@crystallize/design-system 1.24.46 → 2.0.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 (170) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{chunk-6DIAYHKQ.mjs → chunk-B2Q2EUTC.mjs} +5339 -4416
  3. package/dist/index.css +156 -208
  4. package/dist/index.d.ts +57 -204
  5. package/dist/index.js +8873 -8258
  6. package/dist/index.mjs +137 -307
  7. package/dist/{parser-babel-B7AMC4UT.mjs → parser-babel-D5SPHKKD.mjs} +2424 -2411
  8. package/dist/{parser-html-URMUOK6U.mjs → parser-html-RZQPYQ4H.mjs} +3 -3
  9. package/dist/{parser-postcss-AN2EJ77H.mjs → parser-postcss-D5TI5WMI.mjs} +6 -6
  10. package/dist/{rich-text-editor-EVN3N57G.css → rich-text-editor-4ZROYBHM.css} +98 -147
  11. package/dist/{rich-text-editor-QGMRYDKQ.mjs → rich-text-editor-SIZB67MA.mjs} +667 -873
  12. package/dist/{standalone-AR2ENVE7.mjs → standalone-COC5HE24.mjs} +8 -6
  13. package/package.json +26 -27
  14. package/src/action-menu/action-menu.tsx +1 -2
  15. package/src/dialog/config.tsx +6 -10
  16. package/src/dialog/dialog.tsx +2 -2
  17. package/src/dropdown-menu/dropdown-menu-root.tsx +3 -4
  18. package/src/iconography/Icon.stories.tsx +0 -1
  19. package/src/iconography/actions.tsx +1 -5
  20. package/src/iconography/add.tsx +1 -5
  21. package/src/iconography/advance.tsx +1 -5
  22. package/src/iconography/app.tsx +1 -5
  23. package/src/iconography/archive.tsx +1 -5
  24. package/src/iconography/arrow.tsx +1 -5
  25. package/src/iconography/atom.tsx +1 -5
  26. package/src/iconography/battery.tsx +1 -5
  27. package/src/iconography/bell.tsx +1 -5
  28. package/src/iconography/billing-payments.tsx +1 -5
  29. package/src/iconography/bin.tsx +1 -5
  30. package/src/iconography/boolean.tsx +17 -0
  31. package/src/iconography/cancel.tsx +1 -5
  32. package/src/iconography/caret.tsx +2 -6
  33. package/src/iconography/cart.tsx +1 -5
  34. package/src/iconography/catalogue.tsx +1 -4
  35. package/src/iconography/check-with-circle.tsx +1 -4
  36. package/src/iconography/check.tsx +1 -4
  37. package/src/iconography/checkbox.tsx +24 -0
  38. package/src/iconography/chevron.tsx +1 -3
  39. package/src/iconography/choice.tsx +1 -5
  40. package/src/iconography/chunk.tsx +1 -5
  41. package/src/iconography/clock.tsx +1 -5
  42. package/src/iconography/cloud-with-key-hole.tsx +1 -5
  43. package/src/iconography/cloud.tsx +1 -5
  44. package/src/iconography/compact.tsx +1 -5
  45. package/src/iconography/copy-with-cloud.tsx +2 -13
  46. package/src/iconography/copy.tsx +1 -5
  47. package/src/iconography/coupon.tsx +1 -5
  48. package/src/iconography/crystal.tsx +2 -14
  49. package/src/iconography/customers.tsx +1 -5
  50. package/src/iconography/dashboard.tsx +1 -5
  51. package/src/iconography/date-infinity.tsx +1 -5
  52. package/src/iconography/date.tsx +1 -5
  53. package/src/iconography/discovery.tsx +1 -5
  54. package/src/iconography/document-shortcut.tsx +1 -5
  55. package/src/iconography/document.tsx +1 -5
  56. package/src/iconography/dots.tsx +1 -5
  57. package/src/iconography/download.tsx +1 -5
  58. package/src/iconography/drag-handle.tsx +1 -5
  59. package/src/iconography/dynamic-value.tsx +1 -5
  60. package/src/iconography/edit.tsx +1 -5
  61. package/src/iconography/error-white.tsx +1 -4
  62. package/src/iconography/error.tsx +1 -4
  63. package/src/iconography/expanded.tsx +1 -5
  64. package/src/iconography/eye-closed.tsx +1 -5
  65. package/src/iconography/eye-open.tsx +1 -5
  66. package/src/iconography/file-upload.tsx +1 -5
  67. package/src/iconography/filename.tsx +1 -5
  68. package/src/iconography/fixed-property-table.tsx +1 -5
  69. package/src/iconography/fixed-value.tsx +1 -5
  70. package/src/iconography/flow.tsx +9 -21
  71. package/src/iconography/folder-shortcut.tsx +1 -5
  72. package/src/iconography/folder.tsx +1 -5
  73. package/src/iconography/frontends.tsx +1 -5
  74. package/src/iconography/fulfilment.tsx +1 -5
  75. package/src/iconography/glasses.tsx +2 -13
  76. package/src/iconography/graphQL.tsx +2 -13
  77. package/src/iconography/grid-relation.tsx +1 -5
  78. package/src/iconography/grid.tsx +1 -5
  79. package/src/iconography/hand-mirror.tsx +1 -4
  80. package/src/iconography/hooks.tsx +1 -5
  81. package/src/iconography/image.tsx +1 -5
  82. package/src/iconography/index.ts +16 -1
  83. package/src/iconography/info.tsx +1 -4
  84. package/src/iconography/items.tsx +1 -5
  85. package/src/iconography/key.tsx +1 -5
  86. package/src/iconography/language.tsx +2 -6
  87. package/src/iconography/lifebouy.tsx +2 -6
  88. package/src/iconography/limitations.tsx +1 -5
  89. package/src/iconography/location.tsx +2 -6
  90. package/src/iconography/lock-closed.tsx +1 -5
  91. package/src/iconography/lock-open.tsx +2 -6
  92. package/src/iconography/magnifier.tsx +22 -37
  93. package/src/iconography/meta-preset.tsx +36 -0
  94. package/src/iconography/min-quantity.tsx +2 -6
  95. package/src/iconography/min-value.tsx +2 -6
  96. package/src/iconography/multilingual.tsx +2 -6
  97. package/src/iconography/multiple-choice.tsx +2 -6
  98. package/src/iconography/mushroom.tsx +2 -6
  99. package/src/iconography/nail-polish.tsx +3 -14
  100. package/src/iconography/number.tsx +16 -0
  101. package/src/iconography/numeric.tsx +2 -6
  102. package/src/iconography/order.tsx +2 -6
  103. package/src/iconography/organization.tsx +2 -6
  104. package/src/iconography/paragraph-collection.tsx +2 -6
  105. package/src/iconography/particle.tsx +3 -15
  106. package/src/iconography/paths.tsx +2 -5
  107. package/src/iconography/people.tsx +2 -6
  108. package/src/iconography/percentage.tsx +3 -8
  109. package/src/iconography/piece.tsx +4 -8
  110. package/src/iconography/pin.tsx +2 -6
  111. package/src/iconography/pipeline-dashed.tsx +2 -6
  112. package/src/iconography/plans-and-pricing.tsx +2 -6
  113. package/src/iconography/plug.tsx +2 -6
  114. package/src/iconography/price-list.tsx +2 -6
  115. package/src/iconography/price-tag.tsx +2 -6
  116. package/src/iconography/product-shortcut.tsx +2 -6
  117. package/src/iconography/product.tsx +2 -6
  118. package/src/iconography/promotion.tsx +2 -6
  119. package/src/iconography/property-table.tsx +2 -6
  120. package/src/iconography/relation.tsx +2 -6
  121. package/src/iconography/remove.tsx +2 -6
  122. package/src/iconography/renew.tsx +2 -6
  123. package/src/iconography/restricted-catalogue.tsx +2 -5
  124. package/src/iconography/rich-text.tsx +2 -6
  125. package/src/iconography/rocket.tsx +2 -6
  126. package/src/iconography/search.tsx +2 -6
  127. package/src/iconography/select.tsx +20 -0
  128. package/src/iconography/selection.tsx +2 -6
  129. package/src/iconography/settings.tsx +2 -6
  130. package/src/iconography/shapes.tsx +2 -6
  131. package/src/iconography/singleline.tsx +2 -6
  132. package/src/iconography/special-price.tsx +2 -6
  133. package/src/iconography/split.tsx +2 -6
  134. package/src/iconography/stock-location.tsx +2 -6
  135. package/src/iconography/string.tsx +16 -0
  136. package/src/iconography/subscription-contracts.tsx +43 -49
  137. package/src/iconography/subscription-plans.tsx +2 -6
  138. package/src/iconography/subscription.tsx +2 -6
  139. package/src/iconography/switch.tsx +2 -6
  140. package/src/iconography/target.tsx +2 -6
  141. package/src/iconography/topics-branch.tsx +2 -6
  142. package/src/iconography/topics-leaf.tsx +2 -6
  143. package/src/iconography/topics.tsx +2 -6
  144. package/src/iconography/transition-in-disabled.tsx +2 -6
  145. package/src/iconography/transition-in.tsx +2 -6
  146. package/src/iconography/transition-out-disabled.tsx +13 -19
  147. package/src/iconography/transition-out.tsx +2 -6
  148. package/src/iconography/unpublish.tsx +2 -6
  149. package/src/iconography/usage-meter.tsx +4 -8
  150. package/src/iconography/usage.tsx +2 -6
  151. package/src/iconography/user-card.tsx +2 -6
  152. package/src/iconography/user.tsx +2 -6
  153. package/src/iconography/users.tsx +2 -6
  154. package/src/iconography/variant.tsx +2 -6
  155. package/src/iconography/video.tsx +2 -6
  156. package/src/iconography/wand.tsx +2 -6
  157. package/src/iconography/warning.tsx +2 -5
  158. package/src/iconography/x-for-y.tsx +2 -6
  159. package/src/label/label.tsx +1 -1
  160. package/src/popover/popover.tsx +5 -6
  161. package/src/rich-text-editor/tests/rich-text-editor-basic-rendering.test.tsx +8 -6
  162. package/src/rich-text-editor/tests/rich-text-editor-code.test.tsx +1 -1
  163. package/src/rich-text-editor/tests/rich-text-editor-onchange.test.tsx +4 -18
  164. package/src/rich-text-editor/tests/rich-text-editor-quote.test.tsx +2 -1
  165. package/src/rich-text-editor/tests/rich-text-editor-typing.test.tsx +6 -4
  166. package/src/rich-text-editor/tests/utils.ts +3 -1
  167. package/src/select/select-root.tsx +2 -2
  168. package/src/spinner/index.tsx +3 -3
  169. package/src/tag/tag.tsx +2 -2
  170. package/src/tooltip/tooltip.tsx +1 -1
@@ -6,7 +6,7 @@ import {
6
6
  Icon,
7
7
  IconButton,
8
8
  InputWithLabel
9
- } from "./chunk-6DIAYHKQ.mjs";
9
+ } from "./chunk-B2Q2EUTC.mjs";
10
10
  import "./chunk-NIH5ZMPE.mjs";
11
11
 
12
12
  // src/rich-text-editor/rich-text-editor.tsx
@@ -32,10 +32,7 @@ import { jsx } from "react/jsx-runtime";
32
32
  var Context = createContext({});
33
33
  var SharedHistoryContext = ({ children }) => {
34
34
  const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);
35
- return /* @__PURE__ */ jsx(Context.Provider, {
36
- value: historyContext,
37
- children
38
- });
35
+ return /* @__PURE__ */ jsx(Context.Provider, { value: historyContext, children });
39
36
  };
40
37
  var useSharedHistoryContext = () => {
41
38
  return useContext(Context);
@@ -117,10 +114,7 @@ function I18nProvider({
117
114
  children
118
115
  }) {
119
116
  const translations2 = labelTranslations || en_default;
120
- return /* @__PURE__ */ jsx2(I18nContext.Provider, {
121
- value: translations2,
122
- children
123
- });
117
+ return /* @__PURE__ */ jsx2(I18nContext.Provider, { value: translations2, children });
124
118
  }
125
119
  function replaceI18nVariablesInString(str, replaceWith) {
126
120
  return str.replace(/({{[^}]+}})/g, replaceWith);
@@ -572,7 +566,6 @@ var BaseNodes = [
572
566
  ];
573
567
 
574
568
  // src/rich-text-editor/plugins/AutoLinkPlugin/index.tsx
575
- import "react";
576
569
  import { AutoLinkPlugin } from "@lexical/react/LexicalAutoLinkPlugin";
577
570
  import { jsx as jsx3 } from "react/jsx-runtime";
578
571
  var URL_MATCHER = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
@@ -602,9 +595,7 @@ var MATCHERS = [
602
595
  }
603
596
  ];
604
597
  function LexicalAutoLinkPlugin() {
605
- return /* @__PURE__ */ jsx3(AutoLinkPlugin, {
606
- matchers: MATCHERS
607
- });
598
+ return /* @__PURE__ */ jsx3(AutoLinkPlugin, { matchers: MATCHERS });
608
599
  }
609
600
 
610
601
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx
@@ -616,7 +607,6 @@ import { $isCodeNode as $isCodeNode4, CodeNode as CodeNode2, getLanguageFriendly
616
607
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
617
608
 
618
609
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx
619
- import "react";
620
610
  import { useState } from "react";
621
611
  import { $getNearestNodeFromDOMNode, $getSelection, $setSelection } from "lexical";
622
612
  import { useDebouncedCallback } from "use-debounce";
@@ -650,28 +640,18 @@ function CopyButton({ editor, getCodeDOMNode }) {
650
640
  console.error("Failed to copy: ", err);
651
641
  }
652
642
  }
653
- return /* @__PURE__ */ jsx4("button", {
654
- className: "c-rte-code-button",
655
- onClick: handleClick,
656
- "aria-label": tr("actionCopyCode"),
657
- children: isCopyCompleted ? /* @__PURE__ */ jsx4("i", {
658
- className: "c-rte-code-button__icon c-rte-icon-success"
659
- }) : /* @__PURE__ */ jsx4("i", {
660
- className: "c-rte-code-button__icon c-rte-icon-copy"
661
- })
662
- });
643
+ return /* @__PURE__ */ jsx4("button", { className: "c-rte-code-button", onClick: handleClick, "aria-label": tr("actionCopyCode"), children: isCopyCompleted ? /* @__PURE__ */ jsx4("i", { className: "c-rte-code-button__icon c-rte-icon-success" }) : /* @__PURE__ */ jsx4("i", { className: "c-rte-code-button__icon c-rte-icon-copy" }) });
663
644
  }
664
645
 
665
646
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx
666
- import "react";
667
647
  import { useState as useState2 } from "react";
668
648
  import { $getNearestNodeFromDOMNode as $getNearestNodeFromDOMNode2 } from "lexical";
669
649
  import { $isCodeNode as $isCodeNode3 } from "@lexical/code";
670
650
  import { jsx as jsx5, jsxs } from "react/jsx-runtime";
671
651
  var PRETTIER_PARSER_MODULES = {
672
- css: () => import("./parser-postcss-AN2EJ77H.mjs"),
673
- html: () => import("./parser-html-URMUOK6U.mjs"),
674
- js: () => import("./parser-babel-B7AMC4UT.mjs")
652
+ css: () => import("./parser-postcss-D5TI5WMI.mjs"),
653
+ html: () => import("./parser-html-RZQPYQ4H.mjs"),
654
+ js: () => import("./parser-babel-D5SPHKKD.mjs")
675
655
  };
676
656
  async function loadPrettierParserByLang(lang) {
677
657
  const dynamicImport = PRETTIER_PARSER_MODULES[lang];
@@ -679,7 +659,7 @@ async function loadPrettierParserByLang(lang) {
679
659
  return parser?.default || parser;
680
660
  }
681
661
  async function loadPrettierFormat() {
682
- const prettier = await import("./standalone-AR2ENVE7.mjs");
662
+ const prettier = await import("./standalone-COC5HE24.mjs");
683
663
  return prettier?.default?.format || prettier?.format;
684
664
  }
685
665
  var PRETTIER_OPTIONS_BY_LANG = {
@@ -765,27 +745,20 @@ function PrettierButton({ lang, editor, getCodeDOMNode }) {
765
745
  setTipsVisible(false);
766
746
  }
767
747
  }
768
- return /* @__PURE__ */ jsxs("div", {
769
- className: "c-rte-prettier-wrapper",
770
- children: [
771
- /* @__PURE__ */ jsx5("button", {
748
+ return /* @__PURE__ */ jsxs("div", { className: "c-rte-prettier-wrapper", children: [
749
+ /* @__PURE__ */ jsx5(
750
+ "button",
751
+ {
772
752
  className: "c-rte-code-button",
773
753
  onClick: handleClick,
774
754
  onMouseEnter: handleMouseEnter,
775
755
  onMouseLeave: handleMouseLeave,
776
756
  "aria-label": tr("actionFormatCode"),
777
- children: syntaxError ? /* @__PURE__ */ jsx5("i", {
778
- className: "c-rte-code-button__icon c-rte-icon-prettier-error"
779
- }) : /* @__PURE__ */ jsx5("i", {
780
- className: "c-rte-code-button__icon c-rte-icon-prettier"
781
- })
782
- }),
783
- tipsVisible ? /* @__PURE__ */ jsx5("pre", {
784
- className: "c-rte-code-error-tips",
785
- children: syntaxError
786
- }) : null
787
- ]
788
- });
757
+ children: syntaxError ? /* @__PURE__ */ jsx5("i", { className: "c-rte-code-button__icon c-rte-icon-prettier-error" }) : /* @__PURE__ */ jsx5("i", { className: "c-rte-code-button__icon c-rte-icon-prettier" })
758
+ }
759
+ ),
760
+ tipsVisible ? /* @__PURE__ */ jsx5("pre", { className: "c-rte-code-error-tips", children: syntaxError }) : null
761
+ ] });
789
762
  }
790
763
 
791
764
  // src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx
@@ -875,27 +848,11 @@ function CodeActionMenuContainer({ anchorElem }) {
875
848
  }, [editor]);
876
849
  const normalizedLang = normalizeCodeLang(lang);
877
850
  const codeFriendlyName = getLanguageFriendlyName(lang);
878
- return /* @__PURE__ */ jsx6(Fragment, {
879
- children: isShown ? /* @__PURE__ */ jsxs2("div", {
880
- className: "c-rte-code-action-menu-container",
881
- style: { ...position },
882
- children: [
883
- /* @__PURE__ */ jsx6("div", {
884
- className: "c-rte-code-highlight-language",
885
- children: codeFriendlyName
886
- }),
887
- /* @__PURE__ */ jsx6(CopyButton, {
888
- editor,
889
- getCodeDOMNode
890
- }),
891
- canBePrettier(normalizedLang) ? /* @__PURE__ */ jsx6(PrettierButton, {
892
- editor,
893
- getCodeDOMNode,
894
- lang: normalizedLang
895
- }) : null
896
- ]
897
- }) : null
898
- });
851
+ return /* @__PURE__ */ jsx6(Fragment, { children: isShown ? /* @__PURE__ */ jsxs2("div", { className: "c-rte-code-action-menu-container", style: { ...position }, children: [
852
+ /* @__PURE__ */ jsx6("div", { className: "c-rte-code-highlight-language", children: codeFriendlyName }),
853
+ /* @__PURE__ */ jsx6(CopyButton, { editor, getCodeDOMNode }),
854
+ canBePrettier(normalizedLang) ? /* @__PURE__ */ jsx6(PrettierButton, { editor, getCodeDOMNode, lang: normalizedLang }) : null
855
+ ] }) : null });
899
856
  }
900
857
  function getMouseInfo(event) {
901
858
  const target = event.target;
@@ -910,9 +867,7 @@ function getMouseInfo(event) {
910
867
  function CodeActionMenuPlugin({
911
868
  anchorElem = document.body
912
869
  }) {
913
- return createPortal(/* @__PURE__ */ jsx6(CodeActionMenuContainer, {
914
- anchorElem
915
- }), anchorElem);
870
+ return createPortal(/* @__PURE__ */ jsx6(CodeActionMenuContainer, { anchorElem }), anchorElem);
916
871
  }
917
872
 
918
873
  // src/rich-text-editor/plugins/CodeHighlightPlugin/index.ts
@@ -1004,67 +959,40 @@ function LinkPreviewContent({
1004
959
  if (!hasPreview) {
1005
960
  return null;
1006
961
  }
1007
- return /* @__PURE__ */ jsxs3("div", {
1008
- className: "c-rte-link-preview",
1009
- children: [
1010
- preview.google.image && /* @__PURE__ */ jsx7("div", {
1011
- className: "c-rte-link-preview-image-wrapper",
1012
- children: /* @__PURE__ */ jsx7("img", {
1013
- src: preview.google.image,
1014
- alt: preview.google.title,
1015
- className: "c-rte-link-preview-image"
1016
- })
1017
- }),
1018
- preview.google.title && /* @__PURE__ */ jsx7("div", {
1019
- className: "c-rte-link-preview-title",
1020
- children: preview.google.title
1021
- }),
1022
- preview.google.description && /* @__PURE__ */ jsx7("div", {
1023
- className: "c-rte-link-preview-description",
1024
- children: preview.google.description
1025
- }),
1026
- textContent && textContent !== preview.google.title ? /* @__PURE__ */ jsx7(Button, {
1027
- className: "c-rte-link-preview__replace-text-btn",
1028
- onClick: useTitleForText,
1029
- children: tr("linkPreviewReplaceTextWithTitle")
1030
- }) : null
1031
- ]
1032
- });
962
+ return /* @__PURE__ */ jsxs3("div", { className: "c-rte-link-preview", children: [
963
+ preview.google.image && /* @__PURE__ */ jsx7("div", { className: "c-rte-link-preview-image-wrapper", children: /* @__PURE__ */ jsx7("img", { src: preview.google.image, alt: preview.google.title, className: "c-rte-link-preview-image" }) }),
964
+ preview.google.title && /* @__PURE__ */ jsx7("div", { className: "c-rte-link-preview-title", children: preview.google.title }),
965
+ preview.google.description && /* @__PURE__ */ jsx7("div", { className: "c-rte-link-preview-description", children: preview.google.description }),
966
+ textContent && textContent !== preview.google.title ? /* @__PURE__ */ jsx7(Button, { className: "c-rte-link-preview__replace-text-btn", onClick: useTitleForText, children: tr("linkPreviewReplaceTextWithTitle") }) : null
967
+ ] });
1033
968
  }
1034
969
  function Glimmer(props) {
1035
- return /* @__PURE__ */ jsx7("div", {
1036
- className: "c-rte-link-preview-glimmer",
1037
- ...props,
1038
- style: {
1039
- animationDelay: String((props.index || 0) * 300),
1040
- ...props.style || {}
970
+ return /* @__PURE__ */ jsx7(
971
+ "div",
972
+ {
973
+ className: "c-rte-link-preview-glimmer",
974
+ ...props,
975
+ style: {
976
+ animationDelay: String((props.index || 0) * 300),
977
+ ...props.style || {}
978
+ }
1041
979
  }
1042
- });
980
+ );
1043
981
  }
1044
982
  function LinkPreview({
1045
983
  url
1046
984
  }) {
1047
- return /* @__PURE__ */ jsx7(Suspense, {
1048
- fallback: /* @__PURE__ */ jsxs3(Fragment2, {
1049
- children: [
1050
- /* @__PURE__ */ jsx7(Glimmer, {
1051
- style: { height: "80px" },
1052
- index: 0
1053
- }),
1054
- /* @__PURE__ */ jsx7(Glimmer, {
1055
- style: { width: "60%" },
1056
- index: 1
1057
- }),
1058
- /* @__PURE__ */ jsx7(Glimmer, {
1059
- style: { width: "80%" },
1060
- index: 2
1061
- })
1062
- ]
1063
- }),
1064
- children: /* @__PURE__ */ jsx7(LinkPreviewContent, {
1065
- url
1066
- })
1067
- });
985
+ return /* @__PURE__ */ jsx7(
986
+ Suspense,
987
+ {
988
+ fallback: /* @__PURE__ */ jsxs3(Fragment2, { children: [
989
+ /* @__PURE__ */ jsx7(Glimmer, { style: { height: "80px" }, index: 0 }),
990
+ /* @__PURE__ */ jsx7(Glimmer, { style: { width: "60%" }, index: 1 }),
991
+ /* @__PURE__ */ jsx7(Glimmer, { style: { width: "80%" }, index: 2 })
992
+ ] }),
993
+ children: /* @__PURE__ */ jsx7(LinkPreviewContent, { url })
994
+ }
995
+ );
1068
996
  }
1069
997
 
1070
998
  // src/rich-text-editor/utils/getSelectedNode.ts
@@ -1250,109 +1178,77 @@ function FloatingLinkEditor({
1250
1178
  inputRef.current.focus();
1251
1179
  }
1252
1180
  }, [isEditMode]);
1253
- return /* @__PURE__ */ jsx8("div", {
1254
- ref: editorRef,
1255
- className: "c-rte-link-editor",
1256
- "data-testid": "rich-text-link-editor",
1257
- children: isEditMode ? /* @__PURE__ */ jsxs4("div", {
1258
- children: [
1259
- /* @__PURE__ */ jsx8("div", {
1260
- className: "c-rte-link-editor-input-group",
1261
- children: /* @__PURE__ */ jsx8(InputWithLabel, {
1262
- label: tr("linkEditorLink"),
1263
- type: "text",
1264
- value: linkUrl,
1265
- onChange: (e) => setLinkUrl(e.target.value)
1266
- })
1267
- }),
1268
- /* @__PURE__ */ jsx8("div", {
1269
- className: "c-rte-link-editor-input-group",
1270
- children: /* @__PURE__ */ jsx8(InputWithLabel, {
1271
- label: tr("linkEditorRel"),
1272
- type: "text",
1273
- value: rel ?? "",
1274
- onChange: (e) => setRel(e.target.value)
1275
- })
1276
- }),
1277
- /* @__PURE__ */ jsx8("div", {
1278
- className: "c-rte-link-editor-input-group",
1279
- children: /* @__PURE__ */ jsx8(InputWithLabel, {
1280
- label: tr("linkEditorTarget"),
1281
- type: "text",
1282
- value: target ?? "",
1283
- onChange: (e) => setTarget(e.target.value)
1284
- })
1285
- }),
1286
- /* @__PURE__ */ jsx8("div", {
1287
- className: "c-rte-link-editor-button-wrap",
1288
- children: /* @__PURE__ */ jsx8(Button, {
1289
- "data-testid": "link-editor-save-button",
1290
- onClick: () => {
1291
- if (lastSelection !== null) {
1292
- if (linkUrl !== "") {
1293
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, {
1294
- url: sanitizeUrl(linkUrl),
1295
- rel,
1296
- target
1297
- });
1298
- }
1299
- setEditMode(false);
1300
- }
1301
- },
1302
- children: tr("linkEditorCommit")
1303
- })
1304
- })
1305
- ]
1306
- }) : /* @__PURE__ */ jsxs4(Fragment3, {
1307
- children: [
1308
- /* @__PURE__ */ jsxs4("div", {
1309
- className: "c-rte-link-editor-link-input",
1310
- children: [
1311
- /* @__PURE__ */ jsxs4("div", {
1312
- className: "c-rte-link-editor-link-preview",
1313
- children: [
1314
- /* @__PURE__ */ jsx8("a", {
1315
- href: linkUrl,
1316
- target: "_blank",
1317
- rel: "noopener noreferrer",
1318
- children: linkUrl
1319
- }),
1320
- rel || target ? /* @__PURE__ */ jsxs4("div", {
1321
- className: "c-rte-link-editor-preview-attrs",
1322
- children: [
1323
- rel && /* @__PURE__ */ jsx8("div", {
1324
- className: "c-rte-link-editor-preview-attr",
1325
- children: rel
1326
- }),
1327
- target && /* @__PURE__ */ jsx8("div", {
1328
- className: "c-rte-link-editor-preview-attr",
1329
- children: target
1330
- })
1331
- ]
1332
- }) : null
1333
- ]
1334
- }),
1335
- /* @__PURE__ */ jsx8("div", {
1336
- children: /* @__PURE__ */ jsx8(IconButton, {
1337
- size: "sm",
1338
- tabIndex: 0,
1339
- onMouseDown: (event) => event.preventDefault(),
1340
- onClick: () => setEditMode(true),
1341
- "aria-label": tr("linkEditorEdit"),
1342
- "data-testid": "link-editor-edit",
1343
- children: /* @__PURE__ */ jsx8(Icon.Edit, {})
1344
- })
1345
- })
1346
- ]
1347
- }),
1348
- /* @__PURE__ */ jsx8("div", {
1349
- children: /* @__PURE__ */ jsx8(LinkPreview, {
1350
- url: linkUrl
1351
- })
1352
- })
1353
- ]
1354
- })
1355
- });
1181
+ return /* @__PURE__ */ jsx8("div", { ref: editorRef, className: "c-rte-link-editor", "data-testid": "rich-text-link-editor", children: isEditMode ? /* @__PURE__ */ jsxs4("div", { children: [
1182
+ /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-input-group", children: /* @__PURE__ */ jsx8(
1183
+ InputWithLabel,
1184
+ {
1185
+ label: tr("linkEditorLink"),
1186
+ type: "text",
1187
+ value: linkUrl,
1188
+ onChange: (e) => setLinkUrl(e.target.value)
1189
+ }
1190
+ ) }),
1191
+ /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-input-group", children: /* @__PURE__ */ jsx8(
1192
+ InputWithLabel,
1193
+ {
1194
+ label: tr("linkEditorRel"),
1195
+ type: "text",
1196
+ value: rel ?? "",
1197
+ onChange: (e) => setRel(e.target.value)
1198
+ }
1199
+ ) }),
1200
+ /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-input-group", children: /* @__PURE__ */ jsx8(
1201
+ InputWithLabel,
1202
+ {
1203
+ label: tr("linkEditorTarget"),
1204
+ type: "text",
1205
+ value: target ?? "",
1206
+ onChange: (e) => setTarget(e.target.value)
1207
+ }
1208
+ ) }),
1209
+ /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-button-wrap", children: /* @__PURE__ */ jsx8(
1210
+ Button,
1211
+ {
1212
+ "data-testid": "link-editor-save-button",
1213
+ onClick: () => {
1214
+ if (lastSelection !== null) {
1215
+ if (linkUrl !== "") {
1216
+ editor.dispatchCommand(TOGGLE_LINK_COMMAND, {
1217
+ url: sanitizeUrl(linkUrl),
1218
+ rel,
1219
+ target
1220
+ });
1221
+ }
1222
+ setEditMode(false);
1223
+ }
1224
+ },
1225
+ children: tr("linkEditorCommit")
1226
+ }
1227
+ ) })
1228
+ ] }) : /* @__PURE__ */ jsxs4(Fragment3, { children: [
1229
+ /* @__PURE__ */ jsxs4("div", { className: "c-rte-link-editor-link-input", children: [
1230
+ /* @__PURE__ */ jsxs4("div", { className: "c-rte-link-editor-link-preview", children: [
1231
+ /* @__PURE__ */ jsx8("a", { href: linkUrl, target: "_blank", rel: "noopener noreferrer", children: linkUrl }),
1232
+ rel || target ? /* @__PURE__ */ jsxs4("div", { className: "c-rte-link-editor-preview-attrs", children: [
1233
+ rel && /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-preview-attr", children: rel }),
1234
+ target && /* @__PURE__ */ jsx8("div", { className: "c-rte-link-editor-preview-attr", children: target })
1235
+ ] }) : null
1236
+ ] }),
1237
+ /* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsx8(
1238
+ IconButton,
1239
+ {
1240
+ size: "sm",
1241
+ tabIndex: 0,
1242
+ onMouseDown: (event) => event.preventDefault(),
1243
+ onClick: () => setEditMode(true),
1244
+ "aria-label": tr("linkEditorEdit"),
1245
+ "data-testid": "link-editor-edit",
1246
+ children: /* @__PURE__ */ jsx8(Icon.Edit, {})
1247
+ }
1248
+ ) })
1249
+ ] }),
1250
+ /* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsx8(LinkPreview, { url: linkUrl }) })
1251
+ ] }) });
1356
1252
  }
1357
1253
  function useFloatingLinkEditorToolbar(editor, anchorElem) {
1358
1254
  const [activeEditor, setActiveEditor] = useState5(editor);
@@ -1395,12 +1291,7 @@ function useFloatingLinkEditorToolbar(editor, anchorElem) {
1395
1291
  return () => document.removeEventListener("click", onClick);
1396
1292
  }, [isLink, activeEditor]);
1397
1293
  return isLink ? createPortal2(
1398
- /* @__PURE__ */ jsx8(FloatingLinkEditor, {
1399
- editor: activeEditor,
1400
- isLink,
1401
- anchorElem,
1402
- setIsLink
1403
- }),
1294
+ /* @__PURE__ */ jsx8(FloatingLinkEditor, { editor: activeEditor, isLink, anchorElem, setIsLink }),
1404
1295
  anchorElem
1405
1296
  ) : null;
1406
1297
  }
@@ -1413,7 +1304,6 @@ function FloatingLinkEditorPlugin({
1413
1304
 
1414
1305
  // src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx
1415
1306
  import { useCallback as useCallback2, useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
1416
- import "react";
1417
1307
  import {
1418
1308
  $getSelection as $getSelection4,
1419
1309
  $isRangeSelection as $isRangeSelection2,
@@ -1537,96 +1427,132 @@ function TextFormatFloatingToolbar({
1537
1427
  if (!editor.isEditable()) {
1538
1428
  return /* @__PURE__ */ jsx9("span", {});
1539
1429
  }
1540
- return /* @__PURE__ */ jsxs5("div", {
1541
- ref: popupCharStylesEditorRef,
1542
- className: "c-rte-floating-text-format-tb-plugin",
1543
- children: [
1544
- /* @__PURE__ */ jsx9(IconButton, {
1430
+ return /* @__PURE__ */ jsxs5("div", { ref: popupCharStylesEditorRef, className: "c-rte-floating-text-format-tb-plugin", children: [
1431
+ /* @__PURE__ */ jsx9(
1432
+ IconButton,
1433
+ {
1545
1434
  onClick: () => {
1546
1435
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "bold");
1547
1436
  },
1548
1437
  style: { padding: 0, overflow: "hidden" },
1549
1438
  title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
1550
1439
  "aria-label": tr("actionFormatAsStrongLabel"),
1551
- children: /* @__PURE__ */ jsx9("i", {
1552
- className: `c-rte-icon-bold c-rte-floating-text-format-tb-plugin__format-icon ${isBold ? "selected" : ""}`
1553
- })
1554
- }),
1555
- /* @__PURE__ */ jsx9(IconButton, {
1440
+ children: /* @__PURE__ */ jsx9(
1441
+ "i",
1442
+ {
1443
+ className: `c-rte-icon-bold c-rte-floating-text-format-tb-plugin__format-icon ${isBold ? "selected" : ""}`
1444
+ }
1445
+ )
1446
+ }
1447
+ ),
1448
+ /* @__PURE__ */ jsx9(
1449
+ IconButton,
1450
+ {
1556
1451
  style: { padding: 0, overflow: "hidden" },
1557
1452
  onClick: () => {
1558
1453
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "italic");
1559
1454
  },
1560
1455
  title: tr("actionFormatAsEmphasizedTitle"),
1561
1456
  "aria-label": tr("actionFormatAsEmphasizedLabel"),
1562
- children: /* @__PURE__ */ jsx9("i", {
1563
- className: `c-rte-icon-italic c-rte-floating-text-format-tb-plugin__format-icon ${isItalic ? "selected" : ""}`
1564
- })
1565
- }),
1566
- /* @__PURE__ */ jsx9(IconButton, {
1457
+ children: /* @__PURE__ */ jsx9(
1458
+ "i",
1459
+ {
1460
+ className: `c-rte-icon-italic c-rte-floating-text-format-tb-plugin__format-icon ${isItalic ? "selected" : ""}`
1461
+ }
1462
+ )
1463
+ }
1464
+ ),
1465
+ /* @__PURE__ */ jsx9(
1466
+ IconButton,
1467
+ {
1567
1468
  style: { padding: 0, overflow: "hidden" },
1568
1469
  onClick: () => {
1569
1470
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
1570
1471
  },
1571
1472
  title: tr("actionFormatAsUnderlinedTitle"),
1572
1473
  "aria-label": tr("actionFormatAsUnderlinedLabel"),
1573
- children: /* @__PURE__ */ jsx9("i", {
1574
- className: `c-rte-icon-underline c-rte-floating-text-format-tb-plugin__format-icon ${isUnderline ? "selected" : ""}`
1575
- })
1576
- }),
1577
- /* @__PURE__ */ jsx9(IconButton, {
1474
+ children: /* @__PURE__ */ jsx9(
1475
+ "i",
1476
+ {
1477
+ className: `c-rte-icon-underline c-rte-floating-text-format-tb-plugin__format-icon ${isUnderline ? "selected" : ""}`
1478
+ }
1479
+ )
1480
+ }
1481
+ ),
1482
+ /* @__PURE__ */ jsx9(
1483
+ IconButton,
1484
+ {
1578
1485
  style: { padding: 0, overflow: "hidden" },
1579
1486
  onClick: () => {
1580
1487
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "code");
1581
1488
  },
1582
1489
  "aria-label": tr("actionInsertCodeBlock"),
1583
- children: /* @__PURE__ */ jsx9("i", {
1584
- className: `c-rte-icon-code c-rte-floating-text-format-tb-plugin__format-icon ${isCode ? "selected" : ""}`
1585
- })
1586
- }),
1587
- /* @__PURE__ */ jsx9(IconButton, {
1588
- style: { padding: 0, overflow: "hidden" },
1589
- onClick: insertLink,
1590
- "aria-label": tr("actionInsertlink"),
1591
- children: /* @__PURE__ */ jsx9("i", {
1592
- className: `c-rte-icon-link c-rte-floating-text-format-tb-plugin__format-icon ${isLink ? "selected" : ""}`
1593
- })
1594
- }),
1595
- /* @__PURE__ */ jsx9(IconButton, {
1490
+ children: /* @__PURE__ */ jsx9(
1491
+ "i",
1492
+ {
1493
+ className: `c-rte-icon-code c-rte-floating-text-format-tb-plugin__format-icon ${isCode ? "selected" : ""}`
1494
+ }
1495
+ )
1496
+ }
1497
+ ),
1498
+ /* @__PURE__ */ jsx9(IconButton, { style: { padding: 0, overflow: "hidden" }, onClick: insertLink, "aria-label": tr("actionInsertlink"), children: /* @__PURE__ */ jsx9(
1499
+ "i",
1500
+ {
1501
+ className: `c-rte-icon-link c-rte-floating-text-format-tb-plugin__format-icon ${isLink ? "selected" : ""}`
1502
+ }
1503
+ ) }),
1504
+ /* @__PURE__ */ jsx9(
1505
+ IconButton,
1506
+ {
1596
1507
  style: { padding: 0, overflow: "hidden" },
1597
1508
  onClick: () => {
1598
1509
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "strikethrough");
1599
1510
  },
1600
1511
  title: tr("actionFormatWithStrikethroughTitle"),
1601
1512
  "aria-label": tr("actionFormatWithStrikethroughLabel"),
1602
- children: /* @__PURE__ */ jsx9("i", {
1603
- className: `c-rte-icon-strikethrough c-rte-floating-text-format-tb-plugin__format-icon ${isStrikethrough ? "selected" : ""}`
1604
- })
1605
- }),
1606
- /* @__PURE__ */ jsx9(IconButton, {
1513
+ children: /* @__PURE__ */ jsx9(
1514
+ "i",
1515
+ {
1516
+ className: `c-rte-icon-strikethrough c-rte-floating-text-format-tb-plugin__format-icon ${isStrikethrough ? "selected" : ""}`
1517
+ }
1518
+ )
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ jsx9(
1522
+ IconButton,
1523
+ {
1607
1524
  style: { padding: 0, overflow: "hidden" },
1608
1525
  onClick: () => {
1609
1526
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "subscript");
1610
1527
  },
1611
1528
  title: tr("actionFormatWithSubscriptTitle"),
1612
1529
  "aria-label": tr("actionFormatWithSubscriptLabel"),
1613
- children: /* @__PURE__ */ jsx9("i", {
1614
- className: `c-rte-icon-subscript c-rte-floating-text-format-tb-plugin__format-icon ${isSubscript ? "selected" : ""}`
1615
- })
1616
- }),
1617
- /* @__PURE__ */ jsx9(IconButton, {
1530
+ children: /* @__PURE__ */ jsx9(
1531
+ "i",
1532
+ {
1533
+ className: `c-rte-icon-subscript c-rte-floating-text-format-tb-plugin__format-icon ${isSubscript ? "selected" : ""}`
1534
+ }
1535
+ )
1536
+ }
1537
+ ),
1538
+ /* @__PURE__ */ jsx9(
1539
+ IconButton,
1540
+ {
1618
1541
  style: { padding: 0, overflow: "hidden" },
1619
1542
  onClick: () => {
1620
1543
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, "superscript");
1621
1544
  },
1622
1545
  title: tr("actionFormatWithSuperscriptTitle"),
1623
1546
  "aria-label": tr("actionFormatWithSuperscriptLabel"),
1624
- children: /* @__PURE__ */ jsx9("i", {
1625
- className: `c-rte-icon-superscript c-rte-floating-text-format-tb-plugin__format-icon ${isSuperscript ? "selected" : ""}`
1626
- })
1627
- })
1628
- ]
1629
- });
1547
+ children: /* @__PURE__ */ jsx9(
1548
+ "i",
1549
+ {
1550
+ className: `c-rte-icon-superscript c-rte-floating-text-format-tb-plugin__format-icon ${isSuperscript ? "selected" : ""}`
1551
+ }
1552
+ )
1553
+ }
1554
+ )
1555
+ ] });
1630
1556
  }
1631
1557
  function useFloatingTextFormatToolbar(editor, anchorElem) {
1632
1558
  const [isText, setIsText] = useState6(false);
@@ -1696,18 +1622,21 @@ function useFloatingTextFormatToolbar(editor, anchorElem) {
1696
1622
  return null;
1697
1623
  }
1698
1624
  return createPortal3(
1699
- /* @__PURE__ */ jsx9(TextFormatFloatingToolbar, {
1700
- editor,
1701
- anchorElem,
1702
- isLink,
1703
- isBold,
1704
- isItalic,
1705
- isStrikethrough,
1706
- isSubscript,
1707
- isSuperscript,
1708
- isUnderline,
1709
- isCode
1710
- }),
1625
+ /* @__PURE__ */ jsx9(
1626
+ TextFormatFloatingToolbar,
1627
+ {
1628
+ editor,
1629
+ anchorElem,
1630
+ isLink,
1631
+ isBold,
1632
+ isItalic,
1633
+ isStrikethrough,
1634
+ isSubscript,
1635
+ isSuperscript,
1636
+ isUnderline,
1637
+ isCode
1638
+ }
1639
+ ),
1711
1640
  anchorElem
1712
1641
  );
1713
1642
  }
@@ -1719,13 +1648,10 @@ function FloatingTextFormatToolbarPlugin({
1719
1648
  }
1720
1649
 
1721
1650
  // src/rich-text-editor/plugins/LinkPlugin/index.tsx
1722
- import "react";
1723
1651
  import { LinkPlugin as LexicalLinkPlugin } from "@lexical/react/LexicalLinkPlugin";
1724
1652
  import { jsx as jsx10 } from "react/jsx-runtime";
1725
1653
  function LinkPlugin() {
1726
- return /* @__PURE__ */ jsx10(LexicalLinkPlugin, {
1727
- validateUrl
1728
- });
1654
+ return /* @__PURE__ */ jsx10(LexicalLinkPlugin, { validateUrl });
1729
1655
  }
1730
1656
 
1731
1657
  // src/rich-text-editor/plugins/ListMaxIndentLevelPlugin/index.ts
@@ -2072,51 +1998,22 @@ function TableActionMenu({ tableCellNode: _tableCellNode, tableStats }) {
2072
1998
  clearTableSelection();
2073
1999
  });
2074
2000
  }, [editor, tableCellNode, clearTableSelection]);
2075
- return /* @__PURE__ */ jsxs6(Fragment4, {
2076
- children: [
2077
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2078
- onSelect: () => insertTableRowAtSelection(false),
2079
- children: tr("actionTableInsertRowsAbove", selectionCounts.rows)
2080
- }),
2081
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2082
- onSelect: () => insertTableRowAtSelection(true),
2083
- children: tr("actionTableInsertRowsBelow", selectionCounts.rows)
2084
- }),
2085
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2086
- onSelect: () => insertTableColumnAtSelection(false),
2087
- children: tr("actionTableInsertColumnsBefore", selectionCounts.columns)
2088
- }),
2089
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2090
- onSelect: () => insertTableColumnAtSelection(true),
2091
- children: tr("actionTableInsertColumnsAfter", selectionCounts.columns)
2092
- }),
2093
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2094
- onSelect: () => toggleTableRowIsHeader(),
2095
- children: tr(
2096
- (tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "actionTableRemoveRowHeader" : "actionTableAddRowHeader"
2097
- )
2098
- }),
2099
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2100
- onSelect: () => toggleTableColumnIsHeader(),
2101
- children: tr(
2102
- (tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? "actionTableRemoveColumnHeader" : "actionTableAddColumnHeader"
2103
- )
2104
- }),
2105
- /* @__PURE__ */ jsx11(DropdownMenu.Separator, {}),
2106
- tableStats.columns > 1 && /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2107
- onSelect: () => deleteTableColumnAtSelection(),
2108
- children: tr("actionTableDeleteColumn")
2109
- }),
2110
- tableStats.rows > 1 && /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2111
- onSelect: () => deleteTableRowAtSelection(),
2112
- children: tr("actionTableDeleteRow")
2113
- }),
2114
- /* @__PURE__ */ jsx11(DropdownMenu.Item, {
2115
- onSelect: () => deleteTableAtSelection(),
2116
- children: tr("actionTableDeleteTable")
2117
- })
2118
- ]
2119
- });
2001
+ return /* @__PURE__ */ jsxs6(Fragment4, { children: [
2002
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => insertTableRowAtSelection(false), children: tr("actionTableInsertRowsAbove", selectionCounts.rows) }),
2003
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => insertTableRowAtSelection(true), children: tr("actionTableInsertRowsBelow", selectionCounts.rows) }),
2004
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => insertTableColumnAtSelection(false), children: tr("actionTableInsertColumnsBefore", selectionCounts.columns) }),
2005
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => insertTableColumnAtSelection(true), children: tr("actionTableInsertColumnsAfter", selectionCounts.columns) }),
2006
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => toggleTableRowIsHeader(), children: tr(
2007
+ (tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "actionTableRemoveRowHeader" : "actionTableAddRowHeader"
2008
+ ) }),
2009
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => toggleTableColumnIsHeader(), children: tr(
2010
+ (tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? "actionTableRemoveColumnHeader" : "actionTableAddColumnHeader"
2011
+ ) }),
2012
+ /* @__PURE__ */ jsx11(DropdownMenu.Separator, {}),
2013
+ tableStats.columns > 1 && /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => deleteTableColumnAtSelection(), children: tr("actionTableDeleteColumn") }),
2014
+ tableStats.rows > 1 && /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => deleteTableRowAtSelection(), children: tr("actionTableDeleteRow") }),
2015
+ /* @__PURE__ */ jsx11(DropdownMenu.Item, { onSelect: () => deleteTableAtSelection(), children: tr("actionTableDeleteTable") })
2016
+ ] });
2120
2017
  }
2121
2018
  function TableCellActionMenuContainer({ anchorElem }) {
2122
2019
  const [editor] = useLexicalComposerContext9();
@@ -2193,30 +2090,20 @@ function TableCellActionMenuContainer({ anchorElem }) {
2193
2090
  }
2194
2091
  }
2195
2092
  }, [menuButtonRef, tableCellNode, editor, anchorElem]);
2196
- return /* @__PURE__ */ jsx11("div", {
2197
- className: "c-rte-table-cell-action-button-container",
2198
- ref: menuButtonRef,
2199
- children: tableCellNode != null && /* @__PURE__ */ jsx11(DropdownMenu.Root, {
2093
+ return /* @__PURE__ */ jsx11("div", { className: "c-rte-table-cell-action-button-container", ref: menuButtonRef, children: tableCellNode != null && /* @__PURE__ */ jsx11(
2094
+ DropdownMenu.Root,
2095
+ {
2200
2096
  onOpenChange: (isOpen) => setIsMenuOpen(isOpen),
2201
- content: /* @__PURE__ */ jsx11(TableActionMenu, {
2202
- tableCellNode,
2203
- tableStats
2204
- }),
2205
- children: /* @__PURE__ */ jsx11(IconButton, {
2206
- size: "xs",
2207
- "aria-label": tr("actionTableOpenOptions"),
2208
- children: /* @__PURE__ */ jsx11(Icon.Arrow, {})
2209
- })
2210
- })
2211
- });
2097
+ content: /* @__PURE__ */ jsx11(TableActionMenu, { tableCellNode, tableStats }),
2098
+ children: /* @__PURE__ */ jsx11(IconButton, { size: "xs", "aria-label": tr("actionTableOpenOptions"), children: /* @__PURE__ */ jsx11(Icon.Arrow, {}) })
2099
+ }
2100
+ ) });
2212
2101
  }
2213
2102
  function TableActionMenuPlugin({
2214
2103
  anchorElem = document.body
2215
2104
  }) {
2216
2105
  const isEditable = useLexicalEditable();
2217
- return createPortal4(isEditable ? /* @__PURE__ */ jsx11(TableCellActionMenuContainer, {
2218
- anchorElem
2219
- }) : null, anchorElem);
2106
+ return createPortal4(isEditable ? /* @__PURE__ */ jsx11(TableCellActionMenuContainer, { anchorElem }) : null, anchorElem);
2220
2107
  }
2221
2108
 
2222
2109
  // src/rich-text-editor/plugins/ToolbarPlugin/index.tsx
@@ -2280,19 +2167,21 @@ async function copyJson(editor) {
2280
2167
  function ActionsPlugin({ append, prepend, disabled }) {
2281
2168
  const [editor] = useLexicalComposerContext10();
2282
2169
  const tr = useTr();
2283
- return /* @__PURE__ */ jsxs7(ActionMenu, {
2284
- children: [
2285
- !prepend ? null : prepend.map((actionItem) => /* @__PURE__ */ jsx12(ActionMenu.Item, {
2170
+ return /* @__PURE__ */ jsxs7(ActionMenu, { children: [
2171
+ !prepend ? null : prepend.map((actionItem) => /* @__PURE__ */ jsx12(
2172
+ ActionMenu.Item,
2173
+ {
2286
2174
  onSelect: actionItem.action,
2287
2175
  className: actionItem.type === "danger" ? "danger" : "",
2288
2176
  disabled: actionItem.disabled,
2289
2177
  children: actionItem.title
2290
- }, actionItem.title)),
2291
- /* @__PURE__ */ jsx12(ActionMenu.Item, {
2292
- onSelect: () => copyJson(editor),
2293
- children: tr("actionCopyJSON")
2294
- }),
2295
- /* @__PURE__ */ jsx12(ActionMenu.Item, {
2178
+ },
2179
+ actionItem.title
2180
+ )),
2181
+ /* @__PURE__ */ jsx12(ActionMenu.Item, { onSelect: () => copyJson(editor), children: tr("actionCopyJSON") }),
2182
+ /* @__PURE__ */ jsx12(
2183
+ ActionMenu.Item,
2184
+ {
2296
2185
  disabled,
2297
2186
  className: "danger",
2298
2187
  onSelect: () => {
@@ -2300,15 +2189,19 @@ function ActionsPlugin({ append, prepend, disabled }) {
2300
2189
  editor.focus();
2301
2190
  },
2302
2191
  children: tr("actionClear")
2303
- }),
2304
- !append ? null : append.map((actionItem) => /* @__PURE__ */ jsx12(ActionMenu.Item, {
2192
+ }
2193
+ ),
2194
+ !append ? null : append.map((actionItem) => /* @__PURE__ */ jsx12(
2195
+ ActionMenu.Item,
2196
+ {
2305
2197
  onSelect: actionItem.action,
2306
2198
  className: actionItem.type === "danger" ? "danger" : "",
2307
2199
  disabled: actionItem.disabled,
2308
2200
  children: actionItem.title
2309
- }, actionItem.title))
2310
- ]
2311
- });
2201
+ },
2202
+ actionItem.title
2203
+ ))
2204
+ ] });
2312
2205
  }
2313
2206
 
2314
2207
  // src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx
@@ -2332,46 +2225,34 @@ function InsertTableDialog({ activeEditor }) {
2332
2225
  }
2333
2226
  });
2334
2227
  };
2335
- return /* @__PURE__ */ jsxs8("div", {
2336
- className: "c-rte-insert-table",
2337
- children: [
2338
- /* @__PURE__ */ jsxs8("div", {
2339
- className: "c-rte-insert-table__dimensions",
2340
- children: [
2341
- /* @__PURE__ */ jsx13(InputWithLabel, {
2342
- label: tr("insertTableRows"),
2343
- value: rows,
2344
- placeholder: "0",
2345
- type: "text",
2346
- inputMode: "numeric",
2347
- onChange: (e) => setRows(e.target.value)
2348
- }),
2349
- /* @__PURE__ */ jsx13("span", {
2350
- className: "c-rte-insert-table__dimensions__separator"
2351
- }),
2352
- /* @__PURE__ */ jsx13(InputWithLabel, {
2353
- type: "text",
2354
- label: tr("insertTableColumns"),
2355
- placeholder: "0",
2356
- value: columns,
2357
- inputMode: "numeric",
2358
- onChange: (e) => setColumns(e.target.value)
2359
- })
2360
- ]
2361
- }),
2362
- /* @__PURE__ */ jsx13("div", {
2363
- className: "c-rte-insert-table__actions",
2364
- children: /* @__PURE__ */ jsx13(Button, {
2365
- as: Dialog.Close,
2366
- size: "sm",
2367
- intent: "action",
2368
- "aria-label": tr("insertTableCommit"),
2369
- onClick,
2370
- children: tr("insertTableCommit")
2371
- })
2372
- })
2373
- ]
2374
- });
2228
+ return /* @__PURE__ */ jsxs8("div", { className: "c-rte-insert-table", children: [
2229
+ /* @__PURE__ */ jsxs8("div", { className: "c-rte-insert-table__dimensions", children: [
2230
+ /* @__PURE__ */ jsx13(
2231
+ InputWithLabel,
2232
+ {
2233
+ label: tr("insertTableRows"),
2234
+ value: rows,
2235
+ placeholder: "0",
2236
+ type: "text",
2237
+ inputMode: "numeric",
2238
+ onChange: (e) => setRows(e.target.value)
2239
+ }
2240
+ ),
2241
+ /* @__PURE__ */ jsx13("span", { className: "c-rte-insert-table__dimensions__separator" }),
2242
+ /* @__PURE__ */ jsx13(
2243
+ InputWithLabel,
2244
+ {
2245
+ type: "text",
2246
+ label: tr("insertTableColumns"),
2247
+ placeholder: "0",
2248
+ value: columns,
2249
+ inputMode: "numeric",
2250
+ onChange: (e) => setColumns(e.target.value)
2251
+ }
2252
+ )
2253
+ ] }),
2254
+ /* @__PURE__ */ jsx13("div", { className: "c-rte-insert-table__actions", children: /* @__PURE__ */ jsx13(Button, { as: Dialog.Close, size: "sm", intent: "action", "aria-label": tr("insertTableCommit"), onClick, children: tr("insertTableCommit") }) })
2255
+ ] });
2375
2256
  }
2376
2257
 
2377
2258
  // src/rich-text-editor/plugins/ToolbarPlugin/index.tsx
@@ -2479,104 +2360,84 @@ function BlockFormatDropDown({
2479
2360
  });
2480
2361
  }
2481
2362
  };
2482
- return /* @__PURE__ */ jsx14(DropdownMenu.Root, {
2483
- disabled,
2484
- style: { zIndex: 1 },
2485
- content: /* @__PURE__ */ jsxs9(Fragment5, {
2486
- children: [
2487
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2488
- onClick: formatParagraph,
2489
- children: [
2490
- /* @__PURE__ */ jsx14("i", {
2363
+ return /* @__PURE__ */ jsx14(
2364
+ DropdownMenu.Root,
2365
+ {
2366
+ disabled,
2367
+ style: { zIndex: 1 },
2368
+ content: /* @__PURE__ */ jsxs9(Fragment5, { children: [
2369
+ /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: formatParagraph, children: [
2370
+ /* @__PURE__ */ jsx14(
2371
+ "i",
2372
+ {
2491
2373
  className: `c-rte-icon-paragraph c-rte-toolbar__block-format__icon ${blockType === "paragraph" ? "selected" : ""}`
2492
- }),
2493
- /* @__PURE__ */ jsx14("span", {
2494
- className: `c-rte-toolbar__block-format__text ${blockType === "paragraph" ? "selected" : ""}`,
2495
- children: "Normal"
2496
- })
2497
- ]
2498
- }),
2499
- headings.map((headingSize) => /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2500
- onClick: () => formatHeading(headingSize),
2501
- children: [
2502
- /* @__PURE__ */ jsx14("i", {
2374
+ }
2375
+ ),
2376
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === "paragraph" ? "selected" : ""}`, children: "Normal" })
2377
+ ] }),
2378
+ headings.map((headingSize) => /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: () => formatHeading(headingSize), children: [
2379
+ /* @__PURE__ */ jsx14(
2380
+ "i",
2381
+ {
2503
2382
  className: `c-rte-icon-${headingSize} c-rte-toolbar__block-format__icon ${blockType === headingSize ? "selected" : ""}`
2504
- }),
2505
- /* @__PURE__ */ jsx14("span", {
2506
- className: `c-rte-toolbar__block-format__text ${blockType === headingSize ? "selected" : ""}`,
2507
- children: headingTypeToBlockName[headingSize]
2508
- })
2509
- ]
2510
- }, headingSize)),
2511
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2512
- onClick: formatBulletList,
2513
- children: [
2514
- /* @__PURE__ */ jsx14("i", {
2383
+ }
2384
+ ),
2385
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === headingSize ? "selected" : ""}`, children: headingTypeToBlockName[headingSize] })
2386
+ ] }, headingSize)),
2387
+ /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: formatBulletList, children: [
2388
+ /* @__PURE__ */ jsx14(
2389
+ "i",
2390
+ {
2515
2391
  className: `c-rte-icon-bullet-list c-rte-toolbar__block-format__icon ${blockType === "bullet" ? "selected" : ""}`
2516
- }),
2517
- /* @__PURE__ */ jsx14("span", {
2518
- className: `c-rte-toolbar__block-format__text ${blockType === "bullet" ? "selected" : ""}`,
2519
- children: "Bullet List"
2520
- })
2521
- ]
2522
- }),
2523
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2524
- onClick: formatNumberedList,
2525
- children: [
2526
- /* @__PURE__ */ jsx14("i", {
2392
+ }
2393
+ ),
2394
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === "bullet" ? "selected" : ""}`, children: "Bullet List" })
2395
+ ] }),
2396
+ /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: formatNumberedList, children: [
2397
+ /* @__PURE__ */ jsx14(
2398
+ "i",
2399
+ {
2527
2400
  className: `c-rte-icon-numbered-list c-rte-toolbar__block-format__icon ${blockType === "number" ? "selected" : ""}`
2528
- }),
2529
- /* @__PURE__ */ jsx14("span", {
2530
- className: `c-rte-toolbar__block-format__text ${blockType === "number" ? "selected" : ""}`,
2531
- children: "Numbered List"
2532
- })
2533
- ]
2534
- }),
2535
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2536
- onClick: formatQuote,
2537
- "data-testid": "toggle-block-format-quote",
2538
- children: [
2539
- /* @__PURE__ */ jsx14("i", {
2401
+ }
2402
+ ),
2403
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === "number" ? "selected" : ""}`, children: "Numbered List" })
2404
+ ] }),
2405
+ /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: formatQuote, "data-testid": "toggle-block-format-quote", children: [
2406
+ /* @__PURE__ */ jsx14(
2407
+ "i",
2408
+ {
2540
2409
  className: `c-rte-icon-quote c-rte-toolbar__block-format__icon ${blockType === "quote" ? "selected" : ""}`
2541
- }),
2542
- /* @__PURE__ */ jsx14("span", {
2543
- className: `c-rte-toolbar__block-format__text ${blockType === "quote" ? "selected" : ""}`,
2544
- children: "Quote"
2545
- })
2546
- ]
2547
- }),
2548
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2549
- onClick: formatCode,
2550
- "data-testid": "toggle-block-format-code",
2551
- children: [
2552
- /* @__PURE__ */ jsx14("i", {
2410
+ }
2411
+ ),
2412
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === "quote" ? "selected" : ""}`, children: "Quote" })
2413
+ ] }),
2414
+ /* @__PURE__ */ jsxs9(DropdownMenu.Item, { onClick: formatCode, "data-testid": "toggle-block-format-code", children: [
2415
+ /* @__PURE__ */ jsx14(
2416
+ "i",
2417
+ {
2553
2418
  className: `icon c-rte-icon-code c-rte-toolbar__block-format__icon ${blockType === "code" ? "selected" : ""}`
2554
- }),
2555
- /* @__PURE__ */ jsx14("span", {
2556
- className: `c-rte-toolbar__block-format__text ${blockType === "code" ? "selected" : ""}`,
2557
- children: "Code block"
2558
- })
2419
+ }
2420
+ ),
2421
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__block-format__text ${blockType === "code" ? "selected" : ""}`, children: "Code block" })
2422
+ ] })
2423
+ ] }),
2424
+ children: /* @__PURE__ */ jsxs9(
2425
+ Button,
2426
+ {
2427
+ style: { backgroundColor: "transparent", padding: "0 8px" },
2428
+ "aria-label": "Formatting options for text style",
2429
+ "data-testid": "toggle-block-format",
2430
+ children: [
2431
+ /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__toggle-icon c-rte-icon-${blockType}` }),
2432
+ /* @__PURE__ */ jsx14(Icon.Arrow, {})
2559
2433
  ]
2560
- })
2561
- ]
2562
- }),
2563
- children: /* @__PURE__ */ jsxs9(Button, {
2564
- style: { backgroundColor: "transparent", padding: "0 8px" },
2565
- "aria-label": "Formatting options for text style",
2566
- "data-testid": "toggle-block-format",
2567
- children: [
2568
- /* @__PURE__ */ jsx14("i", {
2569
- className: `c-rte-toolbar__toggle-icon c-rte-icon-${blockType}`
2570
- }),
2571
- /* @__PURE__ */ jsx14(Icon.Arrow, {})
2572
- ]
2573
- })
2574
- });
2434
+ }
2435
+ )
2436
+ }
2437
+ );
2575
2438
  }
2576
2439
  function Divider() {
2577
- return /* @__PURE__ */ jsx14("div", {
2578
- className: "c-rte-toolbar__divider"
2579
- });
2440
+ return /* @__PURE__ */ jsx14("div", { className: "c-rte-toolbar__divider" });
2580
2441
  }
2581
2442
  function ToolbarPlugin({
2582
2443
  actionsMenuPrepend,
@@ -2724,294 +2585,267 @@ function ToolbarPlugin({
2724
2585
  },
2725
2586
  [activeEditor, selectedElementKey]
2726
2587
  );
2727
- return /* @__PURE__ */ jsxs9("div", {
2728
- className: "c-rte-toolbar",
2729
- children: [
2730
- /* @__PURE__ */ jsxs9("div", {
2731
- className: "c-rte-toolbar__inner",
2732
- children: [
2733
- /* @__PURE__ */ jsx14(IconButton, {
2734
- disabled: !canUndo || !isEditable,
2588
+ return /* @__PURE__ */ jsxs9("div", { className: "c-rte-toolbar", children: [
2589
+ /* @__PURE__ */ jsxs9("div", { className: "c-rte-toolbar__inner", children: [
2590
+ /* @__PURE__ */ jsx14(
2591
+ IconButton,
2592
+ {
2593
+ disabled: !canUndo || !isEditable,
2594
+ onClick: () => {
2595
+ activeEditor.dispatchCommand(UNDO_COMMAND, void 0);
2596
+ },
2597
+ type: "button",
2598
+ title: tr(IS_APPLE ? "actionUndoTitleApple" : "actionUndoTitle"),
2599
+ "aria-label": tr("actionUndoLabel"),
2600
+ "data-testid": "rich-text-undo-button",
2601
+ children: /* @__PURE__ */ jsx14(
2602
+ "i",
2603
+ {
2604
+ className: `c-rte-icon-undo c-rte-toolbar__icon ${!canUndo ? "disabled" : ""}
2605
+ `
2606
+ }
2607
+ )
2608
+ }
2609
+ ),
2610
+ /* @__PURE__ */ jsx14(
2611
+ IconButton,
2612
+ {
2613
+ disabled: !canRedo || !isEditable,
2614
+ onClick: () => {
2615
+ activeEditor.dispatchCommand(REDO_COMMAND, void 0);
2616
+ },
2617
+ type: "button",
2618
+ title: tr(IS_APPLE ? "actionRedoTitleApple" : "actionRedoTitle"),
2619
+ "aria-label": tr("actionRedoLabel"),
2620
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-icon-redo c-rte-toolbar__icon ${!canRedo ? "disabled" : ""}` })
2621
+ }
2622
+ ),
2623
+ /* @__PURE__ */ jsx14(Divider, {}),
2624
+ blockType in blockTypeToBlockName && activeEditor === editor && /* @__PURE__ */ jsxs9(Fragment5, { children: [
2625
+ /* @__PURE__ */ jsx14(BlockFormatDropDown, { disabled: !isEditable, blockType, editor }),
2626
+ /* @__PURE__ */ jsx14(Divider, {})
2627
+ ] }),
2628
+ blockType === "code" ? /* @__PURE__ */ jsx14(Fragment5, { children: /* @__PURE__ */ jsx14(
2629
+ DropdownMenu.Root,
2630
+ {
2631
+ disabled: !isEditable,
2632
+ style: { zIndex: 1 },
2633
+ content: /* @__PURE__ */ jsx14(Fragment5, { children: CODE_LANGUAGE_OPTIONS.map(([value, name]) => {
2634
+ return /* @__PURE__ */ jsx14(
2635
+ DropdownMenu.Item,
2636
+ {
2637
+ className: `item ${dropDownActiveClass(value === codeLanguage)}`,
2638
+ onClick: () => onCodeLanguageSelect(value),
2639
+ children: /* @__PURE__ */ jsx14(
2640
+ "span",
2641
+ {
2642
+ className: `c-rte-toolbar__code-lang__sel-item ${dropDownActiveClass(value === codeLanguage) ? "selected" : ""}`,
2643
+ children: name
2644
+ }
2645
+ )
2646
+ },
2647
+ value
2648
+ );
2649
+ }) }),
2650
+ children: /* @__PURE__ */ jsx14(Button, { "aria-label": tr("codeSelectLanguage"), append: /* @__PURE__ */ jsx14(Icon.Arrow, {}), children: /* @__PURE__ */ jsx14("span", { className: "c-rte-toolbar__code-lang__button-text", children: getLanguageFriendlyName2(codeLanguage) }) })
2651
+ }
2652
+ ) }) : /* @__PURE__ */ jsx14(Dialog, { children: /* @__PURE__ */ jsxs9("div", { className: "c-rte-toolbar__actions-rest", children: [
2653
+ /* @__PURE__ */ jsx14(
2654
+ IconButton,
2655
+ {
2656
+ disabled: !isEditable,
2657
+ className: `c-rte-toolbar__icon-btn ${isBold ? "selected" : ""}`,
2658
+ type: "button",
2659
+ title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
2660
+ "aria-label": tr("actionFormatAsStrongLabel"),
2661
+ "data-testid": "toggle-format-bold",
2662
+ onClick: () => {
2663
+ activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "bold");
2664
+ },
2665
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__icon-btn__icon c-rte-icon-bold` })
2666
+ }
2667
+ ),
2668
+ /* @__PURE__ */ jsx14(
2669
+ IconButton,
2670
+ {
2671
+ className: `c-rte-toolbar__icon-btn ${isItalic ? "selected" : ""}`,
2672
+ disabled: !isEditable,
2735
2673
  onClick: () => {
2736
- activeEditor.dispatchCommand(UNDO_COMMAND, void 0);
2674
+ activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "italic");
2737
2675
  },
2738
2676
  type: "button",
2739
- title: tr(IS_APPLE ? "actionUndoTitleApple" : "actionUndoTitle"),
2740
- "aria-label": tr("actionUndoLabel"),
2741
- "data-testid": "rich-text-undo-button",
2742
- children: /* @__PURE__ */ jsx14("i", {
2743
- className: `c-rte-icon-undo c-rte-toolbar__icon ${!canUndo ? "disabled" : ""}
2744
- `
2745
- })
2746
- }),
2747
- /* @__PURE__ */ jsx14(IconButton, {
2748
- disabled: !canRedo || !isEditable,
2677
+ title: tr(IS_APPLE ? "actionFormatAsEmphasizedTitleApple" : "actionFormatAsEmphasizedTitle"),
2678
+ "aria-label": tr("actionFormatAsEmphasizedLabel"),
2679
+ "data-testid": "toggle-format-emphasized",
2680
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__icon-btn__icon c-rte-icon-italic` })
2681
+ }
2682
+ ),
2683
+ /* @__PURE__ */ jsx14(
2684
+ IconButton,
2685
+ {
2686
+ className: `c-rte-toolbar__icon-btn ${isUnderline ? "selected" : ""}`,
2687
+ disabled: !isEditable,
2688
+ onClick: () => {
2689
+ activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "underline");
2690
+ },
2691
+ type: "button",
2692
+ title: tr(IS_APPLE ? "actionFormatAsUnderlinedTitleApple" : "actionFormatAsUnderlinedTitle"),
2693
+ "aria-label": tr("actionFormatAsUnderlinedLabel"),
2694
+ "data-testid": "toggle-format-underlined",
2695
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__icon-btn__icon c-rte-icon-underline` })
2696
+ }
2697
+ ),
2698
+ /* @__PURE__ */ jsx14(
2699
+ IconButton,
2700
+ {
2701
+ className: `c-rte-toolbar__icon-btn ${isCode ? "selected" : ""}`,
2702
+ disabled: !isEditable,
2749
2703
  onClick: () => {
2750
- activeEditor.dispatchCommand(REDO_COMMAND, void 0);
2704
+ activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "code");
2751
2705
  },
2752
2706
  type: "button",
2753
- title: tr(IS_APPLE ? "actionRedoTitleApple" : "actionRedoTitle"),
2754
- "aria-label": tr("actionRedoLabel"),
2755
- children: /* @__PURE__ */ jsx14("i", {
2756
- className: `c-rte-icon-redo c-rte-toolbar__icon ${!canRedo ? "disabled" : ""}`
2757
- })
2758
- }),
2759
- /* @__PURE__ */ jsx14(Divider, {}),
2760
- blockType in blockTypeToBlockName && activeEditor === editor && /* @__PURE__ */ jsxs9(Fragment5, {
2761
- children: [
2762
- /* @__PURE__ */ jsx14(BlockFormatDropDown, {
2763
- disabled: !isEditable,
2764
- blockType,
2765
- editor
2766
- }),
2767
- /* @__PURE__ */ jsx14(Divider, {})
2768
- ]
2769
- }),
2770
- blockType === "code" ? /* @__PURE__ */ jsx14(Fragment5, {
2771
- children: /* @__PURE__ */ jsx14(DropdownMenu.Root, {
2772
- disabled: !isEditable,
2773
- style: { zIndex: 1 },
2774
- content: /* @__PURE__ */ jsx14(Fragment5, {
2775
- children: CODE_LANGUAGE_OPTIONS.map(([value, name]) => {
2776
- return /* @__PURE__ */ jsx14(DropdownMenu.Item, {
2777
- className: `item ${dropDownActiveClass(value === codeLanguage)}`,
2778
- onClick: () => onCodeLanguageSelect(value),
2779
- children: /* @__PURE__ */ jsx14("span", {
2780
- className: `c-rte-toolbar__code-lang__sel-item ${dropDownActiveClass(value === codeLanguage) ? "selected" : ""}`,
2781
- children: name
2782
- })
2783
- }, value);
2784
- })
2785
- }),
2786
- children: /* @__PURE__ */ jsx14(Button, {
2787
- "aria-label": tr("codeSelectLanguage"),
2788
- append: /* @__PURE__ */ jsx14(Icon.Arrow, {}),
2789
- children: /* @__PURE__ */ jsx14("span", {
2790
- className: "c-rte-toolbar__code-lang__button-text",
2791
- children: getLanguageFriendlyName2(codeLanguage)
2792
- })
2793
- })
2794
- })
2795
- }) : /* @__PURE__ */ jsx14(Dialog, {
2796
- children: /* @__PURE__ */ jsxs9("div", {
2797
- className: "c-rte-toolbar__actions-rest",
2798
- children: [
2799
- /* @__PURE__ */ jsx14(IconButton, {
2707
+ title: tr("actionInsertCodeBlock"),
2708
+ "aria-label": tr("actionInsertCodeBlock"),
2709
+ "data-testid": "toggle-format-code",
2710
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__icon-btn__icon c-rte-icon-code` })
2711
+ }
2712
+ ),
2713
+ /* @__PURE__ */ jsx14(
2714
+ IconButton,
2715
+ {
2716
+ className: `c-rte-toolbar__icon-btn ${isLink ? "selected" : ""}`,
2717
+ disabled: !isEditable,
2718
+ onClick: insertLink,
2719
+ type: "button",
2720
+ "aria-label": tr("actionInsertlink"),
2721
+ title: tr("actionInsertlink"),
2722
+ children: /* @__PURE__ */ jsx14("i", { className: `c-rte-toolbar__icon-btn__icon c-rte-icon-link` })
2723
+ }
2724
+ ),
2725
+ /* @__PURE__ */ jsx14(
2726
+ DropdownMenu.Root,
2727
+ {
2728
+ disabled: !isEditable,
2729
+ style: { zIndex: 1 },
2730
+ content: /* @__PURE__ */ jsxs9(Fragment5, { children: [
2731
+ /* @__PURE__ */ jsxs9(
2732
+ DropdownMenu.Item,
2733
+ {
2800
2734
  disabled: !isEditable,
2801
- className: `c-rte-toolbar__icon-btn ${isBold ? "selected" : ""}`,
2802
- type: "button",
2803
- title: tr(IS_APPLE ? "actionFormatAsStrongTitleApple" : "actionFormatAsStrongTitle"),
2804
- "aria-label": tr("actionFormatAsStrongLabel"),
2805
- "data-testid": "toggle-format-bold",
2806
- onClick: () => {
2807
- activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "bold");
2808
- },
2809
- children: /* @__PURE__ */ jsx14("i", {
2810
- className: `c-rte-toolbar__icon-btn__icon c-rte-icon-bold`
2811
- })
2812
- }),
2813
- /* @__PURE__ */ jsx14(IconButton, {
2814
- className: `c-rte-toolbar__icon-btn ${isItalic ? "selected" : ""}`,
2735
+ onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "strikethrough"),
2736
+ title: tr("actionFormatWithStrikethroughTitle"),
2737
+ "aria-label": tr("actionFormatWithStrikethroughLabel"),
2738
+ children: [
2739
+ /* @__PURE__ */ jsx14(
2740
+ "i",
2741
+ {
2742
+ className: `c-rte-icon-strikethrough c-rte-toolbar__dd-item__icon ${isStrikethrough ? "selected" : ""}`
2743
+ }
2744
+ ),
2745
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__dd-item__text ${isStrikethrough ? "selected" : ""}`, children: tr("actionFormatWithStrikethroughTitle") })
2746
+ ]
2747
+ }
2748
+ ),
2749
+ /* @__PURE__ */ jsxs9(
2750
+ DropdownMenu.Item,
2751
+ {
2815
2752
  disabled: !isEditable,
2816
- onClick: () => {
2817
- activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "italic");
2818
- },
2819
- type: "button",
2820
- title: tr(IS_APPLE ? "actionFormatAsEmphasizedTitleApple" : "actionFormatAsEmphasizedTitle"),
2821
- "aria-label": tr("actionFormatAsEmphasizedLabel"),
2822
- "data-testid": "toggle-format-emphasized",
2823
- children: /* @__PURE__ */ jsx14("i", {
2824
- className: `c-rte-toolbar__icon-btn__icon c-rte-icon-italic`
2825
- })
2826
- }),
2827
- /* @__PURE__ */ jsx14(IconButton, {
2828
- className: `c-rte-toolbar__icon-btn ${isUnderline ? "selected" : ""}`,
2753
+ onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "subscript"),
2754
+ title: tr("actionFormatWithSubscriptTitle"),
2755
+ "aria-label": tr("actionFormatWithSubscriptLabel"),
2756
+ children: [
2757
+ /* @__PURE__ */ jsx14(
2758
+ "i",
2759
+ {
2760
+ className: `c-rte-icon-subscript c-rte-toolbar__dd-item__icon ${isSubscript ? "selected" : ""}`
2761
+ }
2762
+ ),
2763
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__dd-item__text ${isSubscript ? "selected" : ""}`, children: tr("actionFormatWithSubscriptTitle") })
2764
+ ]
2765
+ }
2766
+ ),
2767
+ /* @__PURE__ */ jsxs9(
2768
+ DropdownMenu.Item,
2769
+ {
2829
2770
  disabled: !isEditable,
2830
- onClick: () => {
2831
- activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "underline");
2832
- },
2833
- type: "button",
2834
- title: tr(IS_APPLE ? "actionFormatAsUnderlinedTitleApple" : "actionFormatAsUnderlinedTitle"),
2835
- "aria-label": tr("actionFormatAsUnderlinedLabel"),
2836
- "data-testid": "toggle-format-underlined",
2837
- children: /* @__PURE__ */ jsx14("i", {
2838
- className: `c-rte-toolbar__icon-btn__icon c-rte-icon-underline`
2839
- })
2840
- }),
2841
- /* @__PURE__ */ jsx14(IconButton, {
2842
- className: `c-rte-toolbar__icon-btn ${isCode ? "selected" : ""}`,
2771
+ onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "superscript"),
2772
+ title: tr("actionFormatWithSuperscriptTitle"),
2773
+ "aria-label": tr("actionFormatWithSuperscriptLabel"),
2774
+ children: [
2775
+ /* @__PURE__ */ jsx14(
2776
+ "i",
2777
+ {
2778
+ className: `c-rte-icon-superscript c-rte-toolbar__dd-item__icon ${isSuperscript ? "selected" : ""}`
2779
+ }
2780
+ ),
2781
+ /* @__PURE__ */ jsx14("span", { className: `c-rte-toolbar__dd-item__text ${isSuperscript ? "selected" : ""}`, children: tr("actionFormatWithSuperscriptTitle") })
2782
+ ]
2783
+ }
2784
+ ),
2785
+ /* @__PURE__ */ jsxs9(
2786
+ DropdownMenu.Item,
2787
+ {
2843
2788
  disabled: !isEditable,
2789
+ onClick: clearFormatting,
2790
+ className: "item",
2791
+ title: tr("actionClearTextFormatting"),
2792
+ "aria-label": tr("actionClearTextFormatting"),
2793
+ children: [
2794
+ /* @__PURE__ */ jsx14("i", { className: "c-rte-icon-clear c-rte-toolbar__dd-item__icon" }),
2795
+ /* @__PURE__ */ jsx14("span", { className: "c-rte-toolbar__dd-item__text--clear", children: tr("actionFormatClear") })
2796
+ ]
2797
+ }
2798
+ )
2799
+ ] }),
2800
+ children: /* @__PURE__ */ jsxs9(
2801
+ Button,
2802
+ {
2803
+ style: { backgroundColor: "transparent", padding: "0 8px" },
2804
+ "aria-label": tr("actionTextFormattingOptions"),
2805
+ children: [
2806
+ /* @__PURE__ */ jsx14("i", { className: `c-rte-icon-dropdown-more c-rte-toolbar__toggle-icon` }),
2807
+ /* @__PURE__ */ jsx14(Icon.Arrow, {})
2808
+ ]
2809
+ }
2810
+ )
2811
+ }
2812
+ ),
2813
+ /* @__PURE__ */ jsx14(Divider, {}),
2814
+ /* @__PURE__ */ jsx14(
2815
+ DropdownMenu.Root,
2816
+ {
2817
+ style: { zIndex: 1 },
2818
+ disabled: !isEditable,
2819
+ content: /* @__PURE__ */ jsxs9(Fragment5, { children: [
2820
+ /* @__PURE__ */ jsxs9(
2821
+ DropdownMenu.Item,
2822
+ {
2844
2823
  onClick: () => {
2845
- activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "code");
2824
+ activeEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
2846
2825
  },
2847
- type: "button",
2848
- title: tr("actionInsertCodeBlock"),
2849
- "aria-label": tr("actionInsertCodeBlock"),
2850
- "data-testid": "toggle-format-code",
2851
- children: /* @__PURE__ */ jsx14("i", {
2852
- className: `c-rte-toolbar__icon-btn__icon c-rte-icon-code`
2853
- })
2854
- }),
2855
- /* @__PURE__ */ jsx14(IconButton, {
2856
- className: `c-rte-toolbar__icon-btn ${isLink ? "selected" : ""}`,
2857
- disabled: !isEditable,
2858
- onClick: insertLink,
2859
- type: "button",
2860
- "aria-label": tr("actionInsertlink"),
2861
- title: tr("actionInsertlink"),
2862
- children: /* @__PURE__ */ jsx14("i", {
2863
- className: `c-rte-toolbar__icon-btn__icon c-rte-icon-link`
2864
- })
2865
- }),
2866
- /* @__PURE__ */ jsx14(DropdownMenu.Root, {
2867
- disabled: !isEditable,
2868
- style: { zIndex: 1 },
2869
- content: /* @__PURE__ */ jsxs9(Fragment5, {
2870
- children: [
2871
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2872
- disabled: !isEditable,
2873
- onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "strikethrough"),
2874
- title: tr("actionFormatWithStrikethroughTitle"),
2875
- "aria-label": tr("actionFormatWithStrikethroughLabel"),
2876
- children: [
2877
- /* @__PURE__ */ jsx14("i", {
2878
- className: `c-rte-icon-strikethrough c-rte-toolbar__dd-item__icon ${isStrikethrough ? "selected" : ""}`
2879
- }),
2880
- /* @__PURE__ */ jsx14("span", {
2881
- className: `c-rte-toolbar__dd-item__text ${isStrikethrough ? "selected" : ""}`,
2882
- children: tr("actionFormatWithStrikethroughTitle")
2883
- })
2884
- ]
2885
- }),
2886
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2887
- disabled: !isEditable,
2888
- onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "subscript"),
2889
- title: tr("actionFormatWithSubscriptTitle"),
2890
- "aria-label": tr("actionFormatWithSubscriptLabel"),
2891
- children: [
2892
- /* @__PURE__ */ jsx14("i", {
2893
- className: `c-rte-icon-subscript c-rte-toolbar__dd-item__icon ${isSubscript ? "selected" : ""}`
2894
- }),
2895
- /* @__PURE__ */ jsx14("span", {
2896
- className: `c-rte-toolbar__dd-item__text ${isSubscript ? "selected" : ""}`,
2897
- children: tr("actionFormatWithSubscriptTitle")
2898
- })
2899
- ]
2900
- }),
2901
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2902
- disabled: !isEditable,
2903
- onClick: () => activeEditor.dispatchCommand(FORMAT_TEXT_COMMAND2, "superscript"),
2904
- title: tr("actionFormatWithSuperscriptTitle"),
2905
- "aria-label": tr("actionFormatWithSuperscriptLabel"),
2906
- children: [
2907
- /* @__PURE__ */ jsx14("i", {
2908
- className: `c-rte-icon-superscript c-rte-toolbar__dd-item__icon ${isSuperscript ? "selected" : ""}`
2909
- }),
2910
- /* @__PURE__ */ jsx14("span", {
2911
- className: `c-rte-toolbar__dd-item__text ${isSuperscript ? "selected" : ""}`,
2912
- children: tr("actionFormatWithSuperscriptTitle")
2913
- })
2914
- ]
2915
- }),
2916
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2917
- disabled: !isEditable,
2918
- onClick: clearFormatting,
2919
- className: "item",
2920
- title: tr("actionClearTextFormatting"),
2921
- "aria-label": tr("actionClearTextFormatting"),
2922
- children: [
2923
- /* @__PURE__ */ jsx14("i", {
2924
- className: "c-rte-icon-clear c-rte-toolbar__dd-item__icon"
2925
- }),
2926
- /* @__PURE__ */ jsx14("span", {
2927
- className: "c-rte-toolbar__dd-item__text--clear",
2928
- children: tr("actionFormatClear")
2929
- })
2930
- ]
2931
- })
2932
- ]
2933
- }),
2934
- children: /* @__PURE__ */ jsxs9(Button, {
2935
- style: { backgroundColor: "transparent", padding: "0 8px" },
2936
- "aria-label": tr("actionTextFormattingOptions"),
2937
- children: [
2938
- /* @__PURE__ */ jsx14("i", {
2939
- className: `c-rte-icon-dropdown-more c-rte-toolbar__toggle-icon`
2940
- }),
2941
- /* @__PURE__ */ jsx14(Icon.Arrow, {})
2942
- ]
2943
- })
2944
- }),
2945
- /* @__PURE__ */ jsx14(Divider, {}),
2946
- /* @__PURE__ */ jsx14(DropdownMenu.Root, {
2947
- style: { zIndex: 1 },
2948
- disabled: !isEditable,
2949
- content: /* @__PURE__ */ jsxs9(Fragment5, {
2950
- children: [
2951
- /* @__PURE__ */ jsxs9(DropdownMenu.Item, {
2952
- onClick: () => {
2953
- activeEditor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
2954
- },
2955
- children: [
2956
- /* @__PURE__ */ jsx14("i", {
2957
- className: "c-rte-toolbar__dd-item__icon c-rte-icon-horizontal-rule"
2958
- }),
2959
- /* @__PURE__ */ jsx14("span", {
2960
- className: "c-rte-toolbar__dd-item__text",
2961
- children: tr("horizontalRule")
2962
- })
2963
- ]
2964
- }),
2965
- /* @__PURE__ */ jsx14(DropdownMenu.Item, {
2966
- children: /* @__PURE__ */ jsx14(Dialog.Trigger, {
2967
- asChild: true,
2968
- children: /* @__PURE__ */ jsxs9("div", {
2969
- className: "c-rte-toolbar__dd-item--table",
2970
- children: [
2971
- /* @__PURE__ */ jsx14("i", {
2972
- className: "c-rte-toolbar__dd-item__icon c-rte-icon-table"
2973
- }),
2974
- /* @__PURE__ */ jsx14("span", {
2975
- className: "c-rte-toolbar__dd-item__text",
2976
- children: tr("table")
2977
- })
2978
- ]
2979
- })
2980
- })
2981
- })
2982
- ]
2983
- }),
2984
- children: /* @__PURE__ */ jsx14(IconButton, {
2985
- children: /* @__PURE__ */ jsx14("i", {
2986
- className: "c-rte-icon-plus c-rte-toolbar__plus"
2987
- })
2988
- })
2989
- }),
2990
- /* @__PURE__ */ jsxs9(Dialog.Content, {
2991
2826
  children: [
2992
- /* @__PURE__ */ jsx14(Dialog.Title, {
2993
- children: tr("insertTableTitle")
2994
- }),
2995
- /* @__PURE__ */ jsx14(Dialog.Description, {
2996
- children: tr("insertTableDescription")
2997
- }),
2998
- /* @__PURE__ */ jsx14(InsertTableDialog, {
2999
- activeEditor
3000
- })
2827
+ /* @__PURE__ */ jsx14("i", { className: "c-rte-toolbar__dd-item__icon c-rte-icon-horizontal-rule" }),
2828
+ /* @__PURE__ */ jsx14("span", { className: "c-rte-toolbar__dd-item__text", children: tr("horizontalRule") })
3001
2829
  ]
3002
- })
3003
- ]
3004
- })
3005
- })
3006
- ]
3007
- }),
3008
- /* @__PURE__ */ jsx14(ActionsPlugin, {
3009
- disabled,
3010
- prepend: actionsMenuPrepend,
3011
- append: actionsMenuAppend
3012
- })
3013
- ]
3014
- });
2830
+ }
2831
+ ),
2832
+ /* @__PURE__ */ jsx14(DropdownMenu.Item, { children: /* @__PURE__ */ jsx14(Dialog.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs9("div", { className: "c-rte-toolbar__dd-item--table", children: [
2833
+ /* @__PURE__ */ jsx14("i", { className: "c-rte-toolbar__dd-item__icon c-rte-icon-table" }),
2834
+ /* @__PURE__ */ jsx14("span", { className: "c-rte-toolbar__dd-item__text", children: tr("table") })
2835
+ ] }) }) })
2836
+ ] }),
2837
+ children: /* @__PURE__ */ jsx14(IconButton, { children: /* @__PURE__ */ jsx14("i", { className: "c-rte-icon-plus c-rte-toolbar__plus" }) })
2838
+ }
2839
+ ),
2840
+ /* @__PURE__ */ jsxs9(Dialog.Content, { children: [
2841
+ /* @__PURE__ */ jsx14(Dialog.Title, { children: tr("insertTableTitle") }),
2842
+ /* @__PURE__ */ jsx14(Dialog.Description, { children: tr("insertTableDescription") }),
2843
+ /* @__PURE__ */ jsx14(InsertTableDialog, { activeEditor })
2844
+ ] })
2845
+ ] }) })
2846
+ ] }),
2847
+ /* @__PURE__ */ jsx14(ActionsPlugin, { disabled, prepend: actionsMenuPrepend, append: actionsMenuAppend })
2848
+ ] });
3015
2849
  }
3016
2850
 
3017
2851
  // src/rich-text-editor/themes/CrystallizeRTEditorTheme.ts
@@ -3124,30 +2958,22 @@ function RichTextEditor({
3124
2958
  labelTranslations,
3125
2959
  ...rest
3126
2960
  }) {
3127
- return /* @__PURE__ */ jsx15(LexicalComposer, {
3128
- initialConfig: {
3129
- editable: !rest.disabled,
3130
- namespace: "crystallize-rich-text-editor",
3131
- nodes: [...BaseNodes],
3132
- theme: CrystallizeRTEditorTheme_default,
3133
- editorState: initialData ? composeInitialState({ richText: initialData }) : void 0,
3134
- onError: (error) => {
3135
- throw error;
3136
- }
3137
- },
3138
- children: /* @__PURE__ */ jsx15(I18nProvider, {
3139
- language,
3140
- labelTranslations,
3141
- children: /* @__PURE__ */ jsx15(SharedHistoryContext, {
3142
- children: /* @__PURE__ */ jsx15("div", {
3143
- className: "c-rich-text-editor",
3144
- children: /* @__PURE__ */ jsx15(RichTextEditorWithoutContext, {
3145
- ...rest
3146
- })
3147
- })
3148
- })
3149
- })
3150
- });
2961
+ return /* @__PURE__ */ jsx15(
2962
+ LexicalComposer,
2963
+ {
2964
+ initialConfig: {
2965
+ editable: !rest.disabled,
2966
+ namespace: "crystallize-rich-text-editor",
2967
+ nodes: [...BaseNodes],
2968
+ theme: CrystallizeRTEditorTheme_default,
2969
+ editorState: initialData ? composeInitialState({ richText: initialData }) : void 0,
2970
+ onError: (error) => {
2971
+ throw error;
2972
+ }
2973
+ },
2974
+ children: /* @__PURE__ */ jsx15(I18nProvider, { language, labelTranslations, children: /* @__PURE__ */ jsx15(SharedHistoryContext, { children: /* @__PURE__ */ jsx15("div", { className: "c-rich-text-editor", children: /* @__PURE__ */ jsx15(RichTextEditorWithoutContext, { ...rest }) }) }) })
2975
+ }
2976
+ );
3151
2977
  }
3152
2978
  function RichTextEditorWithoutContext({
3153
2979
  placeholder: placeholderText,
@@ -3163,10 +2989,7 @@ function RichTextEditorWithoutContext({
3163
2989
  }) {
3164
2990
  const editable = !disabled;
3165
2991
  const { historyState } = useSharedHistoryContext();
3166
- const placeholder = /* @__PURE__ */ jsx15("div", {
3167
- className: "c-rte-placeholder",
3168
- children: placeholderText ?? ""
3169
- });
2992
+ const placeholder = /* @__PURE__ */ jsx15("div", { className: "c-rte-placeholder", children: placeholderText ?? "" });
3170
2993
  const [editor] = useLexicalComposerContext12();
3171
2994
  const [floatingAnchorElem, setFloatingAnchorElem] = useState10(null);
3172
2995
  const firstOnChangeTriggeredRef = useRef5(!autoFocus);
@@ -3186,76 +3009,47 @@ function RichTextEditorWithoutContext({
3186
3009
  }
3187
3010
  firstOnChangeTriggeredRef.current = true;
3188
3011
  }
3189
- return /* @__PURE__ */ jsxs10(Fragment6, {
3190
- children: [
3191
- /* @__PURE__ */ jsx15(OnChangePlugin, {
3192
- onChange: onLocalChange,
3193
- ignoreSelectionChange: true
3194
- }),
3195
- /* @__PURE__ */ jsx15(ToolbarPlugin, {
3012
+ return /* @__PURE__ */ jsxs10(Fragment6, { children: [
3013
+ /* @__PURE__ */ jsx15(OnChangePlugin, { onChange: onLocalChange, ignoreSelectionChange: true }),
3014
+ /* @__PURE__ */ jsx15(
3015
+ ToolbarPlugin,
3016
+ {
3196
3017
  disabled,
3197
3018
  actionsMenuPrepend,
3198
3019
  actionsMenuAppend
3199
- }),
3200
- slotPreContent,
3201
- /* @__PURE__ */ jsxs10("div", {
3202
- className: `c-rte-editor-container ${disabled ? "disabled" : ""}`,
3203
- "data-testid": "rich-text-editor",
3204
- children: [
3205
- maxLength != null ? /* @__PURE__ */ jsx15(MaxLengthPlugin, {
3206
- maxLength
3207
- }) : null,
3208
- !autoFocus ? null : /* @__PURE__ */ jsx15(AutoFocusPlugin, {}),
3209
- /* @__PURE__ */ jsx15(ClearEditorPlugin, {}),
3210
- /* @__PURE__ */ jsx15(LexicalAutoLinkPlugin, {}),
3211
- /* @__PURE__ */ jsx15(HistoryPlugin, {
3212
- externalHistoryState: historyState
3213
- }),
3214
- /* @__PURE__ */ jsx15(RichTextPlugin, {
3215
- contentEditable: /* @__PURE__ */ jsx15("div", {
3216
- className: "c-rte-editor-scroller",
3217
- children: /* @__PURE__ */ jsx15("div", {
3218
- className: "c-rte-editor",
3219
- ref: onRef,
3220
- children: /* @__PURE__ */ jsx15(ContentEditable, {
3221
- className: "c-rte-contenteditable-root",
3222
- id
3223
- })
3224
- })
3225
- }),
3226
- placeholder,
3227
- ErrorBoundary: LexicalErrorBoundary
3228
- }),
3229
- /* @__PURE__ */ jsx15(CodeHighlightPlugin, {}),
3230
- /* @__PURE__ */ jsx15(ListPlugin, {}),
3231
- /* @__PURE__ */ jsx15(ListMaxIndentLevelPlugin, {
3232
- maxDepth: 7
3233
- }),
3234
- /* @__PURE__ */ jsx15(TablePlugin, {}),
3235
- /* @__PURE__ */ jsx15(LinkPlugin, {}),
3236
- /* @__PURE__ */ jsx15(HorizontalRulePlugin, {}),
3237
- /* @__PURE__ */ jsx15(TabFocusPlugin, {}),
3238
- /* @__PURE__ */ jsx15(TabIndentationPlugin, {}),
3239
- floatingAnchorElem && /* @__PURE__ */ jsxs10(Fragment6, {
3240
- children: [
3241
- /* @__PURE__ */ jsx15(CodeActionMenuPlugin, {
3242
- anchorElem: floatingAnchorElem
3243
- }),
3244
- /* @__PURE__ */ jsx15(FloatingLinkEditorPlugin, {
3245
- anchorElem: floatingAnchorElem
3246
- }),
3247
- /* @__PURE__ */ jsx15(TableActionMenuPlugin, {
3248
- anchorElem: floatingAnchorElem
3249
- }),
3250
- /* @__PURE__ */ jsx15(FloatingTextFormatToolbarPlugin, {
3251
- anchorElem: floatingAnchorElem
3252
- })
3253
- ]
3254
- })
3255
- ]
3256
- })
3257
- ]
3258
- });
3020
+ }
3021
+ ),
3022
+ slotPreContent,
3023
+ /* @__PURE__ */ jsxs10("div", { className: `c-rte-editor-container ${disabled ? "disabled" : ""}`, "data-testid": "rich-text-editor", children: [
3024
+ maxLength != null ? /* @__PURE__ */ jsx15(MaxLengthPlugin, { maxLength }) : null,
3025
+ !autoFocus ? null : /* @__PURE__ */ jsx15(AutoFocusPlugin, {}),
3026
+ /* @__PURE__ */ jsx15(ClearEditorPlugin, {}),
3027
+ /* @__PURE__ */ jsx15(LexicalAutoLinkPlugin, {}),
3028
+ /* @__PURE__ */ jsx15(HistoryPlugin, { externalHistoryState: historyState }),
3029
+ /* @__PURE__ */ jsx15(
3030
+ RichTextPlugin,
3031
+ {
3032
+ contentEditable: /* @__PURE__ */ jsx15("div", { className: "c-rte-editor-scroller", children: /* @__PURE__ */ jsx15("div", { className: "c-rte-editor", ref: onRef, children: /* @__PURE__ */ jsx15(ContentEditable, { className: "c-rte-contenteditable-root", id }) }) }),
3033
+ placeholder,
3034
+ ErrorBoundary: LexicalErrorBoundary
3035
+ }
3036
+ ),
3037
+ /* @__PURE__ */ jsx15(CodeHighlightPlugin, {}),
3038
+ /* @__PURE__ */ jsx15(ListPlugin, {}),
3039
+ /* @__PURE__ */ jsx15(ListMaxIndentLevelPlugin, { maxDepth: 7 }),
3040
+ /* @__PURE__ */ jsx15(TablePlugin, {}),
3041
+ /* @__PURE__ */ jsx15(LinkPlugin, {}),
3042
+ /* @__PURE__ */ jsx15(HorizontalRulePlugin, {}),
3043
+ /* @__PURE__ */ jsx15(TabFocusPlugin, {}),
3044
+ /* @__PURE__ */ jsx15(TabIndentationPlugin, {}),
3045
+ floatingAnchorElem && /* @__PURE__ */ jsxs10(Fragment6, { children: [
3046
+ /* @__PURE__ */ jsx15(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem }),
3047
+ /* @__PURE__ */ jsx15(FloatingLinkEditorPlugin, { anchorElem: floatingAnchorElem }),
3048
+ /* @__PURE__ */ jsx15(TableActionMenuPlugin, { anchorElem: floatingAnchorElem }),
3049
+ /* @__PURE__ */ jsx15(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem })
3050
+ ] })
3051
+ ] })
3052
+ ] });
3259
3053
  }
3260
3054
  var rich_text_editor_default = RichTextEditor;
3261
3055
  export {