1 | "use strict";
|
2 |
|
3 | function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.default = useStyle;
|
9 |
|
10 | var React = _interopRequireWildcard(require("react"));
|
11 |
|
12 | var _cssinjs = require("@ant-design/cssinjs");
|
13 |
|
14 | var _antd = require("antd");
|
15 |
|
16 | var _style = require("antd/lib/style");
|
17 |
|
18 | function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19 |
|
20 | function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21 |
|
22 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
23 |
|
24 | function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
25 |
|
26 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
27 |
|
28 |
|
29 | var genSharedButtonStyle = function genSharedButtonStyle(token) {
|
30 | var _objectSpread2;
|
31 |
|
32 | var componentCls = token.componentCls,
|
33 | colorBgContainer = token.colorBgContainer,
|
34 | fontSize = token.fontSize,
|
35 | fontSizeSM = token.fontSizeSM,
|
36 | padding = token.padding,
|
37 | paddingXS = token.paddingXS,
|
38 | marginSM = token.marginSM,
|
39 | marginXXS = token.marginXXS,
|
40 | controlHeight = token.controlHeight,
|
41 | lineHeightSM = token.lineHeightSM,
|
42 | colorText = token.colorText,
|
43 | colorTextSecondary = token.colorTextSecondary,
|
44 | colorTextTertiary = token.colorTextTertiary,
|
45 | motionDurationSlow = token.motionDurationSlow;
|
46 | return _defineProperty({}, componentCls, _objectSpread(_objectSpread({}, (0, _style.resetComponent)(token)), {}, (_objectSpread2 = {
|
47 | position: 'relative',
|
48 | backgroundColor: colorBgContainer
|
49 | }, _defineProperty(_objectSpread2, "".concat(componentCls, "-inner"), {
|
50 | display: 'flex',
|
51 | paddingBlock: padding
|
52 | }), _defineProperty(_objectSpread2, "".concat(componentCls, "-avatar"), {
|
53 | position: 'relative',
|
54 | flexShrink: 0,
|
55 | marginInlineEnd: marginSM,
|
56 | cursor: 'pointer',
|
57 | img: {
|
58 | width: controlHeight,
|
59 | height: controlHeight,
|
60 | borderRadius: '50%'
|
61 | }
|
62 | }), _defineProperty(_objectSpread2, "".concat(componentCls, "-content"), {
|
63 | position: 'relative',
|
64 | flex: 'auto',
|
65 | minWidth: 0,
|
66 | wordWrap: 'break-word',
|
67 | '&-author': {
|
68 | display: 'flex',
|
69 | flexWrap: 'wrap',
|
70 | justifyContent: 'flex-start',
|
71 | marginBottom: marginXXS,
|
72 | '& > a, & > span': {
|
73 | paddingInlineEnd: paddingXS,
|
74 | fontSize: fontSizeSM,
|
75 | lineHeight: lineHeightSM
|
76 | },
|
77 | '&-name': {
|
78 | color: colorTextSecondary,
|
79 | fontSize: fontSize,
|
80 | transition: "color ".concat(motionDurationSlow),
|
81 | '> *': {
|
82 | color: colorTextSecondary,
|
83 | '&:hover': {
|
84 | color: colorTextSecondary
|
85 | }
|
86 | }
|
87 | },
|
88 | '&-time': {
|
89 | color: colorTextTertiary,
|
90 | whiteSpace: 'nowrap',
|
91 | cursor: 'auto'
|
92 | }
|
93 | },
|
94 | '&-detail p': {
|
95 | whiteSpace: 'pre-wrap',
|
96 | marginBlock: 0
|
97 | }
|
98 | }), _defineProperty(_objectSpread2, "".concat(componentCls, "-actions"), {
|
99 | marginTop: marginSM,
|
100 | marginBottom: 0,
|
101 | paddingInlineStart: 0,
|
102 | '> li': {
|
103 | display: 'inline-block',
|
104 | color: colorTextSecondary,
|
105 | '> span': {
|
106 | marginInlineEnd: marginSM,
|
107 | color: colorTextSecondary,
|
108 | fontSize: fontSizeSM,
|
109 | cursor: 'pointer',
|
110 | transition: "color ".concat(motionDurationSlow),
|
111 | userSelect: 'none',
|
112 | '&:hover': {
|
113 | color: colorText
|
114 | }
|
115 | }
|
116 | }
|
117 | }), _defineProperty(_objectSpread2, "".concat(componentCls, "-nested"), {
|
118 | marginInlineStart: 44
|
119 | }), _objectSpread2)));
|
120 | };
|
121 |
|
122 | function useStyle(prefixCls) {
|
123 | var _antdTheme$useToken = _antd.theme.useToken(),
|
124 | theme = _antdTheme$useToken.theme,
|
125 | token = _antdTheme$useToken.token,
|
126 | hashId = _antdTheme$useToken.hashId;
|
127 |
|
128 | var _React$useContext = React.useContext(_antd.ConfigProvider.ConfigContext),
|
129 | iconPrefixCls = _React$useContext.iconPrefixCls;
|
130 |
|
131 | return [(0, _cssinjs.useStyleRegister)({
|
132 | theme: theme,
|
133 | token: token,
|
134 | hashId: hashId,
|
135 | path: ['compatible', 'Comment', prefixCls, iconPrefixCls]
|
136 | }, function () {
|
137 | var mergedToken = _objectSpread({
|
138 | componentCls: ".".concat(prefixCls)
|
139 | }, token);
|
140 |
|
141 | return [genSharedButtonStyle(mergedToken)];
|
142 | }), hashId];
|
143 | } |
\ | No newline at end of file |