@baishuyun/ui-base 6.9.1 → 6.10.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 (145) hide show
  1. package/dist/Amap/{Amap-BNnmSPnl.js → Amap-BLSziesG.js} +1 -1
  2. package/dist/Amap/AmapCircle/index.js +4 -4
  3. package/dist/Amap/{AmapCircle-BDW6pnNR.js → AmapCircle-2qupysHe.js} +1 -1
  4. package/dist/Amap/AmapMarker/index.js +5 -5
  5. package/dist/Amap/{AmapMarker-CdoPWdff.js → AmapMarker-xEqoVnFR.js} +2 -2
  6. package/dist/Amap/AmapMarkerCluster/index.js +5 -5
  7. package/dist/Amap/{AmapMarkerCluster-CSIxiVC5.js → AmapMarkerCluster-CvEQa3o9.js} +2 -2
  8. package/dist/Amap/AmapProvider/index.js +6 -5
  9. package/dist/Amap/{AmapProvider-Cwi6WOe0.js → AmapProvider-DqFp3DZ5.js} +2 -2
  10. package/dist/Amap/hooks/index.js +3 -3
  11. package/dist/Amap/{hooks-DAN31s_-.js → hooks-BTcFpdd0.js} +1 -1
  12. package/dist/Amap/index.js +12 -11
  13. package/dist/Calendar/{AllDaySection-a96dIzs3.js → AllDaySection-BqbcPQls.js} +1 -1
  14. package/dist/Calendar/{Calendar-Bcs9mxET.js → Calendar-gEtuBW7Y.js} +9 -10
  15. package/dist/Calendar/{CurrentTimeIndicator-CNKsVEXH.js → CurrentTimeIndicator-dRYot1Rk.js} +24 -18
  16. package/dist/Calendar/{EventCard-B1LoBxth.js → EventCard-Di5UX4pB.js} +1 -2
  17. package/dist/Calendar/{TimeGrid-DIw8oCqY.js → TimeGrid-CBpDFAM4.js} +1 -1
  18. package/dist/Calendar/context/index.js +1 -1
  19. package/dist/Calendar/index.js +15 -14
  20. package/dist/Calendar/subcomponents/AllDaySection/index.js +5 -4
  21. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -3
  22. package/dist/Calendar/subcomponents/EventCard/index.js +4 -3
  23. package/dist/Calendar/subcomponents/TimeAxis/index.js +1 -1
  24. package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -3
  25. package/dist/Calendar/{theme-xnrMsnkg.js → theme-i60ueO92.js} +1 -1
  26. package/dist/Calendar/utils/index.js +1 -1
  27. package/dist/Calendar/utils/layout/index.js +1 -1
  28. package/dist/Calendar/utils/theme/index.js +2 -2
  29. package/dist/Card/index.js +2 -2
  30. package/dist/CheckBox/index.js +1 -1
  31. package/dist/ColorPicker/ColorPicker-CYlrnMwM.js +174 -0
  32. package/dist/ColorPicker/index.js +6 -6
  33. package/dist/ConfigProvider/index.js +4 -3
  34. package/dist/DatePicker/DatePicker-CagGt_f0.js +101 -0
  35. package/dist/DatePicker/{DatePickerPanel-C_TDG3HH.js → DatePickerPanel-CaDZzxMD.js} +3 -3
  36. package/dist/DatePicker/index.js +7 -6
  37. package/dist/DatePicker/style/index.js +2 -2
  38. package/dist/DatePicker/{style-CNtPPsZp.js → style-UKXn1N_p.js} +1 -1
  39. package/dist/DropDown/DropDown-CLuQf970.js +178 -0
  40. package/dist/DropDown/index.js +8 -7
  41. package/dist/DropDown/style/index.js +2 -2
  42. package/dist/DropDown/{style-Fdp-U4md.js → style-LLDVPpPa.js} +1 -1
  43. package/dist/Editor/Buttons-ByO5rS19.js +937 -0
  44. package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -12
  45. package/dist/Editor/constants/index.js +3 -3
  46. package/dist/Editor/index.js +667 -298
  47. package/dist/Gantt/GanttChart/index.js +11 -10
  48. package/dist/Gantt/{GanttChart-DjwZsxEj.js → GanttChart-DvCAp8Dk.js} +3 -5
  49. package/dist/Gantt/GanttTable/index.js +6 -6
  50. package/dist/Gantt/{GanttTable-xbXD_PWI.js → GanttTable-DyVJOVo3.js} +1 -1
  51. package/dist/Gantt/GanttToolBar/index.js +9 -8
  52. package/dist/Gantt/{GanttToolBar-BTeTsR6Z.js → GanttToolBar-CxT68kmT.js} +2 -3
  53. package/dist/Gantt/index.js +15 -14
  54. package/dist/Gantt/{theme-DLNvgM9X.js → theme-2LyXJRDe.js} +1 -1
  55. package/dist/Gantt/utils/index.js +1 -1
  56. package/dist/Gantt/utils/theme/index.js +2 -2
  57. package/dist/Icon/index.js +1 -1
  58. package/dist/InputTag/{InputTag-hzCCJQ1z.js → InputTag-yRPO90Ku.js} +2 -2
  59. package/dist/InputTag/index.js +5 -5
  60. package/dist/Loading/{Loading-DiywS7ex.js → Loading-BF_dtuLc.js} +1 -1
  61. package/dist/Loading/index.js +4 -4
  62. package/dist/Modal/Modal-Cb7Msq26.js +96 -0
  63. package/dist/Modal/index.js +3 -2
  64. package/dist/NotFoundContent/index.js +1 -1
  65. package/dist/Overlay/OverlayContext-CVSFoyqN.js +23 -0
  66. package/dist/Overlay/index.js +3 -0
  67. package/dist/Radio/index.js +1 -1
  68. package/dist/ScrollBar/{ScrollBar-QhXVe8zd.js → ScrollBar-N2pOLv-8.js} +1 -1
  69. package/dist/ScrollBar/index.js +2 -2
  70. package/dist/Segmented/{Segmented-BDz1hMDT.js → Segmented-BCQRrc65.js} +1 -1
  71. package/dist/Segmented/index.js +2 -2
  72. package/dist/Select/Select-iwzfNy9d.js +753 -0
  73. package/dist/Select/{SelectInputSearch-COUzreau.js → SelectInputSearch-Bc_aPNbG.js} +1 -1
  74. package/dist/Select/index.js +8 -7
  75. package/dist/Table/{Table-yQXQEk6d.js → Table-Cm8zFl2G.js} +2 -2
  76. package/dist/Table/hooks/index.js +1 -1
  77. package/dist/Table/index.js +5 -5
  78. package/dist/Table/style/index.js +2 -2
  79. package/dist/Table/{style-DgiPEsSp.js → style-C4wp0IOM.js} +1 -1
  80. package/dist/Table/utils/index.js +1 -1
  81. package/dist/Tabs/{Tabs-BiKW70CL.js → Tabs-BPWRIwtD.js} +118 -103
  82. package/dist/Tabs/index.js +5 -5
  83. package/dist/Tooltip/Tooltip-Bb3Jx-If.js +172 -0
  84. package/dist/Tooltip/index.js +3 -2
  85. package/dist/Tree/index.js +2 -2
  86. package/dist/Tree/utils/index.js +1 -1
  87. package/dist/components/ColorPicker/ColorPalettes.d.ts +3 -8
  88. package/dist/components/ColorPicker/ColorPicker.type.d.ts +6 -9
  89. package/dist/components/ColorPicker/constants.d.ts +3 -1
  90. package/dist/components/ColorPicker/index.d.ts +1 -1
  91. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +2 -0
  92. package/dist/components/DatePicker/interface.d.ts +2 -0
  93. package/dist/components/Editor/ToolbarPlugin/Buttons/BulletListButton.d.ts +2 -0
  94. package/dist/components/Editor/ToolbarPlugin/Buttons/CodeButton.d.ts +2 -0
  95. package/dist/components/Editor/ToolbarPlugin/Buttons/CodeLanguageButton.d.ts +2 -0
  96. package/dist/components/Editor/ToolbarPlugin/Buttons/IndentButton.d.ts +2 -0
  97. package/dist/components/Editor/ToolbarPlugin/Buttons/NumberListButton.d.ts +2 -0
  98. package/dist/components/Editor/ToolbarPlugin/Buttons/OutdentButton.d.ts +2 -0
  99. package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +5 -4
  100. package/dist/components/Editor/ToolbarPlugin/Buttons/RedoButton.d.ts +2 -0
  101. package/dist/components/Editor/ToolbarPlugin/Buttons/StrikeThroughButton.d.ts +2 -0
  102. package/dist/components/Editor/ToolbarPlugin/Buttons/SubscriptButton.d.ts +2 -0
  103. package/dist/components/Editor/ToolbarPlugin/Buttons/SuperscriptButton.d.ts +2 -0
  104. package/dist/components/Editor/ToolbarPlugin/Buttons/UndoButton.d.ts +2 -0
  105. package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +10 -0
  106. package/dist/components/Editor/ToolbarPlugin/context/HistoryStateProvider.d.ts +8 -0
  107. package/dist/components/Editor/ToolbarPlugin/context/TextFormatsContext.d.ts +8 -1
  108. package/dist/components/Editor/ToolbarPlugin/icons/ToolbarIcon.d.ts +13 -0
  109. package/dist/components/Editor/constants/codeLanguages.d.ts +69 -0
  110. package/dist/components/Editor/constants/index.d.ts +2 -0
  111. package/dist/components/Editor/plugins/CodeHighlightPlugin.d.ts +1 -0
  112. package/dist/components/Editor/plugins/LinkColorPlugin.d.ts +2 -0
  113. package/dist/components/Editor/plugins/PasteStripImagePlugin.d.ts +1 -0
  114. package/dist/components/Editor/utils/codeHighlighter.d.ts +12 -0
  115. package/dist/components/Editor/utils/formatTruncatedFilename.d.ts +4 -0
  116. package/dist/components/Editor/utils/stripImagesFromHtml.d.ts +1 -0
  117. package/dist/components/Overlay/OverlayContext.d.ts +16 -0
  118. package/dist/components/Overlay/index.d.ts +2 -0
  119. package/dist/components/Tooltip/Tooltip.type.d.ts +1 -1
  120. package/dist/components/index.d.ts +2 -0
  121. package/dist/index.js +45 -44
  122. package/dist/locale/lang/en-US.json.d.ts +14 -2
  123. package/dist/locale/lang/zh-CN.json.d.ts +14 -2
  124. package/dist/locale/lang/zh-TW.json.d.ts +14 -2
  125. package/dist/style.css +1 -1
  126. package/dist/vendors/{ConfigProvider-DxrZpdIb.js → ConfigProvider-vPuwReNX.js} +70 -36
  127. package/dist/vendors/{LocaleContext-Dcw6C1LX.js → LocaleContext-CN9doEXT.js} +14 -2
  128. package/dist/vendors/{Tree-DXmVRDn0.js → Tree-B09frqQX.js} +1 -0
  129. package/dist/vendors/{useLocale-BKZX2_zw.js → useLocale-sawv8CEL.js} +1 -1
  130. package/dist/vendors/{version-DiV_Cnd8.js → version-DdQLttdL.js} +1 -1
  131. package/package.json +7 -1
  132. package/dist/ColorPicker/ColorPicker-t1uBeATW.js +0 -155
  133. package/dist/DatePicker/DatePicker--kMNwM9Q.js +0 -96
  134. package/dist/DropDown/DropDown-yDH9V_9Y.js +0 -171
  135. package/dist/Editor/Buttons-BhStZyIa.js +0 -620
  136. package/dist/Modal/Modal-LiztSF7x.js +0 -92
  137. package/dist/Select/Select-D6EK7whJ.js +0 -744
  138. package/dist/Tooltip/Tooltip-Ch9lti_7.js +0 -168
  139. package/dist/vendors/color-D6XBXROa.js +0 -12
  140. /package/dist/Amap/{AmapContext-D7Njjm5a.js → AmapContext-CJBe6lld.js} +0 -0
  141. /package/dist/Amap/{useMarkerInfoWindowController-BQmhR0N7.js → useMarkerInfoWindowController-Cjx0xQXw.js} +0 -0
  142. /package/dist/Card/{Card-CtKLNh3n.js → Card-Ds5Rpq--.js} +0 -0
  143. /package/dist/vendors/{cssVars-BYg1matG.js → cssVars-l4-kP_14.js} +0 -0
  144. /package/dist/vendors/{mergeRefs-Bsywq1Vo.js → mergeRefs-TiJ0xjUN.js} +0 -0
  145. /package/dist/vendors/{useFloatingOverlay-BApqkHSu.js → useFloatingOverlay-B3M9k8nj.js} +0 -0
@@ -1,57 +1,61 @@
1
- import "../vendors/version-DiV_Cnd8.js";
1
+ import "../vendors/version-DdQLttdL.js";
2
2
  import "../ScrollBar/style-D26azwz6.js";
3
- import "../Icon/Icon-BBDcb-yw.js";
4
- import "../vendors/LocaleContext-Dcw6C1LX.js";
5
- import "../Modal/Modal-LiztSF7x.js";
6
- import "../ColorPicker/ColorPicker-t1uBeATW.js";
7
- import "../vendors/useFloatingOverlay-BApqkHSu.js";
8
- import "../vendors/useLocale-BKZX2_zw.js";
9
- import "../vendors/color-D6XBXROa.js";
3
+ import { t as e } from "../Icon/Icon-BBDcb-yw.js";
4
+ import "../vendors/LocaleContext-CN9doEXT.js";
5
+ import "../Overlay/OverlayContext-CVSFoyqN.js";
6
+ import "../Modal/Modal-Cb7Msq26.js";
7
+ import "../ColorPicker/ColorPicker-CYlrnMwM.js";
8
+ import "../vendors/useFloatingOverlay-B3M9k8nj.js";
9
+ import { t } from "../vendors/useLocale-sawv8CEL.js";
10
10
  import "../vendors/useLatchedPopupPortalRoot-4fVhqVT4.js";
11
- import { t as e } from "../vendors/cssVars-BYg1matG.js";
12
- import "../Select/SelectInputSearch-COUzreau.js";
11
+ import { t as n } from "../vendors/cssVars-l4-kP_14.js";
12
+ import "../Select/SelectInputSearch-Bc_aPNbG.js";
13
13
  import "../CheckBox/CheckBox-ByWSy9Yr.js";
14
14
  import "../CheckBox/CheckBox-nBm0u6zX.js";
15
15
  import "../NotFoundContent/NotFoundContent-BLmzWNBi.js";
16
- import "../ScrollBar/ScrollBar-QhXVe8zd.js";
16
+ import "../ScrollBar/ScrollBar-N2pOLv-8.js";
17
17
  import "../vendors/useFloatingPortal-CmVJbuRm.js";
18
- import "../DropDown/DropDown-yDH9V_9Y.js";
19
- import "../DropDown/style-Fdp-U4md.js";
20
- import { a as t, c as n, d as r, i, l as a, n as o, o as s, r as c, s as l, u } from "./Buttons-BhStZyIa.js";
21
- import { DEFAULT_BACKGROUND_COLOR as d, DEFAULT_FONT_COLOR as f, DEFAULT_FONT_SIZE as p } from "./constants/index.js";
22
- import { omit as m } from "lodash-es";
23
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
24
- import v, { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
25
- import w from "clsx";
26
- import { LexicalComposer as T } from "@lexical/react/LexicalComposer";
27
- import { RichTextPlugin as E } from "@lexical/react/LexicalRichTextPlugin";
28
- import { ContentEditable as ee } from "@lexical/react/LexicalContentEditable";
29
- import { HistoryPlugin as te } from "@lexical/react/LexicalHistoryPlugin";
30
- import { OnChangePlugin as ne } from "@lexical/react/LexicalOnChangePlugin";
31
- import { LexicalErrorBoundary as D } from "@lexical/react/LexicalErrorBoundary";
32
- import { $generateHtmlFromNodes as re, $generateNodesFromDOM as ie } from "@lexical/html";
33
- import { $applyNodeReplacement as O, $createParagraphNode as k, $getNodeByKey as A, $getRoot as j, $getRoot as M, $getSelection as N, $insertNodes as P, $isElementNode as ae, $isRangeSelection as F, $isRootOrShadowRoot as oe, $isTextNode as se, COMMAND_PRIORITY_EDITOR as ce, COMMAND_PRIORITY_LOW as le, DecoratorNode as ue, KEY_ENTER_COMMAND as de, RootNode as fe, TextNode as I } from "lexical";
34
- import { useLexicalComposerContext as pe, useLexicalComposerContext as L } from "@lexical/react/LexicalComposerContext";
35
- import { $getSelectionStyleValueForProperty as R, $patchStyleText as z, $trimTextContentFromAnchor as B } from "@lexical/selection";
36
- import { $findMatchingParent as V, $restoreEditorState as me } from "@lexical/utils";
37
- import { $isLinkNode as he, AutoLinkNode as ge, LinkNode as _e } from "@lexical/link";
38
- import { useLexicalEditable as ve } from "@lexical/react/useLexicalEditable";
39
- import { LinkPlugin as ye } from "@lexical/react/LexicalLinkPlugin";
18
+ import { t as r } from "../DropDown/DropDown-CLuQf970.js";
19
+ import "../DropDown/style-LLDVPpPa.js";
20
+ import { _ as i, a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as ee, u as v, v as y, y as te } from "./Buttons-ByO5rS19.js";
21
+ import { DEFAULT_BACKGROUND_COLOR as ne, DEFAULT_FONT_COLOR as re, DEFAULT_FONT_SIZE as ie } from "./constants/index.js";
22
+ import { omit as ae } from "lodash-es";
23
+ import { Fragment as oe, jsx as b, jsxs as x } from "react/jsx-runtime";
24
+ import se, { useCallback as S, useEffect as C, useMemo as w, useRef as T, useState as E } from "react";
25
+ import D 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, $getNodeByKey as O, $getRoot as we, $getRoot as k, $getSelection as A, $insertNodes as j, $isElementNode as Te, $isLineBreakNode as M, $isRangeSelection as N, $isRootOrShadowRoot as Ee, $isTabNode as De, $isTextNode as Oe, $onUpdate as ke, COMMAND_PRIORITY_EDITOR as Ae, COMMAND_PRIORITY_HIGH as je, COMMAND_PRIORITY_LOW as Me, DROP_COMMAND as Ne, DecoratorNode as Pe, KEY_ENTER_COMMAND as Fe, PASTE_COMMAND as Ie, PASTE_TAG as Le, RootNode as Re, TextNode as P, mergeRegister as ze } from "lexical";
35
+ import { useLexicalComposerContext as Be, useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext";
36
+ import { $getSelectionStyleValueForProperty as I, $patchStyleText as Ve, $trimTextContentFromAnchor as L } from "@lexical/selection";
37
+ import { $findMatchingParent as R, $restoreEditorState as He, mergeRegister as Ue } from "@lexical/utils";
38
+ import { $isLinkNode as We, AutoLinkNode as Ge, LinkNode as Ke } from "@lexical/link";
39
+ import { $isListItemNode as z, $isListNode as qe, ListItemNode as Je, ListNode as Ye } from "@lexical/list";
40
+ import { $createCodeHighlightNode as Xe, $isCodeHighlightNode as B, $isCodeNode as V, $plainifyCodeContent as Ze, CodeHighlightNode as H, CodeNode as U, registerCodeIndentation as Qe } from "@lexical/code-core";
41
+ import { useLexicalEditable as $e } from "@lexical/react/useLexicalEditable";
42
+ import { LinkPlugin as et } from "@lexical/react/LexicalLinkPlugin";
43
+ import { ListPlugin as tt } from "@lexical/react/LexicalListPlugin";
40
44
  //#region src/components/Editor/utils/resolveEditorToolbarThemeVars.ts
41
- var H = (e) => {
45
+ var W = (e) => {
42
46
  if (!(e === void 0 || e === "")) return typeof e == "number" ? `${e}px` : e;
43
- }, be = (t) => {
44
- if (!t) return {};
45
- let n = {};
46
- return e(n, "--bsy-editor-toolbar-bg", t.bg), e(n, "--bsy-editor-toolbar-border-color", t.borderColor), e(n, "--bsy-editor-toolbar-padding", t.padding), e(n, "--bsy-editor-toolbar-gap", H(t.gap)), e(n, "--bsy-editor-toolbar-group-gap", H(t.groupGap)), e(n, "--bsy-editor-toolbar-divider-color", t.dividerColor), e(n, "--bsy-editor-toolbar-divider-size", H(t.dividerSize)), e(n, "--bsy-editor-toolbar-divider-margin", H(t.dividerMargin)), e(n, "--bsy-editor-toolbar-color-icon", t.colorIcon), e(n, "--bsy-editor-toolbar-item-hover-bg", t.itemHoverBg), e(n, "--bsy-editor-toolbar-item-hover-color", t.itemHoverColor), e(n, "--bsy-editor-toolbar-item-active-bg", t.itemActiveBg), e(n, "--bsy-editor-toolbar-item-active-color", t.itemActiveColor), e(n, "--bsy-editor-toolbar-item-padding", H(t.itemPadding)), e(n, "--bsy-editor-toolbar-item-border-radius", H(t.itemBorderRadius)), e(n, "--bsy-editor-toolbar-icon-size", H(t.iconSize)), n;
47
- }, xe = (e) => {
47
+ }, nt = (e) => {
48
+ if (!e) return {};
49
+ let t = {};
50
+ return n(t, "--bsy-editor-toolbar-bg", e.bg), n(t, "--bsy-editor-toolbar-border-color", e.borderColor), n(t, "--bsy-editor-toolbar-padding", e.padding), n(t, "--bsy-editor-toolbar-gap", W(e.gap)), n(t, "--bsy-editor-toolbar-group-gap", W(e.groupGap)), n(t, "--bsy-editor-toolbar-divider-color", e.dividerColor), n(t, "--bsy-editor-toolbar-divider-size", W(e.dividerSize)), n(t, "--bsy-editor-toolbar-divider-margin", W(e.dividerMargin)), n(t, "--bsy-editor-toolbar-color-icon", e.colorIcon), n(t, "--bsy-editor-toolbar-item-hover-bg", e.itemHoverBg), n(t, "--bsy-editor-toolbar-item-hover-color", e.itemHoverColor), n(t, "--bsy-editor-toolbar-item-active-bg", e.itemActiveBg), n(t, "--bsy-editor-toolbar-item-active-color", e.itemActiveColor), n(t, "--bsy-editor-toolbar-item-padding", W(e.itemPadding)), n(t, "--bsy-editor-toolbar-item-border-radius", W(e.itemBorderRadius)), n(t, "--bsy-editor-toolbar-icon-size", W(e.iconSize)), t;
51
+ }, rt = (e) => {
48
52
  if (typeof e == "number" && Number.isFinite(e)) return e;
49
53
  if (typeof e == "string") {
50
54
  let t = Number.parseFloat(e);
51
55
  if (Number.isFinite(t)) return t;
52
56
  }
53
57
  return 14;
54
- }, Se = (e) => {
58
+ }, it = (e) => {
55
59
  let t = e?.placement ?? "top", n = e?.offset, r = typeof n == "number" ? 0 : n?.x ?? 0, i = typeof n == "number" ? n : n?.y ?? 0, a = t === "top", o = {
56
60
  position: "absolute",
57
61
  [a ? "bottom" : "top"]: "100%",
@@ -61,43 +65,72 @@ var H = (e) => {
61
65
  width: "100%"
62
66
  };
63
67
  return r && (o.transform = `translateX(${r}px)`), o;
64
- }, U = {
65
- "bsy-lexical__toolbar": "_bsy-lexical__toolbar_3xekt_1",
66
- "bsy-lexical__toolbar--floating": "_bsy-lexical__toolbar--floating_3xekt_10",
67
- "bsy-lexical__toolbar-group": "_bsy-lexical__toolbar-group_3xekt_16",
68
- "bsy-lexical__toolbar-divider": "_bsy-lexical__toolbar-divider_3xekt_22"
68
+ }, G = {
69
+ "bsy-lexical__toolbar": "_bsy-lexical__toolbar_se2wg_1",
70
+ "bsy-lexical__toolbar--floating": "_bsy-lexical__toolbar--floating_se2wg_12",
71
+ "bsy-lexical__toolbar-item": "_bsy-lexical__toolbar-item_se2wg_18",
72
+ "bsy-lexical__toolbar-group": "_bsy-lexical__toolbar-group_se2wg_24",
73
+ "bsy-lexical__toolbar-divider": "_bsy-lexical__toolbar-divider_se2wg_30",
74
+ "bsy-lexical__code-language": "_bsy-lexical__code-language_se2wg_37",
75
+ "bsy-lexical__code-language-label": "_bsy-lexical__code-language-label_se2wg_54",
76
+ "bsy-lexical__code-language-arrow": "_bsy-lexical__code-language-arrow_se2wg_65"
69
77
  };
70
78
  //#endregion
71
79
  //#region src/components/Editor/hooks/useTextFormatsState.ts
72
- function Ce() {
73
- let [e] = L(), [t, n] = C({
80
+ function at() {
81
+ let [e] = F(), [t, n] = E({
74
82
  bold: !1,
75
83
  italic: !1,
76
84
  underline: !1,
77
- fontSize: p,
78
- fontColor: f,
79
- backgroundColor: d,
85
+ strikethrough: !1,
86
+ superscript: !1,
87
+ subscript: !1,
88
+ fontSize: ie,
89
+ fontColor: re,
90
+ backgroundColor: ne,
80
91
  align: "left",
92
+ listType: !1,
93
+ canOutdent: !1,
94
+ isCodeBlock: !1,
95
+ codeLanguage: i,
81
96
  link: void 0
82
97
  });
83
- return b(() => e.registerUpdateListener(({ editorState: e }) => {
98
+ return C(() => e.registerUpdateListener(({ editorState: e }) => {
84
99
  e.read(() => {
85
- let e = N();
86
- if (F(e)) {
87
- let t = R(e, "font-size", p), r = R(e, "color", f), i = R(e, "background-color", d), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : V(a, (e) => {
100
+ let e = A();
101
+ if (N(e)) {
102
+ let t = I(e, "font-size", ie), r = I(e, "color", re), i = I(e, "background-color", ne), a = e.anchor.getNode(), o = a.getKey() === "root" ? a : R(a, (e) => {
88
103
  let t = e.getParent();
89
- return t !== null && oe(t);
104
+ return t !== null && Ee(t);
90
105
  });
91
106
  o === null && (o = a.getTopLevelElementOrThrow());
92
- let s = {}, c = V(a, he);
93
- c ? (s.link = c.getURL(), s.linkText = c.getTextContent(), s.newBlank = c.getTarget() === "_blank") : s.linkText = e.getTextContent(), n({
107
+ let s = {}, c = R(a, We);
108
+ c ? (s.link = c.getURL(), s.linkText = c.getTextContent(), s.newBlank = c.getTarget() === "_blank") : s.linkText = e.getTextContent();
109
+ let l = R(a, z), u = !1, d = Te(o) ? o.getIndent() : 0;
110
+ if (z(l)) {
111
+ d = l.getIndent();
112
+ let e = l.getParent();
113
+ if (qe(e)) {
114
+ let t = e.getListType();
115
+ u = t === "number" || t === "bullet" ? t : !1;
116
+ }
117
+ }
118
+ let f = R(a, V);
119
+ n({
94
120
  bold: e.hasFormat("bold"),
95
121
  italic: e.hasFormat("italic"),
96
122
  underline: e.hasFormat("underline"),
123
+ strikethrough: e.hasFormat("strikethrough"),
124
+ superscript: e.hasFormat("superscript"),
125
+ subscript: e.hasFormat("subscript"),
97
126
  fontSize: t,
98
127
  fontColor: r,
99
128
  backgroundColor: i,
100
- align: ae(o) ? o.getFormatType() : "left",
129
+ align: Te(o) ? o.getFormatType() : "left",
130
+ listType: u,
131
+ canOutdent: d > 0 || u !== !1,
132
+ isCodeBlock: !!f,
133
+ codeLanguage: y(f?.getLanguage()),
101
134
  link: s
102
135
  });
103
136
  }
@@ -106,14 +139,129 @@ function Ce() {
106
139
  }
107
140
  //#endregion
108
141
  //#region src/components/Editor/ToolbarPlugin/context/TextFormatProvider.tsx
109
- var we = (e) => {
110
- let t = Ce();
111
- return /* @__PURE__ */ g(r.Provider, {
142
+ var ot = (e) => {
143
+ let t = at();
144
+ return /* @__PURE__ */ b(te.Provider, {
112
145
  value: t,
113
146
  children: e.children
114
147
  });
115
- }, Te = (e) => {
116
- let { config: t = [], style: r, theme: i, mode: a, floating: s } = e, { toolbarRef: c } = n(), l = a === "floating", d = x(() => be(i), [i]), f = x(() => ({ iconSize: xe(i?.iconSize) }), [i?.iconSize]), p = l ? Se(s) : void 0, h = l ? m(r, [
148
+ }, st = u.map((e) => ({
149
+ key: e.id,
150
+ label: e.label
151
+ })), ct = () => {
152
+ let [n] = F(), { codeLanguage: i } = f(), { t: a } = t(), { getPopupContainer: s } = o(), { iconSize: u } = c(), d = S((e) => {
153
+ let t = e.key;
154
+ n.update(() => {
155
+ let e = A();
156
+ N(e) && R(e.anchor.getNode(), V)?.setLanguage(t);
157
+ });
158
+ }, [n]), p = l[i].label;
159
+ return /* @__PURE__ */ b(r, {
160
+ menus: st,
161
+ onClick: d,
162
+ activeKey: [i],
163
+ showSearch: !1,
164
+ getPopupContainer: s,
165
+ style: {
166
+ width: 120,
167
+ minWidth: 120
168
+ },
169
+ children: /* @__PURE__ */ b("div", {
170
+ className: G["bsy-lexical__code-language"],
171
+ children: /* @__PURE__ */ b(v, {
172
+ icon: /* @__PURE__ */ x(oe, { children: [/* @__PURE__ */ b("span", {
173
+ className: G["bsy-lexical__code-language-label"],
174
+ children: p
175
+ }), /* @__PURE__ */ b(e, {
176
+ name: "arrow-down",
177
+ size: u,
178
+ className: G["bsy-lexical__code-language-arrow"]
179
+ })] }),
180
+ tooltip: a("editor.codeLanguage")
181
+ })
182
+ })
183
+ });
184
+ }, lt = {
185
+ initial: {
186
+ opacity: 0,
187
+ x: 6
188
+ },
189
+ animate: {
190
+ opacity: 1,
191
+ x: 0
192
+ },
193
+ exit: {
194
+ opacity: 0,
195
+ x: -6
196
+ }
197
+ }, ut = (e) => typeof e == "string" ? e : e.name, dt = (e, t) => {
198
+ if (t) return [
199
+ {
200
+ kind: "button",
201
+ key: "undo",
202
+ name: "undo"
203
+ },
204
+ {
205
+ kind: "button",
206
+ key: "redo",
207
+ name: "redo"
208
+ },
209
+ {
210
+ kind: "divider",
211
+ key: "divider-code"
212
+ },
213
+ {
214
+ kind: "button",
215
+ key: "code-block-toggle",
216
+ name: "code"
217
+ },
218
+ {
219
+ kind: "language",
220
+ key: "code-language"
221
+ }
222
+ ];
223
+ let n = [];
224
+ return e.forEach((t, r) => {
225
+ t.buttons.forEach((e) => {
226
+ let t = ut(e);
227
+ n.push({
228
+ kind: "button",
229
+ key: t,
230
+ name: t,
231
+ props: typeof e == "string" ? void 0 : e.props
232
+ });
233
+ }), r < e.length - 1 && n.push({
234
+ kind: "divider",
235
+ key: `divider-${t.key}`
236
+ });
237
+ }), n;
238
+ }, ft = (e, t) => {
239
+ let n = m(e);
240
+ return n ? /* @__PURE__ */ b(n, { ...t }) : (console.warn(`[ToolbarPlugin] Button "${e}" is not registered.`), null);
241
+ }, pt = ({ config: e }) => {
242
+ let { isCodeBlock: t } = f(), n = ue(), r = dt(e, t), i = {
243
+ duration: n ? 0 : .16,
244
+ ease: "easeOut"
245
+ }, a = n ? {} : lt;
246
+ return /* @__PURE__ */ b(ce, {
247
+ initial: !1,
248
+ mode: "popLayout",
249
+ children: r.map((e) => {
250
+ let t = null;
251
+ return t = e.kind === "divider" ? /* @__PURE__ */ b("div", { className: G["bsy-lexical__toolbar-divider"] }) : e.kind === "language" ? /* @__PURE__ */ b(ct, {}) : ft(e.name, e.props), t === null ? null : /* @__PURE__ */ b(le.div, {
252
+ className: G["bsy-lexical__toolbar-item"],
253
+ layout: "position",
254
+ transition: i,
255
+ ...a,
256
+ children: t
257
+ }, e.key);
258
+ })
259
+ });
260
+ }, mt = (e) => {
261
+ let { config: t = [], style: n, theme: r, mode: i, floating: a } = e, { toolbarRef: c } = o(), l = i === "floating", u = ue(), d = {
262
+ duration: u ? 0 : .16,
263
+ ease: "easeOut"
264
+ }, f = w(() => nt(r), [r]), p = w(() => ({ iconSize: rt(r?.iconSize) }), [r?.iconSize]), m = l ? it(a) : void 0, h = l ? ae(n, [
117
265
  "position",
118
266
  "left",
119
267
  "top",
@@ -123,35 +271,123 @@ var we = (e) => {
123
271
  "transform",
124
272
  "marginTop",
125
273
  "marginBottom"
126
- ]) : r, v = (e, t) => {
127
- let n = typeof e == "string" ? e : e.name, r = o(n);
128
- return r ? typeof e == "string" ? /* @__PURE__ */ g(r, {}, `${n}-${t}`) : /* @__PURE__ */ g(r, { ...e.props }, `${n}-${t}`) : (console.warn(`[ToolbarPlugin] Button "${n}" is not registered.`), null);
129
- };
130
- return /* @__PURE__ */ g(u, {
131
- value: f,
132
- children: /* @__PURE__ */ g(we, { children: /* @__PURE__ */ g("div", {
274
+ ]) : n;
275
+ return /* @__PURE__ */ b(s, {
276
+ value: p,
277
+ children: /* @__PURE__ */ b(g, { children: /* @__PURE__ */ b(ot, { children: /* @__PURE__ */ b(le.div, {
133
278
  ref: c,
134
- className: w(U["bsy-lexical__toolbar"], l && U["bsy-lexical__toolbar--floating"]),
279
+ layout: !u,
280
+ transition: d,
281
+ className: D(G["bsy-lexical__toolbar"], l && G["bsy-lexical__toolbar--floating"]),
135
282
  style: {
136
- ...d,
137
- ...p,
283
+ ...f,
284
+ ...m,
138
285
  ...h
139
286
  },
140
- children: t.map((e, n) => /* @__PURE__ */ _("div", {
141
- className: U["bsy-lexical__toolbar-group"],
142
- "data-group": e.key,
143
- children: [e.buttons.map((e, t) => v(e, t)), n < t.length - 1 && /* @__PURE__ */ g("div", { className: U["bsy-lexical__toolbar-divider"] })]
144
- }, e.key + n))
145
- }) })
287
+ children: /* @__PURE__ */ b(pt, { config: t })
288
+ }) }) })
146
289
  });
147
- }, W = {
148
- "bsy-lexical-editor": "_bsy-lexical-editor_jbc8k_1",
149
- "bsy-lexical-editor--floating": "_bsy-lexical-editor--floating_jbc8k_7",
150
- "bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_jbc8k_10",
151
- "bsy-lexical-editor__content-editable--with-length-badge": "_bsy-lexical-editor__content-editable--with-length-badge_jbc8k_17",
152
- "bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-badge_jbc8k_20",
153
- "bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--exceeded_jbc8k_36"
154
- }, G = {
290
+ }, K = {
291
+ "bsy-lexical-editor": "_bsy-lexical-editor_1bhfo_1",
292
+ "bsy-lexical-editor--floating": "_bsy-lexical-editor--floating_1bhfo_7",
293
+ "bsy-lexical-editor__content-editable": "_bsy-lexical-editor__content-editable_1bhfo_10",
294
+ "bsy-lexical-editor__content-editable--with-length-badge": "_bsy-lexical-editor__content-editable--with-length-badge_1bhfo_17",
295
+ "bsy-lexical-editor__length-badge": "_bsy-lexical-editor__length-badge_1bhfo_20",
296
+ "bsy-lexical-editor__length-badge--exceeded": "_bsy-lexical-editor__length-badge--exceeded_1bhfo_36"
297
+ }, q = class e extends P {
298
+ constructor(e, t) {
299
+ super(e, t);
300
+ }
301
+ static getType() {
302
+ return "extended-text";
303
+ }
304
+ static clone(t) {
305
+ return new e(t.__text, t.__key);
306
+ }
307
+ static importDOM() {
308
+ let e = P.importDOM();
309
+ return {
310
+ ...e,
311
+ code: () => ({
312
+ conversion: J(e?.code),
313
+ priority: 1
314
+ }),
315
+ em: () => ({
316
+ conversion: J(e?.em),
317
+ priority: 1
318
+ }),
319
+ span: () => ({
320
+ conversion: J(e?.span),
321
+ priority: 1
322
+ }),
323
+ strong: () => ({
324
+ conversion: J(e?.strong),
325
+ priority: 1
326
+ }),
327
+ sub: () => ({
328
+ conversion: J(e?.sub),
329
+ priority: 1
330
+ }),
331
+ sup: () => ({
332
+ conversion: J(e?.sup),
333
+ priority: 1
334
+ })
335
+ };
336
+ }
337
+ static importJSON(e) {
338
+ return ht().updateFromJSON(e);
339
+ }
340
+ isSimpleText() {
341
+ return this.__type === "extended-text" && this.__mode === 0;
342
+ }
343
+ };
344
+ function ht(e = "") {
345
+ return ye(new q(e));
346
+ }
347
+ function J(e) {
348
+ return (t) => {
349
+ let n = e?.(t);
350
+ if (!n) return null;
351
+ let r = n.conversion(t);
352
+ if (!r) return r;
353
+ 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;
354
+ return {
355
+ ...r,
356
+ forChild: (e, t) => {
357
+ let n = (r?.forChild ?? ((e) => e))(e, t);
358
+ if (Oe(n)) {
359
+ let e = [
360
+ i ? `background-color: ${i}` : null,
361
+ a ? `color: ${a}` : null,
362
+ o ? `font-family: ${o}` : null,
363
+ s ? `font-weight: ${s}` : null,
364
+ c ? `font-size: ${c}` : null,
365
+ l ? `text-decoration: ${l}` : null
366
+ ].filter((e) => e !== null).join("; ");
367
+ if (e.length) return n.setStyle(e);
368
+ }
369
+ return n;
370
+ }
371
+ };
372
+ };
373
+ }
374
+ //#endregion
375
+ //#region src/components/Editor/plugins/LinkColorPlugin.tsx
376
+ function gt(e) {
377
+ return e.split(";").map((e) => e.trim()).filter((e) => e && e.split(":")[0].trim().toLowerCase() !== "color").join("; ");
378
+ }
379
+ function _t(e) {
380
+ if (!R(e, We)) return;
381
+ let t = e.getStyle();
382
+ if (!t) return;
383
+ let n = gt(t);
384
+ n !== t && e.setStyle(n);
385
+ }
386
+ function vt() {
387
+ let [e] = F();
388
+ return C(() => e.registerNodeTransform(q, _t), [e]), null;
389
+ }
390
+ var Y = {
155
391
  imageWrapper: "_imageWrapper_y06h3_1",
156
392
  selected: "_selected_y06h3_8",
157
393
  resizing: "_resizing_y06h3_12",
@@ -161,16 +397,16 @@ var we = (e) => {
161
397
  topRight: "_topRight_y06h3_49",
162
398
  bottomLeft: "_bottomLeft_y06h3_54",
163
399
  bottomRight: "_bottomRight_y06h3_59"
164
- }, Ee = ({ src: e, altText: t, width: n, height: r, nodeKey: i }) => {
165
- let [a] = L(), [o, s] = C(!1), [c, l] = C(null), u = S(null), [d, f] = C({
400
+ }, yt = ({ src: e, altText: t, width: n, height: r, nodeKey: i }) => {
401
+ let [a] = F(), [o, s] = E(!1), [c, l] = E(null), u = T(null), [d, f] = E({
166
402
  width: n || void 0,
167
403
  height: r || void 0
168
- }), p = y(() => {
404
+ }), p = S(() => {
169
405
  n && r && f({
170
406
  width: n,
171
407
  height: r
172
408
  });
173
- }, [n, r]), m = y((e, t) => {
409
+ }, [n, r]), m = S((e, t) => {
174
410
  if (e.preventDefault(), e.stopPropagation(), !u.current) return;
175
411
  let n = d.width || u.current.offsetWidth, r = d.height || u.current.offsetHeight, i = n / r;
176
412
  (!d.width || !d.height) && f({
@@ -185,7 +421,7 @@ var we = (e) => {
185
421
  aspectRatio: i,
186
422
  direction: t
187
423
  });
188
- }, [d]), x = y((e) => {
424
+ }, [d]), h = S((e) => {
189
425
  if (!c?.isResizing) return;
190
426
  let t = e.clientX - c.startX, n;
191
427
  switch (c.direction) {
@@ -208,10 +444,10 @@ var we = (e) => {
208
444
  width: n,
209
445
  height: r
210
446
  });
211
- }, [c]), T = y(() => {
447
+ }, [c]), g = S(() => {
212
448
  c?.isResizing && (a.update(() => {
213
- let e = A(i);
214
- De(e) && e.setWidthAndHeight(d.width, d.height);
449
+ let e = O(i);
450
+ bt(e) && e.setWidthAndHeight(d.width, d.height);
215
451
  }), l(null));
216
452
  }, [
217
453
  a,
@@ -219,71 +455,71 @@ var we = (e) => {
219
455
  d,
220
456
  c
221
457
  ]);
222
- v.useEffect(() => {
223
- if (c?.isResizing) return document.addEventListener("mousemove", x), document.addEventListener("mouseup", T), () => {
224
- document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", T);
458
+ se.useEffect(() => {
459
+ if (c?.isResizing) return document.addEventListener("mousemove", h), document.addEventListener("mouseup", g), () => {
460
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", g);
225
461
  };
226
462
  }, [
227
463
  c,
228
- x,
229
- T
464
+ h,
465
+ g
230
466
  ]);
231
- let E = y(() => {
467
+ let _ = S(() => {
232
468
  s(!0);
233
469
  }, []);
234
- return b(() => a.registerUpdateListener(({ editorState: e }) => {
470
+ return C(() => a.registerUpdateListener(({ editorState: e }) => {
235
471
  e.read(() => {
236
- let e = N();
237
- F(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
472
+ let e = A();
473
+ N(e) && !e.getNodes().some((e) => e.getKey() === i || e.getParent() && e.getParent()?.getKey() === i) && o && s(!1);
238
474
  });
239
475
  }), [
240
476
  a,
241
477
  i,
242
478
  o
243
- ]), b(() => {
479
+ ]), C(() => {
244
480
  let e = (e) => {
245
481
  o && u.current && !u.current.contains(e.target) && s(!1);
246
482
  };
247
483
  if (o) return document.addEventListener("mousedown", e), () => {
248
484
  document.removeEventListener("mousedown", e);
249
485
  };
250
- }, [o]), /* @__PURE__ */ _("div", {
251
- className: w(G.imageWrapper, {
252
- [G.selected]: o,
253
- [G.resizing]: c?.isResizing
486
+ }, [o]), /* @__PURE__ */ x("div", {
487
+ className: D(Y.imageWrapper, {
488
+ [Y.selected]: o,
489
+ [Y.resizing]: c?.isResizing
254
490
  }),
255
- children: [/* @__PURE__ */ g("img", {
491
+ children: [/* @__PURE__ */ b("img", {
256
492
  ref: u,
257
493
  src: e,
258
494
  alt: t,
259
- className: G.image,
495
+ className: Y.image,
260
496
  style: {
261
497
  width: d.width,
262
498
  height: d.height
263
499
  },
264
500
  onLoad: p,
265
- onClick: E,
501
+ onClick: _,
266
502
  draggable: !1
267
- }), o && /* @__PURE__ */ _(h, { children: [
268
- /* @__PURE__ */ g("div", {
269
- className: w(G.resizeHandle, G.bottomRight),
503
+ }), o && /* @__PURE__ */ x(oe, { children: [
504
+ /* @__PURE__ */ b("div", {
505
+ className: D(Y.resizeHandle, Y.bottomRight),
270
506
  onMouseDown: (e) => m(e, "bottom-right")
271
507
  }),
272
- /* @__PURE__ */ g("div", {
273
- className: w(G.resizeHandle, G.bottomLeft),
508
+ /* @__PURE__ */ b("div", {
509
+ className: D(Y.resizeHandle, Y.bottomLeft),
274
510
  onMouseDown: (e) => m(e, "bottom-left")
275
511
  }),
276
- /* @__PURE__ */ g("div", {
277
- className: w(G.resizeHandle, G.topRight),
512
+ /* @__PURE__ */ b("div", {
513
+ className: D(Y.resizeHandle, Y.topRight),
278
514
  onMouseDown: (e) => m(e, "top-right")
279
515
  }),
280
- /* @__PURE__ */ g("div", {
281
- className: w(G.resizeHandle, G.topLeft),
516
+ /* @__PURE__ */ b("div", {
517
+ className: D(Y.resizeHandle, Y.topLeft),
282
518
  onMouseDown: (e) => m(e, "top-left")
283
519
  })
284
520
  ] })]
285
521
  });
286
- }, K = class e extends ue {
522
+ }, X = class e extends Pe {
287
523
  static getType() {
288
524
  return "image";
289
525
  }
@@ -329,7 +565,7 @@ var we = (e) => {
329
565
  n.__width = e, n.__height = t;
330
566
  }
331
567
  decorate() {
332
- return /* @__PURE__ */ g(Ee, {
568
+ return /* @__PURE__ */ b(yt, {
333
569
  src: this.__src,
334
570
  altText: this.__altText,
335
571
  width: this.__width,
@@ -339,13 +575,13 @@ var we = (e) => {
339
575
  }
340
576
  static importDOM() {
341
577
  return { img: () => ({
342
- conversion: Oe,
578
+ conversion: xt,
343
579
  priority: 0
344
580
  }) };
345
581
  }
346
582
  static importJSON(e) {
347
583
  let { src: t, altText: n, width: r, height: i } = e;
348
- return q({
584
+ return Z({
349
585
  src: t,
350
586
  altText: n,
351
587
  width: r,
@@ -366,13 +602,13 @@ var we = (e) => {
366
602
  return !0;
367
603
  }
368
604
  };
369
- function q({ src: e, altText: t, width: n, height: r, key: i }) {
370
- return new K(e, t, n, r, i);
605
+ function Z({ src: e, altText: t, width: n, height: r, key: i }) {
606
+ return new X(e, t, n, r, i);
371
607
  }
372
- function De(e) {
373
- return e instanceof K;
608
+ function bt(e) {
609
+ return e instanceof X;
374
610
  }
375
- function Oe(e) {
611
+ function xt(e) {
376
612
  if (e instanceof HTMLImageElement) {
377
613
  let { src: t, alt: n, style: r } = e, i, a;
378
614
  if (r.width) {
@@ -383,7 +619,7 @@ function Oe(e) {
383
619
  let e = parseInt(r.height, 10);
384
620
  isNaN(e) || (a = e);
385
621
  }
386
- return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: q({
622
+ return i === void 0 && e.width && (i = e.width), a === void 0 && e.height && (a = e.height), { node: Z({
387
623
  src: t,
388
624
  altText: n,
389
625
  width: i,
@@ -394,23 +630,62 @@ function Oe(e) {
394
630
  }
395
631
  //#endregion
396
632
  //#region src/components/Editor/plugins/ImagePlugin.tsx
397
- function ke() {
398
- let [e] = L();
399
- return b(() => e.registerCommand(s, (e) => (P([q(e)]), !0), ce), [e]), null;
633
+ function St() {
634
+ let [e] = F();
635
+ return C(() => e.registerCommand(h, (e) => (j([Z(e)]), !0), Ae), [e]), null;
636
+ }
637
+ //#endregion
638
+ //#region src/components/Editor/utils/stripImagesFromHtml.ts
639
+ function Ct(e) {
640
+ let t = new DOMParser().parseFromString(e, "text/html");
641
+ return t.querySelectorAll("img, picture").forEach((e) => e.remove()), t.body.innerHTML;
642
+ }
643
+ //#endregion
644
+ //#region src/components/Editor/plugins/PasteStripImagePlugin.tsx
645
+ var wt = /<img\b|<picture\b/i;
646
+ function Tt() {
647
+ let [e] = F();
648
+ return C(() => {
649
+ let t = (t) => {
650
+ let n = "clipboardData" in t ? t.clipboardData : "dataTransfer" in t ? t.dataTransfer : null;
651
+ if (!n || n.getData("application/x-lexical-editor") || n.getData("application/x-lexical-drag")) return !1;
652
+ let r = n.getData("text/html");
653
+ if (!(Array.from(n.files).some((e) => e.type.startsWith("image/")) || Array.from(n.items).some((e) => e.type.startsWith("image/")) || wt.test(r))) return !1;
654
+ t.preventDefault();
655
+ let i = n.getData("text/plain");
656
+ return !wt.test(r) && !i || e.update(() => {
657
+ let t = A();
658
+ if (t === null) return;
659
+ let n = r ? Ct(r) : "", a = document.createElement("div");
660
+ if (a.innerHTML = n, n && a.textContent?.trim()) {
661
+ let t = ve(e, new DOMParser().parseFromString(n, "text/html"));
662
+ if (t.length) {
663
+ j(t);
664
+ return;
665
+ }
666
+ }
667
+ i && t.insertRawText(i);
668
+ }, { tag: Le }), !0;
669
+ };
670
+ return Ue(e.registerCommand(Ie, (e) => t(e), je), e.registerCommand(Ne, (e) => t(e), je));
671
+ }, [e]), null;
400
672
  }
401
673
  //#endregion
402
674
  //#region src/components/Editor/plugins/EnterKeyPlugin.tsx
403
- function Ae() {
404
- let [e] = L(), t = S(0);
405
- return b(() => e.registerCommand(de, (n) => {
675
+ function Et() {
676
+ let [e] = F(), t = T(0);
677
+ return C(() => e.registerCommand(Fe, (n) => {
406
678
  let r = Date.now(), i = r - t.current;
407
- return t.current = r, i < 250 && i > 0 ? (e.update(() => {
408
- let e = N();
409
- if (F(e)) {
679
+ return t.current = r, i < 250 && i > 0 ? e.getEditorState().read(() => {
680
+ let e = A();
681
+ return N(e) ? !!R(e.anchor.getNode(), (e) => z(e) || V(e)) : !1;
682
+ }, { editor: e }) ? !1 : (e.update(() => {
683
+ let e = A();
684
+ if (N(e)) {
410
685
  let t = e.anchor.getNode().getTopLevelElement();
411
686
  if (t && t.getTextContent().trim() === "") {
412
- let n = k();
413
- z(e, {
687
+ let n = xe();
688
+ Ve(e, {
414
689
  "background-color": "",
415
690
  color: "",
416
691
  "font-size": "",
@@ -423,38 +698,195 @@ function Ae() {
423
698
  }
424
699
  }
425
700
  }), n?.preventDefault(), !0) : !1;
426
- }, le), [e]), null;
701
+ }, Me), [e]), null;
702
+ }
703
+ //#endregion
704
+ //#region src/components/Editor/utils/codeHighlighter.ts
705
+ var Dt = {
706
+ css: () => import("@shikijs/langs/css"),
707
+ html: () => import("@shikijs/langs/html"),
708
+ xml: () => import("@shikijs/langs/xml"),
709
+ javascript: () => import("@shikijs/langs/javascript"),
710
+ typescript: () => import("@shikijs/langs/typescript"),
711
+ jsx: () => import("@shikijs/langs/jsx"),
712
+ go: () => import("@shikijs/langs/go"),
713
+ php: () => import("@shikijs/langs/php"),
714
+ c: () => import("@shikijs/langs/c"),
715
+ python: () => import("@shikijs/langs/python"),
716
+ java: () => import("@shikijs/langs/java"),
717
+ cpp: () => import("@shikijs/langs/cpp"),
718
+ csharp: () => import("@shikijs/langs/csharp"),
719
+ vb: () => import("@shikijs/langs/vb"),
720
+ sql: () => import("@shikijs/langs/sql"),
721
+ ruby: () => import("@shikijs/langs/ruby"),
722
+ swift: () => import("@shikijs/langs/swift"),
723
+ bash: () => import("@shikijs/langs/shellscript"),
724
+ lua: () => import("@shikijs/langs/lua"),
725
+ markdown: () => import("@shikijs/langs/markdown")
726
+ }, Q = (e) => e === "bash" ? "shellscript" : e, Ot = (e) => e in Dt, $ = null, kt = null, At = /* @__PURE__ */ new Map(), jt = () => ($ ||= Promise.all([import("@shikijs/core"), import("@shikijs/engine-javascript")]).then(([{ createHighlighterCoreSync: e }, { createJavaScriptRegexEngine: t }]) => e({
727
+ engine: t(),
728
+ langs: [],
729
+ themes: []
730
+ })).catch((e) => {
731
+ throw $ = null, e;
732
+ }), $), Mt = (e, t) => Ot(t) && e.getLoadedLanguages().includes(Q(t)), Nt = (e) => {
733
+ let t = At.get(e);
734
+ return t || (t = jt().then(async (t) => {
735
+ let n = Q(e);
736
+ if (!t.getLoadedLanguages().includes(n)) {
737
+ let n = await Dt[e]();
738
+ await t.loadLanguage(n.default);
739
+ }
740
+ return t;
741
+ }).catch((t) => {
742
+ throw At.delete(e), t;
743
+ }), At.set(e, t)), t;
744
+ }, Pt = () => (kt ||= jt().then(async (e) => {
745
+ if (!e.getLoadedThemes().includes("github-light")) {
746
+ let t = await import("@shikijs/themes/github-light");
747
+ await e.loadTheme(t.default);
748
+ }
749
+ return e;
750
+ }).catch((e) => {
751
+ throw kt = null, e;
752
+ }), kt), Ft = (e, t, n) => {
753
+ let r = e.getTextContent();
754
+ if (e.getStyle() && e.setStyle(""), !n || !Mt(n, t)) return Ze(r);
755
+ let i = Q(t), a = n.codeToTokens(r, {
756
+ lang: i,
757
+ theme: p
758
+ }), o = [];
759
+ return a.tokens.forEach((e, t) => {
760
+ t && o.push(be()), e.forEach((e) => {
761
+ e.content.split(" ").forEach((t, n) => {
762
+ if (n && o.push(Se()), t === "") return;
763
+ let r = Xe(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}` : "";
764
+ i && r.setStyle(i), o.push(r);
765
+ });
766
+ });
767
+ }), o;
768
+ }, It = (e, t) => {
769
+ let n = O(e);
770
+ if (!V(n) || !n.isAttached()) return;
771
+ let r = A();
772
+ if (!N(r)) {
773
+ t();
774
+ return;
775
+ }
776
+ let { anchor: i } = r, a = i.offset, o = i.type === "element" && M(n.getChildAtIndex(i.offset - 1)), s = 0;
777
+ if (o || (s = a + i.getNode().getPreviousSiblings().reduce((e, t) => e + t.getTextContentSize(), 0)), t()) {
778
+ if (o) {
779
+ i.getNode().select(a, a);
780
+ return;
781
+ }
782
+ n.getChildren().some((e) => {
783
+ let t = Oe(e);
784
+ if (t || M(e)) {
785
+ let n = e.getTextContentSize();
786
+ if (t && n >= s) return e.select(s, s), !0;
787
+ s -= n;
788
+ }
789
+ return !1;
790
+ });
791
+ }
792
+ }, Lt = (e, t) => B(e) && B(t) && e.__text === t.__text && e.__highlightType === t.__highlightType && e.__style === t.__style || De(e) && De(t) || M(e) && M(t), Rt = (e, t) => {
793
+ let n = 0;
794
+ for (; n < e.length && Lt(e[n], t[n]);) n++;
795
+ let r = e.length, i = t.length, a = Math.min(r, i) - n, o = 0;
796
+ for (; o < a;) if (o++, !Lt(e[r - o], t[i - o])) {
797
+ o--;
798
+ break;
799
+ }
800
+ return {
801
+ from: n,
802
+ to: r - o,
803
+ nodesForReplacement: t.slice(n, i - o)
804
+ };
805
+ }, zt = (e, t, n, r, i) => {
806
+ let a = i.getKey(), o = y(i.getLanguage());
807
+ if (i.getLanguage() !== o && i.setLanguage(o), o === "plaintext") i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1);
808
+ else {
809
+ i.getTheme() !== "github-light" && i.setTheme(p);
810
+ let s = t ? t.getLoadedThemes().includes("github-light") ? Ot(o) && !Mt(t, o) ? Nt(o) : null : Pt() : jt();
811
+ if (s) {
812
+ i.getIsSyntaxHighlightSupported() && i.setIsSyntaxHighlightSupported(!1), n.pendingKeys.add(a), n.loading !== s && (n.loading = s, s.then((t) => {
813
+ r(t);
814
+ let i = [...n.pendingKeys];
815
+ n.pendingKeys.clear(), n.loading = null, e.update(() => {
816
+ i.forEach((e) => {
817
+ O(e)?.markDirty();
818
+ });
819
+ });
820
+ }, () => {
821
+ n.pendingKeys.clear(), n.loading = null;
822
+ }));
823
+ return;
824
+ }
825
+ i.getIsSyntaxHighlightSupported() || i.setIsSyntaxHighlightSupported(!0);
826
+ }
827
+ n.nodesCurrentlyHighlighting.has(a) || (n.nodesCurrentlyHighlighting.add(a), n.didTransform || (n.didTransform = !0, ke(() => {
828
+ n.didTransform = !1, n.nodesCurrentlyHighlighting.clear();
829
+ })), It(a, () => {
830
+ let e = O(a);
831
+ if (!V(e) || !e.isAttached()) return !1;
832
+ let n = Ft(e, y(e.getLanguage()), t), { from: r, to: i, nodesForReplacement: o } = Rt(e.getChildren(), n);
833
+ return r !== i || o.length ? (e.splice(r, i - r, o), !0) : !1;
834
+ }));
835
+ }, Bt = (e, t, n, r, i) => {
836
+ let a = i.getParent();
837
+ V(a) ? zt(e, t, n, r, a) : B(i) && i.replace(Ce(i.__text));
838
+ };
839
+ function Vt() {
840
+ let [e] = F();
841
+ return C(() => {
842
+ if (!e.hasNodes([U, H])) throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");
843
+ let t = null, n = {
844
+ didTransform: !1,
845
+ nodesCurrentlyHighlighting: /* @__PURE__ */ new Set(),
846
+ pendingKeys: /* @__PURE__ */ new Set(),
847
+ loading: null
848
+ }, r = (e) => {
849
+ t = e;
850
+ };
851
+ return ze(Qe(e), e.registerNodeTransform(U, (i) => {
852
+ zt(e, t, n, r, i);
853
+ }), e.registerNodeTransform(P, (i) => {
854
+ Bt(e, t, n, r, i);
855
+ }), e.registerNodeTransform(H, (i) => {
856
+ Bt(e, t, n, r, i);
857
+ }));
858
+ }, [e]), null;
427
859
  }
428
860
  //#endregion
429
861
  //#region src/components/Editor/plugins/MaxLengthPlugin.tsx
430
- function je({ maxLength: e, onMaxLengthExceed: t }) {
431
- let [n] = L(), r = S(t);
432
- return r.current = t, b(() => {
862
+ function Ht({ maxLength: e, onMaxLengthExceed: t }) {
863
+ let [n] = F(), r = T(t);
864
+ return r.current = t, C(() => {
433
865
  let t = null;
434
- return n.registerNodeTransform(fe, (i) => {
866
+ return n.registerNodeTransform(Re, (i) => {
435
867
  let a = i.getTextContentSize();
436
868
  if (a <= e) return;
437
- let o = n.getEditorState(), s = o.read(() => i.getTextContentSize()), c = a - e, l = N();
869
+ let o = n.getEditorState(), s = o.read(() => i.getTextContentSize()), c = a - e, l = A();
438
870
  if (s === e && t !== o) {
439
- t = o, me(n, o), r.current?.();
871
+ t = o, He(n, o), r.current?.();
440
872
  return;
441
873
  }
442
- if (F(l) && l.isCollapsed()) {
443
- B(n, l.anchor, c), r.current?.();
874
+ if (N(l) && l.isCollapsed()) {
875
+ L(n, l.anchor, c), r.current?.();
444
876
  return;
445
877
  }
446
878
  i.selectEnd();
447
- let u = N();
448
- F(u) && (B(n, u.anchor, c), r.current?.());
879
+ let u = A();
880
+ N(u) && (L(n, u.anchor, c), r.current?.());
449
881
  });
450
882
  }, [n, e]), null;
451
883
  }
452
884
  //#endregion
453
885
  //#region src/components/Editor/LengthBadge.tsx
454
- var J = ({ current: e, maxLength: t }) => {
886
+ var Ut = ({ current: e, maxLength: t }) => {
455
887
  let n = e > t;
456
- return /* @__PURE__ */ _("div", {
457
- className: w(W["bsy-lexical-editor__length-badge"], n && W["bsy-lexical-editor__length-badge--exceeded"]),
888
+ return /* @__PURE__ */ x("div", {
889
+ className: D(K["bsy-lexical-editor__length-badge"], n && K["bsy-lexical-editor__length-badge--exceeded"]),
458
890
  "aria-live": "polite",
459
891
  children: [
460
892
  e,
@@ -463,22 +895,22 @@ var J = ({ current: e, maxLength: t }) => {
463
895
  ]
464
896
  });
465
897
  };
466
- J.displayName = "BsyLexicalEditorLengthBadge";
898
+ Ut.displayName = "BsyLexicalEditorLengthBadge";
467
899
  //#endregion
468
900
  //#region src/components/Editor/utils/textLength.ts
469
- function Y(e) {
901
+ function Wt(e) {
470
902
  return typeof e == "number" && Number.isFinite(e) && e > 0;
471
903
  }
472
- function Me(e, t) {
473
- let n = M(), r = n.getTextContentSize();
904
+ function Gt(e, t) {
905
+ let n = k(), r = n.getTextContentSize();
474
906
  if (r <= t) return !1;
475
907
  let i = r - t;
476
908
  n.selectEnd();
477
- let a = N();
478
- return F(a) ? B(e, a.anchor, i) : Ne(i), !0;
909
+ let a = A();
910
+ return N(a) ? L(e, a.anchor, i) : Kt(i), !0;
479
911
  }
480
- function Ne(e) {
481
- let t = e, n = M().getAllTextNodes();
912
+ function Kt(e) {
913
+ let t = e, n = k().getAllTextNodes();
482
914
  for (let e = n.length - 1; e >= 0 && t > 0; e--) {
483
915
  let r = n[e], i = r.getTextContent();
484
916
  i.length !== 0 && (i.length <= t ? (t -= i.length, r.remove()) : (r.setTextContent(i.slice(0, i.length - t)), t = 0));
@@ -486,17 +918,17 @@ function Ne(e) {
486
918
  }
487
919
  //#endregion
488
920
  //#region src/components/Editor/EditorCore.tsx
489
- var X = (e) => {
490
- let { height: t = 126, onChange: n, toolbar: r, theme: i, maxLength: a, onMaxLengthExceed: o } = e, [s] = L(), c = S(null), u = S(null), d = S(null), f = S(o);
491
- f.current = o;
492
- let p = Y(a) ? a : void 0, [m, h] = C(0), v = r?.mode === "floating", T = x(() => ({
921
+ var qt = (e) => {
922
+ let { height: t = 126, onChange: n, toolbar: r, theme: i, maxLength: a, onMaxLengthExceed: o } = e, [s] = F(), c = T(null), l = T(null), u = T(null), d = T(o);
923
+ d.current = o;
924
+ let f = Wt(a) ? a : void 0, [p, m] = E(0), h = r?.mode === "floating", g = w(() => ({
493
925
  containerRef: c,
494
- toolbarRef: u,
495
- getPopupContainer: () => v && u.current ? u.current : c.current || document.body
496
- }), [v]), O = y((e) => {
926
+ toolbarRef: l,
927
+ getPopupContainer: () => h && l.current ? l.current : c.current || document.body
928
+ }), [h]), _ = S((e) => {
497
929
  e.read(() => {
498
- let t = M().getTextContent(), r = re(s, null), i = !t.trim() && (r === "<p><br></p>" || r === "<p></p>" || r === "" || /^<p>\s*<br>\s*<\/p>$/.test(r)) ? null : r;
499
- d.current = i, p !== void 0 && h(t.length), n({
930
+ let t = k().getTextContent(), r = _e(s, null), i = !t.trim() && (r === "<p><br></p>" || r === "<p></p>" || r === "" || /^<p>\s*<br>\s*<\/p>$/.test(r)) ? null : r;
931
+ u.current = i, f !== void 0 && m(t.length), n({
500
932
  text: t,
501
933
  html: i
502
934
  }, e);
@@ -504,155 +936,80 @@ var X = (e) => {
504
936
  }, [
505
937
  n,
506
938
  s,
507
- p
939
+ f
508
940
  ]);
509
- b(() => {
510
- p !== void 0 && s.getEditorState().read(() => {
511
- h(M().getTextContentSize());
941
+ C(() => {
942
+ f !== void 0 && s.getEditorState().read(() => {
943
+ m(k().getTextContentSize());
512
944
  }, { editor: s });
513
- }, [s, p]), b(() => {
514
- if (e.value !== void 0 && e.value !== d.current) {
945
+ }, [s, f]), C(() => {
946
+ if (e.value !== void 0 && e.value !== u.current) {
515
947
  let t = !1;
516
948
  s.update(() => {
517
- M().clear(), e.value && e.value.trim() && (P(ie(s, new DOMParser().parseFromString(e.value, "text/html"))), p !== void 0 && (t = Me(s, p)));
518
- }), t && f.current?.();
949
+ k().clear(), e.value && e.value.trim() && (j(ve(s, new DOMParser().parseFromString(e.value, "text/html"))), f !== void 0 && (t = Gt(s, f)));
950
+ }), t && d.current?.();
519
951
  }
520
952
  }, [
521
953
  e.value,
522
954
  s,
523
- p
955
+ f
524
956
  ]);
525
- let k = r?.config?.length ? r?.config : [], A = ve();
526
- return /* @__PURE__ */ g(l.Provider, {
527
- value: T,
528
- children: /* @__PURE__ */ _("div", {
957
+ let v = r?.config?.length ? r?.config : [], y = $e();
958
+ return /* @__PURE__ */ b(ee.Provider, {
959
+ value: g,
960
+ children: /* @__PURE__ */ x("div", {
529
961
  ref: c,
530
- className: w(W["bsy-lexical-editor"], v && W["bsy-lexical-editor--floating"]),
962
+ className: D(K["bsy-lexical-editor"], h && K["bsy-lexical-editor--floating"]),
531
963
  onClick: (e) => {
532
964
  let t = s.getRootElement(), n = e.target;
533
965
  !t || !n || !t.contains(n) || s.isEditable() || s.setEditable(!0);
534
966
  },
535
967
  children: [
536
- k.length > 0 && /* @__PURE__ */ g(Te, {
537
- config: k,
968
+ v.length > 0 && /* @__PURE__ */ b(mt, {
969
+ config: v,
538
970
  theme: i?.toolbar,
539
971
  style: r?.style,
540
972
  mode: r?.mode,
541
973
  floating: r?.floating
542
974
  }),
543
- /* @__PURE__ */ g(E, {
544
- contentEditable: /* @__PURE__ */ g(ee, {
545
- className: w(W["bsy-lexical-editor__content-editable"], p !== void 0 && W["bsy-lexical-editor__content-editable--with-length-badge"]),
975
+ /* @__PURE__ */ b(fe, {
976
+ contentEditable: /* @__PURE__ */ b(pe, {
977
+ className: D(K["bsy-lexical-editor__content-editable"], f !== void 0 && K["bsy-lexical-editor__content-editable--with-length-badge"]),
546
978
  style: {
547
979
  height: t,
548
- cursor: A ? "auto" : "text"
980
+ cursor: y ? "auto" : "text"
549
981
  }
550
982
  }),
551
- ErrorBoundary: D
983
+ ErrorBoundary: ge
552
984
  }),
553
- /* @__PURE__ */ g(ye, {}),
554
- /* @__PURE__ */ g(ke, {}),
555
- /* @__PURE__ */ g(Ae, {}),
556
- p !== void 0 && /* @__PURE__ */ g(je, {
557
- maxLength: p,
985
+ /* @__PURE__ */ b(et, {}),
986
+ /* @__PURE__ */ b(tt, {}),
987
+ /* @__PURE__ */ b(vt, {}),
988
+ /* @__PURE__ */ b(St, {}),
989
+ /* @__PURE__ */ b(Tt, {}),
990
+ /* @__PURE__ */ b(Et, {}),
991
+ /* @__PURE__ */ b(Vt, {}),
992
+ f !== void 0 && /* @__PURE__ */ b(Ht, {
993
+ maxLength: f,
558
994
  onMaxLengthExceed: o
559
995
  }),
560
- /* @__PURE__ */ g(te, {}),
561
- /* @__PURE__ */ g(ne, { onChange: O }),
562
- p !== void 0 && /* @__PURE__ */ g(J, {
563
- current: m,
564
- maxLength: p
996
+ /* @__PURE__ */ b(me, {}),
997
+ /* @__PURE__ */ b(he, { onChange: _ }),
998
+ f !== void 0 && /* @__PURE__ */ b(Ut, {
999
+ current: p,
1000
+ maxLength: f
565
1001
  })
566
1002
  ]
567
1003
  })
568
1004
  });
569
1005
  };
570
- X.displayName = "BsyLexicalEditorCore";
571
- //#endregion
572
- //#region src/components/Editor/nodes/ExtendedTextNode.tsx
573
- var Z = class e extends I {
574
- constructor(e, t) {
575
- super(e, t);
576
- }
577
- static getType() {
578
- return "extended-text";
579
- }
580
- static clone(t) {
581
- return new e(t.__text, t.__key);
582
- }
583
- static importDOM() {
584
- let e = I.importDOM();
585
- return {
586
- ...e,
587
- code: () => ({
588
- conversion: Q(e?.code),
589
- priority: 1
590
- }),
591
- em: () => ({
592
- conversion: Q(e?.em),
593
- priority: 1
594
- }),
595
- span: () => ({
596
- conversion: Q(e?.span),
597
- priority: 1
598
- }),
599
- strong: () => ({
600
- conversion: Q(e?.strong),
601
- priority: 1
602
- }),
603
- sub: () => ({
604
- conversion: Q(e?.sub),
605
- priority: 1
606
- }),
607
- sup: () => ({
608
- conversion: Q(e?.sup),
609
- priority: 1
610
- })
611
- };
612
- }
613
- static importJSON(e) {
614
- return Pe().updateFromJSON(e);
615
- }
616
- isSimpleText() {
617
- return this.__type === "extended-text" && this.__mode === 0;
618
- }
619
- };
620
- function Pe(e = "") {
621
- return O(new Z(e));
622
- }
623
- function Q(e) {
624
- return (t) => {
625
- let n = e?.(t);
626
- if (!n) return null;
627
- let r = n.conversion(t);
628
- if (!r) return r;
629
- 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;
630
- return {
631
- ...r,
632
- forChild: (e, t) => {
633
- let n = (r?.forChild ?? ((e) => e))(e, t);
634
- if (se(n)) {
635
- let e = [
636
- i ? `background-color: ${i}` : null,
637
- a ? `color: ${a}` : null,
638
- o ? `font-family: ${o}` : null,
639
- s ? `font-weight: ${s}` : null,
640
- c ? `font-size: ${c}` : null,
641
- l ? `text-decoration: ${l}` : null
642
- ].filter((e) => e !== null).join("; ");
643
- if (e.length) return n.setStyle(e);
644
- }
645
- return n;
646
- }
647
- };
648
- };
649
- }
1006
+ qt.displayName = "BsyLexicalEditorCore";
650
1007
  //#endregion
651
1008
  //#region src/components/Editor/Editor.tsx
652
- var $ = (e) => {
1009
+ var Jt = (e) => {
653
1010
  let { autoFocus: t = !1 } = e;
654
- return /* @__PURE__ */ g(T, {
655
- initialConfig: x(() => ({
1011
+ return /* @__PURE__ */ b(de, {
1012
+ initialConfig: w(() => ({
656
1013
  namespace: "bsyLexicalEditor",
657
1014
  onError: (e) => {
658
1015
  console.error("Lexical error", e);
@@ -662,25 +1019,37 @@ var $ = (e) => {
662
1019
  text: {
663
1020
  bold: "editor-text-bold",
664
1021
  italic: "editor-text-italic",
665
- underline: "editor-text-underline"
1022
+ underline: "editor-text-underline",
1023
+ strikethrough: "editor-text-strikethrough",
1024
+ underlineStrikethrough: "editor-text-underline-strikethrough"
1025
+ },
1026
+ list: {
1027
+ ul: "editor-list-ul",
1028
+ ol: "editor-list-ol",
1029
+ listitem: "editor-listitem"
666
1030
  },
1031
+ code: "editor-code",
667
1032
  link: "editor-link"
668
1033
  },
669
1034
  nodes: [
670
- _e,
671
- ge,
672
- K,
673
- Z,
1035
+ Ke,
1036
+ Ge,
1037
+ Ye,
1038
+ Je,
1039
+ U,
1040
+ H,
1041
+ X,
1042
+ q,
674
1043
  {
675
- replace: I,
676
- with: (e) => new Z(e.__text),
677
- withKlass: Z
1044
+ replace: P,
1045
+ with: (e) => new q(e.__text),
1046
+ withKlass: q
678
1047
  }
679
1048
  ]
680
1049
  }), [t]),
681
- children: /* @__PURE__ */ g(X, { ...e })
1050
+ children: /* @__PURE__ */ b(qt, { ...e })
682
1051
  });
683
1052
  };
684
- $.displayName = "BsyLexicalEditor";
1053
+ Jt.displayName = "BsyLexicalEditor";
685
1054
  //#endregion
686
- export { j as $getRoot, a as BaseButton, $ as default, c as listRegisteredToolbarButtons, i as registerToolbarButton, t as unregisterToolbarButton, pe as useLexicalComposerContext };
1055
+ export { we as $getRoot, v as BaseButton, Jt as default, _ as listRegisteredToolbarButtons, d as registerToolbarButton, a as unregisterToolbarButton, Be as useLexicalComposerContext };