zs_library 0.3.8 → 0.3.10
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/dist/index.es.js +2319 -0
- package/dist/index.umd.js +468 -0
- package/dist/style.css +1 -0
- package/package.json +6 -4
- package/dist/index.js +0 -1696
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,2319 @@
|
|
|
1
|
+
var Ar = Object.defineProperty;
|
|
2
|
+
var Br = (d, r, i) => r in d ? Ar(d, r, { enumerable: !0, configurable: !0, writable: !0, value: i }) : d[r] = i;
|
|
3
|
+
var Oe = (d, r, i) => Br(d, typeof r != "symbol" ? r + "" : r, i);
|
|
4
|
+
import nr, { createContext as ar, useMemo as Ee, useContext as ir, useState as oe, useRef as Be, useEffect as ye } from "react";
|
|
5
|
+
import { cx as U, css as u } from "@emotion/css";
|
|
6
|
+
import Lr from "react-slick";
|
|
7
|
+
import { ReactSortable as Fe } from "react-sortablejs";
|
|
8
|
+
import { AnimatePresence as Fr, motion as A } from "framer-motion";
|
|
9
|
+
import { useLocalStorageState as Yr, useDebounceEffect as Wr } from "ahooks";
|
|
10
|
+
import { v4 as rr } from "uuid";
|
|
11
|
+
import Ur from "rc-tooltip";
|
|
12
|
+
import { RiPencilRuler2Line as Vr, RiShareLine as zr, RiInformationLine as Gr, RiCloseCircleLine as Xr } from "@remixicon/react";
|
|
13
|
+
import sr from "rc-dialog";
|
|
14
|
+
import qr from "react-json-view";
|
|
15
|
+
import { MDXEditor as Jr, toolbarPlugin as Kr, DiffSourceToggleWrapper as Hr, UndoRedo as Zr, Separator as ue, BoldItalicUnderlineToggles as Qr, CodeToggle as et, StrikeThroughSupSubToggles as rt, ListsToggle as tt, CreateLink as ot, InsertImage as nt, InsertTable as at, InsertThematicBreak as it, InsertCodeBlock as st, ConditionalContents as lt, InsertAdmonition as ct, InsertFrontmatter as ut, diffSourcePlugin as dt, listsPlugin as ft, quotePlugin as mt, headingsPlugin as gt, linkPlugin as pt, linkDialogPlugin as ht, imagePlugin as vt, tablePlugin as xt, thematicBreakPlugin as bt, frontmatterPlugin as kt, codeBlockPlugin as yt, codeMirrorPlugin as Ct, markdownShortcutPlugin as wt, directivesPlugin as jt, AdmonitionDirectiveDescriptor as It } from "@mdxeditor/editor";
|
|
16
|
+
var Le = { exports: {} }, be = {};
|
|
17
|
+
/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-jsx-runtime.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
var tr;
|
|
27
|
+
function St() {
|
|
28
|
+
if (tr) return be;
|
|
29
|
+
tr = 1;
|
|
30
|
+
var d = nr, r = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, g = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
31
|
+
function y(b, s, _) {
|
|
32
|
+
var p, N = {}, M = null, V = null;
|
|
33
|
+
_ !== void 0 && (M = "" + _), s.key !== void 0 && (M = "" + s.key), s.ref !== void 0 && (V = s.ref);
|
|
34
|
+
for (p in s) a.call(s, p) && !l.hasOwnProperty(p) && (N[p] = s[p]);
|
|
35
|
+
if (b && b.defaultProps) for (p in s = b.defaultProps, s) N[p] === void 0 && (N[p] = s[p]);
|
|
36
|
+
return { $$typeof: r, type: b, key: M, ref: V, props: N, _owner: g.current };
|
|
37
|
+
}
|
|
38
|
+
return be.Fragment = i, be.jsx = y, be.jsxs = y, be;
|
|
39
|
+
}
|
|
40
|
+
var ke = {};
|
|
41
|
+
/**
|
|
42
|
+
* @license React
|
|
43
|
+
* react-jsx-runtime.development.js
|
|
44
|
+
*
|
|
45
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the MIT license found in the
|
|
48
|
+
* LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/
|
|
50
|
+
var or;
|
|
51
|
+
function Tt() {
|
|
52
|
+
return or || (or = 1, process.env.NODE_ENV !== "production" && function() {
|
|
53
|
+
var d = nr, r = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), b = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), V = Symbol.for("react.offscreen"), Y = Symbol.iterator, f = "@@iterator";
|
|
54
|
+
function h(e) {
|
|
55
|
+
if (e === null || typeof e != "object")
|
|
56
|
+
return null;
|
|
57
|
+
var t = Y && e[Y] || e[f];
|
|
58
|
+
return typeof t == "function" ? t : null;
|
|
59
|
+
}
|
|
60
|
+
var T = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
61
|
+
function m(e) {
|
|
62
|
+
{
|
|
63
|
+
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
|
|
64
|
+
n[c - 1] = arguments[c];
|
|
65
|
+
G("error", e, n);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function G(e, t, n) {
|
|
69
|
+
{
|
|
70
|
+
var c = T.ReactDebugCurrentFrame, S = c.getStackAddendum();
|
|
71
|
+
S !== "" && (t += "%s", n = n.concat([S]));
|
|
72
|
+
var $ = n.map(function(j) {
|
|
73
|
+
return String(j);
|
|
74
|
+
});
|
|
75
|
+
$.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, $);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
var v = !1, P = !1, R = !1, x = !1, C = !1, X;
|
|
79
|
+
X = Symbol.for("react.module.reference");
|
|
80
|
+
function ce(e) {
|
|
81
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === l || C || e === g || e === _ || e === p || x || e === V || v || P || R || typeof e == "object" && e !== null && (e.$$typeof === M || e.$$typeof === N || e.$$typeof === y || e.$$typeof === b || e.$$typeof === s || // This needs to include all possible module reference object
|
|
82
|
+
// types supported by any Flight configuration anywhere since
|
|
83
|
+
// we don't know which Flight build this will end up being used
|
|
84
|
+
// with.
|
|
85
|
+
e.$$typeof === X || e.getModuleId !== void 0));
|
|
86
|
+
}
|
|
87
|
+
function J(e, t, n) {
|
|
88
|
+
var c = e.displayName;
|
|
89
|
+
if (c)
|
|
90
|
+
return c;
|
|
91
|
+
var S = t.displayName || t.name || "";
|
|
92
|
+
return S !== "" ? n + "(" + S + ")" : n;
|
|
93
|
+
}
|
|
94
|
+
function ge(e) {
|
|
95
|
+
return e.displayName || "Context";
|
|
96
|
+
}
|
|
97
|
+
function q(e) {
|
|
98
|
+
if (e == null)
|
|
99
|
+
return null;
|
|
100
|
+
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
101
|
+
return e.displayName || e.name || null;
|
|
102
|
+
if (typeof e == "string")
|
|
103
|
+
return e;
|
|
104
|
+
switch (e) {
|
|
105
|
+
case a:
|
|
106
|
+
return "Fragment";
|
|
107
|
+
case i:
|
|
108
|
+
return "Portal";
|
|
109
|
+
case l:
|
|
110
|
+
return "Profiler";
|
|
111
|
+
case g:
|
|
112
|
+
return "StrictMode";
|
|
113
|
+
case _:
|
|
114
|
+
return "Suspense";
|
|
115
|
+
case p:
|
|
116
|
+
return "SuspenseList";
|
|
117
|
+
}
|
|
118
|
+
if (typeof e == "object")
|
|
119
|
+
switch (e.$$typeof) {
|
|
120
|
+
case b:
|
|
121
|
+
var t = e;
|
|
122
|
+
return ge(t) + ".Consumer";
|
|
123
|
+
case y:
|
|
124
|
+
var n = e;
|
|
125
|
+
return ge(n._context) + ".Provider";
|
|
126
|
+
case s:
|
|
127
|
+
return J(e, e.render, "ForwardRef");
|
|
128
|
+
case N:
|
|
129
|
+
var c = e.displayName || null;
|
|
130
|
+
return c !== null ? c : q(e.type) || "Memo";
|
|
131
|
+
case M: {
|
|
132
|
+
var S = e, $ = S._payload, j = S._init;
|
|
133
|
+
try {
|
|
134
|
+
return q(j($));
|
|
135
|
+
} catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
var re = Object.assign, se = 0, B, ne, le, Ce, we, je, Ie;
|
|
143
|
+
function I() {
|
|
144
|
+
}
|
|
145
|
+
I.__reactDisabledLog = !0;
|
|
146
|
+
function H() {
|
|
147
|
+
{
|
|
148
|
+
if (se === 0) {
|
|
149
|
+
B = console.log, ne = console.info, le = console.warn, Ce = console.error, we = console.group, je = console.groupCollapsed, Ie = console.groupEnd;
|
|
150
|
+
var e = {
|
|
151
|
+
configurable: !0,
|
|
152
|
+
enumerable: !0,
|
|
153
|
+
value: I,
|
|
154
|
+
writable: !0
|
|
155
|
+
};
|
|
156
|
+
Object.defineProperties(console, {
|
|
157
|
+
info: e,
|
|
158
|
+
log: e,
|
|
159
|
+
warn: e,
|
|
160
|
+
error: e,
|
|
161
|
+
group: e,
|
|
162
|
+
groupCollapsed: e,
|
|
163
|
+
groupEnd: e
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
se++;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function K() {
|
|
170
|
+
{
|
|
171
|
+
if (se--, se === 0) {
|
|
172
|
+
var e = {
|
|
173
|
+
configurable: !0,
|
|
174
|
+
enumerable: !0,
|
|
175
|
+
writable: !0
|
|
176
|
+
};
|
|
177
|
+
Object.defineProperties(console, {
|
|
178
|
+
log: re({}, e, {
|
|
179
|
+
value: B
|
|
180
|
+
}),
|
|
181
|
+
info: re({}, e, {
|
|
182
|
+
value: ne
|
|
183
|
+
}),
|
|
184
|
+
warn: re({}, e, {
|
|
185
|
+
value: le
|
|
186
|
+
}),
|
|
187
|
+
error: re({}, e, {
|
|
188
|
+
value: Ce
|
|
189
|
+
}),
|
|
190
|
+
group: re({}, e, {
|
|
191
|
+
value: we
|
|
192
|
+
}),
|
|
193
|
+
groupCollapsed: re({}, e, {
|
|
194
|
+
value: je
|
|
195
|
+
}),
|
|
196
|
+
groupEnd: re({}, e, {
|
|
197
|
+
value: Ie
|
|
198
|
+
})
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
se < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var D = T.ReactCurrentDispatcher, L;
|
|
205
|
+
function O(e, t, n) {
|
|
206
|
+
{
|
|
207
|
+
if (L === void 0)
|
|
208
|
+
try {
|
|
209
|
+
throw Error();
|
|
210
|
+
} catch (S) {
|
|
211
|
+
var c = S.stack.trim().match(/\n( *(at )?)/);
|
|
212
|
+
L = c && c[1] || "";
|
|
213
|
+
}
|
|
214
|
+
return `
|
|
215
|
+
` + L + e;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
var w = !1, E;
|
|
219
|
+
{
|
|
220
|
+
var z = typeof WeakMap == "function" ? WeakMap : Map;
|
|
221
|
+
E = new z();
|
|
222
|
+
}
|
|
223
|
+
function te(e, t) {
|
|
224
|
+
if (!e || w)
|
|
225
|
+
return "";
|
|
226
|
+
{
|
|
227
|
+
var n = E.get(e);
|
|
228
|
+
if (n !== void 0)
|
|
229
|
+
return n;
|
|
230
|
+
}
|
|
231
|
+
var c;
|
|
232
|
+
w = !0;
|
|
233
|
+
var S = Error.prepareStackTrace;
|
|
234
|
+
Error.prepareStackTrace = void 0;
|
|
235
|
+
var $;
|
|
236
|
+
$ = D.current, D.current = null, H();
|
|
237
|
+
try {
|
|
238
|
+
if (t) {
|
|
239
|
+
var j = function() {
|
|
240
|
+
throw Error();
|
|
241
|
+
};
|
|
242
|
+
if (Object.defineProperty(j.prototype, "props", {
|
|
243
|
+
set: function() {
|
|
244
|
+
throw Error();
|
|
245
|
+
}
|
|
246
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
247
|
+
try {
|
|
248
|
+
Reflect.construct(j, []);
|
|
249
|
+
} catch (ee) {
|
|
250
|
+
c = ee;
|
|
251
|
+
}
|
|
252
|
+
Reflect.construct(e, [], j);
|
|
253
|
+
} else {
|
|
254
|
+
try {
|
|
255
|
+
j.call();
|
|
256
|
+
} catch (ee) {
|
|
257
|
+
c = ee;
|
|
258
|
+
}
|
|
259
|
+
e.call(j.prototype);
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
try {
|
|
263
|
+
throw Error();
|
|
264
|
+
} catch (ee) {
|
|
265
|
+
c = ee;
|
|
266
|
+
}
|
|
267
|
+
e();
|
|
268
|
+
}
|
|
269
|
+
} catch (ee) {
|
|
270
|
+
if (ee && c && typeof ee.stack == "string") {
|
|
271
|
+
for (var k = ee.stack.split(`
|
|
272
|
+
`), Z = c.stack.split(`
|
|
273
|
+
`), F = k.length - 1, W = Z.length - 1; F >= 1 && W >= 0 && k[F] !== Z[W]; )
|
|
274
|
+
W--;
|
|
275
|
+
for (; F >= 1 && W >= 0; F--, W--)
|
|
276
|
+
if (k[F] !== Z[W]) {
|
|
277
|
+
if (F !== 1 || W !== 1)
|
|
278
|
+
do
|
|
279
|
+
if (F--, W--, W < 0 || k[F] !== Z[W]) {
|
|
280
|
+
var ae = `
|
|
281
|
+
` + k[F].replace(" at new ", " at ");
|
|
282
|
+
return e.displayName && ae.includes("<anonymous>") && (ae = ae.replace("<anonymous>", e.displayName)), typeof e == "function" && E.set(e, ae), ae;
|
|
283
|
+
}
|
|
284
|
+
while (F >= 1 && W >= 0);
|
|
285
|
+
break;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} finally {
|
|
289
|
+
w = !1, D.current = $, K(), Error.prepareStackTrace = S;
|
|
290
|
+
}
|
|
291
|
+
var he = e ? e.displayName || e.name : "", fe = he ? O(he) : "";
|
|
292
|
+
return typeof e == "function" && E.set(e, fe), fe;
|
|
293
|
+
}
|
|
294
|
+
function Se(e, t, n) {
|
|
295
|
+
return te(e, !1);
|
|
296
|
+
}
|
|
297
|
+
function Te(e) {
|
|
298
|
+
var t = e.prototype;
|
|
299
|
+
return !!(t && t.isReactComponent);
|
|
300
|
+
}
|
|
301
|
+
function Q(e, t, n) {
|
|
302
|
+
if (e == null)
|
|
303
|
+
return "";
|
|
304
|
+
if (typeof e == "function")
|
|
305
|
+
return te(e, Te(e));
|
|
306
|
+
if (typeof e == "string")
|
|
307
|
+
return O(e);
|
|
308
|
+
switch (e) {
|
|
309
|
+
case _:
|
|
310
|
+
return O("Suspense");
|
|
311
|
+
case p:
|
|
312
|
+
return O("SuspenseList");
|
|
313
|
+
}
|
|
314
|
+
if (typeof e == "object")
|
|
315
|
+
switch (e.$$typeof) {
|
|
316
|
+
case s:
|
|
317
|
+
return Se(e.render);
|
|
318
|
+
case N:
|
|
319
|
+
return Q(e.type, t, n);
|
|
320
|
+
case M: {
|
|
321
|
+
var c = e, S = c._payload, $ = c._init;
|
|
322
|
+
try {
|
|
323
|
+
return Q($(S), t, n);
|
|
324
|
+
} catch {
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return "";
|
|
329
|
+
}
|
|
330
|
+
var de = Object.prototype.hasOwnProperty, We = {}, Ue = T.ReactDebugCurrentFrame;
|
|
331
|
+
function Re(e) {
|
|
332
|
+
if (e) {
|
|
333
|
+
var t = e._owner, n = Q(e.type, e._source, t ? t.type : null);
|
|
334
|
+
Ue.setExtraStackFrame(n);
|
|
335
|
+
} else
|
|
336
|
+
Ue.setExtraStackFrame(null);
|
|
337
|
+
}
|
|
338
|
+
function pr(e, t, n, c, S) {
|
|
339
|
+
{
|
|
340
|
+
var $ = Function.call.bind(de);
|
|
341
|
+
for (var j in e)
|
|
342
|
+
if ($(e, j)) {
|
|
343
|
+
var k = void 0;
|
|
344
|
+
try {
|
|
345
|
+
if (typeof e[j] != "function") {
|
|
346
|
+
var Z = Error((c || "React class") + ": " + n + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
347
|
+
throw Z.name = "Invariant Violation", Z;
|
|
348
|
+
}
|
|
349
|
+
k = e[j](t, j, c, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
350
|
+
} catch (F) {
|
|
351
|
+
k = F;
|
|
352
|
+
}
|
|
353
|
+
k && !(k instanceof Error) && (Re(S), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", n, j, typeof k), Re(null)), k instanceof Error && !(k.message in We) && (We[k.message] = !0, Re(S), m("Failed %s type: %s", n, k.message), Re(null));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
var hr = Array.isArray;
|
|
358
|
+
function _e(e) {
|
|
359
|
+
return hr(e);
|
|
360
|
+
}
|
|
361
|
+
function vr(e) {
|
|
362
|
+
{
|
|
363
|
+
var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
364
|
+
return n;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function xr(e) {
|
|
368
|
+
try {
|
|
369
|
+
return Ve(e), !1;
|
|
370
|
+
} catch {
|
|
371
|
+
return !0;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function Ve(e) {
|
|
375
|
+
return "" + e;
|
|
376
|
+
}
|
|
377
|
+
function ze(e) {
|
|
378
|
+
if (xr(e))
|
|
379
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", vr(e)), Ve(e);
|
|
380
|
+
}
|
|
381
|
+
var xe = T.ReactCurrentOwner, br = {
|
|
382
|
+
key: !0,
|
|
383
|
+
ref: !0,
|
|
384
|
+
__self: !0,
|
|
385
|
+
__source: !0
|
|
386
|
+
}, Ge, Xe, Me;
|
|
387
|
+
Me = {};
|
|
388
|
+
function kr(e) {
|
|
389
|
+
if (de.call(e, "ref")) {
|
|
390
|
+
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
391
|
+
if (t && t.isReactWarning)
|
|
392
|
+
return !1;
|
|
393
|
+
}
|
|
394
|
+
return e.ref !== void 0;
|
|
395
|
+
}
|
|
396
|
+
function yr(e) {
|
|
397
|
+
if (de.call(e, "key")) {
|
|
398
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
399
|
+
if (t && t.isReactWarning)
|
|
400
|
+
return !1;
|
|
401
|
+
}
|
|
402
|
+
return e.key !== void 0;
|
|
403
|
+
}
|
|
404
|
+
function Cr(e, t) {
|
|
405
|
+
if (typeof e.ref == "string" && xe.current && t && xe.current.stateNode !== t) {
|
|
406
|
+
var n = q(xe.current.type);
|
|
407
|
+
Me[n] || (m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', q(xe.current.type), e.ref), Me[n] = !0);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function wr(e, t) {
|
|
411
|
+
{
|
|
412
|
+
var n = function() {
|
|
413
|
+
Ge || (Ge = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
414
|
+
};
|
|
415
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
416
|
+
get: n,
|
|
417
|
+
configurable: !0
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function jr(e, t) {
|
|
422
|
+
{
|
|
423
|
+
var n = function() {
|
|
424
|
+
Xe || (Xe = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
|
|
425
|
+
};
|
|
426
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
427
|
+
get: n,
|
|
428
|
+
configurable: !0
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
var Ir = function(e, t, n, c, S, $, j) {
|
|
433
|
+
var k = {
|
|
434
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
435
|
+
$$typeof: r,
|
|
436
|
+
// Built-in properties that belong on the element
|
|
437
|
+
type: e,
|
|
438
|
+
key: t,
|
|
439
|
+
ref: n,
|
|
440
|
+
props: j,
|
|
441
|
+
// Record the component responsible for creating this element.
|
|
442
|
+
_owner: $
|
|
443
|
+
};
|
|
444
|
+
return k._store = {}, Object.defineProperty(k._store, "validated", {
|
|
445
|
+
configurable: !1,
|
|
446
|
+
enumerable: !1,
|
|
447
|
+
writable: !0,
|
|
448
|
+
value: !1
|
|
449
|
+
}), Object.defineProperty(k, "_self", {
|
|
450
|
+
configurable: !1,
|
|
451
|
+
enumerable: !1,
|
|
452
|
+
writable: !1,
|
|
453
|
+
value: c
|
|
454
|
+
}), Object.defineProperty(k, "_source", {
|
|
455
|
+
configurable: !1,
|
|
456
|
+
enumerable: !1,
|
|
457
|
+
writable: !1,
|
|
458
|
+
value: S
|
|
459
|
+
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
460
|
+
};
|
|
461
|
+
function Sr(e, t, n, c, S) {
|
|
462
|
+
{
|
|
463
|
+
var $, j = {}, k = null, Z = null;
|
|
464
|
+
n !== void 0 && (ze(n), k = "" + n), yr(t) && (ze(t.key), k = "" + t.key), kr(t) && (Z = t.ref, Cr(t, S));
|
|
465
|
+
for ($ in t)
|
|
466
|
+
de.call(t, $) && !br.hasOwnProperty($) && (j[$] = t[$]);
|
|
467
|
+
if (e && e.defaultProps) {
|
|
468
|
+
var F = e.defaultProps;
|
|
469
|
+
for ($ in F)
|
|
470
|
+
j[$] === void 0 && (j[$] = F[$]);
|
|
471
|
+
}
|
|
472
|
+
if (k || Z) {
|
|
473
|
+
var W = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
474
|
+
k && wr(j, W), Z && jr(j, W);
|
|
475
|
+
}
|
|
476
|
+
return Ir(e, k, Z, S, c, xe.current, j);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
var Pe = T.ReactCurrentOwner, qe = T.ReactDebugCurrentFrame;
|
|
480
|
+
function pe(e) {
|
|
481
|
+
if (e) {
|
|
482
|
+
var t = e._owner, n = Q(e.type, e._source, t ? t.type : null);
|
|
483
|
+
qe.setExtraStackFrame(n);
|
|
484
|
+
} else
|
|
485
|
+
qe.setExtraStackFrame(null);
|
|
486
|
+
}
|
|
487
|
+
var De;
|
|
488
|
+
De = !1;
|
|
489
|
+
function $e(e) {
|
|
490
|
+
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
491
|
+
}
|
|
492
|
+
function Je() {
|
|
493
|
+
{
|
|
494
|
+
if (Pe.current) {
|
|
495
|
+
var e = q(Pe.current.type);
|
|
496
|
+
if (e)
|
|
497
|
+
return `
|
|
498
|
+
|
|
499
|
+
Check the render method of \`` + e + "`.";
|
|
500
|
+
}
|
|
501
|
+
return "";
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function Tr(e) {
|
|
505
|
+
return "";
|
|
506
|
+
}
|
|
507
|
+
var Ke = {};
|
|
508
|
+
function Rr(e) {
|
|
509
|
+
{
|
|
510
|
+
var t = Je();
|
|
511
|
+
if (!t) {
|
|
512
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
513
|
+
n && (t = `
|
|
514
|
+
|
|
515
|
+
Check the top-level render call using <` + n + ">.");
|
|
516
|
+
}
|
|
517
|
+
return t;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function He(e, t) {
|
|
521
|
+
{
|
|
522
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
523
|
+
return;
|
|
524
|
+
e._store.validated = !0;
|
|
525
|
+
var n = Rr(t);
|
|
526
|
+
if (Ke[n])
|
|
527
|
+
return;
|
|
528
|
+
Ke[n] = !0;
|
|
529
|
+
var c = "";
|
|
530
|
+
e && e._owner && e._owner !== Pe.current && (c = " It was passed a child from " + q(e._owner.type) + "."), pe(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, c), pe(null);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function Ze(e, t) {
|
|
534
|
+
{
|
|
535
|
+
if (typeof e != "object")
|
|
536
|
+
return;
|
|
537
|
+
if (_e(e))
|
|
538
|
+
for (var n = 0; n < e.length; n++) {
|
|
539
|
+
var c = e[n];
|
|
540
|
+
$e(c) && He(c, t);
|
|
541
|
+
}
|
|
542
|
+
else if ($e(e))
|
|
543
|
+
e._store && (e._store.validated = !0);
|
|
544
|
+
else if (e) {
|
|
545
|
+
var S = h(e);
|
|
546
|
+
if (typeof S == "function" && S !== e.entries)
|
|
547
|
+
for (var $ = S.call(e), j; !(j = $.next()).done; )
|
|
548
|
+
$e(j.value) && He(j.value, t);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
function Er(e) {
|
|
553
|
+
{
|
|
554
|
+
var t = e.type;
|
|
555
|
+
if (t == null || typeof t == "string")
|
|
556
|
+
return;
|
|
557
|
+
var n;
|
|
558
|
+
if (typeof t == "function")
|
|
559
|
+
n = t.propTypes;
|
|
560
|
+
else if (typeof t == "object" && (t.$$typeof === s || // Note: Memo only checks outer props here.
|
|
561
|
+
// Inner props are checked in the reconciler.
|
|
562
|
+
t.$$typeof === N))
|
|
563
|
+
n = t.propTypes;
|
|
564
|
+
else
|
|
565
|
+
return;
|
|
566
|
+
if (n) {
|
|
567
|
+
var c = q(t);
|
|
568
|
+
pr(n, e.props, "prop", c, e);
|
|
569
|
+
} else if (t.PropTypes !== void 0 && !De) {
|
|
570
|
+
De = !0;
|
|
571
|
+
var S = q(t);
|
|
572
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
573
|
+
}
|
|
574
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
function _r(e) {
|
|
578
|
+
{
|
|
579
|
+
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
580
|
+
var c = t[n];
|
|
581
|
+
if (c !== "children" && c !== "key") {
|
|
582
|
+
pe(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), pe(null);
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
e.ref !== null && (pe(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), pe(null));
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
var Qe = {};
|
|
590
|
+
function er(e, t, n, c, S, $) {
|
|
591
|
+
{
|
|
592
|
+
var j = ce(e);
|
|
593
|
+
if (!j) {
|
|
594
|
+
var k = "";
|
|
595
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
596
|
+
var Z = Tr();
|
|
597
|
+
Z ? k += Z : k += Je();
|
|
598
|
+
var F;
|
|
599
|
+
e === null ? F = "null" : _e(e) ? F = "array" : e !== void 0 && e.$$typeof === r ? (F = "<" + (q(e.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : F = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", F, k);
|
|
600
|
+
}
|
|
601
|
+
var W = Sr(e, t, n, S, $);
|
|
602
|
+
if (W == null)
|
|
603
|
+
return W;
|
|
604
|
+
if (j) {
|
|
605
|
+
var ae = t.children;
|
|
606
|
+
if (ae !== void 0)
|
|
607
|
+
if (c)
|
|
608
|
+
if (_e(ae)) {
|
|
609
|
+
for (var he = 0; he < ae.length; he++)
|
|
610
|
+
Ze(ae[he], e);
|
|
611
|
+
Object.freeze && Object.freeze(ae);
|
|
612
|
+
} else
|
|
613
|
+
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
614
|
+
else
|
|
615
|
+
Ze(ae, e);
|
|
616
|
+
}
|
|
617
|
+
if (de.call(t, "key")) {
|
|
618
|
+
var fe = q(e), ee = Object.keys(t).filter(function(Or) {
|
|
619
|
+
return Or !== "key";
|
|
620
|
+
}), Ne = ee.length > 0 ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
621
|
+
if (!Qe[fe + Ne]) {
|
|
622
|
+
var Nr = ee.length > 0 ? "{" + ee.join(": ..., ") + ": ...}" : "{}";
|
|
623
|
+
m(`A props object containing a "key" prop is being spread into JSX:
|
|
624
|
+
let props = %s;
|
|
625
|
+
<%s {...props} />
|
|
626
|
+
React keys must be passed directly to JSX without using spread:
|
|
627
|
+
let props = %s;
|
|
628
|
+
<%s key={someKey} {...props} />`, Ne, fe, Nr, fe), Qe[fe + Ne] = !0;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return e === a ? _r(W) : Er(W), W;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
function Mr(e, t, n) {
|
|
635
|
+
return er(e, t, n, !0);
|
|
636
|
+
}
|
|
637
|
+
function Pr(e, t, n) {
|
|
638
|
+
return er(e, t, n, !1);
|
|
639
|
+
}
|
|
640
|
+
var Dr = Pr, $r = Mr;
|
|
641
|
+
ke.Fragment = a, ke.jsx = Dr, ke.jsxs = $r;
|
|
642
|
+
}()), ke;
|
|
643
|
+
}
|
|
644
|
+
process.env.NODE_ENV === "production" ? Le.exports = St() : Le.exports = Tt();
|
|
645
|
+
var o = Le.exports;
|
|
646
|
+
const lr = {
|
|
647
|
+
token: {
|
|
648
|
+
itemNameColor: "#1a1a1a",
|
|
649
|
+
itemIconBackgroundColor: "white",
|
|
650
|
+
itemIconShadowColor: "rgba(0, 0, 0, 0.1)",
|
|
651
|
+
groupItemIconBackgroundColor: "rgba(255, 255, 255, 0.1)",
|
|
652
|
+
groupItemIconShadowColor: "rgba(0, 0, 0, 0.1)",
|
|
653
|
+
groupItemModalBackgroundColor: "rgba(255, 255, 255, 0.8)",
|
|
654
|
+
contextMenuTextColor: "black",
|
|
655
|
+
contextMenuActiveColor: "#f3f4f6",
|
|
656
|
+
contextMenuBackgroundColor: "white",
|
|
657
|
+
contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
|
|
658
|
+
}
|
|
659
|
+
}, cr = {
|
|
660
|
+
token: {
|
|
661
|
+
itemNameColor: "white",
|
|
662
|
+
itemIconBackgroundColor: "#1f2937",
|
|
663
|
+
itemIconShadowColor: "rgba(0, 0, 0, 0.1)",
|
|
664
|
+
groupItemIconBackgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
665
|
+
groupItemIconShadowColor: "rgba(0, 0, 0, 0.1)",
|
|
666
|
+
groupItemModalBackgroundColor: "rgba(0, 0, 0, 0.1)",
|
|
667
|
+
contextMenuTextColor: "white",
|
|
668
|
+
contextMenuActiveColor: "#1a1a1a",
|
|
669
|
+
contextMenuBackgroundColor: "#1a1a1a",
|
|
670
|
+
contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
|
|
671
|
+
}
|
|
672
|
+
}, ur = ar(
|
|
673
|
+
{}
|
|
674
|
+
), Rt = (d) => {
|
|
675
|
+
const { children: r, theme: i, ...a } = d, g = Ee(() => i === "light" ? lr : i === "dark" ? cr : i, [i]);
|
|
676
|
+
return /* @__PURE__ */ o.jsx(ur.Provider, { value: { theme: g, ...a }, children: r });
|
|
677
|
+
}, me = () => ir(ur), dr = {
|
|
678
|
+
maxRow: 2,
|
|
679
|
+
maxCol: 2
|
|
680
|
+
}, Et = {
|
|
681
|
+
...dr
|
|
682
|
+
}, fr = {
|
|
683
|
+
app: dr,
|
|
684
|
+
group: Et
|
|
685
|
+
};
|
|
686
|
+
class ie {
|
|
687
|
+
}
|
|
688
|
+
/** 清理重复id */
|
|
689
|
+
Oe(ie, "uniqueArray", (r) => r.reduce((i, a) => i.find((l) => l.id === a.id) ? i : i.concat([a]), [])), Oe(ie, "getTheme", (r) => {
|
|
690
|
+
const i = lr.token, a = cr.token, g = { ...i, ...r == null ? void 0 : r.token }, l = { ...a, ...r == null ? void 0 : r.token };
|
|
691
|
+
return { light: g, dark: l };
|
|
692
|
+
});
|
|
693
|
+
const mr = ar({
|
|
694
|
+
list: [],
|
|
695
|
+
setList: () => {
|
|
696
|
+
},
|
|
697
|
+
contextMenu: null,
|
|
698
|
+
setContextMenu: () => {
|
|
699
|
+
},
|
|
700
|
+
listStatus: null,
|
|
701
|
+
setListStatus: () => {
|
|
702
|
+
},
|
|
703
|
+
contextMenuFuns: () => {
|
|
704
|
+
},
|
|
705
|
+
hideContextMenu: () => {
|
|
706
|
+
},
|
|
707
|
+
showInfoItemData: null,
|
|
708
|
+
setShowInfoItemData: () => {
|
|
709
|
+
},
|
|
710
|
+
openGroupItemData: null,
|
|
711
|
+
setOpenGroupItemData: () => {
|
|
712
|
+
},
|
|
713
|
+
longPressTriggered: !1,
|
|
714
|
+
updateItem: () => {
|
|
715
|
+
},
|
|
716
|
+
updateItemConfig: () => {
|
|
717
|
+
},
|
|
718
|
+
removeItem: () => {
|
|
719
|
+
},
|
|
720
|
+
addItem: () => {
|
|
721
|
+
},
|
|
722
|
+
moveItemId: null,
|
|
723
|
+
setMoveItemId: () => {
|
|
724
|
+
},
|
|
725
|
+
moveTargetId: null,
|
|
726
|
+
setMoveTargetId: () => {
|
|
727
|
+
}
|
|
728
|
+
}), _t = (d) => {
|
|
729
|
+
const {
|
|
730
|
+
children: r,
|
|
731
|
+
list: i = [],
|
|
732
|
+
onChange: a,
|
|
733
|
+
storageKey: g = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
734
|
+
enableCaching: l = !0
|
|
735
|
+
} = d, [y, b] = oe(), [s, _] = oe(), [p, N] = oe(null), M = Be(p), [V, Y] = oe(null), [f, h] = oe([]), [T, m] = oe(
|
|
736
|
+
null
|
|
737
|
+
), [G, v] = oe(
|
|
738
|
+
null
|
|
739
|
+
), [P, R] = oe(!1), [x, C] = oe(null), [X, ce] = oe(
|
|
740
|
+
null
|
|
741
|
+
), [J, ge] = oe(!1), [q, re] = Yr(g, {
|
|
742
|
+
defaultValue: [],
|
|
743
|
+
listenStorageChange: !0
|
|
744
|
+
}), se = () => {
|
|
745
|
+
Y(null), clearTimeout(y), b(void 0), M.current = null;
|
|
746
|
+
}, B = (I, H) => {
|
|
747
|
+
Y({ ...I, pageX: I.pageX, pageY: I.pageY, data: H }), clearTimeout(y);
|
|
748
|
+
}, ne = (I, H = !0) => {
|
|
749
|
+
const { config: K = {} } = I;
|
|
750
|
+
return K.allowContextMenu === !1 ? {} : {
|
|
751
|
+
onMouseDown: (D) => {
|
|
752
|
+
b(
|
|
753
|
+
setTimeout(() => {
|
|
754
|
+
H && M.current === null && B(D, I);
|
|
755
|
+
}, 800)
|
|
756
|
+
), R(!1), _(
|
|
757
|
+
setTimeout(() => {
|
|
758
|
+
R(!0);
|
|
759
|
+
}, 800)
|
|
760
|
+
);
|
|
761
|
+
},
|
|
762
|
+
onMouseUp: () => {
|
|
763
|
+
clearTimeout(s), _(void 0), clearTimeout(y), b(void 0);
|
|
764
|
+
},
|
|
765
|
+
onContextMenu: (D) => {
|
|
766
|
+
H && (D.preventDefault(), B(D, I));
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}, le = (I, H) => {
|
|
770
|
+
const K = [...H || []];
|
|
771
|
+
if (K.length > 0)
|
|
772
|
+
h((D) => {
|
|
773
|
+
const L = [...D], O = (w) => {
|
|
774
|
+
var Se, Te;
|
|
775
|
+
const E = K.shift(), z = w.find((Q) => Q.id === E), te = w.findIndex((Q) => Q.id === E);
|
|
776
|
+
if (K.length && z) {
|
|
777
|
+
if (((Se = z.children) == null ? void 0 : Se.filter(
|
|
778
|
+
(Q) => !I.some((de) => de.id === Q.id)
|
|
779
|
+
).length) === 1 && I.length === 1) {
|
|
780
|
+
const Q = { ...I[0] };
|
|
781
|
+
return w.splice(te, 1, Q), a == null || a(w), w;
|
|
782
|
+
}
|
|
783
|
+
return z.children = O(z.children || []), w.splice(te, 1, z), a == null || a(w), w;
|
|
784
|
+
}
|
|
785
|
+
if (z) {
|
|
786
|
+
if (!((Te = z.children) != null && Te.length) && I.length) {
|
|
787
|
+
const Q = { ...z };
|
|
788
|
+
return z.data = { name: "文件夹" }, z.type = "group", z.children = [Q, ...I], z.id = rr(), w.splice(te, 1, z), a == null || a(w), w;
|
|
789
|
+
}
|
|
790
|
+
return z.children = ie.uniqueArray(I), w.splice(te, 1, z), a == null || a(w), w;
|
|
791
|
+
}
|
|
792
|
+
return ie.uniqueArray(I);
|
|
793
|
+
};
|
|
794
|
+
return ie.uniqueArray(O(L));
|
|
795
|
+
});
|
|
796
|
+
else {
|
|
797
|
+
const D = ie.uniqueArray(I);
|
|
798
|
+
a == null || a(D), h(D);
|
|
799
|
+
}
|
|
800
|
+
}, Ce = (I, H) => {
|
|
801
|
+
h((K) => {
|
|
802
|
+
const D = [...K], L = (O) => {
|
|
803
|
+
var w;
|
|
804
|
+
for (let E = 0; E < O.length; E++)
|
|
805
|
+
if (O[E].id === I) {
|
|
806
|
+
O[E].config = H;
|
|
807
|
+
break;
|
|
808
|
+
} else ((w = O[E].children) == null ? void 0 : w.length) !== void 0 && L(O[E].children);
|
|
809
|
+
};
|
|
810
|
+
return L(D), a == null || a(D), D;
|
|
811
|
+
});
|
|
812
|
+
}, we = (I, H) => {
|
|
813
|
+
h((K) => {
|
|
814
|
+
const D = [...K], L = (O) => {
|
|
815
|
+
var w;
|
|
816
|
+
for (let E = 0; E < O.length; E++)
|
|
817
|
+
if (O[E].id === I) {
|
|
818
|
+
O[E].data = H;
|
|
819
|
+
break;
|
|
820
|
+
} else ((w = O[E].children) == null ? void 0 : w.length) !== void 0 && L(O[E].children);
|
|
821
|
+
};
|
|
822
|
+
return L(D), a == null || a(D), D;
|
|
823
|
+
});
|
|
824
|
+
}, je = (I) => {
|
|
825
|
+
h((H) => {
|
|
826
|
+
const K = [...H], D = (L) => {
|
|
827
|
+
var O;
|
|
828
|
+
for (let w = 0; w < L.length; w++)
|
|
829
|
+
if (L[w].id === I) {
|
|
830
|
+
L.splice(w, 1);
|
|
831
|
+
break;
|
|
832
|
+
} else ((O = L[w].children) == null ? void 0 : O.length) !== void 0 && D(L[w].children);
|
|
833
|
+
};
|
|
834
|
+
return D(K), a == null || a(K), K;
|
|
835
|
+
});
|
|
836
|
+
}, Ie = (I, H) => {
|
|
837
|
+
const K = [...f], D = (L, O) => {
|
|
838
|
+
const w = O.shift(), E = L.find((te) => te.id === w), z = L.findIndex((te) => te.id === w);
|
|
839
|
+
if (E) {
|
|
840
|
+
if (O.length)
|
|
841
|
+
E.children = D(E.children || [], O);
|
|
842
|
+
else {
|
|
843
|
+
const te = (I == null ? void 0 : I.type) ?? "app";
|
|
844
|
+
E.children = [
|
|
845
|
+
...E.children ?? [],
|
|
846
|
+
{
|
|
847
|
+
...I,
|
|
848
|
+
id: rr(),
|
|
849
|
+
config: (I == null ? void 0 : I.config) ?? fr[te]
|
|
850
|
+
}
|
|
851
|
+
];
|
|
852
|
+
}
|
|
853
|
+
return L.splice(z, 1, E), L;
|
|
854
|
+
} else
|
|
855
|
+
return L;
|
|
856
|
+
};
|
|
857
|
+
h(D(K, H));
|
|
858
|
+
};
|
|
859
|
+
return ye(() => {
|
|
860
|
+
(i == null ? void 0 : i.length) > 0 && f.length === 0 && le(i);
|
|
861
|
+
}, [i]), ye(() => {
|
|
862
|
+
M.current = p, p !== null && se();
|
|
863
|
+
}, [p]), ye(() => {
|
|
864
|
+
l && q != null && q.length && !J && (le(q), ge(!0));
|
|
865
|
+
}, [q, J, l]), Wr(
|
|
866
|
+
() => {
|
|
867
|
+
l && re(f);
|
|
868
|
+
},
|
|
869
|
+
[f, l],
|
|
870
|
+
{
|
|
871
|
+
wait: 1e3
|
|
872
|
+
}
|
|
873
|
+
), /* @__PURE__ */ o.jsx(
|
|
874
|
+
mr.Provider,
|
|
875
|
+
{
|
|
876
|
+
value: {
|
|
877
|
+
list: f,
|
|
878
|
+
setList: le,
|
|
879
|
+
contextMenu: V,
|
|
880
|
+
setContextMenu: Y,
|
|
881
|
+
listStatus: p,
|
|
882
|
+
setListStatus: N,
|
|
883
|
+
contextMenuFuns: ne,
|
|
884
|
+
hideContextMenu: se,
|
|
885
|
+
showInfoItemData: T,
|
|
886
|
+
setShowInfoItemData: m,
|
|
887
|
+
openGroupItemData: G,
|
|
888
|
+
setOpenGroupItemData: v,
|
|
889
|
+
longPressTriggered: P,
|
|
890
|
+
updateItemConfig: Ce,
|
|
891
|
+
updateItem: we,
|
|
892
|
+
removeItem: je,
|
|
893
|
+
addItem: Ie,
|
|
894
|
+
moveItemId: x,
|
|
895
|
+
setMoveItemId: C,
|
|
896
|
+
moveTargetId: X,
|
|
897
|
+
setMoveTargetId: ce
|
|
898
|
+
},
|
|
899
|
+
children: r
|
|
900
|
+
}
|
|
901
|
+
);
|
|
902
|
+
}, ve = () => ir(mr), Mt = {
|
|
903
|
+
menuShow: {
|
|
904
|
+
opacity: 1,
|
|
905
|
+
y: 0,
|
|
906
|
+
transition: { type: "spring", stiffness: 300, damping: 24 }
|
|
907
|
+
},
|
|
908
|
+
menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
|
|
909
|
+
}, Ae = (d) => {
|
|
910
|
+
const { icon: r, title: i, onClick: a } = d, { theme: g } = me(), { light: l, dark: y } = ie.getTheme(g);
|
|
911
|
+
return /* @__PURE__ */ o.jsx(
|
|
912
|
+
A.div,
|
|
913
|
+
{
|
|
914
|
+
className: u`
|
|
915
|
+
&:hover {
|
|
916
|
+
background-color: ${l.contextMenuActiveColor};
|
|
917
|
+
@media (prefers-color-scheme: dark) {
|
|
918
|
+
background-color: ${y.contextMenuActiveColor};
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
@media (prefers-color-scheme: dark) {
|
|
922
|
+
color: black;
|
|
923
|
+
}
|
|
924
|
+
font-size: 0.75rem;
|
|
925
|
+
line-height: 1rem;
|
|
926
|
+
cursor: pointer;
|
|
927
|
+
transition: all 0.3s;
|
|
928
|
+
user-select: none;
|
|
929
|
+
border-radius: 0.5rem;
|
|
930
|
+
`,
|
|
931
|
+
onClick: (b) => {
|
|
932
|
+
b.stopPropagation(), a == null || a();
|
|
933
|
+
},
|
|
934
|
+
variants: Mt,
|
|
935
|
+
children: /* @__PURE__ */ o.jsxs(
|
|
936
|
+
A.div,
|
|
937
|
+
{
|
|
938
|
+
className: U(
|
|
939
|
+
"py-1.5 px-3 rounded-lg",
|
|
940
|
+
u`
|
|
941
|
+
padding-top: 0.375rem;
|
|
942
|
+
padding-bottom: 0.375rem;
|
|
943
|
+
padding-left: 0.75rem;
|
|
944
|
+
padding-right: 0.75rem;
|
|
945
|
+
border-radius: 0.5rem;
|
|
946
|
+
`
|
|
947
|
+
),
|
|
948
|
+
whileTap: { scale: 0.9 },
|
|
949
|
+
children: [
|
|
950
|
+
/* @__PURE__ */ o.jsx(
|
|
951
|
+
A.div,
|
|
952
|
+
{
|
|
953
|
+
className: U(
|
|
954
|
+
u`
|
|
955
|
+
margin-bottom: 0.375rem;
|
|
956
|
+
display: flex;
|
|
957
|
+
justify-content: center;
|
|
958
|
+
`
|
|
959
|
+
),
|
|
960
|
+
children: r
|
|
961
|
+
}
|
|
962
|
+
),
|
|
963
|
+
/* @__PURE__ */ o.jsx(A.div, { children: i })
|
|
964
|
+
]
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
}, Pt = (d) => {
|
|
970
|
+
const {
|
|
971
|
+
showInfoButton: r = !0,
|
|
972
|
+
showRemoveButton: i = !0,
|
|
973
|
+
showShareButton: a = !0,
|
|
974
|
+
showSizeButton: g = !0,
|
|
975
|
+
onInfoClick: l,
|
|
976
|
+
onShareClick: y,
|
|
977
|
+
onRemoveClick: b
|
|
978
|
+
} = d, {
|
|
979
|
+
contextMenu: s,
|
|
980
|
+
setContextMenu: _,
|
|
981
|
+
hideContextMenu: p,
|
|
982
|
+
setShowInfoItemData: N,
|
|
983
|
+
removeItem: M,
|
|
984
|
+
updateItemConfig: V
|
|
985
|
+
} = ve(), { theme: Y } = me(), { light: f, dark: h } = ie.getTheme(Y), { data: T } = s ?? {}, { config: m = {} } = T ?? {}, G = () => {
|
|
986
|
+
var R;
|
|
987
|
+
const v = fr[(R = s == null ? void 0 : s.data) == null ? void 0 : R.type], P = [];
|
|
988
|
+
for (let x = 1; x <= ((v == null ? void 0 : v.maxRow) ?? 2); x++)
|
|
989
|
+
for (let C = 1; C <= ((v == null ? void 0 : v.maxCol) ?? 2); C++)
|
|
990
|
+
P.push(`${x}x${C}`);
|
|
991
|
+
return P;
|
|
992
|
+
};
|
|
993
|
+
return /* @__PURE__ */ o.jsx(Fr, { children: s && /* @__PURE__ */ o.jsxs(
|
|
994
|
+
A.div,
|
|
995
|
+
{
|
|
996
|
+
initial: { opacity: 0 },
|
|
997
|
+
animate: { opacity: 1 },
|
|
998
|
+
exit: { opacity: 0 },
|
|
999
|
+
onMouseDown: (v) => {
|
|
1000
|
+
v.stopPropagation(), v.preventDefault();
|
|
1001
|
+
},
|
|
1002
|
+
children: [
|
|
1003
|
+
/* @__PURE__ */ o.jsx(
|
|
1004
|
+
A.div,
|
|
1005
|
+
{
|
|
1006
|
+
className: U(
|
|
1007
|
+
u`
|
|
1008
|
+
border-radius: 0.5rem;
|
|
1009
|
+
overflow: hidden;
|
|
1010
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
1011
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
1012
|
+
@media (prefers-color-scheme: dark) {
|
|
1013
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
1014
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
1015
|
+
}
|
|
1016
|
+
`
|
|
1017
|
+
),
|
|
1018
|
+
children: g && m.allowResize !== !1 && /* @__PURE__ */ o.jsx(
|
|
1019
|
+
A.ul,
|
|
1020
|
+
{
|
|
1021
|
+
className: u`
|
|
1022
|
+
background-color: white;
|
|
1023
|
+
padding: 0.25rem;
|
|
1024
|
+
margin: 0;
|
|
1025
|
+
`,
|
|
1026
|
+
children: [
|
|
1027
|
+
{
|
|
1028
|
+
label: "修改大小",
|
|
1029
|
+
key: "size",
|
|
1030
|
+
icon: /* @__PURE__ */ o.jsx(Vr, { size: 14 }),
|
|
1031
|
+
items: G().map((v) => ({
|
|
1032
|
+
label: v,
|
|
1033
|
+
key: v,
|
|
1034
|
+
onClick: () => {
|
|
1035
|
+
const [P, R] = v.split("x").map(Number);
|
|
1036
|
+
V(s.data.id, {
|
|
1037
|
+
row: P,
|
|
1038
|
+
col: R
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
}))
|
|
1042
|
+
}
|
|
1043
|
+
].map((v) => /* @__PURE__ */ o.jsxs(
|
|
1044
|
+
A.li,
|
|
1045
|
+
{
|
|
1046
|
+
className: u`
|
|
1047
|
+
padding-top: 0.5rem;
|
|
1048
|
+
padding-bottom: 0.5rem;
|
|
1049
|
+
padding-left: 0.75rem;
|
|
1050
|
+
padding-right: 0.75rem;
|
|
1051
|
+
`,
|
|
1052
|
+
children: [
|
|
1053
|
+
/* @__PURE__ */ o.jsxs(
|
|
1054
|
+
A.p,
|
|
1055
|
+
{
|
|
1056
|
+
className: u`
|
|
1057
|
+
display: flex;
|
|
1058
|
+
align-items: center;
|
|
1059
|
+
font-size: 0.875rem;
|
|
1060
|
+
line-height: 1.25rem;
|
|
1061
|
+
gap: 0.5rem;
|
|
1062
|
+
padding-bottom: 0.5rem;
|
|
1063
|
+
margin: 0;
|
|
1064
|
+
`,
|
|
1065
|
+
children: [
|
|
1066
|
+
v.icon,
|
|
1067
|
+
" ",
|
|
1068
|
+
v.label
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
),
|
|
1072
|
+
/* @__PURE__ */ o.jsx(
|
|
1073
|
+
A.div,
|
|
1074
|
+
{
|
|
1075
|
+
className: u`
|
|
1076
|
+
display: grid;
|
|
1077
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1078
|
+
gap: 0.25rem;
|
|
1079
|
+
`,
|
|
1080
|
+
children: v.items.map((P) => /* @__PURE__ */ o.jsx(
|
|
1081
|
+
A.div,
|
|
1082
|
+
{
|
|
1083
|
+
className: U(
|
|
1084
|
+
"py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
|
|
1085
|
+
u`
|
|
1086
|
+
padding-top: 0.25rem;
|
|
1087
|
+
padding-bottom: 0.25rem;
|
|
1088
|
+
padding-left: 0.5rem;
|
|
1089
|
+
padding-right: 0.5rem;
|
|
1090
|
+
border-radius: 0.25rem;
|
|
1091
|
+
transition: all 0.3s;
|
|
1092
|
+
font-size: 0.875rem;
|
|
1093
|
+
line-height: 1.25rem;
|
|
1094
|
+
cursor: pointer;
|
|
1095
|
+
text-align: center;
|
|
1096
|
+
color: ${f.contextMenuTextColor};
|
|
1097
|
+
@media (prefers-color-scheme: dark) {
|
|
1098
|
+
color: ${h.contextMenuTextColor};
|
|
1099
|
+
}
|
|
1100
|
+
&:hover {
|
|
1101
|
+
background-color: ${f.contextMenuActiveColor};
|
|
1102
|
+
@media (prefers-color-scheme: dark) {
|
|
1103
|
+
background-color: ${h.contextMenuActiveColor};
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
`,
|
|
1107
|
+
`${m.row}x${m.col}` === P.key && u`
|
|
1108
|
+
background-color: ${f.contextMenuActiveColor};
|
|
1109
|
+
@media (prefers-color-scheme: dark) {
|
|
1110
|
+
background-color: ${h.contextMenuActiveColor};
|
|
1111
|
+
}
|
|
1112
|
+
`
|
|
1113
|
+
),
|
|
1114
|
+
onClick: P.onClick,
|
|
1115
|
+
children: P.label
|
|
1116
|
+
},
|
|
1117
|
+
P.key
|
|
1118
|
+
))
|
|
1119
|
+
}
|
|
1120
|
+
)
|
|
1121
|
+
]
|
|
1122
|
+
},
|
|
1123
|
+
v.key
|
|
1124
|
+
))
|
|
1125
|
+
}
|
|
1126
|
+
)
|
|
1127
|
+
}
|
|
1128
|
+
),
|
|
1129
|
+
/* @__PURE__ */ o.jsxs(
|
|
1130
|
+
A.div,
|
|
1131
|
+
{
|
|
1132
|
+
className: U(
|
|
1133
|
+
u`
|
|
1134
|
+
background-color: ${f.contextMenuBackgroundColor};
|
|
1135
|
+
box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
|
|
1136
|
+
@media (prefers-color-scheme: dark) {
|
|
1137
|
+
background-color: ${h.contextMenuBackgroundColor};
|
|
1138
|
+
box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
|
|
1139
|
+
}
|
|
1140
|
+
display: flex;
|
|
1141
|
+
justify-content: space-around;
|
|
1142
|
+
align-items: center;
|
|
1143
|
+
margin-top: 0.5rem;
|
|
1144
|
+
border-radius: 0.5rem;
|
|
1145
|
+
overflow: hidden;
|
|
1146
|
+
padding: 0.25rem;
|
|
1147
|
+
`
|
|
1148
|
+
),
|
|
1149
|
+
children: [
|
|
1150
|
+
a && /* @__PURE__ */ o.jsx(
|
|
1151
|
+
Ae,
|
|
1152
|
+
{
|
|
1153
|
+
icon: /* @__PURE__ */ o.jsx(zr, { size: 20 }),
|
|
1154
|
+
title: "分享",
|
|
1155
|
+
onClick: () => {
|
|
1156
|
+
if (y) {
|
|
1157
|
+
y(s.data);
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
),
|
|
1163
|
+
r && /* @__PURE__ */ o.jsx(
|
|
1164
|
+
Ae,
|
|
1165
|
+
{
|
|
1166
|
+
icon: /* @__PURE__ */ o.jsx(Gr, { size: 20 }),
|
|
1167
|
+
title: "信息",
|
|
1168
|
+
onClick: () => {
|
|
1169
|
+
if (l) {
|
|
1170
|
+
l(s.data);
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
N({
|
|
1174
|
+
...s.data,
|
|
1175
|
+
pageX: s.pageX,
|
|
1176
|
+
pageY: s.pageY
|
|
1177
|
+
}), p();
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
),
|
|
1181
|
+
i && /* @__PURE__ */ o.jsx(
|
|
1182
|
+
Ae,
|
|
1183
|
+
{
|
|
1184
|
+
icon: /* @__PURE__ */ o.jsx(Xr, { size: 20 }),
|
|
1185
|
+
title: "移除",
|
|
1186
|
+
onClick: () => {
|
|
1187
|
+
if (b) {
|
|
1188
|
+
b(s.data, M);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
_(null), M(s.data.id);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
)
|
|
1195
|
+
]
|
|
1196
|
+
}
|
|
1197
|
+
)
|
|
1198
|
+
]
|
|
1199
|
+
}
|
|
1200
|
+
) });
|
|
1201
|
+
}, Dt = (d) => {
|
|
1202
|
+
const { data: r, noLetters: i = !1 } = d, { contextMenuFuns: a } = ve(), { itemIconBuilder: g, theme: l, contextMenu: y } = me(), { light: b, dark: s } = ie.getTheme(l), { data: _ = {} } = r, { name: p } = _;
|
|
1203
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
1204
|
+
/* @__PURE__ */ o.jsx(
|
|
1205
|
+
A.div,
|
|
1206
|
+
{
|
|
1207
|
+
className: u`
|
|
1208
|
+
width: 4rem;
|
|
1209
|
+
height: 4rem;
|
|
1210
|
+
background-color: ${b.itemIconBackgroundColor};
|
|
1211
|
+
border-radius: 0.75rem;
|
|
1212
|
+
box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
|
|
1213
|
+
cursor: pointer;
|
|
1214
|
+
position: relative;
|
|
1215
|
+
overflow: hidden;
|
|
1216
|
+
@media (prefers-color-scheme: dark) {
|
|
1217
|
+
background-color: ${s.itemIconBackgroundColor};
|
|
1218
|
+
box-shadow: 0 0 0.5rem ${s.itemIconShadowColor};
|
|
1219
|
+
}
|
|
1220
|
+
`,
|
|
1221
|
+
whileTap: { scale: 0.9 },
|
|
1222
|
+
children: /* @__PURE__ */ o.jsx(
|
|
1223
|
+
"div",
|
|
1224
|
+
{
|
|
1225
|
+
className: u`
|
|
1226
|
+
position: absolute;
|
|
1227
|
+
left: 0;
|
|
1228
|
+
top: 0;
|
|
1229
|
+
width: 100%;
|
|
1230
|
+
height: 100%;
|
|
1231
|
+
color: ${b.itemNameColor};
|
|
1232
|
+
@media (prefers-color-scheme: dark) {
|
|
1233
|
+
color: ${s.itemNameColor};
|
|
1234
|
+
}
|
|
1235
|
+
`,
|
|
1236
|
+
...a(r, y !== !1),
|
|
1237
|
+
children: g == null ? void 0 : g(r)
|
|
1238
|
+
}
|
|
1239
|
+
)
|
|
1240
|
+
}
|
|
1241
|
+
),
|
|
1242
|
+
/* @__PURE__ */ o.jsx(
|
|
1243
|
+
A.p,
|
|
1244
|
+
{
|
|
1245
|
+
className: U(
|
|
1246
|
+
u`
|
|
1247
|
+
text-align: center;
|
|
1248
|
+
margin-top: 0.25rem;
|
|
1249
|
+
margin-bottom: 0;
|
|
1250
|
+
color: ${b.itemNameColor};
|
|
1251
|
+
@media (prefers-color-scheme: dark) {
|
|
1252
|
+
color: ${s.itemNameColor};
|
|
1253
|
+
}
|
|
1254
|
+
`,
|
|
1255
|
+
i && u`
|
|
1256
|
+
color: transparent;
|
|
1257
|
+
`
|
|
1258
|
+
),
|
|
1259
|
+
children: p
|
|
1260
|
+
}
|
|
1261
|
+
)
|
|
1262
|
+
] });
|
|
1263
|
+
}, Ye = (d) => {
|
|
1264
|
+
const {
|
|
1265
|
+
data: r,
|
|
1266
|
+
className: i,
|
|
1267
|
+
itemIndex: a,
|
|
1268
|
+
onClick: g,
|
|
1269
|
+
disabledDrag: l = !1,
|
|
1270
|
+
children: y,
|
|
1271
|
+
parentIds: b,
|
|
1272
|
+
childrenLength: s
|
|
1273
|
+
} = d, { contextMenu: _, setContextMenu: p } = ve(), { contextMenu: N } = me();
|
|
1274
|
+
return /* @__PURE__ */ o.jsx(
|
|
1275
|
+
Ur,
|
|
1276
|
+
{
|
|
1277
|
+
placement: "bottom",
|
|
1278
|
+
overlayClassName: u`
|
|
1279
|
+
background-color: transparent;
|
|
1280
|
+
.rc-tooltip-inner {
|
|
1281
|
+
background-color: transparent;
|
|
1282
|
+
padding: 0;
|
|
1283
|
+
border: none;
|
|
1284
|
+
}
|
|
1285
|
+
`,
|
|
1286
|
+
overlay: /* @__PURE__ */ o.jsx(Pt, { ...N }),
|
|
1287
|
+
visible: (_ == null ? void 0 : _.data.id) === r.id,
|
|
1288
|
+
onVisibleChange: (M) => {
|
|
1289
|
+
M || p(null);
|
|
1290
|
+
},
|
|
1291
|
+
destroyTooltipOnHide: !0,
|
|
1292
|
+
children: /* @__PURE__ */ o.jsx(
|
|
1293
|
+
A.div,
|
|
1294
|
+
{
|
|
1295
|
+
"data-id": r.id,
|
|
1296
|
+
"data-index": a,
|
|
1297
|
+
"data-parent-ids": b == null ? void 0 : b.join(","),
|
|
1298
|
+
"data-children-length": s,
|
|
1299
|
+
onClick: () => g == null ? void 0 : g(r),
|
|
1300
|
+
className: U(l && "drag-disabled", i),
|
|
1301
|
+
children: y ?? /* @__PURE__ */ o.jsx(Dt, { ...d })
|
|
1302
|
+
}
|
|
1303
|
+
)
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
}, $t = (d) => {
|
|
1307
|
+
const {
|
|
1308
|
+
data: r,
|
|
1309
|
+
className: i,
|
|
1310
|
+
parentIds: a,
|
|
1311
|
+
itemIndex: g,
|
|
1312
|
+
onClick: l,
|
|
1313
|
+
noLetters: y = !1
|
|
1314
|
+
} = d, {
|
|
1315
|
+
contextMenuFuns: b,
|
|
1316
|
+
setList: s,
|
|
1317
|
+
setOpenGroupItemData: _,
|
|
1318
|
+
longPressTriggered: p,
|
|
1319
|
+
moveItemId: N,
|
|
1320
|
+
moveTargetId: M,
|
|
1321
|
+
setMoveTargetId: V,
|
|
1322
|
+
listStatus: Y
|
|
1323
|
+
} = ve(), { itemIconBuilder: f, theme: h, contextMenu: T } = me(), { light: m, dark: G } = ie.getTheme(h), { children: v, data: P, config: R } = r, { row: x = 1, col: C = 1 } = R ?? {}, X = {
|
|
1324
|
+
visible: { opacity: 1, scale: 1 },
|
|
1325
|
+
hidden: { opacity: 0, scale: 0.95 }
|
|
1326
|
+
}, ce = ((v == null ? void 0 : v.length) ?? 0) === 0, J = ce ? [r] : [...v ?? []].slice(0, 9), ge = Ee(() => N === r.id.toString(), [r.id, N]), q = Ee(() => M === r.id, [r.id, M]), re = u`
|
|
1327
|
+
overflow: hidden;
|
|
1328
|
+
cursor: pointer;
|
|
1329
|
+
background-color: ${m.itemIconBackgroundColor};
|
|
1330
|
+
box-shadow: 0 0 0.5rem ${m.itemIconShadowColor};
|
|
1331
|
+
@media (prefers-color-scheme: dark) {
|
|
1332
|
+
background-color: ${G.itemIconBackgroundColor};
|
|
1333
|
+
box-shadow: 0 0 0.5rem ${G.itemIconShadowColor};
|
|
1334
|
+
}
|
|
1335
|
+
`, se = () => {
|
|
1336
|
+
if (ce)
|
|
1337
|
+
return /* @__PURE__ */ o.jsx(
|
|
1338
|
+
A.div,
|
|
1339
|
+
{
|
|
1340
|
+
className: U(
|
|
1341
|
+
"sortable-group-item",
|
|
1342
|
+
u`
|
|
1343
|
+
overflow: hidden;
|
|
1344
|
+
cursor: pointer;
|
|
1345
|
+
width: 100%;
|
|
1346
|
+
height: 100%;
|
|
1347
|
+
background-color: ${m.itemIconBackgroundColor};
|
|
1348
|
+
position: absolute;
|
|
1349
|
+
left: 0;
|
|
1350
|
+
top: 0;
|
|
1351
|
+
border-radius: 0.75rem;
|
|
1352
|
+
@media (prefers-color-scheme: dark) {
|
|
1353
|
+
background-color: ${G.itemIconBackgroundColor};
|
|
1354
|
+
}
|
|
1355
|
+
`
|
|
1356
|
+
),
|
|
1357
|
+
onClick: (B) => {
|
|
1358
|
+
B.stopPropagation(), l == null || l(r);
|
|
1359
|
+
},
|
|
1360
|
+
children: f == null ? void 0 : f(r)
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
1363
|
+
if (x === 1 && C === 1 || x === 2 && C === 2)
|
|
1364
|
+
return /* @__PURE__ */ o.jsx(
|
|
1365
|
+
A.div,
|
|
1366
|
+
{
|
|
1367
|
+
className: u`
|
|
1368
|
+
display: grid;
|
|
1369
|
+
width: 100%;
|
|
1370
|
+
height: 100%;
|
|
1371
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
1372
|
+
grid-template-rows: repeat(3, minmax(0, 1fr));
|
|
1373
|
+
padding: ${C === 1 ? "0.125rem" : "0.25rem"};
|
|
1374
|
+
gap: ${C === 1 ? "0.125rem" : "0.5rem"};
|
|
1375
|
+
place-items: center;
|
|
1376
|
+
`,
|
|
1377
|
+
children: J == null ? void 0 : J.slice(0, 9).map((B) => /* @__PURE__ */ o.jsx(
|
|
1378
|
+
A.div,
|
|
1379
|
+
{
|
|
1380
|
+
className: U(
|
|
1381
|
+
re,
|
|
1382
|
+
u`
|
|
1383
|
+
border-radius: ${C === 1 ? "0.25rem" : "0.5rem"};
|
|
1384
|
+
width: 100%;
|
|
1385
|
+
height: 100%;
|
|
1386
|
+
`
|
|
1387
|
+
),
|
|
1388
|
+
onClick: (ne) => {
|
|
1389
|
+
ne.stopPropagation(), l == null || l(B);
|
|
1390
|
+
},
|
|
1391
|
+
children: f == null ? void 0 : f(B)
|
|
1392
|
+
},
|
|
1393
|
+
B.id
|
|
1394
|
+
))
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1397
|
+
if (x === 1 && C === 2)
|
|
1398
|
+
return /* @__PURE__ */ o.jsx(
|
|
1399
|
+
A.div,
|
|
1400
|
+
{
|
|
1401
|
+
className: u`
|
|
1402
|
+
display: grid;
|
|
1403
|
+
grid-template-columns: repeat(10, minmax(0, 1fr));
|
|
1404
|
+
grid-template-rows: repeat(4, minmax(0, 1fr));
|
|
1405
|
+
column-gap: 0.5rem;
|
|
1406
|
+
row-gap: 0.25rem;
|
|
1407
|
+
width: 144px;
|
|
1408
|
+
height: 52px;
|
|
1409
|
+
place-items: center;
|
|
1410
|
+
`,
|
|
1411
|
+
children: J == null ? void 0 : J.slice(0, 4).map((B, ne) => /* @__PURE__ */ o.jsx(
|
|
1412
|
+
A.div,
|
|
1413
|
+
{
|
|
1414
|
+
className: U(
|
|
1415
|
+
re,
|
|
1416
|
+
ne < 2 ? u`
|
|
1417
|
+
width: 52px;
|
|
1418
|
+
height: 52px;
|
|
1419
|
+
border-radius: 0.5rem;
|
|
1420
|
+
grid-column: span 4 / span 4;
|
|
1421
|
+
grid-row: span 4 / span 4;
|
|
1422
|
+
` : u`
|
|
1423
|
+
width: 1.5rem;
|
|
1424
|
+
height: 1.5rem;
|
|
1425
|
+
border-radius: 0.375rem;
|
|
1426
|
+
grid-column: span 2 / span 2;
|
|
1427
|
+
grid-row: span 2 / span 2;
|
|
1428
|
+
`
|
|
1429
|
+
),
|
|
1430
|
+
onClick: (le) => {
|
|
1431
|
+
ne > 2 || (le.stopPropagation(), l == null || l(B));
|
|
1432
|
+
},
|
|
1433
|
+
children: f == null ? void 0 : f(B)
|
|
1434
|
+
},
|
|
1435
|
+
B.id
|
|
1436
|
+
))
|
|
1437
|
+
}
|
|
1438
|
+
);
|
|
1439
|
+
if (x === 2 && C === 1)
|
|
1440
|
+
return /* @__PURE__ */ o.jsx(
|
|
1441
|
+
A.div,
|
|
1442
|
+
{
|
|
1443
|
+
className: u`
|
|
1444
|
+
display: grid;
|
|
1445
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
1446
|
+
grid-template-rows: repeat(10, minmax(0, 1fr));
|
|
1447
|
+
column-gap: 0.25rem;
|
|
1448
|
+
row-gap: 0.5rem;
|
|
1449
|
+
width: 52px;
|
|
1450
|
+
height: 144px;
|
|
1451
|
+
place-items: center;
|
|
1452
|
+
`,
|
|
1453
|
+
children: J == null ? void 0 : J.slice(0, 4).map((B, ne) => /* @__PURE__ */ o.jsx(
|
|
1454
|
+
A.div,
|
|
1455
|
+
{
|
|
1456
|
+
className: U(
|
|
1457
|
+
re,
|
|
1458
|
+
ne < 2 ? u`
|
|
1459
|
+
width: 52px;
|
|
1460
|
+
height: 52px;
|
|
1461
|
+
border-radius: 0.5rem;
|
|
1462
|
+
grid-column: span 4 / span 4;
|
|
1463
|
+
grid-row: span 4 / span 4;
|
|
1464
|
+
` : u`
|
|
1465
|
+
width: 1.5rem;
|
|
1466
|
+
height: 1.5rem;
|
|
1467
|
+
grid-column: span 2 / span 2;
|
|
1468
|
+
grid-row: span 2 / span 2;
|
|
1469
|
+
`
|
|
1470
|
+
),
|
|
1471
|
+
onClick: (le) => {
|
|
1472
|
+
ne > 2 || (le.stopPropagation(), l == null || l(B));
|
|
1473
|
+
},
|
|
1474
|
+
children: f == null ? void 0 : f(B)
|
|
1475
|
+
},
|
|
1476
|
+
B.id
|
|
1477
|
+
))
|
|
1478
|
+
}
|
|
1479
|
+
);
|
|
1480
|
+
};
|
|
1481
|
+
return /* @__PURE__ */ o.jsxs(
|
|
1482
|
+
Ye,
|
|
1483
|
+
{
|
|
1484
|
+
data: r,
|
|
1485
|
+
itemIndex: g,
|
|
1486
|
+
parentIds: a,
|
|
1487
|
+
childrenLength: v == null ? void 0 : v.length,
|
|
1488
|
+
className: U(
|
|
1489
|
+
u`
|
|
1490
|
+
grid-row: span ${x};
|
|
1491
|
+
grid-column: span ${C};
|
|
1492
|
+
`,
|
|
1493
|
+
i
|
|
1494
|
+
),
|
|
1495
|
+
children: [
|
|
1496
|
+
/* @__PURE__ */ o.jsx(
|
|
1497
|
+
A.div,
|
|
1498
|
+
{
|
|
1499
|
+
whileTap: { scale: 0.9 },
|
|
1500
|
+
className: U(
|
|
1501
|
+
q ? "!scale-110" : "",
|
|
1502
|
+
u`
|
|
1503
|
+
cursor: pointer;
|
|
1504
|
+
position: relative;
|
|
1505
|
+
border-radius: 0.75rem;
|
|
1506
|
+
background-color: ${m.groupItemIconBackgroundColor};
|
|
1507
|
+
box-shadow: 0 0 0.5rem ${m.groupItemIconShadowColor};
|
|
1508
|
+
@media (prefers-color-scheme: dark) {
|
|
1509
|
+
background-color: ${G.groupItemIconBackgroundColor};
|
|
1510
|
+
box-shadow: 0 0 0.5rem ${G.groupItemIconShadowColor};
|
|
1511
|
+
}
|
|
1512
|
+
/* overflow: hidden; */
|
|
1513
|
+
transition: all 0.3s;
|
|
1514
|
+
margin: 0 auto;
|
|
1515
|
+
width: ${C * 64 + 32 * (C - 1)}px;
|
|
1516
|
+
height: ${x * 64 + 32 * (x - 1)}px;
|
|
1517
|
+
`
|
|
1518
|
+
),
|
|
1519
|
+
onClick: (B) => {
|
|
1520
|
+
!ce && !p && (r.parentIds = a, r.pageX = B.pageX, r.pageY = B.pageY, _(r));
|
|
1521
|
+
},
|
|
1522
|
+
...b(r, T !== !1),
|
|
1523
|
+
children: /* @__PURE__ */ o.jsxs(
|
|
1524
|
+
A.div,
|
|
1525
|
+
{
|
|
1526
|
+
className: u`
|
|
1527
|
+
position: relative;
|
|
1528
|
+
width: 100%;
|
|
1529
|
+
height: 100%;
|
|
1530
|
+
display: flex;
|
|
1531
|
+
justify-content: center;
|
|
1532
|
+
align-items: center;
|
|
1533
|
+
padding: 0.375rem;
|
|
1534
|
+
`,
|
|
1535
|
+
children: [
|
|
1536
|
+
se(),
|
|
1537
|
+
/* @__PURE__ */ o.jsx(
|
|
1538
|
+
Fe,
|
|
1539
|
+
{
|
|
1540
|
+
className: U(
|
|
1541
|
+
"sortable-group-item",
|
|
1542
|
+
u`
|
|
1543
|
+
position: absolute;
|
|
1544
|
+
cursor: pointer;
|
|
1545
|
+
left: 0.375rem;
|
|
1546
|
+
top: 0.375rem;
|
|
1547
|
+
width: calc(100% - 0.75rem);
|
|
1548
|
+
height: calc(100% - 0.75rem);
|
|
1549
|
+
pointer-events: ${Y === null ? "none" : "auto"};
|
|
1550
|
+
> * {
|
|
1551
|
+
opacity: 0;
|
|
1552
|
+
}
|
|
1553
|
+
`
|
|
1554
|
+
),
|
|
1555
|
+
group: { name: "nested", pull: !1, put: !0 },
|
|
1556
|
+
animation: 150,
|
|
1557
|
+
fallbackOnBody: !0,
|
|
1558
|
+
list: v ?? [],
|
|
1559
|
+
setList: (B) => s(B, a),
|
|
1560
|
+
filter: () => !0,
|
|
1561
|
+
"data-id": r.id,
|
|
1562
|
+
onChange: () => {
|
|
1563
|
+
V(r.id);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
)
|
|
1567
|
+
]
|
|
1568
|
+
}
|
|
1569
|
+
)
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
/* @__PURE__ */ o.jsx(
|
|
1573
|
+
A.p,
|
|
1574
|
+
{
|
|
1575
|
+
className: U(
|
|
1576
|
+
u`
|
|
1577
|
+
text-align: center;
|
|
1578
|
+
margin-top: 0.25rem;
|
|
1579
|
+
margin-bottom: 0;
|
|
1580
|
+
color: ${m.itemNameColor};
|
|
1581
|
+
@media (prefers-color-scheme: dark) {
|
|
1582
|
+
color: ${G.itemNameColor};
|
|
1583
|
+
}
|
|
1584
|
+
`,
|
|
1585
|
+
y && u`
|
|
1586
|
+
color: transparent;
|
|
1587
|
+
`
|
|
1588
|
+
),
|
|
1589
|
+
variants: X,
|
|
1590
|
+
animate: ge ? "hidden" : "visible",
|
|
1591
|
+
children: (P == null ? void 0 : P.name) ?? "文件夹"
|
|
1592
|
+
}
|
|
1593
|
+
)
|
|
1594
|
+
]
|
|
1595
|
+
}
|
|
1596
|
+
);
|
|
1597
|
+
}, gr = u`
|
|
1598
|
+
padding: 8px;
|
|
1599
|
+
transition: all 0.2s;
|
|
1600
|
+
> div {
|
|
1601
|
+
transition: all 0.2s;
|
|
1602
|
+
border: 2px solid aquamarine;
|
|
1603
|
+
background-color: transparent;
|
|
1604
|
+
> div {
|
|
1605
|
+
opacity: 0;
|
|
1606
|
+
transition: all 0.2s;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
`, Nt = (d) => {
|
|
1610
|
+
const { data: r, onClose: i, onItemClick: a } = d, {
|
|
1611
|
+
list: g,
|
|
1612
|
+
setList: l,
|
|
1613
|
+
setListStatus: y,
|
|
1614
|
+
setMoveItemId: b,
|
|
1615
|
+
setMoveTargetId: s,
|
|
1616
|
+
updateItem: _
|
|
1617
|
+
} = ve(), { theme: p } = me(), { light: N, dark: M } = ie.getTheme(p), [V, Y] = oe("文件夹"), f = [...(r == null ? void 0 : r.children) ?? []];
|
|
1618
|
+
return ye(() => {
|
|
1619
|
+
var h;
|
|
1620
|
+
r && Y((h = r.data) == null ? void 0 : h.name);
|
|
1621
|
+
}, [r]), /* @__PURE__ */ o.jsx(
|
|
1622
|
+
sr,
|
|
1623
|
+
{
|
|
1624
|
+
visible: !!r,
|
|
1625
|
+
onClose: () => {
|
|
1626
|
+
i();
|
|
1627
|
+
},
|
|
1628
|
+
animation: "zoom",
|
|
1629
|
+
maskAnimation: "fade",
|
|
1630
|
+
mousePosition: r != null && r.pageX && (r != null && r.pageY) ? {
|
|
1631
|
+
x: r == null ? void 0 : r.pageX,
|
|
1632
|
+
y: r == null ? void 0 : r.pageY
|
|
1633
|
+
} : null,
|
|
1634
|
+
title: /* @__PURE__ */ o.jsx(
|
|
1635
|
+
"input",
|
|
1636
|
+
{
|
|
1637
|
+
className: u`
|
|
1638
|
+
background-color: transparent;
|
|
1639
|
+
border-style: none;
|
|
1640
|
+
text-align: center;
|
|
1641
|
+
font-size: 1.25rem;
|
|
1642
|
+
line-height: 1.75rem;
|
|
1643
|
+
color: white;
|
|
1644
|
+
@media (prefers-color-scheme: dark) {
|
|
1645
|
+
color: black;
|
|
1646
|
+
}
|
|
1647
|
+
&:focus {
|
|
1648
|
+
outline: none;
|
|
1649
|
+
}
|
|
1650
|
+
`,
|
|
1651
|
+
value: V,
|
|
1652
|
+
onChange: (h) => {
|
|
1653
|
+
Y(h.target.value);
|
|
1654
|
+
},
|
|
1655
|
+
onBlur: () => {
|
|
1656
|
+
r && _(r.id, {
|
|
1657
|
+
...r.data,
|
|
1658
|
+
name: V
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
),
|
|
1663
|
+
footer: null,
|
|
1664
|
+
closable: !1,
|
|
1665
|
+
className: U(
|
|
1666
|
+
"group-item-modal",
|
|
1667
|
+
u`
|
|
1668
|
+
.rc-dialog-content {
|
|
1669
|
+
background-color: transparent;
|
|
1670
|
+
box-shadow: none;
|
|
1671
|
+
padding: 0;
|
|
1672
|
+
.rc-dialog-header {
|
|
1673
|
+
text-align: center;
|
|
1674
|
+
background-color: transparent;
|
|
1675
|
+
margin-bottom: 1rem;
|
|
1676
|
+
border-bottom: none;
|
|
1677
|
+
.ant-modal-name {
|
|
1678
|
+
color: #fff;
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
.rc-dialog-body {
|
|
1682
|
+
background-color: ${N.groupItemModalBackgroundColor};
|
|
1683
|
+
@media (prefers-color-scheme: dark) {
|
|
1684
|
+
background-color: ${M.groupItemModalBackgroundColor};
|
|
1685
|
+
}
|
|
1686
|
+
border-radius: 0.5rem;
|
|
1687
|
+
overflow: hidden;
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
`
|
|
1691
|
+
),
|
|
1692
|
+
width: 600,
|
|
1693
|
+
destroyOnClose: !0,
|
|
1694
|
+
children: /* @__PURE__ */ o.jsx(
|
|
1695
|
+
"div",
|
|
1696
|
+
{
|
|
1697
|
+
className: u`
|
|
1698
|
+
overflow-y: auto;
|
|
1699
|
+
max-height: 60vh;
|
|
1700
|
+
padding: 1.25rem 0;
|
|
1701
|
+
`,
|
|
1702
|
+
onDragLeave: (h) => {
|
|
1703
|
+
const T = h.relatedTarget;
|
|
1704
|
+
T && (h.currentTarget.contains(T) || setTimeout(() => {
|
|
1705
|
+
i();
|
|
1706
|
+
}, 500));
|
|
1707
|
+
},
|
|
1708
|
+
children: /* @__PURE__ */ o.jsx(
|
|
1709
|
+
Fe,
|
|
1710
|
+
{
|
|
1711
|
+
className: u`
|
|
1712
|
+
display: grid;
|
|
1713
|
+
gap: 1rem;
|
|
1714
|
+
place-items: center;
|
|
1715
|
+
grid-template-columns: repeat(auto-fill, 96px);
|
|
1716
|
+
grid-auto-flow: dense;
|
|
1717
|
+
grid-auto-rows: 96px;
|
|
1718
|
+
`,
|
|
1719
|
+
group: { name: "nested", pull: !0, put: !1 },
|
|
1720
|
+
animation: 150,
|
|
1721
|
+
fallbackOnBody: !0,
|
|
1722
|
+
list: (r == null ? void 0 : r.children) ?? [],
|
|
1723
|
+
setList: (h) => {
|
|
1724
|
+
var G, v;
|
|
1725
|
+
const T = h.map((P) => P.id), m = (v = (G = g.find((P) => P.id === (r == null ? void 0 : r.id))) == null ? void 0 : G.children) == null ? void 0 : v.map((P) => P.id);
|
|
1726
|
+
T.length === (m == null ? void 0 : m.length) && T.every((P, R) => P === m[R]) || T.length < ((m == null ? void 0 : m.length) ?? 0) || l(h, [...(r == null ? void 0 : r.parentIds) ?? [], r == null ? void 0 : r.id]);
|
|
1727
|
+
},
|
|
1728
|
+
onMove: () => (s(null), y("onMove"), !0),
|
|
1729
|
+
onStart: (h) => {
|
|
1730
|
+
const T = h.item.dataset;
|
|
1731
|
+
T != null && T.id && b(T.id), y("onMove");
|
|
1732
|
+
},
|
|
1733
|
+
onEnd: () => {
|
|
1734
|
+
b(null), s(null), y(null);
|
|
1735
|
+
},
|
|
1736
|
+
ghostClass: gr,
|
|
1737
|
+
children: f.map((h, T) => /* @__PURE__ */ o.jsx(
|
|
1738
|
+
Ye,
|
|
1739
|
+
{
|
|
1740
|
+
data: h,
|
|
1741
|
+
itemIndex: T,
|
|
1742
|
+
onClick: a
|
|
1743
|
+
},
|
|
1744
|
+
h.id
|
|
1745
|
+
))
|
|
1746
|
+
}
|
|
1747
|
+
)
|
|
1748
|
+
}
|
|
1749
|
+
)
|
|
1750
|
+
}
|
|
1751
|
+
);
|
|
1752
|
+
}, Ot = (d) => {
|
|
1753
|
+
var a;
|
|
1754
|
+
const { data: r, onClose: i } = d;
|
|
1755
|
+
return /* @__PURE__ */ o.jsx(
|
|
1756
|
+
sr,
|
|
1757
|
+
{
|
|
1758
|
+
visible: !!r,
|
|
1759
|
+
onClose: () => {
|
|
1760
|
+
i();
|
|
1761
|
+
},
|
|
1762
|
+
animation: "zoom",
|
|
1763
|
+
maskAnimation: "fade",
|
|
1764
|
+
mousePosition: r != null && r.pageX && (r != null && r.pageY) ? {
|
|
1765
|
+
x: r == null ? void 0 : r.pageX,
|
|
1766
|
+
y: r == null ? void 0 : r.pageY
|
|
1767
|
+
} : null,
|
|
1768
|
+
footer: null,
|
|
1769
|
+
title: ((a = r == null ? void 0 : r.data) == null ? void 0 : a.name) ?? "信息",
|
|
1770
|
+
children: r && /* @__PURE__ */ o.jsxs("div", { children: [
|
|
1771
|
+
/* @__PURE__ */ o.jsx("div", { className: "mb-2", children: "开发者信息" }),
|
|
1772
|
+
/* @__PURE__ */ o.jsx("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ o.jsx(qr, { src: r, theme: "monokai" }) })
|
|
1773
|
+
] })
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
}, At = (d) => {
|
|
1777
|
+
const {
|
|
1778
|
+
pagination: r = { position: "bottom" },
|
|
1779
|
+
className: i,
|
|
1780
|
+
sliderProps: a,
|
|
1781
|
+
sliderRef: g,
|
|
1782
|
+
onItemClick: l
|
|
1783
|
+
} = d, y = Be(null), b = Be(null), {
|
|
1784
|
+
list: s,
|
|
1785
|
+
setList: _,
|
|
1786
|
+
setListStatus: p,
|
|
1787
|
+
showInfoItemData: N,
|
|
1788
|
+
setShowInfoItemData: M,
|
|
1789
|
+
openGroupItemData: V,
|
|
1790
|
+
setOpenGroupItemData: Y,
|
|
1791
|
+
setMoveItemId: f,
|
|
1792
|
+
setMoveTargetId: h,
|
|
1793
|
+
addItem: T
|
|
1794
|
+
} = ve(), { pagingDotBuilder: m, pagingDotsBuilder: G, itemBuilder: v } = me(), P = Ee(() => r === !1 ? {} : {
|
|
1795
|
+
top: u`
|
|
1796
|
+
display: flex;
|
|
1797
|
+
flex-direction: column;
|
|
1798
|
+
.slick-list {
|
|
1799
|
+
order: 1;
|
|
1800
|
+
}
|
|
1801
|
+
.slick-dots {
|
|
1802
|
+
position: static;
|
|
1803
|
+
}
|
|
1804
|
+
`,
|
|
1805
|
+
bottom: u`
|
|
1806
|
+
.slick-dots {
|
|
1807
|
+
position: static;
|
|
1808
|
+
}
|
|
1809
|
+
`,
|
|
1810
|
+
left: u`
|
|
1811
|
+
.slick-dots {
|
|
1812
|
+
position: absolute;
|
|
1813
|
+
width: auto;
|
|
1814
|
+
left: 0;
|
|
1815
|
+
top: 0;
|
|
1816
|
+
bottom: 0;
|
|
1817
|
+
transform: translateX(-100%);
|
|
1818
|
+
display: flex;
|
|
1819
|
+
justify-content: center;
|
|
1820
|
+
align-items: center;
|
|
1821
|
+
.slick-dots-default {
|
|
1822
|
+
flex-direction: column;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
`,
|
|
1826
|
+
right: u`
|
|
1827
|
+
.slick-dots {
|
|
1828
|
+
position: absolute;
|
|
1829
|
+
width: auto;
|
|
1830
|
+
right: 0;
|
|
1831
|
+
top: 0;
|
|
1832
|
+
bottom: 0;
|
|
1833
|
+
transform: translateX(100%);
|
|
1834
|
+
display: flex;
|
|
1835
|
+
justify-content: center;
|
|
1836
|
+
align-items: center;
|
|
1837
|
+
.slick-dots-default {
|
|
1838
|
+
flex-direction: column;
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
`
|
|
1842
|
+
}[r.position ?? "bottom"], [r]);
|
|
1843
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
1844
|
+
/* @__PURE__ */ o.jsx(
|
|
1845
|
+
Lr,
|
|
1846
|
+
{
|
|
1847
|
+
useCSS: !0,
|
|
1848
|
+
useTransform: !0,
|
|
1849
|
+
arrows: !1,
|
|
1850
|
+
ref: g ?? y,
|
|
1851
|
+
infinite: !1,
|
|
1852
|
+
dots: !0,
|
|
1853
|
+
touchMove: !1,
|
|
1854
|
+
lazyLoad: "anticipated",
|
|
1855
|
+
className: U(
|
|
1856
|
+
P,
|
|
1857
|
+
u`
|
|
1858
|
+
.slick-track {
|
|
1859
|
+
display: flex;
|
|
1860
|
+
align-items: stretch;
|
|
1861
|
+
}
|
|
1862
|
+
.slick-slide {
|
|
1863
|
+
display: flex;
|
|
1864
|
+
align-self: stretch;
|
|
1865
|
+
height: unset;
|
|
1866
|
+
> div {
|
|
1867
|
+
display: flex;
|
|
1868
|
+
align-self: stretch;
|
|
1869
|
+
width: 100%;
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
`,
|
|
1873
|
+
i
|
|
1874
|
+
),
|
|
1875
|
+
customPaging: (R) => {
|
|
1876
|
+
var x, C;
|
|
1877
|
+
return m ? m(s[R], R) : /* @__PURE__ */ o.jsx(
|
|
1878
|
+
"div",
|
|
1879
|
+
{
|
|
1880
|
+
onDragEnter: () => {
|
|
1881
|
+
var X;
|
|
1882
|
+
(X = (g ?? y).current) == null || X.slickGoTo(R);
|
|
1883
|
+
},
|
|
1884
|
+
children: (C = (x = s[R]) == null ? void 0 : x.data) == null ? void 0 : C.name
|
|
1885
|
+
}
|
|
1886
|
+
);
|
|
1887
|
+
},
|
|
1888
|
+
appendDots: (R) => G ? G(R) : r === !1 ? /* @__PURE__ */ o.jsx("div", {}) : /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx(
|
|
1889
|
+
"ul",
|
|
1890
|
+
{
|
|
1891
|
+
ref: b,
|
|
1892
|
+
className: U(
|
|
1893
|
+
"slick-dots-default",
|
|
1894
|
+
u`
|
|
1895
|
+
padding: 0.5rem;
|
|
1896
|
+
display: inline-flex;
|
|
1897
|
+
justify-content: center;
|
|
1898
|
+
align-items: center;
|
|
1899
|
+
gap: 0.5rem;
|
|
1900
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
1901
|
+
border-radius: 0.5rem;
|
|
1902
|
+
.slick-active {
|
|
1903
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
1904
|
+
color: white;
|
|
1905
|
+
padding: 0.25rem;
|
|
1906
|
+
border-radius: 0.25rem;
|
|
1907
|
+
}
|
|
1908
|
+
li {
|
|
1909
|
+
margin: 0;
|
|
1910
|
+
width: auto;
|
|
1911
|
+
height: auto;
|
|
1912
|
+
}
|
|
1913
|
+
`
|
|
1914
|
+
),
|
|
1915
|
+
children: R
|
|
1916
|
+
}
|
|
1917
|
+
) }),
|
|
1918
|
+
...a,
|
|
1919
|
+
children: s.map((R) => /* @__PURE__ */ o.jsx(
|
|
1920
|
+
"div",
|
|
1921
|
+
{
|
|
1922
|
+
onDrop: (x) => {
|
|
1923
|
+
x.preventDefault();
|
|
1924
|
+
const C = x.dataTransfer.getData("text/plain");
|
|
1925
|
+
if (C !== "")
|
|
1926
|
+
try {
|
|
1927
|
+
T(JSON.parse(C), [R.id]);
|
|
1928
|
+
} catch (X) {
|
|
1929
|
+
console.log("drag error", X);
|
|
1930
|
+
}
|
|
1931
|
+
},
|
|
1932
|
+
onDragOver: (x) => {
|
|
1933
|
+
x.preventDefault();
|
|
1934
|
+
},
|
|
1935
|
+
children: /* @__PURE__ */ o.jsx(
|
|
1936
|
+
Fe,
|
|
1937
|
+
{
|
|
1938
|
+
className: U(
|
|
1939
|
+
u`
|
|
1940
|
+
display: grid;
|
|
1941
|
+
transition: all 0.3s;
|
|
1942
|
+
grid-template-columns: repeat(auto-fill, 96px);
|
|
1943
|
+
grid-auto-flow: dense;
|
|
1944
|
+
grid-auto-rows: 96px;
|
|
1945
|
+
place-items: center;
|
|
1946
|
+
justify-content: center;
|
|
1947
|
+
align-items: center;
|
|
1948
|
+
`
|
|
1949
|
+
),
|
|
1950
|
+
animation: 150,
|
|
1951
|
+
fallbackOnBody: !0,
|
|
1952
|
+
swapThreshold: 0.65,
|
|
1953
|
+
group: "nested",
|
|
1954
|
+
list: R.children ?? [],
|
|
1955
|
+
setList: (x) => _(x, [R.id]),
|
|
1956
|
+
filter: ".drag-disabled",
|
|
1957
|
+
onMove: (x) => {
|
|
1958
|
+
p("onMove");
|
|
1959
|
+
const { dragged: C, related: X } = x, ce = C.dataset, J = X.dataset;
|
|
1960
|
+
return h(null), !((Object.keys(J).length === 0 || J.parentIds) && Number(ce.childrenLength) > 0 && X.classList.contains("sortable-group-item"));
|
|
1961
|
+
},
|
|
1962
|
+
onStart: (x) => {
|
|
1963
|
+
const C = x.item.dataset;
|
|
1964
|
+
C != null && C.id && f(C.id), p("onMove");
|
|
1965
|
+
},
|
|
1966
|
+
onEnd: () => {
|
|
1967
|
+
f(null), h(null), p(null);
|
|
1968
|
+
},
|
|
1969
|
+
ghostClass: gr,
|
|
1970
|
+
children: (R.children ?? []).map((x, C) => {
|
|
1971
|
+
let X;
|
|
1972
|
+
if (v)
|
|
1973
|
+
return v(x);
|
|
1974
|
+
switch (x.type) {
|
|
1975
|
+
case "group":
|
|
1976
|
+
case "app":
|
|
1977
|
+
X = /* @__PURE__ */ o.jsx(
|
|
1978
|
+
$t,
|
|
1979
|
+
{
|
|
1980
|
+
data: x,
|
|
1981
|
+
itemIndex: C,
|
|
1982
|
+
parentIds: [R.id, x.id],
|
|
1983
|
+
onClick: l
|
|
1984
|
+
},
|
|
1985
|
+
x.id
|
|
1986
|
+
);
|
|
1987
|
+
break;
|
|
1988
|
+
default:
|
|
1989
|
+
X = /* @__PURE__ */ o.jsx(
|
|
1990
|
+
Ye,
|
|
1991
|
+
{
|
|
1992
|
+
data: x,
|
|
1993
|
+
itemIndex: C,
|
|
1994
|
+
onClick: l
|
|
1995
|
+
},
|
|
1996
|
+
x.id
|
|
1997
|
+
);
|
|
1998
|
+
break;
|
|
1999
|
+
}
|
|
2000
|
+
return X;
|
|
2001
|
+
})
|
|
2002
|
+
}
|
|
2003
|
+
)
|
|
2004
|
+
},
|
|
2005
|
+
R.id
|
|
2006
|
+
))
|
|
2007
|
+
}
|
|
2008
|
+
),
|
|
2009
|
+
/* @__PURE__ */ o.jsx(
|
|
2010
|
+
Ot,
|
|
2011
|
+
{
|
|
2012
|
+
data: N,
|
|
2013
|
+
onClose: () => {
|
|
2014
|
+
M(null);
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
),
|
|
2018
|
+
/* @__PURE__ */ o.jsx(
|
|
2019
|
+
Nt,
|
|
2020
|
+
{
|
|
2021
|
+
data: V,
|
|
2022
|
+
onClose: () => {
|
|
2023
|
+
Y(null);
|
|
2024
|
+
},
|
|
2025
|
+
onItemClick: l
|
|
2026
|
+
}
|
|
2027
|
+
)
|
|
2028
|
+
] });
|
|
2029
|
+
}, eo = (d) => {
|
|
2030
|
+
const {
|
|
2031
|
+
list: r,
|
|
2032
|
+
onChange: i,
|
|
2033
|
+
storageKey: a,
|
|
2034
|
+
enableCaching: g,
|
|
2035
|
+
theme: l,
|
|
2036
|
+
noLetters: y,
|
|
2037
|
+
contextMenu: b,
|
|
2038
|
+
contextMenuBuilder: s,
|
|
2039
|
+
itemBuilder: _,
|
|
2040
|
+
itemIconBuilder: p,
|
|
2041
|
+
pagingDotBuilder: N,
|
|
2042
|
+
pagingDotsBuilder: M,
|
|
2043
|
+
...V
|
|
2044
|
+
} = d, Y = {
|
|
2045
|
+
list: r,
|
|
2046
|
+
onChange: i,
|
|
2047
|
+
storageKey: a,
|
|
2048
|
+
enableCaching: g
|
|
2049
|
+
}, f = {
|
|
2050
|
+
theme: l,
|
|
2051
|
+
noLetters: y,
|
|
2052
|
+
contextMenu: b,
|
|
2053
|
+
pagingDotsBuilder: M,
|
|
2054
|
+
pagingDotBuilder: N,
|
|
2055
|
+
itemBuilder: _,
|
|
2056
|
+
itemIconBuilder: p,
|
|
2057
|
+
contextMenuBuilder: s
|
|
2058
|
+
};
|
|
2059
|
+
return /* @__PURE__ */ o.jsx(_t, { ...Y, children: /* @__PURE__ */ o.jsx(Rt, { ...f, children: /* @__PURE__ */ o.jsx(At, { ...V }) }) });
|
|
2060
|
+
}, Bt = {
|
|
2061
|
+
frontmatterEditor: {
|
|
2062
|
+
title: "编辑前置元数据",
|
|
2063
|
+
key: "键",
|
|
2064
|
+
value: "值",
|
|
2065
|
+
addEntry: "添加项目"
|
|
2066
|
+
},
|
|
2067
|
+
dialogControls: {
|
|
2068
|
+
save: "保存",
|
|
2069
|
+
cancel: "取消"
|
|
2070
|
+
},
|
|
2071
|
+
uploadImage: {
|
|
2072
|
+
uploadInstructions: "从您的设备中上传图片:",
|
|
2073
|
+
addViaUrlInstructions: "或从网址新增图片:",
|
|
2074
|
+
autoCompletePlaceholder: "选择或粘贴图片",
|
|
2075
|
+
alt: "替代文本:",
|
|
2076
|
+
title: "标题:"
|
|
2077
|
+
},
|
|
2078
|
+
imageEditor: {
|
|
2079
|
+
editImage: "编辑图片"
|
|
2080
|
+
},
|
|
2081
|
+
createLink: {
|
|
2082
|
+
url: "网址",
|
|
2083
|
+
urlPlaceholder: "选择或粘贴网址",
|
|
2084
|
+
title: "标题",
|
|
2085
|
+
saveTooltip: "设置网址",
|
|
2086
|
+
cancelTooltip: "取消更改"
|
|
2087
|
+
},
|
|
2088
|
+
linkPreview: {
|
|
2089
|
+
open: "在新窗口中打开 {{url}}",
|
|
2090
|
+
edit: "编辑链接网址",
|
|
2091
|
+
copyToClipboard: "复制到剪贴板",
|
|
2092
|
+
copied: "已复制!",
|
|
2093
|
+
remove: "移除链接"
|
|
2094
|
+
},
|
|
2095
|
+
table: {
|
|
2096
|
+
deleteTable: "删除表格",
|
|
2097
|
+
columnMenu: "列菜单",
|
|
2098
|
+
textAlignment: "文字对齐",
|
|
2099
|
+
alignLeft: "左对齐",
|
|
2100
|
+
alignCenter: "居中对齐",
|
|
2101
|
+
alignRight: "右对齐",
|
|
2102
|
+
insertColumnLeft: "在当前列左侧插入一列",
|
|
2103
|
+
insertColumnRight: "在当前列右侧插入一列",
|
|
2104
|
+
deleteColumn: "删除此列",
|
|
2105
|
+
rowMenu: "行菜单",
|
|
2106
|
+
insertRowAbove: "在当前行上方插入一行",
|
|
2107
|
+
insertRowBelow: "在当前行下方插入一行",
|
|
2108
|
+
deleteRow: "删除此行"
|
|
2109
|
+
},
|
|
2110
|
+
toolbar: {
|
|
2111
|
+
blockTypes: {
|
|
2112
|
+
paragraph: "段落",
|
|
2113
|
+
quote: "引用",
|
|
2114
|
+
heading: "标题 {{level}}"
|
|
2115
|
+
},
|
|
2116
|
+
blockTypeSelect: {
|
|
2117
|
+
selectBlockTypeTooltip: "选择块类型",
|
|
2118
|
+
placeholder: "块类型"
|
|
2119
|
+
},
|
|
2120
|
+
toggleGroup: "切换组",
|
|
2121
|
+
removeBold: "移除粗体",
|
|
2122
|
+
bold: "粗体",
|
|
2123
|
+
removeItalic: "移除斜体",
|
|
2124
|
+
italic: "斜体",
|
|
2125
|
+
underline: "移除下划线",
|
|
2126
|
+
removeUnderline: "下划线",
|
|
2127
|
+
removeInlineCode: "移除内联代码样式",
|
|
2128
|
+
inlineCode: "内联代码样式",
|
|
2129
|
+
link: "创建链接",
|
|
2130
|
+
richText: "富文本",
|
|
2131
|
+
diffMode: "差异模式",
|
|
2132
|
+
source: "源码模式",
|
|
2133
|
+
admonition: "插入注释区块",
|
|
2134
|
+
codeBlock: "插入代码块",
|
|
2135
|
+
editFrontmatter: "编辑前置元数据",
|
|
2136
|
+
insertFrontmatter: "插入前置元数据",
|
|
2137
|
+
image: "插入图片",
|
|
2138
|
+
insertSandpack: "插入 Sandpack",
|
|
2139
|
+
table: "插入表格",
|
|
2140
|
+
thematicBreak: "插入主题换行",
|
|
2141
|
+
bulletedList: "无序列表",
|
|
2142
|
+
numberedList: "有序列表",
|
|
2143
|
+
checkList: "任务列表",
|
|
2144
|
+
deleteSandpack: "删除 Sandpack",
|
|
2145
|
+
undo: "撤销 {{shortcut}}",
|
|
2146
|
+
redo: "重做 {{shortcut}}",
|
|
2147
|
+
superscript: "上标",
|
|
2148
|
+
subscript: "下标",
|
|
2149
|
+
strikethrough: "删除线",
|
|
2150
|
+
removeSubscript: "移除下标",
|
|
2151
|
+
removeSuperscript: "移除上标",
|
|
2152
|
+
removeStrikethrough: "移除删除线"
|
|
2153
|
+
},
|
|
2154
|
+
admonitions: {
|
|
2155
|
+
note: "注意",
|
|
2156
|
+
tip: "提示",
|
|
2157
|
+
danger: "危险",
|
|
2158
|
+
info: "信息",
|
|
2159
|
+
caution: "警告",
|
|
2160
|
+
changeType: "选择注释区块类型",
|
|
2161
|
+
placeholder: "注释区块类型"
|
|
2162
|
+
},
|
|
2163
|
+
codeBlock: {
|
|
2164
|
+
language: "代码块语言",
|
|
2165
|
+
selectLanguage: "选择代码块语言",
|
|
2166
|
+
inlineLanguage: "代码块语言"
|
|
2167
|
+
},
|
|
2168
|
+
codeblock: {
|
|
2169
|
+
delete: "删除代码块"
|
|
2170
|
+
},
|
|
2171
|
+
contentArea: {
|
|
2172
|
+
editableMarkdown: "可编辑的 Markdown"
|
|
2173
|
+
},
|
|
2174
|
+
image: {
|
|
2175
|
+
delete: "删除图片"
|
|
2176
|
+
}
|
|
2177
|
+
}, Lt = (d, r, i) => {
|
|
2178
|
+
const g = d.split(".").reduce(
|
|
2179
|
+
(l, y) => typeof l == "string" ? l : l[y],
|
|
2180
|
+
Bt
|
|
2181
|
+
);
|
|
2182
|
+
return typeof g != "string" ? r : i ? g.replace(/{{(.*?)}}/g, (l, y) => i[y]) : g;
|
|
2183
|
+
};
|
|
2184
|
+
function Ft(d) {
|
|
2185
|
+
const r = d == null ? void 0 : d.rootNode;
|
|
2186
|
+
return !r || r.getType() !== "directive" ? !1 : ["note", "tip", "danger", "info", "caution"].includes(
|
|
2187
|
+
r.getMdastNode().name
|
|
2188
|
+
);
|
|
2189
|
+
}
|
|
2190
|
+
const ro = (d) => {
|
|
2191
|
+
const { value: r, onChange: i, translation: a, pluginConfig: g, ...l } = d, {
|
|
2192
|
+
image: y,
|
|
2193
|
+
diffSource: b = {
|
|
2194
|
+
viewMode: "rich-text"
|
|
2195
|
+
},
|
|
2196
|
+
headings: s,
|
|
2197
|
+
link: _,
|
|
2198
|
+
codeBlock: p,
|
|
2199
|
+
codeMirror: N = {
|
|
2200
|
+
codeBlockLanguages: {
|
|
2201
|
+
js: "JavaScript",
|
|
2202
|
+
css: "CSS",
|
|
2203
|
+
txt: "Plain Text",
|
|
2204
|
+
tsx: "TypeScript",
|
|
2205
|
+
"": "Unspecified"
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
directives: M = {
|
|
2209
|
+
directiveDescriptors: [It]
|
|
2210
|
+
}
|
|
2211
|
+
} = g ?? {}, [V, Y] = oe("");
|
|
2212
|
+
return ye(() => {
|
|
2213
|
+
r !== void 0 && Y(r);
|
|
2214
|
+
}, [r]), /* @__PURE__ */ o.jsx(
|
|
2215
|
+
Jr,
|
|
2216
|
+
{
|
|
2217
|
+
contentEditableClassName: U(
|
|
2218
|
+
"markdown-body",
|
|
2219
|
+
u`
|
|
2220
|
+
table {
|
|
2221
|
+
border-spacing: 0;
|
|
2222
|
+
border-collapse: collapse;
|
|
2223
|
+
width: 100%;
|
|
2224
|
+
display: table;
|
|
2225
|
+
th[data-tool-cell],
|
|
2226
|
+
td[data-tool-cell] {
|
|
2227
|
+
padding: 0;
|
|
2228
|
+
border: none;
|
|
2229
|
+
}
|
|
2230
|
+
tr {
|
|
2231
|
+
border-top: 0;
|
|
2232
|
+
}
|
|
2233
|
+
thead {
|
|
2234
|
+
th {
|
|
2235
|
+
padding: 0;
|
|
2236
|
+
border: none;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
tfoot {
|
|
2240
|
+
th {
|
|
2241
|
+
padding: 0;
|
|
2242
|
+
border: none;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
[class*="_addRowButton"],
|
|
2246
|
+
[class*="_addColumnButton"],
|
|
2247
|
+
[class*="_tableColumnEditorTrigger"],
|
|
2248
|
+
[class*="_iconButton"] {
|
|
2249
|
+
cursor: pointer;
|
|
2250
|
+
transition: all 0.3s;
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
`
|
|
2254
|
+
),
|
|
2255
|
+
markdown: V,
|
|
2256
|
+
onChange: (f) => {
|
|
2257
|
+
!r && !i && Y(f), i && i(f);
|
|
2258
|
+
},
|
|
2259
|
+
translation: a ?? Lt,
|
|
2260
|
+
plugins: [
|
|
2261
|
+
Kr({
|
|
2262
|
+
toolbarContents: () => /* @__PURE__ */ o.jsxs(Hr, { options: ["rich-text", "source"], children: [
|
|
2263
|
+
/* @__PURE__ */ o.jsx(Zr, {}),
|
|
2264
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2265
|
+
/* @__PURE__ */ o.jsx(Qr, {}),
|
|
2266
|
+
/* @__PURE__ */ o.jsx(et, {}),
|
|
2267
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2268
|
+
/* @__PURE__ */ o.jsx(rt, {}),
|
|
2269
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2270
|
+
/* @__PURE__ */ o.jsx(tt, {}),
|
|
2271
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2272
|
+
/* @__PURE__ */ o.jsx(ot, {}),
|
|
2273
|
+
/* @__PURE__ */ o.jsx(nt, {}),
|
|
2274
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2275
|
+
/* @__PURE__ */ o.jsx(at, {}),
|
|
2276
|
+
/* @__PURE__ */ o.jsx(it, {}),
|
|
2277
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2278
|
+
/* @__PURE__ */ o.jsx(st, {}),
|
|
2279
|
+
/* @__PURE__ */ o.jsx(
|
|
2280
|
+
lt,
|
|
2281
|
+
{
|
|
2282
|
+
options: [
|
|
2283
|
+
{
|
|
2284
|
+
when: (f) => !Ft(f),
|
|
2285
|
+
contents: () => /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
2286
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2287
|
+
/* @__PURE__ */ o.jsx(ct, {})
|
|
2288
|
+
] })
|
|
2289
|
+
}
|
|
2290
|
+
]
|
|
2291
|
+
}
|
|
2292
|
+
),
|
|
2293
|
+
/* @__PURE__ */ o.jsx(ue, {}),
|
|
2294
|
+
/* @__PURE__ */ o.jsx(ut, {})
|
|
2295
|
+
] })
|
|
2296
|
+
}),
|
|
2297
|
+
dt(b),
|
|
2298
|
+
ft(),
|
|
2299
|
+
mt(),
|
|
2300
|
+
gt(s),
|
|
2301
|
+
pt(_),
|
|
2302
|
+
ht(),
|
|
2303
|
+
vt(y),
|
|
2304
|
+
xt(),
|
|
2305
|
+
bt(),
|
|
2306
|
+
kt(),
|
|
2307
|
+
yt(p),
|
|
2308
|
+
Ct(N),
|
|
2309
|
+
wt(),
|
|
2310
|
+
jt(M)
|
|
2311
|
+
],
|
|
2312
|
+
...l
|
|
2313
|
+
}
|
|
2314
|
+
);
|
|
2315
|
+
};
|
|
2316
|
+
export {
|
|
2317
|
+
eo as Desktop,
|
|
2318
|
+
ro as MdEditor
|
|
2319
|
+
};
|