@lobehub/ui 1.11.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.
- package/lib/ActionIcon/index.js +77 -79
- package/lib/ActionIcon/style.js +17 -61
- package/lib/Avatar/index.js +62 -67
- package/lib/Chat/const.js +6 -27
- package/lib/Chat/index.js +24 -28
- package/lib/Chat/store/index.js +46 -40
- package/lib/Chat/store/initialState.js +6 -27
- package/lib/Chat/store/messageReducer.js +51 -58
- package/lib/Chat/store/selectors.js +44 -46
- package/lib/Chat/store/store.js +242 -115
- package/lib/Chat/types.js +4 -16
- package/lib/Chat/utils/fetch.js +104 -68
- package/lib/ContextMenu/MenuItem/icons.js +48 -66
- package/lib/ContextMenu/MenuItem/index.js +73 -66
- package/lib/ContextMenu/MenuItem/style.js +19 -89
- package/lib/ContextMenu/index.js +194 -178
- package/lib/ContextMenu/style.js +17 -85
- package/lib/ContextMenu/types/index.js +15 -18
- package/lib/ContextMenu/types/menuItem.js +4 -16
- package/lib/Conversation/App.js +47 -50
- package/lib/Conversation/ChatList/MessageItem/Content.js +98 -93
- package/lib/Conversation/ChatList/MessageItem/Toolbar.js +94 -104
- package/lib/Conversation/ChatList/MessageItem/index.js +125 -157
- package/lib/Conversation/ChatList/index.js +64 -58
- package/lib/Conversation/InputArea/ActionBar.js +74 -92
- package/lib/Conversation/InputArea/index.js +103 -142
- package/lib/Conversation/StoreUpdater.js +28 -48
- package/lib/Conversation/index.js +30 -42
- package/lib/CopyButton/index.js +37 -62
- package/lib/DraggablePanel/index.js +192 -207
- package/lib/DraggablePanel/style.js +30 -278
- package/lib/DraggablePanel/utils.js +14 -35
- package/lib/EditableMessage/index.js +66 -89
- package/lib/EditableMessageList/index.js +97 -112
- package/lib/EditableText/index.js +36 -49
- package/lib/Highlighter/SyntaxHighlighter/Prism.js +43 -38
- package/lib/Highlighter/SyntaxHighlighter/index.js +62 -53
- package/lib/Highlighter/SyntaxHighlighter/style.js +18 -56
- package/lib/Highlighter/index.js +52 -58
- package/lib/Highlighter/style.js +22 -101
- package/lib/Icon/index.js +29 -36
- package/lib/Input/index.js +45 -43
- package/lib/Input/style.js +17 -67
- package/lib/List/ListItem/index.js +108 -150
- package/lib/List/ListItem/time.js +15 -47
- package/lib/List/index.js +9 -37
- package/lib/Logo/Divider.js +21 -34
- package/lib/Logo/Logo3D.js +17 -33
- package/lib/Logo/LogoFlat.js +108 -118
- package/lib/Logo/LogoHighContrast.js +30 -33
- package/lib/Logo/LogoText.js +21 -34
- package/lib/Logo/index.js +97 -59
- package/lib/Logo/style.js +13 -36
- package/lib/Markdown/Code.js +16 -30
- package/lib/Markdown/CodeBlock.js +33 -65
- package/lib/Markdown/index.js +35 -54
- package/lib/Markdown/style.js +15 -129
- package/lib/MessageInput/index.js +60 -56
- package/lib/MessageModal/index.js +80 -91
- package/lib/SearchBar/index.js +86 -73
- package/lib/SearchBar/style.js +18 -46
- package/lib/SideNav/index.js +43 -31
- package/lib/SideNav/style.js +13 -43
- package/lib/Snippet/index.js +42 -45
- package/lib/Snippet/style.js +13 -71
- package/lib/StroyBook/index.js +60 -61
- package/lib/StroyBook/style.js +19 -87
- package/lib/Swatches/index.js +35 -53
- package/lib/TabsNav/index.js +23 -31
- package/lib/TabsNav/style.js +17 -60
- package/lib/ThemeProvider/GlobalStyle.js +29 -92
- package/lib/ThemeProvider/index.js +43 -57
- package/lib/ThemeSwitch/index.js +62 -46
- package/lib/Tooltip/index.js +26 -31
- package/lib/Tooltip/style.js +13 -49
- package/lib/components/ControlInput.js +86 -87
- package/lib/hooks/useCopied.js +27 -37
- package/lib/hooks/useHighlight.js +65 -70
- package/lib/index.js +211 -120
- package/lib/styles/algorithms/generateColorPalette.js +28 -60
- package/lib/styles/algorithms/generateCustomStylish.js +22 -117
- package/lib/styles/algorithms/generateCustomToken.js +51 -65
- package/lib/styles/algorithms/generateTheme.js +22 -53
- package/lib/styles/colors.js +121 -1766
- package/lib/styles/index.js +23 -32
- package/lib/styles/theme/base.js +11 -32
- package/lib/styles/theme/dark.js +38 -62
- package/lib/styles/theme/light.js +38 -62
- package/lib/types/index.js +4 -16
- package/lib/utils/colorUtils.js +14 -48
- package/package.json +1 -1
|
@@ -1,286 +1,38 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
useStyle: () => useStyle
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
23
6
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
7
|
+
exports.useStyle = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _antdStyle = require("antd-style");
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
26
11
|
var offset = 16;
|
|
27
12
|
var toggleLength = 40;
|
|
28
13
|
var toggleShort = 16;
|
|
29
|
-
var useStyle = (0,
|
|
30
|
-
|
|
31
|
-
position: relative;
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
`;
|
|
14
|
+
var useStyle = (0, _antdStyle.createStyles)(function (_ref, prefix) {
|
|
15
|
+
var token = _ref.token;
|
|
16
|
+
var commonHandle = (0, _antdStyle.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
17
|
+
var commonToggle = (0, _antdStyle.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n z-index: 1001;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
|
|
18
|
+
var float = (0, _antdStyle.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n z-index: 2000;\n "])));
|
|
90
19
|
return {
|
|
91
|
-
container: (0,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
),
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
)
|
|
20
|
+
container: (0, _antdStyle.cx)(prefix, (0, _antdStyle.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n flex-shrink: 0;\n border: 0 solid ", ";\n\n &:hover {\n .", "-toggle {\n opacity: 1;\n }\n }\n "])), token.colorBorderSecondary, prefix)),
|
|
21
|
+
fixed: (0, _antdStyle.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n "]))),
|
|
22
|
+
leftFloat: (0, _antdStyle.cx)(float, (0, _antdStyle.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n top: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n "])))),
|
|
23
|
+
rightFloat: (0, _antdStyle.cx)(float, (0, _antdStyle.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n "])))),
|
|
24
|
+
topFloat: (0, _antdStyle.cx)(float, (0, _antdStyle.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n "])))),
|
|
25
|
+
bottomFloat: (0, _antdStyle.cx)(float, (0, _antdStyle.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n "])))),
|
|
26
|
+
toggleLeft: (0, _antdStyle.cx)("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, (0, _antdStyle.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
27
|
+
toggleRight: (0, _antdStyle.cx)("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, (0, _antdStyle.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
|
|
28
|
+
toggleTop: (0, _antdStyle.cx)("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-top"), commonToggle, (0, _antdStyle.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n top: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-left: -20px;\n\n border-radius: 4px 4px 0 0;\n }\n "])), offset, toggleShort, toggleLength, toggleShort)),
|
|
29
|
+
toggleBottom: (0, _antdStyle.cx)("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-bottom"), commonToggle, (0, _antdStyle.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n bottom: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: 16px;\n margin-left: -20px;\n\n border-radius: 0 0 4px 4px;\n }\n "])), offset, toggleShort, toggleLength)),
|
|
30
|
+
panel: (0, _antdStyle.cx)("".concat(prefix, "-fixed"), (0, _antdStyle.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2.default)(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
|
|
31
|
+
handlerIcon: (0, _antdStyle.css)(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut),
|
|
32
|
+
leftHandle: (0, _antdStyle.cx)((0, _antdStyle.css)(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n &::before {\n left: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-left-handle")),
|
|
33
|
+
rightHandle: (0, _antdStyle.cx)((0, _antdStyle.css)(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n &::before {\n right: 50%;\n width: 2px;\n height: 100%;\n }\n "])), commonHandle), "".concat(prefix, "-right-handle")),
|
|
34
|
+
topHandle: (0, _antdStyle.cx)("".concat(prefix, "-top-handle"), (0, _antdStyle.css)(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n &::before {\n top: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle)),
|
|
35
|
+
bottomHandle: (0, _antdStyle.cx)("".concat(prefix, "-bottom-handle"), (0, _antdStyle.css)(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n &::before {\n bottom: 50%;\n width: 100%;\n height: 2px;\n }\n "])), commonHandle))
|
|
281
36
|
};
|
|
282
37
|
});
|
|
283
|
-
|
|
284
|
-
0 && (module.exports = {
|
|
285
|
-
useStyle
|
|
286
|
-
});
|
|
38
|
+
exports.useStyle = useStyle;
|
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
__export(utils_exports, {
|
|
22
|
-
revesePlacement: () => revesePlacement
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
var revesePlacement = (placement)
|
|
6
|
+
exports.revesePlacement = void 0;
|
|
7
|
+
var revesePlacement = function revesePlacement(placement) {
|
|
26
8
|
switch (placement) {
|
|
27
|
-
case
|
|
28
|
-
return
|
|
29
|
-
case
|
|
30
|
-
return
|
|
31
|
-
case
|
|
32
|
-
return
|
|
33
|
-
case
|
|
34
|
-
return
|
|
9
|
+
case 'bottom':
|
|
10
|
+
return 'top';
|
|
11
|
+
case 'top':
|
|
12
|
+
return 'bottom';
|
|
13
|
+
case 'right':
|
|
14
|
+
return 'left';
|
|
15
|
+
case 'left':
|
|
16
|
+
return 'right';
|
|
35
17
|
}
|
|
36
18
|
};
|
|
37
|
-
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
revesePlacement
|
|
40
|
-
});
|
|
19
|
+
exports.revesePlacement = revesePlacement;
|
|
@@ -1,96 +1,73 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
default: () => EditableMessage_default
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
33
6
|
});
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _Markdown = _interopRequireDefault(require("../Markdown"));
|
|
10
|
+
var _MessageInput = _interopRequireDefault(require("../MessageInput"));
|
|
11
|
+
var _MessageModal = _interopRequireDefault(require("../MessageModal"));
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _useMergeValue = _interopRequireDefault(require("use-merge-value"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var EditableMessage = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
16
|
+
var value = _ref.value,
|
|
17
|
+
_onChange = _ref.onChange,
|
|
18
|
+
_ref$classNames = _ref.classNames,
|
|
19
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
20
|
+
onEditingChange = _ref.onEditingChange,
|
|
21
|
+
editing = _ref.editing,
|
|
22
|
+
openModal = _ref.openModal,
|
|
23
|
+
onOpenChange = _ref.onOpenChange,
|
|
24
|
+
_ref$showEditWhenEmpt = _ref.showEditWhenEmpty,
|
|
25
|
+
showEditWhenEmpty = _ref$showEditWhenEmpt === void 0 ? false : _ref$showEditWhenEmpt;
|
|
26
|
+
var _useControlledState = (0, _useMergeValue.default)(false, {
|
|
52
27
|
value: editing,
|
|
53
28
|
onChange: onEditingChange
|
|
54
|
-
})
|
|
55
|
-
|
|
29
|
+
}),
|
|
30
|
+
_useControlledState2 = (0, _slicedToArray2.default)(_useControlledState, 2),
|
|
31
|
+
isEdit = _useControlledState2[0],
|
|
32
|
+
setTyping = _useControlledState2[1];
|
|
33
|
+
var _useControlledState3 = (0, _useMergeValue.default)(false, {
|
|
56
34
|
value: openModal,
|
|
57
35
|
onChange: onOpenChange
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
}),
|
|
37
|
+
_useControlledState4 = (0, _slicedToArray2.default)(_useControlledState3, 2),
|
|
38
|
+
expand = _useControlledState4[0],
|
|
39
|
+
setExpand = _useControlledState4[1];
|
|
40
|
+
return !value && showEditWhenEmpty ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageInput.default, {
|
|
41
|
+
onConfirm: function onConfirm(text) {
|
|
42
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
43
|
+
setTyping(false);
|
|
44
|
+
},
|
|
45
|
+
className: classNames.input
|
|
46
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageModal.default, {
|
|
48
|
+
open: expand,
|
|
49
|
+
onOpenChange: setExpand,
|
|
50
|
+
value: value,
|
|
51
|
+
editing: isEdit,
|
|
52
|
+
onEditingChange: setTyping,
|
|
53
|
+
onChange: function onChange(text) {
|
|
54
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
67
55
|
}
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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 = {});
|
|
56
|
+
}), !expand && isEdit ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageInput.default, {
|
|
57
|
+
onConfirm: function onConfirm(text) {
|
|
58
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
59
|
+
setTyping(false);
|
|
60
|
+
},
|
|
61
|
+
onCancel: function onCancel() {
|
|
62
|
+
return setTyping(false);
|
|
63
|
+
},
|
|
64
|
+
defaultValue: value,
|
|
65
|
+
className: classNames.input
|
|
66
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Markdown.default, {
|
|
67
|
+
className: classNames.markdown,
|
|
68
|
+
children: value
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _default = EditableMessage;
|
|
73
|
+
exports.default = _default;
|