@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.
- package/package.json +1 -1
- package/lib/ActionIcon/index.d.ts +0 -49
- package/lib/ActionIcon/index.js +0 -82
- package/lib/ActionIcon/style.d.ts +0 -6
- package/lib/ActionIcon/style.js +0 -64
- package/lib/Avatar/index.d.ts +0 -10
- package/lib/Avatar/index.js +0 -74
- package/lib/Chat/const.d.ts +0 -1
- package/lib/Chat/const.js +0 -29
- package/lib/Chat/index.d.ts +0 -2
- package/lib/Chat/index.js +0 -31
- package/lib/Chat/store/index.d.ts +0 -20
- package/lib/Chat/store/index.js +0 -44
- package/lib/Chat/store/initialState.d.ts +0 -28
- package/lib/Chat/store/initialState.js +0 -37
- package/lib/Chat/store/messageReducer.d.ts +0 -37
- package/lib/Chat/store/messageReducer.js +0 -82
- package/lib/Chat/store/selectors.d.ts +0 -9
- package/lib/Chat/store/selectors.js +0 -53
- package/lib/Chat/store/store.d.ts +0 -34
- package/lib/Chat/store/store.js +0 -119
- package/lib/Chat/types.d.ts +0 -77
- package/lib/Chat/types.js +0 -17
- package/lib/Chat/utils/fetch.d.ts +0 -11
- package/lib/Chat/utils/fetch.js +0 -72
- package/lib/ContextMenu/MenuItem/icons.d.ts +0 -4
- package/lib/ContextMenu/MenuItem/icons.js +0 -100
- package/lib/ContextMenu/MenuItem/index.d.ts +0 -12
- package/lib/ContextMenu/MenuItem/index.js +0 -72
- package/lib/ContextMenu/MenuItem/style.d.ts +0 -7
- package/lib/ContextMenu/MenuItem/style.js +0 -94
- package/lib/ContextMenu/index.d.ts +0 -9
- package/lib/ContextMenu/index.js +0 -254
- package/lib/ContextMenu/style.d.ts +0 -4
- package/lib/ContextMenu/style.js +0 -88
- package/lib/ContextMenu/types/index.d.ts +0 -5
- package/lib/ContextMenu/types/index.js +0 -19
- package/lib/ContextMenu/types/menuItem.d.ts +0 -21
- package/lib/ContextMenu/types/menuItem.js +0 -17
- package/lib/Conversation/App.d.ts +0 -13
- package/lib/Conversation/App.js +0 -53
- package/lib/Conversation/ChatList/MessageItem/Content.d.ts +0 -8
- package/lib/Conversation/ChatList/MessageItem/Content.js +0 -104
- package/lib/Conversation/ChatList/MessageItem/Toolbar.d.ts +0 -10
- package/lib/Conversation/ChatList/MessageItem/Toolbar.js +0 -110
- package/lib/Conversation/ChatList/MessageItem/index.d.ts +0 -9
- package/lib/Conversation/ChatList/MessageItem/index.js +0 -164
- package/lib/Conversation/ChatList/index.d.ts +0 -14
- package/lib/Conversation/ChatList/index.js +0 -61
- package/lib/Conversation/InputArea/ActionBar.d.ts +0 -4
- package/lib/Conversation/InputArea/ActionBar.js +0 -97
- package/lib/Conversation/InputArea/index.d.ts +0 -4
- package/lib/Conversation/InputArea/index.js +0 -148
- package/lib/Conversation/StoreUpdater.d.ts +0 -7
- package/lib/Conversation/StoreUpdater.js +0 -52
- package/lib/Conversation/index.d.ts +0 -8
- package/lib/Conversation/index.js +0 -45
- package/lib/CopyButton/index.d.ts +0 -26
- package/lib/CopyButton/index.js +0 -66
- package/lib/DraggablePanel/index.d.ts +0 -92
- package/lib/DraggablePanel/index.js +0 -217
- package/lib/DraggablePanel/style.d.ts +0 -18
- package/lib/DraggablePanel/style.js +0 -286
- package/lib/DraggablePanel/utils.d.ts +0 -2
- package/lib/DraggablePanel/utils.js +0 -40
- package/lib/EditableMessage/index.d.ts +0 -43
- package/lib/EditableMessage/index.js +0 -96
- package/lib/EditableMessageList/index.d.ts +0 -9
- package/lib/EditableMessageList/index.js +0 -124
- package/lib/EditableText/index.d.ts +0 -5
- package/lib/EditableText/index.js +0 -56
- package/lib/Highlighter/SyntaxHighlighter/Prism.d.ts +0 -7
- package/lib/Highlighter/SyntaxHighlighter/Prism.js +0 -41
- package/lib/Highlighter/SyntaxHighlighter/index.d.ts +0 -5
- package/lib/Highlighter/SyntaxHighlighter/index.js +0 -55
- package/lib/Highlighter/SyntaxHighlighter/style.d.ts +0 -5
- package/lib/Highlighter/SyntaxHighlighter/style.js +0 -61
- package/lib/Highlighter/index.d.ts +0 -36
- package/lib/Highlighter/index.js +0 -62
- package/lib/Highlighter/style.d.ts +0 -5
- package/lib/Highlighter/style.js +0 -104
- package/lib/Icon/index.d.ts +0 -21
- package/lib/Icon/index.js +0 -52
- package/lib/Input/index.d.ts +0 -13
- package/lib/Input/index.js +0 -45
- package/lib/Input/style.d.ts +0 -6
- package/lib/Input/style.js +0 -70
- package/lib/List/ListItem/index.d.ts +0 -64
- package/lib/List/ListItem/index.js +0 -157
- package/lib/List/ListItem/time.d.ts +0 -2
- package/lib/List/ListItem/time.js +0 -50
- package/lib/List/index.d.ts +0 -5
- package/lib/List/index.js +0 -41
- package/lib/Logo/Divider.d.ts +0 -3
- package/lib/Logo/Divider.js +0 -41
- package/lib/Logo/Logo3D.d.ts +0 -3
- package/lib/Logo/Logo3D.js +0 -35
- package/lib/Logo/LogoFlat.d.ts +0 -3
- package/lib/Logo/LogoFlat.js +0 -120
- package/lib/Logo/LogoHighContrast.d.ts +0 -3
- package/lib/Logo/LogoHighContrast.js +0 -35
- package/lib/Logo/LogoText.d.ts +0 -3
- package/lib/Logo/LogoText.js +0 -39
- package/lib/Logo/index.d.ts +0 -20
- package/lib/Logo/index.js +0 -64
- package/lib/Logo/style.d.ts +0 -4
- package/lib/Logo/style.js +0 -41
- package/lib/Markdown/Code.d.ts +0 -3
- package/lib/Markdown/Code.js +0 -33
- package/lib/Markdown/CodeBlock.d.ts +0 -3
- package/lib/Markdown/CodeBlock.js +0 -68
- package/lib/Markdown/index.d.ts +0 -13
- package/lib/Markdown/index.js +0 -58
- package/lib/Markdown/style.d.ts +0 -4
- package/lib/Markdown/style.js +0 -134
- package/lib/MessageInput/index.d.ts +0 -37
- package/lib/MessageInput/index.js +0 -59
- package/lib/MessageModal/index.d.ts +0 -11
- package/lib/MessageModal/index.js +0 -98
- package/lib/SearchBar/index.d.ts +0 -8
- package/lib/SearchBar/index.js +0 -77
- package/lib/SearchBar/style.d.ts +0 -6
- package/lib/SearchBar/style.js +0 -49
- package/lib/SideNav/index.d.ts +0 -18
- package/lib/SideNav/index.js +0 -34
- package/lib/SideNav/style.d.ts +0 -1
- package/lib/SideNav/style.js +0 -46
- package/lib/Snippet/index.d.ts +0 -29
- package/lib/Snippet/index.js +0 -47
- package/lib/Snippet/style.d.ts +0 -1
- package/lib/Snippet/style.js +0 -74
- package/lib/StroyBook/index.d.ts +0 -17
- package/lib/StroyBook/index.js +0 -65
- package/lib/StroyBook/style.d.ts +0 -8
- package/lib/StroyBook/style.js +0 -90
- package/lib/Swatches/index.d.ts +0 -8
- package/lib/Swatches/index.js +0 -68
- package/lib/TabsNav/index.d.ts +0 -22
- package/lib/TabsNav/index.js +0 -34
- package/lib/TabsNav/style.d.ts +0 -3
- package/lib/TabsNav/style.js +0 -65
- package/lib/ThemeProvider/GlobalStyle.d.ts +0 -3
- package/lib/ThemeProvider/GlobalStyle.js +0 -94
- package/lib/ThemeProvider/index.d.ts +0 -22
- package/lib/ThemeProvider/index.js +0 -60
- package/lib/ThemeSwitch/index.d.ts +0 -27
- package/lib/ThemeSwitch/index.js +0 -50
- package/lib/Tooltip/index.d.ts +0 -5
- package/lib/Tooltip/index.js +0 -34
- package/lib/Tooltip/style.d.ts +0 -3
- package/lib/Tooltip/style.js +0 -54
- package/lib/components/ControlInput.d.ts +0 -9
- package/lib/components/ControlInput.js +0 -91
- package/lib/hooks/useCopied.d.ts +0 -4
- package/lib/hooks/useCopied.js +0 -44
- package/lib/hooks/useHighlight.d.ts +0 -36
- package/lib/hooks/useHighlight.js +0 -76
- package/lib/index.d.ts +0 -27
- package/lib/index.js +0 -122
- package/lib/styles/algorithms/generateColorPalette.d.ts +0 -11
- package/lib/styles/algorithms/generateColorPalette.js +0 -72
- package/lib/styles/algorithms/generateCustomStylish.d.ts +0 -17
- package/lib/styles/algorithms/generateCustomStylish.js +0 -122
- package/lib/styles/algorithms/generateCustomToken.d.ts +0 -3
- package/lib/styles/algorithms/generateCustomToken.js +0 -79
- package/lib/styles/algorithms/generateTheme.d.ts +0 -5
- package/lib/styles/algorithms/generateTheme.js +0 -59
- package/lib/styles/colors.d.ts +0 -38
- package/lib/styles/colors.js +0 -1828
- package/lib/styles/index.d.ts +0 -3
- package/lib/styles/index.js +0 -35
- package/lib/styles/theme/base.d.ts +0 -2
- package/lib/styles/theme/base.js +0 -41
- package/lib/styles/theme/dark.d.ts +0 -3
- package/lib/styles/theme/dark.js +0 -74
- package/lib/styles/theme/light.d.ts +0 -3
- package/lib/styles/theme/light.js +0 -74
- package/lib/types/customToken.d.ts +0 -1027
- package/lib/types/global.d.ts +0 -12
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.js +0 -17
- package/lib/utils/colorUtils.d.ts +0 -1
- 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,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 = {});
|