@lobehub/ui 1.11.0 → 1.11.2

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 (183) hide show
  1. package/package.json +1 -1
  2. package/lib/ActionIcon/index.d.ts +0 -49
  3. package/lib/ActionIcon/index.js +0 -82
  4. package/lib/ActionIcon/style.d.ts +0 -6
  5. package/lib/ActionIcon/style.js +0 -64
  6. package/lib/Avatar/index.d.ts +0 -10
  7. package/lib/Avatar/index.js +0 -74
  8. package/lib/Chat/const.d.ts +0 -1
  9. package/lib/Chat/const.js +0 -29
  10. package/lib/Chat/index.d.ts +0 -2
  11. package/lib/Chat/index.js +0 -31
  12. package/lib/Chat/store/index.d.ts +0 -20
  13. package/lib/Chat/store/index.js +0 -44
  14. package/lib/Chat/store/initialState.d.ts +0 -28
  15. package/lib/Chat/store/initialState.js +0 -37
  16. package/lib/Chat/store/messageReducer.d.ts +0 -37
  17. package/lib/Chat/store/messageReducer.js +0 -82
  18. package/lib/Chat/store/selectors.d.ts +0 -9
  19. package/lib/Chat/store/selectors.js +0 -53
  20. package/lib/Chat/store/store.d.ts +0 -34
  21. package/lib/Chat/store/store.js +0 -119
  22. package/lib/Chat/types.d.ts +0 -77
  23. package/lib/Chat/types.js +0 -17
  24. package/lib/Chat/utils/fetch.d.ts +0 -11
  25. package/lib/Chat/utils/fetch.js +0 -72
  26. package/lib/ContextMenu/MenuItem/icons.d.ts +0 -4
  27. package/lib/ContextMenu/MenuItem/icons.js +0 -100
  28. package/lib/ContextMenu/MenuItem/index.d.ts +0 -12
  29. package/lib/ContextMenu/MenuItem/index.js +0 -72
  30. package/lib/ContextMenu/MenuItem/style.d.ts +0 -7
  31. package/lib/ContextMenu/MenuItem/style.js +0 -94
  32. package/lib/ContextMenu/index.d.ts +0 -9
  33. package/lib/ContextMenu/index.js +0 -254
  34. package/lib/ContextMenu/style.d.ts +0 -4
  35. package/lib/ContextMenu/style.js +0 -88
  36. package/lib/ContextMenu/types/index.d.ts +0 -5
  37. package/lib/ContextMenu/types/index.js +0 -19
  38. package/lib/ContextMenu/types/menuItem.d.ts +0 -21
  39. package/lib/ContextMenu/types/menuItem.js +0 -17
  40. package/lib/Conversation/App.d.ts +0 -13
  41. package/lib/Conversation/App.js +0 -53
  42. package/lib/Conversation/ChatList/MessageItem/Content.d.ts +0 -8
  43. package/lib/Conversation/ChatList/MessageItem/Content.js +0 -104
  44. package/lib/Conversation/ChatList/MessageItem/Toolbar.d.ts +0 -10
  45. package/lib/Conversation/ChatList/MessageItem/Toolbar.js +0 -110
  46. package/lib/Conversation/ChatList/MessageItem/index.d.ts +0 -9
  47. package/lib/Conversation/ChatList/MessageItem/index.js +0 -164
  48. package/lib/Conversation/ChatList/index.d.ts +0 -14
  49. package/lib/Conversation/ChatList/index.js +0 -61
  50. package/lib/Conversation/InputArea/ActionBar.d.ts +0 -4
  51. package/lib/Conversation/InputArea/ActionBar.js +0 -97
  52. package/lib/Conversation/InputArea/index.d.ts +0 -4
  53. package/lib/Conversation/InputArea/index.js +0 -148
  54. package/lib/Conversation/StoreUpdater.d.ts +0 -7
  55. package/lib/Conversation/StoreUpdater.js +0 -52
  56. package/lib/Conversation/index.d.ts +0 -8
  57. package/lib/Conversation/index.js +0 -45
  58. package/lib/CopyButton/index.d.ts +0 -26
  59. package/lib/CopyButton/index.js +0 -66
  60. package/lib/DraggablePanel/index.d.ts +0 -92
  61. package/lib/DraggablePanel/index.js +0 -217
  62. package/lib/DraggablePanel/style.d.ts +0 -18
  63. package/lib/DraggablePanel/style.js +0 -286
  64. package/lib/DraggablePanel/utils.d.ts +0 -2
  65. package/lib/DraggablePanel/utils.js +0 -40
  66. package/lib/EditableMessage/index.d.ts +0 -43
  67. package/lib/EditableMessage/index.js +0 -96
  68. package/lib/EditableMessageList/index.d.ts +0 -9
  69. package/lib/EditableMessageList/index.js +0 -124
  70. package/lib/EditableText/index.d.ts +0 -5
  71. package/lib/EditableText/index.js +0 -56
  72. package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +0 -7
  73. package/lib/Highlighter/SyntaxHighlighter/Prism.js +0 -41
  74. package/lib/Highlighter/SyntaxHighlighter/index.d.ts +0 -5
  75. package/lib/Highlighter/SyntaxHighlighter/index.js +0 -55
  76. package/lib/Highlighter/SyntaxHighlighter/style.d.ts +0 -5
  77. package/lib/Highlighter/SyntaxHighlighter/style.js +0 -61
  78. package/lib/Highlighter/index.d.ts +0 -36
  79. package/lib/Highlighter/index.js +0 -62
  80. package/lib/Highlighter/style.d.ts +0 -5
  81. package/lib/Highlighter/style.js +0 -104
  82. package/lib/Icon/index.d.ts +0 -21
  83. package/lib/Icon/index.js +0 -52
  84. package/lib/Input/index.d.ts +0 -13
  85. package/lib/Input/index.js +0 -45
  86. package/lib/Input/style.d.ts +0 -6
  87. package/lib/Input/style.js +0 -70
  88. package/lib/List/ListItem/index.d.ts +0 -64
  89. package/lib/List/ListItem/index.js +0 -157
  90. package/lib/List/ListItem/time.d.ts +0 -2
  91. package/lib/List/ListItem/time.js +0 -50
  92. package/lib/List/index.d.ts +0 -5
  93. package/lib/List/index.js +0 -41
  94. package/lib/Logo/Divider.d.ts +0 -3
  95. package/lib/Logo/Divider.js +0 -41
  96. package/lib/Logo/Logo3D.d.ts +0 -3
  97. package/lib/Logo/Logo3D.js +0 -35
  98. package/lib/Logo/LogoFlat.d.ts +0 -3
  99. package/lib/Logo/LogoFlat.js +0 -120
  100. package/lib/Logo/LogoHighContrast.d.ts +0 -3
  101. package/lib/Logo/LogoHighContrast.js +0 -35
  102. package/lib/Logo/LogoText.d.ts +0 -3
  103. package/lib/Logo/LogoText.js +0 -39
  104. package/lib/Logo/index.d.ts +0 -20
  105. package/lib/Logo/index.js +0 -64
  106. package/lib/Logo/style.d.ts +0 -4
  107. package/lib/Logo/style.js +0 -41
  108. package/lib/Markdown/Code.d.ts +0 -3
  109. package/lib/Markdown/Code.js +0 -33
  110. package/lib/Markdown/CodeBlock.d.ts +0 -3
  111. package/lib/Markdown/CodeBlock.js +0 -68
  112. package/lib/Markdown/index.d.ts +0 -13
  113. package/lib/Markdown/index.js +0 -58
  114. package/lib/Markdown/style.d.ts +0 -4
  115. package/lib/Markdown/style.js +0 -134
  116. package/lib/MessageInput/index.d.ts +0 -37
  117. package/lib/MessageInput/index.js +0 -59
  118. package/lib/MessageModal/index.d.ts +0 -11
  119. package/lib/MessageModal/index.js +0 -98
  120. package/lib/SearchBar/index.d.ts +0 -8
  121. package/lib/SearchBar/index.js +0 -77
  122. package/lib/SearchBar/style.d.ts +0 -6
  123. package/lib/SearchBar/style.js +0 -49
  124. package/lib/SideNav/index.d.ts +0 -18
  125. package/lib/SideNav/index.js +0 -34
  126. package/lib/SideNav/style.d.ts +0 -1
  127. package/lib/SideNav/style.js +0 -46
  128. package/lib/Snippet/index.d.ts +0 -29
  129. package/lib/Snippet/index.js +0 -47
  130. package/lib/Snippet/style.d.ts +0 -1
  131. package/lib/Snippet/style.js +0 -74
  132. package/lib/StroyBook/index.d.ts +0 -17
  133. package/lib/StroyBook/index.js +0 -65
  134. package/lib/StroyBook/style.d.ts +0 -8
  135. package/lib/StroyBook/style.js +0 -90
  136. package/lib/Swatches/index.d.ts +0 -8
  137. package/lib/Swatches/index.js +0 -68
  138. package/lib/TabsNav/index.d.ts +0 -22
  139. package/lib/TabsNav/index.js +0 -34
  140. package/lib/TabsNav/style.d.ts +0 -3
  141. package/lib/TabsNav/style.js +0 -65
  142. package/lib/ThemeProvider/GlobalStyle.d.ts +0 -3
  143. package/lib/ThemeProvider/GlobalStyle.js +0 -94
  144. package/lib/ThemeProvider/index.d.ts +0 -22
  145. package/lib/ThemeProvider/index.js +0 -60
  146. package/lib/ThemeSwitch/index.d.ts +0 -27
  147. package/lib/ThemeSwitch/index.js +0 -50
  148. package/lib/Tooltip/index.d.ts +0 -5
  149. package/lib/Tooltip/index.js +0 -34
  150. package/lib/Tooltip/style.d.ts +0 -3
  151. package/lib/Tooltip/style.js +0 -54
  152. package/lib/components/ControlInput.d.ts +0 -9
  153. package/lib/components/ControlInput.js +0 -91
  154. package/lib/hooks/useCopied.d.ts +0 -4
  155. package/lib/hooks/useCopied.js +0 -44
  156. package/lib/hooks/useHighlight.d.ts +0 -36
  157. package/lib/hooks/useHighlight.js +0 -76
  158. package/lib/index.d.ts +0 -27
  159. package/lib/index.js +0 -122
  160. package/lib/styles/algorithms/generateColorPalette.d.ts +0 -11
  161. package/lib/styles/algorithms/generateColorPalette.js +0 -72
  162. package/lib/styles/algorithms/generateCustomStylish.d.ts +0 -17
  163. package/lib/styles/algorithms/generateCustomStylish.js +0 -122
  164. package/lib/styles/algorithms/generateCustomToken.d.ts +0 -3
  165. package/lib/styles/algorithms/generateCustomToken.js +0 -79
  166. package/lib/styles/algorithms/generateTheme.d.ts +0 -5
  167. package/lib/styles/algorithms/generateTheme.js +0 -59
  168. package/lib/styles/colors.d.ts +0 -38
  169. package/lib/styles/colors.js +0 -1828
  170. package/lib/styles/index.d.ts +0 -3
  171. package/lib/styles/index.js +0 -35
  172. package/lib/styles/theme/base.d.ts +0 -2
  173. package/lib/styles/theme/base.js +0 -41
  174. package/lib/styles/theme/dark.d.ts +0 -3
  175. package/lib/styles/theme/dark.js +0 -74
  176. package/lib/styles/theme/light.d.ts +0 -3
  177. package/lib/styles/theme/light.js +0 -74
  178. package/lib/types/customToken.d.ts +0 -1027
  179. package/lib/types/global.d.ts +0 -12
  180. package/lib/types/index.d.ts +0 -6
  181. package/lib/types/index.js +0 -17
  182. package/lib/utils/colorUtils.d.ts +0 -1
  183. package/lib/utils/colorUtils.js +0 -52
@@ -1,286 +0,0 @@
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);
18
-
19
- // src/DraggablePanel/style.ts
20
- var style_exports = {};
21
- __export(style_exports, {
22
- useStyle: () => useStyle
23
- });
24
- module.exports = __toCommonJS(style_exports);
25
- var import_antd_style = require("antd-style");
26
- var offset = 16;
27
- var toggleLength = 40;
28
- var toggleShort = 16;
29
- var useStyle = (0, import_antd_style.createStyles)(({ token }, prefix) => {
30
- const commonHandle = import_antd_style.css`
31
- position: relative;
32
- &::before {
33
- content: '';
34
- position: absolute;
35
- z-index: 50;
36
- transition: all 0.2s ${token.motionEaseOut};
37
- }
38
-
39
- &:hover,
40
- &:active {
41
- &::before {
42
- background: ${token.colorPrimary};
43
- }
44
- }
45
- `;
46
- const commonToggle = import_antd_style.css`
47
- position: absolute;
48
- z-index: 1001;
49
- opacity: 0;
50
- transition: all 0.2s ${token.motionEaseOut};
51
-
52
- &:hover {
53
- opacity: 1 !important;
54
- }
55
-
56
- &:active {
57
- opacity: 1 !important;
58
- }
59
-
60
- > div {
61
- cursor: pointer;
62
-
63
- position: absolute;
64
-
65
- color: ${token.colorTextTertiary};
66
-
67
- background: ${token.colorFillTertiary};
68
- border-color: ${token.colorBorderSecondary};
69
- border-style: solid;
70
- border-width: 1px;
71
- border-radius: 4px;
72
-
73
- transition: all 0.2s ${token.motionEaseOut};
74
-
75
- &:hover {
76
- color: ${token.colorTextSecondary};
77
- background: ${token.colorFillSecondary};
78
- }
79
-
80
- &:active {
81
- color: ${token.colorText};
82
- background: ${token.colorFill};
83
- }
84
- }
85
- `;
86
- const float = import_antd_style.css`
87
- position: absolute;
88
- z-index: 2000;
89
- `;
90
- return {
91
- container: (0, import_antd_style.cx)(
92
- prefix,
93
- import_antd_style.css`
94
- flex-shrink: 0;
95
- border: 0 solid ${token.colorBorderSecondary};
96
-
97
- &:hover {
98
- .${prefix}-toggle {
99
- opacity: 1;
100
- }
101
- }
102
- `
103
- ),
104
- fixed: import_antd_style.css`
105
- position: relative;
106
- `,
107
- leftFloat: (0, import_antd_style.cx)(
108
- float,
109
- import_antd_style.css`
110
- top: 0;
111
- bottom: 0;
112
- left: 0;
113
- height: 100%;
114
- `
115
- ),
116
- rightFloat: (0, import_antd_style.cx)(
117
- float,
118
- import_antd_style.css`
119
- top: 0;
120
- right: 0;
121
- bottom: 0;
122
- height: 100%;
123
- `
124
- ),
125
- topFloat: (0, import_antd_style.cx)(
126
- float,
127
- import_antd_style.css`
128
- top: 0;
129
- right: 0;
130
- left: 0;
131
- width: 100%;
132
- `
133
- ),
134
- bottomFloat: (0, import_antd_style.cx)(
135
- float,
136
- import_antd_style.css`
137
- right: 0;
138
- bottom: 0;
139
- left: 0;
140
- width: 100%;
141
- `
142
- ),
143
- toggleLeft: (0, import_antd_style.cx)(
144
- `${prefix}-toggle`,
145
- `${prefix}-toggle-left`,
146
- commonToggle,
147
- import_antd_style.css`
148
- left: -${offset}px;
149
- width: ${toggleShort}px;
150
- height: 100%;
151
- > div {
152
- top: 50%;
153
-
154
- width: ${toggleShort}px;
155
- height: ${toggleLength}px;
156
- margin-top: -20px;
157
-
158
- border-radius: 4px 0 0 4px;
159
- }
160
- `
161
- ),
162
- toggleRight: (0, import_antd_style.cx)(
163
- `${prefix}-toggle`,
164
- `${prefix}-toggle-right`,
165
- commonToggle,
166
- import_antd_style.css`
167
- right: -${offset}px;
168
- width: ${toggleShort}px;
169
- height: 100%;
170
- > div {
171
- top: 50%;
172
-
173
- width: ${toggleShort}px;
174
- height: ${toggleLength}px;
175
- margin-top: -20px;
176
-
177
- border-radius: 0 4px 4px 0;
178
- }
179
- `
180
- ),
181
- toggleTop: (0, import_antd_style.cx)(
182
- `${prefix}-toggle`,
183
- `${prefix}-toggle-top`,
184
- commonToggle,
185
- import_antd_style.css`
186
- top: -${offset}px;
187
- width: 100%;
188
- height: ${toggleShort}px;
189
-
190
- > div {
191
- left: 50%;
192
-
193
- width: ${toggleLength}px;
194
- height: ${toggleShort}px;
195
- margin-left: -20px;
196
-
197
- border-radius: 4px 4px 0 0;
198
- }
199
- `
200
- ),
201
- toggleBottom: (0, import_antd_style.cx)(
202
- `${prefix}-toggle`,
203
- `${prefix}-toggle-bottom`,
204
- commonToggle,
205
- import_antd_style.css`
206
- bottom: -${offset}px;
207
- width: 100%;
208
- height: ${toggleShort}px;
209
-
210
- > div {
211
- left: 50%;
212
-
213
- width: ${toggleLength}px;
214
- height: 16px;
215
- margin-left: -20px;
216
-
217
- border-radius: 0 0 4px 4px;
218
- }
219
- `
220
- ),
221
- panel: (0, import_antd_style.cx)(
222
- `${prefix}-fixed`,
223
- import_antd_style.css`
224
- overflow: hidden;
225
- transition: all 0.2s ${token.motionEaseOut};
226
- `
227
- ),
228
- handlerIcon: import_antd_style.css`
229
- display: flex;
230
- align-items: center;
231
- justify-content: center;
232
- transition: all 0.2s ${token.motionEaseOut};
233
- `,
234
- leftHandle: (0, import_antd_style.cx)(
235
- import_antd_style.css`
236
- ${commonHandle};
237
-
238
- &::before {
239
- left: 50%;
240
- width: 2px;
241
- height: 100%;
242
- }
243
- `,
244
- `${prefix}-left-handle`
245
- ),
246
- rightHandle: (0, import_antd_style.cx)(
247
- import_antd_style.css`
248
- ${commonHandle};
249
- &::before {
250
- right: 50%;
251
- width: 2px;
252
- height: 100%;
253
- }
254
- `,
255
- `${prefix}-right-handle`
256
- ),
257
- topHandle: (0, import_antd_style.cx)(
258
- `${prefix}-top-handle`,
259
- import_antd_style.css`
260
- ${commonHandle};
261
-
262
- &::before {
263
- top: 50%;
264
- width: 100%;
265
- height: 2px;
266
- }
267
- `
268
- ),
269
- bottomHandle: (0, import_antd_style.cx)(
270
- `${prefix}-bottom-handle`,
271
- import_antd_style.css`
272
- ${commonHandle};
273
-
274
- &::before {
275
- bottom: 50%;
276
- width: 100%;
277
- height: 2px;
278
- }
279
- `
280
- )
281
- };
282
- });
283
- // Annotate the CommonJS export names for ESM import in node:
284
- 0 && (module.exports = {
285
- useStyle
286
- });
@@ -1,2 +0,0 @@
1
- import { placementType } from './index';
2
- export declare const revesePlacement: (placement: placementType) => "left" | "right" | "bottom" | "top";
@@ -1,40 +0,0 @@
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);
18
-
19
- // src/DraggablePanel/utils.ts
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- revesePlacement: () => revesePlacement
23
- });
24
- module.exports = __toCommonJS(utils_exports);
25
- var revesePlacement = (placement) => {
26
- switch (placement) {
27
- case "bottom":
28
- return "top";
29
- case "top":
30
- return "bottom";
31
- case "right":
32
- return "left";
33
- case "left":
34
- return "right";
35
- }
36
- };
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- revesePlacement
40
- });
@@ -1,43 +0,0 @@
1
- /// <reference types="react" />
2
- export interface EditableMessageProps {
3
- /**
4
- * @title 当前文本值
5
- */
6
- value: string;
7
- /**
8
- * @title 值改变时的回调函数
9
- * @param value - 改变后的值
10
- */
11
- onChange?: (value: string) => void;
12
- /**
13
- * @title 是否打开模态框
14
- * @default false
15
- */
16
- openModal?: boolean;
17
- /**
18
- * @title 模态框打开状态变化的回调函数
19
- * @param open - 模态框是否打开
20
- */
21
- onOpenChange?: (open: boolean) => void;
22
- /**
23
- * @title 是否处于编辑状态
24
- * @default false
25
- */
26
- editing?: boolean;
27
- /**
28
- * @title 编辑状态变化的回调函数
29
- * @param editing - 是否处于编辑状态
30
- */
31
- onEditingChange?: (editing: boolean) => void;
32
- /**
33
- * @title 当文本值为空时是否显示编辑按钮
34
- * @default false
35
- */
36
- showEditWhenEmpty?: boolean;
37
- classNames?: {
38
- markdown?: string;
39
- input?: string;
40
- };
41
- }
42
- declare const EditableMessage: import("react").NamedExoticComponent<EditableMessageProps>;
43
- export default EditableMessage;
@@ -1,96 +0,0 @@
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);
28
-
29
- // src/EditableMessage/index.tsx
30
- var EditableMessage_exports = {};
31
- __export(EditableMessage_exports, {
32
- default: () => EditableMessage_default
33
- });
34
- module.exports = __toCommonJS(EditableMessage_exports);
35
- var import_Markdown = __toESM(require("../Markdown"));
36
- var import_MessageInput = __toESM(require("../MessageInput"));
37
- var import_MessageModal = __toESM(require("../MessageModal"));
38
- var import_react = require("react");
39
- var import_use_merge_value = __toESM(require("use-merge-value"));
40
- var EditableMessage = (0, import_react.memo)(
41
- ({
42
- value,
43
- onChange,
44
- classNames = {},
45
- onEditingChange,
46
- editing,
47
- openModal,
48
- onOpenChange,
49
- showEditWhenEmpty = false
50
- }) => {
51
- const [isEdit, setTyping] = (0, import_use_merge_value.default)(false, {
52
- value: editing,
53
- onChange: onEditingChange
54
- });
55
- const [expand, setExpand] = (0, import_use_merge_value.default)(false, {
56
- value: openModal,
57
- onChange: onOpenChange
58
- });
59
- return !value && showEditWhenEmpty ? /* @__PURE__ */ React.createElement(
60
- import_MessageInput.default,
61
- {
62
- onConfirm: (text) => {
63
- onChange == null ? void 0 : onChange(text);
64
- setTyping(false);
65
- },
66
- className: classNames.input
67
- }
68
- ) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
69
- import_MessageModal.default,
70
- {
71
- open: expand,
72
- onOpenChange: setExpand,
73
- value,
74
- editing: isEdit,
75
- onEditingChange: setTyping,
76
- onChange: (text) => {
77
- onChange == null ? void 0 : onChange(text);
78
- }
79
- }
80
- ), !expand && isEdit ? /* @__PURE__ */ React.createElement(
81
- import_MessageInput.default,
82
- {
83
- onConfirm: (text) => {
84
- onChange == null ? void 0 : onChange(text);
85
- setTyping(false);
86
- },
87
- onCancel: () => setTyping(false),
88
- defaultValue: value,
89
- className: classNames.input
90
- }
91
- ) : /* @__PURE__ */ React.createElement(import_Markdown.default, { className: classNames.markdown }, value));
92
- }
93
- );
94
- var EditableMessage_default = EditableMessage;
95
- // Annotate the CommonJS export names for ESM import in node:
96
- 0 && (module.exports = {});
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { ChatMessage } from "../Chat";
3
- export interface EditableMessageListProps {
4
- dataSources: ChatMessage[];
5
- onChange?: (chatMessages: ChatMessage[]) => void;
6
- disabled?: boolean;
7
- }
8
- export declare const EditableMessageList: import("react").NamedExoticComponent<EditableMessageListProps>;
9
- export default EditableMessageList;
@@ -1,124 +0,0 @@
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);
28
-
29
- // src/EditableMessageList/index.tsx
30
- var EditableMessageList_exports = {};
31
- __export(EditableMessageList_exports, {
32
- EditableMessageList: () => EditableMessageList,
33
- default: () => EditableMessageList_default
34
- });
35
- module.exports = __toCommonJS(EditableMessageList_exports);
36
- var import_ActionIcon = __toESM(require("../ActionIcon"));
37
- var import_Chat = require("../Chat");
38
- var import_ControlInput = require("../components/ControlInput");
39
- var import_icons = require("@ant-design/icons");
40
- var import_antd = require("antd");
41
- var import_fast_deep_equal = __toESM(require("fast-deep-equal"));
42
- var import_lucide_react = require("lucide-react");
43
- var import_react = require("react");
44
- var import_react_layout_kit = require("react-layout-kit");
45
- var EditableMessageList = (0, import_react.memo)(
46
- ({ disabled, dataSources, onChange }) => {
47
- const [chatMessages, dispatch] = (0, import_react.useReducer)(import_Chat.messagesReducer, dataSources);
48
- (0, import_react.useEffect)(() => {
49
- if (!(0, import_fast_deep_equal.default)(dataSources, chatMessages)) {
50
- onChange == null ? void 0 : onChange(chatMessages);
51
- }
52
- }, [chatMessages]);
53
- return !dataSources ? null : /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { gap: 12 }, chatMessages.map((item, index) => /* @__PURE__ */ React.createElement(
54
- import_react_layout_kit.Flexbox,
55
- {
56
- horizontal: true,
57
- gap: 8,
58
- width: "100%",
59
- align: "center",
60
- key: `${index}-${item.content}`
61
- },
62
- /* @__PURE__ */ React.createElement(
63
- import_antd.Select,
64
- {
65
- value: item.role,
66
- style: { width: 120 },
67
- dropdownStyle: { zIndex: 100 },
68
- disabled,
69
- onChange: (value) => {
70
- dispatch({ type: "updateMessageRole", index, role: value });
71
- },
72
- options: [
73
- { value: "system", label: "系统" },
74
- { value: "user", label: "输入" },
75
- { value: "assistant", label: "输出" }
76
- ]
77
- }
78
- ),
79
- /* @__PURE__ */ React.createElement(
80
- import_ControlInput.ControlInput,
81
- {
82
- disabled,
83
- value: item.content,
84
- onChange: (e) => {
85
- dispatch({ type: "updateMessage", index, message: e });
86
- },
87
- placeholder: item.role === "user" ? "请填入输入的样例内容" : "请填入输出的样例"
88
- }
89
- ),
90
- /* @__PURE__ */ React.createElement(
91
- import_ActionIcon.default,
92
- {
93
- icon: import_lucide_react.TrashIcon,
94
- placement: "right",
95
- title: "Delete",
96
- onClick: () => {
97
- dispatch({ type: "deleteMessage", index });
98
- }
99
- }
100
- )
101
- )), /* @__PURE__ */ React.createElement(
102
- import_antd.Button,
103
- {
104
- block: true,
105
- disabled,
106
- icon: /* @__PURE__ */ React.createElement(import_icons.PlusOutlined, null),
107
- onClick: () => {
108
- const lastMeg = chatMessages.at(-1);
109
- dispatch({
110
- type: "addMessage",
111
- message: { role: (lastMeg == null ? void 0 : lastMeg.role) === "user" ? "assistant" : "user", content: "" }
112
- });
113
- }
114
- },
115
- "添加一项"
116
- ));
117
- },
118
- import_fast_deep_equal.default
119
- );
120
- var EditableMessageList_default = EditableMessageList;
121
- // Annotate the CommonJS export names for ESM import in node:
122
- 0 && (module.exports = {
123
- EditableMessageList
124
- });
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { ControlInputProps } from "../components/ControlInput";
3
- export declare type EditableTextProps = ControlInputProps;
4
- declare const EditableText: import("react").NamedExoticComponent<ControlInputProps>;
5
- export default EditableText;
@@ -1,56 +0,0 @@
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);
18
-
19
- // src/EditableText/index.tsx
20
- var EditableText_exports = {};
21
- __export(EditableText_exports, {
22
- default: () => EditableText_default
23
- });
24
- module.exports = __toCommonJS(EditableText_exports);
25
- var import_ControlInput = require("../components/ControlInput");
26
- var import__ = require("../index");
27
- var import_lucide_react = require("lucide-react");
28
- var import_react = require("react");
29
- var import_react_layout_kit = require("react-layout-kit");
30
- var EditableText = (0, import_react.memo)(({ value, onChange }) => {
31
- const [edited, setEdited] = (0, import_react.useState)(false);
32
- return edited ? /* @__PURE__ */ React.createElement(
33
- import_ControlInput.ControlInput,
34
- {
35
- value,
36
- onChangeEnd: () => {
37
- setEdited(false);
38
- },
39
- onChange
40
- }
41
- ) : /* @__PURE__ */ React.createElement(import_react_layout_kit.Flexbox, { horizontal: true, gap: 8 }, value, /* @__PURE__ */ React.createElement(
42
- import__.ActionIcon,
43
- {
44
- title: "Edit",
45
- placement: "right",
46
- icon: import_lucide_react.Edit3,
47
- size: "small",
48
- onClick: () => {
49
- setEdited(!edited);
50
- }
51
- }
52
- ));
53
- });
54
- var EditableText_default = EditableText;
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {});
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export interface PrismProps {
3
- children: string;
4
- language: string;
5
- isDarkMode: boolean;
6
- }
7
- export declare const Prism: import("react").NamedExoticComponent<PrismProps>;