@baishuyun/ui-base 6.11.1 → 6.12.0

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 (59) hide show
  1. package/dist/Amap/AmapCircle/index.js +1 -1
  2. package/dist/Amap/AmapMarker/index.js +1 -1
  3. package/dist/Amap/AmapMarkerCluster/index.js +1 -1
  4. package/dist/Amap/AmapProvider/index.js +1 -1
  5. package/dist/Amap/hooks/index.js +1 -1
  6. package/dist/Amap/index.js +1 -1
  7. package/dist/Calendar/{Calendar-BAojDII3.js → Calendar-BOLbbip1.js} +1 -1
  8. package/dist/Calendar/context/index.js +1 -1
  9. package/dist/Calendar/index.js +3 -3
  10. package/dist/Calendar/subcomponents/AllDaySection/index.js +1 -1
  11. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +1 -1
  12. package/dist/Calendar/subcomponents/EventCard/index.js +1 -1
  13. package/dist/Calendar/subcomponents/TimeAxis/index.js +1 -1
  14. package/dist/Calendar/subcomponents/TimeGrid/index.js +1 -1
  15. package/dist/Calendar/utils/index.js +1 -1
  16. package/dist/Calendar/utils/layout/index.js +1 -1
  17. package/dist/Calendar/utils/theme/index.js +1 -1
  18. package/dist/Card/index.js +1 -1
  19. package/dist/CheckBox/index.js +1 -1
  20. package/dist/ColorPicker/index.js +1 -1
  21. package/dist/ConfigProvider/index.js +1 -1
  22. package/dist/DatePicker/{DatePicker-E9HxZcGE.js → DatePicker-Vi3wfsfz.js} +1 -1
  23. package/dist/DatePicker/{DatePickerPanel-DM5Bje8r.js → DatePickerPanel-Cwmb-4UR.js} +1 -1
  24. package/dist/DatePicker/index.js +2 -2
  25. package/dist/DatePicker/style/index.js +1 -1
  26. package/dist/DropDown/index.js +1 -1
  27. package/dist/DropDown/style/index.js +1 -1
  28. package/dist/Editor/ToolbarPlugin/Buttons/index.js +1 -1
  29. package/dist/Editor/constants/index.js +1 -1
  30. package/dist/Editor/index.js +267 -263
  31. package/dist/Gantt/GanttChart/index.js +1 -1
  32. package/dist/Gantt/GanttTable/index.js +1 -1
  33. package/dist/Gantt/GanttToolBar/index.js +1 -1
  34. package/dist/Gantt/index.js +1 -1
  35. package/dist/Gantt/utils/index.js +1 -1
  36. package/dist/Gantt/utils/theme/index.js +1 -1
  37. package/dist/Icon/index.js +1 -1
  38. package/dist/InputTag/index.js +1 -1
  39. package/dist/Loading/index.js +1 -1
  40. package/dist/Modal/index.js +1 -1
  41. package/dist/NotFoundContent/index.js +1 -1
  42. package/dist/Overlay/index.js +1 -1
  43. package/dist/Radio/index.js +1 -1
  44. package/dist/ScrollBar/index.js +1 -1
  45. package/dist/Segmented/index.js +1 -1
  46. package/dist/Select/index.js +1 -1
  47. package/dist/Table/hooks/index.js +1 -1
  48. package/dist/Table/index.js +1 -1
  49. package/dist/Table/style/index.js +1 -1
  50. package/dist/Table/utils/index.js +1 -1
  51. package/dist/Tabs/index.js +1 -1
  52. package/dist/Tooltip/index.js +1 -1
  53. package/dist/Tree/index.js +1 -1
  54. package/dist/Tree/utils/index.js +1 -1
  55. package/dist/components/Editor/interface.d.ts +9 -2
  56. package/dist/index.js +3 -3
  57. package/dist/style.css +1 -1
  58. package/dist/vendors/{version-DU4mlk3q.js → version-CJyzNHuS.js} +1 -1
  59. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import "../vendors/version-DU4mlk3q.js";
1
+ import "../vendors/version-CJyzNHuS.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
3
  import { t as e } from "../Icon/Icon-oQ_uBooE.js";
4
4
  import "../vendors/LocaleContext-I4PW9j4M.js";
@@ -17,27 +17,27 @@ import "../ScrollBar/ScrollBar-N2pOLv-8.js";
17
17
  import "../vendors/useFloatingPortal-CmVJbuRm.js";
18
18
  import { t as r } from "../DropDown/DropDown-CuL1Qq25.js";
19
19
  import "../DropDown/style-LLDVPpPa.js";
20
- import { _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, u as b, v as x, y as ee } from "./Buttons-CMkFTv6y.js";
21
- import { DEFAULT_BACKGROUND_COLOR as te, DEFAULT_FONT_COLOR as ne, DEFAULT_FONT_SIZE as re } from "./constants/index.js";
22
- import { omit as ie } from "lodash-es";
23
- import { Fragment as ae, jsx as S, jsxs as C } from "react/jsx-runtime";
24
- import oe, { createContext as se, useCallback as w, useContext as ce, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
25
- import k from "clsx";
26
- import { AnimatePresence as le, motion as ue, useReducedMotion as de } from "motion/react";
27
- import { LexicalComposer as fe } from "@lexical/react/LexicalComposer";
28
- import { RichTextPlugin as pe } from "@lexical/react/LexicalRichTextPlugin";
29
- import { ContentEditable as me } from "@lexical/react/LexicalContentEditable";
30
- import { HistoryPlugin as he } from "@lexical/react/LexicalHistoryPlugin";
31
- import { OnChangePlugin as ge } from "@lexical/react/LexicalOnChangePlugin";
32
- import { LexicalErrorBoundary as _e } from "@lexical/react/LexicalErrorBoundary";
33
- import { $generateHtmlFromNodes as ve, $generateNodesFromDOM as ye } from "@lexical/html";
34
- import { $applyNodeReplacement as be, $createLineBreakNode as xe, $createParagraphNode as Se, $createTabNode as Ce, $createTextNode as we, $getNearestNodeFromDOMNode as Te, $getNodeByKey as A, $getRoot as Ee, $getRoot as j, $getSelection as M, $insertNodes as N, $isElementNode as De, $isLineBreakNode as P, $isRangeSelection as F, $isRootOrShadowRoot as Oe, $isTabNode as ke, $isTextNode as Ae, $onUpdate as je, CLEAR_HISTORY_COMMAND as Me, COMMAND_PRIORITY_CRITICAL as Ne, COMMAND_PRIORITY_EDITOR as Pe, COMMAND_PRIORITY_HIGH as I, COMMAND_PRIORITY_LOW as Fe, DROP_COMMAND as Ie, DecoratorNode as Le, HISTORY_MERGE_TAG as Re, INDENT_CONTENT_COMMAND as ze, KEY_ENTER_COMMAND as Be, KEY_TAB_COMMAND as Ve, PASTE_COMMAND as He, PASTE_TAG as Ue, RootNode as We, TextNode as L, isHTMLElement as Ge, mergeRegister as Ke } from "lexical";
20
+ import { _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as ee, s as v, u as y, v as b, y as te } from "./Buttons-CMkFTv6y.js";
21
+ import { DEFAULT_BACKGROUND_COLOR as x, DEFAULT_FONT_COLOR as ne, DEFAULT_FONT_SIZE as S } from "./constants/index.js";
22
+ import { omit as re } from "lodash-es";
23
+ import { Fragment as ie, jsx as C, jsxs as w } from "react/jsx-runtime";
24
+ import ae, { createContext as oe, useCallback as T, useContext as se, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
25
+ import A from "clsx";
26
+ import { AnimatePresence as ce, motion as le, useReducedMotion as ue } from "motion/react";
27
+ import { LexicalComposer as de } from "@lexical/react/LexicalComposer";
28
+ import { RichTextPlugin as fe } from "@lexical/react/LexicalRichTextPlugin";
29
+ import { ContentEditable as pe } from "@lexical/react/LexicalContentEditable";
30
+ import { HistoryPlugin as me } from "@lexical/react/LexicalHistoryPlugin";
31
+ import { OnChangePlugin as he } from "@lexical/react/LexicalOnChangePlugin";
32
+ import { LexicalErrorBoundary as ge } from "@lexical/react/LexicalErrorBoundary";
33
+ import { $generateHtmlFromNodes as _e, $generateNodesFromDOM as ve } from "@lexical/html";
34
+ import { $applyNodeReplacement as ye, $createLineBreakNode as be, $createParagraphNode as xe, $createTabNode as Se, $createTextNode as Ce, $getNearestNodeFromDOMNode as we, $getNodeByKey as j, $getRoot as Te, $getRoot as M, $getSelection as N, $insertNodes as P, $isElementNode as Ee, $isLineBreakNode as F, $isRangeSelection as I, $isRootOrShadowRoot as De, $isTabNode as Oe, $isTextNode as ke, $onUpdate as Ae, CLEAR_HISTORY_COMMAND as je, COMMAND_PRIORITY_CRITICAL as Me, COMMAND_PRIORITY_EDITOR as Ne, COMMAND_PRIORITY_HIGH as Pe, COMMAND_PRIORITY_LOW as Fe, DROP_COMMAND as Ie, DecoratorNode as Le, HISTORY_MERGE_TAG as Re, INDENT_CONTENT_COMMAND as ze, KEY_ENTER_COMMAND as Be, KEY_TAB_COMMAND as Ve, PASTE_COMMAND as He, PASTE_TAG as Ue, RootNode as We, TextNode as L, isHTMLElement as Ge, mergeRegister as Ke } from "lexical";
35
35
  import { useLexicalComposerContext as qe, useLexicalComposerContext as R } from "@lexical/react/LexicalComposerContext";
36
- import { $getSelectionStyleValueForProperty as z, $patchStyleText as Je, $trimTextContentFromAnchor as B } from "@lexical/selection";
37
- import { $findMatchingParent as V, $restoreEditorState as Ye, mergeRegister as Xe } from "@lexical/utils";
38
- import { $isLinkNode as Ze, AutoLinkNode as Qe, LinkNode as $e } from "@lexical/link";
39
- import { $isListItemNode as H, $isListNode as et, ListItemNode as tt, ListNode as nt } from "@lexical/list";
40
- import { $createCodeHighlightNode as rt, $createCodeNode as it, $isCodeHighlightNode as at, $isCodeNode as U, $plainifyCodeContent as ot, CodeHighlightNode as W, CodeNode as G, registerCodeIndentation as st } from "@lexical/code-core";
36
+ import { $getSelectionStyleValueForProperty as Je, $patchStyleText as Ye, $trimTextContentFromAnchor as Xe } from "@lexical/selection";
37
+ import { $findMatchingParent as z, $restoreEditorState as Ze, mergeRegister as B } from "@lexical/utils";
38
+ import { $isLinkNode as Qe, AutoLinkNode as $e, LinkNode as et } from "@lexical/link";
39
+ import { $isListItemNode as V, $isListNode as tt, ListItemNode as nt, ListNode as rt } from "@lexical/list";
40
+ import { $createCodeHighlightNode as it, $createCodeNode as at, $isCodeHighlightNode as H, $isCodeNode as U, $plainifyCodeContent as ot, CodeHighlightNode as W, CodeNode as G, registerCodeIndentation as st } from "@lexical/code-core";
41
41
  import { $findCellNode as ct, $isTableCellNode as K, $isTableNode as lt, $isTableRowNode as ut, $isTableSelection as dt, TableCellNode as q, TableNode as ft, TableRowNode as pt, registerTableCellUnmergeTransform as mt, registerTablePlugin as ht, registerTableSelectionObserver as gt, setScrollableTablesActive as _t } from "@lexical/table";
42
42
  import { $isHeadingNode as vt, HeadingNode as yt } from "@lexical/rich-text";
43
43
  import { useLexicalEditable as bt } from "@lexical/react/useLexicalEditable";
@@ -72,16 +72,16 @@ var J = (e) => {
72
72
  //#endregion
73
73
  //#region src/components/Editor/hooks/useTextFormatsState.ts
74
74
  function Dt() {
75
- let [e] = R(), [t, n] = O({
75
+ let [e] = R(), [t, n] = k({
76
76
  bold: !1,
77
77
  italic: !1,
78
78
  underline: !1,
79
79
  strikethrough: !1,
80
80
  superscript: !1,
81
81
  subscript: !1,
82
- fontSize: re,
82
+ fontSize: S,
83
83
  fontColor: ne,
84
- backgroundColor: te,
84
+ backgroundColor: x,
85
85
  align: "left",
86
86
  listType: !1,
87
87
  canOutdent: !1,
@@ -91,9 +91,9 @@ function Dt() {
91
91
  codeLanguage: i,
92
92
  link: void 0
93
93
  });
94
- return T(() => e.registerUpdateListener(({ editorState: e }) => {
94
+ return E(() => e.registerUpdateListener(({ editorState: e }) => {
95
95
  e.read(() => {
96
- let e = M();
96
+ let e = N();
97
97
  if (dt(e)) {
98
98
  n((e) => ({
99
99
  ...e,
@@ -103,24 +103,24 @@ function Dt() {
103
103
  }));
104
104
  return;
105
105
  }
106
- if (F(e)) {
107
- let t = z(e, "font-size", re), r = z(e, "color", ne), i = z(e, "background-color", te), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : V(a, (e) => {
106
+ if (I(e)) {
107
+ let t = Je(e, "font-size", S), r = Je(e, "color", ne), i = Je(e, "background-color", x), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : z(a, (e) => {
108
108
  let t = e.getParent();
109
- return t !== null && Oe(t);
109
+ return t !== null && De(t);
110
110
  });
111
111
  o === null && (o = a.getTopLevelElementOrThrow());
112
- let s = {}, c = V(a, Ze);
112
+ let s = {}, c = z(a, Qe);
113
113
  c ? (s.link = c.getURL(), s.linkText = c.getTextContent(), s.newBlank = c.getTarget() === "_blank") : s.linkText = e.getTextContent();
114
- let l = V(a, H), u = !1, d = De(o) ? o.getIndent() : 0;
115
- if (H(l)) {
114
+ let l = z(a, V), u = !1, d = Ee(o) ? o.getIndent() : 0;
115
+ if (V(l)) {
116
116
  d = l.getIndent();
117
117
  let e = l.getParent();
118
- if (et(e)) {
118
+ if (tt(e)) {
119
119
  let t = e.getListType();
120
120
  u = t === "number" || t === "bullet" ? t : !1;
121
121
  }
122
122
  }
123
- let f = V(a, U), p = V(a, vt), m = vt(p) ? p.getTag() : void 0;
123
+ let f = z(a, U), p = z(a, vt), m = vt(p) ? p.getTag() : void 0;
124
124
  n({
125
125
  bold: e.hasFormat("bold"),
126
126
  italic: e.hasFormat("italic"),
@@ -131,13 +131,13 @@ function Dt() {
131
131
  fontSize: t,
132
132
  fontColor: r,
133
133
  backgroundColor: i,
134
- align: De(o) ? o.getFormatType() : "left",
134
+ align: Ee(o) ? o.getFormatType() : "left",
135
135
  listType: u,
136
136
  canOutdent: d > 0 || u !== !1,
137
137
  isCodeBlock: !!f,
138
- isInTable: !!V(a, K),
138
+ isInTable: !!z(a, K),
139
139
  headingTag: m === "h1" || m === "h2" || m === "h3" ? m : !1,
140
- codeLanguage: x(f?.getLanguage()),
140
+ codeLanguage: b(f?.getLanguage()),
141
141
  link: s
142
142
  });
143
143
  }
@@ -148,26 +148,26 @@ function Dt() {
148
148
  //#region src/components/Editor/ToolbarPlugin/context/TextFormatProvider.tsx
149
149
  var Ot = (e) => {
150
150
  let t = Dt();
151
- return /* @__PURE__ */ S(ee.Provider, {
151
+ return /* @__PURE__ */ C(te.Provider, {
152
152
  value: t,
153
153
  children: e.children
154
154
  });
155
- }, kt = se(null), At = () => {
156
- let e = ce(kt);
155
+ }, kt = oe(null), At = () => {
156
+ let e = se(kt);
157
157
  if (!e) throw Error("useEditorContainer must be used within EditorContainerProvider");
158
158
  return e;
159
159
  }, jt = d.map((e) => ({
160
160
  key: e.id,
161
161
  label: e.label
162
162
  })), Mt = () => {
163
- let [n] = R(), { codeLanguage: i } = p(), { t: a } = t(), { iconSize: s } = l(), c = w((e) => {
163
+ let [n] = R(), { codeLanguage: i } = p(), { t: a } = t(), { iconSize: s } = l(), c = T((e) => {
164
164
  let t = e.key;
165
165
  n.update(() => {
166
- let e = M();
167
- F(e) && V(e.anchor.getNode(), U)?.setLanguage(t);
166
+ let e = N();
167
+ I(e) && z(e.anchor.getNode(), U)?.setLanguage(t);
168
168
  });
169
169
  }, [n]), d = u[i].label;
170
- return /* @__PURE__ */ S(r, {
170
+ return /* @__PURE__ */ C(r, {
171
171
  menus: jt,
172
172
  onClick: c,
173
173
  activeKey: [i],
@@ -176,14 +176,14 @@ var Ot = (e) => {
176
176
  width: 120,
177
177
  minWidth: 120
178
178
  },
179
- children: /* @__PURE__ */ S("div", {
179
+ children: /* @__PURE__ */ C("div", {
180
180
  className: o["bsy-lexical__toolbar-select"],
181
181
  style: { width: 120 },
182
- children: /* @__PURE__ */ S(b, {
183
- icon: /* @__PURE__ */ C(ae, { children: [/* @__PURE__ */ S("span", {
182
+ children: /* @__PURE__ */ C(y, {
183
+ icon: /* @__PURE__ */ w(ie, { children: [/* @__PURE__ */ C("span", {
184
184
  className: o["bsy-lexical__toolbar-select-label"],
185
185
  children: d
186
- }), /* @__PURE__ */ S(e, {
186
+ }), /* @__PURE__ */ C(e, {
187
187
  name: "arrow-down",
188
188
  size: s,
189
189
  className: o["bsy-lexical__toolbar-select-arrow"]
@@ -265,18 +265,18 @@ var Ot = (e) => {
265
265
  }), r;
266
266
  }, It = (e, t) => {
267
267
  let n = h(e);
268
- return n ? /* @__PURE__ */ S(n, { ...t }) : (console.warn(`[ToolbarPlugin] Button "${e}" is not registered.`), null);
268
+ return n ? /* @__PURE__ */ C(n, { ...t }) : (console.warn(`[ToolbarPlugin] Button "${e}" is not registered.`), null);
269
269
  }, Lt = ({ config: e }) => {
270
- let { isCodeBlock: t } = p(), { isSourceMode: n } = y(), r = de(), i = Ft(e, t, n), a = {
270
+ let { isCodeBlock: t } = p(), { isSourceMode: n } = v(), r = ue(), i = Ft(e, t, n), a = {
271
271
  duration: r ? 0 : .16,
272
272
  ease: "easeOut"
273
273
  }, s = r ? {} : Nt;
274
- return /* @__PURE__ */ S(le, {
274
+ return /* @__PURE__ */ C(ce, {
275
275
  initial: !1,
276
276
  mode: "popLayout",
277
277
  children: i.map((e) => {
278
278
  let t = null;
279
- return t = e.kind === "divider" ? /* @__PURE__ */ S("div", { className: o["bsy-lexical__toolbar-divider"] }) : e.kind === "language" ? /* @__PURE__ */ S(Mt, {}) : It(e.name, e.props), t === null ? null : /* @__PURE__ */ S(ue.div, {
279
+ return t = e.kind === "divider" ? /* @__PURE__ */ C("div", { className: o["bsy-lexical__toolbar-divider"] }) : e.kind === "language" ? /* @__PURE__ */ C(Mt, {}) : It(e.name, e.props), t === null ? null : /* @__PURE__ */ C(le.div, {
280
280
  className: o["bsy-lexical__toolbar-item"],
281
281
  layout: "position",
282
282
  transition: a,
@@ -286,10 +286,10 @@ var Ot = (e) => {
286
286
  })
287
287
  });
288
288
  }, Rt = (e) => {
289
- let { config: t = [], style: n, theme: r, mode: i, floating: a } = e, { toolbarRef: s } = At(), l = i === "floating", u = de(), d = {
289
+ let { config: t = [], style: n, theme: r, mode: i, floating: a } = e, { toolbarRef: s } = At(), l = i === "floating", u = ue(), d = {
290
290
  duration: u ? 0 : .16,
291
291
  ease: "easeOut"
292
- }, f = E(() => wt(r), [r]), p = E(() => ({ iconSize: Tt(r?.iconSize) }), [r?.iconSize]), m = l ? Et(a) : void 0, h = l ? ie(n, [
292
+ }, f = D(() => wt(r), [r]), p = D(() => ({ iconSize: Tt(r?.iconSize) }), [r?.iconSize]), m = l ? Et(a) : void 0, h = l ? re(n, [
293
293
  "position",
294
294
  "left",
295
295
  "top",
@@ -300,28 +300,29 @@ var Ot = (e) => {
300
300
  "marginTop",
301
301
  "marginBottom"
302
302
  ]) : n;
303
- return /* @__PURE__ */ S(c, {
303
+ return /* @__PURE__ */ C(c, {
304
304
  value: p,
305
- children: /* @__PURE__ */ S(_, { children: /* @__PURE__ */ S(Ot, { children: /* @__PURE__ */ S(ue.div, {
305
+ children: /* @__PURE__ */ C(_, { children: /* @__PURE__ */ C(Ot, { children: /* @__PURE__ */ C(le.div, {
306
306
  ref: s,
307
307
  layout: !u,
308
308
  transition: d,
309
- className: k(o["bsy-lexical__toolbar"], l && o["bsy-lexical__toolbar--floating"]),
309
+ className: A(o["bsy-lexical__toolbar"], l && o["bsy-lexical__toolbar--floating"]),
310
310
  style: {
311
311
  ...f,
312
312
  ...m,
313
313
  ...h
314
314
  },
315
- children: /* @__PURE__ */ S(Lt, { config: t })
315
+ children: /* @__PURE__ */ C(Lt, { config: t })
316
316
  }) }) })
317
317
  });
318
318
  }, Y = {
319
- "bsy-lexical-editor": "_bsy-lexical-editor_1bhfo_1",
320
- "bsy-lexical-editor--floating": "_bsy-lexical-editor--floating_1bhfo_7",
321
- "bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_1bhfo_10",
322
- "bsy-lexical-editor__content-editable--with-length-badge": "_bsy-lexical-editor__content-editable--with-length-badge_1bhfo_17",
323
- "bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-badge_1bhfo_20",
324
- "bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--exceeded_1bhfo_36"
319
+ "bsy-lexical-editor": "_bsy-lexical-editor_11st3_1",
320
+ "bsy-lexical-editor--floating": "_bsy-lexical-editor--floating_11st3_7",
321
+ "bsy-lexical-editor__body": "_bsy-lexical-editor__body_11st3_10",
322
+ "bsy-lexical-editor__body--fixed": "_bsy-lexical-editor__body--fixed_11st3_15",
323
+ "bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_11st3_18",
324
+ "bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-badge_11st3_30",
325
+ "bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--exceeded_11st3_42"
325
326
  }, X = class e extends L {
326
327
  constructor(e, t) {
327
328
  super(e, t);
@@ -370,7 +371,7 @@ var Ot = (e) => {
370
371
  }
371
372
  };
372
373
  function zt(e = "") {
373
- return be(new X(e));
374
+ return ye(new X(e));
374
375
  }
375
376
  function Z(e) {
376
377
  return (t) => {
@@ -383,7 +384,7 @@ function Z(e) {
383
384
  ...r,
384
385
  forChild: (e, t) => {
385
386
  let n = (r?.forChild ?? ((e) => e))(e, t);
386
- if (Ae(n)) {
387
+ if (ke(n)) {
387
388
  let e = [
388
389
  i ? `background-color: ${i}` : null,
389
390
  a ? `color: ${a}` : null,
@@ -407,7 +408,7 @@ function Bt(e, t) {
407
408
  //#endregion
408
409
  //#region src/components/Editor/plugins/LinkColorPlugin.tsx
409
410
  function Vt(e) {
410
- if (!V(e, Ze)) return;
411
+ if (!z(e, Qe)) return;
411
412
  let t = e.getStyle();
412
413
  if (!t) return;
413
414
  let n = Bt(t, "color");
@@ -415,7 +416,7 @@ function Vt(e) {
415
416
  }
416
417
  function Ht() {
417
418
  let [e] = R();
418
- return T(() => e.registerNodeTransform(X, Vt), [e]), null;
419
+ return E(() => e.registerNodeTransform(X, Vt), [e]), null;
419
420
  }
420
421
  var Q = {
421
422
  imageWrapper: "_imageWrapper_y06h3_1",
@@ -428,15 +429,15 @@ var Q = {
428
429
  bottomLeft: "_bottomLeft_y06h3_54",
429
430
  bottomRight: "_bottomRight_y06h3_59"
430
431
  }, Ut = ({ src: e, altText: t, width: n, height: r, nodeKey: i }) => {
431
- let [a] = R(), [o, s] = O(!1), [c, l] = O(null), u = D(null), [d, f] = O({
432
+ let [a] = R(), [o, s] = k(!1), [c, l] = k(null), u = O(null), [d, f] = k({
432
433
  width: n || void 0,
433
434
  height: r || void 0
434
- }), p = w(() => {
435
+ }), p = T(() => {
435
436
  n && r && f({
436
437
  width: n,
437
438
  height: r
438
439
  });
439
- }, [n, r]), m = w((e, t) => {
440
+ }, [n, r]), m = T((e, t) => {
440
441
  if (e.preventDefault(), e.stopPropagation(), !u.current) return;
441
442
  let n = d.width || u.current.offsetWidth, r = d.height || u.current.offsetHeight, i = n / r;
442
443
  (!d.width || !d.height) && f({
@@ -451,7 +452,7 @@ var Q = {
451
452
  aspectRatio: i,
452
453
  direction: t
453
454
  });
454
- }, [d]), h = w((e) => {
455
+ }, [d]), h = T((e) => {
455
456
  if (!c?.isResizing) return;
456
457
  let t = e.clientX - c.startX, n;
457
458
  switch (c.direction) {
@@ -474,9 +475,9 @@ var Q = {
474
475
  width: n,
475
476
  height: r
476
477
  });
477
- }, [c]), g = w(() => {
478
+ }, [c]), g = T(() => {
478
479
  c?.isResizing && (a.update(() => {
479
- let e = A(i);
480
+ let e = j(i);
480
481
  Kt(e) && e.setWidthAndHeight(d.width, d.height);
481
482
  }), l(null));
482
483
  }, [
@@ -485,7 +486,7 @@ var Q = {
485
486
  d,
486
487
  c
487
488
  ]);
488
- oe.useEffect(() => {
489
+ ae.useEffect(() => {
489
490
  if (c?.isResizing) return document.addEventListener("mousemove", h), document.addEventListener("mouseup", g), () => {
490
491
  document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
491
492
  };
@@ -494,31 +495,31 @@ var Q = {
494
495
  h,
495
496
  g
496
497
  ]);
497
- let _ = w(() => {
498
+ let _ = T(() => {
498
499
  s(!0);
499
500
  }, []);
500
- return T(() => a.registerUpdateListener(({ editorState: e }) => {
501
+ return E(() => a.registerUpdateListener(({ editorState: e }) => {
501
502
  e.read(() => {
502
- let e = M();
503
- F(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
503
+ let e = N();
504
+ I(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
504
505
  });
505
506
  }), [
506
507
  a,
507
508
  i,
508
509
  o
509
- ]), T(() => {
510
+ ]), E(() => {
510
511
  let e = (e) => {
511
512
  o && u.current && !u.current.contains(e.target) && s(!1);
512
513
  };
513
514
  if (o) return document.addEventListener("mousedown", e), () => {
514
515
  document.removeEventListener("mousedown", e);
515
516
  };
516
- }, [o]), /* @__PURE__ */ C("div", {
517
- className: k(Q.imageWrapper, {
517
+ }, [o]), /* @__PURE__ */ w("div", {
518
+ className: A(Q.imageWrapper, {
518
519
  [Q.selected]: o,
519
520
  [Q.resizing]: c?.isResizing
520
521
  }),
521
- children: [/* @__PURE__ */ S("img", {
522
+ children: [/* @__PURE__ */ C("img", {
522
523
  ref: u,
523
524
  src: e,
524
525
  alt: t,
@@ -530,21 +531,21 @@ var Q = {
530
531
  onLoad: p,
531
532
  onClick: _,
532
533
  draggable: !1
533
- }), o && /* @__PURE__ */ C(ae, { children: [
534
- /* @__PURE__ */ S("div", {
535
- className: k(Q.resizeHandle, Q.bottomRight),
534
+ }), o && /* @__PURE__ */ w(ie, { children: [
535
+ /* @__PURE__ */ C("div", {
536
+ className: A(Q.resizeHandle, Q.bottomRight),
536
537
  onMouseDown: (e) => m(e, "bottom-right")
537
538
  }),
538
- /* @__PURE__ */ S("div", {
539
- className: k(Q.resizeHandle, Q.bottomLeft),
539
+ /* @__PURE__ */ C("div", {
540
+ className: A(Q.resizeHandle, Q.bottomLeft),
540
541
  onMouseDown: (e) => m(e, "bottom-left")
541
542
  }),
542
- /* @__PURE__ */ S("div", {
543
- className: k(Q.resizeHandle, Q.topRight),
543
+ /* @__PURE__ */ C("div", {
544
+ className: A(Q.resizeHandle, Q.topRight),
544
545
  onMouseDown: (e) => m(e, "top-right")
545
546
  }),
546
- /* @__PURE__ */ S("div", {
547
- className: k(Q.resizeHandle, Q.topLeft),
547
+ /* @__PURE__ */ C("div", {
548
+ className: A(Q.resizeHandle, Q.topLeft),
548
549
  onMouseDown: (e) => m(e, "top-left")
549
550
  })
550
551
  ] })]
@@ -595,7 +596,7 @@ var Q = {
595
596
  n.__width = e, n.__height = t;
596
597
  }
597
598
  decorate() {
598
- return /* @__PURE__ */ S(Ut, {
599
+ return /* @__PURE__ */ C(Ut, {
599
600
  src: this.__src,
600
601
  altText: this.__altText,
601
602
  width: this.__width,
@@ -662,7 +663,7 @@ function qt(e) {
662
663
  //#region src/components/Editor/plugins/ImagePlugin.tsx
663
664
  function Jt() {
664
665
  let [e] = R();
665
- return T(() => e.registerCommand(s, (e) => (N([Gt(e)]), !0), Pe), [e]), null;
666
+ return E(() => e.registerCommand(s, (e) => (P([Gt(e)]), !0), Ne), [e]), null;
666
667
  }
667
668
  //#endregion
668
669
  //#region src/components/Editor/utils/stripImagesFromHtml.ts
@@ -674,8 +675,8 @@ function Yt(e) {
674
675
  //#region src/components/Editor/plugins/PasteStripImagePlugin.tsx
675
676
  var Xt = /<img\b|<picture\b/i;
676
677
  function Zt() {
677
- let [e] = R(), { isSourceModeRef: t } = y();
678
- return T(() => {
678
+ let [e] = R(), { isSourceModeRef: t } = v();
679
+ return E(() => {
679
680
  let n = (n) => {
680
681
  if (t.current) return !1;
681
682
  let r = "clipboardData" in n ? n.clipboardData : "dataTransfer" in n ? n.dataTransfer : null;
@@ -685,38 +686,38 @@ function Zt() {
685
686
  n.preventDefault();
686
687
  let a = r.getData("text/plain");
687
688
  return !Xt.test(i) && !a || e.update(() => {
688
- let t = M();
689
+ let t = N();
689
690
  if (t === null) return;
690
691
  let n = i ? Yt(i) : "", r = document.createElement("div");
691
692
  if (r.innerHTML = n, n && r.textContent?.trim()) {
692
- let t = ye(e, new DOMParser().parseFromString(n, "text/html"));
693
+ let t = ve(e, new DOMParser().parseFromString(n, "text/html"));
693
694
  if (t.length) {
694
- N(t);
695
+ P(t);
695
696
  return;
696
697
  }
697
698
  }
698
699
  a && t.insertRawText(a);
699
700
  }, { tag: Ue }), !0;
700
701
  };
701
- return Xe(e.registerCommand(He, (e) => n(e), I), e.registerCommand(Ie, (e) => n(e), I));
702
+ return B(e.registerCommand(He, (e) => n(e), Pe), e.registerCommand(Ie, (e) => n(e), Pe));
702
703
  }, [e, t]), null;
703
704
  }
704
705
  //#endregion
705
706
  //#region src/components/Editor/plugins/EnterKeyPlugin.tsx
706
707
  function Qt() {
707
- let [e] = R(), t = D(0);
708
- return T(() => e.registerCommand(Be, (n) => {
708
+ let [e] = R(), t = O(0);
709
+ return E(() => e.registerCommand(Be, (n) => {
709
710
  let r = Date.now(), i = r - t.current;
710
711
  return t.current = r, i < 250 && i > 0 ? e.getEditorState().read(() => {
711
- let e = M();
712
- return F(e) ? !!V(e.anchor.getNode(), (e) => H(e) || U(e) || K(e)) : !1;
712
+ let e = N();
713
+ return I(e) ? !!z(e.anchor.getNode(), (e) => V(e) || U(e) || K(e)) : !1;
713
714
  }, { editor: e }) ? !1 : (e.update(() => {
714
- let e = M();
715
- if (F(e)) {
715
+ let e = N();
716
+ if (I(e)) {
716
717
  let t = e.anchor.getNode().getTopLevelElement();
717
718
  if (t && t.getTextContent().trim() === "") {
718
- let n = Se();
719
- Je(e, {
719
+ let n = xe();
720
+ Ye(e, {
720
721
  "background-color": "",
721
722
  color: "",
722
723
  "font-size": "",
@@ -788,31 +789,31 @@ var $t = {
788
789
  theme: m
789
790
  }), o = [];
790
791
  return a.tokens.forEach((e, t) => {
791
- t && o.push(xe()), e.forEach((e) => {
792
+ t && o.push(be()), e.forEach((e) => {
792
793
  e.content.split(" ").forEach((t, n) => {
793
- if (n && o.push(Ce()), t === "") return;
794
- let r = rt(t), i = typeof e.htmlStyle == "string" ? e.htmlStyle : e.htmlStyle ? Object.entries(e.htmlStyle).map(([e, t]) => `${e}:${t}`).join(";") : e.color ? `color: ${e.color}` : "";
794
+ if (n && o.push(Se()), t === "") return;
795
+ let r = it(t), i = typeof e.htmlStyle == "string" ? e.htmlStyle : e.htmlStyle ? Object.entries(e.htmlStyle).map(([e, t]) => `${e}:${t}`).join(";") : e.color ? `color: ${e.color}` : "";
795
796
  i && r.setStyle(i), o.push(r);
796
797
  });
797
798
  });
798
799
  }), o;
799
800
  }, dn = (e, t) => {
800
- let n = A(e);
801
+ let n = j(e);
801
802
  if (!U(n) || !n.isAttached()) return;
802
- let r = M();
803
- if (!F(r)) {
803
+ let r = N();
804
+ if (!I(r)) {
804
805
  t();
805
806
  return;
806
807
  }
807
- let { anchor: i } = r, a = i.offset, o = i.type === "element" && P(n.getChildAtIndex(i.offset - 1)), s = 0;
808
+ let { anchor: i } = r, a = i.offset, o = i.type === "element" && F(n.getChildAtIndex(i.offset - 1)), s = 0;
808
809
  if (o || (s = a + i.getNode().getPreviousSiblings().reduce((e, t) => e + t.getTextContentSize(), 0)), t()) {
809
810
  if (o) {
810
811
  i.getNode().select(a, a);
811
812
  return;
812
813
  }
813
814
  n.getChildren().some((e) => {
814
- let t = Ae(e);
815
- if (t || P(e)) {
815
+ let t = ke(e);
816
+ if (t || F(e)) {
816
817
  let n = e.getTextContentSize();
817
818
  if (t && n >= s) return e.select(s, s), !0;
818
819
  s -= n;
@@ -820,7 +821,7 @@ var $t = {
820
821
  return !1;
821
822
  });
822
823
  }
823
- }, fn = (e, t) => at(e) && at(t) && e.__text === t.__text && e.__highlightType === t.__highlightType && e.__style === t.__style || ke(e) && ke(t) || P(e) && P(t), pn = (e, t) => {
824
+ }, fn = (e, t) => H(e) && H(t) && e.__text === t.__text && e.__highlightType === t.__highlightType && e.__style === t.__style || Oe(e) && Oe(t) || F(e) && F(t), pn = (e, t) => {
824
825
  let n = 0;
825
826
  for (; n < e.length && fn(e[n], t[n]);) n++;
826
827
  let r = e.length, i = t.length, a = Math.min(r, i) - n, o = 0;
@@ -834,7 +835,7 @@ var $t = {
834
835
  nodesForReplacement: t.slice(n, i - o)
835
836
  };
836
837
  }, mn = (e, t, n, r, i) => {
837
- let a = i.getKey(), o = x(i.getLanguage());
838
+ let a = i.getKey(), o = b(i.getLanguage());
838
839
  if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
839
840
  else {
840
841
  i.getTheme() !== "github-light" && i.setTheme(m);
@@ -845,7 +846,7 @@ var $t = {
845
846
  let i = [...n.pendingKeys];
846
847
  n.pendingKeys.clear(), n.loading = null, e.update(() => {
847
848
  i.forEach((e) => {
848
- A(e)?.markDirty();
849
+ j(e)?.markDirty();
849
850
  });
850
851
  }, { tag: Re });
851
852
  }, () => {
@@ -855,21 +856,21 @@ var $t = {
855
856
  }
856
857
  i.getIsSyntaxHighlightSupported() || i.setIsSyntaxHighlightSupported(!0);
857
858
  }
858
- n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, je(() => {
859
+ n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, Ae(() => {
859
860
  n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
860
861
  })), dn(a, () => {
861
- let e = A(a);
862
+ let e = j(a);
862
863
  if (!U(e) || !e.isAttached()) return !1;
863
- let n = un(e, x(e.getLanguage()), t), { from: r, to: i, nodesForReplacement: o } = pn(e.getChildren(), n);
864
+ let n = un(e, b(e.getLanguage()), t), { from: r, to: i, nodesForReplacement: o } = pn(e.getChildren(), n);
864
865
  return r !== i || o.length ? (e.splice(r, i - r, o), !0) : !1;
865
866
  }));
866
867
  }, hn = (e, t, n, r, i) => {
867
868
  let a = i.getParent();
868
- U(a) ? mn(e, t, n, r, a) : at(i) && i.replace(we(i.__text));
869
+ U(a) ? mn(e, t, n, r, a) : H(i) && i.replace(Ce(i.__text));
869
870
  };
870
871
  function gn() {
871
872
  let [e] = R();
872
- return T(() => {
873
+ return E(() => {
873
874
  if (!e.hasNodes([G, W])) throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");
874
875
  let t = null, n = {
875
876
  didTransform: !1,
@@ -879,7 +880,7 @@ function gn() {
879
880
  }, r = (e) => {
880
881
  t = e;
881
882
  }, i = (e) => {
882
- let t = A(e);
883
+ let t = j(e);
883
884
  if (!U(t)) return;
884
885
  let n = t.getChildrenSize();
885
886
  n === 0 ? t.selectStart() : t.select(0, n);
@@ -887,7 +888,7 @@ function gn() {
887
888
  if (!(t instanceof Node) || !e.getRootElement()?.contains(t)) return null;
888
889
  let n = null;
889
890
  return e.getEditorState().read(() => {
890
- let e = Te(t), r = e ? V(e, U) : null;
891
+ let e = we(t), r = e ? z(e, U) : null;
891
892
  U(r) && (n = r.getKey());
892
893
  }, { editor: e }), n;
893
894
  }, o = null, s = (t, n, r) => {
@@ -925,17 +926,17 @@ function gn() {
925
926
  //#region src/components/Editor/plugins/TablePlugin.tsx
926
927
  function _n() {
927
928
  let [e] = R();
928
- return T(() => (_t(e, !0), Xe(ht(e), gt(e, !1), mt(e), e.registerNodeTransform(q, (e) => {
929
+ return E(() => (_t(e, !0), B(ht(e), gt(e, !1), mt(e), e.registerNodeTransform(q, (e) => {
929
930
  e.getBackgroundColor() !== null && e.setBackgroundColor(null);
930
931
  }), e.registerCommand(Ve, (e) => {
931
- let t = M();
932
- if (!F(t) || !t.isCollapsed()) return !1;
932
+ let t = N();
933
+ if (!I(t) || !t.isCollapsed()) return !1;
933
934
  let n = ct(t.anchor.getNode());
934
935
  if (n === null) return !1;
935
936
  let r = e.shiftKey ? "previous" : "next", i = r === "next" ? "getNextSibling" : "getPreviousSibling", a = r === "next" ? "getFirstChild" : "getLastChild", o = n[i](), s = null;
936
937
  if (K(o)) s = o;
937
938
  else {
938
- let e = V(n, ut);
939
+ let e = z(n, ut);
939
940
  if (e !== null) for (let t = e[i](); t !== null; t = t[i]()) {
940
941
  if (!ut(t)) continue;
941
942
  let e = t[a]();
@@ -949,60 +950,60 @@ function _n() {
949
950
  let e = s.getFirstDescendant();
950
951
  e ? e.selectStart() : s.selectStart();
951
952
  } else {
952
- let e = V(n, lt);
953
+ let e = z(n, lt);
953
954
  e && (r === "next" ? e.selectNext() : e.selectPrevious());
954
955
  }
955
956
  return !0;
956
- }, I))), [e]), null;
957
+ }, Pe))), [e]), null;
957
958
  }
958
959
  //#endregion
959
960
  //#region src/components/Editor/plugins/TabIndentPlugin.tsx
960
961
  var vn = "\xA0".repeat(4);
961
962
  function yn() {
962
963
  let [e] = R();
963
- return T(() => e.registerCommand(Ve, (t) => {
964
+ return E(() => e.registerCommand(Ve, (t) => {
964
965
  if (t.shiftKey) return !1;
965
- let n = M();
966
- if (!F(n)) return !1;
966
+ let n = N();
967
+ if (!I(n)) return !1;
967
968
  let r = n.anchor.getNode();
968
- if (ct(r) !== null || V(r, U)) return !1;
969
+ if (ct(r) !== null || z(r, U)) return !1;
969
970
  t.preventDefault();
970
- let i = V(r, H);
971
- if (H(i)) {
971
+ let i = z(r, V);
972
+ if (V(i)) {
972
973
  let e = new Set([i]);
973
974
  for (let t of n.getNodes()) {
974
- let n = V(t, H);
975
- H(n) && e.add(n);
975
+ let n = z(t, V);
976
+ V(n) && e.add(n);
976
977
  }
977
978
  for (let t of e) t.setIndent(t.getIndent() + 1);
978
979
  return !0;
979
980
  }
980
981
  let a = r.getTopLevelElement(), o = n.focus.getNode().getTopLevelElement();
981
982
  return !n.isCollapsed() && a && o && a !== o ? e.dispatchCommand(ze, void 0) : (n.insertText(vn), !0);
982
- }, Pe), [e]), null;
983
+ }, Ne), [e]), null;
983
984
  }
984
985
  //#endregion
985
986
  //#region src/components/Editor/plugins/MaxLengthPlugin.tsx
986
987
  function bn({ maxLength: e, onMaxLengthExceed: t }) {
987
- let [n] = R(), { isSourceModeRef: r } = y(), i = D(t);
988
- return i.current = t, T(() => {
988
+ let [n] = R(), { isSourceModeRef: r } = v(), i = O(t);
989
+ return i.current = t, E(() => {
989
990
  let t = null;
990
991
  return n.registerNodeTransform(We, (a) => {
991
992
  if (r.current) return;
992
993
  let o = a.getTextContentSize();
993
994
  if (o <= e) return;
994
- let s = n.getEditorState(), c = s.read(() => a.getTextContentSize()), l = o - e, u = M();
995
+ let s = n.getEditorState(), c = s.read(() => a.getTextContentSize()), l = o - e, u = N();
995
996
  if (c === e && t !== s) {
996
- t = s, Ye(n, s), i.current?.();
997
+ t = s, Ze(n, s), i.current?.();
997
998
  return;
998
999
  }
999
- if (F(u) && u.isCollapsed()) {
1000
- B(n, u.anchor, l), i.current?.();
1000
+ if (I(u) && u.isCollapsed()) {
1001
+ Xe(n, u.anchor, l), i.current?.();
1001
1002
  return;
1002
1003
  }
1003
1004
  a.selectEnd();
1004
- let d = M();
1005
- F(d) && (B(n, d.anchor, l), i.current?.());
1005
+ let d = N();
1006
+ I(d) && (Xe(n, d.anchor, l), i.current?.());
1006
1007
  });
1007
1008
  }, [
1008
1009
  n,
@@ -1043,12 +1044,12 @@ var xn = [
1043
1044
  }
1044
1045
  };
1045
1046
  function Cn(e, t) {
1046
- let n = j();
1047
+ let n = M();
1047
1048
  if (n.clear(), !t.trim()) return;
1048
1049
  let r = new DOMParser().parseFromString(t, "text/html");
1049
1050
  Sn(r);
1050
- let i = ye(e, r);
1051
- i.length && (n.select(), N(i));
1051
+ let i = ve(e, r);
1052
+ i.length && (n.select(), P(i));
1052
1053
  }
1053
1054
  //#endregion
1054
1055
  //#region src/components/Editor/utils/isEmptyEditorHtml.ts
@@ -1117,15 +1118,15 @@ function Mn(e) {
1117
1118
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1118
1119
  }
1119
1120
  function Nn(e, t) {
1120
- let n = j(), r = n.getTextContentSize();
1121
+ let n = M(), r = n.getTextContentSize();
1121
1122
  if (r <= t) return !1;
1122
1123
  let i = r - t;
1123
1124
  n.selectEnd();
1124
- let a = M();
1125
- return F(a) ? B(e, a.anchor, i) : Pn(i), !0;
1125
+ let a = N();
1126
+ return I(a) ? Xe(e, a.anchor, i) : Pn(i), !0;
1126
1127
  }
1127
1128
  function Pn(e) {
1128
- let t = e, n = j().getAllTextNodes();
1129
+ let t = e, n = M().getAllTextNodes();
1129
1130
  for (let e = n.length - 1; e >= 0 && t > 0; e--) {
1130
1131
  let r = n[e], i = r.getTextContent();
1131
1132
  i.length !== 0 && (i.length <= t ? (t -= i.length, r.remove()) : (r.setTextContent(i.slice(0, i.length - t)), t = 0));
@@ -1178,42 +1179,42 @@ async function Ln(e) {
1178
1179
  //#endregion
1179
1180
  //#region src/components/Editor/utils/writeHtmlSource.ts
1180
1181
  function Rn(e) {
1181
- j().clear();
1182
- let t = it("html");
1183
- if (j().append(t), !e) return;
1182
+ M().clear();
1183
+ let t = at("html");
1184
+ if (M().append(t), !e) return;
1184
1185
  t.select();
1185
- let n = M();
1186
- F(n) && n.insertRawText(e);
1186
+ let n = N();
1187
+ I(n) && n.insertRawText(e);
1187
1188
  }
1188
1189
  //#endregion
1189
1190
  //#region src/components/Editor/plugins/SourceModePlugin.tsx
1190
1191
  function zn({ children: e, maxLength: t, onMaxLengthExceed: n }) {
1191
- let [r] = R(), [i, a] = O(!1), o = D(!1), s = D(n);
1192
+ let [r] = R(), [i, a] = k(!1), o = O(!1), s = O(n);
1192
1193
  s.current = n;
1193
- let c = Mn(t) ? t : void 0, l = w(() => {
1194
+ let c = Mn(t) ? t : void 0, l = T(() => {
1194
1195
  if (o.current) return;
1195
1196
  let e = "", t = "";
1196
1197
  r.getEditorState().read(() => {
1197
- t = j().getTextContent(), e = ve(r, null);
1198
+ t = M().getTextContent(), e = _e(r, null);
1198
1199
  }, { editor: r }), Ln(wn(e, t) ? "" : $(e)).then((e) => {
1199
1200
  o.current || (o.current = !0, a(!0), r.update(() => {
1200
1201
  Rn(e);
1201
- }), r.dispatchCommand(Me, void 0));
1202
+ }), r.dispatchCommand(je, void 0));
1202
1203
  });
1203
- }, [r]), u = w(() => {
1204
+ }, [r]), u = T(() => {
1204
1205
  if (!o.current) return;
1205
1206
  let e = !1;
1206
1207
  o.current = !1, r.update(() => {
1207
- Cn(r, $(j().getTextContent())), c !== void 0 && (e = Nn(r, c));
1208
- }), a(!1), r.dispatchCommand(Me, void 0), e && s.current?.();
1209
- }, [r, c]), d = w(() => {
1208
+ Cn(r, $(M().getTextContent())), c !== void 0 && (e = Nn(r, c));
1209
+ }), a(!1), r.dispatchCommand(je, void 0), e && s.current?.();
1210
+ }, [r, c]), d = T(() => {
1210
1211
  if (o.current) {
1211
1212
  u();
1212
1213
  return;
1213
1214
  }
1214
1215
  l();
1215
1216
  }, [l, u]);
1216
- T(() => {
1217
+ E(() => {
1217
1218
  let e = (e) => {
1218
1219
  if (!o.current) return !1;
1219
1220
  let t = "clipboardData" in e ? e.clipboardData : "dataTransfer" in e ? e.dataTransfer : null;
@@ -1223,22 +1224,22 @@ function zn({ children: e, maxLength: t, onMaxLengthExceed: n }) {
1223
1224
  if (!n) return !0;
1224
1225
  let i = $(n);
1225
1226
  return r.update(() => {
1226
- let e = M();
1227
- F(e) && i && e.insertRawText(i);
1227
+ let e = N();
1228
+ I(e) && i && e.insertRawText(i);
1228
1229
  }, { tag: Ue }), !0;
1229
1230
  };
1230
- return Xe(r.registerNodeTransform(We, () => {
1231
+ return B(r.registerNodeTransform(We, () => {
1231
1232
  if (!o.current) return;
1232
- let e = j(), t = e.getChildrenSize() === 1 ? e.getFirstChild() : null;
1233
+ let e = M(), t = e.getChildrenSize() === 1 ? e.getFirstChild() : null;
1233
1234
  U(t) && t.getLanguage() === "html" || Rn(e.getTextContent());
1234
- }), r.registerCommand(He, e, Ne), r.registerCommand(Ie, e, Ne));
1235
+ }), r.registerCommand(He, e, Me), r.registerCommand(Ie, e, Me));
1235
1236
  }, [r]);
1236
- let f = E(() => ({
1237
+ let f = D(() => ({
1237
1238
  isSourceMode: i,
1238
1239
  isSourceModeRef: o,
1239
1240
  toggleSourceMode: d
1240
1241
  }), [i, d]);
1241
- return /* @__PURE__ */ S(g.Provider, {
1242
+ return /* @__PURE__ */ C(g.Provider, {
1242
1243
  value: f,
1243
1244
  children: e
1244
1245
  });
@@ -1248,7 +1249,7 @@ function zn({ children: e, maxLength: t, onMaxLengthExceed: n }) {
1248
1249
  function Bn(e) {
1249
1250
  let t = e.getTag();
1250
1251
  if (t === "h4" || t === "h5" || t === "h6") {
1251
- e.replace(Se(), !0);
1252
+ e.replace(xe(), !0);
1252
1253
  return;
1253
1254
  }
1254
1255
  for (let t of e.getAllTextNodes()) {
@@ -1260,14 +1261,14 @@ function Bn(e) {
1260
1261
  }
1261
1262
  function Vn() {
1262
1263
  let [e] = R();
1263
- return T(() => e.registerNodeTransform(yt, Bn), [e]), null;
1264
+ return E(() => e.registerNodeTransform(yt, Bn), [e]), null;
1264
1265
  }
1265
1266
  //#endregion
1266
1267
  //#region src/components/Editor/LengthBadge.tsx
1267
1268
  var Hn = ({ current: e, maxLength: t }) => {
1268
1269
  let n = e > t;
1269
- return /* @__PURE__ */ C("div", {
1270
- className: k(Y["bsy-lexical-editor__length-badge"], n && Y["bsy-lexical-editor__length-badge--exceeded"]),
1270
+ return /* @__PURE__ */ w("div", {
1271
+ className: A(Y["bsy-lexical-editor__length-badge"], n && Y["bsy-lexical-editor__length-badge--exceeded"]),
1271
1272
  "aria-live": "polite",
1272
1273
  children: [
1273
1274
  e,
@@ -1280,109 +1281,112 @@ Hn.displayName = "BsyLexicalEditorLengthBadge";
1280
1281
  //#endregion
1281
1282
  //#region src/components/Editor/EditorCore.tsx
1282
1283
  var Un = (e) => {
1283
- let { height: t = 126, onChange: n, toolbar: r, theme: i, maxLength: a, onMaxLengthExceed: o } = e, [s] = R(), { isSourceMode: c, isSourceModeRef: l } = y(), u = D(null), d = D(null), f = D(null), p = D(o);
1284
- p.current = o;
1285
- let m = Mn(a) ? a : void 0, [h, g] = O(0), _ = r?.mode === "floating", v = m !== void 0 && !c, b = E(() => ({
1286
- containerRef: u,
1287
- toolbarRef: d
1288
- }), []), x = w((e) => {
1289
- l.current || e.read(() => {
1290
- let t = j().getTextContent(), r = $(ve(s, null)), i = wn(r, t) ? null : r;
1291
- f.current = i, m !== void 0 && g(t.length), n({
1284
+ let { height: t = "auto", minHeight: n, onChange: r, toolbar: i, theme: a, maxLength: o, onMaxLengthExceed: s } = e, [c] = R(), { isSourceMode: l, isSourceModeRef: u } = v(), d = O(null), f = O(null), p = O(null), m = O(s);
1285
+ m.current = s;
1286
+ let h = Mn(o) ? o : void 0, [g, _] = k(0), ee = i?.mode === "floating", y = h !== void 0 && !l, b = D(() => ({
1287
+ containerRef: d,
1288
+ toolbarRef: f
1289
+ }), []), te = T((e) => {
1290
+ u.current || e.read(() => {
1291
+ let t = M().getTextContent(), n = $(_e(c, null)), i = wn(n, t) ? null : n;
1292
+ p.current = i, h !== void 0 && _(t.length), r({
1292
1293
  text: t,
1293
1294
  html: i
1294
1295
  }, e);
1295
- }, { editor: s });
1296
+ }, { editor: c });
1296
1297
  }, [
1297
- n,
1298
- s,
1299
- m,
1300
- l
1298
+ r,
1299
+ c,
1300
+ h,
1301
+ u
1301
1302
  ]);
1302
- T(() => {
1303
- m === void 0 || c || s.getEditorState().read(() => {
1304
- g(j().getTextContentSize());
1305
- }, { editor: s });
1303
+ E(() => {
1304
+ h === void 0 || l || c.getEditorState().read(() => {
1305
+ _(M().getTextContentSize());
1306
+ }, { editor: c });
1306
1307
  }, [
1307
- s,
1308
- m,
1309
- c
1310
- ]), T(() => {
1311
- if (e.value === void 0 || e.value === f.current) return;
1312
- if (l.current) {
1308
+ c,
1309
+ h,
1310
+ l
1311
+ ]), E(() => {
1312
+ if (e.value === void 0 || e.value === p.current) return;
1313
+ if (u.current) {
1313
1314
  let t = e.value?.trim() ? $(e.value) : "", n = e.value;
1314
1315
  Ln(t).then((e) => {
1315
- !l.current || f.current !== n || s.update(() => {
1316
+ !u.current || p.current !== n || c.update(() => {
1316
1317
  Rn(e);
1317
1318
  });
1318
- }), f.current = e.value;
1319
+ }), p.current = e.value;
1319
1320
  return;
1320
1321
  }
1321
1322
  let t = !1;
1322
- s.update(() => {
1323
- Cn(s, e.value?.trim() ? $(e.value) : ""), m !== void 0 && (t = Nn(s, m));
1324
- }), t && p.current?.();
1323
+ c.update(() => {
1324
+ Cn(c, e.value?.trim() ? $(e.value) : ""), h !== void 0 && (t = Nn(c, h));
1325
+ }), t && m.current?.();
1325
1326
  }, [
1326
1327
  e.value,
1327
- s,
1328
- m,
1329
- l
1328
+ c,
1329
+ h,
1330
+ u
1330
1331
  ]);
1331
- let ee = r?.config?.length ? r?.config : [], te = bt();
1332
- return /* @__PURE__ */ S(kt.Provider, {
1332
+ let x = i?.config?.length ? i?.config : [], ne = bt(), S = typeof t == "number" ? t : void 0;
1333
+ return /* @__PURE__ */ C(kt.Provider, {
1333
1334
  value: b,
1334
- children: /* @__PURE__ */ C("div", {
1335
- ref: u,
1336
- className: k(Y["bsy-lexical-editor"], _ && Y["bsy-lexical-editor--floating"]),
1335
+ children: /* @__PURE__ */ w("div", {
1336
+ ref: d,
1337
+ className: A(Y["bsy-lexical-editor"], ee && Y["bsy-lexical-editor--floating"]),
1337
1338
  onClick: (e) => {
1338
- let t = s.getRootElement(), n = e.target;
1339
- !t || !n || !t.contains(n) || s.isEditable() || s.setEditable(!0);
1339
+ let t = c.getRootElement(), n = e.target;
1340
+ !t || !n || !t.contains(n) || c.isEditable() || c.setEditable(!0);
1340
1341
  },
1341
1342
  children: [
1342
- ee.length > 0 && /* @__PURE__ */ S(Rt, {
1343
- config: ee,
1344
- theme: i?.toolbar,
1345
- style: r?.style,
1346
- mode: r?.mode,
1347
- floating: r?.floating
1343
+ x.length > 0 && /* @__PURE__ */ C(Rt, {
1344
+ config: x,
1345
+ theme: a?.toolbar,
1346
+ style: i?.style,
1347
+ mode: i?.mode,
1348
+ floating: i?.floating
1348
1349
  }),
1349
- /* @__PURE__ */ S(pe, {
1350
- contentEditable: /* @__PURE__ */ S(me, {
1351
- className: k(Y["bsy-lexical-editor__content-editable"], v && Y["bsy-lexical-editor__content-editable--with-length-badge"]),
1352
- style: {
1353
- height: t,
1354
- cursor: te ? "auto" : "text"
1355
- }
1356
- }),
1357
- ErrorBoundary: _e
1350
+ /* @__PURE__ */ w("div", {
1351
+ className: A(Y["bsy-lexical-editor__body"], S !== void 0 && Y["bsy-lexical-editor__body--fixed"]),
1352
+ style: { height: S },
1353
+ children: [/* @__PURE__ */ C(fe, {
1354
+ contentEditable: /* @__PURE__ */ C(pe, {
1355
+ className: Y["bsy-lexical-editor__content-editable"],
1356
+ style: {
1357
+ minHeight: S === void 0 ? n : void 0,
1358
+ cursor: ne ? "auto" : "text"
1359
+ }
1360
+ }),
1361
+ ErrorBoundary: ge
1362
+ }), y ? /* @__PURE__ */ C(Hn, {
1363
+ current: g,
1364
+ maxLength: h
1365
+ }) : null]
1358
1366
  }),
1359
- /* @__PURE__ */ S(xt, {}),
1360
- /* @__PURE__ */ S(St, {}),
1361
- /* @__PURE__ */ S(Ht, {}),
1362
- /* @__PURE__ */ S(Vn, {}),
1363
- /* @__PURE__ */ S(Jt, {}),
1364
- /* @__PURE__ */ S(Zt, {}),
1365
- /* @__PURE__ */ S(Qt, {}),
1366
- /* @__PURE__ */ S(gn, {}),
1367
- /* @__PURE__ */ S(_n, {}),
1368
- /* @__PURE__ */ S(yn, {}),
1369
- v ? /* @__PURE__ */ S(bn, {
1370
- maxLength: m,
1371
- onMaxLengthExceed: o
1367
+ /* @__PURE__ */ C(xt, {}),
1368
+ /* @__PURE__ */ C(St, {}),
1369
+ /* @__PURE__ */ C(Ht, {}),
1370
+ /* @__PURE__ */ C(Vn, {}),
1371
+ /* @__PURE__ */ C(Jt, {}),
1372
+ /* @__PURE__ */ C(Zt, {}),
1373
+ /* @__PURE__ */ C(Qt, {}),
1374
+ /* @__PURE__ */ C(gn, {}),
1375
+ /* @__PURE__ */ C(_n, {}),
1376
+ /* @__PURE__ */ C(yn, {}),
1377
+ y ? /* @__PURE__ */ C(bn, {
1378
+ maxLength: h,
1379
+ onMaxLengthExceed: s
1372
1380
  }) : null,
1373
- /* @__PURE__ */ S(he, {}),
1374
- /* @__PURE__ */ S(ge, { onChange: x }),
1375
- v ? /* @__PURE__ */ S(Hn, {
1376
- current: h,
1377
- maxLength: m
1378
- }) : null
1381
+ /* @__PURE__ */ C(me, {}),
1382
+ /* @__PURE__ */ C(he, { onChange: te })
1379
1383
  ]
1380
1384
  })
1381
1385
  });
1382
- }, Wn = (e) => /* @__PURE__ */ S(zn, {
1386
+ }, Wn = (e) => /* @__PURE__ */ C(zn, {
1383
1387
  maxLength: e.maxLength,
1384
1388
  onMaxLengthExceed: e.onMaxLengthExceed,
1385
- children: /* @__PURE__ */ S(Un, { ...e })
1389
+ children: /* @__PURE__ */ C(Un, { ...e })
1386
1390
  });
1387
1391
  Wn.displayName = "BsyLexicalEditorCore";
1388
1392
  //#endregion
@@ -1392,8 +1396,8 @@ var Gn = "1px solid #d9d9d9", Kn = { export: new Map([[q, (e, t) => {
1392
1396
  return Ge(n.element) && (n.element.style.border = Gn), n;
1393
1397
  }]]) }, qn = (e) => {
1394
1398
  let { autoFocus: t = !1 } = e;
1395
- return /* @__PURE__ */ S(fe, {
1396
- initialConfig: E(() => ({
1399
+ return /* @__PURE__ */ C(de, {
1400
+ initialConfig: D(() => ({
1397
1401
  namespace: "bsyLexicalEditor",
1398
1402
  onError: (e) => {
1399
1403
  console.error("Lexical error", e);
@@ -1431,10 +1435,10 @@ var Gn = "1px solid #d9d9d9", Kn = { export: new Map([[q, (e, t) => {
1431
1435
  },
1432
1436
  html: Kn,
1433
1437
  nodes: [
1438
+ et,
1434
1439
  $e,
1435
- Qe,
1440
+ rt,
1436
1441
  nt,
1437
- tt,
1438
1442
  yt,
1439
1443
  G,
1440
1444
  W,
@@ -1450,9 +1454,9 @@ var Gn = "1px solid #d9d9d9", Kn = { export: new Map([[q, (e, t) => {
1450
1454
  }
1451
1455
  ]
1452
1456
  }), [t]),
1453
- children: /* @__PURE__ */ S(Wn, { ...e })
1457
+ children: /* @__PURE__ */ C(Wn, { ...e })
1454
1458
  });
1455
1459
  };
1456
1460
  qn.displayName = "BsyLexicalEditor";
1457
1461
  //#endregion
1458
- export { Ee as $getRoot, b as BaseButton, qn as default, v as listRegisteredToolbarButtons, f as registerToolbarButton, a as unregisterToolbarButton, qe as useLexicalComposerContext };
1462
+ export { Te as $getRoot, y as BaseButton, qn as default, ee as listRegisteredToolbarButtons, f as registerToolbarButton, a as unregisterToolbarButton, qe as useLexicalComposerContext };