@underverse-ui/underverse 1.0.152 → 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.cjs CHANGED
@@ -995,6 +995,15 @@ var en_default = {
995
995
  noResults: "No emoji found",
996
996
  showingCount: "Showing first {shown} of {total} emojis"
997
997
  },
998
+ formulaSuggestion: {
999
+ title: "Functions",
1000
+ noResults: "No function found",
1001
+ sum: "Add values in a range",
1002
+ avg: "Average values in a range",
1003
+ min: "Smallest value in a range",
1004
+ max: "Largest value in a range",
1005
+ count: "Count numeric cells in a range"
1006
+ },
998
1007
  tableMenu: {
999
1008
  insert3x3: "Insert 3\xD73 Table",
1000
1009
  insertTable: "Insert Table",
@@ -1030,6 +1039,9 @@ var en_default = {
1030
1039
  borderColor: "Border Color",
1031
1040
  clearBorder: "Clear Border",
1032
1041
  formula: "Formula",
1042
+ numberFormat: "Number Format",
1043
+ formatText: "Text",
1044
+ formatDate: "Date",
1033
1045
  apply: "Apply",
1034
1046
  clear: "Clear",
1035
1047
  recalculate: "Recalculate",
@@ -1375,6 +1387,15 @@ var vi_default = {
1375
1387
  noResults: "Kh\xF4ng t\xECm th\u1EA5y emoji",
1376
1388
  showingCount: "Hi\u1EC3n th\u1ECB {shown} trong t\u1ED5ng s\u1ED1 {total} emoji"
1377
1389
  },
1390
+ formulaSuggestion: {
1391
+ title: "H\xE0m",
1392
+ noResults: "Kh\xF4ng t\xECm th\u1EA5y h\xE0m",
1393
+ sum: "C\u1ED9ng c\xE1c gi\xE1 tr\u1ECB trong v\xF9ng",
1394
+ avg: "T\xEDnh trung b\xECnh c\xE1c gi\xE1 tr\u1ECB trong v\xF9ng",
1395
+ min: "Gi\xE1 tr\u1ECB nh\u1ECF nh\u1EA5t trong v\xF9ng",
1396
+ max: "Gi\xE1 tr\u1ECB l\u1EDBn nh\u1EA5t trong v\xF9ng",
1397
+ count: "\u0110\u1EBFm c\xE1c \xF4 d\u1EA1ng s\u1ED1 trong v\xF9ng"
1398
+ },
1378
1399
  tableMenu: {
1379
1400
  insert3x3: "Ch\xE8n b\u1EA3ng 3\xD73",
1380
1401
  insertTable: "Ch\xE8n b\u1EA3ng",
@@ -1410,6 +1431,9 @@ var vi_default = {
1410
1431
  borderColor: "M\xE0u vi\u1EC1n",
1411
1432
  clearBorder: "X\xF3a vi\u1EC1n",
1412
1433
  formula: "C\xF4ng th\u1EE9c",
1434
+ numberFormat: "\u0110\u1ECBnh d\u1EA1ng s\u1ED1",
1435
+ formatText: "Ch\u1EEF",
1436
+ formatDate: "Ng\xE0y",
1413
1437
  apply: "\xC1p d\u1EE5ng",
1414
1438
  clear: "X\xF3a",
1415
1439
  recalculate: "T\xEDnh l\u1EA1i",
@@ -1716,6 +1740,7 @@ var ko_default = {
1716
1740
  dividerDesc: "\uC2DC\uAC01\uC801 \uAD6C\uBD84\uC120",
1717
1741
  table: "\uD45C",
1718
1742
  tableDesc: "\uD45C \uCD94\uAC00",
1743
+ noResults: "\uC77C\uCE58\uD558\uB294 \uBE14\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
1719
1744
  callout: "\uCF5C\uC544\uC6C3",
1720
1745
  calloutDesc: "\uC911\uC694\uD55C \uC815\uBCF4\uB97C \uCF5C\uC544\uC6C3 \uBE14\uB85D\uC73C\uB85C \uAC15\uC870\uD569\uB2C8\uB2E4",
1721
1746
  bookmark: "\uBD81\uB9C8\uD06C \uCE74\uB4DC",
@@ -1754,6 +1779,15 @@ var ko_default = {
1754
1779
  noResults: "\uC774\uBAA8\uC9C0\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
1755
1780
  showingCount: "\uCD1D {total}\uAC1C \uC911 \uCC98\uC74C {shown}\uAC1C\uC758 \uC774\uBAA8\uC9C0\uB97C \uD45C\uC2DC \uC911"
1756
1781
  },
1782
+ formulaSuggestion: {
1783
+ title: "\uD568\uC218",
1784
+ noResults: "\uD568\uC218\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4",
1785
+ sum: "\uBC94\uC704\uC758 \uAC12\uC744 \uD569\uC0B0",
1786
+ avg: "\uBC94\uC704\uC758 \uAC12 \uD3C9\uADE0",
1787
+ min: "\uBC94\uC704\uC758 \uCD5C\uC19F\uAC12",
1788
+ max: "\uBC94\uC704\uC758 \uCD5C\uB313\uAC12",
1789
+ count: "\uBC94\uC704\uC758 \uC22B\uC790 \uC140 \uAC1C\uC218"
1790
+ },
1757
1791
  tableMenu: {
1758
1792
  insert3x3: "3x3 \uD45C \uC0BD\uC785",
1759
1793
  insertTable: "\uD45C \uC0BD\uC785",
@@ -1788,6 +1822,13 @@ var ko_default = {
1788
1822
  borderWidth: "\uD14C\uB450\uB9AC \uB450\uAED8",
1789
1823
  borderColor: "\uD14C\uB450\uB9AC \uC0C9\uC0C1",
1790
1824
  clearBorder: "\uD14C\uB450\uB9AC \uC9C0\uC6B0\uAE30",
1825
+ formula: "\uC218\uC2DD",
1826
+ numberFormat: "\uD45C\uC2DC \uD615\uC2DD",
1827
+ formatText: "\uD14D\uC2A4\uD2B8",
1828
+ formatDate: "\uB0A0\uC9DC",
1829
+ apply: "\uC801\uC6A9",
1830
+ clear: "\uC9C0\uC6B0\uAE30",
1831
+ recalculate: "\uB2E4\uC2DC \uACC4\uC0B0",
1791
1832
  done: "\uC644\uB8CC"
1792
1833
  },
1793
1834
  callout: {
@@ -2091,6 +2132,7 @@ var ja_default = {
2091
2132
  dividerDesc: "\u8996\u899A\u7684\u306A\u533A\u5207\u308A\u7DDA",
2092
2133
  table: "\u8868",
2093
2134
  tableDesc: "\u8868\u3092\u8FFD\u52A0",
2135
+ noResults: "\u4E00\u81F4\u3059\u308B\u30D6\u30ED\u30C3\u30AF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
2094
2136
  callout: "\u30B3\u30FC\u30EB\u30A2\u30A6\u30C8",
2095
2137
  calloutDesc: "\u91CD\u8981\u306A\u60C5\u5831\u3092\u30B3\u30FC\u30EB\u30A2\u30A6\u30C8\u30D6\u30ED\u30C3\u30AF\u3067\u5F37\u8ABF\u3057\u307E\u3059",
2096
2138
  bookmark: "\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF\u30AB\u30FC\u30C9",
@@ -2129,6 +2171,15 @@ var ja_default = {
2129
2171
  noResults: "\u7D75\u6587\u5B57\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
2130
2172
  showingCount: "{total} \u4EF6\u4E2D {shown} \u4EF6\u306E\u7D75\u6587\u5B57\u3092\u8868\u793A\u4E2D"
2131
2173
  },
2174
+ formulaSuggestion: {
2175
+ title: "\u95A2\u6570",
2176
+ noResults: "\u95A2\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
2177
+ sum: "\u7BC4\u56F2\u5185\u306E\u5024\u3092\u5408\u8A08",
2178
+ avg: "\u7BC4\u56F2\u5185\u306E\u5024\u306E\u5E73\u5747",
2179
+ min: "\u7BC4\u56F2\u5185\u306E\u6700\u5C0F\u5024",
2180
+ max: "\u7BC4\u56F2\u5185\u306E\u6700\u5927\u5024",
2181
+ count: "\u7BC4\u56F2\u5185\u306E\u6570\u5024\u30BB\u30EB\u3092\u30AB\u30A6\u30F3\u30C8"
2182
+ },
2132
2183
  tableMenu: {
2133
2184
  insert3x3: "3x3 \u8868\u3092\u633F\u5165",
2134
2185
  insertTable: "\u8868\u3092\u633F\u5165",
@@ -2163,6 +2214,13 @@ var ja_default = {
2163
2214
  borderWidth: "\u67A0\u7DDA\u306E\u592A\u3055",
2164
2215
  borderColor: "\u67A0\u7DDA\u306E\u8272",
2165
2216
  clearBorder: "\u67A0\u7DDA\u3092\u30AF\u30EA\u30A2",
2217
+ formula: "\u6570\u5F0F",
2218
+ numberFormat: "\u8868\u793A\u5F62\u5F0F",
2219
+ formatText: "\u30C6\u30AD\u30B9\u30C8",
2220
+ formatDate: "\u65E5\u4ED8",
2221
+ apply: "\u9069\u7528",
2222
+ clear: "\u30AF\u30EA\u30A2",
2223
+ recalculate: "\u518D\u8A08\u7B97",
2166
2224
  done: "\u5B8C\u4E86"
2167
2225
  },
2168
2226
  callout: {
@@ -24807,11 +24865,11 @@ function useLocale2() {
24807
24865
  }
24808
24866
 
24809
24867
  // src/components/UEditor/UEditor.tsx
24810
- var import_react69 = __toESM(require("react"), 1);
24811
- var import_react70 = require("@tiptap/react");
24868
+ var import_react71 = __toESM(require("react"), 1);
24869
+ var import_react72 = require("@tiptap/react");
24812
24870
 
24813
24871
  // src/components/UEditor/extensions.ts
24814
- var import_core13 = require("@tiptap/core");
24872
+ var import_core14 = require("@tiptap/core");
24815
24873
  var import_extension_document = __toESM(require("@tiptap/extension-document"), 1);
24816
24874
  var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"), 1);
24817
24875
  var import_extension_text = __toESM(require("@tiptap/extension-text"), 1);
@@ -24827,8 +24885,8 @@ var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"),
24827
24885
  var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"), 1);
24828
24886
  var import_extension_blockquote = __toESM(require("@tiptap/extension-blockquote"), 1);
24829
24887
  var import_extension_code = __toESM(require("@tiptap/extension-code"), 1);
24830
- var import_core14 = require("@tiptap/core");
24831
- var import_react57 = require("@tiptap/react");
24888
+ var import_core15 = require("@tiptap/core");
24889
+ var import_react59 = require("@tiptap/react");
24832
24890
 
24833
24891
  // src/components/UEditor/callout.ts
24834
24892
  var import_core = require("@tiptap/core");
@@ -26858,11 +26916,189 @@ var EmojiSuggestion = import_core6.Extension.create({
26858
26916
  }
26859
26917
  });
26860
26918
 
26861
- // src/components/UEditor/placeholder.ts
26919
+ // src/components/UEditor/formula-suggestion.tsx
26862
26920
  var import_core7 = require("@tiptap/core");
26921
+ var import_suggestion3 = __toESM(require("@tiptap/suggestion"), 1);
26922
+ var import_react53 = require("@tiptap/react");
26863
26923
  var import_state4 = require("@tiptap/pm/state");
26924
+ var import_react54 = __toESM(require("react"), 1);
26925
+ var import_lucide_react45 = require("lucide-react");
26926
+ var import_jsx_runtime81 = require("react/jsx-runtime");
26927
+ var FORMULA_FUNCTIONS = [
26928
+ {
26929
+ name: "SUM",
26930
+ signature: "SUM(range)",
26931
+ descriptionKey: "formulaSuggestion.sum"
26932
+ },
26933
+ {
26934
+ name: "AVG",
26935
+ signature: "AVG(range)",
26936
+ descriptionKey: "formulaSuggestion.avg"
26937
+ },
26938
+ {
26939
+ name: "MIN",
26940
+ signature: "MIN(range)",
26941
+ descriptionKey: "formulaSuggestion.min"
26942
+ },
26943
+ {
26944
+ name: "MAX",
26945
+ signature: "MAX(range)",
26946
+ descriptionKey: "formulaSuggestion.max"
26947
+ },
26948
+ {
26949
+ name: "COUNT",
26950
+ signature: "COUNT(range)",
26951
+ descriptionKey: "formulaSuggestion.count"
26952
+ }
26953
+ ];
26954
+ function isInTableCell(editor) {
26955
+ const { $from } = editor.state.selection;
26956
+ for (let depth = $from.depth; depth > 0; depth -= 1) {
26957
+ const nodeName = $from.node(depth).type.name;
26958
+ if (nodeName === "tableCell" || nodeName === "tableHeader") {
26959
+ return true;
26960
+ }
26961
+ }
26962
+ return false;
26963
+ }
26964
+ function buildFormulaSuggestionItems({ query }) {
26965
+ const normalizedQuery = query.trim().toUpperCase();
26966
+ if (!normalizedQuery) {
26967
+ return FORMULA_FUNCTIONS;
26968
+ }
26969
+ return FORMULA_FUNCTIONS.filter((item) => item.name.startsWith(normalizedQuery));
26970
+ }
26971
+ var FormulaSuggestionList = (0, import_react54.forwardRef)((props, ref) => {
26972
+ const t = useSmartTranslations("UEditor");
26973
+ const [selectedIndex, setSelectedIndex] = import_react54.default.useState(0);
26974
+ import_react54.default.useEffect(() => {
26975
+ setSelectedIndex(0);
26976
+ }, [props.items]);
26977
+ (0, import_react54.useImperativeHandle)(ref, () => ({
26978
+ onKeyDown: ({ event }) => {
26979
+ if (props.items.length === 0) return false;
26980
+ if (event.key === "ArrowUp") {
26981
+ setSelectedIndex((prev) => (prev + props.items.length - 1) % props.items.length);
26982
+ return true;
26983
+ }
26984
+ if (event.key === "ArrowDown") {
26985
+ setSelectedIndex((prev) => (prev + 1) % props.items.length);
26986
+ return true;
26987
+ }
26988
+ if (event.key === "Enter" || event.key === "Tab") {
26989
+ const item = props.items[selectedIndex];
26990
+ if (item) {
26991
+ props.command(item);
26992
+ }
26993
+ return true;
26994
+ }
26995
+ return false;
26996
+ }
26997
+ }));
26998
+ if (props.items.length === 0) {
26999
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("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") });
27000
+ }
27001
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-lg shadow-lg", children: [
27002
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center gap-2", children: [
27003
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react45.Sigma, { className: "w-4 h-4 text-primary" }),
27004
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
27005
+ ] }) }),
27006
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
27007
+ "button",
27008
+ {
27009
+ type: "button",
27010
+ 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"}`,
27011
+ onMouseEnter: () => setSelectedIndex(index),
27012
+ onMouseDown: (event) => event.preventDefault(),
27013
+ onClick: () => props.command(item),
27014
+ children: [
27015
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
27016
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "font-mono text-sm font-semibold", children: item.name }),
27017
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
27018
+ ] }),
27019
+ /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
27020
+ ]
27021
+ },
27022
+ item.name
27023
+ )) })
27024
+ ] });
27025
+ });
27026
+ FormulaSuggestionList.displayName = "FormulaSuggestionList";
27027
+ function insertFormulaFunction(editor, range, item) {
27028
+ const insertedText = `=${item.name}()`;
27029
+ const cursorPosition = range.from + item.name.length + 2;
27030
+ editor.chain().focus().deleteRange(range).insertContent(insertedText).run();
27031
+ editor.commands.setTextSelection(cursorPosition);
27032
+ }
27033
+ var FormulaSuggestion = import_core7.Extension.create({
27034
+ name: "formulaSuggestion",
27035
+ addProseMirrorPlugins() {
27036
+ return [
27037
+ (0, import_suggestion3.default)({
27038
+ editor: this.editor,
27039
+ char: "=",
27040
+ pluginKey: new import_state4.PluginKey("formulaSuggestion"),
27041
+ allow: ({ editor }) => isInTableCell(editor),
27042
+ command: ({ editor, range, props }) => {
27043
+ insertFormulaFunction(editor, range, props);
27044
+ },
27045
+ items: buildFormulaSuggestionItems,
27046
+ render: () => {
27047
+ let component;
27048
+ let popup;
27049
+ return {
27050
+ onStart: (props) => {
27051
+ component = new import_react53.ReactRenderer(FormulaSuggestionList, {
27052
+ props,
27053
+ editor: props.editor
27054
+ });
27055
+ if (!props.clientRect) {
27056
+ return;
27057
+ }
27058
+ popup = tippy("body", {
27059
+ getReferenceClientRect: props.clientRect,
27060
+ appendTo: () => document.body,
27061
+ content: component.element,
27062
+ showOnCreate: true,
27063
+ interactive: true,
27064
+ trigger: "manual",
27065
+ placement: "bottom-start",
27066
+ zIndex: 99999
27067
+ });
27068
+ },
27069
+ onUpdate(props) {
27070
+ component?.updateProps(props);
27071
+ if (!props.clientRect) {
27072
+ return;
27073
+ }
27074
+ popup?.[0]?.setProps({
27075
+ getReferenceClientRect: props.clientRect
27076
+ });
27077
+ },
27078
+ onKeyDown(props) {
27079
+ const popupInstance = getFirstTippyInstance(popup);
27080
+ if (props.event.key === "Escape") {
27081
+ hideTippyInstance(popupInstance);
27082
+ return true;
27083
+ }
27084
+ return component?.ref?.onKeyDown(props) ?? false;
27085
+ },
27086
+ onExit() {
27087
+ destroyTippyInstance(getFirstTippyInstance(popup));
27088
+ component?.destroy();
27089
+ }
27090
+ };
27091
+ }
27092
+ })
27093
+ ];
27094
+ }
27095
+ });
27096
+
27097
+ // src/components/UEditor/placeholder.ts
27098
+ var import_core8 = require("@tiptap/core");
27099
+ var import_state5 = require("@tiptap/pm/state");
26864
27100
  var import_view = require("@tiptap/pm/view");
26865
- var UEditorPlaceholder = import_core7.Extension.create({
27101
+ var UEditorPlaceholder = import_core8.Extension.create({
26866
27102
  name: "placeholder",
26867
27103
  addOptions() {
26868
27104
  return {
@@ -26879,8 +27115,8 @@ var UEditorPlaceholder = import_core7.Extension.create({
26879
27115
  addProseMirrorPlugins() {
26880
27116
  const dataAttribute = `data-${this.options.dataAttribute}`;
26881
27117
  return [
26882
- new import_state4.Plugin({
26883
- key: new import_state4.PluginKey("placeholder"),
27118
+ new import_state5.Plugin({
27119
+ key: new import_state5.PluginKey("placeholder"),
26884
27120
  props: {
26885
27121
  decorations: ({ doc, selection }) => {
26886
27122
  const active = this.editor.isEditable || !this.options.showOnlyWhenEditable;
@@ -26900,7 +27136,7 @@ var UEditorPlaceholder = import_core7.Extension.create({
26900
27136
  });
26901
27137
  doc.descendants((node, pos) => {
26902
27138
  const hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;
26903
- const isEmpty = !node.isLeaf && (0, import_core7.isNodeEmpty)(node);
27139
+ const isEmpty = !node.isLeaf && (0, import_core8.isNodeEmpty)(node);
26904
27140
  if (!((hasAnchor || !this.options.showOnlyCurrent) && isEmpty)) {
26905
27141
  return this.options.includeChildren;
26906
27142
  }
@@ -26932,11 +27168,11 @@ var UEditorPlaceholder = import_core7.Extension.create({
26932
27168
  });
26933
27169
 
26934
27170
  // src/components/UEditor/resizable-image.tsx
26935
- var import_react53 = require("react");
27171
+ var import_react55 = require("react");
26936
27172
  var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
26937
- var import_core8 = require("@tiptap/core");
26938
- var import_react54 = require("@tiptap/react");
26939
- var import_jsx_runtime81 = require("react/jsx-runtime");
27173
+ var import_core9 = require("@tiptap/core");
27174
+ var import_react56 = require("@tiptap/react");
27175
+ var import_jsx_runtime82 = require("react/jsx-runtime");
26940
27176
  var MIN_IMAGE_SIZE_PX = 40;
26941
27177
  var IMAGE_LAYOUTS = /* @__PURE__ */ new Set(["block", "left", "right"]);
26942
27178
  var IMAGE_WIDTH_PRESETS = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
@@ -27015,16 +27251,16 @@ function sizeFromHeight(height, aspect, maxWidth) {
27015
27251
  }
27016
27252
  function ResizableImageNodeView(props) {
27017
27253
  const { node, selected, updateAttributes, editor, getPos } = props;
27018
- const wrapperRef = (0, import_react53.useRef)(null);
27019
- const imgRef = (0, import_react53.useRef)(null);
27020
- const [isHovered, setIsHovered] = (0, import_react53.useState)(false);
27021
- const [isResizing, setIsResizing] = (0, import_react53.useState)(false);
27254
+ const wrapperRef = (0, import_react55.useRef)(null);
27255
+ const imgRef = (0, import_react55.useRef)(null);
27256
+ const [isHovered, setIsHovered] = (0, import_react55.useState)(false);
27257
+ const [isResizing, setIsResizing] = (0, import_react55.useState)(false);
27022
27258
  const widthAttr = toNullableNumber(node.attrs["width"]);
27023
27259
  const heightAttr = toNullableNumber(node.attrs["height"]);
27024
27260
  const textAlign = String(node.attrs["textAlign"] ?? "");
27025
27261
  const imageLayout = parseImageLayout(node.attrs["imageLayout"]);
27026
- const dragStateRef = (0, import_react53.useRef)(null);
27027
- (0, import_react53.useEffect)(() => {
27262
+ const dragStateRef = (0, import_react55.useRef)(null);
27263
+ (0, import_react55.useEffect)(() => {
27028
27264
  const img = imgRef.current;
27029
27265
  if (!img) return;
27030
27266
  img.style.width = widthAttr ? `${widthAttr}px` : "";
@@ -27110,8 +27346,8 @@ function ResizableImageNodeView(props) {
27110
27346
  const showHandle = selected || isHovered || isResizing;
27111
27347
  const wrapperAlignClass = imageLayout === "block" ? textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "" : "";
27112
27348
  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";
27113
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
27114
- import_react54.NodeViewWrapper,
27349
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
27350
+ import_react56.NodeViewWrapper,
27115
27351
  {
27116
27352
  as: "div",
27117
27353
  ref: wrapperRef,
@@ -27125,7 +27361,7 @@ function ResizableImageNodeView(props) {
27125
27361
  },
27126
27362
  contentEditable: false,
27127
27363
  children: [
27128
- /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
27364
+ /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
27129
27365
  "img",
27130
27366
  {
27131
27367
  ref: imgRef,
@@ -27144,7 +27380,7 @@ function ResizableImageNodeView(props) {
27144
27380
  }
27145
27381
  }
27146
27382
  ),
27147
- showHandle && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
27383
+ showHandle && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
27148
27384
  "div",
27149
27385
  {
27150
27386
  "aria-hidden": "true",
@@ -27209,10 +27445,10 @@ var ResizableImage = import_extension_image.default.extend({
27209
27445
  };
27210
27446
  },
27211
27447
  renderHTML({ HTMLAttributes }) {
27212
- return ["img", (0, import_core8.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
27448
+ return ["img", (0, import_core9.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes)];
27213
27449
  },
27214
27450
  addNodeView() {
27215
- return (0, import_react54.ReactNodeViewRenderer)(ResizableImageNodeView);
27451
+ return (0, import_react56.ReactNodeViewRenderer)(ResizableImageNodeView);
27216
27452
  }
27217
27453
  }).configure({
27218
27454
  allowBase64: true,
@@ -27257,8 +27493,8 @@ var UEditorTableRow = import_extension_table_row.default.extend({
27257
27493
  var table_row_default = UEditorTableRow;
27258
27494
 
27259
27495
  // src/components/UEditor/font-family.ts
27260
- var import_core9 = require("@tiptap/core");
27261
- var FontFamily = import_core9.Extension.create({
27496
+ var import_core10 = require("@tiptap/core");
27497
+ var FontFamily = import_core10.Extension.create({
27262
27498
  name: "fontFamily",
27263
27499
  addOptions() {
27264
27500
  return {
@@ -27293,8 +27529,8 @@ var FontFamily = import_core9.Extension.create({
27293
27529
  var font_family_default = FontFamily;
27294
27530
 
27295
27531
  // src/components/UEditor/font-size.ts
27296
- var import_core10 = require("@tiptap/core");
27297
- var FontSize = import_core10.Extension.create({
27532
+ var import_core11 = require("@tiptap/core");
27533
+ var FontSize = import_core11.Extension.create({
27298
27534
  name: "fontSize",
27299
27535
  addOptions() {
27300
27536
  return {
@@ -27329,8 +27565,8 @@ var FontSize = import_core10.Extension.create({
27329
27565
  var font_size_default = FontSize;
27330
27566
 
27331
27567
  // src/components/UEditor/line-height.ts
27332
- var import_core11 = require("@tiptap/core");
27333
- var LineHeight = import_core11.Extension.create({
27568
+ var import_core12 = require("@tiptap/core");
27569
+ var LineHeight = import_core12.Extension.create({
27334
27570
  name: "lineHeight",
27335
27571
  addOptions() {
27336
27572
  return {
@@ -27365,8 +27601,8 @@ var LineHeight = import_core11.Extension.create({
27365
27601
  var line_height_default = LineHeight;
27366
27602
 
27367
27603
  // src/components/UEditor/letter-spacing.ts
27368
- var import_core12 = require("@tiptap/core");
27369
- var LetterSpacing = import_core12.Extension.create({
27604
+ var import_core13 = require("@tiptap/core");
27605
+ var LetterSpacing = import_core13.Extension.create({
27370
27606
  name: "letterSpacing",
27371
27607
  addOptions() {
27372
27608
  return {
@@ -27402,7 +27638,7 @@ var letter_spacing_default = LetterSpacing;
27402
27638
 
27403
27639
  // src/components/UEditor/table-align.ts
27404
27640
  var import_extension_table = require("@tiptap/extension-table");
27405
- var import_state5 = require("@tiptap/pm/state");
27641
+ var import_state6 = require("@tiptap/pm/state");
27406
27642
 
27407
27643
  // src/components/UEditor/table-dom-utils.ts
27408
27644
  var MIN_TABLE_ROW_HEIGHT = 36;
@@ -27644,7 +27880,7 @@ var UEditorTable = import_extension_table.Table.extend({
27644
27880
  addProseMirrorPlugins() {
27645
27881
  return [
27646
27882
  ...this.parent?.() ?? [],
27647
- new import_state5.Plugin({
27883
+ new import_state6.Plugin({
27648
27884
  appendTransaction(_transactions, _oldState, newState) {
27649
27885
  const { doc, schema } = newState;
27650
27886
  const paragraphType = schema.nodes.paragraph;
@@ -27664,10 +27900,10 @@ var UEditorTable = import_extension_table.Table.extend({
27664
27900
  var table_align_default = UEditorTable;
27665
27901
 
27666
27902
  // src/components/UEditor/CodeBlockView.tsx
27667
- var import_react55 = __toESM(require("react"), 1);
27668
- var import_react56 = require("@tiptap/react");
27669
- var import_lucide_react45 = require("lucide-react");
27670
- var import_jsx_runtime82 = require("react/jsx-runtime");
27903
+ var import_react57 = __toESM(require("react"), 1);
27904
+ var import_react58 = require("@tiptap/react");
27905
+ var import_lucide_react46 = require("lucide-react");
27906
+ var import_jsx_runtime83 = require("react/jsx-runtime");
27671
27907
  var LANGUAGES = [
27672
27908
  { label: "Plain Text", value: "text" },
27673
27909
  { label: "JavaScript", value: "javascript" },
@@ -27689,12 +27925,12 @@ var CodeBlockView = ({
27689
27925
  updateAttributes,
27690
27926
  extension
27691
27927
  }) => {
27692
- const [copied, setCopied] = (0, import_react55.useState)(false);
27693
- const [isDropdownOpen, setIsDropdownOpen] = (0, import_react55.useState)(false);
27694
- const timeoutRef = import_react55.default.useRef(null);
27928
+ const [copied, setCopied] = (0, import_react57.useState)(false);
27929
+ const [isDropdownOpen, setIsDropdownOpen] = (0, import_react57.useState)(false);
27930
+ const timeoutRef = import_react57.default.useRef(null);
27695
27931
  const currentLangValue = node.attrs.language || "text";
27696
27932
  const currentLangLabel = LANGUAGES.find((lang) => lang.value === currentLangValue)?.label || "Plain Text";
27697
- import_react55.default.useEffect(() => {
27933
+ import_react57.default.useEffect(() => {
27698
27934
  return () => {
27699
27935
  if (timeoutRef.current) {
27700
27936
  clearTimeout(timeoutRef.current);
@@ -27715,15 +27951,15 @@ var CodeBlockView = ({
27715
27951
  console.error("Failed to copy code text: ", err);
27716
27952
  }
27717
27953
  };
27718
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_react56.NodeViewWrapper, { 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: [
27719
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
27954
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_react58.NodeViewWrapper, { 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: [
27955
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
27720
27956
  "div",
27721
27957
  {
27722
27958
  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",
27723
27959
  contentEditable: false,
27724
27960
  children: [
27725
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "relative", children: [
27726
- /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
27961
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "relative", children: [
27962
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
27727
27963
  "button",
27728
27964
  {
27729
27965
  type: "button",
@@ -27731,19 +27967,19 @@ var CodeBlockView = ({
27731
27967
  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",
27732
27968
  children: [
27733
27969
  currentLangLabel,
27734
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react45.ChevronDown, { className: "h-3 w-3" })
27970
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.ChevronDown, { className: "h-3 w-3" })
27735
27971
  ]
27736
27972
  }
27737
27973
  ),
27738
- isDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_jsx_runtime82.Fragment, { children: [
27739
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
27974
+ isDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
27975
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
27740
27976
  "div",
27741
27977
  {
27742
27978
  className: "fixed inset-0 z-20",
27743
27979
  onClick: () => setIsDropdownOpen(false)
27744
27980
  }
27745
27981
  ),
27746
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("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__ */ (0, import_jsx_runtime82.jsx)(
27982
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("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__ */ (0, import_jsx_runtime83.jsx)(
27747
27983
  "button",
27748
27984
  {
27749
27985
  type: "button",
@@ -27761,20 +27997,20 @@ var CodeBlockView = ({
27761
27997
  )) })
27762
27998
  ] })
27763
27999
  ] }),
27764
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
28000
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
27765
28001
  "button",
27766
28002
  {
27767
28003
  type: "button",
27768
28004
  onClick: handleCopy,
27769
28005
  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",
27770
28006
  title: "Copy code",
27771
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react45.Check, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react45.Copy, { className: "h-3.5 w-3.5" })
28007
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Check, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Copy, { className: "h-3.5 w-3.5" })
27772
28008
  }
27773
28009
  )
27774
28010
  ]
27775
28011
  }
27776
28012
  ),
27777
- /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_react56.NodeViewContent, {}) }) })
28013
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react58.NodeViewContent, {}) }) })
27778
28014
  ] });
27779
28015
  };
27780
28016
 
@@ -27891,7 +28127,7 @@ var CustomTableCell = import_extension_table_cell.default.extend({
27891
28127
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
27892
28128
  return [
27893
28129
  "td",
27894
- (0, import_core13.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
28130
+ (0, import_core14.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
27895
28131
  0
27896
28132
  ];
27897
28133
  }
@@ -27998,7 +28234,7 @@ var CustomTableHeader = import_extension_table_header.default.extend({
27998
28234
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
27999
28235
  return [
28000
28236
  "th",
28001
- (0, import_core13.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
28237
+ (0, import_core14.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
28002
28238
  0
28003
28239
  ];
28004
28240
  }
@@ -28006,15 +28242,15 @@ var CustomTableHeader = import_extension_table_header.default.extend({
28006
28242
  var CustomTaskList = import_extension_task_list.default.extend({
28007
28243
  addInputRules() {
28008
28244
  return [
28009
- (0, import_core14.wrappingInputRule)({
28245
+ (0, import_core15.wrappingInputRule)({
28010
28246
  find: /^\s*(\[ \]|\[\])\s$/,
28011
28247
  type: this.type
28012
28248
  }),
28013
- (0, import_core14.wrappingInputRule)({
28249
+ (0, import_core15.wrappingInputRule)({
28014
28250
  find: /^\s*(-\s*\[ \]|-\s*\[\])\s$/,
28015
28251
  type: this.type
28016
28252
  }),
28017
- (0, import_core14.wrappingInputRule)({
28253
+ (0, import_core15.wrappingInputRule)({
28018
28254
  find: /^\s*(\*\s*\[ \]|-\s*\[\])\s$/,
28019
28255
  type: this.type
28020
28256
  })
@@ -28024,7 +28260,7 @@ var CustomTaskList = import_extension_task_list.default.extend({
28024
28260
  var lowlight = (0, import_lowlight.createLowlight)(import_lowlight.common);
28025
28261
  var CustomCodeBlockLowlight = import_extension_code_block_lowlight.default.extend({
28026
28262
  addNodeView() {
28027
- return (0, import_react57.ReactNodeViewRenderer)(CodeBlockView);
28263
+ return (0, import_react59.ReactNodeViewRenderer)(CodeBlockView);
28028
28264
  }
28029
28265
  });
28030
28266
  function buildUEditorExtensions({
@@ -28160,6 +28396,7 @@ function buildUEditorExtensions({
28160
28396
  SlashCommand.configure({
28161
28397
  messages: buildSlashCommandMessages(translate)
28162
28398
  }),
28399
+ FormulaSuggestion,
28163
28400
  EmojiSuggestion,
28164
28401
  Callout,
28165
28402
  Bookmark.configure({
@@ -28172,19 +28409,19 @@ function buildUEditorExtensions({
28172
28409
  }
28173
28410
 
28174
28411
  // src/components/UEditor/toolbar.tsx
28175
- var import_react60 = __toESM(require("react"), 1);
28176
- var import_react61 = require("@tiptap/react");
28177
- var import_lucide_react48 = require("lucide-react");
28412
+ var import_react62 = __toESM(require("react"), 1);
28413
+ var import_react63 = require("@tiptap/react");
28414
+ var import_lucide_react49 = require("lucide-react");
28178
28415
 
28179
28416
  // src/components/UEditor/colors.tsx
28180
- var import_react58 = require("react");
28181
- var import_lucide_react46 = require("lucide-react");
28182
- var import_jsx_runtime83 = require("react/jsx-runtime");
28417
+ var import_react60 = require("react");
28418
+ var import_lucide_react47 = require("lucide-react");
28419
+ var import_jsx_runtime84 = require("react/jsx-runtime");
28183
28420
  var TextColorIcon = ({ color }) => {
28184
28421
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28185
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28186
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
28187
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28422
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28423
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
28424
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28188
28425
  "span",
28189
28426
  {
28190
28427
  "aria-hidden": "true",
@@ -28196,9 +28433,9 @@ var TextColorIcon = ({ color }) => {
28196
28433
  };
28197
28434
  var HighlightColorIcon = ({ color }) => {
28198
28435
  const underlineColor = color || "currentColor";
28199
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28200
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Highlighter, { className: "h-4 w-4" }),
28201
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28436
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28437
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Highlighter, { className: "h-4 w-4" }),
28438
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28202
28439
  "span",
28203
28440
  {
28204
28441
  "aria-hidden": "true",
@@ -28210,9 +28447,9 @@ var HighlightColorIcon = ({ color }) => {
28210
28447
  };
28211
28448
  var CellBgColorIcon = ({ color }) => {
28212
28449
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28213
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28214
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Paintbrush, { className: "h-4 w-4" }),
28215
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28450
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28451
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Paintbrush, { className: "h-4 w-4" }),
28452
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28216
28453
  "span",
28217
28454
  {
28218
28455
  "aria-hidden": "true",
@@ -28224,9 +28461,9 @@ var CellBgColorIcon = ({ color }) => {
28224
28461
  };
28225
28462
  var CellBorderIcon = ({ color }) => {
28226
28463
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28227
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28228
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Grid, { className: "h-4 w-4" }),
28229
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28464
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28465
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Grid, { className: "h-4 w-4" }),
28466
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28230
28467
  "span",
28231
28468
  {
28232
28469
  "aria-hidden": "true",
@@ -28309,7 +28546,7 @@ function buildColorOptions(colors, prefix) {
28309
28546
  }
28310
28547
  var useEditorColors = () => {
28311
28548
  const t = useSmartTranslations("UEditor");
28312
- const textColors = (0, import_react58.useMemo)(
28549
+ const textColors = (0, import_react60.useMemo)(
28313
28550
  () => [
28314
28551
  { name: t("colors.default"), color: "inherit", cssClass: "text-foreground" },
28315
28552
  { name: t("colors.muted"), color: "var(--muted-foreground)", cssClass: "text-muted-foreground" },
@@ -28323,7 +28560,7 @@ var useEditorColors = () => {
28323
28560
  ],
28324
28561
  [t]
28325
28562
  );
28326
- const highlightColors = (0, import_react58.useMemo)(
28563
+ const highlightColors = (0, import_react60.useMemo)(
28327
28564
  () => [
28328
28565
  { name: t("colors.default"), color: "", cssClass: "" },
28329
28566
  { name: t("colors.muted"), color: "var(--muted)", cssClass: "bg-muted" },
@@ -28347,12 +28584,12 @@ var EditorColorPalette = ({
28347
28584
  label
28348
28585
  }) => {
28349
28586
  const t = useSmartTranslations("UEditor");
28350
- const colorInputRef = (0, import_react58.useRef)(null);
28587
+ const colorInputRef = (0, import_react60.useRef)(null);
28351
28588
  const automaticColor = colors[0]?.color ?? "";
28352
28589
  const paletteColors = colors.slice(1);
28353
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "w-56 p-2", children: [
28354
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
28355
- /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
28590
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "w-56 p-2", children: [
28591
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
28592
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
28356
28593
  "button",
28357
28594
  {
28358
28595
  type: "button",
@@ -28364,12 +28601,12 @@ var EditorColorPalette = ({
28364
28601
  currentColor === automaticColor ? "border-primary text-primary" : "border-transparent text-foreground"
28365
28602
  ),
28366
28603
  children: [
28367
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Check, { className: "h-3.5 w-3.5" }) }),
28368
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "flex-1 text-center", children: t("colors.automatic") })
28604
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Check, { className: "h-3.5 w-3.5" }) }),
28605
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "flex-1 text-center", children: t("colors.automatic") })
28369
28606
  ]
28370
28607
  }
28371
28608
  ),
28372
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Tooltip, { placement: "top", content: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28609
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { placement: "top", content: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28373
28610
  "button",
28374
28611
  {
28375
28612
  type: "button",
@@ -28381,10 +28618,10 @@ var EditorColorPalette = ({
28381
28618
  currentColor === c.color ? "border-primary ring-2 ring-primary/25" : "border-border/70"
28382
28619
  ),
28383
28620
  style: { backgroundColor: c.color || "transparent" },
28384
- children: currentColor === c.color && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Check, { className: "h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.8)]" }) })
28621
+ children: currentColor === c.color && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Check, { className: "h-3.5 w-3.5 text-white drop-shadow-[0_1px_1px_rgba(0,0,0,0.8)]" }) })
28385
28622
  }
28386
28623
  ) }, `${c.name}-${c.color}`)) }),
28387
- /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
28624
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
28388
28625
  "button",
28389
28626
  {
28390
28627
  type: "button",
@@ -28392,7 +28629,7 @@ var EditorColorPalette = ({
28392
28629
  onClick: () => colorInputRef.current?.click(),
28393
28630
  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",
28394
28631
  children: [
28395
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28632
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28396
28633
  "span",
28397
28634
  {
28398
28635
  "aria-hidden": "true",
@@ -28402,9 +28639,9 @@ var EditorColorPalette = ({
28402
28639
  }
28403
28640
  }
28404
28641
  ),
28405
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
28406
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react46.Palette, { className: "h-4 w-4 text-muted-foreground" }),
28407
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
28642
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
28643
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Palette, { className: "h-4 w-4 text-muted-foreground" }),
28644
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28408
28645
  "input",
28409
28646
  {
28410
28647
  ref: colorInputRef,
@@ -28422,7 +28659,7 @@ var EditorColorPalette = ({
28422
28659
  };
28423
28660
 
28424
28661
  // src/components/UEditor/image-commands.ts
28425
- var import_state6 = require("@tiptap/pm/state");
28662
+ var import_state7 = require("@tiptap/pm/state");
28426
28663
  var IMAGE_WIDTHS_BY_LAYOUT = {
28427
28664
  block: {
28428
28665
  sm: 180,
@@ -28437,7 +28674,7 @@ var IMAGE_WIDTHS_BY_LAYOUT = {
28437
28674
  };
28438
28675
  function isSelectedImage(editor) {
28439
28676
  const { selection } = editor.state;
28440
- return selection instanceof import_state6.NodeSelection && selection.node.type.name === "image";
28677
+ return selection instanceof import_state7.NodeSelection && selection.node.type.name === "image";
28441
28678
  }
28442
28679
  function toPositiveNumber(value) {
28443
28680
  if (typeof value === "number" && Number.isFinite(value) && value > 0) return value;
@@ -28479,7 +28716,7 @@ function getImagePresetAttributes(editor, width, preset, attrs, pos) {
28479
28716
  function applyImageLayout(editor, layout) {
28480
28717
  const { state, view } = editor;
28481
28718
  const { selection, schema } = state;
28482
- if (!(selection instanceof import_state6.NodeSelection) || selection.node.type.name !== "image") {
28719
+ if (!(selection instanceof import_state7.NodeSelection) || selection.node.type.name !== "image") {
28483
28720
  editor.chain().focus().updateAttributes("image", { imageLayout: layout }).run();
28484
28721
  return;
28485
28722
  }
@@ -28497,10 +28734,10 @@ function applyImageLayout(editor, layout) {
28497
28734
  }
28498
28735
  }
28499
28736
  const resolvedPos = transaction.doc.resolve(Math.min(nextPos + 1, transaction.doc.content.size));
28500
- transaction = transaction.setSelection(import_state6.TextSelection.near(resolvedPos));
28737
+ transaction = transaction.setSelection(import_state7.TextSelection.near(resolvedPos));
28501
28738
  } else {
28502
28739
  const resolvedPos = transaction.doc.resolve(selection.from);
28503
- transaction = transaction.setSelection(import_state6.NodeSelection.create(transaction.doc, resolvedPos.pos));
28740
+ transaction = transaction.setSelection(import_state7.NodeSelection.create(transaction.doc, resolvedPos.pos));
28504
28741
  }
28505
28742
  view.dispatch(transaction.scrollIntoView());
28506
28743
  view.focus();
@@ -28549,9 +28786,9 @@ function deleteSelectedImage(editor) {
28549
28786
  }
28550
28787
 
28551
28788
  // src/components/UEditor/inputs.tsx
28552
- var import_react59 = require("react");
28553
- var import_lucide_react47 = require("lucide-react");
28554
- var import_jsx_runtime84 = require("react/jsx-runtime");
28789
+ var import_react61 = require("react");
28790
+ var import_lucide_react48 = require("lucide-react");
28791
+ var import_jsx_runtime85 = require("react/jsx-runtime");
28555
28792
  function normalizeUrl(raw) {
28556
28793
  return sanitizeUEditorUrl(raw, "link");
28557
28794
  }
@@ -28561,9 +28798,9 @@ var LinkInput = ({
28561
28798
  initialUrl = ""
28562
28799
  }) => {
28563
28800
  const t = useSmartTranslations("UEditor");
28564
- const [url, setUrl] = (0, import_react59.useState)(initialUrl);
28565
- const inputRef = (0, import_react59.useRef)(null);
28566
- (0, import_react59.useEffect)(() => {
28801
+ const [url, setUrl] = (0, import_react61.useState)(initialUrl);
28802
+ const inputRef = (0, import_react61.useRef)(null);
28803
+ (0, import_react61.useEffect)(() => {
28567
28804
  inputRef.current?.focus();
28568
28805
  inputRef.current?.select();
28569
28806
  }, []);
@@ -28572,8 +28809,8 @@ var LinkInput = ({
28572
28809
  const normalized = normalizeUrl(url);
28573
28810
  if (normalized) onSubmit(normalized);
28574
28811
  };
28575
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
28576
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28812
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
28813
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
28577
28814
  "input",
28578
28815
  {
28579
28816
  ref: inputRef,
@@ -28584,16 +28821,16 @@ var LinkInput = ({
28584
28821
  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"
28585
28822
  }
28586
28823
  ),
28587
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.Check, { className: "w-4 h-4" }) }),
28588
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react47.X, { className: "w-4 h-4" }) })
28824
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Check, { className: "w-4 h-4" }) }),
28825
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.X, { className: "w-4 h-4" }) })
28589
28826
  ] });
28590
28827
  };
28591
28828
  var ImageInput = ({ onSubmit, onCancel }) => {
28592
28829
  const t = useSmartTranslations("UEditor");
28593
- const [url, setUrl] = (0, import_react59.useState)("");
28594
- const [alt, setAlt] = (0, import_react59.useState)("");
28595
- const inputRef = (0, import_react59.useRef)(null);
28596
- (0, import_react59.useEffect)(() => {
28830
+ const [url, setUrl] = (0, import_react61.useState)("");
28831
+ const [alt, setAlt] = (0, import_react61.useState)("");
28832
+ const inputRef = (0, import_react61.useRef)(null);
28833
+ (0, import_react61.useEffect)(() => {
28597
28834
  inputRef.current?.focus();
28598
28835
  }, []);
28599
28836
  const handleSubmit = (e) => {
@@ -28603,10 +28840,10 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28603
28840
  onSubmit(safeUrl, alt);
28604
28841
  }
28605
28842
  };
28606
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
28607
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
28608
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
28609
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28843
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
28844
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { children: [
28845
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
28846
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
28610
28847
  "input",
28611
28848
  {
28612
28849
  ref: inputRef,
@@ -28618,9 +28855,9 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28618
28855
  }
28619
28856
  )
28620
28857
  ] }),
28621
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { children: [
28622
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
28623
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28858
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { children: [
28859
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
28860
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
28624
28861
  "input",
28625
28862
  {
28626
28863
  type: "text",
@@ -28631,8 +28868,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28631
28868
  }
28632
28869
  )
28633
28870
  ] }),
28634
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex gap-2", children: [
28635
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
28871
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex gap-2", children: [
28872
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
28636
28873
  "button",
28637
28874
  {
28638
28875
  type: "submit",
@@ -28641,13 +28878,13 @@ var ImageInput = ({ onSubmit, onCancel }) => {
28641
28878
  children: t("imageInput.addBtn")
28642
28879
  }
28643
28880
  ),
28644
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
28881
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
28645
28882
  ] })
28646
28883
  ] });
28647
28884
  };
28648
28885
 
28649
28886
  // src/components/UEditor/table-cell-commands.ts
28650
- var import_state7 = require("@tiptap/pm/state");
28887
+ var import_state8 = require("@tiptap/pm/state");
28651
28888
  var import_tables = require("@tiptap/pm/tables");
28652
28889
  function getCellSelectionPositions(selection) {
28653
28890
  const value = selection;
@@ -28681,7 +28918,7 @@ function getFocusableCellPos(editor, cellPos) {
28681
28918
  return node?.isTextblock ? offset + 1 : cellPos + 1;
28682
28919
  }
28683
28920
  function focusCell(editor, cellPos) {
28684
- const selection = import_state7.TextSelection.near(editor.state.doc.resolve(getFocusableCellPos(editor, cellPos)));
28921
+ const selection = import_state8.TextSelection.near(editor.state.doc.resolve(getFocusableCellPos(editor, cellPos)));
28685
28922
  editor.view.dispatch(editor.state.tr.setSelection(selection));
28686
28923
  editor.view.focus();
28687
28924
  }
@@ -28972,7 +29209,7 @@ function getDefaultLetterSpacings() {
28972
29209
  }
28973
29210
 
28974
29211
  // src/components/UEditor/toolbar.tsx
28975
- var import_jsx_runtime85 = require("react/jsx-runtime");
29212
+ var import_jsx_runtime86 = require("react/jsx-runtime");
28976
29213
  function getTableAnchorPos(editor) {
28977
29214
  const tableInfo = findTableNodeInfoFromState(editor.state);
28978
29215
  if (tableInfo) return editor.state.selection.from;
@@ -29002,8 +29239,8 @@ function fileToDataUrl2(file) {
29002
29239
  function formatTableInsertLabel(template, rows, cols) {
29003
29240
  return template.replace("{rows}", String(rows)).replace("{cols}", String(cols));
29004
29241
  }
29005
- var ToolbarButton = import_react60.default.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
29006
- const button = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29242
+ var ToolbarButton = import_react62.default.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
29243
+ const button = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29007
29244
  "button",
29008
29245
  {
29009
29246
  ref,
@@ -29028,28 +29265,28 @@ var ToolbarButton = import_react60.default.forwardRef(({ onClick, onMouseDown, a
29028
29265
  }
29029
29266
  );
29030
29267
  if (title) {
29031
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
29268
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
29032
29269
  }
29033
29270
  return button;
29034
29271
  });
29035
29272
  ToolbarButton.displayName = "ToolbarButton";
29036
- var ToolbarDivider = () => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
29273
+ var ToolbarDivider = () => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
29037
29274
  var TableInsertGrid = ({
29038
29275
  insertLabel,
29039
29276
  previewTemplate,
29040
29277
  onInsert
29041
29278
  }) => {
29042
- const [selection, setSelection] = import_react60.default.useState({ rows: 3, cols: 3 });
29279
+ const [selection, setSelection] = import_react62.default.useState({ rows: 3, cols: 3 });
29043
29280
  const maxRows = 8;
29044
29281
  const maxCols = 8;
29045
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
29046
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
29047
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
29282
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
29283
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
29284
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
29048
29285
  (_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
29049
29286
  const rows = rowIndex + 1;
29050
29287
  const cols = colIndex + 1;
29051
29288
  const active = rows <= selection.rows && cols <= selection.cols;
29052
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29289
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29053
29290
  "button",
29054
29291
  {
29055
29292
  type: "button",
@@ -29067,7 +29304,7 @@ var TableInsertGrid = ({
29067
29304
  );
29068
29305
  })
29069
29306
  ) }),
29070
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
29307
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
29071
29308
  ] });
29072
29309
  };
29073
29310
  var EditorToolbar = ({
@@ -29083,18 +29320,18 @@ var EditorToolbar = ({
29083
29320
  letterSpacings
29084
29321
  }) => {
29085
29322
  const t = useSmartTranslations("UEditor");
29086
- (0, import_react61.useEditorState)({
29323
+ (0, import_react63.useEditorState)({
29087
29324
  editor,
29088
29325
  selector: ({ transactionNumber }) => transactionNumber
29089
29326
  });
29090
29327
  const { textColors, highlightColors } = useEditorColors();
29091
- const [showImageInput, setShowImageInput] = (0, import_react60.useState)(false);
29092
- const [showLinkInput, setShowLinkInput] = (0, import_react60.useState)(false);
29093
- const [isTableMenuOpen, setIsTableMenuOpen] = (0, import_react60.useState)(false);
29094
- const tableCommandAnchorPosRef = (0, import_react60.useRef)(null);
29095
- const fileInputRef = (0, import_react60.useRef)(null);
29096
- const [isUploadingImage, setIsUploadingImage] = (0, import_react60.useState)(false);
29097
- const [imageUploadError, setImageUploadError] = (0, import_react60.useState)(null);
29328
+ const [showImageInput, setShowImageInput] = (0, import_react62.useState)(false);
29329
+ const [showLinkInput, setShowLinkInput] = (0, import_react62.useState)(false);
29330
+ const [isTableMenuOpen, setIsTableMenuOpen] = (0, import_react62.useState)(false);
29331
+ const tableCommandAnchorPosRef = (0, import_react62.useRef)(null);
29332
+ const fileInputRef = (0, import_react62.useRef)(null);
29333
+ const [isUploadingImage, setIsUploadingImage] = (0, import_react62.useState)(false);
29334
+ const [imageUploadError, setImageUploadError] = (0, import_react62.useState)(null);
29098
29335
  const isImageSelected = editor.isActive("image");
29099
29336
  const imageAttrs = editor.getAttributes("image");
29100
29337
  const tableAnchorPos = getTableAnchorPos(editor);
@@ -29115,10 +29352,10 @@ var EditorToolbar = ({
29115
29352
  const currentHighlightColor = normalizeStyleValue(editor.getAttributes("highlight").color) || "";
29116
29353
  const currentLineHeight = normalizeStyleValue(textStyleAttrs.lineHeight);
29117
29354
  const currentLetterSpacing = normalizeStyleValue(textStyleAttrs.letterSpacing);
29118
- const availableFontFamilies = import_react60.default.useMemo(() => fontFamilies ?? getDefaultFontFamilies(t), [fontFamilies, t]);
29119
- const availableFontSizes = import_react60.default.useMemo(() => fontSizes ?? getDefaultFontSizes(), [fontSizes]);
29120
- const availableLineHeights = import_react60.default.useMemo(() => lineHeights ?? getDefaultLineHeights(), [lineHeights]);
29121
- const availableLetterSpacings = import_react60.default.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
29355
+ const availableFontFamilies = import_react62.default.useMemo(() => fontFamilies ?? getDefaultFontFamilies(t), [fontFamilies, t]);
29356
+ const availableFontSizes = import_react62.default.useMemo(() => fontSizes ?? getDefaultFontSizes(), [fontSizes]);
29357
+ const availableLineHeights = import_react62.default.useMemo(() => lineHeights ?? getDefaultLineHeights(), [lineHeights]);
29358
+ const availableLetterSpacings = import_react62.default.useMemo(() => letterSpacings ?? getDefaultLetterSpacings(), [letterSpacings]);
29122
29359
  const currentFontFamilyDisplayValue = currentFontFamily.split(",")[0]?.trim() ?? currentFontFamily;
29123
29360
  const currentFontFamilyLabel = availableFontFamilies.find((option) => normalizeStyleValue(option.value) === currentFontFamily)?.label ?? (currentFontFamilyDisplayValue || t("toolbar.fontDefault"));
29124
29361
  const currentFontSizeLabel = availableFontSizes.find((option) => normalizeStyleValue(option.value) === currentFontSize)?.label ?? t("toolbar.sizeDefault");
@@ -29147,41 +29384,41 @@ var EditorToolbar = ({
29147
29384
  setIsUploadingImage(false);
29148
29385
  };
29149
29386
  if (variant === "minimal") {
29150
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-1 border-b border-border/35 bg-muted/30 p-2", children: [
29151
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Bold, { className: "w-4 h-4" }) }),
29152
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Italic, { className: "w-4 h-4" }) }),
29153
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29387
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-1 border-b border-border/35 bg-muted/30 p-2", children: [
29388
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Bold, { className: "w-4 h-4" }) }),
29389
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Italic, { className: "w-4 h-4" }) }),
29390
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29154
29391
  ToolbarButton,
29155
29392
  {
29156
29393
  onClick: () => editor.chain().focus().toggleBulletList().run(),
29157
29394
  active: editor.isActive("bulletList"),
29158
29395
  title: t("toolbar.bulletList"),
29159
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.List, { className: "w-4 h-4" })
29396
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.List, { className: "w-4 h-4" })
29160
29397
  }
29161
29398
  )
29162
29399
  ] });
29163
29400
  }
29164
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("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: [
29165
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29401
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("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: [
29402
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29166
29403
  DropdownMenu,
29167
29404
  {
29168
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29405
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29169
29406
  }, title: t("toolbar.fontFamily"), className: "px-1.5 w-auto gap-0.5", children: [
29170
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Baseline, { className: "w-4 h-4" }),
29171
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29407
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Baseline, { className: "w-4 h-4" }),
29408
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29172
29409
  ] }),
29173
29410
  contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
29174
29411
  children: [
29175
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29412
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29176
29413
  DropdownMenuItem,
29177
29414
  {
29178
- icon: import_lucide_react48.Type,
29415
+ icon: import_lucide_react49.Type,
29179
29416
  label: t("toolbar.fontDefault"),
29180
29417
  onClick: () => editor.chain().focus().unsetFontFamily().run(),
29181
29418
  active: !currentFontFamily
29182
29419
  }
29183
29420
  ),
29184
- availableFontFamilies.map((option) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29421
+ availableFontFamilies.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29185
29422
  DropdownMenuItem,
29186
29423
  {
29187
29424
  label: option.label,
@@ -29194,29 +29431,29 @@ var EditorToolbar = ({
29194
29431
  ]
29195
29432
  }
29196
29433
  ),
29197
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29434
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29198
29435
  DropdownMenu,
29199
29436
  {
29200
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29437
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29201
29438
  }, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-0.5", children: [
29202
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-0.5", children: [
29203
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
29204
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-xs font-bold leading-none", children: "A" })
29439
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-0.5", children: [
29440
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
29441
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "text-xs font-bold leading-none", children: "A" })
29205
29442
  ] }),
29206
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29443
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29207
29444
  ] }),
29208
29445
  contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
29209
29446
  children: [
29210
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29447
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29211
29448
  DropdownMenuItem,
29212
29449
  {
29213
- icon: import_lucide_react48.Type,
29450
+ icon: import_lucide_react49.Type,
29214
29451
  label: t("toolbar.sizeDefault"),
29215
29452
  onClick: () => editor.chain().focus().unsetFontSize().run(),
29216
29453
  active: !currentFontSize
29217
29454
  }
29218
29455
  ),
29219
- availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29456
+ availableFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29220
29457
  DropdownMenuItem,
29221
29458
  {
29222
29459
  label: option.label,
@@ -29228,49 +29465,49 @@ var EditorToolbar = ({
29228
29465
  ]
29229
29466
  }
29230
29467
  ),
29231
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29468
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29232
29469
  DropdownMenu,
29233
29470
  {
29234
29471
  contentClassName: "p-1",
29235
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29472
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29236
29473
  }, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
29237
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Type, { className: "w-4 h-4" }),
29238
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29474
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Type, { className: "w-4 h-4" }),
29475
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "h-3 w-3 text-muted-foreground" })
29239
29476
  ] }),
29240
29477
  children: [
29241
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29478
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29242
29479
  DropdownMenuItem,
29243
29480
  {
29244
- icon: import_lucide_react48.Type,
29481
+ icon: import_lucide_react49.Type,
29245
29482
  label: t("toolbar.normal"),
29246
29483
  onClick: () => editor.chain().focus().setParagraph().run(),
29247
29484
  active: editor.isActive("paragraph")
29248
29485
  }
29249
29486
  ),
29250
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29487
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29251
29488
  DropdownMenuItem,
29252
29489
  {
29253
- icon: import_lucide_react48.Heading1,
29490
+ icon: import_lucide_react49.Heading1,
29254
29491
  label: t("toolbar.heading1"),
29255
29492
  onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
29256
29493
  active: editor.isActive("heading", { level: 1 }),
29257
29494
  shortcut: "Ctrl+Alt+1"
29258
29495
  }
29259
29496
  ),
29260
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29497
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29261
29498
  DropdownMenuItem,
29262
29499
  {
29263
- icon: import_lucide_react48.Heading2,
29500
+ icon: import_lucide_react49.Heading2,
29264
29501
  label: t("toolbar.heading2"),
29265
29502
  onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
29266
29503
  active: editor.isActive("heading", { level: 2 }),
29267
29504
  shortcut: "Ctrl+Alt+2"
29268
29505
  }
29269
29506
  ),
29270
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29507
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29271
29508
  DropdownMenuItem,
29272
29509
  {
29273
- icon: import_lucide_react48.Heading3,
29510
+ icon: import_lucide_react49.Heading3,
29274
29511
  label: t("toolbar.heading3"),
29275
29512
  onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
29276
29513
  active: editor.isActive("heading", { level: 3 }),
@@ -29280,26 +29517,26 @@ var EditorToolbar = ({
29280
29517
  ]
29281
29518
  }
29282
29519
  ),
29283
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29520
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29284
29521
  DropdownMenu,
29285
29522
  {
29286
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29523
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29287
29524
  }, title: t("toolbar.lineHeight"), className: "gap-0.5", children: [
29288
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowUp, { className: "w-3 h-3" }),
29289
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowDown, { className: "w-3 h-3" })
29525
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowUp, { className: "w-3 h-3" }),
29526
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowDown, { className: "w-3 h-3" })
29290
29527
  ] }),
29291
29528
  contentClassName: "max-h-72 overflow-y-auto p-1",
29292
29529
  children: [
29293
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29530
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29294
29531
  DropdownMenuItem,
29295
29532
  {
29296
- icon: import_lucide_react48.Type,
29533
+ icon: import_lucide_react49.Type,
29297
29534
  label: t("toolbar.lineHeightDefault"),
29298
29535
  onClick: () => editor.chain().focus().unsetLineHeight().run(),
29299
29536
  active: !currentLineHeight
29300
29537
  }
29301
29538
  ),
29302
- availableLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29539
+ availableLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29303
29540
  DropdownMenuItem,
29304
29541
  {
29305
29542
  label: option.label,
@@ -29311,26 +29548,26 @@ var EditorToolbar = ({
29311
29548
  ]
29312
29549
  }
29313
29550
  ),
29314
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29551
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29315
29552
  DropdownMenu,
29316
29553
  {
29317
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29554
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29318
29555
  }, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: [
29319
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowLeft, { className: "w-3 h-3" }),
29320
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowRight, { className: "w-3 h-3" })
29556
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowLeft, { className: "w-3 h-3" }),
29557
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowRight, { className: "w-3 h-3" })
29321
29558
  ] }),
29322
29559
  contentClassName: "max-h-72 overflow-y-auto p-1",
29323
29560
  children: [
29324
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29561
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29325
29562
  DropdownMenuItem,
29326
29563
  {
29327
- icon: import_lucide_react48.Type,
29564
+ icon: import_lucide_react49.Type,
29328
29565
  label: t("toolbar.letterSpacingDefault"),
29329
29566
  onClick: () => editor.chain().focus().unsetLetterSpacing().run(),
29330
29567
  active: !currentLetterSpacing
29331
29568
  }
29332
29569
  ),
29333
- availableLetterSpacings.map((option) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29570
+ availableLetterSpacings.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29334
29571
  DropdownMenuItem,
29335
29572
  {
29336
29573
  label: option.label,
@@ -29342,44 +29579,44 @@ var EditorToolbar = ({
29342
29579
  ]
29343
29580
  }
29344
29581
  ),
29345
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29346
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Bold, { className: "w-4 h-4" }) }),
29347
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Italic, { className: "w-4 h-4" }) }),
29348
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29582
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
29583
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Bold, { className: "w-4 h-4" }) }),
29584
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Italic, { className: "w-4 h-4" }) }),
29585
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29349
29586
  ToolbarButton,
29350
29587
  {
29351
29588
  onClick: () => editor.chain().focus().toggleUnderline().run(),
29352
29589
  active: editor.isActive("underline"),
29353
29590
  title: t("toolbar.underline"),
29354
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Underline, { className: "w-4 h-4" })
29591
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Underline, { className: "w-4 h-4" })
29355
29592
  }
29356
29593
  ),
29357
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Strikethrough, { className: "w-4 h-4" }) }),
29358
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Code, { className: "w-4 h-4" }) }),
29359
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29594
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Strikethrough, { className: "w-4 h-4" }) }),
29595
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Code, { className: "w-4 h-4" }) }),
29596
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29360
29597
  ToolbarButton,
29361
29598
  {
29362
29599
  onClick: () => editor.chain().focus().toggleSubscript().run(),
29363
29600
  active: editor.isActive("subscript"),
29364
29601
  title: t("toolbar.subscript"),
29365
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Subscript, { className: "w-4 h-4" })
29602
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Subscript, { className: "w-4 h-4" })
29366
29603
  }
29367
29604
  ),
29368
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29605
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29369
29606
  ToolbarButton,
29370
29607
  {
29371
29608
  onClick: () => editor.chain().focus().toggleSuperscript().run(),
29372
29609
  active: editor.isActive("superscript"),
29373
29610
  title: t("toolbar.superscript"),
29374
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Superscript, { className: "w-4 h-4" })
29611
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Superscript, { className: "w-4 h-4" })
29375
29612
  }
29376
29613
  ),
29377
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29614
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29378
29615
  DropdownMenu,
29379
29616
  {
29380
29617
  contentClassName: "min-w-72",
29381
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Link, { className: "w-4 h-4" }) }),
29382
- children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29618
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Link, { className: "w-4 h-4" }) }),
29619
+ children: showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29383
29620
  LinkInput,
29384
29621
  {
29385
29622
  initialUrl: String(editor.getAttributes("link").href ?? ""),
@@ -29389,21 +29626,21 @@ var EditorToolbar = ({
29389
29626
  },
29390
29627
  onCancel: () => setShowLinkInput(false)
29391
29628
  }
29392
- ) : /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
29393
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29629
+ ) : /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
29630
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29394
29631
  DropdownMenuItem,
29395
29632
  {
29396
- icon: import_lucide_react48.Link,
29633
+ icon: import_lucide_react49.Link,
29397
29634
  label: t("toolbar.link"),
29398
29635
  onClick: () => setShowLinkInput(true),
29399
29636
  active: editor.isActive("link"),
29400
29637
  closeOnSelect: false
29401
29638
  }
29402
29639
  ),
29403
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29640
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29404
29641
  DropdownMenuItem,
29405
29642
  {
29406
- icon: import_lucide_react48.Trash2,
29643
+ icon: import_lucide_react49.Trash2,
29407
29644
  label: t("toolbar.removeLink"),
29408
29645
  onClick: () => editor.chain().focus().extendMarkRange("link").unsetLink().run(),
29409
29646
  disabled: !editor.isActive("link"),
@@ -29413,16 +29650,16 @@ var EditorToolbar = ({
29413
29650
  ] })
29414
29651
  }
29415
29652
  ),
29416
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29417
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29653
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
29654
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29418
29655
  DropdownMenu,
29419
29656
  {
29420
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29657
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29421
29658
  }, title: t("colors.textColor"), children: [
29422
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TextColorIcon, { color: currentTextColor }),
29423
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29659
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TextColorIcon, { color: currentTextColor }),
29660
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29424
29661
  ] }),
29425
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29662
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29426
29663
  EditorColorPalette,
29427
29664
  {
29428
29665
  colors: textColors,
@@ -29439,15 +29676,15 @@ var EditorToolbar = ({
29439
29676
  )
29440
29677
  }
29441
29678
  ),
29442
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29679
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29443
29680
  DropdownMenu,
29444
29681
  {
29445
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29682
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29446
29683
  }, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
29447
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HighlightColorIcon, { color: currentHighlightColor }),
29448
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29684
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(HighlightColorIcon, { color: currentHighlightColor }),
29685
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29449
29686
  ] }),
29450
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29687
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29451
29688
  EditorColorPalette,
29452
29689
  {
29453
29690
  colors: highlightColors,
@@ -29464,14 +29701,14 @@ var EditorToolbar = ({
29464
29701
  )
29465
29702
  }
29466
29703
  ),
29467
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29468
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29704
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
29705
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29469
29706
  DropdownMenu,
29470
29707
  {
29471
29708
  contentClassName: "p-0 overflow-hidden",
29472
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => {
29473
- }, title: t("toolbar.emoji"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Smile, { className: "w-4 h-4" }) }),
29474
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29709
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => {
29710
+ }, title: t("toolbar.emoji"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Smile, { className: "w-4 h-4" }) }),
29711
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29475
29712
  EmojiPicker2,
29476
29713
  {
29477
29714
  onSelect: (emoji) => {
@@ -29481,47 +29718,47 @@ var EditorToolbar = ({
29481
29718
  )
29482
29719
  }
29483
29720
  ),
29484
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29485
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29721
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
29722
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29486
29723
  DropdownMenu,
29487
29724
  {
29488
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29725
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29489
29726
  }, title: t("toolbar.alignment"), children: [
29490
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.AlignLeft, { className: "w-4 h-4" }),
29491
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29727
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.AlignLeft, { className: "w-4 h-4" }),
29728
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29492
29729
  ] }),
29493
29730
  children: [
29494
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29731
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29495
29732
  DropdownMenuItem,
29496
29733
  {
29497
- icon: import_lucide_react48.AlignLeft,
29734
+ icon: import_lucide_react49.AlignLeft,
29498
29735
  label: t("toolbar.alignLeft"),
29499
29736
  onClick: () => editor.chain().focus().setTextAlign("left").run(),
29500
29737
  active: editor.isActive({ textAlign: "left" })
29501
29738
  }
29502
29739
  ),
29503
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29740
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29504
29741
  DropdownMenuItem,
29505
29742
  {
29506
- icon: import_lucide_react48.AlignCenter,
29743
+ icon: import_lucide_react49.AlignCenter,
29507
29744
  label: t("toolbar.alignCenter"),
29508
29745
  onClick: () => editor.chain().focus().setTextAlign("center").run(),
29509
29746
  active: editor.isActive({ textAlign: "center" })
29510
29747
  }
29511
29748
  ),
29512
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29749
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29513
29750
  DropdownMenuItem,
29514
29751
  {
29515
- icon: import_lucide_react48.AlignRight,
29752
+ icon: import_lucide_react49.AlignRight,
29516
29753
  label: t("toolbar.alignRight"),
29517
29754
  onClick: () => editor.chain().focus().setTextAlign("right").run(),
29518
29755
  active: editor.isActive({ textAlign: "right" })
29519
29756
  }
29520
29757
  ),
29521
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29758
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29522
29759
  DropdownMenuItem,
29523
29760
  {
29524
- icon: import_lucide_react48.AlignJustify,
29761
+ icon: import_lucide_react49.AlignJustify,
29525
29762
  label: t("toolbar.justify"),
29526
29763
  onClick: () => editor.chain().focus().setTextAlign("justify").run(),
29527
29764
  active: editor.isActive({ textAlign: "justify" })
@@ -29530,40 +29767,40 @@ var EditorToolbar = ({
29530
29767
  ]
29531
29768
  }
29532
29769
  ),
29533
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29534
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29770
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
29771
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29535
29772
  DropdownMenu,
29536
29773
  {
29537
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29774
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29538
29775
  }, title: t("toolbar.bulletList"), children: [
29539
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.List, { className: "w-4 h-4" }),
29540
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29776
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.List, { className: "w-4 h-4" }),
29777
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29541
29778
  ] }),
29542
29779
  children: [
29543
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29780
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29544
29781
  DropdownMenuItem,
29545
29782
  {
29546
- icon: import_lucide_react48.List,
29783
+ icon: import_lucide_react49.List,
29547
29784
  label: t("toolbar.bulletList"),
29548
29785
  onClick: () => editor.chain().focus().toggleBulletList().run(),
29549
29786
  active: editor.isActive("bulletList"),
29550
29787
  shortcut: "Ctrl+Shift+8"
29551
29788
  }
29552
29789
  ),
29553
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29790
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29554
29791
  DropdownMenuItem,
29555
29792
  {
29556
- icon: import_lucide_react48.ListOrdered,
29793
+ icon: import_lucide_react49.ListOrdered,
29557
29794
  label: t("toolbar.orderedList"),
29558
29795
  onClick: () => editor.chain().focus().toggleOrderedList().run(),
29559
29796
  active: editor.isActive("orderedList"),
29560
29797
  shortcut: "Ctrl+Shift+7"
29561
29798
  }
29562
29799
  ),
29563
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29800
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29564
29801
  DropdownMenuItem,
29565
29802
  {
29566
- icon: import_lucide_react48.ListTodo,
29803
+ icon: import_lucide_react49.ListTodo,
29567
29804
  label: t("toolbar.taskList"),
29568
29805
  onClick: () => editor.chain().focus().toggleTaskList().run(),
29569
29806
  active: editor.isActive("taskList"),
@@ -29573,29 +29810,29 @@ var EditorToolbar = ({
29573
29810
  ]
29574
29811
  }
29575
29812
  ),
29576
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29813
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29577
29814
  DropdownMenu,
29578
29815
  {
29579
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29816
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29580
29817
  }, title: t("toolbar.quote"), children: [
29581
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Quote, { className: "w-4 h-4" }),
29582
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29818
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Quote, { className: "w-4 h-4" }),
29819
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29583
29820
  ] }),
29584
29821
  children: [
29585
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29822
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29586
29823
  DropdownMenuItem,
29587
29824
  {
29588
- icon: import_lucide_react48.Quote,
29825
+ icon: import_lucide_react49.Quote,
29589
29826
  label: t("toolbar.quote"),
29590
29827
  onClick: () => editor.chain().focus().toggleBlockquote().run(),
29591
29828
  active: editor.isActive("blockquote"),
29592
29829
  shortcut: "Ctrl+Shift+B"
29593
29830
  }
29594
29831
  ),
29595
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29832
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29596
29833
  DropdownMenuItem,
29597
29834
  {
29598
- icon: import_lucide_react48.FileCode,
29835
+ icon: import_lucide_react49.FileCode,
29599
29836
  label: t("toolbar.codeBlock"),
29600
29837
  onClick: () => editor.chain().focus().toggleCodeBlock().run(),
29601
29838
  active: editor.isActive("codeBlock"),
@@ -29605,15 +29842,15 @@ var EditorToolbar = ({
29605
29842
  ]
29606
29843
  }
29607
29844
  ),
29608
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29845
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29609
29846
  DropdownMenu,
29610
29847
  {
29611
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29848
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29612
29849
  }, title: t("toolbar.image"), children: [
29613
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Image, { className: "w-4 h-4" }),
29614
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29850
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Image, { className: "w-4 h-4" }),
29851
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29615
29852
  ] }),
29616
- children: showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29853
+ children: showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29617
29854
  ImageInput,
29618
29855
  {
29619
29856
  onSubmit: (url, alt) => {
@@ -29622,20 +29859,20 @@ var EditorToolbar = ({
29622
29859
  },
29623
29860
  onCancel: () => setShowImageInput(false)
29624
29861
  }
29625
- ) : /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
29626
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(DropdownMenuItem, { icon: import_lucide_react48.Link, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
29627
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29862
+ ) : /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
29863
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(DropdownMenuItem, { icon: import_lucide_react49.Link, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
29864
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29628
29865
  DropdownMenuItem,
29629
29866
  {
29630
- icon: import_lucide_react48.Upload,
29867
+ icon: import_lucide_react49.Upload,
29631
29868
  label: isUploadingImage ? t("imageInput.uploading") : t("imageInput.uploadTab"),
29632
29869
  disabled: isUploadingImage,
29633
29870
  onClick: () => fileInputRef.current?.click(),
29634
29871
  closeOnSelect: false
29635
29872
  }
29636
29873
  ),
29637
- imageUploadError && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
29638
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29874
+ imageUploadError && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
29875
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29639
29876
  "input",
29640
29877
  {
29641
29878
  ref: fileInputRef,
@@ -29650,39 +29887,39 @@ var EditorToolbar = ({
29650
29887
  }
29651
29888
  }
29652
29889
  ),
29653
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29654
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29890
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
29891
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29655
29892
  DropdownMenuItem,
29656
29893
  {
29657
- icon: import_lucide_react48.AlignCenter,
29894
+ icon: import_lucide_react49.AlignCenter,
29658
29895
  label: t("toolbar.imageLayoutBlock"),
29659
29896
  onClick: () => applyImageLayout(editor, "block"),
29660
29897
  active: isImageSelected && imageLayout === "block",
29661
29898
  disabled: !isImageSelected
29662
29899
  }
29663
29900
  ),
29664
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29901
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29665
29902
  DropdownMenuItem,
29666
29903
  {
29667
- icon: import_lucide_react48.AlignLeft,
29904
+ icon: import_lucide_react49.AlignLeft,
29668
29905
  label: t("toolbar.imageLayoutLeft"),
29669
29906
  onClick: () => applyImageLayout(editor, "left"),
29670
29907
  active: isImageSelected && imageLayout === "left",
29671
29908
  disabled: !isImageSelected
29672
29909
  }
29673
29910
  ),
29674
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29911
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29675
29912
  DropdownMenuItem,
29676
29913
  {
29677
- icon: import_lucide_react48.AlignRight,
29914
+ icon: import_lucide_react49.AlignRight,
29678
29915
  label: t("toolbar.imageLayoutRight"),
29679
29916
  onClick: () => applyImageLayout(editor, "right"),
29680
29917
  active: isImageSelected && imageLayout === "right",
29681
29918
  disabled: !isImageSelected
29682
29919
  }
29683
29920
  ),
29684
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29685
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29921
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
29922
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29686
29923
  DropdownMenuItem,
29687
29924
  {
29688
29925
  label: t("toolbar.imageWidthSm"),
@@ -29691,7 +29928,7 @@ var EditorToolbar = ({
29691
29928
  disabled: !isImageSelected
29692
29929
  }
29693
29930
  ),
29694
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29931
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29695
29932
  DropdownMenuItem,
29696
29933
  {
29697
29934
  label: t("toolbar.imageWidthMd"),
@@ -29700,7 +29937,7 @@ var EditorToolbar = ({
29700
29937
  disabled: !isImageSelected
29701
29938
  }
29702
29939
  ),
29703
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29940
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29704
29941
  DropdownMenuItem,
29705
29942
  {
29706
29943
  label: t("toolbar.imageWidthLg"),
@@ -29709,20 +29946,20 @@ var EditorToolbar = ({
29709
29946
  disabled: !isImageSelected
29710
29947
  }
29711
29948
  ),
29712
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29713
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29949
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
29950
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29714
29951
  DropdownMenuItem,
29715
29952
  {
29716
- icon: import_lucide_react48.RotateCcw,
29953
+ icon: import_lucide_react49.RotateCcw,
29717
29954
  label: t("toolbar.imageResetSize"),
29718
29955
  onClick: () => resetImageSize(editor),
29719
29956
  disabled: !isImageSelected
29720
29957
  }
29721
29958
  ),
29722
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29959
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29723
29960
  DropdownMenuItem,
29724
29961
  {
29725
- icon: import_lucide_react48.Trash2,
29962
+ icon: import_lucide_react49.Trash2,
29726
29963
  label: t("toolbar.imageDelete"),
29727
29964
  onClick: () => deleteSelectedImage(editor),
29728
29965
  disabled: !isImageSelected,
@@ -29732,7 +29969,7 @@ var EditorToolbar = ({
29732
29969
  ] })
29733
29970
  }
29734
29971
  ),
29735
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
29972
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
29736
29973
  DropdownMenu,
29737
29974
  {
29738
29975
  isOpen: isTableMenuOpen,
@@ -29740,14 +29977,14 @@ var EditorToolbar = ({
29740
29977
  setIsTableMenuOpen(open);
29741
29978
  tableCommandAnchorPosRef.current = open ? getTableAnchorPos(editor) : null;
29742
29979
  },
29743
- trigger: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ToolbarButton, { onClick: () => {
29980
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(ToolbarButton, { onClick: () => {
29744
29981
  }, title: t("toolbar.table"), children: [
29745
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Table, { className: "w-4 h-4" }),
29746
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ChevronDown, { className: "w-3 h-3" })
29982
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Table, { className: "w-4 h-4" }),
29983
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "w-3 h-3" })
29747
29984
  ] }),
29748
29985
  contentClassName: "p-2 min-w-56",
29749
29986
  children: [
29750
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29987
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29751
29988
  TableInsertGrid,
29752
29989
  {
29753
29990
  insertLabel: t("tableMenu.insertTable"),
@@ -29758,116 +29995,116 @@ var EditorToolbar = ({
29758
29995
  }
29759
29996
  }
29760
29997
  ),
29761
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29762
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
29998
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
29999
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29763
30000
  DropdownMenuItem,
29764
30001
  {
29765
- icon: import_lucide_react48.AlignLeft,
30002
+ icon: import_lucide_react49.AlignLeft,
29766
30003
  label: t("tableMenu.alignLeft"),
29767
30004
  onClick: () => applyTableAlignment(editor, "left", tableCommandAnchorPos),
29768
30005
  active: hasTableContext && currentTableAlign === "left",
29769
30006
  disabled: !hasTableContext
29770
30007
  }
29771
30008
  ),
29772
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30009
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29773
30010
  DropdownMenuItem,
29774
30011
  {
29775
- icon: import_lucide_react48.AlignCenter,
30012
+ icon: import_lucide_react49.AlignCenter,
29776
30013
  label: t("tableMenu.alignCenter"),
29777
30014
  onClick: () => applyTableAlignment(editor, "center", tableCommandAnchorPos),
29778
30015
  active: hasTableContext && currentTableAlign === "center",
29779
30016
  disabled: !hasTableContext
29780
30017
  }
29781
30018
  ),
29782
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30019
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29783
30020
  DropdownMenuItem,
29784
30021
  {
29785
- icon: import_lucide_react48.AlignRight,
30022
+ icon: import_lucide_react49.AlignRight,
29786
30023
  label: t("tableMenu.alignRight"),
29787
30024
  onClick: () => applyTableAlignment(editor, "right", tableCommandAnchorPos),
29788
30025
  active: hasTableContext && currentTableAlign === "right",
29789
30026
  disabled: !hasTableContext
29790
30027
  }
29791
30028
  ),
29792
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29793
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30029
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
30030
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29794
30031
  DropdownMenuItem,
29795
30032
  {
29796
- icon: import_lucide_react48.ArrowLeft,
30033
+ icon: import_lucide_react49.ArrowLeft,
29797
30034
  label: t("tableMenu.addColumnBefore"),
29798
30035
  onClick: () => editor.chain().focus().addColumnBefore().run(),
29799
30036
  disabled: !hasTableContext || !editor.can().addColumnBefore()
29800
30037
  }
29801
30038
  ),
29802
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30039
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29803
30040
  DropdownMenuItem,
29804
30041
  {
29805
- icon: import_lucide_react48.ArrowDown,
30042
+ icon: import_lucide_react49.ArrowDown,
29806
30043
  label: t("tableMenu.addColumnAfter"),
29807
30044
  onClick: () => editor.chain().focus().addColumnAfter().run(),
29808
30045
  disabled: !hasTableContext || !editor.can().addColumnAfter()
29809
30046
  }
29810
30047
  ),
29811
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30048
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29812
30049
  DropdownMenuItem,
29813
30050
  {
29814
- icon: import_lucide_react48.ArrowUp,
30051
+ icon: import_lucide_react49.ArrowUp,
29815
30052
  label: t("tableMenu.addRowBefore"),
29816
30053
  onClick: () => editor.chain().focus().addRowBefore().run(),
29817
30054
  disabled: !hasTableContext || !editor.can().addRowBefore()
29818
30055
  }
29819
30056
  ),
29820
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30057
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29821
30058
  DropdownMenuItem,
29822
30059
  {
29823
- icon: import_lucide_react48.ArrowRight,
30060
+ icon: import_lucide_react49.ArrowRight,
29824
30061
  label: t("tableMenu.addRowAfter"),
29825
30062
  onClick: () => editor.chain().focus().addRowAfter().run(),
29826
30063
  disabled: !hasTableContext || !editor.can().addRowAfter()
29827
30064
  }
29828
30065
  ),
29829
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29830
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30066
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
30067
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29831
30068
  DropdownMenuItem,
29832
30069
  {
29833
- icon: import_lucide_react48.Table,
30070
+ icon: import_lucide_react49.Table,
29834
30071
  label: t("tableMenu.toggleHeaderRow"),
29835
30072
  onClick: () => editor.chain().focus().toggleHeaderRow().run(),
29836
30073
  disabled: !hasTableContext || !editor.can().toggleHeaderRow()
29837
30074
  }
29838
30075
  ),
29839
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30076
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29840
30077
  DropdownMenuItem,
29841
30078
  {
29842
- icon: import_lucide_react48.Table,
30079
+ icon: import_lucide_react49.Table,
29843
30080
  label: t("tableMenu.toggleHeaderColumn"),
29844
30081
  onClick: () => editor.chain().focus().toggleHeaderColumn().run(),
29845
30082
  disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
29846
30083
  }
29847
30084
  ),
29848
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "my-1 border-t" }),
29849
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30085
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "my-1 border-t" }),
30086
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29850
30087
  DropdownMenuItem,
29851
30088
  {
29852
- icon: import_lucide_react48.Trash2,
30089
+ icon: import_lucide_react49.Trash2,
29853
30090
  label: t("tableMenu.deleteColumn"),
29854
30091
  onClick: () => editor.chain().focus().deleteColumn().run(),
29855
30092
  disabled: !hasTableContext || !editor.can().deleteColumn()
29856
30093
  }
29857
30094
  ),
29858
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30095
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29859
30096
  DropdownMenuItem,
29860
30097
  {
29861
- icon: import_lucide_react48.Trash2,
30098
+ icon: import_lucide_react49.Trash2,
29862
30099
  label: t("tableMenu.deleteRow"),
29863
30100
  onClick: () => editor.chain().focus().deleteRow().run(),
29864
30101
  disabled: !hasTableContext || !editor.can().deleteRow()
29865
30102
  }
29866
30103
  ),
29867
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30104
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29868
30105
  DropdownMenuItem,
29869
30106
  {
29870
- icon: import_lucide_react48.Trash2,
30107
+ icon: import_lucide_react49.Trash2,
29871
30108
  label: t("tableMenu.deleteTable"),
29872
30109
  onClick: () => editor.chain().focus().deleteTable().run(),
29873
30110
  disabled: !hasTableContext || !editor.can().deleteTable()
@@ -29876,48 +30113,48 @@ var EditorToolbar = ({
29876
30113
  ]
29877
30114
  }
29878
30115
  ),
29879
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29880
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Undo, { className: "w-4 h-4" }) }),
29881
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.Redo, { className: "w-4 h-4" }) }),
29882
- hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
29883
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ToolbarDivider, {}),
29884
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30116
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
30117
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Undo, { className: "w-4 h-4" }) }),
30118
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Redo, { className: "w-4 h-4" }) }),
30119
+ hasTableContext && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
30120
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarDivider, {}),
30121
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29885
30122
  ToolbarButton,
29886
30123
  {
29887
30124
  onClick: () => editor.chain().focus().addColumnBefore().run(),
29888
30125
  disabled: !editor.can().addColumnBefore(),
29889
30126
  title: t("tableMenu.addColumnBefore"),
29890
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowLeft, { className: "w-4 h-4" })
30127
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowLeft, { className: "w-4 h-4" })
29891
30128
  }
29892
30129
  ),
29893
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30130
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29894
30131
  ToolbarButton,
29895
30132
  {
29896
30133
  onClick: () => editor.chain().focus().addColumnAfter().run(),
29897
30134
  disabled: !editor.can().addColumnAfter(),
29898
30135
  title: t("tableMenu.addColumnAfter"),
29899
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowRight, { className: "w-4 h-4" })
30136
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowRight, { className: "w-4 h-4" })
29900
30137
  }
29901
30138
  ),
29902
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30139
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29903
30140
  ToolbarButton,
29904
30141
  {
29905
30142
  onClick: () => editor.chain().focus().addRowBefore().run(),
29906
30143
  disabled: !editor.can().addRowBefore(),
29907
30144
  title: t("tableMenu.addRowBefore"),
29908
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowUp, { className: "w-4 h-4" })
30145
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowUp, { className: "w-4 h-4" })
29909
30146
  }
29910
30147
  ),
29911
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30148
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29912
30149
  ToolbarButton,
29913
30150
  {
29914
30151
  onClick: () => editor.chain().focus().addRowAfter().run(),
29915
30152
  disabled: !editor.can().addRowAfter(),
29916
30153
  title: t("tableMenu.addRowAfter"),
29917
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.ArrowDown, { className: "w-4 h-4" })
30154
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ArrowDown, { className: "w-4 h-4" })
29918
30155
  }
29919
30156
  ),
29920
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
30157
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
29921
30158
  ToolbarButton,
29922
30159
  {
29923
30160
  onClick: () => {
@@ -29930,7 +30167,7 @@ var EditorToolbar = ({
29930
30167
  active: canSplitCell,
29931
30168
  disabled: !canMergeCells && !canSplitCell,
29932
30169
  title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
29933
- children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.TableCellsMerge, { className: "w-4 h-4" })
30170
+ children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.TableCellsMerge, { className: "w-4 h-4" })
29934
30171
  }
29935
30172
  )
29936
30173
  ] })
@@ -29938,11 +30175,11 @@ var EditorToolbar = ({
29938
30175
  };
29939
30176
 
29940
30177
  // src/components/UEditor/menus.tsx
29941
- var import_react62 = require("react");
29942
- var import_react63 = require("@tiptap/react");
30178
+ var import_react64 = require("react");
30179
+ var import_react65 = require("@tiptap/react");
29943
30180
  var import_tables3 = require("@tiptap/pm/tables");
29944
30181
  var import_react_dom8 = require("react-dom");
29945
- var import_lucide_react49 = require("lucide-react");
30182
+ var import_lucide_react50 = require("lucide-react");
29946
30183
 
29947
30184
  // src/components/UEditor/table-formula-commands.ts
29948
30185
  var import_tables2 = require("@tiptap/pm/tables");
@@ -30019,9 +30256,67 @@ function getTableCellRangeLabels(range) {
30019
30256
  function normalizeTableFormula(formula) {
30020
30257
  return formula.trim().replace(/^=/, "").trim();
30021
30258
  }
30259
+ function isDraftTableFormula(formula) {
30260
+ const normalized = normalizeTableFormula(formula);
30261
+ if (!normalized) return true;
30262
+ let depth = 0;
30263
+ for (const char of normalized) {
30264
+ if (char === "(") depth += 1;
30265
+ if (char === ")") depth -= 1;
30266
+ if (depth < 0) return false;
30267
+ }
30268
+ if (depth > 0) return true;
30269
+ if (/^[A-Z]+\(\s*\)$/i.test(normalized)) return true;
30270
+ if (/[+\-*/,(]\s*$/.test(normalized)) return true;
30271
+ return false;
30272
+ }
30022
30273
  function formatFormulaError(error) {
30023
30274
  return `#${error.toUpperCase()}`;
30024
30275
  }
30276
+ function normalizeTableNumberFormat(format) {
30277
+ return format === "text" || format === "number" || format === "currency" || format === "percent" || format === "date" ? format : "text";
30278
+ }
30279
+ function formatTableFormulaDisplayValue(value, numberFormat) {
30280
+ const stringValue = String(value);
30281
+ if (stringValue.startsWith("#")) {
30282
+ return stringValue;
30283
+ }
30284
+ const normalizedFormat = normalizeTableNumberFormat(numberFormat);
30285
+ if (normalizedFormat === "text") {
30286
+ return stringValue;
30287
+ }
30288
+ const numericValue = typeof value === "number" ? value : Number.parseFloat(stringValue.replace(/,/g, ""));
30289
+ if (!Number.isFinite(numericValue)) {
30290
+ return stringValue;
30291
+ }
30292
+ if (normalizedFormat === "number") {
30293
+ return new Intl.NumberFormat("en-US", { maximumFractionDigits: 6 }).format(numericValue);
30294
+ }
30295
+ if (normalizedFormat === "currency") {
30296
+ return new Intl.NumberFormat("en-US", {
30297
+ style: "currency",
30298
+ currency: "USD",
30299
+ maximumFractionDigits: 2
30300
+ }).format(numericValue);
30301
+ }
30302
+ if (normalizedFormat === "percent") {
30303
+ return new Intl.NumberFormat("en-US", {
30304
+ style: "percent",
30305
+ maximumFractionDigits: 2
30306
+ }).format(numericValue);
30307
+ }
30308
+ const excelEpochMs = Date.UTC(1899, 11, 30);
30309
+ const date = new Date(excelEpochMs + numericValue * 24 * 60 * 60 * 1e3);
30310
+ if (Number.isNaN(date.getTime())) {
30311
+ return stringValue;
30312
+ }
30313
+ return new Intl.DateTimeFormat("en-US", {
30314
+ year: "numeric",
30315
+ month: "2-digit",
30316
+ day: "2-digit",
30317
+ timeZone: "UTC"
30318
+ }).format(date);
30319
+ }
30025
30320
  function getTableFormulaReferences(formula) {
30026
30321
  const normalized = normalizeTableFormula(formula);
30027
30322
  if (!normalized) return [];
@@ -30418,24 +30713,70 @@ function setSelectedTableCellFormula(editor, formula) {
30418
30713
  function clearSelectedTableCellFormula(editor) {
30419
30714
  return setSelectedTableCellFormula(editor, "");
30420
30715
  }
30716
+ function setSelectedTableCellNumberFormat(editor, numberFormat) {
30717
+ const value = numberFormat && numberFormat !== "text" ? numberFormat : null;
30718
+ const { state, view } = editor;
30719
+ const applied = (0, import_tables2.setCellAttr)("numberFormat", value)(state, view.dispatch.bind(view));
30720
+ if (!applied) return false;
30721
+ recalculateSelectedTable(editor);
30722
+ view.focus();
30723
+ dispatchTableLayoutChange(editor);
30724
+ return true;
30725
+ }
30421
30726
  function promoteFormulaTextInTableNode(tableNode) {
30422
30727
  let changed = false;
30423
30728
  const rows = getTableRows2(tableNode).map((rowInfo) => {
30424
30729
  const cells = collectChildren2(rowInfo.node);
30425
30730
  for (const entry of rowInfo.cells) {
30426
30731
  const text = getCellText(entry.node);
30427
- const formula = text.startsWith("=") ? normalizeFormulaInput(text) : "";
30428
- if (!formula || entry.node.attrs.formula === formula) continue;
30429
- cells[entry.index] = entry.node.type.create(
30430
- {
30431
- ...entry.node.attrs,
30432
- formula,
30433
- computedValue: null
30434
- },
30435
- entry.node.content,
30436
- entry.node.marks
30437
- );
30438
- changed = true;
30732
+ const existingFormula = typeof entry.node.attrs.formula === "string" ? entry.node.attrs.formula.trim() : "";
30733
+ const existingComputedValue = typeof entry.node.attrs.computedValue === "string" ? entry.node.attrs.computedValue.trim() : "";
30734
+ if (text.startsWith("=")) {
30735
+ if (!normalizeTableFormula(text)) {
30736
+ if (!existingFormula && !existingComputedValue) continue;
30737
+ cells[entry.index] = entry.node.type.create(
30738
+ {
30739
+ ...entry.node.attrs,
30740
+ formula: null,
30741
+ computedValue: null
30742
+ },
30743
+ text === formatFormulaError("empty") ? createCellDisplayContent(entry.node, "") : entry.node.content,
30744
+ entry.node.marks
30745
+ );
30746
+ changed = true;
30747
+ continue;
30748
+ }
30749
+ if (isDraftTableFormula(text)) {
30750
+ continue;
30751
+ }
30752
+ const formula = normalizeFormulaInput(text);
30753
+ if (entry.node.attrs.formula === formula) continue;
30754
+ cells[entry.index] = entry.node.type.create(
30755
+ {
30756
+ ...entry.node.attrs,
30757
+ formula,
30758
+ computedValue: null
30759
+ },
30760
+ entry.node.content,
30761
+ entry.node.marks
30762
+ );
30763
+ changed = true;
30764
+ continue;
30765
+ }
30766
+ if (existingFormula) {
30767
+ const isExistingEmptyFormula = !normalizeTableFormula(existingFormula);
30768
+ if (!isExistingEmptyFormula) continue;
30769
+ cells[entry.index] = entry.node.type.create(
30770
+ {
30771
+ ...entry.node.attrs,
30772
+ formula: null,
30773
+ computedValue: null
30774
+ },
30775
+ isExistingEmptyFormula && text === formatFormulaError("empty") ? createCellDisplayContent(entry.node, "") : entry.node.content,
30776
+ entry.node.marks
30777
+ );
30778
+ changed = true;
30779
+ }
30439
30780
  }
30440
30781
  return rowInfo.node.type.create(rowInfo.node.attrs, cells);
30441
30782
  });
@@ -30496,14 +30837,15 @@ function recalculateTableNode(tableNode) {
30496
30837
  const label = `${indexToColumnName(rectForCell.left)}${rectForCell.top + 1}`;
30497
30838
  const computedValue = computedValues.get(label);
30498
30839
  if (computedValue == null) continue;
30499
- const contentMatchesComputedValue = getCellText(entry.node) === computedValue;
30840
+ const displayValue = formatTableFormulaDisplayValue(computedValue, entry.node.attrs.numberFormat);
30841
+ const contentMatchesComputedValue = getCellText(entry.node) === displayValue;
30500
30842
  if (entry.node.attrs.computedValue === computedValue && contentMatchesComputedValue) continue;
30501
30843
  cells[entry.index] = entry.node.type.create(
30502
30844
  {
30503
30845
  ...entry.node.attrs,
30504
30846
  computedValue
30505
30847
  },
30506
- createCellDisplayContent(entry.node, computedValue),
30848
+ createCellDisplayContent(entry.node, displayValue),
30507
30849
  entry.node.marks
30508
30850
  );
30509
30851
  changed = true;
@@ -30549,7 +30891,7 @@ function recalculateAllTableFormulas(editor) {
30549
30891
  }
30550
30892
 
30551
30893
  // src/components/UEditor/menus.tsx
30552
- var import_jsx_runtime86 = require("react/jsx-runtime");
30894
+ var import_jsx_runtime87 = require("react/jsx-runtime");
30553
30895
  function applyTableCellBackground(editor, color) {
30554
30896
  const value = color || null;
30555
30897
  const { state, view } = editor;
@@ -30568,21 +30910,21 @@ var BubbleMenuContent = ({
30568
30910
  initialShowLinkInput = false
30569
30911
  }) => {
30570
30912
  const t = useSmartTranslations("UEditor");
30571
- (0, import_react63.useEditorState)({
30913
+ (0, import_react65.useEditorState)({
30572
30914
  editor,
30573
30915
  selector: ({ transactionNumber }) => transactionNumber
30574
30916
  });
30575
30917
  const { textColors, highlightColors } = useEditorColors();
30576
- const [showLinkInput, setShowLinkInput] = (0, import_react62.useState)(initialShowLinkInput);
30577
- const [activeColorPalette, setActiveColorPalette] = (0, import_react62.useState)(null);
30578
- (0, import_react62.useEffect)(() => {
30918
+ const [showLinkInput, setShowLinkInput] = (0, import_react64.useState)(initialShowLinkInput);
30919
+ const [activeColorPalette, setActiveColorPalette] = (0, import_react64.useState)(null);
30920
+ (0, import_react64.useEffect)(() => {
30579
30921
  setShowLinkInput(initialShowLinkInput);
30580
30922
  }, [initialShowLinkInput]);
30581
- const [showTypographyPanel, setShowTypographyPanel] = (0, import_react62.useState)(false);
30582
- const [showFormulaPanel, setShowFormulaPanel] = (0, import_react62.useState)(false);
30583
- const [formulaDraft, setFormulaDraft] = (0, import_react62.useState)("");
30584
- const [showFontSizeOptions, setShowFontSizeOptions] = (0, import_react62.useState)(false);
30585
- const [fontSizeDraft, setFontSizeDraft] = (0, import_react62.useState)("");
30923
+ const [showTypographyPanel, setShowTypographyPanel] = (0, import_react64.useState)(false);
30924
+ const [showFormulaPanel, setShowFormulaPanel] = (0, import_react64.useState)(false);
30925
+ const [formulaDraft, setFormulaDraft] = (0, import_react64.useState)("");
30926
+ const [showFontSizeOptions, setShowFontSizeOptions] = (0, import_react64.useState)(false);
30927
+ const [fontSizeDraft, setFontSizeDraft] = (0, import_react64.useState)("");
30586
30928
  const isImageSelected = editor.isActive("image");
30587
30929
  const imageAttrs = editor.getAttributes("image");
30588
30930
  const imageLayout = imageAttrs.imageLayout === "left" || imageAttrs.imageLayout === "right" ? imageAttrs.imageLayout : "block";
@@ -30592,23 +30934,24 @@ var BubbleMenuContent = ({
30592
30934
  const currentHighlightColor = normalizeStyleValue(editor.getAttributes("highlight").color) || "";
30593
30935
  const currentCellBgColor = normalizeStyleValue(editor.getAttributes("tableCell").backgroundColor || editor.getAttributes("tableHeader").backgroundColor) || "";
30594
30936
  const currentCellFormula = normalizeStyleValue(editor.getAttributes("tableCell").formula || editor.getAttributes("tableHeader").formula) || "";
30937
+ const currentCellNumberFormat = normalizeStyleValue(editor.getAttributes("tableCell").numberFormat || editor.getAttributes("tableHeader").numberFormat) || "text";
30595
30938
  const isInTable2 = (0, import_tables3.isInTable)(editor.state);
30596
30939
  const canMergeCells = isInTable2 && editor.can().mergeCells();
30597
30940
  const canSplitCell = isInTable2 && editor.can().splitCell();
30598
30941
  const currentFontSize = normalizeStyleValue(textStyleAttrs.fontSize);
30599
30942
  const currentLineHeight = normalizeStyleValue(textStyleAttrs.lineHeight);
30600
- const quickFontSizes = (0, import_react62.useMemo)(
30943
+ const quickFontSizes = (0, import_react64.useMemo)(
30601
30944
  () => (fontSizes ?? getDefaultFontSizes()).filter((option) => ["14px", "16px", "24px"].includes(option.value)),
30602
30945
  [fontSizes]
30603
30946
  );
30604
- const quickLineHeights = (0, import_react62.useMemo)(
30947
+ const quickLineHeights = (0, import_react64.useMemo)(
30605
30948
  () => (lineHeights ?? getDefaultLineHeights()).filter((option) => ["1.2", "1.5", "1.75"].includes(option.value)),
30606
30949
  [lineHeights]
30607
30950
  );
30608
- (0, import_react62.useEffect)(() => {
30951
+ (0, import_react64.useEffect)(() => {
30609
30952
  setFontSizeDraft(currentFontSize.replace(/px$/i, ""));
30610
30953
  }, [currentFontSize]);
30611
- (0, import_react62.useEffect)(() => {
30954
+ (0, import_react64.useEffect)(() => {
30612
30955
  setFormulaDraft(currentCellFormula);
30613
30956
  }, [currentCellFormula]);
30614
30957
  const applyFontSizeDraft = () => {
@@ -30623,10 +30966,10 @@ var BubbleMenuContent = ({
30623
30966
  editor.chain().focus().setFontSize(`${clamped}px`).run();
30624
30967
  setFontSizeDraft(String(clamped));
30625
30968
  };
30626
- (0, import_react62.useEffect)(() => {
30969
+ (0, import_react64.useEffect)(() => {
30627
30970
  onKeepOpenChange?.(showLinkInput);
30628
30971
  }, [onKeepOpenChange, showLinkInput]);
30629
- (0, import_react62.useEffect)(() => {
30972
+ (0, import_react64.useEffect)(() => {
30630
30973
  if (!showLinkInput) return;
30631
30974
  const close2 = () => setShowLinkInput(false);
30632
30975
  editor.on("selectionUpdate", close2);
@@ -30637,7 +30980,7 @@ var BubbleMenuContent = ({
30637
30980
  };
30638
30981
  }, [editor, showLinkInput]);
30639
30982
  if (showLinkInput) {
30640
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
30983
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30641
30984
  LinkInput,
30642
30985
  {
30643
30986
  initialUrl: editor.getAttributes("link").href || "",
@@ -30660,11 +31003,11 @@ var BubbleMenuContent = ({
30660
31003
  const currentBorderStyle = editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || "solid";
30661
31004
  const currentBorderWidth = editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth || "1px";
30662
31005
  const currentBorderColor = editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || "currentColor";
30663
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", children: [
30664
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
30665
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-1", children: [
30666
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
30667
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
31006
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", children: [
31007
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
31008
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1", children: [
31009
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
31010
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
30668
31011
  "select",
30669
31012
  {
30670
31013
  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",
@@ -30674,18 +31017,18 @@ var BubbleMenuContent = ({
30674
31017
  editor.chain().focus().setCellAttribute("borderStyle", style).run();
30675
31018
  },
30676
31019
  children: [
30677
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "solid", children: "Solid" }),
30678
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "dashed", children: "Dashed" }),
30679
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "dotted", children: "Dotted" }),
30680
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "double", children: "Double" }),
30681
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "none", children: "None" })
31020
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "solid", children: "Solid" }),
31021
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "dashed", children: "Dashed" }),
31022
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "dotted", children: "Dotted" }),
31023
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "double", children: "Double" }),
31024
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "none", children: "None" })
30682
31025
  ]
30683
31026
  }
30684
31027
  )
30685
31028
  ] }),
30686
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex flex-col gap-1", children: [
30687
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
30688
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
31029
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1", children: [
31030
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
31031
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
30689
31032
  "select",
30690
31033
  {
30691
31034
  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",
@@ -30695,23 +31038,23 @@ var BubbleMenuContent = ({
30695
31038
  editor.chain().focus().setCellAttribute("borderWidth", width).run();
30696
31039
  },
30697
31040
  children: [
30698
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "1px", children: "1px" }),
30699
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "2px", children: "2px" }),
30700
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "3px", children: "3px" }),
30701
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("option", { value: "4px", children: "4px" })
31041
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "1px", children: "1px" }),
31042
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "2px", children: "2px" }),
31043
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "3px", children: "3px" }),
31044
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("option", { value: "4px", children: "4px" })
30702
31045
  ]
30703
31046
  }
30704
31047
  )
30705
31048
  ] }),
30706
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
31049
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
30707
31050
  "button",
30708
31051
  {
30709
31052
  type: "button",
30710
31053
  onClick: () => setActiveColorPalette("cell-border-color"),
30711
31054
  className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
30712
31055
  children: [
30713
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { children: t("tableMenu.borderColor") || "Border Color" }),
30714
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31056
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: t("tableMenu.borderColor") || "Border Color" }),
31057
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30715
31058
  "span",
30716
31059
  {
30717
31060
  className: "w-4 h-4 rounded-full border border-border",
@@ -30723,8 +31066,8 @@ var BubbleMenuContent = ({
30723
31066
  ]
30724
31067
  }
30725
31068
  ),
30726
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: [
30727
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31069
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: [
31070
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30728
31071
  "button",
30729
31072
  {
30730
31073
  type: "button",
@@ -30736,7 +31079,7 @@ var BubbleMenuContent = ({
30736
31079
  children: t("tableMenu.clearBorder") || "Clear Border"
30737
31080
  }
30738
31081
  ),
30739
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31082
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30740
31083
  "button",
30741
31084
  {
30742
31085
  type: "button",
@@ -30750,7 +31093,7 @@ var BubbleMenuContent = ({
30750
31093
  }
30751
31094
  if (activeColorPalette === "cell-border-color") {
30752
31095
  const currentBorderColor = normalizeStyleValue(editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor) || "";
30753
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-56", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31096
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-56", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30754
31097
  EditorColorPalette,
30755
31098
  {
30756
31099
  colors: highlightColors,
@@ -30764,7 +31107,7 @@ var BubbleMenuContent = ({
30764
31107
  }
30765
31108
  ) });
30766
31109
  }
30767
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-56", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31110
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-56", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30768
31111
  EditorColorPalette,
30769
31112
  {
30770
31113
  colors: isTextPalette ? textColors : highlightColors,
@@ -30792,32 +31135,32 @@ var BubbleMenuContent = ({
30792
31135
  ) });
30793
31136
  }
30794
31137
  if (isImageSelected) {
30795
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
30796
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.AlignCenter, { className: "w-4 h-4" }) }),
30797
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.AlignLeft, { className: "w-4 h-4" }) }),
30798
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.AlignRight, { className: "w-4 h-4" }) }),
30799
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
30800
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "text-[10px] font-semibold", children: "S" }) }),
30801
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "text-[10px] font-semibold", children: "M" }) }),
30802
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "text-[10px] font-semibold", children: "L" }) }),
30803
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
30804
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.RotateCcw, { className: "w-4 h-4" }) }),
30805
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31138
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
31139
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.AlignCenter, { className: "w-4 h-4" }) }),
31140
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.AlignLeft, { className: "w-4 h-4" }) }),
31141
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.AlignRight, { className: "w-4 h-4" }) }),
31142
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31143
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-[10px] font-semibold", children: "S" }) }),
31144
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-[10px] font-semibold", children: "M" }) }),
31145
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-[10px] font-semibold", children: "L" }) }),
31146
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31147
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.RotateCcw, { className: "w-4 h-4" }) }),
31148
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30806
31149
  ToolbarButton,
30807
31150
  {
30808
31151
  onClick: () => deleteSelectedImage(editor),
30809
31152
  title: t("toolbar.imageDelete"),
30810
31153
  className: "text-destructive hover:text-destructive",
30811
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Trash2, { className: "w-4 h-4" })
31154
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Trash2, { className: "w-4 h-4" })
30812
31155
  }
30813
31156
  )
30814
31157
  ] });
30815
31158
  }
30816
31159
  if (showFormulaPanel && isInTable2) {
30817
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "w-72 p-2", children: [
30818
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
30819
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
30820
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31160
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "w-72 p-2", children: [
31161
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31162
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
31163
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30821
31164
  "button",
30822
31165
  {
30823
31166
  type: "button",
@@ -30830,7 +31173,7 @@ var BubbleMenuContent = ({
30830
31173
  }
30831
31174
  )
30832
31175
  ] }),
30833
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31176
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30834
31177
  "input",
30835
31178
  {
30836
31179
  value: formulaDraft,
@@ -30851,8 +31194,30 @@ var BubbleMenuContent = ({
30851
31194
  className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
30852
31195
  }
30853
31196
  ) }),
30854
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
30855
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31197
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mt-2", children: [
31198
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
31199
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "grid grid-cols-5 gap-1", children: [
31200
+ ["text", "Text"],
31201
+ ["number", "123"],
31202
+ ["currency", "$"],
31203
+ ["percent", "%"],
31204
+ ["date", "Date"]
31205
+ ].map(([format, label]) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31206
+ "button",
31207
+ {
31208
+ type: "button",
31209
+ onClick: () => setSelectedTableCellNumberFormat(editor, format),
31210
+ className: cn(
31211
+ "h-8 rounded-md text-[11px] font-semibold transition-colors hover:bg-muted",
31212
+ currentCellNumberFormat === format || format === "text" && !currentCellNumberFormat ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31213
+ ),
31214
+ children: format === "text" ? t("tableMenu.formatText") || label : format === "date" ? t("tableMenu.formatDate") || label : label
31215
+ },
31216
+ format
31217
+ )) })
31218
+ ] }),
31219
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
31220
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30856
31221
  "button",
30857
31222
  {
30858
31223
  type: "button",
@@ -30865,7 +31230,7 @@ var BubbleMenuContent = ({
30865
31230
  children: t("tableMenu.apply") || "Apply"
30866
31231
  }
30867
31232
  ),
30868
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31233
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30869
31234
  "button",
30870
31235
  {
30871
31236
  type: "button",
@@ -30877,7 +31242,7 @@ var BubbleMenuContent = ({
30877
31242
  children: t("tableMenu.clear") || "Clear"
30878
31243
  }
30879
31244
  ),
30880
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31245
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30881
31246
  "button",
30882
31247
  {
30883
31248
  type: "button",
@@ -30890,10 +31255,10 @@ var BubbleMenuContent = ({
30890
31255
  ] });
30891
31256
  }
30892
31257
  if (showTypographyPanel) {
30893
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "w-72 p-2", children: [
30894
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
30895
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
30896
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31258
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "w-72 p-2", children: [
31259
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31260
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
31261
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30897
31262
  "button",
30898
31263
  {
30899
31264
  type: "button",
@@ -30903,11 +31268,11 @@ var BubbleMenuContent = ({
30903
31268
  }
30904
31269
  )
30905
31270
  ] }),
30906
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "space-y-2", children: [
30907
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { children: [
30908
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
30909
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
30910
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31271
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "space-y-2", children: [
31272
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { children: [
31273
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
31274
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
31275
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30911
31276
  "input",
30912
31277
  {
30913
31278
  type: "number",
@@ -30931,8 +31296,8 @@ var BubbleMenuContent = ({
30931
31296
  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"
30932
31297
  }
30933
31298
  ),
30934
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
30935
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31299
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
31300
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30936
31301
  "button",
30937
31302
  {
30938
31303
  type: "button",
@@ -30942,12 +31307,12 @@ var BubbleMenuContent = ({
30942
31307
  "flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
30943
31308
  showFontSizeOptions && "bg-primary/10 text-primary"
30944
31309
  ),
30945
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ChevronDown, { className: "h-4 w-4" })
31310
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.ChevronDown, { className: "h-4 w-4" })
30946
31311
  }
30947
31312
  )
30948
31313
  ] }),
30949
- showFontSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
30950
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31314
+ showFontSizeOptions && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
31315
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30951
31316
  "button",
30952
31317
  {
30953
31318
  type: "button",
@@ -30962,7 +31327,7 @@ var BubbleMenuContent = ({
30962
31327
  children: "A"
30963
31328
  }
30964
31329
  ),
30965
- quickFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31330
+ quickFontSizes.map((option) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30966
31331
  "button",
30967
31332
  {
30968
31333
  type: "button",
@@ -30980,10 +31345,10 @@ var BubbleMenuContent = ({
30980
31345
  ))
30981
31346
  ] })
30982
31347
  ] }),
30983
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { children: [
30984
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
30985
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "grid grid-cols-4 gap-1", children: [
30986
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31348
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { children: [
31349
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
31350
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-4 gap-1", children: [
31351
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30987
31352
  "button",
30988
31353
  {
30989
31354
  type: "button",
@@ -30995,7 +31360,7 @@ var BubbleMenuContent = ({
30995
31360
  children: "LH"
30996
31361
  }
30997
31362
  ),
30998
- quickLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31363
+ quickLineHeights.map((option) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
30999
31364
  "button",
31000
31365
  {
31001
31366
  type: "button",
@@ -31010,8 +31375,8 @@ var BubbleMenuContent = ({
31010
31375
  ))
31011
31376
  ] })
31012
31377
  ] }),
31013
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
31014
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
31378
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
31379
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
31015
31380
  "button",
31016
31381
  {
31017
31382
  type: "button",
@@ -31021,12 +31386,12 @@ var BubbleMenuContent = ({
31021
31386
  editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31022
31387
  ),
31023
31388
  children: [
31024
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Subscript, { className: "h-4 w-4" }),
31389
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Subscript, { className: "h-4 w-4" }),
31025
31390
  t("toolbar.subscript")
31026
31391
  ]
31027
31392
  }
31028
31393
  ),
31029
- /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
31394
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
31030
31395
  "button",
31031
31396
  {
31032
31397
  type: "button",
@@ -31036,7 +31401,7 @@ var BubbleMenuContent = ({
31036
31401
  editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31037
31402
  ),
31038
31403
  children: [
31039
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Superscript, { className: "h-4 w-4" }),
31404
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Superscript, { className: "h-4 w-4" }),
31040
31405
  t("toolbar.superscript")
31041
31406
  ]
31042
31407
  }
@@ -31045,22 +31410,22 @@ var BubbleMenuContent = ({
31045
31410
  ] })
31046
31411
  ] });
31047
31412
  }
31048
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
31049
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Bold, { className: "w-4 h-4" }) }),
31050
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Italic, { className: "w-4 h-4" }) }),
31051
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31413
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-0.5 p-1", children: [
31414
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Bold, { className: "w-4 h-4" }) }),
31415
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Italic, { className: "w-4 h-4" }) }),
31416
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31052
31417
  ToolbarButton,
31053
31418
  {
31054
31419
  onClick: () => editor.chain().focus().toggleUnderline().run(),
31055
31420
  active: editor.isActive("underline"),
31056
31421
  title: t("toolbar.underline"),
31057
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Underline, { className: "w-4 h-4" })
31422
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Underline, { className: "w-4 h-4" })
31058
31423
  }
31059
31424
  ),
31060
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Strikethrough, { className: "w-4 h-4" }) }),
31061
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Code, { className: "w-4 h-4" }) }),
31062
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31063
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31425
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Strikethrough, { className: "w-4 h-4" }) }),
31426
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Code, { className: "w-4 h-4" }) }),
31427
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31428
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31064
31429
  ToolbarButton,
31065
31430
  {
31066
31431
  onMouseDown: () => {
@@ -31071,22 +31436,22 @@ var BubbleMenuContent = ({
31071
31436
  },
31072
31437
  active: editor.isActive("link"),
31073
31438
  title: t("toolbar.link"),
31074
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Link, { className: "w-4 h-4" })
31439
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Link, { className: "w-4 h-4" })
31075
31440
  }
31076
31441
  ),
31077
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TextColorIcon, { color: currentTextColor }) }),
31078
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
31079
- isInTable2 && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
31080
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31442
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TextColorIcon, { color: currentTextColor }) }),
31443
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(HighlightColorIcon, { color: currentHighlightColor }) }),
31444
+ isInTable2 && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
31445
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31081
31446
  ToolbarButton,
31082
31447
  {
31083
31448
  onClick: () => setActiveColorPalette("cell-bg"),
31084
31449
  active: Boolean(currentCellBgColor),
31085
31450
  title: t("tableMenu.cellBackground") || "Cell background",
31086
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CellBgColorIcon, { color: currentCellBgColor })
31451
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(CellBgColorIcon, { color: currentCellBgColor })
31087
31452
  }
31088
31453
  ),
31089
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31454
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31090
31455
  ToolbarButton,
31091
31456
  {
31092
31457
  onClick: () => setActiveColorPalette("cell-border"),
@@ -31094,7 +31459,7 @@ var BubbleMenuContent = ({
31094
31459
  editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
31095
31460
  ),
31096
31461
  title: t("tableMenu.cellBorder") || "Cell border",
31097
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31462
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31098
31463
  CellBorderIcon,
31099
31464
  {
31100
31465
  color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
@@ -31102,7 +31467,7 @@ var BubbleMenuContent = ({
31102
31467
  )
31103
31468
  }
31104
31469
  ),
31105
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31470
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31106
31471
  ToolbarButton,
31107
31472
  {
31108
31473
  onMouseDown: () => {
@@ -31114,10 +31479,10 @@ var BubbleMenuContent = ({
31114
31479
  },
31115
31480
  active: Boolean(currentCellFormula),
31116
31481
  title: t("tableMenu.formula") || "Formula",
31117
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Sigma, { className: "w-4 h-4" })
31482
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Sigma, { className: "w-4 h-4" })
31118
31483
  }
31119
31484
  ),
31120
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31485
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31121
31486
  ToolbarButton,
31122
31487
  {
31123
31488
  onClick: () => {
@@ -31130,17 +31495,17 @@ var BubbleMenuContent = ({
31130
31495
  active: canSplitCell,
31131
31496
  disabled: !canMergeCells && !canSplitCell,
31132
31497
  title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
31133
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.TableCellsMerge, { className: "w-4 h-4" })
31498
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.TableCellsMerge, { className: "w-4 h-4" })
31134
31499
  }
31135
31500
  )
31136
31501
  ] }),
31137
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31502
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31138
31503
  ToolbarButton,
31139
31504
  {
31140
31505
  onClick: () => setShowTypographyPanel(true),
31141
31506
  active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
31142
31507
  title: t("toolbar.textStyle"),
31143
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Type, { className: "w-4 h-4" })
31508
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Type, { className: "w-4 h-4" })
31144
31509
  }
31145
31510
  )
31146
31511
  ] });
@@ -31154,12 +31519,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
31154
31519
  const handleUnlink = () => {
31155
31520
  editor.chain().focus().unsetLink().run();
31156
31521
  };
31157
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
31158
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-[180px]", children: url }),
31159
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31160
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.ExternalLink, { className: "w-4 h-4" }) }),
31161
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Edit2, { className: "w-4 h-4" }) }),
31162
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.Unlink, { className: "w-4 h-4" }) })
31522
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
31523
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-[180px]", children: url }),
31524
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31525
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.ExternalLink, { className: "w-4 h-4" }) }),
31526
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Edit2, { className: "w-4 h-4" }) }),
31527
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react50.Unlink, { className: "w-4 h-4" }) })
31163
31528
  ] });
31164
31529
  };
31165
31530
  var CustomBubbleMenu = ({
@@ -31169,16 +31534,16 @@ var CustomBubbleMenu = ({
31169
31534
  }) => {
31170
31535
  const SHOW_DELAY_MS = 180;
31171
31536
  const BUBBLE_MENU_OFFSET = 16;
31172
- const [isVisible, setIsVisible] = (0, import_react62.useState)(false);
31173
- const [position, setPosition] = (0, import_react62.useState)({ top: 0, left: 0 });
31174
- const menuRef = (0, import_react62.useRef)(null);
31175
- const keepOpenRef = (0, import_react62.useRef)(false);
31176
- const showTimeoutRef = (0, import_react62.useRef)(null);
31177
- const setKeepOpen = (0, import_react62.useCallback)((next) => {
31537
+ const [isVisible, setIsVisible] = (0, import_react64.useState)(false);
31538
+ const [position, setPosition] = (0, import_react64.useState)({ top: 0, left: 0 });
31539
+ const menuRef = (0, import_react64.useRef)(null);
31540
+ const keepOpenRef = (0, import_react64.useRef)(false);
31541
+ const showTimeoutRef = (0, import_react64.useRef)(null);
31542
+ const setKeepOpen = (0, import_react64.useCallback)((next) => {
31178
31543
  keepOpenRef.current = next;
31179
31544
  if (next) setIsVisible(true);
31180
31545
  }, []);
31181
- (0, import_react62.useEffect)(() => {
31546
+ (0, import_react64.useEffect)(() => {
31182
31547
  const clearShowTimeout = () => {
31183
31548
  if (showTimeoutRef.current) {
31184
31549
  clearTimeout(showTimeoutRef.current);
@@ -31246,7 +31611,7 @@ var CustomBubbleMenu = ({
31246
31611
  }, [editor]);
31247
31612
  if (!isVisible) return null;
31248
31613
  return (0, import_react_dom8.createPortal)(
31249
- /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31614
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31250
31615
  "div",
31251
31616
  {
31252
31617
  ref: menuRef,
@@ -31258,7 +31623,7 @@ var CustomBubbleMenu = ({
31258
31623
  transform: "translate(-50%, -100%)"
31259
31624
  },
31260
31625
  onMouseDown: (e) => e.preventDefault(),
31261
- children: editor.isActive("link") && !keepOpenRef.current ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(LinkPreviewContent, { editor, onEdit: () => setKeepOpen(true) }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
31626
+ children: editor.isActive("link") && !keepOpenRef.current ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(LinkPreviewContent, { editor, onEdit: () => setKeepOpen(true) }) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
31262
31627
  BubbleMenuContent,
31263
31628
  {
31264
31629
  editor,
@@ -31275,25 +31640,25 @@ var CustomBubbleMenu = ({
31275
31640
  };
31276
31641
 
31277
31642
  // src/components/UEditor/CharacterCount.tsx
31278
- var import_jsx_runtime87 = require("react/jsx-runtime");
31643
+ var import_jsx_runtime88 = require("react/jsx-runtime");
31279
31644
  var CharacterCountDisplay = ({ editor, maxCharacters }) => {
31280
31645
  const t = useSmartTranslations("UEditor");
31281
31646
  const storage = editor.storage;
31282
31647
  const characterCount = storage.characterCount?.characters?.() ?? 0;
31283
31648
  const wordCount = storage.characterCount?.words?.() ?? 0;
31284
31649
  const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
31285
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
31286
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
31650
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
31651
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { children: [
31287
31652
  wordCount,
31288
31653
  " ",
31289
31654
  t("words")
31290
31655
  ] }),
31291
- /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { children: [
31656
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { children: [
31292
31657
  characterCount,
31293
31658
  " ",
31294
31659
  t("characters")
31295
31660
  ] }),
31296
- maxCharacters && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
31661
+ maxCharacters && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
31297
31662
  characterCount,
31298
31663
  "/",
31299
31664
  maxCharacters
@@ -31714,7 +32079,7 @@ async function prepareUEditorContentForSave({
31714
32079
  }
31715
32080
 
31716
32081
  // src/components/UEditor/table-controls.tsx
31717
- var import_react64 = __toESM(require("react"), 1);
32082
+ var import_react66 = __toESM(require("react"), 1);
31718
32083
 
31719
32084
  // node_modules/prosemirror-model/dist/index.js
31720
32085
  function findDiffStart(a, b, pos) {
@@ -34731,7 +35096,7 @@ function createKey(name) {
34731
35096
  keys[name] = 0;
34732
35097
  return name + "$";
34733
35098
  }
34734
- var PluginKey4 = class {
35099
+ var PluginKey5 = class {
34735
35100
  /**
34736
35101
  Create a plugin key.
34737
35102
  */
@@ -35163,7 +35528,7 @@ function tableNodeTypes(schema) {
35163
35528
  }
35164
35529
  return result;
35165
35530
  }
35166
- var tableEditingKey = new PluginKey4("selectingCells");
35531
+ var tableEditingKey = new PluginKey5("selectingCells");
35167
35532
  function cellAround($pos) {
35168
35533
  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));
35169
35534
  return null;
@@ -35394,7 +35759,7 @@ var CellBookmark = class CellBookmark2 {
35394
35759
  else return Selection.near($headCell, 1);
35395
35760
  }
35396
35761
  };
35397
- var fixTablesKey = new PluginKey4("fix-tables");
35762
+ var fixTablesKey = new PluginKey5("fix-tables");
35398
35763
  function convertTableNodeToArrayOfRows(tableNode) {
35399
35764
  const map = TableMap3.get(tableNode);
35400
35765
  const rows = [];
@@ -35872,10 +36237,10 @@ function atEndOfCell(view, axis, dir) {
35872
36237
  }
35873
36238
  return null;
35874
36239
  }
35875
- var columnResizingPluginKey = new PluginKey4("tableColumnResizing");
36240
+ var columnResizingPluginKey = new PluginKey5("tableColumnResizing");
35876
36241
 
35877
36242
  // src/components/UEditor/table-controls.tsx
35878
- var import_lucide_react52 = require("lucide-react");
36243
+ var import_lucide_react53 = require("lucide-react");
35879
36244
 
35880
36245
  // src/components/UEditor/table-layout-model.ts
35881
36246
  var FALLBACK_TABLE_ROW_HEIGHT = 44;
@@ -36188,7 +36553,7 @@ function buildTableHoverState({
36188
36553
  }
36189
36554
 
36190
36555
  // src/components/UEditor/table-drag-preview.tsx
36191
- var import_jsx_runtime88 = require("react/jsx-runtime");
36556
+ var import_jsx_runtime89 = require("react/jsx-runtime");
36192
36557
  function TableDragPreview({
36193
36558
  columnDragLabel,
36194
36559
  dragPreview,
@@ -36199,9 +36564,9 @@ function TableDragPreview({
36199
36564
  const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
36200
36565
  const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
36201
36566
  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__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
36203
- dragPreview.kind === "row" && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
36204
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36567
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
36568
+ dragPreview.kind === "row" && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
36569
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36205
36570
  "div",
36206
36571
  {
36207
36572
  "aria-hidden": "true",
@@ -36214,7 +36579,7 @@ function TableDragPreview({
36214
36579
  }
36215
36580
  }
36216
36581
  ),
36217
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36582
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36218
36583
  "div",
36219
36584
  {
36220
36585
  "aria-hidden": "true",
@@ -36228,8 +36593,8 @@ function TableDragPreview({
36228
36593
  }
36229
36594
  )
36230
36595
  ] }),
36231
- dragPreview.kind === "column" && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
36232
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36596
+ dragPreview.kind === "column" && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
36597
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36233
36598
  "div",
36234
36599
  {
36235
36600
  "aria-hidden": "true",
@@ -36242,7 +36607,7 @@ function TableDragPreview({
36242
36607
  }
36243
36608
  }
36244
36609
  ),
36245
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36610
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36246
36611
  "div",
36247
36612
  {
36248
36613
  "aria-hidden": "true",
@@ -36256,7 +36621,7 @@ function TableDragPreview({
36256
36621
  }
36257
36622
  )
36258
36623
  ] }),
36259
- (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36624
+ (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36260
36625
  "div",
36261
36626
  {
36262
36627
  "aria-hidden": "true",
@@ -36269,7 +36634,7 @@ function TableDragPreview({
36269
36634
  }
36270
36635
  }
36271
36636
  ),
36272
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
36637
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36273
36638
  "div",
36274
36639
  {
36275
36640
  role: "status",
@@ -36285,7 +36650,7 @@ function TableDragPreview({
36285
36650
  }
36286
36651
 
36287
36652
  // src/components/UEditor/table-add-rails.tsx
36288
- var import_jsx_runtime89 = require("react/jsx-runtime");
36653
+ var import_jsx_runtime90 = require("react/jsx-runtime");
36289
36654
  var ADD_COLUMN_RAIL_GAP = 4;
36290
36655
  var ADD_ROW_RAIL_GAP = 4;
36291
36656
  function TableAddRails({
@@ -36306,13 +36671,13 @@ function TableAddRails({
36306
36671
  const rowRailLeft = visibleBounds.left;
36307
36672
  const showColumnRail = controlsVisible || addColumnVisible;
36308
36673
  const showRowRail = controlsVisible || addRowVisible;
36309
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
36310
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36674
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
36675
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36311
36676
  Tooltip,
36312
36677
  {
36313
36678
  placement: "right",
36314
- content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
36315
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36679
+ content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
36680
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36316
36681
  "button",
36317
36682
  {
36318
36683
  type: "button",
@@ -36339,17 +36704,17 @@ function TableAddRails({
36339
36704
  transform: showColumnRail ? "scale(1)" : "scale(0.92)",
36340
36705
  pointerEvents: showColumnRail ? "auto" : "none"
36341
36706
  },
36342
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
36707
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
36343
36708
  }
36344
36709
  )
36345
36710
  }
36346
36711
  ),
36347
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36712
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36348
36713
  Tooltip,
36349
36714
  {
36350
36715
  placement: "bottom",
36351
- content: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
36352
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
36716
+ content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
36717
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36353
36718
  "button",
36354
36719
  {
36355
36720
  type: "button",
@@ -36376,7 +36741,7 @@ function TableAddRails({
36376
36741
  transform: showRowRail ? "scale(1)" : "scale(0.92)",
36377
36742
  pointerEvents: showRowRail ? "auto" : "none"
36378
36743
  },
36379
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
36744
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-sm font-medium leading-none", children: "+" })
36380
36745
  }
36381
36746
  )
36382
36747
  }
@@ -36385,8 +36750,8 @@ function TableAddRails({
36385
36750
  }
36386
36751
 
36387
36752
  // src/components/UEditor/table-control-menu.tsx
36388
- var import_lucide_react50 = require("lucide-react");
36389
- var import_jsx_runtime90 = require("react/jsx-runtime");
36753
+ var import_lucide_react51 = require("lucide-react");
36754
+ var import_jsx_runtime91 = require("react/jsx-runtime");
36390
36755
  function TableControlMenu({
36391
36756
  controlsVisible,
36392
36757
  isOpen,
@@ -36398,7 +36763,7 @@ function TableControlMenu({
36398
36763
  top
36399
36764
  }) {
36400
36765
  const shown = controlsVisible || menuVisible || isOpen;
36401
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36766
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36402
36767
  "div",
36403
36768
  {
36404
36769
  className: "absolute z-30",
@@ -36407,13 +36772,13 @@ function TableControlMenu({
36407
36772
  top,
36408
36773
  left
36409
36774
  },
36410
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36775
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36411
36776
  Tooltip,
36412
36777
  {
36413
36778
  placement: "top",
36414
36779
  disabled: isOpen,
36415
- content: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xs font-medium", children: label }),
36416
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36780
+ content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-xs font-medium", children: label }),
36781
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36417
36782
  DropdownMenu,
36418
36783
  {
36419
36784
  placement: "bottom-start",
@@ -36421,7 +36786,7 @@ function TableControlMenu({
36421
36786
  onOpenChange,
36422
36787
  contentClassName: "p-2",
36423
36788
  items,
36424
- trigger: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
36789
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36425
36790
  "button",
36426
36791
  {
36427
36792
  type: "button",
@@ -36437,7 +36802,7 @@ function TableControlMenu({
36437
36802
  transform: shown ? "scale(1)" : "scale(0.82)",
36438
36803
  pointerEvents: shown ? "auto" : "none"
36439
36804
  },
36440
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react50.MoreHorizontal, { className: "h-4 w-4" })
36805
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react51.MoreHorizontal, { className: "h-4 w-4" })
36441
36806
  }
36442
36807
  )
36443
36808
  }
@@ -36449,8 +36814,8 @@ function TableControlMenu({
36449
36814
  }
36450
36815
 
36451
36816
  // src/components/UEditor/table-axis-handles.tsx
36452
- var import_lucide_react51 = require("lucide-react");
36453
- var import_jsx_runtime91 = require("react/jsx-runtime");
36817
+ var import_lucide_react52 = require("lucide-react");
36818
+ var import_jsx_runtime92 = require("react/jsx-runtime");
36454
36819
  var IDLE_HANDLE_SCALE = "0.78";
36455
36820
  function TableRowHandles({
36456
36821
  activeRowIndex,
@@ -36464,12 +36829,12 @@ function TableRowHandles({
36464
36829
  rowHandleLeft,
36465
36830
  rowHandles
36466
36831
  }) {
36467
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: rowHandles.map((rowHandle) => {
36832
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_jsx_runtime92.Fragment, { children: rowHandles.map((rowHandle) => {
36468
36833
  const menuKey = `row:${rowHandle.index}`;
36469
36834
  const isActive = rowHandle.index === activeRowIndex;
36470
36835
  const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
36471
36836
  const isShown = visible || isActive;
36472
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36837
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36473
36838
  "div",
36474
36839
  {
36475
36840
  className: "absolute z-30",
@@ -36478,13 +36843,13 @@ function TableRowHandles({
36478
36843
  top: Math.max(8, rowHandle.center - 12),
36479
36844
  left: rowHandleLeft
36480
36845
  },
36481
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36846
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36482
36847
  Tooltip,
36483
36848
  {
36484
36849
  placement: "right",
36485
36850
  disabled: openMenuKey === menuKey || !visible && isActive,
36486
- content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
36487
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36851
+ content: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
36852
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36488
36853
  DropdownMenu,
36489
36854
  {
36490
36855
  placement: "right",
@@ -36492,7 +36857,7 @@ function TableRowHandles({
36492
36857
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
36493
36858
  contentClassName: "p-2",
36494
36859
  items: getMenuItems(rowHandle),
36495
- trigger: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36860
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36496
36861
  "button",
36497
36862
  {
36498
36863
  type: "button",
@@ -36511,7 +36876,7 @@ function TableRowHandles({
36511
36876
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
36512
36877
  pointerEvents: isShown ? "auto" : "none"
36513
36878
  },
36514
- children: visible ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react51.GripVertical, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36879
+ children: visible ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react52.GripVertical, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36515
36880
  }
36516
36881
  )
36517
36882
  }
@@ -36535,12 +36900,12 @@ function TableColumnHandles({
36535
36900
  onStartDrag,
36536
36901
  openMenuKey
36537
36902
  }) {
36538
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: columnHandles.map((columnHandle) => {
36903
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_jsx_runtime92.Fragment, { children: columnHandles.map((columnHandle) => {
36539
36904
  const menuKey = `column:${columnHandle.index}`;
36540
36905
  const isActive = columnHandle.index === activeColumnIndex;
36541
36906
  const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
36542
36907
  const isShown = visible || isActive;
36543
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36908
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36544
36909
  "div",
36545
36910
  {
36546
36911
  className: "absolute z-30",
@@ -36549,13 +36914,13 @@ function TableColumnHandles({
36549
36914
  top: columnHandleTop,
36550
36915
  left: Math.max(8, columnHandle.center - 12)
36551
36916
  },
36552
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36917
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36553
36918
  Tooltip,
36554
36919
  {
36555
36920
  placement: "top",
36556
36921
  disabled: openMenuKey === menuKey || !visible && isActive,
36557
- content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
36558
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36922
+ content: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
36923
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36559
36924
  DropdownMenu,
36560
36925
  {
36561
36926
  placement: "bottom-start",
@@ -36563,7 +36928,7 @@ function TableColumnHandles({
36563
36928
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
36564
36929
  contentClassName: "p-2",
36565
36930
  items: getMenuItems(columnHandle),
36566
- trigger: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
36931
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
36567
36932
  "button",
36568
36933
  {
36569
36934
  type: "button",
@@ -36582,7 +36947,7 @@ function TableColumnHandles({
36582
36947
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
36583
36948
  pointerEvents: isShown ? "auto" : "none"
36584
36949
  },
36585
- children: visible ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react51.GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36950
+ children: visible ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react52.GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
36586
36951
  }
36587
36952
  )
36588
36953
  }
@@ -36596,7 +36961,7 @@ function TableColumnHandles({
36596
36961
  }
36597
36962
 
36598
36963
  // src/components/UEditor/table-controls.tsx
36599
- var import_jsx_runtime92 = require("react/jsx-runtime");
36964
+ var import_jsx_runtime93 = require("react/jsx-runtime");
36600
36965
  var TABLE_MENU_TOP_OFFSET = 10;
36601
36966
  function nearestIndex(centers, position) {
36602
36967
  let bestIndex = 0;
@@ -36622,17 +36987,17 @@ function getSelectedCell(editor) {
36622
36987
  }
36623
36988
  function TableControls({ editor, containerRef }) {
36624
36989
  const t = useSmartTranslations("UEditor");
36625
- const [layout, setLayout] = import_react64.default.useState(null);
36626
- const [dragPreview, setDragPreview] = import_react64.default.useState(null);
36627
- const [hoverState, setHoverState] = import_react64.default.useState(DEFAULT_TABLE_HOVER_STATE);
36628
- const [openMenuKey, setOpenMenuKey] = import_react64.default.useState(null);
36629
- const layoutRef = import_react64.default.useRef(null);
36630
- const dragStateRef = import_react64.default.useRef(null);
36631
- const syncFrameRef = import_react64.default.useRef(null);
36632
- import_react64.default.useEffect(() => {
36990
+ const [layout, setLayout] = import_react66.default.useState(null);
36991
+ const [dragPreview, setDragPreview] = import_react66.default.useState(null);
36992
+ const [hoverState, setHoverState] = import_react66.default.useState(DEFAULT_TABLE_HOVER_STATE);
36993
+ const [openMenuKey, setOpenMenuKey] = import_react66.default.useState(null);
36994
+ const layoutRef = import_react66.default.useRef(null);
36995
+ const dragStateRef = import_react66.default.useRef(null);
36996
+ const syncFrameRef = import_react66.default.useRef(null);
36997
+ import_react66.default.useEffect(() => {
36633
36998
  layoutRef.current = layout;
36634
36999
  }, [layout]);
36635
- const syncFromCell = import_react64.default.useCallback((cell) => {
37000
+ const syncFromCell = import_react66.default.useCallback((cell) => {
36636
37001
  const surface = containerRef.current;
36637
37002
  if (!surface || !cell) {
36638
37003
  setLayout(null);
@@ -36640,23 +37005,23 @@ function TableControls({ editor, containerRef }) {
36640
37005
  }
36641
37006
  setLayout(buildTableControlLayout(editor, surface, cell));
36642
37007
  }, [containerRef, editor]);
36643
- const syncFromSelection = import_react64.default.useCallback(() => {
37008
+ const syncFromSelection = import_react66.default.useCallback(() => {
36644
37009
  syncFromCell(getSelectedCell(editor));
36645
37010
  }, [editor, syncFromCell]);
36646
- const scheduleSyncFromSelection = import_react64.default.useCallback(() => {
37011
+ const scheduleSyncFromSelection = import_react66.default.useCallback(() => {
36647
37012
  if (syncFrameRef.current !== null) return;
36648
37013
  syncFrameRef.current = window.requestAnimationFrame(() => {
36649
37014
  syncFrameRef.current = null;
36650
37015
  syncFromSelection();
36651
37016
  });
36652
37017
  }, [syncFromSelection]);
36653
- import_react64.default.useEffect(() => () => {
37018
+ import_react66.default.useEffect(() => () => {
36654
37019
  if (syncFrameRef.current !== null) {
36655
37020
  window.cancelAnimationFrame(syncFrameRef.current);
36656
37021
  syncFrameRef.current = null;
36657
37022
  }
36658
37023
  }, []);
36659
- const refreshCurrentLayout = import_react64.default.useCallback(() => {
37024
+ const refreshCurrentLayout = import_react66.default.useCallback(() => {
36660
37025
  setLayout((prev) => {
36661
37026
  if (!prev) return prev;
36662
37027
  const surface = containerRef.current;
@@ -36666,12 +37031,12 @@ function TableControls({ editor, containerRef }) {
36666
37031
  return cell ? buildTableControlLayout(editor, surface, cell) : null;
36667
37032
  });
36668
37033
  }, [containerRef, editor]);
36669
- const clearDrag = import_react64.default.useCallback(() => {
37034
+ const clearDrag = import_react66.default.useCallback(() => {
36670
37035
  dragStateRef.current = null;
36671
37036
  setDragPreview(null);
36672
37037
  document.body.style.cursor = "";
36673
37038
  }, []);
36674
- const updateHoverState = import_react64.default.useCallback((event) => {
37039
+ const updateHoverState = import_react66.default.useCallback((event) => {
36675
37040
  const activeLayout = layoutRef.current;
36676
37041
  const surface = containerRef.current;
36677
37042
  if (!activeLayout || !surface || dragStateRef.current) {
@@ -36687,7 +37052,7 @@ function TableControls({ editor, containerRef }) {
36687
37052
  return areTableHoverStatesEqual(prev, nextState) ? prev : nextState;
36688
37053
  });
36689
37054
  }, [containerRef]);
36690
- import_react64.default.useEffect(() => {
37055
+ import_react66.default.useEffect(() => {
36691
37056
  const proseMirror = editor.view.dom;
36692
37057
  const surface = containerRef.current;
36693
37058
  if (!surface) return void 0;
@@ -36738,37 +37103,37 @@ function TableControls({ editor, containerRef }) {
36738
37103
  editor.off("update", refreshCurrentLayout);
36739
37104
  };
36740
37105
  }, [clearDrag, containerRef, editor, refreshCurrentLayout, syncFromCell, syncFromSelection, updateHoverState]);
36741
- const runAtCellPos = import_react64.default.useCallback((cellPos, command, options) => {
37106
+ const runAtCellPos = import_react66.default.useCallback((cellPos, command, options) => {
36742
37107
  const result = runTableCommandAtCellPos(editor, cellPos, command);
36743
37108
  if (options?.sync !== false) {
36744
37109
  scheduleSyncFromSelection();
36745
37110
  }
36746
37111
  return result;
36747
37112
  }, [editor, scheduleSyncFromSelection]);
36748
- const runAtActiveCell = import_react64.default.useCallback((command, options) => {
37113
+ const runAtActiveCell = import_react66.default.useCallback((command, options) => {
36749
37114
  return runAtCellPos(layoutRef.current?.cellPos ?? null, command, options);
36750
37115
  }, [runAtCellPos]);
36751
- const duplicateRowAt = import_react64.default.useCallback((rowIndex, cellPos) => {
37116
+ const duplicateRowAt = import_react66.default.useCallback((rowIndex, cellPos) => {
36752
37117
  const result = duplicateTableRowAt(editor, rowIndex, cellPos);
36753
37118
  scheduleSyncFromSelection();
36754
37119
  return result;
36755
37120
  }, [editor, scheduleSyncFromSelection]);
36756
- const clearRowAt = import_react64.default.useCallback((rowIndex, cellPos) => {
37121
+ const clearRowAt = import_react66.default.useCallback((rowIndex, cellPos) => {
36757
37122
  const result = clearTableRowAt(editor, rowIndex, cellPos);
36758
37123
  scheduleSyncFromSelection();
36759
37124
  return result;
36760
37125
  }, [editor, scheduleSyncFromSelection]);
36761
- const duplicateColumnAt = import_react64.default.useCallback((columnIndex, cellPos) => {
37126
+ const duplicateColumnAt = import_react66.default.useCallback((columnIndex, cellPos) => {
36762
37127
  const result = duplicateTableColumnAt(editor, columnIndex, cellPos);
36763
37128
  scheduleSyncFromSelection();
36764
37129
  return result;
36765
37130
  }, [editor, scheduleSyncFromSelection]);
36766
- const clearColumnAt = import_react64.default.useCallback((columnIndex, cellPos) => {
37131
+ const clearColumnAt = import_react66.default.useCallback((columnIndex, cellPos) => {
36767
37132
  const result = clearTableColumnAt(editor, columnIndex, cellPos);
36768
37133
  scheduleSyncFromSelection();
36769
37134
  return result;
36770
37135
  }, [editor, scheduleSyncFromSelection]);
36771
- const expandTableBy = import_react64.default.useCallback((rows, cols) => {
37136
+ const expandTableBy = import_react66.default.useCallback((rows, cols) => {
36772
37137
  const activeCellPos = layoutRef.current?.cellPos ?? editor.state.selection.from;
36773
37138
  const result = expandTableFromCell(editor, activeCellPos, rows, cols);
36774
37139
  scheduleSyncFromSelection();
@@ -36777,19 +37142,19 @@ function TableControls({ editor, containerRef }) {
36777
37142
  const canExpandTable = Boolean(layout);
36778
37143
  const controlsVisible = dragPreview !== null;
36779
37144
  const tableMenuOpen = openMenuKey === "table";
36780
- const startAddColumnDrag = import_react64.default.useCallback(() => {
37145
+ const startAddColumnDrag = import_react66.default.useCallback(() => {
36781
37146
  setOpenMenuKey(null);
36782
37147
  dragStateRef.current = { kind: "add-column", previewCols: 1 };
36783
37148
  setDragPreview({ kind: "add-column", previewCols: 1 });
36784
37149
  document.body.style.cursor = "ew-resize";
36785
37150
  }, []);
36786
- const startAddRowDrag = import_react64.default.useCallback(() => {
37151
+ const startAddRowDrag = import_react66.default.useCallback(() => {
36787
37152
  setOpenMenuKey(null);
36788
37153
  dragStateRef.current = { kind: "add-row", previewRows: 1 };
36789
37154
  setDragPreview({ kind: "add-row", previewRows: 1 });
36790
37155
  document.body.style.cursor = "ns-resize";
36791
37156
  }, []);
36792
- const startRowDrag = import_react64.default.useCallback((rowHandle) => {
37157
+ const startRowDrag = import_react66.default.useCallback((rowHandle) => {
36793
37158
  setOpenMenuKey(null);
36794
37159
  dragStateRef.current = {
36795
37160
  kind: "row",
@@ -36806,7 +37171,7 @@ function TableControls({ editor, containerRef }) {
36806
37171
  });
36807
37172
  document.body.style.cursor = "grabbing";
36808
37173
  }, []);
36809
- const startColumnDrag = import_react64.default.useCallback((columnHandle) => {
37174
+ const startColumnDrag = import_react66.default.useCallback((columnHandle) => {
36810
37175
  setOpenMenuKey(null);
36811
37176
  dragStateRef.current = {
36812
37177
  kind: "column",
@@ -36823,7 +37188,7 @@ function TableControls({ editor, containerRef }) {
36823
37188
  });
36824
37189
  document.body.style.cursor = "grabbing";
36825
37190
  }, []);
36826
- import_react64.default.useEffect(() => {
37191
+ import_react66.default.useEffect(() => {
36827
37192
  const handleMouseMove = (event) => {
36828
37193
  const dragState = dragStateRef.current;
36829
37194
  const activeLayout = layoutRef.current;
@@ -36912,126 +37277,126 @@ function TableControls({ editor, containerRef }) {
36912
37277
  window.removeEventListener("blur", clearDrag);
36913
37278
  };
36914
37279
  }, [clearDrag, containerRef, editor, expandTableBy, scheduleSyncFromSelection]);
36915
- const menuItems = import_react64.default.useMemo(() => {
37280
+ const menuItems = import_react66.default.useMemo(() => {
36916
37281
  if (!layout) return [];
36917
37282
  return [
36918
37283
  {
36919
37284
  label: t("tableMenu.alignLeft"),
36920
- icon: import_lucide_react52.AlignLeft,
37285
+ icon: import_lucide_react53.AlignLeft,
36921
37286
  onClick: () => applyTableAlignment(editor, "left", layout.cellPos)
36922
37287
  },
36923
37288
  {
36924
37289
  label: t("tableMenu.alignCenter"),
36925
- icon: import_lucide_react52.AlignCenter,
37290
+ icon: import_lucide_react53.AlignCenter,
36926
37291
  onClick: () => applyTableAlignment(editor, "center", layout.cellPos)
36927
37292
  },
36928
37293
  {
36929
37294
  label: t("tableMenu.alignRight"),
36930
- icon: import_lucide_react52.AlignRight,
37295
+ icon: import_lucide_react53.AlignRight,
36931
37296
  onClick: () => applyTableAlignment(editor, "right", layout.cellPos)
36932
37297
  },
36933
37298
  {
36934
37299
  label: t("tableMenu.addColumnBefore"),
36935
- icon: import_lucide_react52.ArrowLeft,
37300
+ icon: import_lucide_react53.ArrowLeft,
36936
37301
  onClick: () => runAtActiveCell((chain) => chain.addColumnBefore())
36937
37302
  },
36938
37303
  {
36939
37304
  label: t("tableMenu.addColumnAfter"),
36940
- icon: import_lucide_react52.ArrowRight,
37305
+ icon: import_lucide_react53.ArrowRight,
36941
37306
  onClick: () => runAtActiveCell((chain) => chain.addColumnAfter())
36942
37307
  },
36943
37308
  {
36944
37309
  label: t("tableMenu.addRowBefore"),
36945
- icon: import_lucide_react52.ArrowUp,
37310
+ icon: import_lucide_react53.ArrowUp,
36946
37311
  onClick: () => runAtActiveCell((chain) => chain.addRowBefore())
36947
37312
  },
36948
37313
  {
36949
37314
  label: t("tableMenu.addRowAfter"),
36950
- icon: import_lucide_react52.ArrowDown,
37315
+ icon: import_lucide_react53.ArrowDown,
36951
37316
  onClick: () => runAtActiveCell((chain) => chain.addRowAfter())
36952
37317
  },
36953
37318
  {
36954
37319
  label: t("tableMenu.toggleHeaderRow"),
36955
- icon: import_lucide_react52.Table,
37320
+ icon: import_lucide_react53.Table,
36956
37321
  onClick: () => runAtActiveCell((chain) => chain.toggleHeaderRow())
36957
37322
  },
36958
37323
  {
36959
37324
  label: t("tableMenu.toggleHeaderColumn"),
36960
- icon: import_lucide_react52.Table,
37325
+ icon: import_lucide_react53.Table,
36961
37326
  onClick: () => runAtActiveCell((chain) => chain.toggleHeaderColumn())
36962
37327
  },
36963
37328
  {
36964
37329
  label: t("tableMenu.deleteColumn"),
36965
- icon: import_lucide_react52.Trash2,
37330
+ icon: import_lucide_react53.Trash2,
36966
37331
  onClick: () => runAtActiveCell((chain) => chain.deleteColumn()),
36967
37332
  destructive: true
36968
37333
  },
36969
37334
  {
36970
37335
  label: t("tableMenu.deleteRow"),
36971
- icon: import_lucide_react52.Trash2,
37336
+ icon: import_lucide_react53.Trash2,
36972
37337
  onClick: () => runAtActiveCell((chain) => chain.deleteRow()),
36973
37338
  destructive: true
36974
37339
  },
36975
37340
  {
36976
37341
  label: t("tableMenu.deleteTable"),
36977
- icon: import_lucide_react52.Trash2,
37342
+ icon: import_lucide_react53.Trash2,
36978
37343
  onClick: () => runAtActiveCell((chain) => chain.deleteTable()),
36979
37344
  destructive: true
36980
37345
  }
36981
37346
  ];
36982
37347
  }, [layout, runAtActiveCell, t]);
36983
- const getRowHandleMenuItems = import_react64.default.useCallback((rowHandle) => [
37348
+ const getRowHandleMenuItems = import_react66.default.useCallback((rowHandle) => [
36984
37349
  {
36985
37350
  label: t("tableMenu.addRowBefore"),
36986
- icon: import_lucide_react52.ArrowUp,
37351
+ icon: import_lucide_react53.ArrowUp,
36987
37352
  onClick: () => runAtCellPos(rowHandle.cellPos, (chain) => chain.addRowBefore())
36988
37353
  },
36989
37354
  {
36990
37355
  label: t("tableMenu.addRowAfter"),
36991
- icon: import_lucide_react52.ArrowDown,
37356
+ icon: import_lucide_react53.ArrowDown,
36992
37357
  onClick: () => runAtCellPos(rowHandle.cellPos, (chain) => chain.addRowAfter())
36993
37358
  },
36994
37359
  {
36995
37360
  label: t("tableMenu.duplicateRow"),
36996
- icon: import_lucide_react52.Copy,
37361
+ icon: import_lucide_react53.Copy,
36997
37362
  onClick: () => duplicateRowAt(rowHandle.index, rowHandle.cellPos)
36998
37363
  },
36999
37364
  {
37000
37365
  label: t("tableMenu.clearRowContents"),
37001
- icon: import_lucide_react52.Table,
37366
+ icon: import_lucide_react53.Table,
37002
37367
  onClick: () => clearRowAt(rowHandle.index, rowHandle.cellPos)
37003
37368
  },
37004
37369
  {
37005
37370
  label: t("tableMenu.deleteRow"),
37006
- icon: import_lucide_react52.Trash2,
37371
+ icon: import_lucide_react53.Trash2,
37007
37372
  onClick: () => runAtCellPos(rowHandle.cellPos, (chain) => chain.deleteRow()),
37008
37373
  destructive: true
37009
37374
  }
37010
37375
  ], [clearRowAt, duplicateRowAt, runAtCellPos, t]);
37011
- const getColumnHandleMenuItems = import_react64.default.useCallback((columnHandle) => [
37376
+ const getColumnHandleMenuItems = import_react66.default.useCallback((columnHandle) => [
37012
37377
  {
37013
37378
  label: t("tableMenu.addColumnBefore"),
37014
- icon: import_lucide_react52.ArrowLeft,
37379
+ icon: import_lucide_react53.ArrowLeft,
37015
37380
  onClick: () => runAtCellPos(columnHandle.cellPos, (chain) => chain.addColumnBefore())
37016
37381
  },
37017
37382
  {
37018
37383
  label: t("tableMenu.addColumnAfter"),
37019
- icon: import_lucide_react52.ArrowRight,
37384
+ icon: import_lucide_react53.ArrowRight,
37020
37385
  onClick: () => runAtCellPos(columnHandle.cellPos, (chain) => chain.addColumnAfter())
37021
37386
  },
37022
37387
  {
37023
37388
  label: t("tableMenu.duplicateColumn"),
37024
- icon: import_lucide_react52.Copy,
37389
+ icon: import_lucide_react53.Copy,
37025
37390
  onClick: () => duplicateColumnAt(columnHandle.index, columnHandle.cellPos)
37026
37391
  },
37027
37392
  {
37028
37393
  label: t("tableMenu.clearColumnContents"),
37029
- icon: import_lucide_react52.Table,
37394
+ icon: import_lucide_react53.Table,
37030
37395
  onClick: () => clearColumnAt(columnHandle.index, columnHandle.cellPos)
37031
37396
  },
37032
37397
  {
37033
37398
  label: t("tableMenu.deleteColumn"),
37034
- icon: import_lucide_react52.Trash2,
37399
+ icon: import_lucide_react53.Trash2,
37035
37400
  onClick: () => runAtCellPos(columnHandle.cellPos, (chain) => chain.deleteColumn()),
37036
37401
  destructive: true
37037
37402
  }
@@ -37043,8 +37408,8 @@ function TableControls({ editor, containerRef }) {
37043
37408
  const menuLeft = Math.max(8, layout.tableLeft);
37044
37409
  const rowHandleLeft = layout.tableLeft - 12;
37045
37410
  const columnHandleTop = layout.tableTop - 12;
37046
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
37047
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
37411
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
37412
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
37048
37413
  TableRowHandles,
37049
37414
  {
37050
37415
  activeRowIndex: layout.activeRowIndex,
@@ -37061,7 +37426,7 @@ function TableControls({ editor, containerRef }) {
37061
37426
  rowHandles: layout.rowHandles
37062
37427
  }
37063
37428
  ),
37064
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
37429
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
37065
37430
  TableColumnHandles,
37066
37431
  {
37067
37432
  activeColumnIndex: layout.activeColumnIndex,
@@ -37078,7 +37443,7 @@ function TableControls({ editor, containerRef }) {
37078
37443
  openMenuKey
37079
37444
  }
37080
37445
  ),
37081
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
37446
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
37082
37447
  TableControlMenu,
37083
37448
  {
37084
37449
  controlsVisible,
@@ -37093,7 +37458,7 @@ function TableControls({ editor, containerRef }) {
37093
37458
  top: menuTop
37094
37459
  }
37095
37460
  ),
37096
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
37461
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
37097
37462
  TableAddRails,
37098
37463
  {
37099
37464
  addColumnVisible: hoverState.addColumnVisible,
@@ -37107,7 +37472,7 @@ function TableControls({ editor, containerRef }) {
37107
37472
  quickAddRowLabel: t("tableMenu.quickAddRowAfter")
37108
37473
  }
37109
37474
  ),
37110
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
37475
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
37111
37476
  TableDragPreview,
37112
37477
  {
37113
37478
  columnDragLabel: t("tableMenu.dragColumn"),
@@ -37278,10 +37643,10 @@ var UEDITOR_PROSEMIRROR_CLASS_NAME = cn(
37278
37643
  );
37279
37644
 
37280
37645
  // src/components/UEditor/use-table-interactions.ts
37281
- var import_react66 = __toESM(require("react"), 1);
37646
+ var import_react68 = __toESM(require("react"), 1);
37282
37647
 
37283
37648
  // src/components/UEditor/use-table-row-resize.ts
37284
- var import_react65 = __toESM(require("react"), 1);
37649
+ var import_react67 = __toESM(require("react"), 1);
37285
37650
  function useTableRowResize({
37286
37651
  editor,
37287
37652
  setHoveredTableCell,
@@ -37290,9 +37655,9 @@ function useTableRowResize({
37290
37655
  clearAllTableResizeHover,
37291
37656
  scheduleTableLayoutSync
37292
37657
  }) {
37293
- const commitFrameRef = (0, import_react65.useRef)(null);
37294
- const stateRef = (0, import_react65.useRef)(null);
37295
- const commitPreview = import_react65.default.useCallback(() => {
37658
+ const commitFrameRef = (0, import_react67.useRef)(null);
37659
+ const stateRef = (0, import_react67.useRef)(null);
37660
+ const commitPreview = import_react67.default.useCallback(() => {
37296
37661
  if (!editor) return;
37297
37662
  const state = stateRef.current;
37298
37663
  if (!state) return;
@@ -37327,22 +37692,22 @@ function useTableRowResize({
37327
37692
  showRowGuide(state.tableElement, state.rowElement, state.cellElement);
37328
37693
  scheduleTableLayoutSync();
37329
37694
  }, [editor, scheduleTableLayoutSync, showRowGuide]);
37330
- const scheduleCommit = import_react65.default.useCallback(() => {
37695
+ const scheduleCommit = import_react67.default.useCallback(() => {
37331
37696
  if (commitFrameRef.current !== null) return;
37332
37697
  commitFrameRef.current = window.requestAnimationFrame(() => {
37333
37698
  commitFrameRef.current = null;
37334
37699
  commitPreview();
37335
37700
  });
37336
37701
  }, [commitPreview]);
37337
- const syncActiveGuide = import_react65.default.useCallback(() => {
37702
+ const syncActiveGuide = import_react67.default.useCallback(() => {
37338
37703
  const state = stateRef.current;
37339
37704
  if (!state) return false;
37340
37705
  setHoveredTableCell(state.cellElement);
37341
37706
  showRowGuide(state.tableElement, state.rowElement, state.cellElement);
37342
37707
  return true;
37343
37708
  }, [setHoveredTableCell, showRowGuide]);
37344
- const isResizing = import_react65.default.useCallback(() => stateRef.current !== null, []);
37345
- const beginResize = import_react65.default.useCallback((event, table, row, cell) => {
37709
+ const isResizing = import_react67.default.useCallback(() => stateRef.current !== null, []);
37710
+ const beginResize = import_react67.default.useCallback((event, table, row, cell) => {
37346
37711
  if (!editor || !isRowResizeHotspot(cell, event.clientX, event.clientY)) {
37347
37712
  return false;
37348
37713
  }
@@ -37368,7 +37733,7 @@ function useTableRowResize({
37368
37733
  event.stopPropagation();
37369
37734
  return true;
37370
37735
  }, [editor, setHoveredTableCell, showRowGuide]);
37371
- const handlePointerMove = import_react65.default.useCallback((event) => {
37736
+ const handlePointerMove = import_react67.default.useCallback((event) => {
37372
37737
  const state = stateRef.current;
37373
37738
  if (!state) return;
37374
37739
  const nextHeight = Math.max(
@@ -37384,7 +37749,7 @@ function useTableRowResize({
37384
37749
  document.body.style.cursor = "row-resize";
37385
37750
  scheduleCommit();
37386
37751
  }, [scheduleCommit, showRowGuide]);
37387
- const handlePointerUp = import_react65.default.useCallback((event) => {
37752
+ const handlePointerUp = import_react67.default.useCallback((event) => {
37388
37753
  if (!editor) return;
37389
37754
  const state = stateRef.current;
37390
37755
  if (!state) return;
@@ -37414,7 +37779,7 @@ function useTableRowResize({
37414
37779
  clearAllTableResizeHover();
37415
37780
  scheduleTableLayoutSync();
37416
37781
  }, [clearAllTableResizeHover, clearHoveredTableCell, commitPreview, editor, scheduleTableLayoutSync]);
37417
- const cancelResize = import_react65.default.useCallback(() => {
37782
+ const cancelResize = import_react67.default.useCallback(() => {
37418
37783
  if (!stateRef.current) return;
37419
37784
  if (commitFrameRef.current !== null) {
37420
37785
  window.cancelAnimationFrame(commitFrameRef.current);
@@ -37426,7 +37791,7 @@ function useTableRowResize({
37426
37791
  clearAllTableResizeHover();
37427
37792
  scheduleTableLayoutSync();
37428
37793
  }, [clearAllTableResizeHover, clearHoveredTableCell, scheduleTableLayoutSync]);
37429
- const cleanup = import_react65.default.useCallback(() => {
37794
+ const cleanup = import_react67.default.useCallback(() => {
37430
37795
  if (commitFrameRef.current !== null) {
37431
37796
  window.cancelAnimationFrame(commitFrameRef.current);
37432
37797
  commitFrameRef.current = null;
@@ -37447,24 +37812,24 @@ function useTableRowResize({
37447
37812
 
37448
37813
  // src/components/UEditor/use-table-interactions.ts
37449
37814
  function useUEditorTableInteractions(editor, editable = true) {
37450
- const editorContentRef = (0, import_react66.useRef)(null);
37451
- const tableColumnGuideRef = (0, import_react66.useRef)(null);
37452
- const tableRowGuideRef = (0, import_react66.useRef)(null);
37453
- const activeTableCellHighlightRef = (0, import_react66.useRef)(null);
37454
- const hoveredTableCellRef = (0, import_react66.useRef)(null);
37455
- const activeTableCellRef = (0, import_react66.useRef)(null);
37456
- const suppressActiveCellHighlightRef = (0, import_react66.useRef)(false);
37457
- const tableLayoutSyncFrameRef = (0, import_react66.useRef)(null);
37458
- const getProseMirrorElement = import_react66.default.useCallback(() => {
37815
+ const editorContentRef = (0, import_react68.useRef)(null);
37816
+ const tableColumnGuideRef = (0, import_react68.useRef)(null);
37817
+ const tableRowGuideRef = (0, import_react68.useRef)(null);
37818
+ const activeTableCellHighlightRef = (0, import_react68.useRef)(null);
37819
+ const hoveredTableCellRef = (0, import_react68.useRef)(null);
37820
+ const activeTableCellRef = (0, import_react68.useRef)(null);
37821
+ const suppressActiveCellHighlightRef = (0, import_react68.useRef)(false);
37822
+ const tableLayoutSyncFrameRef = (0, import_react68.useRef)(null);
37823
+ const getProseMirrorElement = import_react68.default.useCallback(() => {
37459
37824
  return editorContentRef.current?.querySelector(".ProseMirror");
37460
37825
  }, []);
37461
- const setEditorResizeCursor = import_react66.default.useCallback((cursor) => {
37826
+ const setEditorResizeCursor = import_react68.default.useCallback((cursor) => {
37462
37827
  const proseMirror = getProseMirrorElement();
37463
37828
  if (proseMirror) {
37464
37829
  proseMirror.style.cursor = cursor;
37465
37830
  }
37466
37831
  }, [getProseMirrorElement]);
37467
- const hideColumnGuide = import_react66.default.useCallback(() => {
37832
+ const hideColumnGuide = import_react68.default.useCallback(() => {
37468
37833
  editorContentRef.current?.classList.remove("resize-cursor");
37469
37834
  getProseMirrorElement()?.classList.remove("resize-cursor");
37470
37835
  const guide = tableColumnGuideRef.current;
@@ -37472,7 +37837,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37472
37837
  guide.style.opacity = "0";
37473
37838
  }
37474
37839
  }, [getProseMirrorElement]);
37475
- const hideRowGuide = import_react66.default.useCallback(() => {
37840
+ const hideRowGuide = import_react68.default.useCallback(() => {
37476
37841
  editorContentRef.current?.classList.remove("resize-row-cursor");
37477
37842
  getProseMirrorElement()?.classList.remove("resize-row-cursor");
37478
37843
  const guide = tableRowGuideRef.current;
@@ -37480,12 +37845,12 @@ function useUEditorTableInteractions(editor, editable = true) {
37480
37845
  guide.style.opacity = "0";
37481
37846
  }
37482
37847
  }, [getProseMirrorElement]);
37483
- const clearAllTableResizeHover = import_react66.default.useCallback(() => {
37848
+ const clearAllTableResizeHover = import_react68.default.useCallback(() => {
37484
37849
  setEditorResizeCursor("");
37485
37850
  hideColumnGuide();
37486
37851
  hideRowGuide();
37487
37852
  }, [hideColumnGuide, hideRowGuide, setEditorResizeCursor]);
37488
- const updateActiveCellHighlight = import_react66.default.useCallback((cell) => {
37853
+ const updateActiveCellHighlight = import_react68.default.useCallback((cell) => {
37489
37854
  const surface = editorContentRef.current;
37490
37855
  const highlight = activeTableCellHighlightRef.current;
37491
37856
  if (!highlight) return;
@@ -37500,7 +37865,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37500
37865
  highlight.style.width = `${metrics.width}px`;
37501
37866
  highlight.style.height = `${metrics.height}px`;
37502
37867
  }, []);
37503
- const scheduleTableLayoutSync = import_react66.default.useCallback(() => {
37868
+ const scheduleTableLayoutSync = import_react68.default.useCallback(() => {
37504
37869
  if (tableLayoutSyncFrameRef.current !== null) return;
37505
37870
  tableLayoutSyncFrameRef.current = window.requestAnimationFrame(() => {
37506
37871
  tableLayoutSyncFrameRef.current = null;
@@ -37508,7 +37873,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37508
37873
  editorContentRef.current?.dispatchEvent(new CustomEvent(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT));
37509
37874
  });
37510
37875
  }, [updateActiveCellHighlight]);
37511
- const setActiveTableCell = import_react66.default.useCallback((cell) => {
37876
+ const setActiveTableCell = import_react68.default.useCallback((cell) => {
37512
37877
  if (activeTableCellRef.current === cell) {
37513
37878
  updateActiveCellHighlight(cell);
37514
37879
  return;
@@ -37516,17 +37881,17 @@ function useUEditorTableInteractions(editor, editable = true) {
37516
37881
  activeTableCellRef.current = cell;
37517
37882
  updateActiveCellHighlight(activeTableCellRef.current);
37518
37883
  }, [updateActiveCellHighlight]);
37519
- const clearActiveTableCell = import_react66.default.useCallback(() => {
37884
+ const clearActiveTableCell = import_react68.default.useCallback(() => {
37520
37885
  activeTableCellRef.current = null;
37521
37886
  updateActiveCellHighlight(null);
37522
37887
  }, [updateActiveCellHighlight]);
37523
- const setHoveredTableCell = import_react66.default.useCallback((cell) => {
37888
+ const setHoveredTableCell = import_react68.default.useCallback((cell) => {
37524
37889
  hoveredTableCellRef.current = cell;
37525
37890
  }, []);
37526
- const clearHoveredTableCell = import_react66.default.useCallback(() => {
37891
+ const clearHoveredTableCell = import_react68.default.useCallback(() => {
37527
37892
  hoveredTableCellRef.current = null;
37528
37893
  }, []);
37529
- const showColumnGuide = import_react66.default.useCallback((table, row, cell) => {
37894
+ const showColumnGuide = import_react68.default.useCallback((table, row, cell) => {
37530
37895
  const surface = editorContentRef.current;
37531
37896
  const guide = tableColumnGuideRef.current;
37532
37897
  if (!surface || !guide) return;
@@ -37540,7 +37905,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37540
37905
  getProseMirrorElement()?.classList.add("resize-cursor");
37541
37906
  setEditorResizeCursor("col-resize");
37542
37907
  }, [getProseMirrorElement, setEditorResizeCursor]);
37543
- const showRowGuide = import_react66.default.useCallback((table, row, cell) => {
37908
+ const showRowGuide = import_react68.default.useCallback((table, row, cell) => {
37544
37909
  const surface = editorContentRef.current;
37545
37910
  const guide = tableRowGuideRef.current;
37546
37911
  if (!surface || !guide) return;
@@ -37570,7 +37935,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37570
37935
  clearAllTableResizeHover,
37571
37936
  scheduleTableLayoutSync
37572
37937
  });
37573
- const syncActiveTableCellFromSelection = import_react66.default.useCallback(() => {
37938
+ const syncActiveTableCellFromSelection = import_react68.default.useCallback(() => {
37574
37939
  if (!editor) return;
37575
37940
  if (!editor.isFocused) {
37576
37941
  clearActiveTableCell();
@@ -37578,7 +37943,7 @@ function useUEditorTableInteractions(editor, editable = true) {
37578
37943
  }
37579
37944
  setActiveTableCell(getSelectionTableCell(editor.view));
37580
37945
  }, [clearActiveTableCell, editor, setActiveTableCell]);
37581
- (0, import_react66.useEffect)(() => {
37946
+ (0, import_react68.useEffect)(() => {
37582
37947
  if (!editor || !editable) return void 0;
37583
37948
  const proseMirror = editor.view.dom;
37584
37949
  const surface = editorContentRef.current;
@@ -37751,17 +38116,17 @@ function useUEditorTableInteractions(editor, editable = true) {
37751
38116
  }
37752
38117
 
37753
38118
  // src/components/UEditor/menu-bar.tsx
37754
- var import_react67 = __toESM(require("react"), 1);
37755
- var import_react68 = require("@tiptap/react");
37756
- var import_lucide_react53 = require("lucide-react");
37757
- var import_jsx_runtime93 = require("react/jsx-runtime");
38119
+ var import_react69 = __toESM(require("react"), 1);
38120
+ var import_react70 = require("@tiptap/react");
38121
+ var import_lucide_react54 = require("lucide-react");
38122
+ var import_jsx_runtime94 = require("react/jsx-runtime");
37758
38123
  function MenuTableInsertGrid({
37759
38124
  insertLabel,
37760
38125
  previewTemplate,
37761
38126
  onInsert
37762
38127
  }) {
37763
38128
  const closeMenu = useDropdownMenuClose();
37764
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38129
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
37765
38130
  TableInsertGrid,
37766
38131
  {
37767
38132
  insertLabel,
@@ -37777,9 +38142,9 @@ function renderMenuItems(items) {
37777
38142
  return items.map((item, i) => {
37778
38143
  switch (item.type) {
37779
38144
  case "separator":
37780
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DropdownMenuSeparator, {}, i);
38145
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DropdownMenuSeparator, {}, i);
37781
38146
  case "action":
37782
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38147
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
37783
38148
  DropdownMenuItem,
37784
38149
  {
37785
38150
  label: item.label,
@@ -37793,9 +38158,9 @@ function renderMenuItems(items) {
37793
38158
  i
37794
38159
  );
37795
38160
  case "sub":
37796
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
38161
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
37797
38162
  case "custom":
37798
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react67.default.Fragment, { children: item.render() }, item.key);
38163
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react69.default.Fragment, { children: item.render() }, item.key);
37799
38164
  }
37800
38165
  });
37801
38166
  }
@@ -37833,7 +38198,7 @@ function buildEditMenuItems(t, editor) {
37833
38198
  {
37834
38199
  type: "action",
37835
38200
  label: t("menubar.undo"),
37836
- icon: import_lucide_react53.Undo,
38201
+ icon: import_lucide_react54.Undo,
37837
38202
  shortcut: t("menubar.undoShortcut"),
37838
38203
  onClick: () => editor.chain().focus().undo().run(),
37839
38204
  disabled: !editor.can().undo()
@@ -37841,7 +38206,7 @@ function buildEditMenuItems(t, editor) {
37841
38206
  {
37842
38207
  type: "action",
37843
38208
  label: t("menubar.redo"),
37844
- icon: import_lucide_react53.Redo,
38209
+ icon: import_lucide_react54.Redo,
37845
38210
  shortcut: t("menubar.redoShortcut"),
37846
38211
  onClick: () => editor.chain().focus().redo().run(),
37847
38212
  disabled: !editor.can().redo()
@@ -37850,7 +38215,7 @@ function buildEditMenuItems(t, editor) {
37850
38215
  {
37851
38216
  type: "action",
37852
38217
  label: t("menubar.cut"),
37853
- icon: import_lucide_react53.Scissors,
38218
+ icon: import_lucide_react54.Scissors,
37854
38219
  shortcut: t("menubar.cutShortcut"),
37855
38220
  onClick: () => document.execCommand("cut")
37856
38221
  },
@@ -37898,7 +38263,7 @@ function buildViewMenuItems(t, {
37898
38263
  {
37899
38264
  type: "action",
37900
38265
  label: t("menubar.sourceCode"),
37901
- icon: import_lucide_react53.FileCode,
38266
+ icon: import_lucide_react54.FileCode,
37902
38267
  onClick: () => onSourceCode ? onSourceCode() : openSourceDialog()
37903
38268
  },
37904
38269
  {
@@ -37910,7 +38275,7 @@ function buildViewMenuItems(t, {
37910
38275
  {
37911
38276
  type: "action",
37912
38277
  label: t("menubar.fullscreen"),
37913
- icon: import_lucide_react53.Maximize2,
38278
+ icon: import_lucide_react54.Maximize2,
37914
38279
  shortcut: t("menubar.fullscreenShortcut"),
37915
38280
  onClick: () => {
37916
38281
  const el = containerRef.current;
@@ -37929,7 +38294,7 @@ function buildFormatMenuItems(t, editor) {
37929
38294
  {
37930
38295
  type: "action",
37931
38296
  label: t("menubar.bold"),
37932
- icon: import_lucide_react53.Bold,
38297
+ icon: import_lucide_react54.Bold,
37933
38298
  shortcut: t("menubar.boldShortcut"),
37934
38299
  active: editor.isActive("bold"),
37935
38300
  onClick: () => editor.chain().focus().toggleBold().run()
@@ -37937,7 +38302,7 @@ function buildFormatMenuItems(t, editor) {
37937
38302
  {
37938
38303
  type: "action",
37939
38304
  label: t("menubar.italic"),
37940
- icon: import_lucide_react53.Italic,
38305
+ icon: import_lucide_react54.Italic,
37941
38306
  shortcut: t("menubar.italicShortcut"),
37942
38307
  active: editor.isActive("italic"),
37943
38308
  onClick: () => editor.chain().focus().toggleItalic().run()
@@ -37945,7 +38310,7 @@ function buildFormatMenuItems(t, editor) {
37945
38310
  {
37946
38311
  type: "action",
37947
38312
  label: t("menubar.underline"),
37948
- icon: import_lucide_react53.Underline,
38313
+ icon: import_lucide_react54.Underline,
37949
38314
  shortcut: t("menubar.underlineShortcut"),
37950
38315
  active: editor.isActive("underline"),
37951
38316
  onClick: () => editor.chain().focus().toggleUnderline().run()
@@ -37953,28 +38318,28 @@ function buildFormatMenuItems(t, editor) {
37953
38318
  {
37954
38319
  type: "action",
37955
38320
  label: t("menubar.strike"),
37956
- icon: import_lucide_react53.Strikethrough,
38321
+ icon: import_lucide_react54.Strikethrough,
37957
38322
  active: editor.isActive("strike"),
37958
38323
  onClick: () => editor.chain().focus().toggleStrike().run()
37959
38324
  },
37960
38325
  {
37961
38326
  type: "action",
37962
38327
  label: t("menubar.superscript"),
37963
- icon: import_lucide_react53.Superscript,
38328
+ icon: import_lucide_react54.Superscript,
37964
38329
  active: editor.isActive("superscript"),
37965
38330
  onClick: () => editor.chain().focus().toggleSuperscript().run()
37966
38331
  },
37967
38332
  {
37968
38333
  type: "action",
37969
38334
  label: t("menubar.subscript"),
37970
- icon: import_lucide_react53.Subscript,
38335
+ icon: import_lucide_react54.Subscript,
37971
38336
  active: editor.isActive("subscript"),
37972
38337
  onClick: () => editor.chain().focus().toggleSubscript().run()
37973
38338
  },
37974
38339
  {
37975
38340
  type: "action",
37976
38341
  label: t("menubar.code"),
37977
- icon: import_lucide_react53.Code,
38342
+ icon: import_lucide_react54.Code,
37978
38343
  active: editor.isActive("code"),
37979
38344
  onClick: () => editor.chain().focus().toggleCode().run()
37980
38345
  },
@@ -37992,21 +38357,21 @@ function buildFormatMenuItems(t, editor) {
37992
38357
  {
37993
38358
  type: "action",
37994
38359
  label: t("menubar.heading1"),
37995
- icon: import_lucide_react53.Heading1,
38360
+ icon: import_lucide_react54.Heading1,
37996
38361
  active: editor.isActive("heading", { level: 1 }),
37997
38362
  onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run()
37998
38363
  },
37999
38364
  {
38000
38365
  type: "action",
38001
38366
  label: t("menubar.heading2"),
38002
- icon: import_lucide_react53.Heading2,
38367
+ icon: import_lucide_react54.Heading2,
38003
38368
  active: editor.isActive("heading", { level: 2 }),
38004
38369
  onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run()
38005
38370
  },
38006
38371
  {
38007
38372
  type: "action",
38008
38373
  label: t("menubar.heading3"),
38009
- icon: import_lucide_react53.Heading3,
38374
+ icon: import_lucide_react54.Heading3,
38010
38375
  active: editor.isActive("heading", { level: 3 }),
38011
38376
  onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run()
38012
38377
  },
@@ -38014,21 +38379,21 @@ function buildFormatMenuItems(t, editor) {
38014
38379
  {
38015
38380
  type: "action",
38016
38381
  label: t("menubar.blockquote"),
38017
- icon: import_lucide_react53.Quote,
38382
+ icon: import_lucide_react54.Quote,
38018
38383
  active: editor.isActive("blockquote"),
38019
38384
  onClick: () => editor.chain().focus().toggleBlockquote().run()
38020
38385
  },
38021
38386
  {
38022
38387
  type: "action",
38023
38388
  label: t("menubar.codeBlock"),
38024
- icon: import_lucide_react53.FileCode,
38389
+ icon: import_lucide_react54.FileCode,
38025
38390
  active: editor.isActive("codeBlock"),
38026
38391
  onClick: () => editor.chain().focus().toggleCodeBlock().run()
38027
38392
  },
38028
38393
  {
38029
38394
  type: "action",
38030
38395
  label: t("menubar.taskList"),
38031
- icon: import_lucide_react53.ListTodo,
38396
+ icon: import_lucide_react54.ListTodo,
38032
38397
  active: editor.isActive("taskList"),
38033
38398
  onClick: () => editor.chain().focus().toggleTaskList().run()
38034
38399
  }
@@ -38041,28 +38406,28 @@ function buildFormatMenuItems(t, editor) {
38041
38406
  {
38042
38407
  type: "action",
38043
38408
  label: t("menubar.alignLeft"),
38044
- icon: import_lucide_react53.AlignLeft,
38409
+ icon: import_lucide_react54.AlignLeft,
38045
38410
  active: editor.isActive({ textAlign: "left" }),
38046
38411
  onClick: () => editor.chain().focus().setTextAlign("left").run()
38047
38412
  },
38048
38413
  {
38049
38414
  type: "action",
38050
38415
  label: t("menubar.alignCenter"),
38051
- icon: import_lucide_react53.AlignCenter,
38416
+ icon: import_lucide_react54.AlignCenter,
38052
38417
  active: editor.isActive({ textAlign: "center" }),
38053
38418
  onClick: () => editor.chain().focus().setTextAlign("center").run()
38054
38419
  },
38055
38420
  {
38056
38421
  type: "action",
38057
38422
  label: t("menubar.alignRight"),
38058
- icon: import_lucide_react53.AlignRight,
38423
+ icon: import_lucide_react54.AlignRight,
38059
38424
  active: editor.isActive({ textAlign: "right" }),
38060
38425
  onClick: () => editor.chain().focus().setTextAlign("right").run()
38061
38426
  },
38062
38427
  {
38063
38428
  type: "action",
38064
38429
  label: t("menubar.alignJustify"),
38065
- icon: import_lucide_react53.AlignJustify,
38430
+ icon: import_lucide_react54.AlignJustify,
38066
38431
  active: editor.isActive({ textAlign: "justify" }),
38067
38432
  onClick: () => editor.chain().focus().setTextAlign("justify").run()
38068
38433
  }
@@ -38081,7 +38446,7 @@ function buildToolsMenuItems(t, { onSourceCode, openSourceDialog }) {
38081
38446
  {
38082
38447
  type: "action",
38083
38448
  label: t("menubar.sourceCode"),
38084
- icon: import_lucide_react53.FileCode,
38449
+ icon: import_lucide_react54.FileCode,
38085
38450
  onClick: () => onSourceCode ? onSourceCode() : openSourceDialog()
38086
38451
  }
38087
38452
  ];
@@ -38092,12 +38457,12 @@ function buildTableMenuItems(t, editor, onInsertTable) {
38092
38457
  {
38093
38458
  type: "sub",
38094
38459
  label: t("menubar.insertTable"),
38095
- icon: import_lucide_react53.Table,
38460
+ icon: import_lucide_react54.Table,
38096
38461
  items: [
38097
38462
  {
38098
38463
  type: "custom",
38099
38464
  key: "table-insert-grid",
38100
- render: () => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38465
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38101
38466
  MenuTableInsertGrid,
38102
38467
  {
38103
38468
  insertLabel: t("tableMenu.insertTable"),
@@ -38118,7 +38483,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
38118
38483
  {
38119
38484
  type: "action",
38120
38485
  label: t("menubar.deleteTable"),
38121
- icon: import_lucide_react53.Trash2,
38486
+ icon: import_lucide_react54.Trash2,
38122
38487
  destructive: true,
38123
38488
  disabled: !inTable,
38124
38489
  onClick: () => editor.chain().focus().deleteTable().run()
@@ -38193,8 +38558,8 @@ function buildTableMenuItems(t, editor, onInsertTable) {
38193
38558
  }
38194
38559
  ];
38195
38560
  }
38196
- var MenuBarTrigger = import_react67.default.forwardRef(
38197
- ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38561
+ var MenuBarTrigger = import_react69.default.forwardRef(
38562
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38198
38563
  "button",
38199
38564
  {
38200
38565
  ref,
@@ -38225,17 +38590,17 @@ var MenuBar = ({
38225
38590
  onPreview
38226
38591
  }) => {
38227
38592
  const t = useSmartTranslations("UEditor");
38228
- (0, import_react68.useEditorState)({
38593
+ (0, import_react70.useEditorState)({
38229
38594
  editor,
38230
38595
  selector: ({ transactionNumber }) => transactionNumber
38231
38596
  });
38232
- const fileInputRef = (0, import_react67.useRef)(null);
38233
- const [showImageInput, setShowImageInput] = (0, import_react67.useState)(false);
38234
- const [showLinkInput, setShowLinkInput] = (0, import_react67.useState)(false);
38235
- const [isInsertMenuOpen, setIsInsertMenuOpen] = (0, import_react67.useState)(false);
38236
- const [showSourceDialog, setShowSourceDialog] = (0, import_react67.useState)(false);
38237
- const [sourceHtml, setSourceHtml] = (0, import_react67.useState)("");
38238
- const [showPreviewDialog, setShowPreviewDialog] = (0, import_react67.useState)(false);
38597
+ const fileInputRef = (0, import_react69.useRef)(null);
38598
+ const [showImageInput, setShowImageInput] = (0, import_react69.useState)(false);
38599
+ const [showLinkInput, setShowLinkInput] = (0, import_react69.useState)(false);
38600
+ const [isInsertMenuOpen, setIsInsertMenuOpen] = (0, import_react69.useState)(false);
38601
+ const [showSourceDialog, setShowSourceDialog] = (0, import_react69.useState)(false);
38602
+ const [sourceHtml, setSourceHtml] = (0, import_react69.useState)("");
38603
+ const [showPreviewDialog, setShowPreviewDialog] = (0, import_react69.useState)(false);
38239
38604
  const openSourceDialog = () => {
38240
38605
  setSourceHtml(editor.getHTML());
38241
38606
  setShowSourceDialog(true);
@@ -38296,13 +38661,13 @@ var MenuBar = ({
38296
38661
  {
38297
38662
  type: "custom",
38298
38663
  key: "image",
38299
- render: () => showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
38300
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DropdownMenuItem, { label: t("menubar.image"), icon: import_lucide_react53.Image, onClick: () => setShowImageInput(true), closeOnSelect: false }),
38301
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38664
+ render: () => showImageInput ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
38665
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DropdownMenuItem, { label: t("menubar.image"), icon: import_lucide_react54.Image, onClick: () => setShowImageInput(true), closeOnSelect: false }),
38666
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38302
38667
  DropdownMenuItem,
38303
38668
  {
38304
38669
  label: t("menubar.imageUpload"),
38305
- icon: import_lucide_react53.Upload,
38670
+ icon: import_lucide_react54.Upload,
38306
38671
  onClick: () => fileInputRef.current?.click(),
38307
38672
  closeOnSelect: false
38308
38673
  }
@@ -38313,11 +38678,11 @@ var MenuBar = ({
38313
38678
  {
38314
38679
  type: "custom",
38315
38680
  key: "link",
38316
- render: () => showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38681
+ render: () => showLinkInput ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38317
38682
  DropdownMenuItem,
38318
38683
  {
38319
38684
  label: t("menubar.link"),
38320
- icon: import_lucide_react53.Link,
38685
+ icon: import_lucide_react54.Link,
38321
38686
  shortcut: t("menubar.linkShortcut"),
38322
38687
  onClick: () => setShowLinkInput(true),
38323
38688
  closeOnSelect: false
@@ -38328,12 +38693,12 @@ var MenuBar = ({
38328
38693
  {
38329
38694
  type: "sub",
38330
38695
  label: t("menubar.insertTable"),
38331
- icon: import_lucide_react53.Table,
38696
+ icon: import_lucide_react54.Table,
38332
38697
  items: [
38333
38698
  {
38334
38699
  type: "custom",
38335
38700
  key: "table-grid",
38336
- render: () => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38701
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38337
38702
  MenuTableInsertGrid,
38338
38703
  {
38339
38704
  insertLabel: t("tableMenu.insertTable"),
@@ -38386,8 +38751,8 @@ var MenuBar = ({
38386
38751
  },
38387
38752
  { label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
38388
38753
  ];
38389
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
38390
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38754
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
38755
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38391
38756
  "input",
38392
38757
  {
38393
38758
  ref: fileInputRef,
@@ -38398,11 +38763,11 @@ var MenuBar = ({
38398
38763
  onChange: (e) => handleImageFiles(e.target.files)
38399
38764
  }
38400
38765
  ),
38401
- /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
38402
- menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38766
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
38767
+ menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38403
38768
  DropdownMenu,
38404
38769
  {
38405
- trigger: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(MenuBarTrigger, { children: label }),
38770
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MenuBarTrigger, { children: label }),
38406
38771
  placement: "bottom-start",
38407
38772
  isOpen: open,
38408
38773
  onOpenChange,
@@ -38410,7 +38775,7 @@ var MenuBar = ({
38410
38775
  },
38411
38776
  label
38412
38777
  )),
38413
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38778
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38414
38779
  "button",
38415
38780
  {
38416
38781
  type: "button",
@@ -38421,20 +38786,20 @@ var MenuBar = ({
38421
38786
  "ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
38422
38787
  "hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
38423
38788
  ),
38424
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.Eye, { className: "h-4 w-4", "aria-hidden": "true" })
38789
+ children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_lucide_react54.Eye, { className: "h-4 w-4", "aria-hidden": "true" })
38425
38790
  }
38426
38791
  )
38427
38792
  ] }),
38428
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38793
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38429
38794
  Modal_default,
38430
38795
  {
38431
38796
  isOpen: showSourceDialog,
38432
38797
  onClose: () => setShowSourceDialog(false),
38433
38798
  title: t("menubar.sourceCode"),
38434
38799
  size: "lg",
38435
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "space-y-3", children: [
38436
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
38437
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38800
+ children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "space-y-3", children: [
38801
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
38802
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38438
38803
  "textarea",
38439
38804
  {
38440
38805
  "data-testid": "source-code-textarea",
@@ -38444,8 +38809,8 @@ var MenuBar = ({
38444
38809
  spellCheck: false
38445
38810
  }
38446
38811
  ),
38447
- /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex gap-2 justify-end", children: [
38448
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38812
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "flex gap-2 justify-end", children: [
38813
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38449
38814
  "button",
38450
38815
  {
38451
38816
  type: "button",
@@ -38454,7 +38819,7 @@ var MenuBar = ({
38454
38819
  children: t("menubar.applySource")
38455
38820
  }
38456
38821
  ),
38457
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38822
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38458
38823
  "button",
38459
38824
  {
38460
38825
  type: "button",
@@ -38467,7 +38832,7 @@ var MenuBar = ({
38467
38832
  ] })
38468
38833
  }
38469
38834
  ),
38470
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38835
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38471
38836
  Modal_default,
38472
38837
  {
38473
38838
  isOpen: showPreviewDialog,
@@ -38478,12 +38843,12 @@ var MenuBar = ({
38478
38843
  height: "min(860px, calc(100vh - 2rem))",
38479
38844
  className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
38480
38845
  contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
38481
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38846
+ children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38482
38847
  "div",
38483
38848
  {
38484
38849
  "data-testid": "preview-content",
38485
38850
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-8",
38486
- children: editor.isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
38851
+ children: editor.isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38487
38852
  "div",
38488
38853
  {
38489
38854
  className: UEDITOR_PROSEMIRROR_CLASS_NAME,
@@ -38498,8 +38863,8 @@ var MenuBar = ({
38498
38863
  };
38499
38864
 
38500
38865
  // src/components/UEditor/UEditor.tsx
38501
- var import_jsx_runtime94 = require("react/jsx-runtime");
38502
- var UEditor = import_react69.default.forwardRef(({
38866
+ var import_jsx_runtime95 = require("react/jsx-runtime");
38867
+ var UEditor = import_react71.default.forwardRef(({
38503
38868
  content = "",
38504
38869
  onChange,
38505
38870
  onHtmlChange,
@@ -38539,10 +38904,10 @@ var UEditor = import_react69.default.forwardRef(({
38539
38904
  }, ref) => {
38540
38905
  const t = useSmartTranslations("UEditor");
38541
38906
  const effectivePlaceholder = placeholder ?? t("placeholder");
38542
- const inFlightPrepareRef = (0, import_react69.useRef)(null);
38543
- const lastAppliedContentRef = (0, import_react69.useRef)(content ?? "");
38544
- const scheduledFormulaRecalculateRef = (0, import_react69.useRef)(false);
38545
- const resolvedUploadFile = (0, import_react69.useMemo)(() => {
38907
+ const inFlightPrepareRef = (0, import_react71.useRef)(null);
38908
+ const lastAppliedContentRef = (0, import_react71.useRef)(content ?? "");
38909
+ const scheduledFormulaRecalculateRef = (0, import_react71.useRef)(false);
38910
+ const resolvedUploadFile = (0, import_react71.useMemo)(() => {
38546
38911
  if (uploadFile) return uploadFile;
38547
38912
  if (uploadFileForSave) {
38548
38913
  return async (file) => {
@@ -38552,7 +38917,7 @@ var UEditor = import_react69.default.forwardRef(({
38552
38917
  }
38553
38918
  return uploadImage;
38554
38919
  }, [uploadFile, uploadFileForSave, uploadImage]);
38555
- const extensions = (0, import_react69.useMemo)(
38920
+ const extensions = (0, import_react71.useMemo)(
38556
38921
  () => [
38557
38922
  ...buildUEditorExtensions({
38558
38923
  placeholder: effectivePlaceholder,
@@ -38571,7 +38936,7 @@ var UEditor = import_react69.default.forwardRef(({
38571
38936
  ],
38572
38937
  [effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, editable, fetchMetadata, extraExtensions]
38573
38938
  );
38574
- const editor = (0, import_react70.useEditor)({
38939
+ const editor = (0, import_react72.useEditor)({
38575
38940
  immediatelyRender: false,
38576
38941
  extensions,
38577
38942
  content,
@@ -38627,7 +38992,7 @@ var UEditor = import_react69.default.forwardRef(({
38627
38992
  tableRowGuideRef,
38628
38993
  activeTableCellHighlightRef
38629
38994
  } = useUEditorTableInteractions(editor, editable);
38630
- (0, import_react69.useImperativeHandle)(
38995
+ (0, import_react71.useImperativeHandle)(
38631
38996
  ref,
38632
38997
  () => ({
38633
38998
  editor,
@@ -38652,7 +39017,7 @@ var UEditor = import_react69.default.forwardRef(({
38652
39017
  }),
38653
39018
  [content, editor, uploadImageForSave, uploadFileForSave, uploadImageConcurrency]
38654
39019
  );
38655
- (0, import_react69.useEffect)(() => {
39020
+ (0, import_react71.useEffect)(() => {
38656
39021
  if (!editor) return;
38657
39022
  queueMicrotask(() => {
38658
39023
  if (!editor.isDestroyed) {
@@ -38660,7 +39025,7 @@ var UEditor = import_react69.default.forwardRef(({
38660
39025
  }
38661
39026
  });
38662
39027
  }, [editor]);
38663
- (0, import_react69.useEffect)(() => {
39028
+ (0, import_react71.useEffect)(() => {
38664
39029
  if (!editor) return;
38665
39030
  const nextContent = content ?? "";
38666
39031
  if (lastAppliedContentRef.current === nextContent) return;
@@ -38679,7 +39044,7 @@ var UEditor = import_react69.default.forwardRef(({
38679
39044
  }
38680
39045
  }, [content, editor]);
38681
39046
  if (!editor) {
38682
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39047
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38683
39048
  "div",
38684
39049
  {
38685
39050
  className: cn("w-full border bg-background flex items-center justify-center text-muted-foreground", className),
@@ -38688,7 +39053,7 @@ var UEditor = import_react69.default.forwardRef(({
38688
39053
  }
38689
39054
  );
38690
39055
  }
38691
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
39056
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
38692
39057
  "div",
38693
39058
  {
38694
39059
  className: cn(
@@ -38703,7 +39068,7 @@ var UEditor = import_react69.default.forwardRef(({
38703
39068
  className
38704
39069
  ),
38705
39070
  children: [
38706
- editable && showMenuBar && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39071
+ editable && showMenuBar && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38707
39072
  MenuBar,
38708
39073
  {
38709
39074
  editor,
@@ -38718,7 +39083,7 @@ var UEditor = import_react69.default.forwardRef(({
38718
39083
  onPreview
38719
39084
  }
38720
39085
  ),
38721
- editable && showToolbar && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39086
+ editable && showToolbar && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38722
39087
  EditorToolbar,
38723
39088
  {
38724
39089
  editor,
@@ -38733,7 +39098,7 @@ var UEditor = import_react69.default.forwardRef(({
38733
39098
  letterSpacings
38734
39099
  }
38735
39100
  ),
38736
- editable && showBubbleMenu && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39101
+ editable && showBubbleMenu && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38737
39102
  CustomBubbleMenu,
38738
39103
  {
38739
39104
  editor,
@@ -38741,7 +39106,7 @@ var UEditor = import_react69.default.forwardRef(({
38741
39106
  lineHeights
38742
39107
  }
38743
39108
  ),
38744
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
39109
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
38745
39110
  "div",
38746
39111
  {
38747
39112
  ref: editorContentRef,
@@ -38751,7 +39116,7 @@ var UEditor = import_react69.default.forwardRef(({
38751
39116
  maxHeight
38752
39117
  },
38753
39118
  children: [
38754
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39119
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38755
39120
  "span",
38756
39121
  {
38757
39122
  ref: tableColumnGuideRef,
@@ -38759,7 +39124,7 @@ var UEditor = import_react69.default.forwardRef(({
38759
39124
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
38760
39125
  }
38761
39126
  ),
38762
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39127
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38763
39128
  "span",
38764
39129
  {
38765
39130
  ref: tableRowGuideRef,
@@ -38767,7 +39132,7 @@ var UEditor = import_react69.default.forwardRef(({
38767
39132
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
38768
39133
  }
38769
39134
  ),
38770
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
39135
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
38771
39136
  "span",
38772
39137
  {
38773
39138
  ref: activeTableCellHighlightRef,
@@ -38776,9 +39141,9 @@ var UEditor = import_react69.default.forwardRef(({
38776
39141
  className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10"
38777
39142
  }
38778
39143
  ),
38779
- editable && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TableControls, { editor, containerRef: editorContentRef }),
38780
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
38781
- import_react70.EditorContent,
39144
+ editable && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TableControls, { editor, containerRef: editorContentRef }),
39145
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
39146
+ import_react72.EditorContent,
38782
39147
  {
38783
39148
  editor,
38784
39149
  className: "min-h-full"
@@ -38787,7 +39152,7 @@ var UEditor = import_react69.default.forwardRef(({
38787
39152
  ]
38788
39153
  }
38789
39154
  ),
38790
- showCharacterCount && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(CharacterCountDisplay, { editor, maxCharacters })
39155
+ showCharacterCount && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(CharacterCountDisplay, { editor, maxCharacters })
38791
39156
  ]
38792
39157
  }
38793
39158
  );