@baishuyun/ui-base 2.3.3 → 2.3.4

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 (52) 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-BoNqxIRo.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/index.js +19 -20
  33. package/dist/vendors/Tree-nIRgDY2s.js +231 -0
  34. package/dist/vendors/{color-BPWy9DvT.js → color-CyuNdAfc.js} +2 -2
  35. package/package.json +3 -1
  36. package/dist/CheckBox/CheckBox-q2vu7qf7.js +0 -33
  37. package/dist/ColorPicker/ColorPicker-Bh4KTHxh.js +0 -168
  38. package/dist/DropDown/DropDown-BEzloRRM.js +0 -162
  39. package/dist/Icon/Icon-DXmPqVzg.js +0 -19
  40. package/dist/Select/Select-DoQO-Xi5.js +0 -729
  41. package/dist/vendors/Tree-DgwG7Unx.js +0 -231
  42. package/dist/vendors/clsx-DNOE4Gl8.js +0 -16
  43. package/dist/vendors/fuse.js-BKtvbTjL.js +0 -877
  44. package/dist/vendors/lexical-hZliMgDv.js +0 -6439
  45. package/dist/vendors/lodash-es-Bu9xU1fK.js +0 -334
  46. package/dist/vendors/simplebar-react-CFlS-Nm9.js +0 -370
  47. package/dist/vendors/tinycolor2-DToeAEPD.js +0 -726
  48. /package/dist/Loading/{Loading-Bi5NO-Ky.js → Loading-Dy5A--HK.js} +0 -0
  49. /package/dist/NotFoundContent/{NotFoundContent-CTPpcZOt.js → NotFoundContent-1-41e1rN.js} +0 -0
  50. /package/dist/vendors/{animations-C5JKFkz4.js → animations-DvjIfVz9.js} +0 -0
  51. /package/dist/vendors/{useFloatingPortal-BA6P5GxV.js → useFloatingPortal-W4pliYWU.js} +0 -0
  52. /package/dist/vendors/{useLocale-BfT0V1j4.js → useLocale-BXnqO-Ju.js} +0 -0
@@ -1,59 +1,70 @@
1
- import "../Icon/Icon-DXmPqVzg.js";
2
- import "../vendors/useLocale-BfT0V1j4.js";
3
- import { t as e } from "../vendors/clsx-DNOE4Gl8.js";
4
- import "../Modal/Modal-BO1s8pJe.js";
5
- import "../ColorPicker/ColorPicker-Bh4KTHxh.js";
6
- import "../vendors/tinycolor2-DToeAEPD.js";
7
- import "../vendors/color-BPWy9DvT.js";
8
- import "../Select/SelectInputSearch-gp6gcY3x.js";
9
- import "../CheckBox/CheckBox-DFoMXJZz.js";
10
- import "../CheckBox/CheckBox-q2vu7qf7.js";
11
- import "../NotFoundContent/NotFoundContent-CTPpcZOt.js";
12
- import "../vendors/useFloatingPortal-BA6P5GxV.js";
13
- import "../DropDown/DropDown-BEzloRRM.js";
14
- import { C as t, D as n, F as r, I as i, M as a, N as o, O as s, P as c, S as l, T as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, l as y, m as b, o as x, p as ee, r as te, t as ne, u as re, v as ie, w as S, x as C, y as w } from "../vendors/lexical-hZliMgDv.js";
15
- import { a as T, c as E, i as D, l as O, n as k, o as ae, r as oe, s as se } from "./Buttons-ClWtl3G-.js";
16
- import { DEFAULT_BACKGROUND_COLOR as A, DEFAULT_FONT_COLOR as j, DEFAULT_FONT_SIZE as M } from "./constants/index.js";
17
- import { Fragment as ce, jsx as N, jsxs as P } from "react/jsx-runtime";
18
- import F, { useCallback as I, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
1
+ import "../Icon/Icon-CTZCSuVg.js";
2
+ import "../vendors/useLocale-BXnqO-Ju.js";
3
+ import "../Modal/Modal-DQ5bptu_.js";
4
+ import "../ColorPicker/ColorPicker-C1kG_eI-.js";
5
+ import "../vendors/color-CyuNdAfc.js";
6
+ import "../Select/SelectInputSearch-DMY6Y9B6.js";
7
+ import "../CheckBox/CheckBox-l__wOnmH.js";
8
+ import "../CheckBox/CheckBox-Cz6KW9Lw.js";
9
+ import "../NotFoundContent/NotFoundContent-1-41e1rN.js";
10
+ import "../vendors/useFloatingPortal-W4pliYWU.js";
11
+ import "../DropDown/DropDown-BAPBTglm.js";
12
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s } from "./Buttons-CsKKYGbV.js";
13
+ import { DEFAULT_BACKGROUND_COLOR as c, DEFAULT_FONT_COLOR as l, DEFAULT_FONT_SIZE as u } from "./constants/index.js";
14
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
15
+ import m, { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
16
+ import b from "clsx";
17
+ import { LexicalComposer as x } from "@lexical/react/LexicalComposer";
18
+ import { RichTextPlugin as S } from "@lexical/react/LexicalRichTextPlugin";
19
+ import { ContentEditable as C } from "@lexical/react/LexicalContentEditable";
20
+ import { HistoryPlugin as w } from "@lexical/react/LexicalHistoryPlugin";
21
+ import { OnChangePlugin as T } from "@lexical/react/LexicalOnChangePlugin";
22
+ import { LexicalErrorBoundary as E } from "@lexical/react/LexicalErrorBoundary";
23
+ import { $generateHtmlFromNodes as D, $generateNodesFromDOM as O } from "@lexical/html";
24
+ import { $applyNodeReplacement as ee, $createParagraphNode as te, $getNodeByKey as ne, $getRoot as re, $getRoot as k, $getSelection as A, $insertNodes as j, $isElementNode as M, $isRangeSelection as N, $isRootOrShadowRoot as ie, $isTextNode as P, COMMAND_PRIORITY_EDITOR as ae, COMMAND_PRIORITY_LOW as oe, DecoratorNode as se, KEY_ENTER_COMMAND as ce, TextNode as F } from "lexical";
25
+ import { useLexicalComposerContext as I, useLexicalComposerContext as L } from "@lexical/react/LexicalComposerContext";
26
+ import { $getSelectionStyleValueForProperty as R, $patchStyleText as z } from "@lexical/selection";
27
+ import { $findMatchingParent as B } from "@lexical/utils";
28
+ import { $isLinkNode as V, AutoLinkNode as H, LinkNode as U } from "@lexical/link";
29
+ import { LinkPlugin as W } from "@lexical/react/LexicalLinkPlugin";
19
30
  //#region src/components/Editor/ToolbarPlugin/ToolbarPlugin.module.scss
20
- var V = {
31
+ var G = {
21
32
  "bsy-lexical__toolbar": "_bsy-lexical__toolbar_n60av_1",
22
33
  "bsy-lexical__toolbar-group": "_bsy-lexical__toolbar-group_n60av_9",
23
34
  "bsy-lexical__toolbar-divider": "_bsy-lexical__toolbar-divider_n60av_15"
24
35
  };
25
36
  //#endregion
26
37
  //#region src/components/Editor/hooks/useTextFormatsState.ts
27
- function H() {
28
- let [e] = i(), [t, a] = B({
38
+ function le() {
39
+ let [e] = L(), [t, n] = y({
29
40
  bold: !1,
30
41
  italic: !1,
31
42
  underline: !1,
32
- fontSize: M,
33
- fontColor: j,
34
- backgroundColor: A,
43
+ fontSize: u,
44
+ fontColor: l,
45
+ backgroundColor: c,
35
46
  align: "left",
36
47
  link: void 0
37
48
  });
38
- return L(() => e.registerUpdateListener(({ editorState: e }) => {
49
+ return g(() => e.registerUpdateListener(({ editorState: e }) => {
39
50
  e.read(() => {
40
- let e = C();
41
- if (u(e)) {
42
- let t = d(e, "font-size", M), i = d(e, "color", j), o = d(e, "background-color", A), s = e.anchor.getNode(), c = s.getKey() === "root" ? s : v(s, (e) => {
51
+ let e = A();
52
+ if (N(e)) {
53
+ let t = R(e, "font-size", u), r = R(e, "color", l), i = R(e, "background-color", c), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : B(a, (e) => {
43
54
  let t = e.getParent();
44
- return t !== null && n(t);
55
+ return t !== null && ie(t);
45
56
  });
46
- c === null && (c = s.getTopLevelElementOrThrow());
47
- let l = {}, u = v(s, x);
48
- u ? (l.link = u.getURL(), l.linkText = u.getTextContent(), l.newBlank = u.getTarget() === "_blank") : l.linkText = e.getTextContent(), a({
57
+ o === null && (o = a.getTopLevelElementOrThrow());
58
+ let s = {}, d = B(a, V);
59
+ d ? (s.link = d.getURL(), s.linkText = d.getTextContent(), s.newBlank = d.getTarget() === "_blank") : s.linkText = e.getTextContent(), n({
49
60
  bold: e.hasFormat("bold"),
50
61
  italic: e.hasFormat("italic"),
51
62
  underline: e.hasFormat("underline"),
52
63
  fontSize: t,
53
- fontColor: i,
54
- backgroundColor: o,
55
- align: r(c) ? c.getFormatType() : "left",
56
- link: l
64
+ fontColor: r,
65
+ backgroundColor: i,
66
+ align: M(o) ? o.getFormatType() : "left",
67
+ link: s
57
68
  });
58
69
  }
59
70
  });
@@ -61,30 +72,30 @@ function H() {
61
72
  }
62
73
  //#endregion
63
74
  //#region src/components/Editor/ToolbarPlugin/context/TextFormatProvider.tsx
64
- var U = (e) => {
65
- let t = H();
66
- return /* @__PURE__ */ N(O.Provider, {
75
+ var ue = (e) => {
76
+ let t = le();
77
+ return /* @__PURE__ */ f(r.Provider, {
67
78
  value: t,
68
79
  children: e.children
69
80
  });
70
- }, W = (e) => {
81
+ }, de = (e) => {
71
82
  let { config: t = [], style: n } = e, r = (e, t) => {
72
- let n = typeof e == "string" ? e : e.name, r = k(n);
73
- return r ? typeof e == "string" ? /* @__PURE__ */ N(r, {}, `${n}-${t}`) : /* @__PURE__ */ N(r, { ...e.props }, `${n}-${t}`) : (console.warn(`[ToolbarPlugin] Button "${n}" is not registered.`), null);
83
+ let n = typeof e == "string" ? e : e.name, r = i(n);
84
+ return r ? typeof e == "string" ? /* @__PURE__ */ f(r, {}, `${n}-${t}`) : /* @__PURE__ */ f(r, { ...e.props }, `${n}-${t}`) : (console.warn(`[ToolbarPlugin] Button "${n}" is not registered.`), null);
74
85
  };
75
- return /* @__PURE__ */ N(U, { children: /* @__PURE__ */ N("div", {
76
- className: V["bsy-lexical__toolbar"],
86
+ return /* @__PURE__ */ f(ue, { children: /* @__PURE__ */ f("div", {
87
+ className: G["bsy-lexical__toolbar"],
77
88
  style: n,
78
- children: t.map((e, n) => /* @__PURE__ */ P("div", {
79
- className: V["bsy-lexical__toolbar-group"],
89
+ children: t.map((e, n) => /* @__PURE__ */ p("div", {
90
+ className: G["bsy-lexical__toolbar-group"],
80
91
  "data-group": e.key,
81
- children: [e.buttons.map((e, t) => r(e, t)), n < t.length - 1 && /* @__PURE__ */ N("div", { className: V["bsy-lexical__toolbar-divider"] })]
92
+ children: [e.buttons.map((e, t) => r(e, t)), n < t.length - 1 && /* @__PURE__ */ f("div", { className: G["bsy-lexical__toolbar-divider"] })]
82
93
  }, e.key + n))
83
94
  }) });
84
- }, G = {
95
+ }, K = {
85
96
  "bsy-lexical-editor": "_bsy-lexical-editor_19ssw_1",
86
97
  "bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_19ssw_6"
87
- }, K = {
98
+ }, q = {
88
99
  imageWrapper: "_imageWrapper_y06h3_1",
89
100
  selected: "_selected_y06h3_8",
90
101
  resizing: "_resizing_y06h3_12",
@@ -94,22 +105,22 @@ var U = (e) => {
94
105
  topRight: "_topRight_y06h3_49",
95
106
  bottomLeft: "_bottomLeft_y06h3_54",
96
107
  bottomRight: "_bottomRight_y06h3_59"
97
- }, le = ({ src: n, altText: r, width: a, height: o, nodeKey: s }) => {
98
- let [c] = i(), [l, d] = B(!1), [f, p] = B(null), m = z(null), [h, g] = B({
99
- width: a || void 0,
100
- height: o || void 0
101
- }), _ = I(() => {
102
- a && o && g({
103
- width: a,
104
- height: o
108
+ }, fe = ({ src: e, altText: t, width: n, height: r, nodeKey: i }) => {
109
+ let [a] = L(), [o, s] = y(!1), [c, l] = y(null), u = v(null), [_, x] = y({
110
+ width: n || void 0,
111
+ height: r || void 0
112
+ }), S = h(() => {
113
+ n && r && x({
114
+ width: n,
115
+ height: r
105
116
  });
106
- }, [a, o]), v = I((e, t) => {
107
- if (e.preventDefault(), e.stopPropagation(), !m.current) return;
108
- let n = h.width || m.current.offsetWidth, r = h.height || m.current.offsetHeight, i = n / r;
109
- (!h.width || !h.height) && g({
117
+ }, [n, r]), C = h((e, t) => {
118
+ if (e.preventDefault(), e.stopPropagation(), !u.current) return;
119
+ let n = _.width || u.current.offsetWidth, r = _.height || u.current.offsetHeight, i = n / r;
120
+ (!_.width || !_.height) && x({
110
121
  width: n,
111
122
  height: r
112
- }), p({
123
+ }), l({
113
124
  isResizing: !0,
114
125
  startX: e.clientX,
115
126
  startY: e.clientY,
@@ -118,105 +129,105 @@ var U = (e) => {
118
129
  aspectRatio: i,
119
130
  direction: t
120
131
  });
121
- }, [h]), y = I((e) => {
122
- if (!f?.isResizing) return;
123
- let t = e.clientX - f.startX, n;
124
- switch (f.direction) {
132
+ }, [_]), w = h((e) => {
133
+ if (!c?.isResizing) return;
134
+ let t = e.clientX - c.startX, n;
135
+ switch (c.direction) {
125
136
  case "bottom-right":
126
- n = Math.max(50, f.startWidth + t);
137
+ n = Math.max(50, c.startWidth + t);
127
138
  break;
128
139
  case "bottom-left":
129
- n = Math.max(50, f.startWidth - t);
140
+ n = Math.max(50, c.startWidth - t);
130
141
  break;
131
142
  case "top-right":
132
- n = Math.max(50, f.startWidth + t);
143
+ n = Math.max(50, c.startWidth + t);
133
144
  break;
134
145
  case "top-left":
135
- n = Math.max(50, f.startWidth - t);
146
+ n = Math.max(50, c.startWidth - t);
136
147
  break;
137
- default: n = Math.max(50, f.startWidth + t);
148
+ default: n = Math.max(50, c.startWidth + t);
138
149
  }
139
- let r = n / f.aspectRatio;
140
- g({
150
+ let r = n / c.aspectRatio;
151
+ x({
141
152
  width: n,
142
153
  height: r
143
154
  });
144
- }, [f]), b = I(() => {
145
- f?.isResizing && (c.update(() => {
146
- let e = t(s);
147
- ue(e) && e.setWidthAndHeight(h.width, h.height);
148
- }), p(null));
155
+ }, [c]), T = h(() => {
156
+ c?.isResizing && (a.update(() => {
157
+ let e = ne(i);
158
+ pe(e) && e.setWidthAndHeight(_.width, _.height);
159
+ }), l(null));
149
160
  }, [
150
- c,
151
- s,
152
- h,
153
- f
161
+ a,
162
+ i,
163
+ _,
164
+ c
154
165
  ]);
155
- F.useEffect(() => {
156
- if (f?.isResizing) return document.addEventListener("mousemove", y), document.addEventListener("mouseup", b), () => {
157
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", b);
166
+ m.useEffect(() => {
167
+ if (c?.isResizing) return document.addEventListener("mousemove", w), document.addEventListener("mouseup", T), () => {
168
+ document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", T);
158
169
  };
159
170
  }, [
160
- f,
161
- y,
162
- b
171
+ c,
172
+ w,
173
+ T
163
174
  ]);
164
- let x = I(() => {
165
- d(!0);
175
+ let E = h(() => {
176
+ s(!0);
166
177
  }, []);
167
- return L(() => c.registerUpdateListener(({ editorState: e }) => {
178
+ return g(() => a.registerUpdateListener(({ editorState: e }) => {
168
179
  e.read(() => {
169
- let e = C();
170
- u(e) && !e.getNodes().some((e) => e.getKey() === s || e.getParent() && e.getParent()?.getKey() === s) && l && d(!1);
180
+ let e = A();
181
+ N(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
171
182
  });
172
183
  }), [
173
- c,
174
- s,
175
- l
176
- ]), L(() => {
184
+ a,
185
+ i,
186
+ o
187
+ ]), g(() => {
177
188
  let e = (e) => {
178
- l && m.current && !m.current.contains(e.target) && d(!1);
189
+ o && u.current && !u.current.contains(e.target) && s(!1);
179
190
  };
180
- if (l) return document.addEventListener("mousedown", e), () => {
191
+ if (o) return document.addEventListener("mousedown", e), () => {
181
192
  document.removeEventListener("mousedown", e);
182
193
  };
183
- }, [l]), /* @__PURE__ */ P("div", {
184
- className: e(K.imageWrapper, {
185
- [K.selected]: l,
186
- [K.resizing]: f?.isResizing
194
+ }, [o]), /* @__PURE__ */ p("div", {
195
+ className: b(q.imageWrapper, {
196
+ [q.selected]: o,
197
+ [q.resizing]: c?.isResizing
187
198
  }),
188
- children: [/* @__PURE__ */ N("img", {
189
- ref: m,
190
- src: n,
191
- alt: r,
192
- className: K.image,
199
+ children: [/* @__PURE__ */ f("img", {
200
+ ref: u,
201
+ src: e,
202
+ alt: t,
203
+ className: q.image,
193
204
  style: {
194
- width: h.width,
195
- height: h.height
205
+ width: _.width,
206
+ height: _.height
196
207
  },
197
- onLoad: _,
198
- onClick: x,
208
+ onLoad: S,
209
+ onClick: E,
199
210
  draggable: !1
200
- }), l && /* @__PURE__ */ P(ce, { children: [
201
- /* @__PURE__ */ N("div", {
202
- className: e(K.resizeHandle, K.bottomRight),
203
- onMouseDown: (e) => v(e, "bottom-right")
211
+ }), o && /* @__PURE__ */ p(d, { children: [
212
+ /* @__PURE__ */ f("div", {
213
+ className: b(q.resizeHandle, q.bottomRight),
214
+ onMouseDown: (e) => C(e, "bottom-right")
204
215
  }),
205
- /* @__PURE__ */ N("div", {
206
- className: e(K.resizeHandle, K.bottomLeft),
207
- onMouseDown: (e) => v(e, "bottom-left")
216
+ /* @__PURE__ */ f("div", {
217
+ className: b(q.resizeHandle, q.bottomLeft),
218
+ onMouseDown: (e) => C(e, "bottom-left")
208
219
  }),
209
- /* @__PURE__ */ N("div", {
210
- className: e(K.resizeHandle, K.topRight),
211
- onMouseDown: (e) => v(e, "top-right")
220
+ /* @__PURE__ */ f("div", {
221
+ className: b(q.resizeHandle, q.topRight),
222
+ onMouseDown: (e) => C(e, "top-right")
212
223
  }),
213
- /* @__PURE__ */ N("div", {
214
- className: e(K.resizeHandle, K.topLeft),
215
- onMouseDown: (e) => v(e, "top-left")
224
+ /* @__PURE__ */ f("div", {
225
+ className: b(q.resizeHandle, q.topLeft),
226
+ onMouseDown: (e) => C(e, "top-left")
216
227
  })
217
228
  ] })]
218
229
  });
219
- }, q = class e extends l {
230
+ }, J = class e extends se {
220
231
  static getType() {
221
232
  return "image";
222
233
  }
@@ -262,7 +273,7 @@ var U = (e) => {
262
273
  n.__width = e, n.__height = t;
263
274
  }
264
275
  decorate() {
265
- return /* @__PURE__ */ N(le, {
276
+ return /* @__PURE__ */ f(fe, {
266
277
  src: this.__src,
267
278
  altText: this.__altText,
268
279
  width: this.__width,
@@ -272,13 +283,13 @@ var U = (e) => {
272
283
  }
273
284
  static importDOM() {
274
285
  return { img: () => ({
275
- conversion: Y,
286
+ conversion: me,
276
287
  priority: 0
277
288
  }) };
278
289
  }
279
290
  static importJSON(e) {
280
291
  let { src: t, altText: n, width: r, height: i } = e;
281
- return J({
292
+ return Y({
282
293
  src: t,
283
294
  altText: n,
284
295
  width: r,
@@ -299,13 +310,13 @@ var U = (e) => {
299
310
  return !0;
300
311
  }
301
312
  };
302
- function J({ src: e, altText: t, width: n, height: r, key: i }) {
303
- return new q(e, t, n, r, i);
313
+ function Y({ src: e, altText: t, width: n, height: r, key: i }) {
314
+ return new J(e, t, n, r, i);
304
315
  }
305
- function ue(e) {
306
- return e instanceof q;
316
+ function pe(e) {
317
+ return e instanceof J;
307
318
  }
308
- function Y(e) {
319
+ function me(e) {
309
320
  if (e instanceof HTMLImageElement) {
310
321
  let { src: t, alt: n, style: r } = e, i, a;
311
322
  if (r.width) {
@@ -316,7 +327,7 @@ function Y(e) {
316
327
  let e = parseInt(r.height, 10);
317
328
  isNaN(e) || (a = e);
318
329
  }
319
- return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: J({
330
+ return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: Y({
320
331
  src: t,
321
332
  altText: n,
322
333
  width: i,
@@ -327,23 +338,23 @@ function Y(e) {
327
338
  }
328
339
  //#endregion
329
340
  //#region src/components/Editor/plugins/ImagePlugin.tsx
330
- function de() {
331
- let [e] = i();
332
- return L(() => e.registerCommand(ae, (e) => (S([J(e)]), !0), 0), [e]), null;
341
+ function he() {
342
+ let [e] = L();
343
+ return g(() => e.registerCommand(a, (e) => (j([Y(e)]), !0), ae), [e]), null;
333
344
  }
334
345
  //#endregion
335
346
  //#region src/components/Editor/plugins/EnterKeyPlugin.tsx
336
- function fe() {
337
- let [e] = i(), t = z(0);
338
- return L(() => e.registerCommand(p, (n) => {
347
+ function ge() {
348
+ let [e] = L(), t = v(0);
349
+ return g(() => e.registerCommand(ce, (n) => {
339
350
  let r = Date.now(), i = r - t.current;
340
351
  return t.current = r, i < 250 && i > 0 ? (e.update(() => {
341
- let e = C();
342
- if (u(e)) {
352
+ let e = A();
353
+ if (N(e)) {
343
354
  let t = e.anchor.getNode().getTopLevelElement();
344
355
  if (t && t.getTextContent().trim() === "") {
345
- let n = w();
346
- _(e, {
356
+ let n = te();
357
+ z(e, {
347
358
  "background-color": "",
348
359
  color: "",
349
360
  "font-size": "",
@@ -356,57 +367,57 @@ function fe() {
356
367
  }
357
368
  }
358
369
  }), n?.preventDefault(), !0) : !1;
359
- }, 1), [e]), null;
370
+ }, oe), [e]), null;
360
371
  }
361
372
  //#endregion
362
373
  //#region src/components/Editor/EditorCore.tsx
363
374
  var X = (e) => {
364
- let { height: t = 126, onChange: n, toolbar: r } = e, [a] = i(), o = z(null), s = z(null), l = R(() => ({
365
- containerRef: o,
366
- getPopupContainer: () => o.current || document.body
367
- }), []), u = I((e) => {
375
+ let { height: t = 126, onChange: n, toolbar: r } = e, [i] = L(), a = v(null), o = v(null), c = _(() => ({
376
+ containerRef: a,
377
+ getPopupContainer: () => a.current || document.body
378
+ }), []), l = h((e) => {
368
379
  e.read(() => {
369
- let t = c().getTextContent(), r = ee(a, null), i = !t.trim() && (r === "<p><br></p>" || r === "<p></p>" || r === "" || /^<p>\s*<br>\s*<\/p>$/.test(r)) ? null : r;
370
- s.current = i, n({
380
+ let t = k().getTextContent(), r = D(i, null), a = !t.trim() && (r === "<p><br></p>" || r === "<p></p>" || r === "" || /^<p>\s*<br>\s*<\/p>$/.test(r)) ? null : r;
381
+ o.current = a, n({
371
382
  text: t,
372
- html: i
383
+ html: a
373
384
  }, e);
374
385
  });
375
- }, [n, a]);
376
- L(() => {
377
- e.value !== void 0 && e.value !== s.current && a.update(() => {
378
- c().clear(), e.value && e.value.trim() && S(b(a, new DOMParser().parseFromString(e.value, "text/html")));
386
+ }, [n, i]);
387
+ g(() => {
388
+ e.value !== void 0 && e.value !== o.current && i.update(() => {
389
+ k().clear(), e.value && e.value.trim() && j(O(i, new DOMParser().parseFromString(e.value, "text/html")));
379
390
  });
380
- }, [e.value, a]);
381
- let d = r?.config?.length ? r?.config : [], f = a.isEditable();
382
- return /* @__PURE__ */ N(se.Provider, {
383
- value: l,
384
- children: /* @__PURE__ */ P("div", {
385
- ref: o,
386
- className: G["bsy-lexical-editor"],
391
+ }, [e.value, i]);
392
+ let u = r?.config?.length ? r?.config : [], d = i.isEditable();
393
+ return /* @__PURE__ */ f(s.Provider, {
394
+ value: c,
395
+ children: /* @__PURE__ */ p("div", {
396
+ ref: a,
397
+ className: K["bsy-lexical-editor"],
387
398
  onClick: () => {
388
- f || (a.setEditable(!0), a.focus(() => {}, { defaultSelection: "rootEnd" }));
399
+ d || (i.setEditable(!0), i.focus(() => {}, { defaultSelection: "rootEnd" }));
389
400
  },
390
401
  children: [
391
- d.length > 0 && /* @__PURE__ */ N(W, {
392
- config: d,
402
+ u.length > 0 && /* @__PURE__ */ f(de, {
403
+ config: u,
393
404
  style: { ...r?.style }
394
405
  }),
395
- /* @__PURE__ */ N(g, {
396
- contentEditable: /* @__PURE__ */ N(h, {
397
- className: G["bsy-lexical-editor__content-editable"],
406
+ /* @__PURE__ */ f(S, {
407
+ contentEditable: /* @__PURE__ */ f(C, {
408
+ className: K["bsy-lexical-editor__content-editable"],
398
409
  style: {
399
410
  height: t,
400
- cursor: f ? "auto" : "text"
411
+ cursor: d ? "auto" : "text"
401
412
  }
402
413
  }),
403
- ErrorBoundary: m
414
+ ErrorBoundary: E
404
415
  }),
405
- /* @__PURE__ */ N(ne, {}),
406
- /* @__PURE__ */ N(de, {}),
407
- /* @__PURE__ */ N(fe, {}),
408
- /* @__PURE__ */ N(re, {}),
409
- /* @__PURE__ */ N(y, { onChange: u })
416
+ /* @__PURE__ */ f(W, {}),
417
+ /* @__PURE__ */ f(he, {}),
418
+ /* @__PURE__ */ f(ge, {}),
419
+ /* @__PURE__ */ f(w, {}),
420
+ /* @__PURE__ */ f(T, { onChange: l })
410
421
  ]
411
422
  })
412
423
  });
@@ -414,7 +425,7 @@ var X = (e) => {
414
425
  X.displayName = "BsyLexicalEditorCore";
415
426
  //#endregion
416
427
  //#region src/components/Editor/nodes/ExtendedTextNode.tsx
417
- var Z = class e extends a {
428
+ var Z = class e extends F {
418
429
  constructor(e, t) {
419
430
  super(e, t);
420
431
  }
@@ -425,7 +436,7 @@ var Z = class e extends a {
425
436
  return new e(t.__text, t.__key);
426
437
  }
427
438
  static importDOM() {
428
- let e = a.importDOM();
439
+ let e = F.importDOM();
429
440
  return {
430
441
  ...e,
431
442
  code: () => ({
@@ -455,14 +466,14 @@ var Z = class e extends a {
455
466
  };
456
467
  }
457
468
  static importJSON(e) {
458
- return pe().updateFromJSON(e);
469
+ return _e().updateFromJSON(e);
459
470
  }
460
471
  isSimpleText() {
461
472
  return this.__type === "extended-text" && this.__mode === 0;
462
473
  }
463
474
  };
464
- function pe(e = "") {
465
- return s(new Z(e));
475
+ function _e(e = "") {
476
+ return ee(new Z(e));
466
477
  }
467
478
  function Q(e) {
468
479
  return (t) => {
@@ -470,19 +481,19 @@ function Q(e) {
470
481
  if (!n) return null;
471
482
  let r = n.conversion(t);
472
483
  if (!r) return r;
473
- let i = t.style.backgroundColor, a = t.style.color, s = t.style.fontFamily, c = t.style.fontWeight, l = t.style.fontSize, u = t.style.textDecoration;
484
+ let i = t.style.backgroundColor, a = t.style.color, o = t.style.fontFamily, s = t.style.fontWeight, c = t.style.fontSize, l = t.style.textDecoration;
474
485
  return {
475
486
  ...r,
476
487
  forChild: (e, t) => {
477
488
  let n = (r?.forChild ?? ((e) => e))(e, t);
478
- if (o(n)) {
489
+ if (P(n)) {
479
490
  let e = [
480
491
  i ? `background-color: ${i}` : null,
481
492
  a ? `color: ${a}` : null,
482
- s ? `font-family: ${s}` : null,
483
- c ? `font-weight: ${c}` : null,
484
- l ? `font-size: ${l}` : null,
485
- u ? `text-decoration: ${u}` : null
493
+ o ? `font-family: ${o}` : null,
494
+ s ? `font-weight: ${s}` : null,
495
+ c ? `font-size: ${c}` : null,
496
+ l ? `text-decoration: ${l}` : null
486
497
  ].filter((e) => e !== null).join("; ");
487
498
  if (e.length) return n.setStyle(e);
488
499
  }
@@ -495,8 +506,8 @@ function Q(e) {
495
506
  //#region src/components/Editor/Editor.tsx
496
507
  var $ = (e) => {
497
508
  let { autoFocus: t = !1 } = e;
498
- return /* @__PURE__ */ N(ie, {
499
- initialConfig: R(() => ({
509
+ return /* @__PURE__ */ f(x, {
510
+ initialConfig: _(() => ({
500
511
  namespace: "bsyLexicalEditor",
501
512
  onError: (e) => {
502
513
  console.error("Lexical error", e);
@@ -511,20 +522,20 @@ var $ = (e) => {
511
522
  link: "editor-link"
512
523
  },
513
524
  nodes: [
514
- te,
515
- f,
516
- q,
525
+ U,
526
+ H,
527
+ J,
517
528
  Z,
518
529
  {
519
- replace: a,
530
+ replace: F,
520
531
  with: (e) => new Z(e.__text),
521
532
  withKlass: Z
522
533
  }
523
534
  ]
524
535
  }), [t]),
525
- children: /* @__PURE__ */ N(X, { ...e })
536
+ children: /* @__PURE__ */ f(X, { ...e })
526
537
  });
527
538
  };
528
539
  $.displayName = "BsyLexicalEditor";
529
540
  //#endregion
530
- export { c as $getRoot, E as BaseButton, $ as default, oe as listRegisteredToolbarButtons, D as registerToolbarButton, T as unregisterToolbarButton, i as useLexicalComposerContext };
541
+ export { re as $getRoot, t as BaseButton, $ as default, o as listRegisteredToolbarButtons, n as registerToolbarButton, e as unregisterToolbarButton, I as useLexicalComposerContext };
@@ -0,0 +1,19 @@
1
+ import { createFromIconfontCN as e } from "@ant-design/icons";
2
+ import { isNumber as t } from "lodash-es";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/Icon/Icon.tsx
5
+ var r = e({ scriptUrl: "https://at.alicdn.com/t/c/font_4786625_ofg0ibxfhle.js" }), i = ({ name: e, style: i, className: a, onClick: o, color: s, size: c = 16 }) => {
6
+ let l = {
7
+ color: s,
8
+ fontSize: t(c) ? `${c}px` : c,
9
+ ...i
10
+ };
11
+ return /* @__PURE__ */ n(r, {
12
+ onClick: o,
13
+ type: `icon-${e}`,
14
+ style: l,
15
+ className: `${a || ""}`
16
+ });
17
+ };
18
+ //#endregion
19
+ export { i as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./Icon-DXmPqVzg.js";
1
+ import { t as e } from "./Icon-CTZCSuVg.js";
2
2
  export { e as default };