@lobehub/ui 1.10.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/es/ActionIcon/style.js +1 -1
  2. package/es/Highlighter/style.js +1 -2
  3. package/es/Input/index.js +7 -5
  4. package/es/Input/style.js +2 -3
  5. package/es/Markdown/style.js +1 -1
  6. package/es/SearchBar/index.js +2 -1
  7. package/es/Snippet/style.js +1 -2
  8. package/es/StroyBook/style.js +1 -1
  9. package/es/ThemeProvider/index.d.ts +2 -6
  10. package/es/ThemeProvider/index.js +8 -18
  11. package/es/styles/algorithms/generateColorPalette.d.ts +11 -0
  12. package/es/styles/algorithms/generateColorPalette.js +31 -0
  13. package/es/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  14. package/es/styles/{customStylish.js → algorithms/generateCustomStylish.js} +1 -1
  15. package/es/styles/algorithms/generateCustomToken.d.ts +3 -0
  16. package/es/styles/algorithms/generateCustomToken.js +57 -0
  17. package/es/styles/algorithms/generateTheme.d.ts +5 -0
  18. package/es/styles/algorithms/generateTheme.js +18 -0
  19. package/es/styles/colors.d.ts +38 -0
  20. package/es/styles/colors.js +176 -0
  21. package/es/styles/index.d.ts +3 -3
  22. package/es/styles/index.js +3 -3
  23. package/es/styles/theme/base.d.ts +2 -2
  24. package/es/styles/theme/base.js +8 -14
  25. package/es/styles/theme/dark.d.ts +3 -4
  26. package/es/styles/theme/dark.js +40 -71
  27. package/es/styles/theme/light.d.ts +3 -4
  28. package/es/styles/theme/light.js +41 -32
  29. package/es/types/customToken.d.ts +1027 -0
  30. package/es/types/global.d.ts +12 -0
  31. package/es/types/index.d.ts +5 -28
  32. package/es/types/index.js +1 -0
  33. package/lib/ActionIcon/index.js +77 -79
  34. package/lib/ActionIcon/style.js +17 -61
  35. package/lib/Avatar/index.js +62 -67
  36. package/lib/Chat/const.js +6 -27
  37. package/lib/Chat/index.js +24 -28
  38. package/lib/Chat/store/index.js +46 -40
  39. package/lib/Chat/store/initialState.js +6 -27
  40. package/lib/Chat/store/messageReducer.js +51 -58
  41. package/lib/Chat/store/selectors.js +44 -46
  42. package/lib/Chat/store/store.js +242 -115
  43. package/lib/Chat/types.js +4 -16
  44. package/lib/Chat/utils/fetch.js +104 -68
  45. package/lib/ContextMenu/MenuItem/icons.js +48 -66
  46. package/lib/ContextMenu/MenuItem/index.js +73 -66
  47. package/lib/ContextMenu/MenuItem/style.js +19 -89
  48. package/lib/ContextMenu/index.js +194 -178
  49. package/lib/ContextMenu/style.js +17 -85
  50. package/lib/ContextMenu/types/index.js +15 -18
  51. package/lib/ContextMenu/types/menuItem.js +4 -16
  52. package/lib/Conversation/App.js +47 -50
  53. package/lib/Conversation/ChatList/MessageItem/Content.js +98 -93
  54. package/lib/Conversation/ChatList/MessageItem/Toolbar.js +94 -104
  55. package/lib/Conversation/ChatList/MessageItem/index.js +125 -157
  56. package/lib/Conversation/ChatList/index.js +64 -58
  57. package/lib/Conversation/InputArea/ActionBar.js +74 -92
  58. package/lib/Conversation/InputArea/index.js +103 -142
  59. package/lib/Conversation/StoreUpdater.js +28 -48
  60. package/lib/Conversation/index.js +30 -42
  61. package/lib/CopyButton/index.js +37 -62
  62. package/lib/DraggablePanel/index.js +192 -207
  63. package/lib/DraggablePanel/style.js +30 -278
  64. package/lib/DraggablePanel/utils.js +14 -35
  65. package/lib/EditableMessage/index.js +66 -89
  66. package/lib/EditableMessageList/index.js +97 -112
  67. package/lib/EditableText/index.js +36 -49
  68. package/lib/Highlighter/SyntaxHighlighter/Prism.js +43 -38
  69. package/lib/Highlighter/SyntaxHighlighter/index.js +62 -53
  70. package/lib/Highlighter/SyntaxHighlighter/style.js +18 -56
  71. package/lib/Highlighter/index.js +52 -58
  72. package/lib/Highlighter/style.js +22 -102
  73. package/lib/Icon/index.js +29 -36
  74. package/lib/Input/index.js +45 -39
  75. package/lib/Input/style.js +17 -68
  76. package/lib/List/ListItem/index.js +108 -150
  77. package/lib/List/ListItem/time.js +15 -47
  78. package/lib/List/index.js +9 -37
  79. package/lib/Logo/Divider.js +21 -34
  80. package/lib/Logo/Logo3D.js +17 -33
  81. package/lib/Logo/LogoFlat.js +108 -118
  82. package/lib/Logo/LogoHighContrast.js +30 -33
  83. package/lib/Logo/LogoText.js +21 -34
  84. package/lib/Logo/index.js +97 -59
  85. package/lib/Logo/style.js +13 -36
  86. package/lib/Markdown/Code.js +16 -30
  87. package/lib/Markdown/CodeBlock.js +33 -65
  88. package/lib/Markdown/index.js +35 -54
  89. package/lib/Markdown/style.js +15 -125
  90. package/lib/MessageInput/index.js +60 -56
  91. package/lib/MessageModal/index.js +80 -91
  92. package/lib/SearchBar/index.js +86 -72
  93. package/lib/SearchBar/style.js +18 -46
  94. package/lib/SideNav/index.js +43 -31
  95. package/lib/SideNav/style.js +13 -43
  96. package/lib/Snippet/index.js +42 -45
  97. package/lib/Snippet/style.js +13 -72
  98. package/lib/StroyBook/index.js +60 -61
  99. package/lib/StroyBook/style.js +19 -87
  100. package/lib/Swatches/index.js +35 -53
  101. package/lib/TabsNav/index.js +23 -31
  102. package/lib/TabsNav/style.js +17 -60
  103. package/lib/ThemeProvider/GlobalStyle.js +29 -92
  104. package/lib/ThemeProvider/index.d.ts +2 -6
  105. package/lib/ThemeProvider/index.js +44 -69
  106. package/lib/ThemeSwitch/index.js +62 -46
  107. package/lib/Tooltip/index.js +26 -31
  108. package/lib/Tooltip/style.js +13 -49
  109. package/lib/components/ControlInput.js +86 -87
  110. package/lib/hooks/useCopied.js +27 -37
  111. package/lib/hooks/useHighlight.js +65 -70
  112. package/lib/index.js +211 -120
  113. package/lib/styles/algorithms/generateColorPalette.d.ts +11 -0
  114. package/lib/styles/algorithms/generateColorPalette.js +40 -0
  115. package/lib/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
  116. package/lib/styles/algorithms/generateCustomStylish.js +27 -0
  117. package/lib/styles/algorithms/generateCustomToken.d.ts +3 -0
  118. package/lib/styles/algorithms/generateCustomToken.js +65 -0
  119. package/lib/styles/algorithms/generateTheme.d.ts +5 -0
  120. package/lib/styles/algorithms/generateTheme.js +28 -0
  121. package/lib/styles/colors.d.ts +38 -0
  122. package/lib/styles/colors.js +183 -0
  123. package/lib/styles/index.d.ts +3 -3
  124. package/lib/styles/index.js +25 -20
  125. package/lib/styles/theme/base.d.ts +2 -2
  126. package/lib/styles/theme/base.js +17 -44
  127. package/lib/styles/theme/dark.d.ts +3 -4
  128. package/lib/styles/theme/dark.js +45 -119
  129. package/lib/styles/theme/light.d.ts +3 -4
  130. package/lib/styles/theme/light.js +47 -61
  131. package/lib/types/customToken.d.ts +1027 -0
  132. package/lib/types/global.d.ts +12 -0
  133. package/lib/types/index.d.ts +5 -28
  134. package/lib/types/index.js +5 -0
  135. package/lib/utils/colorUtils.js +14 -48
  136. package/package.json +1 -1
  137. package/es/styles/algorithms/colorRelationship.d.ts +0 -6
  138. package/es/styles/algorithms/colorRelationship.js +0 -88
  139. package/es/styles/algorithms/index.d.ts +0 -15
  140. package/es/styles/algorithms/index.js +0 -66
  141. package/es/styles/algorithms/paletteGenerator.d.ts +0 -51
  142. package/es/styles/algorithms/paletteGenerator.js +0 -74
  143. package/es/styles/antdTheme.d.ts +0 -2
  144. package/es/styles/antdTheme.js +0 -4
  145. package/es/styles/customToken.d.ts +0 -65
  146. package/es/styles/customToken.js +0 -24
  147. package/es/styles/theme/index.d.ts +0 -2
  148. package/es/styles/theme/index.js +0 -2
  149. package/lib/styles/algorithms/colorRelationship.d.ts +0 -6
  150. package/lib/styles/algorithms/colorRelationship.js +0 -87
  151. package/lib/styles/algorithms/index.d.ts +0 -15
  152. package/lib/styles/algorithms/index.js +0 -81
  153. package/lib/styles/algorithms/paletteGenerator.d.ts +0 -51
  154. package/lib/styles/algorithms/paletteGenerator.js +0 -91
  155. package/lib/styles/antdTheme.d.ts +0 -2
  156. package/lib/styles/antdTheme.js +0 -30
  157. package/lib/styles/customStylish.js +0 -118
  158. package/lib/styles/customToken.d.ts +0 -65
  159. package/lib/styles/customToken.js +0 -54
  160. package/lib/styles/theme/index.d.ts +0 -2
  161. package/lib/styles/theme/index.js +0 -32
@@ -1,157 +1,115 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
18
2
 
19
- // src/List/ListItem/index.tsx
20
- var ListItem_exports = {};
21
- __export(ListItem_exports, {
22
- default: () => ListItem_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(ListItem_exports);
25
- var import_icons = require("@ant-design/icons");
26
- var import_antd_style = require("antd-style");
27
- var import_react = require("react");
28
- var import_react_layout_kit = require("react-layout-kit");
29
- var import_colorUtils = require("../../utils/colorUtils");
30
- var import_time = require("./time");
31
- var useStyles = (0, import_antd_style.createStyles)(({ css, cx, token }) => {
32
- const textOverlay = css`
33
- --overlay-background: ${token.colorBgLayout};
34
-
35
- position: absolute;
36
- z-index: 10;
37
- top: 0;
38
- right: 0;
39
-
40
- width: 32px;
41
- height: 44px;
42
-
43
- background: linear-gradient(to right, transparent, var(--overlay-background));
44
- `;
45
- const overlayColor = (0, import_colorUtils.convertAlphaToSolid)(token.colorFillContent, token.colorBgLayout);
46
- const hoverOverlay = css`
47
- .${cx(textOverlay)} {
48
- --overlay-background: ${overlayColor};
49
- }
50
- `;
7
+ exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+ var _icons = require("@ant-design/icons");
12
+ var _antdStyle = require("antd-style");
13
+ var _react = require("react");
14
+ var _reactLayoutKit = require("react-layout-kit");
15
+ var _colorUtils = require("../../utils/colorUtils");
16
+ var _time = require("./time");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ var _excluded = ["active", "avatar", "loading", "description", "date", "title", "onHoverChange", "renderActions", "className", "style", "showAction", "classNames"];
19
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
20
+ var useStyles = (0, _antdStyle.createStyles)(function (_ref) {
21
+ var css = _ref.css,
22
+ cx = _ref.cx,
23
+ token = _ref.token;
24
+ var textOverlay = css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n --overlay-background: ", ";\n\n position: absolute;\n z-index: 10;\n top: 0;\n right: 0;\n\n width: 32px;\n height: 44px;\n\n background: linear-gradient(to right, transparent, var(--overlay-background));\n "])), token.colorBgLayout);
25
+ var overlayColor = (0, _colorUtils.convertAlphaToSolid)(token.colorFillContent, token.colorBgLayout);
26
+ var hoverOverlay = css(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n --overlay-background: ", ";\n }\n "])), cx(textOverlay), overlayColor);
51
27
  return {
52
- container: css`
53
- cursor: pointer;
54
- color: ${token.colorTextTertiary};
55
- border-radius: 8px;
56
-
57
- &:hover {
58
- background: ${token.colorFillContent};
59
- ${hoverOverlay}
60
- }
61
- `,
62
- active: css`
63
- color: ${token.colorText};
64
- background: ${token.colorFillContent};
65
-
66
- ${hoverOverlay}
67
- `,
68
- content: css`
69
- position: relative;
70
- overflow: hidden;
71
- flex: 1;
72
- `,
73
- title: css`
74
- overflow: hidden;
75
-
76
- width: 100%;
77
-
78
- font-size: 0.9em;
79
- text-overflow: ellipsis;
80
- white-space: nowrap;
81
- `,
82
- time: css`
83
- font-size: 12px;
84
- color: ${token.colorTextPlaceholder};
85
- `,
86
- desc: css`
87
- overflow: hidden;
88
-
89
- width: 100%;
90
- margin-top: 2px;
91
-
92
- font-size: 0.75em;
93
- text-overflow: ellipsis;
94
- white-space: nowrap;
95
-
96
- opacity: 0.5;
97
- `,
98
- textOverlay
28
+ container: css(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n cursor: pointer;\n color: ", ";\n border-radius: 8px;\n\n &:hover {\n background: ", ";\n ", "\n }\n "])), token.colorTextTertiary, token.colorFillContent, hoverOverlay),
29
+ active: css(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n background: ", ";\n\n ", "\n "])), token.colorText, token.colorFillContent, hoverOverlay),
30
+ content: css(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow: hidden;\n flex: 1;\n "]))),
31
+ title: css(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n\n width: 100%;\n\n font-size: 0.9em;\n text-overflow: ellipsis;\n white-space: nowrap;\n "]))),
32
+ time: css(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 12px;\n color: ", ";\n "])), token.colorTextPlaceholder),
33
+ desc: css(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n\n width: 100%;\n margin-top: 2px;\n\n font-size: 0.75em;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n opacity: 0.5;\n "]))),
34
+ textOverlay: textOverlay
99
35
  };
100
36
  });
101
- var ListItem = (0, import_react.forwardRef)(
102
- ({
103
- active,
104
- avatar,
105
- loading,
106
- description,
107
- date,
108
- title,
109
- onHoverChange,
110
- renderActions,
111
- className,
112
- style,
113
- showAction,
114
- classNames = {},
115
- ...props
116
- }, ref) => {
117
- const { styles, cx } = useStyles();
118
- return /* @__PURE__ */ React.createElement(
119
- import_react_layout_kit.Flexbox,
120
- {
121
- ref,
37
+
38
+ /**
39
+ * 卡片列表项的属性
40
+ */
41
+
42
+ var ListItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
43
+ var active = _ref2.active,
44
+ avatar = _ref2.avatar,
45
+ loading = _ref2.loading,
46
+ description = _ref2.description,
47
+ date = _ref2.date,
48
+ title = _ref2.title,
49
+ onHoverChange = _ref2.onHoverChange,
50
+ renderActions = _ref2.renderActions,
51
+ className = _ref2.className,
52
+ style = _ref2.style,
53
+ showAction = _ref2.showAction,
54
+ _ref2$classNames = _ref2.classNames,
55
+ classNames = _ref2$classNames === void 0 ? {} : _ref2$classNames,
56
+ props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
57
+ var _useStyles = useStyles(),
58
+ styles = _useStyles.styles,
59
+ cx = _useStyles.cx;
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactLayoutKit.Flexbox, (0, _objectSpread2.default)((0, _objectSpread2.default)({
61
+ ref: ref,
62
+ horizontal: true,
63
+ paddingBlock: 8,
64
+ gap: 8,
65
+ paddingInline: '12px 8px',
66
+ align: 'flex-start',
67
+ distribution: 'space-between',
68
+ className: cx(styles.container, active && styles.active, className),
69
+ style: style
70
+ }, props), {}, {
71
+ onMouseEnter: function onMouseEnter() {
72
+ onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(true);
73
+ },
74
+ onMouseLeave: function onMouseLeave() {
75
+ onHoverChange === null || onHoverChange === void 0 ? void 0 : onHoverChange(false);
76
+ },
77
+ children: [avatar !== null && avatar !== void 0 ? avatar : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.MessageOutlined, {
78
+ style: {
79
+ marginTop: 4
80
+ }
81
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactLayoutKit.Flexbox, {
82
+ className: styles.content,
83
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
122
84
  horizontal: true,
123
- paddingBlock: 8,
124
- gap: 8,
125
- paddingInline: "12px 8px",
126
- align: "flex-start",
127
- distribution: "space-between",
128
- className: cx(styles.container, active && styles.active, className),
129
- style,
130
- ...props,
131
- onMouseEnter: () => {
132
- onHoverChange == null ? void 0 : onHoverChange(true);
133
- },
134
- onMouseLeave: () => {
135
- onHoverChange == null ? void 0 : onHoverChange(false);
136
- }
85
+ distribution: 'space-between',
86
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
+ className: styles.title,
88
+ children: title
89
+ })
90
+ }), description && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
91
+ className: styles.desc,
92
+ children: description
93
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
94
+ className: styles.textOverlay
95
+ })]
96
+ }), loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.LoadingOutlined, {
97
+ spin: true
98
+ }) : showAction ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
99
+ horizontal: true,
100
+ gap: 4,
101
+ style: {
102
+ display: showAction ? undefined : 'none'
137
103
  },
138
- avatar ?? /* @__PURE__ */ React.createElement(import_icons.MessageOutlined, { style: { marginTop: 4 } }),
139
- /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { className: styles.content }, /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, distribution: "space-between" }, /* @__PURE__ */ React.createElement("div", { className: styles.title }, title)), description && /* @__PURE__ */ React.createElement("div", { className: styles.desc }, description), /* @__PURE__ */ React.createElement("div", { className: styles.textOverlay })),
140
- loading ? /* @__PURE__ */ React.createElement(import_icons.LoadingOutlined, { spin: true }) : showAction ? /* @__PURE__ */ React.createElement(
141
- import_react_layout_kit.Flexbox,
142
- {
143
- horizontal: true,
144
- gap: 4,
145
- style: { display: showAction ? void 0 : "none" },
146
- onClick: (e) => {
147
- e.stopPropagation();
148
- }
149
- },
150
- renderActions
151
- ) : date && /* @__PURE__ */ React.createElement("div", { className: cx(styles.time, classNames.time) }, (0, import_time.getChatItemTime)(date))
152
- );
153
- }
154
- );
155
- var ListItem_default = ListItem;
156
- // Annotate the CommonJS export names for ESM import in node:
157
- 0 && (module.exports = {});
104
+ onClick: function onClick(e) {
105
+ e.stopPropagation();
106
+ },
107
+ children: renderActions
108
+ }) : date && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
109
+ className: cx(styles.time, classNames.time),
110
+ children: (0, _time.getChatItemTime)(date)
111
+ })]
112
+ }));
113
+ });
114
+ var _default = ListItem;
115
+ exports.default = _default;
@@ -1,50 +1,18 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/List/ListItem/time.ts
30
- var time_exports = {};
31
- __export(time_exports, {
32
- getChatItemTime: () => getChatItemTime
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
33
6
  });
34
- module.exports = __toCommonJS(time_exports);
35
- var import_dayjs = __toESM(require("dayjs"));
36
- var import_zh_cn = require("dayjs/locale/zh-cn");
37
- import_dayjs.default.locale("zh-cn");
38
- var getChatItemTime = (updateAt) => {
39
- const time = (0, import_dayjs.default)(updateAt);
40
- const diff = (0, import_dayjs.default)().day() - time.day();
41
- if (time.isSame((0, import_dayjs.default)(), "day"))
42
- return time.format("HH:mm");
43
- if (diff === 1)
44
- return "昨天";
45
- return time.format("MM-DD");
7
+ exports.getChatItemTime = void 0;
8
+ var _dayjs = _interopRequireDefault(require("dayjs"));
9
+ require("dayjs/locale/zh-cn");
10
+ _dayjs.default.locale('zh-cn');
11
+ var getChatItemTime = function getChatItemTime(updateAt) {
12
+ var time = (0, _dayjs.default)(updateAt);
13
+ var diff = (0, _dayjs.default)().day() - time.day();
14
+ if (time.isSame((0, _dayjs.default)(), 'day')) return time.format('HH:mm');
15
+ if (diff === 1) return '昨天';
16
+ return time.format('MM-DD');
46
17
  };
47
- // Annotate the CommonJS export names for ESM import in node:
48
- 0 && (module.exports = {
49
- getChatItemTime
50
- });
18
+ exports.getChatItemTime = getChatItemTime;
package/lib/List/index.js CHANGED
@@ -1,41 +1,13 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/List/index.ts
30
- var List_exports = {};
31
- __export(List_exports, {
32
- default: () => List_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
33
6
  });
34
- module.exports = __toCommonJS(List_exports);
35
- var import_ListItem = __toESM(require("./ListItem"));
7
+ exports.default = void 0;
8
+ var _ListItem = _interopRequireDefault(require("./ListItem"));
36
9
  var List = {
37
- Item: import_ListItem.default
10
+ Item: _ListItem.default
38
11
  };
39
- var List_default = List;
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {});
12
+ var _default = List;
13
+ exports.default = _default;
@@ -1,41 +1,28 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
18
2
 
19
- // src/Logo/Divider.tsx
20
- var Divider_exports = {};
21
- __export(Divider_exports, {
22
- default: () => Divider_default
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
23
6
  });
24
- module.exports = __toCommonJS(Divider_exports);
25
- var import_react = require("react");
26
- var Divider = (0, import_react.memo)(({ ...props }) => /* @__PURE__ */ React.createElement(
27
- "svg",
28
- {
7
+ exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
10
+ var _react = require("react");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ var Divider = /*#__PURE__*/(0, _react.memo)(function (_ref) {
13
+ var props = Object.assign({}, ((0, _objectDestructuringEmpty2.default)(_ref), _ref));
14
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", (0, _objectSpread2.default)((0, _objectSpread2.default)({
29
15
  fill: "none",
30
16
  stroke: "currentColor",
31
17
  strokeLinecap: "round",
32
18
  strokeLinejoin: "round",
33
19
  shapeRendering: "geometricPrecision",
34
- viewBox: "0 0 24 24",
35
- ...props
36
- },
37
- /* @__PURE__ */ React.createElement("path", { d: "M16.88 3.549L7.12 20.451" })
38
- ));
39
- var Divider_default = Divider;
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {});
20
+ viewBox: "0 0 24 24"
21
+ }, props), {}, {
22
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
23
+ d: "M16.88 3.549L7.12 20.451"
24
+ })
25
+ }));
26
+ });
27
+ var _default = Divider;
28
+ exports.default = _default;