zs_library 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +181 -139
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ var Ne = Object.defineProperty;
2
2
  var $e = (a, e, r) => e in a ? Ne(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
3
3
  var ne = (a, e, r) => $e(a, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { jsx as t, jsxs as q, Fragment as le } from "E:/Projects/Private/zs_library/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js";
5
- import { cx as D, css as i } from "E:/Projects/Private/zs_library/node_modules/.pnpm/@emotion+css@11.13.0/node_modules/@emotion/css/dist/emotion-css.esm.js";
5
+ import { cx as $, css as i } from "E:/Projects/Private/zs_library/node_modules/.pnpm/@emotion+css@11.13.0/node_modules/@emotion/css/dist/emotion-css.esm.js";
6
6
  import { createContext as ge, useMemo as oe, useContext as pe, useState as j, useRef as ae, useEffect as ee } from "E:/Projects/Private/zs_library/node_modules/.pnpm/react@18.3.1/node_modules/react/index.js";
7
7
  import Be from "E:/Projects/Private/zs_library/node_modules/.pnpm/react-slick@0.30.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-slick/lib/index.js";
8
8
  import { ReactSortable as se } from "E:/Projects/Private/zs_library/node_modules/.pnpm/react-sortablejs@6.1.4_@types+sortablejs@1.15.8_react-dom@18.3.1_react@18.3.1__react@18.3.1_sortablejs@1.15.3/node_modules/react-sortablejs/dist/index.js";
@@ -17,8 +17,9 @@ import { RiPencilRuler2Line as Ae, RiShareLine as ze, RiInformationLine as Ee, R
17
17
  import he from "E:/Projects/Private/zs_library/node_modules/.pnpm/rc-dialog@9.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-dialog/es/index.js";
18
18
  import "E:/Projects/Private/zs_library/node_modules/.pnpm/rc-dialog@9.6.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-dialog/assets/index.css";
19
19
  import Ge from "E:/Projects/Private/zs_library/node_modules/.pnpm/react-json-view@1.21.3_@types+react@18.3.5_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-json-view/dist/main.js";
20
- import { MDXEditor as Ye, toolbarPlugin as je, DiffSourceToggleWrapper as qe, UndoRedo as Fe, Separator as K, BoldItalicUnderlineToggles as Ue, CodeToggle as Ve, StrikeThroughSupSubToggles as Je, ListsToggle as Ke, CreateLink as He, InsertImage as We, InsertTable as Ze, InsertThematicBreak as Oe, InsertCodeBlock as Qe, ConditionalContents as _e, InsertAdmonition as et, InsertFrontmatter as tt, diffSourcePlugin as ot, listsPlugin as rt, quotePlugin as nt, headingsPlugin as it, linkPlugin as at, linkDialogPlugin as lt, imagePlugin as st, tablePlugin as ct, thematicBreakPlugin as dt, frontmatterPlugin as ut, codeBlockPlugin as mt, codeMirrorPlugin as gt, markdownShortcutPlugin as pt, directivesPlugin as ht, AdmonitionDirectiveDescriptor as ft } from "E:/Projects/Private/zs_library/node_modules/.pnpm/@mdxeditor+editor@3.11.3_@codemirror+language@6.10.2_@lezer+common@1.2.1_@lezer+highlight@1.2_hb5siswbm5zateow6zcvbwvsv4/node_modules/@mdxeditor/editor/dist/index.js";
20
+ import { MDXEditor as Ye, toolbarPlugin as je, DiffSourceToggleWrapper as qe, UndoRedo as Fe, Separator as K, BoldItalicUnderlineToggles as Ue, CodeToggle as Ve, StrikeThroughSupSubToggles as Je, ListsToggle as Ke, CreateLink as He, InsertImage as _e, InsertTable as We, InsertThematicBreak as Ze, InsertCodeBlock as Oe, ConditionalContents as Qe, InsertAdmonition as et, InsertFrontmatter as tt, diffSourcePlugin as ot, listsPlugin as rt, quotePlugin as nt, headingsPlugin as it, linkPlugin as at, linkDialogPlugin as lt, imagePlugin as st, tablePlugin as ct, thematicBreakPlugin as dt, frontmatterPlugin as ut, codeBlockPlugin as mt, codeMirrorPlugin as gt, markdownShortcutPlugin as pt, directivesPlugin as ht, AdmonitionDirectiveDescriptor as ft } from "E:/Projects/Private/zs_library/node_modules/.pnpm/@mdxeditor+editor@3.11.3_@codemirror+language@6.10.2_@lezer+common@1.2.1_@lezer+highlight@1.2_hb5siswbm5zateow6zcvbwvsv4/node_modules/@mdxeditor/editor/dist/index.js";
21
21
  import "E:/Projects/Private/zs_library/node_modules/.pnpm/@mdxeditor+editor@3.11.3_@codemirror+language@6.10.2_@lezer+common@1.2.1_@lezer+highlight@1.2_hb5siswbm5zateow6zcvbwvsv4/node_modules/@mdxeditor/editor/dist/style.css";
22
+ import "E:/Projects/Private/zs_library/node_modules/.pnpm/github-markdown-css@5.6.1/node_modules/github-markdown-css/github-markdown.css";
22
23
  const fe = {
23
24
  token: {
24
25
  itemNameColor: "#1a1a1a",
@@ -32,7 +33,7 @@ const fe = {
32
33
  contextMenuBackgroundColor: "white",
33
34
  contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
34
35
  }
35
- }, ke = {
36
+ }, be = {
36
37
  token: {
37
38
  itemNameColor: "white",
38
39
  itemIconBackgroundColor: "#1f2937",
@@ -45,25 +46,25 @@ const fe = {
45
46
  contextMenuBackgroundColor: "#1a1a1a",
46
47
  contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
47
48
  }
48
- }, be = ge(
49
+ }, ke = ge(
49
50
  {}
50
- ), kt = (a) => {
51
- const { children: e, theme: r, ...o } = a, m = oe(() => r === "light" ? fe : r === "dark" ? ke : r, [r]);
52
- return /* @__PURE__ */ t(be.Provider, { value: { theme: m, ...o }, children: e });
53
- }, O = () => pe(be), xe = {
51
+ ), bt = (a) => {
52
+ const { children: e, theme: r, ...o } = a, m = oe(() => r === "light" ? fe : r === "dark" ? be : r, [r]);
53
+ return /* @__PURE__ */ t(ke.Provider, { value: { theme: m, ...o }, children: e });
54
+ }, Z = () => pe(ke), xe = {
54
55
  maxRow: 2,
55
56
  maxCol: 2
56
- }, bt = {
57
+ }, kt = {
57
58
  ...xe
58
59
  }, ve = {
59
60
  app: xe,
60
- group: bt
61
+ group: kt
61
62
  };
62
63
  class F {
63
64
  }
64
65
  /** 清理重复id */
65
66
  ne(F, "uniqueArray", (e) => e.reduce((r, o) => r.find((n) => n.id === o.id) ? r : r.concat([o]), [])), ne(F, "getTheme", (e) => {
66
- const r = fe.token, o = ke.token, m = { ...r, ...e == null ? void 0 : e.token }, n = { ...o, ...e == null ? void 0 : e.token };
67
+ const r = fe.token, o = be.token, m = { ...r, ...e == null ? void 0 : e.token }, n = { ...o, ...e == null ? void 0 : e.token };
67
68
  return { light: m, dark: n };
68
69
  });
69
70
  const Ce = ge({
@@ -108,45 +109,45 @@ const Ce = ge({
108
109
  onChange: o,
109
110
  storageKey: m = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
110
111
  enableCaching: n = !0
111
- } = a, [f, k] = j(), [s, N] = j(), [C, L] = j(null), $ = ae(C), [G, R] = j(null), [l, c] = j([]), [M, I] = j(
112
+ } = a, [f, b] = j(), [s, N] = j(), [C, L] = j(null), B = ae(C), [G, R] = j(null), [l, c] = j([]), [M, I] = j(
112
113
  null
113
114
  ), [A, d] = j(
114
115
  null
115
- ), [x, b] = j(!1), [u, g] = j(null), [z, H] = j(
116
+ ), [x, k] = j(!1), [u, g] = j(null), [z, H] = j(
116
117
  null
117
- ), [E, re] = j(!1), [W, _] = Pe(m, {
118
+ ), [E, re] = j(!1), [_, Q] = Pe(m, {
118
119
  defaultValue: [],
119
120
  listenStorageChange: !0
120
121
  }), te = () => {
121
- R(null), clearTimeout(f), k(void 0), $.current = null;
122
+ R(null), clearTimeout(f), b(void 0), B.current = null;
122
123
  }, S = (p, Y) => {
123
124
  R({ ...p, pageX: p.pageX, pageY: p.pageY, data: Y }), clearTimeout(f);
124
125
  }, V = (p, Y = !0) => {
125
126
  const { config: X = {} } = p;
126
127
  return X.allowContextMenu === !1 ? {} : {
127
128
  onMouseDown: (w) => {
128
- k(
129
+ b(
129
130
  setTimeout(() => {
130
- Y && $.current === null && S(w, p);
131
+ Y && B.current === null && S(w, p);
131
132
  }, 800)
132
- ), b(!1), N(
133
+ ), k(!1), N(
133
134
  setTimeout(() => {
134
- b(!0);
135
+ k(!0);
135
136
  }, 800)
136
137
  );
137
138
  },
138
139
  onMouseUp: () => {
139
- clearTimeout(s), N(void 0), clearTimeout(f), k(void 0);
140
+ clearTimeout(s), N(void 0), clearTimeout(f), b(void 0);
140
141
  },
141
142
  onContextMenu: (w) => {
142
143
  Y && (w.preventDefault(), S(w, p));
143
144
  }
144
145
  };
145
- }, Z = (p, Y) => {
146
+ }, W = (p, Y) => {
146
147
  const X = [...Y || []];
147
148
  if (X.length > 0)
148
149
  c((w) => {
149
- const B = [...w], T = (h) => {
150
+ const D = [...w], T = (h) => {
150
151
  var de, ue;
151
152
  const y = X.shift(), P = h.find((J) => J.id === y), U = h.findIndex((J) => J.id === y);
152
153
  if (X.length && P) {
@@ -167,7 +168,7 @@ const Ce = ge({
167
168
  }
168
169
  return F.uniqueArray(p);
169
170
  };
170
- return F.uniqueArray(T(B));
171
+ return F.uniqueArray(T(D));
171
172
  });
172
173
  else {
173
174
  const w = F.uniqueArray(p);
@@ -175,43 +176,43 @@ const Ce = ge({
175
176
  }
176
177
  }, we = (p, Y) => {
177
178
  c((X) => {
178
- const w = [...X], B = (T) => {
179
+ const w = [...X], D = (T) => {
179
180
  var h;
180
181
  for (let y = 0; y < T.length; y++)
181
182
  if (T[y].id === p) {
182
183
  T[y].config = Y;
183
184
  break;
184
- } else ((h = T[y].children) == null ? void 0 : h.length) !== void 0 && B(T[y].children);
185
+ } else ((h = T[y].children) == null ? void 0 : h.length) !== void 0 && D(T[y].children);
185
186
  };
186
- return B(w), o == null || o(w), w;
187
+ return D(w), o == null || o(w), w;
187
188
  });
188
189
  }, ye = (p, Y) => {
189
190
  c((X) => {
190
- const w = [...X], B = (T) => {
191
+ const w = [...X], D = (T) => {
191
192
  var h;
192
193
  for (let y = 0; y < T.length; y++)
193
194
  if (T[y].id === p) {
194
195
  T[y].data = Y;
195
196
  break;
196
- } else ((h = T[y].children) == null ? void 0 : h.length) !== void 0 && B(T[y].children);
197
+ } else ((h = T[y].children) == null ? void 0 : h.length) !== void 0 && D(T[y].children);
197
198
  };
198
- return B(w), o == null || o(w), w;
199
+ return D(w), o == null || o(w), w;
199
200
  });
200
201
  }, Me = (p) => {
201
202
  c((Y) => {
202
- const X = [...Y], w = (B) => {
203
+ const X = [...Y], w = (D) => {
203
204
  var T;
204
- for (let h = 0; h < B.length; h++)
205
- if (B[h].id === p) {
206
- B.splice(h, 1);
205
+ for (let h = 0; h < D.length; h++)
206
+ if (D[h].id === p) {
207
+ D.splice(h, 1);
207
208
  break;
208
- } else ((T = B[h].children) == null ? void 0 : T.length) !== void 0 && w(B[h].children);
209
+ } else ((T = D[h].children) == null ? void 0 : T.length) !== void 0 && w(D[h].children);
209
210
  };
210
211
  return w(X), o == null || o(X), X;
211
212
  });
212
213
  }, Se = (p, Y) => {
213
- const X = [...l], w = (B, T) => {
214
- const h = T.shift(), y = B.find((U) => U.id === h), P = B.findIndex((U) => U.id === h);
214
+ const X = [...l], w = (D, T) => {
215
+ const h = T.shift(), y = D.find((U) => U.id === h), P = D.findIndex((U) => U.id === h);
215
216
  if (y) {
216
217
  if (T.length)
217
218
  y.children = w(y.children || [], T);
@@ -226,21 +227,21 @@ const Ce = ge({
226
227
  }
227
228
  ];
228
229
  }
229
- return B.splice(P, 1, y), B;
230
+ return D.splice(P, 1, y), D;
230
231
  } else
231
- return B;
232
+ return D;
232
233
  };
233
234
  c(w(X, Y));
234
235
  };
235
236
  return ee(() => {
236
- (r == null ? void 0 : r.length) > 0 && l.length === 0 && Z(r);
237
+ (r == null ? void 0 : r.length) > 0 && l.length === 0 && W(r);
237
238
  }, [r]), ee(() => {
238
- $.current = C, C !== null && te();
239
+ B.current = C, C !== null && te();
239
240
  }, [C]), ee(() => {
240
- n && W != null && W.length && !E && (Z(W), re(!0));
241
- }, [W, E, n]), Le(
241
+ n && _ != null && _.length && !E && (W(_), re(!0));
242
+ }, [_, E, n]), Le(
242
243
  () => {
243
- n && _(l);
244
+ n && Q(l);
244
245
  },
245
246
  [l, n],
246
247
  {
@@ -251,7 +252,7 @@ const Ce = ge({
251
252
  {
252
253
  value: {
253
254
  list: l,
254
- setList: Z,
255
+ setList: W,
255
256
  contextMenu: G,
256
257
  setContextMenu: R,
257
258
  listStatus: C,
@@ -275,7 +276,7 @@ const Ce = ge({
275
276
  children: e
276
277
  }
277
278
  );
278
- }, Q = () => pe(Ce), vt = {
279
+ }, O = () => pe(Ce), vt = {
279
280
  menuShow: {
280
281
  opacity: 1,
281
282
  y: 0,
@@ -283,7 +284,7 @@ const Ce = ge({
283
284
  },
284
285
  menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
285
286
  }, ie = (a) => {
286
- const { icon: e, title: r, onClick: o } = a, { theme: m } = O(), { light: n, dark: f } = F.getTheme(m);
287
+ const { icon: e, title: r, onClick: o } = a, { theme: m } = Z(), { light: n, dark: f } = F.getTheme(m);
287
288
  return /* @__PURE__ */ t(
288
289
  v.div,
289
290
  {
@@ -304,14 +305,14 @@ const Ce = ge({
304
305
  user-select: none;
305
306
  border-radius: 0.5rem;
306
307
  `,
307
- onClick: (k) => {
308
- k.stopPropagation(), o == null || o();
308
+ onClick: (b) => {
309
+ b.stopPropagation(), o == null || o();
309
310
  },
310
311
  variants: vt,
311
312
  children: /* @__PURE__ */ q(
312
313
  v.div,
313
314
  {
314
- className: D(
315
+ className: $(
315
316
  "py-1.5 px-3 rounded-lg",
316
317
  i`
317
318
  padding-top: 0.375rem;
@@ -326,7 +327,7 @@ const Ce = ge({
326
327
  /* @__PURE__ */ t(
327
328
  v.div,
328
329
  {
329
- className: D(
330
+ className: $(
330
331
  i`
331
332
  margin-bottom: 0.375rem;
332
333
  display: flex;
@@ -350,17 +351,17 @@ const Ce = ge({
350
351
  showSizeButton: m = !0,
351
352
  onInfoClick: n,
352
353
  onShareClick: f,
353
- onRemoveClick: k
354
+ onRemoveClick: b
354
355
  } = a, {
355
356
  contextMenu: s,
356
357
  setContextMenu: N,
357
358
  hideContextMenu: C,
358
359
  setShowInfoItemData: L,
359
- removeItem: $,
360
+ removeItem: B,
360
361
  updateItemConfig: G
361
- } = Q(), { theme: R } = O(), { light: l, dark: c } = F.getTheme(R), { data: M } = s ?? {}, { config: I = {} } = M ?? {}, A = () => {
362
- var b;
363
- const d = ve[(b = s == null ? void 0 : s.data) == null ? void 0 : b.type], x = [];
362
+ } = O(), { theme: R } = Z(), { light: l, dark: c } = F.getTheme(R), { data: M } = s ?? {}, { config: I = {} } = M ?? {}, A = () => {
363
+ var k;
364
+ const d = ve[(k = s == null ? void 0 : s.data) == null ? void 0 : k.type], x = [];
364
365
  for (let u = 1; u <= ((d == null ? void 0 : d.maxRow) ?? 2); u++)
365
366
  for (let g = 1; g <= ((d == null ? void 0 : d.maxCol) ?? 2); g++)
366
367
  x.push(`${u}x${g}`);
@@ -379,7 +380,7 @@ const Ce = ge({
379
380
  /* @__PURE__ */ t(
380
381
  v.div,
381
382
  {
382
- className: D(
383
+ className: $(
383
384
  i`
384
385
  border-radius: 0.5rem;
385
386
  overflow: hidden;
@@ -408,10 +409,10 @@ const Ce = ge({
408
409
  label: d,
409
410
  key: d,
410
411
  onClick: () => {
411
- const [x, b] = d.split("x").map(Number);
412
+ const [x, k] = d.split("x").map(Number);
412
413
  G(s.data.id, {
413
414
  row: x,
414
- col: b
415
+ col: k
415
416
  });
416
417
  }
417
418
  }))
@@ -456,7 +457,7 @@ const Ce = ge({
456
457
  children: d.items.map((x) => /* @__PURE__ */ t(
457
458
  v.div,
458
459
  {
459
- className: D(
460
+ className: $(
460
461
  "py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
461
462
  i`
462
463
  padding-top: 0.25rem;
@@ -505,7 +506,7 @@ const Ce = ge({
505
506
  /* @__PURE__ */ q(
506
507
  v.div,
507
508
  {
508
- className: D(
509
+ className: $(
509
510
  i`
510
511
  background-color: ${l.contextMenuBackgroundColor};
511
512
  box-shadow: 0 0 0.5rem ${l.contextMenuShadowColor};
@@ -560,11 +561,11 @@ const Ce = ge({
560
561
  icon: /* @__PURE__ */ t(Xe, { size: 20 }),
561
562
  title: "移除",
562
563
  onClick: () => {
563
- if (k) {
564
- k(s.data, $);
564
+ if (b) {
565
+ b(s.data, B);
565
566
  return;
566
567
  }
567
- N(null), $(s.data.id);
568
+ N(null), B(s.data.id);
568
569
  }
569
570
  }
570
571
  )
@@ -575,7 +576,7 @@ const Ce = ge({
575
576
  }
576
577
  ) });
577
578
  }, It = (a) => {
578
- const { data: e, noLetters: r = !1 } = a, { contextMenuFuns: o } = Q(), { itemIconBuilder: m, theme: n, contextMenu: f } = O(), { light: k, dark: s } = F.getTheme(n), { data: N = {} } = e, { name: C } = N;
579
+ const { data: e, noLetters: r = !1 } = a, { contextMenuFuns: o } = O(), { itemIconBuilder: m, theme: n, contextMenu: f } = Z(), { light: b, dark: s } = F.getTheme(n), { data: N = {} } = e, { name: C } = N;
579
580
  return /* @__PURE__ */ q(le, { children: [
580
581
  /* @__PURE__ */ t(
581
582
  v.div,
@@ -583,9 +584,9 @@ const Ce = ge({
583
584
  className: i`
584
585
  width: 4rem;
585
586
  height: 4rem;
586
- background-color: ${k.itemIconBackgroundColor};
587
+ background-color: ${b.itemIconBackgroundColor};
587
588
  border-radius: 0.75rem;
588
- box-shadow: 0 0 0.5rem ${k.itemIconShadowColor};
589
+ box-shadow: 0 0 0.5rem ${b.itemIconShadowColor};
589
590
  cursor: pointer;
590
591
  position: relative;
591
592
  overflow: hidden;
@@ -604,7 +605,7 @@ const Ce = ge({
604
605
  top: 0;
605
606
  width: 100%;
606
607
  height: 100%;
607
- color: ${k.itemNameColor};
608
+ color: ${b.itemNameColor};
608
609
  @media (prefers-color-scheme: dark) {
609
610
  color: ${s.itemNameColor};
610
611
  }
@@ -618,12 +619,12 @@ const Ce = ge({
618
619
  /* @__PURE__ */ t(
619
620
  v.p,
620
621
  {
621
- className: D(
622
+ className: $(
622
623
  i`
623
624
  text-align: center;
624
625
  margin-top: 0.25rem;
625
626
  margin-bottom: 0;
626
- color: ${k.itemNameColor};
627
+ color: ${b.itemNameColor};
627
628
  @media (prefers-color-scheme: dark) {
628
629
  color: ${s.itemNameColor};
629
630
  }
@@ -644,9 +645,9 @@ const Ce = ge({
644
645
  onClick: m,
645
646
  disabledDrag: n = !1,
646
647
  children: f,
647
- parentIds: k,
648
+ parentIds: b,
648
649
  childrenLength: s
649
- } = a, { contextMenu: N, setContextMenu: C } = Q(), { contextMenu: L } = O();
650
+ } = a, { contextMenu: N, setContextMenu: C } = O(), { contextMenu: L } = Z();
650
651
  return /* @__PURE__ */ t(
651
652
  Re,
652
653
  {
@@ -661,8 +662,8 @@ const Ce = ge({
661
662
  `,
662
663
  overlay: /* @__PURE__ */ t(Ct, { ...L }),
663
664
  visible: (N == null ? void 0 : N.data.id) === e.id,
664
- onVisibleChange: ($) => {
665
- $ || C(null);
665
+ onVisibleChange: (B) => {
666
+ B || C(null);
666
667
  },
667
668
  destroyTooltipOnHide: !0,
668
669
  children: /* @__PURE__ */ t(
@@ -670,10 +671,10 @@ const Ce = ge({
670
671
  {
671
672
  "data-id": e.id,
672
673
  "data-index": o,
673
- "data-parent-ids": k == null ? void 0 : k.join(","),
674
+ "data-parent-ids": b == null ? void 0 : b.join(","),
674
675
  "data-children-length": s,
675
676
  onClick: () => m == null ? void 0 : m(e),
676
- className: D(n && "drag-disabled", r),
677
+ className: $(n && "drag-disabled", r),
677
678
  children: f ?? /* @__PURE__ */ t(It, { ...a })
678
679
  }
679
680
  )
@@ -688,18 +689,18 @@ const Ce = ge({
688
689
  onClick: n,
689
690
  noLetters: f = !1
690
691
  } = a, {
691
- contextMenuFuns: k,
692
+ contextMenuFuns: b,
692
693
  setList: s,
693
694
  setOpenGroupItemData: N,
694
695
  longPressTriggered: C,
695
696
  moveItemId: L,
696
- moveTargetId: $,
697
+ moveTargetId: B,
697
698
  setMoveTargetId: G,
698
699
  listStatus: R
699
- } = Q(), { itemIconBuilder: l, theme: c, contextMenu: M } = O(), { light: I, dark: A } = F.getTheme(c), { children: d, data: x, config: b } = e, { row: u = 1, col: g = 1 } = b ?? {}, z = {
700
+ } = O(), { itemIconBuilder: l, theme: c, contextMenu: M } = Z(), { light: I, dark: A } = F.getTheme(c), { children: d, data: x, config: k } = e, { row: u = 1, col: g = 1 } = k ?? {}, z = {
700
701
  visible: { opacity: 1, scale: 1 },
701
702
  hidden: { opacity: 0, scale: 0.95 }
702
- }, H = ((d == null ? void 0 : d.length) ?? 0) === 0, E = H ? [e] : [...d ?? []].slice(0, 9), re = oe(() => L === e.id.toString(), [e.id, L]), W = oe(() => $ === e.id, [e.id, $]), _ = i`
703
+ }, H = ((d == null ? void 0 : d.length) ?? 0) === 0, E = H ? [e] : [...d ?? []].slice(0, 9), re = oe(() => L === e.id.toString(), [e.id, L]), _ = oe(() => B === e.id, [e.id, B]), Q = i`
703
704
  overflow: hidden;
704
705
  cursor: pointer;
705
706
  background-color: ${I.itemIconBackgroundColor};
@@ -713,7 +714,7 @@ const Ce = ge({
713
714
  return /* @__PURE__ */ t(
714
715
  v.div,
715
716
  {
716
- className: D(
717
+ className: $(
717
718
  "sortable-group-item",
718
719
  i`
719
720
  overflow: hidden;
@@ -753,8 +754,8 @@ const Ce = ge({
753
754
  children: E == null ? void 0 : E.slice(0, 9).map((S) => /* @__PURE__ */ t(
754
755
  v.div,
755
756
  {
756
- className: D(
757
- _,
757
+ className: $(
758
+ Q,
758
759
  i`
759
760
  border-radius: ${g === 1 ? "0.25rem" : "0.5rem"};
760
761
  width: 100%;
@@ -787,8 +788,8 @@ const Ce = ge({
787
788
  children: E == null ? void 0 : E.slice(0, 4).map((S, V) => /* @__PURE__ */ t(
788
789
  v.div,
789
790
  {
790
- className: D(
791
- _,
791
+ className: $(
792
+ Q,
792
793
  V < 2 ? i`
793
794
  width: 52px;
794
795
  height: 52px;
@@ -803,8 +804,8 @@ const Ce = ge({
803
804
  grid-row: span 2 / span 2;
804
805
  `
805
806
  ),
806
- onClick: (Z) => {
807
- V > 2 || (Z.stopPropagation(), n == null || n(S));
807
+ onClick: (W) => {
808
+ V > 2 || (W.stopPropagation(), n == null || n(S));
808
809
  },
809
810
  children: l == null ? void 0 : l(S)
810
811
  },
@@ -829,8 +830,8 @@ const Ce = ge({
829
830
  children: E == null ? void 0 : E.slice(0, 4).map((S, V) => /* @__PURE__ */ t(
830
831
  v.div,
831
832
  {
832
- className: D(
833
- _,
833
+ className: $(
834
+ Q,
834
835
  V < 2 ? i`
835
836
  width: 52px;
836
837
  height: 52px;
@@ -844,8 +845,8 @@ const Ce = ge({
844
845
  grid-row: span 2 / span 2;
845
846
  `
846
847
  ),
847
- onClick: (Z) => {
848
- V > 2 || (Z.stopPropagation(), n == null || n(S));
848
+ onClick: (W) => {
849
+ V > 2 || (W.stopPropagation(), n == null || n(S));
849
850
  },
850
851
  children: l == null ? void 0 : l(S)
851
852
  },
@@ -861,7 +862,7 @@ const Ce = ge({
861
862
  itemIndex: m,
862
863
  parentIds: o,
863
864
  childrenLength: d == null ? void 0 : d.length,
864
- className: D(
865
+ className: $(
865
866
  i`
866
867
  grid-row: span ${u};
867
868
  grid-column: span ${g};
@@ -873,8 +874,8 @@ const Ce = ge({
873
874
  v.div,
874
875
  {
875
876
  whileTap: { scale: 0.9 },
876
- className: D(
877
- W ? "!scale-110" : "",
877
+ className: $(
878
+ _ ? "!scale-110" : "",
878
879
  i`
879
880
  cursor: pointer;
880
881
  position: relative;
@@ -895,7 +896,7 @@ const Ce = ge({
895
896
  onClick: (S) => {
896
897
  !H && !C && (e.parentIds = o, e.pageX = S.pageX, e.pageY = S.pageY, N(e));
897
898
  },
898
- ...k(e, M !== !1),
899
+ ...b(e, M !== !1),
899
900
  children: /* @__PURE__ */ q(
900
901
  v.div,
901
902
  {
@@ -913,7 +914,7 @@ const Ce = ge({
913
914
  /* @__PURE__ */ t(
914
915
  se,
915
916
  {
916
- className: D(
917
+ className: $(
917
918
  "sortable-group-item",
918
919
  i`
919
920
  position: absolute;
@@ -948,7 +949,7 @@ const Ce = ge({
948
949
  /* @__PURE__ */ t(
949
950
  v.p,
950
951
  {
951
- className: D(
952
+ className: $(
952
953
  i`
953
954
  text-align: center;
954
955
  margin-top: 0.25rem;
@@ -987,10 +988,10 @@ const Ce = ge({
987
988
  list: m,
988
989
  setList: n,
989
990
  setListStatus: f,
990
- setMoveItemId: k,
991
+ setMoveItemId: b,
991
992
  setMoveTargetId: s,
992
993
  updateItem: N
993
- } = Q(), { theme: C } = O(), { light: L, dark: $ } = F.getTheme(C), [G, R] = j("文件夹"), l = [...(e == null ? void 0 : e.children) ?? []];
994
+ } = O(), { theme: C } = Z(), { light: L, dark: B } = F.getTheme(C), [G, R] = j("文件夹"), l = [...(e == null ? void 0 : e.children) ?? []];
994
995
  return ee(() => {
995
996
  var c;
996
997
  e && R((c = e.data) == null ? void 0 : c.name);
@@ -1038,7 +1039,7 @@ const Ce = ge({
1038
1039
  ),
1039
1040
  footer: null,
1040
1041
  closable: !1,
1041
- className: D(
1042
+ className: $(
1042
1043
  "group-item-modal",
1043
1044
  i`
1044
1045
  .rc-dialog-content {
@@ -1057,7 +1058,7 @@ const Ce = ge({
1057
1058
  .rc-dialog-body {
1058
1059
  background-color: ${L.groupItemModalBackgroundColor};
1059
1060
  @media (prefers-color-scheme: dark) {
1060
- background-color: ${$.groupItemModalBackgroundColor};
1061
+ background-color: ${B.groupItemModalBackgroundColor};
1061
1062
  }
1062
1063
  border-radius: 0.5rem;
1063
1064
  overflow: hidden;
@@ -1099,15 +1100,15 @@ const Ce = ge({
1099
1100
  setList: (c) => {
1100
1101
  var A, d;
1101
1102
  const M = c.map((x) => x.id), I = (d = (A = m.find((x) => x.id === (e == null ? void 0 : e.id))) == null ? void 0 : A.children) == null ? void 0 : d.map((x) => x.id);
1102
- M.length === (I == null ? void 0 : I.length) && M.every((x, b) => x === I[b]) || M.length < ((I == null ? void 0 : I.length) ?? 0) || n(c, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1103
+ M.length === (I == null ? void 0 : I.length) && M.every((x, k) => x === I[k]) || M.length < ((I == null ? void 0 : I.length) ?? 0) || n(c, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1103
1104
  },
1104
1105
  onMove: () => (s(null), f("onMove"), !0),
1105
1106
  onStart: (c) => {
1106
1107
  const M = c.item.dataset;
1107
- M != null && M.id && k(M.id), f("onMove");
1108
+ M != null && M.id && b(M.id), f("onMove");
1108
1109
  },
1109
1110
  onEnd: () => {
1110
- k(null), s(null), f(null);
1111
+ b(null), s(null), f(null);
1111
1112
  },
1112
1113
  ghostClass: Ie,
1113
1114
  children: l.map((c, M) => /* @__PURE__ */ t(
@@ -1156,18 +1157,18 @@ const Ce = ge({
1156
1157
  sliderProps: o,
1157
1158
  sliderRef: m,
1158
1159
  onItemClick: n
1159
- } = a, f = ae(null), k = ae(null), {
1160
+ } = a, f = ae(null), b = ae(null), {
1160
1161
  list: s,
1161
1162
  setList: N,
1162
1163
  setListStatus: C,
1163
1164
  showInfoItemData: L,
1164
- setShowInfoItemData: $,
1165
+ setShowInfoItemData: B,
1165
1166
  openGroupItemData: G,
1166
1167
  setOpenGroupItemData: R,
1167
1168
  setMoveItemId: l,
1168
1169
  setMoveTargetId: c,
1169
1170
  addItem: M
1170
- } = Q(), { pagingDotBuilder: I, pagingDotsBuilder: A, itemBuilder: d } = O(), x = oe(() => e === !1 ? {} : {
1171
+ } = O(), { pagingDotBuilder: I, pagingDotsBuilder: A, itemBuilder: d } = Z(), x = oe(() => e === !1 ? {} : {
1171
1172
  top: i`
1172
1173
  display: flex;
1173
1174
  flex-direction: column;
@@ -1228,7 +1229,7 @@ const Ce = ge({
1228
1229
  dots: !0,
1229
1230
  touchMove: !1,
1230
1231
  lazyLoad: "anticipated",
1231
- className: D(
1232
+ className: $(
1232
1233
  x,
1233
1234
  i`
1234
1235
  .slick-track {
@@ -1248,24 +1249,24 @@ const Ce = ge({
1248
1249
  `,
1249
1250
  r
1250
1251
  ),
1251
- customPaging: (b) => {
1252
+ customPaging: (k) => {
1252
1253
  var u, g;
1253
- return I ? I(s[b], b) : /* @__PURE__ */ t(
1254
+ return I ? I(s[k], k) : /* @__PURE__ */ t(
1254
1255
  "div",
1255
1256
  {
1256
1257
  onDragEnter: () => {
1257
1258
  var z;
1258
- (z = (m ?? f).current) == null || z.slickGoTo(b);
1259
+ (z = (m ?? f).current) == null || z.slickGoTo(k);
1259
1260
  },
1260
- children: (g = (u = s[b]) == null ? void 0 : u.data) == null ? void 0 : g.name
1261
+ children: (g = (u = s[k]) == null ? void 0 : u.data) == null ? void 0 : g.name
1261
1262
  }
1262
1263
  );
1263
1264
  },
1264
- appendDots: (b) => A ? A(b) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1265
+ appendDots: (k) => A ? A(k) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1265
1266
  "ul",
1266
1267
  {
1267
- ref: k,
1268
- className: D(
1268
+ ref: b,
1269
+ className: $(
1269
1270
  "slick-dots-default",
1270
1271
  i`
1271
1272
  padding: 0.5rem;
@@ -1288,11 +1289,11 @@ const Ce = ge({
1288
1289
  }
1289
1290
  `
1290
1291
  ),
1291
- children: b
1292
+ children: k
1292
1293
  }
1293
1294
  ) }),
1294
1295
  ...o,
1295
- children: s.map((b) => /* @__PURE__ */ t(
1296
+ children: s.map((k) => /* @__PURE__ */ t(
1296
1297
  "div",
1297
1298
  {
1298
1299
  onDrop: (u) => {
@@ -1300,7 +1301,7 @@ const Ce = ge({
1300
1301
  const g = u.dataTransfer.getData("text/plain");
1301
1302
  if (g !== "")
1302
1303
  try {
1303
- M(JSON.parse(g), [b.id]);
1304
+ M(JSON.parse(g), [k.id]);
1304
1305
  } catch (z) {
1305
1306
  console.log("drag error", z);
1306
1307
  }
@@ -1311,7 +1312,7 @@ const Ce = ge({
1311
1312
  children: /* @__PURE__ */ t(
1312
1313
  se,
1313
1314
  {
1314
- className: D(
1315
+ className: $(
1315
1316
  i`
1316
1317
  display: grid;
1317
1318
  transition: all 0.3s;
@@ -1327,8 +1328,8 @@ const Ce = ge({
1327
1328
  fallbackOnBody: !0,
1328
1329
  swapThreshold: 0.65,
1329
1330
  group: "nested",
1330
- list: b.children ?? [],
1331
- setList: (u) => N(u, [b.id]),
1331
+ list: k.children ?? [],
1332
+ setList: (u) => N(u, [k.id]),
1332
1333
  filter: ".drag-disabled",
1333
1334
  onMove: (u) => {
1334
1335
  C("onMove");
@@ -1343,7 +1344,7 @@ const Ce = ge({
1343
1344
  l(null), c(null), C(null);
1344
1345
  },
1345
1346
  ghostClass: Ie,
1346
- children: (b.children ?? []).map((u, g) => {
1347
+ children: (k.children ?? []).map((u, g) => {
1347
1348
  let z;
1348
1349
  if (d)
1349
1350
  return d(u);
@@ -1355,7 +1356,7 @@ const Ce = ge({
1355
1356
  {
1356
1357
  data: u,
1357
1358
  itemIndex: g,
1358
- parentIds: [b.id, u.id],
1359
+ parentIds: [k.id, u.id],
1359
1360
  onClick: n
1360
1361
  },
1361
1362
  u.id
@@ -1378,7 +1379,7 @@ const Ce = ge({
1378
1379
  }
1379
1380
  )
1380
1381
  },
1381
- b.id
1382
+ k.id
1382
1383
  ))
1383
1384
  }
1384
1385
  ),
@@ -1387,7 +1388,7 @@ const Ce = ge({
1387
1388
  {
1388
1389
  data: L,
1389
1390
  onClose: () => {
1390
- $(null);
1391
+ B(null);
1391
1392
  }
1392
1393
  }
1393
1394
  ),
@@ -1410,12 +1411,12 @@ const Ce = ge({
1410
1411
  enableCaching: m,
1411
1412
  theme: n,
1412
1413
  noLetters: f,
1413
- contextMenu: k,
1414
+ contextMenu: b,
1414
1415
  contextMenuBuilder: s,
1415
1416
  itemBuilder: N,
1416
1417
  itemIconBuilder: C,
1417
1418
  pagingDotBuilder: L,
1418
- pagingDotsBuilder: $,
1419
+ pagingDotsBuilder: B,
1419
1420
  ...G
1420
1421
  } = a;
1421
1422
  return /* @__PURE__ */ t(xt, { ...{
@@ -1423,11 +1424,11 @@ const Ce = ge({
1423
1424
  onChange: r,
1424
1425
  storageKey: o,
1425
1426
  enableCaching: m
1426
- }, children: /* @__PURE__ */ t(kt, { ...{
1427
+ }, children: /* @__PURE__ */ t(bt, { ...{
1427
1428
  theme: n,
1428
1429
  noLetters: f,
1429
- contextMenu: k,
1430
- pagingDotsBuilder: $,
1430
+ contextMenu: b,
1431
+ pagingDotsBuilder: B,
1431
1432
  pagingDotBuilder: L,
1432
1433
  itemBuilder: N,
1433
1434
  itemIconBuilder: C,
@@ -1538,7 +1539,11 @@ const Ce = ge({
1538
1539
  },
1539
1540
  codeBlock: {
1540
1541
  language: "代码块语言",
1541
- selectLanguage: "选择代码块语言"
1542
+ selectLanguage: "选择代码块语言",
1543
+ inlineLanguage: "代码块语言"
1544
+ },
1545
+ codeblock: {
1546
+ delete: "删除代码块"
1542
1547
  },
1543
1548
  contentArea: {
1544
1549
  editableMarkdown: "可编辑的 Markdown"
@@ -1562,7 +1567,7 @@ function $t(a) {
1562
1567
  const Zt = (a) => {
1563
1568
  const { value: e, onChange: r, translation: o, pluginConfig: m, ...n } = a, {
1564
1569
  image: f,
1565
- diffSource: k = {
1570
+ diffSource: b = {
1566
1571
  viewMode: "rich-text"
1567
1572
  },
1568
1573
  headings: s,
@@ -1577,7 +1582,7 @@ const Zt = (a) => {
1577
1582
  "": "Unspecified"
1578
1583
  }
1579
1584
  },
1580
- directives: $ = {
1585
+ directives: B = {
1581
1586
  directiveDescriptors: [ft]
1582
1587
  }
1583
1588
  } = m ?? {}, [G, R] = j("");
@@ -1586,7 +1591,44 @@ const Zt = (a) => {
1586
1591
  }, [e]), /* @__PURE__ */ t(
1587
1592
  Ye,
1588
1593
  {
1589
- contentEditableClassName: "markdown-body",
1594
+ contentEditableClassName: $(
1595
+ "markdown-body",
1596
+ i`
1597
+ table {
1598
+ border-spacing: 0;
1599
+ border-collapse: collapse;
1600
+ width: 100%;
1601
+ display: table;
1602
+ th[data-tool-cell],
1603
+ td[data-tool-cell] {
1604
+ padding: 0;
1605
+ border: none;
1606
+ }
1607
+ tr {
1608
+ border-top: 0;
1609
+ }
1610
+ thead {
1611
+ th {
1612
+ padding: 0;
1613
+ border: none;
1614
+ }
1615
+ }
1616
+ tfoot {
1617
+ th {
1618
+ padding: 0;
1619
+ border: none;
1620
+ }
1621
+ }
1622
+ [class*="_addRowButton"],
1623
+ [class*="_addColumnButton"],
1624
+ [class*="_tableColumnEditorTrigger"],
1625
+ [class*="_iconButton"] {
1626
+ cursor: pointer;
1627
+ transition: all 0.3s;
1628
+ }
1629
+ }
1630
+ `
1631
+ ),
1590
1632
  markdown: G,
1591
1633
  onChange: (l) => {
1592
1634
  !e && !r && R(l), r && r(l);
@@ -1605,14 +1647,14 @@ const Zt = (a) => {
1605
1647
  /* @__PURE__ */ t(Ke, {}),
1606
1648
  /* @__PURE__ */ t(K, {}),
1607
1649
  /* @__PURE__ */ t(He, {}),
1608
- /* @__PURE__ */ t(We, {}),
1650
+ /* @__PURE__ */ t(_e, {}),
1609
1651
  /* @__PURE__ */ t(K, {}),
1652
+ /* @__PURE__ */ t(We, {}),
1610
1653
  /* @__PURE__ */ t(Ze, {}),
1611
- /* @__PURE__ */ t(Oe, {}),
1612
1654
  /* @__PURE__ */ t(K, {}),
1613
- /* @__PURE__ */ t(Qe, {}),
1655
+ /* @__PURE__ */ t(Oe, {}),
1614
1656
  /* @__PURE__ */ t(
1615
- _e,
1657
+ Qe,
1616
1658
  {
1617
1659
  options: [
1618
1660
  {
@@ -1629,7 +1671,7 @@ const Zt = (a) => {
1629
1671
  /* @__PURE__ */ t(tt, {})
1630
1672
  ] })
1631
1673
  }),
1632
- ot(k),
1674
+ ot(b),
1633
1675
  rt(),
1634
1676
  nt(),
1635
1677
  it(s),
@@ -1642,7 +1684,7 @@ const Zt = (a) => {
1642
1684
  mt(C),
1643
1685
  gt(L),
1644
1686
  pt(),
1645
- ht($)
1687
+ ht(B)
1646
1688
  ],
1647
1689
  ...n
1648
1690
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zs_library",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "homepage": "https://zs-library.vercel.app",
5
5
  "bugs": {
6
6
  "url": "https://github.com/virzs/zs_library/issues"