@underverse-ui/underverse 2.0.35 → 2.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/api-reference.json +1 -1
  2. package/dist/DatePicker-FDOTQMNL.js +15 -0
  3. package/dist/{EmojiPicker-6H52Q4YE.js → EmojiPicker-Z7QPW4DA.js} +5 -4
  4. package/dist/EmojiPicker-Z7QPW4DA.js.map +1 -0
  5. package/dist/chunk-5GMQ23IU.js +719 -0
  6. package/dist/chunk-5GMQ23IU.js.map +1 -0
  7. package/dist/{chunk-L73HBI6E.js → chunk-5VCM2Z7M.js} +6 -4
  8. package/dist/{chunk-L73HBI6E.js.map → chunk-5VCM2Z7M.js.map} +1 -1
  9. package/dist/{chunk-6FAHXNDQ.js → chunk-6XQTRIP6.js} +10 -349
  10. package/dist/chunk-6XQTRIP6.js.map +1 -0
  11. package/dist/chunk-EN33T3LJ.js +358 -0
  12. package/dist/chunk-EN33T3LJ.js.map +1 -0
  13. package/dist/{chunk-WFQV7XFC.js → chunk-JABD2ONI.js} +3 -3
  14. package/dist/chunk-JG3U26V6.js +1692 -0
  15. package/dist/chunk-JG3U26V6.js.map +1 -0
  16. package/dist/{chunk-H4AVZA4K.js → chunk-SCW2XGCE.js} +462 -353
  17. package/dist/chunk-SCW2XGCE.js.map +1 -0
  18. package/dist/{chunk-W3QTP2DM.js → chunk-TSBKJELM.js} +2 -2
  19. package/dist/{chunk-F2P3DJSC.js → chunk-V4VZZHV7.js} +322 -1029
  20. package/dist/chunk-V4VZZHV7.js.map +1 -0
  21. package/dist/index.cjs +13472 -13308
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +20 -0
  24. package/dist/index.d.ts +20 -0
  25. package/dist/index.js +1942 -3569
  26. package/dist/index.js.map +1 -1
  27. package/dist/{menu-bar-MUISXLMR.js → menu-bar-MX3LXG6T.js} +6 -4
  28. package/dist/{menu-bar-MUISXLMR.js.map → menu-bar-MX3LXG6T.js.map} +1 -1
  29. package/dist/ueditor.cjs +2777 -1098
  30. package/dist/ueditor.cjs.map +1 -1
  31. package/dist/ueditor.js +6 -4
  32. package/package.json +1 -1
  33. package/dist/chunk-6FAHXNDQ.js.map +0 -1
  34. package/dist/chunk-F2P3DJSC.js.map +0 -1
  35. package/dist/chunk-H4AVZA4K.js.map +0 -1
  36. /package/dist/{EmojiPicker-6H52Q4YE.js.map → DatePicker-FDOTQMNL.js.map} +0 -0
  37. /package/dist/{chunk-WFQV7XFC.js.map → chunk-JABD2ONI.js.map} +0 -0
  38. /package/dist/{chunk-W3QTP2DM.js.map → chunk-TSBKJELM.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EmojiGridButton,
3
3
  formatEmojiCountLabel
4
- } from "./chunk-W3QTP2DM.js";
4
+ } from "./chunk-TSBKJELM.js";
5
5
  import {
6
6
  COLUMN_RESIZE_LINE_THICKNESS,
7
7
  CellBgColorIcon,
@@ -17,7 +17,6 @@ import {
17
17
  HighlightColorIcon,
18
18
  LinkInput,
19
19
  MIN_TABLE_ROW_HEIGHT,
20
- Popover,
21
20
  ROW_RESIZE_LINE_THICKNESS,
22
21
  TABLE_WIDTH_BASIS_POINTS,
23
22
  TextColorIcon,
@@ -94,9 +93,14 @@ import {
94
93
  sanitizeUEditorUrl,
95
94
  useEditorColors,
96
95
  useSharedEditorUiRenderState
97
- } from "./chunk-F2P3DJSC.js";
96
+ } from "./chunk-V4VZZHV7.js";
97
+ import {
98
+ Tooltip
99
+ } from "./chunk-EN33T3LJ.js";
100
+ import {
101
+ Popover
102
+ } from "./chunk-5GMQ23IU.js";
98
103
  import {
99
- Tooltip,
100
104
  UEditorPortalProvider,
101
105
  cn,
102
106
  formControlGroupOutlineClass,
@@ -104,7 +108,7 @@ import {
104
108
  resolveUEditorPortalContainer,
105
109
  useSmartTranslations,
106
110
  useUEditorPortalContainerGetter
107
- } from "./chunk-6FAHXNDQ.js";
111
+ } from "./chunk-6XQTRIP6.js";
108
112
 
109
113
  // src/components/UEditor/prepare-content-for-save.ts
110
114
  var MIME_EXTENSION_MAP = {
@@ -522,11 +526,11 @@ async function prepareUEditorContentForSave({
522
526
  }
523
527
 
524
528
  // src/components/UEditor/UEditor.tsx
525
- import React16, { useEffect as useEffect10, useImperativeHandle as useImperativeHandle4, useMemo as useMemo2, useRef as useRef10 } from "react";
529
+ import React17, { useEffect as useEffect10, useImperativeHandle as useImperativeHandle4, useMemo as useMemo2, useRef as useRef10 } from "react";
526
530
  import { useEditor, EditorContent } from "@tiptap/react";
527
531
 
528
532
  // src/components/UEditor/extensions.ts
529
- import { mergeAttributes as mergeAttributes8 } from "@tiptap/core";
533
+ import { mergeAttributes as mergeAttributes9 } from "@tiptap/core";
530
534
  import { Document } from "@tiptap/extension-document";
531
535
  import { Paragraph } from "@tiptap/extension-paragraph";
532
536
  import { Text } from "@tiptap/extension-text";
@@ -544,7 +548,7 @@ import { TaskItem } from "@tiptap/extension-task-item";
544
548
  import { Blockquote } from "@tiptap/extension-blockquote";
545
549
  import { Code } from "@tiptap/extension-code";
546
550
  import { wrappingInputRule } from "@tiptap/core";
547
- import { ReactNodeViewRenderer as ReactNodeViewRenderer7 } from "@tiptap/react";
551
+ import { ReactNodeViewRenderer as ReactNodeViewRenderer8 } from "@tiptap/react";
548
552
 
549
553
  // src/components/UEditor/callout.ts
550
554
  import { Node, mergeAttributes } from "@tiptap/core";
@@ -557,7 +561,7 @@ import { NodeViewWrapper, NodeViewContent } from "@tiptap/react";
557
561
  import React from "react";
558
562
  import { jsx } from "react/jsx-runtime";
559
563
  var LazyBaseEmojiPicker = React.lazy(async () => {
560
- const { EmojiPicker: EmojiPicker2 } = await import("./EmojiPicker-6H52Q4YE.js");
564
+ const { EmojiPicker: EmojiPicker2 } = await import("./EmojiPicker-Z7QPW4DA.js");
561
565
  return { default: EmojiPicker2 };
562
566
  });
563
567
  var EmojiPicker = ({ onSelect }) => {
@@ -1647,6 +1651,96 @@ var FormRadio = Node5.create({
1647
1651
  }
1648
1652
  });
1649
1653
 
1654
+ // src/components/UEditor/date-picker-node.ts
1655
+ import { Node as Node6, mergeAttributes as mergeAttributes6 } from "@tiptap/core";
1656
+ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
1657
+
1658
+ // src/components/UEditor/DatePickerNodeView.tsx
1659
+ import React5 from "react";
1660
+ import { Calendar } from "lucide-react";
1661
+ import { NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
1662
+ import { jsx as jsx7 } from "react/jsx-runtime";
1663
+ var LazyDatePicker = React5.lazy(async () => {
1664
+ const { DatePicker } = await import("./DatePicker-FDOTQMNL.js");
1665
+ return { default: DatePicker };
1666
+ });
1667
+ function isDateValue(value) {
1668
+ return typeof value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(value);
1669
+ }
1670
+ function parseDateValue(value) {
1671
+ if (!isDateValue(value)) return void 0;
1672
+ const [year, month, day] = value.split("-").map(Number);
1673
+ return new Date(year, month - 1, day);
1674
+ }
1675
+ function formatDateValue(value) {
1676
+ const year = value.getFullYear();
1677
+ const month = String(value.getMonth() + 1).padStart(2, "0");
1678
+ const day = String(value.getDate()).padStart(2, "0");
1679
+ return `${year}-${month}-${day}`;
1680
+ }
1681
+ var DatePickerNodeView = ({ node, updateAttributes, editor, selected }) => {
1682
+ const date = isDateValue(node.attrs.date) ? node.attrs.date : "";
1683
+ const isEditable = editor.isEditable;
1684
+ return /* @__PURE__ */ jsx7(
1685
+ NodeViewWrapper6,
1686
+ {
1687
+ as: "span",
1688
+ "data-type": "date-picker",
1689
+ "data-date": date || void 0,
1690
+ "data-ueditor-date-picker": "true",
1691
+ className: selected ? "inline-flex items-center align-middle mx-1 rounded ring-2 ring-primary/30" : "inline-flex items-center align-middle mx-1",
1692
+ children: /* @__PURE__ */ jsx7("span", { contentEditable: false, children: /* @__PURE__ */ jsx7(React5.Suspense, { fallback: /* @__PURE__ */ jsx7(Calendar, { className: "h-4 w-4", "aria-hidden": "true" }), children: /* @__PURE__ */ jsx7(
1693
+ LazyDatePicker,
1694
+ {
1695
+ iconOnly: true,
1696
+ iconOnlyDateFormat: "year-month-day",
1697
+ value: parseDateValue(date),
1698
+ disabled: !isEditable,
1699
+ getPortalContainer: () => editor.view.dom.ownerDocument.body,
1700
+ onChange: (value) => updateAttributes({ date: value ? formatDateValue(value) : "" })
1701
+ }
1702
+ ) }) })
1703
+ }
1704
+ );
1705
+ };
1706
+
1707
+ // src/components/UEditor/date-picker-node.ts
1708
+ var DatePickerNode = Node6.create({
1709
+ name: "datePicker",
1710
+ group: "inline",
1711
+ inline: true,
1712
+ atom: true,
1713
+ addOptions() {
1714
+ return { HTMLAttributes: {} };
1715
+ },
1716
+ addAttributes() {
1717
+ return {
1718
+ date: {
1719
+ default: "",
1720
+ parseHTML: (element) => element.getAttribute("data-date") || "",
1721
+ renderHTML: (attributes) => attributes.date ? { "data-date": attributes.date } : {}
1722
+ }
1723
+ };
1724
+ },
1725
+ parseHTML() {
1726
+ return [{ tag: 'span[data-type="date-picker"]' }];
1727
+ },
1728
+ renderHTML({ HTMLAttributes }) {
1729
+ return [
1730
+ "span",
1731
+ mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes, { "data-type": "date-picker" })
1732
+ ];
1733
+ },
1734
+ addNodeView() {
1735
+ return ReactNodeViewRenderer6(DatePickerNodeView);
1736
+ },
1737
+ addCommands() {
1738
+ return {
1739
+ setDatePicker: (attributes) => ({ commands }) => commands.insertContent({ type: this.name, attrs: attributes })
1740
+ };
1741
+ }
1742
+ });
1743
+
1650
1744
  // src/components/UEditor/extensions.ts
1651
1745
  import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
1652
1746
  import { History } from "@tiptap/extension-history";
@@ -1668,7 +1762,7 @@ import { Gapcursor } from "@tiptap/extension-gapcursor";
1668
1762
  import { Extension } from "@tiptap/core";
1669
1763
  import { Suggestion } from "@tiptap/suggestion";
1670
1764
  import { ReactRenderer } from "@tiptap/react";
1671
- import React5, { forwardRef, useEffect as useEffect3, useImperativeHandle, useRef as useRef2 } from "react";
1765
+ import React6, { forwardRef, useEffect as useEffect3, useImperativeHandle, useRef as useRef2 } from "react";
1672
1766
  import {
1673
1767
  FileCode,
1674
1768
  Heading1,
@@ -1686,7 +1780,8 @@ import {
1686
1780
  Paperclip,
1687
1781
  CheckSquare,
1688
1782
  CircleCheckBig,
1689
- CircleDot
1783
+ CircleDot,
1784
+ CalendarDays
1690
1785
  } from "lucide-react";
1691
1786
 
1692
1787
  // src/components/UEditor/tippy-interop.ts
@@ -1713,7 +1808,7 @@ function setTippyReferenceClientRect(instance, clientRect) {
1713
1808
  }
1714
1809
 
1715
1810
  // src/components/UEditor/slash-command.tsx
1716
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1811
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1717
1812
  var DEFAULT_MESSAGES = {
1718
1813
  noResults: "No results",
1719
1814
  basicBlocks: "Basic Blocks",
@@ -1737,6 +1832,8 @@ var DEFAULT_MESSAGES = {
1737
1832
  codeBlockDesc: "Display code with syntax highlighting",
1738
1833
  divider: "Divider",
1739
1834
  dividerDesc: "Visually divide blocks",
1835
+ date: "Date",
1836
+ dateDesc: "Insert a date from the calendar",
1740
1837
  table: "Table",
1741
1838
  tableDesc: "Insert a table",
1742
1839
  callout: "Callout",
@@ -1753,9 +1850,9 @@ var DEFAULT_MESSAGES = {
1753
1850
  formRadioDesc: "Insert an interactive radio button field"
1754
1851
  };
1755
1852
  function useResettingIndex(resetToken) {
1756
- const [state, setState] = React5.useState({ resetToken, index: 0 });
1853
+ const [state, setState] = React6.useState({ resetToken, index: 0 });
1757
1854
  const selectedIndex = Object.is(state.resetToken, resetToken) ? state.index : 0;
1758
- const setSelectedIndex = React5.useCallback((nextIndex) => {
1855
+ const setSelectedIndex = React6.useCallback((nextIndex) => {
1759
1856
  setState((prev) => {
1760
1857
  const prevIndex = Object.is(prev.resetToken, resetToken) ? prev.index : 0;
1761
1858
  return {
@@ -1794,6 +1891,8 @@ function buildSlashCommandMessages(translate) {
1794
1891
  codeBlockDesc: translate("slashCommand.codeBlockDesc"),
1795
1892
  divider: translate("slashCommand.divider") || "Divider",
1796
1893
  dividerDesc: translate("slashCommand.dividerDesc") || "Visually divide blocks",
1894
+ date: translate("slashCommand.date") || "Date",
1895
+ dateDesc: translate("slashCommand.dateDesc") || "Insert a date from the calendar",
1797
1896
  table: translate("slashCommand.table") || "Table",
1798
1897
  tableDesc: translate("slashCommand.tableDesc") || "Insert a table",
1799
1898
  callout: translate("slashCommand.callout") || "Callout",
@@ -1896,6 +1995,15 @@ function buildSlashCommandItems({
1896
1995
  getCommandChain(editor, range).setHorizontalRule().run();
1897
1996
  })
1898
1997
  },
1998
+ {
1999
+ icon: CalendarDays,
2000
+ title: messages.date,
2001
+ description: messages.dateDesc,
2002
+ searchTerms: ["calendar", "date"],
2003
+ command: run(({ editor, range }) => {
2004
+ getCommandChain(editor, range).setDatePicker().run();
2005
+ })
2006
+ },
1899
2007
  {
1900
2008
  icon: Table,
1901
2009
  title: messages.table,
@@ -1983,7 +2091,7 @@ function buildSlashCommandItems({
1983
2091
  var SlashCommandList = forwardRef((props, ref) => {
1984
2092
  const [selectedIndex, setSelectedIndex] = useResettingIndex(props.items);
1985
2093
  const listRef = useRef2(null);
1986
- const listId = React5.useId();
2094
+ const listId = React6.useId();
1987
2095
  useEffect3(() => {
1988
2096
  const selectedElement = listRef.current?.querySelector(`[data-index="${selectedIndex}"]`);
1989
2097
  selectedElement?.scrollIntoView({ block: "nearest" });
@@ -2014,7 +2122,7 @@ var SlashCommandList = forwardRef((props, ref) => {
2014
2122
  }
2015
2123
  }));
2016
2124
  if (props.items.length === 0) {
2017
- return /* @__PURE__ */ jsx7("div", { role: "status", className: "w-72 p-4 text-center text-sm text-muted-foreground", children: props.messages.noResults });
2125
+ return /* @__PURE__ */ jsx8("div", { role: "status", className: "w-72 p-4 text-center text-sm text-muted-foreground", children: props.messages.noResults });
2018
2126
  }
2019
2127
  return /* @__PURE__ */ jsxs5(
2020
2128
  "div",
@@ -2026,8 +2134,8 @@ var SlashCommandList = forwardRef((props, ref) => {
2026
2134
  "aria-activedescendant": `${listId}-option-${selectedIndex}`,
2027
2135
  className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg",
2028
2136
  children: [
2029
- /* @__PURE__ */ jsx7("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx7("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: props.messages.basicBlocks }) }),
2030
- /* @__PURE__ */ jsx7("div", { className: "p-1", children: props.items.map((item, index) => /* @__PURE__ */ jsxs5(
2137
+ /* @__PURE__ */ jsx8("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx8("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: props.messages.basicBlocks }) }),
2138
+ /* @__PURE__ */ jsx8("div", { className: "p-1", children: props.items.map((item, index) => /* @__PURE__ */ jsxs5(
2031
2139
  "button",
2032
2140
  {
2033
2141
  type: "button",
@@ -2043,19 +2151,19 @@ var SlashCommandList = forwardRef((props, ref) => {
2043
2151
  selectedIndex === index ? "bg-accent" : "hover:bg-accent/50"
2044
2152
  ),
2045
2153
  children: [
2046
- /* @__PURE__ */ jsx7(
2154
+ /* @__PURE__ */ jsx8(
2047
2155
  "div",
2048
2156
  {
2049
2157
  className: cn(
2050
2158
  "flex items-center justify-center w-10 h-10 rounded-lg mr-3 transition-colors",
2051
2159
  selectedIndex === index ? "bg-primary/10" : "bg-muted/50 group-hover:bg-muted"
2052
2160
  ),
2053
- children: /* @__PURE__ */ jsx7(item.icon, { "aria-hidden": "true", className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
2161
+ children: /* @__PURE__ */ jsx8(item.icon, { "aria-hidden": "true", className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
2054
2162
  }
2055
2163
  ),
2056
2164
  /* @__PURE__ */ jsxs5("div", { className: "text-left", children: [
2057
- /* @__PURE__ */ jsx7("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: item.title }),
2058
- /* @__PURE__ */ jsx7("div", { className: "text-xs text-muted-foreground", children: item.description })
2165
+ /* @__PURE__ */ jsx8("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: item.title }),
2166
+ /* @__PURE__ */ jsx8("div", { className: "text-xs text-muted-foreground", children: item.description })
2059
2167
  ] })
2060
2168
  ]
2061
2169
  },
@@ -2147,13 +2255,13 @@ import { Extension as Extension2 } from "@tiptap/core";
2147
2255
  import { Suggestion as Suggestion2 } from "@tiptap/suggestion";
2148
2256
  import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
2149
2257
  import { PluginKey as PluginKey2 } from "@tiptap/pm/state";
2150
- import React6, { forwardRef as forwardRef2, useImperativeHandle as useImperativeHandle2 } from "react";
2258
+ import React7, { forwardRef as forwardRef2, useImperativeHandle as useImperativeHandle2 } from "react";
2151
2259
  import { Smile } from "lucide-react";
2152
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2260
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2153
2261
  function useResettingIndex2(resetToken) {
2154
- const [state, setState] = React6.useState({ resetToken, index: 0 });
2262
+ const [state, setState] = React7.useState({ resetToken, index: 0 });
2155
2263
  const selectedIndex = Object.is(state.resetToken, resetToken) ? state.index : 0;
2156
- const setSelectedIndex = React6.useCallback((nextIndex) => {
2264
+ const setSelectedIndex = React7.useCallback((nextIndex) => {
2157
2265
  setState((prev) => {
2158
2266
  const prevIndex = Object.is(prev.resetToken, resetToken) ? prev.index : 0;
2159
2267
  return {
@@ -2167,7 +2275,7 @@ function useResettingIndex2(resetToken) {
2167
2275
  var EmojiList = forwardRef2((props, ref) => {
2168
2276
  const t = useSmartTranslations("UEditor");
2169
2277
  const [selectedIndex, setSelectedIndex] = useResettingIndex2(props.items);
2170
- const listId = React6.useId();
2278
+ const listId = React7.useId();
2171
2279
  const showingCountLabel = formatEmojiCountLabel(t("emojiSuggestion.showingCount"), 64, props.items.length);
2172
2280
  useImperativeHandle2(ref, () => ({
2173
2281
  onKeyDown: (keyProps) => {
@@ -2200,7 +2308,7 @@ var EmojiList = forwardRef2((props, ref) => {
2200
2308
  }
2201
2309
  }));
2202
2310
  if (props.items.length === 0) {
2203
- return /* @__PURE__ */ jsx8("div", { role: "status", className: "w-80 p-4 text-center text-sm text-muted-foreground bg-card border border-border/50 rounded-2xl shadow-lg", children: t("emojiSuggestion.noResults") });
2311
+ return /* @__PURE__ */ jsx9("div", { role: "status", className: "w-80 p-4 text-center text-sm text-muted-foreground bg-card border border-border/50 rounded-2xl shadow-lg", children: t("emojiSuggestion.noResults") });
2204
2312
  }
2205
2313
  return /* @__PURE__ */ jsxs6(
2206
2314
  "div",
@@ -2211,12 +2319,12 @@ var EmojiList = forwardRef2((props, ref) => {
2211
2319
  "aria-activedescendant": `${listId}-option-${selectedIndex}`,
2212
2320
  className: "w-80 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg",
2213
2321
  children: [
2214
- /* @__PURE__ */ jsx8("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
2215
- /* @__PURE__ */ jsx8(Smile, { className: "w-4 h-4 text-primary" }),
2216
- /* @__PURE__ */ jsx8("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("emojiSuggestion.title") })
2322
+ /* @__PURE__ */ jsx9("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2", children: [
2323
+ /* @__PURE__ */ jsx9(Smile, { className: "w-4 h-4 text-primary" }),
2324
+ /* @__PURE__ */ jsx9("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("emojiSuggestion.title") })
2217
2325
  ] }) }),
2218
2326
  /* @__PURE__ */ jsxs6("div", { className: "p-3", children: [
2219
- /* @__PURE__ */ jsx8("div", { className: "grid grid-cols-8 gap-1", children: props.items.slice(0, 64).map((item, index) => /* @__PURE__ */ jsx8(
2327
+ /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-8 gap-1", children: props.items.slice(0, 64).map((item, index) => /* @__PURE__ */ jsx9(
2220
2328
  EmojiGridButton,
2221
2329
  {
2222
2330
  id: `${listId}-option-${index}`,
@@ -2231,7 +2339,7 @@ var EmojiList = forwardRef2((props, ref) => {
2231
2339
  },
2232
2340
  item.name
2233
2341
  )) }),
2234
- props.items.length > 64 && /* @__PURE__ */ jsx8("div", { className: "mt-2 text-xs text-center text-muted-foreground", children: showingCountLabel })
2342
+ props.items.length > 64 && /* @__PURE__ */ jsx9("div", { className: "mt-2 text-xs text-center text-muted-foreground", children: showingCountLabel })
2235
2343
  ] })
2236
2344
  ]
2237
2345
  }
@@ -2325,9 +2433,9 @@ import { Extension as Extension3 } from "@tiptap/core";
2325
2433
  import { Suggestion as Suggestion3 } from "@tiptap/suggestion";
2326
2434
  import { ReactRenderer as ReactRenderer3 } from "@tiptap/react";
2327
2435
  import { PluginKey as PluginKey3 } from "@tiptap/pm/state";
2328
- import React7, { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle3 } from "react";
2436
+ import React8, { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle3 } from "react";
2329
2437
  import { Sigma } from "lucide-react";
2330
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2438
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
2331
2439
  var FORMULA_FUNCTIONS = [
2332
2440
  {
2333
2441
  name: "SUM",
@@ -2380,9 +2488,9 @@ function isFormulaFunctionSuggestionQuery(query) {
2380
2488
  }
2381
2489
  var FormulaSuggestionList = forwardRef3((props, ref) => {
2382
2490
  const t = useSmartTranslations("UEditor");
2383
- const [selectedIndex, setSelectedIndex] = React7.useState(0);
2384
- const listId = React7.useId();
2385
- React7.useEffect(() => {
2491
+ const [selectedIndex, setSelectedIndex] = React8.useState(0);
2492
+ const listId = React8.useId();
2493
+ React8.useEffect(() => {
2386
2494
  setSelectedIndex(0);
2387
2495
  }, [props.items]);
2388
2496
  useImperativeHandle3(ref, () => ({
@@ -2407,7 +2515,7 @@ var FormulaSuggestionList = forwardRef3((props, ref) => {
2407
2515
  }
2408
2516
  }));
2409
2517
  if (props.items.length === 0) {
2410
- return /* @__PURE__ */ jsx9("div", { role: "status", className: "w-72 p-3 text-sm text-muted-foreground bg-card border border-border/50 rounded-lg shadow-lg", children: t("formulaSuggestion.noResults") });
2518
+ return /* @__PURE__ */ jsx10("div", { role: "status", className: "w-72 p-3 text-sm text-muted-foreground bg-card border border-border/50 rounded-lg shadow-lg", children: t("formulaSuggestion.noResults") });
2411
2519
  }
2412
2520
  return /* @__PURE__ */ jsxs7(
2413
2521
  "div",
@@ -2418,11 +2526,11 @@ var FormulaSuggestionList = forwardRef3((props, ref) => {
2418
2526
  "aria-activedescendant": `${listId}-option-${selectedIndex}`,
2419
2527
  className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-lg shadow-lg",
2420
2528
  children: [
2421
- /* @__PURE__ */ jsx9("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
2422
- /* @__PURE__ */ jsx9(Sigma, { className: "w-4 h-4 text-primary" }),
2423
- /* @__PURE__ */ jsx9("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
2529
+ /* @__PURE__ */ jsx10("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
2530
+ /* @__PURE__ */ jsx10(Sigma, { className: "w-4 h-4 text-primary" }),
2531
+ /* @__PURE__ */ jsx10("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
2424
2532
  ] }) }),
2425
- /* @__PURE__ */ jsx9("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs7(
2533
+ /* @__PURE__ */ jsx10("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs7(
2426
2534
  "button",
2427
2535
  {
2428
2536
  type: "button",
@@ -2436,10 +2544,10 @@ var FormulaSuggestionList = forwardRef3((props, ref) => {
2436
2544
  onClick: () => props.command(item),
2437
2545
  children: [
2438
2546
  /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-3", children: [
2439
- /* @__PURE__ */ jsx9("span", { className: "font-mono text-sm font-semibold", children: item.name }),
2440
- /* @__PURE__ */ jsx9("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
2547
+ /* @__PURE__ */ jsx10("span", { className: "font-mono text-sm font-semibold", children: item.name }),
2548
+ /* @__PURE__ */ jsx10("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
2441
2549
  ] }),
2442
- /* @__PURE__ */ jsx9("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
2550
+ /* @__PURE__ */ jsx10("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
2443
2551
  ]
2444
2552
  },
2445
2553
  item.name
@@ -2649,9 +2757,9 @@ var UEditorPlaceholder = Extension4.create({
2649
2757
  // src/components/UEditor/resizable-image.tsx
2650
2758
  import { useEffect as useEffect4, useRef as useRef3, useState as useState3 } from "react";
2651
2759
  import { Image as Image2 } from "@tiptap/extension-image";
2652
- import { mergeAttributes as mergeAttributes6 } from "@tiptap/core";
2653
- import { NodeViewWrapper as NodeViewWrapper6, ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
2654
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2760
+ import { mergeAttributes as mergeAttributes7 } from "@tiptap/core";
2761
+ import { NodeViewWrapper as NodeViewWrapper7, ReactNodeViewRenderer as ReactNodeViewRenderer7 } from "@tiptap/react";
2762
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
2655
2763
  var MIN_IMAGE_SIZE_PX = 40;
2656
2764
  var IMAGE_LAYOUTS = /* @__PURE__ */ new Set(["block", "left", "right"]);
2657
2765
  var IMAGE_WIDTH_PRESETS = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
@@ -2894,7 +3002,7 @@ function ResizableImageNodeView(props) {
2894
3002
  const wrapperAlignClass = imageLayout === "block" ? textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "" : "";
2895
3003
  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";
2896
3004
  return /* @__PURE__ */ jsxs8(
2897
- NodeViewWrapper6,
3005
+ NodeViewWrapper7,
2898
3006
  {
2899
3007
  as: "div",
2900
3008
  ref: wrapperRef,
@@ -2908,7 +3016,7 @@ function ResizableImageNodeView(props) {
2908
3016
  },
2909
3017
  contentEditable: false,
2910
3018
  children: [
2911
- /* @__PURE__ */ jsx10(
3019
+ /* @__PURE__ */ jsx11(
2912
3020
  "img",
2913
3021
  {
2914
3022
  ref: imgRef,
@@ -2924,7 +3032,7 @@ function ResizableImageNodeView(props) {
2924
3032
  style: getImageDisplayStyle(widthAttr, heightAttr)
2925
3033
  }
2926
3034
  ),
2927
- /* @__PURE__ */ jsx10(
3035
+ /* @__PURE__ */ jsx11(
2928
3036
  "div",
2929
3037
  {
2930
3038
  ref: resizePreviewRef,
@@ -2948,7 +3056,7 @@ function ResizableImageNodeView(props) {
2948
3056
  }
2949
3057
  }
2950
3058
  ),
2951
- showHandle && /* @__PURE__ */ jsx10(
3059
+ showHandle && /* @__PURE__ */ jsx11(
2952
3060
  "div",
2953
3061
  {
2954
3062
  "aria-hidden": "true",
@@ -3014,10 +3122,10 @@ var ResizableImage = Image2.extend({
3014
3122
  };
3015
3123
  },
3016
3124
  renderHTML({ HTMLAttributes }) {
3017
- return ["img", mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes)];
3125
+ return ["img", mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes)];
3018
3126
  },
3019
3127
  addNodeView() {
3020
- return ReactNodeViewRenderer6(ResizableImageNodeView);
3128
+ return ReactNodeViewRenderer7(ResizableImageNodeView);
3021
3129
  }
3022
3130
  }).configure({
3023
3131
  allowBase64: true,
@@ -3444,7 +3552,7 @@ var Indent = Extension9.create({
3444
3552
  var indent_default = Indent;
3445
3553
 
3446
3554
  // src/components/UEditor/table-align.ts
3447
- import { mergeAttributes as mergeAttributes7 } from "@tiptap/core";
3555
+ import { mergeAttributes as mergeAttributes8 } from "@tiptap/core";
3448
3556
  import { Table as Table2 } from "@tiptap/extension-table";
3449
3557
  import { Plugin as Plugin4, PluginKey as PluginKey5, TextSelection } from "@tiptap/pm/state";
3450
3558
  import {
@@ -4325,7 +4433,7 @@ var UEditorTable = Table2.extend({
4325
4433
  ].join("; ") + ";" : tableWidth ? `width: ${tableWidth}; ${renderFixedTableAlignStyle(tableAlign)}` : `table-layout: fixed; ${renderFixedTableAlignStyle(tableAlign)}`;
4326
4434
  const table = [
4327
4435
  "table",
4328
- mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes, {
4436
+ mergeAttributes8(this.options.HTMLAttributes, HTMLAttributes, {
4329
4437
  ...widthMode === "responsive" ? {
4330
4438
  "data-table-width-mode": "responsive",
4331
4439
  "data-table-width": formatBasisPointsAsPercentage(widthBp),
@@ -4432,10 +4540,10 @@ var UEditorTable = Table2.extend({
4432
4540
  var table_align_default = UEditorTable;
4433
4541
 
4434
4542
  // src/components/UEditor/CodeBlockView.tsx
4435
- import React9, { useState as useState4 } from "react";
4436
- import { NodeViewWrapper as NodeViewWrapper7, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
4543
+ import React10, { useState as useState4 } from "react";
4544
+ import { NodeViewWrapper as NodeViewWrapper8, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
4437
4545
  import { Check as Check2, Copy, ChevronDown } from "lucide-react";
4438
- import { Fragment, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
4546
+ import { Fragment, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
4439
4547
  var LANGUAGES = [
4440
4548
  { label: "Plain Text", value: "text" },
4441
4549
  { label: "JavaScript", value: "javascript" },
@@ -4459,11 +4567,11 @@ var CodeBlockView = ({
4459
4567
  }) => {
4460
4568
  const [copied, setCopied] = useState4(false);
4461
4569
  const [isDropdownOpen, setIsDropdownOpen] = useState4(false);
4462
- const timeoutRef = React9.useRef(null);
4570
+ const timeoutRef = React10.useRef(null);
4463
4571
  const t = useSmartTranslations("UEditor");
4464
4572
  const currentLangValue = node.attrs.language || "text";
4465
4573
  const currentLangLabel = LANGUAGES.find((lang) => lang.value === currentLangValue)?.label || "Plain Text";
4466
- React9.useEffect(() => {
4574
+ React10.useEffect(() => {
4467
4575
  return () => {
4468
4576
  if (timeoutRef.current) {
4469
4577
  clearTimeout(timeoutRef.current);
@@ -4484,7 +4592,7 @@ var CodeBlockView = ({
4484
4592
  console.error("Failed to copy code text: ", err);
4485
4593
  }
4486
4594
  };
4487
- return /* @__PURE__ */ jsxs9(NodeViewWrapper7, { 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: [
4595
+ return /* @__PURE__ */ jsxs9(NodeViewWrapper8, { 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: [
4488
4596
  /* @__PURE__ */ jsxs9(
4489
4597
  "div",
4490
4598
  {
@@ -4502,19 +4610,19 @@ var CodeBlockView = ({
4502
4610
  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-[color,background-color,transform] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
4503
4611
  children: [
4504
4612
  currentLangLabel,
4505
- /* @__PURE__ */ jsx11(ChevronDown, { "aria-hidden": "true", className: "h-3 w-3" })
4613
+ /* @__PURE__ */ jsx12(ChevronDown, { "aria-hidden": "true", className: "h-3 w-3" })
4506
4614
  ]
4507
4615
  }
4508
4616
  ),
4509
4617
  isDropdownOpen && /* @__PURE__ */ jsxs9(Fragment, { children: [
4510
- /* @__PURE__ */ jsx11(
4618
+ /* @__PURE__ */ jsx12(
4511
4619
  "div",
4512
4620
  {
4513
4621
  className: "fixed inset-0 z-20",
4514
4622
  onClick: () => setIsDropdownOpen(false)
4515
4623
  }
4516
4624
  ),
4517
- /* @__PURE__ */ jsx11("div", { role: "listbox", "aria-label": currentLangLabel, 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 motion-reduce:animate-none", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx11(
4625
+ /* @__PURE__ */ jsx12("div", { role: "listbox", "aria-label": currentLangLabel, 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 motion-reduce:animate-none", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx12(
4518
4626
  "button",
4519
4627
  {
4520
4628
  type: "button",
@@ -4534,7 +4642,7 @@ var CodeBlockView = ({
4534
4642
  )) })
4535
4643
  ] })
4536
4644
  ] }),
4537
- /* @__PURE__ */ jsx11(
4645
+ /* @__PURE__ */ jsx12(
4538
4646
  "button",
4539
4647
  {
4540
4648
  type: "button",
@@ -4542,13 +4650,13 @@ var CodeBlockView = ({
4542
4650
  "aria-label": t("menubar.copy"),
4543
4651
  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-[color,background-color,transform] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
4544
4652
  title: t("menubar.copy"),
4545
- children: copied ? /* @__PURE__ */ jsx11(Check2, { "aria-hidden": "true", className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75 motion-reduce:animate-none" }) : /* @__PURE__ */ jsx11(Copy, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
4653
+ children: copied ? /* @__PURE__ */ jsx12(Check2, { "aria-hidden": "true", className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75 motion-reduce:animate-none" }) : /* @__PURE__ */ jsx12(Copy, { "aria-hidden": "true", className: "h-3.5 w-3.5" })
4546
4654
  }
4547
4655
  )
4548
4656
  ]
4549
4657
  }
4550
4658
  ),
4551
- /* @__PURE__ */ jsx11("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx11("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx11(NodeViewContent2, {}) }) })
4659
+ /* @__PURE__ */ jsx12("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx12("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx12(NodeViewContent2, {}) }) })
4552
4660
  ] });
4553
4661
  };
4554
4662
 
@@ -5417,7 +5525,7 @@ var CustomTableCell = TableCell.extend({
5417
5525
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
5418
5526
  return [
5419
5527
  "td",
5420
- mergeAttributes8(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
5528
+ mergeAttributes9(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
5421
5529
  0
5422
5530
  ];
5423
5531
  }
@@ -5550,7 +5658,7 @@ var CustomTableHeader = TableHeader.extend({
5550
5658
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
5551
5659
  return [
5552
5660
  "th",
5553
- mergeAttributes8(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
5661
+ mergeAttributes9(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
5554
5662
  0
5555
5663
  ];
5556
5664
  }
@@ -5597,7 +5705,7 @@ function ensureCommonLowlightLanguages() {
5597
5705
  }
5598
5706
  var CustomCodeBlockLowlight = CodeBlockLowlight.extend({
5599
5707
  addNodeView() {
5600
- return ReactNodeViewRenderer7(CodeBlockView);
5708
+ return ReactNodeViewRenderer8(CodeBlockView);
5601
5709
  },
5602
5710
  addProseMirrorPlugins() {
5603
5711
  const parentPlugins = this.parent?.() ?? [];
@@ -5768,7 +5876,8 @@ function buildUEditorExtensions({
5768
5876
  upload: uploadFile
5769
5877
  }),
5770
5878
  FormCheckbox,
5771
- FormRadio
5879
+ FormRadio,
5880
+ DatePickerNode
5772
5881
  ];
5773
5882
  }
5774
5883
 
@@ -5974,7 +6083,7 @@ function subscribeSharedGlobalEvent(target, type, listener, options) {
5974
6083
  }
5975
6084
 
5976
6085
  // src/components/UEditor/menus.tsx
5977
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
6086
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
5978
6087
  var FloatingSlashCommandMenu = ({ editor, onClose }) => {
5979
6088
  const t = useSmartTranslations("UEditor");
5980
6089
  const messages = useMemo(() => buildSlashCommandMessages(t), [t]);
@@ -5997,7 +6106,7 @@ var FloatingSlashCommandMenu = ({ editor, onClose }) => {
5997
6106
  if (!portalDocument) return;
5998
6107
  return subscribeSharedGlobalEvent(portalDocument, "keydown", handleKeyDown2);
5999
6108
  }, [onClose, portalDocument]);
6000
- return /* @__PURE__ */ jsx12(
6109
+ return /* @__PURE__ */ jsx13(
6001
6110
  SlashCommandList,
6002
6111
  {
6003
6112
  ref: listRef,
@@ -6014,7 +6123,7 @@ var FloatingMenuContent = ({ editor }) => {
6014
6123
  const t = useSmartTranslations("UEditor");
6015
6124
  const [showCommands, setShowCommands] = useState5(false);
6016
6125
  if (showCommands) {
6017
- return /* @__PURE__ */ jsx12(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
6126
+ return /* @__PURE__ */ jsx13(FloatingSlashCommandMenu, { editor, onClose: () => setShowCommands(false) });
6018
6127
  }
6019
6128
  return /* @__PURE__ */ jsxs10(
6020
6129
  "button",
@@ -6023,8 +6132,8 @@ var FloatingMenuContent = ({ editor }) => {
6023
6132
  onClick: () => setShowCommands(true),
6024
6133
  className: "group flex items-center gap-1 rounded-lg px-2 py-1.5 transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",
6025
6134
  children: [
6026
- /* @__PURE__ */ jsx12(Plus, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
6027
- /* @__PURE__ */ jsx12("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
6135
+ /* @__PURE__ */ jsx13(Plus, { className: "w-4 h-4 text-muted-foreground group-hover:text-foreground" }),
6136
+ /* @__PURE__ */ jsx13("span", { className: "text-sm text-muted-foreground group-hover:text-foreground", children: t("floatingMenu.addBlock") })
6028
6137
  ]
6029
6138
  }
6030
6139
  );
@@ -6056,7 +6165,7 @@ function applyTableCellAttribute(editor, name, value, options = {}) {
6056
6165
  }
6057
6166
  function BorderStylePreviewIcon({ style }) {
6058
6167
  const isNone = style === "none";
6059
- return /* @__PURE__ */ jsx12(
6168
+ return /* @__PURE__ */ jsx13(
6060
6169
  "span",
6061
6170
  {
6062
6171
  "aria-hidden": "true",
@@ -6068,7 +6177,7 @@ function BorderStylePreviewIcon({ style }) {
6068
6177
  borderStyle: style,
6069
6178
  borderWidth: style === "double" ? 3 : 2
6070
6179
  },
6071
- children: isNone && /* @__PURE__ */ jsx12("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
6180
+ children: isNone && /* @__PURE__ */ jsx13("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
6072
6181
  }
6073
6182
  );
6074
6183
  }
@@ -6080,7 +6189,7 @@ function BorderPositionPreviewIcon({ position }) {
6080
6189
  const showHorizontal = position === "all" || position === "inner" || position === "horizontal";
6081
6190
  const showVertical = position === "all" || position === "inner" || position === "vertical";
6082
6191
  return /* @__PURE__ */ jsxs10("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-5 w-5 fill-none stroke-current", children: [
6083
- /* @__PURE__ */ jsx12(
6192
+ /* @__PURE__ */ jsx13(
6084
6193
  "path",
6085
6194
  {
6086
6195
  d: "M2 2H18V18H2Z M2 10H18 M10 2V18",
@@ -6090,12 +6199,12 @@ function BorderPositionPreviewIcon({ position }) {
6090
6199
  strokeWidth: "1.25"
6091
6200
  }
6092
6201
  ),
6093
- showTop && /* @__PURE__ */ jsx12("path", { d: "M2 2H18", strokeWidth: "2" }),
6094
- showRight && /* @__PURE__ */ jsx12("path", { d: "M18 2V18", strokeWidth: "2" }),
6095
- showBottom && /* @__PURE__ */ jsx12("path", { d: "M2 18H18", strokeWidth: "2" }),
6096
- showLeft && /* @__PURE__ */ jsx12("path", { d: "M2 2V18", strokeWidth: "2" }),
6097
- showHorizontal && /* @__PURE__ */ jsx12("path", { d: "M2 10H18", strokeWidth: "2" }),
6098
- showVertical && /* @__PURE__ */ jsx12("path", { d: "M10 2V18", strokeWidth: "2" })
6202
+ showTop && /* @__PURE__ */ jsx13("path", { d: "M2 2H18", strokeWidth: "2" }),
6203
+ showRight && /* @__PURE__ */ jsx13("path", { d: "M18 2V18", strokeWidth: "2" }),
6204
+ showBottom && /* @__PURE__ */ jsx13("path", { d: "M2 18H18", strokeWidth: "2" }),
6205
+ showLeft && /* @__PURE__ */ jsx13("path", { d: "M2 2V18", strokeWidth: "2" }),
6206
+ showHorizontal && /* @__PURE__ */ jsx13("path", { d: "M2 10H18", strokeWidth: "2" }),
6207
+ showVertical && /* @__PURE__ */ jsx13("path", { d: "M10 2V18", strokeWidth: "2" })
6099
6208
  ] });
6100
6209
  }
6101
6210
  function getBubbleMenuPosition({
@@ -6327,7 +6436,7 @@ var BubbleMenuContent = ({
6327
6436
  };
6328
6437
  }, [editor, showLinkInput]);
6329
6438
  if (showLinkInput) {
6330
- return /* @__PURE__ */ jsx12(
6439
+ return /* @__PURE__ */ jsx13(
6331
6440
  LinkInput,
6332
6441
  {
6333
6442
  initialUrl: editor.getAttributes("link").href || "",
@@ -6348,10 +6457,10 @@ var BubbleMenuContent = ({
6348
6457
  const isHighlightPalette = activeColorPalette === "highlight";
6349
6458
  if (activeColorPalette === "cell-border") {
6350
6459
  return /* @__PURE__ */ jsxs10("div", { className: "flex w-72 flex-col gap-2 p-2 text-sm", "data-ueditor-keep-open": true, children: [
6351
- /* @__PURE__ */ jsx12("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
6460
+ /* @__PURE__ */ jsx13("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
6352
6461
  /* @__PURE__ */ jsxs10("div", { className: "flex gap-2", children: [
6353
6462
  /* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
6354
- /* @__PURE__ */ jsx12("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
6463
+ /* @__PURE__ */ jsx13("label", { className: "mb-1 block text-xs text-muted-foreground", children: t("tableMenu.borderPosition") || "Border placement" }),
6355
6464
  /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-5 gap-1", role: "group", "aria-label": t("tableMenu.borderPosition") || "Border placement", children: [
6356
6465
  [
6357
6466
  ["all", "borderAll"],
@@ -6365,7 +6474,7 @@ var BubbleMenuContent = ({
6365
6474
  ["left", "borderLeft"]
6366
6475
  ].map(([position, labelKey]) => {
6367
6476
  const label = t(`tableMenu.${labelKey}`) || position;
6368
- return /* @__PURE__ */ jsx12(
6477
+ return /* @__PURE__ */ jsx13(
6369
6478
  "button",
6370
6479
  {
6371
6480
  type: "button",
@@ -6377,12 +6486,12 @@ var BubbleMenuContent = ({
6377
6486
  "inline-flex h-8 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted hover:text-primary",
6378
6487
  activeBorderPosition === position ? "bg-primary/10 text-primary" : "bg-muted/40"
6379
6488
  ),
6380
- children: /* @__PURE__ */ jsx12(BorderPositionPreviewIcon, { position })
6489
+ children: /* @__PURE__ */ jsx13(BorderPositionPreviewIcon, { position })
6381
6490
  },
6382
6491
  position
6383
6492
  );
6384
6493
  }),
6385
- /* @__PURE__ */ jsx12(
6494
+ /* @__PURE__ */ jsx13(
6386
6495
  "button",
6387
6496
  {
6388
6497
  type: "button",
@@ -6391,13 +6500,13 @@ var BubbleMenuContent = ({
6391
6500
  onMouseDown: (event) => event.preventDefault(),
6392
6501
  onClick: clearTableCellBorders,
6393
6502
  className: "inline-flex h-8 items-center justify-center rounded-md bg-muted/40 text-destructive transition-colors hover:bg-destructive/10",
6394
- children: /* @__PURE__ */ jsx12(BorderStylePreviewIcon, { style: "none" })
6503
+ children: /* @__PURE__ */ jsx13(BorderStylePreviewIcon, { style: "none" })
6395
6504
  }
6396
6505
  )
6397
6506
  ] })
6398
6507
  ] }),
6399
6508
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1 border-l border-border pl-2 pt-5", role: "group", "aria-label": t("tableMenu.borderMode") || "Border mode", children: [
6400
- /* @__PURE__ */ jsx12(
6509
+ /* @__PURE__ */ jsx13(
6401
6510
  "button",
6402
6511
  {
6403
6512
  type: "button",
@@ -6409,10 +6518,10 @@ var BubbleMenuContent = ({
6409
6518
  "inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
6410
6519
  borderEditMode === "draw" ? "bg-primary/10 text-primary" : "text-muted-foreground"
6411
6520
  ),
6412
- children: /* @__PURE__ */ jsx12(Edit2, { className: "h-4 w-4" })
6521
+ children: /* @__PURE__ */ jsx13(Edit2, { className: "h-4 w-4" })
6413
6522
  }
6414
6523
  ),
6415
- /* @__PURE__ */ jsx12(
6524
+ /* @__PURE__ */ jsx13(
6416
6525
  "button",
6417
6526
  {
6418
6527
  type: "button",
@@ -6424,14 +6533,14 @@ var BubbleMenuContent = ({
6424
6533
  "inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-muted",
6425
6534
  borderEditMode === "erase" ? "bg-destructive/10 text-destructive" : "text-muted-foreground"
6426
6535
  ),
6427
- children: /* @__PURE__ */ jsx12(Eraser, { className: "h-4 w-4" })
6536
+ children: /* @__PURE__ */ jsx13(Eraser, { className: "h-4 w-4" })
6428
6537
  }
6429
6538
  )
6430
6539
  ] })
6431
6540
  ] }),
6432
6541
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1", children: [
6433
- /* @__PURE__ */ jsx12("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
6434
- /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-4 gap-1.5", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
6542
+ /* @__PURE__ */ jsx13("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
6543
+ /* @__PURE__ */ jsx13("div", { className: "grid grid-cols-4 gap-1.5", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
6435
6544
  ["solid", "Solid"],
6436
6545
  ["dashed", "Dashed"],
6437
6546
  ["dotted", "Dotted"],
@@ -6447,16 +6556,16 @@ var BubbleMenuContent = ({
6447
6556
  borderStyleDraft === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
6448
6557
  ),
6449
6558
  children: [
6450
- /* @__PURE__ */ jsx12(BorderStylePreviewIcon, { style }),
6451
- /* @__PURE__ */ jsx12("span", { children: label })
6559
+ /* @__PURE__ */ jsx13(BorderStylePreviewIcon, { style }),
6560
+ /* @__PURE__ */ jsx13("span", { children: label })
6452
6561
  ]
6453
6562
  },
6454
6563
  style
6455
6564
  )) })
6456
6565
  ] }),
6457
6566
  /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1", children: [
6458
- /* @__PURE__ */ jsx12("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
6459
- /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-4 gap-1", role: "group", "aria-label": t("tableMenu.borderWidth") || "Border Width", children: ["1px", "2px", "3px", "4px"].map((width) => /* @__PURE__ */ jsx12(
6567
+ /* @__PURE__ */ jsx13("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
6568
+ /* @__PURE__ */ jsx13("div", { className: "grid grid-cols-4 gap-1", role: "group", "aria-label": t("tableMenu.borderWidth") || "Border Width", children: ["1px", "2px", "3px", "4px"].map((width) => /* @__PURE__ */ jsx13(
6460
6569
  "button",
6461
6570
  {
6462
6571
  type: "button",
@@ -6478,8 +6587,8 @@ var BubbleMenuContent = ({
6478
6587
  onClick: () => setActiveColorPalette("cell-border-color"),
6479
6588
  className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
6480
6589
  children: [
6481
- /* @__PURE__ */ jsx12("span", { children: t("tableMenu.borderColor") || "Border Color" }),
6482
- /* @__PURE__ */ jsx12(
6590
+ /* @__PURE__ */ jsx13("span", { children: t("tableMenu.borderColor") || "Border Color" }),
6591
+ /* @__PURE__ */ jsx13(
6483
6592
  "span",
6484
6593
  {
6485
6594
  className: "w-4 h-4 rounded-full border border-border",
@@ -6494,7 +6603,7 @@ var BubbleMenuContent = ({
6494
6603
  ] });
6495
6604
  }
6496
6605
  if (activeColorPalette === "cell-border-color") {
6497
- return /* @__PURE__ */ jsx12("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx12(
6606
+ return /* @__PURE__ */ jsx13("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx13(
6498
6607
  EditorColorPalette,
6499
6608
  {
6500
6609
  colors: borderColors,
@@ -6504,7 +6613,7 @@ var BubbleMenuContent = ({
6504
6613
  }
6505
6614
  ) });
6506
6615
  }
6507
- return /* @__PURE__ */ jsx12("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx12(
6616
+ return /* @__PURE__ */ jsx13("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx13(
6508
6617
  EditorColorPalette,
6509
6618
  {
6510
6619
  colors: isTextPalette ? textColors : highlightColors,
@@ -6517,22 +6626,22 @@ var BubbleMenuContent = ({
6517
6626
  }
6518
6627
  if (isImageSelected) {
6519
6628
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-0.5 p-1", children: [
6520
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx12(AlignCenter, { className: "w-4 h-4" }) }),
6521
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx12(AlignLeft, { className: "w-4 h-4" }) }),
6522
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx12(AlignRight, { className: "w-4 h-4" }) }),
6523
- /* @__PURE__ */ jsx12("div", { className: "w-px h-6 bg-border/50 mx-1" }),
6524
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx12("span", { className: "text-[10px] font-semibold", children: "S" }) }),
6525
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx12("span", { className: "text-[10px] font-semibold", children: "M" }) }),
6526
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx12("span", { className: "text-[10px] font-semibold", children: "L" }) }),
6527
- /* @__PURE__ */ jsx12("div", { className: "w-px h-6 bg-border/50 mx-1" }),
6528
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx12(RotateCcw, { className: "w-4 h-4" }) }),
6529
- /* @__PURE__ */ jsx12(
6629
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx13(AlignCenter, { className: "w-4 h-4" }) }),
6630
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx13(AlignLeft, { className: "w-4 h-4" }) }),
6631
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx13(AlignRight, { className: "w-4 h-4" }) }),
6632
+ /* @__PURE__ */ jsx13("div", { className: "w-px h-6 bg-border/50 mx-1" }),
6633
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx13("span", { className: "text-[10px] font-semibold", children: "S" }) }),
6634
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx13("span", { className: "text-[10px] font-semibold", children: "M" }) }),
6635
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx13("span", { className: "text-[10px] font-semibold", children: "L" }) }),
6636
+ /* @__PURE__ */ jsx13("div", { className: "w-px h-6 bg-border/50 mx-1" }),
6637
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx13(RotateCcw, { className: "w-4 h-4" }) }),
6638
+ /* @__PURE__ */ jsx13(
6530
6639
  ToolbarButton,
6531
6640
  {
6532
6641
  onClick: () => deleteSelectedImage(editor),
6533
6642
  title: t("toolbar.imageDelete"),
6534
6643
  className: "text-destructive hover:text-destructive",
6535
- children: /* @__PURE__ */ jsx12(Trash2, { className: "w-4 h-4" })
6644
+ children: /* @__PURE__ */ jsx13(Trash2, { className: "w-4 h-4" })
6536
6645
  }
6537
6646
  )
6538
6647
  ] });
@@ -6540,8 +6649,8 @@ var BubbleMenuContent = ({
6540
6649
  if (showFormulaPanel && isInTable3) {
6541
6650
  return /* @__PURE__ */ jsxs10("div", { className: "w-72 p-2", children: [
6542
6651
  /* @__PURE__ */ jsxs10("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
6543
- /* @__PURE__ */ jsx12("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
6544
- /* @__PURE__ */ jsx12(
6652
+ /* @__PURE__ */ jsx13("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
6653
+ /* @__PURE__ */ jsx13(
6545
6654
  "button",
6546
6655
  {
6547
6656
  type: "button",
@@ -6554,7 +6663,7 @@ var BubbleMenuContent = ({
6554
6663
  }
6555
6664
  )
6556
6665
  ] }),
6557
- /* @__PURE__ */ jsx12("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: /* @__PURE__ */ jsx12(
6666
+ /* @__PURE__ */ jsx13("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: /* @__PURE__ */ jsx13(
6558
6667
  "input",
6559
6668
  {
6560
6669
  value: formulaDraft,
@@ -6576,14 +6685,14 @@ var BubbleMenuContent = ({
6576
6685
  }
6577
6686
  ) }),
6578
6687
  /* @__PURE__ */ jsxs10("div", { className: "mt-2", children: [
6579
- /* @__PURE__ */ jsx12("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
6580
- /* @__PURE__ */ jsx12("div", { className: "grid grid-cols-5 gap-1", children: [
6688
+ /* @__PURE__ */ jsx13("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
6689
+ /* @__PURE__ */ jsx13("div", { className: "grid grid-cols-5 gap-1", children: [
6581
6690
  ["text", "Text"],
6582
6691
  ["number", "123"],
6583
6692
  ["currency", "$"],
6584
6693
  ["percent", "%"],
6585
6694
  ["date", "Date"]
6586
- ].map(([format, label]) => /* @__PURE__ */ jsx12(
6695
+ ].map(([format, label]) => /* @__PURE__ */ jsx13(
6587
6696
  "button",
6588
6697
  {
6589
6698
  type: "button",
@@ -6598,7 +6707,7 @@ var BubbleMenuContent = ({
6598
6707
  )) })
6599
6708
  ] }),
6600
6709
  /* @__PURE__ */ jsxs10("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
6601
- /* @__PURE__ */ jsx12(
6710
+ /* @__PURE__ */ jsx13(
6602
6711
  "button",
6603
6712
  {
6604
6713
  type: "button",
@@ -6611,7 +6720,7 @@ var BubbleMenuContent = ({
6611
6720
  children: t("tableMenu.apply") || "Apply"
6612
6721
  }
6613
6722
  ),
6614
- /* @__PURE__ */ jsx12(
6723
+ /* @__PURE__ */ jsx13(
6615
6724
  "button",
6616
6725
  {
6617
6726
  type: "button",
@@ -6623,7 +6732,7 @@ var BubbleMenuContent = ({
6623
6732
  children: t("tableMenu.clear") || "Clear"
6624
6733
  }
6625
6734
  ),
6626
- /* @__PURE__ */ jsx12(
6735
+ /* @__PURE__ */ jsx13(
6627
6736
  "button",
6628
6737
  {
6629
6738
  type: "button",
@@ -6638,8 +6747,8 @@ var BubbleMenuContent = ({
6638
6747
  if (showTypographyPanel) {
6639
6748
  return /* @__PURE__ */ jsxs10("div", { className: "w-72 p-2", children: [
6640
6749
  /* @__PURE__ */ jsxs10("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
6641
- /* @__PURE__ */ jsx12("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
6642
- /* @__PURE__ */ jsx12(
6750
+ /* @__PURE__ */ jsx13("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
6751
+ /* @__PURE__ */ jsx13(
6643
6752
  "button",
6644
6753
  {
6645
6754
  type: "button",
@@ -6651,9 +6760,9 @@ var BubbleMenuContent = ({
6651
6760
  ] }),
6652
6761
  /* @__PURE__ */ jsxs10("div", { className: "space-y-2", children: [
6653
6762
  /* @__PURE__ */ jsxs10("div", { children: [
6654
- /* @__PURE__ */ jsx12("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
6763
+ /* @__PURE__ */ jsx13("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
6655
6764
  /* @__PURE__ */ jsxs10("div", { className: cn("flex h-9 items-center overflow-hidden rounded-md bg-muted/40", formControlGroupOutlineClass), children: [
6656
- /* @__PURE__ */ jsx12(
6765
+ /* @__PURE__ */ jsx13(
6657
6766
  "input",
6658
6767
  {
6659
6768
  type: "number",
@@ -6677,8 +6786,8 @@ var BubbleMenuContent = ({
6677
6786
  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"
6678
6787
  }
6679
6788
  ),
6680
- /* @__PURE__ */ jsx12("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
6681
- /* @__PURE__ */ jsx12(
6789
+ /* @__PURE__ */ jsx13("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
6790
+ /* @__PURE__ */ jsx13(
6682
6791
  "button",
6683
6792
  {
6684
6793
  type: "button",
@@ -6688,12 +6797,12 @@ var BubbleMenuContent = ({
6688
6797
  "flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
6689
6798
  showFontSizeOptions && "bg-primary/10 text-primary"
6690
6799
  ),
6691
- children: /* @__PURE__ */ jsx12(ChevronDown2, { className: "h-4 w-4" })
6800
+ children: /* @__PURE__ */ jsx13(ChevronDown2, { className: "h-4 w-4" })
6692
6801
  }
6693
6802
  )
6694
6803
  ] }),
6695
6804
  showFontSizeOptions && /* @__PURE__ */ jsxs10("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
6696
- /* @__PURE__ */ jsx12(
6805
+ /* @__PURE__ */ jsx13(
6697
6806
  "button",
6698
6807
  {
6699
6808
  type: "button",
@@ -6708,7 +6817,7 @@ var BubbleMenuContent = ({
6708
6817
  children: "A"
6709
6818
  }
6710
6819
  ),
6711
- quickFontSizes.map((option) => /* @__PURE__ */ jsx12(
6820
+ quickFontSizes.map((option) => /* @__PURE__ */ jsx13(
6712
6821
  "button",
6713
6822
  {
6714
6823
  type: "button",
@@ -6727,9 +6836,9 @@ var BubbleMenuContent = ({
6727
6836
  ] })
6728
6837
  ] }),
6729
6838
  /* @__PURE__ */ jsxs10("div", { children: [
6730
- /* @__PURE__ */ jsx12("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
6839
+ /* @__PURE__ */ jsx13("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
6731
6840
  /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-4 gap-1", children: [
6732
- /* @__PURE__ */ jsx12(
6841
+ /* @__PURE__ */ jsx13(
6733
6842
  "button",
6734
6843
  {
6735
6844
  type: "button",
@@ -6741,7 +6850,7 @@ var BubbleMenuContent = ({
6741
6850
  children: "LH"
6742
6851
  }
6743
6852
  ),
6744
- quickLineHeights.map((option) => /* @__PURE__ */ jsx12(
6853
+ quickLineHeights.map((option) => /* @__PURE__ */ jsx13(
6745
6854
  "button",
6746
6855
  {
6747
6856
  type: "button",
@@ -6767,7 +6876,7 @@ var BubbleMenuContent = ({
6767
6876
  editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
6768
6877
  ),
6769
6878
  children: [
6770
- /* @__PURE__ */ jsx12(SubscriptIcon, { className: "h-4 w-4" }),
6879
+ /* @__PURE__ */ jsx13(SubscriptIcon, { className: "h-4 w-4" }),
6771
6880
  t("toolbar.subscript")
6772
6881
  ]
6773
6882
  }
@@ -6782,7 +6891,7 @@ var BubbleMenuContent = ({
6782
6891
  editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
6783
6892
  ),
6784
6893
  children: [
6785
- /* @__PURE__ */ jsx12(SuperscriptIcon, { className: "h-4 w-4" }),
6894
+ /* @__PURE__ */ jsx13(SuperscriptIcon, { className: "h-4 w-4" }),
6786
6895
  t("toolbar.superscript")
6787
6896
  ]
6788
6897
  }
@@ -6794,17 +6903,17 @@ var BubbleMenuContent = ({
6794
6903
  const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? AlignCenterVertical : currentCellVerticalAlign === "bottom" ? AlignEndVertical : AlignStartVertical;
6795
6904
  if (isTableCellSelection) {
6796
6905
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-0.5 p-1", "data-ueditor-cell-inspector": "", children: [
6797
- /* @__PURE__ */ jsx12(
6906
+ /* @__PURE__ */ jsx13(
6798
6907
  ToolbarButton,
6799
6908
  {
6800
6909
  onMouseDown: () => onKeepOpenChange?.(true),
6801
6910
  onClick: () => setActiveColorPalette("cell-bg"),
6802
6911
  active: Boolean(currentCellBgColor),
6803
6912
  title: t("tableMenu.cellBackground") || "Cell background",
6804
- children: /* @__PURE__ */ jsx12(CellBgColorIcon, { color: currentCellBgColor })
6913
+ children: /* @__PURE__ */ jsx13(CellBgColorIcon, { color: currentCellBgColor })
6805
6914
  }
6806
6915
  ),
6807
- /* @__PURE__ */ jsx12(
6916
+ /* @__PURE__ */ jsx13(
6808
6917
  ToolbarButton,
6809
6918
  {
6810
6919
  onMouseDown: () => onKeepOpenChange?.(true),
@@ -6813,7 +6922,7 @@ var BubbleMenuContent = ({
6813
6922
  editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
6814
6923
  ),
6815
6924
  title: t("tableMenu.cellBorder") || "Cell border",
6816
- children: /* @__PURE__ */ jsx12(
6925
+ children: /* @__PURE__ */ jsx13(
6817
6926
  CellBorderIcon,
6818
6927
  {
6819
6928
  color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
@@ -6821,7 +6930,7 @@ var BubbleMenuContent = ({
6821
6930
  )
6822
6931
  }
6823
6932
  ),
6824
- /* @__PURE__ */ jsx12(
6933
+ /* @__PURE__ */ jsx13(
6825
6934
  ToolbarButton,
6826
6935
  {
6827
6936
  onMouseDown: () => onKeepOpenChange?.(true),
@@ -6831,10 +6940,10 @@ var BubbleMenuContent = ({
6831
6940
  },
6832
6941
  active: Boolean(currentCellFormula),
6833
6942
  title: t("tableMenu.formula") || "Formula",
6834
- children: /* @__PURE__ */ jsx12(Sigma2, { className: "w-4 h-4" })
6943
+ children: /* @__PURE__ */ jsx13(Sigma2, { className: "w-4 h-4" })
6835
6944
  }
6836
6945
  ),
6837
- /* @__PURE__ */ jsx12(
6946
+ /* @__PURE__ */ jsx13(
6838
6947
  ToolbarButton,
6839
6948
  {
6840
6949
  onClick: () => {
@@ -6847,10 +6956,10 @@ var BubbleMenuContent = ({
6847
6956
  active: canSplitCell,
6848
6957
  disabled: !canMergeCells && !canSplitCell,
6849
6958
  title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
6850
- children: /* @__PURE__ */ jsx12(TableCellsMerge, { className: "w-4 h-4" })
6959
+ children: /* @__PURE__ */ jsx13(TableCellsMerge, { className: "w-4 h-4" })
6851
6960
  }
6852
6961
  ),
6853
- /* @__PURE__ */ jsx12(
6962
+ /* @__PURE__ */ jsx13(
6854
6963
  ToolbarButton,
6855
6964
  {
6856
6965
  onClick: () => applyTableCellAttribute(
@@ -6861,7 +6970,7 @@ var BubbleMenuContent = ({
6861
6970
  ),
6862
6971
  active: currentCellTextWrap !== "nowrap",
6863
6972
  title: currentCellTextWrap === "nowrap" ? t("tableMenu.wrapText") : t("tableMenu.noWrapText"),
6864
- children: /* @__PURE__ */ jsx12(WrapText, { className: "h-4 w-4" })
6973
+ children: /* @__PURE__ */ jsx13(WrapText, { className: "h-4 w-4" })
6865
6974
  }
6866
6975
  ),
6867
6976
  /* @__PURE__ */ jsxs10(
@@ -6876,13 +6985,13 @@ var BubbleMenuContent = ({
6876
6985
  },
6877
6986
  title: t("tableMenu.alignVertical") || "Vertical alignment",
6878
6987
  children: [
6879
- /* @__PURE__ */ jsx12(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
6880
- /* @__PURE__ */ jsx12(ChevronDown2, { className: "w-3 h-3" })
6988
+ /* @__PURE__ */ jsx13(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
6989
+ /* @__PURE__ */ jsx13(ChevronDown2, { className: "w-3 h-3" })
6881
6990
  ]
6882
6991
  }
6883
6992
  ),
6884
6993
  children: [
6885
- /* @__PURE__ */ jsx12(
6994
+ /* @__PURE__ */ jsx13(
6886
6995
  DropdownMenuItem,
6887
6996
  {
6888
6997
  icon: AlignStartVertical,
@@ -6891,7 +7000,7 @@ var BubbleMenuContent = ({
6891
7000
  active: currentCellVerticalAlign === "top"
6892
7001
  }
6893
7002
  ),
6894
- /* @__PURE__ */ jsx12(
7003
+ /* @__PURE__ */ jsx13(
6895
7004
  DropdownMenuItem,
6896
7005
  {
6897
7006
  icon: AlignCenterVertical,
@@ -6900,7 +7009,7 @@ var BubbleMenuContent = ({
6900
7009
  active: currentCellVerticalAlign === "middle"
6901
7010
  }
6902
7011
  ),
6903
- /* @__PURE__ */ jsx12(
7012
+ /* @__PURE__ */ jsx13(
6904
7013
  DropdownMenuItem,
6905
7014
  {
6906
7015
  icon: AlignEndVertical,
@@ -6924,13 +7033,13 @@ var BubbleMenuContent = ({
6924
7033
  },
6925
7034
  title: t("tableMenu.textDirection"),
6926
7035
  children: [
6927
- currentCellTextDirection === "vertical" ? /* @__PURE__ */ jsx12(ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx12(ArrowRight, { className: "w-4 h-4" }),
6928
- /* @__PURE__ */ jsx12(ChevronDown2, { className: "w-3 h-3" })
7036
+ currentCellTextDirection === "vertical" ? /* @__PURE__ */ jsx13(ArrowDown, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx13(ArrowRight, { className: "w-4 h-4" }),
7037
+ /* @__PURE__ */ jsx13(ChevronDown2, { className: "w-3 h-3" })
6929
7038
  ]
6930
7039
  }
6931
7040
  ),
6932
7041
  children: [
6933
- /* @__PURE__ */ jsx12(
7042
+ /* @__PURE__ */ jsx13(
6934
7043
  DropdownMenuItem,
6935
7044
  {
6936
7045
  icon: ArrowRight,
@@ -6939,7 +7048,7 @@ var BubbleMenuContent = ({
6939
7048
  active: currentCellTextDirection === "horizontal"
6940
7049
  }
6941
7050
  ),
6942
- /* @__PURE__ */ jsx12(
7051
+ /* @__PURE__ */ jsx13(
6943
7052
  DropdownMenuItem,
6944
7053
  {
6945
7054
  icon: ArrowDown,
@@ -6954,21 +7063,21 @@ var BubbleMenuContent = ({
6954
7063
  ] });
6955
7064
  }
6956
7065
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-0.5 p-1", children: [
6957
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx12(BoldIcon, { className: "w-4 h-4" }) }),
6958
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx12(ItalicIcon, { className: "w-4 h-4" }) }),
6959
- /* @__PURE__ */ jsx12(
7066
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx13(BoldIcon, { className: "w-4 h-4" }) }),
7067
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx13(ItalicIcon, { className: "w-4 h-4" }) }),
7068
+ /* @__PURE__ */ jsx13(
6960
7069
  ToolbarButton,
6961
7070
  {
6962
7071
  onClick: () => editor.chain().focus().toggleUnderline().run(),
6963
7072
  active: editor.isActive("underline"),
6964
7073
  title: t("toolbar.underline"),
6965
- children: /* @__PURE__ */ jsx12(UnderlineIcon, { className: "w-4 h-4" })
7074
+ children: /* @__PURE__ */ jsx13(UnderlineIcon, { className: "w-4 h-4" })
6966
7075
  }
6967
7076
  ),
6968
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx12(StrikethroughIcon, { className: "w-4 h-4" }) }),
6969
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx12(CodeIcon, { className: "w-4 h-4" }) }),
6970
- /* @__PURE__ */ jsx12("div", { className: "w-px h-6 bg-border/50 mx-1" }),
6971
- /* @__PURE__ */ jsx12(
7077
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx13(StrikethroughIcon, { className: "w-4 h-4" }) }),
7078
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx13(CodeIcon, { className: "w-4 h-4" }) }),
7079
+ /* @__PURE__ */ jsx13("div", { className: "w-px h-6 bg-border/50 mx-1" }),
7080
+ /* @__PURE__ */ jsx13(
6972
7081
  ToolbarButton,
6973
7082
  {
6974
7083
  onMouseDown: () => {
@@ -6979,18 +7088,18 @@ var BubbleMenuContent = ({
6979
7088
  },
6980
7089
  active: editor.isActive("link"),
6981
7090
  title: t("toolbar.link"),
6982
- children: /* @__PURE__ */ jsx12(LinkIcon, { className: "w-4 h-4" })
7091
+ children: /* @__PURE__ */ jsx13(LinkIcon, { className: "w-4 h-4" })
6983
7092
  }
6984
7093
  ),
6985
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx12(TextColorIcon, { color: currentTextColor }) }),
6986
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx12(HighlightColorIcon, { color: currentHighlightColor }) }),
6987
- /* @__PURE__ */ jsx12(
7094
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx13(TextColorIcon, { color: currentTextColor }) }),
7095
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx13(HighlightColorIcon, { color: currentHighlightColor }) }),
7096
+ /* @__PURE__ */ jsx13(
6988
7097
  ToolbarButton,
6989
7098
  {
6990
7099
  onClick: () => setShowTypographyPanel(true),
6991
7100
  active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
6992
7101
  title: t("toolbar.textStyle"),
6993
- children: /* @__PURE__ */ jsx12(Type2, { className: "w-4 h-4" })
7102
+ children: /* @__PURE__ */ jsx13(Type2, { className: "w-4 h-4" })
6994
7103
  }
6995
7104
  )
6996
7105
  ] });
@@ -7006,11 +7115,11 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
7006
7115
  editor.chain().focus().unsetLink().run();
7007
7116
  };
7008
7117
  return /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
7009
- /* @__PURE__ */ jsx12("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
7010
- /* @__PURE__ */ jsx12("div", { className: "w-px h-6 bg-border/50 mx-1" }),
7011
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx12(ExternalLink2, { className: "w-4 h-4" }) }),
7012
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx12(Edit2, { className: "w-4 h-4" }) }),
7013
- /* @__PURE__ */ jsx12(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx12(Unlink, { className: "w-4 h-4" }) })
7118
+ /* @__PURE__ */ jsx13("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
7119
+ /* @__PURE__ */ jsx13("div", { className: "w-px h-6 bg-border/50 mx-1" }),
7120
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx13(ExternalLink2, { className: "w-4 h-4" }) }),
7121
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx13(Edit2, { className: "w-4 h-4" }) }),
7122
+ /* @__PURE__ */ jsx13(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx13(Unlink, { className: "w-4 h-4" }) })
7014
7123
  ] });
7015
7124
  };
7016
7125
  var CustomBubbleMenu = ({
@@ -7205,7 +7314,7 @@ var CustomBubbleMenu = ({
7205
7314
  const context = getBubbleMenuContext(editor);
7206
7315
  if (context === "none") return null;
7207
7316
  return createPortal(
7208
- /* @__PURE__ */ jsx12(
7317
+ /* @__PURE__ */ jsx13(
7209
7318
  "div",
7210
7319
  {
7211
7320
  ref: menuRef,
@@ -7229,7 +7338,7 @@ var CustomBubbleMenu = ({
7229
7338
  }
7230
7339
  e.preventDefault();
7231
7340
  },
7232
- children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ jsx12(
7341
+ children: context === "link" && !keepOpen && !linkInputOpen ? /* @__PURE__ */ jsx13(
7233
7342
  LinkPreviewContent,
7234
7343
  {
7235
7344
  editor,
@@ -7238,7 +7347,7 @@ var CustomBubbleMenu = ({
7238
7347
  setKeepOpen(true);
7239
7348
  }
7240
7349
  }
7241
- ) : /* @__PURE__ */ jsx12(
7350
+ ) : /* @__PURE__ */ jsx13(
7242
7351
  BubbleMenuContent,
7243
7352
  {
7244
7353
  editor,
@@ -7303,7 +7412,7 @@ var CustomFloatingMenu = ({ editor }) => {
7303
7412
  }, [editor, editorWindow]);
7304
7413
  if (!isVisible || !portalContainer) return null;
7305
7414
  return createPortal(
7306
- /* @__PURE__ */ jsx12(
7415
+ /* @__PURE__ */ jsx13(
7307
7416
  "div",
7308
7417
  {
7309
7418
  "data-popover": true,
@@ -7314,7 +7423,7 @@ var CustomFloatingMenu = ({ editor }) => {
7314
7423
  transform: "translate(-50%, -100%)"
7315
7424
  },
7316
7425
  onMouseDown: (e) => e.preventDefault(),
7317
- children: /* @__PURE__ */ jsx12(FloatingMenuContent, { editor })
7426
+ children: /* @__PURE__ */ jsx13(FloatingMenuContent, { editor })
7318
7427
  }
7319
7428
  ),
7320
7429
  portalContainer
@@ -7357,7 +7466,7 @@ var CharacterCountDisplay = ({ editor, maxCharacters }) => {
7357
7466
  };
7358
7467
 
7359
7468
  // src/components/UEditor/table-controls.tsx
7360
- import React11 from "react";
7469
+ import React12 from "react";
7361
7470
 
7362
7471
  // node_modules/prosemirror-model/dist/index.js
7363
7472
  function findDiffStart(a, b, pos) {
@@ -8406,7 +8515,7 @@ var NodeRange = class {
8406
8515
  }
8407
8516
  };
8408
8517
  var emptyAttrs = /* @__PURE__ */ Object.create(null);
8409
- var Node6 = class _Node {
8518
+ var Node7 = class _Node {
8410
8519
  /**
8411
8520
  @internal
8412
8521
  */
@@ -8808,7 +8917,7 @@ var Node6 = class _Node {
8808
8917
  return node;
8809
8918
  }
8810
8919
  };
8811
- Node6.prototype.text = void 0;
8920
+ Node7.prototype.text = void 0;
8812
8921
  function wrapMarks(marks, str) {
8813
8922
  for (let i = marks.length - 1; i >= 0; i--)
8814
8923
  str = marks[i].type.name + "(" + str + ")";
@@ -11910,7 +12019,7 @@ function buildTableHoverState({
11910
12019
  }
11911
12020
 
11912
12021
  // src/components/UEditor/table-drag-preview.tsx
11913
- import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
12022
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
11914
12023
  function TableDragPreview({
11915
12024
  columnDragLabel,
11916
12025
  dragPreview,
@@ -11923,7 +12032,7 @@ function TableDragPreview({
11923
12032
  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`;
11924
12033
  return /* @__PURE__ */ jsxs12(Fragment3, { children: [
11925
12034
  dragPreview.kind === "row" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
11926
- /* @__PURE__ */ jsx13(
12035
+ /* @__PURE__ */ jsx14(
11927
12036
  "div",
11928
12037
  {
11929
12038
  "aria-hidden": "true",
@@ -11936,7 +12045,7 @@ function TableDragPreview({
11936
12045
  }
11937
12046
  }
11938
12047
  ),
11939
- /* @__PURE__ */ jsx13(
12048
+ /* @__PURE__ */ jsx14(
11940
12049
  "div",
11941
12050
  {
11942
12051
  "aria-hidden": "true",
@@ -11951,7 +12060,7 @@ function TableDragPreview({
11951
12060
  )
11952
12061
  ] }),
11953
12062
  dragPreview.kind === "column" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
11954
- /* @__PURE__ */ jsx13(
12063
+ /* @__PURE__ */ jsx14(
11955
12064
  "div",
11956
12065
  {
11957
12066
  "aria-hidden": "true",
@@ -11964,7 +12073,7 @@ function TableDragPreview({
11964
12073
  }
11965
12074
  }
11966
12075
  ),
11967
- /* @__PURE__ */ jsx13(
12076
+ /* @__PURE__ */ jsx14(
11968
12077
  "div",
11969
12078
  {
11970
12079
  "aria-hidden": "true",
@@ -11978,7 +12087,7 @@ function TableDragPreview({
11978
12087
  }
11979
12088
  )
11980
12089
  ] }),
11981
- (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx13(
12090
+ (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx14(
11982
12091
  "div",
11983
12092
  {
11984
12093
  "aria-hidden": "true",
@@ -11991,7 +12100,7 @@ function TableDragPreview({
11991
12100
  }
11992
12101
  }
11993
12102
  ),
11994
- /* @__PURE__ */ jsx13(
12103
+ /* @__PURE__ */ jsx14(
11995
12104
  "div",
11996
12105
  {
11997
12106
  role: "status",
@@ -12007,7 +12116,7 @@ function TableDragPreview({
12007
12116
  }
12008
12117
 
12009
12118
  // src/components/UEditor/table-add-rails.tsx
12010
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
12119
+ import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
12011
12120
  var ADD_COLUMN_RAIL_GAP = 4;
12012
12121
  var ADD_ROW_RAIL_GAP = 4;
12013
12122
  var BUTTON_LONG_SIZE = 36;
@@ -12033,12 +12142,12 @@ function TableAddRails({
12033
12142
  const showColumnRail = controlsVisible || addColumnVisible;
12034
12143
  const showRowRail = controlsVisible || addRowVisible;
12035
12144
  return /* @__PURE__ */ jsxs13(Fragment4, { children: [
12036
- /* @__PURE__ */ jsx14(
12145
+ /* @__PURE__ */ jsx15(
12037
12146
  Tooltip,
12038
12147
  {
12039
12148
  placement: "right",
12040
- content: /* @__PURE__ */ jsx14("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
12041
- children: /* @__PURE__ */ jsx14(
12149
+ content: /* @__PURE__ */ jsx15("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
12150
+ children: /* @__PURE__ */ jsx15(
12042
12151
  "button",
12043
12152
  {
12044
12153
  type: "button",
@@ -12066,17 +12175,17 @@ function TableAddRails({
12066
12175
  transform: showColumnRail ? "scale(1)" : "scale(0.85)",
12067
12176
  pointerEvents: showColumnRail ? "auto" : "none"
12068
12177
  },
12069
- children: /* @__PURE__ */ jsx14("span", { className: "text-sm font-medium leading-none", children: "+" })
12178
+ children: /* @__PURE__ */ jsx15("span", { className: "text-sm font-medium leading-none", children: "+" })
12070
12179
  }
12071
12180
  )
12072
12181
  }
12073
12182
  ),
12074
- /* @__PURE__ */ jsx14(
12183
+ /* @__PURE__ */ jsx15(
12075
12184
  Tooltip,
12076
12185
  {
12077
12186
  placement: "bottom",
12078
- content: /* @__PURE__ */ jsx14("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
12079
- children: /* @__PURE__ */ jsx14(
12187
+ content: /* @__PURE__ */ jsx15("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
12188
+ children: /* @__PURE__ */ jsx15(
12080
12189
  "button",
12081
12190
  {
12082
12191
  type: "button",
@@ -12102,7 +12211,7 @@ function TableAddRails({
12102
12211
  transform: showRowRail ? "scale(1)" : "scale(0.85)",
12103
12212
  pointerEvents: showRowRail ? "auto" : "none"
12104
12213
  },
12105
- children: /* @__PURE__ */ jsx14("span", { className: "text-sm font-medium leading-none", children: "+" })
12214
+ children: /* @__PURE__ */ jsx15("span", { className: "text-sm font-medium leading-none", children: "+" })
12106
12215
  }
12107
12216
  )
12108
12217
  }
@@ -12112,7 +12221,7 @@ function TableAddRails({
12112
12221
 
12113
12222
  // src/components/UEditor/table-control-menu.tsx
12114
12223
  import { MoreHorizontal } from "lucide-react";
12115
- import { jsx as jsx15 } from "react/jsx-runtime";
12224
+ import { jsx as jsx16 } from "react/jsx-runtime";
12116
12225
  function TableControlMenu({
12117
12226
  controlsVisible,
12118
12227
  isOpen,
@@ -12124,7 +12233,7 @@ function TableControlMenu({
12124
12233
  top
12125
12234
  }) {
12126
12235
  const shown = controlsVisible || menuVisible || isOpen;
12127
- return /* @__PURE__ */ jsx15(
12236
+ return /* @__PURE__ */ jsx16(
12128
12237
  "div",
12129
12238
  {
12130
12239
  className: "absolute z-30",
@@ -12133,13 +12242,13 @@ function TableControlMenu({
12133
12242
  top,
12134
12243
  left
12135
12244
  },
12136
- children: /* @__PURE__ */ jsx15(
12245
+ children: /* @__PURE__ */ jsx16(
12137
12246
  Tooltip,
12138
12247
  {
12139
12248
  placement: "top",
12140
12249
  disabled: isOpen,
12141
- content: /* @__PURE__ */ jsx15("span", { className: "text-xs font-medium", children: label }),
12142
- children: /* @__PURE__ */ jsx15("span", { className: "inline-flex", children: /* @__PURE__ */ jsx15(
12250
+ content: /* @__PURE__ */ jsx16("span", { className: "text-xs font-medium", children: label }),
12251
+ children: /* @__PURE__ */ jsx16("span", { className: "inline-flex", children: /* @__PURE__ */ jsx16(
12143
12252
  DropdownMenu,
12144
12253
  {
12145
12254
  placement: "bottom-start",
@@ -12147,7 +12256,7 @@ function TableControlMenu({
12147
12256
  onOpenChange,
12148
12257
  contentClassName: "p-2",
12149
12258
  items,
12150
- trigger: /* @__PURE__ */ jsx15(
12259
+ trigger: /* @__PURE__ */ jsx16(
12151
12260
  "button",
12152
12261
  {
12153
12262
  type: "button",
@@ -12163,7 +12272,7 @@ function TableControlMenu({
12163
12272
  transform: shown ? "scale(1)" : "scale(0.82)",
12164
12273
  pointerEvents: shown ? "auto" : "none"
12165
12274
  },
12166
- children: /* @__PURE__ */ jsx15(MoreHorizontal, { "aria-hidden": "true", className: "h-4 w-4" })
12275
+ children: /* @__PURE__ */ jsx16(MoreHorizontal, { "aria-hidden": "true", className: "h-4 w-4" })
12167
12276
  }
12168
12277
  )
12169
12278
  }
@@ -12176,7 +12285,7 @@ function TableControlMenu({
12176
12285
 
12177
12286
  // src/components/UEditor/table-axis-handles.tsx
12178
12287
  import { GripHorizontal, GripVertical } from "lucide-react";
12179
- import { Fragment as Fragment5, jsx as jsx16 } from "react/jsx-runtime";
12288
+ import { Fragment as Fragment5, jsx as jsx17 } from "react/jsx-runtime";
12180
12289
  var IDLE_HANDLE_SCALE = "0.78";
12181
12290
  function TableRowHandles({
12182
12291
  activeRowIndex,
@@ -12191,12 +12300,12 @@ function TableRowHandles({
12191
12300
  rowHandleLeft,
12192
12301
  rowHandles
12193
12302
  }) {
12194
- return /* @__PURE__ */ jsx16(Fragment5, { children: rowHandles.map((rowHandle) => {
12303
+ return /* @__PURE__ */ jsx17(Fragment5, { children: rowHandles.map((rowHandle) => {
12195
12304
  const menuKey = `row:${rowHandle.index}`;
12196
12305
  const isActive = rowHandle.index === activeRowIndex;
12197
12306
  const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
12198
12307
  const isShown = visible || isActive;
12199
- return /* @__PURE__ */ jsx16(
12308
+ return /* @__PURE__ */ jsx17(
12200
12309
  "div",
12201
12310
  {
12202
12311
  className: "absolute z-30",
@@ -12206,13 +12315,13 @@ function TableRowHandles({
12206
12315
  left: rowHandleLeft,
12207
12316
  pointerEvents: visible ? "auto" : "none"
12208
12317
  },
12209
- children: /* @__PURE__ */ jsx16(
12318
+ children: /* @__PURE__ */ jsx17(
12210
12319
  Tooltip,
12211
12320
  {
12212
12321
  placement: "right",
12213
12322
  disabled: openMenuKey === menuKey || !visible && isActive,
12214
- content: /* @__PURE__ */ jsx16("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
12215
- children: /* @__PURE__ */ jsx16("span", { className: "inline-flex", children: /* @__PURE__ */ jsx16(
12323
+ content: /* @__PURE__ */ jsx17("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
12324
+ children: /* @__PURE__ */ jsx17("span", { className: "inline-flex", children: /* @__PURE__ */ jsx17(
12216
12325
  DropdownMenu,
12217
12326
  {
12218
12327
  placement: "right",
@@ -12220,7 +12329,7 @@ function TableRowHandles({
12220
12329
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
12221
12330
  contentClassName: "p-2",
12222
12331
  items: getMenuItems(rowHandle),
12223
- trigger: /* @__PURE__ */ jsx16(
12332
+ trigger: /* @__PURE__ */ jsx17(
12224
12333
  "button",
12225
12334
  {
12226
12335
  type: "button",
@@ -12245,7 +12354,7 @@ function TableRowHandles({
12245
12354
  // selection near the first character of a table cell.
12246
12355
  pointerEvents: visible ? "auto" : "none"
12247
12356
  },
12248
- children: visible ? /* @__PURE__ */ jsx16(GripVertical, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx16("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
12357
+ children: visible ? /* @__PURE__ */ jsx17(GripVertical, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx17("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
12249
12358
  }
12250
12359
  )
12251
12360
  }
@@ -12270,12 +12379,12 @@ function TableColumnHandles({
12270
12379
  onStartDrag,
12271
12380
  openMenuKey
12272
12381
  }) {
12273
- return /* @__PURE__ */ jsx16(Fragment5, { children: columnHandles.map((columnHandle) => {
12382
+ return /* @__PURE__ */ jsx17(Fragment5, { children: columnHandles.map((columnHandle) => {
12274
12383
  const menuKey = `column:${columnHandle.index}`;
12275
12384
  const isActive = columnHandle.index === activeColumnIndex;
12276
12385
  const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
12277
12386
  const isShown = visible || isActive;
12278
- return /* @__PURE__ */ jsx16(
12387
+ return /* @__PURE__ */ jsx17(
12279
12388
  "div",
12280
12389
  {
12281
12390
  className: "absolute z-30",
@@ -12285,13 +12394,13 @@ function TableColumnHandles({
12285
12394
  left: Math.max(8, columnHandle.center - 12),
12286
12395
  pointerEvents: visible ? "auto" : "none"
12287
12396
  },
12288
- children: /* @__PURE__ */ jsx16(
12397
+ children: /* @__PURE__ */ jsx17(
12289
12398
  Tooltip,
12290
12399
  {
12291
12400
  placement: "top",
12292
12401
  disabled: openMenuKey === menuKey || !visible && isActive,
12293
- content: /* @__PURE__ */ jsx16("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
12294
- children: /* @__PURE__ */ jsx16("span", { className: "inline-flex", children: /* @__PURE__ */ jsx16(
12402
+ content: /* @__PURE__ */ jsx17("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
12403
+ children: /* @__PURE__ */ jsx17("span", { className: "inline-flex", children: /* @__PURE__ */ jsx17(
12295
12404
  DropdownMenu,
12296
12405
  {
12297
12406
  placement: "bottom-start",
@@ -12299,7 +12408,7 @@ function TableColumnHandles({
12299
12408
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
12300
12409
  contentClassName: "p-2",
12301
12410
  items: getMenuItems(columnHandle),
12302
- trigger: /* @__PURE__ */ jsx16(
12411
+ trigger: /* @__PURE__ */ jsx17(
12303
12412
  "button",
12304
12413
  {
12305
12414
  type: "button",
@@ -12321,7 +12430,7 @@ function TableColumnHandles({
12321
12430
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
12322
12431
  pointerEvents: visible ? "auto" : "none"
12323
12432
  },
12324
- children: visible ? /* @__PURE__ */ jsx16(GripHorizontal, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx16("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
12433
+ children: visible ? /* @__PURE__ */ jsx17(GripHorizontal, { "aria-hidden": "true", className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx17("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
12325
12434
  }
12326
12435
  )
12327
12436
  }
@@ -12336,7 +12445,7 @@ function TableColumnHandles({
12336
12445
 
12337
12446
  // src/components/UEditor/table-resize-handles.tsx
12338
12447
  import { MoveDiagonal2 } from "lucide-react";
12339
- import { Fragment as Fragment6, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
12448
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
12340
12449
  var EDGE_HANDLE_CLASS = cn(
12341
12450
  "pointer-events-auto absolute top-0 z-10 h-full w-2 touch-none cursor-col-resize bg-transparent p-0",
12342
12451
  "border-transparent transition-colors duration-150 hover:border-primary",
@@ -12387,7 +12496,7 @@ function TableResizeHandles({
12387
12496
  },
12388
12497
  children: [
12389
12498
  layout.widthMode === "responsive" ? /* @__PURE__ */ jsxs14(Fragment6, { children: [
12390
- /* @__PURE__ */ jsx17(
12499
+ /* @__PURE__ */ jsx18(
12391
12500
  "button",
12392
12501
  {
12393
12502
  type: "button",
@@ -12402,7 +12511,7 @@ function TableResizeHandles({
12402
12511
  onKeyDown: (event) => onKeyboardResize(event, "left")
12403
12512
  }
12404
12513
  ),
12405
- /* @__PURE__ */ jsx17(
12514
+ /* @__PURE__ */ jsx18(
12406
12515
  "button",
12407
12516
  {
12408
12517
  type: "button",
@@ -12418,7 +12527,7 @@ function TableResizeHandles({
12418
12527
  }
12419
12528
  )
12420
12529
  ] }) : null,
12421
- /* @__PURE__ */ jsx17(
12530
+ /* @__PURE__ */ jsx18(
12422
12531
  "button",
12423
12532
  {
12424
12533
  type: "button",
@@ -12436,10 +12545,10 @@ function TableResizeHandles({
12436
12545
  },
12437
12546
  onPointerDown: (event) => onStartResize(event, "both"),
12438
12547
  onKeyDown: (event) => onKeyboardResize(event, "both"),
12439
- children: /* @__PURE__ */ jsx17(MoveDiagonal2, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 2.25 })
12548
+ children: /* @__PURE__ */ jsx18(MoveDiagonal2, { "aria-hidden": "true", className: "h-3.5 w-3.5", strokeWidth: 2.25 })
12440
12549
  }
12441
12550
  ),
12442
- active ? /* @__PURE__ */ jsx17(
12551
+ active ? /* @__PURE__ */ jsx18(
12443
12552
  "span",
12444
12553
  {
12445
12554
  role: "status",
@@ -12689,7 +12798,7 @@ function applyTableSize(editor, snapshot, dimensions, options = {}) {
12689
12798
  }
12690
12799
 
12691
12800
  // src/components/UEditor/table-controls.tsx
12692
- import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
12801
+ import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
12693
12802
  var TABLE_MENU_TOP_OFFSET = 10;
12694
12803
  var AXIS_HANDLE_RADIUS = 12;
12695
12804
  function clamp2(value, min, max) {
@@ -12725,21 +12834,21 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12725
12834
  const t = useSmartTranslations("UEditor");
12726
12835
  const editorDocument = editor.view.dom.ownerDocument;
12727
12836
  const editorWindow = editorDocument.defaultView;
12728
- const [layout, setLayout] = React11.useState(null);
12729
- const [dragPreview, setDragPreview] = React11.useState(null);
12730
- const [tableResizeActive, setTableResizeActive] = React11.useState(false);
12731
- const [hoverState, setHoverState] = React11.useState(DEFAULT_TABLE_HOVER_STATE);
12732
- const [openMenuKey, setOpenMenuKey] = React11.useState(null);
12733
- const layoutRef = React11.useRef(null);
12734
- const dragStateRef = React11.useRef(null);
12735
- const syncFrameRef = React11.useRef(null);
12736
- const layoutRefreshFrameRef = React11.useRef(null);
12737
- const tableResizeFrameRef = React11.useRef(null);
12738
- const tableResizePreviewFrameRef = React11.useRef(null);
12739
- React11.useEffect(() => {
12837
+ const [layout, setLayout] = React12.useState(null);
12838
+ const [dragPreview, setDragPreview] = React12.useState(null);
12839
+ const [tableResizeActive, setTableResizeActive] = React12.useState(false);
12840
+ const [hoverState, setHoverState] = React12.useState(DEFAULT_TABLE_HOVER_STATE);
12841
+ const [openMenuKey, setOpenMenuKey] = React12.useState(null);
12842
+ const layoutRef = React12.useRef(null);
12843
+ const dragStateRef = React12.useRef(null);
12844
+ const syncFrameRef = React12.useRef(null);
12845
+ const layoutRefreshFrameRef = React12.useRef(null);
12846
+ const tableResizeFrameRef = React12.useRef(null);
12847
+ const tableResizePreviewFrameRef = React12.useRef(null);
12848
+ React12.useEffect(() => {
12740
12849
  layoutRef.current = layout;
12741
12850
  }, [layout]);
12742
- const syncFromCell = React11.useCallback((cell) => {
12851
+ const syncFromCell = React12.useCallback((cell) => {
12743
12852
  const surface = containerRef.current;
12744
12853
  if (!surface || !cell) {
12745
12854
  layoutRef.current = null;
@@ -12750,10 +12859,10 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12750
12859
  layoutRef.current = nextLayout;
12751
12860
  setLayout(nextLayout);
12752
12861
  }, [containerRef, editor]);
12753
- const syncFromSelection = React11.useCallback(() => {
12862
+ const syncFromSelection = React12.useCallback(() => {
12754
12863
  syncFromCell(getSelectedCell(editor));
12755
12864
  }, [editor, syncFromCell]);
12756
- const scheduleSyncFromSelection = React11.useCallback(() => {
12865
+ const scheduleSyncFromSelection = React12.useCallback(() => {
12757
12866
  if (syncFrameRef.current !== null) return;
12758
12867
  if (!editorWindow) return;
12759
12868
  syncFrameRef.current = editorWindow.requestAnimationFrame(() => {
@@ -12761,13 +12870,13 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12761
12870
  syncFromSelection();
12762
12871
  });
12763
12872
  }, [editorWindow, syncFromSelection]);
12764
- React11.useEffect(() => () => {
12873
+ React12.useEffect(() => () => {
12765
12874
  if (syncFrameRef.current !== null) {
12766
12875
  editorWindow?.cancelAnimationFrame(syncFrameRef.current);
12767
12876
  syncFrameRef.current = null;
12768
12877
  }
12769
12878
  }, [editorWindow]);
12770
- const refreshCurrentLayout = React11.useCallback(() => {
12879
+ const refreshCurrentLayout = React12.useCallback(() => {
12771
12880
  const currentLayout = layoutRef.current;
12772
12881
  if (!currentLayout) return;
12773
12882
  const surface = containerRef.current;
@@ -12782,7 +12891,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12782
12891
  layoutRef.current = nextLayout;
12783
12892
  setLayout(nextLayout);
12784
12893
  }, [containerRef, editor]);
12785
- const scheduleCurrentLayoutRefresh = React11.useCallback(() => {
12894
+ const scheduleCurrentLayoutRefresh = React12.useCallback(() => {
12786
12895
  if (!layoutRef.current || layoutRefreshFrameRef.current !== null) return;
12787
12896
  if (!editorWindow) return;
12788
12897
  layoutRefreshFrameRef.current = editorWindow.requestAnimationFrame(() => {
@@ -12790,13 +12899,13 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12790
12899
  refreshCurrentLayout();
12791
12900
  });
12792
12901
  }, [editorWindow, refreshCurrentLayout]);
12793
- React11.useEffect(() => () => {
12902
+ React12.useEffect(() => () => {
12794
12903
  if (layoutRefreshFrameRef.current !== null) {
12795
12904
  editorWindow?.cancelAnimationFrame(layoutRefreshFrameRef.current);
12796
12905
  layoutRefreshFrameRef.current = null;
12797
12906
  }
12798
12907
  }, [editorWindow]);
12799
- const updateTableResizePreview = React11.useCallback((dimensions) => {
12908
+ const updateTableResizePreview = React12.useCallback((dimensions) => {
12800
12909
  const frame = tableResizeFrameRef.current;
12801
12910
  if (!frame) return;
12802
12911
  frame.style.width = `${dimensions.width}px`;
@@ -12816,7 +12925,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12816
12925
  });
12817
12926
  }
12818
12927
  }, []);
12819
- const resetTableResizePreview = React11.useCallback(() => {
12928
+ const resetTableResizePreview = React12.useCallback(() => {
12820
12929
  const activeLayout = layoutRef.current;
12821
12930
  if (!activeLayout) return;
12822
12931
  updateTableResizePreview({
@@ -12825,7 +12934,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12825
12934
  leftDelta: 0
12826
12935
  });
12827
12936
  }, [updateTableResizePreview]);
12828
- const clearDrag = React11.useCallback(() => {
12937
+ const clearDrag = React12.useCallback(() => {
12829
12938
  const dragState = dragStateRef.current;
12830
12939
  if (dragState?.kind === "resize-table") {
12831
12940
  try {
@@ -12845,7 +12954,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12845
12954
  resetTableResizePreview();
12846
12955
  setDocumentCursor(editorDocument, "");
12847
12956
  }, [editorDocument, editorWindow, resetTableResizePreview]);
12848
- const updateHoverState = React11.useCallback((event) => {
12957
+ const updateHoverState = React12.useCallback((event) => {
12849
12958
  const activeLayout = layoutRef.current;
12850
12959
  const surface = containerRef.current;
12851
12960
  if (!activeLayout || !surface || dragStateRef.current || event.buttons !== 0) {
@@ -12861,7 +12970,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12861
12970
  return areTableHoverStatesEqual(prev, nextState) ? prev : nextState;
12862
12971
  });
12863
12972
  }, [containerRef]);
12864
- React11.useEffect(() => {
12973
+ React12.useEffect(() => {
12865
12974
  const proseMirror = editor.view.dom;
12866
12975
  const surface = containerRef.current;
12867
12976
  if (!surface) return void 0;
@@ -12948,37 +13057,37 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12948
13057
  editor.off("update", scheduleCurrentLayoutRefresh);
12949
13058
  };
12950
13059
  }, [clearDrag, containerRef, editor, editorWindow, scheduleCurrentLayoutRefresh, scheduleSyncFromSelection, syncFromCell, syncFromSelection, updateHoverState]);
12951
- const runAtCellPos = React11.useCallback((cellPos, command, options) => {
13060
+ const runAtCellPos = React12.useCallback((cellPos, command, options) => {
12952
13061
  const result = runTableCommandAtCellPos(editor, cellPos, command);
12953
13062
  if (options?.sync !== false) {
12954
13063
  scheduleSyncFromSelection();
12955
13064
  }
12956
13065
  return result;
12957
13066
  }, [editor, scheduleSyncFromSelection]);
12958
- const runAtActiveCell = React11.useCallback((command, options) => {
13067
+ const runAtActiveCell = React12.useCallback((command, options) => {
12959
13068
  return runAtCellPos(layoutRef.current?.cellPos ?? null, command, options);
12960
13069
  }, [runAtCellPos]);
12961
- const duplicateRowAt = React11.useCallback((rowIndex, cellPos) => {
13070
+ const duplicateRowAt = React12.useCallback((rowIndex, cellPos) => {
12962
13071
  const result = duplicateTableRowAt(editor, rowIndex, cellPos);
12963
13072
  scheduleSyncFromSelection();
12964
13073
  return result;
12965
13074
  }, [editor, scheduleSyncFromSelection]);
12966
- const clearRowAt = React11.useCallback((rowIndex, cellPos) => {
13075
+ const clearRowAt = React12.useCallback((rowIndex, cellPos) => {
12967
13076
  const result = clearTableRowAt(editor, rowIndex, cellPos);
12968
13077
  scheduleSyncFromSelection();
12969
13078
  return result;
12970
13079
  }, [editor, scheduleSyncFromSelection]);
12971
- const duplicateColumnAt = React11.useCallback((columnIndex, cellPos) => {
13080
+ const duplicateColumnAt = React12.useCallback((columnIndex, cellPos) => {
12972
13081
  const result = duplicateTableColumnAt(editor, columnIndex, cellPos);
12973
13082
  scheduleSyncFromSelection();
12974
13083
  return result;
12975
13084
  }, [editor, scheduleSyncFromSelection]);
12976
- const clearColumnAt = React11.useCallback((columnIndex, cellPos) => {
13085
+ const clearColumnAt = React12.useCallback((columnIndex, cellPos) => {
12977
13086
  const result = clearTableColumnAt(editor, columnIndex, cellPos);
12978
13087
  scheduleSyncFromSelection();
12979
13088
  return result;
12980
13089
  }, [editor, scheduleSyncFromSelection]);
12981
- const expandTableBy = React11.useCallback((rows, cols) => {
13090
+ const expandTableBy = React12.useCallback((rows, cols) => {
12982
13091
  const activeCellPos = layoutRef.current?.cellPos ?? editor.state.selection.from;
12983
13092
  const result = expandTableFromCell(editor, activeCellPos, rows, cols);
12984
13093
  scheduleSyncFromSelection();
@@ -12987,7 +13096,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
12987
13096
  const canExpandTable = Boolean(layout);
12988
13097
  const controlsVisible = false;
12989
13098
  const tableMenuOpen = openMenuKey === "table";
12990
- const startTableResize = React11.useCallback((event, edge) => {
13099
+ const startTableResize = React12.useCallback((event, edge) => {
12991
13100
  if (event.button !== 0 || dragStateRef.current) return;
12992
13101
  const activeLayout = layoutRef.current;
12993
13102
  if (!activeLayout) return;
@@ -13025,7 +13134,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13025
13134
  updateTableResizePreview(pendingDimensions);
13026
13135
  setDocumentCursor(editorDocument, edge === "both" ? "nwse-resize" : "ew-resize");
13027
13136
  }, [editor, editorDocument, updateTableResizePreview]);
13028
- const fitTableToEditorWidth = React11.useCallback(() => {
13137
+ const fitTableToEditorWidth = React12.useCallback(() => {
13029
13138
  if (dragStateRef.current) return;
13030
13139
  const activeLayout = layoutRef.current;
13031
13140
  if (!activeLayout) return;
@@ -13048,7 +13157,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13048
13157
  scheduleSyncFromSelection();
13049
13158
  }
13050
13159
  }, [editor, scheduleSyncFromSelection]);
13051
- const resizeTableWithKeyboard = React11.useCallback((event, edge) => {
13160
+ const resizeTableWithKeyboard = React12.useCallback((event, edge) => {
13052
13161
  const horizontal = event.key === "ArrowLeft" || event.key === "ArrowRight";
13053
13162
  const vertical = event.key === "ArrowUp" || event.key === "ArrowDown";
13054
13163
  if (!horizontal && !vertical || edge !== "both" && !horizontal) return;
@@ -13077,7 +13186,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13077
13186
  scheduleSyncFromSelection();
13078
13187
  }
13079
13188
  }, [editor, scheduleSyncFromSelection]);
13080
- const startAddColumnDrag = React11.useCallback((event) => {
13189
+ const startAddColumnDrag = React12.useCallback((event) => {
13081
13190
  if (event.button !== 0 || dragStateRef.current) return;
13082
13191
  event.preventDefault();
13083
13192
  event.stopPropagation();
@@ -13086,7 +13195,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13086
13195
  setDragPreview({ kind: "add-column", previewCols: 1 });
13087
13196
  setDocumentCursor(editorDocument, "ew-resize");
13088
13197
  }, [editorDocument]);
13089
- const startAddRowDrag = React11.useCallback((event) => {
13198
+ const startAddRowDrag = React12.useCallback((event) => {
13090
13199
  if (event.button !== 0 || dragStateRef.current) return;
13091
13200
  event.preventDefault();
13092
13201
  event.stopPropagation();
@@ -13095,7 +13204,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13095
13204
  setDragPreview({ kind: "add-row", previewRows: 1 });
13096
13205
  setDocumentCursor(editorDocument, "ns-resize");
13097
13206
  }, [editorDocument]);
13098
- const startRowDrag = React11.useCallback((event, rowHandle) => {
13207
+ const startRowDrag = React12.useCallback((event, rowHandle) => {
13099
13208
  if (event.button !== 0 || dragStateRef.current) return;
13100
13209
  event.preventDefault();
13101
13210
  event.stopPropagation();
@@ -13115,7 +13224,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13115
13224
  });
13116
13225
  setDocumentCursor(editorDocument, "grabbing");
13117
13226
  }, [editorDocument]);
13118
- const startColumnDrag = React11.useCallback((event, columnHandle) => {
13227
+ const startColumnDrag = React12.useCallback((event, columnHandle) => {
13119
13228
  if (event.button !== 0 || dragStateRef.current) return;
13120
13229
  event.preventDefault();
13121
13230
  event.stopPropagation();
@@ -13135,7 +13244,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13135
13244
  });
13136
13245
  setDocumentCursor(editorDocument, "grabbing");
13137
13246
  }, [editorDocument]);
13138
- const moveRowWithKeyboard = React11.useCallback((rowHandle, direction) => {
13247
+ const moveRowWithKeyboard = React12.useCallback((rowHandle, direction) => {
13139
13248
  const targetIndex = clamp2(rowHandle.index + direction, 0, (layoutRef.current?.rowHandles.length ?? 1) - 1);
13140
13249
  if (targetIndex === rowHandle.index) return;
13141
13250
  const tableInfo = findTableInfo(editor, rowHandle.cellPos);
@@ -13156,7 +13265,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13156
13265
  });
13157
13266
  scheduleSyncFromSelection();
13158
13267
  }, [editor, scheduleSyncFromSelection]);
13159
- const moveColumnWithKeyboard = React11.useCallback((columnHandle, direction) => {
13268
+ const moveColumnWithKeyboard = React12.useCallback((columnHandle, direction) => {
13160
13269
  const targetIndex = clamp2(columnHandle.index + direction, 0, (layoutRef.current?.columnHandles.length ?? 1) - 1);
13161
13270
  if (targetIndex === columnHandle.index) return;
13162
13271
  const tableInfo = findTableInfo(editor, columnHandle.cellPos);
@@ -13188,7 +13297,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13188
13297
  });
13189
13298
  scheduleSyncFromSelection();
13190
13299
  }, [editor, scheduleSyncFromSelection]);
13191
- React11.useEffect(() => {
13300
+ React12.useEffect(() => {
13192
13301
  if (!editorWindow) return;
13193
13302
  const handlePointerMove = (event) => {
13194
13303
  const dragState = dragStateRef.current;
@@ -13333,7 +13442,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13333
13442
  unsubscribeBlur();
13334
13443
  };
13335
13444
  }, [clearDrag, containerRef, editor, editorDocument, editorWindow, expandTableBy, scheduleSyncFromSelection]);
13336
- React11.useEffect(() => {
13445
+ React12.useEffect(() => {
13337
13446
  if (!editorWindow) return;
13338
13447
  const handlePointerMove = (event) => {
13339
13448
  const dragState = dragStateRef.current;
@@ -13404,7 +13513,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13404
13513
  }
13405
13514
  };
13406
13515
  }, [clearDrag, editor, editorDocument, editorWindow, scheduleSyncFromSelection, updateTableResizePreview]);
13407
- const openCellInspector = React11.useCallback(() => {
13516
+ const openCellInspector = React12.useCallback(() => {
13408
13517
  const cellPos = layoutRef.current?.cellPos;
13409
13518
  if (!showCellInspector || cellPos == null) return;
13410
13519
  const didSelect = editor.commands.setCellSelection({
@@ -13416,7 +13525,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13416
13525
  if (!editor.isDestroyed) editor.view.focus();
13417
13526
  });
13418
13527
  }, [editor, editorWindow, showCellInspector]);
13419
- const menuItems = React11.useMemo(() => {
13528
+ const menuItems = React12.useMemo(() => {
13420
13529
  if (!layout) return [];
13421
13530
  return [
13422
13531
  ...showCellInspector ? [{
@@ -13494,7 +13603,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13494
13603
  }
13495
13604
  ];
13496
13605
  }, [editor, fitTableToEditorWidth, layout, openCellInspector, runAtActiveCell, showCellInspector, t]);
13497
- const getRowHandleMenuItems = React11.useCallback((rowHandle) => [
13606
+ const getRowHandleMenuItems = React12.useCallback((rowHandle) => [
13498
13607
  {
13499
13608
  label: t("tableMenu.addRowBefore"),
13500
13609
  icon: ArrowUp,
@@ -13522,7 +13631,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13522
13631
  destructive: true
13523
13632
  }
13524
13633
  ], [clearRowAt, duplicateRowAt, runAtCellPos, t]);
13525
- const getColumnHandleMenuItems = React11.useCallback((columnHandle) => [
13634
+ const getColumnHandleMenuItems = React12.useCallback((columnHandle) => [
13526
13635
  {
13527
13636
  label: t("tableMenu.addColumnBefore"),
13528
13637
  icon: ArrowLeft,
@@ -13558,7 +13667,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13558
13667
  const rowHandleLeft = layout.tableLeft - AXIS_HANDLE_RADIUS;
13559
13668
  const columnHandleTop = layout.tableTop - AXIS_HANDLE_RADIUS;
13560
13669
  return /* @__PURE__ */ jsxs15(Fragment7, { children: [
13561
- /* @__PURE__ */ jsx18(
13670
+ /* @__PURE__ */ jsx19(
13562
13671
  TableRowHandles,
13563
13672
  {
13564
13673
  activeRowIndex: layout.activeRowIndex,
@@ -13576,7 +13685,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13576
13685
  rowHandles: layout.rowHandles
13577
13686
  }
13578
13687
  ),
13579
- /* @__PURE__ */ jsx18(
13688
+ /* @__PURE__ */ jsx19(
13580
13689
  TableColumnHandles,
13581
13690
  {
13582
13691
  activeColumnIndex: layout.activeColumnIndex,
@@ -13594,7 +13703,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13594
13703
  openMenuKey
13595
13704
  }
13596
13705
  ),
13597
- /* @__PURE__ */ jsx18(
13706
+ /* @__PURE__ */ jsx19(
13598
13707
  TableControlMenu,
13599
13708
  {
13600
13709
  controlsVisible,
@@ -13609,7 +13718,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13609
13718
  top: menuTop
13610
13719
  }
13611
13720
  ),
13612
- dragPreview === null && /* @__PURE__ */ jsx18(
13721
+ dragPreview === null && /* @__PURE__ */ jsx19(
13613
13722
  TableResizeHandles,
13614
13723
  {
13615
13724
  active: tableResizeActive,
@@ -13622,7 +13731,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13622
13731
  resizeBothLabel: t("tableMenu.resizeBoth")
13623
13732
  }
13624
13733
  ),
13625
- /* @__PURE__ */ jsx18(
13734
+ /* @__PURE__ */ jsx19(
13626
13735
  TableAddRails,
13627
13736
  {
13628
13737
  addColumnVisible: hoverState.addColumnVisible,
@@ -13638,7 +13747,7 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13638
13747
  quickAddRowLabel: t("tableMenu.quickAddRowAfter")
13639
13748
  }
13640
13749
  ),
13641
- /* @__PURE__ */ jsx18(
13750
+ /* @__PURE__ */ jsx19(
13642
13751
  TableDragPreview,
13643
13752
  {
13644
13753
  columnDragLabel: t("tableMenu.dragColumn"),
@@ -13651,10 +13760,10 @@ function TableControls({ editor, containerRef, showCellInspector = true }) {
13651
13760
  }
13652
13761
 
13653
13762
  // src/components/UEditor/use-table-interactions.ts
13654
- import React13, { useEffect as useEffect6, useRef as useRef6 } from "react";
13763
+ import React14, { useEffect as useEffect6, useRef as useRef6 } from "react";
13655
13764
 
13656
13765
  // src/components/UEditor/use-table-row-resize.ts
13657
- import React12, { useRef as useRef5 } from "react";
13766
+ import React13, { useRef as useRef5 } from "react";
13658
13767
  function setRowResizeBodyState(ownerDocument, active) {
13659
13768
  ownerDocument.body.style.userSelect = active ? "none" : "";
13660
13769
  ownerDocument.body.style.cursor = active ? "row-resize" : "";
@@ -13668,15 +13777,15 @@ function useTableRowResize({
13668
13777
  scheduleTableLayoutSync
13669
13778
  }) {
13670
13779
  const stateRef = useRef5(null);
13671
- const syncActiveGuide = React12.useCallback(() => {
13780
+ const syncActiveGuide = React13.useCallback(() => {
13672
13781
  const state = stateRef.current;
13673
13782
  if (!state) return false;
13674
13783
  setHoveredTableCell(state.cellElement);
13675
13784
  showRowGuide(state.tableElement, state.rowElement, state.cellElement, state.pendingHeight);
13676
13785
  return true;
13677
13786
  }, [setHoveredTableCell, showRowGuide]);
13678
- const isResizing = React12.useCallback(() => stateRef.current !== null, []);
13679
- const beginResize = React12.useCallback((event, table, row, cell) => {
13787
+ const isResizing = React13.useCallback(() => stateRef.current !== null, []);
13788
+ const beginResize = React13.useCallback((event, table, row, cell) => {
13680
13789
  if (!editor || !isRowResizeHotspot(cell, event.clientX, event.clientY)) {
13681
13790
  return false;
13682
13791
  }
@@ -13705,7 +13814,7 @@ function useTableRowResize({
13705
13814
  event.stopPropagation();
13706
13815
  return true;
13707
13816
  }, [editor, setHoveredTableCell, showRowGuide]);
13708
- const handlePointerMove = React12.useCallback((event) => {
13817
+ const handlePointerMove = React13.useCallback((event) => {
13709
13818
  const state = stateRef.current;
13710
13819
  if (!state) return;
13711
13820
  const nextHeight = Math.max(
@@ -13722,7 +13831,7 @@ function useTableRowResize({
13722
13831
  setRowResizeBodyState(state.rowElement.ownerDocument, true);
13723
13832
  showRowGuide(state.tableElement, state.rowElement, state.cellElement, nextHeight);
13724
13833
  }, [showRowGuide]);
13725
- const handlePointerUp = React12.useCallback((event) => {
13834
+ const handlePointerUp = React13.useCallback((event) => {
13726
13835
  if (!editor) return;
13727
13836
  const state = stateRef.current;
13728
13837
  if (!state) return;
@@ -13747,7 +13856,7 @@ function useTableRowResize({
13747
13856
  clearAllTableResizeHover();
13748
13857
  scheduleTableLayoutSync();
13749
13858
  }, [clearAllTableResizeHover, clearHoveredTableCell, editor, scheduleTableLayoutSync]);
13750
- const cancelResize = React12.useCallback(() => {
13859
+ const cancelResize = React13.useCallback(() => {
13751
13860
  const state = stateRef.current;
13752
13861
  if (!state) return;
13753
13862
  stateRef.current = null;
@@ -13757,7 +13866,7 @@ function useTableRowResize({
13757
13866
  clearAllTableResizeHover();
13758
13867
  scheduleTableLayoutSync();
13759
13868
  }, [clearAllTableResizeHover, clearHoveredTableCell, scheduleTableLayoutSync]);
13760
- const cleanup = React12.useCallback(() => {
13869
+ const cleanup = React13.useCallback(() => {
13761
13870
  const editorDocument = stateRef.current?.rowElement.ownerDocument ?? editor?.view.dom.ownerDocument;
13762
13871
  stateRef.current = null;
13763
13872
  isRowResizingGlobal.active = false;
@@ -13786,16 +13895,16 @@ function useUEditorTableInteractions(editor, editable = true) {
13786
13895
  const activeTableCellRef = useRef6(null);
13787
13896
  const suppressActiveCellHighlightRef = useRef6(false);
13788
13897
  const tableLayoutSyncFrameRef = useRef6(null);
13789
- const getProseMirrorElement = React13.useCallback(() => {
13898
+ const getProseMirrorElement = React14.useCallback(() => {
13790
13899
  return editorContentRef.current?.querySelector(".ProseMirror");
13791
13900
  }, []);
13792
- const setEditorResizeCursor = React13.useCallback((cursor) => {
13901
+ const setEditorResizeCursor = React14.useCallback((cursor) => {
13793
13902
  const proseMirror = getProseMirrorElement();
13794
13903
  if (proseMirror) {
13795
13904
  proseMirror.style.cursor = cursor;
13796
13905
  }
13797
13906
  }, [getProseMirrorElement]);
13798
- const hideColumnGuide = React13.useCallback(() => {
13907
+ const hideColumnGuide = React14.useCallback(() => {
13799
13908
  editorContentRef.current?.classList.remove("resize-cursor");
13800
13909
  getProseMirrorElement()?.classList.remove("resize-cursor");
13801
13910
  const guide = tableColumnGuideRef.current;
@@ -13803,7 +13912,7 @@ function useUEditorTableInteractions(editor, editable = true) {
13803
13912
  guide.style.opacity = "0";
13804
13913
  }
13805
13914
  }, [getProseMirrorElement]);
13806
- const hideRowGuide = React13.useCallback(() => {
13915
+ const hideRowGuide = React14.useCallback(() => {
13807
13916
  editorContentRef.current?.classList.remove("resize-row-cursor");
13808
13917
  getProseMirrorElement()?.classList.remove("resize-row-cursor");
13809
13918
  const guide = tableRowGuideRef.current;
@@ -13813,21 +13922,21 @@ function useUEditorTableInteractions(editor, editable = true) {
13813
13922
  }, [getProseMirrorElement]);
13814
13923
  const hotspotTimerRef = useRef6(null);
13815
13924
  const activeHotspotKeyRef = useRef6(null);
13816
- const clearHotspotTimer = React13.useCallback(() => {
13925
+ const clearHotspotTimer = React14.useCallback(() => {
13817
13926
  if (hotspotTimerRef.current !== null) {
13818
13927
  const realm = editorContentRef.current?.ownerDocument.defaultView;
13819
13928
  realm?.clearTimeout(hotspotTimerRef.current);
13820
13929
  hotspotTimerRef.current = null;
13821
13930
  }
13822
13931
  }, []);
13823
- const clearAllTableResizeHover = React13.useCallback(() => {
13932
+ const clearAllTableResizeHover = React14.useCallback(() => {
13824
13933
  clearHotspotTimer();
13825
13934
  activeHotspotKeyRef.current = null;
13826
13935
  setEditorResizeCursor("");
13827
13936
  hideColumnGuide();
13828
13937
  hideRowGuide();
13829
13938
  }, [clearHotspotTimer, hideColumnGuide, hideRowGuide, setEditorResizeCursor]);
13830
- const updateActiveCellHighlight = React13.useCallback((cell) => {
13939
+ const updateActiveCellHighlight = React14.useCallback((cell) => {
13831
13940
  const surface = editorContentRef.current;
13832
13941
  const highlight = activeTableCellHighlightRef.current;
13833
13942
  if (!highlight) return;
@@ -13842,7 +13951,7 @@ function useUEditorTableInteractions(editor, editable = true) {
13842
13951
  highlight.style.width = `${metrics.width}px`;
13843
13952
  highlight.style.height = `${metrics.height}px`;
13844
13953
  }, []);
13845
- const scheduleTableLayoutSync = React13.useCallback(() => {
13954
+ const scheduleTableLayoutSync = React14.useCallback(() => {
13846
13955
  if (!activeTableCellRef.current || tableLayoutSyncFrameRef.current !== null) return;
13847
13956
  const realm = editorContentRef.current?.ownerDocument.defaultView;
13848
13957
  if (!realm) return;
@@ -13854,7 +13963,7 @@ function useUEditorTableInteractions(editor, editable = true) {
13854
13963
  editorContentRef.current?.dispatchEvent(new realm.CustomEvent(UEDITOR_TABLE_LAYOUT_CHANGE_EVENT));
13855
13964
  });
13856
13965
  }, [updateActiveCellHighlight]);
13857
- const setActiveTableCell = React13.useCallback((cell) => {
13966
+ const setActiveTableCell = React14.useCallback((cell) => {
13858
13967
  if (activeTableCellRef.current === cell) {
13859
13968
  updateActiveCellHighlight(cell);
13860
13969
  return;
@@ -13862,17 +13971,17 @@ function useUEditorTableInteractions(editor, editable = true) {
13862
13971
  activeTableCellRef.current = cell;
13863
13972
  updateActiveCellHighlight(activeTableCellRef.current);
13864
13973
  }, [updateActiveCellHighlight]);
13865
- const clearActiveTableCell = React13.useCallback(() => {
13974
+ const clearActiveTableCell = React14.useCallback(() => {
13866
13975
  activeTableCellRef.current = null;
13867
13976
  updateActiveCellHighlight(null);
13868
13977
  }, [updateActiveCellHighlight]);
13869
- const setHoveredTableCell = React13.useCallback((cell) => {
13978
+ const setHoveredTableCell = React14.useCallback((cell) => {
13870
13979
  hoveredTableCellRef.current = cell;
13871
13980
  }, []);
13872
- const clearHoveredTableCell = React13.useCallback(() => {
13981
+ const clearHoveredTableCell = React14.useCallback(() => {
13873
13982
  hoveredTableCellRef.current = null;
13874
13983
  }, []);
13875
- const showColumnGuide = React13.useCallback((table, row, cell) => {
13984
+ const showColumnGuide = React14.useCallback((table, row, cell) => {
13876
13985
  const surface = editorContentRef.current;
13877
13986
  const guide = tableColumnGuideRef.current;
13878
13987
  if (!surface || !guide) return;
@@ -13886,7 +13995,7 @@ function useUEditorTableInteractions(editor, editable = true) {
13886
13995
  getProseMirrorElement()?.classList.add("resize-cursor");
13887
13996
  setEditorResizeCursor("col-resize");
13888
13997
  }, [getProseMirrorElement, setEditorResizeCursor]);
13889
- const showRowGuide = React13.useCallback((table, row, cell, previewHeight) => {
13998
+ const showRowGuide = React14.useCallback((table, row, cell, previewHeight) => {
13890
13999
  const surface = editorContentRef.current;
13891
14000
  const guide = tableRowGuideRef.current;
13892
14001
  if (!surface || !guide) return;
@@ -13918,7 +14027,7 @@ function useUEditorTableInteractions(editor, editable = true) {
13918
14027
  clearAllTableResizeHover,
13919
14028
  scheduleTableLayoutSync
13920
14029
  });
13921
- const syncActiveTableCellFromSelection = React13.useCallback(() => {
14030
+ const syncActiveTableCellFromSelection = React14.useCallback(() => {
13922
14031
  if (!editor) return;
13923
14032
  if (!editor.isFocused) {
13924
14033
  clearActiveTableCell();
@@ -14655,7 +14764,7 @@ function useFormulaCoordinateOverlay(editor, containerRef, labels) {
14655
14764
  import { useEffect as useEffect8, useRef as useRef8, useState as useState6 } from "react";
14656
14765
  import { useEditorState as useEditorState2 } from "@tiptap/react";
14657
14766
  import { AlertCircle as AlertCircle2, Check as Check3, Hash, Sigma as Sigma3, Trash2 as Trash23 } from "lucide-react";
14658
- import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
14767
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
14659
14768
  function TableFormulaBar({ editor }) {
14660
14769
  const t = useSmartTranslations("UEditor");
14661
14770
  const inputRef = useRef8(null);
@@ -14726,7 +14835,7 @@ function TableFormulaBar({ editor }) {
14726
14835
  "aria-label": t("tableMenu.formulaBar"),
14727
14836
  className: "flex min-h-10 items-center gap-2 border-b border-border/60 bg-muted/25 px-2 py-1.5",
14728
14837
  children: [
14729
- /* @__PURE__ */ jsx19(
14838
+ /* @__PURE__ */ jsx20(
14730
14839
  "span",
14731
14840
  {
14732
14841
  "data-ueditor-formula-cell-label": "",
@@ -14734,8 +14843,8 @@ function TableFormulaBar({ editor }) {
14734
14843
  children: selectedCell.label
14735
14844
  }
14736
14845
  ),
14737
- /* @__PURE__ */ jsx19(Sigma3, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
14738
- /* @__PURE__ */ jsx19(
14846
+ /* @__PURE__ */ jsx20(Sigma3, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-primary" }),
14847
+ /* @__PURE__ */ jsx20(
14739
14848
  "input",
14740
14849
  {
14741
14850
  ref: inputRef,
@@ -14762,12 +14871,12 @@ function TableFormulaBar({ editor }) {
14762
14871
  role: "status",
14763
14872
  className: "hidden shrink-0 items-center gap-1 text-xs font-medium text-destructive sm:inline-flex",
14764
14873
  children: [
14765
- /* @__PURE__ */ jsx19(AlertCircle2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
14874
+ /* @__PURE__ */ jsx20(AlertCircle2, { "aria-hidden": "true", className: "h-3.5 w-3.5" }),
14766
14875
  t("tableMenu.formulaError")
14767
14876
  ]
14768
14877
  }
14769
14878
  ),
14770
- /* @__PURE__ */ jsx19(
14879
+ /* @__PURE__ */ jsx20(
14771
14880
  "button",
14772
14881
  {
14773
14882
  type: "button",
@@ -14775,10 +14884,10 @@ function TableFormulaBar({ editor }) {
14775
14884
  "aria-label": t("tableMenu.apply"),
14776
14885
  title: t("tableMenu.apply"),
14777
14886
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground transition-colors hover:bg-primary/90",
14778
- children: /* @__PURE__ */ jsx19(Check3, { "aria-hidden": "true", className: "h-4 w-4" })
14887
+ children: /* @__PURE__ */ jsx20(Check3, { "aria-hidden": "true", className: "h-4 w-4" })
14779
14888
  }
14780
14889
  ),
14781
- /* @__PURE__ */ jsx19(
14890
+ /* @__PURE__ */ jsx20(
14782
14891
  "button",
14783
14892
  {
14784
14893
  type: "button",
@@ -14789,10 +14898,10 @@ function TableFormulaBar({ editor }) {
14789
14898
  "aria-label": t("tableMenu.convertToValue"),
14790
14899
  title: t("tableMenu.convertToValue"),
14791
14900
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border/60 bg-background text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
14792
- children: /* @__PURE__ */ jsx19(Hash, { "aria-hidden": "true", className: "h-4 w-4" })
14901
+ children: /* @__PURE__ */ jsx20(Hash, { "aria-hidden": "true", className: "h-4 w-4" })
14793
14902
  }
14794
14903
  ),
14795
- /* @__PURE__ */ jsx19(
14904
+ /* @__PURE__ */ jsx20(
14796
14905
  "button",
14797
14906
  {
14798
14907
  type: "button",
@@ -14803,7 +14912,7 @@ function TableFormulaBar({ editor }) {
14803
14912
  "aria-label": t("tableMenu.clearCell"),
14804
14913
  title: t("tableMenu.clearCell"),
14805
14914
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-destructive/30 bg-background text-destructive transition-colors hover:bg-destructive/10",
14806
- children: /* @__PURE__ */ jsx19(Trash23, { "aria-hidden": "true", className: "h-4 w-4" })
14915
+ children: /* @__PURE__ */ jsx20(Trash23, { "aria-hidden": "true", className: "h-4 w-4" })
14807
14916
  }
14808
14917
  )
14809
14918
  ]
@@ -14812,7 +14921,7 @@ function TableFormulaBar({ editor }) {
14812
14921
  }
14813
14922
 
14814
14923
  // src/components/UEditor/use-editor-output.ts
14815
- import * as React15 from "react";
14924
+ import * as React16 from "react";
14816
14925
  function normalizeDebounceMs(value) {
14817
14926
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
14818
14927
  }
@@ -14822,18 +14931,18 @@ function useUEditorOutput({
14822
14931
  onJsonChange,
14823
14932
  outputDebounceMs
14824
14933
  }) {
14825
- const callbacksRef = React15.useRef({
14934
+ const callbacksRef = React16.useRef({
14826
14935
  onChange,
14827
14936
  onHtmlChange,
14828
14937
  onJsonChange
14829
14938
  });
14830
- const pendingEditorRef = React15.useRef(null);
14831
- const timeoutRef = React15.useRef(null);
14939
+ const pendingEditorRef = React16.useRef(null);
14940
+ const timeoutRef = React16.useRef(null);
14832
14941
  const debounceMs = normalizeDebounceMs(outputDebounceMs);
14833
- React15.useLayoutEffect(() => {
14942
+ React16.useLayoutEffect(() => {
14834
14943
  callbacksRef.current = { onChange, onHtmlChange, onJsonChange };
14835
14944
  }, [onChange, onHtmlChange, onJsonChange]);
14836
- const flushOutputUpdates = React15.useCallback(() => {
14945
+ const flushOutputUpdates = React16.useCallback(() => {
14837
14946
  if (timeoutRef.current !== null) {
14838
14947
  clearTimeout(timeoutRef.current);
14839
14948
  timeoutRef.current = null;
@@ -14851,7 +14960,7 @@ function useUEditorOutput({
14851
14960
  callbacks.onJsonChange(editor.getJSON());
14852
14961
  }
14853
14962
  }, []);
14854
- const scheduleOutputUpdate = React15.useCallback((editor) => {
14963
+ const scheduleOutputUpdate = React16.useCallback((editor) => {
14855
14964
  const callbacks = callbacksRef.current;
14856
14965
  if (!callbacks.onChange && !callbacks.onHtmlChange && !callbacks.onJsonChange) return;
14857
14966
  pendingEditorRef.current = editor;
@@ -14865,13 +14974,13 @@ function useUEditorOutput({
14865
14974
  }
14866
14975
  timeoutRef.current = setTimeout(flushOutputUpdates, debounceMs);
14867
14976
  }, [debounceMs, flushOutputUpdates]);
14868
- React15.useEffect(() => {
14977
+ React16.useEffect(() => {
14869
14978
  if (!pendingEditorRef.current || timeoutRef.current === null) return;
14870
14979
  clearTimeout(timeoutRef.current);
14871
14980
  timeoutRef.current = debounceMs === 0 ? null : setTimeout(flushOutputUpdates, debounceMs);
14872
14981
  if (debounceMs === 0) flushOutputUpdates();
14873
14982
  }, [debounceMs, flushOutputUpdates]);
14874
- React15.useEffect(() => () => {
14983
+ React16.useEffect(() => () => {
14875
14984
  flushOutputUpdates();
14876
14985
  if (timeoutRef.current !== null) {
14877
14986
  clearTimeout(timeoutRef.current);
@@ -14886,12 +14995,12 @@ function useUEditorOutput({
14886
14995
  }
14887
14996
 
14888
14997
  // src/components/UEditor/UEditor.tsx
14889
- import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
14890
- var LazyMenuBar = React16.lazy(async () => {
14891
- const { MenuBar } = await import("./menu-bar-MUISXLMR.js");
14998
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
14999
+ var LazyMenuBar = React17.lazy(async () => {
15000
+ const { MenuBar } = await import("./menu-bar-MX3LXG6T.js");
14892
15001
  return { default: MenuBar };
14893
15002
  });
14894
- var UEditor = React16.forwardRef(({
15003
+ var UEditor = React17.forwardRef(({
14895
15004
  getPortalContainer,
14896
15005
  content = "",
14897
15006
  onChange,
@@ -14952,8 +15061,8 @@ var UEditor = React16.forwardRef(({
14952
15061
  const editorInstanceRef = useRef10(null);
14953
15062
  const formulaRangePickRef = useRef10(null);
14954
15063
  const formulaRangeSurfaceRef = useRef10(null);
14955
- const [formulaRangeHighlight, setFormulaRangeHighlight] = React16.useState(null);
14956
- const [isMenuBarVisible, setIsMenuBarVisible] = React16.useState(showMenuBar);
15064
+ const [formulaRangeHighlight, setFormulaRangeHighlight] = React17.useState(null);
15065
+ const [isMenuBarVisible, setIsMenuBarVisible] = React17.useState(showMenuBar);
14957
15066
  useEffect10(() => {
14958
15067
  setIsMenuBarVisible(showMenuBar);
14959
15068
  }, [showMenuBar]);
@@ -14963,7 +15072,7 @@ var UEditor = React16.forwardRef(({
14963
15072
  onJsonChange,
14964
15073
  outputDebounceMs
14965
15074
  });
14966
- const scheduleFormulaRecalculate = React16.useCallback((editor2, options) => {
15075
+ const scheduleFormulaRecalculate = React17.useCallback((editor2, options) => {
14967
15076
  if (editor2.isDestroyed || scheduledFormulaRecalculateRef.current) return;
14968
15077
  if (!options?.force && isEditingTableFormulaText(editor2)) return;
14969
15078
  scheduledFormulaRecalculateRef.current = true;
@@ -15005,7 +15114,7 @@ var UEditor = React16.forwardRef(({
15005
15114
  ],
15006
15115
  [getPortalContainer, effectivePlaceholder, t, maxCharacters, uploadImage, resolvedUploadFile, imageInsertMode, maxImageFileSize, allowedImageMimeTypes, fallbackToDataUrl, onImageUploadError, editable, fetchMetadata, extraExtensions]
15007
15116
  );
15008
- const syncFormulaRangeHighlight = React16.useCallback((pickState) => {
15117
+ const syncFormulaRangeHighlight = React17.useCallback((pickState) => {
15009
15118
  const container = formulaRangeSurfaceRef.current;
15010
15119
  setFormulaRangeHighlight(container && pickState ? getFormulaRangePickHighlight(container, pickState) : null);
15011
15120
  }, []);
@@ -15202,7 +15311,7 @@ var UEditor = React16.forwardRef(({
15202
15311
  }
15203
15312
  }, [content, editor]);
15204
15313
  if (!editor) {
15205
- return /* @__PURE__ */ jsx20(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ jsx20(
15314
+ return /* @__PURE__ */ jsx21(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ jsx21(
15206
15315
  "div",
15207
15316
  {
15208
15317
  role: "status",
@@ -15213,7 +15322,7 @@ var UEditor = React16.forwardRef(({
15213
15322
  }
15214
15323
  ) });
15215
15324
  }
15216
- return /* @__PURE__ */ jsx20(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ jsx20("div", { "data-ueditor-width-boundary": "", className: "w-full", children: /* @__PURE__ */ jsxs17(
15325
+ return /* @__PURE__ */ jsx21(UEditorPortalProvider, { getPortalContainer, children: /* @__PURE__ */ jsx21("div", { "data-ueditor-width-boundary": "", className: "w-full", children: /* @__PURE__ */ jsxs17(
15217
15326
  "div",
15218
15327
  {
15219
15328
  className: cn(
@@ -15230,7 +15339,7 @@ var UEditor = React16.forwardRef(({
15230
15339
  ),
15231
15340
  children: [
15232
15341
  editable && (showMenuBar || showToolbar || showBubbleMenu) ? /* @__PURE__ */ jsxs17(EditorUiRenderStateProvider, { editor, children: [
15233
- isMenuBarVisible && /* @__PURE__ */ jsx20(React16.Suspense, { fallback: null, children: /* @__PURE__ */ jsx20(
15342
+ isMenuBarVisible && /* @__PURE__ */ jsx21(React17.Suspense, { fallback: null, children: /* @__PURE__ */ jsx21(
15234
15343
  LazyMenuBar,
15235
15344
  {
15236
15345
  editor,
@@ -15248,7 +15357,7 @@ var UEditor = React16.forwardRef(({
15248
15357
  showPreviewButton
15249
15358
  }
15250
15359
  ) }),
15251
- showToolbar && /* @__PURE__ */ jsx20(
15360
+ showToolbar && /* @__PURE__ */ jsx21(
15252
15361
  EditorToolbar,
15253
15362
  {
15254
15363
  editor,
@@ -15268,8 +15377,8 @@ var UEditor = React16.forwardRef(({
15268
15377
  letterSpacings
15269
15378
  }
15270
15379
  ),
15271
- /* @__PURE__ */ jsx20(TableFormulaBar, { editor }),
15272
- showBubbleMenu && /* @__PURE__ */ jsx20(
15380
+ /* @__PURE__ */ jsx21(TableFormulaBar, { editor }),
15381
+ showBubbleMenu && /* @__PURE__ */ jsx21(
15273
15382
  CustomBubbleMenu,
15274
15383
  {
15275
15384
  editor,
@@ -15278,8 +15387,8 @@ var UEditor = React16.forwardRef(({
15278
15387
  lineHeights
15279
15388
  }
15280
15389
  )
15281
- ] }) : editable ? /* @__PURE__ */ jsx20(TableFormulaBar, { editor }) : null,
15282
- editable && showFloatingMenu && /* @__PURE__ */ jsx20(CustomFloatingMenu, { editor }),
15390
+ ] }) : editable ? /* @__PURE__ */ jsx21(TableFormulaBar, { editor }) : null,
15391
+ editable && showFloatingMenu && /* @__PURE__ */ jsx21(CustomFloatingMenu, { editor }),
15283
15392
  /* @__PURE__ */ jsxs17(
15284
15393
  "div",
15285
15394
  {
@@ -15298,7 +15407,7 @@ var UEditor = React16.forwardRef(({
15298
15407
  "--ueditor-table-cell-padding-x": `${resolvedTableCellHorizontalPadding}px`
15299
15408
  },
15300
15409
  children: [
15301
- /* @__PURE__ */ jsx20(
15410
+ /* @__PURE__ */ jsx21(
15302
15411
  "span",
15303
15412
  {
15304
15413
  ref: tableColumnGuideRef,
@@ -15306,7 +15415,7 @@ var UEditor = React16.forwardRef(({
15306
15415
  className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
15307
15416
  }
15308
15417
  ),
15309
- /* @__PURE__ */ jsx20(
15418
+ /* @__PURE__ */ jsx21(
15310
15419
  "span",
15311
15420
  {
15312
15421
  ref: tableRowGuideRef,
@@ -15314,7 +15423,7 @@ var UEditor = React16.forwardRef(({
15314
15423
  className: "pointer-events-none absolute z-20 bg-primary/50 opacity-0 transition-opacity duration-200 delay-100 ease-out"
15315
15424
  }
15316
15425
  ),
15317
- /* @__PURE__ */ jsx20(
15426
+ /* @__PURE__ */ jsx21(
15318
15427
  "span",
15319
15428
  {
15320
15429
  ref: activeTableCellHighlightRef,
@@ -15323,7 +15432,7 @@ var UEditor = React16.forwardRef(({
15323
15432
  className: "pointer-events-none hidden absolute z-20 rounded-[2px] border border-primary/50 bg-primary/5"
15324
15433
  }
15325
15434
  ),
15326
- /* @__PURE__ */ jsx20(
15435
+ /* @__PURE__ */ jsx21(
15327
15436
  "div",
15328
15437
  {
15329
15438
  ref: formulaCoordinateOverlayRef,
@@ -15331,7 +15440,7 @@ var UEditor = React16.forwardRef(({
15331
15440
  className: "pointer-events-none absolute inset-0 z-[35] hidden overflow-visible"
15332
15441
  }
15333
15442
  ),
15334
- formulaRangeHighlight && /* @__PURE__ */ jsx20(
15443
+ formulaRangeHighlight && /* @__PURE__ */ jsx21(
15335
15444
  "span",
15336
15445
  {
15337
15446
  "aria-hidden": "true",
@@ -15349,7 +15458,7 @@ var UEditor = React16.forwardRef(({
15349
15458
  }
15350
15459
  }
15351
15460
  ),
15352
- editable && /* @__PURE__ */ jsx20(
15461
+ editable && /* @__PURE__ */ jsx21(
15353
15462
  TableControls,
15354
15463
  {
15355
15464
  editor,
@@ -15357,7 +15466,7 @@ var UEditor = React16.forwardRef(({
15357
15466
  showCellInspector: showBubbleMenu
15358
15467
  }
15359
15468
  ),
15360
- /* @__PURE__ */ jsx20(
15469
+ /* @__PURE__ */ jsx21(
15361
15470
  EditorContent,
15362
15471
  {
15363
15472
  editor,
@@ -15367,7 +15476,7 @@ var UEditor = React16.forwardRef(({
15367
15476
  ]
15368
15477
  }
15369
15478
  ),
15370
- showFooter && showCharacterCount && /* @__PURE__ */ jsx20(CharacterCountDisplay, { editor, maxCharacters })
15479
+ showFooter && showCharacterCount && /* @__PURE__ */ jsx21(CharacterCountDisplay, { editor, maxCharacters })
15371
15480
  ]
15372
15481
  }
15373
15482
  ) }) });
@@ -15382,4 +15491,4 @@ export {
15382
15491
  prepareUEditorContentForSave,
15383
15492
  UEditor_default
15384
15493
  };
15385
- //# sourceMappingURL=chunk-H4AVZA4K.js.map
15494
+ //# sourceMappingURL=chunk-SCW2XGCE.js.map