@underverse-ui/underverse 1.0.162 → 1.0.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -779,7 +779,11 @@ var en_default = {
779
779
  bookmark: "Bookmark Card",
780
780
  bookmarkDesc: "Embed a link as a bookmark card",
781
781
  fileCard: "File Attachment",
782
- fileCardDesc: "Upload a file card attachment"
782
+ fileCardDesc: "Upload a file card attachment",
783
+ formCheckbox: "Form Checkbox",
784
+ formCheckboxDesc: "Insert an interactive checkbox field",
785
+ formRadio: "Form Radio Button",
786
+ formRadioDesc: "Insert an interactive radio button field"
783
787
  },
784
788
  floatingMenu: {
785
789
  addBlock: "Add block"
@@ -862,12 +866,20 @@ var en_default = {
862
866
  apply: "Apply",
863
867
  clear: "Clear",
864
868
  recalculate: "Recalculate",
865
- done: "Done"
869
+ done: "Done",
870
+ alignVertical: "Vertical Alignment",
871
+ alignVerticalTop: "Top Align",
872
+ alignVerticalMiddle: "Middle Align",
873
+ alignVerticalBottom: "Bottom Align"
866
874
  },
867
875
  callout: {
868
876
  selectEmoji: "Select Emoji",
869
877
  backgroundColor: "Background Color"
870
878
  },
879
+ radio: {
880
+ groupName: "Group Name",
881
+ editGroup: "Edit Group Name"
882
+ },
871
883
  bookmark: {
872
884
  clickToOpenNewTab: "Click to open this link in a new tab.",
873
885
  clickToOpenLink: "Click to open link.",
@@ -952,6 +964,9 @@ var en_default = {
952
964
  mergeCells: "Merge cells",
953
965
  splitCell: "Split cell",
954
966
  imageUpload: "Upload Image",
967
+ formFields: "Form Fields",
968
+ formCheckbox: "Form Checkbox",
969
+ formRadio: "Form Radio Button",
955
970
  applySource: "Apply",
956
971
  closeDialog: "Close",
957
972
  copyHtml: "Copy HTML",
@@ -1177,7 +1192,11 @@ var vi_default = {
1177
1192
  bookmark: "Th\u1EBB li\xEAn k\u1EBFt",
1178
1193
  bookmarkDesc: "Nh\xFAng m\u1ED9t li\xEAn k\u1EBFt d\u01B0\u1EDBi d\u1EA1ng th\u1EBB xem tr\u01B0\u1EDBc",
1179
1194
  fileCard: "T\u1EC7p \u0111\xEDnh k\xE8m",
1180
- fileCardDesc: "T\u1EA3i l\xEAn t\u1EC7p tin \u0111\xEDnh k\xE8m"
1195
+ fileCardDesc: "T\u1EA3i l\xEAn t\u1EC7p tin \u0111\xEDnh k\xE8m",
1196
+ formCheckbox: "Checkbox bi\u1EC3u m\u1EABu",
1197
+ formCheckboxDesc: "Th\xEAm \xF4 checkbox bi\u1EC3u m\u1EABu",
1198
+ formRadio: "Radio bi\u1EC3u m\u1EABu",
1199
+ formRadioDesc: "Th\xEAm n\xFAt ch\u1ECDn m\u1ED9t (Radio) bi\u1EC3u m\u1EABu"
1181
1200
  },
1182
1201
  floatingMenu: {
1183
1202
  addBlock: "Th\xEAm kh\u1ED1i"
@@ -1260,12 +1279,20 @@ var vi_default = {
1260
1279
  apply: "\xC1p d\u1EE5ng",
1261
1280
  clear: "X\xF3a",
1262
1281
  recalculate: "T\xEDnh l\u1EA1i",
1263
- done: "Xong"
1282
+ done: "Xong",
1283
+ alignVertical: "C\u0103n l\u1EC1 d\u1ECDc",
1284
+ alignVerticalTop: "C\u0103n tr\xEAn",
1285
+ alignVerticalMiddle: "C\u0103n gi\u1EEFa",
1286
+ alignVerticalBottom: "C\u0103n d\u01B0\u1EDBi"
1264
1287
  },
1265
1288
  callout: {
1266
1289
  selectEmoji: "Ch\u1ECDn Bi\u1EC3u t\u01B0\u1EE3ng",
1267
1290
  backgroundColor: "M\xE0u n\u1EC1n"
1268
1291
  },
1292
+ radio: {
1293
+ groupName: "T\xEAn nh\xF3m",
1294
+ editGroup: "S\u1EEDa t\xEAn nh\xF3m"
1295
+ },
1269
1296
  bookmark: {
1270
1297
  clickToOpenNewTab: "B\u1EA5m \u0111\u1EC3 m\u1EDF li\xEAn k\u1EBFt n\xE0y trong tab m\u1EDBi.",
1271
1298
  clickToOpenLink: "B\u1EA5m \u0111\u1EC3 m\u1EDF li\xEAn k\u1EBFt.",
@@ -1350,6 +1377,9 @@ var vi_default = {
1350
1377
  mergeCells: "G\u1ED9p \xF4",
1351
1378
  splitCell: "T\xE1ch \xF4",
1352
1379
  imageUpload: "T\u1EA3i \u1EA3nh l\xEAn",
1380
+ formFields: "Tr\u01B0\u1EDDng bi\u1EC3u m\u1EABu",
1381
+ formCheckbox: "Checkbox bi\u1EC3u m\u1EABu",
1382
+ formRadio: "N\xFAt ch\u1ECDn m\u1ED9t (Radio)",
1353
1383
  applySource: "\xC1p d\u1EE5ng",
1354
1384
  closeDialog: "\u0110\xF3ng",
1355
1385
  copyHtml: "Sao ch\xE9p HTML",
@@ -1575,7 +1605,11 @@ var ko_default = {
1575
1605
  bookmark: "\uBD81\uB9C8\uD06C \uCE74\uB4DC",
1576
1606
  bookmarkDesc: "\uB9C1\uD06C\uB97C \uBD81\uB9C8\uD06C \uCE74\uB4DC\uB85C \uC0BD\uC785\uD569\uB2C8\uB2E4",
1577
1607
  fileCard: "\uD30C\uC77C \uCCA8\uBD80",
1578
- fileCardDesc: "\uD30C\uC77C \uCE74\uB4DC \uCCA8\uBD80 \uD30C\uC77C\uC744 \uC5C5\uB85C\uB4DC\uD569\uB2C8\uB2E4"
1608
+ fileCardDesc: "\uD30C\uC77C \uCE74\uB4DC \uCCA8\uBD80 \uD30C\uC77C\uC744 \uC5C5\uB85C\uB4DC\uD569\uB2C8\uB2E4",
1609
+ formCheckbox: "\uC591\uC2DD \uCCB4\uD06C\uBC15\uC2A4",
1610
+ formCheckboxDesc: "\uB300\uD654\uD615 \uCCB4\uD06C\uBC15\uC2A4 \uD544\uB4DC \uC0BD\uC785",
1611
+ formRadio: "\uC591\uC2DD \uB77C\uB514\uC624 \uBC84\uD2BC",
1612
+ formRadioDesc: "\uB300\uD654\uD615 \uB77C\uB514\uC624 \uBC84\uD2BC \uD544\uB4DC \uC0BD\uC785"
1579
1613
  },
1580
1614
  floatingMenu: {
1581
1615
  addBlock: "\uBE14\uB85D \uCD94\uAC00"
@@ -1658,12 +1692,20 @@ var ko_default = {
1658
1692
  apply: "\uC801\uC6A9",
1659
1693
  clear: "\uC9C0\uC6B0\uAE30",
1660
1694
  recalculate: "\uB2E4\uC2DC \uACC4\uC0B0",
1661
- done: "\uC644\uB8CC"
1695
+ done: "\uC644\uB8CC",
1696
+ alignVertical: "\uC138\uB85C \uB9DE\uCDA4",
1697
+ alignVerticalTop: "\uC704\uCABD \uB9DE\uCDA4",
1698
+ alignVerticalMiddle: "\uAC00\uC6B4\uB370 \uB9DE\uCDA4",
1699
+ alignVerticalBottom: "\uC544\uB798\uCABD \uB9DE\uCDA4"
1662
1700
  },
1663
1701
  callout: {
1664
1702
  selectEmoji: "\uC774\uBAA8\uC9C0 \uC120\uD0DD",
1665
1703
  backgroundColor: "\uBC30\uACBD \uC0C9\uC0C1"
1666
1704
  },
1705
+ radio: {
1706
+ groupName: "\uADF8\uB8F9 \uC774\uB984",
1707
+ editGroup: "\uADF8\uB8F9 \uC774\uB984 \uD3B8\uC9D1"
1708
+ },
1667
1709
  bookmark: {
1668
1710
  clickToOpenNewTab: "\uD074\uB9AD\uD558\uC5EC \uC774 \uB9C1\uD06C\uB97C \uC0C8 \uD0ED\uC5D0\uC11C \uC5FD\uB2C8\uB2E4.",
1669
1711
  clickToOpenLink: "\uD074\uB9AD\uD558\uC5EC \uB9C1\uD06C\uB97C \uC5FD\uB2C8\uB2E4.",
@@ -1748,6 +1790,9 @@ var ko_default = {
1748
1790
  mergeCells: "\uC140 \uBCD1\uD569",
1749
1791
  splitCell: "\uC140 \uBD84\uD560",
1750
1792
  imageUpload: "\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC",
1793
+ formFields: "\uC591\uC2DD \uD544\uB4DC",
1794
+ formCheckbox: "\uC591\uC2DD \uCCB4\uD06C\uBC15\uC2A4",
1795
+ formRadio: "\uC591\uC2DD \uB77C\uB514\uC624 \uBC84\uD2BC",
1751
1796
  applySource: "\uC801\uC6A9",
1752
1797
  closeDialog: "\uB2EB\uAE30",
1753
1798
  copyHtml: "HTML \uBCF5\uC0AC",
@@ -1973,7 +2018,11 @@ var ja_default = {
1973
2018
  bookmark: "\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF\u30AB\u30FC\u30C9",
1974
2019
  bookmarkDesc: "\u30EA\u30F3\u30AF\u3092\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF\u30AB\u30FC\u30C9\u3068\u3057\u3066\u57CB\u3081\u8FBC\u307F\u307E\u3059",
1975
2020
  fileCard: "\u30D5\u30A1\u30A4\u30EB\u6DFB\u4ED8",
1976
- fileCardDesc: "\u30D5\u30A1\u30A4\u30EB\u30AB\u30FC\u30C9\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u307E\u3059"
2021
+ fileCardDesc: "\u30D5\u30A1\u30A4\u30EB\u30AB\u30FC\u30C9\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u307E\u3059",
2022
+ formCheckbox: "\u30D5\u30A9\u30FC\u30E0\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9",
2023
+ formCheckboxDesc: "\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6\u306A\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9\u3092\u633F\u5165\u3057\u307E\u3059",
2024
+ formRadio: "\u30D5\u30A9\u30FC\u30E0\u30E9\u30B8\u30AA\u30DC\u30BF\u30F3",
2025
+ formRadioDesc: "\u30A4\u30F3\u30BF\u30E9\u30AF\u30C6\u30A3\u30D6\u306A\u30E9\u30B8\u30AA\u30DC\u30BF\u30F3\u3092\u633F\u5165\u3057\u307E\u3059"
1977
2026
  },
1978
2027
  floatingMenu: {
1979
2028
  addBlock: "\u30D6\u30ED\u30C3\u30AF\u3092\u8FFD\u52A0"
@@ -2056,12 +2105,20 @@ var ja_default = {
2056
2105
  apply: "\u9069\u7528",
2057
2106
  clear: "\u30AF\u30EA\u30A2",
2058
2107
  recalculate: "\u518D\u8A08\u7B97",
2059
- done: "\u5B8C\u4E86"
2108
+ done: "\u5B8C\u4E86",
2109
+ alignVertical: "\u5782\u76F4\u63C3\u3048",
2110
+ alignVerticalTop: "\u4E0A\u63C3\u3048",
2111
+ alignVerticalMiddle: "\u4E0A\u4E0B\u4E2D\u592E\u63C3\u3048",
2112
+ alignVerticalBottom: "\u4E0B\u63C3\u3048"
2060
2113
  },
2061
2114
  callout: {
2062
2115
  selectEmoji: "\u7D75\u6587\u5B57\u3092\u9078\u629E",
2063
2116
  backgroundColor: "\u80CC\u666F\u8272"
2064
2117
  },
2118
+ radio: {
2119
+ groupName: "\u30B0\u30EB\u30FC\u30D7\u540D",
2120
+ editGroup: "\u30B0\u30EB\u30FC\u30D7\u540D\u7DE8\u96C6"
2121
+ },
2065
2122
  bookmark: {
2066
2123
  clickToOpenNewTab: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u3053\u306E\u30EA\u30F3\u30AF\u3092\u65B0\u3057\u3044\u30BF\u30D6\u3067\u958B\u304F\u3002",
2067
2124
  clickToOpenLink: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30EA\u30F3\u30AF\u3092\u958B\u304F\u3002",
@@ -2146,6 +2203,9 @@ var ja_default = {
2146
2203
  mergeCells: "\u30BB\u30EB\u3092\u7D50\u5408",
2147
2204
  splitCell: "\u30BB\u30EB\u3092\u5206\u5272",
2148
2205
  imageUpload: "\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
2206
+ formFields: "\u30D5\u30A9\u30FC\u30E0\u30D5\u30A3\u30FC\u30EB\u30C9",
2207
+ formCheckbox: "\u30D5\u30A9\u30FC\u30E0\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9",
2208
+ formRadio: "\u30D5\u30A9\u30FC\u30E0\u30E9\u30B8\u30AA\u30DC\u30BF\u30F3",
2149
2209
  applySource: "\u9069\u7528",
2150
2210
  closeDialog: "\u9589\u3058\u308B",
2151
2211
  copyHtml: "HTML\u3092\u30B3\u30D4\u30FC",
@@ -7599,7 +7659,15 @@ var DropdownMenu = ({
7599
7659
  }) => {
7600
7660
  const [internalOpen, setInternalOpen] = useState17(false);
7601
7661
  const open = isOpen !== void 0 ? isOpen : internalOpen;
7602
- const setOpen = onOpenChange || setInternalOpen;
7662
+ const setOpen = React25.useCallback(
7663
+ (nextOpen) => {
7664
+ if (isOpen === void 0) {
7665
+ setInternalOpen(nextOpen);
7666
+ }
7667
+ onOpenChange?.(nextOpen);
7668
+ },
7669
+ [isOpen, onOpenChange]
7670
+ );
7603
7671
  const triggerRef = React25.useRef(null);
7604
7672
  const menuRef = React25.useRef(null);
7605
7673
  const itemsRef = React25.useRef([]);
@@ -22979,6 +23047,16 @@ function getHeaderBgColor(colorTag) {
22979
23047
  if (!rgb) return colorTag;
22980
23048
  return toRgba(rgb[0], rgb[1], rgb[2], 1);
22981
23049
  }
23050
+ function getReadableForeground(colorTag) {
23051
+ const rgb = parseColor(colorTag);
23052
+ if (!rgb) return void 0;
23053
+ const toLinear = (c) => {
23054
+ const s = c / 255;
23055
+ return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
23056
+ };
23057
+ const L = 0.2126 * toLinear(rgb[0]) + 0.7152 * toLinear(rgb[1]) + 0.0722 * toLinear(rgb[2]);
23058
+ return L > 0.5 ? "rgba(15, 23, 42, 0.92)" : "rgba(255, 255, 255, 0.95)";
23059
+ }
22982
23060
  function groupColumnsByColorTag(leafCols, colorGroups) {
22983
23061
  const groupsMap = /* @__PURE__ */ new Map();
22984
23062
  const ungrouped = [];
@@ -23040,7 +23118,8 @@ function DataTableHeader({
23040
23118
  getStickyHeaderClass,
23041
23119
  getStickyHeaderCellStyle,
23042
23120
  sortByLabel,
23043
- t
23121
+ t,
23122
+ columnColorGroups
23044
23123
  }) {
23045
23124
  const gi18n = useGlobalI18n();
23046
23125
  const renderFilterControl = React56.useCallback(
@@ -23189,7 +23268,7 @@ function DataTableHeader({
23189
23268
  title: gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
23190
23269
  className: cn(
23191
23270
  "p-1.5 rounded-lg transition-all duration-200 hover:bg-accent",
23192
- filters[col.key] ? "bg-accent text-primary" : "text-muted-foreground"
23271
+ filters[col.key] ? "bg-accent opacity-100" : "opacity-60 hover:opacity-100"
23193
23272
  ),
23194
23273
  "aria-label": gi18n.filterByColumn ? gi18n.filterByColumn(columnLabel) : `Filter by ${columnLabel}`,
23195
23274
  children: /* @__PURE__ */ jsx65(FilterIcon, { className: "w-4 h-4" })
@@ -23258,6 +23337,7 @@ function DataTableHeader({
23258
23337
  const showBorderLeft = columnDividers && cellIndex > 0 && !isAfterFixedLeft && !col.fixed;
23259
23338
  const isLastCell = cellIndex === row.length - 1;
23260
23339
  const headerBackgroundColor = isLeaf && col.colorTag ? getHeaderBgColor(col.colorTag) : "var(--muted)";
23340
+ const headerColor = isLeaf && col.colorTag ? columnColorGroups?.[col.colorTag]?.headerTextColor ?? getReadableForeground(col.colorTag) : void 0;
23261
23341
  return /* @__PURE__ */ jsxs53(
23262
23342
  TableHead,
23263
23343
  {
@@ -23267,6 +23347,7 @@ function DataTableHeader({
23267
23347
  style: {
23268
23348
  width: col.width,
23269
23349
  backgroundColor: headerBackgroundColor,
23350
+ color: headerColor,
23270
23351
  ...getStickyHeaderCellStyle(headerCell)
23271
23352
  },
23272
23353
  className: cn(
@@ -24314,7 +24395,8 @@ function DataTable({
24314
24395
  getStickyHeaderClass,
24315
24396
  getStickyHeaderCellStyle,
24316
24397
  sortByLabel: labels?.sortBy,
24317
- t
24398
+ t,
24399
+ columnColorGroups
24318
24400
  }
24319
24401
  ) }),
24320
24402
  /* @__PURE__ */ jsx68(
@@ -24853,7 +24935,7 @@ import React83, { useEffect as useEffect38, useImperativeHandle as useImperative
24853
24935
  import { useEditor, EditorContent } from "@tiptap/react";
24854
24936
 
24855
24937
  // src/components/UEditor/extensions.ts
24856
- import { mergeAttributes as mergeAttributes5 } from "@tiptap/core";
24938
+ import { mergeAttributes as mergeAttributes7 } from "@tiptap/core";
24857
24939
  import Document from "@tiptap/extension-document";
24858
24940
  import Paragraph from "@tiptap/extension-paragraph";
24859
24941
  import Text from "@tiptap/extension-text";
@@ -24870,7 +24952,7 @@ import TaskItem from "@tiptap/extension-task-item";
24870
24952
  import Blockquote from "@tiptap/extension-blockquote";
24871
24953
  import Code from "@tiptap/extension-code";
24872
24954
  import { wrappingInputRule } from "@tiptap/core";
24873
- import { ReactNodeViewRenderer as ReactNodeViewRenderer5 } from "@tiptap/react";
24955
+ import { ReactNodeViewRenderer as ReactNodeViewRenderer7 } from "@tiptap/react";
24874
24956
 
24875
24957
  // src/components/UEditor/callout.ts
24876
24958
  import { Node as Node2, mergeAttributes } from "@tiptap/core";
@@ -25499,6 +25581,370 @@ var FileCard = Node4.create({
25499
25581
  }
25500
25582
  });
25501
25583
 
25584
+ // src/components/UEditor/form-checkbox.ts
25585
+ import { Node as Node5, mergeAttributes as mergeAttributes4 } from "@tiptap/core";
25586
+ import { ReactNodeViewRenderer as ReactNodeViewRenderer4 } from "@tiptap/react";
25587
+
25588
+ // src/components/UEditor/FormCheckboxView.tsx
25589
+ import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
25590
+ import { Check as Check10 } from "lucide-react";
25591
+ import { jsx as jsx79 } from "react/jsx-runtime";
25592
+ var FormCheckboxView = ({ node, updateAttributes, editor, selected }) => {
25593
+ const isChecked = !!node.attrs.checked;
25594
+ const isEditable = editor.isEditable;
25595
+ const handleToggle = (e) => {
25596
+ if (!isEditable) return;
25597
+ e.preventDefault();
25598
+ e.stopPropagation();
25599
+ updateAttributes({ checked: !isChecked });
25600
+ };
25601
+ const handleKeyDown2 = (e) => {
25602
+ if (e.key === " " || e.key === "Enter") {
25603
+ handleToggle(e);
25604
+ }
25605
+ };
25606
+ return /* @__PURE__ */ jsx79(
25607
+ NodeViewWrapper4,
25608
+ {
25609
+ as: "span",
25610
+ className: cn(
25611
+ "inline-flex items-center justify-center align-middle mx-1",
25612
+ isEditable ? "cursor-pointer select-none" : "cursor-default"
25613
+ ),
25614
+ children: /* @__PURE__ */ jsx79(
25615
+ "span",
25616
+ {
25617
+ role: "checkbox",
25618
+ "aria-checked": isChecked,
25619
+ tabIndex: isEditable ? 0 : -1,
25620
+ onClick: handleToggle,
25621
+ onKeyDown: handleKeyDown2,
25622
+ className: cn(
25623
+ "flex items-center justify-center w-5 h-5 rounded-md border text-primary-foreground transition-all duration-200 outline-none",
25624
+ isChecked ? "bg-primary border-primary scale-100" : "bg-background border-border/70 hover:border-primary/50",
25625
+ selected && "ring-2 ring-primary/30 ring-offset-1",
25626
+ isEditable && "focus-visible:ring-2 focus-visible:ring-primary/45 focus-visible:ring-offset-1 focus-visible:border-primary"
25627
+ ),
25628
+ children: /* @__PURE__ */ jsx79(
25629
+ "span",
25630
+ {
25631
+ className: cn(
25632
+ "transition-transform duration-200 ease-out-back",
25633
+ isChecked ? "scale-100 opacity-100" : "scale-50 opacity-0"
25634
+ ),
25635
+ children: /* @__PURE__ */ jsx79(Check10, { className: "w-3.5 h-3.5 stroke-[3px]" })
25636
+ }
25637
+ )
25638
+ }
25639
+ )
25640
+ }
25641
+ );
25642
+ };
25643
+
25644
+ // src/components/UEditor/form-checkbox.ts
25645
+ var FormCheckbox2 = Node5.create({
25646
+ name: "formCheckbox",
25647
+ group: "inline",
25648
+ inline: true,
25649
+ atom: true,
25650
+ addOptions() {
25651
+ return {
25652
+ HTMLAttributes: {}
25653
+ };
25654
+ },
25655
+ addAttributes() {
25656
+ return {
25657
+ checked: {
25658
+ default: false,
25659
+ parseHTML: (element) => {
25660
+ const checked = element.getAttribute("data-checked") || element.getAttribute("checked");
25661
+ if (checked === "true" || checked === "") return true;
25662
+ if (element instanceof HTMLInputElement) {
25663
+ return element.checked;
25664
+ }
25665
+ return false;
25666
+ },
25667
+ renderHTML: (attributes) => {
25668
+ if (!attributes.checked) return {};
25669
+ return {
25670
+ "data-checked": "true",
25671
+ checked: "checked"
25672
+ };
25673
+ }
25674
+ },
25675
+ id: {
25676
+ default: null,
25677
+ parseHTML: (element) => element.getAttribute("data-id") || element.getAttribute("id") || `chk-${Math.random().toString(36).substring(2, 9)}`,
25678
+ renderHTML: (attributes) => {
25679
+ if (!attributes.id) return {};
25680
+ return {
25681
+ "data-id": attributes.id,
25682
+ id: attributes.id
25683
+ };
25684
+ }
25685
+ },
25686
+ name: {
25687
+ default: "",
25688
+ parseHTML: (element) => element.getAttribute("name") || "",
25689
+ renderHTML: (attributes) => {
25690
+ if (!attributes.name) return {};
25691
+ return {
25692
+ name: attributes.name
25693
+ };
25694
+ }
25695
+ }
25696
+ };
25697
+ },
25698
+ parseHTML() {
25699
+ return [
25700
+ {
25701
+ tag: 'input[type="checkbox"][data-type="form-checkbox"]'
25702
+ },
25703
+ {
25704
+ tag: 'span[data-type="form-checkbox"]'
25705
+ }
25706
+ ];
25707
+ },
25708
+ renderHTML({ HTMLAttributes }) {
25709
+ return [
25710
+ "input",
25711
+ mergeAttributes4(this.options.HTMLAttributes, HTMLAttributes, {
25712
+ type: "checkbox",
25713
+ "data-type": "form-checkbox"
25714
+ })
25715
+ ];
25716
+ },
25717
+ addNodeView() {
25718
+ return ReactNodeViewRenderer4(FormCheckboxView);
25719
+ },
25720
+ addCommands() {
25721
+ return {
25722
+ setFormCheckbox: (attributes) => ({ commands }) => {
25723
+ return commands.insertContent({
25724
+ type: this.name,
25725
+ attrs: attributes
25726
+ });
25727
+ }
25728
+ };
25729
+ }
25730
+ });
25731
+
25732
+ // src/components/UEditor/form-radio.ts
25733
+ import { Node as Node6, mergeAttributes as mergeAttributes5 } from "@tiptap/core";
25734
+ import { ReactNodeViewRenderer as ReactNodeViewRenderer5 } from "@tiptap/react";
25735
+
25736
+ // src/components/UEditor/FormRadioView.tsx
25737
+ import { NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
25738
+ import { Settings } from "lucide-react";
25739
+ import { jsx as jsx80, jsxs as jsxs65 } from "react/jsx-runtime";
25740
+ var FormRadioView = ({ node, updateAttributes, editor, selected }) => {
25741
+ const t = useSmartTranslations("UEditor");
25742
+ const isChecked = !!node.attrs.checked;
25743
+ const isEditable = editor.isEditable;
25744
+ const groupName = node.attrs.name || "radio-group";
25745
+ const handleSelect = (e) => {
25746
+ e.preventDefault();
25747
+ e.stopPropagation();
25748
+ if (!isEditable) return;
25749
+ editor.commands.checkFormRadio(node.attrs.id);
25750
+ };
25751
+ const handleKeyDown2 = (e) => {
25752
+ if (e.key === " " || e.key === "Enter") {
25753
+ handleSelect(e);
25754
+ }
25755
+ };
25756
+ return /* @__PURE__ */ jsxs65(
25757
+ NodeViewWrapper5,
25758
+ {
25759
+ as: "span",
25760
+ className: cn(
25761
+ "inline-flex items-center justify-center align-middle mx-1 select-none",
25762
+ isEditable ? "cursor-pointer" : "cursor-default"
25763
+ ),
25764
+ children: [
25765
+ /* @__PURE__ */ jsx80(
25766
+ "span",
25767
+ {
25768
+ role: "radio",
25769
+ "aria-checked": isChecked,
25770
+ tabIndex: isEditable ? 0 : -1,
25771
+ onClick: handleSelect,
25772
+ onKeyDown: handleKeyDown2,
25773
+ className: cn(
25774
+ "flex items-center justify-center w-5 h-5 rounded-full border bg-background transition-all duration-200 outline-none",
25775
+ isChecked ? "border-primary scale-100" : "border-border/70 hover:border-primary/50",
25776
+ selected && "ring-2 ring-primary/30 ring-offset-1",
25777
+ isEditable && "focus-visible:ring-2 focus-visible:ring-primary/45 focus-visible:ring-offset-1 focus-visible:border-primary"
25778
+ ),
25779
+ children: /* @__PURE__ */ jsx80(
25780
+ "span",
25781
+ {
25782
+ className: cn(
25783
+ "w-2.5 h-2.5 rounded-full bg-primary transition-all duration-200 ease-out-back",
25784
+ isChecked ? "scale-100 opacity-100" : "scale-50 opacity-0"
25785
+ )
25786
+ }
25787
+ )
25788
+ }
25789
+ ),
25790
+ isEditable && selected && /* @__PURE__ */ jsx80("span", { className: "inline-flex items-center ml-0.5", contentEditable: false, children: /* @__PURE__ */ jsx80(
25791
+ Popover,
25792
+ {
25793
+ placement: "bottom-start",
25794
+ trigger: /* @__PURE__ */ jsx80(
25795
+ "button",
25796
+ {
25797
+ type: "button",
25798
+ className: "p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors outline-none cursor-pointer",
25799
+ title: t("radio.editGroup") || "Edit Group",
25800
+ children: /* @__PURE__ */ jsx80(Settings, { className: "w-3.5 h-3.5" })
25801
+ }
25802
+ ),
25803
+ children: /* @__PURE__ */ jsxs65("div", { className: "p-3 w-52 flex flex-col gap-2 bg-card border rounded-xl shadow-lg text-card-foreground", children: [
25804
+ /* @__PURE__ */ jsx80("label", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("radio.groupName") || "Group Name" }),
25805
+ /* @__PURE__ */ jsx80(
25806
+ "input",
25807
+ {
25808
+ type: "text",
25809
+ value: groupName,
25810
+ onChange: (e) => updateAttributes({ name: e.target.value }),
25811
+ className: "w-full text-sm px-2 py-1.5 border border-border/60 rounded-lg bg-background text-foreground focus:outline-none focus:ring-1 focus:ring-primary"
25812
+ }
25813
+ )
25814
+ ] })
25815
+ }
25816
+ ) })
25817
+ ]
25818
+ }
25819
+ );
25820
+ };
25821
+
25822
+ // src/components/UEditor/form-radio.ts
25823
+ var FormRadio = Node6.create({
25824
+ name: "formRadio",
25825
+ group: "inline",
25826
+ inline: true,
25827
+ atom: true,
25828
+ addOptions() {
25829
+ return {
25830
+ HTMLAttributes: {}
25831
+ };
25832
+ },
25833
+ addAttributes() {
25834
+ return {
25835
+ checked: {
25836
+ default: false,
25837
+ parseHTML: (element) => {
25838
+ const checked = element.getAttribute("data-checked") || element.getAttribute("checked");
25839
+ if (checked === "true" || checked === "") return true;
25840
+ if (element instanceof HTMLInputElement) {
25841
+ return element.checked;
25842
+ }
25843
+ return false;
25844
+ },
25845
+ renderHTML: (attributes) => {
25846
+ if (!attributes.checked) return {};
25847
+ return {
25848
+ "data-checked": "true",
25849
+ checked: "checked"
25850
+ };
25851
+ }
25852
+ },
25853
+ id: {
25854
+ default: null,
25855
+ parseHTML: (element) => element.getAttribute("data-id") || element.getAttribute("id") || `rad-${Math.random().toString(36).substring(2, 9)}`,
25856
+ renderHTML: (attributes) => {
25857
+ if (!attributes.id) return {};
25858
+ return {
25859
+ "data-id": attributes.id,
25860
+ id: attributes.id
25861
+ };
25862
+ }
25863
+ },
25864
+ name: {
25865
+ default: "radio-group",
25866
+ parseHTML: (element) => element.getAttribute("name") || element.getAttribute("data-group") || "radio-group",
25867
+ renderHTML: (attributes) => {
25868
+ if (!attributes.name) return {};
25869
+ return {
25870
+ name: attributes.name,
25871
+ "data-group": attributes.name
25872
+ };
25873
+ }
25874
+ },
25875
+ value: {
25876
+ default: "",
25877
+ parseHTML: (element) => element.getAttribute("value") || "",
25878
+ renderHTML: (attributes) => {
25879
+ if (!attributes.value) return {};
25880
+ return {
25881
+ value: attributes.value
25882
+ };
25883
+ }
25884
+ }
25885
+ };
25886
+ },
25887
+ parseHTML() {
25888
+ return [
25889
+ {
25890
+ tag: 'input[type="radio"][data-type="form-radio"]'
25891
+ },
25892
+ {
25893
+ tag: 'span[data-type="form-radio"]'
25894
+ }
25895
+ ];
25896
+ },
25897
+ renderHTML({ HTMLAttributes }) {
25898
+ return [
25899
+ "input",
25900
+ mergeAttributes5(this.options.HTMLAttributes, HTMLAttributes, {
25901
+ type: "radio",
25902
+ "data-type": "form-radio"
25903
+ })
25904
+ ];
25905
+ },
25906
+ addNodeView() {
25907
+ return ReactNodeViewRenderer5(FormRadioView);
25908
+ },
25909
+ addCommands() {
25910
+ return {
25911
+ setFormRadio: (attributes) => ({ commands }) => {
25912
+ return commands.insertContent({
25913
+ type: this.name,
25914
+ attrs: attributes
25915
+ });
25916
+ },
25917
+ checkFormRadio: (id) => ({ tr, dispatch }) => {
25918
+ if (!dispatch) return true;
25919
+ let targetGroupName = "";
25920
+ let targetPos = -1;
25921
+ tr.doc.descendants((node, pos) => {
25922
+ if (node.type.name === "formRadio" && node.attrs.id === id) {
25923
+ targetGroupName = node.attrs.name;
25924
+ targetPos = pos;
25925
+ return false;
25926
+ }
25927
+ return true;
25928
+ });
25929
+ if (targetPos === -1) return false;
25930
+ tr.doc.descendants((node, pos) => {
25931
+ if (node.type.name === "formRadio") {
25932
+ if (pos === targetPos) {
25933
+ if (!node.attrs.checked) {
25934
+ tr.setNodeMarkup(pos, void 0, { ...node.attrs, checked: true });
25935
+ }
25936
+ } else if (node.attrs.name === targetGroupName && node.attrs.checked) {
25937
+ tr.setNodeMarkup(pos, void 0, { ...node.attrs, checked: false });
25938
+ }
25939
+ }
25940
+ return true;
25941
+ });
25942
+ return true;
25943
+ }
25944
+ };
25945
+ }
25946
+ });
25947
+
25502
25948
  // src/components/UEditor/extensions.ts
25503
25949
  import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
25504
25950
  import History2 from "@tiptap/extension-history";
@@ -25536,7 +25982,9 @@ import {
25536
25982
  Type,
25537
25983
  Info as Info3,
25538
25984
  Bookmark as BookmarkIcon,
25539
- Paperclip
25985
+ Paperclip,
25986
+ CheckSquare,
25987
+ CircleDot
25540
25988
  } from "lucide-react";
25541
25989
 
25542
25990
  // src/components/UEditor/tippy-interop.ts
@@ -25559,7 +26007,7 @@ function destroyTippyInstance(instance) {
25559
26007
  }
25560
26008
 
25561
26009
  // src/components/UEditor/slash-command.tsx
25562
- import { jsx as jsx79, jsxs as jsxs65 } from "react/jsx-runtime";
26010
+ import { jsx as jsx81, jsxs as jsxs66 } from "react/jsx-runtime";
25563
26011
  var DEFAULT_MESSAGES = {
25564
26012
  noResults: "No results",
25565
26013
  basicBlocks: "Basic Blocks",
@@ -25590,7 +26038,11 @@ var DEFAULT_MESSAGES = {
25590
26038
  bookmark: "Bookmark Card",
25591
26039
  bookmarkDesc: "Embed a link as a bookmark card",
25592
26040
  fileCard: "File Attachment",
25593
- fileCardDesc: "Upload a file card attachment"
26041
+ fileCardDesc: "Upload a file card attachment",
26042
+ formCheckbox: "Form Checkbox",
26043
+ formCheckboxDesc: "Insert an interactive checkbox field",
26044
+ formRadio: "Form Radio Button",
26045
+ formRadioDesc: "Insert an interactive radio button field"
25594
26046
  };
25595
26047
  function useResettingIndex2(resetToken) {
25596
26048
  const [state, setState] = React70.useState({ resetToken, index: 0 });
@@ -25641,7 +26093,11 @@ function buildSlashCommandMessages(translate) {
25641
26093
  bookmark: translate("slashCommand.bookmark") || "Bookmark Card",
25642
26094
  bookmarkDesc: translate("slashCommand.bookmarkDesc") || "Embed a link as a bookmark card",
25643
26095
  fileCard: translate("slashCommand.fileCard") || "File Attachment",
25644
- fileCardDesc: translate("slashCommand.fileCardDesc") || "Upload a file card attachment"
26096
+ fileCardDesc: translate("slashCommand.fileCardDesc") || "Upload a file card attachment",
26097
+ formCheckbox: translate("slashCommand.formCheckbox") || "Form Checkbox",
26098
+ formCheckboxDesc: translate("slashCommand.formCheckboxDesc") || "Insert an interactive checkbox field",
26099
+ formRadio: translate("slashCommand.formRadio") || "Form Radio Button",
26100
+ formRadioDesc: translate("slashCommand.formRadioDesc") || "Insert an interactive radio button field"
25645
26101
  };
25646
26102
  }
25647
26103
  function buildSlashCommandItems({
@@ -25781,6 +26237,22 @@ function buildSlashCommandItems({
25781
26237
  };
25782
26238
  input.click();
25783
26239
  })
26240
+ },
26241
+ {
26242
+ icon: CheckSquare,
26243
+ title: messages.formCheckbox,
26244
+ description: messages.formCheckboxDesc,
26245
+ command: run(({ editor, range }) => {
26246
+ getCommandChain(editor, range).setFormCheckbox().run();
26247
+ })
26248
+ },
26249
+ {
26250
+ icon: CircleDot,
26251
+ title: messages.formRadio,
26252
+ description: messages.formRadioDesc,
26253
+ command: run(({ editor, range }) => {
26254
+ getCommandChain(editor, range).setFormRadio({ name: `radio-group-${Math.random().toString(36).substring(2, 6)}` }).run();
26255
+ })
25784
26256
  }
25785
26257
  ].filter((item) => item.title.toLowerCase().includes(query.toLowerCase()));
25786
26258
  }
@@ -25817,11 +26289,11 @@ var SlashCommandList = forwardRef14((props, ref) => {
25817
26289
  }
25818
26290
  }));
25819
26291
  if (props.items.length === 0) {
25820
- return /* @__PURE__ */ jsx79("div", { className: "w-72 p-4 text-center text-sm text-muted-foreground", children: props.messages.noResults });
26292
+ return /* @__PURE__ */ jsx81("div", { className: "w-72 p-4 text-center text-sm text-muted-foreground", children: props.messages.noResults });
25821
26293
  }
25822
- return /* @__PURE__ */ jsxs65("div", { ref: listRef, className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg", children: [
25823
- /* @__PURE__ */ jsx79("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx79("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: props.messages.basicBlocks }) }),
25824
- /* @__PURE__ */ jsx79("div", { className: "p-1", children: props.items.map((item, index) => /* @__PURE__ */ jsxs65(
26294
+ return /* @__PURE__ */ jsxs66("div", { ref: listRef, className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg", children: [
26295
+ /* @__PURE__ */ jsx81("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsx81("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: props.messages.basicBlocks }) }),
26296
+ /* @__PURE__ */ jsx81("div", { className: "p-1", children: props.items.map((item, index) => /* @__PURE__ */ jsxs66(
25825
26297
  "button",
25826
26298
  {
25827
26299
  type: "button",
@@ -25833,19 +26305,19 @@ var SlashCommandList = forwardRef14((props, ref) => {
25833
26305
  selectedIndex === index ? "bg-accent" : "hover:bg-accent/50"
25834
26306
  ),
25835
26307
  children: [
25836
- /* @__PURE__ */ jsx79(
26308
+ /* @__PURE__ */ jsx81(
25837
26309
  "div",
25838
26310
  {
25839
26311
  className: cn(
25840
26312
  "flex items-center justify-center w-10 h-10 rounded-lg mr-3 transition-colors",
25841
26313
  selectedIndex === index ? "bg-primary/10" : "bg-muted/50 group-hover:bg-muted"
25842
26314
  ),
25843
- children: /* @__PURE__ */ jsx79(item.icon, { className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
26315
+ children: /* @__PURE__ */ jsx81(item.icon, { className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
25844
26316
  }
25845
26317
  ),
25846
- /* @__PURE__ */ jsxs65("div", { className: "text-left", children: [
25847
- /* @__PURE__ */ jsx79("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: item.title }),
25848
- /* @__PURE__ */ jsx79("div", { className: "text-xs text-muted-foreground", children: item.description })
26318
+ /* @__PURE__ */ jsxs66("div", { className: "text-left", children: [
26319
+ /* @__PURE__ */ jsx81("div", { className: cn("text-sm font-medium", selectedIndex === index && "text-primary"), children: item.title }),
26320
+ /* @__PURE__ */ jsx81("div", { className: "text-xs text-muted-foreground", children: item.description })
25849
26321
  ] })
25850
26322
  ]
25851
26323
  },
@@ -26800,7 +27272,7 @@ import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
26800
27272
  import { PluginKey as PluginKey2 } from "@tiptap/pm/state";
26801
27273
  import React71, { forwardRef as forwardRef15, useImperativeHandle as useImperativeHandle2 } from "react";
26802
27274
  import { Smile as Smile2 } from "lucide-react";
26803
- import { jsx as jsx80, jsxs as jsxs66 } from "react/jsx-runtime";
27275
+ import { jsx as jsx82, jsxs as jsxs67 } from "react/jsx-runtime";
26804
27276
  function useResettingIndex3(resetToken) {
26805
27277
  const [state, setState] = React71.useState({ resetToken, index: 0 });
26806
27278
  const selectedIndex = Object.is(state.resetToken, resetToken) ? state.index : 0;
@@ -26850,15 +27322,15 @@ var EmojiList = forwardRef15((props, ref) => {
26850
27322
  }
26851
27323
  }));
26852
27324
  if (props.items.length === 0) {
26853
- return /* @__PURE__ */ jsx80("div", { 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") });
27325
+ return /* @__PURE__ */ jsx82("div", { 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") });
26854
27326
  }
26855
- return /* @__PURE__ */ jsxs66("div", { className: "w-80 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg", children: [
26856
- /* @__PURE__ */ jsx80("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
26857
- /* @__PURE__ */ jsx80(Smile2, { className: "w-4 h-4 text-primary" }),
26858
- /* @__PURE__ */ jsx80("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("emojiSuggestion.title") })
27327
+ return /* @__PURE__ */ jsxs67("div", { className: "w-80 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-2xl shadow-lg", children: [
27328
+ /* @__PURE__ */ jsx82("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
27329
+ /* @__PURE__ */ jsx82(Smile2, { className: "w-4 h-4 text-primary" }),
27330
+ /* @__PURE__ */ jsx82("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("emojiSuggestion.title") })
26859
27331
  ] }) }),
26860
- /* @__PURE__ */ jsxs66("div", { className: "p-3", children: [
26861
- /* @__PURE__ */ jsx80("div", { className: "grid grid-cols-8 gap-1", children: props.items.slice(0, 64).map((item, index) => /* @__PURE__ */ jsx80(
27332
+ /* @__PURE__ */ jsxs67("div", { className: "p-3", children: [
27333
+ /* @__PURE__ */ jsx82("div", { className: "grid grid-cols-8 gap-1", children: props.items.slice(0, 64).map((item, index) => /* @__PURE__ */ jsx82(
26862
27334
  EmojiGridButton,
26863
27335
  {
26864
27336
  emoji: item.emoji,
@@ -26869,7 +27341,7 @@ var EmojiList = forwardRef15((props, ref) => {
26869
27341
  },
26870
27342
  item.name
26871
27343
  )) }),
26872
- props.items.length > 64 && /* @__PURE__ */ jsx80("div", { className: "mt-2 text-xs text-center text-muted-foreground", children: showingCountLabel })
27344
+ props.items.length > 64 && /* @__PURE__ */ jsx82("div", { className: "mt-2 text-xs text-center text-muted-foreground", children: showingCountLabel })
26873
27345
  ] })
26874
27346
  ] });
26875
27347
  });
@@ -26955,7 +27427,7 @@ import { ReactRenderer as ReactRenderer3 } from "@tiptap/react";
26955
27427
  import { PluginKey as PluginKey3 } from "@tiptap/pm/state";
26956
27428
  import React72, { forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3 } from "react";
26957
27429
  import { Sigma } from "lucide-react";
26958
- import { jsx as jsx81, jsxs as jsxs67 } from "react/jsx-runtime";
27430
+ import { jsx as jsx83, jsxs as jsxs68 } from "react/jsx-runtime";
26959
27431
  var FORMULA_FUNCTIONS = [
26960
27432
  {
26961
27433
  name: "SUM",
@@ -27028,14 +27500,14 @@ var FormulaSuggestionList = forwardRef16((props, ref) => {
27028
27500
  }
27029
27501
  }));
27030
27502
  if (props.items.length === 0) {
27031
- return /* @__PURE__ */ jsx81("div", { className: "w-72 p-3 text-sm text-muted-foreground bg-card border border-border/50 rounded-lg shadow-lg", children: t("formulaSuggestion.noResults") });
27503
+ return /* @__PURE__ */ jsx83("div", { className: "w-72 p-3 text-sm text-muted-foreground bg-card border border-border/50 rounded-lg shadow-lg", children: t("formulaSuggestion.noResults") });
27032
27504
  }
27033
- return /* @__PURE__ */ jsxs67("div", { className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-lg shadow-lg", children: [
27034
- /* @__PURE__ */ jsx81("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
27035
- /* @__PURE__ */ jsx81(Sigma, { className: "w-4 h-4 text-primary" }),
27036
- /* @__PURE__ */ jsx81("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
27505
+ return /* @__PURE__ */ jsxs68("div", { className: "w-72 max-h-80 overflow-y-auto bg-card border border-border/50 rounded-lg shadow-lg", children: [
27506
+ /* @__PURE__ */ jsx83("div", { className: "px-3 py-2 border-b bg-muted/30", children: /* @__PURE__ */ jsxs68("div", { className: "flex items-center gap-2", children: [
27507
+ /* @__PURE__ */ jsx83(Sigma, { className: "w-4 h-4 text-primary" }),
27508
+ /* @__PURE__ */ jsx83("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: t("formulaSuggestion.title") })
27037
27509
  ] }) }),
27038
- /* @__PURE__ */ jsx81("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs67(
27510
+ /* @__PURE__ */ jsx83("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs68(
27039
27511
  "button",
27040
27512
  {
27041
27513
  type: "button",
@@ -27044,11 +27516,11 @@ var FormulaSuggestionList = forwardRef16((props, ref) => {
27044
27516
  onMouseDown: (event) => event.preventDefault(),
27045
27517
  onClick: () => props.command(item),
27046
27518
  children: [
27047
- /* @__PURE__ */ jsxs67("div", { className: "flex items-center justify-between gap-3", children: [
27048
- /* @__PURE__ */ jsx81("span", { className: "font-mono text-sm font-semibold", children: item.name }),
27049
- /* @__PURE__ */ jsx81("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
27519
+ /* @__PURE__ */ jsxs68("div", { className: "flex items-center justify-between gap-3", children: [
27520
+ /* @__PURE__ */ jsx83("span", { className: "font-mono text-sm font-semibold", children: item.name }),
27521
+ /* @__PURE__ */ jsx83("span", { className: "font-mono text-xs text-muted-foreground", children: item.signature })
27050
27522
  ] }),
27051
- /* @__PURE__ */ jsx81("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
27523
+ /* @__PURE__ */ jsx83("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
27052
27524
  ]
27053
27525
  },
27054
27526
  item.name
@@ -27202,8 +27674,8 @@ var UEditorPlaceholder = Extension5.create({
27202
27674
  // src/components/UEditor/resizable-image.tsx
27203
27675
  import { useEffect as useEffect34, useRef as useRef29, useState as useState44 } from "react";
27204
27676
  import Image4 from "@tiptap/extension-image";
27205
- import { mergeAttributes as mergeAttributes4 } from "@tiptap/core";
27206
- import { NodeViewWrapper as NodeViewWrapper4, ReactNodeViewRenderer as ReactNodeViewRenderer4 } from "@tiptap/react";
27677
+ import { mergeAttributes as mergeAttributes6 } from "@tiptap/core";
27678
+ import { NodeViewWrapper as NodeViewWrapper6, ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
27207
27679
 
27208
27680
  // src/components/UEditor/table-dom-utils.ts
27209
27681
  var DEFAULT_TABLE_ROW_HEIGHT = 25;
@@ -27310,7 +27782,7 @@ function getRelativeSelectedCellsMetrics(surface) {
27310
27782
  }
27311
27783
 
27312
27784
  // src/components/UEditor/resizable-image.tsx
27313
- import { jsx as jsx82, jsxs as jsxs68 } from "react/jsx-runtime";
27785
+ import { jsx as jsx84, jsxs as jsxs69 } from "react/jsx-runtime";
27314
27786
  var MIN_IMAGE_SIZE_PX = 40;
27315
27787
  var IMAGE_LAYOUTS = /* @__PURE__ */ new Set(["block", "left", "right"]);
27316
27788
  var IMAGE_WIDTH_PRESETS = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
@@ -27552,8 +28024,8 @@ function ResizableImageNodeView(props) {
27552
28024
  const showHandle = selected || isHovered || isResizing;
27553
28025
  const wrapperAlignClass = imageLayout === "block" ? textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "" : "";
27554
28026
  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";
27555
- return /* @__PURE__ */ jsxs68(
27556
- NodeViewWrapper4,
28027
+ return /* @__PURE__ */ jsxs69(
28028
+ NodeViewWrapper6,
27557
28029
  {
27558
28030
  as: "div",
27559
28031
  ref: wrapperRef,
@@ -27567,7 +28039,7 @@ function ResizableImageNodeView(props) {
27567
28039
  },
27568
28040
  contentEditable: false,
27569
28041
  children: [
27570
- /* @__PURE__ */ jsx82(
28042
+ /* @__PURE__ */ jsx84(
27571
28043
  "img",
27572
28044
  {
27573
28045
  ref: imgRef,
@@ -27583,7 +28055,7 @@ function ResizableImageNodeView(props) {
27583
28055
  style: getImageDisplayStyle(widthAttr, heightAttr)
27584
28056
  }
27585
28057
  ),
27586
- /* @__PURE__ */ jsx82(
28058
+ /* @__PURE__ */ jsx84(
27587
28059
  "div",
27588
28060
  {
27589
28061
  ref: resizePreviewRef,
@@ -27607,7 +28079,7 @@ function ResizableImageNodeView(props) {
27607
28079
  }
27608
28080
  }
27609
28081
  ),
27610
- showHandle && /* @__PURE__ */ jsx82(
28082
+ showHandle && /* @__PURE__ */ jsx84(
27611
28083
  "div",
27612
28084
  {
27613
28085
  "aria-hidden": "true",
@@ -27673,10 +28145,10 @@ var ResizableImage = Image4.extend({
27673
28145
  };
27674
28146
  },
27675
28147
  renderHTML({ HTMLAttributes }) {
27676
- return ["img", mergeAttributes4(this.options.HTMLAttributes, HTMLAttributes)];
28148
+ return ["img", mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes)];
27677
28149
  },
27678
28150
  addNodeView() {
27679
- return ReactNodeViewRenderer4(ResizableImageNodeView);
28151
+ return ReactNodeViewRenderer6(ResizableImageNodeView);
27680
28152
  }
27681
28153
  }).configure({
27682
28154
  allowBase64: true,
@@ -28405,9 +28877,9 @@ var table_align_default = UEditorTable;
28405
28877
 
28406
28878
  // src/components/UEditor/CodeBlockView.tsx
28407
28879
  import React74, { useState as useState45 } from "react";
28408
- import { NodeViewWrapper as NodeViewWrapper5, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
28409
- import { Check as Check10, Copy as Copy2, ChevronDown as ChevronDown7 } from "lucide-react";
28410
- import { Fragment as Fragment27, jsx as jsx83, jsxs as jsxs69 } from "react/jsx-runtime";
28880
+ import { NodeViewWrapper as NodeViewWrapper7, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
28881
+ import { Check as Check11, Copy as Copy2, ChevronDown as ChevronDown7 } from "lucide-react";
28882
+ import { Fragment as Fragment27, jsx as jsx85, jsxs as jsxs70 } from "react/jsx-runtime";
28411
28883
  var LANGUAGES = [
28412
28884
  { label: "Plain Text", value: "text" },
28413
28885
  { label: "JavaScript", value: "javascript" },
@@ -28455,15 +28927,15 @@ var CodeBlockView = ({
28455
28927
  console.error("Failed to copy code text: ", err);
28456
28928
  }
28457
28929
  };
28458
- return /* @__PURE__ */ jsxs69(NodeViewWrapper5, { className: "group/code relative my-4 rounded-xl border border-border/60 bg-muted/40 p-4 font-mono text-sm shadow-sm overflow-visible", children: [
28459
- /* @__PURE__ */ jsxs69(
28930
+ return /* @__PURE__ */ jsxs70(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: [
28931
+ /* @__PURE__ */ jsxs70(
28460
28932
  "div",
28461
28933
  {
28462
28934
  className: "absolute right-3 top-3 z-10 flex items-center gap-1.5 opacity-0 group-hover/code:opacity-100 focus-within:opacity-100 transition-opacity duration-200 select-none",
28463
28935
  contentEditable: false,
28464
28936
  children: [
28465
- /* @__PURE__ */ jsxs69("div", { className: "relative", children: [
28466
- /* @__PURE__ */ jsxs69(
28937
+ /* @__PURE__ */ jsxs70("div", { className: "relative", children: [
28938
+ /* @__PURE__ */ jsxs70(
28467
28939
  "button",
28468
28940
  {
28469
28941
  type: "button",
@@ -28471,19 +28943,19 @@ var CodeBlockView = ({
28471
28943
  className: "flex items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1 text-xs text-muted-foreground hover:text-foreground hover:bg-muted active:scale-95 transition-all focus:outline-none",
28472
28944
  children: [
28473
28945
  currentLangLabel,
28474
- /* @__PURE__ */ jsx83(ChevronDown7, { className: "h-3 w-3" })
28946
+ /* @__PURE__ */ jsx85(ChevronDown7, { className: "h-3 w-3" })
28475
28947
  ]
28476
28948
  }
28477
28949
  ),
28478
- isDropdownOpen && /* @__PURE__ */ jsxs69(Fragment27, { children: [
28479
- /* @__PURE__ */ jsx83(
28950
+ isDropdownOpen && /* @__PURE__ */ jsxs70(Fragment27, { children: [
28951
+ /* @__PURE__ */ jsx85(
28480
28952
  "div",
28481
28953
  {
28482
28954
  className: "fixed inset-0 z-20",
28483
28955
  onClick: () => setIsDropdownOpen(false)
28484
28956
  }
28485
28957
  ),
28486
- /* @__PURE__ */ jsx83("div", { className: "absolute right-0 mt-1 max-h-56 w-36 overflow-y-auto rounded-lg border border-border/50 bg-popover p-1 shadow-lg z-30 [scrollbar-width:thin] animate-in fade-in-0 zoom-in-95", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx83(
28958
+ /* @__PURE__ */ jsx85("div", { className: "absolute right-0 mt-1 max-h-56 w-36 overflow-y-auto rounded-lg border border-border/50 bg-popover p-1 shadow-lg z-30 [scrollbar-width:thin] animate-in fade-in-0 zoom-in-95", children: LANGUAGES.map((lang) => /* @__PURE__ */ jsx85(
28487
28959
  "button",
28488
28960
  {
28489
28961
  type: "button",
@@ -28501,20 +28973,20 @@ var CodeBlockView = ({
28501
28973
  )) })
28502
28974
  ] })
28503
28975
  ] }),
28504
- /* @__PURE__ */ jsx83(
28976
+ /* @__PURE__ */ jsx85(
28505
28977
  "button",
28506
28978
  {
28507
28979
  type: "button",
28508
28980
  onClick: handleCopy,
28509
28981
  className: "flex h-7 w-7 items-center justify-center rounded-lg border border-border bg-background text-muted-foreground hover:text-foreground hover:bg-muted active:scale-95 transition-all focus:outline-none",
28510
28982
  title: "Copy code",
28511
- children: copied ? /* @__PURE__ */ jsx83(Check10, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ jsx83(Copy2, { className: "h-3.5 w-3.5" })
28983
+ children: copied ? /* @__PURE__ */ jsx85(Check11, { className: "h-3.5 w-3.5 text-success animate-in fade-in-0 zoom-in-75" }) : /* @__PURE__ */ jsx85(Copy2, { className: "h-3.5 w-3.5" })
28512
28984
  }
28513
28985
  )
28514
28986
  ]
28515
28987
  }
28516
28988
  ),
28517
- /* @__PURE__ */ jsx83("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx83("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx83(NodeViewContent2, {}) }) })
28989
+ /* @__PURE__ */ jsx85("pre", { className: "m-0 overflow-x-auto [scrollbar-width:thin] pt-4 sm:pt-0", children: /* @__PURE__ */ jsx85("code", { className: "bg-transparent! text-foreground!", children: /* @__PURE__ */ jsx85(NodeViewContent2, {}) }) })
28518
28990
  ] });
28519
28991
  };
28520
28992
 
@@ -28614,6 +29086,16 @@ var CustomTableCell = TableCell2.extend({
28614
29086
  "data-computed-value": attributes.computedValue
28615
29087
  };
28616
29088
  }
29089
+ },
29090
+ verticalAlign: {
29091
+ default: null,
29092
+ parseHTML: (element) => element.style.verticalAlign || element.getAttribute("data-vertical-align") || null,
29093
+ renderHTML: (attributes) => {
29094
+ if (!attributes.verticalAlign) return {};
29095
+ return {
29096
+ "data-vertical-align": attributes.verticalAlign
29097
+ };
29098
+ }
28617
29099
  }
28618
29100
  };
28619
29101
  },
@@ -28623,15 +29105,17 @@ var CustomTableCell = TableCell2.extend({
28623
29105
  const borderColor = HTMLAttributes["data-border-color"];
28624
29106
  const borderStyle = HTMLAttributes["data-border-style"];
28625
29107
  const borderWidth = HTMLAttributes["data-border-width"];
29108
+ const verticalAlign = HTMLAttributes["data-vertical-align"];
28626
29109
  let mergedStyle = style;
28627
29110
  if (bg) mergedStyle += `; background-color: ${bg}`;
28628
29111
  if (borderColor) mergedStyle += `; border-color: ${borderColor}`;
28629
29112
  if (borderStyle) mergedStyle += `; border-style: ${borderStyle}`;
28630
29113
  if (borderWidth) mergedStyle += `; border-width: ${borderWidth}`;
29114
+ if (verticalAlign) mergedStyle += `; vertical-align: ${verticalAlign}`;
28631
29115
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
28632
29116
  return [
28633
29117
  "td",
28634
- mergeAttributes5(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
29118
+ mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
28635
29119
  0
28636
29120
  ];
28637
29121
  }
@@ -28721,6 +29205,16 @@ var CustomTableHeader = TableHeader2.extend({
28721
29205
  "data-computed-value": attributes.computedValue
28722
29206
  };
28723
29207
  }
29208
+ },
29209
+ verticalAlign: {
29210
+ default: null,
29211
+ parseHTML: (element) => element.style.verticalAlign || element.getAttribute("data-vertical-align") || null,
29212
+ renderHTML: (attributes) => {
29213
+ if (!attributes.verticalAlign) return {};
29214
+ return {
29215
+ "data-vertical-align": attributes.verticalAlign
29216
+ };
29217
+ }
28724
29218
  }
28725
29219
  };
28726
29220
  },
@@ -28730,15 +29224,17 @@ var CustomTableHeader = TableHeader2.extend({
28730
29224
  const borderColor = HTMLAttributes["data-border-color"];
28731
29225
  const borderStyle = HTMLAttributes["data-border-style"];
28732
29226
  const borderWidth = HTMLAttributes["data-border-width"];
29227
+ const verticalAlign = HTMLAttributes["data-vertical-align"];
28733
29228
  let mergedStyle = style;
28734
29229
  if (bg) mergedStyle += `; background-color: ${bg}`;
28735
29230
  if (borderColor) mergedStyle += `; border-color: ${borderColor}`;
28736
29231
  if (borderStyle) mergedStyle += `; border-style: ${borderStyle}`;
28737
29232
  if (borderWidth) mergedStyle += `; border-width: ${borderWidth}`;
29233
+ if (verticalAlign) mergedStyle += `; vertical-align: ${verticalAlign}`;
28738
29234
  mergedStyle = mergedStyle.replace(/^;/, "").trim();
28739
29235
  return [
28740
29236
  "th",
28741
- mergeAttributes5(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
29237
+ mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
28742
29238
  0
28743
29239
  ];
28744
29240
  }
@@ -28764,7 +29260,7 @@ var CustomTaskList = TaskList.extend({
28764
29260
  var lowlight = createLowlight(common);
28765
29261
  var CustomCodeBlockLowlight = CodeBlockLowlight.extend({
28766
29262
  addNodeView() {
28767
- return ReactNodeViewRenderer5(CodeBlockView);
29263
+ return ReactNodeViewRenderer7(CodeBlockView);
28768
29264
  }
28769
29265
  });
28770
29266
  function buildUEditorExtensions({
@@ -28908,7 +29404,9 @@ function buildUEditorExtensions({
28908
29404
  }),
28909
29405
  FileCard.configure({
28910
29406
  upload: uploadFile
28911
- })
29407
+ }),
29408
+ FormCheckbox2,
29409
+ FormRadio
28912
29410
  ];
28913
29411
  }
28914
29412
 
@@ -28951,18 +29449,22 @@ import {
28951
29449
  Type as Type2,
28952
29450
  Underline as UnderlineIcon,
28953
29451
  Undo as UndoIcon,
28954
- Upload as Upload3
29452
+ Upload as Upload3,
29453
+ AlignStartVertical,
29454
+ AlignCenterVertical,
29455
+ AlignEndVertical
28955
29456
  } from "lucide-react";
29457
+ import { setCellAttr } from "@tiptap/pm/tables";
28956
29458
 
28957
29459
  // src/components/UEditor/colors.tsx
28958
29460
  import { useMemo as useMemo22, useRef as useRef30 } from "react";
28959
- import { Check as Check11, Highlighter, Palette as Palette2, Paintbrush, Grid as Grid2 } from "lucide-react";
28960
- import { jsx as jsx84, jsxs as jsxs70 } from "react/jsx-runtime";
29461
+ import { Check as Check12, Highlighter, Palette as Palette2, Paintbrush, Grid as Grid2 } from "lucide-react";
29462
+ import { jsx as jsx86, jsxs as jsxs71 } from "react/jsx-runtime";
28961
29463
  var TextColorIcon = ({ color }) => {
28962
29464
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28963
- return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28964
- /* @__PURE__ */ jsx84("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
28965
- /* @__PURE__ */ jsx84(
29465
+ return /* @__PURE__ */ jsxs71("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
29466
+ /* @__PURE__ */ jsx86("span", { className: "text-[15px] font-semibold leading-none", children: "A" }),
29467
+ /* @__PURE__ */ jsx86(
28966
29468
  "span",
28967
29469
  {
28968
29470
  "aria-hidden": "true",
@@ -28974,9 +29476,9 @@ var TextColorIcon = ({ color }) => {
28974
29476
  };
28975
29477
  var HighlightColorIcon = ({ color }) => {
28976
29478
  const underlineColor = color || "currentColor";
28977
- return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28978
- /* @__PURE__ */ jsx84(Highlighter, { className: "h-4 w-4" }),
28979
- /* @__PURE__ */ jsx84(
29479
+ return /* @__PURE__ */ jsxs71("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
29480
+ /* @__PURE__ */ jsx86(Highlighter, { className: "h-4 w-4" }),
29481
+ /* @__PURE__ */ jsx86(
28980
29482
  "span",
28981
29483
  {
28982
29484
  "aria-hidden": "true",
@@ -28988,9 +29490,9 @@ var HighlightColorIcon = ({ color }) => {
28988
29490
  };
28989
29491
  var CellBgColorIcon = ({ color }) => {
28990
29492
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
28991
- return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
28992
- /* @__PURE__ */ jsx84(Paintbrush, { className: "h-4 w-4" }),
28993
- /* @__PURE__ */ jsx84(
29493
+ return /* @__PURE__ */ jsxs71("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
29494
+ /* @__PURE__ */ jsx86(Paintbrush, { className: "h-4 w-4" }),
29495
+ /* @__PURE__ */ jsx86(
28994
29496
  "span",
28995
29497
  {
28996
29498
  "aria-hidden": "true",
@@ -29002,9 +29504,9 @@ var CellBgColorIcon = ({ color }) => {
29002
29504
  };
29003
29505
  var CellBorderIcon = ({ color }) => {
29004
29506
  const underlineColor = color && color !== "inherit" ? color : "currentColor";
29005
- return /* @__PURE__ */ jsxs70("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
29006
- /* @__PURE__ */ jsx84(Grid2, { className: "h-4 w-4" }),
29007
- /* @__PURE__ */ jsx84(
29507
+ return /* @__PURE__ */ jsxs71("span", { className: "relative flex h-5 w-5 items-center justify-center leading-none", children: [
29508
+ /* @__PURE__ */ jsx86(Grid2, { className: "h-4 w-4" }),
29509
+ /* @__PURE__ */ jsx86(
29008
29510
  "span",
29009
29511
  {
29010
29512
  "aria-hidden": "true",
@@ -29131,9 +29633,9 @@ var EditorColorPalette = ({
29131
29633
  const colorInputRef = useRef30(null);
29132
29634
  const automaticColor = colors[0]?.color ?? "";
29133
29635
  const paletteColors = colors.slice(1);
29134
- return /* @__PURE__ */ jsxs70("div", { className: "w-56 p-2", children: [
29135
- /* @__PURE__ */ jsx84("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
29136
- /* @__PURE__ */ jsxs70(
29636
+ return /* @__PURE__ */ jsxs71("div", { className: "w-56 p-2", children: [
29637
+ /* @__PURE__ */ jsx86("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
29638
+ /* @__PURE__ */ jsxs71(
29137
29639
  "button",
29138
29640
  {
29139
29641
  type: "button",
@@ -29145,12 +29647,12 @@ var EditorColorPalette = ({
29145
29647
  currentColor === automaticColor ? "border-primary text-primary" : "border-transparent text-foreground"
29146
29648
  ),
29147
29649
  children: [
29148
- /* @__PURE__ */ jsx84("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ jsx84(Check11, { className: "h-3.5 w-3.5" }) }),
29149
- /* @__PURE__ */ jsx84("span", { className: "flex-1 text-center", children: t("colors.automatic") })
29650
+ /* @__PURE__ */ jsx86("span", { className: "flex h-5 w-5 items-center justify-center rounded border border-border bg-background", children: currentColor === automaticColor && /* @__PURE__ */ jsx86(Check12, { className: "h-3.5 w-3.5" }) }),
29651
+ /* @__PURE__ */ jsx86("span", { className: "flex-1 text-center", children: t("colors.automatic") })
29150
29652
  ]
29151
29653
  }
29152
29654
  ),
29153
- /* @__PURE__ */ jsx84("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ jsx84(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx84("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsx84(
29655
+ /* @__PURE__ */ jsx86("div", { className: "mt-2 grid grid-cols-8 gap-1", children: paletteColors.map((c) => /* @__PURE__ */ jsx86(Tooltip, { placement: "top", content: /* @__PURE__ */ jsx86("span", { className: "text-xs font-medium", children: c.name }), children: /* @__PURE__ */ jsx86(
29154
29656
  "button",
29155
29657
  {
29156
29658
  type: "button",
@@ -29162,10 +29664,10 @@ var EditorColorPalette = ({
29162
29664
  currentColor === c.color ? "border-primary ring-2 ring-primary/25" : "border-border/70"
29163
29665
  ),
29164
29666
  style: { backgroundColor: c.color || "transparent" },
29165
- children: currentColor === c.color && /* @__PURE__ */ jsx84("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx84(Check11, { className: cn("h-3.5 w-3.5", getSwatchCheckClass(c.color)) }) })
29667
+ children: currentColor === c.color && /* @__PURE__ */ jsx86("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx86(Check12, { className: cn("h-3.5 w-3.5", getSwatchCheckClass(c.color)) }) })
29166
29668
  }
29167
29669
  ) }, `${c.name}-${c.color}`)) }),
29168
- /* @__PURE__ */ jsxs70(
29670
+ /* @__PURE__ */ jsxs71(
29169
29671
  "button",
29170
29672
  {
29171
29673
  type: "button",
@@ -29173,7 +29675,7 @@ var EditorColorPalette = ({
29173
29675
  onClick: () => colorInputRef.current?.click(),
29174
29676
  className: "mt-3 flex h-9 w-full items-center gap-3 rounded-md px-2 text-sm text-foreground transition-colors hover:bg-muted",
29175
29677
  children: [
29176
- /* @__PURE__ */ jsx84(
29678
+ /* @__PURE__ */ jsx86(
29177
29679
  "span",
29178
29680
  {
29179
29681
  "aria-hidden": "true",
@@ -29183,9 +29685,9 @@ var EditorColorPalette = ({
29183
29685
  }
29184
29686
  }
29185
29687
  ),
29186
- /* @__PURE__ */ jsx84("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
29187
- /* @__PURE__ */ jsx84(Palette2, { className: "h-4 w-4 text-muted-foreground" }),
29188
- /* @__PURE__ */ jsx84(
29688
+ /* @__PURE__ */ jsx86("span", { className: "flex-1 text-center", children: t("colors.moreColors") }),
29689
+ /* @__PURE__ */ jsx86(Palette2, { className: "h-4 w-4 text-muted-foreground" }),
29690
+ /* @__PURE__ */ jsx86(
29189
29691
  "input",
29190
29692
  {
29191
29693
  ref: colorInputRef,
@@ -29331,8 +29833,8 @@ function deleteSelectedImage(editor) {
29331
29833
 
29332
29834
  // src/components/UEditor/inputs.tsx
29333
29835
  import { useEffect as useEffect35, useRef as useRef31, useState as useState46 } from "react";
29334
- import { Check as Check12, X as X18 } from "lucide-react";
29335
- import { jsx as jsx85, jsxs as jsxs71 } from "react/jsx-runtime";
29836
+ import { Check as Check13, X as X18 } from "lucide-react";
29837
+ import { jsx as jsx87, jsxs as jsxs72 } from "react/jsx-runtime";
29336
29838
  function normalizeUrl(raw) {
29337
29839
  return sanitizeUEditorUrl(raw, "link");
29338
29840
  }
@@ -29353,8 +29855,8 @@ var LinkInput = ({
29353
29855
  const normalized = normalizeUrl(url);
29354
29856
  if (normalized) onSubmit(normalized);
29355
29857
  };
29356
- return /* @__PURE__ */ jsxs71("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
29357
- /* @__PURE__ */ jsx85(
29858
+ return /* @__PURE__ */ jsxs72("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
29859
+ /* @__PURE__ */ jsx87(
29358
29860
  "input",
29359
29861
  {
29360
29862
  ref: inputRef,
@@ -29365,8 +29867,8 @@ var LinkInput = ({
29365
29867
  className: "flex-1 px-3 py-2 text-sm bg-muted/50 border-0 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary/20"
29366
29868
  }
29367
29869
  ),
29368
- /* @__PURE__ */ jsx85("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx85(Check12, { className: "w-4 h-4" }) }),
29369
- /* @__PURE__ */ jsx85("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx85(X18, { className: "w-4 h-4" }) })
29870
+ /* @__PURE__ */ jsx87("button", { type: "submit", className: "p-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 transition-colors", children: /* @__PURE__ */ jsx87(Check13, { className: "w-4 h-4" }) }),
29871
+ /* @__PURE__ */ jsx87("button", { type: "button", onClick: onCancel, className: "p-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: /* @__PURE__ */ jsx87(X18, { className: "w-4 h-4" }) })
29370
29872
  ] });
29371
29873
  };
29372
29874
  var ImageInput = ({ onSubmit, onCancel }) => {
@@ -29384,10 +29886,10 @@ var ImageInput = ({ onSubmit, onCancel }) => {
29384
29886
  onSubmit(safeUrl, alt);
29385
29887
  }
29386
29888
  };
29387
- return /* @__PURE__ */ jsxs71("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
29388
- /* @__PURE__ */ jsxs71("div", { children: [
29389
- /* @__PURE__ */ jsx85("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
29390
- /* @__PURE__ */ jsx85(
29889
+ return /* @__PURE__ */ jsxs72("form", { onSubmit: handleSubmit, className: "p-3 space-y-3", children: [
29890
+ /* @__PURE__ */ jsxs72("div", { children: [
29891
+ /* @__PURE__ */ jsx87("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.urlLabel") }),
29892
+ /* @__PURE__ */ jsx87(
29391
29893
  "input",
29392
29894
  {
29393
29895
  ref: inputRef,
@@ -29399,9 +29901,9 @@ var ImageInput = ({ onSubmit, onCancel }) => {
29399
29901
  }
29400
29902
  )
29401
29903
  ] }),
29402
- /* @__PURE__ */ jsxs71("div", { children: [
29403
- /* @__PURE__ */ jsx85("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
29404
- /* @__PURE__ */ jsx85(
29904
+ /* @__PURE__ */ jsxs72("div", { children: [
29905
+ /* @__PURE__ */ jsx87("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
29906
+ /* @__PURE__ */ jsx87(
29405
29907
  "input",
29406
29908
  {
29407
29909
  type: "text",
@@ -29412,8 +29914,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
29412
29914
  }
29413
29915
  )
29414
29916
  ] }),
29415
- /* @__PURE__ */ jsxs71("div", { className: "flex gap-2", children: [
29416
- /* @__PURE__ */ jsx85(
29917
+ /* @__PURE__ */ jsxs72("div", { className: "flex gap-2", children: [
29918
+ /* @__PURE__ */ jsx87(
29417
29919
  "button",
29418
29920
  {
29419
29921
  type: "submit",
@@ -29422,7 +29924,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
29422
29924
  children: t("imageInput.addBtn")
29423
29925
  }
29424
29926
  ),
29425
- /* @__PURE__ */ jsx85("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
29927
+ /* @__PURE__ */ jsx87("button", { type: "button", onClick: onCancel, className: "px-4 py-2 rounded-lg hover:bg-muted transition-colors text-muted-foreground", children: t("imageInput.cancelBtn") })
29426
29928
  ] })
29427
29929
  ] });
29428
29930
  };
@@ -29790,7 +30292,7 @@ function getDefaultLetterSpacings() {
29790
30292
  }
29791
30293
 
29792
30294
  // src/components/UEditor/toolbar.tsx
29793
- import { Fragment as Fragment28, jsx as jsx86, jsxs as jsxs72 } from "react/jsx-runtime";
30295
+ import { Fragment as Fragment28, jsx as jsx88, jsxs as jsxs73 } from "react/jsx-runtime";
29794
30296
  function getTableAnchorPos(editor) {
29795
30297
  const tableInfo = findTableNodeInfoFromState(editor.state);
29796
30298
  if (tableInfo) return editor.state.selection.from;
@@ -29821,7 +30323,7 @@ function formatTableInsertLabel(template, rows, cols) {
29821
30323
  return template.replace("{rows}", String(rows)).replace("{cols}", String(cols));
29822
30324
  }
29823
30325
  var ToolbarButton = React77.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
29824
- const button = /* @__PURE__ */ jsx86(
30326
+ const button = /* @__PURE__ */ jsx88(
29825
30327
  "button",
29826
30328
  {
29827
30329
  ref,
@@ -29846,12 +30348,12 @@ var ToolbarButton = React77.forwardRef(({ onClick, onMouseDown, active, disabled
29846
30348
  }
29847
30349
  );
29848
30350
  if (title) {
29849
- return /* @__PURE__ */ jsx86(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
30351
+ return /* @__PURE__ */ jsx88(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
29850
30352
  }
29851
30353
  return button;
29852
30354
  });
29853
30355
  ToolbarButton.displayName = "ToolbarButton";
29854
- var ToolbarDivider = () => /* @__PURE__ */ jsx86("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
30356
+ var ToolbarDivider = () => /* @__PURE__ */ jsx88("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
29855
30357
  var TableInsertGrid = ({
29856
30358
  insertLabel,
29857
30359
  previewTemplate,
@@ -29860,14 +30362,14 @@ var TableInsertGrid = ({
29860
30362
  const [selection, setSelection] = React77.useState({ rows: 3, cols: 3 });
29861
30363
  const maxRows = 8;
29862
30364
  const maxCols = 8;
29863
- return /* @__PURE__ */ jsxs72("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
29864
- /* @__PURE__ */ jsx86("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
29865
- /* @__PURE__ */ jsx86("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
30365
+ return /* @__PURE__ */ jsxs73("div", { className: "mb-2 rounded-xl border border-border/60 bg-muted/20 p-2", children: [
30366
+ /* @__PURE__ */ jsx88("div", { className: "mb-2 text-sm font-medium text-foreground", children: formatTableInsertLabel(previewTemplate, selection.rows, selection.cols) }),
30367
+ /* @__PURE__ */ jsx88("div", { className: "grid grid-cols-8 gap-1", onMouseLeave: () => setSelection((prev) => prev), children: Array.from({ length: maxRows }).map(
29866
30368
  (_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
29867
30369
  const rows = rowIndex + 1;
29868
30370
  const cols = colIndex + 1;
29869
30371
  const active = rows <= selection.rows && cols <= selection.cols;
29870
- return /* @__PURE__ */ jsx86(
30372
+ return /* @__PURE__ */ jsx88(
29871
30373
  "button",
29872
30374
  {
29873
30375
  type: "button",
@@ -29885,9 +30387,18 @@ var TableInsertGrid = ({
29885
30387
  );
29886
30388
  })
29887
30389
  ) }),
29888
- /* @__PURE__ */ jsx86("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
30390
+ /* @__PURE__ */ jsx88("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
29889
30391
  ] });
29890
30392
  };
30393
+ function applyTableCellAttribute(editor, name, value) {
30394
+ const { state, view } = editor;
30395
+ const applied = setCellAttr(name, value)(state, view.dispatch.bind(view));
30396
+ if (applied) {
30397
+ view.focus();
30398
+ return;
30399
+ }
30400
+ editor.chain().focus().setCellAttribute(name, value).run();
30401
+ }
29891
30402
  var EditorToolbar = ({
29892
30403
  editor,
29893
30404
  variant,
@@ -29927,6 +30438,7 @@ var EditorToolbar = ({
29927
30438
  const hasTableContext = isTableSelected || tableCommandAnchorPosRef.current !== null;
29928
30439
  const canMergeCells = hasTableContext && editor.can().mergeCells();
29929
30440
  const canSplitCell = hasTableContext && editor.can().splitCell();
30441
+ const currentCellVerticalAlign = normalizeStyleValue(editor.getAttributes("tableCell").verticalAlign || editor.getAttributes("tableHeader").verticalAlign) || "";
29930
30442
  const currentFontFamily = normalizeStyleValue(textStyleAttrs.fontFamily);
29931
30443
  const currentFontSize = normalizeStyleValue(textStyleAttrs.fontSize);
29932
30444
  const currentTextColor = normalizeStyleValue(textStyleAttrs.color) || "inherit";
@@ -29949,6 +30461,9 @@ var EditorToolbar = ({
29949
30461
  const displayedFontSizeLabel = currentFontSize ? currentFontSizeLabel : "13";
29950
30462
  const activeFontSize = currentFontSize || "13px";
29951
30463
  const tableCommandAnchorPos = tableCommandAnchorPosRef.current ?? tableAnchorPos ?? void 0;
30464
+ const isMedium = variant === "medium";
30465
+ const isMediumFull = variant === "medium-full";
30466
+ const isFull = variant === "default" || variant === "full" || variant === "notion" || !variant;
29952
30467
  const insertImageFiles = async (files) => {
29953
30468
  if (files.length === 0) return;
29954
30469
  setIsUploadingImage(true);
@@ -29970,31 +30485,74 @@ var EditorToolbar = ({
29970
30485
  setIsUploadingImage(false);
29971
30486
  };
29972
30487
  if (variant === "minimal") {
29973
- return /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-1 border-b border-border/35 bg-muted/30 p-2", children: [
29974
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx86(BoldIcon, { className: "w-4 h-4" }) }),
29975
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx86(ItalicIcon, { className: "w-4 h-4" }) }),
29976
- /* @__PURE__ */ jsx86(
30488
+ return /* @__PURE__ */ jsxs73("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-muted/30 p-1.5", children: [
30489
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx88(UndoIcon, { className: "w-4 h-4" }) }),
30490
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx88(RedoIcon, { className: "w-4 h-4" }) }),
30491
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30492
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx88(BoldIcon, { className: "w-4 h-4" }) }),
30493
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx88(ItalicIcon, { className: "w-4 h-4" }) }),
30494
+ /* @__PURE__ */ jsx88(
29977
30495
  ToolbarButton,
29978
30496
  {
29979
30497
  onClick: () => editor.chain().focus().toggleBulletList().run(),
29980
30498
  active: editor.isActive("bulletList"),
29981
30499
  title: t("toolbar.bulletList"),
29982
- children: /* @__PURE__ */ jsx86(ListIcon, { className: "w-4 h-4" })
30500
+ children: /* @__PURE__ */ jsx88(ListIcon, { className: "w-4 h-4" })
30501
+ }
30502
+ ),
30503
+ /* @__PURE__ */ jsx88(
30504
+ DropdownMenu,
30505
+ {
30506
+ contentClassName: "min-w-72",
30507
+ trigger: /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx88(LinkIcon, { className: "w-4 h-4" }) }),
30508
+ children: showLinkInput ? /* @__PURE__ */ jsx88(
30509
+ LinkInput,
30510
+ {
30511
+ initialUrl: String(editor.getAttributes("link").href ?? ""),
30512
+ onSubmit: (url) => {
30513
+ editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
30514
+ setShowLinkInput(false);
30515
+ },
30516
+ onCancel: () => setShowLinkInput(false)
30517
+ }
30518
+ ) : /* @__PURE__ */ jsxs73(Fragment28, { children: [
30519
+ /* @__PURE__ */ jsx88(
30520
+ DropdownMenuItem,
30521
+ {
30522
+ icon: LinkIcon,
30523
+ label: t("toolbar.link"),
30524
+ onClick: () => setShowLinkInput(true),
30525
+ active: editor.isActive("link"),
30526
+ closeOnSelect: false
30527
+ }
30528
+ ),
30529
+ /* @__PURE__ */ jsx88(
30530
+ DropdownMenuItem,
30531
+ {
30532
+ icon: Trash22,
30533
+ label: t("toolbar.removeLink"),
30534
+ onClick: () => editor.chain().focus().extendMarkRange("link").unsetLink().run(),
30535
+ disabled: !editor.isActive("link"),
30536
+ destructive: true
30537
+ }
30538
+ )
30539
+ ] })
29983
30540
  }
29984
30541
  )
29985
30542
  ] });
29986
30543
  }
29987
- return /* @__PURE__ */ jsxs72("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-linear-to-r from-muted/25 to-transparent p-1.5", children: [
29988
- /* @__PURE__ */ jsx86(
30544
+ const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? AlignCenterVertical : currentCellVerticalAlign === "bottom" ? AlignEndVertical : AlignStartVertical;
30545
+ return /* @__PURE__ */ jsxs73("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border/35 bg-linear-to-r from-muted/25 to-transparent p-1.5", children: [
30546
+ isFull && /* @__PURE__ */ jsx88(
29989
30547
  DropdownMenu,
29990
30548
  {
29991
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30549
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
29992
30550
  }, title: t("toolbar.fontFamily"), className: "min-w-0 max-w-40 px-1.5 w-auto gap-1", children: [
29993
- /* @__PURE__ */ jsx86("span", { className: "max-w-28 truncate text-xs font-medium", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
29994
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
30551
+ /* @__PURE__ */ jsx88("span", { className: "max-w-28 truncate text-xs font-medium", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
30552
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
29995
30553
  ] }),
29996
30554
  contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
29997
- children: availableFontFamilies.map((option) => /* @__PURE__ */ jsx86(
30555
+ children: availableFontFamilies.map((option) => /* @__PURE__ */ jsx88(
29998
30556
  DropdownMenuItem,
29999
30557
  {
30000
30558
  label: option.label,
@@ -30006,19 +30564,19 @@ var EditorToolbar = ({
30006
30564
  ))
30007
30565
  }
30008
30566
  ),
30009
- /* @__PURE__ */ jsx86(
30567
+ (isMediumFull || isFull) && /* @__PURE__ */ jsx88(
30010
30568
  DropdownMenu,
30011
30569
  {
30012
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30570
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30013
30571
  }, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-1", children: [
30014
- /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-0.5", children: [
30015
- /* @__PURE__ */ jsx86(ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
30016
- /* @__PURE__ */ jsx86("span", { className: "min-w-4 text-center text-xs font-semibold leading-none", children: displayedFontSizeLabel })
30572
+ /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5", children: [
30573
+ /* @__PURE__ */ jsx88(ChevronsUpDown, { className: "h-3 w-3 text-muted-foreground", strokeWidth: 2.5 }),
30574
+ /* @__PURE__ */ jsx88("span", { className: "min-w-4 text-center text-xs font-semibold leading-none", children: displayedFontSizeLabel })
30017
30575
  ] }),
30018
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
30576
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
30019
30577
  ] }),
30020
30578
  contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
30021
- children: availableFontSizes.map((option) => /* @__PURE__ */ jsx86(
30579
+ children: availableFontSizes.map((option) => /* @__PURE__ */ jsx88(
30022
30580
  DropdownMenuItem,
30023
30581
  {
30024
30582
  label: option.label,
@@ -30029,17 +30587,17 @@ var EditorToolbar = ({
30029
30587
  ))
30030
30588
  }
30031
30589
  ),
30032
- /* @__PURE__ */ jsxs72(
30590
+ /* @__PURE__ */ jsxs73(
30033
30591
  DropdownMenu,
30034
30592
  {
30035
30593
  contentClassName: "p-1",
30036
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30594
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30037
30595
  }, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
30038
- /* @__PURE__ */ jsx86(Type2, { className: "w-4 h-4" }),
30039
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
30596
+ /* @__PURE__ */ jsx88(Type2, { className: "w-4 h-4" }),
30597
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
30040
30598
  ] }),
30041
30599
  children: [
30042
- /* @__PURE__ */ jsx86(
30600
+ /* @__PURE__ */ jsx88(
30043
30601
  DropdownMenuItem,
30044
30602
  {
30045
30603
  icon: Type2,
@@ -30048,7 +30606,7 @@ var EditorToolbar = ({
30048
30606
  active: editor.isActive("paragraph")
30049
30607
  }
30050
30608
  ),
30051
- /* @__PURE__ */ jsx86(
30609
+ /* @__PURE__ */ jsx88(
30052
30610
  DropdownMenuItem,
30053
30611
  {
30054
30612
  icon: Heading1Icon,
@@ -30058,7 +30616,7 @@ var EditorToolbar = ({
30058
30616
  shortcut: "Ctrl+Alt+1"
30059
30617
  }
30060
30618
  ),
30061
- /* @__PURE__ */ jsx86(
30619
+ /* @__PURE__ */ jsx88(
30062
30620
  DropdownMenuItem,
30063
30621
  {
30064
30622
  icon: Heading2Icon,
@@ -30068,7 +30626,7 @@ var EditorToolbar = ({
30068
30626
  shortcut: "Ctrl+Alt+2"
30069
30627
  }
30070
30628
  ),
30071
- /* @__PURE__ */ jsx86(
30629
+ /* @__PURE__ */ jsx88(
30072
30630
  DropdownMenuItem,
30073
30631
  {
30074
30632
  icon: Heading3Icon,
@@ -30081,106 +30639,110 @@ var EditorToolbar = ({
30081
30639
  ]
30082
30640
  }
30083
30641
  ),
30084
- /* @__PURE__ */ jsxs72(
30085
- DropdownMenu,
30086
- {
30087
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30088
- }, title: t("toolbar.lineHeight"), className: "gap-0.5", children: [
30089
- /* @__PURE__ */ jsx86(ArrowUp, { className: "w-3 h-3" }),
30090
- /* @__PURE__ */ jsx86(ArrowDown, { className: "w-3 h-3" })
30091
- ] }),
30092
- contentClassName: "max-h-72 overflow-y-auto p-1",
30093
- children: [
30094
- /* @__PURE__ */ jsx86(
30095
- DropdownMenuItem,
30096
- {
30097
- icon: Type2,
30098
- label: t("toolbar.lineHeightDefault"),
30099
- onClick: () => editor.chain().focus().unsetLineHeight().run(),
30100
- active: !currentLineHeight
30101
- }
30102
- ),
30103
- availableLineHeights.map((option) => /* @__PURE__ */ jsx86(
30104
- DropdownMenuItem,
30105
- {
30106
- label: option.label,
30107
- onClick: () => editor.chain().focus().setLineHeight(option.value).run(),
30108
- active: normalizeStyleValue(option.value) === currentLineHeight
30109
- },
30110
- option.value
30111
- ))
30112
- ]
30113
- }
30114
- ),
30115
- /* @__PURE__ */ jsxs72(
30116
- DropdownMenu,
30117
- {
30118
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30119
- }, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: [
30120
- /* @__PURE__ */ jsx86(ArrowLeft, { className: "w-3 h-3" }),
30121
- /* @__PURE__ */ jsx86(ArrowRight, { className: "w-3 h-3" })
30122
- ] }),
30123
- contentClassName: "max-h-72 overflow-y-auto p-1",
30124
- children: [
30125
- /* @__PURE__ */ jsx86(
30126
- DropdownMenuItem,
30127
- {
30128
- icon: Type2,
30129
- label: t("toolbar.letterSpacingDefault"),
30130
- onClick: () => editor.chain().focus().unsetLetterSpacing().run(),
30131
- active: !currentLetterSpacing
30132
- }
30133
- ),
30134
- availableLetterSpacings.map((option) => /* @__PURE__ */ jsx86(
30135
- DropdownMenuItem,
30136
- {
30137
- label: option.label,
30138
- onClick: () => editor.chain().focus().setLetterSpacing(option.value).run(),
30139
- active: normalizeStyleValue(option.value) === currentLetterSpacing
30140
- },
30141
- option.value
30142
- ))
30143
- ]
30144
- }
30145
- ),
30146
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30147
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx86(BoldIcon, { className: "w-4 h-4" }) }),
30148
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx86(ItalicIcon, { className: "w-4 h-4" }) }),
30149
- /* @__PURE__ */ jsx86(
30642
+ isFull && /* @__PURE__ */ jsxs73(Fragment28, { children: [
30643
+ /* @__PURE__ */ jsxs73(
30644
+ DropdownMenu,
30645
+ {
30646
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30647
+ }, title: t("toolbar.lineHeight"), className: "gap-0.5", children: [
30648
+ /* @__PURE__ */ jsx88(ArrowUp, { className: "w-3 h-3" }),
30649
+ /* @__PURE__ */ jsx88(ArrowDown, { className: "w-3 h-3" })
30650
+ ] }),
30651
+ contentClassName: "max-h-72 overflow-y-auto p-1",
30652
+ children: [
30653
+ /* @__PURE__ */ jsx88(
30654
+ DropdownMenuItem,
30655
+ {
30656
+ icon: Type2,
30657
+ label: t("toolbar.lineHeightDefault"),
30658
+ onClick: () => editor.chain().focus().unsetLineHeight().run(),
30659
+ active: !currentLineHeight
30660
+ }
30661
+ ),
30662
+ availableLineHeights.map((option) => /* @__PURE__ */ jsx88(
30663
+ DropdownMenuItem,
30664
+ {
30665
+ label: option.label,
30666
+ onClick: () => editor.chain().focus().setLineHeight(option.value).run(),
30667
+ active: normalizeStyleValue(option.value) === currentLineHeight
30668
+ },
30669
+ option.value
30670
+ ))
30671
+ ]
30672
+ }
30673
+ ),
30674
+ /* @__PURE__ */ jsxs73(
30675
+ DropdownMenu,
30676
+ {
30677
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30678
+ }, title: t("toolbar.letterSpacing"), className: "gap-0.5", children: [
30679
+ /* @__PURE__ */ jsx88(ArrowLeft, { className: "w-3 h-3" }),
30680
+ /* @__PURE__ */ jsx88(ArrowRight, { className: "w-3 h-3" })
30681
+ ] }),
30682
+ contentClassName: "max-h-72 overflow-y-auto p-1",
30683
+ children: [
30684
+ /* @__PURE__ */ jsx88(
30685
+ DropdownMenuItem,
30686
+ {
30687
+ icon: Type2,
30688
+ label: t("toolbar.letterSpacingDefault"),
30689
+ onClick: () => editor.chain().focus().unsetLetterSpacing().run(),
30690
+ active: !currentLetterSpacing
30691
+ }
30692
+ ),
30693
+ availableLetterSpacings.map((option) => /* @__PURE__ */ jsx88(
30694
+ DropdownMenuItem,
30695
+ {
30696
+ label: option.label,
30697
+ onClick: () => editor.chain().focus().setLetterSpacing(option.value).run(),
30698
+ active: normalizeStyleValue(option.value) === currentLetterSpacing
30699
+ },
30700
+ option.value
30701
+ ))
30702
+ ]
30703
+ }
30704
+ )
30705
+ ] }),
30706
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30707
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx88(BoldIcon, { className: "w-4 h-4" }) }),
30708
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx88(ItalicIcon, { className: "w-4 h-4" }) }),
30709
+ /* @__PURE__ */ jsx88(
30150
30710
  ToolbarButton,
30151
30711
  {
30152
30712
  onClick: () => editor.chain().focus().toggleUnderline().run(),
30153
30713
  active: editor.isActive("underline"),
30154
30714
  title: t("toolbar.underline"),
30155
- children: /* @__PURE__ */ jsx86(UnderlineIcon, { className: "w-4 h-4" })
30715
+ children: /* @__PURE__ */ jsx88(UnderlineIcon, { className: "w-4 h-4" })
30156
30716
  }
30157
30717
  ),
30158
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx86(StrikethroughIcon, { className: "w-4 h-4" }) }),
30159
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx86(CodeIcon, { className: "w-4 h-4" }) }),
30160
- /* @__PURE__ */ jsx86(
30161
- ToolbarButton,
30162
- {
30163
- onClick: () => editor.chain().focus().toggleSubscript().run(),
30164
- active: editor.isActive("subscript"),
30165
- title: t("toolbar.subscript"),
30166
- children: /* @__PURE__ */ jsx86(SubscriptIcon, { className: "w-4 h-4" })
30167
- }
30168
- ),
30169
- /* @__PURE__ */ jsx86(
30170
- ToolbarButton,
30171
- {
30172
- onClick: () => editor.chain().focus().toggleSuperscript().run(),
30173
- active: editor.isActive("superscript"),
30174
- title: t("toolbar.superscript"),
30175
- children: /* @__PURE__ */ jsx86(SuperscriptIcon, { className: "w-4 h-4" })
30176
- }
30177
- ),
30178
- /* @__PURE__ */ jsx86(
30718
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx88(StrikethroughIcon, { className: "w-4 h-4" }) }),
30719
+ (isMediumFull || isFull) && /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx88(CodeIcon, { className: "w-4 h-4" }) }),
30720
+ isFull && /* @__PURE__ */ jsxs73(Fragment28, { children: [
30721
+ /* @__PURE__ */ jsx88(
30722
+ ToolbarButton,
30723
+ {
30724
+ onClick: () => editor.chain().focus().toggleSubscript().run(),
30725
+ active: editor.isActive("subscript"),
30726
+ title: t("toolbar.subscript"),
30727
+ children: /* @__PURE__ */ jsx88(SubscriptIcon, { className: "w-4 h-4" })
30728
+ }
30729
+ ),
30730
+ /* @__PURE__ */ jsx88(
30731
+ ToolbarButton,
30732
+ {
30733
+ onClick: () => editor.chain().focus().toggleSuperscript().run(),
30734
+ active: editor.isActive("superscript"),
30735
+ title: t("toolbar.superscript"),
30736
+ children: /* @__PURE__ */ jsx88(SuperscriptIcon, { className: "w-4 h-4" })
30737
+ }
30738
+ )
30739
+ ] }),
30740
+ /* @__PURE__ */ jsx88(
30179
30741
  DropdownMenu,
30180
30742
  {
30181
30743
  contentClassName: "min-w-72",
30182
- trigger: /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx86(LinkIcon, { className: "w-4 h-4" }) }),
30183
- children: showLinkInput ? /* @__PURE__ */ jsx86(
30744
+ trigger: /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => setShowLinkInput(!editor.isActive("link")), active: editor.isActive("link"), title: t("toolbar.link"), children: /* @__PURE__ */ jsx88(LinkIcon, { className: "w-4 h-4" }) }),
30745
+ children: showLinkInput ? /* @__PURE__ */ jsx88(
30184
30746
  LinkInput,
30185
30747
  {
30186
30748
  initialUrl: String(editor.getAttributes("link").href ?? ""),
@@ -30190,8 +30752,8 @@ var EditorToolbar = ({
30190
30752
  },
30191
30753
  onCancel: () => setShowLinkInput(false)
30192
30754
  }
30193
- ) : /* @__PURE__ */ jsxs72(Fragment28, { children: [
30194
- /* @__PURE__ */ jsx86(
30755
+ ) : /* @__PURE__ */ jsxs73(Fragment28, { children: [
30756
+ /* @__PURE__ */ jsx88(
30195
30757
  DropdownMenuItem,
30196
30758
  {
30197
30759
  icon: LinkIcon,
@@ -30201,7 +30763,7 @@ var EditorToolbar = ({
30201
30763
  closeOnSelect: false
30202
30764
  }
30203
30765
  ),
30204
- /* @__PURE__ */ jsx86(
30766
+ /* @__PURE__ */ jsx88(
30205
30767
  DropdownMenuItem,
30206
30768
  {
30207
30769
  icon: Trash22,
@@ -30214,16 +30776,16 @@ var EditorToolbar = ({
30214
30776
  ] })
30215
30777
  }
30216
30778
  ),
30217
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30218
- /* @__PURE__ */ jsx86(
30779
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30780
+ /* @__PURE__ */ jsx88(
30219
30781
  DropdownMenu,
30220
30782
  {
30221
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30783
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30222
30784
  }, title: t("colors.textColor"), children: [
30223
- /* @__PURE__ */ jsx86(TextColorIcon, { color: currentTextColor }),
30224
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
30785
+ /* @__PURE__ */ jsx88(TextColorIcon, { color: currentTextColor }),
30786
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30225
30787
  ] }),
30226
- children: /* @__PURE__ */ jsx86(
30788
+ children: /* @__PURE__ */ jsx88(
30227
30789
  EditorColorPalette,
30228
30790
  {
30229
30791
  colors: textColors,
@@ -30240,15 +30802,15 @@ var EditorToolbar = ({
30240
30802
  )
30241
30803
  }
30242
30804
  ),
30243
- /* @__PURE__ */ jsx86(
30805
+ /* @__PURE__ */ jsx88(
30244
30806
  DropdownMenu,
30245
30807
  {
30246
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30808
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30247
30809
  }, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
30248
- /* @__PURE__ */ jsx86(HighlightColorIcon, { color: currentHighlightColor }),
30249
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
30810
+ /* @__PURE__ */ jsx88(HighlightColorIcon, { color: currentHighlightColor }),
30811
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30250
30812
  ] }),
30251
- children: /* @__PURE__ */ jsx86(
30813
+ children: /* @__PURE__ */ jsx88(
30252
30814
  EditorColorPalette,
30253
30815
  {
30254
30816
  colors: highlightColors,
@@ -30265,83 +30827,117 @@ var EditorToolbar = ({
30265
30827
  )
30266
30828
  }
30267
30829
  ),
30268
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30269
- /* @__PURE__ */ jsx86(
30270
- DropdownMenu,
30271
- {
30272
- contentClassName: "p-0 overflow-hidden",
30273
- trigger: /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => {
30274
- }, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx86(Smile3, { className: "w-4 h-4" }) }),
30275
- children: /* @__PURE__ */ jsx86(
30276
- EmojiPicker2,
30277
- {
30278
- onSelect: (emoji) => {
30279
- editor.chain().focus().insertContent(emoji).run();
30280
- }
30281
- }
30282
- )
30283
- }
30284
- ),
30285
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30286
- /* @__PURE__ */ jsxs72(
30287
- DropdownMenu,
30288
- {
30289
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30290
- }, title: t("toolbar.alignment"), children: [
30291
- /* @__PURE__ */ jsx86(AlignLeft, { className: "w-4 h-4" }),
30292
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
30293
- ] }),
30294
- children: [
30295
- /* @__PURE__ */ jsx86(
30296
- DropdownMenuItem,
30297
- {
30298
- icon: AlignLeft,
30299
- label: t("toolbar.alignLeft"),
30300
- onClick: () => editor.chain().focus().setTextAlign("left").run(),
30301
- active: editor.isActive({ textAlign: "left" })
30302
- }
30303
- ),
30304
- /* @__PURE__ */ jsx86(
30305
- DropdownMenuItem,
30306
- {
30307
- icon: AlignCenter,
30308
- label: t("toolbar.alignCenter"),
30309
- onClick: () => editor.chain().focus().setTextAlign("center").run(),
30310
- active: editor.isActive({ textAlign: "center" })
30311
- }
30312
- ),
30313
- /* @__PURE__ */ jsx86(
30314
- DropdownMenuItem,
30315
- {
30316
- icon: AlignRight,
30317
- label: t("toolbar.alignRight"),
30318
- onClick: () => editor.chain().focus().setTextAlign("right").run(),
30319
- active: editor.isActive({ textAlign: "right" })
30320
- }
30321
- ),
30322
- /* @__PURE__ */ jsx86(
30323
- DropdownMenuItem,
30830
+ (isMediumFull || isFull) && /* @__PURE__ */ jsxs73(Fragment28, { children: [
30831
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30832
+ /* @__PURE__ */ jsx88(
30833
+ DropdownMenu,
30834
+ {
30835
+ contentClassName: "p-0 overflow-hidden",
30836
+ trigger: /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => {
30837
+ }, title: t("toolbar.emoji"), children: /* @__PURE__ */ jsx88(Smile3, { className: "w-4 h-4" }) }),
30838
+ children: /* @__PURE__ */ jsx88(
30839
+ EmojiPicker2,
30324
30840
  {
30325
- icon: AlignJustify,
30326
- label: t("toolbar.justify"),
30327
- onClick: () => editor.chain().focus().setTextAlign("justify").run(),
30328
- active: editor.isActive({ textAlign: "justify" })
30841
+ onSelect: (emoji) => {
30842
+ editor.chain().focus().insertContent(emoji).run();
30843
+ }
30329
30844
  }
30330
30845
  )
30331
- ]
30332
- }
30333
- ),
30334
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30335
- /* @__PURE__ */ jsxs72(
30846
+ }
30847
+ )
30848
+ ] }),
30849
+ (isMediumFull || isFull) && /* @__PURE__ */ jsxs73(Fragment28, { children: [
30850
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30851
+ /* @__PURE__ */ jsxs73(
30852
+ DropdownMenu,
30853
+ {
30854
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30855
+ }, title: t("toolbar.alignment"), children: [
30856
+ /* @__PURE__ */ jsx88(AlignLeft, { className: "w-4 h-4" }),
30857
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30858
+ ] }),
30859
+ children: [
30860
+ /* @__PURE__ */ jsx88(
30861
+ DropdownMenuItem,
30862
+ {
30863
+ icon: AlignLeft,
30864
+ label: t("toolbar.alignLeft"),
30865
+ onClick: () => editor.chain().focus().setTextAlign("left").run(),
30866
+ active: editor.isActive({ textAlign: "left" })
30867
+ }
30868
+ ),
30869
+ /* @__PURE__ */ jsx88(
30870
+ DropdownMenuItem,
30871
+ {
30872
+ icon: AlignCenter,
30873
+ label: t("toolbar.alignCenter"),
30874
+ onClick: () => editor.chain().focus().setTextAlign("center").run(),
30875
+ active: editor.isActive({ textAlign: "center" })
30876
+ }
30877
+ ),
30878
+ /* @__PURE__ */ jsx88(
30879
+ DropdownMenuItem,
30880
+ {
30881
+ icon: AlignRight,
30882
+ label: t("toolbar.alignRight"),
30883
+ onClick: () => editor.chain().focus().setTextAlign("right").run(),
30884
+ active: editor.isActive({ textAlign: "right" })
30885
+ }
30886
+ ),
30887
+ /* @__PURE__ */ jsx88(
30888
+ DropdownMenuItem,
30889
+ {
30890
+ icon: AlignJustify,
30891
+ label: t("toolbar.justify"),
30892
+ onClick: () => editor.chain().focus().setTextAlign("justify").run(),
30893
+ active: editor.isActive({ textAlign: "justify" })
30894
+ }
30895
+ ),
30896
+ hasTableContext && /* @__PURE__ */ jsxs73(Fragment28, { children: [
30897
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
30898
+ /* @__PURE__ */ jsx88(
30899
+ DropdownMenuItem,
30900
+ {
30901
+ icon: AlignStartVertical,
30902
+ label: t("tableMenu.alignVerticalTop") || "Align top",
30903
+ onClick: () => applyTableCellAttribute(editor, "verticalAlign", "top"),
30904
+ active: currentCellVerticalAlign === "top"
30905
+ }
30906
+ ),
30907
+ /* @__PURE__ */ jsx88(
30908
+ DropdownMenuItem,
30909
+ {
30910
+ icon: AlignCenterVertical,
30911
+ label: t("tableMenu.alignVerticalMiddle") || "Align middle",
30912
+ onClick: () => applyTableCellAttribute(editor, "verticalAlign", "middle"),
30913
+ active: currentCellVerticalAlign === "middle"
30914
+ }
30915
+ ),
30916
+ /* @__PURE__ */ jsx88(
30917
+ DropdownMenuItem,
30918
+ {
30919
+ icon: AlignEndVertical,
30920
+ label: t("tableMenu.alignVerticalBottom") || "Align bottom",
30921
+ onClick: () => applyTableCellAttribute(editor, "verticalAlign", "bottom"),
30922
+ active: currentCellVerticalAlign === "bottom"
30923
+ }
30924
+ )
30925
+ ] })
30926
+ ]
30927
+ }
30928
+ )
30929
+ ] }),
30930
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
30931
+ /* @__PURE__ */ jsxs73(
30336
30932
  DropdownMenu,
30337
30933
  {
30338
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30934
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30339
30935
  }, title: t("toolbar.bulletList"), children: [
30340
- /* @__PURE__ */ jsx86(ListIcon, { className: "w-4 h-4" }),
30341
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
30936
+ /* @__PURE__ */ jsx88(ListIcon, { className: "w-4 h-4" }),
30937
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30342
30938
  ] }),
30343
30939
  children: [
30344
- /* @__PURE__ */ jsx86(
30940
+ /* @__PURE__ */ jsx88(
30345
30941
  DropdownMenuItem,
30346
30942
  {
30347
30943
  icon: ListIcon,
@@ -30351,7 +30947,7 @@ var EditorToolbar = ({
30351
30947
  shortcut: "Ctrl+Shift+8"
30352
30948
  }
30353
30949
  ),
30354
- /* @__PURE__ */ jsx86(
30950
+ /* @__PURE__ */ jsx88(
30355
30951
  DropdownMenuItem,
30356
30952
  {
30357
30953
  icon: ListOrderedIcon,
@@ -30361,7 +30957,7 @@ var EditorToolbar = ({
30361
30957
  shortcut: "Ctrl+Shift+7"
30362
30958
  }
30363
30959
  ),
30364
- /* @__PURE__ */ jsx86(
30960
+ /* @__PURE__ */ jsx88(
30365
30961
  DropdownMenuItem,
30366
30962
  {
30367
30963
  icon: ListTodo2,
@@ -30374,16 +30970,17 @@ var EditorToolbar = ({
30374
30970
  ]
30375
30971
  }
30376
30972
  ),
30377
- /* @__PURE__ */ jsxs72(
30973
+ isMediumFull && /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().toggleBlockquote().run(), active: editor.isActive("blockquote"), title: t("toolbar.quote"), children: /* @__PURE__ */ jsx88(QuoteIcon, { className: "w-4 h-4" }) }),
30974
+ isFull && /* @__PURE__ */ jsxs73(
30378
30975
  DropdownMenu,
30379
30976
  {
30380
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
30977
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30381
30978
  }, title: t("toolbar.quote"), children: [
30382
- /* @__PURE__ */ jsx86(QuoteIcon, { className: "w-4 h-4" }),
30383
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
30979
+ /* @__PURE__ */ jsx88(QuoteIcon, { className: "w-4 h-4" }),
30980
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30384
30981
  ] }),
30385
30982
  children: [
30386
- /* @__PURE__ */ jsx86(
30983
+ /* @__PURE__ */ jsx88(
30387
30984
  DropdownMenuItem,
30388
30985
  {
30389
30986
  icon: QuoteIcon,
@@ -30393,7 +30990,7 @@ var EditorToolbar = ({
30393
30990
  shortcut: "Ctrl+Shift+B"
30394
30991
  }
30395
30992
  ),
30396
- /* @__PURE__ */ jsx86(
30993
+ /* @__PURE__ */ jsx88(
30397
30994
  DropdownMenuItem,
30398
30995
  {
30399
30996
  icon: FileCode3,
@@ -30406,15 +31003,15 @@ var EditorToolbar = ({
30406
31003
  ]
30407
31004
  }
30408
31005
  ),
30409
- /* @__PURE__ */ jsx86(
31006
+ (isMediumFull || isFull) && /* @__PURE__ */ jsx88(
30410
31007
  DropdownMenu,
30411
31008
  {
30412
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
31009
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30413
31010
  }, title: t("toolbar.image"), children: [
30414
- /* @__PURE__ */ jsx86(ImageIcon2, { className: "w-4 h-4" }),
30415
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
31011
+ /* @__PURE__ */ jsx88(ImageIcon2, { className: "w-4 h-4" }),
31012
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30416
31013
  ] }),
30417
- children: showImageInput ? /* @__PURE__ */ jsx86(
31014
+ children: showImageInput ? /* @__PURE__ */ jsx88(
30418
31015
  ImageInput,
30419
31016
  {
30420
31017
  onSubmit: (url, alt) => {
@@ -30423,9 +31020,9 @@ var EditorToolbar = ({
30423
31020
  },
30424
31021
  onCancel: () => setShowImageInput(false)
30425
31022
  }
30426
- ) : /* @__PURE__ */ jsxs72(Fragment28, { children: [
30427
- /* @__PURE__ */ jsx86(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
30428
- /* @__PURE__ */ jsx86(
31023
+ ) : /* @__PURE__ */ jsxs73(Fragment28, { children: [
31024
+ /* @__PURE__ */ jsx88(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
31025
+ /* @__PURE__ */ jsx88(
30429
31026
  DropdownMenuItem,
30430
31027
  {
30431
31028
  icon: Upload3,
@@ -30435,8 +31032,8 @@ var EditorToolbar = ({
30435
31032
  closeOnSelect: false
30436
31033
  }
30437
31034
  ),
30438
- imageUploadError && /* @__PURE__ */ jsx86(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
30439
- /* @__PURE__ */ jsx86(
31035
+ imageUploadError && /* @__PURE__ */ jsx88(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
31036
+ /* @__PURE__ */ jsx88(
30440
31037
  "input",
30441
31038
  {
30442
31039
  ref: fileInputRef,
@@ -30451,8 +31048,8 @@ var EditorToolbar = ({
30451
31048
  }
30452
31049
  }
30453
31050
  ),
30454
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30455
- /* @__PURE__ */ jsx86(
31051
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31052
+ /* @__PURE__ */ jsx88(
30456
31053
  DropdownMenuItem,
30457
31054
  {
30458
31055
  icon: AlignCenter,
@@ -30462,7 +31059,7 @@ var EditorToolbar = ({
30462
31059
  disabled: !isImageSelected
30463
31060
  }
30464
31061
  ),
30465
- /* @__PURE__ */ jsx86(
31062
+ /* @__PURE__ */ jsx88(
30466
31063
  DropdownMenuItem,
30467
31064
  {
30468
31065
  icon: AlignLeft,
@@ -30472,7 +31069,7 @@ var EditorToolbar = ({
30472
31069
  disabled: !isImageSelected
30473
31070
  }
30474
31071
  ),
30475
- /* @__PURE__ */ jsx86(
31072
+ /* @__PURE__ */ jsx88(
30476
31073
  DropdownMenuItem,
30477
31074
  {
30478
31075
  icon: AlignRight,
@@ -30482,8 +31079,8 @@ var EditorToolbar = ({
30482
31079
  disabled: !isImageSelected
30483
31080
  }
30484
31081
  ),
30485
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30486
- /* @__PURE__ */ jsx86(
31082
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31083
+ /* @__PURE__ */ jsx88(
30487
31084
  DropdownMenuItem,
30488
31085
  {
30489
31086
  label: t("toolbar.imageWidthSm"),
@@ -30492,7 +31089,7 @@ var EditorToolbar = ({
30492
31089
  disabled: !isImageSelected
30493
31090
  }
30494
31091
  ),
30495
- /* @__PURE__ */ jsx86(
31092
+ /* @__PURE__ */ jsx88(
30496
31093
  DropdownMenuItem,
30497
31094
  {
30498
31095
  label: t("toolbar.imageWidthMd"),
@@ -30501,7 +31098,7 @@ var EditorToolbar = ({
30501
31098
  disabled: !isImageSelected
30502
31099
  }
30503
31100
  ),
30504
- /* @__PURE__ */ jsx86(
31101
+ /* @__PURE__ */ jsx88(
30505
31102
  DropdownMenuItem,
30506
31103
  {
30507
31104
  label: t("toolbar.imageWidthLg"),
@@ -30510,8 +31107,8 @@ var EditorToolbar = ({
30510
31107
  disabled: !isImageSelected
30511
31108
  }
30512
31109
  ),
30513
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30514
- /* @__PURE__ */ jsx86(
31110
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31111
+ /* @__PURE__ */ jsx88(
30515
31112
  DropdownMenuItem,
30516
31113
  {
30517
31114
  icon: RotateCcw2,
@@ -30520,7 +31117,7 @@ var EditorToolbar = ({
30520
31117
  disabled: !isImageSelected
30521
31118
  }
30522
31119
  ),
30523
- /* @__PURE__ */ jsx86(
31120
+ /* @__PURE__ */ jsx88(
30524
31121
  DropdownMenuItem,
30525
31122
  {
30526
31123
  icon: Trash22,
@@ -30533,7 +31130,7 @@ var EditorToolbar = ({
30533
31130
  ] })
30534
31131
  }
30535
31132
  ),
30536
- /* @__PURE__ */ jsxs72(
31133
+ (isMediumFull || isFull) && /* @__PURE__ */ jsxs73(
30537
31134
  DropdownMenu,
30538
31135
  {
30539
31136
  isOpen: isTableMenuOpen,
@@ -30541,14 +31138,14 @@ var EditorToolbar = ({
30541
31138
  setIsTableMenuOpen(open);
30542
31139
  tableCommandAnchorPosRef.current = open ? getTableAnchorPos(editor) : null;
30543
31140
  },
30544
- trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
31141
+ trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
30545
31142
  }, title: t("toolbar.table"), children: [
30546
- /* @__PURE__ */ jsx86(TableIcon, { className: "w-4 h-4" }),
30547
- /* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
31143
+ /* @__PURE__ */ jsx88(TableIcon, { className: "w-4 h-4" }),
31144
+ /* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
30548
31145
  ] }),
30549
31146
  contentClassName: "p-2 min-w-56",
30550
31147
  children: [
30551
- /* @__PURE__ */ jsx86(
31148
+ /* @__PURE__ */ jsx88(
30552
31149
  TableInsertGrid,
30553
31150
  {
30554
31151
  insertLabel: t("tableMenu.insertTable"),
@@ -30559,8 +31156,8 @@ var EditorToolbar = ({
30559
31156
  }
30560
31157
  }
30561
31158
  ),
30562
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30563
- /* @__PURE__ */ jsx86(
31159
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31160
+ /* @__PURE__ */ jsx88(
30564
31161
  DropdownMenuItem,
30565
31162
  {
30566
31163
  icon: AlignLeft,
@@ -30570,7 +31167,7 @@ var EditorToolbar = ({
30570
31167
  disabled: !hasTableContext
30571
31168
  }
30572
31169
  ),
30573
- /* @__PURE__ */ jsx86(
31170
+ /* @__PURE__ */ jsx88(
30574
31171
  DropdownMenuItem,
30575
31172
  {
30576
31173
  icon: AlignCenter,
@@ -30580,7 +31177,7 @@ var EditorToolbar = ({
30580
31177
  disabled: !hasTableContext
30581
31178
  }
30582
31179
  ),
30583
- /* @__PURE__ */ jsx86(
31180
+ /* @__PURE__ */ jsx88(
30584
31181
  DropdownMenuItem,
30585
31182
  {
30586
31183
  icon: AlignRight,
@@ -30590,8 +31187,8 @@ var EditorToolbar = ({
30590
31187
  disabled: !hasTableContext
30591
31188
  }
30592
31189
  ),
30593
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30594
- /* @__PURE__ */ jsx86(
31190
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31191
+ /* @__PURE__ */ jsx88(
30595
31192
  DropdownMenuItem,
30596
31193
  {
30597
31194
  icon: ArrowLeft,
@@ -30600,7 +31197,7 @@ var EditorToolbar = ({
30600
31197
  disabled: !hasTableContext || !editor.can().addColumnBefore()
30601
31198
  }
30602
31199
  ),
30603
- /* @__PURE__ */ jsx86(
31200
+ /* @__PURE__ */ jsx88(
30604
31201
  DropdownMenuItem,
30605
31202
  {
30606
31203
  icon: ArrowDown,
@@ -30609,7 +31206,7 @@ var EditorToolbar = ({
30609
31206
  disabled: !hasTableContext || !editor.can().addColumnAfter()
30610
31207
  }
30611
31208
  ),
30612
- /* @__PURE__ */ jsx86(
31209
+ /* @__PURE__ */ jsx88(
30613
31210
  DropdownMenuItem,
30614
31211
  {
30615
31212
  icon: ArrowUp,
@@ -30618,7 +31215,7 @@ var EditorToolbar = ({
30618
31215
  disabled: !hasTableContext || !editor.can().addRowBefore()
30619
31216
  }
30620
31217
  ),
30621
- /* @__PURE__ */ jsx86(
31218
+ /* @__PURE__ */ jsx88(
30622
31219
  DropdownMenuItem,
30623
31220
  {
30624
31221
  icon: ArrowRight,
@@ -30627,8 +31224,8 @@ var EditorToolbar = ({
30627
31224
  disabled: !hasTableContext || !editor.can().addRowAfter()
30628
31225
  }
30629
31226
  ),
30630
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30631
- /* @__PURE__ */ jsx86(
31227
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31228
+ /* @__PURE__ */ jsx88(
30632
31229
  DropdownMenuItem,
30633
31230
  {
30634
31231
  icon: TableIcon,
@@ -30637,7 +31234,7 @@ var EditorToolbar = ({
30637
31234
  disabled: !hasTableContext || !editor.can().toggleHeaderRow()
30638
31235
  }
30639
31236
  ),
30640
- /* @__PURE__ */ jsx86(
31237
+ /* @__PURE__ */ jsx88(
30641
31238
  DropdownMenuItem,
30642
31239
  {
30643
31240
  icon: TableIcon,
@@ -30646,8 +31243,8 @@ var EditorToolbar = ({
30646
31243
  disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
30647
31244
  }
30648
31245
  ),
30649
- /* @__PURE__ */ jsx86("div", { className: "my-1 border-t" }),
30650
- /* @__PURE__ */ jsx86(
31246
+ /* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
31247
+ /* @__PURE__ */ jsx88(
30651
31248
  DropdownMenuItem,
30652
31249
  {
30653
31250
  icon: Trash22,
@@ -30656,7 +31253,7 @@ var EditorToolbar = ({
30656
31253
  disabled: !hasTableContext || !editor.can().deleteColumn()
30657
31254
  }
30658
31255
  ),
30659
- /* @__PURE__ */ jsx86(
31256
+ /* @__PURE__ */ jsx88(
30660
31257
  DropdownMenuItem,
30661
31258
  {
30662
31259
  icon: Trash22,
@@ -30665,7 +31262,7 @@ var EditorToolbar = ({
30665
31262
  disabled: !hasTableContext || !editor.can().deleteRow()
30666
31263
  }
30667
31264
  ),
30668
- /* @__PURE__ */ jsx86(
31265
+ /* @__PURE__ */ jsx88(
30669
31266
  DropdownMenuItem,
30670
31267
  {
30671
31268
  icon: Trash22,
@@ -30677,48 +31274,48 @@ var EditorToolbar = ({
30677
31274
  ]
30678
31275
  }
30679
31276
  ),
30680
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30681
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx86(UndoIcon, { className: "w-4 h-4" }) }),
30682
- /* @__PURE__ */ jsx86(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx86(RedoIcon, { className: "w-4 h-4" }) }),
30683
- hasTableContext && /* @__PURE__ */ jsxs72(Fragment28, { children: [
30684
- /* @__PURE__ */ jsx86(ToolbarDivider, {}),
30685
- /* @__PURE__ */ jsx86(
31277
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
31278
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: t("toolbar.undo"), children: /* @__PURE__ */ jsx88(UndoIcon, { className: "w-4 h-4" }) }),
31279
+ /* @__PURE__ */ jsx88(ToolbarButton, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: t("toolbar.redo"), children: /* @__PURE__ */ jsx88(RedoIcon, { className: "w-4 h-4" }) }),
31280
+ hasTableContext && /* @__PURE__ */ jsxs73(Fragment28, { children: [
31281
+ /* @__PURE__ */ jsx88(ToolbarDivider, {}),
31282
+ /* @__PURE__ */ jsx88(
30686
31283
  ToolbarButton,
30687
31284
  {
30688
31285
  onClick: () => editor.chain().focus().addColumnBefore().run(),
30689
31286
  disabled: !editor.can().addColumnBefore(),
30690
31287
  title: t("tableMenu.addColumnBefore"),
30691
- children: /* @__PURE__ */ jsx86(ArrowLeft, { className: "w-4 h-4" })
31288
+ children: /* @__PURE__ */ jsx88(ArrowLeft, { className: "w-4 h-4" })
30692
31289
  }
30693
31290
  ),
30694
- /* @__PURE__ */ jsx86(
31291
+ /* @__PURE__ */ jsx88(
30695
31292
  ToolbarButton,
30696
31293
  {
30697
31294
  onClick: () => editor.chain().focus().addColumnAfter().run(),
30698
31295
  disabled: !editor.can().addColumnAfter(),
30699
31296
  title: t("tableMenu.addColumnAfter"),
30700
- children: /* @__PURE__ */ jsx86(ArrowRight, { className: "w-4 h-4" })
31297
+ children: /* @__PURE__ */ jsx88(ArrowRight, { className: "w-4 h-4" })
30701
31298
  }
30702
31299
  ),
30703
- /* @__PURE__ */ jsx86(
31300
+ /* @__PURE__ */ jsx88(
30704
31301
  ToolbarButton,
30705
31302
  {
30706
31303
  onClick: () => editor.chain().focus().addRowBefore().run(),
30707
31304
  disabled: !editor.can().addRowBefore(),
30708
31305
  title: t("tableMenu.addRowBefore"),
30709
- children: /* @__PURE__ */ jsx86(ArrowUp, { className: "w-4 h-4" })
31306
+ children: /* @__PURE__ */ jsx88(ArrowUp, { className: "w-4 h-4" })
30710
31307
  }
30711
31308
  ),
30712
- /* @__PURE__ */ jsx86(
31309
+ /* @__PURE__ */ jsx88(
30713
31310
  ToolbarButton,
30714
31311
  {
30715
31312
  onClick: () => editor.chain().focus().addRowAfter().run(),
30716
31313
  disabled: !editor.can().addRowAfter(),
30717
31314
  title: t("tableMenu.addRowAfter"),
30718
- children: /* @__PURE__ */ jsx86(ArrowDown, { className: "w-4 h-4" })
31315
+ children: /* @__PURE__ */ jsx88(ArrowDown, { className: "w-4 h-4" })
30719
31316
  }
30720
31317
  ),
30721
- /* @__PURE__ */ jsx86(
31318
+ /* @__PURE__ */ jsx88(
30722
31319
  ToolbarButton,
30723
31320
  {
30724
31321
  onClick: () => {
@@ -30731,7 +31328,7 @@ var EditorToolbar = ({
30731
31328
  active: canSplitCell,
30732
31329
  disabled: !canMergeCells && !canSplitCell,
30733
31330
  title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
30734
- children: /* @__PURE__ */ jsx86(TableCellsMerge, { className: "w-4 h-4" })
31331
+ children: /* @__PURE__ */ jsx88(TableCellsMerge, { className: "w-4 h-4" })
30735
31332
  }
30736
31333
  )
30737
31334
  ] })
@@ -30741,7 +31338,7 @@ var EditorToolbar = ({
30741
31338
  // src/components/UEditor/menus.tsx
30742
31339
  import { useCallback as useCallback22, useEffect as useEffect36, useMemo as useMemo23, useRef as useRef33, useState as useState48 } from "react";
30743
31340
  import { useEditorState as useEditorState2 } from "@tiptap/react";
30744
- import { isInTable as isSelectionInTable, setCellAttr as setCellAttr2 } from "@tiptap/pm/tables";
31341
+ import { isInTable as isSelectionInTable, setCellAttr as setCellAttr3 } from "@tiptap/pm/tables";
30745
31342
  import { createPortal as createPortal8 } from "react-dom";
30746
31343
  import {
30747
31344
  AlignCenter as AlignCenter2,
@@ -30764,11 +31361,14 @@ import {
30764
31361
  Edit2,
30765
31362
  Unlink,
30766
31363
  ExternalLink as ExternalLink3,
30767
- Sigma as Sigma2
31364
+ Sigma as Sigma2,
31365
+ AlignStartVertical as AlignStartVertical2,
31366
+ AlignCenterVertical as AlignCenterVertical2,
31367
+ AlignEndVertical as AlignEndVertical2
30768
31368
  } from "lucide-react";
30769
31369
 
30770
31370
  // src/components/UEditor/table-formula-commands.ts
30771
- import { selectedRect as selectedRect2, setCellAttr, TableMap as TableMap3 } from "@tiptap/pm/tables";
31371
+ import { selectedRect as selectedRect2, setCellAttr as setCellAttr2, TableMap as TableMap3 } from "@tiptap/pm/tables";
30772
31372
 
30773
31373
  // src/components/UEditor/table-formula.ts
30774
31374
  var CELL_ADDRESS_RE = /^([A-Z]+)([1-9]\d*)$/i;
@@ -31340,8 +31940,8 @@ function setSelectedTableCellFormula(editor, formula) {
31340
31940
  const normalized = normalizeFormulaInput(formula);
31341
31941
  const { state, view } = editor;
31342
31942
  if (!normalized) {
31343
- const clearedFormula = setCellAttr("formula", null)(state, view.dispatch.bind(view));
31344
- const clearedValue2 = setCellAttr("computedValue", null)(editor.state, view.dispatch.bind(view));
31943
+ const clearedFormula = setCellAttr2("formula", null)(state, view.dispatch.bind(view));
31944
+ const clearedValue2 = setCellAttr2("computedValue", null)(editor.state, view.dispatch.bind(view));
31345
31945
  if (clearedFormula || clearedValue2) {
31346
31946
  recalculateActiveTableFormulas(editor);
31347
31947
  view.focus();
@@ -31350,8 +31950,8 @@ function setSelectedTableCellFormula(editor, formula) {
31350
31950
  }
31351
31951
  return false;
31352
31952
  }
31353
- const appliedFormula = setCellAttr("formula", normalized)(state, view.dispatch.bind(view));
31354
- const clearedValue = setCellAttr("computedValue", null)(editor.state, view.dispatch.bind(view));
31953
+ const appliedFormula = setCellAttr2("formula", normalized)(state, view.dispatch.bind(view));
31954
+ const clearedValue = setCellAttr2("computedValue", null)(editor.state, view.dispatch.bind(view));
31355
31955
  if (appliedFormula || clearedValue) {
31356
31956
  recalculateActiveTableFormulas(editor);
31357
31957
  view.focus();
@@ -31366,7 +31966,7 @@ function clearSelectedTableCellFormula(editor) {
31366
31966
  function setSelectedTableCellNumberFormat(editor, numberFormat) {
31367
31967
  const value = numberFormat && numberFormat !== "text" ? numberFormat : null;
31368
31968
  const { state, view } = editor;
31369
- const applied = setCellAttr("numberFormat", value)(state, view.dispatch.bind(view));
31969
+ const applied = setCellAttr2("numberFormat", value)(state, view.dispatch.bind(view));
31370
31970
  if (!applied) return false;
31371
31971
  recalculateSelectedTable(editor);
31372
31972
  view.focus();
@@ -31560,21 +32160,21 @@ function recalculateAllTableFormulas(editor) {
31560
32160
  }
31561
32161
 
31562
32162
  // src/components/UEditor/menus.tsx
31563
- import { Fragment as Fragment29, jsx as jsx87, jsxs as jsxs73 } from "react/jsx-runtime";
32163
+ import { Fragment as Fragment29, jsx as jsx89, jsxs as jsxs74 } from "react/jsx-runtime";
31564
32164
  function applyTableCellBackground(editor, color) {
31565
32165
  const value = color || null;
31566
32166
  const { state, view } = editor;
31567
- const applied = setCellAttr2("backgroundColor", value)(state, view.dispatch.bind(view));
32167
+ const applied = setCellAttr3("backgroundColor", value)(state, view.dispatch.bind(view));
31568
32168
  if (applied) {
31569
32169
  view.focus();
31570
32170
  return;
31571
32171
  }
31572
32172
  editor.chain().focus().setCellAttribute("backgroundColor", value).run();
31573
32173
  }
31574
- function applyTableCellAttribute(editor, name, value, options = {}) {
32174
+ function applyTableCellAttribute2(editor, name, value, options = {}) {
31575
32175
  const shouldFocus = options.focus ?? true;
31576
32176
  const { state, view } = editor;
31577
- const applied = setCellAttr2(name, value)(state, view.dispatch.bind(view));
32177
+ const applied = setCellAttr3(name, value)(state, view.dispatch.bind(view));
31578
32178
  if (applied) {
31579
32179
  if (shouldFocus) view.focus();
31580
32180
  return;
@@ -31585,7 +32185,7 @@ function applyTableCellAttribute(editor, name, value, options = {}) {
31585
32185
  }
31586
32186
  function BorderStylePreviewIcon({ style }) {
31587
32187
  const isNone = style === "none";
31588
- return /* @__PURE__ */ jsx87(
32188
+ return /* @__PURE__ */ jsx89(
31589
32189
  "span",
31590
32190
  {
31591
32191
  "aria-hidden": "true",
@@ -31597,7 +32197,7 @@ function BorderStylePreviewIcon({ style }) {
31597
32197
  borderStyle: style,
31598
32198
  borderWidth: style === "double" ? 3 : 2
31599
32199
  },
31600
- children: isNone && /* @__PURE__ */ jsx87("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
32200
+ children: isNone && /* @__PURE__ */ jsx89("span", { className: "absolute left-1/2 top-0 h-full w-px -translate-x-1/2 rotate-45 bg-muted-foreground/70" })
31601
32201
  }
31602
32202
  );
31603
32203
  }
@@ -31638,6 +32238,7 @@ var BubbleMenuContent = ({
31638
32238
  const currentCellNumberFormat = normalizeStyleValue(editor.getAttributes("tableCell").numberFormat || editor.getAttributes("tableHeader").numberFormat) || "text";
31639
32239
  const currentCellBorderStyle = editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || "solid";
31640
32240
  const currentCellBorderWidth = editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth || "1px";
32241
+ const currentCellVerticalAlign = normalizeStyleValue(editor.getAttributes("tableCell").verticalAlign || editor.getAttributes("tableHeader").verticalAlign) || "";
31641
32242
  const isInTable2 = isSelectionInTable(editor.state);
31642
32243
  const canMergeCells = isInTable2 && editor.can().mergeCells();
31643
32244
  const canSplitCell = isInTable2 && editor.can().splitCell();
@@ -31693,18 +32294,18 @@ var BubbleMenuContent = ({
31693
32294
  onRequestClose?.();
31694
32295
  }, [onKeepOpenChange, onLinkInputOpenChange, onRequestClose]);
31695
32296
  const applyTableCellAttributeAndClose = useCallback22((name, value) => {
31696
- applyTableCellAttribute(editor, name, value, { focus: false });
32297
+ applyTableCellAttribute2(editor, name, value, { focus: false });
31697
32298
  closeTransientPanels();
31698
32299
  }, [closeTransientPanels, editor]);
31699
32300
  const clearTableCellBorderAndClose = useCallback22(() => {
31700
- applyTableCellAttribute(editor, "borderColor", null, { focus: false });
31701
- applyTableCellAttribute(editor, "borderStyle", null, { focus: false });
31702
- applyTableCellAttribute(editor, "borderWidth", null, { focus: false });
32301
+ applyTableCellAttribute2(editor, "borderColor", null, { focus: false });
32302
+ applyTableCellAttribute2(editor, "borderStyle", null, { focus: false });
32303
+ applyTableCellAttribute2(editor, "borderWidth", null, { focus: false });
31703
32304
  closeTransientPanels();
31704
32305
  }, [closeTransientPanels, editor]);
31705
32306
  const applyTableCellBorderColorAndClose = useCallback22((color) => {
31706
32307
  const value = color || null;
31707
- applyTableCellAttribute(editor, "borderColor", value, { focus: false });
32308
+ applyTableCellAttribute2(editor, "borderColor", value, { focus: false });
31708
32309
  closeTransientPanels();
31709
32310
  }, [closeTransientPanels, editor]);
31710
32311
  const closeColorPalette = useCallback22(() => {
@@ -31740,7 +32341,7 @@ var BubbleMenuContent = ({
31740
32341
  };
31741
32342
  }, [editor, showLinkInput]);
31742
32343
  if (showLinkInput) {
31743
- return /* @__PURE__ */ jsx87(
32344
+ return /* @__PURE__ */ jsx89(
31744
32345
  LinkInput,
31745
32346
  {
31746
32347
  initialUrl: editor.getAttributes("link").href || "",
@@ -31761,17 +32362,17 @@ var BubbleMenuContent = ({
31761
32362
  const isHighlightPalette = activeColorPalette === "highlight";
31762
32363
  if (activeColorPalette === "cell-border") {
31763
32364
  const currentBorderColor = editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || "currentColor";
31764
- return /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", "data-ueditor-keep-open": true, children: [
31765
- /* @__PURE__ */ jsx87("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
31766
- /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-1", children: [
31767
- /* @__PURE__ */ jsx87("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
31768
- /* @__PURE__ */ jsx87("div", { className: "grid grid-cols-3 gap-1", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
32365
+ return /* @__PURE__ */ jsxs74("div", { className: "flex flex-col gap-2 p-2 w-56 text-sm", "data-ueditor-keep-open": true, children: [
32366
+ /* @__PURE__ */ jsx89("div", { className: "font-semibold text-xs text-muted-foreground uppercase tracking-wider mb-1", children: t("tableMenu.cellBorder") || "Cell Borders" }),
32367
+ /* @__PURE__ */ jsxs74("div", { className: "flex flex-col gap-1", children: [
32368
+ /* @__PURE__ */ jsx89("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderStyle") || "Border Style" }),
32369
+ /* @__PURE__ */ jsx89("div", { className: "grid grid-cols-3 gap-1", role: "group", "aria-label": t("tableMenu.borderStyle") || "Border Style", children: [
31769
32370
  ["solid", "Solid"],
31770
32371
  ["dashed", "Dashed"],
31771
32372
  ["dotted", "Dotted"],
31772
32373
  ["double", "Double"],
31773
32374
  ["none", "None"]
31774
- ].map(([style, label]) => /* @__PURE__ */ jsxs73(
32375
+ ].map(([style, label]) => /* @__PURE__ */ jsxs74(
31775
32376
  "button",
31776
32377
  {
31777
32378
  type: "button",
@@ -31783,16 +32384,16 @@ var BubbleMenuContent = ({
31783
32384
  currentCellBorderStyle === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
31784
32385
  ),
31785
32386
  children: [
31786
- /* @__PURE__ */ jsx87(BorderStylePreviewIcon, { style }),
31787
- /* @__PURE__ */ jsx87("span", { children: label })
32387
+ /* @__PURE__ */ jsx89(BorderStylePreviewIcon, { style }),
32388
+ /* @__PURE__ */ jsx89("span", { children: label })
31788
32389
  ]
31789
32390
  },
31790
32391
  style
31791
32392
  )) })
31792
32393
  ] }),
31793
- /* @__PURE__ */ jsxs73("div", { className: "flex flex-col gap-1", children: [
31794
- /* @__PURE__ */ jsx87("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
31795
- /* @__PURE__ */ jsx87("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__ */ jsx87(
32394
+ /* @__PURE__ */ jsxs74("div", { className: "flex flex-col gap-1", children: [
32395
+ /* @__PURE__ */ jsx89("label", { className: "text-xs text-muted-foreground", children: t("tableMenu.borderWidth") || "Border Width" }),
32396
+ /* @__PURE__ */ jsx89("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__ */ jsx89(
31796
32397
  "button",
31797
32398
  {
31798
32399
  type: "button",
@@ -31808,15 +32409,15 @@ var BubbleMenuContent = ({
31808
32409
  width
31809
32410
  )) })
31810
32411
  ] }),
31811
- /* @__PURE__ */ jsxs73(
32412
+ /* @__PURE__ */ jsxs74(
31812
32413
  "button",
31813
32414
  {
31814
32415
  type: "button",
31815
32416
  onClick: () => setActiveColorPalette("cell-border-color"),
31816
32417
  className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
31817
32418
  children: [
31818
- /* @__PURE__ */ jsx87("span", { children: t("tableMenu.borderColor") || "Border Color" }),
31819
- /* @__PURE__ */ jsx87(
32419
+ /* @__PURE__ */ jsx89("span", { children: t("tableMenu.borderColor") || "Border Color" }),
32420
+ /* @__PURE__ */ jsx89(
31820
32421
  "span",
31821
32422
  {
31822
32423
  className: "w-4 h-4 rounded-full border border-border",
@@ -31828,7 +32429,7 @@ var BubbleMenuContent = ({
31828
32429
  ]
31829
32430
  }
31830
32431
  ),
31831
- /* @__PURE__ */ jsx87("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: /* @__PURE__ */ jsx87(
32432
+ /* @__PURE__ */ jsx89("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: /* @__PURE__ */ jsx89(
31832
32433
  "button",
31833
32434
  {
31834
32435
  type: "button",
@@ -31842,7 +32443,7 @@ var BubbleMenuContent = ({
31842
32443
  }
31843
32444
  if (activeColorPalette === "cell-border-color") {
31844
32445
  const currentBorderColor = normalizeStyleValue(editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor) || "";
31845
- return /* @__PURE__ */ jsx87("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx87(
32446
+ return /* @__PURE__ */ jsx89("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx89(
31846
32447
  EditorColorPalette,
31847
32448
  {
31848
32449
  colors: borderColors,
@@ -31852,7 +32453,7 @@ var BubbleMenuContent = ({
31852
32453
  }
31853
32454
  ) });
31854
32455
  }
31855
- return /* @__PURE__ */ jsx87("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx87(
32456
+ return /* @__PURE__ */ jsx89("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx89(
31856
32457
  EditorColorPalette,
31857
32458
  {
31858
32459
  colors: isTextPalette ? textColors : highlightColors,
@@ -31863,32 +32464,32 @@ var BubbleMenuContent = ({
31863
32464
  ) });
31864
32465
  }
31865
32466
  if (isImageSelected) {
31866
- return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5 p-1", children: [
31867
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx87(AlignCenter2, { className: "w-4 h-4" }) }),
31868
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx87(AlignLeft2, { className: "w-4 h-4" }) }),
31869
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx87(AlignRight2, { className: "w-4 h-4" }) }),
31870
- /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31871
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "S" }) }),
31872
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "M" }) }),
31873
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx87("span", { className: "text-[10px] font-semibold", children: "L" }) }),
31874
- /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
31875
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx87(RotateCcw3, { className: "w-4 h-4" }) }),
31876
- /* @__PURE__ */ jsx87(
32467
+ return /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-0.5 p-1", children: [
32468
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageLayout(editor, "block"), active: imageLayout === "block", title: t("toolbar.imageLayoutBlock"), children: /* @__PURE__ */ jsx89(AlignCenter2, { className: "w-4 h-4" }) }),
32469
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageLayout(editor, "left"), active: imageLayout === "left", title: t("toolbar.imageLayoutLeft"), children: /* @__PURE__ */ jsx89(AlignLeft2, { className: "w-4 h-4" }) }),
32470
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageLayout(editor, "right"), active: imageLayout === "right", title: t("toolbar.imageLayoutRight"), children: /* @__PURE__ */ jsx89(AlignRight2, { className: "w-4 h-4" }) }),
32471
+ /* @__PURE__ */ jsx89("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32472
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "sm"), active: imageWidthPreset === "sm", title: t("toolbar.imageWidthSm"), children: /* @__PURE__ */ jsx89("span", { className: "text-[10px] font-semibold", children: "S" }) }),
32473
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "md"), active: imageWidthPreset === "md", title: t("toolbar.imageWidthMd"), children: /* @__PURE__ */ jsx89("span", { className: "text-[10px] font-semibold", children: "M" }) }),
32474
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => applyImageWidthPreset(editor, "lg"), active: imageWidthPreset === "lg", title: t("toolbar.imageWidthLg"), children: /* @__PURE__ */ jsx89("span", { className: "text-[10px] font-semibold", children: "L" }) }),
32475
+ /* @__PURE__ */ jsx89("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32476
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => resetImageSize(editor), title: t("toolbar.imageResetSize"), children: /* @__PURE__ */ jsx89(RotateCcw3, { className: "w-4 h-4" }) }),
32477
+ /* @__PURE__ */ jsx89(
31877
32478
  ToolbarButton,
31878
32479
  {
31879
32480
  onClick: () => deleteSelectedImage(editor),
31880
32481
  title: t("toolbar.imageDelete"),
31881
32482
  className: "text-destructive hover:text-destructive",
31882
- children: /* @__PURE__ */ jsx87(Trash23, { className: "w-4 h-4" })
32483
+ children: /* @__PURE__ */ jsx89(Trash23, { className: "w-4 h-4" })
31883
32484
  }
31884
32485
  )
31885
32486
  ] });
31886
32487
  }
31887
32488
  if (showFormulaPanel && isInTable2) {
31888
- return /* @__PURE__ */ jsxs73("div", { className: "w-72 p-2", children: [
31889
- /* @__PURE__ */ jsxs73("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31890
- /* @__PURE__ */ jsx87("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
31891
- /* @__PURE__ */ jsx87(
32489
+ return /* @__PURE__ */ jsxs74("div", { className: "w-72 p-2", children: [
32490
+ /* @__PURE__ */ jsxs74("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
32491
+ /* @__PURE__ */ jsx89("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("tableMenu.formula") || "Formula" }),
32492
+ /* @__PURE__ */ jsx89(
31892
32493
  "button",
31893
32494
  {
31894
32495
  type: "button",
@@ -31901,7 +32502,7 @@ var BubbleMenuContent = ({
31901
32502
  }
31902
32503
  )
31903
32504
  ] }),
31904
- /* @__PURE__ */ jsx87("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx87(
32505
+ /* @__PURE__ */ jsx89("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx89(
31905
32506
  "input",
31906
32507
  {
31907
32508
  value: formulaDraft,
@@ -31922,15 +32523,15 @@ var BubbleMenuContent = ({
31922
32523
  className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
31923
32524
  }
31924
32525
  ) }),
31925
- /* @__PURE__ */ jsxs73("div", { className: "mt-2", children: [
31926
- /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
31927
- /* @__PURE__ */ jsx87("div", { className: "grid grid-cols-5 gap-1", children: [
32526
+ /* @__PURE__ */ jsxs74("div", { className: "mt-2", children: [
32527
+ /* @__PURE__ */ jsx89("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("tableMenu.numberFormat") || "Number format" }),
32528
+ /* @__PURE__ */ jsx89("div", { className: "grid grid-cols-5 gap-1", children: [
31928
32529
  ["text", "Text"],
31929
32530
  ["number", "123"],
31930
32531
  ["currency", "$"],
31931
32532
  ["percent", "%"],
31932
32533
  ["date", "Date"]
31933
- ].map(([format, label]) => /* @__PURE__ */ jsx87(
32534
+ ].map(([format, label]) => /* @__PURE__ */ jsx89(
31934
32535
  "button",
31935
32536
  {
31936
32537
  type: "button",
@@ -31944,8 +32545,8 @@ var BubbleMenuContent = ({
31944
32545
  format
31945
32546
  )) })
31946
32547
  ] }),
31947
- /* @__PURE__ */ jsxs73("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
31948
- /* @__PURE__ */ jsx87(
32548
+ /* @__PURE__ */ jsxs74("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
32549
+ /* @__PURE__ */ jsx89(
31949
32550
  "button",
31950
32551
  {
31951
32552
  type: "button",
@@ -31958,7 +32559,7 @@ var BubbleMenuContent = ({
31958
32559
  children: t("tableMenu.apply") || "Apply"
31959
32560
  }
31960
32561
  ),
31961
- /* @__PURE__ */ jsx87(
32562
+ /* @__PURE__ */ jsx89(
31962
32563
  "button",
31963
32564
  {
31964
32565
  type: "button",
@@ -31970,7 +32571,7 @@ var BubbleMenuContent = ({
31970
32571
  children: t("tableMenu.clear") || "Clear"
31971
32572
  }
31972
32573
  ),
31973
- /* @__PURE__ */ jsx87(
32574
+ /* @__PURE__ */ jsx89(
31974
32575
  "button",
31975
32576
  {
31976
32577
  type: "button",
@@ -31983,10 +32584,10 @@ var BubbleMenuContent = ({
31983
32584
  ] });
31984
32585
  }
31985
32586
  if (showTypographyPanel) {
31986
- return /* @__PURE__ */ jsxs73("div", { className: "w-72 p-2", children: [
31987
- /* @__PURE__ */ jsxs73("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
31988
- /* @__PURE__ */ jsx87("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
31989
- /* @__PURE__ */ jsx87(
32587
+ return /* @__PURE__ */ jsxs74("div", { className: "w-72 p-2", children: [
32588
+ /* @__PURE__ */ jsxs74("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
32589
+ /* @__PURE__ */ jsx89("span", { className: "px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground", children: t("toolbar.textStyle") }),
32590
+ /* @__PURE__ */ jsx89(
31990
32591
  "button",
31991
32592
  {
31992
32593
  type: "button",
@@ -31996,11 +32597,11 @@ var BubbleMenuContent = ({
31996
32597
  }
31997
32598
  )
31998
32599
  ] }),
31999
- /* @__PURE__ */ jsxs73("div", { className: "space-y-2", children: [
32000
- /* @__PURE__ */ jsxs73("div", { children: [
32001
- /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
32002
- /* @__PURE__ */ jsxs73("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
32003
- /* @__PURE__ */ jsx87(
32600
+ /* @__PURE__ */ jsxs74("div", { className: "space-y-2", children: [
32601
+ /* @__PURE__ */ jsxs74("div", { children: [
32602
+ /* @__PURE__ */ jsx89("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.fontSize") }),
32603
+ /* @__PURE__ */ jsxs74("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: [
32604
+ /* @__PURE__ */ jsx89(
32004
32605
  "input",
32005
32606
  {
32006
32607
  type: "number",
@@ -32024,8 +32625,8 @@ var BubbleMenuContent = ({
32024
32625
  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"
32025
32626
  }
32026
32627
  ),
32027
- /* @__PURE__ */ jsx87("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
32028
- /* @__PURE__ */ jsx87(
32628
+ /* @__PURE__ */ jsx89("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
32629
+ /* @__PURE__ */ jsx89(
32029
32630
  "button",
32030
32631
  {
32031
32632
  type: "button",
@@ -32035,12 +32636,12 @@ var BubbleMenuContent = ({
32035
32636
  "flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
32036
32637
  showFontSizeOptions && "bg-primary/10 text-primary"
32037
32638
  ),
32038
- children: /* @__PURE__ */ jsx87(ChevronDown9, { className: "h-4 w-4" })
32639
+ children: /* @__PURE__ */ jsx89(ChevronDown9, { className: "h-4 w-4" })
32039
32640
  }
32040
32641
  )
32041
32642
  ] }),
32042
- showFontSizeOptions && /* @__PURE__ */ jsxs73("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
32043
- /* @__PURE__ */ jsx87(
32643
+ showFontSizeOptions && /* @__PURE__ */ jsxs74("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
32644
+ /* @__PURE__ */ jsx89(
32044
32645
  "button",
32045
32646
  {
32046
32647
  type: "button",
@@ -32055,7 +32656,7 @@ var BubbleMenuContent = ({
32055
32656
  children: "A"
32056
32657
  }
32057
32658
  ),
32058
- quickFontSizes.map((option) => /* @__PURE__ */ jsx87(
32659
+ quickFontSizes.map((option) => /* @__PURE__ */ jsx89(
32059
32660
  "button",
32060
32661
  {
32061
32662
  type: "button",
@@ -32073,10 +32674,10 @@ var BubbleMenuContent = ({
32073
32674
  ))
32074
32675
  ] })
32075
32676
  ] }),
32076
- /* @__PURE__ */ jsxs73("div", { children: [
32077
- /* @__PURE__ */ jsx87("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
32078
- /* @__PURE__ */ jsxs73("div", { className: "grid grid-cols-4 gap-1", children: [
32079
- /* @__PURE__ */ jsx87(
32677
+ /* @__PURE__ */ jsxs74("div", { children: [
32678
+ /* @__PURE__ */ jsx89("div", { className: "mb-1 px-1 text-[11px] font-medium text-muted-foreground", children: t("toolbar.lineHeight") }),
32679
+ /* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-4 gap-1", children: [
32680
+ /* @__PURE__ */ jsx89(
32080
32681
  "button",
32081
32682
  {
32082
32683
  type: "button",
@@ -32088,7 +32689,7 @@ var BubbleMenuContent = ({
32088
32689
  children: "LH"
32089
32690
  }
32090
32691
  ),
32091
- quickLineHeights.map((option) => /* @__PURE__ */ jsx87(
32692
+ quickLineHeights.map((option) => /* @__PURE__ */ jsx89(
32092
32693
  "button",
32093
32694
  {
32094
32695
  type: "button",
@@ -32103,8 +32704,8 @@ var BubbleMenuContent = ({
32103
32704
  ))
32104
32705
  ] })
32105
32706
  ] }),
32106
- /* @__PURE__ */ jsxs73("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
32107
- /* @__PURE__ */ jsxs73(
32707
+ /* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
32708
+ /* @__PURE__ */ jsxs74(
32108
32709
  "button",
32109
32710
  {
32110
32711
  type: "button",
@@ -32114,12 +32715,12 @@ var BubbleMenuContent = ({
32114
32715
  editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
32115
32716
  ),
32116
32717
  children: [
32117
- /* @__PURE__ */ jsx87(SubscriptIcon2, { className: "h-4 w-4" }),
32718
+ /* @__PURE__ */ jsx89(SubscriptIcon2, { className: "h-4 w-4" }),
32118
32719
  t("toolbar.subscript")
32119
32720
  ]
32120
32721
  }
32121
32722
  ),
32122
- /* @__PURE__ */ jsxs73(
32723
+ /* @__PURE__ */ jsxs74(
32123
32724
  "button",
32124
32725
  {
32125
32726
  type: "button",
@@ -32129,7 +32730,7 @@ var BubbleMenuContent = ({
32129
32730
  editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
32130
32731
  ),
32131
32732
  children: [
32132
- /* @__PURE__ */ jsx87(SuperscriptIcon2, { className: "h-4 w-4" }),
32733
+ /* @__PURE__ */ jsx89(SuperscriptIcon2, { className: "h-4 w-4" }),
32133
32734
  t("toolbar.superscript")
32134
32735
  ]
32135
32736
  }
@@ -32138,22 +32739,23 @@ var BubbleMenuContent = ({
32138
32739
  ] })
32139
32740
  ] });
32140
32741
  }
32141
- return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5 p-1", children: [
32142
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx87(BoldIcon2, { className: "w-4 h-4" }) }),
32143
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx87(ItalicIcon2, { className: "w-4 h-4" }) }),
32144
- /* @__PURE__ */ jsx87(
32742
+ const VerticalAlignActiveIcon = currentCellVerticalAlign === "middle" ? AlignCenterVertical2 : currentCellVerticalAlign === "bottom" ? AlignEndVertical2 : AlignStartVertical2;
32743
+ return /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-0.5 p-1", children: [
32744
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => editor.chain().focus().toggleBold().run(), active: editor.isActive("bold"), title: t("toolbar.bold"), children: /* @__PURE__ */ jsx89(BoldIcon2, { className: "w-4 h-4" }) }),
32745
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => editor.chain().focus().toggleItalic().run(), active: editor.isActive("italic"), title: t("toolbar.italic"), children: /* @__PURE__ */ jsx89(ItalicIcon2, { className: "w-4 h-4" }) }),
32746
+ /* @__PURE__ */ jsx89(
32145
32747
  ToolbarButton,
32146
32748
  {
32147
32749
  onClick: () => editor.chain().focus().toggleUnderline().run(),
32148
32750
  active: editor.isActive("underline"),
32149
32751
  title: t("toolbar.underline"),
32150
- children: /* @__PURE__ */ jsx87(UnderlineIcon2, { className: "w-4 h-4" })
32752
+ children: /* @__PURE__ */ jsx89(UnderlineIcon2, { className: "w-4 h-4" })
32151
32753
  }
32152
32754
  ),
32153
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx87(StrikethroughIcon2, { className: "w-4 h-4" }) }),
32154
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx87(CodeIcon2, { className: "w-4 h-4" }) }),
32155
- /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32156
- /* @__PURE__ */ jsx87(
32755
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => editor.chain().focus().toggleStrike().run(), active: editor.isActive("strike"), title: t("toolbar.strike"), children: /* @__PURE__ */ jsx89(StrikethroughIcon2, { className: "w-4 h-4" }) }),
32756
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => editor.chain().focus().toggleCode().run(), active: editor.isActive("code"), title: t("toolbar.code"), children: /* @__PURE__ */ jsx89(CodeIcon2, { className: "w-4 h-4" }) }),
32757
+ /* @__PURE__ */ jsx89("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32758
+ /* @__PURE__ */ jsx89(
32157
32759
  ToolbarButton,
32158
32760
  {
32159
32761
  onMouseDown: () => {
@@ -32164,22 +32766,22 @@ var BubbleMenuContent = ({
32164
32766
  },
32165
32767
  active: editor.isActive("link"),
32166
32768
  title: t("toolbar.link"),
32167
- children: /* @__PURE__ */ jsx87(LinkIcon2, { className: "w-4 h-4" })
32769
+ children: /* @__PURE__ */ jsx89(LinkIcon2, { className: "w-4 h-4" })
32168
32770
  }
32169
32771
  ),
32170
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx87(TextColorIcon, { color: currentTextColor }) }),
32171
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx87(HighlightColorIcon, { color: currentHighlightColor }) }),
32172
- isInTable2 && /* @__PURE__ */ jsxs73(Fragment29, { children: [
32173
- /* @__PURE__ */ jsx87(
32772
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => setActiveColorPalette("text"), title: t("colors.textColor"), children: /* @__PURE__ */ jsx89(TextColorIcon, { color: currentTextColor }) }),
32773
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: () => setActiveColorPalette("highlight"), active: editor.isActive("highlight"), title: t("colors.highlight"), children: /* @__PURE__ */ jsx89(HighlightColorIcon, { color: currentHighlightColor }) }),
32774
+ isInTable2 && /* @__PURE__ */ jsxs74(Fragment29, { children: [
32775
+ /* @__PURE__ */ jsx89(
32174
32776
  ToolbarButton,
32175
32777
  {
32176
32778
  onClick: () => setActiveColorPalette("cell-bg"),
32177
32779
  active: Boolean(currentCellBgColor),
32178
32780
  title: t("tableMenu.cellBackground") || "Cell background",
32179
- children: /* @__PURE__ */ jsx87(CellBgColorIcon, { color: currentCellBgColor })
32781
+ children: /* @__PURE__ */ jsx89(CellBgColorIcon, { color: currentCellBgColor })
32180
32782
  }
32181
32783
  ),
32182
- /* @__PURE__ */ jsx87(
32784
+ /* @__PURE__ */ jsx89(
32183
32785
  ToolbarButton,
32184
32786
  {
32185
32787
  onMouseDown: () => {
@@ -32190,7 +32792,7 @@ var BubbleMenuContent = ({
32190
32792
  editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth
32191
32793
  ),
32192
32794
  title: t("tableMenu.cellBorder") || "Cell border",
32193
- children: /* @__PURE__ */ jsx87(
32795
+ children: /* @__PURE__ */ jsx89(
32194
32796
  CellBorderIcon,
32195
32797
  {
32196
32798
  color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
@@ -32198,7 +32800,7 @@ var BubbleMenuContent = ({
32198
32800
  )
32199
32801
  }
32200
32802
  ),
32201
- /* @__PURE__ */ jsx87(
32803
+ /* @__PURE__ */ jsx89(
32202
32804
  ToolbarButton,
32203
32805
  {
32204
32806
  onMouseDown: () => {
@@ -32210,10 +32812,10 @@ var BubbleMenuContent = ({
32210
32812
  },
32211
32813
  active: Boolean(currentCellFormula),
32212
32814
  title: t("tableMenu.formula") || "Formula",
32213
- children: /* @__PURE__ */ jsx87(Sigma2, { className: "w-4 h-4" })
32815
+ children: /* @__PURE__ */ jsx89(Sigma2, { className: "w-4 h-4" })
32214
32816
  }
32215
32817
  ),
32216
- /* @__PURE__ */ jsx87(
32818
+ /* @__PURE__ */ jsx89(
32217
32819
  ToolbarButton,
32218
32820
  {
32219
32821
  onClick: () => {
@@ -32226,17 +32828,69 @@ var BubbleMenuContent = ({
32226
32828
  active: canSplitCell,
32227
32829
  disabled: !canMergeCells && !canSplitCell,
32228
32830
  title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
32229
- children: /* @__PURE__ */ jsx87(TableCellsMerge2, { className: "w-4 h-4" })
32831
+ children: /* @__PURE__ */ jsx89(TableCellsMerge2, { className: "w-4 h-4" })
32832
+ }
32833
+ ),
32834
+ /* @__PURE__ */ jsxs74(
32835
+ DropdownMenu,
32836
+ {
32837
+ onOpenChange: (open) => {
32838
+ onKeepOpenChange?.(open);
32839
+ },
32840
+ trigger: /* @__PURE__ */ jsxs74(
32841
+ ToolbarButton,
32842
+ {
32843
+ onMouseDown: () => {
32844
+ onKeepOpenChange?.(true);
32845
+ },
32846
+ onClick: () => {
32847
+ },
32848
+ title: t("tableMenu.alignVertical") || "Vertical alignment",
32849
+ children: [
32850
+ /* @__PURE__ */ jsx89(VerticalAlignActiveIcon, { className: "w-4 h-4" }),
32851
+ /* @__PURE__ */ jsx89(ChevronDown9, { className: "w-3 h-3" })
32852
+ ]
32853
+ }
32854
+ ),
32855
+ children: [
32856
+ /* @__PURE__ */ jsx89(
32857
+ DropdownMenuItem,
32858
+ {
32859
+ icon: AlignStartVertical2,
32860
+ label: t("tableMenu.alignVerticalTop") || "Align top",
32861
+ onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "top", { focus: false }),
32862
+ active: currentCellVerticalAlign === "top"
32863
+ }
32864
+ ),
32865
+ /* @__PURE__ */ jsx89(
32866
+ DropdownMenuItem,
32867
+ {
32868
+ icon: AlignCenterVertical2,
32869
+ label: t("tableMenu.alignVerticalMiddle") || "Align middle",
32870
+ onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "middle", { focus: false }),
32871
+ active: currentCellVerticalAlign === "middle"
32872
+ }
32873
+ ),
32874
+ /* @__PURE__ */ jsx89(
32875
+ DropdownMenuItem,
32876
+ {
32877
+ icon: AlignEndVertical2,
32878
+ label: t("tableMenu.alignVerticalBottom") || "Align bottom",
32879
+ onClick: () => applyTableCellAttribute2(editor, "verticalAlign", "bottom", { focus: false }),
32880
+ active: currentCellVerticalAlign === "bottom"
32881
+ }
32882
+ )
32883
+ ]
32230
32884
  }
32231
32885
  )
32232
32886
  ] }),
32233
- /* @__PURE__ */ jsx87(
32887
+ /* @__PURE__ */ jsx89(
32234
32888
  ToolbarButton,
32235
32889
  {
32236
32890
  onClick: () => setShowTypographyPanel(true),
32237
32891
  active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
32238
32892
  title: t("toolbar.textStyle"),
32239
- children: /* @__PURE__ */ jsx87(Type3, { className: "w-4 h-4" })
32893
+ children: /* @__PURE__ */ jsx89(Type3, { className: "w-4 h-4" })
32240
32894
  }
32241
32895
  )
32242
32896
  ] });
@@ -32250,12 +32904,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
32250
32904
  const handleUnlink = () => {
32251
32905
  editor.chain().focus().unsetLink().run();
32252
32906
  };
32253
- return /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
32254
- /* @__PURE__ */ jsx87("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
32255
- /* @__PURE__ */ jsx87("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32256
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx87(ExternalLink3, { className: "w-4 h-4" }) }),
32257
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx87(Edit2, { className: "w-4 h-4" }) }),
32258
- /* @__PURE__ */ jsx87(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx87(Unlink, { className: "w-4 h-4" }) })
32907
+ return /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-1 p-1 max-w-sm", children: [
32908
+ /* @__PURE__ */ jsx89("span", { className: "text-xs text-muted-foreground font-mono px-2 truncate max-w-45", children: url }),
32909
+ /* @__PURE__ */ jsx89("div", { className: "w-px h-6 bg-border/50 mx-1" }),
32910
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: handleOpen, title: t("linkPreview.open") || "Open link", children: /* @__PURE__ */ jsx89(ExternalLink3, { className: "w-4 h-4" }) }),
32911
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: onEdit, title: t("linkPreview.edit") || "Edit link", children: /* @__PURE__ */ jsx89(Edit2, { className: "w-4 h-4" }) }),
32912
+ /* @__PURE__ */ jsx89(ToolbarButton, { onClick: handleUnlink, title: t("linkPreview.unlink") || "Remove link", className: "text-destructive hover:text-destructive", children: /* @__PURE__ */ jsx89(Unlink, { className: "w-4 h-4" }) })
32259
32913
  ] });
32260
32914
  };
32261
32915
  var CustomBubbleMenu = ({
@@ -32376,7 +33030,7 @@ var CustomBubbleMenu = ({
32376
33030
  }, [editor]);
32377
33031
  if (!isVisible) return null;
32378
33032
  return createPortal8(
32379
- /* @__PURE__ */ jsx87(
33033
+ /* @__PURE__ */ jsx89(
32380
33034
  "div",
32381
33035
  {
32382
33036
  ref: menuRef,
@@ -32396,7 +33050,7 @@ var CustomBubbleMenu = ({
32396
33050
  }
32397
33051
  e.preventDefault();
32398
33052
  },
32399
- children: editor.isActive("link") && !keepOpenRef.current && !linkInputOpen ? /* @__PURE__ */ jsx87(
33053
+ children: editor.isActive("link") && !keepOpenRef.current && !linkInputOpen ? /* @__PURE__ */ jsx89(
32400
33054
  LinkPreviewContent,
32401
33055
  {
32402
33056
  editor,
@@ -32405,7 +33059,7 @@ var CustomBubbleMenu = ({
32405
33059
  setKeepOpen(true);
32406
33060
  }
32407
33061
  }
32408
- ) : /* @__PURE__ */ jsx87(
33062
+ ) : /* @__PURE__ */ jsx89(
32409
33063
  BubbleMenuContent,
32410
33064
  {
32411
33065
  editor,
@@ -32424,25 +33078,25 @@ var CustomBubbleMenu = ({
32424
33078
  };
32425
33079
 
32426
33080
  // src/components/UEditor/CharacterCount.tsx
32427
- import { jsxs as jsxs74 } from "react/jsx-runtime";
33081
+ import { jsxs as jsxs75 } from "react/jsx-runtime";
32428
33082
  var CharacterCountDisplay = ({ editor, maxCharacters }) => {
32429
33083
  const t = useSmartTranslations("UEditor");
32430
33084
  const storage = editor.storage;
32431
33085
  const characterCount = storage.characterCount?.characters?.() ?? 0;
32432
33086
  const wordCount = storage.characterCount?.words?.() ?? 0;
32433
33087
  const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
32434
- return /* @__PURE__ */ jsxs74("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t bg-muted/20", children: [
32435
- /* @__PURE__ */ jsxs74("span", { children: [
33088
+ return /* @__PURE__ */ jsxs75("div", { className: "flex items-center gap-3 px-3 py-2 text-xs text-muted-foreground border-t border-border/30 bg-muted/20", children: [
33089
+ /* @__PURE__ */ jsxs75("span", { children: [
32436
33090
  wordCount,
32437
33091
  " ",
32438
33092
  t("words")
32439
33093
  ] }),
32440
- /* @__PURE__ */ jsxs74("span", { children: [
33094
+ /* @__PURE__ */ jsxs75("span", { children: [
32441
33095
  characterCount,
32442
33096
  " ",
32443
33097
  t("characters")
32444
33098
  ] }),
32445
- maxCharacters && /* @__PURE__ */ jsxs74("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
33099
+ maxCharacters && /* @__PURE__ */ jsxs75("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
32446
33100
  characterCount,
32447
33101
  "/",
32448
33102
  maxCharacters
@@ -33897,7 +34551,7 @@ var NodeRange = class {
33897
34551
  }
33898
34552
  };
33899
34553
  var emptyAttrs = /* @__PURE__ */ Object.create(null);
33900
- var Node5 = class _Node {
34554
+ var Node7 = class _Node {
33901
34555
  /**
33902
34556
  @internal
33903
34557
  */
@@ -34298,7 +34952,7 @@ var Node5 = class _Node {
34298
34952
  return node;
34299
34953
  }
34300
34954
  };
34301
- Node5.prototype.text = void 0;
34955
+ Node7.prototype.text = void 0;
34302
34956
  function wrapMarks(marks, str) {
34303
34957
  for (let i = marks.length - 1; i >= 0; i--)
34304
34958
  str = marks[i].type.name + "(" + str + ")";
@@ -37348,7 +38002,7 @@ function buildTableHoverState({
37348
38002
  }
37349
38003
 
37350
38004
  // src/components/UEditor/table-drag-preview.tsx
37351
- import { Fragment as Fragment31, jsx as jsx88, jsxs as jsxs75 } from "react/jsx-runtime";
38005
+ import { Fragment as Fragment31, jsx as jsx90, jsxs as jsxs76 } from "react/jsx-runtime";
37352
38006
  function TableDragPreview({
37353
38007
  columnDragLabel,
37354
38008
  dragPreview,
@@ -37359,9 +38013,9 @@ function TableDragPreview({
37359
38013
  const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
37360
38014
  const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
37361
38015
  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`;
37362
- return /* @__PURE__ */ jsxs75(Fragment31, { children: [
37363
- dragPreview.kind === "row" && /* @__PURE__ */ jsxs75(Fragment31, { children: [
37364
- /* @__PURE__ */ jsx88(
38016
+ return /* @__PURE__ */ jsxs76(Fragment31, { children: [
38017
+ dragPreview.kind === "row" && /* @__PURE__ */ jsxs76(Fragment31, { children: [
38018
+ /* @__PURE__ */ jsx90(
37365
38019
  "div",
37366
38020
  {
37367
38021
  "aria-hidden": "true",
@@ -37374,7 +38028,7 @@ function TableDragPreview({
37374
38028
  }
37375
38029
  }
37376
38030
  ),
37377
- /* @__PURE__ */ jsx88(
38031
+ /* @__PURE__ */ jsx90(
37378
38032
  "div",
37379
38033
  {
37380
38034
  "aria-hidden": "true",
@@ -37388,8 +38042,8 @@ function TableDragPreview({
37388
38042
  }
37389
38043
  )
37390
38044
  ] }),
37391
- dragPreview.kind === "column" && /* @__PURE__ */ jsxs75(Fragment31, { children: [
37392
- /* @__PURE__ */ jsx88(
38045
+ dragPreview.kind === "column" && /* @__PURE__ */ jsxs76(Fragment31, { children: [
38046
+ /* @__PURE__ */ jsx90(
37393
38047
  "div",
37394
38048
  {
37395
38049
  "aria-hidden": "true",
@@ -37402,7 +38056,7 @@ function TableDragPreview({
37402
38056
  }
37403
38057
  }
37404
38058
  ),
37405
- /* @__PURE__ */ jsx88(
38059
+ /* @__PURE__ */ jsx90(
37406
38060
  "div",
37407
38061
  {
37408
38062
  "aria-hidden": "true",
@@ -37416,7 +38070,7 @@ function TableDragPreview({
37416
38070
  }
37417
38071
  )
37418
38072
  ] }),
37419
- (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx88(
38073
+ (dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx90(
37420
38074
  "div",
37421
38075
  {
37422
38076
  "aria-hidden": "true",
@@ -37429,7 +38083,7 @@ function TableDragPreview({
37429
38083
  }
37430
38084
  }
37431
38085
  ),
37432
- /* @__PURE__ */ jsx88(
38086
+ /* @__PURE__ */ jsx90(
37433
38087
  "div",
37434
38088
  {
37435
38089
  role: "status",
@@ -37445,7 +38099,7 @@ function TableDragPreview({
37445
38099
  }
37446
38100
 
37447
38101
  // src/components/UEditor/table-add-rails.tsx
37448
- import { Fragment as Fragment32, jsx as jsx89, jsxs as jsxs76 } from "react/jsx-runtime";
38102
+ import { Fragment as Fragment32, jsx as jsx91, jsxs as jsxs77 } from "react/jsx-runtime";
37449
38103
  var ADD_COLUMN_RAIL_GAP = 4;
37450
38104
  var ADD_ROW_RAIL_GAP = 4;
37451
38105
  function TableAddRails({
@@ -37466,13 +38120,13 @@ function TableAddRails({
37466
38120
  const rowRailLeft = visibleBounds.left;
37467
38121
  const showColumnRail = controlsVisible || addColumnVisible;
37468
38122
  const showRowRail = controlsVisible || addRowVisible;
37469
- return /* @__PURE__ */ jsxs76(Fragment32, { children: [
37470
- /* @__PURE__ */ jsx89(
38123
+ return /* @__PURE__ */ jsxs77(Fragment32, { children: [
38124
+ /* @__PURE__ */ jsx91(
37471
38125
  Tooltip,
37472
38126
  {
37473
38127
  placement: "right",
37474
- content: /* @__PURE__ */ jsx89("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
37475
- children: /* @__PURE__ */ jsx89(
38128
+ content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
38129
+ children: /* @__PURE__ */ jsx91(
37476
38130
  "button",
37477
38131
  {
37478
38132
  type: "button",
@@ -37499,17 +38153,17 @@ function TableAddRails({
37499
38153
  transform: showColumnRail ? "scale(1)" : "scale(0.92)",
37500
38154
  pointerEvents: showColumnRail ? "auto" : "none"
37501
38155
  },
37502
- children: /* @__PURE__ */ jsx89("span", { className: "text-sm font-medium leading-none", children: "+" })
38156
+ children: /* @__PURE__ */ jsx91("span", { className: "text-sm font-medium leading-none", children: "+" })
37503
38157
  }
37504
38158
  )
37505
38159
  }
37506
38160
  ),
37507
- /* @__PURE__ */ jsx89(
38161
+ /* @__PURE__ */ jsx91(
37508
38162
  Tooltip,
37509
38163
  {
37510
38164
  placement: "bottom",
37511
- content: /* @__PURE__ */ jsx89("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
37512
- children: /* @__PURE__ */ jsx89(
38165
+ content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
38166
+ children: /* @__PURE__ */ jsx91(
37513
38167
  "button",
37514
38168
  {
37515
38169
  type: "button",
@@ -37536,7 +38190,7 @@ function TableAddRails({
37536
38190
  transform: showRowRail ? "scale(1)" : "scale(0.92)",
37537
38191
  pointerEvents: showRowRail ? "auto" : "none"
37538
38192
  },
37539
- children: /* @__PURE__ */ jsx89("span", { className: "text-sm font-medium leading-none", children: "+" })
38193
+ children: /* @__PURE__ */ jsx91("span", { className: "text-sm font-medium leading-none", children: "+" })
37540
38194
  }
37541
38195
  )
37542
38196
  }
@@ -37546,7 +38200,7 @@ function TableAddRails({
37546
38200
 
37547
38201
  // src/components/UEditor/table-control-menu.tsx
37548
38202
  import { MoreHorizontal as MoreHorizontal2 } from "lucide-react";
37549
- import { jsx as jsx90 } from "react/jsx-runtime";
38203
+ import { jsx as jsx92 } from "react/jsx-runtime";
37550
38204
  function TableControlMenu({
37551
38205
  controlsVisible,
37552
38206
  isOpen,
@@ -37558,7 +38212,7 @@ function TableControlMenu({
37558
38212
  top
37559
38213
  }) {
37560
38214
  const shown = controlsVisible || menuVisible || isOpen;
37561
- return /* @__PURE__ */ jsx90(
38215
+ return /* @__PURE__ */ jsx92(
37562
38216
  "div",
37563
38217
  {
37564
38218
  className: "absolute z-30",
@@ -37567,13 +38221,13 @@ function TableControlMenu({
37567
38221
  top,
37568
38222
  left
37569
38223
  },
37570
- children: /* @__PURE__ */ jsx90(
38224
+ children: /* @__PURE__ */ jsx92(
37571
38225
  Tooltip,
37572
38226
  {
37573
38227
  placement: "top",
37574
38228
  disabled: isOpen,
37575
- content: /* @__PURE__ */ jsx90("span", { className: "text-xs font-medium", children: label }),
37576
- children: /* @__PURE__ */ jsx90("span", { className: "inline-flex", children: /* @__PURE__ */ jsx90(
38229
+ content: /* @__PURE__ */ jsx92("span", { className: "text-xs font-medium", children: label }),
38230
+ children: /* @__PURE__ */ jsx92("span", { className: "inline-flex", children: /* @__PURE__ */ jsx92(
37577
38231
  DropdownMenu,
37578
38232
  {
37579
38233
  placement: "bottom-start",
@@ -37581,7 +38235,7 @@ function TableControlMenu({
37581
38235
  onOpenChange,
37582
38236
  contentClassName: "p-2",
37583
38237
  items,
37584
- trigger: /* @__PURE__ */ jsx90(
38238
+ trigger: /* @__PURE__ */ jsx92(
37585
38239
  "button",
37586
38240
  {
37587
38241
  type: "button",
@@ -37597,7 +38251,7 @@ function TableControlMenu({
37597
38251
  transform: shown ? "scale(1)" : "scale(0.82)",
37598
38252
  pointerEvents: shown ? "auto" : "none"
37599
38253
  },
37600
- children: /* @__PURE__ */ jsx90(MoreHorizontal2, { className: "h-4 w-4" })
38254
+ children: /* @__PURE__ */ jsx92(MoreHorizontal2, { className: "h-4 w-4" })
37601
38255
  }
37602
38256
  )
37603
38257
  }
@@ -37610,7 +38264,7 @@ function TableControlMenu({
37610
38264
 
37611
38265
  // src/components/UEditor/table-axis-handles.tsx
37612
38266
  import { GripHorizontal, GripVertical as GripVertical3 } from "lucide-react";
37613
- import { Fragment as Fragment33, jsx as jsx91 } from "react/jsx-runtime";
38267
+ import { Fragment as Fragment33, jsx as jsx93 } from "react/jsx-runtime";
37614
38268
  var IDLE_HANDLE_SCALE = "0.78";
37615
38269
  function TableRowHandles({
37616
38270
  activeRowIndex,
@@ -37624,12 +38278,12 @@ function TableRowHandles({
37624
38278
  rowHandleLeft,
37625
38279
  rowHandles
37626
38280
  }) {
37627
- return /* @__PURE__ */ jsx91(Fragment33, { children: rowHandles.map((rowHandle) => {
38281
+ return /* @__PURE__ */ jsx93(Fragment33, { children: rowHandles.map((rowHandle) => {
37628
38282
  const menuKey = `row:${rowHandle.index}`;
37629
38283
  const isActive = rowHandle.index === activeRowIndex;
37630
38284
  const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
37631
38285
  const isShown = visible || isActive;
37632
- return /* @__PURE__ */ jsx91(
38286
+ return /* @__PURE__ */ jsx93(
37633
38287
  "div",
37634
38288
  {
37635
38289
  className: "absolute z-30",
@@ -37638,13 +38292,13 @@ function TableRowHandles({
37638
38292
  top: Math.max(8, rowHandle.center - 12),
37639
38293
  left: rowHandleLeft
37640
38294
  },
37641
- children: /* @__PURE__ */ jsx91(
38295
+ children: /* @__PURE__ */ jsx93(
37642
38296
  Tooltip,
37643
38297
  {
37644
38298
  placement: "right",
37645
38299
  disabled: openMenuKey === menuKey || !visible && isActive,
37646
- content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
37647
- children: /* @__PURE__ */ jsx91("span", { className: "inline-flex", children: /* @__PURE__ */ jsx91(
38300
+ content: /* @__PURE__ */ jsx93("span", { className: "text-xs font-medium", children: `${rowDragLabel} ${rowHandle.index + 1}` }),
38301
+ children: /* @__PURE__ */ jsx93("span", { className: "inline-flex", children: /* @__PURE__ */ jsx93(
37648
38302
  DropdownMenu,
37649
38303
  {
37650
38304
  placement: "right",
@@ -37652,7 +38306,7 @@ function TableRowHandles({
37652
38306
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
37653
38307
  contentClassName: "p-2",
37654
38308
  items: getMenuItems(rowHandle),
37655
- trigger: /* @__PURE__ */ jsx91(
38309
+ trigger: /* @__PURE__ */ jsx93(
37656
38310
  "button",
37657
38311
  {
37658
38312
  type: "button",
@@ -37671,7 +38325,7 @@ function TableRowHandles({
37671
38325
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
37672
38326
  pointerEvents: isShown ? "auto" : "none"
37673
38327
  },
37674
- children: visible ? /* @__PURE__ */ jsx91(GripVertical3, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx91("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
38328
+ children: visible ? /* @__PURE__ */ jsx93(GripVertical3, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx93("div", { className: "h-3 w-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
37675
38329
  }
37676
38330
  )
37677
38331
  }
@@ -37695,12 +38349,12 @@ function TableColumnHandles({
37695
38349
  onStartDrag,
37696
38350
  openMenuKey
37697
38351
  }) {
37698
- return /* @__PURE__ */ jsx91(Fragment33, { children: columnHandles.map((columnHandle) => {
38352
+ return /* @__PURE__ */ jsx93(Fragment33, { children: columnHandles.map((columnHandle) => {
37699
38353
  const menuKey = `column:${columnHandle.index}`;
37700
38354
  const isActive = columnHandle.index === activeColumnIndex;
37701
38355
  const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
37702
38356
  const isShown = visible || isActive;
37703
- return /* @__PURE__ */ jsx91(
38357
+ return /* @__PURE__ */ jsx93(
37704
38358
  "div",
37705
38359
  {
37706
38360
  className: "absolute z-30",
@@ -37709,13 +38363,13 @@ function TableColumnHandles({
37709
38363
  top: columnHandleTop,
37710
38364
  left: Math.max(8, columnHandle.center - 12)
37711
38365
  },
37712
- children: /* @__PURE__ */ jsx91(
38366
+ children: /* @__PURE__ */ jsx93(
37713
38367
  Tooltip,
37714
38368
  {
37715
38369
  placement: "top",
37716
38370
  disabled: openMenuKey === menuKey || !visible && isActive,
37717
- content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
37718
- children: /* @__PURE__ */ jsx91("span", { className: "inline-flex", children: /* @__PURE__ */ jsx91(
38371
+ content: /* @__PURE__ */ jsx93("span", { className: "text-xs font-medium", children: `${columnDragLabel} ${columnHandle.index + 1}` }),
38372
+ children: /* @__PURE__ */ jsx93("span", { className: "inline-flex", children: /* @__PURE__ */ jsx93(
37719
38373
  DropdownMenu,
37720
38374
  {
37721
38375
  placement: "bottom-start",
@@ -37723,7 +38377,7 @@ function TableColumnHandles({
37723
38377
  onOpenChange: (open) => onOpenMenuChange(menuKey, open),
37724
38378
  contentClassName: "p-2",
37725
38379
  items: getMenuItems(columnHandle),
37726
- trigger: /* @__PURE__ */ jsx91(
38380
+ trigger: /* @__PURE__ */ jsx93(
37727
38381
  "button",
37728
38382
  {
37729
38383
  type: "button",
@@ -37742,7 +38396,7 @@ function TableColumnHandles({
37742
38396
  transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
37743
38397
  pointerEvents: isShown ? "auto" : "none"
37744
38398
  },
37745
- children: visible ? /* @__PURE__ */ jsx91(GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx91("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
38399
+ children: visible ? /* @__PURE__ */ jsx93(GripHorizontal, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx93("div", { className: "h-1 w-3 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground" })
37746
38400
  }
37747
38401
  )
37748
38402
  }
@@ -37756,7 +38410,7 @@ function TableColumnHandles({
37756
38410
  }
37757
38411
 
37758
38412
  // src/components/UEditor/table-controls.tsx
37759
- import { Fragment as Fragment34, jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
38413
+ import { Fragment as Fragment34, jsx as jsx94, jsxs as jsxs78 } from "react/jsx-runtime";
37760
38414
  var TABLE_MENU_TOP_OFFSET = 10;
37761
38415
  function nearestIndex(centers, position) {
37762
38416
  let bestIndex = 0;
@@ -38203,8 +38857,8 @@ function TableControls({ editor, containerRef }) {
38203
38857
  const menuLeft = Math.max(8, layout.tableLeft);
38204
38858
  const rowHandleLeft = layout.tableLeft - 12;
38205
38859
  const columnHandleTop = layout.tableTop - 12;
38206
- return /* @__PURE__ */ jsxs77(Fragment34, { children: [
38207
- /* @__PURE__ */ jsx92(
38860
+ return /* @__PURE__ */ jsxs78(Fragment34, { children: [
38861
+ /* @__PURE__ */ jsx94(
38208
38862
  TableRowHandles,
38209
38863
  {
38210
38864
  activeRowIndex: layout.activeRowIndex,
@@ -38221,7 +38875,7 @@ function TableControls({ editor, containerRef }) {
38221
38875
  rowHandles: layout.rowHandles
38222
38876
  }
38223
38877
  ),
38224
- /* @__PURE__ */ jsx92(
38878
+ /* @__PURE__ */ jsx94(
38225
38879
  TableColumnHandles,
38226
38880
  {
38227
38881
  activeColumnIndex: layout.activeColumnIndex,
@@ -38238,7 +38892,7 @@ function TableControls({ editor, containerRef }) {
38238
38892
  openMenuKey
38239
38893
  }
38240
38894
  ),
38241
- /* @__PURE__ */ jsx92(
38895
+ /* @__PURE__ */ jsx94(
38242
38896
  TableControlMenu,
38243
38897
  {
38244
38898
  controlsVisible,
@@ -38253,7 +38907,7 @@ function TableControls({ editor, containerRef }) {
38253
38907
  top: menuTop
38254
38908
  }
38255
38909
  ),
38256
- /* @__PURE__ */ jsx92(
38910
+ /* @__PURE__ */ jsx94(
38257
38911
  TableAddRails,
38258
38912
  {
38259
38913
  addColumnVisible: hoverState.addColumnVisible,
@@ -38267,7 +38921,7 @@ function TableControls({ editor, containerRef }) {
38267
38921
  quickAddRowLabel: t("tableMenu.quickAddRowAfter")
38268
38922
  }
38269
38923
  ),
38270
- /* @__PURE__ */ jsx92(
38924
+ /* @__PURE__ */ jsx94(
38271
38925
  TableDragPreview,
38272
38926
  {
38273
38927
  columnDragLabel: t("tableMenu.dragColumn"),
@@ -38899,6 +39553,8 @@ import {
38899
39553
  Trash2 as Trash25,
38900
39554
  Underline as UnderlineIcon3,
38901
39555
  Undo as UndoIcon2,
39556
+ Square,
39557
+ CircleDot as CircleDot2,
38902
39558
  Upload as Upload4
38903
39559
  } from "lucide-react";
38904
39560
 
@@ -39039,14 +39695,14 @@ function prepareUEditorPreviewHtml(html) {
39039
39695
  }
39040
39696
 
39041
39697
  // src/components/UEditor/menu-bar.tsx
39042
- import { Fragment as Fragment35, jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
39698
+ import { Fragment as Fragment35, jsx as jsx95, jsxs as jsxs79 } from "react/jsx-runtime";
39043
39699
  function MenuTableInsertGrid({
39044
39700
  insertLabel,
39045
39701
  previewTemplate,
39046
39702
  onInsert
39047
39703
  }) {
39048
39704
  const closeMenu = useDropdownMenuClose();
39049
- return /* @__PURE__ */ jsx93(
39705
+ return /* @__PURE__ */ jsx95(
39050
39706
  TableInsertGrid,
39051
39707
  {
39052
39708
  insertLabel,
@@ -39062,9 +39718,9 @@ function renderMenuItems(items) {
39062
39718
  return items.map((item, i) => {
39063
39719
  switch (item.type) {
39064
39720
  case "separator":
39065
- return /* @__PURE__ */ jsx93(DropdownMenuSeparator, {}, i);
39721
+ return /* @__PURE__ */ jsx95(DropdownMenuSeparator, {}, i);
39066
39722
  case "action":
39067
- return /* @__PURE__ */ jsx93(
39723
+ return /* @__PURE__ */ jsx95(
39068
39724
  DropdownMenuItem,
39069
39725
  {
39070
39726
  label: item.label,
@@ -39078,9 +39734,9 @@ function renderMenuItems(items) {
39078
39734
  i
39079
39735
  );
39080
39736
  case "sub":
39081
- return /* @__PURE__ */ jsx93(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
39737
+ return /* @__PURE__ */ jsx95(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
39082
39738
  case "custom":
39083
- return /* @__PURE__ */ jsx93(React82.Fragment, { children: item.render() }, item.key);
39739
+ return /* @__PURE__ */ jsx95(React82.Fragment, { children: item.render() }, item.key);
39084
39740
  }
39085
39741
  });
39086
39742
  }
@@ -39382,7 +40038,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
39382
40038
  {
39383
40039
  type: "custom",
39384
40040
  key: "table-insert-grid",
39385
- render: () => /* @__PURE__ */ jsx93(
40041
+ render: () => /* @__PURE__ */ jsx95(
39386
40042
  MenuTableInsertGrid,
39387
40043
  {
39388
40044
  insertLabel: t("tableMenu.insertTable"),
@@ -39457,7 +40113,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
39457
40113
  ];
39458
40114
  }
39459
40115
  var MenuBarTrigger = React82.forwardRef(
39460
- ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx93(
40116
+ ({ children, className, ...props }, ref) => /* @__PURE__ */ jsx95(
39461
40117
  "button",
39462
40118
  {
39463
40119
  ref,
@@ -39560,9 +40216,9 @@ var MenuBar = ({
39560
40216
  {
39561
40217
  type: "custom",
39562
40218
  key: "image",
39563
- render: () => showImageInput ? /* @__PURE__ */ jsx93(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs78(Fragment35, { children: [
39564
- /* @__PURE__ */ jsx93(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon3, onClick: () => setShowImageInput(true), closeOnSelect: false }),
39565
- /* @__PURE__ */ jsx93(
40219
+ render: () => showImageInput ? /* @__PURE__ */ jsx95(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs79(Fragment35, { children: [
40220
+ /* @__PURE__ */ jsx95(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon3, onClick: () => setShowImageInput(true), closeOnSelect: false }),
40221
+ /* @__PURE__ */ jsx95(
39566
40222
  DropdownMenuItem,
39567
40223
  {
39568
40224
  label: t("menubar.imageUpload"),
@@ -39577,7 +40233,7 @@ var MenuBar = ({
39577
40233
  {
39578
40234
  type: "custom",
39579
40235
  key: "link",
39580
- render: () => showLinkInput ? /* @__PURE__ */ jsx93(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx93(
40236
+ render: () => showLinkInput ? /* @__PURE__ */ jsx95(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx95(
39581
40237
  DropdownMenuItem,
39582
40238
  {
39583
40239
  label: t("menubar.link"),
@@ -39597,7 +40253,7 @@ var MenuBar = ({
39597
40253
  {
39598
40254
  type: "custom",
39599
40255
  key: "table-grid",
39600
- render: () => /* @__PURE__ */ jsx93(
40256
+ render: () => /* @__PURE__ */ jsx95(
39601
40257
  MenuTableInsertGrid,
39602
40258
  {
39603
40259
  insertLabel: t("tableMenu.insertTable"),
@@ -39609,6 +40265,26 @@ var MenuBar = ({
39609
40265
  ]
39610
40266
  },
39611
40267
  { type: "separator" },
40268
+ {
40269
+ type: "sub",
40270
+ label: t("menubar.formFields") || "Form Fields",
40271
+ icon: ListTodo3,
40272
+ items: [
40273
+ {
40274
+ type: "action",
40275
+ label: t("menubar.formCheckbox") || "Form Checkbox",
40276
+ icon: Square,
40277
+ onClick: () => editor.chain().focus().setFormCheckbox().run()
40278
+ },
40279
+ {
40280
+ type: "action",
40281
+ label: t("menubar.formRadio") || "Form Radio Button",
40282
+ icon: CircleDot2,
40283
+ onClick: () => editor.chain().focus().setFormRadio().run()
40284
+ }
40285
+ ]
40286
+ },
40287
+ { type: "separator" },
39612
40288
  {
39613
40289
  type: "action",
39614
40290
  label: t("menubar.horizontalRule"),
@@ -39650,8 +40326,8 @@ var MenuBar = ({
39650
40326
  },
39651
40327
  { label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
39652
40328
  ];
39653
- return /* @__PURE__ */ jsxs78(Fragment35, { children: [
39654
- /* @__PURE__ */ jsx93(
40329
+ return /* @__PURE__ */ jsxs79(Fragment35, { children: [
40330
+ /* @__PURE__ */ jsx95(
39655
40331
  "input",
39656
40332
  {
39657
40333
  ref: fileInputRef,
@@ -39662,11 +40338,11 @@ var MenuBar = ({
39662
40338
  onChange: (e) => handleImageFiles(e.target.files)
39663
40339
  }
39664
40340
  ),
39665
- /* @__PURE__ */ jsxs78("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
39666
- menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx93(
40341
+ /* @__PURE__ */ jsxs79("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: [
40342
+ menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx95(
39667
40343
  DropdownMenu,
39668
40344
  {
39669
- trigger: /* @__PURE__ */ jsx93(MenuBarTrigger, { children: label }),
40345
+ trigger: /* @__PURE__ */ jsx95(MenuBarTrigger, { children: label }),
39670
40346
  placement: "bottom-start",
39671
40347
  isOpen: open,
39672
40348
  onOpenChange,
@@ -39674,7 +40350,7 @@ var MenuBar = ({
39674
40350
  },
39675
40351
  label
39676
40352
  )),
39677
- /* @__PURE__ */ jsx93(
40353
+ /* @__PURE__ */ jsx95(
39678
40354
  "button",
39679
40355
  {
39680
40356
  type: "button",
@@ -39685,20 +40361,20 @@ var MenuBar = ({
39685
40361
  "ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
39686
40362
  "hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
39687
40363
  ),
39688
- children: /* @__PURE__ */ jsx93(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
40364
+ children: /* @__PURE__ */ jsx95(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
39689
40365
  }
39690
40366
  )
39691
40367
  ] }),
39692
- /* @__PURE__ */ jsx93(
40368
+ /* @__PURE__ */ jsx95(
39693
40369
  Modal_default,
39694
40370
  {
39695
40371
  isOpen: showSourceDialog,
39696
40372
  onClose: () => setShowSourceDialog(false),
39697
40373
  title: t("menubar.sourceCode"),
39698
40374
  size: "lg",
39699
- children: /* @__PURE__ */ jsxs78("div", { className: "space-y-3", children: [
39700
- /* @__PURE__ */ jsx93("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
39701
- /* @__PURE__ */ jsx93(
40375
+ children: /* @__PURE__ */ jsxs79("div", { className: "space-y-3", children: [
40376
+ /* @__PURE__ */ jsx95("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
40377
+ /* @__PURE__ */ jsx95(
39702
40378
  "textarea",
39703
40379
  {
39704
40380
  "data-testid": "source-code-textarea",
@@ -39708,8 +40384,8 @@ var MenuBar = ({
39708
40384
  spellCheck: false
39709
40385
  }
39710
40386
  ),
39711
- /* @__PURE__ */ jsxs78("div", { className: "flex gap-2 justify-end", children: [
39712
- /* @__PURE__ */ jsx93(
40387
+ /* @__PURE__ */ jsxs79("div", { className: "flex gap-2 justify-end", children: [
40388
+ /* @__PURE__ */ jsx95(
39713
40389
  "button",
39714
40390
  {
39715
40391
  type: "button",
@@ -39718,7 +40394,7 @@ var MenuBar = ({
39718
40394
  children: t("menubar.applySource")
39719
40395
  }
39720
40396
  ),
39721
- /* @__PURE__ */ jsx93(
40397
+ /* @__PURE__ */ jsx95(
39722
40398
  "button",
39723
40399
  {
39724
40400
  type: "button",
@@ -39731,7 +40407,7 @@ var MenuBar = ({
39731
40407
  ] })
39732
40408
  }
39733
40409
  ),
39734
- /* @__PURE__ */ jsx93(
40410
+ /* @__PURE__ */ jsx95(
39735
40411
  Modal_default,
39736
40412
  {
39737
40413
  isOpen: showPreviewDialog,
@@ -39742,12 +40418,12 @@ var MenuBar = ({
39742
40418
  height: "min(860px, calc(100vh - 2rem))",
39743
40419
  className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
39744
40420
  contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
39745
- children: /* @__PURE__ */ jsx93(
40421
+ children: /* @__PURE__ */ jsx95(
39746
40422
  "div",
39747
40423
  {
39748
40424
  "data-testid": "preview-content",
39749
40425
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
39750
- children: editor.isEmpty ? /* @__PURE__ */ jsx93("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx93(
40426
+ children: editor.isEmpty ? /* @__PURE__ */ jsx95("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx95(
39751
40427
  "div",
39752
40428
  {
39753
40429
  className: UEDITOR_PROSEMIRROR_CLASS_NAME,
@@ -39902,7 +40578,7 @@ function getFormulaRangePickHighlight(container, pickState) {
39902
40578
  }
39903
40579
 
39904
40580
  // src/components/UEditor/UEditor.tsx
39905
- import { jsx as jsx94, jsxs as jsxs79 } from "react/jsx-runtime";
40581
+ import { jsx as jsx96, jsxs as jsxs80 } from "react/jsx-runtime";
39906
40582
  var UEditor = React83.forwardRef(({
39907
40583
  content = "",
39908
40584
  onChange,
@@ -39922,10 +40598,12 @@ var UEditor = React83.forwardRef(({
39922
40598
  showToolbar = true,
39923
40599
  showBubbleMenu = true,
39924
40600
  showCharacterCount = true,
40601
+ showFooter = true,
39925
40602
  maxCharacters,
39926
40603
  minHeight = "200px",
39927
40604
  maxHeight = "auto",
39928
40605
  variant = "default",
40606
+ rounded = true,
39929
40607
  fontFamilies,
39930
40608
  fontSizes,
39931
40609
  lineHeights,
@@ -40131,7 +40809,7 @@ var UEditor = React83.forwardRef(({
40131
40809
  }
40132
40810
  }, [content, editor]);
40133
40811
  if (!editor) {
40134
- return /* @__PURE__ */ jsx94(
40812
+ return /* @__PURE__ */ jsx96(
40135
40813
  "div",
40136
40814
  {
40137
40815
  className: cn("w-full border bg-background flex items-center justify-center text-muted-foreground", className),
@@ -40140,7 +40818,7 @@ var UEditor = React83.forwardRef(({
40140
40818
  }
40141
40819
  );
40142
40820
  }
40143
- return /* @__PURE__ */ jsxs79(
40821
+ return /* @__PURE__ */ jsxs80(
40144
40822
  "div",
40145
40823
  {
40146
40824
  className: cn(
@@ -40150,12 +40828,13 @@ var UEditor = React83.forwardRef(({
40150
40828
  "transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
40151
40829
  "shadow-sm focus-within:shadow-md focus-within:border-primary/15",
40152
40830
  "backdrop-blur-sm",
40153
- variant === "notion" && "hover:shadow-md"
40831
+ variant === "notion" && "hover:shadow-md",
40832
+ rounded ? "rounded-2xl md:rounded-3xl max-md:rounded-xl" : "rounded-none"
40154
40833
  ] : "rounded-none",
40155
40834
  className
40156
40835
  ),
40157
40836
  children: [
40158
- editable && showMenuBar && /* @__PURE__ */ jsx94(
40837
+ editable && showMenuBar && /* @__PURE__ */ jsx96(
40159
40838
  MenuBar,
40160
40839
  {
40161
40840
  editor,
@@ -40170,7 +40849,7 @@ var UEditor = React83.forwardRef(({
40170
40849
  onPreview
40171
40850
  }
40172
40851
  ),
40173
- editable && showToolbar && /* @__PURE__ */ jsx94(
40852
+ editable && showToolbar && /* @__PURE__ */ jsx96(
40174
40853
  EditorToolbar,
40175
40854
  {
40176
40855
  editor,
@@ -40185,7 +40864,7 @@ var UEditor = React83.forwardRef(({
40185
40864
  letterSpacings
40186
40865
  }
40187
40866
  ),
40188
- editable && showBubbleMenu && /* @__PURE__ */ jsx94(
40867
+ editable && showBubbleMenu && /* @__PURE__ */ jsx96(
40189
40868
  CustomBubbleMenu,
40190
40869
  {
40191
40870
  editor,
@@ -40193,7 +40872,7 @@ var UEditor = React83.forwardRef(({
40193
40872
  lineHeights
40194
40873
  }
40195
40874
  ),
40196
- /* @__PURE__ */ jsxs79(
40875
+ /* @__PURE__ */ jsxs80(
40197
40876
  "div",
40198
40877
  {
40199
40878
  ref: (node) => {
@@ -40206,7 +40885,7 @@ var UEditor = React83.forwardRef(({
40206
40885
  maxHeight
40207
40886
  },
40208
40887
  children: [
40209
- /* @__PURE__ */ jsx94(
40888
+ /* @__PURE__ */ jsx96(
40210
40889
  "span",
40211
40890
  {
40212
40891
  ref: tableColumnGuideRef,
@@ -40214,7 +40893,7 @@ var UEditor = React83.forwardRef(({
40214
40893
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
40215
40894
  }
40216
40895
  ),
40217
- /* @__PURE__ */ jsx94(
40896
+ /* @__PURE__ */ jsx96(
40218
40897
  "span",
40219
40898
  {
40220
40899
  ref: tableRowGuideRef,
@@ -40222,7 +40901,7 @@ var UEditor = React83.forwardRef(({
40222
40901
  className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
40223
40902
  }
40224
40903
  ),
40225
- /* @__PURE__ */ jsx94(
40904
+ /* @__PURE__ */ jsx96(
40226
40905
  "span",
40227
40906
  {
40228
40907
  ref: activeTableCellHighlightRef,
@@ -40231,7 +40910,7 @@ var UEditor = React83.forwardRef(({
40231
40910
  className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10"
40232
40911
  }
40233
40912
  ),
40234
- formulaRangeHighlight && /* @__PURE__ */ jsx94(
40913
+ formulaRangeHighlight && /* @__PURE__ */ jsx96(
40235
40914
  "span",
40236
40915
  {
40237
40916
  "aria-hidden": "true",
@@ -40245,8 +40924,8 @@ var UEditor = React83.forwardRef(({
40245
40924
  }
40246
40925
  }
40247
40926
  ),
40248
- editable && /* @__PURE__ */ jsx94(TableControls, { editor, containerRef: editorContentRef }),
40249
- /* @__PURE__ */ jsx94(
40927
+ editable && /* @__PURE__ */ jsx96(TableControls, { editor, containerRef: editorContentRef }),
40928
+ /* @__PURE__ */ jsx96(
40250
40929
  EditorContent,
40251
40930
  {
40252
40931
  editor,
@@ -40256,7 +40935,7 @@ var UEditor = React83.forwardRef(({
40256
40935
  ]
40257
40936
  }
40258
40937
  ),
40259
- showCharacterCount && /* @__PURE__ */ jsx94(CharacterCountDisplay, { editor, maxCharacters })
40938
+ showFooter && showCharacterCount && /* @__PURE__ */ jsx96(CharacterCountDisplay, { editor, maxCharacters })
40260
40939
  ]
40261
40940
  }
40262
40941
  );