zs_library 0.6.15 → 0.6.17
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.js +717 -717
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,32 +6,32 @@ import Jo from "i18next";
|
|
|
6
6
|
import { initReactI18next as Qo } from "react-i18next";
|
|
7
7
|
import { jsx as s, jsxs as A, Fragment as Ie } from "react/jsx-runtime";
|
|
8
8
|
import * as le from "react";
|
|
9
|
-
import { createContext as Ct, useMemo as
|
|
9
|
+
import { createContext as Ct, useMemo as re, useContext as De, useState as B, useRef as ne, useCallback as ue, useEffect as V, forwardRef as Xe, useImperativeHandle as et, memo as Ae, Fragment as er, useLayoutEffect as tr, cloneElement as or } from "react";
|
|
10
10
|
import { css as E, cx as S } from "@emotion/css";
|
|
11
|
-
import
|
|
11
|
+
import rr from "react-slick";
|
|
12
12
|
import { ReactSortable as ft } from "react-sortablejs";
|
|
13
|
-
import { useLocalStorageState as
|
|
13
|
+
import { useLocalStorageState as nr, useDebounceEffect as sr, useRequest as ar } from "ahooks";
|
|
14
14
|
import { v4 as ht } from "uuid";
|
|
15
|
-
import { motion as X, AnimatePresence as Ce, useMotionValue as Yt, useTransform as He, useSpring as
|
|
15
|
+
import { motion as X, AnimatePresence as Ce, useMotionValue as Yt, useTransform as He, useSpring as rt } from "motion/react";
|
|
16
16
|
import { useMotionValue as Fl } from "motion/react";
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { RiFunctionFill as
|
|
20
|
-
import
|
|
21
|
-
import { useFloating as
|
|
22
|
-
import { AdmonitionDirectiveDescriptor as
|
|
17
|
+
import ir from "rc-dialog";
|
|
18
|
+
import lr from "react-json-view";
|
|
19
|
+
import { RiFunctionFill as cr, RiApps2AddLine as dr, RiSearchLine as ur, RiCloseLine as zt, RiArrowRightSLine as Xt, RiCheckLine as Ge, RiIndeterminateCircleLine as fr, RiShare2Line as gr, RiInformationLine as pr, RiApps2Line as mr, RiArrowUpDownLine as hr, RiArrowLeftRightLine as br, RiArrowRightLine as yr, RiArrowLeftLine as xr, RiZoomOutLine as vr, RiZoomInLine as kr, RiClockwise2Line as wr, RiAnticlockwise2Line as Cr, RiMoreLine as zr, RiArrowDropDownLine as Vt, RiLink as Nr, RiDeleteBinLine as qt, RiText as Zt, RiH1 as Kt, RiH2 as Jt, RiH3 as Qt, RiListCheck as eo, RiListUnordered as to, RiListOrdered as oo, RiQuoteText as ro, RiCodeLine as no, RiSparklingFill as Nt, RiImageLine as Ir, RiRepeatLine as Mr, RiFileCopyLine as Sr, RiAddLine as Lr, RiDraggable as Dr } from "@remixicon/react";
|
|
20
|
+
import Ar from "rc-drawer";
|
|
21
|
+
import { useFloating as Er, autoUpdate as Rr, offset as Tr, flip as Pr, shift as Br, FloatingPortal as $r } from "@floating-ui/react";
|
|
22
|
+
import { AdmonitionDirectiveDescriptor as _r, MDXEditor as Or, toolbarPlugin as Fr, diffSourcePlugin as Hr, listsPlugin as jr, quotePlugin as Ur, headingsPlugin as Wr, linkPlugin as Gr, linkDialogPlugin as Yr, imagePlugin as Xr, tablePlugin as Vr, thematicBreakPlugin as qr, frontmatterPlugin as Zr, codeBlockPlugin as Kr, codeMirrorPlugin as Jr, markdownShortcutPlugin as Qr, directivesPlugin as en, DiffSourceToggleWrapper as tn, UndoRedo as on, Separator as Pe, BoldItalicUnderlineToggles as rn, CodeToggle as nn, StrikeThroughSupSubToggles as sn, ListsToggle as an, CreateLink as ln, InsertImage as cn, InsertTable as dn, InsertThematicBreak as un, InsertCodeBlock as fn, InsertFrontmatter as gn } from "@mdxeditor/editor";
|
|
23
23
|
import so from "react-markdown";
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { Prism as
|
|
28
|
-
import { oneLight as
|
|
29
|
-
import
|
|
30
|
-
import { clsx as
|
|
31
|
-
import { twMerge as
|
|
32
|
-
import { Placeholder as
|
|
33
|
-
import { useDebouncedCallback as
|
|
34
|
-
import { Markdown as
|
|
24
|
+
import pn from "remark-gfm";
|
|
25
|
+
import mn from "remark-emoji";
|
|
26
|
+
import hn from "rehype-raw";
|
|
27
|
+
import { Prism as bn } from "react-syntax-highlighter";
|
|
28
|
+
import { oneLight as yn } from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
29
|
+
import xn from "rc-image";
|
|
30
|
+
import { clsx as vn } from "clsx";
|
|
31
|
+
import { twMerge as kn } from "tailwind-merge";
|
|
32
|
+
import { Placeholder as wn, TiptapLink as Cn, TiptapImage as zn, UploadImagesPlugin as Nn, UpdatedImage as In, TaskList as Mn, TaskItem as Sn, HorizontalRule as Ln, StarterKit as Dn, CodeBlockLowlight as An, Mathematics as En, CharacterCount as Rn, AIHighlight as Tn, TiptapUnderline as Pn, HighlightExtension as Bn, TextStyle as $n, Color as _n, CustomKeymap as On, useEditor as Se, EditorBubbleItem as it, getPrevText as Fn, addAIHighlight as Hn, removeAIHighlight as jn, EditorBubble as Un, createImageUpload as ao, Command as Wn, createSuggestionItems as Gn, renderItems as Yn, EditorRoot as Xn, EditorContent as Vn, handleImageDrop as qn, handleImagePaste as Zn, handleCommandNavigation as Kn, EditorCommand as Jn, EditorCommandEmpty as Qn, EditorCommandList as es, EditorCommandItem as ts, ImageResizer as os } from "novel";
|
|
33
|
+
import { useDebouncedCallback as rs } from "use-debounce";
|
|
34
|
+
import { Markdown as ns } from "tiptap-markdown";
|
|
35
35
|
import { cx as ye, cva as ss } from "class-variance-authority";
|
|
36
36
|
import { createLowlight as as, common as is } from "lowlight";
|
|
37
37
|
import { Extension as ls } from "@tiptap/core";
|
|
@@ -51,19 +51,19 @@ import { Command as ve } from "cmdk";
|
|
|
51
51
|
import * as Le from "@radix-ui/react-dialog";
|
|
52
52
|
import Ps from "highlight.js";
|
|
53
53
|
import Bs from "rc-dropdown";
|
|
54
|
-
import
|
|
54
|
+
import nt from "rc-menu";
|
|
55
55
|
import { generateHTML as $s } from "@tiptap/html";
|
|
56
56
|
import { createPortal as co } from "react-dom";
|
|
57
57
|
function _s(t, e) {
|
|
58
58
|
for (var o = 0; o < e.length; o++) {
|
|
59
|
-
const
|
|
60
|
-
if (typeof
|
|
61
|
-
for (const
|
|
62
|
-
if (
|
|
63
|
-
const a = Object.getOwnPropertyDescriptor(
|
|
64
|
-
a && Object.defineProperty(t,
|
|
59
|
+
const n = e[o];
|
|
60
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
61
|
+
for (const r in n)
|
|
62
|
+
if (r !== "default" && !(r in t)) {
|
|
63
|
+
const a = Object.getOwnPropertyDescriptor(n, r);
|
|
64
|
+
a && Object.defineProperty(t, r, a.get ? a : {
|
|
65
65
|
enumerable: !0,
|
|
66
|
-
get: () => r
|
|
66
|
+
get: () => n[r]
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -283,8 +283,8 @@ const gt = {
|
|
|
283
283
|
}, uo = Ct({
|
|
284
284
|
theme: It
|
|
285
285
|
}), fo = (t) => {
|
|
286
|
-
const { children: e, theme: o, ...
|
|
287
|
-
return /* @__PURE__ */ s(uo.Provider, { value: { theme:
|
|
286
|
+
const { children: e, theme: o, ...n } = t, r = re(() => o === "light" ? $e : o === "dark" ? gt : o ?? It, [o]);
|
|
287
|
+
return /* @__PURE__ */ s(uo.Provider, { value: { theme: r, ...n }, children: e });
|
|
288
288
|
};
|
|
289
289
|
function Us(t) {
|
|
290
290
|
const e = $e.token;
|
|
@@ -337,13 +337,13 @@ function Us(t) {
|
|
|
337
337
|
}
|
|
338
338
|
function Mt(t, e) {
|
|
339
339
|
const o = { ...t };
|
|
340
|
-
for (const
|
|
341
|
-
if (e[
|
|
342
|
-
const
|
|
343
|
-
typeof
|
|
340
|
+
for (const n in e)
|
|
341
|
+
if (e[n] !== void 0) {
|
|
342
|
+
const r = e[n], a = o[n];
|
|
343
|
+
typeof r == "object" && r !== null && !Array.isArray(r) ? o[n] = Mt(
|
|
344
344
|
a || {},
|
|
345
|
-
|
|
346
|
-
) : o[
|
|
345
|
+
r
|
|
346
|
+
) : o[n] = r;
|
|
347
347
|
}
|
|
348
348
|
return o;
|
|
349
349
|
}
|
|
@@ -353,7 +353,7 @@ function Ws(t) {
|
|
|
353
353
|
const e = {
|
|
354
354
|
...$e.token.base,
|
|
355
355
|
...t.token.base
|
|
356
|
-
}, o = Us(e),
|
|
356
|
+
}, o = Us(e), n = Mt(o, {
|
|
357
357
|
contextMenu: t.token.contextMenu,
|
|
358
358
|
items: t.token.items,
|
|
359
359
|
dock: t.token.dock,
|
|
@@ -361,11 +361,11 @@ function Ws(t) {
|
|
|
361
361
|
});
|
|
362
362
|
return {
|
|
363
363
|
...t,
|
|
364
|
-
token:
|
|
364
|
+
token: n
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
367
|
const pe = () => {
|
|
368
|
-
const t = De(uo), e =
|
|
368
|
+
const t = De(uo), e = re(() => Ws(t.theme), [t.theme]);
|
|
369
369
|
return {
|
|
370
370
|
...t,
|
|
371
371
|
theme: e
|
|
@@ -374,7 +374,7 @@ const pe = () => {
|
|
|
374
374
|
class Me {
|
|
375
375
|
}
|
|
376
376
|
/** 清理重复id */
|
|
377
|
-
ot(Me, "uniqueArray", (e) => e.reduce((o,
|
|
377
|
+
ot(Me, "uniqueArray", (e) => e.reduce((o, n) => o.find((a) => a.id === n.id) ? o : o.concat([n]), [])), ot(Me, "quickJSONCheck", (e) => {
|
|
378
378
|
if (typeof e != "string" || e.trim() === "") return !1;
|
|
379
379
|
if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
|
|
380
380
|
return /^\s*(".*?"|[\d.]+|true|false|null)\s*$/.test(e);
|
|
@@ -387,7 +387,7 @@ ot(Me, "uniqueArray", (e) => e.reduce((o, r) => o.find((a) => a.id === r.id) ? o
|
|
|
387
387
|
* 计算容器在给定 item 尺寸下的一行可容纳列数及行宽
|
|
388
388
|
*/
|
|
389
389
|
ot(Me, "computeRowWidth", (e, o = 112) => {
|
|
390
|
-
const
|
|
390
|
+
const n = window.getComputedStyle(e), r = parseFloat(n.paddingLeft) || 0, a = parseFloat(n.paddingRight) || 0, i = parseFloat(n.columnGap) || 0, l = e.clientWidth - r - a;
|
|
391
391
|
let f = Math.max(1, Math.floor((l + i) / (o + i)));
|
|
392
392
|
const p = f * o + (f - 1) * i;
|
|
393
393
|
l - p >= o * 0.9 && (f += 1);
|
|
@@ -446,20 +446,20 @@ const go = Ct({
|
|
|
446
446
|
const {
|
|
447
447
|
children: e,
|
|
448
448
|
list: o = [],
|
|
449
|
-
onChange:
|
|
450
|
-
storageKey:
|
|
449
|
+
onChange: n,
|
|
450
|
+
storageKey: r = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
|
|
451
451
|
enableCaching: a = !0
|
|
452
|
-
} = t, [i, l] = B(), [f, p] = B(), [d, g] = B(null), h =
|
|
452
|
+
} = t, [i, l] = B(), [f, p] = B(), [d, g] = B(null), h = ne(d), [c, u] = B(null), [w, z] = B([]), [y, M] = B(null), [k, v] = B(null), [b, x] = B(!1), [D, N] = B(null), [T, $] = B(null), [q, P] = B(null), [_, R] = B(0), [j, se] = B(!1), [Z, U] = nr(r, {
|
|
453
453
|
defaultValue: [],
|
|
454
454
|
listenStorageChange: !0
|
|
455
455
|
}), te = () => {
|
|
456
456
|
u(null), clearTimeout(i), l(void 0), h.current = null;
|
|
457
457
|
}, ce = (H, J) => {
|
|
458
|
-
let
|
|
459
|
-
for (;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
const F =
|
|
458
|
+
let W = H.target;
|
|
459
|
+
for (; W && !W.getAttribute("data-id"); )
|
|
460
|
+
W = W.parentElement;
|
|
461
|
+
W || (W = H.target);
|
|
462
|
+
const F = W.getBoundingClientRect();
|
|
463
463
|
u({
|
|
464
464
|
rect: F,
|
|
465
465
|
pageX: H.pageX,
|
|
@@ -467,8 +467,8 @@ const go = Ct({
|
|
|
467
467
|
data: J
|
|
468
468
|
}), clearTimeout(i);
|
|
469
469
|
}, fe = (H, J = !0) => {
|
|
470
|
-
const { config:
|
|
471
|
-
return
|
|
470
|
+
const { config: W = {} } = H;
|
|
471
|
+
return (W == null ? void 0 : W.allowContextMenu) === !1 ? {} : {
|
|
472
472
|
onMouseDown: (F) => {
|
|
473
473
|
l(
|
|
474
474
|
setTimeout(() => {
|
|
@@ -489,25 +489,25 @@ const go = Ct({
|
|
|
489
489
|
};
|
|
490
490
|
}, ae = ue(
|
|
491
491
|
(H, J) => {
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
492
|
+
const W = [...J || []];
|
|
493
|
+
if (W.length > 0)
|
|
494
494
|
z((F) => {
|
|
495
495
|
const oe = [...F], ee = (m) => {
|
|
496
|
-
var L,
|
|
497
|
-
const C =
|
|
498
|
-
if (
|
|
496
|
+
var L, G;
|
|
497
|
+
const C = W.shift(), I = m.find((O) => O.id === C), Y = m.findIndex((O) => O.id === C);
|
|
498
|
+
if (W.length && I) {
|
|
499
499
|
if (((L = I.children) == null ? void 0 : L.filter((O) => !H.some((me) => me.id === O.id)).length) === 1 && H.length === 1) {
|
|
500
500
|
const O = { ...H[0] };
|
|
501
|
-
return m.splice(Y, 1, O),
|
|
501
|
+
return m.splice(Y, 1, O), n == null || n(m), m;
|
|
502
502
|
}
|
|
503
|
-
return I.children = ee(I.children || []), m.splice(Y, 1, I),
|
|
503
|
+
return I.children = ee(I.children || []), m.splice(Y, 1, I), n == null || n(m), m;
|
|
504
504
|
}
|
|
505
505
|
if (I) {
|
|
506
|
-
if (!((
|
|
506
|
+
if (!((G = I.children) != null && G.length) && H.length && I.type !== "page") {
|
|
507
507
|
const O = { ...I };
|
|
508
|
-
return I.data = { name: "文件夹" }, I.type = "group", I.children = [O, ...H], I.id = ht(), m.splice(Y, 1, I),
|
|
508
|
+
return I.data = { name: "文件夹" }, I.type = "group", I.children = [O, ...H], I.id = ht(), m.splice(Y, 1, I), n == null || n(m), m;
|
|
509
509
|
}
|
|
510
|
-
return I.children = Me.uniqueArray(H), m.splice(Y, 1, I),
|
|
510
|
+
return I.children = Me.uniqueArray(H), m.splice(Y, 1, I), n == null || n(m), m;
|
|
511
511
|
}
|
|
512
512
|
return Me.uniqueArray(H);
|
|
513
513
|
};
|
|
@@ -515,13 +515,13 @@ const go = Ct({
|
|
|
515
515
|
});
|
|
516
516
|
else {
|
|
517
517
|
const F = Me.uniqueArray(H);
|
|
518
|
-
|
|
518
|
+
n == null || n(F), z(F);
|
|
519
519
|
}
|
|
520
520
|
},
|
|
521
|
-
[
|
|
521
|
+
[n]
|
|
522
522
|
), ie = (H, J) => {
|
|
523
|
-
z((
|
|
524
|
-
const F = [...
|
|
523
|
+
z((W) => {
|
|
524
|
+
const F = [...W], oe = (ee) => {
|
|
525
525
|
var m;
|
|
526
526
|
for (let C = 0; C < ee.length; C++)
|
|
527
527
|
if (ee[C].id === H) {
|
|
@@ -529,11 +529,11 @@ const go = Ct({
|
|
|
529
529
|
break;
|
|
530
530
|
} else ((m = ee[C].children) == null ? void 0 : m.length) !== void 0 && oe(ee[C].children);
|
|
531
531
|
};
|
|
532
|
-
return oe(F),
|
|
532
|
+
return oe(F), n == null || n(F), F;
|
|
533
533
|
});
|
|
534
534
|
}, K = (H, J) => {
|
|
535
|
-
z((
|
|
536
|
-
const F = [...
|
|
535
|
+
z((W) => {
|
|
536
|
+
const F = [...W], oe = (ee) => {
|
|
537
537
|
var m;
|
|
538
538
|
for (let C = 0; C < ee.length; C++)
|
|
539
539
|
if (ee[C].id === H) {
|
|
@@ -541,11 +541,11 @@ const go = Ct({
|
|
|
541
541
|
break;
|
|
542
542
|
} else ((m = ee[C].children) == null ? void 0 : m.length) !== void 0 && oe(ee[C].children);
|
|
543
543
|
};
|
|
544
|
-
return oe(F),
|
|
544
|
+
return oe(F), n == null || n(F), F;
|
|
545
545
|
});
|
|
546
546
|
}, de = (H) => {
|
|
547
547
|
z((J) => {
|
|
548
|
-
const
|
|
548
|
+
const W = [...J], F = (oe) => {
|
|
549
549
|
var ee;
|
|
550
550
|
for (let m = 0; m < oe.length; m++)
|
|
551
551
|
if (oe[m].id === H) {
|
|
@@ -553,10 +553,10 @@ const go = Ct({
|
|
|
553
553
|
break;
|
|
554
554
|
} else ((ee = oe[m].children) == null ? void 0 : ee.length) !== void 0 && F(oe[m].children);
|
|
555
555
|
};
|
|
556
|
-
return F(
|
|
556
|
+
return F(W), n == null || n(W), W;
|
|
557
557
|
});
|
|
558
558
|
}, be = (H, J) => {
|
|
559
|
-
const
|
|
559
|
+
const W = [...w], F = !J || J.length === 0 ? (ze == null ? void 0 : ze.id) !== void 0 ? [ze.id] : [] : J;
|
|
560
560
|
if (F.length === 0)
|
|
561
561
|
return;
|
|
562
562
|
const oe = (ee, m) => {
|
|
@@ -570,24 +570,24 @@ const go = Ct({
|
|
|
570
570
|
}
|
|
571
571
|
], ee.splice(Y, 1, I)), ee;
|
|
572
572
|
};
|
|
573
|
-
z(oe(
|
|
573
|
+
z(oe(W, [...F]));
|
|
574
574
|
}, Q = (H) => {
|
|
575
575
|
z((J) => {
|
|
576
|
-
const
|
|
576
|
+
const W = {
|
|
577
577
|
...H,
|
|
578
578
|
id: ht()
|
|
579
|
-
}, F = [...J,
|
|
580
|
-
return
|
|
579
|
+
}, F = [...J, W];
|
|
580
|
+
return n == null || n(F), F;
|
|
581
581
|
});
|
|
582
582
|
}, he = (H, J) => {
|
|
583
|
-
z((
|
|
584
|
-
const F = [...
|
|
585
|
-
return oe !== -1 && (F[oe] = { ...F[oe], ...J },
|
|
583
|
+
z((W) => {
|
|
584
|
+
const F = [...W], oe = F.findIndex((ee) => ee.id === H);
|
|
585
|
+
return oe !== -1 && (F[oe] = { ...F[oe], ...J }, n == null || n(F)), F;
|
|
586
586
|
});
|
|
587
587
|
}, ge = (H) => {
|
|
588
588
|
z((J) => {
|
|
589
|
-
const
|
|
590
|
-
return
|
|
589
|
+
const W = J.filter((F) => F.id !== H);
|
|
590
|
+
return n == null || n(W), W;
|
|
591
591
|
});
|
|
592
592
|
};
|
|
593
593
|
V(() => {
|
|
@@ -596,7 +596,7 @@ const go = Ct({
|
|
|
596
596
|
h.current = d, d !== null && te();
|
|
597
597
|
}, [d]), V(() => {
|
|
598
598
|
a && Z != null && Z.length && !j && (ae(Z), se(!0));
|
|
599
|
-
}, [Z, j, a, ae]),
|
|
599
|
+
}, [Z, j, a, ae]), sr(
|
|
600
600
|
() => {
|
|
601
601
|
a && U(w);
|
|
602
602
|
},
|
|
@@ -605,7 +605,7 @@ const go = Ct({
|
|
|
605
605
|
wait: 1e3
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
|
-
const ke =
|
|
608
|
+
const ke = re(() => w.filter((H) => H.type !== "dock"), [w]), ze = re(() => ke[_] ?? null, [ke, _]);
|
|
609
609
|
return V(() => {
|
|
610
610
|
_ >= ke.length && R(ke.length > 0 ? ke.length - 1 : 0);
|
|
611
611
|
}, [_, ke.length]), /* @__PURE__ */ s(
|
|
@@ -650,19 +650,19 @@ const go = Ct({
|
|
|
650
650
|
sliderRef: t,
|
|
651
651
|
activeSlide: e,
|
|
652
652
|
totalSlides: o,
|
|
653
|
-
maxSlides:
|
|
654
|
-
isDragging:
|
|
653
|
+
maxSlides: n,
|
|
654
|
+
isDragging: r,
|
|
655
655
|
triggerDelay: a = 800,
|
|
656
656
|
triggerZoneWidth: i = 80,
|
|
657
657
|
containerRef: l,
|
|
658
658
|
onCreateNewPage: f
|
|
659
659
|
}, p) => {
|
|
660
|
-
const d =
|
|
660
|
+
const d = ne(null), [g, h] = B(null), c = ne(0), u = ne(!1), w = ue(() => {
|
|
661
661
|
d.current && (clearTimeout(d.current), d.current = null), u.current = !1;
|
|
662
662
|
}, []), z = ue(
|
|
663
663
|
(b) => {
|
|
664
|
-
if (!
|
|
665
|
-
const x = e >= o - 1, D = typeof
|
|
664
|
+
if (!r) return;
|
|
665
|
+
const x = e >= o - 1, D = typeof n == "number" && o >= n;
|
|
666
666
|
if (b === "right" && x && D)
|
|
667
667
|
return;
|
|
668
668
|
const N = Date.now();
|
|
@@ -678,10 +678,10 @@ const go = Ct({
|
|
|
678
678
|
}, a));
|
|
679
679
|
},
|
|
680
680
|
[
|
|
681
|
-
|
|
681
|
+
r,
|
|
682
682
|
e,
|
|
683
683
|
o,
|
|
684
|
-
|
|
684
|
+
n,
|
|
685
685
|
w,
|
|
686
686
|
t,
|
|
687
687
|
g,
|
|
@@ -692,13 +692,13 @@ const go = Ct({
|
|
|
692
692
|
h(null), w();
|
|
693
693
|
}, [w]), M = ue(
|
|
694
694
|
(b) => {
|
|
695
|
-
if (!
|
|
695
|
+
if (!r || !l.current)
|
|
696
696
|
return;
|
|
697
697
|
const x = l.current.getBoundingClientRect(), D = b.clientX - x.left, N = x.width - i;
|
|
698
698
|
if (D < i && e > 0)
|
|
699
699
|
z("left");
|
|
700
700
|
else if (D > N) {
|
|
701
|
-
const T = e >= o - 1, $ = typeof
|
|
701
|
+
const T = e >= o - 1, $ = typeof n == "number" && o >= n;
|
|
702
702
|
if (T && $)
|
|
703
703
|
return;
|
|
704
704
|
z("right");
|
|
@@ -706,12 +706,12 @@ const go = Ct({
|
|
|
706
706
|
g && y();
|
|
707
707
|
},
|
|
708
708
|
[
|
|
709
|
-
|
|
709
|
+
r,
|
|
710
710
|
l,
|
|
711
711
|
i,
|
|
712
712
|
e,
|
|
713
713
|
o,
|
|
714
|
-
|
|
714
|
+
n,
|
|
715
715
|
z,
|
|
716
716
|
g,
|
|
717
717
|
y
|
|
@@ -726,8 +726,8 @@ const go = Ct({
|
|
|
726
726
|
), V(() => () => {
|
|
727
727
|
w();
|
|
728
728
|
}, [w]), V(() => {
|
|
729
|
-
|
|
730
|
-
}, [
|
|
729
|
+
r || (w(), h(null), u.current = !1, c.current = 0);
|
|
730
|
+
}, [r, w]);
|
|
731
731
|
const k = E`
|
|
732
732
|
position: absolute;
|
|
733
733
|
top: 0;
|
|
@@ -790,14 +790,14 @@ const go = Ct({
|
|
|
790
790
|
);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
`, v = typeof
|
|
794
|
-
return !
|
|
793
|
+
`, v = typeof n == "number" && o >= n && e >= o - 1;
|
|
794
|
+
return !r || v ? null : /* @__PURE__ */ A(Ie, { children: [
|
|
795
795
|
e > 0 && /* @__PURE__ */ s(
|
|
796
796
|
"div",
|
|
797
797
|
{
|
|
798
798
|
className: S(k, "left", g === "left" && "active"),
|
|
799
799
|
onMouseEnter: () => {
|
|
800
|
-
|
|
800
|
+
r && z("left");
|
|
801
801
|
},
|
|
802
802
|
onMouseLeave: () => {
|
|
803
803
|
y();
|
|
@@ -809,8 +809,8 @@ const go = Ct({
|
|
|
809
809
|
{
|
|
810
810
|
className: S(k, "right", g === "right" && "active"),
|
|
811
811
|
onMouseEnter: () => {
|
|
812
|
-
const b = e >= o - 1, x = typeof
|
|
813
|
-
|
|
812
|
+
const b = e >= o - 1, x = typeof n == "number" && o >= n;
|
|
813
|
+
r && !(b && x) && z("right");
|
|
814
814
|
},
|
|
815
815
|
onMouseLeave: () => {
|
|
816
816
|
y();
|
|
@@ -999,31 +999,31 @@ function ct(t, e) {
|
|
|
999
999
|
return (e == null ? void 0 : e[t]) || vt[t] || vt.app;
|
|
1000
1000
|
}
|
|
1001
1001
|
function vo(t, e, o) {
|
|
1002
|
-
return t ? e.find((
|
|
1002
|
+
return t ? e.find((n) => n.id === t || n.name === t) || e.find((n) => n.id === o || n.name === o) || e[0] : e.find((n) => n.id === o || n.name === o) || e[0];
|
|
1003
1003
|
}
|
|
1004
1004
|
function ko(t, e, o) {
|
|
1005
|
-
const
|
|
1006
|
-
return { col:
|
|
1005
|
+
const n = ct(t, o), r = vo(e, n.sizeConfigs, n.defaultSizeId);
|
|
1006
|
+
return { col: r.col, row: r.row };
|
|
1007
1007
|
}
|
|
1008
1008
|
const qs = Ae(({ src: t }) => {
|
|
1009
|
-
const [e, o] = B(!0), [
|
|
1009
|
+
const [e, o] = B(!0), [n, r] = B(!1), a = ue(() => {
|
|
1010
1010
|
o(!1);
|
|
1011
1011
|
}, []), i = ue(() => {
|
|
1012
|
-
o(!1),
|
|
1013
|
-
}, []), l =
|
|
1012
|
+
o(!1), r(!0);
|
|
1013
|
+
}, []), l = re(() => `zs-w-full zs-h-full zs-object-cover zs-transition-opacity zs-duration-300 ${e ? "zs-opacity-0" : "zs-opacity-100"}`, [e]);
|
|
1014
1014
|
return /* @__PURE__ */ A("div", { className: "zs-relative zs-w-full zs-h-full", children: [
|
|
1015
1015
|
e && /* @__PURE__ */ s("div", { className: "zs-absolute zs-inset-0 zs-flex zs-items-center zs-justify-center zs-bg-gray-100", children: /* @__PURE__ */ s("div", { className: "zs-animate-spin zs-rounded-full zs-h-4 zs-w-4 zs-border-b-2 zs-border-gray-600" }) }),
|
|
1016
|
-
|
|
1016
|
+
n ? /* @__PURE__ */ s("div", { className: "zs-w-full zs-h-full zs-flex zs-items-center zs-justify-center zs-bg-gray-100 zs-text-gray-400", children: /* @__PURE__ */ s("span", { className: "zs-text-xs", children: "加载失败" }) }) : /* @__PURE__ */ s("img", { src: t, alt: "", className: l, onLoad: a, onError: i })
|
|
1017
1017
|
] });
|
|
1018
1018
|
}), qe = (t, e, o) => {
|
|
1019
|
-
const { data:
|
|
1020
|
-
return e || (
|
|
1019
|
+
const { data: n = {} } = t, { icon: r } = n;
|
|
1020
|
+
return e || (r ? typeof r == "string" && (r.startsWith("http") || r.startsWith("https")) ? /* @__PURE__ */ s(qs, { src: r }) : r : o ? typeof o == "function" ? o(t) : o : null);
|
|
1021
1021
|
}, wo = (t) => {
|
|
1022
1022
|
var g, h;
|
|
1023
|
-
const { data: e, noLetters: o = !1, name:
|
|
1023
|
+
const { data: e, noLetters: o = !1, name: n, defaultName: r, className: a } = t, { moveItemId: i } = Ee(), { theme: l } = pe(), f = {
|
|
1024
1024
|
visible: { opacity: 1, scale: 1 },
|
|
1025
1025
|
hidden: { opacity: 0, scale: 0.95 }
|
|
1026
|
-
}, p =
|
|
1026
|
+
}, p = re(() => i === e.id.toString(), [e.id, i]), d = n || ((g = e.data) == null ? void 0 : g.name) || r || "";
|
|
1027
1027
|
return /* @__PURE__ */ s(
|
|
1028
1028
|
X.p,
|
|
1029
1029
|
{
|
|
@@ -1044,7 +1044,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1044
1044
|
);
|
|
1045
1045
|
}, Zs = (t) => {
|
|
1046
1046
|
var z, y, M;
|
|
1047
|
-
const { data: e, noLetters: o = !1, icon:
|
|
1047
|
+
const { data: e, noLetters: o = !1, icon: n, iconColor: r, from: a, iconSize: i = 64, contextMenuProps: l } = t, { contextMenuFuns: f } = Ee(), { itemIconBuilder: p, theme: d, contextMenu: g } = pe(), h = l != !1 ? l || g : l, { data: c = {} } = e, { name: u, iconColor: w } = c;
|
|
1048
1048
|
return /* @__PURE__ */ A(Ie, { children: [
|
|
1049
1049
|
/* @__PURE__ */ s(
|
|
1050
1050
|
X.div,
|
|
@@ -1052,7 +1052,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1052
1052
|
className: S(
|
|
1053
1053
|
"zs-cursor-pointer zs-relative zs-overflow-hidden",
|
|
1054
1054
|
E`
|
|
1055
|
-
background-color: ${
|
|
1055
|
+
background-color: ${r ?? w ?? ((z = d.token.items) == null ? void 0 : z.iconBackgroundColor)};
|
|
1056
1056
|
border-radius: 0.75rem;
|
|
1057
1057
|
box-shadow: 0 0 0.5rem ${(y = d.token.items) == null ? void 0 : y.iconShadowColor};
|
|
1058
1058
|
width: ${i}px;
|
|
@@ -1073,7 +1073,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1073
1073
|
{ ...e, ...a === "dock" ? { config: { allowResize: !1 } } : {} },
|
|
1074
1074
|
h !== !1
|
|
1075
1075
|
),
|
|
1076
|
-
children: qe(e,
|
|
1076
|
+
children: qe(e, n, p)
|
|
1077
1077
|
}
|
|
1078
1078
|
)
|
|
1079
1079
|
}
|
|
@@ -1081,15 +1081,15 @@ const qs = Ae(({ src: t }) => {
|
|
|
1081
1081
|
/* @__PURE__ */ s(wo, { data: e, noLetters: o, name: u })
|
|
1082
1082
|
] });
|
|
1083
1083
|
}, _e = (t) => {
|
|
1084
|
-
const { data: e, className: o, itemIndex:
|
|
1084
|
+
const { data: e, className: o, itemIndex: n, onClick: r, disabledDrag: a = !1, children: i, parentIds: l, childrenLength: f } = t;
|
|
1085
1085
|
return /* @__PURE__ */ s(
|
|
1086
1086
|
X.div,
|
|
1087
1087
|
{
|
|
1088
1088
|
"data-id": e.id,
|
|
1089
|
-
"data-index":
|
|
1089
|
+
"data-index": n,
|
|
1090
1090
|
"data-parent-ids": l == null ? void 0 : l.join(","),
|
|
1091
1091
|
"data-children-length": f,
|
|
1092
|
-
onClick: () =>
|
|
1092
|
+
onClick: () => r == null ? void 0 : r(e),
|
|
1093
1093
|
className: S(a && "drag-disabled", "zs-relative", o),
|
|
1094
1094
|
initial: { opacity: 0 },
|
|
1095
1095
|
animate: { opacity: 1 },
|
|
@@ -1099,7 +1099,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1099
1099
|
);
|
|
1100
1100
|
}, Co = (t) => {
|
|
1101
1101
|
var P, _, R, j, se;
|
|
1102
|
-
const { data: e, className: o, parentIds:
|
|
1102
|
+
const { data: e, className: o, parentIds: n, itemIndex: r, onClick: a, noLetters: i = !1, disabledDrag: l = !1, icon: f } = t, {
|
|
1103
1103
|
contextMenuFuns: p,
|
|
1104
1104
|
setList: d,
|
|
1105
1105
|
setOpenGroupItemData: g,
|
|
@@ -1107,7 +1107,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1107
1107
|
moveTargetId: c,
|
|
1108
1108
|
setMoveTargetId: u,
|
|
1109
1109
|
listStatus: w
|
|
1110
|
-
} = Ee(), { itemIconBuilder: z, theme: y, contextMenu: M, typeConfigMap: k } = pe(), { children: v } = e, { row: b, col: x } = ko(e.type, (P = e.config) == null ? void 0 : P.sizeId, k), D = ((v == null ? void 0 : v.length) ?? 0) === 0, N = D ? [e] : [...v ?? []].slice(0, 9), T =
|
|
1110
|
+
} = Ee(), { itemIconBuilder: z, theme: y, contextMenu: M, typeConfigMap: k } = pe(), { children: v } = e, { row: b, col: x } = ko(e.type, (P = e.config) == null ? void 0 : P.sizeId, k), D = ((v == null ? void 0 : v.length) ?? 0) === 0, N = D ? [e] : [...v ?? []].slice(0, 9), T = re(() => c === e.id, [e.id, c]), $ = E`
|
|
1111
1111
|
overflow: hidden;
|
|
1112
1112
|
cursor: pointer;
|
|
1113
1113
|
background-color: ${(_ = y.token.items) == null ? void 0 : _.iconBackgroundColor};
|
|
@@ -1220,8 +1220,8 @@ const qs = Ae(({ src: t }) => {
|
|
|
1220
1220
|
_e,
|
|
1221
1221
|
{
|
|
1222
1222
|
data: e,
|
|
1223
|
-
itemIndex:
|
|
1224
|
-
parentIds:
|
|
1223
|
+
itemIndex: r,
|
|
1224
|
+
parentIds: n,
|
|
1225
1225
|
childrenLength: v == null ? void 0 : v.length,
|
|
1226
1226
|
className: S(o),
|
|
1227
1227
|
children: [
|
|
@@ -1244,7 +1244,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1244
1244
|
`
|
|
1245
1245
|
),
|
|
1246
1246
|
onClick: (Z) => {
|
|
1247
|
-
!D && !h && (e.parentIds =
|
|
1247
|
+
!D && !h && (e.parentIds = n, e.pageX = Z.pageX, e.pageY = Z.pageY, g(e));
|
|
1248
1248
|
},
|
|
1249
1249
|
...p(e, M !== !1),
|
|
1250
1250
|
children: /* @__PURE__ */ A(
|
|
@@ -1279,7 +1279,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1279
1279
|
animation: 150,
|
|
1280
1280
|
fallbackOnBody: !0,
|
|
1281
1281
|
list: v ?? [],
|
|
1282
|
-
setList: (Z) => !l && d(Z,
|
|
1282
|
+
setList: (Z) => !l && d(Z, n),
|
|
1283
1283
|
filter: () => !0,
|
|
1284
1284
|
disabled: l,
|
|
1285
1285
|
"data-id": e.id,
|
|
@@ -1297,9 +1297,9 @@ const qs = Ae(({ src: t }) => {
|
|
|
1297
1297
|
]
|
|
1298
1298
|
}
|
|
1299
1299
|
);
|
|
1300
|
-
}, zo = Xs, Ks = ({ value: t, onChange: e, onBlur: o, placeholder:
|
|
1300
|
+
}, zo = Xs, Ks = ({ value: t, onChange: e, onBlur: o, placeholder: n = "标题" }) => {
|
|
1301
1301
|
var p, d, g, h, c, u, w, z, y, M, k, v, b, x, D, N, T, $, q, P, _;
|
|
1302
|
-
const [
|
|
1302
|
+
const [r, a] = B(t), { theme: i } = pe(), l = (R) => {
|
|
1303
1303
|
const j = R.target.value;
|
|
1304
1304
|
a(j), e(j);
|
|
1305
1305
|
}, f = () => {
|
|
@@ -1340,10 +1340,10 @@ const qs = Ae(({ src: t }) => {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
`
|
|
1342
1342
|
),
|
|
1343
|
-
value:
|
|
1343
|
+
value: r,
|
|
1344
1344
|
onChange: l,
|
|
1345
1345
|
onBlur: f,
|
|
1346
|
-
placeholder:
|
|
1346
|
+
placeholder: n
|
|
1347
1347
|
}
|
|
1348
1348
|
);
|
|
1349
1349
|
}, pt = (t) => {
|
|
@@ -1351,8 +1351,8 @@ const qs = Ae(({ src: t }) => {
|
|
|
1351
1351
|
const {
|
|
1352
1352
|
visible: e,
|
|
1353
1353
|
onClose: o,
|
|
1354
|
-
title:
|
|
1355
|
-
children:
|
|
1354
|
+
title: n,
|
|
1355
|
+
children: r,
|
|
1356
1356
|
width: a = 600,
|
|
1357
1357
|
mousePosition: i,
|
|
1358
1358
|
destroyOnClose: l = !0,
|
|
@@ -1364,7 +1364,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1364
1364
|
return V(() => {
|
|
1365
1365
|
w(!!e);
|
|
1366
1366
|
}, [e]), /* @__PURE__ */ s(Ce, { children: e && /* @__PURE__ */ s(
|
|
1367
|
-
|
|
1367
|
+
ir,
|
|
1368
1368
|
{
|
|
1369
1369
|
visible: u,
|
|
1370
1370
|
onClose: () => {
|
|
@@ -1375,7 +1375,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1375
1375
|
animation: "zoom",
|
|
1376
1376
|
maskAnimation: "fade",
|
|
1377
1377
|
mousePosition: i,
|
|
1378
|
-
title:
|
|
1378
|
+
title: n,
|
|
1379
1379
|
footer: p,
|
|
1380
1380
|
closable: f,
|
|
1381
1381
|
className: S(
|
|
@@ -1544,13 +1544,13 @@ const qs = Ae(({ src: t }) => {
|
|
|
1544
1544
|
`,
|
|
1545
1545
|
g
|
|
1546
1546
|
),
|
|
1547
|
-
children:
|
|
1547
|
+
children: r
|
|
1548
1548
|
}
|
|
1549
1549
|
)
|
|
1550
1550
|
}
|
|
1551
1551
|
) });
|
|
1552
1552
|
}, Js = (t) => {
|
|
1553
|
-
const { data: e, onClose: o, onItemClick:
|
|
1553
|
+
const { data: e, onClose: o, onItemClick: n } = t, { list: r, setList: a, setListStatus: i, setMoveItemId: l, setMoveTargetId: f, updateItem: p } = Ee(), [d, g] = B("文件夹"), h = ne(null), c = ne(null), [u, w] = B(), [z, y] = B(), M = [...(e == null ? void 0 : e.children) ?? []];
|
|
1554
1554
|
V(() => {
|
|
1555
1555
|
var N;
|
|
1556
1556
|
e && g((N = e.data) == null ? void 0 : N.name);
|
|
@@ -1617,7 +1617,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1617
1617
|
list: (e == null ? void 0 : e.children) ?? [],
|
|
1618
1618
|
setList: (N) => {
|
|
1619
1619
|
var q, P;
|
|
1620
|
-
const T = N.map((_) => _.id), $ = (P = (q =
|
|
1620
|
+
const T = N.map((_) => _.id), $ = (P = (q = r.find((_) => _.id === (e == null ? void 0 : e.id))) == null ? void 0 : q.children) == null ? void 0 : P.map((_) => _.id);
|
|
1621
1621
|
T.length === ($ == null ? void 0 : $.length) && T.every((_, R) => _ === $[R]) || T.length < (($ == null ? void 0 : $.length) ?? 0) || a(N, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
|
|
1622
1622
|
},
|
|
1623
1623
|
onMove: () => (f(null), i("onMove"), !0),
|
|
@@ -1629,20 +1629,20 @@ const qs = Ae(({ src: t }) => {
|
|
|
1629
1629
|
l(null), f(null), i(null);
|
|
1630
1630
|
},
|
|
1631
1631
|
ghostClass: zo,
|
|
1632
|
-
children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: M.map((N, T) => /* @__PURE__ */ s("div", { className: "zs-w-28 zs-h-28 zs-flex zs-items-center zs-justify-center", children: /* @__PURE__ */ s(_e, { data: N, itemIndex: T, onClick:
|
|
1632
|
+
children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: M.map((N, T) => /* @__PURE__ */ s("div", { className: "zs-w-28 zs-h-28 zs-flex zs-items-center zs-justify-center", children: /* @__PURE__ */ s(_e, { data: N, itemIndex: T, onClick: n }, N.id) }, N.id)) })
|
|
1633
1633
|
}
|
|
1634
1634
|
) })
|
|
1635
1635
|
}
|
|
1636
1636
|
);
|
|
1637
1637
|
}, Qs = (t) => {
|
|
1638
|
-
var
|
|
1639
|
-
const { data: e, onClose: o } = t, { theme:
|
|
1638
|
+
var r, a;
|
|
1639
|
+
const { data: e, onClose: o } = t, { theme: n } = pe();
|
|
1640
1640
|
return /* @__PURE__ */ s(
|
|
1641
1641
|
pt,
|
|
1642
1642
|
{
|
|
1643
1643
|
visible: !!e,
|
|
1644
1644
|
onClose: o,
|
|
1645
|
-
title: `${(
|
|
1645
|
+
title: `${(r = e == null ? void 0 : e.data) == null ? void 0 : r.name}开发者信息`,
|
|
1646
1646
|
mousePosition: e != null && e.pageX && (e != null && e.pageY) ? {
|
|
1647
1647
|
x: e == null ? void 0 : e.pageX,
|
|
1648
1648
|
y: e == null ? void 0 : e.pageY
|
|
@@ -1653,10 +1653,10 @@ const qs = Ae(({ src: t }) => {
|
|
|
1653
1653
|
className: S(
|
|
1654
1654
|
"zs-p-2 zs-rounded-md",
|
|
1655
1655
|
E`
|
|
1656
|
-
background-color: ${(a =
|
|
1656
|
+
background-color: ${(a = n.token.items) == null ? void 0 : a.infoModalBackgroundColor};
|
|
1657
1657
|
`
|
|
1658
1658
|
),
|
|
1659
|
-
children: /* @__PURE__ */ s(
|
|
1659
|
+
children: /* @__PURE__ */ s(lr, { src: e, theme: "monokai" })
|
|
1660
1660
|
}
|
|
1661
1661
|
)
|
|
1662
1662
|
}
|
|
@@ -1706,25 +1706,25 @@ const qs = Ae(({ src: t }) => {
|
|
|
1706
1706
|
),
|
|
1707
1707
|
children: t
|
|
1708
1708
|
}
|
|
1709
|
-
) }), ta = ({ pagingDotsBuilder: t, slickDots: e, disabled: o = !1, className:
|
|
1710
|
-
const
|
|
1711
|
-
return o && a ? o(a,
|
|
1709
|
+
) }), ta = ({ pagingDotsBuilder: t, slickDots: e, disabled: o = !1, className: n }) => o ? /* @__PURE__ */ s("div", {}) : t ? /* @__PURE__ */ s(Ie, { children: t(e) }) : /* @__PURE__ */ s(ea, { dots: e, className: n }), oa = (t, e, o) => (n) => {
|
|
1710
|
+
const r = e === n, a = t[n];
|
|
1711
|
+
return o && a ? o(a, n, r) : /* @__PURE__ */ s(
|
|
1712
1712
|
"button",
|
|
1713
1713
|
{
|
|
1714
1714
|
type: "button",
|
|
1715
1715
|
className: S(
|
|
1716
1716
|
"zs-w-2 zs-h-2 zs-rounded-full zs-border-none zs-cursor-pointer",
|
|
1717
1717
|
E`
|
|
1718
|
-
background-color: ${
|
|
1718
|
+
background-color: ${r ? "rgba(0, 0, 0, 1)" : "rgba(0, 0, 0, 0.3)"};
|
|
1719
1719
|
font-size: 0;
|
|
1720
1720
|
transition: all 0.2s ease;
|
|
1721
1721
|
`
|
|
1722
1722
|
)
|
|
1723
1723
|
}
|
|
1724
1724
|
);
|
|
1725
|
-
},
|
|
1725
|
+
}, ra = ({ onClick: t, className: e }) => {
|
|
1726
1726
|
var c, u, w;
|
|
1727
|
-
const [o,
|
|
1727
|
+
const [o, n] = B(!1), { theme: r } = pe(), a = (w = (u = (c = r == null ? void 0 : r.token) == null ? void 0 : c.dock) == null ? void 0 : u.launchpad) == null ? void 0 : w.icon, i = a.textColor, l = a.backgroundColor, f = a.borderColor, p = a.shadowColor, d = a.hoverGlowColor, g = (z, y) => {
|
|
1728
1728
|
if (z.startsWith("#")) {
|
|
1729
1729
|
const k = z.slice(1), v = parseInt(k.slice(0, 2), 16), b = parseInt(k.slice(2, 4), 16), x = parseInt(k.slice(4, 6), 16), D = y * 15, N = Math.max(0, v - D), T = Math.max(0, b - D), $ = Math.max(0, x - D);
|
|
1730
1730
|
return `rgb(${N}, ${T}, ${$})`;
|
|
@@ -1738,7 +1738,7 @@ const qs = Ae(({ src: t }) => {
|
|
|
1738
1738
|
}, h = [
|
|
1739
1739
|
{
|
|
1740
1740
|
id: "app1",
|
|
1741
|
-
icon: /* @__PURE__ */ s(
|
|
1741
|
+
icon: /* @__PURE__ */ s(cr, { size: 32 })
|
|
1742
1742
|
},
|
|
1743
1743
|
{
|
|
1744
1744
|
id: "app2"
|
|
@@ -1764,8 +1764,8 @@ const qs = Ae(({ src: t }) => {
|
|
|
1764
1764
|
// 减少悬浮缩放
|
|
1765
1765
|
transition: { duration: 0.2 }
|
|
1766
1766
|
},
|
|
1767
|
-
onHoverStart: () =>
|
|
1768
|
-
onHoverEnd: () =>
|
|
1767
|
+
onHoverStart: () => n(!0),
|
|
1768
|
+
onHoverEnd: () => n(!1),
|
|
1769
1769
|
onClick: t,
|
|
1770
1770
|
children: [
|
|
1771
1771
|
/* @__PURE__ */ s(
|
|
@@ -1832,12 +1832,12 @@ const qs = Ae(({ src: t }) => {
|
|
|
1832
1832
|
]
|
|
1833
1833
|
}
|
|
1834
1834
|
);
|
|
1835
|
-
}, No = ({ onClick: t, className: e }) => /* @__PURE__ */ s(
|
|
1835
|
+
}, No = ({ onClick: t, className: e }) => /* @__PURE__ */ s(ra, { onClick: t, className: S("zs-flex-shrink-0", e) });
|
|
1836
1836
|
function Io() {
|
|
1837
1837
|
const t = () => {
|
|
1838
1838
|
if (typeof navigator > "u") return !1;
|
|
1839
|
-
const
|
|
1840
|
-
return
|
|
1839
|
+
const n = navigator.userAgent || "", r = /\biPad\b/i.test(n), a = /\bAndroid\b/i.test(n), i = /\bMobile\b/i.test(n), l = a && !i, f = /\bTablet\b/i.test(n) || /\bSilk\b/i.test(n);
|
|
1840
|
+
return r || l || f ? !1 : !!(/\biPhone\b/i.test(n) || /\biPod\b/i.test(n) || a && i || /\bIEMobile\b/i.test(n) || /\bWindows Phone\b/i.test(n) || /\bOpera Mini\b/i.test(n) || /\bBlackBerry\b/i.test(n));
|
|
1841
1841
|
}, [e, o] = B(!1);
|
|
1842
1842
|
return V(() => {
|
|
1843
1843
|
o(t());
|
|
@@ -1847,8 +1847,8 @@ const Mo = ({
|
|
|
1847
1847
|
items: t = [],
|
|
1848
1848
|
fixedItems: e = [],
|
|
1849
1849
|
position: o = "bottom",
|
|
1850
|
-
className:
|
|
1851
|
-
itemBuilder:
|
|
1850
|
+
className: n,
|
|
1851
|
+
itemBuilder: r,
|
|
1852
1852
|
fixedItemBuilder: a,
|
|
1853
1853
|
showLaunchpad: i = !0,
|
|
1854
1854
|
onLaunchpadClick: l,
|
|
@@ -1857,7 +1857,7 @@ const Mo = ({
|
|
|
1857
1857
|
itemSize: d = 56
|
|
1858
1858
|
}) => {
|
|
1859
1859
|
var q;
|
|
1860
|
-
const { setListStatus: g } = Ee(), { theme: h } = pe(), c = h.token.dock, u = h.token.base, w = Io(), [z, y] = B(null), [M, k] = B(null), [v, b] = B(0), [x, D] = B(!1), N = (P, _) =>
|
|
1860
|
+
const { setListStatus: g } = Ee(), { theme: h } = pe(), c = h.token.dock, u = h.token.base, w = Io(), [z, y] = B(null), [M, k] = B(null), [v, b] = B(0), [x, D] = B(!1), N = (P, _) => r ? r(P, _) : /* @__PURE__ */ s(_e, { data: P, itemIndex: _, noLetters: !0, from: "dock", iconSize: d }, P.id), T = (P, _) => a ? a(P, _) : /* @__PURE__ */ s(
|
|
1861
1861
|
_e,
|
|
1862
1862
|
{
|
|
1863
1863
|
data: P,
|
|
@@ -1897,7 +1897,7 @@ const Mo = ({
|
|
|
1897
1897
|
border-color: ${(c == null ? void 0 : c.borderColor) || "rgba(255, 255, 255, 0.2)"};
|
|
1898
1898
|
box-shadow: 0 8px 32px ${(c == null ? void 0 : c.boxShadowColor) || "rgba(0, 0, 0, 0.1)"};
|
|
1899
1899
|
`,
|
|
1900
|
-
|
|
1900
|
+
n
|
|
1901
1901
|
),
|
|
1902
1902
|
onDragOver: (P) => P.preventDefault(),
|
|
1903
1903
|
onDrop: (P) => {
|
|
@@ -1974,7 +1974,7 @@ const Mo = ({
|
|
|
1974
1974
|
opacity: 0.5 !important;
|
|
1975
1975
|
`
|
|
1976
1976
|
),
|
|
1977
|
-
children: /* @__PURE__ */ s(
|
|
1977
|
+
children: /* @__PURE__ */ s(dr, {})
|
|
1978
1978
|
}
|
|
1979
1979
|
)
|
|
1980
1980
|
}
|
|
@@ -2028,9 +2028,9 @@ const Mo = ({
|
|
|
2028
2028
|
] });
|
|
2029
2029
|
}, bt = E`
|
|
2030
2030
|
transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
2031
|
-
`,
|
|
2032
|
-
var c, u, w, z, y, M, k, v, b, x, D, N, T, $, q, P, _, R, j, se, Z, U, te, ce, fe, ae, ie, K, de, be, Q, he, ge, ke, ze, H, J,
|
|
2033
|
-
const { theme:
|
|
2031
|
+
`, na = ({ value: t, onChange: e, placeholder: o = "搜索应用", className: n = "" }) => {
|
|
2032
|
+
var c, u, w, z, y, M, k, v, b, x, D, N, T, $, q, P, _, R, j, se, Z, U, te, ce, fe, ae, ie, K, de, be, Q, he, ge, ke, ze, H, J, W, F, oe, ee, m, C;
|
|
2033
|
+
const { theme: r } = pe(), a = ne(null), i = ne(null), l = ne(null), [f, p] = B(!1), d = () => {
|
|
2034
2034
|
p(!0), i.current && (i.current.style.transform = "translateY(-50%) translateX(-0.5rem)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0.5rem)");
|
|
2035
2035
|
}, g = () => {
|
|
2036
2036
|
p(!1), i.current && (i.current.style.transform = "translateY(-50%) translateX(0)"), l.current && (l.current.style.transform = "translateY(-50%) translateX(0)");
|
|
@@ -2038,7 +2038,7 @@ const Mo = ({
|
|
|
2038
2038
|
var I;
|
|
2039
2039
|
e(""), (I = a.current) == null || I.focus();
|
|
2040
2040
|
};
|
|
2041
|
-
return /* @__PURE__ */ A("div", { className: `zs-relative zs-w-full zs-group ${
|
|
2041
|
+
return /* @__PURE__ */ A("div", { className: `zs-relative zs-w-full zs-group ${n}`, children: [
|
|
2042
2042
|
/* @__PURE__ */ s(
|
|
2043
2043
|
"div",
|
|
2044
2044
|
{
|
|
@@ -2046,11 +2046,11 @@ const Mo = ({
|
|
|
2046
2046
|
className: S(
|
|
2047
2047
|
"zs-absolute zs-left-4 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-pointer-events-none zs-transition-all zs-duration-300",
|
|
2048
2048
|
E`
|
|
2049
|
-
color: ${f ? (z = (w = (u = (c =
|
|
2049
|
+
color: ${f ? (z = (w = (u = (c = r.token.dock) == null ? void 0 : c.launchpad) == null ? void 0 : u.modal) == null ? void 0 : w.searchBox) == null ? void 0 : z.iconFocusColor : (v = (k = (M = (y = r.token.dock) == null ? void 0 : y.launchpad) == null ? void 0 : M.modal) == null ? void 0 : k.searchBox) == null ? void 0 : v.iconColor};
|
|
2050
2050
|
`,
|
|
2051
2051
|
bt
|
|
2052
2052
|
),
|
|
2053
|
-
children: /* @__PURE__ */ s(
|
|
2053
|
+
children: /* @__PURE__ */ s(ur, { size: 16 })
|
|
2054
2054
|
}
|
|
2055
2055
|
),
|
|
2056
2056
|
/* @__PURE__ */ s(
|
|
@@ -2060,14 +2060,14 @@ const Mo = ({
|
|
|
2060
2060
|
className: S(
|
|
2061
2061
|
"zs-w-full zs-h-11 zs-pl-12 zs-pr-12 zs-border-none zs-rounded-[22px] zs-text-base zs-outline-none zs-transition-all zs-duration-300 placeholder:zs-font-normal focus:zs-scale-[1.02]",
|
|
2062
2062
|
E`
|
|
2063
|
-
background-color: ${(N = (D = (x = (b =
|
|
2064
|
-
color: ${(P = (q = ($ = (T =
|
|
2063
|
+
background-color: ${(N = (D = (x = (b = r.token.dock) == null ? void 0 : b.launchpad) == null ? void 0 : x.modal) == null ? void 0 : D.searchBox) == null ? void 0 : N.backgroundColor};
|
|
2064
|
+
color: ${(P = (q = ($ = (T = r.token.dock) == null ? void 0 : T.launchpad) == null ? void 0 : $.modal) == null ? void 0 : q.searchBox) == null ? void 0 : P.textColor};
|
|
2065
2065
|
&::placeholder {
|
|
2066
|
-
color: ${(se = (j = (R = (_ =
|
|
2066
|
+
color: ${(se = (j = (R = (_ = r.token.dock) == null ? void 0 : _.launchpad) == null ? void 0 : R.modal) == null ? void 0 : j.searchBox) == null ? void 0 : se.placeholderColor};
|
|
2067
2067
|
}
|
|
2068
2068
|
&:focus {
|
|
2069
|
-
background-color: ${(ce = (te = (U = (Z =
|
|
2070
|
-
box-shadow: 0 4px 20px ${(K = (ie = (ae = (fe =
|
|
2069
|
+
background-color: ${(ce = (te = (U = (Z = r.token.dock) == null ? void 0 : Z.launchpad) == null ? void 0 : U.modal) == null ? void 0 : te.searchBox) == null ? void 0 : ce.focusBackgroundColor};
|
|
2070
|
+
box-shadow: 0 4px 20px ${(K = (ie = (ae = (fe = r.token.dock) == null ? void 0 : fe.launchpad) == null ? void 0 : ae.modal) == null ? void 0 : ie.searchBox) == null ? void 0 : K.shadowColor};
|
|
2071
2071
|
}
|
|
2072
2072
|
`,
|
|
2073
2073
|
bt
|
|
@@ -2087,10 +2087,10 @@ const Mo = ({
|
|
|
2087
2087
|
className: S(
|
|
2088
2088
|
"zs-absolute zs-right-3 zs-top-1/2 zs-transform zs--translate-y-1/2 zs-w-5 zs-h-5 zs-rounded-full zs-border-none zs-text-xs zs-cursor-pointer zs-flex zs-items-center zs-justify-center zs-transition-all zs-duration-300 hover:zs-scale-110 active:zs-scale-95",
|
|
2089
2089
|
E`
|
|
2090
|
-
background-color: ${(ge = (he = (Q = (be = (de =
|
|
2091
|
-
color: ${(
|
|
2090
|
+
background-color: ${(ge = (he = (Q = (be = (de = r.token.dock) == null ? void 0 : de.launchpad) == null ? void 0 : be.modal) == null ? void 0 : Q.searchBox) == null ? void 0 : he.clearButton) == null ? void 0 : ge.backgroundColor};
|
|
2091
|
+
color: ${(W = (J = (H = (ze = (ke = r.token.dock) == null ? void 0 : ke.launchpad) == null ? void 0 : ze.modal) == null ? void 0 : H.searchBox) == null ? void 0 : J.clearButton) == null ? void 0 : W.textColor};
|
|
2092
2092
|
&:hover {
|
|
2093
|
-
background-color: ${(C = (m = (ee = (oe = (F =
|
|
2093
|
+
background-color: ${(C = (m = (ee = (oe = (F = r.token.dock) == null ? void 0 : F.launchpad) == null ? void 0 : oe.modal) == null ? void 0 : ee.searchBox) == null ? void 0 : m.clearButton) == null ? void 0 : C.hoverBackgroundColor};
|
|
2094
2094
|
}
|
|
2095
2095
|
`,
|
|
2096
2096
|
bt
|
|
@@ -2106,8 +2106,8 @@ const Mo = ({
|
|
|
2106
2106
|
const {
|
|
2107
2107
|
open: e = !1,
|
|
2108
2108
|
onClose: o,
|
|
2109
|
-
children:
|
|
2110
|
-
title:
|
|
2109
|
+
children: n,
|
|
2110
|
+
title: r,
|
|
2111
2111
|
placement: a = "right",
|
|
2112
2112
|
width: i = 320,
|
|
2113
2113
|
height: l,
|
|
@@ -2126,7 +2126,7 @@ const Mo = ({
|
|
|
2126
2126
|
}, 300);
|
|
2127
2127
|
}, v = a === "left" || a === "right" ? { width: i } : { height: l ?? 300 };
|
|
2128
2128
|
return e ? /* @__PURE__ */ s(
|
|
2129
|
-
|
|
2129
|
+
Ar,
|
|
2130
2130
|
{
|
|
2131
2131
|
open: w,
|
|
2132
2132
|
onClose: k,
|
|
@@ -2269,7 +2269,7 @@ const Mo = ({
|
|
|
2269
2269
|
g
|
|
2270
2270
|
),
|
|
2271
2271
|
children: [
|
|
2272
|
-
|
|
2272
|
+
r && /* @__PURE__ */ s(
|
|
2273
2273
|
"div",
|
|
2274
2274
|
{
|
|
2275
2275
|
className: S(
|
|
@@ -2278,22 +2278,22 @@ const Mo = ({
|
|
|
2278
2278
|
color: ${(Q = u == null ? void 0 : u.header) == null ? void 0 : Q.textColor};
|
|
2279
2279
|
`
|
|
2280
2280
|
),
|
|
2281
|
-
children:
|
|
2281
|
+
children: r
|
|
2282
2282
|
}
|
|
2283
2283
|
),
|
|
2284
|
-
/* @__PURE__ */ s("div", { className: "base-drawer-content zs-p-4", children:
|
|
2284
|
+
/* @__PURE__ */ s("div", { className: "base-drawer-content zs-p-4", children: n })
|
|
2285
2285
|
]
|
|
2286
2286
|
}
|
|
2287
2287
|
)
|
|
2288
2288
|
}
|
|
2289
2289
|
) : null;
|
|
2290
2290
|
}, Lo = ({ visible: t, onClose: e, onItemClick: o }) => {
|
|
2291
|
-
const { list:
|
|
2292
|
-
if (!
|
|
2291
|
+
const { list: n } = Ee(), [r, a] = B(""), i = Io(), { allApps: l, groups: f } = re(() => {
|
|
2292
|
+
if (!n || n.length === 0)
|
|
2293
2293
|
return { allApps: [], groupedData: [], groups: [], groupCounts: [] };
|
|
2294
|
-
const c = (b) => b.flatMap((x) => x.type === "app" ? [{ ...x }] : x.type === "group" && x.children ? c(x.children) : []), u =
|
|
2294
|
+
const c = (b) => b.flatMap((x) => x.type === "app" ? [{ ...x }] : x.type === "group" && x.children ? c(x.children) : []), u = n.flatMap((b) => b.children ? c(b.children) : []), z = (r.trim() ? u.filter((b) => {
|
|
2295
2295
|
var D;
|
|
2296
|
-
return (((D = b.data) == null ? void 0 : D.name) || b.id || "").toString().toLowerCase().includes(
|
|
2296
|
+
return (((D = b.data) == null ? void 0 : D.name) || b.id || "").toString().toLowerCase().includes(r.toLowerCase());
|
|
2297
2297
|
}) : u).sort((b, x) => {
|
|
2298
2298
|
var T, $;
|
|
2299
2299
|
const D = (((T = b.data) == null ? void 0 : T.name) || b.id || "").toString(), N = ((($ = x.data) == null ? void 0 : $.name) || x.id || "").toString();
|
|
@@ -2314,16 +2314,16 @@ const Mo = ({
|
|
|
2314
2314
|
groups: M,
|
|
2315
2315
|
groupCounts: v
|
|
2316
2316
|
};
|
|
2317
|
-
}, [
|
|
2317
|
+
}, [n, r]), p = (c) => {
|
|
2318
2318
|
const u = f[c], w = document.getElementById(`group-${u}`);
|
|
2319
2319
|
w && w.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
2320
2320
|
}, d = /* @__PURE__ */ A("div", { className: "zs-py-4 zs-flex zs-items-center zs-gap-2", children: [
|
|
2321
|
-
/* @__PURE__ */ s(
|
|
2321
|
+
/* @__PURE__ */ s(na, { className: "zs-grow", value: r, onChange: a, placeholder: "搜索应用" }),
|
|
2322
2322
|
i && /* @__PURE__ */ s(zt, { onClick: e, "aria-label": "关闭", className: "zs-shrink-0" })
|
|
2323
2323
|
] }), g = /* @__PURE__ */ s("div", { className: S("zs-flex-1 zs-overflow-y-auto zs-h-full zs-p-1"), children: l.length === 0 ? /* @__PURE__ */ A("div", { className: "zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center zs-h-full", children: [
|
|
2324
|
-
/* @__PURE__ */ s("div", { className: "zs-text-6xl zs-mb-4 zs-opacity-60", children:
|
|
2325
|
-
/* @__PURE__ */ s("div", { className: "zs-mb-2", children:
|
|
2326
|
-
/* @__PURE__ */ s("div", { className: "zs-text-base zs-text-[#c7c7cc] zs-font-normal", children:
|
|
2324
|
+
/* @__PURE__ */ s("div", { className: "zs-text-6xl zs-mb-4 zs-opacity-60", children: r.trim() ? "🔍" : "📱" }),
|
|
2325
|
+
/* @__PURE__ */ s("div", { className: "zs-mb-2", children: r.trim() ? "未找到相关应用" : "暂无应用" }),
|
|
2326
|
+
/* @__PURE__ */ s("div", { className: "zs-text-base zs-text-[#c7c7cc] zs-font-normal", children: r.trim() ? "尝试使用其他关键词搜索" : "请添加应用到启动台" })
|
|
2327
2327
|
] }) : /* @__PURE__ */ s("div", { className: "zs-flex zs-gap-3 md:zs-gap-6 lg:zs-gap-8 zs-flex-wrap", children: /* @__PURE__ */ s(Ce, { mode: "popLayout", children: l.map((c, u) => /* @__PURE__ */ s("div", { className: "zs-mb-6", children: /* @__PURE__ */ s(
|
|
2328
2328
|
_e,
|
|
2329
2329
|
{
|
|
@@ -2408,8 +2408,8 @@ const Mo = ({
|
|
|
2408
2408
|
const {
|
|
2409
2409
|
pagination: e = { position: "bottom" },
|
|
2410
2410
|
className: o,
|
|
2411
|
-
sliderProps:
|
|
2412
|
-
sliderRef:
|
|
2411
|
+
sliderProps: n,
|
|
2412
|
+
sliderRef: r,
|
|
2413
2413
|
maxSlides: a,
|
|
2414
2414
|
onItemClick: i,
|
|
2415
2415
|
extraItems: l,
|
|
@@ -2418,7 +2418,7 @@ const Mo = ({
|
|
|
2418
2418
|
position: "bottom",
|
|
2419
2419
|
showLaunchpad: !0
|
|
2420
2420
|
}
|
|
2421
|
-
} = t, p =
|
|
2421
|
+
} = t, p = ne(null), d = ne(null), g = ne(null), [h, c] = B(0), [u, w] = B(!1), [z, y] = B(!1), [M, k] = B(!0), {
|
|
2422
2422
|
list: v,
|
|
2423
2423
|
setList: b,
|
|
2424
2424
|
setListStatus: x,
|
|
@@ -2434,10 +2434,10 @@ const Mo = ({
|
|
|
2434
2434
|
addRootItem: se,
|
|
2435
2435
|
removeRootItem: Z,
|
|
2436
2436
|
setCurrentSliderIndex: U
|
|
2437
|
-
} = Ee(), { pagingDotBuilder: te, pagingDotsBuilder: ce, itemBuilder: fe, typeConfigMap: ae } = pe(), ie =
|
|
2437
|
+
} = Ee(), { pagingDotBuilder: te, pagingDotsBuilder: ce, itemBuilder: fe, typeConfigMap: ae } = pe(), ie = re(() => {
|
|
2438
2438
|
const m = v.find((C) => C.type === "dock");
|
|
2439
2439
|
return (m == null ? void 0 : m.children) ?? [];
|
|
2440
|
-
}, [v]), K =
|
|
2440
|
+
}, [v]), K = re(() => v.filter((m) => m.type !== "dock"), [v]), de = ue(() => {
|
|
2441
2441
|
if (typeof a == "number" && K.length >= a)
|
|
2442
2442
|
return;
|
|
2443
2443
|
const m = {
|
|
@@ -2447,16 +2447,16 @@ const Mo = ({
|
|
|
2447
2447
|
};
|
|
2448
2448
|
se(m), setTimeout(() => {
|
|
2449
2449
|
var C;
|
|
2450
|
-
(C = (
|
|
2450
|
+
(C = (r ?? p).current) == null || C.slickGoTo(K.length);
|
|
2451
2451
|
}, 100);
|
|
2452
|
-
}, [a, K.length, se,
|
|
2452
|
+
}, [a, K.length, se, r]), be = ue(() => {
|
|
2453
2453
|
const m = K.filter((C) => !C.children || C.children.length === 0);
|
|
2454
2454
|
m.length === K.length && K.length > 1 ? m.slice(1).forEach((C) => {
|
|
2455
2455
|
Z(C.id);
|
|
2456
2456
|
}) : m.length > 0 && K.length > 1 && m.forEach((C) => {
|
|
2457
2457
|
(K.length - m.length > 0 || K.indexOf(C) > 0) && Z(C.id);
|
|
2458
2458
|
});
|
|
2459
|
-
}, [K, Z]), Q =
|
|
2459
|
+
}, [K, Z]), Q = re(() => e === !1 ? {} : {
|
|
2460
2460
|
top: E`
|
|
2461
2461
|
display: flex;
|
|
2462
2462
|
flex-direction: column;
|
|
@@ -2504,7 +2504,7 @@ const Mo = ({
|
|
|
2504
2504
|
}
|
|
2505
2505
|
}
|
|
2506
2506
|
`
|
|
2507
|
-
}[e.position ?? "bottom"], [e]), he =
|
|
2507
|
+
}[e.position ?? "bottom"], [e]), he = re(() => {
|
|
2508
2508
|
if (!f.enabled)
|
|
2509
2509
|
return {};
|
|
2510
2510
|
const m = f.position ?? "bottom";
|
|
@@ -2562,20 +2562,20 @@ const Mo = ({
|
|
|
2562
2562
|
}
|
|
2563
2563
|
`
|
|
2564
2564
|
}[m];
|
|
2565
|
-
}, [f]), [ge, ke] = B(void 0), [ze, H] = B(void 0), J =
|
|
2565
|
+
}, [f]), [ge, ke] = B(void 0), [ze, H] = B(void 0), J = ne(null), W = ne(null), F = ne(null), oe = ue((m) => {
|
|
2566
2566
|
const { width: C, marginLeft: I } = Me.computeRowWidth(m, 112);
|
|
2567
2567
|
ke(C), H(I);
|
|
2568
2568
|
}, []), ee = ue(
|
|
2569
2569
|
(m) => {
|
|
2570
|
-
const C = J.current, I =
|
|
2570
|
+
const C = J.current, I = W.current, Y = F.current;
|
|
2571
2571
|
if (!m && C) {
|
|
2572
|
-
I && (I.disconnect(),
|
|
2572
|
+
I && (I.disconnect(), W.current = null), Y && (globalThis.removeEventListener("resize", Y), F.current = null), J.current = null;
|
|
2573
2573
|
return;
|
|
2574
2574
|
}
|
|
2575
|
-
if (m && C && m !== C && (I && (I.disconnect(),
|
|
2575
|
+
if (m && C && m !== C && (I && (I.disconnect(), W.current = null), Y && (globalThis.removeEventListener("resize", Y), F.current = null), J.current = null), m)
|
|
2576
2576
|
if (J.current = m, requestAnimationFrame(() => oe(m)), "ResizeObserver" in globalThis) {
|
|
2577
2577
|
const L = new ResizeObserver(() => oe(m));
|
|
2578
|
-
|
|
2578
|
+
W.current = L, L.observe(m);
|
|
2579
2579
|
} else {
|
|
2580
2580
|
const L = () => oe(m);
|
|
2581
2581
|
F.current = L, globalThis.addEventListener("resize", L);
|
|
@@ -2636,18 +2636,18 @@ const Mo = ({
|
|
|
2636
2636
|
activeSlide: h,
|
|
2637
2637
|
totalSlides: K.length,
|
|
2638
2638
|
maxSlides: a,
|
|
2639
|
-
sliderRef:
|
|
2639
|
+
sliderRef: r ?? p,
|
|
2640
2640
|
containerRef: d,
|
|
2641
2641
|
onCreateNewPage: de
|
|
2642
2642
|
}
|
|
2643
2643
|
),
|
|
2644
2644
|
/* @__PURE__ */ s(
|
|
2645
|
-
|
|
2645
|
+
rr,
|
|
2646
2646
|
{
|
|
2647
2647
|
useCSS: !0,
|
|
2648
2648
|
useTransform: !0,
|
|
2649
2649
|
arrows: !1,
|
|
2650
|
-
ref:
|
|
2650
|
+
ref: r ?? p,
|
|
2651
2651
|
infinite: !1,
|
|
2652
2652
|
dots: !0,
|
|
2653
2653
|
lazyLoad: "anticipated",
|
|
@@ -2684,11 +2684,11 @@ const Mo = ({
|
|
|
2684
2684
|
activeSlide: h,
|
|
2685
2685
|
onDragEnter: (C) => {
|
|
2686
2686
|
var I;
|
|
2687
|
-
(I = (
|
|
2687
|
+
(I = (r ?? p).current) == null || I.slickGoTo(C);
|
|
2688
2688
|
},
|
|
2689
2689
|
onClick: (C) => {
|
|
2690
2690
|
var I;
|
|
2691
|
-
(I = (
|
|
2691
|
+
(I = (r ?? p).current) == null || I.slickGoTo(C);
|
|
2692
2692
|
},
|
|
2693
2693
|
pagingDotsBuilder: ce,
|
|
2694
2694
|
slickDots: m,
|
|
@@ -2706,7 +2706,7 @@ const Mo = ({
|
|
|
2706
2706
|
beforeChange: (m, C) => {
|
|
2707
2707
|
c(C), U(C);
|
|
2708
2708
|
},
|
|
2709
|
-
...
|
|
2709
|
+
...n,
|
|
2710
2710
|
children: K.map((m) => /* @__PURE__ */ s(
|
|
2711
2711
|
"div",
|
|
2712
2712
|
{
|
|
@@ -2734,14 +2734,14 @@ const Mo = ({
|
|
|
2734
2734
|
onMove: (C) => {
|
|
2735
2735
|
var O;
|
|
2736
2736
|
x("onMove");
|
|
2737
|
-
const { dragged: I, related: Y } = C, L = I.dataset,
|
|
2738
|
-
return P(null), !((Object.keys(
|
|
2737
|
+
const { dragged: I, related: Y } = C, L = I.dataset, G = Y.dataset;
|
|
2738
|
+
return P(null), !((Object.keys(G).length === 0 || G.parentIds) && Number(L.childrenLength) > 0 && Y.classList.contains("sortable-group-item") || (Y.classList.contains("desktop-dock-sortable") || (O = Y.parentElement) != null && O.classList.contains("desktop-dock-sortable")) && Number(L.childrenLength) > 0);
|
|
2739
2739
|
},
|
|
2740
2740
|
onStart: (C) => {
|
|
2741
2741
|
var L;
|
|
2742
2742
|
const I = C.item.dataset;
|
|
2743
2743
|
I != null && I.id && q(I.id), x("onMove"), w(!0);
|
|
2744
|
-
const Y = (L = m.children) == null ? void 0 : L.find((
|
|
2744
|
+
const Y = (L = m.children) == null ? void 0 : L.find((G) => G.id === I.id);
|
|
2745
2745
|
Y && j(Y);
|
|
2746
2746
|
},
|
|
2747
2747
|
onEnd: () => {
|
|
@@ -2756,7 +2756,7 @@ const Mo = ({
|
|
|
2756
2756
|
let Y;
|
|
2757
2757
|
if (fe)
|
|
2758
2758
|
return fe(C);
|
|
2759
|
-
const { row: L, col:
|
|
2759
|
+
const { row: L, col: G } = ko(C.type, (O = C.config) == null ? void 0 : O.sizeId, ae);
|
|
2760
2760
|
switch (C.type) {
|
|
2761
2761
|
case "group":
|
|
2762
2762
|
case "app":
|
|
@@ -2767,7 +2767,7 @@ const Mo = ({
|
|
|
2767
2767
|
"zs-flex zs-justify-start zs-items-start",
|
|
2768
2768
|
E`
|
|
2769
2769
|
grid-row: span ${L};
|
|
2770
|
-
grid-column: span ${
|
|
2770
|
+
grid-column: span ${G};
|
|
2771
2771
|
`
|
|
2772
2772
|
),
|
|
2773
2773
|
"data-id": C.id,
|
|
@@ -2796,7 +2796,7 @@ const Mo = ({
|
|
|
2796
2796
|
"zs-flex zs-justify-center zs-items-center",
|
|
2797
2797
|
E`
|
|
2798
2798
|
grid-row: span ${L};
|
|
2799
|
-
grid-column: span ${
|
|
2799
|
+
grid-column: span ${G};
|
|
2800
2800
|
`
|
|
2801
2801
|
),
|
|
2802
2802
|
"data-id": C.id,
|
|
@@ -2848,19 +2848,19 @@ const Mo = ({
|
|
|
2848
2848
|
] });
|
|
2849
2849
|
}, Ao = (t) => {
|
|
2850
2850
|
var a, i, l, f, p;
|
|
2851
|
-
const { className: e, children: o, ...
|
|
2851
|
+
const { className: e, children: o, ...n } = t, { theme: r } = pe();
|
|
2852
2852
|
return /* @__PURE__ */ s(
|
|
2853
2853
|
X.div,
|
|
2854
2854
|
{
|
|
2855
2855
|
className: S(
|
|
2856
2856
|
"zs-rounded-2xl py-2 zs-w-max zs-z-50",
|
|
2857
2857
|
E`
|
|
2858
|
-
background-color: ${(a =
|
|
2859
|
-
box-shadow: 0 20px 40px ${(i =
|
|
2860
|
-
0 0 0 0.75px ${(l =
|
|
2858
|
+
background-color: ${(a = r.token.contextMenu) == null ? void 0 : a.backgroundColor};
|
|
2859
|
+
box-shadow: 0 20px 40px ${(i = r.token.contextMenu) == null ? void 0 : i.shadowColor},
|
|
2860
|
+
0 0 0 0.75px ${(l = r.token.contextMenu) == null ? void 0 : l.boxShadowBorderColor};
|
|
2861
2861
|
min-width: 200px;
|
|
2862
|
-
border: 0.75px solid ${(f =
|
|
2863
|
-
backdrop-filter: ${(p =
|
|
2862
|
+
border: 0.75px solid ${(f = r.token.contextMenu) == null ? void 0 : f.borderColor};
|
|
2863
|
+
backdrop-filter: ${(p = r.token.contextMenu) == null ? void 0 : p.backdropFilter};
|
|
2864
2864
|
`,
|
|
2865
2865
|
e
|
|
2866
2866
|
),
|
|
@@ -2876,7 +2876,7 @@ const Mo = ({
|
|
|
2876
2876
|
onMouseDown: (d) => {
|
|
2877
2877
|
d.stopPropagation(), d.preventDefault();
|
|
2878
2878
|
},
|
|
2879
|
-
...
|
|
2879
|
+
...n,
|
|
2880
2880
|
children: o
|
|
2881
2881
|
}
|
|
2882
2882
|
);
|
|
@@ -2884,9 +2884,9 @@ const Mo = ({
|
|
|
2884
2884
|
hoveredIndex: null,
|
|
2885
2885
|
setHoveredIndex: () => {
|
|
2886
2886
|
}
|
|
2887
|
-
}), st = ({ icon: t, text: e, color: o, textColor:
|
|
2887
|
+
}), st = ({ icon: t, text: e, color: o, textColor: n, onClick: r, index: a, children: i, ...l }) => {
|
|
2888
2888
|
var w, z, y;
|
|
2889
|
-
const { hoveredIndex: f, setHoveredIndex: p } = De(St), { theme: d } = pe(), g = f === a, h =
|
|
2889
|
+
const { hoveredIndex: f, setHoveredIndex: p } = De(St), { theme: d } = pe(), g = f === a, h = n || ((w = d.token.contextMenu) == null ? void 0 : w.textColor) || "#1d1d1f", c = o || ((z = d.token.contextMenu) == null ? void 0 : z.textColor) || "black";
|
|
2890
2890
|
return /* @__PURE__ */ A(
|
|
2891
2891
|
X.div,
|
|
2892
2892
|
{
|
|
@@ -2898,7 +2898,7 @@ const Mo = ({
|
|
|
2898
2898
|
),
|
|
2899
2899
|
onMouseEnter: () => p(a),
|
|
2900
2900
|
onMouseLeave: () => p(null),
|
|
2901
|
-
onClick:
|
|
2901
|
+
onClick: r,
|
|
2902
2902
|
...l,
|
|
2903
2903
|
children: [
|
|
2904
2904
|
/* @__PURE__ */ s(Ce, { children: g && /* @__PURE__ */ s(
|
|
@@ -2955,9 +2955,9 @@ const Mo = ({
|
|
|
2955
2955
|
]
|
|
2956
2956
|
}
|
|
2957
2957
|
);
|
|
2958
|
-
}, aa = ({ text: t, icon: e, index: o, children:
|
|
2958
|
+
}, aa = ({ text: t, icon: e, index: o, children: n, color: r, textColor: a, ...i }) => {
|
|
2959
2959
|
var D, N, T;
|
|
2960
|
-
const [l, f] = B(!1), [p, d] = B({ x: 0, y: 0 }), g =
|
|
2960
|
+
const [l, f] = B(!1), [p, d] = B({ x: 0, y: 0 }), g = ne(null), h = ne(null), { hoveredIndex: c, setHoveredIndex: u } = De(St), { theme: w } = pe(), z = c === o, y = a || ((D = w.token.contextMenu) == null ? void 0 : D.textColor) || "#1d1d1f", M = r || ((N = w.token.contextMenu) == null ? void 0 : N.textColor) || "black", k = () => {
|
|
2961
2961
|
if (h.current && clearTimeout(h.current), u(o), f(!0), g.current) {
|
|
2962
2962
|
const $ = g.current.getBoundingClientRect();
|
|
2963
2963
|
d({
|
|
@@ -3057,17 +3057,17 @@ const Mo = ({
|
|
|
3057
3057
|
},
|
|
3058
3058
|
onMouseEnter: b,
|
|
3059
3059
|
onMouseLeave: x,
|
|
3060
|
-
children:
|
|
3060
|
+
children: n
|
|
3061
3061
|
}
|
|
3062
3062
|
) })
|
|
3063
3063
|
]
|
|
3064
3064
|
}
|
|
3065
3065
|
);
|
|
3066
3066
|
}, ia = ({ sizes: t, currentSize: e, onSizeChange: o }) => {
|
|
3067
|
-
const [
|
|
3067
|
+
const [n, r] = B(null), { theme: a } = pe();
|
|
3068
3068
|
return /* @__PURE__ */ s(Ie, { children: t.map((i) => {
|
|
3069
3069
|
var p, d, g;
|
|
3070
|
-
const l =
|
|
3070
|
+
const l = n === i, f = e === i;
|
|
3071
3071
|
return /* @__PURE__ */ A(
|
|
3072
3072
|
X.div,
|
|
3073
3073
|
{
|
|
@@ -3077,8 +3077,8 @@ const Mo = ({
|
|
|
3077
3077
|
z-index: 1;
|
|
3078
3078
|
`
|
|
3079
3079
|
),
|
|
3080
|
-
onMouseEnter: () =>
|
|
3081
|
-
onMouseLeave: () =>
|
|
3080
|
+
onMouseEnter: () => r(i),
|
|
3081
|
+
onMouseLeave: () => r(null),
|
|
3082
3082
|
onClick: () => o(i),
|
|
3083
3083
|
whileTap: { scale: 0.98 },
|
|
3084
3084
|
children: [
|
|
@@ -3141,8 +3141,8 @@ const Mo = ({
|
|
|
3141
3141
|
const {
|
|
3142
3142
|
showInfoButton: e = !0,
|
|
3143
3143
|
showRemoveButton: o = !0,
|
|
3144
|
-
showShareButton:
|
|
3145
|
-
showSizeButton:
|
|
3144
|
+
showShareButton: n = !0,
|
|
3145
|
+
showSizeButton: r = !0,
|
|
3146
3146
|
animationOrigin: a = "center",
|
|
3147
3147
|
isOpen: i = !0,
|
|
3148
3148
|
onInfoClick: l,
|
|
@@ -3173,7 +3173,7 @@ const Mo = ({
|
|
|
3173
3173
|
st,
|
|
3174
3174
|
{
|
|
3175
3175
|
text: "移除",
|
|
3176
|
-
icon: /* @__PURE__ */ s(
|
|
3176
|
+
icon: /* @__PURE__ */ s(fr, {}),
|
|
3177
3177
|
color: (($ = M.token.contextMenu) == null ? void 0 : $.dangerColor) || "#ff3b30",
|
|
3178
3178
|
textColor: ((q = M.token.contextMenu) == null ? void 0 : q.dangerColor) || "#ff3b30",
|
|
3179
3179
|
index: 0,
|
|
@@ -3186,11 +3186,11 @@ const Mo = ({
|
|
|
3186
3186
|
}
|
|
3187
3187
|
}
|
|
3188
3188
|
),
|
|
3189
|
-
|
|
3189
|
+
n && /* @__PURE__ */ s(
|
|
3190
3190
|
st,
|
|
3191
3191
|
{
|
|
3192
3192
|
text: "分享",
|
|
3193
|
-
icon: /* @__PURE__ */ s(
|
|
3193
|
+
icon: /* @__PURE__ */ s(gr, {}),
|
|
3194
3194
|
index: 1,
|
|
3195
3195
|
onClick: () => {
|
|
3196
3196
|
if (f) {
|
|
@@ -3204,7 +3204,7 @@ const Mo = ({
|
|
|
3204
3204
|
st,
|
|
3205
3205
|
{
|
|
3206
3206
|
text: "信息",
|
|
3207
|
-
icon: /* @__PURE__ */ s(
|
|
3207
|
+
icon: /* @__PURE__ */ s(pr, {}),
|
|
3208
3208
|
index: 2,
|
|
3209
3209
|
onClick: () => {
|
|
3210
3210
|
if (l) {
|
|
@@ -3219,7 +3219,7 @@ const Mo = ({
|
|
|
3219
3219
|
}
|
|
3220
3220
|
}
|
|
3221
3221
|
),
|
|
3222
|
-
|
|
3222
|
+
r && ((x == null ? void 0 : x.allowResize) || !1) !== !1 && (() => {
|
|
3223
3223
|
var j, se;
|
|
3224
3224
|
const P = ct(((j = d == null ? void 0 : d.data) == null ? void 0 : j.type) || "app", z), _ = vo(
|
|
3225
3225
|
(se = b == null ? void 0 : b.config) == null ? void 0 : se.sizeId,
|
|
@@ -3227,7 +3227,7 @@ const Mo = ({
|
|
|
3227
3227
|
P.defaultSizeId
|
|
3228
3228
|
);
|
|
3229
3229
|
let R = 0;
|
|
3230
|
-
return o && R++,
|
|
3230
|
+
return o && R++, n && R++, e && R++, /* @__PURE__ */ s(aa, { text: "尺寸", icon: /* @__PURE__ */ s(mr, { size: 18 }), index: R, children: /* @__PURE__ */ s(
|
|
3231
3231
|
ia,
|
|
3232
3232
|
{
|
|
3233
3233
|
sizes: D(),
|
|
@@ -3243,7 +3243,7 @@ const Mo = ({
|
|
|
3243
3243
|
})(),
|
|
3244
3244
|
N().map((P, _) => {
|
|
3245
3245
|
let R = 0;
|
|
3246
|
-
return o && R++,
|
|
3246
|
+
return o && R++, n && R++, e && R++, r && ((x == null ? void 0 : x.allowResize) || !1) !== !1 && R++, R += _, /* @__PURE__ */ s(
|
|
3247
3247
|
st,
|
|
3248
3248
|
{
|
|
3249
3249
|
text: P.text,
|
|
@@ -3273,7 +3273,7 @@ const Mo = ({
|
|
|
3273
3273
|
top: window.scrollY,
|
|
3274
3274
|
bottom: window.innerHeight + window.scrollY
|
|
3275
3275
|
}), da = (t) => {
|
|
3276
|
-
const { contextMenu: e, setContextMenu: o } = Ee(), [
|
|
3276
|
+
const { contextMenu: e, setContextMenu: o } = Ee(), [n, r] = B(!1), [a, i] = B(!1), [l, f] = B({
|
|
3277
3277
|
left: 0,
|
|
3278
3278
|
top: 0
|
|
3279
3279
|
}), [p, d] = B("center"), g = ue(
|
|
@@ -3326,20 +3326,20 @@ const Mo = ({
|
|
|
3326
3326
|
bottom: e.pageY || 0
|
|
3327
3327
|
};
|
|
3328
3328
|
}
|
|
3329
|
-
} : null, { refs: w } =
|
|
3330
|
-
open:
|
|
3329
|
+
} : null, { refs: w } = Er({
|
|
3330
|
+
open: n,
|
|
3331
3331
|
strategy: "absolute",
|
|
3332
3332
|
// 改为绝对定位策略
|
|
3333
3333
|
middleware: [
|
|
3334
|
-
|
|
3334
|
+
Tr(10),
|
|
3335
3335
|
// 距离鼠标位置 10px
|
|
3336
|
-
|
|
3336
|
+
Pr({
|
|
3337
3337
|
fallbackPlacements: ["bottom", "top", "right", "left"]
|
|
3338
3338
|
}),
|
|
3339
|
-
|
|
3339
|
+
Br({ padding: 10 })
|
|
3340
3340
|
// 距离视窗边缘至少 10px
|
|
3341
3341
|
],
|
|
3342
|
-
whileElementsMounted:
|
|
3342
|
+
whileElementsMounted: Rr,
|
|
3343
3343
|
elements: {
|
|
3344
3344
|
reference: u
|
|
3345
3345
|
}
|
|
@@ -3349,7 +3349,7 @@ const Mo = ({
|
|
|
3349
3349
|
};
|
|
3350
3350
|
return V(() => {
|
|
3351
3351
|
if (e) {
|
|
3352
|
-
i(!0),
|
|
3352
|
+
i(!0), r(!0);
|
|
3353
3353
|
const { rect: y } = e, M = g(y), { left: k, top: v } = c(
|
|
3354
3354
|
M,
|
|
3355
3355
|
Te.ESTIMATED_MENU_WIDTH,
|
|
@@ -3357,19 +3357,19 @@ const Mo = ({
|
|
|
3357
3357
|
), b = z(k, v, M);
|
|
3358
3358
|
d(b), f({ left: k, top: v });
|
|
3359
3359
|
} else {
|
|
3360
|
-
|
|
3360
|
+
r(!1);
|
|
3361
3361
|
const y = setTimeout(() => {
|
|
3362
3362
|
i(!1);
|
|
3363
3363
|
}, Te.ANIMATION_DELAY);
|
|
3364
3364
|
return () => clearTimeout(y);
|
|
3365
3365
|
}
|
|
3366
3366
|
}, [e, g, c]), V(() => {
|
|
3367
|
-
|
|
3367
|
+
n && w.floating.current && e && a && requestAnimationFrame(() => {
|
|
3368
3368
|
const { rect: y } = e, M = g(y), k = w.floating.current, v = (k == null ? void 0 : k.offsetWidth) || Te.ESTIMATED_MENU_WIDTH, b = (k == null ? void 0 : k.offsetHeight) || Te.ESTIMATED_MENU_HEIGHT, { left: x, top: D } = c(M, v, b), N = z(x, D, M);
|
|
3369
3369
|
d(N), f({ left: x, top: D });
|
|
3370
3370
|
});
|
|
3371
|
-
}, [
|
|
3372
|
-
if (!
|
|
3371
|
+
}, [n, e, w, a, g, c]), V(() => {
|
|
3372
|
+
if (!n) return;
|
|
3373
3373
|
const y = (v) => {
|
|
3374
3374
|
const b = v.target, x = w.floating.current;
|
|
3375
3375
|
x && !x.contains(b) && o(null);
|
|
@@ -3381,7 +3381,7 @@ const Mo = ({
|
|
|
3381
3381
|
return () => {
|
|
3382
3382
|
clearTimeout(k), document.removeEventListener("mousedown", y), document.removeEventListener("keydown", M);
|
|
3383
3383
|
};
|
|
3384
|
-
}, [
|
|
3384
|
+
}, [n, o, w.floating]), a ? /* @__PURE__ */ s($r, { children: /* @__PURE__ */ s(
|
|
3385
3385
|
"div",
|
|
3386
3386
|
{
|
|
3387
3387
|
ref: w.setFloating,
|
|
@@ -3396,14 +3396,14 @@ const Mo = ({
|
|
|
3396
3396
|
onMouseDown: (y) => {
|
|
3397
3397
|
y.stopPropagation();
|
|
3398
3398
|
},
|
|
3399
|
-
children: /* @__PURE__ */ s(la, { ...t, animationOrigin: p, isOpen:
|
|
3399
|
+
children: /* @__PURE__ */ s(la, { ...t, animationOrigin: p, isOpen: n })
|
|
3400
3400
|
}
|
|
3401
3401
|
) }) : null;
|
|
3402
3402
|
}, ua = Xe((t, e) => {
|
|
3403
3403
|
const {
|
|
3404
3404
|
list: o,
|
|
3405
|
-
onChange:
|
|
3406
|
-
storageKey:
|
|
3405
|
+
onChange: n,
|
|
3406
|
+
storageKey: r,
|
|
3407
3407
|
enableCaching: a,
|
|
3408
3408
|
theme: i,
|
|
3409
3409
|
noLetters: l,
|
|
@@ -3417,8 +3417,8 @@ const Mo = ({
|
|
|
3417
3417
|
...w
|
|
3418
3418
|
} = t, z = {
|
|
3419
3419
|
list: o,
|
|
3420
|
-
onChange:
|
|
3421
|
-
storageKey:
|
|
3420
|
+
onChange: n,
|
|
3421
|
+
storageKey: r,
|
|
3422
3422
|
enableCaching: a
|
|
3423
3423
|
}, y = {
|
|
3424
3424
|
theme: i,
|
|
@@ -3560,11 +3560,11 @@ const Mo = ({
|
|
|
3560
3560
|
delete: "删除图片"
|
|
3561
3561
|
}
|
|
3562
3562
|
}, ga = (t, e, o) => {
|
|
3563
|
-
const
|
|
3563
|
+
const r = t.split(".").reduce(
|
|
3564
3564
|
(a, i) => typeof a == "string" ? a : a[i],
|
|
3565
3565
|
fa
|
|
3566
3566
|
);
|
|
3567
|
-
return typeof
|
|
3567
|
+
return typeof r != "string" ? e : o ? r.replace(/{{(.*?)}}/g, (a, i) => o[i]) : r;
|
|
3568
3568
|
}, pa = E`
|
|
3569
3569
|
--accentBase: var(--tomato-1);
|
|
3570
3570
|
--accentBgSubtle: var(--tomato-2);
|
|
@@ -3829,12 +3829,12 @@ const Mo = ({
|
|
|
3829
3829
|
const {
|
|
3830
3830
|
value: e,
|
|
3831
3831
|
onChange: o,
|
|
3832
|
-
translation:
|
|
3833
|
-
pluginConfig:
|
|
3832
|
+
translation: n,
|
|
3833
|
+
pluginConfig: r,
|
|
3834
3834
|
className: a,
|
|
3835
3835
|
theme: i = "auto",
|
|
3836
3836
|
...l
|
|
3837
|
-
} = t, f =
|
|
3837
|
+
} = t, f = ne(null), {
|
|
3838
3838
|
image: p,
|
|
3839
3839
|
diffSource: d = {
|
|
3840
3840
|
viewMode: "rich-text"
|
|
@@ -3852,14 +3852,14 @@ const Mo = ({
|
|
|
3852
3852
|
}
|
|
3853
3853
|
},
|
|
3854
3854
|
directives: w = {
|
|
3855
|
-
directiveDescriptors: [
|
|
3855
|
+
directiveDescriptors: [_r]
|
|
3856
3856
|
}
|
|
3857
|
-
} =
|
|
3857
|
+
} = r ?? {}, [z, y] = B("");
|
|
3858
3858
|
return V(() => {
|
|
3859
3859
|
var M;
|
|
3860
3860
|
e !== void 0 && f.current && ((M = f.current) == null || M.setMarkdown(e), y(e));
|
|
3861
3861
|
}, [e, f]), /* @__PURE__ */ s(
|
|
3862
|
-
|
|
3862
|
+
Or,
|
|
3863
3863
|
{
|
|
3864
3864
|
ref: f,
|
|
3865
3865
|
className: S(
|
|
@@ -3873,91 +3873,91 @@ const Mo = ({
|
|
|
3873
3873
|
onChange: (M) => {
|
|
3874
3874
|
!e && !o && y(M), o && o(M);
|
|
3875
3875
|
},
|
|
3876
|
-
translation:
|
|
3876
|
+
translation: n ?? ga,
|
|
3877
3877
|
plugins: [
|
|
3878
|
-
|
|
3879
|
-
toolbarContents: () => /* @__PURE__ */ A(
|
|
3880
|
-
/* @__PURE__ */ s(
|
|
3878
|
+
Fr({
|
|
3879
|
+
toolbarContents: () => /* @__PURE__ */ A(tn, { options: ["rich-text", "source"], children: [
|
|
3880
|
+
/* @__PURE__ */ s(on, {}),
|
|
3881
3881
|
/* @__PURE__ */ s(Pe, {}),
|
|
3882
|
-
/* @__PURE__ */ s(
|
|
3883
|
-
/* @__PURE__ */ s(
|
|
3882
|
+
/* @__PURE__ */ s(rn, {}),
|
|
3883
|
+
/* @__PURE__ */ s(nn, {}),
|
|
3884
3884
|
/* @__PURE__ */ s(Pe, {}),
|
|
3885
|
-
/* @__PURE__ */ s(
|
|
3885
|
+
/* @__PURE__ */ s(sn, {}),
|
|
3886
3886
|
/* @__PURE__ */ s(Pe, {}),
|
|
3887
|
-
/* @__PURE__ */ s(
|
|
3887
|
+
/* @__PURE__ */ s(an, {}),
|
|
3888
3888
|
/* @__PURE__ */ s(Pe, {}),
|
|
3889
|
-
/* @__PURE__ */ s(
|
|
3890
|
-
/* @__PURE__ */ s(
|
|
3889
|
+
/* @__PURE__ */ s(ln, {}),
|
|
3890
|
+
/* @__PURE__ */ s(cn, {}),
|
|
3891
3891
|
/* @__PURE__ */ s(Pe, {}),
|
|
3892
|
-
/* @__PURE__ */ s(
|
|
3893
|
-
/* @__PURE__ */ s(
|
|
3892
|
+
/* @__PURE__ */ s(dn, {}),
|
|
3893
|
+
/* @__PURE__ */ s(un, {}),
|
|
3894
3894
|
/* @__PURE__ */ s(Pe, {}),
|
|
3895
|
-
/* @__PURE__ */ s(
|
|
3895
|
+
/* @__PURE__ */ s(fn, {}),
|
|
3896
3896
|
/* @__PURE__ */ s(Pe, {}),
|
|
3897
|
-
/* @__PURE__ */ s(
|
|
3897
|
+
/* @__PURE__ */ s(gn, {})
|
|
3898
3898
|
] })
|
|
3899
3899
|
}),
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3900
|
+
Hr(d),
|
|
3901
|
+
jr(),
|
|
3902
|
+
Ur(),
|
|
3903
|
+
Wr(g),
|
|
3904
|
+
Gr(h),
|
|
3905
|
+
Yr(),
|
|
3906
|
+
Xr(p),
|
|
3907
|
+
Vr(),
|
|
3908
|
+
qr(),
|
|
3909
|
+
Zr(),
|
|
3910
|
+
Kr(c),
|
|
3911
|
+
Jr(u),
|
|
3912
|
+
Qr(),
|
|
3913
|
+
en(w)
|
|
3914
3914
|
],
|
|
3915
3915
|
...l
|
|
3916
3916
|
}
|
|
3917
3917
|
);
|
|
3918
3918
|
}, Po = (t) => {
|
|
3919
|
-
const { children: e = "", className: o, theme:
|
|
3919
|
+
const { children: e = "", className: o, theme: n = "auto", imageProps: r } = t;
|
|
3920
3920
|
return /* @__PURE__ */ s(
|
|
3921
3921
|
"div",
|
|
3922
3922
|
{
|
|
3923
|
-
className: kt(
|
|
3923
|
+
className: kt(n) ? To : Ro,
|
|
3924
3924
|
children: /* @__PURE__ */ s(
|
|
3925
3925
|
so,
|
|
3926
3926
|
{
|
|
3927
3927
|
className: S(Eo, o),
|
|
3928
|
-
remarkPlugins: [
|
|
3929
|
-
rehypePlugins: [
|
|
3928
|
+
remarkPlugins: [pn, mn],
|
|
3929
|
+
rehypePlugins: [hn],
|
|
3930
3930
|
components: {
|
|
3931
3931
|
code(a) {
|
|
3932
3932
|
const { children: i, className: l, node: f, ref: p, ...d } = a, g = /language-(\w+)/.exec(l || "");
|
|
3933
3933
|
return g ? /* @__PURE__ */ s(
|
|
3934
|
-
|
|
3934
|
+
bn,
|
|
3935
3935
|
{
|
|
3936
3936
|
...d,
|
|
3937
3937
|
PreTag: "div",
|
|
3938
3938
|
children: String(i).replace(/\n$/, ""),
|
|
3939
3939
|
language: g[1],
|
|
3940
|
-
style:
|
|
3940
|
+
style: yn
|
|
3941
3941
|
}
|
|
3942
3942
|
) : /* @__PURE__ */ s("code", { ...d, className: l, children: i });
|
|
3943
3943
|
},
|
|
3944
3944
|
img(a) {
|
|
3945
|
-
const { preview: i, ...l } =
|
|
3945
|
+
const { preview: i, ...l } = r ?? {};
|
|
3946
3946
|
return /* @__PURE__ */ s(
|
|
3947
|
-
|
|
3947
|
+
xn,
|
|
3948
3948
|
{
|
|
3949
3949
|
...a,
|
|
3950
3950
|
preview: i instanceof Boolean ? i : {
|
|
3951
3951
|
icons: {
|
|
3952
|
-
rotateLeft: /* @__PURE__ */ s(
|
|
3953
|
-
rotateRight: /* @__PURE__ */ s(
|
|
3954
|
-
zoomIn: /* @__PURE__ */ s(
|
|
3955
|
-
zoomOut: /* @__PURE__ */ s(
|
|
3952
|
+
rotateLeft: /* @__PURE__ */ s(Cr, {}),
|
|
3953
|
+
rotateRight: /* @__PURE__ */ s(wr, {}),
|
|
3954
|
+
zoomIn: /* @__PURE__ */ s(kr, {}),
|
|
3955
|
+
zoomOut: /* @__PURE__ */ s(vr, {}),
|
|
3956
3956
|
close: /* @__PURE__ */ s(zt, {}),
|
|
3957
|
-
left: /* @__PURE__ */ s(
|
|
3958
|
-
right: /* @__PURE__ */ s(
|
|
3959
|
-
flipX: /* @__PURE__ */ s(
|
|
3960
|
-
flipY: /* @__PURE__ */ s(
|
|
3957
|
+
left: /* @__PURE__ */ s(xr, {}),
|
|
3958
|
+
right: /* @__PURE__ */ s(yr, {}),
|
|
3959
|
+
flipX: /* @__PURE__ */ s(br, {}),
|
|
3960
|
+
flipY: /* @__PURE__ */ s(hr, {})
|
|
3961
3961
|
},
|
|
3962
3962
|
zIndex: 9999,
|
|
3963
3963
|
mask: " ",
|
|
@@ -3979,37 +3979,37 @@ const Mo = ({
|
|
|
3979
3979
|
}, Bo = ha;
|
|
3980
3980
|
Bo.Preview = Po;
|
|
3981
3981
|
function Ze(...t) {
|
|
3982
|
-
return
|
|
3982
|
+
return kn(vn(t));
|
|
3983
3983
|
}
|
|
3984
3984
|
const Lt = (t) => {
|
|
3985
3985
|
const {
|
|
3986
3986
|
mouseX: e,
|
|
3987
3987
|
title: o,
|
|
3988
|
-
icon:
|
|
3989
|
-
href:
|
|
3988
|
+
icon: n,
|
|
3989
|
+
href: r,
|
|
3990
3990
|
children: a,
|
|
3991
3991
|
as: i = X.div,
|
|
3992
3992
|
componentClassName: l = "zs-rounded-full zs-bg-gray-200 dark:zs-bg-neutral-800",
|
|
3993
3993
|
titleClassName: f = "zs-rounded-md zs-bg-gray-100 zs-border dark:zs-bg-neutral-800 dark:zs-border-neutral-900 dark:zs-text-white zs-border-gray-200 zs-text-neutral-700",
|
|
3994
3994
|
childrenClassName: p,
|
|
3995
3995
|
...d
|
|
3996
|
-
} = t, g =
|
|
3996
|
+
} = t, g = ne(null), h = He(e, (T) => {
|
|
3997
3997
|
var q;
|
|
3998
3998
|
const $ = ((q = g.current) == null ? void 0 : q.getBoundingClientRect()) ?? { x: 0, width: 0 };
|
|
3999
3999
|
return T - $.x - $.width / 2;
|
|
4000
|
-
}), c = He(h, [-150, 0, 150], [40, 80, 40]), u = He(h, [-150, 0, 150], [40, 80, 40]), w = He(h, [-150, 0, 150], [20, 40, 20]), z = He(h, [-150, 0, 150], [20, 40, 20]), y =
|
|
4000
|
+
}), c = He(h, [-150, 0, 150], [40, 80, 40]), u = He(h, [-150, 0, 150], [40, 80, 40]), w = He(h, [-150, 0, 150], [20, 40, 20]), z = He(h, [-150, 0, 150], [20, 40, 20]), y = rt(c, {
|
|
4001
4001
|
mass: 0.1,
|
|
4002
4002
|
stiffness: 150,
|
|
4003
4003
|
damping: 12
|
|
4004
|
-
}), M =
|
|
4004
|
+
}), M = rt(u, {
|
|
4005
4005
|
mass: 0.1,
|
|
4006
4006
|
stiffness: 150,
|
|
4007
4007
|
damping: 12
|
|
4008
|
-
}), k =
|
|
4008
|
+
}), k = rt(w, {
|
|
4009
4009
|
mass: 0.1,
|
|
4010
4010
|
stiffness: 150,
|
|
4011
4011
|
damping: 12
|
|
4012
|
-
}), v =
|
|
4012
|
+
}), v = rt(z, {
|
|
4013
4013
|
mass: 0.1,
|
|
4014
4014
|
stiffness: 150,
|
|
4015
4015
|
damping: 12
|
|
@@ -4045,19 +4045,19 @@ const Lt = (t) => {
|
|
|
4045
4045
|
fontSize: b
|
|
4046
4046
|
},
|
|
4047
4047
|
className: Ze("zs-flex zs-items-center zs-justify-center", p),
|
|
4048
|
-
children: typeof a == "function" ? a({ widthIcon: k, heightIcon: v, fontSizeTransform: b }) : a ||
|
|
4048
|
+
children: typeof a == "function" ? a({ widthIcon: k, heightIcon: v, fontSizeTransform: b }) : a || n
|
|
4049
4049
|
}
|
|
4050
4050
|
)
|
|
4051
4051
|
]
|
|
4052
4052
|
}
|
|
4053
4053
|
);
|
|
4054
|
-
return
|
|
4054
|
+
return r ? /* @__PURE__ */ s("a", { href: r, children: N }) : N;
|
|
4055
4055
|
}, Dt = (t) => {
|
|
4056
4056
|
const {
|
|
4057
4057
|
items: e = [],
|
|
4058
4058
|
className: o = "zs-rounded-2xl zs-bg-gray-50 dark:zs-bg-neutral-900",
|
|
4059
|
-
itemBuilder:
|
|
4060
|
-
children:
|
|
4059
|
+
itemBuilder: n,
|
|
4060
|
+
children: r,
|
|
4061
4061
|
mouseX: a,
|
|
4062
4062
|
as: i = X.div
|
|
4063
4063
|
} = t, l = Yt(1 / 0), f = a ?? l;
|
|
@@ -4067,13 +4067,13 @@ const Lt = (t) => {
|
|
|
4067
4067
|
onMouseMove: (p) => f.set(p.pageX),
|
|
4068
4068
|
onMouseLeave: () => f.set(1 / 0),
|
|
4069
4069
|
className: Ze("zs-mx-auto zs-hidden md:zs-flex zs-h-16 zs-gap-4 zs-items-end zs-px-4 zs-pb-3", o),
|
|
4070
|
-
children:
|
|
4071
|
-
(p) =>
|
|
4070
|
+
children: r || e.map(
|
|
4071
|
+
(p) => n ? n(p, f) : /* @__PURE__ */ s(Lt, { mouseX: f, ...p }, p.title)
|
|
4072
4072
|
)
|
|
4073
4073
|
}
|
|
4074
4074
|
);
|
|
4075
4075
|
}, dt = (t) => {
|
|
4076
|
-
const { title: e, icon: o, href:
|
|
4076
|
+
const { title: e, icon: o, href: n, index: r, totalItems: a, children: i, ...l } = t;
|
|
4077
4077
|
return /* @__PURE__ */ s(
|
|
4078
4078
|
X.div,
|
|
4079
4079
|
{
|
|
@@ -4086,15 +4086,15 @@ const Lt = (t) => {
|
|
|
4086
4086
|
opacity: 0,
|
|
4087
4087
|
y: 10,
|
|
4088
4088
|
transition: {
|
|
4089
|
-
delay:
|
|
4089
|
+
delay: r * 0.05
|
|
4090
4090
|
}
|
|
4091
4091
|
},
|
|
4092
|
-
transition: { delay: (a - 1 -
|
|
4092
|
+
transition: { delay: (a - 1 - r) * 0.05 },
|
|
4093
4093
|
...l,
|
|
4094
4094
|
children: i || /* @__PURE__ */ s(
|
|
4095
4095
|
"a",
|
|
4096
4096
|
{
|
|
4097
|
-
href:
|
|
4097
|
+
href: n,
|
|
4098
4098
|
className: "zs-h-10 zs-w-10 zs-rounded-full zs-bg-gray-50 dark:zs-bg-neutral-900 zs-flex zs-items-center zs-justify-center",
|
|
4099
4099
|
children: /* @__PURE__ */ s("div", { className: "zs-h-4 zs-w-4", children: o })
|
|
4100
4100
|
}
|
|
@@ -4103,10 +4103,10 @@ const Lt = (t) => {
|
|
|
4103
4103
|
e
|
|
4104
4104
|
);
|
|
4105
4105
|
}, At = (t) => {
|
|
4106
|
-
const { items: e = [], className: o, collapseIcon:
|
|
4106
|
+
const { items: e = [], className: o, collapseIcon: n, autoHidden: r = !1, itemBuilder: a, children: i } = t, [l, f] = B(!1), p = () => {
|
|
4107
4107
|
f(!l);
|
|
4108
4108
|
};
|
|
4109
|
-
return /* @__PURE__ */ A("div", { className: Ze("zs-relative zs-block",
|
|
4109
|
+
return /* @__PURE__ */ A("div", { className: Ze("zs-relative zs-block", r ? "md:zs-hidden" : "", o), children: [
|
|
4110
4110
|
/* @__PURE__ */ s(Ce, { children: l && /* @__PURE__ */ s(
|
|
4111
4111
|
X.div,
|
|
4112
4112
|
{
|
|
@@ -4122,7 +4122,7 @@ const Lt = (t) => {
|
|
|
4122
4122
|
{
|
|
4123
4123
|
onClick: p,
|
|
4124
4124
|
className: "zs-h-10 zs-w-10 zs-rounded-full zs-bg-gray-50 dark:zs-bg-neutral-800 zs-flex zs-items-center zs-justify-center",
|
|
4125
|
-
children:
|
|
4125
|
+
children: n || /* @__PURE__ */ s(zr, { className: "zs-h-5 zs-w-5 zs-text-neutral-500 dark:zs-text-neutral-400" })
|
|
4126
4126
|
}
|
|
4127
4127
|
)
|
|
4128
4128
|
] });
|
|
@@ -4130,8 +4130,8 @@ const Lt = (t) => {
|
|
|
4130
4130
|
const {
|
|
4131
4131
|
items: e,
|
|
4132
4132
|
desktopClassName: o,
|
|
4133
|
-
mobileClassName:
|
|
4134
|
-
desktopItemBuilder:
|
|
4133
|
+
mobileClassName: n,
|
|
4134
|
+
desktopItemBuilder: r,
|
|
4135
4135
|
mobileItemBuilder: a,
|
|
4136
4136
|
desktopChildren: i,
|
|
4137
4137
|
mobileChildren: l,
|
|
@@ -4144,7 +4144,7 @@ const Lt = (t) => {
|
|
|
4144
4144
|
{
|
|
4145
4145
|
items: e,
|
|
4146
4146
|
className: o,
|
|
4147
|
-
itemBuilder:
|
|
4147
|
+
itemBuilder: r,
|
|
4148
4148
|
children: i,
|
|
4149
4149
|
mouseX: f,
|
|
4150
4150
|
...p
|
|
@@ -4154,7 +4154,7 @@ const Lt = (t) => {
|
|
|
4154
4154
|
At,
|
|
4155
4155
|
{
|
|
4156
4156
|
items: e,
|
|
4157
|
-
className:
|
|
4157
|
+
className: n,
|
|
4158
4158
|
itemBuilder: a,
|
|
4159
4159
|
children: l,
|
|
4160
4160
|
autoHidden: !0,
|
|
@@ -4186,7 +4186,7 @@ function va(t, e) {
|
|
|
4186
4186
|
throw new Error("No supported clipboard serialization method found.");
|
|
4187
4187
|
}
|
|
4188
4188
|
function ka(t) {
|
|
4189
|
-
const e = t.getBoundingClientRect(), o = t.closest('[role="dialog"]'),
|
|
4189
|
+
const e = t.getBoundingClientRect(), o = t.closest('[role="dialog"]'), n = t.closest(".ProseMirror"), r = n == null ? void 0 : n.getBoundingClientRect(), a = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
|
|
4190
4190
|
if (o && window.getComputedStyle(o).transform !== "none") {
|
|
4191
4191
|
const l = o.getBoundingClientRect();
|
|
4192
4192
|
return {
|
|
@@ -4196,8 +4196,8 @@ function ka(t) {
|
|
|
4196
4196
|
};
|
|
4197
4197
|
}
|
|
4198
4198
|
return {
|
|
4199
|
-
top:
|
|
4200
|
-
left:
|
|
4199
|
+
top: r ? e.top - r.top : e.top + i,
|
|
4200
|
+
left: r ? e.left - r.left : e.left + a,
|
|
4201
4201
|
width: e.width
|
|
4202
4202
|
};
|
|
4203
4203
|
}
|
|
@@ -4213,22 +4213,22 @@ function Rt(t, e) {
|
|
|
4213
4213
|
"h4",
|
|
4214
4214
|
"h5",
|
|
4215
4215
|
"h6",
|
|
4216
|
-
...e.customNodes.map((
|
|
4216
|
+
...e.customNodes.map((n) => `[data-type=${n}]`)
|
|
4217
4217
|
].join(", ");
|
|
4218
4218
|
return document.elementsFromPoint(t.x, t.y).find(
|
|
4219
|
-
(
|
|
4220
|
-
var
|
|
4221
|
-
return ((a = (
|
|
4219
|
+
(n) => {
|
|
4220
|
+
var r, a;
|
|
4221
|
+
return ((a = (r = n.parentElement) == null ? void 0 : r.matches) == null ? void 0 : a.call(r, ".ProseMirror")) || n.matches(o);
|
|
4222
4222
|
}
|
|
4223
4223
|
);
|
|
4224
4224
|
}
|
|
4225
4225
|
function Tt(t, e, o) {
|
|
4226
|
-
var
|
|
4227
|
-
const
|
|
4228
|
-
return (
|
|
4229
|
-
left:
|
|
4230
|
-
top:
|
|
4231
|
-
})) == null ? void 0 :
|
|
4226
|
+
var r;
|
|
4227
|
+
const n = t.getBoundingClientRect();
|
|
4228
|
+
return (r = e.posAtCoords({
|
|
4229
|
+
left: n.left + 50 + o.dragHandleWidth,
|
|
4230
|
+
top: n.top + 1
|
|
4231
|
+
})) == null ? void 0 : r.inside;
|
|
4232
4232
|
}
|
|
4233
4233
|
function at(t, e) {
|
|
4234
4234
|
const o = e.state.doc.resolve(t);
|
|
@@ -4236,7 +4236,7 @@ function at(t, e) {
|
|
|
4236
4236
|
}
|
|
4237
4237
|
function wa(t) {
|
|
4238
4238
|
let e = "", o = !1;
|
|
4239
|
-
function
|
|
4239
|
+
function n(d, g) {
|
|
4240
4240
|
if (g.focus(), !d.dataTransfer) return;
|
|
4241
4241
|
const h = Rt(
|
|
4242
4242
|
{
|
|
@@ -4276,20 +4276,20 @@ function wa(t) {
|
|
|
4276
4276
|
const b = g.state.selection.content(), { dom: x, text: D } = va(g, b);
|
|
4277
4277
|
d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", x.innerHTML), d.dataTransfer.setData("text/plain", D), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(h, 0, 0), g.dragging = { slice: b, move: d.ctrlKey };
|
|
4278
4278
|
}
|
|
4279
|
-
let
|
|
4279
|
+
let r = null;
|
|
4280
4280
|
function a() {
|
|
4281
|
-
|
|
4281
|
+
r && r.classList.add("hide");
|
|
4282
4282
|
}
|
|
4283
4283
|
function i() {
|
|
4284
|
-
|
|
4284
|
+
r && r.classList.remove("hide");
|
|
4285
4285
|
}
|
|
4286
4286
|
function l(d, g) {
|
|
4287
4287
|
const h = at(g, d), c = we.create(d.state.doc, h);
|
|
4288
4288
|
d.dispatch(d.state.tr.setSelection(c)), d.focus(), o = !0;
|
|
4289
4289
|
}
|
|
4290
4290
|
function f(d) {
|
|
4291
|
-
if (o = d.state.selection instanceof we, o && (
|
|
4292
|
-
const h = parseInt(
|
|
4291
|
+
if (o = d.state.selection instanceof we, o && (r != null && r.dataset.nodePos)) {
|
|
4292
|
+
const h = parseInt(r.dataset.nodePos, 10);
|
|
4293
4293
|
try {
|
|
4294
4294
|
const c = d.state.doc.resolve(h);
|
|
4295
4295
|
c && c.parent && c.parent.type.name !== "doc" || (o = !1, a());
|
|
@@ -4297,7 +4297,7 @@ function wa(t) {
|
|
|
4297
4297
|
o = !1, a();
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
|
-
o &&
|
|
4300
|
+
o && r && !r.classList.contains("hide") ? i() : o || a();
|
|
4301
4301
|
}
|
|
4302
4302
|
function p(d) {
|
|
4303
4303
|
if (!(d.target instanceof Element)) return;
|
|
@@ -4314,32 +4314,32 @@ function wa(t) {
|
|
|
4314
4314
|
view: (d) => {
|
|
4315
4315
|
var w, z, y, M;
|
|
4316
4316
|
const g = t.dragHandleSelector ? document.querySelector(t.dragHandleSelector) : null;
|
|
4317
|
-
|
|
4317
|
+
r = g ?? document.createElement("div"), r.draggable = !0, r.dataset.dragHandle = "", r.classList.add("drag-handle");
|
|
4318
4318
|
function h(k) {
|
|
4319
|
-
|
|
4319
|
+
n(k, d);
|
|
4320
4320
|
}
|
|
4321
|
-
|
|
4321
|
+
r.addEventListener("dragstart", h);
|
|
4322
4322
|
function c(k) {
|
|
4323
4323
|
g || (k.preventDefault(), k.stopPropagation());
|
|
4324
|
-
const v =
|
|
4324
|
+
const v = r == null ? void 0 : r.dataset.nodePos;
|
|
4325
4325
|
v && l(d, parseInt(v, 10));
|
|
4326
4326
|
}
|
|
4327
|
-
|
|
4327
|
+
r.addEventListener("click", c);
|
|
4328
4328
|
function u(k) {
|
|
4329
4329
|
a();
|
|
4330
4330
|
const v = window.scrollY;
|
|
4331
4331
|
k.clientY < t.scrollTreshold ? window.scrollTo({ top: v - 30, behavior: "smooth" }) : window.innerHeight - k.clientY < t.scrollTreshold && window.scrollTo({ top: v + 30, behavior: "smooth" });
|
|
4332
4332
|
}
|
|
4333
|
-
return
|
|
4333
|
+
return r.addEventListener("drag", u), a(), g || (z = (w = d == null ? void 0 : d.dom) == null ? void 0 : w.parentElement) == null || z.appendChild(r), (M = (y = d == null ? void 0 : d.dom) == null ? void 0 : y.parentElement) == null || M.addEventListener(
|
|
4334
4334
|
"mouseout",
|
|
4335
4335
|
p
|
|
4336
4336
|
), {
|
|
4337
4337
|
destroy: () => {
|
|
4338
4338
|
var k, v, b;
|
|
4339
|
-
g || (k =
|
|
4339
|
+
g || (k = r == null ? void 0 : r.remove) == null || k.call(r), r == null || r.removeEventListener("drag", u), r == null || r.removeEventListener(
|
|
4340
4340
|
"dragstart",
|
|
4341
4341
|
h
|
|
4342
|
-
),
|
|
4342
|
+
), r == null || r.removeEventListener("click", c), r = null, (b = (v = d == null ? void 0 : d.dom) == null ? void 0 : v.parentElement) == null || b.removeEventListener(
|
|
4343
4343
|
"mouseout",
|
|
4344
4344
|
p
|
|
4345
4345
|
);
|
|
@@ -4363,11 +4363,11 @@ function wa(t) {
|
|
|
4363
4363
|
return;
|
|
4364
4364
|
}
|
|
4365
4365
|
const w = Tt(h, d, t);
|
|
4366
|
-
w != null && w >= 0 && (
|
|
4366
|
+
w != null && w >= 0 && (r.dataset.nodePos = String(
|
|
4367
4367
|
at(w, d)
|
|
4368
4368
|
));
|
|
4369
4369
|
const z = window.getComputedStyle(h), y = parseInt(z.lineHeight, 10), M = isNaN(y) ? parseInt(z.fontSize) * 1.2 : y, k = parseInt(z.paddingTop, 10), v = ka(h);
|
|
4370
|
-
v.top += (M - 24) / 2, v.top += k, h.matches("ul:not([data-type=taskList]) li, ol li") && (v.left -= t.dragHandleWidth - 28), v.width = t.dragHandleWidth,
|
|
4370
|
+
v.top += (M - 24) / 2, v.top += k, h.matches("ul:not([data-type=taskList]) li, ol li") && (v.left -= t.dragHandleWidth - 28), v.width = t.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${v.left - v.width}px`, r.style.top = `${v.top}px`, i());
|
|
4371
4371
|
},
|
|
4372
4372
|
keydown: () => {
|
|
4373
4373
|
o || a();
|
|
@@ -4412,8 +4412,8 @@ function wa(t) {
|
|
|
4412
4412
|
return {};
|
|
4413
4413
|
},
|
|
4414
4414
|
apply(d, g, h, c) {
|
|
4415
|
-
if (d.docChanged &&
|
|
4416
|
-
const u = parseInt(
|
|
4415
|
+
if (d.docChanged && r && r.dataset.nodePos) {
|
|
4416
|
+
const u = parseInt(r.dataset.nodePos, 10);
|
|
4417
4417
|
try {
|
|
4418
4418
|
const w = c.doc.resolve(u);
|
|
4419
4419
|
(!w || w.parent.type.name === "doc") && (o = !1, a());
|
|
@@ -4448,18 +4448,18 @@ const Ca = ls.create({
|
|
|
4448
4448
|
})
|
|
4449
4449
|
];
|
|
4450
4450
|
}
|
|
4451
|
-
}), za =
|
|
4451
|
+
}), za = Tn, Na = wn.configure({
|
|
4452
4452
|
placeholder: "撰写任何内容,或者按“/”输入命令..."
|
|
4453
|
-
}), Ia =
|
|
4453
|
+
}), Ia = Cn.configure({
|
|
4454
4454
|
HTMLAttributes: {
|
|
4455
4455
|
class: ye(
|
|
4456
4456
|
"text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
|
|
4457
4457
|
)
|
|
4458
4458
|
}
|
|
4459
|
-
}), Ma =
|
|
4459
|
+
}), Ma = zn.extend({
|
|
4460
4460
|
addProseMirrorPlugins() {
|
|
4461
4461
|
return [
|
|
4462
|
-
|
|
4462
|
+
Nn({
|
|
4463
4463
|
imageClass: ye("opacity-40 rounded-lg border border-stone-200")
|
|
4464
4464
|
})
|
|
4465
4465
|
];
|
|
@@ -4469,24 +4469,24 @@ const Ca = ls.create({
|
|
|
4469
4469
|
HTMLAttributes: {
|
|
4470
4470
|
class: ye("rounded-lg border border-muted")
|
|
4471
4471
|
}
|
|
4472
|
-
}), Sa =
|
|
4472
|
+
}), Sa = In.configure({
|
|
4473
4473
|
HTMLAttributes: {
|
|
4474
4474
|
class: ye("rounded-lg border border-muted")
|
|
4475
4475
|
}
|
|
4476
|
-
}), La =
|
|
4476
|
+
}), La = Mn.configure({
|
|
4477
4477
|
HTMLAttributes: {
|
|
4478
4478
|
class: ye("not-prose pl-2 ")
|
|
4479
4479
|
}
|
|
4480
|
-
}), Da =
|
|
4480
|
+
}), Da = Sn.configure({
|
|
4481
4481
|
HTMLAttributes: {
|
|
4482
4482
|
class: ye("flex gap-2 items-start my-4")
|
|
4483
4483
|
},
|
|
4484
4484
|
nested: !0
|
|
4485
|
-
}), Aa =
|
|
4485
|
+
}), Aa = Ln.configure({
|
|
4486
4486
|
HTMLAttributes: {
|
|
4487
4487
|
class: ye("mt-4 mb-6 border-t border-muted-foreground")
|
|
4488
4488
|
}
|
|
4489
|
-
}), Ea =
|
|
4489
|
+
}), Ea = Dn.configure({
|
|
4490
4490
|
bulletList: {
|
|
4491
4491
|
HTMLAttributes: {
|
|
4492
4492
|
class: ye("list-disc list-outside leading-3 -mt-2")
|
|
@@ -4526,18 +4526,18 @@ const Ca = ls.create({
|
|
|
4526
4526
|
width: 4
|
|
4527
4527
|
},
|
|
4528
4528
|
gapcursor: !1
|
|
4529
|
-
}), Ra =
|
|
4529
|
+
}), Ra = An.configure({
|
|
4530
4530
|
// configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
|
|
4531
4531
|
// common: covers 37 language grammars which should be good enough in most cases
|
|
4532
4532
|
lowlight: as(is)
|
|
4533
|
-
}), Ta =
|
|
4533
|
+
}), Ta = En.configure({
|
|
4534
4534
|
HTMLAttributes: {
|
|
4535
4535
|
class: ye("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
|
|
4536
4536
|
},
|
|
4537
4537
|
katexOptions: {
|
|
4538
4538
|
throwOnError: !1
|
|
4539
4539
|
}
|
|
4540
|
-
}), Pa =
|
|
4540
|
+
}), Pa = Rn.configure(), Ba = ns.configure({
|
|
4541
4541
|
html: !0,
|
|
4542
4542
|
tightLists: !0,
|
|
4543
4543
|
tightListClass: "tight",
|
|
@@ -4562,24 +4562,24 @@ const Ca = ls.create({
|
|
|
4562
4562
|
Ra,
|
|
4563
4563
|
Ta,
|
|
4564
4564
|
Pa,
|
|
4565
|
-
|
|
4565
|
+
Pn,
|
|
4566
4566
|
Ba,
|
|
4567
|
-
|
|
4568
|
-
$
|
|
4569
|
-
|
|
4570
|
-
|
|
4567
|
+
Bn,
|
|
4568
|
+
$n,
|
|
4569
|
+
_n,
|
|
4570
|
+
On,
|
|
4571
4571
|
$a
|
|
4572
|
-
], _a = Ke.Root, _o = Ke.Trigger, mt = le.forwardRef(({ className: t, align: e = "center", sideOffset: o = 4, ...
|
|
4572
|
+
], _a = Ke.Root, _o = Ke.Trigger, mt = le.forwardRef(({ className: t, align: e = "center", sideOffset: o = 4, ...n }, r) => /* @__PURE__ */ s(Ke.Portal, { children: /* @__PURE__ */ s(
|
|
4573
4573
|
Ke.Content,
|
|
4574
4574
|
{
|
|
4575
|
-
ref:
|
|
4575
|
+
ref: r,
|
|
4576
4576
|
align: e,
|
|
4577
4577
|
sideOffset: o,
|
|
4578
4578
|
className: S(
|
|
4579
4579
|
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
4580
4580
|
t
|
|
4581
4581
|
),
|
|
4582
|
-
...
|
|
4582
|
+
...n
|
|
4583
4583
|
}
|
|
4584
4584
|
) }));
|
|
4585
4585
|
mt.displayName = Ke.Content.displayName;
|
|
@@ -4608,12 +4608,12 @@ const Oa = ss(
|
|
|
4608
4608
|
}
|
|
4609
4609
|
}
|
|
4610
4610
|
), Ne = le.forwardRef(
|
|
4611
|
-
({ className: t, variant: e, size: o, asChild:
|
|
4612
|
-
|
|
4611
|
+
({ className: t, variant: e, size: o, asChild: n = !1, ...r }, a) => /* @__PURE__ */ s(
|
|
4612
|
+
n ? hs : "button",
|
|
4613
4613
|
{
|
|
4614
4614
|
className: S(Oa({ variant: e, size: o, className: t })),
|
|
4615
4615
|
ref: a,
|
|
4616
|
-
...
|
|
4616
|
+
...r
|
|
4617
4617
|
}
|
|
4618
4618
|
)
|
|
4619
4619
|
);
|
|
@@ -4729,9 +4729,9 @@ const Pt = [
|
|
|
4729
4729
|
), Fa = ({ open: t, onOpenChange: e }) => {
|
|
4730
4730
|
const { editor: o } = Se();
|
|
4731
4731
|
if (!o) return null;
|
|
4732
|
-
const
|
|
4732
|
+
const n = Pt.find(
|
|
4733
4733
|
({ color: a }) => o.isActive("textStyle", { color: a })
|
|
4734
|
-
),
|
|
4734
|
+
), r = Bt.find(
|
|
4735
4735
|
({ color: a }) => o.isActive("highlight", { color: a })
|
|
4736
4736
|
);
|
|
4737
4737
|
return /* @__PURE__ */ A(_a, { modal: !0, open: t, onOpenChange: e, children: [
|
|
@@ -4741,8 +4741,8 @@ const Pt = [
|
|
|
4741
4741
|
{
|
|
4742
4742
|
className: "rounded-sm px-1",
|
|
4743
4743
|
style: {
|
|
4744
|
-
color:
|
|
4745
|
-
backgroundColor:
|
|
4744
|
+
color: n == null ? void 0 : n.color,
|
|
4745
|
+
backgroundColor: r == null ? void 0 : r.color
|
|
4746
4746
|
},
|
|
4747
4747
|
children: "A"
|
|
4748
4748
|
}
|
|
@@ -4832,11 +4832,11 @@ function ja(t) {
|
|
|
4832
4832
|
}
|
|
4833
4833
|
}
|
|
4834
4834
|
const Ua = ({ open: t, onOpenChange: e }) => {
|
|
4835
|
-
const o =
|
|
4835
|
+
const o = ne(null), { editor: n } = Se();
|
|
4836
4836
|
return V(() => {
|
|
4837
|
-
var
|
|
4838
|
-
(
|
|
4839
|
-
}),
|
|
4837
|
+
var r;
|
|
4838
|
+
(r = o.current) == null || r.focus();
|
|
4839
|
+
}), n ? /* @__PURE__ */ A(io, { modal: !0, open: t, onOpenChange: e, children: [
|
|
4840
4840
|
/* @__PURE__ */ s(Oe, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ s(ms, { asChild: !0, children: /* @__PURE__ */ A(
|
|
4841
4841
|
Ne,
|
|
4842
4842
|
{
|
|
@@ -4844,14 +4844,14 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4844
4844
|
variant: "ghost",
|
|
4845
4845
|
className: "gap-2 rounded-md border-none",
|
|
4846
4846
|
children: [
|
|
4847
|
-
/* @__PURE__ */ s("p", { className: "text-base", children: /* @__PURE__ */ s(
|
|
4847
|
+
/* @__PURE__ */ s("p", { className: "text-base", children: /* @__PURE__ */ s(Nr, { size: 16 }) }),
|
|
4848
4848
|
/* @__PURE__ */ s(
|
|
4849
4849
|
"p",
|
|
4850
4850
|
{
|
|
4851
4851
|
className: S(
|
|
4852
4852
|
"underline decoration-stone-400 underline-offset-4",
|
|
4853
4853
|
{
|
|
4854
|
-
"text-blue-500":
|
|
4854
|
+
"text-blue-500": n.isActive("link")
|
|
4855
4855
|
}
|
|
4856
4856
|
),
|
|
4857
4857
|
children: "链接 "
|
|
@@ -4863,11 +4863,11 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4863
4863
|
/* @__PURE__ */ s(mt, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ A(
|
|
4864
4864
|
"form",
|
|
4865
4865
|
{
|
|
4866
|
-
onSubmit: (
|
|
4867
|
-
const a =
|
|
4868
|
-
|
|
4866
|
+
onSubmit: (r) => {
|
|
4867
|
+
const a = r.currentTarget;
|
|
4868
|
+
r.preventDefault();
|
|
4869
4869
|
const i = a[0], l = ja(i.value);
|
|
4870
|
-
l && (
|
|
4870
|
+
l && (n.chain().focus().setLink({ href: l }).run(), e(!1));
|
|
4871
4871
|
},
|
|
4872
4872
|
className: "flex p-1 ",
|
|
4873
4873
|
children: [
|
|
@@ -4878,10 +4878,10 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4878
4878
|
type: "text",
|
|
4879
4879
|
placeholder: "粘贴链接",
|
|
4880
4880
|
className: "flex-1 bg-background p-1 text-sm outline-none",
|
|
4881
|
-
defaultValue:
|
|
4881
|
+
defaultValue: n.getAttributes("link").href || ""
|
|
4882
4882
|
}
|
|
4883
4883
|
),
|
|
4884
|
-
|
|
4884
|
+
n.getAttributes("link").href ? /* @__PURE__ */ s(
|
|
4885
4885
|
Ne,
|
|
4886
4886
|
{
|
|
4887
4887
|
size: "icon",
|
|
@@ -4889,7 +4889,7 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4889
4889
|
type: "button",
|
|
4890
4890
|
className: "flex h-8 items-center rounded-sm p-1 text-red-600 transition-all hover:bg-red-100 dark:hover:bg-red-800",
|
|
4891
4891
|
onClick: () => {
|
|
4892
|
-
|
|
4892
|
+
n.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
|
|
4893
4893
|
},
|
|
4894
4894
|
children: /* @__PURE__ */ s(qt, { className: "h-4 w-4" })
|
|
4895
4895
|
}
|
|
@@ -4910,9 +4910,9 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4910
4910
|
if (t.isActive("math"))
|
|
4911
4911
|
t.chain().focus().unsetLatex().run();
|
|
4912
4912
|
else {
|
|
4913
|
-
const { from: e, to: o } = t.state.selection,
|
|
4914
|
-
if (!
|
|
4915
|
-
t.chain().focus().setLatex({ latex:
|
|
4913
|
+
const { from: e, to: o } = t.state.selection, n = t.state.doc.textBetween(e, o);
|
|
4914
|
+
if (!n) return;
|
|
4915
|
+
t.chain().focus().setLatex({ latex: n }).run();
|
|
4916
4916
|
}
|
|
4917
4917
|
},
|
|
4918
4918
|
children: /* @__PURE__ */ s(
|
|
@@ -4977,22 +4977,22 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
4977
4977
|
{
|
|
4978
4978
|
name: "引用",
|
|
4979
4979
|
// Quote
|
|
4980
|
-
icon:
|
|
4980
|
+
icon: ro,
|
|
4981
4981
|
command: (t) => t.chain().focus().clearNodes().toggleBlockquote().run(),
|
|
4982
4982
|
isActive: (t) => t.isActive("blockquote")
|
|
4983
4983
|
},
|
|
4984
4984
|
{
|
|
4985
4985
|
name: "代码块",
|
|
4986
4986
|
// Code
|
|
4987
|
-
icon:
|
|
4987
|
+
icon: no,
|
|
4988
4988
|
command: (t) => t.chain().focus().clearNodes().toggleCodeBlock().run(),
|
|
4989
4989
|
isActive: (t) => t.isActive("codeBlock")
|
|
4990
4990
|
}
|
|
4991
4991
|
], Ga = ({ open: t, onOpenChange: e }) => {
|
|
4992
4992
|
const { editor: o } = Se();
|
|
4993
4993
|
if (!o) return null;
|
|
4994
|
-
const
|
|
4995
|
-
(
|
|
4994
|
+
const n = wt.filter(
|
|
4995
|
+
(r) => r.isActive(o)
|
|
4996
4996
|
).pop() ?? {
|
|
4997
4997
|
name: "多个选中"
|
|
4998
4998
|
// Multiple
|
|
@@ -5004,7 +5004,7 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
5004
5004
|
asChild: !0,
|
|
5005
5005
|
className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
|
|
5006
5006
|
children: /* @__PURE__ */ A(Ne, { size: "sm", variant: "ghost", children: [
|
|
5007
|
-
/* @__PURE__ */ s("span", { className: "whitespace-nowrap text-sm", children:
|
|
5007
|
+
/* @__PURE__ */ s("span", { className: "whitespace-nowrap text-sm", children: n.name }),
|
|
5008
5008
|
/* @__PURE__ */ s(Vt, {})
|
|
5009
5009
|
] })
|
|
5010
5010
|
}
|
|
@@ -5012,30 +5012,30 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
5012
5012
|
/* @__PURE__ */ A(mt, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
|
|
5013
5013
|
/* @__PURE__ */ s("p", { className: "mb-2 text-sm text-secondary-foreground", children: "转换成" }),
|
|
5014
5014
|
" ",
|
|
5015
|
-
wt.map((
|
|
5015
|
+
wt.map((r) => /* @__PURE__ */ A(
|
|
5016
5016
|
it,
|
|
5017
5017
|
{
|
|
5018
5018
|
onSelect: (a) => {
|
|
5019
|
-
|
|
5019
|
+
r.command(a), e(!1);
|
|
5020
5020
|
},
|
|
5021
5021
|
className: "flex cursor-pointer items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-accent",
|
|
5022
5022
|
children: [
|
|
5023
5023
|
/* @__PURE__ */ A("div", { className: "flex items-center space-x-2", children: [
|
|
5024
|
-
/* @__PURE__ */ s("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ s(
|
|
5025
|
-
/* @__PURE__ */ s("span", { children:
|
|
5024
|
+
/* @__PURE__ */ s("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ s(r.icon, { className: "h-3 w-3" }) }),
|
|
5025
|
+
/* @__PURE__ */ s("span", { children: r.name })
|
|
5026
5026
|
] }),
|
|
5027
|
-
|
|
5027
|
+
n.name === r.name && /* @__PURE__ */ s(Ge, { size: 14 })
|
|
5028
5028
|
]
|
|
5029
5029
|
},
|
|
5030
|
-
|
|
5030
|
+
r.name
|
|
5031
5031
|
))
|
|
5032
5032
|
] })
|
|
5033
5033
|
] });
|
|
5034
5034
|
}, Ue = le.forwardRef(
|
|
5035
|
-
({ className: t, orientation: e = "horizontal", decorative: o = !0, ...
|
|
5035
|
+
({ className: t, orientation: e = "horizontal", decorative: o = !0, ...n }, r) => /* @__PURE__ */ s(
|
|
5036
5036
|
lo.Root,
|
|
5037
5037
|
{
|
|
5038
|
-
ref:
|
|
5038
|
+
ref: r,
|
|
5039
5039
|
decorative: o,
|
|
5040
5040
|
orientation: e,
|
|
5041
5041
|
className: S(
|
|
@@ -5043,7 +5043,7 @@ const Ua = ({ open: t, onOpenChange: e }) => {
|
|
|
5043
5043
|
e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
|
|
5044
5044
|
t
|
|
5045
5045
|
),
|
|
5046
|
-
...
|
|
5046
|
+
...n
|
|
5047
5047
|
}
|
|
5048
5048
|
)
|
|
5049
5049
|
);
|
|
@@ -5052,10 +5052,10 @@ const Ya = () => /* @__PURE__ */ A("div", { className: "flex items-center justif
|
|
|
5052
5052
|
/* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
|
|
5053
5053
|
/* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
|
|
5054
5054
|
/* @__PURE__ */ s("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
|
|
5055
|
-
] }), Oo = le.forwardRef(({ className: t, children: e, ...o },
|
|
5055
|
+
] }), Oo = le.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(
|
|
5056
5056
|
Be.Root,
|
|
5057
5057
|
{
|
|
5058
|
-
ref:
|
|
5058
|
+
ref: n,
|
|
5059
5059
|
className: S("relative overflow-hidden", t),
|
|
5060
5060
|
...o,
|
|
5061
5061
|
children: [
|
|
@@ -5066,10 +5066,10 @@ const Ya = () => /* @__PURE__ */ A("div", { className: "flex items-center justif
|
|
|
5066
5066
|
}
|
|
5067
5067
|
));
|
|
5068
5068
|
Oo.displayName = Be.Root.displayName;
|
|
5069
|
-
const Fo = le.forwardRef(({ className: t, orientation: e = "vertical", ...o },
|
|
5069
|
+
const Fo = le.forwardRef(({ className: t, orientation: e = "vertical", ...o }, n) => /* @__PURE__ */ s(
|
|
5070
5070
|
Be.ScrollAreaScrollbar,
|
|
5071
5071
|
{
|
|
5072
|
-
ref:
|
|
5072
|
+
ref: n,
|
|
5073
5073
|
orientation: e,
|
|
5074
5074
|
className: S(
|
|
5075
5075
|
"flex touch-none select-none transition-colors",
|
|
@@ -5094,12 +5094,12 @@ const Xa = Le.Portal, Ho = le.forwardRef(({ className: t, ...e }, o) => /* @__PU
|
|
|
5094
5094
|
}
|
|
5095
5095
|
));
|
|
5096
5096
|
Ho.displayName = Le.Overlay.displayName;
|
|
5097
|
-
const Va = le.forwardRef(({ className: t, children: e, ...o },
|
|
5097
|
+
const Va = le.forwardRef(({ className: t, children: e, ...o }, n) => /* @__PURE__ */ A(Xa, { children: [
|
|
5098
5098
|
/* @__PURE__ */ s(Ho, {}),
|
|
5099
5099
|
/* @__PURE__ */ A(
|
|
5100
5100
|
Le.Content,
|
|
5101
5101
|
{
|
|
5102
|
-
ref:
|
|
5102
|
+
ref: n,
|
|
5103
5103
|
className: S(
|
|
5104
5104
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
5105
5105
|
t
|
|
@@ -5228,11 +5228,11 @@ const Qa = ({
|
|
|
5228
5228
|
className: "gap-2 px-4",
|
|
5229
5229
|
value: "replace",
|
|
5230
5230
|
onSelect: () => {
|
|
5231
|
-
const
|
|
5231
|
+
const n = o.view.state.selection;
|
|
5232
5232
|
o.chain().focus().insertContentAt(
|
|
5233
5233
|
{
|
|
5234
|
-
from:
|
|
5235
|
-
to:
|
|
5234
|
+
from: n.from,
|
|
5235
|
+
to: n.to
|
|
5236
5236
|
},
|
|
5237
5237
|
t
|
|
5238
5238
|
).run();
|
|
@@ -5249,8 +5249,8 @@ const Qa = ({
|
|
|
5249
5249
|
className: "gap-2 px-4",
|
|
5250
5250
|
value: "insert",
|
|
5251
5251
|
onSelect: () => {
|
|
5252
|
-
const
|
|
5253
|
-
o.chain().focus().insertContentAt(
|
|
5252
|
+
const n = o.view.state.selection;
|
|
5253
|
+
o.chain().focus().insertContentAt(n.to + 1, t).run();
|
|
5254
5254
|
},
|
|
5255
5255
|
children: [
|
|
5256
5256
|
/* @__PURE__ */ s(ks, { className: "h-4 w-4 text-muted-foreground" }),
|
|
@@ -5298,11 +5298,11 @@ const Qa = ({
|
|
|
5298
5298
|
ei.map((o) => /* @__PURE__ */ A(
|
|
5299
5299
|
We,
|
|
5300
5300
|
{
|
|
5301
|
-
onSelect: (
|
|
5302
|
-
const
|
|
5303
|
-
|
|
5301
|
+
onSelect: (n) => {
|
|
5302
|
+
const r = e.state.selection.content(), a = e.storage.markdown.serializer.serialize(
|
|
5303
|
+
r.content
|
|
5304
5304
|
);
|
|
5305
|
-
t(a,
|
|
5305
|
+
t(a, n);
|
|
5306
5306
|
},
|
|
5307
5307
|
className: "flex gap-2 px-4",
|
|
5308
5308
|
value: o.value,
|
|
@@ -5321,8 +5321,8 @@ const Qa = ({
|
|
|
5321
5321
|
We,
|
|
5322
5322
|
{
|
|
5323
5323
|
onSelect: () => {
|
|
5324
|
-
const o = e.state.selection.from,
|
|
5325
|
-
t(
|
|
5324
|
+
const o = e.state.selection.from, n = Fn(e, o);
|
|
5325
|
+
t(n, "continue");
|
|
5326
5326
|
},
|
|
5327
5327
|
value: "continue",
|
|
5328
5328
|
className: "gap-2 px-4",
|
|
@@ -5336,7 +5336,7 @@ const Qa = ({
|
|
|
5336
5336
|
] });
|
|
5337
5337
|
};
|
|
5338
5338
|
function oi({ onOpenChange: t, options: e }) {
|
|
5339
|
-
const { editor: o } = Se(), [
|
|
5339
|
+
const { editor: o } = Se(), [n, r] = B(""), { completion: a, complete: i, isLoading: l } = Ts({
|
|
5340
5340
|
// id: "novel",
|
|
5341
5341
|
api: "/api/generate",
|
|
5342
5342
|
onResponse: (p) => {
|
|
@@ -5362,11 +5362,11 @@ function oi({ onOpenChange: t, options: e }) {
|
|
|
5362
5362
|
/* @__PURE__ */ s(
|
|
5363
5363
|
Uo,
|
|
5364
5364
|
{
|
|
5365
|
-
value:
|
|
5366
|
-
onValueChange:
|
|
5365
|
+
value: n,
|
|
5366
|
+
onValueChange: r,
|
|
5367
5367
|
autoFocus: !0,
|
|
5368
5368
|
placeholder: f ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
|
|
5369
|
-
onFocus: () =>
|
|
5369
|
+
onFocus: () => Hn(o)
|
|
5370
5370
|
}
|
|
5371
5371
|
),
|
|
5372
5372
|
/* @__PURE__ */ s(
|
|
@@ -5377,14 +5377,14 @@ function oi({ onOpenChange: t, options: e }) {
|
|
|
5377
5377
|
onClick: () => {
|
|
5378
5378
|
if (a)
|
|
5379
5379
|
return i(a, {
|
|
5380
|
-
body: { option: "zap", command:
|
|
5381
|
-
}).then(() =>
|
|
5380
|
+
body: { option: "zap", command: n }
|
|
5381
|
+
}).then(() => r(""));
|
|
5382
5382
|
const p = o.state.selection.content(), d = o.storage.markdown.serializer.serialize(
|
|
5383
5383
|
p.content
|
|
5384
5384
|
);
|
|
5385
5385
|
i(d, {
|
|
5386
|
-
body: { option: "zap", command:
|
|
5387
|
-
}).then(() =>
|
|
5386
|
+
body: { option: "zap", command: n }
|
|
5387
|
+
}).then(() => r(""));
|
|
5388
5388
|
},
|
|
5389
5389
|
children: /* @__PURE__ */ s(Ss, { className: "h-4 w-4" })
|
|
5390
5390
|
}
|
|
@@ -5407,18 +5407,18 @@ function oi({ onOpenChange: t, options: e }) {
|
|
|
5407
5407
|
] })
|
|
5408
5408
|
] });
|
|
5409
5409
|
}
|
|
5410
|
-
const
|
|
5410
|
+
const ri = ({
|
|
5411
5411
|
children: t,
|
|
5412
5412
|
open: e,
|
|
5413
5413
|
onOpenChange: o,
|
|
5414
|
-
enableAI:
|
|
5415
|
-
aiOptions:
|
|
5414
|
+
enableAI: n = !1,
|
|
5415
|
+
aiOptions: r
|
|
5416
5416
|
}) => {
|
|
5417
5417
|
const { editor: a } = Se();
|
|
5418
5418
|
return V(() => {
|
|
5419
|
-
e ||
|
|
5419
|
+
e || jn(a);
|
|
5420
5420
|
}, [e]), /* @__PURE__ */ A(
|
|
5421
|
-
|
|
5421
|
+
Un,
|
|
5422
5422
|
{
|
|
5423
5423
|
tippyOptions: {
|
|
5424
5424
|
placement: e ? "bottom-start" : "top",
|
|
@@ -5428,16 +5428,16 @@ const ni = ({
|
|
|
5428
5428
|
},
|
|
5429
5429
|
className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
|
|
5430
5430
|
children: [
|
|
5431
|
-
e &&
|
|
5431
|
+
e && n && /* @__PURE__ */ s(
|
|
5432
5432
|
oi,
|
|
5433
5433
|
{
|
|
5434
5434
|
open: e,
|
|
5435
5435
|
onOpenChange: o,
|
|
5436
|
-
options:
|
|
5436
|
+
options: r
|
|
5437
5437
|
}
|
|
5438
5438
|
),
|
|
5439
|
-
!e && /* @__PURE__ */ A(
|
|
5440
|
-
|
|
5439
|
+
!e && /* @__PURE__ */ A(er, { children: [
|
|
5440
|
+
n && /* @__PURE__ */ A(
|
|
5441
5441
|
Ne,
|
|
5442
5442
|
{
|
|
5443
5443
|
className: "gap-1 text-purple-500",
|
|
@@ -5455,7 +5455,7 @@ const ni = ({
|
|
|
5455
5455
|
]
|
|
5456
5456
|
}
|
|
5457
5457
|
);
|
|
5458
|
-
},
|
|
5458
|
+
}, ni = (t) => {
|
|
5459
5459
|
const e = fetch("/api/upload", {
|
|
5460
5460
|
method: "POST",
|
|
5461
5461
|
headers: {
|
|
@@ -5464,25 +5464,25 @@ const ni = ({
|
|
|
5464
5464
|
},
|
|
5465
5465
|
body: t
|
|
5466
5466
|
});
|
|
5467
|
-
return new Promise((o,
|
|
5467
|
+
return new Promise((o, n) => {
|
|
5468
5468
|
Je.promise(
|
|
5469
|
-
e.then(async (
|
|
5470
|
-
if (
|
|
5471
|
-
const { url: a } = await
|
|
5469
|
+
e.then(async (r) => {
|
|
5470
|
+
if (r.status === 200) {
|
|
5471
|
+
const { url: a } = await r.json(), i = new Image();
|
|
5472
5472
|
i.src = a, i.onload = () => {
|
|
5473
5473
|
o(a);
|
|
5474
5474
|
};
|
|
5475
|
-
} else throw
|
|
5475
|
+
} else throw r.status === 401 ? (o(t), new Error("`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead.")) : new Error("Error uploading image. Please try again.");
|
|
5476
5476
|
}),
|
|
5477
5477
|
{
|
|
5478
5478
|
loading: "Uploading image...",
|
|
5479
5479
|
success: "Image uploaded successfully.",
|
|
5480
|
-
error: (
|
|
5480
|
+
error: (r) => (n(r), r.message)
|
|
5481
5481
|
}
|
|
5482
5482
|
);
|
|
5483
5483
|
});
|
|
5484
5484
|
}, si = ao({
|
|
5485
|
-
onUpload:
|
|
5485
|
+
onUpload: ni,
|
|
5486
5486
|
validateFn: (t) => t.type.includes("image/") ? t.size / 1024 / 1024 > 20 ? (Je.error("File size too big (max 20MB)."), !1) : !0 : (Je.error("File type not supported."), !1)
|
|
5487
5487
|
}), ai = () => {
|
|
5488
5488
|
const { editor: t } = Se();
|
|
@@ -5525,8 +5525,8 @@ const ni = ({
|
|
|
5525
5525
|
].map((o) => /* @__PURE__ */ s(
|
|
5526
5526
|
it,
|
|
5527
5527
|
{
|
|
5528
|
-
onSelect: (
|
|
5529
|
-
o.command(
|
|
5528
|
+
onSelect: (n) => {
|
|
5529
|
+
o.command(n);
|
|
5530
5530
|
},
|
|
5531
5531
|
children: /* @__PURE__ */ s(Oe, { overlay: o.name, placement: "top", children: /* @__PURE__ */ s(
|
|
5532
5532
|
Ne,
|
|
@@ -5548,7 +5548,7 @@ const ni = ({
|
|
|
5548
5548
|
},
|
|
5549
5549
|
o.name
|
|
5550
5550
|
)) }) : null;
|
|
5551
|
-
}, Wo = ({ uploadFn: t }) =>
|
|
5551
|
+
}, Wo = ({ uploadFn: t }) => Gn([
|
|
5552
5552
|
{
|
|
5553
5553
|
title: "文本",
|
|
5554
5554
|
// "Text",
|
|
@@ -5632,7 +5632,7 @@ const ni = ({
|
|
|
5632
5632
|
description: "摘取引用。",
|
|
5633
5633
|
// "Capture a quote.",
|
|
5634
5634
|
searchTerms: ["blockquote"],
|
|
5635
|
-
icon: /* @__PURE__ */ s(
|
|
5635
|
+
icon: /* @__PURE__ */ s(ro, { size: 18 }),
|
|
5636
5636
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").toggleBlockquote().run()
|
|
5637
5637
|
},
|
|
5638
5638
|
{
|
|
@@ -5641,7 +5641,7 @@ const ni = ({
|
|
|
5641
5641
|
description: "捕获代码段。",
|
|
5642
5642
|
// "Capture a code snippet.",
|
|
5643
5643
|
searchTerms: ["codeblock"],
|
|
5644
|
-
icon: /* @__PURE__ */ s(
|
|
5644
|
+
icon: /* @__PURE__ */ s(no, { size: 18 }),
|
|
5645
5645
|
command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleCodeBlock().run()
|
|
5646
5646
|
},
|
|
5647
5647
|
{
|
|
@@ -5650,30 +5650,30 @@ const ni = ({
|
|
|
5650
5650
|
description: "从您的计算机上传图像。",
|
|
5651
5651
|
// "Upload an image from your computer.",
|
|
5652
5652
|
searchTerms: ["photo", "picture", "media"],
|
|
5653
|
-
icon: /* @__PURE__ */ s(
|
|
5653
|
+
icon: /* @__PURE__ */ s(Ir, { size: 18 }),
|
|
5654
5654
|
command: ({ editor: e, range: o }) => {
|
|
5655
5655
|
e.chain().focus().deleteRange(o).run();
|
|
5656
|
-
const
|
|
5657
|
-
|
|
5658
|
-
var
|
|
5659
|
-
if ((
|
|
5660
|
-
const a =
|
|
5656
|
+
const n = document.createElement("input");
|
|
5657
|
+
n.type = "file", n.accept = "image/*", n.onchange = async () => {
|
|
5658
|
+
var r;
|
|
5659
|
+
if ((r = n.files) != null && r.length) {
|
|
5660
|
+
const a = n.files[0], i = e.view.state.selection.from;
|
|
5661
5661
|
t(a, e.view, i);
|
|
5662
5662
|
}
|
|
5663
|
-
},
|
|
5663
|
+
}, n.click();
|
|
5664
5664
|
}
|
|
5665
5665
|
}
|
|
5666
|
-
]), ii = (t) =>
|
|
5666
|
+
]), ii = (t) => Wn.configure({
|
|
5667
5667
|
suggestion: {
|
|
5668
5668
|
items: () => Wo(t),
|
|
5669
|
-
render:
|
|
5669
|
+
render: Yn
|
|
5670
5670
|
}
|
|
5671
5671
|
}), li = {
|
|
5672
5672
|
type: "doc",
|
|
5673
5673
|
content: []
|
|
5674
|
-
}, Go = Xe(({ children: t, items: e, ...o },
|
|
5675
|
-
const
|
|
5676
|
-
|
|
5674
|
+
}, Go = Xe(({ children: t, items: e, ...o }, n) => {
|
|
5675
|
+
const r = (i) => /* @__PURE__ */ A(
|
|
5676
|
+
nt.Item,
|
|
5677
5677
|
{
|
|
5678
5678
|
onClick: i.onClick,
|
|
5679
5679
|
className: S(
|
|
@@ -5691,7 +5691,7 @@ const ni = ({
|
|
|
5691
5691
|
), a = (i) => {
|
|
5692
5692
|
var l;
|
|
5693
5693
|
return /* @__PURE__ */ s(
|
|
5694
|
-
|
|
5694
|
+
nt.SubMenu,
|
|
5695
5695
|
{
|
|
5696
5696
|
expandIcon: /* @__PURE__ */ s(Xt, { size: 16 }),
|
|
5697
5697
|
popupClassName: S(
|
|
@@ -5725,7 +5725,7 @@ const ni = ({
|
|
|
5725
5725
|
i.label,
|
|
5726
5726
|
/* @__PURE__ */ s("div", { className: "flex-1" })
|
|
5727
5727
|
] }),
|
|
5728
|
-
children: (l = i.children) == null ? void 0 : l.map(
|
|
5728
|
+
children: (l = i.children) == null ? void 0 : l.map(r)
|
|
5729
5729
|
},
|
|
5730
5730
|
i.key
|
|
5731
5731
|
);
|
|
@@ -5733,10 +5733,10 @@ const ni = ({
|
|
|
5733
5733
|
return /* @__PURE__ */ s(
|
|
5734
5734
|
Bs,
|
|
5735
5735
|
{
|
|
5736
|
-
ref:
|
|
5736
|
+
ref: n,
|
|
5737
5737
|
trigger: "click",
|
|
5738
5738
|
overlay: /* @__PURE__ */ s(
|
|
5739
|
-
|
|
5739
|
+
nt,
|
|
5740
5740
|
{
|
|
5741
5741
|
className: S(
|
|
5742
5742
|
"!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
|
|
@@ -5749,7 +5749,7 @@ const ni = ({
|
|
|
5749
5749
|
`
|
|
5750
5750
|
),
|
|
5751
5751
|
...o,
|
|
5752
|
-
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ s(
|
|
5752
|
+
children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ s(nt.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? a(i) : r(i))
|
|
5753
5753
|
}
|
|
5754
5754
|
),
|
|
5755
5755
|
...o,
|
|
@@ -5759,9 +5759,9 @@ const ni = ({
|
|
|
5759
5759
|
});
|
|
5760
5760
|
Go.displayName = "DropdownMenu";
|
|
5761
5761
|
const ci = ({ children: t, ...e }) => {
|
|
5762
|
-
const { editor: o } = Se(),
|
|
5762
|
+
const { editor: o } = Se(), n = () => {
|
|
5763
5763
|
o && o.state.selection instanceof we && (o.commands.deleteSelection(), o.commands.focus());
|
|
5764
|
-
},
|
|
5764
|
+
}, r = () => {
|
|
5765
5765
|
if (o && o.state.selection instanceof we) {
|
|
5766
5766
|
const l = o.state.selection.node, f = o.state.selection.to;
|
|
5767
5767
|
o.chain().insertContentAt(f, {
|
|
@@ -5783,15 +5783,15 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5783
5783
|
{
|
|
5784
5784
|
key: "transform",
|
|
5785
5785
|
type: "submenu",
|
|
5786
|
-
icon: /* @__PURE__ */ s(
|
|
5786
|
+
icon: /* @__PURE__ */ s(Mr, { size: 16 }),
|
|
5787
5787
|
label: "转换成",
|
|
5788
5788
|
children: a
|
|
5789
5789
|
},
|
|
5790
5790
|
{
|
|
5791
5791
|
key: "duplicate",
|
|
5792
|
-
icon: /* @__PURE__ */ s(
|
|
5792
|
+
icon: /* @__PURE__ */ s(Sr, { size: 16 }),
|
|
5793
5793
|
label: "创建副本",
|
|
5794
|
-
onClick:
|
|
5794
|
+
onClick: r
|
|
5795
5795
|
},
|
|
5796
5796
|
{ key: "divider", type: "divider" },
|
|
5797
5797
|
{
|
|
@@ -5799,15 +5799,15 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5799
5799
|
icon: /* @__PURE__ */ s(qt, { size: 16 }),
|
|
5800
5800
|
label: "删除",
|
|
5801
5801
|
className: "text-red-500",
|
|
5802
|
-
onClick:
|
|
5802
|
+
onClick: n
|
|
5803
5803
|
}
|
|
5804
5804
|
], ...e, children: t });
|
|
5805
5805
|
}, di = () => {
|
|
5806
5806
|
const { editor: t } = Se(), e = (o) => {
|
|
5807
5807
|
if (!t) return;
|
|
5808
|
-
const
|
|
5809
|
-
if (!
|
|
5810
|
-
const
|
|
5808
|
+
const n = o.target.closest(".custom-drag-handle");
|
|
5809
|
+
if (!n) return;
|
|
5810
|
+
const r = n.dataset.nodePos, a = r !== void 0 ? parseInt(n.dataset.nodePos || "0", 10) : r;
|
|
5811
5811
|
a !== void 0 && (t.commands.focus(), t.commands.setNodeSelection(a), t.commands.createParagraphNear() ? t.commands.insertContent("/") : t.chain().insertContentAt(a, {
|
|
5812
5812
|
type: "paragraph",
|
|
5813
5813
|
content: [{ type: "text", text: "/" }]
|
|
@@ -5841,7 +5841,7 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5841
5841
|
variant: "ghost",
|
|
5842
5842
|
className: "w-auto h-auto p-0.5",
|
|
5843
5843
|
onClick: e,
|
|
5844
|
-
children: /* @__PURE__ */ s(
|
|
5844
|
+
children: /* @__PURE__ */ s(Lr, { className: "cursor-pointer", size: 22 })
|
|
5845
5845
|
}
|
|
5846
5846
|
)
|
|
5847
5847
|
}
|
|
@@ -5854,7 +5854,7 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5854
5854
|
"拖动",
|
|
5855
5855
|
/* @__PURE__ */ s("span", { className: "text-muted-foreground", children: "以移动" })
|
|
5856
5856
|
] }) }),
|
|
5857
|
-
children: /* @__PURE__ */ s(Ne, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ s(
|
|
5857
|
+
children: /* @__PURE__ */ s(Ne, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ s(Dr, { size: 22 }) })
|
|
5858
5858
|
}
|
|
5859
5859
|
) })
|
|
5860
5860
|
]
|
|
@@ -5864,8 +5864,8 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5864
5864
|
const {
|
|
5865
5865
|
className: e,
|
|
5866
5866
|
initialContent: o = {},
|
|
5867
|
-
onChange:
|
|
5868
|
-
cacheKey:
|
|
5867
|
+
onChange: n,
|
|
5868
|
+
cacheKey: r = "novel-content",
|
|
5869
5869
|
enableCache: a = !1,
|
|
5870
5870
|
showSaveStatus: i = !0,
|
|
5871
5871
|
showWordCount: l = !0,
|
|
@@ -5880,19 +5880,19 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5880
5880
|
return j.querySelectorAll("pre code").forEach((se) => {
|
|
5881
5881
|
Ps.highlightElement(se);
|
|
5882
5882
|
}), new XMLSerializer().serializeToString(j);
|
|
5883
|
-
}, q =
|
|
5883
|
+
}, q = rs(
|
|
5884
5884
|
async (R) => {
|
|
5885
5885
|
const j = R.getJSON();
|
|
5886
|
-
y(R.storage.characterCount.words()),
|
|
5886
|
+
y(R.storage.characterCount.words()), n == null || n(j), a && (window.localStorage.setItem(
|
|
5887
5887
|
"html-content",
|
|
5888
5888
|
$(R.getHTML())
|
|
5889
|
-
), window.localStorage.setItem(
|
|
5889
|
+
), window.localStorage.setItem(r, JSON.stringify(j)), window.localStorage.setItem(
|
|
5890
5890
|
"markdown",
|
|
5891
5891
|
R.storage.markdown.getMarkdown()
|
|
5892
5892
|
), w("Saved"));
|
|
5893
5893
|
},
|
|
5894
5894
|
500
|
|
5895
|
-
), P =
|
|
5895
|
+
), P = re(() => {
|
|
5896
5896
|
if (!f) return si;
|
|
5897
5897
|
const {
|
|
5898
5898
|
beforeUpload: R,
|
|
@@ -5957,9 +5957,9 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5957
5957
|
}, [f]);
|
|
5958
5958
|
if (V(() => {
|
|
5959
5959
|
if (!a) return;
|
|
5960
|
-
const R = window.localStorage.getItem(
|
|
5960
|
+
const R = window.localStorage.getItem(r);
|
|
5961
5961
|
c(R ? JSON.parse(R) : li);
|
|
5962
|
-
}, [
|
|
5962
|
+
}, [r, a]), !h) return null;
|
|
5963
5963
|
const _ = [
|
|
5964
5964
|
...$o,
|
|
5965
5965
|
ii({
|
|
@@ -5980,8 +5980,8 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5980
5980
|
}
|
|
5981
5981
|
)
|
|
5982
5982
|
] }),
|
|
5983
|
-
/* @__PURE__ */ s(
|
|
5984
|
-
|
|
5983
|
+
/* @__PURE__ */ s(Xn, { children: /* @__PURE__ */ A(
|
|
5984
|
+
Vn,
|
|
5985
5985
|
{
|
|
5986
5986
|
onCreate: ({ editor: R }) => {
|
|
5987
5987
|
p && (p.current = R);
|
|
@@ -5991,10 +5991,10 @@ const ci = ({ children: t, ...e }) => {
|
|
|
5991
5991
|
className: "relative min-h-[500px] w-full editor-content",
|
|
5992
5992
|
editorProps: {
|
|
5993
5993
|
handleDOMEvents: {
|
|
5994
|
-
keydown: (R, j) =>
|
|
5994
|
+
keydown: (R, j) => Kn(j)
|
|
5995
5995
|
},
|
|
5996
|
-
handlePaste: (R, j) =>
|
|
5997
|
-
handleDrop: (R, j, se, Z) =>
|
|
5996
|
+
handlePaste: (R, j) => Zn(R, j, P),
|
|
5997
|
+
handleDrop: (R, j, se, Z) => qn(R, j, Z, P),
|
|
5998
5998
|
attributes: {
|
|
5999
5999
|
class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
|
|
6000
6000
|
}
|
|
@@ -6004,8 +6004,8 @@ const ci = ({ children: t, ...e }) => {
|
|
|
6004
6004
|
},
|
|
6005
6005
|
slotAfter: /* @__PURE__ */ s(os, {}),
|
|
6006
6006
|
children: [
|
|
6007
|
-
/* @__PURE__ */ A(
|
|
6008
|
-
/* @__PURE__ */ s(
|
|
6007
|
+
/* @__PURE__ */ A(Jn, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
|
|
6008
|
+
/* @__PURE__ */ s(Qn, { className: "px-2 text-muted-foreground", children: "没有结果" }),
|
|
6009
6009
|
/* @__PURE__ */ s(es, { children: Wo({
|
|
6010
6010
|
uploadFn: P
|
|
6011
6011
|
}).map((R) => /* @__PURE__ */ A(
|
|
@@ -6026,7 +6026,7 @@ const ci = ({ children: t, ...e }) => {
|
|
|
6026
6026
|
)) })
|
|
6027
6027
|
] }),
|
|
6028
6028
|
/* @__PURE__ */ A(
|
|
6029
|
-
|
|
6029
|
+
ri,
|
|
6030
6030
|
{
|
|
6031
6031
|
open: N,
|
|
6032
6032
|
onOpenChange: T,
|
|
@@ -6052,14 +6052,14 @@ const ci = ({ children: t, ...e }) => {
|
|
|
6052
6052
|
) })
|
|
6053
6053
|
] });
|
|
6054
6054
|
}, fi = ({ json: t }) => {
|
|
6055
|
-
const e =
|
|
6055
|
+
const e = re(() => $s(t ?? {}, $o), [t]);
|
|
6056
6056
|
return /* @__PURE__ */ s("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ s("div", { dangerouslySetInnerHTML: { __html: e } }) });
|
|
6057
6057
|
}, Yo = ui;
|
|
6058
6058
|
Yo.Preview = fi;
|
|
6059
6059
|
const gi = le.createContext(null);
|
|
6060
6060
|
function pi(t, e) {
|
|
6061
|
-
const o = Array.isArray(t) ? t[0] : t ? t.x : 0,
|
|
6062
|
-
return o ===
|
|
6061
|
+
const o = Array.isArray(t) ? t[0] : t ? t.x : 0, n = Array.isArray(t) ? t[1] : t ? t.y : 0, r = Array.isArray(e) ? e[0] : e ? e.x : 0, a = Array.isArray(e) ? e[1] : e ? e.y : 0;
|
|
6062
|
+
return o === r && n === a;
|
|
6063
6063
|
}
|
|
6064
6064
|
function xe(t, e) {
|
|
6065
6065
|
if (t === e)
|
|
@@ -6076,11 +6076,11 @@ function xe(t, e) {
|
|
|
6076
6076
|
} else if (Array.isArray(e))
|
|
6077
6077
|
return !1;
|
|
6078
6078
|
if (typeof t == "object" && typeof e == "object") {
|
|
6079
|
-
const o = Object.keys(t),
|
|
6080
|
-
if (o.length !==
|
|
6079
|
+
const o = Object.keys(t), n = Object.keys(e);
|
|
6080
|
+
if (o.length !== n.length)
|
|
6081
6081
|
return !1;
|
|
6082
|
-
for (const
|
|
6083
|
-
if (!e.hasOwnProperty(
|
|
6082
|
+
for (const r of o)
|
|
6083
|
+
if (!e.hasOwnProperty(r) || !xe(t[r], e[r]))
|
|
6084
6084
|
return !1;
|
|
6085
6085
|
return !0;
|
|
6086
6086
|
}
|
|
@@ -6097,12 +6097,12 @@ function $t(t) {
|
|
|
6097
6097
|
};
|
|
6098
6098
|
}
|
|
6099
6099
|
function _t(t, e) {
|
|
6100
|
-
const o = e.viewState || e,
|
|
6100
|
+
const o = e.viewState || e, n = {};
|
|
6101
6101
|
if ("longitude" in o && "latitude" in o && (o.longitude !== t.center.lng || o.latitude !== t.center.lat)) {
|
|
6102
|
-
const
|
|
6103
|
-
|
|
6102
|
+
const r = t.center.constructor;
|
|
6103
|
+
n.center = new r(o.longitude, o.latitude);
|
|
6104
6104
|
}
|
|
6105
|
-
return "zoom" in o && o.zoom !== t.zoom && (
|
|
6105
|
+
return "zoom" in o && o.zoom !== t.zoom && (n.zoom = o.zoom), "bearing" in o && o.bearing !== t.bearing && (n.bearing = o.bearing), "pitch" in o && o.pitch !== t.pitch && (n.pitch = o.pitch), o.padding && t.padding && !xe(o.padding, t.padding) && (n.padding = o.padding), n;
|
|
6106
6106
|
}
|
|
6107
6107
|
const mi = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
|
|
6108
6108
|
function Ot(t) {
|
|
@@ -6111,18 +6111,18 @@ function Ot(t) {
|
|
|
6111
6111
|
if (typeof t == "string" || ("toJS" in t && (t = t.toJS()), !t.layers))
|
|
6112
6112
|
return t;
|
|
6113
6113
|
const e = {};
|
|
6114
|
-
for (const
|
|
6115
|
-
e[
|
|
6116
|
-
const o = t.layers.map((
|
|
6117
|
-
let
|
|
6118
|
-
"interactive" in
|
|
6119
|
-
const a = e[
|
|
6114
|
+
for (const n of t.layers)
|
|
6115
|
+
e[n.id] = n;
|
|
6116
|
+
const o = t.layers.map((n) => {
|
|
6117
|
+
let r = null;
|
|
6118
|
+
"interactive" in n && (r = Object.assign({}, n), delete r.interactive);
|
|
6119
|
+
const a = e[n.ref];
|
|
6120
6120
|
if (a) {
|
|
6121
|
-
|
|
6121
|
+
r = r || Object.assign({}, n), delete r.ref;
|
|
6122
6122
|
for (const i of mi)
|
|
6123
|
-
i in a && (
|
|
6123
|
+
i in a && (r[i] = a[i]);
|
|
6124
6124
|
}
|
|
6125
|
-
return
|
|
6125
|
+
return r || n;
|
|
6126
6126
|
});
|
|
6127
6127
|
return { ...t, layers: o };
|
|
6128
6128
|
}
|
|
@@ -6190,21 +6190,21 @@ const Ft = { version: 8, sources: {}, layers: [] }, Ht = {
|
|
|
6190
6190
|
"touchPitch"
|
|
6191
6191
|
];
|
|
6192
6192
|
class Ye {
|
|
6193
|
-
constructor(e, o,
|
|
6194
|
-
this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (
|
|
6195
|
-
const a = this.props[Ut[
|
|
6196
|
-
a ? a(
|
|
6197
|
-
}, this._onCameraEvent = (
|
|
6193
|
+
constructor(e, o, n) {
|
|
6194
|
+
this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (r) => {
|
|
6195
|
+
const a = this.props[Ut[r.type]];
|
|
6196
|
+
a ? a(r) : r.type === "error" && console.error(r.error);
|
|
6197
|
+
}, this._onCameraEvent = (r) => {
|
|
6198
6198
|
if (this._internalUpdate)
|
|
6199
6199
|
return;
|
|
6200
|
-
|
|
6201
|
-
const a = this.props[jt[
|
|
6202
|
-
a && a(
|
|
6203
|
-
}, this._onCameraUpdate = (
|
|
6204
|
-
(
|
|
6205
|
-
const a = this.props[Ht[
|
|
6206
|
-
a && (this.props.interactiveLayerIds &&
|
|
6207
|
-
}, this._MapClass = e, this.props = o, this._initialize(
|
|
6200
|
+
r.viewState = this._propsedCameraUpdate || $t(this._map.transform);
|
|
6201
|
+
const a = this.props[jt[r.type]];
|
|
6202
|
+
a && a(r);
|
|
6203
|
+
}, this._onCameraUpdate = (r) => this._internalUpdate ? r : (this._propsedCameraUpdate = $t(r), _t(r, this.props)), this._onPointerEvent = (r) => {
|
|
6204
|
+
(r.type === "mousemove" || r.type === "mouseout") && this._updateHover(r);
|
|
6205
|
+
const a = this.props[Ht[r.type]];
|
|
6206
|
+
a && (this.props.interactiveLayerIds && r.type !== "mouseover" && r.type !== "mouseout" && (r.features = this._hoveredFeatures || this._queryRenderedFeatures(r.point)), a(r), delete r.features);
|
|
6207
|
+
}, this._MapClass = e, this.props = o, this._initialize(n);
|
|
6208
6208
|
}
|
|
6209
6209
|
get map() {
|
|
6210
6210
|
return this._map;
|
|
@@ -6212,31 +6212,31 @@ class Ye {
|
|
|
6212
6212
|
setProps(e) {
|
|
6213
6213
|
const o = this.props;
|
|
6214
6214
|
this.props = e;
|
|
6215
|
-
const
|
|
6216
|
-
this._updateStyle(e, o), this._updateStyleComponents(e), this._updateHandlers(e, o), (
|
|
6215
|
+
const n = this._updateSettings(e, o), r = this._updateSize(e), a = this._updateViewState(e);
|
|
6216
|
+
this._updateStyle(e, o), this._updateStyleComponents(e), this._updateHandlers(e, o), (n || r || a && !this._map.isMoving()) && this.redraw();
|
|
6217
6217
|
}
|
|
6218
6218
|
static reuse(e, o) {
|
|
6219
|
-
const
|
|
6220
|
-
if (!
|
|
6219
|
+
const n = Ye.savedMaps.pop();
|
|
6220
|
+
if (!n)
|
|
6221
6221
|
return null;
|
|
6222
|
-
const
|
|
6222
|
+
const r = n.map, a = r.getContainer();
|
|
6223
6223
|
for (o.className = a.className; a.childNodes.length > 0; )
|
|
6224
6224
|
o.appendChild(a.childNodes[0]);
|
|
6225
|
-
|
|
6226
|
-
const i =
|
|
6227
|
-
i && (i.disconnect(), i.observe(o)),
|
|
6225
|
+
r._container = o;
|
|
6226
|
+
const i = r._resizeObserver;
|
|
6227
|
+
i && (i.disconnect(), i.observe(o)), n.setProps({ ...e, styleDiffing: !1 }), r.resize();
|
|
6228
6228
|
const { initialViewState: l } = e;
|
|
6229
|
-
return l && (l.bounds ?
|
|
6229
|
+
return l && (l.bounds ? r.fitBounds(l.bounds, { ...l.fitBoundsOptions, duration: 0 }) : n._updateViewState(l)), r.isStyleLoaded() ? r.fire("load") : r.once("style.load", () => r.fire("load")), r._update(), n;
|
|
6230
6230
|
}
|
|
6231
6231
|
/* eslint-disable complexity,max-statements */
|
|
6232
6232
|
_initialize(e) {
|
|
6233
|
-
const { props: o } = this, { mapStyle:
|
|
6233
|
+
const { props: o } = this, { mapStyle: n = Ft } = o, r = {
|
|
6234
6234
|
...o,
|
|
6235
6235
|
...o.initialViewState,
|
|
6236
6236
|
container: e,
|
|
6237
|
-
style: Ot(
|
|
6238
|
-
}, a =
|
|
6239
|
-
if (Object.assign(
|
|
6237
|
+
style: Ot(n)
|
|
6238
|
+
}, a = r.initialViewState || r.viewState || r;
|
|
6239
|
+
if (Object.assign(r, {
|
|
6240
6240
|
center: [a.longitude || 0, a.latitude || 0],
|
|
6241
6241
|
zoom: a.zoom || 0,
|
|
6242
6242
|
pitch: a.pitch || 0,
|
|
@@ -6245,7 +6245,7 @@ class Ye {
|
|
|
6245
6245
|
const l = HTMLCanvasElement.prototype.getContext;
|
|
6246
6246
|
HTMLCanvasElement.prototype.getContext = () => (HTMLCanvasElement.prototype.getContext = l, o.gl);
|
|
6247
6247
|
}
|
|
6248
|
-
const i = new this._MapClass(
|
|
6248
|
+
const i = new this._MapClass(r);
|
|
6249
6249
|
a.padding && i.setPadding(a.padding), o.cursor && (i.getCanvas().style.cursor = o.cursor), i.transformCameraUpdate = this._onCameraUpdate, i.on("style.load", () => {
|
|
6250
6250
|
var l;
|
|
6251
6251
|
this._styleComponents = {
|
|
@@ -6288,9 +6288,9 @@ class Ye {
|
|
|
6288
6288
|
_updateSize(e) {
|
|
6289
6289
|
const { viewState: o } = e;
|
|
6290
6290
|
if (o) {
|
|
6291
|
-
const
|
|
6292
|
-
if (o.width !==
|
|
6293
|
-
return
|
|
6291
|
+
const n = this._map;
|
|
6292
|
+
if (o.width !== n.transform.width || o.height !== n.transform.height)
|
|
6293
|
+
return n.resize(), !0;
|
|
6294
6294
|
}
|
|
6295
6295
|
return !1;
|
|
6296
6296
|
}
|
|
@@ -6301,9 +6301,9 @@ class Ye {
|
|
|
6301
6301
|
@returns {bool} true if anything is changed
|
|
6302
6302
|
*/
|
|
6303
6303
|
_updateViewState(e) {
|
|
6304
|
-
const o = this._map,
|
|
6304
|
+
const o = this._map, n = o.transform;
|
|
6305
6305
|
if (!o.isMoving()) {
|
|
6306
|
-
const a = _t(
|
|
6306
|
+
const a = _t(n, e);
|
|
6307
6307
|
if (Object.keys(a).length > 0)
|
|
6308
6308
|
return this._internalUpdate = !0, o.jumpTo(a), this._internalUpdate = !1, !0;
|
|
6309
6309
|
}
|
|
@@ -6315,23 +6315,23 @@ class Ye {
|
|
|
6315
6315
|
@returns {bool} true if anything is changed
|
|
6316
6316
|
*/
|
|
6317
6317
|
_updateSettings(e, o) {
|
|
6318
|
-
const
|
|
6319
|
-
let
|
|
6318
|
+
const n = this._map;
|
|
6319
|
+
let r = !1;
|
|
6320
6320
|
for (const a of hi)
|
|
6321
6321
|
if (a in e && !xe(e[a], o[a])) {
|
|
6322
|
-
|
|
6323
|
-
const i =
|
|
6324
|
-
i == null || i.call(
|
|
6322
|
+
r = !0;
|
|
6323
|
+
const i = n[`set${a[0].toUpperCase()}${a.slice(1)}`];
|
|
6324
|
+
i == null || i.call(n, e[a]);
|
|
6325
6325
|
}
|
|
6326
|
-
return
|
|
6326
|
+
return r;
|
|
6327
6327
|
}
|
|
6328
6328
|
/* Update map style to match props */
|
|
6329
6329
|
_updateStyle(e, o) {
|
|
6330
6330
|
if (e.cursor !== o.cursor && (this._map.getCanvas().style.cursor = e.cursor || ""), e.mapStyle !== o.mapStyle) {
|
|
6331
|
-
const { mapStyle:
|
|
6332
|
-
diff:
|
|
6331
|
+
const { mapStyle: n = Ft, styleDiffing: r = !0 } = e, a = {
|
|
6332
|
+
diff: r
|
|
6333
6333
|
};
|
|
6334
|
-
"localIdeographFontFamily" in e && (a.localIdeographFontFamily = e.localIdeographFontFamily), this._map.setStyle(Ot(
|
|
6334
|
+
"localIdeographFontFamily" in e && (a.localIdeographFontFamily = e.localIdeographFontFamily), this._map.setStyle(Ot(n), a);
|
|
6335
6335
|
}
|
|
6336
6336
|
}
|
|
6337
6337
|
/* Update fog, light, projection and terrain to match props
|
|
@@ -6339,34 +6339,34 @@ class Ye {
|
|
|
6339
6339
|
* 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met
|
|
6340
6340
|
* 2. They can be overwritten by mapStyle
|
|
6341
6341
|
*/
|
|
6342
|
-
_updateStyleComponents({ light: e, projection: o, sky:
|
|
6342
|
+
_updateStyleComponents({ light: e, projection: o, sky: n, terrain: r }) {
|
|
6343
6343
|
var l, f;
|
|
6344
6344
|
const a = this._map, i = this._styleComponents;
|
|
6345
|
-
a.style._loaded && (e && !xe(e, i.light) && (i.light = e, a.setLight(e)), o && !xe(o, i.projection) && o !== ((l = i.projection) == null ? void 0 : l.type) && (i.projection = typeof o == "string" ? { type: o } : o, (f = a.setProjection) == null || f.call(a, i.projection)),
|
|
6345
|
+
a.style._loaded && (e && !xe(e, i.light) && (i.light = e, a.setLight(e)), o && !xe(o, i.projection) && o !== ((l = i.projection) == null ? void 0 : l.type) && (i.projection = typeof o == "string" ? { type: o } : o, (f = a.setProjection) == null || f.call(a, i.projection)), n && !xe(n, i.sky) && (i.sky = n, a.setSky(n)), r !== void 0 && !xe(r, i.terrain) && (!r || a.getSource(r.source)) && (i.terrain = r, a.setTerrain(r)));
|
|
6346
6346
|
}
|
|
6347
6347
|
/* Update interaction handlers to match props */
|
|
6348
6348
|
_updateHandlers(e, o) {
|
|
6349
|
-
const
|
|
6350
|
-
for (const
|
|
6351
|
-
const a = e[
|
|
6352
|
-
xe(a, i) || (a ? r
|
|
6349
|
+
const n = this._map;
|
|
6350
|
+
for (const r of bi) {
|
|
6351
|
+
const a = e[r] ?? !0, i = o[r] ?? !0;
|
|
6352
|
+
xe(a, i) || (a ? n[r].enable(a) : n[r].disable());
|
|
6353
6353
|
}
|
|
6354
6354
|
}
|
|
6355
6355
|
_queryRenderedFeatures(e) {
|
|
6356
|
-
const o = this._map, { interactiveLayerIds:
|
|
6356
|
+
const o = this._map, { interactiveLayerIds: n = [] } = this.props;
|
|
6357
6357
|
try {
|
|
6358
6358
|
return o.queryRenderedFeatures(e, {
|
|
6359
|
-
layers:
|
|
6359
|
+
layers: n.filter(o.getLayer.bind(o))
|
|
6360
6360
|
});
|
|
6361
6361
|
} catch {
|
|
6362
6362
|
return [];
|
|
6363
6363
|
}
|
|
6364
6364
|
}
|
|
6365
6365
|
_updateHover(e) {
|
|
6366
|
-
var
|
|
6366
|
+
var r;
|
|
6367
6367
|
const { props: o } = this;
|
|
6368
6368
|
if (o.interactiveLayerIds && (o.onMouseMove || o.onMouseEnter || o.onMouseLeave)) {
|
|
6369
|
-
const a = e.type, i = ((
|
|
6369
|
+
const a = e.type, i = ((r = this._hoveredFeatures) == null ? void 0 : r.length) > 0, l = this._queryRenderedFeatures(e.point), f = l.length > 0;
|
|
6370
6370
|
!f && i && (e.type = "mouseleave", this._onPointerEvent(e)), this._hoveredFeatures = l, f && !i && (e.type = "mouseenter", this._onPointerEvent(e)), e.type = a;
|
|
6371
6371
|
} else
|
|
6372
6372
|
this._hoveredFeatures = null;
|
|
@@ -6401,34 +6401,34 @@ function xi(t) {
|
|
|
6401
6401
|
const e = t.map, o = {
|
|
6402
6402
|
getMap: () => e
|
|
6403
6403
|
};
|
|
6404
|
-
for (const
|
|
6405
|
-
!(
|
|
6404
|
+
for (const n of vi(e))
|
|
6405
|
+
!(n in o) && !yi.includes(n) && (o[n] = e[n].bind(e));
|
|
6406
6406
|
return o;
|
|
6407
6407
|
}
|
|
6408
6408
|
function vi(t) {
|
|
6409
6409
|
const e = /* @__PURE__ */ new Set();
|
|
6410
6410
|
let o = t;
|
|
6411
6411
|
for (; o; ) {
|
|
6412
|
-
for (const
|
|
6413
|
-
|
|
6412
|
+
for (const n of Object.getOwnPropertyNames(o))
|
|
6413
|
+
n[0] !== "_" && typeof t[n] == "function" && n !== "fire" && n !== "setEventedParent" && e.add(n);
|
|
6414
6414
|
o = Object.getPrototypeOf(o);
|
|
6415
6415
|
}
|
|
6416
6416
|
return Array.from(e);
|
|
6417
6417
|
}
|
|
6418
|
-
const ki = typeof document < "u" ?
|
|
6418
|
+
const ki = typeof document < "u" ? tr : V;
|
|
6419
6419
|
function wi(t, e) {
|
|
6420
|
-
const { RTLTextPlugin: o, maxParallelImageRequests:
|
|
6420
|
+
const { RTLTextPlugin: o, maxParallelImageRequests: n, workerCount: r, workerUrl: a } = e;
|
|
6421
6421
|
if (o && t.getRTLTextPluginStatus && t.getRTLTextPluginStatus() === "unavailable") {
|
|
6422
6422
|
const { pluginUrl: i, lazy: l = !0 } = typeof o == "string" ? { pluginUrl: o } : o;
|
|
6423
6423
|
t.setRTLTextPlugin(i, (f) => {
|
|
6424
6424
|
f && console.error(f);
|
|
6425
6425
|
}, l);
|
|
6426
6426
|
}
|
|
6427
|
-
|
|
6427
|
+
n !== void 0 && t.setMaxParallelImageRequests(n), r !== void 0 && t.setWorkerCount(r), a !== void 0 && t.setWorkerUrl(a);
|
|
6428
6428
|
}
|
|
6429
6429
|
const Ve = le.createContext(null);
|
|
6430
6430
|
function Ci(t, e) {
|
|
6431
|
-
const o = De(gi), [
|
|
6431
|
+
const o = De(gi), [n, r] = B(null), a = ne(), { current: i } = ne({ mapLib: null, map: null });
|
|
6432
6432
|
V(() => {
|
|
6433
6433
|
const p = t.mapLib;
|
|
6434
6434
|
let d = !0, g;
|
|
@@ -6440,7 +6440,7 @@ function Ci(t, e) {
|
|
|
6440
6440
|
const c = "Map" in h ? h : h.default;
|
|
6441
6441
|
if (!c.Map)
|
|
6442
6442
|
throw new Error("Invalid mapLib");
|
|
6443
|
-
wi(c, t), t.reuseMaps && (g = Ye.reuse(t, a.current)), g || (g = new Ye(c.Map, t, a.current)), i.map = xi(g), i.mapLib = c,
|
|
6443
|
+
wi(c, t), t.reuseMaps && (g = Ye.reuse(t, a.current)), g || (g = new Ye(c.Map, t, a.current)), i.map = xi(g), i.mapLib = c, r(g), o == null || o.onMapMount(i.map, t.id);
|
|
6444
6444
|
}).catch((h) => {
|
|
6445
6445
|
const { onError: c } = t;
|
|
6446
6446
|
c ? c({
|
|
@@ -6453,9 +6453,9 @@ function Ci(t, e) {
|
|
|
6453
6453
|
d = !1, g && (o == null || o.onMapUnmount(t.id), t.reuseMaps ? g.recycle() : g.destroy());
|
|
6454
6454
|
};
|
|
6455
6455
|
}, []), ki(() => {
|
|
6456
|
-
|
|
6457
|
-
}), et(e, () => i.map, [
|
|
6458
|
-
const l =
|
|
6456
|
+
n && n.setProps(t);
|
|
6457
|
+
}), et(e, () => i.map, [n]);
|
|
6458
|
+
const l = re(() => ({
|
|
6459
6459
|
position: "relative",
|
|
6460
6460
|
width: "100%",
|
|
6461
6461
|
height: "100%",
|
|
@@ -6463,7 +6463,7 @@ function Ci(t, e) {
|
|
|
6463
6463
|
}), [t.style]), f = {
|
|
6464
6464
|
height: "100%"
|
|
6465
6465
|
};
|
|
6466
|
-
return le.createElement("div", { id: t.id, ref: a, style: l },
|
|
6466
|
+
return le.createElement("div", { id: t.id, ref: a, style: l }, n && le.createElement(
|
|
6467
6467
|
Ve.Provider,
|
|
6468
6468
|
{ value: i },
|
|
6469
6469
|
le.createElement("div", { "mapboxgl-children": "", style: f }, t.children)
|
|
@@ -6474,26 +6474,26 @@ function Re(t, e) {
|
|
|
6474
6474
|
if (!t || !e)
|
|
6475
6475
|
return;
|
|
6476
6476
|
const o = t.style;
|
|
6477
|
-
for (const
|
|
6478
|
-
const
|
|
6479
|
-
Number.isFinite(
|
|
6477
|
+
for (const n in e) {
|
|
6478
|
+
const r = e[n];
|
|
6479
|
+
Number.isFinite(r) && !Ni.test(n) ? o[n] = `${r}px` : o[n] = r;
|
|
6480
6480
|
}
|
|
6481
6481
|
}
|
|
6482
6482
|
function Xo(t, e) {
|
|
6483
6483
|
if (t === e)
|
|
6484
6484
|
return null;
|
|
6485
|
-
const o = Wt(t),
|
|
6486
|
-
for (const a of
|
|
6487
|
-
o.has(a) ||
|
|
6485
|
+
const o = Wt(t), n = Wt(e), r = [];
|
|
6486
|
+
for (const a of n)
|
|
6487
|
+
o.has(a) || r.push(a);
|
|
6488
6488
|
for (const a of o)
|
|
6489
|
-
|
|
6490
|
-
return
|
|
6489
|
+
n.has(a) || r.push(a);
|
|
6490
|
+
return r.length === 0 ? null : r;
|
|
6491
6491
|
}
|
|
6492
6492
|
function Wt(t) {
|
|
6493
6493
|
return new Set(t ? t.trim().split(/\s+/) : []);
|
|
6494
6494
|
}
|
|
6495
6495
|
const yt = Ae(Xe((t, e) => {
|
|
6496
|
-
const { map: o, mapLib:
|
|
6496
|
+
const { map: o, mapLib: n } = De(Ve), r = ne({ props: t }), a = re(() => {
|
|
6497
6497
|
let y = !1;
|
|
6498
6498
|
le.Children.forEach(t.children, (v) => {
|
|
6499
6499
|
v && (y = !0);
|
|
@@ -6501,10 +6501,10 @@ const yt = Ae(Xe((t, e) => {
|
|
|
6501
6501
|
const M = {
|
|
6502
6502
|
...t,
|
|
6503
6503
|
element: y ? document.createElement("div") : void 0
|
|
6504
|
-
}, k = new
|
|
6504
|
+
}, k = new n.Marker(M);
|
|
6505
6505
|
return k.setLngLat([t.longitude, t.latitude]), k.getElement().addEventListener("click", (v) => {
|
|
6506
6506
|
var b, x;
|
|
6507
|
-
(x = (b =
|
|
6507
|
+
(x = (b = r.current.props).onClick) == null || x.call(b, {
|
|
6508
6508
|
type: "click",
|
|
6509
6509
|
target: k,
|
|
6510
6510
|
originalEvent: v
|
|
@@ -6512,15 +6512,15 @@ const yt = Ae(Xe((t, e) => {
|
|
|
6512
6512
|
}), k.on("dragstart", (v) => {
|
|
6513
6513
|
var x, D;
|
|
6514
6514
|
const b = v;
|
|
6515
|
-
b.lngLat = a.getLngLat(), (D = (x =
|
|
6515
|
+
b.lngLat = a.getLngLat(), (D = (x = r.current.props).onDragStart) == null || D.call(x, b);
|
|
6516
6516
|
}), k.on("drag", (v) => {
|
|
6517
6517
|
var x, D;
|
|
6518
6518
|
const b = v;
|
|
6519
|
-
b.lngLat = a.getLngLat(), (D = (x =
|
|
6519
|
+
b.lngLat = a.getLngLat(), (D = (x = r.current.props).onDrag) == null || D.call(x, b);
|
|
6520
6520
|
}), k.on("dragend", (v) => {
|
|
6521
6521
|
var x, D;
|
|
6522
6522
|
const b = v;
|
|
6523
|
-
b.lngLat = a.getLngLat(), (D = (x =
|
|
6523
|
+
b.lngLat = a.getLngLat(), (D = (x = r.current.props).onDragEnd) == null || D.call(x, b);
|
|
6524
6524
|
}), k;
|
|
6525
6525
|
}, []);
|
|
6526
6526
|
V(() => (a.addTo(o.getMap()), () => {
|
|
@@ -6530,17 +6530,17 @@ const yt = Ae(Xe((t, e) => {
|
|
|
6530
6530
|
V(() => {
|
|
6531
6531
|
Re(a.getElement(), p);
|
|
6532
6532
|
}, [p]), et(e, () => a, []);
|
|
6533
|
-
const w =
|
|
6533
|
+
const w = r.current.props;
|
|
6534
6534
|
(a.getLngLat().lng !== i || a.getLngLat().lat !== l) && a.setLngLat([i, l]), f && !pi(a.getOffset(), f) && a.setOffset(f), a.isDraggable() !== d && a.setDraggable(d), a.getRotation() !== h && a.setRotation(h), a.getRotationAlignment() !== c && a.setRotationAlignment(c), a.getPitchAlignment() !== u && a.setPitchAlignment(u), a.getPopup() !== g && a.setPopup(g);
|
|
6535
6535
|
const z = Xo(w.className, t.className);
|
|
6536
6536
|
if (z)
|
|
6537
6537
|
for (const y of z)
|
|
6538
6538
|
a.toggleClassName(y);
|
|
6539
|
-
return
|
|
6539
|
+
return r.current.props = t, co(t.children, a.getElement());
|
|
6540
6540
|
}));
|
|
6541
6541
|
Ae(Xe((t, e) => {
|
|
6542
|
-
const { map: o, mapLib:
|
|
6543
|
-
const l = { ...t }, f = new
|
|
6542
|
+
const { map: o, mapLib: n } = De(Ve), r = re(() => document.createElement("div"), []), a = ne({ props: t }), i = re(() => {
|
|
6543
|
+
const l = { ...t }, f = new n.Popup(l);
|
|
6544
6544
|
return f.setLngLat([t.longitude, t.latitude]), f.once("open", (p) => {
|
|
6545
6545
|
var d, g;
|
|
6546
6546
|
(g = (d = a.current.props).onOpen) == null || g.call(d, p);
|
|
@@ -6551,7 +6551,7 @@ Ae(Xe((t, e) => {
|
|
|
6551
6551
|
var p, d;
|
|
6552
6552
|
(d = (p = a.current.props).onClose) == null || d.call(p, f);
|
|
6553
6553
|
};
|
|
6554
|
-
return i.on("close", l), i.setDOMContent(
|
|
6554
|
+
return i.on("close", l), i.setDOMContent(r).addTo(o.getMap()), () => {
|
|
6555
6555
|
i.off("close", l), i.isOpen() && i.remove();
|
|
6556
6556
|
};
|
|
6557
6557
|
}, []), V(() => {
|
|
@@ -6565,14 +6565,14 @@ Ae(Xe((t, e) => {
|
|
|
6565
6565
|
i.toggleClassName(p);
|
|
6566
6566
|
a.current.props = t;
|
|
6567
6567
|
}
|
|
6568
|
-
return co(t.children,
|
|
6568
|
+
return co(t.children, r);
|
|
6569
6569
|
}));
|
|
6570
|
-
function Fe(t, e, o,
|
|
6571
|
-
const
|
|
6570
|
+
function Fe(t, e, o, n) {
|
|
6571
|
+
const r = De(Ve), a = re(() => t(r), []);
|
|
6572
6572
|
return V(() => {
|
|
6573
|
-
const i = e, l = null, f = typeof e == "function" ? e : null, { map: p } =
|
|
6574
|
-
return p.hasControl(a) || (p.addControl(a, i == null ? void 0 : i.position), l && l(
|
|
6575
|
-
f && f(
|
|
6573
|
+
const i = e, l = null, f = typeof e == "function" ? e : null, { map: p } = r;
|
|
6574
|
+
return p.hasControl(a) || (p.addControl(a, i == null ? void 0 : i.position), l && l(r)), () => {
|
|
6575
|
+
f && f(r), p.hasControl(a) && p.removeControl(a);
|
|
6576
6576
|
};
|
|
6577
6577
|
}, []), a;
|
|
6578
6578
|
}
|
|
@@ -6595,8 +6595,8 @@ function Mi(t) {
|
|
|
6595
6595
|
}
|
|
6596
6596
|
Ae(Mi);
|
|
6597
6597
|
function Si(t, e) {
|
|
6598
|
-
const o =
|
|
6599
|
-
const a = new
|
|
6598
|
+
const o = ne({ props: t }), n = Fe(({ mapLib: r }) => {
|
|
6599
|
+
const a = new r.GeolocateControl(t), i = a._setupUI;
|
|
6600
6600
|
return a._setupUI = () => {
|
|
6601
6601
|
a._container.hasChildNodes() || i();
|
|
6602
6602
|
}, a.on("geolocate", (l) => {
|
|
@@ -6616,8 +6616,8 @@ function Si(t, e) {
|
|
|
6616
6616
|
(p = (f = o.current.props).onTrackUserLocationEnd) == null || p.call(f, l);
|
|
6617
6617
|
}), a;
|
|
6618
6618
|
}, { position: t.position });
|
|
6619
|
-
return o.current.props = t, et(e, () =>
|
|
6620
|
-
Re(
|
|
6619
|
+
return o.current.props = t, et(e, () => n, []), V(() => {
|
|
6620
|
+
Re(n._container, t.style);
|
|
6621
6621
|
}, [t.style]), null;
|
|
6622
6622
|
}
|
|
6623
6623
|
Ae(Xe(Si));
|
|
@@ -6633,12 +6633,12 @@ Ae(Li);
|
|
|
6633
6633
|
function Di(t) {
|
|
6634
6634
|
const e = Fe(({ mapLib: a }) => new a.ScaleControl(t), {
|
|
6635
6635
|
position: t.position
|
|
6636
|
-
}), o =
|
|
6636
|
+
}), o = ne(t), n = o.current;
|
|
6637
6637
|
o.current = t;
|
|
6638
|
-
const { style:
|
|
6639
|
-
return t.maxWidth !== void 0 && t.maxWidth !==
|
|
6640
|
-
Re(e._container,
|
|
6641
|
-
}, [
|
|
6638
|
+
const { style: r } = t;
|
|
6639
|
+
return t.maxWidth !== void 0 && t.maxWidth !== n.maxWidth && (e.options.maxWidth = t.maxWidth), t.unit !== void 0 && t.unit !== n.unit && e.setUnit(t.unit), V(() => {
|
|
6640
|
+
Re(e._container, r);
|
|
6641
|
+
}, [r]), null;
|
|
6642
6642
|
}
|
|
6643
6643
|
Ae(Di);
|
|
6644
6644
|
function Ai(t) {
|
|
@@ -6664,18 +6664,18 @@ function ut(t, e) {
|
|
|
6664
6664
|
let Ri = 0;
|
|
6665
6665
|
function Ti(t, e, o) {
|
|
6666
6666
|
if (t.style && t.style._loaded) {
|
|
6667
|
-
const
|
|
6668
|
-
return delete
|
|
6667
|
+
const n = { ...o };
|
|
6668
|
+
return delete n.id, delete n.children, t.addSource(e, n), t.getSource(e);
|
|
6669
6669
|
}
|
|
6670
6670
|
return null;
|
|
6671
6671
|
}
|
|
6672
6672
|
function Pi(t, e, o) {
|
|
6673
6673
|
var i, l, f;
|
|
6674
6674
|
ut(e.id === o.id, "source id changed"), ut(e.type === o.type, "source type changed");
|
|
6675
|
-
let
|
|
6675
|
+
let n = "", r = 0;
|
|
6676
6676
|
for (const p in e)
|
|
6677
|
-
p !== "children" && p !== "id" && !xe(o[p], e[p]) && (
|
|
6678
|
-
if (!
|
|
6677
|
+
p !== "children" && p !== "id" && !xe(o[p], e[p]) && (n = p, r++);
|
|
6678
|
+
if (!r)
|
|
6679
6679
|
return;
|
|
6680
6680
|
const a = e.type;
|
|
6681
6681
|
if (a === "geojson")
|
|
@@ -6686,7 +6686,7 @@ function Pi(t, e, o) {
|
|
|
6686
6686
|
coordinates: e.coordinates
|
|
6687
6687
|
});
|
|
6688
6688
|
else
|
|
6689
|
-
switch (
|
|
6689
|
+
switch (n) {
|
|
6690
6690
|
case "coordinates":
|
|
6691
6691
|
(i = t.setCoordinates) == null || i.call(t, e.coordinates);
|
|
6692
6692
|
break;
|
|
@@ -6697,75 +6697,75 @@ function Pi(t, e, o) {
|
|
|
6697
6697
|
(f = t.setTiles) == null || f.call(t, e.tiles);
|
|
6698
6698
|
break;
|
|
6699
6699
|
default:
|
|
6700
|
-
console.warn(`Unable to update <Source> prop: ${
|
|
6700
|
+
console.warn(`Unable to update <Source> prop: ${n}`);
|
|
6701
6701
|
}
|
|
6702
6702
|
}
|
|
6703
6703
|
function xt(t) {
|
|
6704
|
-
const e = De(Ve).map.getMap(), o =
|
|
6704
|
+
const e = De(Ve).map.getMap(), o = ne(t), [, n] = B(0), r = re(() => t.id || `jsx-source-${Ri++}`, []);
|
|
6705
6705
|
V(() => {
|
|
6706
6706
|
if (e) {
|
|
6707
|
-
const i = () => setTimeout(() =>
|
|
6707
|
+
const i = () => setTimeout(() => n((l) => l + 1), 0);
|
|
6708
6708
|
return e.on("styledata", i), i(), () => {
|
|
6709
6709
|
var l;
|
|
6710
|
-
if (e.off("styledata", i), e.style && e.style._loaded && e.getSource(
|
|
6710
|
+
if (e.off("styledata", i), e.style && e.style._loaded && e.getSource(r)) {
|
|
6711
6711
|
const f = (l = e.getStyle()) == null ? void 0 : l.layers;
|
|
6712
6712
|
if (f)
|
|
6713
6713
|
for (const p of f)
|
|
6714
|
-
p.source ===
|
|
6715
|
-
e.removeSource(
|
|
6714
|
+
p.source === r && e.removeLayer(p.id);
|
|
6715
|
+
e.removeSource(r);
|
|
6716
6716
|
}
|
|
6717
6717
|
};
|
|
6718
6718
|
}
|
|
6719
6719
|
}, [e]);
|
|
6720
|
-
let a = e && e.style && e.getSource(
|
|
6721
|
-
return a ? Pi(a, t, o.current) : a = Ti(e,
|
|
6722
|
-
source:
|
|
6720
|
+
let a = e && e.style && e.getSource(r);
|
|
6721
|
+
return a ? Pi(a, t, o.current) : a = Ti(e, r, t), o.current = t, a && le.Children.map(t.children, (i) => i && or(i, {
|
|
6722
|
+
source: r
|
|
6723
6723
|
})) || null;
|
|
6724
6724
|
}
|
|
6725
|
-
function Bi(t, e, o,
|
|
6726
|
-
if (ut(o.id ===
|
|
6725
|
+
function Bi(t, e, o, n) {
|
|
6726
|
+
if (ut(o.id === n.id, "layer id changed"), ut(o.type === n.type, "layer type changed"), o.type === "custom" || n.type === "custom")
|
|
6727
6727
|
return;
|
|
6728
|
-
const { layout:
|
|
6729
|
-
if (p !==
|
|
6730
|
-
const d =
|
|
6731
|
-
for (const g in
|
|
6732
|
-
xe(
|
|
6728
|
+
const { layout: r = {}, paint: a = {}, filter: i, minzoom: l, maxzoom: f, beforeId: p } = o;
|
|
6729
|
+
if (p !== n.beforeId && t.moveLayer(e, p), r !== n.layout) {
|
|
6730
|
+
const d = n.layout || {};
|
|
6731
|
+
for (const g in r)
|
|
6732
|
+
xe(r[g], d[g]) || t.setLayoutProperty(e, g, r[g]);
|
|
6733
6733
|
for (const g in d)
|
|
6734
|
-
|
|
6734
|
+
r.hasOwnProperty(g) || t.setLayoutProperty(e, g, void 0);
|
|
6735
6735
|
}
|
|
6736
|
-
if (a !==
|
|
6737
|
-
const d =
|
|
6736
|
+
if (a !== n.paint) {
|
|
6737
|
+
const d = n.paint || {};
|
|
6738
6738
|
for (const g in a)
|
|
6739
6739
|
xe(a[g], d[g]) || t.setPaintProperty(e, g, a[g]);
|
|
6740
6740
|
for (const g in d)
|
|
6741
6741
|
a.hasOwnProperty(g) || t.setPaintProperty(e, g, void 0);
|
|
6742
6742
|
}
|
|
6743
|
-
xe(i,
|
|
6743
|
+
xe(i, n.filter) || t.setFilter(e, i), (l !== n.minzoom || f !== n.maxzoom) && t.setLayerZoomRange(e, l, f);
|
|
6744
6744
|
}
|
|
6745
6745
|
function $i(t, e, o) {
|
|
6746
6746
|
if (t.style && t.style._loaded && (!("source" in o) || t.getSource(o.source))) {
|
|
6747
|
-
const
|
|
6748
|
-
delete
|
|
6747
|
+
const n = { ...o, id: e };
|
|
6748
|
+
delete n.beforeId, t.addLayer(n, o.beforeId);
|
|
6749
6749
|
}
|
|
6750
6750
|
}
|
|
6751
6751
|
let _i = 0;
|
|
6752
6752
|
function je(t) {
|
|
6753
|
-
const e = De(Ve).map.getMap(), o =
|
|
6753
|
+
const e = De(Ve).map.getMap(), o = ne(t), [, n] = B(0), r = re(() => t.id || `jsx-layer-${_i++}`, []);
|
|
6754
6754
|
if (V(() => {
|
|
6755
6755
|
if (e) {
|
|
6756
|
-
const i = () =>
|
|
6756
|
+
const i = () => n((l) => l + 1);
|
|
6757
6757
|
return e.on("styledata", i), i(), () => {
|
|
6758
|
-
e.off("styledata", i), e.style && e.style._loaded && e.getLayer(
|
|
6758
|
+
e.off("styledata", i), e.style && e.style._loaded && e.getLayer(r) && e.removeLayer(r);
|
|
6759
6759
|
};
|
|
6760
6760
|
}
|
|
6761
|
-
}, [e]), e && e.style && e.getLayer(
|
|
6761
|
+
}, [e]), e && e.style && e.getLayer(r))
|
|
6762
6762
|
try {
|
|
6763
|
-
Bi(e,
|
|
6763
|
+
Bi(e, r, t, o.current);
|
|
6764
6764
|
} catch (i) {
|
|
6765
6765
|
console.warn(i);
|
|
6766
6766
|
}
|
|
6767
6767
|
else
|
|
6768
|
-
$i(e,
|
|
6768
|
+
$i(e, r, t);
|
|
6769
6769
|
return o.current = t, null;
|
|
6770
6770
|
}
|
|
6771
6771
|
const Oi = (t) => {
|
|
@@ -6773,11 +6773,11 @@ const Oi = (t) => {
|
|
|
6773
6773
|
return t.bbox;
|
|
6774
6774
|
if (!t.geometry) return null;
|
|
6775
6775
|
try {
|
|
6776
|
-
let e = 180, o = 90,
|
|
6776
|
+
let e = 180, o = 90, n = -180, r = -90;
|
|
6777
6777
|
const a = (l) => {
|
|
6778
6778
|
if (l.length >= 2) {
|
|
6779
6779
|
const [f, p] = l;
|
|
6780
|
-
e = Math.min(e, f), o = Math.min(o, p),
|
|
6780
|
+
e = Math.min(e, f), o = Math.min(o, p), n = Math.max(n, f), r = Math.max(r, p);
|
|
6781
6781
|
}
|
|
6782
6782
|
}, i = (l) => {
|
|
6783
6783
|
Array.isArray(l) && (typeof l[0] == "number" ? a(l) : l.forEach((f) => i(f)));
|
|
@@ -6801,17 +6801,17 @@ const Oi = (t) => {
|
|
|
6801
6801
|
});
|
|
6802
6802
|
break;
|
|
6803
6803
|
}
|
|
6804
|
-
if (e <=
|
|
6805
|
-
return [e, o,
|
|
6804
|
+
if (e <= n && o <= r && e !== 180 && o !== 90 && n !== -180 && r !== -90)
|
|
6805
|
+
return [e, o, n, r];
|
|
6806
6806
|
} catch (e) {
|
|
6807
6807
|
console.warn("计算边界框失败:", e);
|
|
6808
6808
|
}
|
|
6809
6809
|
return null;
|
|
6810
6810
|
}, Fi = (t, e, o) => {
|
|
6811
6811
|
if (!t || !e) return [];
|
|
6812
|
-
const
|
|
6812
|
+
const n = t.getBounds(), r = n.getWest(), a = n.getEast(), i = n.getSouth(), l = n.getNorth(), f = Math.abs(a - r), p = Math.abs(l - i);
|
|
6813
6813
|
if (console.log("视图边界:", {
|
|
6814
|
-
west:
|
|
6814
|
+
west: r,
|
|
6815
6815
|
east: a,
|
|
6816
6816
|
south: i,
|
|
6817
6817
|
north: l,
|
|
@@ -6833,17 +6833,17 @@ const Oi = (t) => {
|
|
|
6833
6833
|
}
|
|
6834
6834
|
if (!w) return;
|
|
6835
6835
|
const [z, y, M, k] = w;
|
|
6836
|
-
!(M <
|
|
6836
|
+
!(M < r || // 省份完全在视图左侧
|
|
6837
6837
|
z > a || // 省份完全在视图右侧
|
|
6838
6838
|
k < i || // 省份完全在视图下方
|
|
6839
6839
|
y > l) && d.push(u);
|
|
6840
6840
|
}), d.length < 3 && (console.log("找到的相交区域太少,尝试其他检查方法..."), o.forEach((h) => {
|
|
6841
6841
|
if (d.some((z) => z.code === h.code)) return;
|
|
6842
6842
|
const { longitude: u, latitude: w } = h;
|
|
6843
|
-
u >=
|
|
6843
|
+
u >= r && u <= a && w >= i && w <= l && d.push(h);
|
|
6844
6844
|
}), d.length < 3 && (f > 10 || p > 10))) {
|
|
6845
6845
|
console.log("扩大检查范围...");
|
|
6846
|
-
const h =
|
|
6846
|
+
const h = r - 2, c = a + 2, u = i - 2, w = l + 2;
|
|
6847
6847
|
o.forEach((z) => {
|
|
6848
6848
|
if (d.some(
|
|
6849
6849
|
(v) => v.code === z.code
|
|
@@ -6872,8 +6872,8 @@ const Oi = (t) => {
|
|
|
6872
6872
|
initialZoom: t = 3,
|
|
6873
6873
|
initialLongitude: e = 108,
|
|
6874
6874
|
initialLatitude: o = 35,
|
|
6875
|
-
className:
|
|
6876
|
-
zoomLevels:
|
|
6875
|
+
className: n = "",
|
|
6876
|
+
zoomLevels: r = Hi,
|
|
6877
6877
|
mapStyle: a,
|
|
6878
6878
|
style: i,
|
|
6879
6879
|
onVisibleAreasChanged: l,
|
|
@@ -6882,10 +6882,10 @@ const Oi = (t) => {
|
|
|
6882
6882
|
fetchGeoData: d,
|
|
6883
6883
|
children: g
|
|
6884
6884
|
}) => {
|
|
6885
|
-
const h =
|
|
6885
|
+
const h = ne(null), [c, u] = B(Gt), [w, z] = B(null), [y, M] = B(t), [k, v] = B([]), b = ne({}), [x, D] = B({}), [N, T] = B({}), [$, q] = B(!1), [P, _] = B([]), [R, j] = B({}), [se, Z] = B({}), [U, te] = B(!1), [ce, fe] = B([]), ae = re(
|
|
6886
6886
|
() => d || ji,
|
|
6887
6887
|
[d]
|
|
6888
|
-
), { run: ie } =
|
|
6888
|
+
), { run: ie } = ar(
|
|
6889
6889
|
(m) => ae(m),
|
|
6890
6890
|
{
|
|
6891
6891
|
manual: !0,
|
|
@@ -6902,7 +6902,7 @@ const Oi = (t) => {
|
|
|
6902
6902
|
const C = [];
|
|
6903
6903
|
let I = 0, Y = 0;
|
|
6904
6904
|
return m.features.forEach((L) => {
|
|
6905
|
-
var
|
|
6905
|
+
var G;
|
|
6906
6906
|
if (L.properties)
|
|
6907
6907
|
try {
|
|
6908
6908
|
let O = L.properties.centroid || null;
|
|
@@ -6918,7 +6918,7 @@ const Oi = (t) => {
|
|
|
6918
6918
|
} catch (O) {
|
|
6919
6919
|
Y++, console.error(
|
|
6920
6920
|
"Error processing centroid data for feature:",
|
|
6921
|
-
((
|
|
6921
|
+
((G = L.properties) == null ? void 0 : G.name) || "unknown",
|
|
6922
6922
|
O
|
|
6923
6923
|
);
|
|
6924
6924
|
}
|
|
@@ -6939,29 +6939,29 @@ const Oi = (t) => {
|
|
|
6939
6939
|
if (I.length === 0)
|
|
6940
6940
|
return;
|
|
6941
6941
|
console.debug(`开始加载${I.length}个省的市级数据`), _((L) => {
|
|
6942
|
-
const
|
|
6943
|
-
return [.../* @__PURE__ */ new Set([...L, ...
|
|
6942
|
+
const G = I.map((O) => O.code);
|
|
6943
|
+
return [.../* @__PURE__ */ new Set([...L, ...G])];
|
|
6944
6944
|
});
|
|
6945
6945
|
const Y = I.map(
|
|
6946
|
-
(L) => ae(L.code).then((
|
|
6946
|
+
(L) => ae(L.code).then((G) => {
|
|
6947
6947
|
D((me) => ({
|
|
6948
6948
|
...me,
|
|
6949
|
-
[L.code]:
|
|
6949
|
+
[L.code]: G
|
|
6950
6950
|
}));
|
|
6951
|
-
const O = K(
|
|
6951
|
+
const O = K(G);
|
|
6952
6952
|
return T((me) => ({
|
|
6953
6953
|
...me,
|
|
6954
6954
|
[L.code]: O
|
|
6955
|
-
})), { code: L.code, data:
|
|
6956
|
-
}).catch((
|
|
6955
|
+
})), { code: L.code, data: G };
|
|
6956
|
+
}).catch((G) => (console.error(
|
|
6957
6957
|
`Failed to load cities data for province ${L.name}:`,
|
|
6958
|
-
|
|
6958
|
+
G
|
|
6959
6959
|
), null))
|
|
6960
6960
|
);
|
|
6961
6961
|
Promise.all(Y).then((L) => {
|
|
6962
|
-
const
|
|
6962
|
+
const G = L.filter(Boolean).map((O) => (O == null ? void 0 : O.code) || "");
|
|
6963
6963
|
_(
|
|
6964
|
-
(O) => O.filter((me) => !
|
|
6964
|
+
(O) => O.filter((me) => !G.includes(me))
|
|
6965
6965
|
);
|
|
6966
6966
|
});
|
|
6967
6967
|
},
|
|
@@ -6985,34 +6985,34 @@ const Oi = (t) => {
|
|
|
6985
6985
|
if (I.length === 0)
|
|
6986
6986
|
return;
|
|
6987
6987
|
console.debug(`开始加载${I.length}个城市的区级数据`), fe((L) => {
|
|
6988
|
-
const
|
|
6989
|
-
return [.../* @__PURE__ */ new Set([...L, ...
|
|
6988
|
+
const G = I.map((O) => O.code);
|
|
6989
|
+
return [.../* @__PURE__ */ new Set([...L, ...G])];
|
|
6990
6990
|
});
|
|
6991
6991
|
const Y = I.map(
|
|
6992
|
-
(L) => ae(L.code).then((
|
|
6992
|
+
(L) => ae(L.code).then((G) => {
|
|
6993
6993
|
j((me) => ({
|
|
6994
6994
|
...me,
|
|
6995
|
-
[L.code]:
|
|
6995
|
+
[L.code]: G
|
|
6996
6996
|
}));
|
|
6997
|
-
const O = K(
|
|
6997
|
+
const O = K(G);
|
|
6998
6998
|
return Z((me) => ({
|
|
6999
6999
|
...me,
|
|
7000
7000
|
[L.code]: O
|
|
7001
|
-
})), { code: L.code, data:
|
|
7002
|
-
}).catch((
|
|
7001
|
+
})), { code: L.code, data: G };
|
|
7002
|
+
}).catch((G) => (console.error(
|
|
7003
7003
|
`Failed to load districts data for city ${L.name}:`,
|
|
7004
|
-
|
|
7004
|
+
G
|
|
7005
7005
|
), null))
|
|
7006
7006
|
);
|
|
7007
7007
|
Promise.all(Y).then((L) => {
|
|
7008
|
-
const
|
|
7008
|
+
const G = L.filter(Boolean).map((O) => (O == null ? void 0 : O.code) || "");
|
|
7009
7009
|
fe(
|
|
7010
|
-
(O) => O.filter((me) => !
|
|
7010
|
+
(O) => O.filter((me) => !G.includes(me))
|
|
7011
7011
|
);
|
|
7012
7012
|
});
|
|
7013
7013
|
},
|
|
7014
7014
|
[ce, R, K, ae]
|
|
7015
|
-
), Q =
|
|
7015
|
+
), Q = re(() => $ ? Object.values(N).flat() : [], [N, $]), he = re(() => U ? Object.values(se).flat() : [], [se, U]), ge = ue(() => {
|
|
7016
7016
|
if (!h.current || !w)
|
|
7017
7017
|
return;
|
|
7018
7018
|
const m = h.current.getBounds(), C = {
|
|
@@ -7036,8 +7036,8 @@ const Oi = (t) => {
|
|
|
7036
7036
|
q(!0), te(!0), de(I);
|
|
7037
7037
|
const Y = Object.values(N).flat().filter(
|
|
7038
7038
|
(L) => {
|
|
7039
|
-
var
|
|
7040
|
-
return (
|
|
7039
|
+
var G;
|
|
7040
|
+
return (G = h.current) == null ? void 0 : G.getBounds().contains([L.longitude, L.latitude]);
|
|
7041
7041
|
}
|
|
7042
7042
|
);
|
|
7043
7043
|
Y.length > 0 && (console.debug(`加载${Y.length}个城市的区级数据`), be(Y));
|
|
@@ -7073,47 +7073,47 @@ const Oi = (t) => {
|
|
|
7073
7073
|
(m) => {
|
|
7074
7074
|
const C = m.viewState.zoom, I = b.current.zoom || y, Y = Math.abs(C - I) >= 5e-3;
|
|
7075
7075
|
if (h.current) {
|
|
7076
|
-
const L = h.current.getBounds(),
|
|
7076
|
+
const L = h.current.getBounds(), G = {
|
|
7077
7077
|
north: L.getNorth(),
|
|
7078
7078
|
south: L.getSouth(),
|
|
7079
7079
|
east: L.getEast(),
|
|
7080
7080
|
west: L.getWest()
|
|
7081
|
-
}, O = !b.current.bounds || Math.abs(b.current.bounds.north -
|
|
7081
|
+
}, O = !b.current.bounds || Math.abs(b.current.bounds.north - G.north) >= 1e-3 || Math.abs(b.current.bounds.south - G.south) >= 1e-3 || Math.abs(b.current.bounds.east - G.east) >= 1e-3 || Math.abs(b.current.bounds.west - G.west) >= 1e-3;
|
|
7082
7082
|
if (Y) {
|
|
7083
7083
|
M(C), b.current.zoom = C;
|
|
7084
7084
|
let me = 6;
|
|
7085
|
-
for (const [Vo, qo] of Object.entries(
|
|
7085
|
+
for (const [Vo, qo] of Object.entries(r))
|
|
7086
7086
|
C >= qo && (me = parseInt(Vo, 10));
|
|
7087
7087
|
c.length !== me && u(Gt);
|
|
7088
7088
|
}
|
|
7089
7089
|
(O || Y) && ge();
|
|
7090
7090
|
}
|
|
7091
7091
|
},
|
|
7092
|
-
[c,
|
|
7092
|
+
[c, r, y, ge]
|
|
7093
7093
|
), ze = ue(() => {
|
|
7094
7094
|
k.length > 0 && h.current && ge();
|
|
7095
|
-
}, [k, ge]), H =
|
|
7095
|
+
}, [k, ge]), H = re(
|
|
7096
7096
|
() => ({
|
|
7097
7097
|
"fill-color": "#e2e8f0",
|
|
7098
7098
|
"fill-opacity": 0.6,
|
|
7099
7099
|
"fill-outline-color": "#94a3b8"
|
|
7100
7100
|
}),
|
|
7101
7101
|
[]
|
|
7102
|
-
), J =
|
|
7102
|
+
), J = re(
|
|
7103
7103
|
() => ({
|
|
7104
7104
|
"line-color": "#64748b",
|
|
7105
7105
|
"line-width": 1.5,
|
|
7106
7106
|
"line-opacity": 0.9
|
|
7107
7107
|
}),
|
|
7108
7108
|
[]
|
|
7109
|
-
),
|
|
7109
|
+
), W = re(
|
|
7110
7110
|
() => ({
|
|
7111
7111
|
"line-color": "#64748b",
|
|
7112
7112
|
"line-width": 1.2,
|
|
7113
7113
|
"line-opacity": 0.8
|
|
7114
7114
|
}),
|
|
7115
7115
|
[]
|
|
7116
|
-
), F =
|
|
7116
|
+
), F = re(() => w && /* @__PURE__ */ A(xt, { id: "geojson-data", type: "geojson", data: w, children: [
|
|
7117
7117
|
/* @__PURE__ */ s(je, { id: "geojson-layer", type: "fill", paint: H }),
|
|
7118
7118
|
($ || U) && /* @__PURE__ */ s(
|
|
7119
7119
|
je,
|
|
@@ -7129,7 +7129,7 @@ const Oi = (t) => {
|
|
|
7129
7129
|
J,
|
|
7130
7130
|
$,
|
|
7131
7131
|
U
|
|
7132
|
-
]), oe =
|
|
7132
|
+
]), oe = re(() => $ ? Object.entries(x).map(([m, C]) => /* @__PURE__ */ A(
|
|
7133
7133
|
xt,
|
|
7134
7134
|
{
|
|
7135
7135
|
id: `city-source-${m}`,
|
|
@@ -7153,13 +7153,13 @@ const Oi = (t) => {
|
|
|
7153
7153
|
{
|
|
7154
7154
|
id: `city-border-layer-${m}`,
|
|
7155
7155
|
type: "line",
|
|
7156
|
-
paint:
|
|
7156
|
+
paint: W
|
|
7157
7157
|
}
|
|
7158
7158
|
)
|
|
7159
7159
|
]
|
|
7160
7160
|
},
|
|
7161
7161
|
`city-source-${m}`
|
|
7162
|
-
)) : null, [$, U, x,
|
|
7162
|
+
)) : null, [$, U, x, W]), ee = re(() => U ? Object.entries(R).map(
|
|
7163
7163
|
([m, C]) => /* @__PURE__ */ A(
|
|
7164
7164
|
xt,
|
|
7165
7165
|
{
|
|
@@ -7199,7 +7199,7 @@ const Oi = (t) => {
|
|
|
7199
7199
|
return /* @__PURE__ */ s(
|
|
7200
7200
|
"div",
|
|
7201
7201
|
{
|
|
7202
|
-
className:
|
|
7202
|
+
className: n,
|
|
7203
7203
|
style: { width: "100%", height: "100%", position: "relative", ...i },
|
|
7204
7204
|
children: /* @__PURE__ */ A(
|
|
7205
7205
|
zi,
|