@underverse-ui/underverse 1.0.153 → 1.0.154

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.
package/dist/index.js CHANGED
@@ -809,6 +809,15 @@ var en_default = {
809
809
  noResults: "No emoji found",
810
810
  showingCount: "Showing first {shown} of {total} emojis"
811
811
  },
812
+ formulaSuggestion: {
813
+ title: "Functions",
814
+ noResults: "No function found",
815
+ sum: "Add values in a range",
816
+ avg: "Average values in a range",
817
+ min: "Smallest value in a range",
818
+ max: "Largest value in a range",
819
+ count: "Count numeric cells in a range"
820
+ },
812
821
  tableMenu: {
813
822
  insert3x3: "Insert 3\xD73 Table",
814
823
  insertTable: "Insert Table",
@@ -1192,6 +1201,15 @@ var vi_default = {
1192
1201
  noResults: "Kh\xF4ng t\xECm th\u1EA5y emoji",
1193
1202
  showingCount: "Hi\u1EC3n th\u1ECB {shown} trong t\u1ED5ng s\u1ED1 {total} emoji"
1194
1203
  },
1204
+ formulaSuggestion: {
1205
+ title: "H\xE0m",
1206
+ noResults: "Kh\xF4ng t\xECm th\u1EA5y h\xE0m",
1207
+ sum: "C\u1ED9ng c\xE1c gi\xE1 tr\u1ECB trong v\xF9ng",
1208
+ avg: "T\xEDnh trung b\xECnh c\xE1c gi\xE1 tr\u1ECB trong v\xF9ng",
1209
+ min: "Gi\xE1 tr\u1ECB nh\u1ECF nh\u1EA5t trong v\xF9ng",
1210
+ max: "Gi\xE1 tr\u1ECB l\u1EDBn nh\u1EA5t trong v\xF9ng",
1211
+ count: "\u0110\u1EBFm c\xE1c \xF4 d\u1EA1ng s\u1ED1 trong v\xF9ng"
1212
+ },
1195
1213
  tableMenu: {
1196
1214
  insert3x3: "Ch\xE8n b\u1EA3ng 3\xD73",
1197
1215
  insertTable: "Ch\xE8n b\u1EA3ng",
@@ -1536,6 +1554,7 @@ var ko_default = {
1536
1554
  dividerDesc: "\uC2DC\uAC01\uC801 \uAD6C\uBD84\uC120",
1537
1555
  table: "\uD45C",
1538
1556
  tableDesc: "\uD45C \uCD94\uAC00",
1557
+ noResults: "\uC77C\uCE58\uD558\uB294 \uBE14\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
1539
1558
  callout: "\uCF5C\uC544\uC6C3",
1540
1559
  calloutDesc: "\uC911\uC694\uD55C \uC815\uBCF4\uB97C \uCF5C\uC544\uC6C3 \uBE14\uB85D\uC73C\uB85C \uAC15\uC870\uD569\uB2C8\uB2E4",
1541
1560
  bookmark: "\uBD81\uB9C8\uD06C \uCE74\uB4DC",
@@ -1574,6 +1593,15 @@ var ko_default = {
1574
1593
  noResults: "\uC774\uBAA8\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
1575
1594
  showingCount: "\uCD1D {total}\uAC1C \uC911 \uCC98\uC74C {shown}\uAC1C\uC758 \uC774\uBAA8\uC9C0\uB97C \uD45C\uC2DC \uC911"
1576
1595
  },
1596
+ formulaSuggestion: {
1597
+ title: "\uD568\uC218",
1598
+ noResults: "\uD568\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
1599
+ sum: "\uBC94\uC704\uC758 \uAC12\uC744 \uD569\uC0B0",
1600
+ avg: "\uBC94\uC704\uC758 \uAC12 \uD3C9\uADE0",
1601
+ min: "\uBC94\uC704\uC758 \uCD5C\uC19F\uAC12",
1602
+ max: "\uBC94\uC704\uC758 \uCD5C\uB313\uAC12",
1603
+ count: "\uBC94\uC704\uC758 \uC22B\uC790 \uC140 \uAC1C\uC218"
1604
+ },
1577
1605
  tableMenu: {
1578
1606
  insert3x3: "3x3 \uD45C \uC0BD\uC785",
1579
1607
  insertTable: "\uD45C \uC0BD\uC785",
@@ -1608,6 +1636,13 @@ var ko_default = {
1608
1636
  borderWidth: "\uD14C\uB450\uB9AC \uB450\uAED8",
1609
1637
  borderColor: "\uD14C\uB450\uB9AC \uC0C9\uC0C1",
1610
1638
  clearBorder: "\uD14C\uB450\uB9AC \uC9C0\uC6B0\uAE30",
1639
+ formula: "\uC218\uC2DD",
1640
+ numberFormat: "\uD45C\uC2DC \uD615\uC2DD",
1641
+ formatText: "\uD14D\uC2A4\uD2B8",
1642
+ formatDate: "\uB0A0\uC9DC",
1643
+ apply: "\uC801\uC6A9",
1644
+ clear: "\uC9C0\uC6B0\uAE30",
1645
+ recalculate: "\uB2E4\uC2DC \uACC4\uC0B0",
1611
1646
  done: "\uC644\uB8CC"
1612
1647
  },
1613
1648
  callout: {
@@ -1911,6 +1946,7 @@ var ja_default = {
1911
1946
  dividerDesc: "\u8996\u899A\u7684\u306A\u533A\u5207\u308A\u7DDA",
1912
1947
  table: "\u8868",
1913
1948
  tableDesc: "\u8868\u3092\u8FFD\u52A0",
1949
+ noResults: "\u4E00\u81F4\u3059\u308B\u30D6\u30ED\u30C3\u30AF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
1914
1950
  callout: "\u30B3\u30FC\u30EB\u30A2\u30A6\u30C8",
1915
1951
  calloutDesc: "\u91CD\u8981\u306A\u60C5\u5831\u3092\u30B3\u30FC\u30EB\u30A2\u30A6\u30C8\u30D6\u30ED\u30C3\u30AF\u3067\u5F37\u8ABF\u3057\u307E\u3059",
1916
1952
  bookmark: "\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF\u30AB\u30FC\u30C9",
@@ -1949,6 +1985,15 @@ var ja_default = {
1949
1985
  noResults: "\u7D75\u6587\u5B57\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
1950
1986
  showingCount: "{total} \u4EF6\u4E2D {shown} \u4EF6\u306E\u7D75\u6587\u5B57\u3092\u8868\u793A\u4E2D"
1951
1987
  },
1988
+ formulaSuggestion: {
1989
+ title: "\u95A2\u6570",
1990
+ noResults: "\u95A2\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
1991
+ sum: "\u7BC4\u56F2\u5185\u306E\u5024\u3092\u5408\u8A08",
1992
+ avg: "\u7BC4\u56F2\u5185\u306E\u5024\u306E\u5E73\u5747",
1993
+ min: "\u7BC4\u56F2\u5185\u306E\u6700\u5C0F\u5024",
1994
+ max: "\u7BC4\u56F2\u5185\u306E\u6700\u5927\u5024",
1995
+ count: "\u7BC4\u56F2\u5185\u306E\u6570\u5024\u30BB\u30EB\u3092\u30AB\u30A6\u30F3\u30C8"
1996
+ },
1952
1997
  tableMenu: {
1953
1998
  insert3x3: "3x3 \u8868\u3092\u633F\u5165",
1954
1999
  insertTable: "\u8868\u3092\u633F\u5165",
@@ -1983,6 +2028,13 @@ var ja_default = {
1983
2028
  borderWidth: "\u67A0\u7DDA\u306E\u592A\u3055",
1984
2029
  borderColor: "\u67A0\u7DDA\u306E\u8272",
1985
2030
  clearBorder: "\u67A0\u7DDA\u3092\u30AF\u30EA\u30A2",
2031
+ formula: "\u6570\u5F0F",
2032
+ numberFormat: "\u8868\u793A\u5F62\u5F0F",
2033
+ formatText: "\u30C6\u30AD\u30B9\u30C8",
2034
+ formatDate: "\u65E5\u4ED8",
2035
+ apply: "\u9069\u7528",
2036
+ clear: "\u30AF\u30EA\u30A2",
2037
+ recalculate: "\u518D\u8A08\u7B97",
1986
2038
  done: "\u5B8C\u4E86"
1987
2039
  },
1988
2040
  callout: {
@@ -24643,7 +24695,7 @@ function useLocale2() {
24643
24695
  }
24644
24696
 
24645
24697
  // src/components/UEditor/UEditor.tsx
24646
- import React82, { useEffect as useEffect38, useImperativeHandle as useImperativeHandle3, useMemo as useMemo24, useRef as useRef37 } from "react";
24698
+ import React83, { useEffect as useEffect38, useImperativeHandle as useImperativeHandle4, useMemo as useMemo24, useRef as useRef37 } from "react";
24647
24699
  import { useEditor, EditorContent } from "@tiptap/react";
24648
24700
 
24649
24701
  // src/components/UEditor/extensions.ts
@@ -26709,11 +26761,189 @@ var EmojiSuggestion = Extension3.create({
26709
26761
  }
26710
26762
  });
26711
26763
 
26764
+ // src/components/UEditor/formula-suggestion.tsx
26765
+ import { Extension as Extension4 } from "@tiptap/core";
26766
+ import Suggestion3 from "@tiptap/suggestion";
26767
+ import { ReactRenderer as ReactRenderer3 } from "@tiptap/react";
26768
+ import { PluginKey as PluginKey3 } from "@tiptap/pm/state";
26769
+ import React72, { forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3 } from "react";
26770
+ import { Sigma } from "lucide-react";
26771
+ import { jsx as jsx81, jsxs as jsxs67 } from "react/jsx-runtime";
26772
+ var FORMULA_FUNCTIONS = [
26773
+ {
26774
+ name: "SUM",
26775
+ signature: "SUM(range)",
26776
+ descriptionKey: "formulaSuggestion.sum"
26777
+ },
26778
+ {
26779
+ name: "AVG",
26780
+ signature: "AVG(range)",
26781
+ descriptionKey: "formulaSuggestion.avg"
26782
+ },
26783
+ {
26784
+ name: "MIN",
26785
+ signature: "MIN(range)",
26786
+ descriptionKey: "formulaSuggestion.min"
26787
+ },
26788
+ {
26789
+ name: "MAX",
26790
+ signature: "MAX(range)",
26791
+ descriptionKey: "formulaSuggestion.max"
26792
+ },
26793
+ {
26794
+ name: "COUNT",
26795
+ signature: "COUNT(range)",
26796
+ descriptionKey: "formulaSuggestion.count"
26797
+ }
26798
+ ];
26799
+ function isInTableCell(editor) {
26800
+ const { $from } = editor.state.selection;
26801
+ for (let depth = $from.depth; depth > 0; depth -= 1) {
26802
+ const nodeName = $from.node(depth).type.name;
26803
+ if (nodeName === "tableCell" || nodeName === "tableHeader") {
26804
+ return true;
26805
+ }
26806
+ }
26807
+ return false;
26808
+ }
26809
+ function buildFormulaSuggestionItems({ query }) {
26810
+ const normalizedQuery = query.trim().toUpperCase();
26811
+ if (!normalizedQuery) {
26812
+ return FORMULA_FUNCTIONS;
26813
+ }
26814
+ return FORMULA_FUNCTIONS.filter((item) => item.name.startsWith(normalizedQuery));
26815
+ }
26816
+ var FormulaSuggestionList = forwardRef16((props, ref) => {
26817
+ const t = useSmartTranslations("UEditor");
26818
+ const [selectedIndex, setSelectedIndex] = React72.useState(0);
26819
+ React72.useEffect(() => {
26820
+ setSelectedIndex(0);
26821
+ }, [props.items]);
26822
+ useImperativeHandle3(ref, () => ({
26823
+ onKeyDown: ({ event }) => {
26824
+ if (props.items.length === 0) return false;
26825
+ if (event.key === "ArrowUp") {
26826
+ setSelectedIndex((prev) => (prev + props.items.length - 1) % props.items.length);
26827
+ return true;
26828
+ }
26829
+ if (event.key === "ArrowDown") {
26830
+ setSelectedIndex((prev) => (prev + 1) % props.items.length);
26831
+ return true;
26832
+ }
26833
+ if (event.key === "Enter" || event.key === "Tab") {
26834
+ const item = props.items[selectedIndex];
26835
+ if (item) {
26836
+ props.command(item);
26837
+ }
26838
+ return true;
26839
+ }
26840
+ return false;
26841
+ }
26842
+ }));
26843
+ if (props.items.length === 0) {
26844
+ return /* @__PURE__ */ jsx81("div", { className: "w-72 p-3 text-sm text-muted-foreground bg-card border border-border/50 rounded-lg shadow-lg", children: t("formulaSuggestion.noResults") });
26845
+ }
26846
+ return /* @__PURE__ */ jsxs67("div", { className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-lg shadow-lg", children: [
26847
+ /* @__PURE__ */ jsx81("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
26848
+ /* @__PURE__ */ jsx81(Sigma, { className: "w-4 h-4 text-primary" }),
26849
+ /* @__PURE__ */ jsx81("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
26850
+ ] }) }),
26851
+ /* @__PURE__ */ jsx81("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs67(
26852
+ "button",
26853
+ {
26854
+ type: "button",
26855
+ className: `w-full rounded-md px-2.5 py-2 text-left transition-colors ${selectedIndex === index ? "bg-primary/10 text-primary" : "text-foreground hover:bg-muted"}`,
26856
+ onMouseEnter: () => setSelectedIndex(index),
26857
+ onMouseDown: (event) => event.preventDefault(),
26858
+ onClick: () => props.command(item),
26859
+ children: [
26860
+ /* @__PURE__ */ jsxs67("div", { className: "flex items-center justify-between gap-3", children: [
26861
+ /* @__PURE__ */ jsx81("span", { className: "font-mono text-sm font-semibold", children: item.name }),
26862
+ /* @__PURE__ */ jsx81("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
26863
+ ] }),
26864
+ /* @__PURE__ */ jsx81("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
26865
+ ]
26866
+ },
26867
+ item.name
26868
+ )) })
26869
+ ] });
26870
+ });
26871
+ FormulaSuggestionList.displayName = "FormulaSuggestionList";
26872
+ function insertFormulaFunction(editor, range, item) {
26873
+ const insertedText = `=${item.name}()`;
26874
+ const cursorPosition = range.from + item.name.length + 2;
26875
+ editor.chain().focus().deleteRange(range).insertContent(insertedText).run();
26876
+ editor.commands.setTextSelection(cursorPosition);
26877
+ }
26878
+ var FormulaSuggestion = Extension4.create({
26879
+ name: "formulaSuggestion",
26880
+ addProseMirrorPlugins() {
26881
+ return [
26882
+ Suggestion3({
26883
+ editor: this.editor,
26884
+ char: "=",
26885
+ pluginKey: new PluginKey3("formulaSuggestion"),
26886
+ allow: ({ editor }) => isInTableCell(editor),
26887
+ command: ({ editor, range, props }) => {
26888
+ insertFormulaFunction(editor, range, props);
26889
+ },
26890
+ items: buildFormulaSuggestionItems,
26891
+ render: () => {
26892
+ let component;
26893
+ let popup;
26894
+ return {
26895
+ onStart: (props) => {
26896
+ component = new ReactRenderer3(FormulaSuggestionList, {
26897
+ props,
26898
+ editor: props.editor
26899
+ });
26900
+ if (!props.clientRect) {
26901
+ return;
26902
+ }
26903
+ popup = tippy("body", {
26904
+ getReferenceClientRect: props.clientRect,
26905
+ appendTo: () => document.body,
26906
+ content: component.element,
26907
+ showOnCreate: true,
26908
+ interactive: true,
26909
+ trigger: "manual",
26910
+ placement: "bottom-start",
26911
+ zIndex: 99999
26912
+ });
26913
+ },
26914
+ onUpdate(props) {
26915
+ component?.updateProps(props);
26916
+ if (!props.clientRect) {
26917
+ return;
26918
+ }
26919
+ popup?.[0]?.setProps({
26920
+ getReferenceClientRect: props.clientRect
26921
+ });
26922
+ },
26923
+ onKeyDown(props) {
26924
+ const popupInstance = getFirstTippyInstance(popup);
26925
+ if (props.event.key === "Escape") {
26926
+ hideTippyInstance(popupInstance);
26927
+ return true;
26928
+ }
26929
+ return component?.ref?.onKeyDown(props) ?? false;
26930
+ },
26931
+ onExit() {
26932
+ destroyTippyInstance(getFirstTippyInstance(popup));
26933
+ component?.destroy();
26934
+ }
26935
+ };
26936
+ }
26937
+ })
26938
+ ];
26939
+ }
26940
+ });
26941
+
26712
26942
  // src/components/UEditor/placeholder.ts
26713
- import { Extension as Extension4, isNodeEmpty } from "@tiptap/core";
26714
- import { Plugin as Plugin3, PluginKey as PluginKey3 } from "@tiptap/pm/state";
26943
+ import { Extension as Extension5, isNodeEmpty } from "@tiptap/core";
26944
+ import { Plugin as Plugin3, PluginKey as PluginKey4 } from "@tiptap/pm/state";
26715
26945
  import { Decoration, DecorationSet } from "@tiptap/pm/view";
26716
- var UEditorPlaceholder = Extension4.create({
26946
+ var UEditorPlaceholder = Extension5.create({
26717
26947
  name: "placeholder",
26718
26948
  addOptions() {
26719
26949
  return {
@@ -26731,7 +26961,7 @@ var UEditorPlaceholder = Extension4.create({
26731
26961
  const dataAttribute = `data-${this.options.dataAttribute}`;
26732
26962
  return [
26733
26963
  new Plugin3({
26734
- key: new PluginKey3("placeholder"),
26964
+ key: new PluginKey4("placeholder"),
26735
26965
  props: {
26736
26966
  decorations: ({ doc, selection }) => {
26737
26967
  const active = this.editor.isEditable || !this.options.showOnlyWhenEditable;
@@ -26787,7 +27017,7 @@ import { useEffect as useEffect34, useRef as useRef29, useState as useState44 }
26787
27017
  import Image4 from "@tiptap/extension-image";
26788
27018
  import { mergeAttributes as mergeAttributes4 } from "@tiptap/core";
26789
27019
  import { NodeViewWrapper as NodeViewWrapper4, ReactNodeViewRenderer as ReactNodeViewRenderer4 } from "@tiptap/react";
26790
- import { jsx as jsx81, jsxs as jsxs67 } from "react/jsx-runtime";
27020
+ import { jsx as jsx82, jsxs as jsxs68 } from "react/jsx-runtime";
26791
27021
  var MIN_IMAGE_SIZE_PX = 40;
26792
27022
  var IMAGE_LAYOUTS = /* @__PURE__ */ new Set(["block", "left", "right"]);
26793
27023
  var IMAGE_WIDTH_PRESETS = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
@@ -26961,7 +27191,7 @@ function ResizableImageNodeView(props) {
26961
27191
  const showHandle = selected || isHovered || isResizing;
26962
27192
  const wrapperAlignClass = imageLayout === "block" ? textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "" : "";
26963
27193
  const wrapperLayoutClass = imageLayout === "left" ? "float-left mr-4 mb-3 mt-1 clear-none max-w-[min(45%,20rem)]" : imageLayout === "right" ? "float-right ml-4 mb-3 mt-1 clear-none max-w-[min(45%,20rem)]" : "w-fit";
26964
- return /* @__PURE__ */ jsxs67(
27194
+ return /* @__PURE__ */ jsxs68(
26965
27195
  NodeViewWrapper4,
26966
27196
  {
26967
27197
  as: "div",
@@ -26976,7 +27206,7 @@ function ResizableImageNodeView(props) {
26976
27206
  },
26977
27207
  contentEditable: false,
26978
27208
  children: [
26979
- /* @__PURE__ */ jsx81(
27209
+ /* @__PURE__ */ jsx82(
26980
27210
  "img",
26981
27211
  {
26982
27212
  ref: imgRef,
@@ -26995,7 +27225,7 @@ function ResizableImageNodeView(props) {
26995
27225
  }
26996
27226
  }
26997
27227
  ),
26998
- showHandle && /* @__PURE__ */ jsx81(
27228
+ showHandle && /* @__PURE__ */ jsx82(
26999
27229
  "div",
27000
27230
  {
27001
27231
  "aria-hidden": "true",
@@ -27108,8 +27338,8 @@ var UEditorTableRow = TableRow2.extend({
27108
27338
  var table_row_default = UEditorTableRow;
27109
27339
 
27110
27340
  // src/components/UEditor/font-family.ts
27111
- import { Extension as Extension5 } from "@tiptap/core";
27112
- var FontFamily = Extension5.create({
27341
+ import { Extension as Extension6 } from "@tiptap/core";
27342
+ var FontFamily = Extension6.create({
27113
27343
  name: "fontFamily",
27114
27344
  addOptions() {
27115
27345
  return {
@@ -27144,8 +27374,8 @@ var FontFamily = Extension5.create({
27144
27374
  var font_family_default = FontFamily;
27145
27375
 
27146
27376
  // src/components/UEditor/font-size.ts
27147
- import { Extension as Extension6 } from "@tiptap/core";
27148
- var FontSize = Extension6.create({
27377
+ import { Extension as Extension7 } from "@tiptap/core";
27378
+ var FontSize = Extension7.create({
27149
27379
  name: "fontSize",
27150
27380
  addOptions() {
27151
27381
  return {
@@ -27180,8 +27410,8 @@ var FontSize = Extension6.create({
27180
27410
  var font_size_default = FontSize;
27181
27411
 
27182
27412
  // src/components/UEditor/line-height.ts
27183
- import { Extension as Extension7 } from "@tiptap/core";
27184
- var LineHeight = Extension7.create({
27413
+ import { Extension as Extension8 } from "@tiptap/core";
27414
+ var LineHeight = Extension8.create({
27185
27415
  name: "lineHeight",
27186
27416
  addOptions() {
27187
27417
  return {
@@ -27216,8 +27446,8 @@ var LineHeight = Extension7.create({
27216
27446
  var line_height_default = LineHeight;
27217
27447
 
27218
27448
  // src/components/UEditor/letter-spacing.ts
27219
- import { Extension as Extension8 } from "@tiptap/core";
27220
- var LetterSpacing = Extension8.create({
27449
+ import { Extension as Extension9 } from "@tiptap/core";
27450
+ var LetterSpacing = Extension9.create({
27221
27451
  name: "letterSpacing",
27222
27452
  addOptions() {
27223
27453
  return {
@@ -27515,10 +27745,10 @@ var UEditorTable = Table3.extend({
27515
27745
  var table_align_default = UEditorTable;
27516
27746
 
27517
27747
  // src/components/UEditor/CodeBlockView.tsx
27518
- import React73, { useState as useState45 } from "react";
27748
+ import React74, { useState as useState45 } from "react";
27519
27749
  import { NodeViewWrapper as NodeViewWrapper5, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
27520
27750
  import { Check as Check10, Copy as Copy2, ChevronDown as ChevronDown7 } from "lucide-react";
27521
- import { Fragment as Fragment27, jsx as jsx82, jsxs as jsxs68 } from "react/jsx-runtime";
27751
+ import { Fragment as Fragment27, jsx as jsx83, jsxs as jsxs69 } from "react/jsx-runtime";
27522
27752
  var LANGUAGES = [
27523
27753
  { label: "Plain Text", value: "text" },
27524
27754
  { label: "JavaScript", value: "javascript" },
@@ -27542,10 +27772,10 @@ var CodeBlockView = ({
27542
27772
  }) => {
27543
27773
  const [copied, setCopied] = useState45(false);
27544
27774
  const [isDropdownOpen, setIsDropdownOpen] = useState45(false);
27545
- const timeoutRef = React73.useRef(null);
27775
+ const timeoutRef = React74.useRef(null);
27546
27776
  const currentLangValue = node.attrs.language || "text";
27547
27777
  const currentLangLabel = LANGUAGES.find((lang) => lang.value === currentLangValue)?.label || "Plain Text";
27548
- React73.useEffect(() => {
27778
+ React74.useEffect(() => {
27549
27779
  return () => {
27550
27780
  if (timeoutRef.current) {
27551
27781
  clearTimeout(timeoutRef.current);
@@ -27566,15 +27796,15 @@ var CodeBlockView = ({
27566
27796
  console.error("Failed to copy code text: ", err);
27567
27797
  }
27568
27798
  };
27569
- return /* @__PURE__ */ jsxs68(NodeViewWrapper5, { className: "group/code relative my-4 rounded-xl border border-border/60 bg-muted/40 p-4 font-mono text-sm shadow-sm overflow-visible", children: [
27570
- /* @__PURE__ */ jsxs68(
27799
+ return /* @__PURE__ */ jsxs69(NodeViewWrapper5, { className: "group/code relative my-4 rounded-xl border border-border/60 bg-muted/40 p-4 font-mono text-sm shadow-sm overflow-visible", children: [
27800
+ /* @__PURE__ */ jsxs69(
27571
27801
  "div",
27572
27802
  {
27573
27803
  className: "absolute right-3 top-3 z-10 flex items-center gap-1.5 opacity-0 group-hover/code:opacity-100 focus-within:opacity-100 transition-opacity duration-200 select-none",
27574
27804
  contentEditable: false,
27575
27805
  children: [
27576
- /* @__PURE__ */ jsxs68("div", { className: "relative", children: [
27577
- /* @__PURE__ */ jsxs68(
27806
+ /* @__PURE__ */ jsxs69("div", { className: "relative", children: [
27807
+ /* @__PURE__ */ jsxs69(
27578
27808
  "button",
27579
27809
  {
27580
27810
  type: "button",
@@ -27582,19 +27812,19 @@ var CodeBlockView = ({
27582
27812
  className: "flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground hover:text-foreground hover:bg-muted active:scale-95 transition-all focus:outline-none",
27583
27813
  children: [
27584
27814
  currentLangLabel,
27585
- /* @__PURE__ */ jsx82(ChevronDown7, { className: "h-3 w-3" })
27815
+ /* @__PURE__ */ jsx83(ChevronDown7, { className: "h-3 w-3" })
27586
27816
  ]
27587
27817
  }
27588
27818
  ),
27589
- isDropdownOpen && /* @__PURE__ */ jsxs68(Fragment27, { children: [
27590
- /* @__PURE__ */ jsx82(
27819
+ isDropdownOpen && /* @__PURE__ */ jsxs69(Fragment27, { children: [
27820
+ /* @__PURE__ */ jsx83(
27591
27821
  "div",
27592
27822
  {
27593
27823
  className: "fixed inset-0 z-20",
27594
27824
  onClick: () => setIsDropdownOpen(false)
27595
27825
  }
27596
27826
  ),
27597
- /* @__PURE__ */ jsx82("div", { className: "absolute right-0 mt-1 max-h-56 w-36 overflow-y-auto rounded-lg border border-border/50 bg-popover p-1 shadow-lg z-30 [scrollbar-width:thin] animate-in fade-in-0 zoom-in-95", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx82(
27827
+ /* @__PURE__ */ jsx83("div", { className: "absolute right-0 mt-1 max-h-56 w-36 overflow-y-auto rounded-lg border border-border/50 bg-popover p-1 shadow-lg z-30 [scrollbar-width:thin] animate-in fade-in-0 zoom-in-95", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx83(
27598
27828
  "button",
27599
27829
  {
27600
27830
  type: "button",
@@ -27612,20 +27842,20 @@ var CodeBlockView = ({
27612
27842
  )) })
27613
27843
  ] })
27614
27844
  ] }),
27615
- /* @__PURE__ */ jsx82(
27845
+ /* @__PURE__ */ jsx83(
27616
27846
  "button",
27617
27847
  {
27618
27848
  type: "button",
27619
27849
  onClick: handleCopy,
27620
27850
  className: "flex h-7 w-7 items-center justify-center rounded-lg border border-border bg-background text-muted-foreground hover:text-foreground hover:bg-muted active:scale-95 transition-all focus:outline-none",
27621
27851
  title: "Copy code",
27622
- children: copied ? /* @__PURE__ */ jsx82(Check10, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ jsx82(Copy2, { className: "h-3.5 w-3.5" })
27852
+ children: copied ? /* @__PURE__ */ jsx83(Check10, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ jsx83(Copy2, { className: "h-3.5 w-3.5" })
27623
27853
  }
27624
27854
  )
27625
27855
  ]
27626
27856
  }
27627
27857
  ),
27628
- /* @__PURE__ */ jsx82("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx82("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx82(NodeViewContent2, {}) }) })
27858
+ /* @__PURE__ */ jsx83("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx83("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx83(NodeViewContent2, {}) }) })
27629
27859
  ] });
27630
27860
  };
27631
27861
 
@@ -28011,6 +28241,7 @@ function buildUEditorExtensions({
28011
28241
  SlashCommand.configure({
28012
28242
  messages: buildSlashCommandMessages(translate)
28013
28243
  }),
28244
+ FormulaSuggestion,
28014
28245
  EmojiSuggestion,
28015
28246
  Callout,
28016
28247
  Bookmark.configure({
@@ -28023,7 +28254,7 @@ function buildUEditorExtensions({
28023
28254
  }
28024
28255
 
28025
28256
  // src/components/UEditor/toolbar.tsx
28026
- import React76, { useRef as useRef32, useState as useState47 } from "react";
28257
+ import React77, { useRef as useRef32, useState as useState47 } from "react";
28027
28258
  import { useEditorState } from "@tiptap/react";
28028
28259
  import {
28029
28260
  AlignCenter,
@@ -28068,12 +28299,12 @@ import {
28068
28299
  // src/components/UEditor/colors.tsx
28069
28300
  import { useMemo as useMemo22, useRef as useRef30 } from "react";
28070
28301
  import { Check as Check11, Highlighter, Palette as Palette2, Paintbrush, Grid as Grid2 } from "lucide-react";
28071
- import { jsx as jsx83, jsxs as jsxs69 } from "react/jsx-runtime";
28302
+ import { jsx as jsx84, jsxs as jsxs70 } from "react/jsx-runtime";
28072
28303
  var TextColorIcon = ({ color }) => {
28073
28304
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28074
- return /* @__PURE__ */ jsxs69("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28075
- /* @__PURE__ */ jsx83("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
28076
- /* @__PURE__ */ jsx83(
28305
+ return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28306
+ /* @__PURE__ */ jsx84("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
28307
+ /* @__PURE__ */ jsx84(
28077
28308
  "span",
28078
28309
  {
28079
28310
  "aria-hidden": "true",
@@ -28085,9 +28316,9 @@ var TextColorIcon = ({ color }) => {
28085
28316
  };
28086
28317
  var HighlightColorIcon = ({ color }) => {
28087
28318
  const underlineColor = color || "currentColor";
28088
- return /* @__PURE__ */ jsxs69("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28089
- /* @__PURE__ */ jsx83(Highlighter, { className: "h-4 w-4" }),
28090
- /* @__PURE__ */ jsx83(
28319
+ return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28320
+ /* @__PURE__ */ jsx84(Highlighter, { className: "h-4 w-4" }),
28321
+ /* @__PURE__ */ jsx84(
28091
28322
  "span",
28092
28323
  {
28093
28324
  "aria-hidden": "true",
@@ -28099,9 +28330,9 @@ var HighlightColorIcon = ({ color }) => {
28099
28330
  };
28100
28331
  var CellBgColorIcon = ({ color }) => {
28101
28332
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28102
- return /* @__PURE__ */ jsxs69("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28103
- /* @__PURE__ */ jsx83(Paintbrush, { className: "h-4 w-4" }),
28104
- /* @__PURE__ */ jsx83(
28333
+ return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28334
+ /* @__PURE__ */ jsx84(Paintbrush, { className: "h-4 w-4" }),
28335
+ /* @__PURE__ */ jsx84(
28105
28336
  "span",
28106
28337
  {
28107
28338
  "aria-hidden": "true",
@@ -28113,9 +28344,9 @@ var CellBgColorIcon = ({ color }) => {
28113
28344
  };
28114
28345
  var CellBorderIcon = ({ color }) => {
28115
28346
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28116
- return /* @__PURE__ */ jsxs69("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28117
- /* @__PURE__ */ jsx83(Grid2, { className: "h-4 w-4" }),
28118
- /* @__PURE__ */ jsx83(
28347
+ return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28348
+ /* @__PURE__ */ jsx84(Grid2, { className: "h-4 w-4" }),
28349
+ /* @__PURE__ */ jsx84(
28119
28350
  "span",
28120
28351
  {
28121
28352
  "aria-hidden": "true",
@@ -28239,9 +28470,9 @@ var EditorColorPalette = ({
28239
28470
  const colorInputRef = useRef30(null);
28240
28471
  const automaticColor = colors[0]?.color ?? "";
28241
28472
  const paletteColors = colors.slice(1);
28242
- return /* @__PURE__ */ jsxs69("div", { className: "w-56 p-2", children: [
28243
- /* @__PURE__ */ jsx83("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
28244
- /* @__PURE__ */ jsxs69(
28473
+ return /* @__PURE__ */ jsxs70("div", { className: "w-56 p-2", children: [
28474
+ /* @__PURE__ */ jsx84("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
28475
+ /* @__PURE__ */ jsxs70(
28245
28476
  "button",
28246
28477
  {
28247
28478
  type: "button",
@@ -28253,12 +28484,12 @@ var EditorColorPalette = ({
28253
28484
  currentColor === automaticColor ? "border-primary text-primary" : "border-transparent text-foreground"
28254
28485
  ),
28255
28486
  children: [
28256
- /* @__PURE__ */ jsx83("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ jsx83(Check11, { className: "h-3.5 w-3.5" }) }),
28257
- /* @__PURE__ */ jsx83("span", { className: "flex-1 text-center", children: t("colors.automatic") })
28487
+ /* @__PURE__ */ jsx84("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ jsx84(Check11, { className: "h-3.5 w-3.5" }) }),
28488
+ /* @__PURE__ */ jsx84("span", { className: "flex-1 text-center", children: t("colors.automatic") })
28258
28489
  ]
28259
28490
  }
28260
28491
  ),
28261
- /* @__PURE__ */ jsx83("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ jsx83(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx83("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsx83(
28492
+ /* @__PURE__ */ jsx84("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ jsx84(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx84("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsx84(
28262
28493
  "button",
28263
28494
  {
28264
28495
  type: "button",
@@ -28270,10 +28501,10 @@ var EditorColorPalette = ({
28270
28501
  currentColor === c.color ? "border-primary ring-2 ring-primary/25" : "border-border/70"
28271
28502
  ),
28272
28503
  style: { backgroundColor: c.color || "transparent" },
28273
- children: currentColor === c.color && /* @__PURE__ */ jsx83("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx83(Check11, { className: "h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.8)]" }) })
28504
+ children: currentColor === c.color && /* @__PURE__ */ jsx84("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx84(Check11, { className: "h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.8)]" }) })
28274
28505
  }
28275
28506
  ) }, `${c.name}-${c.color}`)) }),
28276
- /* @__PURE__ */ jsxs69(
28507
+ /* @__PURE__ */ jsxs70(
28277
28508
  "button",
28278
28509
  {
28279
28510
  type: "button",
@@ -28281,7 +28512,7 @@ var EditorColorPalette = ({
28281
28512
  onClick: () => colorInputRef.current?.click(),
28282
28513
  className: "mt-3 flex h-9 w-full items-center gap-3 rounded-md px-2 text-sm text-foreground transition-colors hover:bg-muted",
28283
28514
  children: [
28284
- /* @__PURE__ */ jsx83(
28515
+ /* @__PURE__ */ jsx84(
28285
28516
  "span",
28286
28517
  {
28287
28518
  "aria-hidden": "true",
@@ -28291,9 +28522,9 @@ var EditorColorPalette = ({
28291
28522
  }
28292
28523
  }
28293
28524
  ),
28294
- /* @__PURE__ */ jsx83("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
28295
- /* @__PURE__ */ jsx83(Palette2, { className: "h-4 w-4 text-muted-foreground" }),
28296
- /* @__PURE__ */ jsx83(
28525
+ /* @__PURE__ */ jsx84("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
28526
+ /* @__PURE__ */ jsx84(Palette2, { className: "h-4 w-4 text-muted-foreground" }),
28527
+ /* @__PURE__ */ jsx84(
28297
28528
  "input",
28298
28529
  {
28299
28530
  ref: colorInputRef,
@@ -28440,7 +28671,7 @@ function deleteSelectedImage(editor) {
28440
28671
  // src/components/UEditor/inputs.tsx
28441
28672
  import { useEffect as useEffect35, useRef as useRef31, useState as useState46 } from "react";
28442
28673
  import { Check as Check12, X as X18 } from "lucide-react";
28443
- import { jsx as jsx84, jsxs as jsxs70 } from "react/jsx-runtime";
28674
+ import { jsx as jsx85, jsxs as jsxs71 } from "react/jsx-runtime";
28444
28675
  function normalizeUrl(raw) {
28445
28676
  return sanitizeUEditorUrl(raw, "link");
28446
28677
  }
@@ -28461,8 +28692,8 @@ var LinkInput = ({
28461
28692
  const normalized = normalizeUrl(url);
28462
28693
  if (normalized) onSubmit(normalized);
28463
28694
  };
28464
- return /* @__PURE__ */ jsxs70("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
28465
- /* @__PURE__ */ jsx84(
28695
+ return /* @__PURE__ */ jsxs71("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
28696
+ /* @__PURE__ */ jsx85(
28466
28697
  "input",
28467
28698
  {
28468
28699
  ref: inputRef,
@@ -28473,8 +28704,8 @@ var LinkInput = ({
28473
28704
  className: "flex-1 px-3 py-2 text-sm bg-muted/50 border-0 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20"
28474
28705
  }
28475
28706
  ),
28476
- /* @__PURE__ */ jsx84("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx84(Check12, { className: "w-4 h-4" }) }),
28477
- /* @__PURE__ */ jsx84("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx84(X18, { className: "w-4 h-4" }) })
28707
+ /* @__PURE__ */ jsx85("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx85(Check12, { className: "w-4 h-4" }) }),
28708
+ /* @__PURE__ */ jsx85("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx85(X18, { className: "w-4 h-4" }) })
28478
28709
  ] });
28479
28710
  };
28480
28711
  var ImageInput = ({ onSubmit, onCancel }) => {
@@ -28492,10 +28723,10 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28492
28723
  onSubmit(safeUrl, alt);
28493
28724
  }
28494
28725
  };
28495
- return /* @__PURE__ */ jsxs70("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
28496
- /* @__PURE__ */ jsxs70("div", { children: [
28497
- /* @__PURE__ */ jsx84("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
28498
- /* @__PURE__ */ jsx84(
28726
+ return /* @__PURE__ */ jsxs71("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
28727
+ /* @__PURE__ */ jsxs71("div", { children: [
28728
+ /* @__PURE__ */ jsx85("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
28729
+ /* @__PURE__ */ jsx85(
28499
28730
  "input",
28500
28731
  {
28501
28732
  ref: inputRef,
@@ -28507,9 +28738,9 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28507
28738
  }
28508
28739
  )
28509
28740
  ] }),
28510
- /* @__PURE__ */ jsxs70("div", { children: [
28511
- /* @__PURE__ */ jsx84("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
28512
- /* @__PURE__ */ jsx84(
28741
+ /* @__PURE__ */ jsxs71("div", { children: [
28742
+ /* @__PURE__ */ jsx85("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
28743
+ /* @__PURE__ */ jsx85(
28513
28744
  "input",
28514
28745
  {
28515
28746
  type: "text",
@@ -28520,8 +28751,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28520
28751
  }
28521
28752
  )
28522
28753
  ] }),
28523
- /* @__PURE__ */ jsxs70("div", { className: "flex gap-2", children: [
28524
- /* @__PURE__ */ jsx84(
28754
+ /* @__PURE__ */ jsxs71("div", { className: "flex gap-2", children: [
28755
+ /* @__PURE__ */ jsx85(
28525
28756
  "button",
28526
28757
  {
28527
28758
  type: "submit",
@@ -28530,7 +28761,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28530
28761
  children: t("imageInput.addBtn")
28531
28762
  }
28532
28763
  ),
28533
- /* @__PURE__ */ jsx84("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
28764
+ /* @__PURE__ */ jsx85("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
28534
28765
  ] })
28535
28766
  ] });
28536
28767
  };
@@ -28861,7 +29092,7 @@ function getDefaultLetterSpacings() {
28861
29092
  }
28862
29093
 
28863
29094
  // src/components/UEditor/toolbar.tsx
28864
- import { Fragment as Fragment28, jsx as jsx85, jsxs as jsxs71 } from "react/jsx-runtime";
29095
+ import { Fragment as Fragment28, jsx as jsx86, jsxs as jsxs72 } from "react/jsx-runtime";
28865
29096
  function getTableAnchorPos(editor) {
28866
29097
  const tableInfo = findTableNodeInfoFromState(editor.state);
28867
29098
  if (tableInfo) return editor.state.selection.from;
@@ -28891,8 +29122,8 @@ function fileToDataUrl2(file) {
28891
29122
  function formatTableInsertLabel(template, rows, cols) {
28892
29123
  return template.replace("{rows}", String(rows)).replace("{cols}", String(cols));
28893
29124
  }
28894
- var ToolbarButton = React76.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
28895
- const button = /* @__PURE__ */ jsx85(
29125
+ var ToolbarButton = React77.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
29126
+ const button = /* @__PURE__ */ jsx86(
28896
29127
  "button",
28897
29128
  {
28898
29129
  ref,
@@ -28917,28 +29148,28 @@ var ToolbarButton = React76.forwardRef(({ onClick, onMouseDown, active, disabled
28917
29148
  }
28918
29149
  );
28919
29150
  if (title) {
28920
- return /* @__PURE__ */ jsx85(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
29151
+ return /* @__PURE__ */ jsx86(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
28921
29152
  }
28922
29153
  return button;
28923
29154
  });
28924
29155
  ToolbarButton.displayName = "ToolbarButton";
28925
- var ToolbarDivider = () => /* @__PURE__ */ jsx85("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
29156
+ var ToolbarDivider = () => /* @__PURE__ */ jsx86("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
28926
29157
  var TableInsertGrid = ({
28927
29158
  insertLabel,
28928
29159
  previewTemplate,
28929
29160
  onInsert
28930
29161
  }) => {
28931
- const [selection, setSelection] = React76.useState({ rows: 3, cols: 3 });
29162
+ const [selection, setSelection] = React77.useState({ rows: 3, cols: 3 });
28932
29163
  const maxRows = 8;
28933
29164
  const maxCols = 8;
28934
- return /* @__PURE__ */ jsxs71("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
28935
- /* @__PURE__ */ jsx85("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
28936
- /* @__PURE__ */ jsx85("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
29165
+ return /* @__PURE__ */ jsxs72("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
29166
+ /* @__PURE__ */ jsx86("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
29167
+ /* @__PURE__ */ jsx86("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
28937
29168
  (_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
28938
29169
  const rows = rowIndex + 1;
28939
29170
  const cols = colIndex + 1;
28940
29171
  const active = rows <= selection.rows && cols <= selection.cols;
28941
- return /* @__PURE__ */ jsx85(
29172
+ return /* @__PURE__ */ jsx86(
28942
29173
  "button",
28943
29174
  {
28944
29175
  type: "button",
@@ -28956,7 +29187,7 @@ var TableInsertGrid = ({
28956
29187
  );
28957
29188
  })
28958
29189
  ) }),
28959
- /* @__PURE__ */ jsx85("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
29190
+ /* @__PURE__ */ jsx86("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
28960
29191
  ] });
28961
29192
  };
28962
29193
  var EditorToolbar = ({
@@ -29004,10 +29235,10 @@ var EditorToolbar = ({
29004
29235
  const currentHighlightColor = normalizeStyleValue(editor.getAttributes("highlight").color) || "";
29005
29236
  const currentLineHeight = normalizeStyleValue(textStyleAttrs.lineHeight);
29006
29237
  const currentLetterSpacing = normalizeStyleValue(textStyleAttrs.letterSpacing);
29007
- const availableFontFamilies = React76.useMemo(() => fontFamilies ?? getDefaultFontFamilies(t), [fontFamilies, t]);
29008
- const availableFontSizes = React76.useMemo(() => fontSizes ?? getDefaultFontSizes(), [fontSizes]);
29009
- const availableLineHeights = React76.useMemo(() => lineHeights ?? getDefaultLineHeights(), [lineHeights]);
29010
- const availableLetterSpacings = React76.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
29238
+ const availableFontFamilies = React77.useMemo(() => fontFamilies ?? getDefaultFontFamilies(t), [fontFamilies, t]);
29239
+ const availableFontSizes = React77.useMemo(() => fontSizes ?? getDefaultFontSizes(), [fontSizes]);
29240
+ const availableLineHeights = React77.useMemo(() => lineHeights ?? getDefaultLineHeights(), [lineHeights]);
29241
+ const availableLetterSpacings = React77.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
29011
29242
  const currentFontFamilyDisplayValue = currentFontFamily.split(",")[0]?.trim() ?? currentFontFamily;
29012
29243
  const currentFontFamilyLabel = availableFontFamilies.find((option) => normalizeStyleValue(option.value) === currentFontFamily)?.label ?? (currentFontFamilyDisplayValue || t("toolbar.fontDefault"));
29013
29244
  const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? t("toolbar.sizeDefault");
@@ -29036,32 +29267,32 @@ var EditorToolbar = ({
29036
29267
  setIsUploadingImage(false);
29037
29268
  };
29038
29269
  if (variant === "minimal") {
29039
- return /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-1 border-b border-border/35 bg-muted/30 p-2", children: [
29040
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx85(BoldIcon, { className: "w-4 h-4" }) }),
29041
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx85(ItalicIcon, { className: "w-4 h-4" }) }),
29042
- /* @__PURE__ */ jsx85(
29270
+ return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-1 border-b border-border/35 bg-muted/30 p-2", children: [
29271
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx86(BoldIcon, { className: "w-4 h-4" }) }),
29272
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx86(ItalicIcon, { className: "w-4 h-4" }) }),
29273
+ /* @__PURE__ */ jsx86(
29043
29274
  ToolbarButton,
29044
29275
  {
29045
29276
  onClick: () => editor.chain().focus().toggleBulletList().run(),
29046
29277
  active: editor.isActive("bulletList"),
29047
29278
  title: t("toolbar.bulletList"),
29048
- children: /* @__PURE__ */ jsx85(ListIcon, { className: "w-4 h-4" })
29279
+ children: /* @__PURE__ */ jsx86(ListIcon, { className: "w-4 h-4" })
29049
29280
  }
29050
29281
  )
29051
29282
  ] });
29052
29283
  }
29053
- return /* @__PURE__ */ jsxs71("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-linear-to-r from-muted/25 to-transparent p-1.5", children: [
29054
- /* @__PURE__ */ jsxs71(
29284
+ return /* @__PURE__ */ jsxs72("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-linear-to-r from-muted/25 to-transparent p-1.5", children: [
29285
+ /* @__PURE__ */ jsxs72(
29055
29286
  DropdownMenu,
29056
29287
  {
29057
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29288
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29058
29289
  }, title: t("toolbar.fontFamily"), className: "px-1.5 w-auto gap-0.5", children: [
29059
- /* @__PURE__ */ jsx85(Baseline, { className: "w-4 h-4" }),
29060
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29290
+ /* @__PURE__ */ jsx86(Baseline, { className: "w-4 h-4" }),
29291
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29061
29292
  ] }),
29062
29293
  contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
29063
29294
  children: [
29064
- /* @__PURE__ */ jsx85(
29295
+ /* @__PURE__ */ jsx86(
29065
29296
  DropdownMenuItem,
29066
29297
  {
29067
29298
  icon: Type2,
@@ -29070,7 +29301,7 @@ var EditorToolbar = ({
29070
29301
  active: !currentFontFamily
29071
29302
  }
29072
29303
  ),
29073
- availableFontFamilies.map((option) => /* @__PURE__ */ jsx85(
29304
+ availableFontFamilies.map((option) => /* @__PURE__ */ jsx86(
29074
29305
  DropdownMenuItem,
29075
29306
  {
29076
29307
  label: option.label,
@@ -29083,20 +29314,20 @@ var EditorToolbar = ({
29083
29314
  ]
29084
29315
  }
29085
29316
  ),
29086
- /* @__PURE__ */ jsxs71(
29317
+ /* @__PURE__ */ jsxs72(
29087
29318
  DropdownMenu,
29088
29319
  {
29089
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29320
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29090
29321
  }, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-0.5", children: [
29091
- /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-0.5", children: [
29092
- /* @__PURE__ */ jsx85(ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
29093
- /* @__PURE__ */ jsx85("span", { className: "text-xs font-bold leading-none", children: "A" })
29322
+ /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-0.5", children: [
29323
+ /* @__PURE__ */ jsx86(ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
29324
+ /* @__PURE__ */ jsx86("span", { className: "text-xs font-bold leading-none", children: "A" })
29094
29325
  ] }),
29095
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29326
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29096
29327
  ] }),
29097
29328
  contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
29098
29329
  children: [
29099
- /* @__PURE__ */ jsx85(
29330
+ /* @__PURE__ */ jsx86(
29100
29331
  DropdownMenuItem,
29101
29332
  {
29102
29333
  icon: Type2,
@@ -29105,7 +29336,7 @@ var EditorToolbar = ({
29105
29336
  active: !currentFontSize
29106
29337
  }
29107
29338
  ),
29108
- availableFontSizes.map((option) => /* @__PURE__ */ jsx85(
29339
+ availableFontSizes.map((option) => /* @__PURE__ */ jsx86(
29109
29340
  DropdownMenuItem,
29110
29341
  {
29111
29342
  label: option.label,
@@ -29117,17 +29348,17 @@ var EditorToolbar = ({
29117
29348
  ]
29118
29349
  }
29119
29350
  ),
29120
- /* @__PURE__ */ jsxs71(
29351
+ /* @__PURE__ */ jsxs72(
29121
29352
  DropdownMenu,
29122
29353
  {
29123
29354
  contentClassName: "p-1",
29124
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29355
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29125
29356
  }, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
29126
- /* @__PURE__ */ jsx85(Type2, { className: "w-4 h-4" }),
29127
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29357
+ /* @__PURE__ */ jsx86(Type2, { className: "w-4 h-4" }),
29358
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29128
29359
  ] }),
29129
29360
  children: [
29130
- /* @__PURE__ */ jsx85(
29361
+ /* @__PURE__ */ jsx86(
29131
29362
  DropdownMenuItem,
29132
29363
  {
29133
29364
  icon: Type2,
@@ -29136,7 +29367,7 @@ var EditorToolbar = ({
29136
29367
  active: editor.isActive("paragraph")
29137
29368
  }
29138
29369
  ),
29139
- /* @__PURE__ */ jsx85(
29370
+ /* @__PURE__ */ jsx86(
29140
29371
  DropdownMenuItem,
29141
29372
  {
29142
29373
  icon: Heading1Icon,
@@ -29146,7 +29377,7 @@ var EditorToolbar = ({
29146
29377
  shortcut: "Ctrl+Alt+1"
29147
29378
  }
29148
29379
  ),
29149
- /* @__PURE__ */ jsx85(
29380
+ /* @__PURE__ */ jsx86(
29150
29381
  DropdownMenuItem,
29151
29382
  {
29152
29383
  icon: Heading2Icon,
@@ -29156,7 +29387,7 @@ var EditorToolbar = ({
29156
29387
  shortcut: "Ctrl+Alt+2"
29157
29388
  }
29158
29389
  ),
29159
- /* @__PURE__ */ jsx85(
29390
+ /* @__PURE__ */ jsx86(
29160
29391
  DropdownMenuItem,
29161
29392
  {
29162
29393
  icon: Heading3Icon,
@@ -29169,17 +29400,17 @@ var EditorToolbar = ({
29169
29400
  ]
29170
29401
  }
29171
29402
  ),
29172
- /* @__PURE__ */ jsxs71(
29403
+ /* @__PURE__ */ jsxs72(
29173
29404
  DropdownMenu,
29174
29405
  {
29175
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29406
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29176
29407
  }, title: t("toolbar.lineHeight"), className: "gap-0.5", children: [
29177
- /* @__PURE__ */ jsx85(ArrowUp, { className: "w-3 h-3" }),
29178
- /* @__PURE__ */ jsx85(ArrowDown, { className: "w-3 h-3" })
29408
+ /* @__PURE__ */ jsx86(ArrowUp, { className: "w-3 h-3" }),
29409
+ /* @__PURE__ */ jsx86(ArrowDown, { className: "w-3 h-3" })
29179
29410
  ] }),
29180
29411
  contentClassName: "max-h-72 overflow-y-auto p-1",
29181
29412
  children: [
29182
- /* @__PURE__ */ jsx85(
29413
+ /* @__PURE__ */ jsx86(
29183
29414
  DropdownMenuItem,
29184
29415
  {
29185
29416
  icon: Type2,
@@ -29188,7 +29419,7 @@ var EditorToolbar = ({
29188
29419
  active: !currentLineHeight
29189
29420
  }
29190
29421
  ),
29191
- availableLineHeights.map((option) => /* @__PURE__ */ jsx85(
29422
+ availableLineHeights.map((option) => /* @__PURE__ */ jsx86(
29192
29423
  DropdownMenuItem,
29193
29424
  {
29194
29425
  label: option.label,
@@ -29200,17 +29431,17 @@ var EditorToolbar = ({
29200
29431
  ]
29201
29432
  }
29202
29433
  ),
29203
- /* @__PURE__ */ jsxs71(
29434
+ /* @__PURE__ */ jsxs72(
29204
29435
  DropdownMenu,
29205
29436
  {
29206
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29437
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29207
29438
  }, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: [
29208
- /* @__PURE__ */ jsx85(ArrowLeft, { className: "w-3 h-3" }),
29209
- /* @__PURE__ */ jsx85(ArrowRight, { className: "w-3 h-3" })
29439
+ /* @__PURE__ */ jsx86(ArrowLeft, { className: "w-3 h-3" }),
29440
+ /* @__PURE__ */ jsx86(ArrowRight, { className: "w-3 h-3" })
29210
29441
  ] }),
29211
29442
  contentClassName: "max-h-72 overflow-y-auto p-1",
29212
29443
  children: [
29213
- /* @__PURE__ */ jsx85(
29444
+ /* @__PURE__ */ jsx86(
29214
29445
  DropdownMenuItem,
29215
29446
  {
29216
29447
  icon: Type2,
@@ -29219,7 +29450,7 @@ var EditorToolbar = ({
29219
29450
  active: !currentLetterSpacing
29220
29451
  }
29221
29452
  ),
29222
- availableLetterSpacings.map((option) => /* @__PURE__ */ jsx85(
29453
+ availableLetterSpacings.map((option) => /* @__PURE__ */ jsx86(
29223
29454
  DropdownMenuItem,
29224
29455
  {
29225
29456
  label: option.label,
@@ -29231,44 +29462,44 @@ var EditorToolbar = ({
29231
29462
  ]
29232
29463
  }
29233
29464
  ),
29234
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29235
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx85(BoldIcon, { className: "w-4 h-4" }) }),
29236
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx85(ItalicIcon, { className: "w-4 h-4" }) }),
29237
- /* @__PURE__ */ jsx85(
29465
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
29466
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx86(BoldIcon, { className: "w-4 h-4" }) }),
29467
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx86(ItalicIcon, { className: "w-4 h-4" }) }),
29468
+ /* @__PURE__ */ jsx86(
29238
29469
  ToolbarButton,
29239
29470
  {
29240
29471
  onClick: () => editor.chain().focus().toggleUnderline().run(),
29241
29472
  active: editor.isActive("underline"),
29242
29473
  title: t("toolbar.underline"),
29243
- children: /* @__PURE__ */ jsx85(UnderlineIcon, { className: "w-4 h-4" })
29474
+ children: /* @__PURE__ */ jsx86(UnderlineIcon, { className: "w-4 h-4" })
29244
29475
  }
29245
29476
  ),
29246
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx85(StrikethroughIcon, { className: "w-4 h-4" }) }),
29247
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx85(CodeIcon, { className: "w-4 h-4" }) }),
29248
- /* @__PURE__ */ jsx85(
29477
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx86(StrikethroughIcon, { className: "w-4 h-4" }) }),
29478
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx86(CodeIcon, { className: "w-4 h-4" }) }),
29479
+ /* @__PURE__ */ jsx86(
29249
29480
  ToolbarButton,
29250
29481
  {
29251
29482
  onClick: () => editor.chain().focus().toggleSubscript().run(),
29252
29483
  active: editor.isActive("subscript"),
29253
29484
  title: t("toolbar.subscript"),
29254
- children: /* @__PURE__ */ jsx85(SubscriptIcon, { className: "w-4 h-4" })
29485
+ children: /* @__PURE__ */ jsx86(SubscriptIcon, { className: "w-4 h-4" })
29255
29486
  }
29256
29487
  ),
29257
- /* @__PURE__ */ jsx85(
29488
+ /* @__PURE__ */ jsx86(
29258
29489
  ToolbarButton,
29259
29490
  {
29260
29491
  onClick: () => editor.chain().focus().toggleSuperscript().run(),
29261
29492
  active: editor.isActive("superscript"),
29262
29493
  title: t("toolbar.superscript"),
29263
- children: /* @__PURE__ */ jsx85(SuperscriptIcon, { className: "w-4 h-4" })
29494
+ children: /* @__PURE__ */ jsx86(SuperscriptIcon, { className: "w-4 h-4" })
29264
29495
  }
29265
29496
  ),
29266
- /* @__PURE__ */ jsx85(
29497
+ /* @__PURE__ */ jsx86(
29267
29498
  DropdownMenu,
29268
29499
  {
29269
29500
  contentClassName: "min-w-72",
29270
- trigger: /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx85(LinkIcon, { className: "w-4 h-4" }) }),
29271
- children: showLinkInput ? /* @__PURE__ */ jsx85(
29501
+ trigger: /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx86(LinkIcon, { className: "w-4 h-4" }) }),
29502
+ children: showLinkInput ? /* @__PURE__ */ jsx86(
29272
29503
  LinkInput,
29273
29504
  {
29274
29505
  initialUrl: String(editor.getAttributes("link").href ?? ""),
@@ -29278,8 +29509,8 @@ var EditorToolbar = ({
29278
29509
  },
29279
29510
  onCancel: () => setShowLinkInput(false)
29280
29511
  }
29281
- ) : /* @__PURE__ */ jsxs71(Fragment28, { children: [
29282
- /* @__PURE__ */ jsx85(
29512
+ ) : /* @__PURE__ */ jsxs72(Fragment28, { children: [
29513
+ /* @__PURE__ */ jsx86(
29283
29514
  DropdownMenuItem,
29284
29515
  {
29285
29516
  icon: LinkIcon,
@@ -29289,7 +29520,7 @@ var EditorToolbar = ({
29289
29520
  closeOnSelect: false
29290
29521
  }
29291
29522
  ),
29292
- /* @__PURE__ */ jsx85(
29523
+ /* @__PURE__ */ jsx86(
29293
29524
  DropdownMenuItem,
29294
29525
  {
29295
29526
  icon: Trash22,
@@ -29302,16 +29533,16 @@ var EditorToolbar = ({
29302
29533
  ] })
29303
29534
  }
29304
29535
  ),
29305
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29306
- /* @__PURE__ */ jsx85(
29536
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
29537
+ /* @__PURE__ */ jsx86(
29307
29538
  DropdownMenu,
29308
29539
  {
29309
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29540
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29310
29541
  }, title: t("colors.textColor"), children: [
29311
- /* @__PURE__ */ jsx85(TextColorIcon, { color: currentTextColor }),
29312
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29542
+ /* @__PURE__ */ jsx86(TextColorIcon, { color: currentTextColor }),
29543
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29313
29544
  ] }),
29314
- children: /* @__PURE__ */ jsx85(
29545
+ children: /* @__PURE__ */ jsx86(
29315
29546
  EditorColorPalette,
29316
29547
  {
29317
29548
  colors: textColors,
@@ -29328,15 +29559,15 @@ var EditorToolbar = ({
29328
29559
  )
29329
29560
  }
29330
29561
  ),
29331
- /* @__PURE__ */ jsx85(
29562
+ /* @__PURE__ */ jsx86(
29332
29563
  DropdownMenu,
29333
29564
  {
29334
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29565
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29335
29566
  }, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
29336
- /* @__PURE__ */ jsx85(HighlightColorIcon, { color: currentHighlightColor }),
29337
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29567
+ /* @__PURE__ */ jsx86(HighlightColorIcon, { color: currentHighlightColor }),
29568
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29338
29569
  ] }),
29339
- children: /* @__PURE__ */ jsx85(
29570
+ children: /* @__PURE__ */ jsx86(
29340
29571
  EditorColorPalette,
29341
29572
  {
29342
29573
  colors: highlightColors,
@@ -29353,14 +29584,14 @@ var EditorToolbar = ({
29353
29584
  )
29354
29585
  }
29355
29586
  ),
29356
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29357
- /* @__PURE__ */ jsx85(
29587
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
29588
+ /* @__PURE__ */ jsx86(
29358
29589
  DropdownMenu,
29359
29590
  {
29360
29591
  contentClassName: "p-0 overflow-hidden",
29361
- trigger: /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => {
29362
- }, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx85(Smile3, { className: "w-4 h-4" }) }),
29363
- children: /* @__PURE__ */ jsx85(
29592
+ trigger: /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => {
29593
+ }, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx86(Smile3, { className: "w-4 h-4" }) }),
29594
+ children: /* @__PURE__ */ jsx86(
29364
29595
  EmojiPicker2,
29365
29596
  {
29366
29597
  onSelect: (emoji) => {
@@ -29370,17 +29601,17 @@ var EditorToolbar = ({
29370
29601
  )
29371
29602
  }
29372
29603
  ),
29373
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29374
- /* @__PURE__ */ jsxs71(
29604
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
29605
+ /* @__PURE__ */ jsxs72(
29375
29606
  DropdownMenu,
29376
29607
  {
29377
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29608
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29378
29609
  }, title: t("toolbar.alignment"), children: [
29379
- /* @__PURE__ */ jsx85(AlignLeft, { className: "w-4 h-4" }),
29380
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29610
+ /* @__PURE__ */ jsx86(AlignLeft, { className: "w-4 h-4" }),
29611
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29381
29612
  ] }),
29382
29613
  children: [
29383
- /* @__PURE__ */ jsx85(
29614
+ /* @__PURE__ */ jsx86(
29384
29615
  DropdownMenuItem,
29385
29616
  {
29386
29617
  icon: AlignLeft,
@@ -29389,7 +29620,7 @@ var EditorToolbar = ({
29389
29620
  active: editor.isActive({ textAlign: "left" })
29390
29621
  }
29391
29622
  ),
29392
- /* @__PURE__ */ jsx85(
29623
+ /* @__PURE__ */ jsx86(
29393
29624
  DropdownMenuItem,
29394
29625
  {
29395
29626
  icon: AlignCenter,
@@ -29398,7 +29629,7 @@ var EditorToolbar = ({
29398
29629
  active: editor.isActive({ textAlign: "center" })
29399
29630
  }
29400
29631
  ),
29401
- /* @__PURE__ */ jsx85(
29632
+ /* @__PURE__ */ jsx86(
29402
29633
  DropdownMenuItem,
29403
29634
  {
29404
29635
  icon: AlignRight,
@@ -29407,7 +29638,7 @@ var EditorToolbar = ({
29407
29638
  active: editor.isActive({ textAlign: "right" })
29408
29639
  }
29409
29640
  ),
29410
- /* @__PURE__ */ jsx85(
29641
+ /* @__PURE__ */ jsx86(
29411
29642
  DropdownMenuItem,
29412
29643
  {
29413
29644
  icon: AlignJustify,
@@ -29419,17 +29650,17 @@ var EditorToolbar = ({
29419
29650
  ]
29420
29651
  }
29421
29652
  ),
29422
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29423
- /* @__PURE__ */ jsxs71(
29653
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
29654
+ /* @__PURE__ */ jsxs72(
29424
29655
  DropdownMenu,
29425
29656
  {
29426
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29657
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29427
29658
  }, title: t("toolbar.bulletList"), children: [
29428
- /* @__PURE__ */ jsx85(ListIcon, { className: "w-4 h-4" }),
29429
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29659
+ /* @__PURE__ */ jsx86(ListIcon, { className: "w-4 h-4" }),
29660
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29430
29661
  ] }),
29431
29662
  children: [
29432
- /* @__PURE__ */ jsx85(
29663
+ /* @__PURE__ */ jsx86(
29433
29664
  DropdownMenuItem,
29434
29665
  {
29435
29666
  icon: ListIcon,
@@ -29439,7 +29670,7 @@ var EditorToolbar = ({
29439
29670
  shortcut: "Ctrl+Shift+8"
29440
29671
  }
29441
29672
  ),
29442
- /* @__PURE__ */ jsx85(
29673
+ /* @__PURE__ */ jsx86(
29443
29674
  DropdownMenuItem,
29444
29675
  {
29445
29676
  icon: ListOrderedIcon,
@@ -29449,7 +29680,7 @@ var EditorToolbar = ({
29449
29680
  shortcut: "Ctrl+Shift+7"
29450
29681
  }
29451
29682
  ),
29452
- /* @__PURE__ */ jsx85(
29683
+ /* @__PURE__ */ jsx86(
29453
29684
  DropdownMenuItem,
29454
29685
  {
29455
29686
  icon: ListTodo2,
@@ -29462,16 +29693,16 @@ var EditorToolbar = ({
29462
29693
  ]
29463
29694
  }
29464
29695
  ),
29465
- /* @__PURE__ */ jsxs71(
29696
+ /* @__PURE__ */ jsxs72(
29466
29697
  DropdownMenu,
29467
29698
  {
29468
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29699
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29469
29700
  }, title: t("toolbar.quote"), children: [
29470
- /* @__PURE__ */ jsx85(QuoteIcon, { className: "w-4 h-4" }),
29471
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29701
+ /* @__PURE__ */ jsx86(QuoteIcon, { className: "w-4 h-4" }),
29702
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29472
29703
  ] }),
29473
29704
  children: [
29474
- /* @__PURE__ */ jsx85(
29705
+ /* @__PURE__ */ jsx86(
29475
29706
  DropdownMenuItem,
29476
29707
  {
29477
29708
  icon: QuoteIcon,
@@ -29481,7 +29712,7 @@ var EditorToolbar = ({
29481
29712
  shortcut: "Ctrl+Shift+B"
29482
29713
  }
29483
29714
  ),
29484
- /* @__PURE__ */ jsx85(
29715
+ /* @__PURE__ */ jsx86(
29485
29716
  DropdownMenuItem,
29486
29717
  {
29487
29718
  icon: FileCode3,
@@ -29494,15 +29725,15 @@ var EditorToolbar = ({
29494
29725
  ]
29495
29726
  }
29496
29727
  ),
29497
- /* @__PURE__ */ jsx85(
29728
+ /* @__PURE__ */ jsx86(
29498
29729
  DropdownMenu,
29499
29730
  {
29500
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29731
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29501
29732
  }, title: t("toolbar.image"), children: [
29502
- /* @__PURE__ */ jsx85(ImageIcon2, { className: "w-4 h-4" }),
29503
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29733
+ /* @__PURE__ */ jsx86(ImageIcon2, { className: "w-4 h-4" }),
29734
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29504
29735
  ] }),
29505
- children: showImageInput ? /* @__PURE__ */ jsx85(
29736
+ children: showImageInput ? /* @__PURE__ */ jsx86(
29506
29737
  ImageInput,
29507
29738
  {
29508
29739
  onSubmit: (url, alt) => {
@@ -29511,9 +29742,9 @@ var EditorToolbar = ({
29511
29742
  },
29512
29743
  onCancel: () => setShowImageInput(false)
29513
29744
  }
29514
- ) : /* @__PURE__ */ jsxs71(Fragment28, { children: [
29515
- /* @__PURE__ */ jsx85(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
29516
- /* @__PURE__ */ jsx85(
29745
+ ) : /* @__PURE__ */ jsxs72(Fragment28, { children: [
29746
+ /* @__PURE__ */ jsx86(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
29747
+ /* @__PURE__ */ jsx86(
29517
29748
  DropdownMenuItem,
29518
29749
  {
29519
29750
  icon: Upload3,
@@ -29523,8 +29754,8 @@ var EditorToolbar = ({
29523
29754
  closeOnSelect: false
29524
29755
  }
29525
29756
  ),
29526
- imageUploadError && /* @__PURE__ */ jsx85(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
29527
- /* @__PURE__ */ jsx85(
29757
+ imageUploadError && /* @__PURE__ */ jsx86(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
29758
+ /* @__PURE__ */ jsx86(
29528
29759
  "input",
29529
29760
  {
29530
29761
  ref: fileInputRef,
@@ -29539,8 +29770,8 @@ var EditorToolbar = ({
29539
29770
  }
29540
29771
  }
29541
29772
  ),
29542
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29543
- /* @__PURE__ */ jsx85(
29773
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29774
+ /* @__PURE__ */ jsx86(
29544
29775
  DropdownMenuItem,
29545
29776
  {
29546
29777
  icon: AlignCenter,
@@ -29550,7 +29781,7 @@ var EditorToolbar = ({
29550
29781
  disabled: !isImageSelected
29551
29782
  }
29552
29783
  ),
29553
- /* @__PURE__ */ jsx85(
29784
+ /* @__PURE__ */ jsx86(
29554
29785
  DropdownMenuItem,
29555
29786
  {
29556
29787
  icon: AlignLeft,
@@ -29560,7 +29791,7 @@ var EditorToolbar = ({
29560
29791
  disabled: !isImageSelected
29561
29792
  }
29562
29793
  ),
29563
- /* @__PURE__ */ jsx85(
29794
+ /* @__PURE__ */ jsx86(
29564
29795
  DropdownMenuItem,
29565
29796
  {
29566
29797
  icon: AlignRight,
@@ -29570,8 +29801,8 @@ var EditorToolbar = ({
29570
29801
  disabled: !isImageSelected
29571
29802
  }
29572
29803
  ),
29573
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29574
- /* @__PURE__ */ jsx85(
29804
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29805
+ /* @__PURE__ */ jsx86(
29575
29806
  DropdownMenuItem,
29576
29807
  {
29577
29808
  label: t("toolbar.imageWidthSm"),
@@ -29580,7 +29811,7 @@ var EditorToolbar = ({
29580
29811
  disabled: !isImageSelected
29581
29812
  }
29582
29813
  ),
29583
- /* @__PURE__ */ jsx85(
29814
+ /* @__PURE__ */ jsx86(
29584
29815
  DropdownMenuItem,
29585
29816
  {
29586
29817
  label: t("toolbar.imageWidthMd"),
@@ -29589,7 +29820,7 @@ var EditorToolbar = ({
29589
29820
  disabled: !isImageSelected
29590
29821
  }
29591
29822
  ),
29592
- /* @__PURE__ */ jsx85(
29823
+ /* @__PURE__ */ jsx86(
29593
29824
  DropdownMenuItem,
29594
29825
  {
29595
29826
  label: t("toolbar.imageWidthLg"),
@@ -29598,8 +29829,8 @@ var EditorToolbar = ({
29598
29829
  disabled: !isImageSelected
29599
29830
  }
29600
29831
  ),
29601
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29602
- /* @__PURE__ */ jsx85(
29832
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29833
+ /* @__PURE__ */ jsx86(
29603
29834
  DropdownMenuItem,
29604
29835
  {
29605
29836
  icon: RotateCcw2,
@@ -29608,7 +29839,7 @@ var EditorToolbar = ({
29608
29839
  disabled: !isImageSelected
29609
29840
  }
29610
29841
  ),
29611
- /* @__PURE__ */ jsx85(
29842
+ /* @__PURE__ */ jsx86(
29612
29843
  DropdownMenuItem,
29613
29844
  {
29614
29845
  icon: Trash22,
@@ -29621,7 +29852,7 @@ var EditorToolbar = ({
29621
29852
  ] })
29622
29853
  }
29623
29854
  ),
29624
- /* @__PURE__ */ jsxs71(
29855
+ /* @__PURE__ */ jsxs72(
29625
29856
  DropdownMenu,
29626
29857
  {
29627
29858
  isOpen: isTableMenuOpen,
@@ -29629,14 +29860,14 @@ var EditorToolbar = ({
29629
29860
  setIsTableMenuOpen(open);
29630
29861
  tableCommandAnchorPosRef.current = open ? getTableAnchorPos(editor) : null;
29631
29862
  },
29632
- trigger: /* @__PURE__ */ jsxs71(ToolbarButton, { onClick: () => {
29863
+ trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
29633
29864
  }, title: t("toolbar.table"), children: [
29634
- /* @__PURE__ */ jsx85(TableIcon, { className: "w-4 h-4" }),
29635
- /* @__PURE__ */ jsx85(ChevronDown8, { className: "w-3 h-3" })
29865
+ /* @__PURE__ */ jsx86(TableIcon, { className: "w-4 h-4" }),
29866
+ /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
29636
29867
  ] }),
29637
29868
  contentClassName: "p-2 min-w-56",
29638
29869
  children: [
29639
- /* @__PURE__ */ jsx85(
29870
+ /* @__PURE__ */ jsx86(
29640
29871
  TableInsertGrid,
29641
29872
  {
29642
29873
  insertLabel: t("tableMenu.insertTable"),
@@ -29647,8 +29878,8 @@ var EditorToolbar = ({
29647
29878
  }
29648
29879
  }
29649
29880
  ),
29650
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29651
- /* @__PURE__ */ jsx85(
29881
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29882
+ /* @__PURE__ */ jsx86(
29652
29883
  DropdownMenuItem,
29653
29884
  {
29654
29885
  icon: AlignLeft,
@@ -29658,7 +29889,7 @@ var EditorToolbar = ({
29658
29889
  disabled: !hasTableContext
29659
29890
  }
29660
29891
  ),
29661
- /* @__PURE__ */ jsx85(
29892
+ /* @__PURE__ */ jsx86(
29662
29893
  DropdownMenuItem,
29663
29894
  {
29664
29895
  icon: AlignCenter,
@@ -29668,7 +29899,7 @@ var EditorToolbar = ({
29668
29899
  disabled: !hasTableContext
29669
29900
  }
29670
29901
  ),
29671
- /* @__PURE__ */ jsx85(
29902
+ /* @__PURE__ */ jsx86(
29672
29903
  DropdownMenuItem,
29673
29904
  {
29674
29905
  icon: AlignRight,
@@ -29678,8 +29909,8 @@ var EditorToolbar = ({
29678
29909
  disabled: !hasTableContext
29679
29910
  }
29680
29911
  ),
29681
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29682
- /* @__PURE__ */ jsx85(
29912
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29913
+ /* @__PURE__ */ jsx86(
29683
29914
  DropdownMenuItem,
29684
29915
  {
29685
29916
  icon: ArrowLeft,
@@ -29688,7 +29919,7 @@ var EditorToolbar = ({
29688
29919
  disabled: !hasTableContext || !editor.can().addColumnBefore()
29689
29920
  }
29690
29921
  ),
29691
- /* @__PURE__ */ jsx85(
29922
+ /* @__PURE__ */ jsx86(
29692
29923
  DropdownMenuItem,
29693
29924
  {
29694
29925
  icon: ArrowDown,
@@ -29697,7 +29928,7 @@ var EditorToolbar = ({
29697
29928
  disabled: !hasTableContext || !editor.can().addColumnAfter()
29698
29929
  }
29699
29930
  ),
29700
- /* @__PURE__ */ jsx85(
29931
+ /* @__PURE__ */ jsx86(
29701
29932
  DropdownMenuItem,
29702
29933
  {
29703
29934
  icon: ArrowUp,
@@ -29706,7 +29937,7 @@ var EditorToolbar = ({
29706
29937
  disabled: !hasTableContext || !editor.can().addRowBefore()
29707
29938
  }
29708
29939
  ),
29709
- /* @__PURE__ */ jsx85(
29940
+ /* @__PURE__ */ jsx86(
29710
29941
  DropdownMenuItem,
29711
29942
  {
29712
29943
  icon: ArrowRight,
@@ -29715,8 +29946,8 @@ var EditorToolbar = ({
29715
29946
  disabled: !hasTableContext || !editor.can().addRowAfter()
29716
29947
  }
29717
29948
  ),
29718
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29719
- /* @__PURE__ */ jsx85(
29949
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29950
+ /* @__PURE__ */ jsx86(
29720
29951
  DropdownMenuItem,
29721
29952
  {
29722
29953
  icon: TableIcon,
@@ -29725,7 +29956,7 @@ var EditorToolbar = ({
29725
29956
  disabled: !hasTableContext || !editor.can().toggleHeaderRow()
29726
29957
  }
29727
29958
  ),
29728
- /* @__PURE__ */ jsx85(
29959
+ /* @__PURE__ */ jsx86(
29729
29960
  DropdownMenuItem,
29730
29961
  {
29731
29962
  icon: TableIcon,
@@ -29734,8 +29965,8 @@ var EditorToolbar = ({
29734
29965
  disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
29735
29966
  }
29736
29967
  ),
29737
- /* @__PURE__ */ jsx85("div", { className: "my-1 border-t" }),
29738
- /* @__PURE__ */ jsx85(
29968
+ /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
29969
+ /* @__PURE__ */ jsx86(
29739
29970
  DropdownMenuItem,
29740
29971
  {
29741
29972
  icon: Trash22,
@@ -29744,7 +29975,7 @@ var EditorToolbar = ({
29744
29975
  disabled: !hasTableContext || !editor.can().deleteColumn()
29745
29976
  }
29746
29977
  ),
29747
- /* @__PURE__ */ jsx85(
29978
+ /* @__PURE__ */ jsx86(
29748
29979
  DropdownMenuItem,
29749
29980
  {
29750
29981
  icon: Trash22,
@@ -29753,7 +29984,7 @@ var EditorToolbar = ({
29753
29984
  disabled: !hasTableContext || !editor.can().deleteRow()
29754
29985
  }
29755
29986
  ),
29756
- /* @__PURE__ */ jsx85(
29987
+ /* @__PURE__ */ jsx86(
29757
29988
  DropdownMenuItem,
29758
29989
  {
29759
29990
  icon: Trash22,
@@ -29765,48 +29996,48 @@ var EditorToolbar = ({
29765
29996
  ]
29766
29997
  }
29767
29998
  ),
29768
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29769
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx85(UndoIcon, { className: "w-4 h-4" }) }),
29770
- /* @__PURE__ */ jsx85(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx85(RedoIcon, { className: "w-4 h-4" }) }),
29771
- hasTableContext && /* @__PURE__ */ jsxs71(Fragment28, { children: [
29772
- /* @__PURE__ */ jsx85(ToolbarDivider, {}),
29773
- /* @__PURE__ */ jsx85(
29999
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30000
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx86(UndoIcon, { className: "w-4 h-4" }) }),
30001
+ /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx86(RedoIcon, { className: "w-4 h-4" }) }),
30002
+ hasTableContext && /* @__PURE__ */ jsxs72(Fragment28, { children: [
30003
+ /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30004
+ /* @__PURE__ */ jsx86(
29774
30005
  ToolbarButton,
29775
30006
  {
29776
30007
  onClick: () => editor.chain().focus().addColumnBefore().run(),
29777
30008
  disabled: !editor.can().addColumnBefore(),
29778
30009
  title: t("tableMenu.addColumnBefore"),
29779
- children: /* @__PURE__ */ jsx85(ArrowLeft, { className: "w-4 h-4" })
30010
+ children: /* @__PURE__ */ jsx86(ArrowLeft, { className: "w-4 h-4" })
29780
30011
  }
29781
30012
  ),
29782
- /* @__PURE__ */ jsx85(
30013
+ /* @__PURE__ */ jsx86(
29783
30014
  ToolbarButton,
29784
30015
  {
29785
30016
  onClick: () => editor.chain().focus().addColumnAfter().run(),
29786
30017
  disabled: !editor.can().addColumnAfter(),
29787
30018
  title: t("tableMenu.addColumnAfter"),
29788
- children: /* @__PURE__ */ jsx85(ArrowRight, { className: "w-4 h-4" })
30019
+ children: /* @__PURE__ */ jsx86(ArrowRight, { className: "w-4 h-4" })
29789
30020
  }
29790
30021
  ),
29791
- /* @__PURE__ */ jsx85(
30022
+ /* @__PURE__ */ jsx86(
29792
30023
  ToolbarButton,
29793
30024
  {
29794
30025
  onClick: () => editor.chain().focus().addRowBefore().run(),
29795
30026
  disabled: !editor.can().addRowBefore(),
29796
30027
  title: t("tableMenu.addRowBefore"),
29797
- children: /* @__PURE__ */ jsx85(ArrowUp, { className: "w-4 h-4" })
30028
+ children: /* @__PURE__ */ jsx86(ArrowUp, { className: "w-4 h-4" })
29798
30029
  }
29799
30030
  ),
29800
- /* @__PURE__ */ jsx85(
30031
+ /* @__PURE__ */ jsx86(
29801
30032
  ToolbarButton,
29802
30033
  {
29803
30034
  onClick: () => editor.chain().focus().addRowAfter().run(),
29804
30035
  disabled: !editor.can().addRowAfter(),
29805
30036
  title: t("tableMenu.addRowAfter"),
29806
- children: /* @__PURE__ */ jsx85(ArrowDown, { className: "w-4 h-4" })
30037
+ children: /* @__PURE__ */ jsx86(ArrowDown, { className: "w-4 h-4" })
29807
30038
  }
29808
30039
  ),
29809
- /* @__PURE__ */ jsx85(
30040
+ /* @__PURE__ */ jsx86(
29810
30041
  ToolbarButton,
29811
30042
  {
29812
30043
  onClick: () => {
@@ -29819,7 +30050,7 @@ var EditorToolbar = ({
29819
30050
  active: canSplitCell,
29820
30051
  disabled: !canMergeCells && !canSplitCell,
29821
30052
  title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
29822
- children: /* @__PURE__ */ jsx85(TableCellsMerge, { className: "w-4 h-4" })
30053
+ children: /* @__PURE__ */ jsx86(TableCellsMerge, { className: "w-4 h-4" })
29823
30054
  }
29824
30055
  )
29825
30056
  ] })
@@ -29852,7 +30083,7 @@ import {
29852
30083
  Edit2,
29853
30084
  Unlink,
29854
30085
  ExternalLink as ExternalLink3,
29855
- Sigma
30086
+ Sigma as Sigma2
29856
30087
  } from "lucide-react";
29857
30088
 
29858
30089
  // src/components/UEditor/table-formula-commands.ts
@@ -29930,6 +30161,20 @@ function getTableCellRangeLabels(range) {
29930
30161
  function normalizeTableFormula(formula) {
29931
30162
  return formula.trim().replace(/^=/, "").trim();
29932
30163
  }
30164
+ function isDraftTableFormula(formula) {
30165
+ const normalized = normalizeTableFormula(formula);
30166
+ if (!normalized) return true;
30167
+ let depth = 0;
30168
+ for (const char of normalized) {
30169
+ if (char === "(") depth += 1;
30170
+ if (char === ")") depth -= 1;
30171
+ if (depth < 0) return false;
30172
+ }
30173
+ if (depth > 0) return true;
30174
+ if (/^[A-Z]+\(\s*\)$/i.test(normalized)) return true;
30175
+ if (/[+\-*/,(]\s*$/.test(normalized)) return true;
30176
+ return false;
30177
+ }
29933
30178
  function formatFormulaError(error) {
29934
30179
  return `#${error.toUpperCase()}`;
29935
30180
  }
@@ -30389,18 +30634,54 @@ function promoteFormulaTextInTableNode(tableNode) {
30389
30634
  const cells = collectChildren2(rowInfo.node);
30390
30635
  for (const entry of rowInfo.cells) {
30391
30636
  const text = getCellText(entry.node);
30392
- const formula = text.startsWith("=") ? normalizeFormulaInput(text) : "";
30393
- if (!formula || entry.node.attrs.formula === formula) continue;
30394
- cells[entry.index] = entry.node.type.create(
30395
- {
30396
- ...entry.node.attrs,
30397
- formula,
30398
- computedValue: null
30399
- },
30400
- entry.node.content,
30401
- entry.node.marks
30402
- );
30403
- changed = true;
30637
+ const existingFormula = typeof entry.node.attrs.formula === "string" ? entry.node.attrs.formula.trim() : "";
30638
+ const existingComputedValue = typeof entry.node.attrs.computedValue === "string" ? entry.node.attrs.computedValue.trim() : "";
30639
+ if (text.startsWith("=")) {
30640
+ if (!normalizeTableFormula(text)) {
30641
+ if (!existingFormula && !existingComputedValue) continue;
30642
+ cells[entry.index] = entry.node.type.create(
30643
+ {
30644
+ ...entry.node.attrs,
30645
+ formula: null,
30646
+ computedValue: null
30647
+ },
30648
+ text === formatFormulaError("empty") ? createCellDisplayContent(entry.node, "") : entry.node.content,
30649
+ entry.node.marks
30650
+ );
30651
+ changed = true;
30652
+ continue;
30653
+ }
30654
+ if (isDraftTableFormula(text)) {
30655
+ continue;
30656
+ }
30657
+ const formula = normalizeFormulaInput(text);
30658
+ if (entry.node.attrs.formula === formula) continue;
30659
+ cells[entry.index] = entry.node.type.create(
30660
+ {
30661
+ ...entry.node.attrs,
30662
+ formula,
30663
+ computedValue: null
30664
+ },
30665
+ entry.node.content,
30666
+ entry.node.marks
30667
+ );
30668
+ changed = true;
30669
+ continue;
30670
+ }
30671
+ if (existingFormula) {
30672
+ const isExistingEmptyFormula = !normalizeTableFormula(existingFormula);
30673
+ if (!isExistingEmptyFormula) continue;
30674
+ cells[entry.index] = entry.node.type.create(
30675
+ {
30676
+ ...entry.node.attrs,
30677
+ formula: null,
30678
+ computedValue: null
30679
+ },
30680
+ isExistingEmptyFormula && text === formatFormulaError("empty") ? createCellDisplayContent(entry.node, "") : entry.node.content,
30681
+ entry.node.marks
30682
+ );
30683
+ changed = true;
30684
+ }
30404
30685
  }
30405
30686
  return rowInfo.node.type.create(rowInfo.node.attrs, cells);
30406
30687
  });
@@ -30515,7 +30796,7 @@ function recalculateAllTableFormulas(editor) {
30515
30796
  }
30516
30797
 
30517
30798
  // src/components/UEditor/menus.tsx
30518
- import { Fragment as Fragment29, jsx as jsx86, jsxs as jsxs72 } from "react/jsx-runtime";
30799
+ import { Fragment as Fragment29, jsx as jsx87, jsxs as jsxs73 } from "react/jsx-runtime";
30519
30800
  function applyTableCellBackground(editor, color) {
30520
30801
  const value = color || null;
30521
30802
  const { state, view } = editor;
@@ -30604,7 +30885,7 @@ var BubbleMenuContent = ({
30604
30885
  };
30605
30886
  }, [editor, showLinkInput]);
30606
30887
  if (showLinkInput) {
30607
- return /* @__PURE__ */ jsx86(
30888
+ return /* @__PURE__ */ jsx87(
30608
30889
  LinkInput,
30609
30890
  {
30610
30891
  initialUrl: editor.getAttributes("link").href || "",
@@ -30627,11 +30908,11 @@ var BubbleMenuContent = ({
30627
30908
  const currentBorderStyle = editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || "solid";
30628
30909
  const currentBorderWidth = editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth || "1px";
30629
30910
  const currentBorderColor = editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || "currentColor";
30630
- return /* @__PURE__ */ jsxs72("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", children: [
30631
- /* @__PURE__ */ jsx86("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
30632
- /* @__PURE__ */ jsxs72("div", { className: "flex flex-col gap-1", children: [
30633
- /* @__PURE__ */ jsx86("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
30634
- /* @__PURE__ */ jsxs72(
30911
+ return /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", children: [
30912
+ /* @__PURE__ */ jsx87("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
30913
+ /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-1", children: [
30914
+ /* @__PURE__ */ jsx87("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
30915
+ /* @__PURE__ */ jsxs73(
30635
30916
  "select",
30636
30917
  {
30637
30918
  className: "flex h-8 w-full rounded-md border border-input bg-background px-2 py-1 text-xs ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
@@ -30641,18 +30922,18 @@ var BubbleMenuContent = ({
30641
30922
  editor.chain().focus().setCellAttribute("borderStyle", style).run();
30642
30923
  },
30643
30924
  children: [
30644
- /* @__PURE__ */ jsx86("option", { value: "solid", children: "Solid" }),
30645
- /* @__PURE__ */ jsx86("option", { value: "dashed", children: "Dashed" }),
30646
- /* @__PURE__ */ jsx86("option", { value: "dotted", children: "Dotted" }),
30647
- /* @__PURE__ */ jsx86("option", { value: "double", children: "Double" }),
30648
- /* @__PURE__ */ jsx86("option", { value: "none", children: "None" })
30925
+ /* @__PURE__ */ jsx87("option", { value: "solid", children: "Solid" }),
30926
+ /* @__PURE__ */ jsx87("option", { value: "dashed", children: "Dashed" }),
30927
+ /* @__PURE__ */ jsx87("option", { value: "dotted", children: "Dotted" }),
30928
+ /* @__PURE__ */ jsx87("option", { value: "double", children: "Double" }),
30929
+ /* @__PURE__ */ jsx87("option", { value: "none", children: "None" })
30649
30930
  ]
30650
30931
  }
30651
30932
  )
30652
30933
  ] }),
30653
- /* @__PURE__ */ jsxs72("div", { className: "flex flex-col gap-1", children: [
30654
- /* @__PURE__ */ jsx86("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
30655
- /* @__PURE__ */ jsxs72(
30934
+ /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-1", children: [
30935
+ /* @__PURE__ */ jsx87("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
30936
+ /* @__PURE__ */ jsxs73(
30656
30937
  "select",
30657
30938
  {
30658
30939
  className: "flex h-8 w-full rounded-md border border-input bg-background px-2 py-1 text-xs ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
@@ -30662,23 +30943,23 @@ var BubbleMenuContent = ({
30662
30943
  editor.chain().focus().setCellAttribute("borderWidth", width).run();
30663
30944
  },
30664
30945
  children: [
30665
- /* @__PURE__ */ jsx86("option", { value: "1px", children: "1px" }),
30666
- /* @__PURE__ */ jsx86("option", { value: "2px", children: "2px" }),
30667
- /* @__PURE__ */ jsx86("option", { value: "3px", children: "3px" }),
30668
- /* @__PURE__ */ jsx86("option", { value: "4px", children: "4px" })
30946
+ /* @__PURE__ */ jsx87("option", { value: "1px", children: "1px" }),
30947
+ /* @__PURE__ */ jsx87("option", { value: "2px", children: "2px" }),
30948
+ /* @__PURE__ */ jsx87("option", { value: "3px", children: "3px" }),
30949
+ /* @__PURE__ */ jsx87("option", { value: "4px", children: "4px" })
30669
30950
  ]
30670
30951
  }
30671
30952
  )
30672
30953
  ] }),
30673
- /* @__PURE__ */ jsxs72(
30954
+ /* @__PURE__ */ jsxs73(
30674
30955
  "button",
30675
30956
  {
30676
30957
  type: "button",
30677
30958
  onClick: () => setActiveColorPalette("cell-border-color"),
30678
30959
  className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
30679
30960
  children: [
30680
- /* @__PURE__ */ jsx86("span", { children: t("tableMenu.borderColor") || "Border Color" }),
30681
- /* @__PURE__ */ jsx86(
30961
+ /* @__PURE__ */ jsx87("span", { children: t("tableMenu.borderColor") || "Border Color" }),
30962
+ /* @__PURE__ */ jsx87(
30682
30963
  "span",
30683
30964
  {
30684
30965
  className: "w-4 h-4 rounded-full border border-border",
@@ -30690,8 +30971,8 @@ var BubbleMenuContent = ({
30690
30971
  ]
30691
30972
  }
30692
30973
  ),
30693
- /* @__PURE__ */ jsxs72("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: [
30694
- /* @__PURE__ */ jsx86(
30974
+ /* @__PURE__ */ jsxs73("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: [
30975
+ /* @__PURE__ */ jsx87(
30695
30976
  "button",
30696
30977
  {
30697
30978
  type: "button",
@@ -30703,7 +30984,7 @@ var BubbleMenuContent = ({
30703
30984
  children: t("tableMenu.clearBorder") || "Clear Border"
30704
30985
  }
30705
30986
  ),
30706
- /* @__PURE__ */ jsx86(
30987
+ /* @__PURE__ */ jsx87(
30707
30988
  "button",
30708
30989
  {
30709
30990
  type: "button",
@@ -30717,7 +30998,7 @@ var BubbleMenuContent = ({
30717
30998
  }
30718
30999
  if (activeColorPalette === "cell-border-color") {
30719
31000
  const currentBorderColor = normalizeStyleValue(editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor) || "";
30720
- return /* @__PURE__ */ jsx86("div", { className: "w-56", children: /* @__PURE__ */ jsx86(
31001
+ return /* @__PURE__ */ jsx87("div", { className: "w-56", children: /* @__PURE__ */ jsx87(
30721
31002
  EditorColorPalette,
30722
31003
  {
30723
31004
  colors: highlightColors,
@@ -30731,7 +31012,7 @@ var BubbleMenuContent = ({
30731
31012
  }
30732
31013
  ) });
30733
31014
  }
30734
- return /* @__PURE__ */ jsx86("div", { className: "w-56", children: /* @__PURE__ */ jsx86(
31015
+ return /* @__PURE__ */ jsx87("div", { className: "w-56", children: /* @__PURE__ */ jsx87(
30735
31016
  EditorColorPalette,
30736
31017
  {
30737
31018
  colors: isTextPalette ? textColors : highlightColors,
@@ -30759,32 +31040,32 @@ var BubbleMenuContent = ({
30759
31040
  ) });
30760
31041
  }
30761
31042
  if (isImageSelected) {
30762
- return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-0.5 p-1", children: [
30763
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx86(AlignCenter2, { className: "w-4 h-4" }) }),
30764
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx86(AlignLeft2, { className: "w-4 h-4" }) }),
30765
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx86(AlignRight2, { className: "w-4 h-4" }) }),
30766
- /* @__PURE__ */ jsx86("div", { className: "w-px h-6 bg-border/50 mx-1" }),
30767
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx86("span", { className: "text-[10px] font-semibold", children: "S" }) }),
30768
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx86("span", { className: "text-[10px] font-semibold", children: "M" }) }),
30769
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx86("span", { className: "text-[10px] font-semibold", children: "L" }) }),
30770
- /* @__PURE__ */ jsx86("div", { className: "w-px h-6 bg-border/50 mx-1" }),
30771
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx86(RotateCcw3, { className: "w-4 h-4" }) }),
30772
- /* @__PURE__ */ jsx86(
31043
+ return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5 p-1", children: [
31044
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx87(AlignCenter2, { className: "w-4 h-4" }) }),
31045
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx87(AlignLeft2, { className: "w-4 h-4" }) }),
31046
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx87(AlignRight2, { className: "w-4 h-4" }) }),
31047
+ /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31048
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "S" }) }),
31049
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "M" }) }),
31050
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "L" }) }),
31051
+ /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31052
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx87(RotateCcw3, { className: "w-4 h-4" }) }),
31053
+ /* @__PURE__ */ jsx87(
30773
31054
  ToolbarButton,
30774
31055
  {
30775
31056
  onClick: () => deleteSelectedImage(editor),
30776
31057
  title: t("toolbar.imageDelete"),
30777
31058
  className: "text-destructive hover:text-destructive",
30778
- children: /* @__PURE__ */ jsx86(Trash23, { className: "w-4 h-4" })
31059
+ children: /* @__PURE__ */ jsx87(Trash23, { className: "w-4 h-4" })
30779
31060
  }
30780
31061
  )
30781
31062
  ] });
30782
31063
  }
30783
31064
  if (showFormulaPanel && isInTable2) {
30784
- return /* @__PURE__ */ jsxs72("div", { className: "w-72 p-2", children: [
30785
- /* @__PURE__ */ jsxs72("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
30786
- /* @__PURE__ */ jsx86("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
30787
- /* @__PURE__ */ jsx86(
31065
+ return /* @__PURE__ */ jsxs73("div", { className: "w-72 p-2", children: [
31066
+ /* @__PURE__ */ jsxs73("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31067
+ /* @__PURE__ */ jsx87("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
31068
+ /* @__PURE__ */ jsx87(
30788
31069
  "button",
30789
31070
  {
30790
31071
  type: "button",
@@ -30797,7 +31078,7 @@ var BubbleMenuContent = ({
30797
31078
  }
30798
31079
  )
30799
31080
  ] }),
30800
- /* @__PURE__ */ jsx86("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx86(
31081
+ /* @__PURE__ */ jsx87("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx87(
30801
31082
  "input",
30802
31083
  {
30803
31084
  value: formulaDraft,
@@ -30818,15 +31099,15 @@ var BubbleMenuContent = ({
30818
31099
  className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
30819
31100
  }
30820
31101
  ) }),
30821
- /* @__PURE__ */ jsxs72("div", { className: "mt-2", children: [
30822
- /* @__PURE__ */ jsx86("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
30823
- /* @__PURE__ */ jsx86("div", { className: "grid grid-cols-5 gap-1", children: [
31102
+ /* @__PURE__ */ jsxs73("div", { className: "mt-2", children: [
31103
+ /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
31104
+ /* @__PURE__ */ jsx87("div", { className: "grid grid-cols-5 gap-1", children: [
30824
31105
  ["text", "Text"],
30825
31106
  ["number", "123"],
30826
31107
  ["currency", "$"],
30827
31108
  ["percent", "%"],
30828
31109
  ["date", "Date"]
30829
- ].map(([format, label]) => /* @__PURE__ */ jsx86(
31110
+ ].map(([format, label]) => /* @__PURE__ */ jsx87(
30830
31111
  "button",
30831
31112
  {
30832
31113
  type: "button",
@@ -30840,8 +31121,8 @@ var BubbleMenuContent = ({
30840
31121
  format
30841
31122
  )) })
30842
31123
  ] }),
30843
- /* @__PURE__ */ jsxs72("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
30844
- /* @__PURE__ */ jsx86(
31124
+ /* @__PURE__ */ jsxs73("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
31125
+ /* @__PURE__ */ jsx87(
30845
31126
  "button",
30846
31127
  {
30847
31128
  type: "button",
@@ -30854,7 +31135,7 @@ var BubbleMenuContent = ({
30854
31135
  children: t("tableMenu.apply") || "Apply"
30855
31136
  }
30856
31137
  ),
30857
- /* @__PURE__ */ jsx86(
31138
+ /* @__PURE__ */ jsx87(
30858
31139
  "button",
30859
31140
  {
30860
31141
  type: "button",
@@ -30866,7 +31147,7 @@ var BubbleMenuContent = ({
30866
31147
  children: t("tableMenu.clear") || "Clear"
30867
31148
  }
30868
31149
  ),
30869
- /* @__PURE__ */ jsx86(
31150
+ /* @__PURE__ */ jsx87(
30870
31151
  "button",
30871
31152
  {
30872
31153
  type: "button",
@@ -30879,10 +31160,10 @@ var BubbleMenuContent = ({
30879
31160
  ] });
30880
31161
  }
30881
31162
  if (showTypographyPanel) {
30882
- return /* @__PURE__ */ jsxs72("div", { className: "w-72 p-2", children: [
30883
- /* @__PURE__ */ jsxs72("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
30884
- /* @__PURE__ */ jsx86("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
30885
- /* @__PURE__ */ jsx86(
31163
+ return /* @__PURE__ */ jsxs73("div", { className: "w-72 p-2", children: [
31164
+ /* @__PURE__ */ jsxs73("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31165
+ /* @__PURE__ */ jsx87("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
31166
+ /* @__PURE__ */ jsx87(
30886
31167
  "button",
30887
31168
  {
30888
31169
  type: "button",
@@ -30892,11 +31173,11 @@ var BubbleMenuContent = ({
30892
31173
  }
30893
31174
  )
30894
31175
  ] }),
30895
- /* @__PURE__ */ jsxs72("div", { className: "space-y-2", children: [
30896
- /* @__PURE__ */ jsxs72("div", { children: [
30897
- /* @__PURE__ */ jsx86("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
30898
- /* @__PURE__ */ jsxs72("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
30899
- /* @__PURE__ */ jsx86(
31176
+ /* @__PURE__ */ jsxs73("div", { className: "space-y-2", children: [
31177
+ /* @__PURE__ */ jsxs73("div", { children: [
31178
+ /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
31179
+ /* @__PURE__ */ jsxs73("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
31180
+ /* @__PURE__ */ jsx87(
30900
31181
  "input",
30901
31182
  {
30902
31183
  type: "number",
@@ -30920,8 +31201,8 @@ var BubbleMenuContent = ({
30920
31201
  className: "h-full min-w-0 flex-1 bg-transparent px-2 text-center text-sm font-semibold text-foreground outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
30921
31202
  }
30922
31203
  ),
30923
- /* @__PURE__ */ jsx86("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
30924
- /* @__PURE__ */ jsx86(
31204
+ /* @__PURE__ */ jsx87("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
31205
+ /* @__PURE__ */ jsx87(
30925
31206
  "button",
30926
31207
  {
30927
31208
  type: "button",
@@ -30931,12 +31212,12 @@ var BubbleMenuContent = ({
30931
31212
  "flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
30932
31213
  showFontSizeOptions && "bg-primary/10 text-primary"
30933
31214
  ),
30934
- children: /* @__PURE__ */ jsx86(ChevronDown9, { className: "h-4 w-4" })
31215
+ children: /* @__PURE__ */ jsx87(ChevronDown9, { className: "h-4 w-4" })
30935
31216
  }
30936
31217
  )
30937
31218
  ] }),
30938
- showFontSizeOptions && /* @__PURE__ */ jsxs72("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
30939
- /* @__PURE__ */ jsx86(
31219
+ showFontSizeOptions && /* @__PURE__ */ jsxs73("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
31220
+ /* @__PURE__ */ jsx87(
30940
31221
  "button",
30941
31222
  {
30942
31223
  type: "button",
@@ -30951,7 +31232,7 @@ var BubbleMenuContent = ({
30951
31232
  children: "A"
30952
31233
  }
30953
31234
  ),
30954
- quickFontSizes.map((option) => /* @__PURE__ */ jsx86(
31235
+ quickFontSizes.map((option) => /* @__PURE__ */ jsx87(
30955
31236
  "button",
30956
31237
  {
30957
31238
  type: "button",
@@ -30969,10 +31250,10 @@ var BubbleMenuContent = ({
30969
31250
  ))
30970
31251
  ] })
30971
31252
  ] }),
30972
- /* @__PURE__ */ jsxs72("div", { children: [
30973
- /* @__PURE__ */ jsx86("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
30974
- /* @__PURE__ */ jsxs72("div", { className: "grid grid-cols-4 gap-1", children: [
30975
- /* @__PURE__ */ jsx86(
31253
+ /* @__PURE__ */ jsxs73("div", { children: [
31254
+ /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
31255
+ /* @__PURE__ */ jsxs73("div", { className: "grid grid-cols-4 gap-1", children: [
31256
+ /* @__PURE__ */ jsx87(
30976
31257
  "button",
30977
31258
  {
30978
31259
  type: "button",
@@ -30984,7 +31265,7 @@ var BubbleMenuContent = ({
30984
31265
  children: "LH"
30985
31266
  }
30986
31267
  ),
30987
- quickLineHeights.map((option) => /* @__PURE__ */ jsx86(
31268
+ quickLineHeights.map((option) => /* @__PURE__ */ jsx87(
30988
31269
  "button",
30989
31270
  {
30990
31271
  type: "button",
@@ -30999,8 +31280,8 @@ var BubbleMenuContent = ({
30999
31280
  ))
31000
31281
  ] })
31001
31282
  ] }),
31002
- /* @__PURE__ */ jsxs72("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
31003
- /* @__PURE__ */ jsxs72(
31283
+ /* @__PURE__ */ jsxs73("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
31284
+ /* @__PURE__ */ jsxs73(
31004
31285
  "button",
31005
31286
  {
31006
31287
  type: "button",
@@ -31010,12 +31291,12 @@ var BubbleMenuContent = ({
31010
31291
  editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31011
31292
  ),
31012
31293
  children: [
31013
- /* @__PURE__ */ jsx86(SubscriptIcon2, { className: "h-4 w-4" }),
31294
+ /* @__PURE__ */ jsx87(SubscriptIcon2, { className: "h-4 w-4" }),
31014
31295
  t("toolbar.subscript")
31015
31296
  ]
31016
31297
  }
31017
31298
  ),
31018
- /* @__PURE__ */ jsxs72(
31299
+ /* @__PURE__ */ jsxs73(
31019
31300
  "button",
31020
31301
  {
31021
31302
  type: "button",
@@ -31025,7 +31306,7 @@ var BubbleMenuContent = ({
31025
31306
  editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31026
31307
  ),
31027
31308
  children: [
31028
- /* @__PURE__ */ jsx86(SuperscriptIcon2, { className: "h-4 w-4" }),
31309
+ /* @__PURE__ */ jsx87(SuperscriptIcon2, { className: "h-4 w-4" }),
31029
31310
  t("toolbar.superscript")
31030
31311
  ]
31031
31312
  }
@@ -31034,22 +31315,22 @@ var BubbleMenuContent = ({
31034
31315
  ] })
31035
31316
  ] });
31036
31317
  }
31037
- return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-0.5 p-1", children: [
31038
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx86(BoldIcon2, { className: "w-4 h-4" }) }),
31039
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx86(ItalicIcon2, { className: "w-4 h-4" }) }),
31040
- /* @__PURE__ */ jsx86(
31318
+ return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5 p-1", children: [
31319
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx87(BoldIcon2, { className: "w-4 h-4" }) }),
31320
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx87(ItalicIcon2, { className: "w-4 h-4" }) }),
31321
+ /* @__PURE__ */ jsx87(
31041
31322
  ToolbarButton,
31042
31323
  {
31043
31324
  onClick: () => editor.chain().focus().toggleUnderline().run(),
31044
31325
  active: editor.isActive("underline"),
31045
31326
  title: t("toolbar.underline"),
31046
- children: /* @__PURE__ */ jsx86(UnderlineIcon2, { className: "w-4 h-4" })
31327
+ children: /* @__PURE__ */ jsx87(UnderlineIcon2, { className: "w-4 h-4" })
31047
31328
  }
31048
31329
  ),
31049
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx86(StrikethroughIcon2, { className: "w-4 h-4" }) }),
31050
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx86(CodeIcon2, { className: "w-4 h-4" }) }),
31051
- /* @__PURE__ */ jsx86("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31052
- /* @__PURE__ */ jsx86(
31330
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx87(StrikethroughIcon2, { className: "w-4 h-4" }) }),
31331
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx87(CodeIcon2, { className: "w-4 h-4" }) }),
31332
+ /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31333
+ /* @__PURE__ */ jsx87(
31053
31334
  ToolbarButton,
31054
31335
  {
31055
31336
  onMouseDown: () => {
@@ -31060,22 +31341,22 @@ var BubbleMenuContent = ({
31060
31341
  },
31061
31342
  active: editor.isActive("link"),
31062
31343
  title: t("toolbar.link"),
31063
- children: /* @__PURE__ */ jsx86(LinkIcon2, { className: "w-4 h-4" })
31344
+ children: /* @__PURE__ */ jsx87(LinkIcon2, { className: "w-4 h-4" })
31064
31345
  }
31065
31346
  ),
31066
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx86(TextColorIcon, { color: currentTextColor }) }),
31067
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx86(HighlightColorIcon, { color: currentHighlightColor }) }),
31068
- isInTable2 && /* @__PURE__ */ jsxs72(Fragment29, { children: [
31069
- /* @__PURE__ */ jsx86(
31347
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx87(TextColorIcon, { color: currentTextColor }) }),
31348
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx87(HighlightColorIcon, { color: currentHighlightColor }) }),
31349
+ isInTable2 && /* @__PURE__ */ jsxs73(Fragment29, { children: [
31350
+ /* @__PURE__ */ jsx87(
31070
31351
  ToolbarButton,
31071
31352
  {
31072
31353
  onClick: () => setActiveColorPalette("cell-bg"),
31073
31354
  active: Boolean(currentCellBgColor),
31074
31355
  title: t("tableMenu.cellBackground") || "Cell background",
31075
- children: /* @__PURE__ */ jsx86(CellBgColorIcon, { color: currentCellBgColor })
31356
+ children: /* @__PURE__ */ jsx87(CellBgColorIcon, { color: currentCellBgColor })
31076
31357
  }
31077
31358
  ),
31078
- /* @__PURE__ */ jsx86(
31359
+ /* @__PURE__ */ jsx87(
31079
31360
  ToolbarButton,
31080
31361
  {
31081
31362
  onClick: () => setActiveColorPalette("cell-border"),
@@ -31083,7 +31364,7 @@ var BubbleMenuContent = ({
31083
31364
  editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
31084
31365
  ),
31085
31366
  title: t("tableMenu.cellBorder") || "Cell border",
31086
- children: /* @__PURE__ */ jsx86(
31367
+ children: /* @__PURE__ */ jsx87(
31087
31368
  CellBorderIcon,
31088
31369
  {
31089
31370
  color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
@@ -31091,7 +31372,7 @@ var BubbleMenuContent = ({
31091
31372
  )
31092
31373
  }
31093
31374
  ),
31094
- /* @__PURE__ */ jsx86(
31375
+ /* @__PURE__ */ jsx87(
31095
31376
  ToolbarButton,
31096
31377
  {
31097
31378
  onMouseDown: () => {
@@ -31103,10 +31384,10 @@ var BubbleMenuContent = ({
31103
31384
  },
31104
31385
  active: Boolean(currentCellFormula),
31105
31386
  title: t("tableMenu.formula") || "Formula",
31106
- children: /* @__PURE__ */ jsx86(Sigma, { className: "w-4 h-4" })
31387
+ children: /* @__PURE__ */ jsx87(Sigma2, { className: "w-4 h-4" })
31107
31388
  }
31108
31389
  ),
31109
- /* @__PURE__ */ jsx86(
31390
+ /* @__PURE__ */ jsx87(
31110
31391
  ToolbarButton,
31111
31392
  {
31112
31393
  onClick: () => {
@@ -31119,17 +31400,17 @@ var BubbleMenuContent = ({
31119
31400
  active: canSplitCell,
31120
31401
  disabled: !canMergeCells && !canSplitCell,
31121
31402
  title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
31122
- children: /* @__PURE__ */ jsx86(TableCellsMerge2, { className: "w-4 h-4" })
31403
+ children: /* @__PURE__ */ jsx87(TableCellsMerge2, { className: "w-4 h-4" })
31123
31404
  }
31124
31405
  )
31125
31406
  ] }),
31126
- /* @__PURE__ */ jsx86(
31407
+ /* @__PURE__ */ jsx87(
31127
31408
  ToolbarButton,
31128
31409
  {
31129
31410
  onClick: () => setShowTypographyPanel(true),
31130
31411
  active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
31131
31412
  title: t("toolbar.textStyle"),
31132
- children: /* @__PURE__ */ jsx86(Type3, { className: "w-4 h-4" })
31413
+ children: /* @__PURE__ */ jsx87(Type3, { className: "w-4 h-4" })
31133
31414
  }
31134
31415
  )
31135
31416
  ] });
@@ -31143,12 +31424,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
31143
31424
  const handleUnlink = () => {
31144
31425
  editor.chain().focus().unsetLink().run();
31145
31426
  };
31146
- return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
31147
- /* @__PURE__ */ jsx86("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-[180px]", children: url }),
31148
- /* @__PURE__ */ jsx86("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31149
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx86(ExternalLink3, { className: "w-4 h-4" }) }),
31150
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx86(Edit2, { className: "w-4 h-4" }) }),
31151
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx86(Unlink, { className: "w-4 h-4" }) })
31427
+ return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
31428
+ /* @__PURE__ */ jsx87("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-[180px]", children: url }),
31429
+ /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31430
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx87(ExternalLink3, { className: "w-4 h-4" }) }),
31431
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx87(Edit2, { className: "w-4 h-4" }) }),
31432
+ /* @__PURE__ */ jsx87(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx87(Unlink, { className: "w-4 h-4" }) })
31152
31433
  ] });
31153
31434
  };
31154
31435
  var CustomBubbleMenu = ({
@@ -31235,7 +31516,7 @@ var CustomBubbleMenu = ({
31235
31516
  }, [editor]);
31236
31517
  if (!isVisible) return null;
31237
31518
  return createPortal8(
31238
- /* @__PURE__ */ jsx86(
31519
+ /* @__PURE__ */ jsx87(
31239
31520
  "div",
31240
31521
  {
31241
31522
  ref: menuRef,
@@ -31247,7 +31528,7 @@ var CustomBubbleMenu = ({
31247
31528
  transform: "translate(-50%, -100%)"
31248
31529
  },
31249
31530
  onMouseDown: (e) => e.preventDefault(),
31250
- children: editor.isActive("link") && !keepOpenRef.current ? /* @__PURE__ */ jsx86(LinkPreviewContent, { editor, onEdit: () => setKeepOpen(true) }) : /* @__PURE__ */ jsx86(
31531
+ children: editor.isActive("link") && !keepOpenRef.current ? /* @__PURE__ */ jsx87(LinkPreviewContent, { editor, onEdit: () => setKeepOpen(true) }) : /* @__PURE__ */ jsx87(
31251
31532
  BubbleMenuContent,
31252
31533
  {
31253
31534
  editor,
@@ -31264,25 +31545,25 @@ var CustomBubbleMenu = ({
31264
31545
  };
31265
31546
 
31266
31547
  // src/components/UEditor/CharacterCount.tsx
31267
- import { jsxs as jsxs73 } from "react/jsx-runtime";
31548
+ import { jsxs as jsxs74 } from "react/jsx-runtime";
31268
31549
  var CharacterCountDisplay = ({ editor, maxCharacters }) => {
31269
31550
  const t = useSmartTranslations("UEditor");
31270
31551
  const storage = editor.storage;
31271
31552
  const characterCount = storage.characterCount?.characters?.() ?? 0;
31272
31553
  const wordCount = storage.characterCount?.words?.() ?? 0;
31273
31554
  const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
31274
- return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
31275
- /* @__PURE__ */ jsxs73("span", { children: [
31555
+ return /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
31556
+ /* @__PURE__ */ jsxs74("span", { children: [
31276
31557
  wordCount,
31277
31558
  " ",
31278
31559
  t("words")
31279
31560
  ] }),
31280
- /* @__PURE__ */ jsxs73("span", { children: [
31561
+ /* @__PURE__ */ jsxs74("span", { children: [
31281
31562
  characterCount,
31282
31563
  " ",
31283
31564
  t("characters")
31284
31565
  ] }),
31285
- maxCharacters && /* @__PURE__ */ jsxs73("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
31566
+ maxCharacters && /* @__PURE__ */ jsxs74("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
31286
31567
  characterCount,
31287
31568
  "/",
31288
31569
  maxCharacters
@@ -31703,7 +31984,7 @@ async function prepareUEditorContentForSave({
31703
31984
  }
31704
31985
 
31705
31986
  // src/components/UEditor/table-controls.tsx
31706
- import React78 from "react";
31987
+ import React79 from "react";
31707
31988
 
31708
31989
  // node_modules/prosemirror-model/dist/index.js
31709
31990
  function findDiffStart(a, b, pos) {
@@ -34720,7 +35001,7 @@ function createKey(name) {
34720
35001
  keys[name] = 0;
34721
35002
  return name + "$";
34722
35003
  }
34723
- var PluginKey4 = class {
35004
+ var PluginKey5 = class {
34724
35005
  /**
34725
35006
  Create a plugin key.
34726
35007
  */
@@ -35152,7 +35433,7 @@ function tableNodeTypes(schema) {
35152
35433
  }
35153
35434
  return result;
35154
35435
  }
35155
- var tableEditingKey = new PluginKey4("selectingCells");
35436
+ var tableEditingKey = new PluginKey5("selectingCells");
35156
35437
  function cellAround($pos) {
35157
35438
  for (let d = $pos.depth - 1; d > 0; d--) if ($pos.node(d).type.spec.tableRole == "row") return $pos.node(0).resolve($pos.before(d + 1));
35158
35439
  return null;
@@ -35383,7 +35664,7 @@ var CellBookmark = class CellBookmark2 {
35383
35664
  else return Selection.near($headCell, 1);
35384
35665
  }
35385
35666
  };
35386
- var fixTablesKey = new PluginKey4("fix-tables");
35667
+ var fixTablesKey = new PluginKey5("fix-tables");
35387
35668
  function convertTableNodeToArrayOfRows(tableNode) {
35388
35669
  const map = TableMap3.get(tableNode);
35389
35670
  const rows = [];
@@ -35861,7 +36142,7 @@ function atEndOfCell(view, axis, dir) {
35861
36142
  }
35862
36143
  return null;
35863
36144
  }
35864
- var columnResizingPluginKey = new PluginKey4("tableColumnResizing");
36145
+ var columnResizingPluginKey = new PluginKey5("tableColumnResizing");
35865
36146
 
35866
36147
  // src/components/UEditor/table-controls.tsx
35867
36148
  import {
@@ -36188,7 +36469,7 @@ function buildTableHoverState({
36188
36469
  }
36189
36470
 
36190
36471
  // src/components/UEditor/table-drag-preview.tsx
36191
- import { Fragment as Fragment31, jsx as jsx87, jsxs as jsxs74 } from "react/jsx-runtime";
36472
+ import { Fragment as Fragment31, jsx as jsx88, jsxs as jsxs75 } from "react/jsx-runtime";
36192
36473
  function TableDragPreview({
36193
36474
  columnDragLabel,
36194
36475
  dragPreview,
@@ -36199,9 +36480,9 @@ function TableDragPreview({
36199
36480
  const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
36200
36481
  const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
36201
36482
  const dragStatusText = dragPreview.kind === "row" ? `${rowDragLabel} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview.kind === "column" ? `${columnDragLabel} ${dragPreview.originIndex + 1} -> ${dragPreview.targetIndex + 1}` : dragPreview.kind === "add-row" ? `+${dragPreview.previewRows}R` : `+${dragPreview.previewCols}C`;
36202
- return /* @__PURE__ */ jsxs74(Fragment31, { children: [
36203
- dragPreview.kind === "row" && /* @__PURE__ */ jsxs74(Fragment31, { children: [
36204
- /* @__PURE__ */ jsx87(
36483
+ return /* @__PURE__ */ jsxs75(Fragment31, { children: [
36484
+ dragPreview.kind === "row" && /* @__PURE__ */ jsxs75(Fragment31, { children: [
36485
+ /* @__PURE__ */ jsx88(
36205
36486
  "div",
36206
36487
  {
36207
36488
  "aria-hidden": "true",
@@ -36214,7 +36495,7 @@ function TableDragPreview({
36214
36495
  }
36215
36496
  }
36216
36497
  ),
36217
- /* @__PURE__ */ jsx87(
36498
+ /* @__PURE__ */ jsx88(
36218
36499
  "div",
36219
36500
  {
36220
36501
  "aria-hidden": "true",
@@ -36228,8 +36509,8 @@ function TableDragPreview({
36228
36509
  }
36229
36510
  )
36230
36511
  ] }),
36231
- dragPreview.kind === "column" && /* @__PURE__ */ jsxs74(Fragment31, { children: [
36232
- /* @__PURE__ */ jsx87(
36512
+ dragPreview.kind === "column" && /* @__PURE__ */ jsxs75(Fragment31, { children: [
36513
+ /* @__PURE__ */ jsx88(
36233
36514
  "div",
36234
36515
  {
36235
36516
  "aria-hidden": "true",
@@ -36242,7 +36523,7 @@ function TableDragPreview({
36242
36523
  }
36243
36524
  }
36244
36525
  ),
36245
- /* @__PURE__ */ jsx87(
36526
+ /* @__PURE__ */ jsx88(
36246
36527
  "div",
36247
36528
  {
36248
36529
  "aria-hidden": "true",
@@ -36256,7 +36537,7 @@ function TableDragPreview({
36256
36537
  }
36257
36538
  )
36258
36539
  ] }),
36259
- (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx87(
36540
+ (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx88(
36260
36541
  "div",
36261
36542
  {
36262
36543
  "aria-hidden": "true",
@@ -36269,7 +36550,7 @@ function TableDragPreview({
36269
36550
  }
36270
36551
  }
36271
36552
  ),
36272
- /* @__PURE__ */ jsx87(
36553
+ /* @__PURE__ */ jsx88(
36273
36554
  "div",
36274
36555
  {
36275
36556
  role: "status",
@@ -36285,7 +36566,7 @@ function TableDragPreview({
36285
36566
  }
36286
36567
 
36287
36568
  // src/components/UEditor/table-add-rails.tsx
36288
- import { Fragment as Fragment32, jsx as jsx88, jsxs as jsxs75 } from "react/jsx-runtime";
36569
+ import { Fragment as Fragment32, jsx as jsx89, jsxs as jsxs76 } from "react/jsx-runtime";
36289
36570
  var ADD_COLUMN_RAIL_GAP = 4;
36290
36571
  var ADD_ROW_RAIL_GAP = 4;
36291
36572
  function TableAddRails({
@@ -36306,13 +36587,13 @@ function TableAddRails({
36306
36587
  const rowRailLeft = visibleBounds.left;
36307
36588
  const showColumnRail = controlsVisible || addColumnVisible;
36308
36589
  const showRowRail = controlsVisible || addRowVisible;
36309
- return /* @__PURE__ */ jsxs75(Fragment32, { children: [
36310
- /* @__PURE__ */ jsx88(
36590
+ return /* @__PURE__ */ jsxs76(Fragment32, { children: [
36591
+ /* @__PURE__ */ jsx89(
36311
36592
  Tooltip,
36312
36593
  {
36313
36594
  placement: "right",
36314
- content: /* @__PURE__ */ jsx88("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
36315
- children: /* @__PURE__ */ jsx88(
36595
+ content: /* @__PURE__ */ jsx89("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
36596
+ children: /* @__PURE__ */ jsx89(
36316
36597
  "button",
36317
36598
  {
36318
36599
  type: "button",
@@ -36339,17 +36620,17 @@ function TableAddRails({
36339
36620
  transform: showColumnRail ? "scale(1)" : "scale(0.92)",
36340
36621
  pointerEvents: showColumnRail ? "auto" : "none"
36341
36622
  },
36342
- children: /* @__PURE__ */ jsx88("span", { className: "text-sm font-medium leading-none", children: "+" })
36623
+ children: /* @__PURE__ */ jsx89("span", { className: "text-sm font-medium leading-none", children: "+" })
36343
36624
  }
36344
36625
  )
36345
36626
  }
36346
36627
  ),
36347
- /* @__PURE__ */ jsx88(
36628
+ /* @__PURE__ */ jsx89(
36348
36629
  Tooltip,
36349
36630
  {
36350
36631
  placement: "bottom",
36351
- content: /* @__PURE__ */ jsx88("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
36352
- children: /* @__PURE__ */ jsx88(
36632
+ content: /* @__PURE__ */ jsx89("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
36633
+ children: /* @__PURE__ */ jsx89(
36353
36634
  "button",
36354
36635
  {
36355
36636
  type: "button",
@@ -36376,7 +36657,7 @@ function TableAddRails({
36376
36657
  transform: showRowRail ? "scale(1)" : "scale(0.92)",
36377
36658
  pointerEvents: showRowRail ? "auto" : "none"
36378
36659
  },
36379
- children: /* @__PURE__ */ jsx88("span", { className: "text-sm font-medium leading-none", children: "+" })
36660
+ children: /* @__PURE__ */ jsx89("span", { className: "text-sm font-medium leading-none", children: "+" })
36380
36661
  }
36381
36662
  )
36382
36663
  }
@@ -36386,7 +36667,7 @@ function TableAddRails({
36386
36667
 
36387
36668
  // src/components/UEditor/table-control-menu.tsx
36388
36669
  import { MoreHorizontal as MoreHorizontal2 } from "lucide-react";
36389
- import { jsx as jsx89 } from "react/jsx-runtime";
36670
+ import { jsx as jsx90 } from "react/jsx-runtime";
36390
36671
  function TableControlMenu({
36391
36672
  controlsVisible,
36392
36673
  isOpen,
@@ -36398,7 +36679,7 @@ function TableControlMenu({
36398
36679
  top
36399
36680
  }) {
36400
36681
  const shown = controlsVisible || menuVisible || isOpen;
36401
- return /* @__PURE__ */ jsx89(
36682
+ return /* @__PURE__ */ jsx90(
36402
36683
  "div",
36403
36684
  {
36404
36685
  className: "absolute z-30",
@@ -36407,13 +36688,13 @@ function TableControlMenu({
36407
36688
  top,
36408
36689
  left
36409
36690
  },
36410
- children: /* @__PURE__ */ jsx89(
36691
+ children: /* @__PURE__ */ jsx90(
36411
36692
  Tooltip,
36412
36693
  {
36413
36694
  placement: "top",
36414
36695
  disabled: isOpen,
36415
- content: /* @__PURE__ */ jsx89("span", { className: "text-xs font-medium", children: label }),
36416
- children: /* @__PURE__ */ jsx89("span", { className: "inline-flex", children: /* @__PURE__ */ jsx89(
36696
+ content: /* @__PURE__ */ jsx90("span", { className: "text-xs font-medium", children: label }),
36697
+ children: /* @__PURE__ */ jsx90("span", { className: "inline-flex", children: /* @__PURE__ */ jsx90(
36417
36698
  DropdownMenu,
36418
36699
  {
36419
36700
  placement: "bottom-start",
@@ -36421,7 +36702,7 @@ function TableControlMenu({
36421
36702
  onOpenChange,
36422
36703
  contentClassName: "p-2",
36423
36704
  items,
36424
- trigger: /* @__PURE__ */ jsx89(
36705
+ trigger: /* @__PURE__ */ jsx90(
36425
36706
  "button",
36426
36707
  {
36427
36708
  type: "button",
@@ -36437,7 +36718,7 @@ function TableControlMenu({
36437
36718
  transform: shown ? "scale(1)" : "scale(0.82)",
36438
36719
  pointerEvents: shown ? "auto" : "none"
36439
36720
  },
36440
- children: /* @__PURE__ */ jsx89(MoreHorizontal2, { className: "h-4 w-4" })
36721
+ children: /* @__PURE__ */ jsx90(MoreHorizontal2, { className: "h-4 w-4" })
36441
36722
  }
36442
36723
  )
36443
36724
  }
@@ -36450,7 +36731,7 @@ function TableControlMenu({
36450
36731
 
36451
36732
  // src/components/UEditor/table-axis-handles.tsx
36452
36733
  import { GripHorizontal, GripVertical as GripVertical3 } from "lucide-react";
36453
- import { Fragment as Fragment33, jsx as jsx90 } from "react/jsx-runtime";
36734
+ import { Fragment as Fragment33, jsx as jsx91 } from "react/jsx-runtime";
36454
36735
  var IDLE_HANDLE_SCALE = "0.78";
36455
36736
  function TableRowHandles({
36456
36737
  activeRowIndex,
@@ -36464,12 +36745,12 @@ function TableRowHandles({
36464
36745
  rowHandleLeft,
36465
36746
  rowHandles
36466
36747
  }) {
36467
- return /* @__PURE__ */ jsx90(Fragment33, { children: rowHandles.map((rowHandle) => {
36748
+ return /* @__PURE__ */ jsx91(Fragment33, { children: rowHandles.map((rowHandle) => {
36468
36749
  const menuKey = `row:${rowHandle.index}`;
36469
36750
  const isActive = rowHandle.index === activeRowIndex;
36470
36751
  const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
36471
36752
  const isShown = visible || isActive;
36472
- return /* @__PURE__ */ jsx90(
36753
+ return /* @__PURE__ */ jsx91(
36473
36754
  "div",
36474
36755
  {
36475
36756
  className: "absolute z-30",
@@ -36478,13 +36759,13 @@ function TableRowHandles({
36478
36759
  top: Math.max(8, rowHandle.center - 12),
36479
36760
  left: rowHandleLeft
36480
36761
  },
36481
- children: /* @__PURE__ */ jsx90(
36762
+ children: /* @__PURE__ */ jsx91(
36482
36763
  Tooltip,
36483
36764
  {
36484
36765
  placement: "right",
36485
36766
  disabled: openMenuKey === menuKey || !visible && isActive,
36486
- content: /* @__PURE__ */ jsx90("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
36487
- children: /* @__PURE__ */ jsx90("span", { className: "inline-flex", children: /* @__PURE__ */ jsx90(
36767
+ content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
36768
+ children: /* @__PURE__ */ jsx91("span", { className: "inline-flex", children: /* @__PURE__ */ jsx91(
36488
36769
  DropdownMenu,
36489
36770
  {
36490
36771
  placement: "right",
@@ -36492,7 +36773,7 @@ function TableRowHandles({
36492
36773
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
36493
36774
  contentClassName: "p-2",
36494
36775
  items: getMenuItems(rowHandle),
36495
- trigger: /* @__PURE__ */ jsx90(
36776
+ trigger: /* @__PURE__ */ jsx91(
36496
36777
  "button",
36497
36778
  {
36498
36779
  type: "button",
@@ -36511,7 +36792,7 @@ function TableRowHandles({
36511
36792
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
36512
36793
  pointerEvents: isShown ? "auto" : "none"
36513
36794
  },
36514
- children: visible ? /* @__PURE__ */ jsx90(GripVertical3, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx90("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36795
+ children: visible ? /* @__PURE__ */ jsx91(GripVertical3, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx91("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36515
36796
  }
36516
36797
  )
36517
36798
  }
@@ -36535,12 +36816,12 @@ function TableColumnHandles({
36535
36816
  onStartDrag,
36536
36817
  openMenuKey
36537
36818
  }) {
36538
- return /* @__PURE__ */ jsx90(Fragment33, { children: columnHandles.map((columnHandle) => {
36819
+ return /* @__PURE__ */ jsx91(Fragment33, { children: columnHandles.map((columnHandle) => {
36539
36820
  const menuKey = `column:${columnHandle.index}`;
36540
36821
  const isActive = columnHandle.index === activeColumnIndex;
36541
36822
  const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
36542
36823
  const isShown = visible || isActive;
36543
- return /* @__PURE__ */ jsx90(
36824
+ return /* @__PURE__ */ jsx91(
36544
36825
  "div",
36545
36826
  {
36546
36827
  className: "absolute z-30",
@@ -36549,13 +36830,13 @@ function TableColumnHandles({
36549
36830
  top: columnHandleTop,
36550
36831
  left: Math.max(8, columnHandle.center - 12)
36551
36832
  },
36552
- children: /* @__PURE__ */ jsx90(
36833
+ children: /* @__PURE__ */ jsx91(
36553
36834
  Tooltip,
36554
36835
  {
36555
36836
  placement: "top",
36556
36837
  disabled: openMenuKey === menuKey || !visible && isActive,
36557
- content: /* @__PURE__ */ jsx90("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
36558
- children: /* @__PURE__ */ jsx90("span", { className: "inline-flex", children: /* @__PURE__ */ jsx90(
36838
+ content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
36839
+ children: /* @__PURE__ */ jsx91("span", { className: "inline-flex", children: /* @__PURE__ */ jsx91(
36559
36840
  DropdownMenu,
36560
36841
  {
36561
36842
  placement: "bottom-start",
@@ -36563,7 +36844,7 @@ function TableColumnHandles({
36563
36844
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
36564
36845
  contentClassName: "p-2",
36565
36846
  items: getMenuItems(columnHandle),
36566
- trigger: /* @__PURE__ */ jsx90(
36847
+ trigger: /* @__PURE__ */ jsx91(
36567
36848
  "button",
36568
36849
  {
36569
36850
  type: "button",
@@ -36582,7 +36863,7 @@ function TableColumnHandles({
36582
36863
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
36583
36864
  pointerEvents: isShown ? "auto" : "none"
36584
36865
  },
36585
- children: visible ? /* @__PURE__ */ jsx90(GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx90("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36866
+ children: visible ? /* @__PURE__ */ jsx91(GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx91("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36586
36867
  }
36587
36868
  )
36588
36869
  }
@@ -36596,7 +36877,7 @@ function TableColumnHandles({
36596
36877
  }
36597
36878
 
36598
36879
  // src/components/UEditor/table-controls.tsx
36599
- import { Fragment as Fragment34, jsx as jsx91, jsxs as jsxs76 } from "react/jsx-runtime";
36880
+ import { Fragment as Fragment34, jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
36600
36881
  var TABLE_MENU_TOP_OFFSET = 10;
36601
36882
  function nearestIndex(centers, position) {
36602
36883
  let bestIndex = 0;
@@ -36622,17 +36903,17 @@ function getSelectedCell(editor) {
36622
36903
  }
36623
36904
  function TableControls({ editor, containerRef }) {
36624
36905
  const t = useSmartTranslations("UEditor");
36625
- const [layout, setLayout] = React78.useState(null);
36626
- const [dragPreview, setDragPreview] = React78.useState(null);
36627
- const [hoverState, setHoverState] = React78.useState(DEFAULT_TABLE_HOVER_STATE);
36628
- const [openMenuKey, setOpenMenuKey] = React78.useState(null);
36629
- const layoutRef = React78.useRef(null);
36630
- const dragStateRef = React78.useRef(null);
36631
- const syncFrameRef = React78.useRef(null);
36632
- React78.useEffect(() => {
36906
+ const [layout, setLayout] = React79.useState(null);
36907
+ const [dragPreview, setDragPreview] = React79.useState(null);
36908
+ const [hoverState, setHoverState] = React79.useState(DEFAULT_TABLE_HOVER_STATE);
36909
+ const [openMenuKey, setOpenMenuKey] = React79.useState(null);
36910
+ const layoutRef = React79.useRef(null);
36911
+ const dragStateRef = React79.useRef(null);
36912
+ const syncFrameRef = React79.useRef(null);
36913
+ React79.useEffect(() => {
36633
36914
  layoutRef.current = layout;
36634
36915
  }, [layout]);
36635
- const syncFromCell = React78.useCallback((cell) => {
36916
+ const syncFromCell = React79.useCallback((cell) => {
36636
36917
  const surface = containerRef.current;
36637
36918
  if (!surface || !cell) {
36638
36919
  setLayout(null);
@@ -36640,23 +36921,23 @@ function TableControls({ editor, containerRef }) {
36640
36921
  }
36641
36922
  setLayout(buildTableControlLayout(editor, surface, cell));
36642
36923
  }, [containerRef, editor]);
36643
- const syncFromSelection = React78.useCallback(() => {
36924
+ const syncFromSelection = React79.useCallback(() => {
36644
36925
  syncFromCell(getSelectedCell(editor));
36645
36926
  }, [editor, syncFromCell]);
36646
- const scheduleSyncFromSelection = React78.useCallback(() => {
36927
+ const scheduleSyncFromSelection = React79.useCallback(() => {
36647
36928
  if (syncFrameRef.current !== null) return;
36648
36929
  syncFrameRef.current = window.requestAnimationFrame(() => {
36649
36930
  syncFrameRef.current = null;
36650
36931
  syncFromSelection();
36651
36932
  });
36652
36933
  }, [syncFromSelection]);
36653
- React78.useEffect(() => () => {
36934
+ React79.useEffect(() => () => {
36654
36935
  if (syncFrameRef.current !== null) {
36655
36936
  window.cancelAnimationFrame(syncFrameRef.current);
36656
36937
  syncFrameRef.current = null;
36657
36938
  }
36658
36939
  }, []);
36659
- const refreshCurrentLayout = React78.useCallback(() => {
36940
+ const refreshCurrentLayout = React79.useCallback(() => {
36660
36941
  setLayout((prev) => {
36661
36942
  if (!prev) return prev;
36662
36943
  const surface = containerRef.current;
@@ -36666,12 +36947,12 @@ function TableControls({ editor, containerRef }) {
36666
36947
  return cell ? buildTableControlLayout(editor, surface, cell) : null;
36667
36948
  });
36668
36949
  }, [containerRef, editor]);
36669
- const clearDrag = React78.useCallback(() => {
36950
+ const clearDrag = React79.useCallback(() => {
36670
36951
  dragStateRef.current = null;
36671
36952
  setDragPreview(null);
36672
36953
  document.body.style.cursor = "";
36673
36954
  }, []);
36674
- const updateHoverState = React78.useCallback((event) => {
36955
+ const updateHoverState = React79.useCallback((event) => {
36675
36956
  const activeLayout = layoutRef.current;
36676
36957
  const surface = containerRef.current;
36677
36958
  if (!activeLayout || !surface || dragStateRef.current) {
@@ -36687,7 +36968,7 @@ function TableControls({ editor, containerRef }) {
36687
36968
  return areTableHoverStatesEqual(prev, nextState) ? prev : nextState;
36688
36969
  });
36689
36970
  }, [containerRef]);
36690
- React78.useEffect(() => {
36971
+ React79.useEffect(() => {
36691
36972
  const proseMirror = editor.view.dom;
36692
36973
  const surface = containerRef.current;
36693
36974
  if (!surface) return void 0;
@@ -36738,37 +37019,37 @@ function TableControls({ editor, containerRef }) {
36738
37019
  editor.off("update", refreshCurrentLayout);
36739
37020
  };
36740
37021
  }, [clearDrag, containerRef, editor, refreshCurrentLayout, syncFromCell, syncFromSelection, updateHoverState]);
36741
- const runAtCellPos = React78.useCallback((cellPos, command, options) => {
37022
+ const runAtCellPos = React79.useCallback((cellPos, command, options) => {
36742
37023
  const result = runTableCommandAtCellPos(editor, cellPos, command);
36743
37024
  if (options?.sync !== false) {
36744
37025
  scheduleSyncFromSelection();
36745
37026
  }
36746
37027
  return result;
36747
37028
  }, [editor, scheduleSyncFromSelection]);
36748
- const runAtActiveCell = React78.useCallback((command, options) => {
37029
+ const runAtActiveCell = React79.useCallback((command, options) => {
36749
37030
  return runAtCellPos(layoutRef.current?.cellPos ?? null, command, options);
36750
37031
  }, [runAtCellPos]);
36751
- const duplicateRowAt = React78.useCallback((rowIndex, cellPos) => {
37032
+ const duplicateRowAt = React79.useCallback((rowIndex, cellPos) => {
36752
37033
  const result = duplicateTableRowAt(editor, rowIndex, cellPos);
36753
37034
  scheduleSyncFromSelection();
36754
37035
  return result;
36755
37036
  }, [editor, scheduleSyncFromSelection]);
36756
- const clearRowAt = React78.useCallback((rowIndex, cellPos) => {
37037
+ const clearRowAt = React79.useCallback((rowIndex, cellPos) => {
36757
37038
  const result = clearTableRowAt(editor, rowIndex, cellPos);
36758
37039
  scheduleSyncFromSelection();
36759
37040
  return result;
36760
37041
  }, [editor, scheduleSyncFromSelection]);
36761
- const duplicateColumnAt = React78.useCallback((columnIndex, cellPos) => {
37042
+ const duplicateColumnAt = React79.useCallback((columnIndex, cellPos) => {
36762
37043
  const result = duplicateTableColumnAt(editor, columnIndex, cellPos);
36763
37044
  scheduleSyncFromSelection();
36764
37045
  return result;
36765
37046
  }, [editor, scheduleSyncFromSelection]);
36766
- const clearColumnAt = React78.useCallback((columnIndex, cellPos) => {
37047
+ const clearColumnAt = React79.useCallback((columnIndex, cellPos) => {
36767
37048
  const result = clearTableColumnAt(editor, columnIndex, cellPos);
36768
37049
  scheduleSyncFromSelection();
36769
37050
  return result;
36770
37051
  }, [editor, scheduleSyncFromSelection]);
36771
- const expandTableBy = React78.useCallback((rows, cols) => {
37052
+ const expandTableBy = React79.useCallback((rows, cols) => {
36772
37053
  const activeCellPos = layoutRef.current?.cellPos ?? editor.state.selection.from;
36773
37054
  const result = expandTableFromCell(editor, activeCellPos, rows, cols);
36774
37055
  scheduleSyncFromSelection();
@@ -36777,19 +37058,19 @@ function TableControls({ editor, containerRef }) {
36777
37058
  const canExpandTable = Boolean(layout);
36778
37059
  const controlsVisible = dragPreview !== null;
36779
37060
  const tableMenuOpen = openMenuKey === "table";
36780
- const startAddColumnDrag = React78.useCallback(() => {
37061
+ const startAddColumnDrag = React79.useCallback(() => {
36781
37062
  setOpenMenuKey(null);
36782
37063
  dragStateRef.current = { kind: "add-column", previewCols: 1 };
36783
37064
  setDragPreview({ kind: "add-column", previewCols: 1 });
36784
37065
  document.body.style.cursor = "ew-resize";
36785
37066
  }, []);
36786
- const startAddRowDrag = React78.useCallback(() => {
37067
+ const startAddRowDrag = React79.useCallback(() => {
36787
37068
  setOpenMenuKey(null);
36788
37069
  dragStateRef.current = { kind: "add-row", previewRows: 1 };
36789
37070
  setDragPreview({ kind: "add-row", previewRows: 1 });
36790
37071
  document.body.style.cursor = "ns-resize";
36791
37072
  }, []);
36792
- const startRowDrag = React78.useCallback((rowHandle) => {
37073
+ const startRowDrag = React79.useCallback((rowHandle) => {
36793
37074
  setOpenMenuKey(null);
36794
37075
  dragStateRef.current = {
36795
37076
  kind: "row",
@@ -36806,7 +37087,7 @@ function TableControls({ editor, containerRef }) {
36806
37087
  });
36807
37088
  document.body.style.cursor = "grabbing";
36808
37089
  }, []);
36809
- const startColumnDrag = React78.useCallback((columnHandle) => {
37090
+ const startColumnDrag = React79.useCallback((columnHandle) => {
36810
37091
  setOpenMenuKey(null);
36811
37092
  dragStateRef.current = {
36812
37093
  kind: "column",
@@ -36823,7 +37104,7 @@ function TableControls({ editor, containerRef }) {
36823
37104
  });
36824
37105
  document.body.style.cursor = "grabbing";
36825
37106
  }, []);
36826
- React78.useEffect(() => {
37107
+ React79.useEffect(() => {
36827
37108
  const handleMouseMove = (event) => {
36828
37109
  const dragState = dragStateRef.current;
36829
37110
  const activeLayout = layoutRef.current;
@@ -36912,7 +37193,7 @@ function TableControls({ editor, containerRef }) {
36912
37193
  window.removeEventListener("blur", clearDrag);
36913
37194
  };
36914
37195
  }, [clearDrag, containerRef, editor, expandTableBy, scheduleSyncFromSelection]);
36915
- const menuItems = React78.useMemo(() => {
37196
+ const menuItems = React79.useMemo(() => {
36916
37197
  if (!layout) return [];
36917
37198
  return [
36918
37199
  {
@@ -36980,7 +37261,7 @@ function TableControls({ editor, containerRef }) {
36980
37261
  }
36981
37262
  ];
36982
37263
  }, [layout, runAtActiveCell, t]);
36983
- const getRowHandleMenuItems = React78.useCallback((rowHandle) => [
37264
+ const getRowHandleMenuItems = React79.useCallback((rowHandle) => [
36984
37265
  {
36985
37266
  label: t("tableMenu.addRowBefore"),
36986
37267
  icon: ArrowUp2,
@@ -37008,7 +37289,7 @@ function TableControls({ editor, containerRef }) {
37008
37289
  destructive: true
37009
37290
  }
37010
37291
  ], [clearRowAt, duplicateRowAt, runAtCellPos, t]);
37011
- const getColumnHandleMenuItems = React78.useCallback((columnHandle) => [
37292
+ const getColumnHandleMenuItems = React79.useCallback((columnHandle) => [
37012
37293
  {
37013
37294
  label: t("tableMenu.addColumnBefore"),
37014
37295
  icon: ArrowLeft2,
@@ -37043,8 +37324,8 @@ function TableControls({ editor, containerRef }) {
37043
37324
  const menuLeft = Math.max(8, layout.tableLeft);
37044
37325
  const rowHandleLeft = layout.tableLeft - 12;
37045
37326
  const columnHandleTop = layout.tableTop - 12;
37046
- return /* @__PURE__ */ jsxs76(Fragment34, { children: [
37047
- /* @__PURE__ */ jsx91(
37327
+ return /* @__PURE__ */ jsxs77(Fragment34, { children: [
37328
+ /* @__PURE__ */ jsx92(
37048
37329
  TableRowHandles,
37049
37330
  {
37050
37331
  activeRowIndex: layout.activeRowIndex,
@@ -37061,7 +37342,7 @@ function TableControls({ editor, containerRef }) {
37061
37342
  rowHandles: layout.rowHandles
37062
37343
  }
37063
37344
  ),
37064
- /* @__PURE__ */ jsx91(
37345
+ /* @__PURE__ */ jsx92(
37065
37346
  TableColumnHandles,
37066
37347
  {
37067
37348
  activeColumnIndex: layout.activeColumnIndex,
@@ -37078,7 +37359,7 @@ function TableControls({ editor, containerRef }) {
37078
37359
  openMenuKey
37079
37360
  }
37080
37361
  ),
37081
- /* @__PURE__ */ jsx91(
37362
+ /* @__PURE__ */ jsx92(
37082
37363
  TableControlMenu,
37083
37364
  {
37084
37365
  controlsVisible,
@@ -37093,7 +37374,7 @@ function TableControls({ editor, containerRef }) {
37093
37374
  top: menuTop
37094
37375
  }
37095
37376
  ),
37096
- /* @__PURE__ */ jsx91(
37377
+ /* @__PURE__ */ jsx92(
37097
37378
  TableAddRails,
37098
37379
  {
37099
37380
  addColumnVisible: hoverState.addColumnVisible,
@@ -37107,7 +37388,7 @@ function TableControls({ editor, containerRef }) {
37107
37388
  quickAddRowLabel: t("tableMenu.quickAddRowAfter")
37108
37389
  }
37109
37390
  ),
37110
- /* @__PURE__ */ jsx91(
37391
+ /* @__PURE__ */ jsx92(
37111
37392
  TableDragPreview,
37112
37393
  {
37113
37394
  columnDragLabel: t("tableMenu.dragColumn"),
@@ -37278,10 +37559,10 @@ var UEDITOR_PROSEMIRROR_CLASS_NAME = cn(
37278
37559
  );
37279
37560
 
37280
37561
  // src/components/UEditor/use-table-interactions.ts
37281
- import React80, { useEffect as useEffect37, useRef as useRef35 } from "react";
37562
+ import React81, { useEffect as useEffect37, useRef as useRef35 } from "react";
37282
37563
 
37283
37564
  // src/components/UEditor/use-table-row-resize.ts
37284
- import React79, { useRef as useRef34 } from "react";
37565
+ import React80, { useRef as useRef34 } from "react";
37285
37566
  function useTableRowResize({
37286
37567
  editor,
37287
37568
  setHoveredTableCell,
@@ -37292,7 +37573,7 @@ function useTableRowResize({
37292
37573
  }) {
37293
37574
  const commitFrameRef = useRef34(null);
37294
37575
  const stateRef = useRef34(null);
37295
- const commitPreview = React79.useCallback(() => {
37576
+ const commitPreview = React80.useCallback(() => {
37296
37577
  if (!editor) return;
37297
37578
  const state = stateRef.current;
37298
37579
  if (!state) return;
@@ -37327,22 +37608,22 @@ function useTableRowResize({
37327
37608
  showRowGuide(state.tableElement, state.rowElement, state.cellElement);
37328
37609
  scheduleTableLayoutSync();
37329
37610
  }, [editor, scheduleTableLayoutSync, showRowGuide]);
37330
- const scheduleCommit = React79.useCallback(() => {
37611
+ const scheduleCommit = React80.useCallback(() => {
37331
37612
  if (commitFrameRef.current !== null) return;
37332
37613
  commitFrameRef.current = window.requestAnimationFrame(() => {
37333
37614
  commitFrameRef.current = null;
37334
37615
  commitPreview();
37335
37616
  });
37336
37617
  }, [commitPreview]);
37337
- const syncActiveGuide = React79.useCallback(() => {
37618
+ const syncActiveGuide = React80.useCallback(() => {
37338
37619
  const state = stateRef.current;
37339
37620
  if (!state) return false;
37340
37621
  setHoveredTableCell(state.cellElement);
37341
37622
  showRowGuide(state.tableElement, state.rowElement, state.cellElement);
37342
37623
  return true;
37343
37624
  }, [setHoveredTableCell, showRowGuide]);
37344
- const isResizing = React79.useCallback(() => stateRef.current !== null, []);
37345
- const beginResize = React79.useCallback((event, table, row, cell) => {
37625
+ const isResizing = React80.useCallback(() => stateRef.current !== null, []);
37626
+ const beginResize = React80.useCallback((event, table, row, cell) => {
37346
37627
  if (!editor || !isRowResizeHotspot(cell, event.clientX, event.clientY)) {
37347
37628
  return false;
37348
37629
  }
@@ -37368,7 +37649,7 @@ function useTableRowResize({
37368
37649
  event.stopPropagation();
37369
37650
  return true;
37370
37651
  }, [editor, setHoveredTableCell, showRowGuide]);
37371
- const handlePointerMove = React79.useCallback((event) => {
37652
+ const handlePointerMove = React80.useCallback((event) => {
37372
37653
  const state = stateRef.current;
37373
37654
  if (!state) return;
37374
37655
  const nextHeight = Math.max(
@@ -37384,7 +37665,7 @@ function useTableRowResize({
37384
37665
  document.body.style.cursor = "row-resize";
37385
37666
  scheduleCommit();
37386
37667
  }, [scheduleCommit, showRowGuide]);
37387
- const handlePointerUp = React79.useCallback((event) => {
37668
+ const handlePointerUp = React80.useCallback((event) => {
37388
37669
  if (!editor) return;
37389
37670
  const state = stateRef.current;
37390
37671
  if (!state) return;
@@ -37414,7 +37695,7 @@ function useTableRowResize({
37414
37695
  clearAllTableResizeHover();
37415
37696
  scheduleTableLayoutSync();
37416
37697
  }, [clearAllTableResizeHover, clearHoveredTableCell, commitPreview, editor, scheduleTableLayoutSync]);
37417
- const cancelResize = React79.useCallback(() => {
37698
+ const cancelResize = React80.useCallback(() => {
37418
37699
  if (!stateRef.current) return;
37419
37700
  if (commitFrameRef.current !== null) {
37420
37701
  window.cancelAnimationFrame(commitFrameRef.current);
@@ -37426,7 +37707,7 @@ function useTableRowResize({
37426
37707
  clearAllTableResizeHover();
37427
37708
  scheduleTableLayoutSync();
37428
37709
  }, [clearAllTableResizeHover, clearHoveredTableCell, scheduleTableLayoutSync]);
37429
- const cleanup = React79.useCallback(() => {
37710
+ const cleanup = React80.useCallback(() => {
37430
37711
  if (commitFrameRef.current !== null) {
37431
37712
  window.cancelAnimationFrame(commitFrameRef.current);
37432
37713
  commitFrameRef.current = null;
@@ -37455,16 +37736,16 @@ function useUEditorTableInteractions(editor, editable = true) {
37455
37736
  const activeTableCellRef = useRef35(null);
37456
37737
  const suppressActiveCellHighlightRef = useRef35(false);
37457
37738
  const tableLayoutSyncFrameRef = useRef35(null);
37458
- const getProseMirrorElement = React80.useCallback(() => {
37739
+ const getProseMirrorElement = React81.useCallback(() => {
37459
37740
  return editorContentRef.current?.querySelector(".ProseMirror");
37460
37741
  }, []);
37461
- const setEditorResizeCursor = React80.useCallback((cursor) => {
37742
+ const setEditorResizeCursor = React81.useCallback((cursor) => {
37462
37743
  const proseMirror = getProseMirrorElement();
37463
37744
  if (proseMirror) {
37464
37745
  proseMirror.style.cursor = cursor;
37465
37746
  }
37466
37747
  }, [getProseMirrorElement]);
37467
- const hideColumnGuide = React80.useCallback(() => {
37748
+ const hideColumnGuide = React81.useCallback(() => {
37468
37749
  editorContentRef.current?.classList.remove("resize-cursor");
37469
37750
  getProseMirrorElement()?.classList.remove("resize-cursor");
37470
37751
  const guide = tableColumnGuideRef.current;
@@ -37472,7 +37753,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37472
37753
  guide.style.opacity = "0";
37473
37754
  }
37474
37755
  }, [getProseMirrorElement]);
37475
- const hideRowGuide = React80.useCallback(() => {
37756
+ const hideRowGuide = React81.useCallback(() => {
37476
37757
  editorContentRef.current?.classList.remove("resize-row-cursor");
37477
37758
  getProseMirrorElement()?.classList.remove("resize-row-cursor");
37478
37759
  const guide = tableRowGuideRef.current;
@@ -37480,12 +37761,12 @@ function useUEditorTableInteractions(editor, editable = true) {
37480
37761
  guide.style.opacity = "0";
37481
37762
  }
37482
37763
  }, [getProseMirrorElement]);
37483
- const clearAllTableResizeHover = React80.useCallback(() => {
37764
+ const clearAllTableResizeHover = React81.useCallback(() => {
37484
37765
  setEditorResizeCursor("");
37485
37766
  hideColumnGuide();
37486
37767
  hideRowGuide();
37487
37768
  }, [hideColumnGuide, hideRowGuide, setEditorResizeCursor]);
37488
- const updateActiveCellHighlight = React80.useCallback((cell) => {
37769
+ const updateActiveCellHighlight = React81.useCallback((cell) => {
37489
37770
  const surface = editorContentRef.current;
37490
37771
  const highlight = activeTableCellHighlightRef.current;
37491
37772
  if (!highlight) return;
@@ -37500,7 +37781,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37500
37781
  highlight.style.width = `${metrics.width}px`;
37501
37782
  highlight.style.height = `${metrics.height}px`;
37502
37783
  }, []);
37503
- const scheduleTableLayoutSync = React80.useCallback(() => {
37784
+ const scheduleTableLayoutSync = React81.useCallback(() => {
37504
37785
  if (tableLayoutSyncFrameRef.current !== null) return;
37505
37786
  tableLayoutSyncFrameRef.current = window.requestAnimationFrame(() => {
37506
37787
  tableLayoutSyncFrameRef.current = null;
@@ -37508,7 +37789,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37508
37789
  editorContentRef.current?.dispatchEvent(new CustomEvent(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT));
37509
37790
  });
37510
37791
  }, [updateActiveCellHighlight]);
37511
- const setActiveTableCell = React80.useCallback((cell) => {
37792
+ const setActiveTableCell = React81.useCallback((cell) => {
37512
37793
  if (activeTableCellRef.current === cell) {
37513
37794
  updateActiveCellHighlight(cell);
37514
37795
  return;
@@ -37516,17 +37797,17 @@ function useUEditorTableInteractions(editor, editable = true) {
37516
37797
  activeTableCellRef.current = cell;
37517
37798
  updateActiveCellHighlight(activeTableCellRef.current);
37518
37799
  }, [updateActiveCellHighlight]);
37519
- const clearActiveTableCell = React80.useCallback(() => {
37800
+ const clearActiveTableCell = React81.useCallback(() => {
37520
37801
  activeTableCellRef.current = null;
37521
37802
  updateActiveCellHighlight(null);
37522
37803
  }, [updateActiveCellHighlight]);
37523
- const setHoveredTableCell = React80.useCallback((cell) => {
37804
+ const setHoveredTableCell = React81.useCallback((cell) => {
37524
37805
  hoveredTableCellRef.current = cell;
37525
37806
  }, []);
37526
- const clearHoveredTableCell = React80.useCallback(() => {
37807
+ const clearHoveredTableCell = React81.useCallback(() => {
37527
37808
  hoveredTableCellRef.current = null;
37528
37809
  }, []);
37529
- const showColumnGuide = React80.useCallback((table, row, cell) => {
37810
+ const showColumnGuide = React81.useCallback((table, row, cell) => {
37530
37811
  const surface = editorContentRef.current;
37531
37812
  const guide = tableColumnGuideRef.current;
37532
37813
  if (!surface || !guide) return;
@@ -37540,7 +37821,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37540
37821
  getProseMirrorElement()?.classList.add("resize-cursor");
37541
37822
  setEditorResizeCursor("col-resize");
37542
37823
  }, [getProseMirrorElement, setEditorResizeCursor]);
37543
- const showRowGuide = React80.useCallback((table, row, cell) => {
37824
+ const showRowGuide = React81.useCallback((table, row, cell) => {
37544
37825
  const surface = editorContentRef.current;
37545
37826
  const guide = tableRowGuideRef.current;
37546
37827
  if (!surface || !guide) return;
@@ -37570,7 +37851,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37570
37851
  clearAllTableResizeHover,
37571
37852
  scheduleTableLayoutSync
37572
37853
  });
37573
- const syncActiveTableCellFromSelection = React80.useCallback(() => {
37854
+ const syncActiveTableCellFromSelection = React81.useCallback(() => {
37574
37855
  if (!editor) return;
37575
37856
  if (!editor.isFocused) {
37576
37857
  clearActiveTableCell();
@@ -37751,7 +38032,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37751
38032
  }
37752
38033
 
37753
38034
  // src/components/UEditor/menu-bar.tsx
37754
- import React81, { useRef as useRef36, useState as useState49 } from "react";
38035
+ import React82, { useRef as useRef36, useState as useState49 } from "react";
37755
38036
  import { useEditorState as useEditorState3 } from "@tiptap/react";
37756
38037
  import {
37757
38038
  AlignCenter as AlignCenter4,
@@ -37782,14 +38063,14 @@ import {
37782
38063
  Undo as UndoIcon2,
37783
38064
  Upload as Upload4
37784
38065
  } from "lucide-react";
37785
- import { Fragment as Fragment35, jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
38066
+ import { Fragment as Fragment35, jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
37786
38067
  function MenuTableInsertGrid({
37787
38068
  insertLabel,
37788
38069
  previewTemplate,
37789
38070
  onInsert
37790
38071
  }) {
37791
38072
  const closeMenu = useDropdownMenuClose();
37792
- return /* @__PURE__ */ jsx92(
38073
+ return /* @__PURE__ */ jsx93(
37793
38074
  TableInsertGrid,
37794
38075
  {
37795
38076
  insertLabel,
@@ -37805,9 +38086,9 @@ function renderMenuItems(items) {
37805
38086
  return items.map((item, i) => {
37806
38087
  switch (item.type) {
37807
38088
  case "separator":
37808
- return /* @__PURE__ */ jsx92(DropdownMenuSeparator, {}, i);
38089
+ return /* @__PURE__ */ jsx93(DropdownMenuSeparator, {}, i);
37809
38090
  case "action":
37810
- return /* @__PURE__ */ jsx92(
38091
+ return /* @__PURE__ */ jsx93(
37811
38092
  DropdownMenuItem,
37812
38093
  {
37813
38094
  label: item.label,
@@ -37821,9 +38102,9 @@ function renderMenuItems(items) {
37821
38102
  i
37822
38103
  );
37823
38104
  case "sub":
37824
- return /* @__PURE__ */ jsx92(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
38105
+ return /* @__PURE__ */ jsx93(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
37825
38106
  case "custom":
37826
- return /* @__PURE__ */ jsx92(React81.Fragment, { children: item.render() }, item.key);
38107
+ return /* @__PURE__ */ jsx93(React82.Fragment, { children: item.render() }, item.key);
37827
38108
  }
37828
38109
  });
37829
38110
  }
@@ -38125,7 +38406,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
38125
38406
  {
38126
38407
  type: "custom",
38127
38408
  key: "table-insert-grid",
38128
- render: () => /* @__PURE__ */ jsx92(
38409
+ render: () => /* @__PURE__ */ jsx93(
38129
38410
  MenuTableInsertGrid,
38130
38411
  {
38131
38412
  insertLabel: t("tableMenu.insertTable"),
@@ -38221,8 +38502,8 @@ function buildTableMenuItems(t, editor, onInsertTable) {
38221
38502
  }
38222
38503
  ];
38223
38504
  }
38224
- var MenuBarTrigger = React81.forwardRef(
38225
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx92(
38505
+ var MenuBarTrigger = React82.forwardRef(
38506
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx93(
38226
38507
  "button",
38227
38508
  {
38228
38509
  ref,
@@ -38324,9 +38605,9 @@ var MenuBar = ({
38324
38605
  {
38325
38606
  type: "custom",
38326
38607
  key: "image",
38327
- render: () => showImageInput ? /* @__PURE__ */ jsx92(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs77(Fragment35, { children: [
38328
- /* @__PURE__ */ jsx92(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon3, onClick: () => setShowImageInput(true), closeOnSelect: false }),
38329
- /* @__PURE__ */ jsx92(
38608
+ render: () => showImageInput ? /* @__PURE__ */ jsx93(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs78(Fragment35, { children: [
38609
+ /* @__PURE__ */ jsx93(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon3, onClick: () => setShowImageInput(true), closeOnSelect: false }),
38610
+ /* @__PURE__ */ jsx93(
38330
38611
  DropdownMenuItem,
38331
38612
  {
38332
38613
  label: t("menubar.imageUpload"),
@@ -38341,7 +38622,7 @@ var MenuBar = ({
38341
38622
  {
38342
38623
  type: "custom",
38343
38624
  key: "link",
38344
- render: () => showLinkInput ? /* @__PURE__ */ jsx92(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx92(
38625
+ render: () => showLinkInput ? /* @__PURE__ */ jsx93(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx93(
38345
38626
  DropdownMenuItem,
38346
38627
  {
38347
38628
  label: t("menubar.link"),
@@ -38361,7 +38642,7 @@ var MenuBar = ({
38361
38642
  {
38362
38643
  type: "custom",
38363
38644
  key: "table-grid",
38364
- render: () => /* @__PURE__ */ jsx92(
38645
+ render: () => /* @__PURE__ */ jsx93(
38365
38646
  MenuTableInsertGrid,
38366
38647
  {
38367
38648
  insertLabel: t("tableMenu.insertTable"),
@@ -38414,8 +38695,8 @@ var MenuBar = ({
38414
38695
  },
38415
38696
  { label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
38416
38697
  ];
38417
- return /* @__PURE__ */ jsxs77(Fragment35, { children: [
38418
- /* @__PURE__ */ jsx92(
38698
+ return /* @__PURE__ */ jsxs78(Fragment35, { children: [
38699
+ /* @__PURE__ */ jsx93(
38419
38700
  "input",
38420
38701
  {
38421
38702
  ref: fileInputRef,
@@ -38426,11 +38707,11 @@ var MenuBar = ({
38426
38707
  onChange: (e) => handleImageFiles(e.target.files)
38427
38708
  }
38428
38709
  ),
38429
- /* @__PURE__ */ jsxs77("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
38430
- menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx92(
38710
+ /* @__PURE__ */ jsxs78("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
38711
+ menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx93(
38431
38712
  DropdownMenu,
38432
38713
  {
38433
- trigger: /* @__PURE__ */ jsx92(MenuBarTrigger, { children: label }),
38714
+ trigger: /* @__PURE__ */ jsx93(MenuBarTrigger, { children: label }),
38434
38715
  placement: "bottom-start",
38435
38716
  isOpen: open,
38436
38717
  onOpenChange,
@@ -38438,7 +38719,7 @@ var MenuBar = ({
38438
38719
  },
38439
38720
  label
38440
38721
  )),
38441
- /* @__PURE__ */ jsx92(
38722
+ /* @__PURE__ */ jsx93(
38442
38723
  "button",
38443
38724
  {
38444
38725
  type: "button",
@@ -38449,20 +38730,20 @@ var MenuBar = ({
38449
38730
  "ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
38450
38731
  "hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
38451
38732
  ),
38452
- children: /* @__PURE__ */ jsx92(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
38733
+ children: /* @__PURE__ */ jsx93(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
38453
38734
  }
38454
38735
  )
38455
38736
  ] }),
38456
- /* @__PURE__ */ jsx92(
38737
+ /* @__PURE__ */ jsx93(
38457
38738
  Modal_default,
38458
38739
  {
38459
38740
  isOpen: showSourceDialog,
38460
38741
  onClose: () => setShowSourceDialog(false),
38461
38742
  title: t("menubar.sourceCode"),
38462
38743
  size: "lg",
38463
- children: /* @__PURE__ */ jsxs77("div", { className: "space-y-3", children: [
38464
- /* @__PURE__ */ jsx92("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
38465
- /* @__PURE__ */ jsx92(
38744
+ children: /* @__PURE__ */ jsxs78("div", { className: "space-y-3", children: [
38745
+ /* @__PURE__ */ jsx93("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
38746
+ /* @__PURE__ */ jsx93(
38466
38747
  "textarea",
38467
38748
  {
38468
38749
  "data-testid": "source-code-textarea",
@@ -38472,8 +38753,8 @@ var MenuBar = ({
38472
38753
  spellCheck: false
38473
38754
  }
38474
38755
  ),
38475
- /* @__PURE__ */ jsxs77("div", { className: "flex gap-2 justify-end", children: [
38476
- /* @__PURE__ */ jsx92(
38756
+ /* @__PURE__ */ jsxs78("div", { className: "flex gap-2 justify-end", children: [
38757
+ /* @__PURE__ */ jsx93(
38477
38758
  "button",
38478
38759
  {
38479
38760
  type: "button",
@@ -38482,7 +38763,7 @@ var MenuBar = ({
38482
38763
  children: t("menubar.applySource")
38483
38764
  }
38484
38765
  ),
38485
- /* @__PURE__ */ jsx92(
38766
+ /* @__PURE__ */ jsx93(
38486
38767
  "button",
38487
38768
  {
38488
38769
  type: "button",
@@ -38495,7 +38776,7 @@ var MenuBar = ({
38495
38776
  ] })
38496
38777
  }
38497
38778
  ),
38498
- /* @__PURE__ */ jsx92(
38779
+ /* @__PURE__ */ jsx93(
38499
38780
  Modal_default,
38500
38781
  {
38501
38782
  isOpen: showPreviewDialog,
@@ -38506,12 +38787,12 @@ var MenuBar = ({
38506
38787
  height: "min(860px, calc(100vh - 2rem))",
38507
38788
  className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
38508
38789
  contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
38509
- children: /* @__PURE__ */ jsx92(
38790
+ children: /* @__PURE__ */ jsx93(
38510
38791
  "div",
38511
38792
  {
38512
38793
  "data-testid": "preview-content",
38513
38794
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-8",
38514
- children: editor.isEmpty ? /* @__PURE__ */ jsx92("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx92(
38795
+ children: editor.isEmpty ? /* @__PURE__ */ jsx93("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx93(
38515
38796
  "div",
38516
38797
  {
38517
38798
  className: UEDITOR_PROSEMIRROR_CLASS_NAME,
@@ -38526,8 +38807,8 @@ var MenuBar = ({
38526
38807
  };
38527
38808
 
38528
38809
  // src/components/UEditor/UEditor.tsx
38529
- import { jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
38530
- var UEditor = React82.forwardRef(({
38810
+ import { jsx as jsx94, jsxs as jsxs79 } from "react/jsx-runtime";
38811
+ var UEditor = React83.forwardRef(({
38531
38812
  content = "",
38532
38813
  onChange,
38533
38814
  onHtmlChange,
@@ -38655,7 +38936,7 @@ var UEditor = React82.forwardRef(({
38655
38936
  tableRowGuideRef,
38656
38937
  activeTableCellHighlightRef
38657
38938
  } = useUEditorTableInteractions(editor, editable);
38658
- useImperativeHandle3(
38939
+ useImperativeHandle4(
38659
38940
  ref,
38660
38941
  () => ({
38661
38942
  editor,
@@ -38707,7 +38988,7 @@ var UEditor = React82.forwardRef(({
38707
38988
  }
38708
38989
  }, [content, editor]);
38709
38990
  if (!editor) {
38710
- return /* @__PURE__ */ jsx93(
38991
+ return /* @__PURE__ */ jsx94(
38711
38992
  "div",
38712
38993
  {
38713
38994
  className: cn("w-full border bg-background flex items-center justify-center text-muted-foreground", className),
@@ -38716,7 +38997,7 @@ var UEditor = React82.forwardRef(({
38716
38997
  }
38717
38998
  );
38718
38999
  }
38719
- return /* @__PURE__ */ jsxs78(
39000
+ return /* @__PURE__ */ jsxs79(
38720
39001
  "div",
38721
39002
  {
38722
39003
  className: cn(
@@ -38731,7 +39012,7 @@ var UEditor = React82.forwardRef(({
38731
39012
  className
38732
39013
  ),
38733
39014
  children: [
38734
- editable && showMenuBar && /* @__PURE__ */ jsx93(
39015
+ editable && showMenuBar && /* @__PURE__ */ jsx94(
38735
39016
  MenuBar,
38736
39017
  {
38737
39018
  editor,
@@ -38746,7 +39027,7 @@ var UEditor = React82.forwardRef(({
38746
39027
  onPreview
38747
39028
  }
38748
39029
  ),
38749
- editable && showToolbar && /* @__PURE__ */ jsx93(
39030
+ editable && showToolbar && /* @__PURE__ */ jsx94(
38750
39031
  EditorToolbar,
38751
39032
  {
38752
39033
  editor,
@@ -38761,7 +39042,7 @@ var UEditor = React82.forwardRef(({
38761
39042
  letterSpacings
38762
39043
  }
38763
39044
  ),
38764
- editable && showBubbleMenu && /* @__PURE__ */ jsx93(
39045
+ editable && showBubbleMenu && /* @__PURE__ */ jsx94(
38765
39046
  CustomBubbleMenu,
38766
39047
  {
38767
39048
  editor,
@@ -38769,7 +39050,7 @@ var UEditor = React82.forwardRef(({
38769
39050
  lineHeights
38770
39051
  }
38771
39052
  ),
38772
- /* @__PURE__ */ jsxs78(
39053
+ /* @__PURE__ */ jsxs79(
38773
39054
  "div",
38774
39055
  {
38775
39056
  ref: editorContentRef,
@@ -38779,7 +39060,7 @@ var UEditor = React82.forwardRef(({
38779
39060
  maxHeight
38780
39061
  },
38781
39062
  children: [
38782
- /* @__PURE__ */ jsx93(
39063
+ /* @__PURE__ */ jsx94(
38783
39064
  "span",
38784
39065
  {
38785
39066
  ref: tableColumnGuideRef,
@@ -38787,7 +39068,7 @@ var UEditor = React82.forwardRef(({
38787
39068
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
38788
39069
  }
38789
39070
  ),
38790
- /* @__PURE__ */ jsx93(
39071
+ /* @__PURE__ */ jsx94(
38791
39072
  "span",
38792
39073
  {
38793
39074
  ref: tableRowGuideRef,
@@ -38795,7 +39076,7 @@ var UEditor = React82.forwardRef(({
38795
39076
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
38796
39077
  }
38797
39078
  ),
38798
- /* @__PURE__ */ jsx93(
39079
+ /* @__PURE__ */ jsx94(
38799
39080
  "span",
38800
39081
  {
38801
39082
  ref: activeTableCellHighlightRef,
@@ -38804,8 +39085,8 @@ var UEditor = React82.forwardRef(({
38804
39085
  className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10"
38805
39086
  }
38806
39087
  ),
38807
- editable && /* @__PURE__ */ jsx93(TableControls, { editor, containerRef: editorContentRef }),
38808
- /* @__PURE__ */ jsx93(
39088
+ editable && /* @__PURE__ */ jsx94(TableControls, { editor, containerRef: editorContentRef }),
39089
+ /* @__PURE__ */ jsx94(
38809
39090
  EditorContent,
38810
39091
  {
38811
39092
  editor,
@@ -38815,7 +39096,7 @@ var UEditor = React82.forwardRef(({
38815
39096
  ]
38816
39097
  }
38817
39098
  ),
38818
- showCharacterCount && /* @__PURE__ */ jsx93(CharacterCountDisplay, { editor, maxCharacters })
39099
+ showCharacterCount && /* @__PURE__ */ jsx94(CharacterCountDisplay, { editor, maxCharacters })
38819
39100
  ]
38820
39101
  }
38821
39102
  );