@baishuyun/ui-base 2.3.3 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/Card/{Card-F2t4Rv_v.js → Card-CaKTq_1y.js} +17 -17
  2. package/dist/Card/index.js +2 -2
  3. package/dist/CheckBox/CheckBox-Cz6KW9Lw.js +33 -0
  4. package/dist/CheckBox/{CheckBox-DFoMXJZz.js → CheckBox-l__wOnmH.js} +25 -25
  5. package/dist/CheckBox/index.js +3 -3
  6. package/dist/ColorPicker/ColorPicker-C1kG_eI-.js +168 -0
  7. package/dist/ColorPicker/index.js +4 -5
  8. package/dist/DropDown/DropDown-BAPBTglm.js +162 -0
  9. package/dist/DropDown/index.js +6 -6
  10. package/dist/Editor/{Buttons-ClWtl3G-.js → Buttons-CsKKYGbV.js} +207 -204
  11. package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -13
  12. package/dist/Editor/index.js +207 -196
  13. package/dist/Icon/Icon-CTZCSuVg.js +19 -0
  14. package/dist/Icon/index.js +1 -1
  15. package/dist/InputTag/{InputTag-DbiyuWo9.js → InputTag-V4UnUnGJ.js} +33 -33
  16. package/dist/InputTag/index.js +2 -2
  17. package/dist/Loading/index.js +1 -1
  18. package/dist/Modal/{Modal-BO1s8pJe.js → Modal-DQ5bptu_.js} +1 -1
  19. package/dist/Modal/index.js +2 -2
  20. package/dist/NotFoundContent/index.js +1 -1
  21. package/dist/Radio/{Radio-dyoBNiKF.js → Radio-CZOrtNyn.js} +25 -25
  22. package/dist/Radio/index.js +1 -1
  23. package/dist/Segmented/{Segmented-Dd8glDXI.js → Segmented-DEGgLO-b.js} +15 -15
  24. package/dist/Segmented/index.js +1 -1
  25. package/dist/Select/Select-DyV_1e23.js +729 -0
  26. package/dist/Select/{SelectInputSearch-gp6gcY3x.js → SelectInputSearch-DMY6Y9B6.js} +2 -2
  27. package/dist/Select/index.js +10 -10
  28. package/dist/Tabs/{Tabs-Dsxn_7gF.js → Tabs-BqT-_eVo.js} +138 -138
  29. package/dist/Tabs/index.js +4 -5
  30. package/dist/Tree/index.js +4 -4
  31. package/dist/Tree/utils/index.js +1 -1
  32. package/dist/components/Tree/Tree.test.d.ts +1 -0
  33. package/dist/components/Tree/context/TreeContext.d.ts +1 -1
  34. package/dist/components/Tree/types/tree.d.ts +1 -1
  35. package/dist/index.js +83 -23
  36. package/dist/locale/LocaleProvider.test.d.ts +1 -0
  37. package/dist/locale/index.d.ts +1 -1
  38. package/dist/locale/lang/zh-TW.json.d.ts +64 -0
  39. package/dist/vendors/Tree-P9E06Unm.js +231 -0
  40. package/dist/vendors/{color-BPWy9DvT.js → color-CyuNdAfc.js} +2 -2
  41. package/package.json +3 -1
  42. package/dist/CheckBox/CheckBox-q2vu7qf7.js +0 -33
  43. package/dist/ColorPicker/ColorPicker-Bh4KTHxh.js +0 -168
  44. package/dist/DropDown/DropDown-BEzloRRM.js +0 -162
  45. package/dist/Icon/Icon-DXmPqVzg.js +0 -19
  46. package/dist/Select/Select-DoQO-Xi5.js +0 -729
  47. package/dist/vendors/Tree-DgwG7Unx.js +0 -231
  48. package/dist/vendors/clsx-DNOE4Gl8.js +0 -16
  49. package/dist/vendors/fuse.js-BKtvbTjL.js +0 -877
  50. package/dist/vendors/lexical-hZliMgDv.js +0 -6439
  51. package/dist/vendors/lodash-es-Bu9xU1fK.js +0 -334
  52. package/dist/vendors/simplebar-react-CFlS-Nm9.js +0 -370
  53. package/dist/vendors/tinycolor2-DToeAEPD.js +0 -726
  54. /package/dist/Loading/{Loading-Bi5NO-Ky.js → Loading-Dy5A--HK.js} +0 -0
  55. /package/dist/NotFoundContent/{NotFoundContent-CTPpcZOt.js → NotFoundContent-1-41e1rN.js} +0 -0
  56. /package/dist/vendors/{animations-C5JKFkz4.js → animations-DvjIfVz9.js} +0 -0
  57. /package/dist/vendors/{useFloatingPortal-BA6P5GxV.js → useFloatingPortal-W4pliYWU.js} +0 -0
  58. /package/dist/vendors/{useLocale-BfT0V1j4.js → useLocale-BXnqO-Ju.js} +0 -0
@@ -1,80 +1,83 @@
1
- import { t as e } from "../Icon/Icon-DXmPqVzg.js";
2
- import { t } from "../vendors/useLocale-BfT0V1j4.js";
3
- import { t as n } from "../vendors/clsx-DNOE4Gl8.js";
4
- import { t as r } from "../Modal/Modal-BO1s8pJe.js";
5
- import { t as i } from "../ColorPicker/ColorPicker-Bh4KTHxh.js";
6
- import { t as a } from "../CheckBox/CheckBox-q2vu7qf7.js";
7
- import { t as o } from "../DropDown/DropDown-BEzloRRM.js";
8
- import { A as s, E as c, F as l, I as u, P as d, T as f, g as p, i as m, j as h, k as g, n as _, s as v, x as y, y as ee } from "../vendors/lexical-hZliMgDv.js";
9
- import { FONT_SIZES as b } from "./constants/index.js";
10
- import { AlignCenterOutlined as x, AlignLeftOutlined as S, AlignRightOutlined as C } from "@ant-design/icons";
11
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
12
- import D, { createContext as O, forwardRef as k, useCallback as A, useContext as j, useImperativeHandle as M, useMemo as N, useRef as P, useState as F } from "react";
13
- import { Button as I, Form as L, Input as R, message as z } from "antd";
14
- import { AnimatePresence as te, motion as B } from "motion/react";
1
+ import { t as e } from "../Icon/Icon-CTZCSuVg.js";
2
+ import { t } from "../vendors/useLocale-BXnqO-Ju.js";
3
+ import { t as n } from "../Modal/Modal-DQ5bptu_.js";
4
+ import { t as r } from "../ColorPicker/ColorPicker-C1kG_eI-.js";
5
+ import { t as i } from "../CheckBox/CheckBox-Cz6KW9Lw.js";
6
+ import { t as a } from "../DropDown/DropDown-BAPBTglm.js";
7
+ import { FONT_SIZES as o } from "./constants/index.js";
8
+ import { AlignCenterOutlined as s, AlignLeftOutlined as c, AlignRightOutlined as l } from "@ant-design/icons";
9
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import p, { createContext as m, forwardRef as h, useCallback as g, useContext as _, useImperativeHandle as v, useMemo as y, useRef as b, useState as x } from "react";
11
+ import S from "clsx";
12
+ import { Button as C, Form as w, Input as T, message as E } from "antd";
13
+ import { AnimatePresence as D, motion as O } from "motion/react";
14
+ import { $createParagraphNode as k, $createTextNode as ee, $getRoot as te, $getSelection as A, $isElementNode as j, $isRangeSelection as M, FORMAT_ELEMENT_COMMAND as ne, FORMAT_TEXT_COMMAND as N, createCommand as P } from "lexical";
15
+ import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
16
+ import { $patchStyleText as I } from "@lexical/selection";
17
+ import { $createLinkNode as L, $toggleLink as R, TOGGLE_LINK_COMMAND as z } from "@lexical/link";
15
18
  //#region src/components/Editor/ToolbarPlugin/context/TextFormatsContext.tsx
16
- var V = O(null), H = {
19
+ var B = m(null), V = {
17
20
  "lexical-editor__toolbar-button": "_lexical-editor__toolbar-button_1y192_1",
18
21
  "lexical-editor__toolbar-button-active": "_lexical-editor__toolbar-button-active_1y192_7"
19
- }, U = (t) => {
20
- let { icon: r, tooltip: i, onClick: a, disabled: o = !1, active: s = !1, size: c = 14 } = t;
21
- return /* @__PURE__ */ T("button", {
22
- className: n(H["lexical-editor__toolbar-button"], { [H["lexical-editor__toolbar-button-active"]]: s }),
22
+ }, H = (t) => {
23
+ let { icon: n, tooltip: r, onClick: i, disabled: a = !1, active: o = !1, size: s = 14 } = t;
24
+ return /* @__PURE__ */ d("button", {
25
+ className: S(V["lexical-editor__toolbar-button"], { [V["lexical-editor__toolbar-button-active"]]: o }),
23
26
  type: "button",
24
- onClick: a,
25
- disabled: o,
26
- title: i,
27
- children: D.isValidElement(r) ? r : /* @__PURE__ */ T(e, {
28
- name: r,
29
- size: c
27
+ onClick: i,
28
+ disabled: a,
29
+ title: r,
30
+ children: p.isValidElement(n) ? n : /* @__PURE__ */ d(e, {
31
+ name: n,
32
+ size: s
30
33
  })
31
34
  });
32
- }, W = () => {
33
- let e = j(V);
35
+ }, U = () => {
36
+ let e = _(B);
34
37
  if (!e) throw Error("useTextFormatsContext must be used within TextFormatsProvider");
35
38
  return e;
36
- }, ne = () => {
37
- let [e] = u(), n = W(), { t: r } = t(), i = n.bold;
38
- return /* @__PURE__ */ T(U, {
39
+ }, W = () => {
40
+ let [e] = F(), n = U(), { t: r } = t(), i = n.bold;
41
+ return /* @__PURE__ */ d(H, {
39
42
  icon: "bold",
40
43
  tooltip: r("editor.bold"),
41
44
  active: i,
42
45
  onClick: () => {
43
- e.dispatchCommand(h, "bold");
46
+ e.dispatchCommand(N, "bold");
44
47
  }
45
48
  });
46
49
  }, re = () => {
47
- let [e] = u(), n = W(), { t: r } = t(), i = n.underline;
48
- return /* @__PURE__ */ T(U, {
50
+ let [e] = F(), n = U(), { t: r } = t(), i = n.underline;
51
+ return /* @__PURE__ */ d(H, {
49
52
  icon: "underline",
50
53
  tooltip: r("editor.underline"),
51
54
  active: i,
52
55
  onClick: () => {
53
- e.dispatchCommand(h, "underline");
56
+ e.dispatchCommand(N, "underline");
54
57
  }
55
58
  });
56
59
  }, ie = () => {
57
- let [e] = u(), n = W(), { t: r } = t(), i = n.italic;
58
- return /* @__PURE__ */ T(U, {
60
+ let [e] = F(), n = U(), { t: r } = t(), i = n.italic;
61
+ return /* @__PURE__ */ d(H, {
59
62
  icon: "italic",
60
63
  tooltip: r("editor.italic"),
61
64
  active: i,
62
65
  onClick: () => {
63
- e.dispatchCommand(h, "italic");
66
+ e.dispatchCommand(N, "italic");
64
67
  }
65
68
  });
66
69
  }, ae = () => {
67
- let [e] = u(), t = W();
68
- return /* @__PURE__ */ T(o, {
69
- menus: N(() => b.map((e) => ({
70
+ let [e] = F(), t = U();
71
+ return /* @__PURE__ */ d(a, {
72
+ menus: y(() => o.map((e) => ({
70
73
  key: e.value,
71
74
  label: e.label
72
75
  })), []),
73
- onClick: A((t) => {
76
+ onClick: g((t) => {
74
77
  let n = t.key;
75
78
  e.update(() => {
76
- let e = y();
77
- f(e) && p(e, { "font-size": n });
79
+ let e = A();
80
+ M(e) && I(e, { "font-size": n });
78
81
  });
79
82
  }, [e]),
80
83
  activeKey: [t.fontSize],
@@ -83,104 +86,104 @@ var V = O(null), H = {
83
86
  width: "60px",
84
87
  minWidth: "60px"
85
88
  },
86
- children: /* @__PURE__ */ T("div", {
89
+ children: /* @__PURE__ */ d("div", {
87
90
  className: "dropdown__trigger inline-flex",
88
- children: /* @__PURE__ */ T(U, {
91
+ children: /* @__PURE__ */ d(H, {
89
92
  icon: "fontsize",
90
93
  tooltip: "字号",
91
94
  active: !1
92
95
  })
93
96
  })
94
97
  });
95
- }, G = O(null), K = () => {
96
- let e = j(G);
98
+ }, G = m(null), K = () => {
99
+ let e = _(G);
97
100
  if (!e) throw Error("useEditorContainer must be used within EditorContainerProvider");
98
101
  return e;
99
102
  }, oe = () => {
100
- let [e] = u(), n = W(), { t: r } = t(), { getPopupContainer: a } = K(), o = A((t) => {
103
+ let [e] = F(), n = U(), { t: i } = t(), { getPopupContainer: a } = K(), o = g((t) => {
101
104
  e.update(() => {
102
- let e = y();
103
- f(e) && p(e, { color: t });
105
+ let e = A();
106
+ M(e) && I(e, { color: t });
104
107
  });
105
108
  }, [e]);
106
- return /* @__PURE__ */ T(i, {
109
+ return /* @__PURE__ */ d(r, {
107
110
  value: n.fontColor,
108
111
  onChange: o,
109
112
  placement: "bottom-start",
110
113
  getPopupContainer: a,
111
- children: /* @__PURE__ */ T("div", {
114
+ children: /* @__PURE__ */ d("div", {
112
115
  className: "trigger-picker inline-flex",
113
- children: /* @__PURE__ */ T(U, {
116
+ children: /* @__PURE__ */ d(H, {
114
117
  icon: "fontcolor",
115
- tooltip: r("editor.fontColor"),
118
+ tooltip: i("editor.fontColor"),
116
119
  onClick: () => {},
117
120
  active: !1
118
121
  })
119
122
  })
120
123
  });
121
124
  }, se = () => {
122
- let [e] = u(), n = W(), { t: r } = t(), { getPopupContainer: a } = K(), o = A((t) => {
125
+ let [e] = F(), n = U(), { t: i } = t(), { getPopupContainer: a } = K(), o = g((t) => {
123
126
  e.update(() => {
124
- let e = y();
125
- f(e) && p(e, { "background-color": t });
127
+ let e = A();
128
+ M(e) && I(e, { "background-color": t });
126
129
  });
127
130
  }, [e]);
128
- return /* @__PURE__ */ T(i, {
131
+ return /* @__PURE__ */ d(r, {
129
132
  value: n.backgroundColor,
130
133
  onChange: o,
131
134
  placement: "bottom-start",
132
135
  getPopupContainer: a,
133
- children: /* @__PURE__ */ T("div", {
136
+ children: /* @__PURE__ */ d("div", {
134
137
  className: "trigger-picker inline-flex",
135
- children: /* @__PURE__ */ T(U, {
138
+ children: /* @__PURE__ */ d(H, {
136
139
  icon: "fill",
137
- tooltip: r("editor.fill"),
140
+ tooltip: i("editor.fill"),
138
141
  onClick: () => {},
139
142
  active: !1
140
143
  })
141
144
  })
142
145
  });
143
146
  }, ce = () => {
144
- let [e] = u(), { align: n } = W(), { t: r } = t(), i = [
147
+ let [e] = F(), { align: n } = U(), { t: r } = t(), i = [
145
148
  {
146
149
  key: "left",
147
150
  label: r("leftAlign"),
148
- icon: /* @__PURE__ */ T(S, {})
151
+ icon: /* @__PURE__ */ d(c, {})
149
152
  },
150
153
  {
151
154
  key: "center",
152
155
  label: r("editor.centerAlign"),
153
- icon: /* @__PURE__ */ T(x, {})
156
+ icon: /* @__PURE__ */ d(s, {})
154
157
  },
155
158
  {
156
159
  key: "right",
157
160
  label: r("editor.rightAlign"),
158
- icon: /* @__PURE__ */ T(C, {})
161
+ icon: /* @__PURE__ */ d(l, {})
159
162
  }
160
- ], a = A((t) => {
161
- e.dispatchCommand(s, t);
162
- }, [e]), c = i.map((e) => ({
163
+ ], o = g((t) => {
164
+ e.dispatchCommand(ne, t);
165
+ }, [e]), u = i.map((e) => ({
163
166
  key: e.key,
164
- label: /* @__PURE__ */ E("div", {
167
+ label: /* @__PURE__ */ f("div", {
165
168
  className: "flex items-center gap-2",
166
- children: [e.icon, /* @__PURE__ */ T("span", { children: e.label })]
169
+ children: [e.icon, /* @__PURE__ */ d("span", { children: e.label })]
167
170
  })
168
- })), l = A((e) => {
169
- a(e.key);
170
- }, [a]), d = i.find((e) => e.key === n)?.icon || /* @__PURE__ */ T(S, {});
171
- return /* @__PURE__ */ T(o, {
172
- menus: c,
173
- onClick: l,
171
+ })), p = g((e) => {
172
+ o(e.key);
173
+ }, [o]), m = i.find((e) => e.key === n)?.icon || /* @__PURE__ */ d(c, {});
174
+ return /* @__PURE__ */ d(a, {
175
+ menus: u,
176
+ onClick: p,
174
177
  showSearch: !1,
175
178
  activeKey: [n],
176
179
  style: {
177
180
  width: "110px",
178
181
  minWidth: "110px"
179
182
  },
180
- children: /* @__PURE__ */ T("div", {
183
+ children: /* @__PURE__ */ d("div", {
181
184
  className: "trigger-dropdown inline-flex text-sm",
182
- children: /* @__PURE__ */ T(U, {
183
- icon: d,
185
+ children: /* @__PURE__ */ d(H, {
186
+ icon: m,
184
187
  tooltip: r("editor.alignment"),
185
188
  onClick: () => {},
186
189
  active: !1
@@ -188,103 +191,103 @@ var V = O(null), H = {
188
191
  })
189
192
  });
190
193
  }, le = () => {
191
- let [e] = u(), { link: n } = W(), { t: i } = t(), [o, s] = F(!1), [c, p] = F(""), [m, h] = F(""), [b, x] = F(!0), [S, C] = z.useMessage(), D = A((e) => e ? e.startsWith("@") ? "javascript:void(0);" : e.match(/^https?:\/\//) ? e : `http://${e}` : "", []), O = () => {
194
+ let [e] = F(), { link: r } = U(), { t: a } = t(), [o, s] = x(!1), [c, l] = x(""), [p, m] = x(""), [h, _] = x(!0), [v, y] = E.useMessage(), b = g((e) => e ? e.startsWith("@") ? "javascript:void(0);" : e.match(/^https?:\/\//) ? e : `http://${e}` : "", []), S = () => {
192
195
  if (!c) {
193
- S.warning(i("editor.linkAddressEmpty"));
196
+ v.warning(a("editor.linkAddressEmpty"));
194
197
  return;
195
198
  }
196
- let t = D(c);
199
+ let t = b(c);
197
200
  e.update(() => {
198
- let e = b ? {
201
+ let e = h ? {
199
202
  target: "_blank",
200
203
  rel: "noopener noreferrer",
201
204
  title: c
202
- } : { title: c }, n = y(), r = _(t, e), i = g(m || c);
203
- if (f(n)) n.isCollapsed() ? (r.append(i), n.insertNodes([r])) : v(t);
205
+ } : { title: c }, n = A(), r = L(t, e), i = ee(p || c);
206
+ if (M(n)) n.isCollapsed() ? (r.append(i), n.insertNodes([r])) : R(t);
204
207
  else {
205
208
  r.append(i);
206
- let e = d(), t = e.getLastChild();
207
- if (l(t) && t.isEmpty()) t.append(r);
209
+ let e = te(), t = e.getLastChild();
210
+ if (j(t) && t.isEmpty()) t.append(r);
208
211
  else {
209
- let t = ee();
212
+ let t = k();
210
213
  t.append(r), e.append(t);
211
214
  }
212
215
  }
213
- }), p(""), h(""), s(!1);
214
- }, k = A(() => {
215
- n ? (p(n.link === "javascript:void(0);" ? "" : n.link), h(n.linkText)) : (p(""), h("")), s(!0);
216
- }, [n]);
217
- return /* @__PURE__ */ E(w, { children: [
218
- /* @__PURE__ */ T(U, {
216
+ }), l(""), m(""), s(!1);
217
+ }, w = g(() => {
218
+ r ? (l(r.link === "javascript:void(0);" ? "" : r.link), m(r.linkText)) : (l(""), m("")), s(!0);
219
+ }, [r]);
220
+ return /* @__PURE__ */ f(u, { children: [
221
+ /* @__PURE__ */ d(H, {
219
222
  icon: "Insertlink",
220
- tooltip: i("link"),
221
- onClick: k,
222
- active: !!n?.link
223
+ tooltip: a("link"),
224
+ onClick: w,
225
+ active: !!r?.link
223
226
  }),
224
- C,
225
- /* @__PURE__ */ T(r, {
226
- title: i("link"),
227
+ y,
228
+ /* @__PURE__ */ d(n, {
229
+ title: a("link"),
227
230
  open: o,
228
231
  onOpenChange: s,
229
- children: /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("div", {
232
+ children: /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
230
233
  className: "px-[20px] pb-[60px] pt-[40px]",
231
- children: [/* @__PURE__ */ E("div", {
234
+ children: [/* @__PURE__ */ f("div", {
232
235
  className: "flex items-center relative",
233
236
  children: [
234
- /* @__PURE__ */ T("label", {
237
+ /* @__PURE__ */ d("label", {
235
238
  className: "w-[80px] shrink-0",
236
- children: i("linkAddress")
239
+ children: a("linkAddress")
237
240
  }),
238
- /* @__PURE__ */ T(R, {
241
+ /* @__PURE__ */ d(T, {
239
242
  value: c,
240
- onChange: (e) => p(e.target.value),
241
- placeholder: i("editor.linkTip")
243
+ onChange: (e) => l(e.target.value),
244
+ placeholder: a("editor.linkTip")
242
245
  }),
243
- /* @__PURE__ */ T("div", {
246
+ /* @__PURE__ */ d("div", {
244
247
  className: "absolute bottom-[-30px] left-[80px]",
245
- children: /* @__PURE__ */ T("p", {
248
+ children: /* @__PURE__ */ d("p", {
246
249
  className: "text-[#999]",
247
250
  children: "链接可用 @表单别名,用于应用内表单跳转"
248
251
  })
249
252
  })
250
253
  ]
251
- }), /* @__PURE__ */ E("div", {
254
+ }), /* @__PURE__ */ f("div", {
252
255
  className: "flex items-center mt-[40px]",
253
- children: [/* @__PURE__ */ T("label", {
256
+ children: [/* @__PURE__ */ d("label", {
254
257
  className: "w-[80px] shrink-0",
255
- children: i("showContent")
256
- }), /* @__PURE__ */ T(R, {
257
- value: m,
258
- onChange: (e) => h(e.target.value)
258
+ children: a("showContent")
259
+ }), /* @__PURE__ */ d(T, {
260
+ value: p,
261
+ onChange: (e) => m(e.target.value)
259
262
  })]
260
263
  })]
261
- }), /* @__PURE__ */ E("div", {
264
+ }), /* @__PURE__ */ f("div", {
262
265
  className: "py-[14px] px-[20px] flex justify-between items-center border-t-[1px] border-solid border-[#e0e0e0]",
263
- children: [/* @__PURE__ */ T("div", { children: /* @__PURE__ */ T(a, {
264
- checked: b,
265
- onChange: (e) => x(e),
266
- children: i("openInNewTab")
267
- }) }), /* @__PURE__ */ E("div", {
266
+ children: [/* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(i, {
267
+ checked: h,
268
+ onChange: (e) => _(e),
269
+ children: a("openInNewTab")
270
+ }) }), /* @__PURE__ */ f("div", {
268
271
  className: "flex gap-[15px]",
269
- children: [/* @__PURE__ */ T(I, {
272
+ children: [/* @__PURE__ */ d(C, {
270
273
  onClick: () => s(!1),
271
- children: i("cancel")
272
- }), /* @__PURE__ */ T(I, {
274
+ children: a("cancel")
275
+ }), /* @__PURE__ */ d(C, {
273
276
  type: "primary",
274
- onClick: O,
275
- children: i("confirm")
277
+ onClick: S,
278
+ children: a("confirm")
276
279
  })]
277
280
  })]
278
281
  })] })
279
282
  })
280
283
  ] });
281
284
  }, ue = () => {
282
- let [e] = u(), { link: n } = W(), { t: r } = t();
283
- return /* @__PURE__ */ T(U, {
285
+ let [e] = F(), { link: n } = U(), { t: r } = t();
286
+ return /* @__PURE__ */ d(H, {
284
287
  icon: "cancellink",
285
288
  tooltip: r("cancelLink"),
286
289
  onClick: () => {
287
- n && e.dispatchCommand(m, null);
290
+ n && e.dispatchCommand(z, null);
288
291
  }
289
292
  });
290
293
  }, q = {
@@ -308,27 +311,27 @@ var V = O(null), H = {
308
311
  "picture-modal__preview-delete": "_picture-modal__preview-delete_qyj1h_113",
309
312
  "picture-modal__upload-text": "_picture-modal__upload-text_qyj1h_121",
310
313
  "picture-modal__footer": "_picture-modal__footer_qyj1h_125"
311
- }, J = k((e, n) => {
312
- let [r] = L.useForm(), [i, a] = F(""), { t: o } = t(), s = (e) => /^https?:\/\/.+/i.test(e);
313
- return M(n, () => ({ getValue: async () => {
314
+ }, J = h((e, n) => {
315
+ let [r] = w.useForm(), [i, a] = x(""), { t: o } = t(), s = (e) => /^https?:\/\/.+/i.test(e);
316
+ return v(n, () => ({ getValue: async () => {
314
317
  try {
315
318
  return await r.validateFields(), i;
316
319
  } catch {
317
320
  throw Error("URL validation failed");
318
321
  }
319
- } })), /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
322
+ } })), /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", {
320
323
  className: q["picture-modal__content-title"],
321
324
  "data-title": o("editor.imageUrlNote"),
322
325
  children: o("editor.enterImageUrl")
323
- }), /* @__PURE__ */ T(L, {
326
+ }), /* @__PURE__ */ d(w, {
324
327
  form: r,
325
- children: /* @__PURE__ */ T(L.Item, {
328
+ children: /* @__PURE__ */ d(w.Item, {
326
329
  name: "url",
327
330
  rules: [{
328
331
  required: !0,
329
332
  message: o("editor.pleaseEnterImageUrl")
330
333
  }, { validator: (e, t) => !t || s(t) ? Promise.resolve() : Promise.reject(Error(o("editor.pleaseEnterValidImageUrl"))) }],
331
- children: /* @__PURE__ */ T(R, {
334
+ children: /* @__PURE__ */ d(T, {
332
335
  placeholder: o("editor.pleaseEnterImageUrl"),
333
336
  value: i,
334
337
  onChange: (e) => a(e.target.value)
@@ -339,17 +342,17 @@ var V = O(null), H = {
339
342
  J.displayName = "LinkInput";
340
343
  //#endregion
341
344
  //#region src/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.tsx
342
- var Y = k((n, r) => {
343
- let [i, a] = F(null), [o, s] = F(!1), [c, l] = F(null), u = P(null), [d, f] = z.useMessage(), { t: p } = t(), m = (e) => (e / 1024).toFixed(1) + "kb", h = (e) => e.type.startsWith("image/") ? e.size > 1048576 ? (d.warning(p("editor.imageSizeNote")), !1) : !0 : (d.warning(p("editor.onlyImageFormatsSupported")), !1), g = (e) => {
344
- h(e) && (a(URL.createObjectURL(e)), l(e));
345
- }, _ = () => {
345
+ var Y = h((n, r) => {
346
+ let [i, a] = x(null), [o, s] = x(!1), [c, l] = x(null), u = b(null), [p, m] = E.useMessage(), { t: h } = t(), g = (e) => (e / 1024).toFixed(1) + "kb", _ = (e) => e.type.startsWith("image/") ? e.size > 1048576 ? (p.warning(h("editor.imageSizeNote")), !1) : !0 : (p.warning(h("editor.onlyImageFormatsSupported")), !1), y = (e) => {
347
+ _(e) && (a(URL.createObjectURL(e)), l(e));
348
+ }, S = () => {
346
349
  u.current?.click();
347
- }, v = (e) => {
350
+ }, C = (e) => {
348
351
  let t = e.target.files?.[0];
349
- t && g(t);
352
+ t && y(t);
350
353
  };
351
- return M(r, () => ({ getValue: async () => {
352
- if (!c) throw d.warning(p("editor.pleaseUploadImageFirst")), Error(p("editor.pleaseUploadImageFirst"));
354
+ return v(r, () => ({ getValue: async () => {
355
+ if (!c) throw p.warning(h("editor.pleaseUploadImageFirst")), Error(h("editor.pleaseUploadImageFirst"));
353
356
  return new Promise((e, t) => {
354
357
  let n = new FileReader();
355
358
  n.onload = () => {
@@ -358,10 +361,10 @@ var Y = k((n, r) => {
358
361
  fileName: c.name
359
362
  });
360
363
  }, n.onerror = () => {
361
- t(Error(p("editor.operationFailed")));
364
+ t(Error(h("editor.operationFailed")));
362
365
  }, n.readAsDataURL(c);
363
366
  });
364
- } })), /* @__PURE__ */ E("div", {
367
+ } })), /* @__PURE__ */ f("div", {
365
368
  className: "h-full",
366
369
  onDragOver: (e) => {
367
370
  e.preventDefault(), s(!0);
@@ -372,25 +375,25 @@ var Y = k((n, r) => {
372
375
  onDrop: (e) => {
373
376
  e.preventDefault(), s(!1);
374
377
  let t = e.dataTransfer.files[0];
375
- t && g(t);
378
+ t && y(t);
376
379
  },
377
380
  children: [
378
- /* @__PURE__ */ T("div", {
381
+ /* @__PURE__ */ d("div", {
379
382
  className: q["picture-modal__content-title"],
380
- "data-title": p("editor.imageSizeNote"),
381
- children: p("editor.uploadImage")
383
+ "data-title": h("editor.imageSizeNote"),
384
+ children: h("editor.uploadImage")
382
385
  }),
383
- /* @__PURE__ */ E("div", {
386
+ /* @__PURE__ */ f("div", {
384
387
  className: `${q["picture-modal__upload-area"]} ${o ? q["picture-modal__upload-area--dragging"] : ""}`,
385
- onClick: _,
386
- children: [/* @__PURE__ */ T(e, { name: "upload" }), /* @__PURE__ */ T("span", {
388
+ onClick: S,
389
+ children: [/* @__PURE__ */ d(e, { name: "upload" }), /* @__PURE__ */ d("span", {
387
390
  className: q["picture-modal__upload-text"],
388
- children: p("editor.clickOrDragToUpload")
391
+ children: h("editor.clickOrDragToUpload")
389
392
  })]
390
393
  }),
391
- /* @__PURE__ */ T(te, {
394
+ /* @__PURE__ */ d(D, {
392
395
  mode: "wait",
393
- children: i && c && /* @__PURE__ */ E(B.div, {
396
+ children: i && c && /* @__PURE__ */ f(O.div, {
394
397
  className: q["picture-modal__preview"],
395
398
  initial: {
396
399
  opacity: 0,
@@ -417,7 +420,7 @@ var Y = k((n, r) => {
417
420
  ]
418
421
  },
419
422
  children: [
420
- /* @__PURE__ */ T(B.div, {
423
+ /* @__PURE__ */ d(O.div, {
421
424
  className: q["picture-modal__preview-image"],
422
425
  initial: {
423
426
  opacity: 0,
@@ -431,16 +434,16 @@ var Y = k((n, r) => {
431
434
  delay: .1,
432
435
  duration: .2
433
436
  },
434
- children: /* @__PURE__ */ T("img", {
437
+ children: /* @__PURE__ */ d("img", {
435
438
  src: i,
436
439
  style: {
437
440
  maxWidth: "120px",
438
441
  height: "80px"
439
442
  },
440
- alt: p("editor.previewImage")
443
+ alt: h("editor.previewImage")
441
444
  })
442
445
  }),
443
- /* @__PURE__ */ E(B.div, {
446
+ /* @__PURE__ */ f(O.div, {
444
447
  className: q["picture-modal__preview-info"],
445
448
  initial: {
446
449
  opacity: 0,
@@ -454,15 +457,15 @@ var Y = k((n, r) => {
454
457
  delay: .15,
455
458
  duration: .2
456
459
  },
457
- children: [/* @__PURE__ */ T("div", {
460
+ children: [/* @__PURE__ */ d("div", {
458
461
  className: q["picture-modal__preview-filename"],
459
462
  children: c.name
460
- }), /* @__PURE__ */ T("div", {
463
+ }), /* @__PURE__ */ d("div", {
461
464
  className: q["picture-modal__preview-size"],
462
- children: m(c.size)
465
+ children: g(c.size)
463
466
  })]
464
467
  }),
465
- /* @__PURE__ */ T(B.div, {
468
+ /* @__PURE__ */ d(O.div, {
466
469
  className: q["picture-modal__preview-delete"],
467
470
  role: "button",
468
471
  onClick: () => {
@@ -482,38 +485,38 @@ var Y = k((n, r) => {
482
485
  },
483
486
  whileHover: { scale: 1.1 },
484
487
  whileTap: { scale: .95 },
485
- children: /* @__PURE__ */ T(e, { name: "delete" })
488
+ children: /* @__PURE__ */ d(e, { name: "delete" })
486
489
  })
487
490
  ]
488
491
  }, "preview")
489
492
  }),
490
- /* @__PURE__ */ T("input", {
493
+ /* @__PURE__ */ d("input", {
491
494
  ref: u,
492
495
  type: "file",
493
496
  accept: "image/*",
494
497
  style: { display: "none" },
495
- onChange: v
498
+ onChange: C
496
499
  }),
497
- f
500
+ m
498
501
  ]
499
502
  });
500
503
  });
501
504
  Y.displayName = "UploadImage";
502
505
  //#endregion
503
506
  //#region src/components/Editor/commands/ImageCommands.ts
504
- var X = c("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
505
- let { t: n } = t(), [i] = u(), [a, o] = F(!1), s = P(null), c = P(null), l = [{
507
+ var X = P("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
508
+ let { t: r } = t(), [i] = F(), [a, o] = x(!1), s = b(null), c = b(null), l = [{
506
509
  key: "upload",
507
- title: n("editor.uploadImage"),
508
- icon: /* @__PURE__ */ T(e, { name: "picture" })
510
+ title: r("editor.uploadImage"),
511
+ icon: /* @__PURE__ */ d(e, { name: "picture" })
509
512
  }, {
510
513
  key: "url",
511
- title: n("editor.imageUrl"),
512
- icon: /* @__PURE__ */ T(e, { name: "Insertlink" })
513
- }], [d, f] = F(l[0].key), p = () => l.findIndex((e) => e.key === d) * 40, m = async () => {
514
+ title: r("editor.imageUrl"),
515
+ icon: /* @__PURE__ */ d(e, { name: "Insertlink" })
516
+ }], [p, m] = x(l[0].key), h = () => l.findIndex((e) => e.key === p) * 40, g = async () => {
514
517
  try {
515
518
  let e = "", t = "";
516
- if (d === "upload" && c.current) {
519
+ if (p === "upload" && c.current) {
517
520
  let n = await c.current.getValue();
518
521
  e = n.src, t = n.fileName;
519
522
  } else s.current && (e = await s.current.getValue(), t = e);
@@ -522,52 +525,52 @@ var X = c("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
522
525
  altText: t
523
526
  }), o(!1);
524
527
  } catch (e) {
525
- z.error(e instanceof Error ? e.message : n("editor.operationFailed"));
528
+ E.error(e instanceof Error ? e.message : r("editor.operationFailed"));
526
529
  }
527
- }, h = {
528
- upload: /* @__PURE__ */ T(Y, { ref: c }),
529
- url: /* @__PURE__ */ T(J, { ref: s })
530
+ }, _ = {
531
+ upload: /* @__PURE__ */ d(Y, { ref: c }),
532
+ url: /* @__PURE__ */ d(J, { ref: s })
530
533
  };
531
- return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(U, {
534
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(H, {
532
535
  icon: "picture",
533
- tooltip: n("picture"),
536
+ tooltip: r("picture"),
534
537
  onClick: () => o(!0)
535
- }), /* @__PURE__ */ E(r, {
536
- title: n("addPicture"),
538
+ }), /* @__PURE__ */ f(n, {
539
+ title: r("addPicture"),
537
540
  open: a,
538
541
  onOpenChange: o,
539
542
  width: "620px",
540
- children: [/* @__PURE__ */ E("div", {
543
+ children: [/* @__PURE__ */ f("div", {
541
544
  className: q["picture-modal__container"],
542
- children: [/* @__PURE__ */ E("div", {
545
+ children: [/* @__PURE__ */ f("div", {
543
546
  className: q["picture-modal__sidebar"],
544
- children: [/* @__PURE__ */ T("div", {
547
+ children: [/* @__PURE__ */ d("div", {
545
548
  className: q["picture-modal__slider"],
546
- style: { transform: `translateY(${p()}px)` }
547
- }), /* @__PURE__ */ T("ul", {
549
+ style: { transform: `translateY(${h()}px)` }
550
+ }), /* @__PURE__ */ d("ul", {
548
551
  className: q["picture-modal__menu-list"],
549
- children: l.map((e) => /* @__PURE__ */ E("li", {
550
- className: `${q["picture-modal__menu-item"]} ${d === e.key ? q["picture-modal__menu-item--active"] : ""}`,
551
- onClick: () => f(e.key),
552
- children: [/* @__PURE__ */ T("span", {
552
+ children: l.map((e) => /* @__PURE__ */ f("li", {
553
+ className: `${q["picture-modal__menu-item"]} ${p === e.key ? q["picture-modal__menu-item--active"] : ""}`,
554
+ onClick: () => m(e.key),
555
+ children: [/* @__PURE__ */ d("span", {
553
556
  className: q["picture-modal__menu-icon"],
554
557
  children: e.icon
555
- }), /* @__PURE__ */ T("span", { children: e.title })]
558
+ }), /* @__PURE__ */ d("span", { children: e.title })]
556
559
  }, e.title))
557
560
  })]
558
- }), /* @__PURE__ */ T("div", {
561
+ }), /* @__PURE__ */ d("div", {
559
562
  className: q["picture-modal__content"],
560
- children: h[d]
563
+ children: _[p]
561
564
  })]
562
- }), /* @__PURE__ */ E("div", {
565
+ }), /* @__PURE__ */ f("div", {
563
566
  className: q["picture-modal__footer"],
564
- children: [/* @__PURE__ */ T(I, {
567
+ children: [/* @__PURE__ */ d(C, {
565
568
  onClick: () => o(!1),
566
- children: n("cancel")
567
- }), /* @__PURE__ */ T(I, {
569
+ children: r("cancel")
570
+ }), /* @__PURE__ */ d(C, {
568
571
  type: "primary",
569
- onClick: m,
570
- children: n("confirm")
572
+ onClick: g,
573
+ children: r("confirm")
571
574
  })]
572
575
  })]
573
576
  })] });
@@ -577,7 +580,7 @@ var X = c("INSERT_INLINE_IMAGE_COMMAND"), de = () => {
577
580
  }, fe = (e) => {
578
581
  Z.delete(e);
579
582
  }, pe = (e) => Z.get(e), me = () => Array.from(Z.keys()), $ = {
580
- bold: ne,
583
+ bold: W,
581
584
  underline: re,
582
585
  italic: ie,
583
586
  fontSize: ae,
@@ -592,4 +595,4 @@ Object.entries($).forEach(([e, t]) => {
592
595
  Q(e, t);
593
596
  });
594
597
  //#endregion
595
- export { fe as a, U as c, Q as i, V as l, pe as n, X as o, me as r, G as s, $ as t };
598
+ export { fe as a, H as c, Q as i, B as l, pe as n, X as o, me as r, G as s, $ as t };