@underverse-ui/underverse 1.0.163 → 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/api-reference.json +1 -1
- package/dist/index.cjs +1587 -932
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -1
- package/dist/index.d.ts +125 -1
- package/dist/index.js +1273 -608
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 =
|
|
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([]);
|
|
@@ -24867,7 +24935,7 @@ import React83, { useEffect as useEffect38, useImperativeHandle as useImperative
|
|
|
24867
24935
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
24868
24936
|
|
|
24869
24937
|
// src/components/UEditor/extensions.ts
|
|
24870
|
-
import { mergeAttributes as
|
|
24938
|
+
import { mergeAttributes as mergeAttributes7 } from "@tiptap/core";
|
|
24871
24939
|
import Document from "@tiptap/extension-document";
|
|
24872
24940
|
import Paragraph from "@tiptap/extension-paragraph";
|
|
24873
24941
|
import Text from "@tiptap/extension-text";
|
|
@@ -24884,7 +24952,7 @@ import TaskItem from "@tiptap/extension-task-item";
|
|
|
24884
24952
|
import Blockquote from "@tiptap/extension-blockquote";
|
|
24885
24953
|
import Code from "@tiptap/extension-code";
|
|
24886
24954
|
import { wrappingInputRule } from "@tiptap/core";
|
|
24887
|
-
import { ReactNodeViewRenderer as
|
|
24955
|
+
import { ReactNodeViewRenderer as ReactNodeViewRenderer7 } from "@tiptap/react";
|
|
24888
24956
|
|
|
24889
24957
|
// src/components/UEditor/callout.ts
|
|
24890
24958
|
import { Node as Node2, mergeAttributes } from "@tiptap/core";
|
|
@@ -25513,6 +25581,370 @@ var FileCard = Node4.create({
|
|
|
25513
25581
|
}
|
|
25514
25582
|
});
|
|
25515
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
|
+
|
|
25516
25948
|
// src/components/UEditor/extensions.ts
|
|
25517
25949
|
import CodeBlockLowlight from "@tiptap/extension-code-block-lowlight";
|
|
25518
25950
|
import History2 from "@tiptap/extension-history";
|
|
@@ -25550,7 +25982,9 @@ import {
|
|
|
25550
25982
|
Type,
|
|
25551
25983
|
Info as Info3,
|
|
25552
25984
|
Bookmark as BookmarkIcon,
|
|
25553
|
-
Paperclip
|
|
25985
|
+
Paperclip,
|
|
25986
|
+
CheckSquare,
|
|
25987
|
+
CircleDot
|
|
25554
25988
|
} from "lucide-react";
|
|
25555
25989
|
|
|
25556
25990
|
// src/components/UEditor/tippy-interop.ts
|
|
@@ -25573,7 +26007,7 @@ function destroyTippyInstance(instance) {
|
|
|
25573
26007
|
}
|
|
25574
26008
|
|
|
25575
26009
|
// src/components/UEditor/slash-command.tsx
|
|
25576
|
-
import { jsx as
|
|
26010
|
+
import { jsx as jsx81, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
25577
26011
|
var DEFAULT_MESSAGES = {
|
|
25578
26012
|
noResults: "No results",
|
|
25579
26013
|
basicBlocks: "Basic Blocks",
|
|
@@ -25604,7 +26038,11 @@ var DEFAULT_MESSAGES = {
|
|
|
25604
26038
|
bookmark: "Bookmark Card",
|
|
25605
26039
|
bookmarkDesc: "Embed a link as a bookmark card",
|
|
25606
26040
|
fileCard: "File Attachment",
|
|
25607
|
-
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"
|
|
25608
26046
|
};
|
|
25609
26047
|
function useResettingIndex2(resetToken) {
|
|
25610
26048
|
const [state, setState] = React70.useState({ resetToken, index: 0 });
|
|
@@ -25655,7 +26093,11 @@ function buildSlashCommandMessages(translate) {
|
|
|
25655
26093
|
bookmark: translate("slashCommand.bookmark") || "Bookmark Card",
|
|
25656
26094
|
bookmarkDesc: translate("slashCommand.bookmarkDesc") || "Embed a link as a bookmark card",
|
|
25657
26095
|
fileCard: translate("slashCommand.fileCard") || "File Attachment",
|
|
25658
|
-
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"
|
|
25659
26101
|
};
|
|
25660
26102
|
}
|
|
25661
26103
|
function buildSlashCommandItems({
|
|
@@ -25795,6 +26237,22 @@ function buildSlashCommandItems({
|
|
|
25795
26237
|
};
|
|
25796
26238
|
input.click();
|
|
25797
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
|
+
})
|
|
25798
26256
|
}
|
|
25799
26257
|
].filter((item) => item.title.toLowerCase().includes(query.toLowerCase()));
|
|
25800
26258
|
}
|
|
@@ -25831,11 +26289,11 @@ var SlashCommandList = forwardRef14((props, ref) => {
|
|
|
25831
26289
|
}
|
|
25832
26290
|
}));
|
|
25833
26291
|
if (props.items.length === 0) {
|
|
25834
|
-
return /* @__PURE__ */
|
|
26292
|
+
return /* @__PURE__ */ jsx81("div", { className: "w-72 p-4 text-center text-sm text-muted-foreground", children: props.messages.noResults });
|
|
25835
26293
|
}
|
|
25836
|
-
return /* @__PURE__ */
|
|
25837
|
-
/* @__PURE__ */
|
|
25838
|
-
/* @__PURE__ */
|
|
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(
|
|
25839
26297
|
"button",
|
|
25840
26298
|
{
|
|
25841
26299
|
type: "button",
|
|
@@ -25847,19 +26305,19 @@ var SlashCommandList = forwardRef14((props, ref) => {
|
|
|
25847
26305
|
selectedIndex === index ? "bg-accent" : "hover:bg-accent/50"
|
|
25848
26306
|
),
|
|
25849
26307
|
children: [
|
|
25850
|
-
/* @__PURE__ */
|
|
26308
|
+
/* @__PURE__ */ jsx81(
|
|
25851
26309
|
"div",
|
|
25852
26310
|
{
|
|
25853
26311
|
className: cn(
|
|
25854
26312
|
"flex items-center justify-center w-10 h-10 rounded-lg mr-3 transition-colors",
|
|
25855
26313
|
selectedIndex === index ? "bg-primary/10" : "bg-muted/50 group-hover:bg-muted"
|
|
25856
26314
|
),
|
|
25857
|
-
children: /* @__PURE__ */
|
|
26315
|
+
children: /* @__PURE__ */ jsx81(item.icon, { className: cn("w-5 h-5", selectedIndex === index ? "text-primary" : "text-muted-foreground") })
|
|
25858
26316
|
}
|
|
25859
26317
|
),
|
|
25860
|
-
/* @__PURE__ */
|
|
25861
|
-
/* @__PURE__ */
|
|
25862
|
-
/* @__PURE__ */
|
|
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 })
|
|
25863
26321
|
] })
|
|
25864
26322
|
]
|
|
25865
26323
|
},
|
|
@@ -26814,7 +27272,7 @@ import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
|
26814
27272
|
import { PluginKey as PluginKey2 } from "@tiptap/pm/state";
|
|
26815
27273
|
import React71, { forwardRef as forwardRef15, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
26816
27274
|
import { Smile as Smile2 } from "lucide-react";
|
|
26817
|
-
import { jsx as
|
|
27275
|
+
import { jsx as jsx82, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
26818
27276
|
function useResettingIndex3(resetToken) {
|
|
26819
27277
|
const [state, setState] = React71.useState({ resetToken, index: 0 });
|
|
26820
27278
|
const selectedIndex = Object.is(state.resetToken, resetToken) ? state.index : 0;
|
|
@@ -26864,15 +27322,15 @@ var EmojiList = forwardRef15((props, ref) => {
|
|
|
26864
27322
|
}
|
|
26865
27323
|
}));
|
|
26866
27324
|
if (props.items.length === 0) {
|
|
26867
|
-
return /* @__PURE__ */
|
|
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") });
|
|
26868
27326
|
}
|
|
26869
|
-
return /* @__PURE__ */
|
|
26870
|
-
/* @__PURE__ */
|
|
26871
|
-
/* @__PURE__ */
|
|
26872
|
-
/* @__PURE__ */
|
|
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") })
|
|
26873
27331
|
] }) }),
|
|
26874
|
-
/* @__PURE__ */
|
|
26875
|
-
/* @__PURE__ */
|
|
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(
|
|
26876
27334
|
EmojiGridButton,
|
|
26877
27335
|
{
|
|
26878
27336
|
emoji: item.emoji,
|
|
@@ -26883,7 +27341,7 @@ var EmojiList = forwardRef15((props, ref) => {
|
|
|
26883
27341
|
},
|
|
26884
27342
|
item.name
|
|
26885
27343
|
)) }),
|
|
26886
|
-
props.items.length > 64 && /* @__PURE__ */
|
|
27344
|
+
props.items.length > 64 && /* @__PURE__ */ jsx82("div", { className: "mt-2 text-xs text-center text-muted-foreground", children: showingCountLabel })
|
|
26887
27345
|
] })
|
|
26888
27346
|
] });
|
|
26889
27347
|
});
|
|
@@ -26969,7 +27427,7 @@ import { ReactRenderer as ReactRenderer3 } from "@tiptap/react";
|
|
|
26969
27427
|
import { PluginKey as PluginKey3 } from "@tiptap/pm/state";
|
|
26970
27428
|
import React72, { forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3 } from "react";
|
|
26971
27429
|
import { Sigma } from "lucide-react";
|
|
26972
|
-
import { jsx as
|
|
27430
|
+
import { jsx as jsx83, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
26973
27431
|
var FORMULA_FUNCTIONS = [
|
|
26974
27432
|
{
|
|
26975
27433
|
name: "SUM",
|
|
@@ -27042,14 +27500,14 @@ var FormulaSuggestionList = forwardRef16((props, ref) => {
|
|
|
27042
27500
|
}
|
|
27043
27501
|
}));
|
|
27044
27502
|
if (props.items.length === 0) {
|
|
27045
|
-
return /* @__PURE__ */
|
|
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") });
|
|
27046
27504
|
}
|
|
27047
|
-
return /* @__PURE__ */
|
|
27048
|
-
/* @__PURE__ */
|
|
27049
|
-
/* @__PURE__ */
|
|
27050
|
-
/* @__PURE__ */
|
|
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") })
|
|
27051
27509
|
] }) }),
|
|
27052
|
-
/* @__PURE__ */
|
|
27510
|
+
/* @__PURE__ */ jsx83("div", { className: "p-1.5", children: props.items.map((item, index) => /* @__PURE__ */ jsxs68(
|
|
27053
27511
|
"button",
|
|
27054
27512
|
{
|
|
27055
27513
|
type: "button",
|
|
@@ -27058,11 +27516,11 @@ var FormulaSuggestionList = forwardRef16((props, ref) => {
|
|
|
27058
27516
|
onMouseDown: (event) => event.preventDefault(),
|
|
27059
27517
|
onClick: () => props.command(item),
|
|
27060
27518
|
children: [
|
|
27061
|
-
/* @__PURE__ */
|
|
27062
|
-
/* @__PURE__ */
|
|
27063
|
-
/* @__PURE__ */
|
|
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 })
|
|
27064
27522
|
] }),
|
|
27065
|
-
/* @__PURE__ */
|
|
27523
|
+
/* @__PURE__ */ jsx83("div", { className: "mt-0.5 text-xs text-muted-foreground", children: t(item.descriptionKey) })
|
|
27066
27524
|
]
|
|
27067
27525
|
},
|
|
27068
27526
|
item.name
|
|
@@ -27216,8 +27674,8 @@ var UEditorPlaceholder = Extension5.create({
|
|
|
27216
27674
|
// src/components/UEditor/resizable-image.tsx
|
|
27217
27675
|
import { useEffect as useEffect34, useRef as useRef29, useState as useState44 } from "react";
|
|
27218
27676
|
import Image4 from "@tiptap/extension-image";
|
|
27219
|
-
import { mergeAttributes as
|
|
27220
|
-
import { NodeViewWrapper as
|
|
27677
|
+
import { mergeAttributes as mergeAttributes6 } from "@tiptap/core";
|
|
27678
|
+
import { NodeViewWrapper as NodeViewWrapper6, ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
27221
27679
|
|
|
27222
27680
|
// src/components/UEditor/table-dom-utils.ts
|
|
27223
27681
|
var DEFAULT_TABLE_ROW_HEIGHT = 25;
|
|
@@ -27324,7 +27782,7 @@ function getRelativeSelectedCellsMetrics(surface) {
|
|
|
27324
27782
|
}
|
|
27325
27783
|
|
|
27326
27784
|
// src/components/UEditor/resizable-image.tsx
|
|
27327
|
-
import { jsx as
|
|
27785
|
+
import { jsx as jsx84, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
27328
27786
|
var MIN_IMAGE_SIZE_PX = 40;
|
|
27329
27787
|
var IMAGE_LAYOUTS = /* @__PURE__ */ new Set(["block", "left", "right"]);
|
|
27330
27788
|
var IMAGE_WIDTH_PRESETS = /* @__PURE__ */ new Set(["sm", "md", "lg"]);
|
|
@@ -27566,8 +28024,8 @@ function ResizableImageNodeView(props) {
|
|
|
27566
28024
|
const showHandle = selected || isHovered || isResizing;
|
|
27567
28025
|
const wrapperAlignClass = imageLayout === "block" ? textAlign === "center" ? "mx-auto" : textAlign === "right" ? "ml-auto" : textAlign === "justify" ? "mx-auto" : "" : "";
|
|
27568
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";
|
|
27569
|
-
return /* @__PURE__ */
|
|
27570
|
-
|
|
28027
|
+
return /* @__PURE__ */ jsxs69(
|
|
28028
|
+
NodeViewWrapper6,
|
|
27571
28029
|
{
|
|
27572
28030
|
as: "div",
|
|
27573
28031
|
ref: wrapperRef,
|
|
@@ -27581,7 +28039,7 @@ function ResizableImageNodeView(props) {
|
|
|
27581
28039
|
},
|
|
27582
28040
|
contentEditable: false,
|
|
27583
28041
|
children: [
|
|
27584
|
-
/* @__PURE__ */
|
|
28042
|
+
/* @__PURE__ */ jsx84(
|
|
27585
28043
|
"img",
|
|
27586
28044
|
{
|
|
27587
28045
|
ref: imgRef,
|
|
@@ -27597,7 +28055,7 @@ function ResizableImageNodeView(props) {
|
|
|
27597
28055
|
style: getImageDisplayStyle(widthAttr, heightAttr)
|
|
27598
28056
|
}
|
|
27599
28057
|
),
|
|
27600
|
-
/* @__PURE__ */
|
|
28058
|
+
/* @__PURE__ */ jsx84(
|
|
27601
28059
|
"div",
|
|
27602
28060
|
{
|
|
27603
28061
|
ref: resizePreviewRef,
|
|
@@ -27621,7 +28079,7 @@ function ResizableImageNodeView(props) {
|
|
|
27621
28079
|
}
|
|
27622
28080
|
}
|
|
27623
28081
|
),
|
|
27624
|
-
showHandle && /* @__PURE__ */
|
|
28082
|
+
showHandle && /* @__PURE__ */ jsx84(
|
|
27625
28083
|
"div",
|
|
27626
28084
|
{
|
|
27627
28085
|
"aria-hidden": "true",
|
|
@@ -27687,10 +28145,10 @@ var ResizableImage = Image4.extend({
|
|
|
27687
28145
|
};
|
|
27688
28146
|
},
|
|
27689
28147
|
renderHTML({ HTMLAttributes }) {
|
|
27690
|
-
return ["img",
|
|
28148
|
+
return ["img", mergeAttributes6(this.options.HTMLAttributes, HTMLAttributes)];
|
|
27691
28149
|
},
|
|
27692
28150
|
addNodeView() {
|
|
27693
|
-
return
|
|
28151
|
+
return ReactNodeViewRenderer6(ResizableImageNodeView);
|
|
27694
28152
|
}
|
|
27695
28153
|
}).configure({
|
|
27696
28154
|
allowBase64: true,
|
|
@@ -28419,9 +28877,9 @@ var table_align_default = UEditorTable;
|
|
|
28419
28877
|
|
|
28420
28878
|
// src/components/UEditor/CodeBlockView.tsx
|
|
28421
28879
|
import React74, { useState as useState45 } from "react";
|
|
28422
|
-
import { NodeViewWrapper as
|
|
28423
|
-
import { Check as
|
|
28424
|
-
import { Fragment as Fragment27, jsx as
|
|
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";
|
|
28425
28883
|
var LANGUAGES = [
|
|
28426
28884
|
{ label: "Plain Text", value: "text" },
|
|
28427
28885
|
{ label: "JavaScript", value: "javascript" },
|
|
@@ -28469,15 +28927,15 @@ var CodeBlockView = ({
|
|
|
28469
28927
|
console.error("Failed to copy code text: ", err);
|
|
28470
28928
|
}
|
|
28471
28929
|
};
|
|
28472
|
-
return /* @__PURE__ */
|
|
28473
|
-
/* @__PURE__ */
|
|
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(
|
|
28474
28932
|
"div",
|
|
28475
28933
|
{
|
|
28476
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",
|
|
28477
28935
|
contentEditable: false,
|
|
28478
28936
|
children: [
|
|
28479
|
-
/* @__PURE__ */
|
|
28480
|
-
/* @__PURE__ */
|
|
28937
|
+
/* @__PURE__ */ jsxs70("div", { className: "relative", children: [
|
|
28938
|
+
/* @__PURE__ */ jsxs70(
|
|
28481
28939
|
"button",
|
|
28482
28940
|
{
|
|
28483
28941
|
type: "button",
|
|
@@ -28485,19 +28943,19 @@ var CodeBlockView = ({
|
|
|
28485
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",
|
|
28486
28944
|
children: [
|
|
28487
28945
|
currentLangLabel,
|
|
28488
|
-
/* @__PURE__ */
|
|
28946
|
+
/* @__PURE__ */ jsx85(ChevronDown7, { className: "h-3 w-3" })
|
|
28489
28947
|
]
|
|
28490
28948
|
}
|
|
28491
28949
|
),
|
|
28492
|
-
isDropdownOpen && /* @__PURE__ */
|
|
28493
|
-
/* @__PURE__ */
|
|
28950
|
+
isDropdownOpen && /* @__PURE__ */ jsxs70(Fragment27, { children: [
|
|
28951
|
+
/* @__PURE__ */ jsx85(
|
|
28494
28952
|
"div",
|
|
28495
28953
|
{
|
|
28496
28954
|
className: "fixed inset-0 z-20",
|
|
28497
28955
|
onClick: () => setIsDropdownOpen(false)
|
|
28498
28956
|
}
|
|
28499
28957
|
),
|
|
28500
|
-
/* @__PURE__ */
|
|
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(
|
|
28501
28959
|
"button",
|
|
28502
28960
|
{
|
|
28503
28961
|
type: "button",
|
|
@@ -28515,20 +28973,20 @@ var CodeBlockView = ({
|
|
|
28515
28973
|
)) })
|
|
28516
28974
|
] })
|
|
28517
28975
|
] }),
|
|
28518
|
-
/* @__PURE__ */
|
|
28976
|
+
/* @__PURE__ */ jsx85(
|
|
28519
28977
|
"button",
|
|
28520
28978
|
{
|
|
28521
28979
|
type: "button",
|
|
28522
28980
|
onClick: handleCopy,
|
|
28523
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",
|
|
28524
28982
|
title: "Copy code",
|
|
28525
|
-
children: copied ? /* @__PURE__ */
|
|
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" })
|
|
28526
28984
|
}
|
|
28527
28985
|
)
|
|
28528
28986
|
]
|
|
28529
28987
|
}
|
|
28530
28988
|
),
|
|
28531
|
-
/* @__PURE__ */
|
|
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, {}) }) })
|
|
28532
28990
|
] });
|
|
28533
28991
|
};
|
|
28534
28992
|
|
|
@@ -28628,6 +29086,16 @@ var CustomTableCell = TableCell2.extend({
|
|
|
28628
29086
|
"data-computed-value": attributes.computedValue
|
|
28629
29087
|
};
|
|
28630
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
|
+
}
|
|
28631
29099
|
}
|
|
28632
29100
|
};
|
|
28633
29101
|
},
|
|
@@ -28637,15 +29105,17 @@ var CustomTableCell = TableCell2.extend({
|
|
|
28637
29105
|
const borderColor = HTMLAttributes["data-border-color"];
|
|
28638
29106
|
const borderStyle = HTMLAttributes["data-border-style"];
|
|
28639
29107
|
const borderWidth = HTMLAttributes["data-border-width"];
|
|
29108
|
+
const verticalAlign = HTMLAttributes["data-vertical-align"];
|
|
28640
29109
|
let mergedStyle = style;
|
|
28641
29110
|
if (bg) mergedStyle += `; background-color: ${bg}`;
|
|
28642
29111
|
if (borderColor) mergedStyle += `; border-color: ${borderColor}`;
|
|
28643
29112
|
if (borderStyle) mergedStyle += `; border-style: ${borderStyle}`;
|
|
28644
29113
|
if (borderWidth) mergedStyle += `; border-width: ${borderWidth}`;
|
|
29114
|
+
if (verticalAlign) mergedStyle += `; vertical-align: ${verticalAlign}`;
|
|
28645
29115
|
mergedStyle = mergedStyle.replace(/^;/, "").trim();
|
|
28646
29116
|
return [
|
|
28647
29117
|
"td",
|
|
28648
|
-
|
|
29118
|
+
mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
|
|
28649
29119
|
0
|
|
28650
29120
|
];
|
|
28651
29121
|
}
|
|
@@ -28735,6 +29205,16 @@ var CustomTableHeader = TableHeader2.extend({
|
|
|
28735
29205
|
"data-computed-value": attributes.computedValue
|
|
28736
29206
|
};
|
|
28737
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
|
+
}
|
|
28738
29218
|
}
|
|
28739
29219
|
};
|
|
28740
29220
|
},
|
|
@@ -28744,15 +29224,17 @@ var CustomTableHeader = TableHeader2.extend({
|
|
|
28744
29224
|
const borderColor = HTMLAttributes["data-border-color"];
|
|
28745
29225
|
const borderStyle = HTMLAttributes["data-border-style"];
|
|
28746
29226
|
const borderWidth = HTMLAttributes["data-border-width"];
|
|
29227
|
+
const verticalAlign = HTMLAttributes["data-vertical-align"];
|
|
28747
29228
|
let mergedStyle = style;
|
|
28748
29229
|
if (bg) mergedStyle += `; background-color: ${bg}`;
|
|
28749
29230
|
if (borderColor) mergedStyle += `; border-color: ${borderColor}`;
|
|
28750
29231
|
if (borderStyle) mergedStyle += `; border-style: ${borderStyle}`;
|
|
28751
29232
|
if (borderWidth) mergedStyle += `; border-width: ${borderWidth}`;
|
|
29233
|
+
if (verticalAlign) mergedStyle += `; vertical-align: ${verticalAlign}`;
|
|
28752
29234
|
mergedStyle = mergedStyle.replace(/^;/, "").trim();
|
|
28753
29235
|
return [
|
|
28754
29236
|
"th",
|
|
28755
|
-
|
|
29237
|
+
mergeAttributes7(this.options.HTMLAttributes, HTMLAttributes, getFormulaStateAttributes(HTMLAttributes), mergedStyle ? { style: mergedStyle } : {}),
|
|
28756
29238
|
0
|
|
28757
29239
|
];
|
|
28758
29240
|
}
|
|
@@ -28778,7 +29260,7 @@ var CustomTaskList = TaskList.extend({
|
|
|
28778
29260
|
var lowlight = createLowlight(common);
|
|
28779
29261
|
var CustomCodeBlockLowlight = CodeBlockLowlight.extend({
|
|
28780
29262
|
addNodeView() {
|
|
28781
|
-
return
|
|
29263
|
+
return ReactNodeViewRenderer7(CodeBlockView);
|
|
28782
29264
|
}
|
|
28783
29265
|
});
|
|
28784
29266
|
function buildUEditorExtensions({
|
|
@@ -28922,7 +29404,9 @@ function buildUEditorExtensions({
|
|
|
28922
29404
|
}),
|
|
28923
29405
|
FileCard.configure({
|
|
28924
29406
|
upload: uploadFile
|
|
28925
|
-
})
|
|
29407
|
+
}),
|
|
29408
|
+
FormCheckbox2,
|
|
29409
|
+
FormRadio
|
|
28926
29410
|
];
|
|
28927
29411
|
}
|
|
28928
29412
|
|
|
@@ -28965,18 +29449,22 @@ import {
|
|
|
28965
29449
|
Type as Type2,
|
|
28966
29450
|
Underline as UnderlineIcon,
|
|
28967
29451
|
Undo as UndoIcon,
|
|
28968
|
-
Upload as Upload3
|
|
29452
|
+
Upload as Upload3,
|
|
29453
|
+
AlignStartVertical,
|
|
29454
|
+
AlignCenterVertical,
|
|
29455
|
+
AlignEndVertical
|
|
28969
29456
|
} from "lucide-react";
|
|
29457
|
+
import { setCellAttr } from "@tiptap/pm/tables";
|
|
28970
29458
|
|
|
28971
29459
|
// src/components/UEditor/colors.tsx
|
|
28972
29460
|
import { useMemo as useMemo22, useRef as useRef30 } from "react";
|
|
28973
|
-
import { Check as
|
|
28974
|
-
import { jsx as
|
|
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";
|
|
28975
29463
|
var TextColorIcon = ({ color }) => {
|
|
28976
29464
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
28977
|
-
return /* @__PURE__ */
|
|
28978
|
-
/* @__PURE__ */
|
|
28979
|
-
/* @__PURE__ */
|
|
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(
|
|
28980
29468
|
"span",
|
|
28981
29469
|
{
|
|
28982
29470
|
"aria-hidden": "true",
|
|
@@ -28988,9 +29476,9 @@ var TextColorIcon = ({ color }) => {
|
|
|
28988
29476
|
};
|
|
28989
29477
|
var HighlightColorIcon = ({ color }) => {
|
|
28990
29478
|
const underlineColor = color || "currentColor";
|
|
28991
|
-
return /* @__PURE__ */
|
|
28992
|
-
/* @__PURE__ */
|
|
28993
|
-
/* @__PURE__ */
|
|
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(
|
|
28994
29482
|
"span",
|
|
28995
29483
|
{
|
|
28996
29484
|
"aria-hidden": "true",
|
|
@@ -29002,9 +29490,9 @@ var HighlightColorIcon = ({ color }) => {
|
|
|
29002
29490
|
};
|
|
29003
29491
|
var CellBgColorIcon = ({ color }) => {
|
|
29004
29492
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
29005
|
-
return /* @__PURE__ */
|
|
29006
|
-
/* @__PURE__ */
|
|
29007
|
-
/* @__PURE__ */
|
|
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(
|
|
29008
29496
|
"span",
|
|
29009
29497
|
{
|
|
29010
29498
|
"aria-hidden": "true",
|
|
@@ -29016,9 +29504,9 @@ var CellBgColorIcon = ({ color }) => {
|
|
|
29016
29504
|
};
|
|
29017
29505
|
var CellBorderIcon = ({ color }) => {
|
|
29018
29506
|
const underlineColor = color && color !== "inherit" ? color : "currentColor";
|
|
29019
|
-
return /* @__PURE__ */
|
|
29020
|
-
/* @__PURE__ */
|
|
29021
|
-
/* @__PURE__ */
|
|
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(
|
|
29022
29510
|
"span",
|
|
29023
29511
|
{
|
|
29024
29512
|
"aria-hidden": "true",
|
|
@@ -29145,9 +29633,9 @@ var EditorColorPalette = ({
|
|
|
29145
29633
|
const colorInputRef = useRef30(null);
|
|
29146
29634
|
const automaticColor = colors[0]?.color ?? "";
|
|
29147
29635
|
const paletteColors = colors.slice(1);
|
|
29148
|
-
return /* @__PURE__ */
|
|
29149
|
-
/* @__PURE__ */
|
|
29150
|
-
/* @__PURE__ */
|
|
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(
|
|
29151
29639
|
"button",
|
|
29152
29640
|
{
|
|
29153
29641
|
type: "button",
|
|
@@ -29159,12 +29647,12 @@ var EditorColorPalette = ({
|
|
|
29159
29647
|
currentColor === automaticColor ? "border-primary text-primary" : "border-transparent text-foreground"
|
|
29160
29648
|
),
|
|
29161
29649
|
children: [
|
|
29162
|
-
/* @__PURE__ */
|
|
29163
|
-
/* @__PURE__ */
|
|
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") })
|
|
29164
29652
|
]
|
|
29165
29653
|
}
|
|
29166
29654
|
),
|
|
29167
|
-
/* @__PURE__ */
|
|
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(
|
|
29168
29656
|
"button",
|
|
29169
29657
|
{
|
|
29170
29658
|
type: "button",
|
|
@@ -29176,10 +29664,10 @@ var EditorColorPalette = ({
|
|
|
29176
29664
|
currentColor === c.color ? "border-primary ring-2 ring-primary/25" : "border-border/70"
|
|
29177
29665
|
),
|
|
29178
29666
|
style: { backgroundColor: c.color || "transparent" },
|
|
29179
|
-
children: currentColor === c.color && /* @__PURE__ */
|
|
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)) }) })
|
|
29180
29668
|
}
|
|
29181
29669
|
) }, `${c.name}-${c.color}`)) }),
|
|
29182
|
-
/* @__PURE__ */
|
|
29670
|
+
/* @__PURE__ */ jsxs71(
|
|
29183
29671
|
"button",
|
|
29184
29672
|
{
|
|
29185
29673
|
type: "button",
|
|
@@ -29187,7 +29675,7 @@ var EditorColorPalette = ({
|
|
|
29187
29675
|
onClick: () => colorInputRef.current?.click(),
|
|
29188
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",
|
|
29189
29677
|
children: [
|
|
29190
|
-
/* @__PURE__ */
|
|
29678
|
+
/* @__PURE__ */ jsx86(
|
|
29191
29679
|
"span",
|
|
29192
29680
|
{
|
|
29193
29681
|
"aria-hidden": "true",
|
|
@@ -29197,9 +29685,9 @@ var EditorColorPalette = ({
|
|
|
29197
29685
|
}
|
|
29198
29686
|
}
|
|
29199
29687
|
),
|
|
29200
|
-
/* @__PURE__ */
|
|
29201
|
-
/* @__PURE__ */
|
|
29202
|
-
/* @__PURE__ */
|
|
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(
|
|
29203
29691
|
"input",
|
|
29204
29692
|
{
|
|
29205
29693
|
ref: colorInputRef,
|
|
@@ -29345,8 +29833,8 @@ function deleteSelectedImage(editor) {
|
|
|
29345
29833
|
|
|
29346
29834
|
// src/components/UEditor/inputs.tsx
|
|
29347
29835
|
import { useEffect as useEffect35, useRef as useRef31, useState as useState46 } from "react";
|
|
29348
|
-
import { Check as
|
|
29349
|
-
import { jsx as
|
|
29836
|
+
import { Check as Check13, X as X18 } from "lucide-react";
|
|
29837
|
+
import { jsx as jsx87, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
29350
29838
|
function normalizeUrl(raw) {
|
|
29351
29839
|
return sanitizeUEditorUrl(raw, "link");
|
|
29352
29840
|
}
|
|
@@ -29367,8 +29855,8 @@ var LinkInput = ({
|
|
|
29367
29855
|
const normalized = normalizeUrl(url);
|
|
29368
29856
|
if (normalized) onSubmit(normalized);
|
|
29369
29857
|
};
|
|
29370
|
-
return /* @__PURE__ */
|
|
29371
|
-
/* @__PURE__ */
|
|
29858
|
+
return /* @__PURE__ */ jsxs72("form", { onSubmit: handleSubmit, className: "flex items-center gap-2 p-2", children: [
|
|
29859
|
+
/* @__PURE__ */ jsx87(
|
|
29372
29860
|
"input",
|
|
29373
29861
|
{
|
|
29374
29862
|
ref: inputRef,
|
|
@@ -29379,8 +29867,8 @@ var LinkInput = ({
|
|
|
29379
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"
|
|
29380
29868
|
}
|
|
29381
29869
|
),
|
|
29382
|
-
/* @__PURE__ */
|
|
29383
|
-
/* @__PURE__ */
|
|
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" }) })
|
|
29384
29872
|
] });
|
|
29385
29873
|
};
|
|
29386
29874
|
var ImageInput = ({ onSubmit, onCancel }) => {
|
|
@@ -29398,10 +29886,10 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
29398
29886
|
onSubmit(safeUrl, alt);
|
|
29399
29887
|
}
|
|
29400
29888
|
};
|
|
29401
|
-
return /* @__PURE__ */
|
|
29402
|
-
/* @__PURE__ */
|
|
29403
|
-
/* @__PURE__ */
|
|
29404
|
-
/* @__PURE__ */
|
|
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(
|
|
29405
29893
|
"input",
|
|
29406
29894
|
{
|
|
29407
29895
|
ref: inputRef,
|
|
@@ -29413,9 +29901,9 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
29413
29901
|
}
|
|
29414
29902
|
)
|
|
29415
29903
|
] }),
|
|
29416
|
-
/* @__PURE__ */
|
|
29417
|
-
/* @__PURE__ */
|
|
29418
|
-
/* @__PURE__ */
|
|
29904
|
+
/* @__PURE__ */ jsxs72("div", { children: [
|
|
29905
|
+
/* @__PURE__ */ jsx87("label", { className: "text-xs font-medium text-muted-foreground", children: t("imageInput.altLabel") }),
|
|
29906
|
+
/* @__PURE__ */ jsx87(
|
|
29419
29907
|
"input",
|
|
29420
29908
|
{
|
|
29421
29909
|
type: "text",
|
|
@@ -29426,8 +29914,8 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
29426
29914
|
}
|
|
29427
29915
|
)
|
|
29428
29916
|
] }),
|
|
29429
|
-
/* @__PURE__ */
|
|
29430
|
-
/* @__PURE__ */
|
|
29917
|
+
/* @__PURE__ */ jsxs72("div", { className: "flex gap-2", children: [
|
|
29918
|
+
/* @__PURE__ */ jsx87(
|
|
29431
29919
|
"button",
|
|
29432
29920
|
{
|
|
29433
29921
|
type: "submit",
|
|
@@ -29436,7 +29924,7 @@ var ImageInput = ({ onSubmit, onCancel }) => {
|
|
|
29436
29924
|
children: t("imageInput.addBtn")
|
|
29437
29925
|
}
|
|
29438
29926
|
),
|
|
29439
|
-
/* @__PURE__ */
|
|
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") })
|
|
29440
29928
|
] })
|
|
29441
29929
|
] });
|
|
29442
29930
|
};
|
|
@@ -29804,7 +30292,7 @@ function getDefaultLetterSpacings() {
|
|
|
29804
30292
|
}
|
|
29805
30293
|
|
|
29806
30294
|
// src/components/UEditor/toolbar.tsx
|
|
29807
|
-
import { Fragment as Fragment28, jsx as
|
|
30295
|
+
import { Fragment as Fragment28, jsx as jsx88, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
29808
30296
|
function getTableAnchorPos(editor) {
|
|
29809
30297
|
const tableInfo = findTableNodeInfoFromState(editor.state);
|
|
29810
30298
|
if (tableInfo) return editor.state.selection.from;
|
|
@@ -29835,7 +30323,7 @@ function formatTableInsertLabel(template, rows, cols) {
|
|
|
29835
30323
|
return template.replace("{rows}", String(rows)).replace("{cols}", String(cols));
|
|
29836
30324
|
}
|
|
29837
30325
|
var ToolbarButton = React77.forwardRef(({ onClick, onMouseDown, active, disabled, children, title, className }, ref) => {
|
|
29838
|
-
const button = /* @__PURE__ */
|
|
30326
|
+
const button = /* @__PURE__ */ jsx88(
|
|
29839
30327
|
"button",
|
|
29840
30328
|
{
|
|
29841
30329
|
ref,
|
|
@@ -29860,12 +30348,12 @@ var ToolbarButton = React77.forwardRef(({ onClick, onMouseDown, active, disabled
|
|
|
29860
30348
|
}
|
|
29861
30349
|
);
|
|
29862
30350
|
if (title) {
|
|
29863
|
-
return /* @__PURE__ */
|
|
30351
|
+
return /* @__PURE__ */ jsx88(Tooltip, { content: title, placement: "top", delay: { open: 200, close: 0 }, children: button });
|
|
29864
30352
|
}
|
|
29865
30353
|
return button;
|
|
29866
30354
|
});
|
|
29867
30355
|
ToolbarButton.displayName = "ToolbarButton";
|
|
29868
|
-
var ToolbarDivider = () => /* @__PURE__ */
|
|
30356
|
+
var ToolbarDivider = () => /* @__PURE__ */ jsx88("div", { className: "mx-0.5 h-5 w-px bg-border/60" });
|
|
29869
30357
|
var TableInsertGrid = ({
|
|
29870
30358
|
insertLabel,
|
|
29871
30359
|
previewTemplate,
|
|
@@ -29874,14 +30362,14 @@ var TableInsertGrid = ({
|
|
|
29874
30362
|
const [selection, setSelection] = React77.useState({ rows: 3, cols: 3 });
|
|
29875
30363
|
const maxRows = 8;
|
|
29876
30364
|
const maxCols = 8;
|
|
29877
|
-
return /* @__PURE__ */
|
|
29878
|
-
/* @__PURE__ */
|
|
29879
|
-
/* @__PURE__ */
|
|
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(
|
|
29880
30368
|
(_, rowIndex) => Array.from({ length: maxCols }).map((__, colIndex) => {
|
|
29881
30369
|
const rows = rowIndex + 1;
|
|
29882
30370
|
const cols = colIndex + 1;
|
|
29883
30371
|
const active = rows <= selection.rows && cols <= selection.cols;
|
|
29884
|
-
return /* @__PURE__ */
|
|
30372
|
+
return /* @__PURE__ */ jsx88(
|
|
29885
30373
|
"button",
|
|
29886
30374
|
{
|
|
29887
30375
|
type: "button",
|
|
@@ -29899,9 +30387,18 @@ var TableInsertGrid = ({
|
|
|
29899
30387
|
);
|
|
29900
30388
|
})
|
|
29901
30389
|
) }),
|
|
29902
|
-
/* @__PURE__ */
|
|
30390
|
+
/* @__PURE__ */ jsx88("div", { className: "mt-2 text-xs text-muted-foreground", children: insertLabel })
|
|
29903
30391
|
] });
|
|
29904
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
|
+
}
|
|
29905
30402
|
var EditorToolbar = ({
|
|
29906
30403
|
editor,
|
|
29907
30404
|
variant,
|
|
@@ -29941,6 +30438,7 @@ var EditorToolbar = ({
|
|
|
29941
30438
|
const hasTableContext = isTableSelected || tableCommandAnchorPosRef.current !== null;
|
|
29942
30439
|
const canMergeCells = hasTableContext && editor.can().mergeCells();
|
|
29943
30440
|
const canSplitCell = hasTableContext && editor.can().splitCell();
|
|
30441
|
+
const currentCellVerticalAlign = normalizeStyleValue(editor.getAttributes("tableCell").verticalAlign || editor.getAttributes("tableHeader").verticalAlign) || "";
|
|
29944
30442
|
const currentFontFamily = normalizeStyleValue(textStyleAttrs.fontFamily);
|
|
29945
30443
|
const currentFontSize = normalizeStyleValue(textStyleAttrs.fontSize);
|
|
29946
30444
|
const currentTextColor = normalizeStyleValue(textStyleAttrs.color) || "inherit";
|
|
@@ -29963,6 +30461,9 @@ var EditorToolbar = ({
|
|
|
29963
30461
|
const displayedFontSizeLabel = currentFontSize ? currentFontSizeLabel : "13";
|
|
29964
30462
|
const activeFontSize = currentFontSize || "13px";
|
|
29965
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;
|
|
29966
30467
|
const insertImageFiles = async (files) => {
|
|
29967
30468
|
if (files.length === 0) return;
|
|
29968
30469
|
setIsUploadingImage(true);
|
|
@@ -29984,31 +30485,74 @@ var EditorToolbar = ({
|
|
|
29984
30485
|
setIsUploadingImage(false);
|
|
29985
30486
|
};
|
|
29986
30487
|
if (variant === "minimal") {
|
|
29987
|
-
return /* @__PURE__ */
|
|
29988
|
-
/* @__PURE__ */
|
|
29989
|
-
/* @__PURE__ */
|
|
29990
|
-
/* @__PURE__ */
|
|
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(
|
|
29991
30495
|
ToolbarButton,
|
|
29992
30496
|
{
|
|
29993
30497
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
29994
30498
|
active: editor.isActive("bulletList"),
|
|
29995
30499
|
title: t("toolbar.bulletList"),
|
|
29996
|
-
children: /* @__PURE__ */
|
|
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
|
+
] })
|
|
29997
30540
|
}
|
|
29998
30541
|
)
|
|
29999
30542
|
] });
|
|
30000
30543
|
}
|
|
30001
|
-
|
|
30002
|
-
|
|
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(
|
|
30003
30547
|
DropdownMenu,
|
|
30004
30548
|
{
|
|
30005
|
-
trigger: /* @__PURE__ */
|
|
30549
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30006
30550
|
}, title: t("toolbar.fontFamily"), className: "min-w-0 max-w-40 px-1.5 w-auto gap-1", children: [
|
|
30007
|
-
/* @__PURE__ */
|
|
30008
|
-
/* @__PURE__ */
|
|
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" })
|
|
30009
30553
|
] }),
|
|
30010
30554
|
contentClassName: "max-h-80 overflow-y-auto min-w-56 p-2",
|
|
30011
|
-
children: availableFontFamilies.map((option) => /* @__PURE__ */
|
|
30555
|
+
children: availableFontFamilies.map((option) => /* @__PURE__ */ jsx88(
|
|
30012
30556
|
DropdownMenuItem,
|
|
30013
30557
|
{
|
|
30014
30558
|
label: option.label,
|
|
@@ -30020,19 +30564,19 @@ var EditorToolbar = ({
|
|
|
30020
30564
|
))
|
|
30021
30565
|
}
|
|
30022
30566
|
),
|
|
30023
|
-
/* @__PURE__ */
|
|
30567
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsx88(
|
|
30024
30568
|
DropdownMenu,
|
|
30025
30569
|
{
|
|
30026
|
-
trigger: /* @__PURE__ */
|
|
30570
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30027
30571
|
}, title: t("toolbar.fontSize"), className: "px-1.5 w-auto gap-1", children: [
|
|
30028
|
-
/* @__PURE__ */
|
|
30029
|
-
/* @__PURE__ */
|
|
30030
|
-
/* @__PURE__ */
|
|
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 })
|
|
30031
30575
|
] }),
|
|
30032
|
-
/* @__PURE__ */
|
|
30576
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
|
|
30033
30577
|
] }),
|
|
30034
30578
|
contentClassName: "max-h-80 overflow-y-auto min-w-32 p-2",
|
|
30035
|
-
children: availableFontSizes.map((option) => /* @__PURE__ */
|
|
30579
|
+
children: availableFontSizes.map((option) => /* @__PURE__ */ jsx88(
|
|
30036
30580
|
DropdownMenuItem,
|
|
30037
30581
|
{
|
|
30038
30582
|
label: option.label,
|
|
@@ -30043,17 +30587,17 @@ var EditorToolbar = ({
|
|
|
30043
30587
|
))
|
|
30044
30588
|
}
|
|
30045
30589
|
),
|
|
30046
|
-
/* @__PURE__ */
|
|
30590
|
+
/* @__PURE__ */ jsxs73(
|
|
30047
30591
|
DropdownMenu,
|
|
30048
30592
|
{
|
|
30049
30593
|
contentClassName: "p-1",
|
|
30050
|
-
trigger: /* @__PURE__ */
|
|
30594
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30051
30595
|
}, title: t("toolbar.textStyle"), className: "px-1.5 w-auto gap-0.5", children: [
|
|
30052
|
-
/* @__PURE__ */
|
|
30053
|
-
/* @__PURE__ */
|
|
30596
|
+
/* @__PURE__ */ jsx88(Type2, { className: "w-4 h-4" }),
|
|
30597
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "h-3 w-3 text-muted-foreground" })
|
|
30054
30598
|
] }),
|
|
30055
30599
|
children: [
|
|
30056
|
-
/* @__PURE__ */
|
|
30600
|
+
/* @__PURE__ */ jsx88(
|
|
30057
30601
|
DropdownMenuItem,
|
|
30058
30602
|
{
|
|
30059
30603
|
icon: Type2,
|
|
@@ -30062,7 +30606,7 @@ var EditorToolbar = ({
|
|
|
30062
30606
|
active: editor.isActive("paragraph")
|
|
30063
30607
|
}
|
|
30064
30608
|
),
|
|
30065
|
-
/* @__PURE__ */
|
|
30609
|
+
/* @__PURE__ */ jsx88(
|
|
30066
30610
|
DropdownMenuItem,
|
|
30067
30611
|
{
|
|
30068
30612
|
icon: Heading1Icon,
|
|
@@ -30072,7 +30616,7 @@ var EditorToolbar = ({
|
|
|
30072
30616
|
shortcut: "Ctrl+Alt+1"
|
|
30073
30617
|
}
|
|
30074
30618
|
),
|
|
30075
|
-
/* @__PURE__ */
|
|
30619
|
+
/* @__PURE__ */ jsx88(
|
|
30076
30620
|
DropdownMenuItem,
|
|
30077
30621
|
{
|
|
30078
30622
|
icon: Heading2Icon,
|
|
@@ -30082,7 +30626,7 @@ var EditorToolbar = ({
|
|
|
30082
30626
|
shortcut: "Ctrl+Alt+2"
|
|
30083
30627
|
}
|
|
30084
30628
|
),
|
|
30085
|
-
/* @__PURE__ */
|
|
30629
|
+
/* @__PURE__ */ jsx88(
|
|
30086
30630
|
DropdownMenuItem,
|
|
30087
30631
|
{
|
|
30088
30632
|
icon: Heading3Icon,
|
|
@@ -30095,106 +30639,110 @@ var EditorToolbar = ({
|
|
|
30095
30639
|
]
|
|
30096
30640
|
}
|
|
30097
30641
|
),
|
|
30098
|
-
/* @__PURE__ */
|
|
30099
|
-
|
|
30100
|
-
|
|
30101
|
-
|
|
30102
|
-
|
|
30103
|
-
|
|
30104
|
-
|
|
30105
|
-
|
|
30106
|
-
|
|
30107
|
-
|
|
30108
|
-
|
|
30109
|
-
|
|
30110
|
-
|
|
30111
|
-
|
|
30112
|
-
|
|
30113
|
-
|
|
30114
|
-
|
|
30115
|
-
|
|
30116
|
-
|
|
30117
|
-
|
|
30118
|
-
|
|
30119
|
-
|
|
30120
|
-
|
|
30121
|
-
|
|
30122
|
-
|
|
30123
|
-
|
|
30124
|
-
|
|
30125
|
-
|
|
30126
|
-
|
|
30127
|
-
|
|
30128
|
-
|
|
30129
|
-
|
|
30130
|
-
|
|
30131
|
-
|
|
30132
|
-
|
|
30133
|
-
|
|
30134
|
-
|
|
30135
|
-
|
|
30136
|
-
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
|
|
30140
|
-
|
|
30141
|
-
|
|
30142
|
-
|
|
30143
|
-
|
|
30144
|
-
|
|
30145
|
-
|
|
30146
|
-
|
|
30147
|
-
|
|
30148
|
-
|
|
30149
|
-
|
|
30150
|
-
|
|
30151
|
-
|
|
30152
|
-
|
|
30153
|
-
|
|
30154
|
-
|
|
30155
|
-
|
|
30156
|
-
|
|
30157
|
-
|
|
30158
|
-
|
|
30159
|
-
|
|
30160
|
-
|
|
30161
|
-
|
|
30162
|
-
/* @__PURE__ */
|
|
30163
|
-
/* @__PURE__ */
|
|
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(
|
|
30164
30710
|
ToolbarButton,
|
|
30165
30711
|
{
|
|
30166
30712
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
30167
30713
|
active: editor.isActive("underline"),
|
|
30168
30714
|
title: t("toolbar.underline"),
|
|
30169
|
-
children: /* @__PURE__ */
|
|
30170
|
-
}
|
|
30171
|
-
),
|
|
30172
|
-
/* @__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" }) }),
|
|
30173
|
-
/* @__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" }) }),
|
|
30174
|
-
/* @__PURE__ */ jsx86(
|
|
30175
|
-
ToolbarButton,
|
|
30176
|
-
{
|
|
30177
|
-
onClick: () => editor.chain().focus().toggleSubscript().run(),
|
|
30178
|
-
active: editor.isActive("subscript"),
|
|
30179
|
-
title: t("toolbar.subscript"),
|
|
30180
|
-
children: /* @__PURE__ */ jsx86(SubscriptIcon, { className: "w-4 h-4" })
|
|
30715
|
+
children: /* @__PURE__ */ jsx88(UnderlineIcon, { className: "w-4 h-4" })
|
|
30181
30716
|
}
|
|
30182
30717
|
),
|
|
30183
|
-
/* @__PURE__ */
|
|
30184
|
-
|
|
30185
|
-
|
|
30186
|
-
|
|
30187
|
-
|
|
30188
|
-
|
|
30189
|
-
|
|
30190
|
-
|
|
30191
|
-
|
|
30192
|
-
|
|
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(
|
|
30193
30741
|
DropdownMenu,
|
|
30194
30742
|
{
|
|
30195
30743
|
contentClassName: "min-w-72",
|
|
30196
|
-
trigger: /* @__PURE__ */
|
|
30197
|
-
children: showLinkInput ? /* @__PURE__ */
|
|
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(
|
|
30198
30746
|
LinkInput,
|
|
30199
30747
|
{
|
|
30200
30748
|
initialUrl: String(editor.getAttributes("link").href ?? ""),
|
|
@@ -30204,8 +30752,8 @@ var EditorToolbar = ({
|
|
|
30204
30752
|
},
|
|
30205
30753
|
onCancel: () => setShowLinkInput(false)
|
|
30206
30754
|
}
|
|
30207
|
-
) : /* @__PURE__ */
|
|
30208
|
-
/* @__PURE__ */
|
|
30755
|
+
) : /* @__PURE__ */ jsxs73(Fragment28, { children: [
|
|
30756
|
+
/* @__PURE__ */ jsx88(
|
|
30209
30757
|
DropdownMenuItem,
|
|
30210
30758
|
{
|
|
30211
30759
|
icon: LinkIcon,
|
|
@@ -30215,7 +30763,7 @@ var EditorToolbar = ({
|
|
|
30215
30763
|
closeOnSelect: false
|
|
30216
30764
|
}
|
|
30217
30765
|
),
|
|
30218
|
-
/* @__PURE__ */
|
|
30766
|
+
/* @__PURE__ */ jsx88(
|
|
30219
30767
|
DropdownMenuItem,
|
|
30220
30768
|
{
|
|
30221
30769
|
icon: Trash22,
|
|
@@ -30228,16 +30776,16 @@ var EditorToolbar = ({
|
|
|
30228
30776
|
] })
|
|
30229
30777
|
}
|
|
30230
30778
|
),
|
|
30231
|
-
/* @__PURE__ */
|
|
30232
|
-
/* @__PURE__ */
|
|
30779
|
+
/* @__PURE__ */ jsx88(ToolbarDivider, {}),
|
|
30780
|
+
/* @__PURE__ */ jsx88(
|
|
30233
30781
|
DropdownMenu,
|
|
30234
30782
|
{
|
|
30235
|
-
trigger: /* @__PURE__ */
|
|
30783
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30236
30784
|
}, title: t("colors.textColor"), children: [
|
|
30237
|
-
/* @__PURE__ */
|
|
30238
|
-
/* @__PURE__ */
|
|
30785
|
+
/* @__PURE__ */ jsx88(TextColorIcon, { color: currentTextColor }),
|
|
30786
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30239
30787
|
] }),
|
|
30240
|
-
children: /* @__PURE__ */
|
|
30788
|
+
children: /* @__PURE__ */ jsx88(
|
|
30241
30789
|
EditorColorPalette,
|
|
30242
30790
|
{
|
|
30243
30791
|
colors: textColors,
|
|
@@ -30254,15 +30802,15 @@ var EditorToolbar = ({
|
|
|
30254
30802
|
)
|
|
30255
30803
|
}
|
|
30256
30804
|
),
|
|
30257
|
-
/* @__PURE__ */
|
|
30805
|
+
/* @__PURE__ */ jsx88(
|
|
30258
30806
|
DropdownMenu,
|
|
30259
30807
|
{
|
|
30260
|
-
trigger: /* @__PURE__ */
|
|
30808
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30261
30809
|
}, active: editor.isActive("highlight"), title: t("colors.highlight"), children: [
|
|
30262
|
-
/* @__PURE__ */
|
|
30263
|
-
/* @__PURE__ */
|
|
30810
|
+
/* @__PURE__ */ jsx88(HighlightColorIcon, { color: currentHighlightColor }),
|
|
30811
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30264
30812
|
] }),
|
|
30265
|
-
children: /* @__PURE__ */
|
|
30813
|
+
children: /* @__PURE__ */ jsx88(
|
|
30266
30814
|
EditorColorPalette,
|
|
30267
30815
|
{
|
|
30268
30816
|
colors: highlightColors,
|
|
@@ -30279,83 +30827,117 @@ var EditorToolbar = ({
|
|
|
30279
30827
|
)
|
|
30280
30828
|
}
|
|
30281
30829
|
),
|
|
30282
|
-
/* @__PURE__ */
|
|
30283
|
-
|
|
30284
|
-
|
|
30285
|
-
|
|
30286
|
-
|
|
30287
|
-
|
|
30288
|
-
|
|
30289
|
-
|
|
30290
|
-
|
|
30291
|
-
|
|
30292
|
-
onSelect: (emoji) => {
|
|
30293
|
-
editor.chain().focus().insertContent(emoji).run();
|
|
30294
|
-
}
|
|
30295
|
-
}
|
|
30296
|
-
)
|
|
30297
|
-
}
|
|
30298
|
-
),
|
|
30299
|
-
/* @__PURE__ */ jsx86(ToolbarDivider, {}),
|
|
30300
|
-
/* @__PURE__ */ jsxs72(
|
|
30301
|
-
DropdownMenu,
|
|
30302
|
-
{
|
|
30303
|
-
trigger: /* @__PURE__ */ jsxs72(ToolbarButton, { onClick: () => {
|
|
30304
|
-
}, title: t("toolbar.alignment"), children: [
|
|
30305
|
-
/* @__PURE__ */ jsx86(AlignLeft, { className: "w-4 h-4" }),
|
|
30306
|
-
/* @__PURE__ */ jsx86(ChevronDown8, { className: "w-3 h-3" })
|
|
30307
|
-
] }),
|
|
30308
|
-
children: [
|
|
30309
|
-
/* @__PURE__ */ jsx86(
|
|
30310
|
-
DropdownMenuItem,
|
|
30311
|
-
{
|
|
30312
|
-
icon: AlignLeft,
|
|
30313
|
-
label: t("toolbar.alignLeft"),
|
|
30314
|
-
onClick: () => editor.chain().focus().setTextAlign("left").run(),
|
|
30315
|
-
active: editor.isActive({ textAlign: "left" })
|
|
30316
|
-
}
|
|
30317
|
-
),
|
|
30318
|
-
/* @__PURE__ */ jsx86(
|
|
30319
|
-
DropdownMenuItem,
|
|
30320
|
-
{
|
|
30321
|
-
icon: AlignCenter,
|
|
30322
|
-
label: t("toolbar.alignCenter"),
|
|
30323
|
-
onClick: () => editor.chain().focus().setTextAlign("center").run(),
|
|
30324
|
-
active: editor.isActive({ textAlign: "center" })
|
|
30325
|
-
}
|
|
30326
|
-
),
|
|
30327
|
-
/* @__PURE__ */ jsx86(
|
|
30328
|
-
DropdownMenuItem,
|
|
30329
|
-
{
|
|
30330
|
-
icon: AlignRight,
|
|
30331
|
-
label: t("toolbar.alignRight"),
|
|
30332
|
-
onClick: () => editor.chain().focus().setTextAlign("right").run(),
|
|
30333
|
-
active: editor.isActive({ textAlign: "right" })
|
|
30334
|
-
}
|
|
30335
|
-
),
|
|
30336
|
-
/* @__PURE__ */ jsx86(
|
|
30337
|
-
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,
|
|
30338
30840
|
{
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
active: editor.isActive({ textAlign: "justify" })
|
|
30841
|
+
onSelect: (emoji) => {
|
|
30842
|
+
editor.chain().focus().insertContent(emoji).run();
|
|
30843
|
+
}
|
|
30343
30844
|
}
|
|
30344
30845
|
)
|
|
30345
|
-
|
|
30346
|
-
|
|
30347
|
-
),
|
|
30348
|
-
/* @__PURE__ */
|
|
30349
|
-
|
|
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(
|
|
30350
30932
|
DropdownMenu,
|
|
30351
30933
|
{
|
|
30352
|
-
trigger: /* @__PURE__ */
|
|
30934
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30353
30935
|
}, title: t("toolbar.bulletList"), children: [
|
|
30354
|
-
/* @__PURE__ */
|
|
30355
|
-
/* @__PURE__ */
|
|
30936
|
+
/* @__PURE__ */ jsx88(ListIcon, { className: "w-4 h-4" }),
|
|
30937
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30356
30938
|
] }),
|
|
30357
30939
|
children: [
|
|
30358
|
-
/* @__PURE__ */
|
|
30940
|
+
/* @__PURE__ */ jsx88(
|
|
30359
30941
|
DropdownMenuItem,
|
|
30360
30942
|
{
|
|
30361
30943
|
icon: ListIcon,
|
|
@@ -30365,7 +30947,7 @@ var EditorToolbar = ({
|
|
|
30365
30947
|
shortcut: "Ctrl+Shift+8"
|
|
30366
30948
|
}
|
|
30367
30949
|
),
|
|
30368
|
-
/* @__PURE__ */
|
|
30950
|
+
/* @__PURE__ */ jsx88(
|
|
30369
30951
|
DropdownMenuItem,
|
|
30370
30952
|
{
|
|
30371
30953
|
icon: ListOrderedIcon,
|
|
@@ -30375,7 +30957,7 @@ var EditorToolbar = ({
|
|
|
30375
30957
|
shortcut: "Ctrl+Shift+7"
|
|
30376
30958
|
}
|
|
30377
30959
|
),
|
|
30378
|
-
/* @__PURE__ */
|
|
30960
|
+
/* @__PURE__ */ jsx88(
|
|
30379
30961
|
DropdownMenuItem,
|
|
30380
30962
|
{
|
|
30381
30963
|
icon: ListTodo2,
|
|
@@ -30388,16 +30970,17 @@ var EditorToolbar = ({
|
|
|
30388
30970
|
]
|
|
30389
30971
|
}
|
|
30390
30972
|
),
|
|
30391
|
-
/* @__PURE__ */
|
|
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(
|
|
30392
30975
|
DropdownMenu,
|
|
30393
30976
|
{
|
|
30394
|
-
trigger: /* @__PURE__ */
|
|
30977
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30395
30978
|
}, title: t("toolbar.quote"), children: [
|
|
30396
|
-
/* @__PURE__ */
|
|
30397
|
-
/* @__PURE__ */
|
|
30979
|
+
/* @__PURE__ */ jsx88(QuoteIcon, { className: "w-4 h-4" }),
|
|
30980
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30398
30981
|
] }),
|
|
30399
30982
|
children: [
|
|
30400
|
-
/* @__PURE__ */
|
|
30983
|
+
/* @__PURE__ */ jsx88(
|
|
30401
30984
|
DropdownMenuItem,
|
|
30402
30985
|
{
|
|
30403
30986
|
icon: QuoteIcon,
|
|
@@ -30407,7 +30990,7 @@ var EditorToolbar = ({
|
|
|
30407
30990
|
shortcut: "Ctrl+Shift+B"
|
|
30408
30991
|
}
|
|
30409
30992
|
),
|
|
30410
|
-
/* @__PURE__ */
|
|
30993
|
+
/* @__PURE__ */ jsx88(
|
|
30411
30994
|
DropdownMenuItem,
|
|
30412
30995
|
{
|
|
30413
30996
|
icon: FileCode3,
|
|
@@ -30420,15 +31003,15 @@ var EditorToolbar = ({
|
|
|
30420
31003
|
]
|
|
30421
31004
|
}
|
|
30422
31005
|
),
|
|
30423
|
-
/* @__PURE__ */
|
|
31006
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsx88(
|
|
30424
31007
|
DropdownMenu,
|
|
30425
31008
|
{
|
|
30426
|
-
trigger: /* @__PURE__ */
|
|
31009
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30427
31010
|
}, title: t("toolbar.image"), children: [
|
|
30428
|
-
/* @__PURE__ */
|
|
30429
|
-
/* @__PURE__ */
|
|
31011
|
+
/* @__PURE__ */ jsx88(ImageIcon2, { className: "w-4 h-4" }),
|
|
31012
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30430
31013
|
] }),
|
|
30431
|
-
children: showImageInput ? /* @__PURE__ */
|
|
31014
|
+
children: showImageInput ? /* @__PURE__ */ jsx88(
|
|
30432
31015
|
ImageInput,
|
|
30433
31016
|
{
|
|
30434
31017
|
onSubmit: (url, alt) => {
|
|
@@ -30437,9 +31020,9 @@ var EditorToolbar = ({
|
|
|
30437
31020
|
},
|
|
30438
31021
|
onCancel: () => setShowImageInput(false)
|
|
30439
31022
|
}
|
|
30440
|
-
) : /* @__PURE__ */
|
|
30441
|
-
/* @__PURE__ */
|
|
30442
|
-
/* @__PURE__ */
|
|
31023
|
+
) : /* @__PURE__ */ jsxs73(Fragment28, { children: [
|
|
31024
|
+
/* @__PURE__ */ jsx88(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true), closeOnSelect: false }),
|
|
31025
|
+
/* @__PURE__ */ jsx88(
|
|
30443
31026
|
DropdownMenuItem,
|
|
30444
31027
|
{
|
|
30445
31028
|
icon: Upload3,
|
|
@@ -30449,8 +31032,8 @@ var EditorToolbar = ({
|
|
|
30449
31032
|
closeOnSelect: false
|
|
30450
31033
|
}
|
|
30451
31034
|
),
|
|
30452
|
-
imageUploadError && /* @__PURE__ */
|
|
30453
|
-
/* @__PURE__ */
|
|
31035
|
+
imageUploadError && /* @__PURE__ */ jsx88(DropdownMenuItem, { label: imageUploadError, disabled: true, destructive: true }),
|
|
31036
|
+
/* @__PURE__ */ jsx88(
|
|
30454
31037
|
"input",
|
|
30455
31038
|
{
|
|
30456
31039
|
ref: fileInputRef,
|
|
@@ -30465,8 +31048,8 @@ var EditorToolbar = ({
|
|
|
30465
31048
|
}
|
|
30466
31049
|
}
|
|
30467
31050
|
),
|
|
30468
|
-
/* @__PURE__ */
|
|
30469
|
-
/* @__PURE__ */
|
|
31051
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31052
|
+
/* @__PURE__ */ jsx88(
|
|
30470
31053
|
DropdownMenuItem,
|
|
30471
31054
|
{
|
|
30472
31055
|
icon: AlignCenter,
|
|
@@ -30476,7 +31059,7 @@ var EditorToolbar = ({
|
|
|
30476
31059
|
disabled: !isImageSelected
|
|
30477
31060
|
}
|
|
30478
31061
|
),
|
|
30479
|
-
/* @__PURE__ */
|
|
31062
|
+
/* @__PURE__ */ jsx88(
|
|
30480
31063
|
DropdownMenuItem,
|
|
30481
31064
|
{
|
|
30482
31065
|
icon: AlignLeft,
|
|
@@ -30486,7 +31069,7 @@ var EditorToolbar = ({
|
|
|
30486
31069
|
disabled: !isImageSelected
|
|
30487
31070
|
}
|
|
30488
31071
|
),
|
|
30489
|
-
/* @__PURE__ */
|
|
31072
|
+
/* @__PURE__ */ jsx88(
|
|
30490
31073
|
DropdownMenuItem,
|
|
30491
31074
|
{
|
|
30492
31075
|
icon: AlignRight,
|
|
@@ -30496,8 +31079,8 @@ var EditorToolbar = ({
|
|
|
30496
31079
|
disabled: !isImageSelected
|
|
30497
31080
|
}
|
|
30498
31081
|
),
|
|
30499
|
-
/* @__PURE__ */
|
|
30500
|
-
/* @__PURE__ */
|
|
31082
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31083
|
+
/* @__PURE__ */ jsx88(
|
|
30501
31084
|
DropdownMenuItem,
|
|
30502
31085
|
{
|
|
30503
31086
|
label: t("toolbar.imageWidthSm"),
|
|
@@ -30506,7 +31089,7 @@ var EditorToolbar = ({
|
|
|
30506
31089
|
disabled: !isImageSelected
|
|
30507
31090
|
}
|
|
30508
31091
|
),
|
|
30509
|
-
/* @__PURE__ */
|
|
31092
|
+
/* @__PURE__ */ jsx88(
|
|
30510
31093
|
DropdownMenuItem,
|
|
30511
31094
|
{
|
|
30512
31095
|
label: t("toolbar.imageWidthMd"),
|
|
@@ -30515,7 +31098,7 @@ var EditorToolbar = ({
|
|
|
30515
31098
|
disabled: !isImageSelected
|
|
30516
31099
|
}
|
|
30517
31100
|
),
|
|
30518
|
-
/* @__PURE__ */
|
|
31101
|
+
/* @__PURE__ */ jsx88(
|
|
30519
31102
|
DropdownMenuItem,
|
|
30520
31103
|
{
|
|
30521
31104
|
label: t("toolbar.imageWidthLg"),
|
|
@@ -30524,8 +31107,8 @@ var EditorToolbar = ({
|
|
|
30524
31107
|
disabled: !isImageSelected
|
|
30525
31108
|
}
|
|
30526
31109
|
),
|
|
30527
|
-
/* @__PURE__ */
|
|
30528
|
-
/* @__PURE__ */
|
|
31110
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31111
|
+
/* @__PURE__ */ jsx88(
|
|
30529
31112
|
DropdownMenuItem,
|
|
30530
31113
|
{
|
|
30531
31114
|
icon: RotateCcw2,
|
|
@@ -30534,7 +31117,7 @@ var EditorToolbar = ({
|
|
|
30534
31117
|
disabled: !isImageSelected
|
|
30535
31118
|
}
|
|
30536
31119
|
),
|
|
30537
|
-
/* @__PURE__ */
|
|
31120
|
+
/* @__PURE__ */ jsx88(
|
|
30538
31121
|
DropdownMenuItem,
|
|
30539
31122
|
{
|
|
30540
31123
|
icon: Trash22,
|
|
@@ -30547,7 +31130,7 @@ var EditorToolbar = ({
|
|
|
30547
31130
|
] })
|
|
30548
31131
|
}
|
|
30549
31132
|
),
|
|
30550
|
-
/* @__PURE__ */
|
|
31133
|
+
(isMediumFull || isFull) && /* @__PURE__ */ jsxs73(
|
|
30551
31134
|
DropdownMenu,
|
|
30552
31135
|
{
|
|
30553
31136
|
isOpen: isTableMenuOpen,
|
|
@@ -30555,14 +31138,14 @@ var EditorToolbar = ({
|
|
|
30555
31138
|
setIsTableMenuOpen(open);
|
|
30556
31139
|
tableCommandAnchorPosRef.current = open ? getTableAnchorPos(editor) : null;
|
|
30557
31140
|
},
|
|
30558
|
-
trigger: /* @__PURE__ */
|
|
31141
|
+
trigger: /* @__PURE__ */ jsxs73(ToolbarButton, { onClick: () => {
|
|
30559
31142
|
}, title: t("toolbar.table"), children: [
|
|
30560
|
-
/* @__PURE__ */
|
|
30561
|
-
/* @__PURE__ */
|
|
31143
|
+
/* @__PURE__ */ jsx88(TableIcon, { className: "w-4 h-4" }),
|
|
31144
|
+
/* @__PURE__ */ jsx88(ChevronDown8, { className: "w-3 h-3" })
|
|
30562
31145
|
] }),
|
|
30563
31146
|
contentClassName: "p-2 min-w-56",
|
|
30564
31147
|
children: [
|
|
30565
|
-
/* @__PURE__ */
|
|
31148
|
+
/* @__PURE__ */ jsx88(
|
|
30566
31149
|
TableInsertGrid,
|
|
30567
31150
|
{
|
|
30568
31151
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -30573,8 +31156,8 @@ var EditorToolbar = ({
|
|
|
30573
31156
|
}
|
|
30574
31157
|
}
|
|
30575
31158
|
),
|
|
30576
|
-
/* @__PURE__ */
|
|
30577
|
-
/* @__PURE__ */
|
|
31159
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31160
|
+
/* @__PURE__ */ jsx88(
|
|
30578
31161
|
DropdownMenuItem,
|
|
30579
31162
|
{
|
|
30580
31163
|
icon: AlignLeft,
|
|
@@ -30584,7 +31167,7 @@ var EditorToolbar = ({
|
|
|
30584
31167
|
disabled: !hasTableContext
|
|
30585
31168
|
}
|
|
30586
31169
|
),
|
|
30587
|
-
/* @__PURE__ */
|
|
31170
|
+
/* @__PURE__ */ jsx88(
|
|
30588
31171
|
DropdownMenuItem,
|
|
30589
31172
|
{
|
|
30590
31173
|
icon: AlignCenter,
|
|
@@ -30594,7 +31177,7 @@ var EditorToolbar = ({
|
|
|
30594
31177
|
disabled: !hasTableContext
|
|
30595
31178
|
}
|
|
30596
31179
|
),
|
|
30597
|
-
/* @__PURE__ */
|
|
31180
|
+
/* @__PURE__ */ jsx88(
|
|
30598
31181
|
DropdownMenuItem,
|
|
30599
31182
|
{
|
|
30600
31183
|
icon: AlignRight,
|
|
@@ -30604,8 +31187,8 @@ var EditorToolbar = ({
|
|
|
30604
31187
|
disabled: !hasTableContext
|
|
30605
31188
|
}
|
|
30606
31189
|
),
|
|
30607
|
-
/* @__PURE__ */
|
|
30608
|
-
/* @__PURE__ */
|
|
31190
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31191
|
+
/* @__PURE__ */ jsx88(
|
|
30609
31192
|
DropdownMenuItem,
|
|
30610
31193
|
{
|
|
30611
31194
|
icon: ArrowLeft,
|
|
@@ -30614,7 +31197,7 @@ var EditorToolbar = ({
|
|
|
30614
31197
|
disabled: !hasTableContext || !editor.can().addColumnBefore()
|
|
30615
31198
|
}
|
|
30616
31199
|
),
|
|
30617
|
-
/* @__PURE__ */
|
|
31200
|
+
/* @__PURE__ */ jsx88(
|
|
30618
31201
|
DropdownMenuItem,
|
|
30619
31202
|
{
|
|
30620
31203
|
icon: ArrowDown,
|
|
@@ -30623,7 +31206,7 @@ var EditorToolbar = ({
|
|
|
30623
31206
|
disabled: !hasTableContext || !editor.can().addColumnAfter()
|
|
30624
31207
|
}
|
|
30625
31208
|
),
|
|
30626
|
-
/* @__PURE__ */
|
|
31209
|
+
/* @__PURE__ */ jsx88(
|
|
30627
31210
|
DropdownMenuItem,
|
|
30628
31211
|
{
|
|
30629
31212
|
icon: ArrowUp,
|
|
@@ -30632,7 +31215,7 @@ var EditorToolbar = ({
|
|
|
30632
31215
|
disabled: !hasTableContext || !editor.can().addRowBefore()
|
|
30633
31216
|
}
|
|
30634
31217
|
),
|
|
30635
|
-
/* @__PURE__ */
|
|
31218
|
+
/* @__PURE__ */ jsx88(
|
|
30636
31219
|
DropdownMenuItem,
|
|
30637
31220
|
{
|
|
30638
31221
|
icon: ArrowRight,
|
|
@@ -30641,8 +31224,8 @@ var EditorToolbar = ({
|
|
|
30641
31224
|
disabled: !hasTableContext || !editor.can().addRowAfter()
|
|
30642
31225
|
}
|
|
30643
31226
|
),
|
|
30644
|
-
/* @__PURE__ */
|
|
30645
|
-
/* @__PURE__ */
|
|
31227
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31228
|
+
/* @__PURE__ */ jsx88(
|
|
30646
31229
|
DropdownMenuItem,
|
|
30647
31230
|
{
|
|
30648
31231
|
icon: TableIcon,
|
|
@@ -30651,7 +31234,7 @@ var EditorToolbar = ({
|
|
|
30651
31234
|
disabled: !hasTableContext || !editor.can().toggleHeaderRow()
|
|
30652
31235
|
}
|
|
30653
31236
|
),
|
|
30654
|
-
/* @__PURE__ */
|
|
31237
|
+
/* @__PURE__ */ jsx88(
|
|
30655
31238
|
DropdownMenuItem,
|
|
30656
31239
|
{
|
|
30657
31240
|
icon: TableIcon,
|
|
@@ -30660,8 +31243,8 @@ var EditorToolbar = ({
|
|
|
30660
31243
|
disabled: !hasTableContext || !editor.can().toggleHeaderColumn()
|
|
30661
31244
|
}
|
|
30662
31245
|
),
|
|
30663
|
-
/* @__PURE__ */
|
|
30664
|
-
/* @__PURE__ */
|
|
31246
|
+
/* @__PURE__ */ jsx88("div", { className: "my-1 border-t" }),
|
|
31247
|
+
/* @__PURE__ */ jsx88(
|
|
30665
31248
|
DropdownMenuItem,
|
|
30666
31249
|
{
|
|
30667
31250
|
icon: Trash22,
|
|
@@ -30670,7 +31253,7 @@ var EditorToolbar = ({
|
|
|
30670
31253
|
disabled: !hasTableContext || !editor.can().deleteColumn()
|
|
30671
31254
|
}
|
|
30672
31255
|
),
|
|
30673
|
-
/* @__PURE__ */
|
|
31256
|
+
/* @__PURE__ */ jsx88(
|
|
30674
31257
|
DropdownMenuItem,
|
|
30675
31258
|
{
|
|
30676
31259
|
icon: Trash22,
|
|
@@ -30679,7 +31262,7 @@ var EditorToolbar = ({
|
|
|
30679
31262
|
disabled: !hasTableContext || !editor.can().deleteRow()
|
|
30680
31263
|
}
|
|
30681
31264
|
),
|
|
30682
|
-
/* @__PURE__ */
|
|
31265
|
+
/* @__PURE__ */ jsx88(
|
|
30683
31266
|
DropdownMenuItem,
|
|
30684
31267
|
{
|
|
30685
31268
|
icon: Trash22,
|
|
@@ -30691,48 +31274,48 @@ var EditorToolbar = ({
|
|
|
30691
31274
|
]
|
|
30692
31275
|
}
|
|
30693
31276
|
),
|
|
30694
|
-
/* @__PURE__ */
|
|
30695
|
-
/* @__PURE__ */
|
|
30696
|
-
/* @__PURE__ */
|
|
30697
|
-
hasTableContext && /* @__PURE__ */
|
|
30698
|
-
/* @__PURE__ */
|
|
30699
|
-
/* @__PURE__ */
|
|
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(
|
|
30700
31283
|
ToolbarButton,
|
|
30701
31284
|
{
|
|
30702
31285
|
onClick: () => editor.chain().focus().addColumnBefore().run(),
|
|
30703
31286
|
disabled: !editor.can().addColumnBefore(),
|
|
30704
31287
|
title: t("tableMenu.addColumnBefore"),
|
|
30705
|
-
children: /* @__PURE__ */
|
|
31288
|
+
children: /* @__PURE__ */ jsx88(ArrowLeft, { className: "w-4 h-4" })
|
|
30706
31289
|
}
|
|
30707
31290
|
),
|
|
30708
|
-
/* @__PURE__ */
|
|
31291
|
+
/* @__PURE__ */ jsx88(
|
|
30709
31292
|
ToolbarButton,
|
|
30710
31293
|
{
|
|
30711
31294
|
onClick: () => editor.chain().focus().addColumnAfter().run(),
|
|
30712
31295
|
disabled: !editor.can().addColumnAfter(),
|
|
30713
31296
|
title: t("tableMenu.addColumnAfter"),
|
|
30714
|
-
children: /* @__PURE__ */
|
|
31297
|
+
children: /* @__PURE__ */ jsx88(ArrowRight, { className: "w-4 h-4" })
|
|
30715
31298
|
}
|
|
30716
31299
|
),
|
|
30717
|
-
/* @__PURE__ */
|
|
31300
|
+
/* @__PURE__ */ jsx88(
|
|
30718
31301
|
ToolbarButton,
|
|
30719
31302
|
{
|
|
30720
31303
|
onClick: () => editor.chain().focus().addRowBefore().run(),
|
|
30721
31304
|
disabled: !editor.can().addRowBefore(),
|
|
30722
31305
|
title: t("tableMenu.addRowBefore"),
|
|
30723
|
-
children: /* @__PURE__ */
|
|
31306
|
+
children: /* @__PURE__ */ jsx88(ArrowUp, { className: "w-4 h-4" })
|
|
30724
31307
|
}
|
|
30725
31308
|
),
|
|
30726
|
-
/* @__PURE__ */
|
|
31309
|
+
/* @__PURE__ */ jsx88(
|
|
30727
31310
|
ToolbarButton,
|
|
30728
31311
|
{
|
|
30729
31312
|
onClick: () => editor.chain().focus().addRowAfter().run(),
|
|
30730
31313
|
disabled: !editor.can().addRowAfter(),
|
|
30731
31314
|
title: t("tableMenu.addRowAfter"),
|
|
30732
|
-
children: /* @__PURE__ */
|
|
31315
|
+
children: /* @__PURE__ */ jsx88(ArrowDown, { className: "w-4 h-4" })
|
|
30733
31316
|
}
|
|
30734
31317
|
),
|
|
30735
|
-
/* @__PURE__ */
|
|
31318
|
+
/* @__PURE__ */ jsx88(
|
|
30736
31319
|
ToolbarButton,
|
|
30737
31320
|
{
|
|
30738
31321
|
onClick: () => {
|
|
@@ -30745,7 +31328,7 @@ var EditorToolbar = ({
|
|
|
30745
31328
|
active: canSplitCell,
|
|
30746
31329
|
disabled: !canMergeCells && !canSplitCell,
|
|
30747
31330
|
title: canSplitCell ? t("tableMenu.splitCell") : t("tableMenu.mergeCells"),
|
|
30748
|
-
children: /* @__PURE__ */
|
|
31331
|
+
children: /* @__PURE__ */ jsx88(TableCellsMerge, { className: "w-4 h-4" })
|
|
30749
31332
|
}
|
|
30750
31333
|
)
|
|
30751
31334
|
] })
|
|
@@ -30755,7 +31338,7 @@ var EditorToolbar = ({
|
|
|
30755
31338
|
// src/components/UEditor/menus.tsx
|
|
30756
31339
|
import { useCallback as useCallback22, useEffect as useEffect36, useMemo as useMemo23, useRef as useRef33, useState as useState48 } from "react";
|
|
30757
31340
|
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
30758
|
-
import { isInTable as isSelectionInTable, setCellAttr as
|
|
31341
|
+
import { isInTable as isSelectionInTable, setCellAttr as setCellAttr3 } from "@tiptap/pm/tables";
|
|
30759
31342
|
import { createPortal as createPortal8 } from "react-dom";
|
|
30760
31343
|
import {
|
|
30761
31344
|
AlignCenter as AlignCenter2,
|
|
@@ -30778,11 +31361,14 @@ import {
|
|
|
30778
31361
|
Edit2,
|
|
30779
31362
|
Unlink,
|
|
30780
31363
|
ExternalLink as ExternalLink3,
|
|
30781
|
-
Sigma as Sigma2
|
|
31364
|
+
Sigma as Sigma2,
|
|
31365
|
+
AlignStartVertical as AlignStartVertical2,
|
|
31366
|
+
AlignCenterVertical as AlignCenterVertical2,
|
|
31367
|
+
AlignEndVertical as AlignEndVertical2
|
|
30782
31368
|
} from "lucide-react";
|
|
30783
31369
|
|
|
30784
31370
|
// src/components/UEditor/table-formula-commands.ts
|
|
30785
|
-
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";
|
|
30786
31372
|
|
|
30787
31373
|
// src/components/UEditor/table-formula.ts
|
|
30788
31374
|
var CELL_ADDRESS_RE = /^([A-Z]+)([1-9]\d*)$/i;
|
|
@@ -31354,8 +31940,8 @@ function setSelectedTableCellFormula(editor, formula) {
|
|
|
31354
31940
|
const normalized = normalizeFormulaInput(formula);
|
|
31355
31941
|
const { state, view } = editor;
|
|
31356
31942
|
if (!normalized) {
|
|
31357
|
-
const clearedFormula =
|
|
31358
|
-
const clearedValue2 =
|
|
31943
|
+
const clearedFormula = setCellAttr2("formula", null)(state, view.dispatch.bind(view));
|
|
31944
|
+
const clearedValue2 = setCellAttr2("computedValue", null)(editor.state, view.dispatch.bind(view));
|
|
31359
31945
|
if (clearedFormula || clearedValue2) {
|
|
31360
31946
|
recalculateActiveTableFormulas(editor);
|
|
31361
31947
|
view.focus();
|
|
@@ -31364,8 +31950,8 @@ function setSelectedTableCellFormula(editor, formula) {
|
|
|
31364
31950
|
}
|
|
31365
31951
|
return false;
|
|
31366
31952
|
}
|
|
31367
|
-
const appliedFormula =
|
|
31368
|
-
const clearedValue =
|
|
31953
|
+
const appliedFormula = setCellAttr2("formula", normalized)(state, view.dispatch.bind(view));
|
|
31954
|
+
const clearedValue = setCellAttr2("computedValue", null)(editor.state, view.dispatch.bind(view));
|
|
31369
31955
|
if (appliedFormula || clearedValue) {
|
|
31370
31956
|
recalculateActiveTableFormulas(editor);
|
|
31371
31957
|
view.focus();
|
|
@@ -31380,7 +31966,7 @@ function clearSelectedTableCellFormula(editor) {
|
|
|
31380
31966
|
function setSelectedTableCellNumberFormat(editor, numberFormat) {
|
|
31381
31967
|
const value = numberFormat && numberFormat !== "text" ? numberFormat : null;
|
|
31382
31968
|
const { state, view } = editor;
|
|
31383
|
-
const applied =
|
|
31969
|
+
const applied = setCellAttr2("numberFormat", value)(state, view.dispatch.bind(view));
|
|
31384
31970
|
if (!applied) return false;
|
|
31385
31971
|
recalculateSelectedTable(editor);
|
|
31386
31972
|
view.focus();
|
|
@@ -31574,21 +32160,21 @@ function recalculateAllTableFormulas(editor) {
|
|
|
31574
32160
|
}
|
|
31575
32161
|
|
|
31576
32162
|
// src/components/UEditor/menus.tsx
|
|
31577
|
-
import { Fragment as Fragment29, jsx as
|
|
32163
|
+
import { Fragment as Fragment29, jsx as jsx89, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
31578
32164
|
function applyTableCellBackground(editor, color) {
|
|
31579
32165
|
const value = color || null;
|
|
31580
32166
|
const { state, view } = editor;
|
|
31581
|
-
const applied =
|
|
32167
|
+
const applied = setCellAttr3("backgroundColor", value)(state, view.dispatch.bind(view));
|
|
31582
32168
|
if (applied) {
|
|
31583
32169
|
view.focus();
|
|
31584
32170
|
return;
|
|
31585
32171
|
}
|
|
31586
32172
|
editor.chain().focus().setCellAttribute("backgroundColor", value).run();
|
|
31587
32173
|
}
|
|
31588
|
-
function
|
|
32174
|
+
function applyTableCellAttribute2(editor, name, value, options = {}) {
|
|
31589
32175
|
const shouldFocus = options.focus ?? true;
|
|
31590
32176
|
const { state, view } = editor;
|
|
31591
|
-
const applied =
|
|
32177
|
+
const applied = setCellAttr3(name, value)(state, view.dispatch.bind(view));
|
|
31592
32178
|
if (applied) {
|
|
31593
32179
|
if (shouldFocus) view.focus();
|
|
31594
32180
|
return;
|
|
@@ -31599,7 +32185,7 @@ function applyTableCellAttribute(editor, name, value, options = {}) {
|
|
|
31599
32185
|
}
|
|
31600
32186
|
function BorderStylePreviewIcon({ style }) {
|
|
31601
32187
|
const isNone = style === "none";
|
|
31602
|
-
return /* @__PURE__ */
|
|
32188
|
+
return /* @__PURE__ */ jsx89(
|
|
31603
32189
|
"span",
|
|
31604
32190
|
{
|
|
31605
32191
|
"aria-hidden": "true",
|
|
@@ -31611,7 +32197,7 @@ function BorderStylePreviewIcon({ style }) {
|
|
|
31611
32197
|
borderStyle: style,
|
|
31612
32198
|
borderWidth: style === "double" ? 3 : 2
|
|
31613
32199
|
},
|
|
31614
|
-
children: isNone && /* @__PURE__ */
|
|
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" })
|
|
31615
32201
|
}
|
|
31616
32202
|
);
|
|
31617
32203
|
}
|
|
@@ -31652,6 +32238,7 @@ var BubbleMenuContent = ({
|
|
|
31652
32238
|
const currentCellNumberFormat = normalizeStyleValue(editor.getAttributes("tableCell").numberFormat || editor.getAttributes("tableHeader").numberFormat) || "text";
|
|
31653
32239
|
const currentCellBorderStyle = editor.getAttributes("tableCell").borderStyle || editor.getAttributes("tableHeader").borderStyle || "solid";
|
|
31654
32240
|
const currentCellBorderWidth = editor.getAttributes("tableCell").borderWidth || editor.getAttributes("tableHeader").borderWidth || "1px";
|
|
32241
|
+
const currentCellVerticalAlign = normalizeStyleValue(editor.getAttributes("tableCell").verticalAlign || editor.getAttributes("tableHeader").verticalAlign) || "";
|
|
31655
32242
|
const isInTable2 = isSelectionInTable(editor.state);
|
|
31656
32243
|
const canMergeCells = isInTable2 && editor.can().mergeCells();
|
|
31657
32244
|
const canSplitCell = isInTable2 && editor.can().splitCell();
|
|
@@ -31707,18 +32294,18 @@ var BubbleMenuContent = ({
|
|
|
31707
32294
|
onRequestClose?.();
|
|
31708
32295
|
}, [onKeepOpenChange, onLinkInputOpenChange, onRequestClose]);
|
|
31709
32296
|
const applyTableCellAttributeAndClose = useCallback22((name, value) => {
|
|
31710
|
-
|
|
32297
|
+
applyTableCellAttribute2(editor, name, value, { focus: false });
|
|
31711
32298
|
closeTransientPanels();
|
|
31712
32299
|
}, [closeTransientPanels, editor]);
|
|
31713
32300
|
const clearTableCellBorderAndClose = useCallback22(() => {
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
32301
|
+
applyTableCellAttribute2(editor, "borderColor", null, { focus: false });
|
|
32302
|
+
applyTableCellAttribute2(editor, "borderStyle", null, { focus: false });
|
|
32303
|
+
applyTableCellAttribute2(editor, "borderWidth", null, { focus: false });
|
|
31717
32304
|
closeTransientPanels();
|
|
31718
32305
|
}, [closeTransientPanels, editor]);
|
|
31719
32306
|
const applyTableCellBorderColorAndClose = useCallback22((color) => {
|
|
31720
32307
|
const value = color || null;
|
|
31721
|
-
|
|
32308
|
+
applyTableCellAttribute2(editor, "borderColor", value, { focus: false });
|
|
31722
32309
|
closeTransientPanels();
|
|
31723
32310
|
}, [closeTransientPanels, editor]);
|
|
31724
32311
|
const closeColorPalette = useCallback22(() => {
|
|
@@ -31754,7 +32341,7 @@ var BubbleMenuContent = ({
|
|
|
31754
32341
|
};
|
|
31755
32342
|
}, [editor, showLinkInput]);
|
|
31756
32343
|
if (showLinkInput) {
|
|
31757
|
-
return /* @__PURE__ */
|
|
32344
|
+
return /* @__PURE__ */ jsx89(
|
|
31758
32345
|
LinkInput,
|
|
31759
32346
|
{
|
|
31760
32347
|
initialUrl: editor.getAttributes("link").href || "",
|
|
@@ -31775,17 +32362,17 @@ var BubbleMenuContent = ({
|
|
|
31775
32362
|
const isHighlightPalette = activeColorPalette === "highlight";
|
|
31776
32363
|
if (activeColorPalette === "cell-border") {
|
|
31777
32364
|
const currentBorderColor = editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor || "currentColor";
|
|
31778
|
-
return /* @__PURE__ */
|
|
31779
|
-
/* @__PURE__ */
|
|
31780
|
-
/* @__PURE__ */
|
|
31781
|
-
/* @__PURE__ */
|
|
31782
|
-
/* @__PURE__ */
|
|
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: [
|
|
31783
32370
|
["solid", "Solid"],
|
|
31784
32371
|
["dashed", "Dashed"],
|
|
31785
32372
|
["dotted", "Dotted"],
|
|
31786
32373
|
["double", "Double"],
|
|
31787
32374
|
["none", "None"]
|
|
31788
|
-
].map(([style, label]) => /* @__PURE__ */
|
|
32375
|
+
].map(([style, label]) => /* @__PURE__ */ jsxs74(
|
|
31789
32376
|
"button",
|
|
31790
32377
|
{
|
|
31791
32378
|
type: "button",
|
|
@@ -31797,16 +32384,16 @@ var BubbleMenuContent = ({
|
|
|
31797
32384
|
currentCellBorderStyle === style ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
31798
32385
|
),
|
|
31799
32386
|
children: [
|
|
31800
|
-
/* @__PURE__ */
|
|
31801
|
-
/* @__PURE__ */
|
|
32387
|
+
/* @__PURE__ */ jsx89(BorderStylePreviewIcon, { style }),
|
|
32388
|
+
/* @__PURE__ */ jsx89("span", { children: label })
|
|
31802
32389
|
]
|
|
31803
32390
|
},
|
|
31804
32391
|
style
|
|
31805
32392
|
)) })
|
|
31806
32393
|
] }),
|
|
31807
|
-
/* @__PURE__ */
|
|
31808
|
-
/* @__PURE__ */
|
|
31809
|
-
/* @__PURE__ */
|
|
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(
|
|
31810
32397
|
"button",
|
|
31811
32398
|
{
|
|
31812
32399
|
type: "button",
|
|
@@ -31822,15 +32409,15 @@ var BubbleMenuContent = ({
|
|
|
31822
32409
|
width
|
|
31823
32410
|
)) })
|
|
31824
32411
|
] }),
|
|
31825
|
-
/* @__PURE__ */
|
|
32412
|
+
/* @__PURE__ */ jsxs74(
|
|
31826
32413
|
"button",
|
|
31827
32414
|
{
|
|
31828
32415
|
type: "button",
|
|
31829
32416
|
onClick: () => setActiveColorPalette("cell-border-color"),
|
|
31830
32417
|
className: "flex items-center justify-between w-full h-8 px-2 rounded-md border border-input hover:bg-accent text-xs",
|
|
31831
32418
|
children: [
|
|
31832
|
-
/* @__PURE__ */
|
|
31833
|
-
/* @__PURE__ */
|
|
32419
|
+
/* @__PURE__ */ jsx89("span", { children: t("tableMenu.borderColor") || "Border Color" }),
|
|
32420
|
+
/* @__PURE__ */ jsx89(
|
|
31834
32421
|
"span",
|
|
31835
32422
|
{
|
|
31836
32423
|
className: "w-4 h-4 rounded-full border border-border",
|
|
@@ -31842,7 +32429,7 @@ var BubbleMenuContent = ({
|
|
|
31842
32429
|
]
|
|
31843
32430
|
}
|
|
31844
32431
|
),
|
|
31845
|
-
/* @__PURE__ */
|
|
32432
|
+
/* @__PURE__ */ jsx89("div", { className: "flex items-center justify-between gap-2 mt-2 pt-2 border-t border-border", children: /* @__PURE__ */ jsx89(
|
|
31846
32433
|
"button",
|
|
31847
32434
|
{
|
|
31848
32435
|
type: "button",
|
|
@@ -31856,7 +32443,7 @@ var BubbleMenuContent = ({
|
|
|
31856
32443
|
}
|
|
31857
32444
|
if (activeColorPalette === "cell-border-color") {
|
|
31858
32445
|
const currentBorderColor = normalizeStyleValue(editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor) || "";
|
|
31859
|
-
return /* @__PURE__ */
|
|
32446
|
+
return /* @__PURE__ */ jsx89("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx89(
|
|
31860
32447
|
EditorColorPalette,
|
|
31861
32448
|
{
|
|
31862
32449
|
colors: borderColors,
|
|
@@ -31866,7 +32453,7 @@ var BubbleMenuContent = ({
|
|
|
31866
32453
|
}
|
|
31867
32454
|
) });
|
|
31868
32455
|
}
|
|
31869
|
-
return /* @__PURE__ */
|
|
32456
|
+
return /* @__PURE__ */ jsx89("div", { className: "w-56", "data-ueditor-keep-open": true, children: /* @__PURE__ */ jsx89(
|
|
31870
32457
|
EditorColorPalette,
|
|
31871
32458
|
{
|
|
31872
32459
|
colors: isTextPalette ? textColors : highlightColors,
|
|
@@ -31877,32 +32464,32 @@ var BubbleMenuContent = ({
|
|
|
31877
32464
|
) });
|
|
31878
32465
|
}
|
|
31879
32466
|
if (isImageSelected) {
|
|
31880
|
-
return /* @__PURE__ */
|
|
31881
|
-
/* @__PURE__ */
|
|
31882
|
-
/* @__PURE__ */
|
|
31883
|
-
/* @__PURE__ */
|
|
31884
|
-
/* @__PURE__ */
|
|
31885
|
-
/* @__PURE__ */
|
|
31886
|
-
/* @__PURE__ */
|
|
31887
|
-
/* @__PURE__ */
|
|
31888
|
-
/* @__PURE__ */
|
|
31889
|
-
/* @__PURE__ */
|
|
31890
|
-
/* @__PURE__ */
|
|
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(
|
|
31891
32478
|
ToolbarButton,
|
|
31892
32479
|
{
|
|
31893
32480
|
onClick: () => deleteSelectedImage(editor),
|
|
31894
32481
|
title: t("toolbar.imageDelete"),
|
|
31895
32482
|
className: "text-destructive hover:text-destructive",
|
|
31896
|
-
children: /* @__PURE__ */
|
|
32483
|
+
children: /* @__PURE__ */ jsx89(Trash23, { className: "w-4 h-4" })
|
|
31897
32484
|
}
|
|
31898
32485
|
)
|
|
31899
32486
|
] });
|
|
31900
32487
|
}
|
|
31901
32488
|
if (showFormulaPanel && isInTable2) {
|
|
31902
|
-
return /* @__PURE__ */
|
|
31903
|
-
/* @__PURE__ */
|
|
31904
|
-
/* @__PURE__ */
|
|
31905
|
-
/* @__PURE__ */
|
|
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(
|
|
31906
32493
|
"button",
|
|
31907
32494
|
{
|
|
31908
32495
|
type: "button",
|
|
@@ -31915,7 +32502,7 @@ var BubbleMenuContent = ({
|
|
|
31915
32502
|
}
|
|
31916
32503
|
)
|
|
31917
32504
|
] }),
|
|
31918
|
-
/* @__PURE__ */
|
|
32505
|
+
/* @__PURE__ */ jsx89("div", { className: "flex h-9 items-center overflow-hidden rounded-md border border-border/60 bg-muted/40", children: /* @__PURE__ */ jsx89(
|
|
31919
32506
|
"input",
|
|
31920
32507
|
{
|
|
31921
32508
|
value: formulaDraft,
|
|
@@ -31936,15 +32523,15 @@ var BubbleMenuContent = ({
|
|
|
31936
32523
|
className: "h-full min-w-0 flex-1 bg-transparent px-2 text-sm font-medium text-foreground outline-none"
|
|
31937
32524
|
}
|
|
31938
32525
|
) }),
|
|
31939
|
-
/* @__PURE__ */
|
|
31940
|
-
/* @__PURE__ */
|
|
31941
|
-
/* @__PURE__ */
|
|
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: [
|
|
31942
32529
|
["text", "Text"],
|
|
31943
32530
|
["number", "123"],
|
|
31944
32531
|
["currency", "$"],
|
|
31945
32532
|
["percent", "%"],
|
|
31946
32533
|
["date", "Date"]
|
|
31947
|
-
].map(([format, label]) => /* @__PURE__ */
|
|
32534
|
+
].map(([format, label]) => /* @__PURE__ */ jsx89(
|
|
31948
32535
|
"button",
|
|
31949
32536
|
{
|
|
31950
32537
|
type: "button",
|
|
@@ -31958,8 +32545,8 @@ var BubbleMenuContent = ({
|
|
|
31958
32545
|
format
|
|
31959
32546
|
)) })
|
|
31960
32547
|
] }),
|
|
31961
|
-
/* @__PURE__ */
|
|
31962
|
-
/* @__PURE__ */
|
|
32548
|
+
/* @__PURE__ */ jsxs74("div", { className: "mt-2 grid grid-cols-3 gap-1", children: [
|
|
32549
|
+
/* @__PURE__ */ jsx89(
|
|
31963
32550
|
"button",
|
|
31964
32551
|
{
|
|
31965
32552
|
type: "button",
|
|
@@ -31972,7 +32559,7 @@ var BubbleMenuContent = ({
|
|
|
31972
32559
|
children: t("tableMenu.apply") || "Apply"
|
|
31973
32560
|
}
|
|
31974
32561
|
),
|
|
31975
|
-
/* @__PURE__ */
|
|
32562
|
+
/* @__PURE__ */ jsx89(
|
|
31976
32563
|
"button",
|
|
31977
32564
|
{
|
|
31978
32565
|
type: "button",
|
|
@@ -31984,7 +32571,7 @@ var BubbleMenuContent = ({
|
|
|
31984
32571
|
children: t("tableMenu.clear") || "Clear"
|
|
31985
32572
|
}
|
|
31986
32573
|
),
|
|
31987
|
-
/* @__PURE__ */
|
|
32574
|
+
/* @__PURE__ */ jsx89(
|
|
31988
32575
|
"button",
|
|
31989
32576
|
{
|
|
31990
32577
|
type: "button",
|
|
@@ -31997,10 +32584,10 @@ var BubbleMenuContent = ({
|
|
|
31997
32584
|
] });
|
|
31998
32585
|
}
|
|
31999
32586
|
if (showTypographyPanel) {
|
|
32000
|
-
return /* @__PURE__ */
|
|
32001
|
-
/* @__PURE__ */
|
|
32002
|
-
/* @__PURE__ */
|
|
32003
|
-
/* @__PURE__ */
|
|
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(
|
|
32004
32591
|
"button",
|
|
32005
32592
|
{
|
|
32006
32593
|
type: "button",
|
|
@@ -32010,11 +32597,11 @@ var BubbleMenuContent = ({
|
|
|
32010
32597
|
}
|
|
32011
32598
|
)
|
|
32012
32599
|
] }),
|
|
32013
|
-
/* @__PURE__ */
|
|
32014
|
-
/* @__PURE__ */
|
|
32015
|
-
/* @__PURE__ */
|
|
32016
|
-
/* @__PURE__ */
|
|
32017
|
-
/* @__PURE__ */
|
|
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(
|
|
32018
32605
|
"input",
|
|
32019
32606
|
{
|
|
32020
32607
|
type: "number",
|
|
@@ -32038,8 +32625,8 @@ var BubbleMenuContent = ({
|
|
|
32038
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"
|
|
32039
32626
|
}
|
|
32040
32627
|
),
|
|
32041
|
-
/* @__PURE__ */
|
|
32042
|
-
/* @__PURE__ */
|
|
32628
|
+
/* @__PURE__ */ jsx89("span", { className: "border-l border-border/50 px-2 text-[11px] text-muted-foreground", children: "px" }),
|
|
32629
|
+
/* @__PURE__ */ jsx89(
|
|
32043
32630
|
"button",
|
|
32044
32631
|
{
|
|
32045
32632
|
type: "button",
|
|
@@ -32049,12 +32636,12 @@ var BubbleMenuContent = ({
|
|
|
32049
32636
|
"flex h-full w-9 items-center justify-center border-l border-border/50 transition-colors hover:bg-muted",
|
|
32050
32637
|
showFontSizeOptions && "bg-primary/10 text-primary"
|
|
32051
32638
|
),
|
|
32052
|
-
children: /* @__PURE__ */
|
|
32639
|
+
children: /* @__PURE__ */ jsx89(ChevronDown9, { className: "h-4 w-4" })
|
|
32053
32640
|
}
|
|
32054
32641
|
)
|
|
32055
32642
|
] }),
|
|
32056
|
-
showFontSizeOptions && /* @__PURE__ */
|
|
32057
|
-
/* @__PURE__ */
|
|
32643
|
+
showFontSizeOptions && /* @__PURE__ */ jsxs74("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
|
|
32644
|
+
/* @__PURE__ */ jsx89(
|
|
32058
32645
|
"button",
|
|
32059
32646
|
{
|
|
32060
32647
|
type: "button",
|
|
@@ -32069,7 +32656,7 @@ var BubbleMenuContent = ({
|
|
|
32069
32656
|
children: "A"
|
|
32070
32657
|
}
|
|
32071
32658
|
),
|
|
32072
|
-
quickFontSizes.map((option) => /* @__PURE__ */
|
|
32659
|
+
quickFontSizes.map((option) => /* @__PURE__ */ jsx89(
|
|
32073
32660
|
"button",
|
|
32074
32661
|
{
|
|
32075
32662
|
type: "button",
|
|
@@ -32087,10 +32674,10 @@ var BubbleMenuContent = ({
|
|
|
32087
32674
|
))
|
|
32088
32675
|
] })
|
|
32089
32676
|
] }),
|
|
32090
|
-
/* @__PURE__ */
|
|
32091
|
-
/* @__PURE__ */
|
|
32092
|
-
/* @__PURE__ */
|
|
32093
|
-
/* @__PURE__ */
|
|
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(
|
|
32094
32681
|
"button",
|
|
32095
32682
|
{
|
|
32096
32683
|
type: "button",
|
|
@@ -32102,7 +32689,7 @@ var BubbleMenuContent = ({
|
|
|
32102
32689
|
children: "LH"
|
|
32103
32690
|
}
|
|
32104
32691
|
),
|
|
32105
|
-
quickLineHeights.map((option) => /* @__PURE__ */
|
|
32692
|
+
quickLineHeights.map((option) => /* @__PURE__ */ jsx89(
|
|
32106
32693
|
"button",
|
|
32107
32694
|
{
|
|
32108
32695
|
type: "button",
|
|
@@ -32117,8 +32704,8 @@ var BubbleMenuContent = ({
|
|
|
32117
32704
|
))
|
|
32118
32705
|
] })
|
|
32119
32706
|
] }),
|
|
32120
|
-
/* @__PURE__ */
|
|
32121
|
-
/* @__PURE__ */
|
|
32707
|
+
/* @__PURE__ */ jsxs74("div", { className: "grid grid-cols-2 gap-1 border-t border-border/40 pt-2", children: [
|
|
32708
|
+
/* @__PURE__ */ jsxs74(
|
|
32122
32709
|
"button",
|
|
32123
32710
|
{
|
|
32124
32711
|
type: "button",
|
|
@@ -32128,12 +32715,12 @@ var BubbleMenuContent = ({
|
|
|
32128
32715
|
editor.isActive("subscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
32129
32716
|
),
|
|
32130
32717
|
children: [
|
|
32131
|
-
/* @__PURE__ */
|
|
32718
|
+
/* @__PURE__ */ jsx89(SubscriptIcon2, { className: "h-4 w-4" }),
|
|
32132
32719
|
t("toolbar.subscript")
|
|
32133
32720
|
]
|
|
32134
32721
|
}
|
|
32135
32722
|
),
|
|
32136
|
-
/* @__PURE__ */
|
|
32723
|
+
/* @__PURE__ */ jsxs74(
|
|
32137
32724
|
"button",
|
|
32138
32725
|
{
|
|
32139
32726
|
type: "button",
|
|
@@ -32143,7 +32730,7 @@ var BubbleMenuContent = ({
|
|
|
32143
32730
|
editor.isActive("superscript") ? "bg-primary/10 text-primary" : "bg-muted/40 text-foreground"
|
|
32144
32731
|
),
|
|
32145
32732
|
children: [
|
|
32146
|
-
/* @__PURE__ */
|
|
32733
|
+
/* @__PURE__ */ jsx89(SuperscriptIcon2, { className: "h-4 w-4" }),
|
|
32147
32734
|
t("toolbar.superscript")
|
|
32148
32735
|
]
|
|
32149
32736
|
}
|
|
@@ -32152,22 +32739,23 @@ var BubbleMenuContent = ({
|
|
|
32152
32739
|
] })
|
|
32153
32740
|
] });
|
|
32154
32741
|
}
|
|
32155
|
-
|
|
32156
|
-
|
|
32157
|
-
/* @__PURE__ */
|
|
32158
|
-
/* @__PURE__ */
|
|
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(
|
|
32159
32747
|
ToolbarButton,
|
|
32160
32748
|
{
|
|
32161
32749
|
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
32162
32750
|
active: editor.isActive("underline"),
|
|
32163
32751
|
title: t("toolbar.underline"),
|
|
32164
|
-
children: /* @__PURE__ */
|
|
32752
|
+
children: /* @__PURE__ */ jsx89(UnderlineIcon2, { className: "w-4 h-4" })
|
|
32165
32753
|
}
|
|
32166
32754
|
),
|
|
32167
|
-
/* @__PURE__ */
|
|
32168
|
-
/* @__PURE__ */
|
|
32169
|
-
/* @__PURE__ */
|
|
32170
|
-
/* @__PURE__ */
|
|
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(
|
|
32171
32759
|
ToolbarButton,
|
|
32172
32760
|
{
|
|
32173
32761
|
onMouseDown: () => {
|
|
@@ -32178,22 +32766,22 @@ var BubbleMenuContent = ({
|
|
|
32178
32766
|
},
|
|
32179
32767
|
active: editor.isActive("link"),
|
|
32180
32768
|
title: t("toolbar.link"),
|
|
32181
|
-
children: /* @__PURE__ */
|
|
32769
|
+
children: /* @__PURE__ */ jsx89(LinkIcon2, { className: "w-4 h-4" })
|
|
32182
32770
|
}
|
|
32183
32771
|
),
|
|
32184
|
-
/* @__PURE__ */
|
|
32185
|
-
/* @__PURE__ */
|
|
32186
|
-
isInTable2 && /* @__PURE__ */
|
|
32187
|
-
/* @__PURE__ */
|
|
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(
|
|
32188
32776
|
ToolbarButton,
|
|
32189
32777
|
{
|
|
32190
32778
|
onClick: () => setActiveColorPalette("cell-bg"),
|
|
32191
32779
|
active: Boolean(currentCellBgColor),
|
|
32192
32780
|
title: t("tableMenu.cellBackground") || "Cell background",
|
|
32193
|
-
children: /* @__PURE__ */
|
|
32781
|
+
children: /* @__PURE__ */ jsx89(CellBgColorIcon, { color: currentCellBgColor })
|
|
32194
32782
|
}
|
|
32195
32783
|
),
|
|
32196
|
-
/* @__PURE__ */
|
|
32784
|
+
/* @__PURE__ */ jsx89(
|
|
32197
32785
|
ToolbarButton,
|
|
32198
32786
|
{
|
|
32199
32787
|
onMouseDown: () => {
|
|
@@ -32204,7 +32792,7 @@ var BubbleMenuContent = ({
|
|
|
32204
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
|
|
32205
32793
|
),
|
|
32206
32794
|
title: t("tableMenu.cellBorder") || "Cell border",
|
|
32207
|
-
children: /* @__PURE__ */
|
|
32795
|
+
children: /* @__PURE__ */ jsx89(
|
|
32208
32796
|
CellBorderIcon,
|
|
32209
32797
|
{
|
|
32210
32798
|
color: editor.getAttributes("tableCell").borderColor || editor.getAttributes("tableHeader").borderColor
|
|
@@ -32212,7 +32800,7 @@ var BubbleMenuContent = ({
|
|
|
32212
32800
|
)
|
|
32213
32801
|
}
|
|
32214
32802
|
),
|
|
32215
|
-
/* @__PURE__ */
|
|
32803
|
+
/* @__PURE__ */ jsx89(
|
|
32216
32804
|
ToolbarButton,
|
|
32217
32805
|
{
|
|
32218
32806
|
onMouseDown: () => {
|
|
@@ -32224,10 +32812,10 @@ var BubbleMenuContent = ({
|
|
|
32224
32812
|
},
|
|
32225
32813
|
active: Boolean(currentCellFormula),
|
|
32226
32814
|
title: t("tableMenu.formula") || "Formula",
|
|
32227
|
-
children: /* @__PURE__ */
|
|
32815
|
+
children: /* @__PURE__ */ jsx89(Sigma2, { className: "w-4 h-4" })
|
|
32228
32816
|
}
|
|
32229
32817
|
),
|
|
32230
|
-
/* @__PURE__ */
|
|
32818
|
+
/* @__PURE__ */ jsx89(
|
|
32231
32819
|
ToolbarButton,
|
|
32232
32820
|
{
|
|
32233
32821
|
onClick: () => {
|
|
@@ -32240,17 +32828,69 @@ var BubbleMenuContent = ({
|
|
|
32240
32828
|
active: canSplitCell,
|
|
32241
32829
|
disabled: !canMergeCells && !canSplitCell,
|
|
32242
32830
|
title: canSplitCell ? t("tableMenu.splitCell") || "Split cell" : t("tableMenu.mergeCells") || "Merge cells",
|
|
32243
|
-
children: /* @__PURE__ */
|
|
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
|
+
]
|
|
32244
32884
|
}
|
|
32245
32885
|
)
|
|
32246
32886
|
] }),
|
|
32247
|
-
/* @__PURE__ */
|
|
32887
|
+
/* @__PURE__ */ jsx89(
|
|
32248
32888
|
ToolbarButton,
|
|
32249
32889
|
{
|
|
32250
32890
|
onClick: () => setShowTypographyPanel(true),
|
|
32251
32891
|
active: Boolean(currentFontSize || currentLineHeight || editor.isActive("subscript") || editor.isActive("superscript")),
|
|
32252
32892
|
title: t("toolbar.textStyle"),
|
|
32253
|
-
children: /* @__PURE__ */
|
|
32893
|
+
children: /* @__PURE__ */ jsx89(Type3, { className: "w-4 h-4" })
|
|
32254
32894
|
}
|
|
32255
32895
|
)
|
|
32256
32896
|
] });
|
|
@@ -32264,12 +32904,12 @@ var LinkPreviewContent = ({ editor, onEdit }) => {
|
|
|
32264
32904
|
const handleUnlink = () => {
|
|
32265
32905
|
editor.chain().focus().unsetLink().run();
|
|
32266
32906
|
};
|
|
32267
|
-
return /* @__PURE__ */
|
|
32268
|
-
/* @__PURE__ */
|
|
32269
|
-
/* @__PURE__ */
|
|
32270
|
-
/* @__PURE__ */
|
|
32271
|
-
/* @__PURE__ */
|
|
32272
|
-
/* @__PURE__ */
|
|
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" }) })
|
|
32273
32913
|
] });
|
|
32274
32914
|
};
|
|
32275
32915
|
var CustomBubbleMenu = ({
|
|
@@ -32390,7 +33030,7 @@ var CustomBubbleMenu = ({
|
|
|
32390
33030
|
}, [editor]);
|
|
32391
33031
|
if (!isVisible) return null;
|
|
32392
33032
|
return createPortal8(
|
|
32393
|
-
/* @__PURE__ */
|
|
33033
|
+
/* @__PURE__ */ jsx89(
|
|
32394
33034
|
"div",
|
|
32395
33035
|
{
|
|
32396
33036
|
ref: menuRef,
|
|
@@ -32410,7 +33050,7 @@ var CustomBubbleMenu = ({
|
|
|
32410
33050
|
}
|
|
32411
33051
|
e.preventDefault();
|
|
32412
33052
|
},
|
|
32413
|
-
children: editor.isActive("link") && !keepOpenRef.current && !linkInputOpen ? /* @__PURE__ */
|
|
33053
|
+
children: editor.isActive("link") && !keepOpenRef.current && !linkInputOpen ? /* @__PURE__ */ jsx89(
|
|
32414
33054
|
LinkPreviewContent,
|
|
32415
33055
|
{
|
|
32416
33056
|
editor,
|
|
@@ -32419,7 +33059,7 @@ var CustomBubbleMenu = ({
|
|
|
32419
33059
|
setKeepOpen(true);
|
|
32420
33060
|
}
|
|
32421
33061
|
}
|
|
32422
|
-
) : /* @__PURE__ */
|
|
33062
|
+
) : /* @__PURE__ */ jsx89(
|
|
32423
33063
|
BubbleMenuContent,
|
|
32424
33064
|
{
|
|
32425
33065
|
editor,
|
|
@@ -32438,25 +33078,25 @@ var CustomBubbleMenu = ({
|
|
|
32438
33078
|
};
|
|
32439
33079
|
|
|
32440
33080
|
// src/components/UEditor/CharacterCount.tsx
|
|
32441
|
-
import { jsxs as
|
|
33081
|
+
import { jsxs as jsxs75 } from "react/jsx-runtime";
|
|
32442
33082
|
var CharacterCountDisplay = ({ editor, maxCharacters }) => {
|
|
32443
33083
|
const t = useSmartTranslations("UEditor");
|
|
32444
33084
|
const storage = editor.storage;
|
|
32445
33085
|
const characterCount = storage.characterCount?.characters?.() ?? 0;
|
|
32446
33086
|
const wordCount = storage.characterCount?.words?.() ?? 0;
|
|
32447
33087
|
const percentage = maxCharacters ? Math.round(characterCount / maxCharacters * 100) : 0;
|
|
32448
|
-
return /* @__PURE__ */
|
|
32449
|
-
/* @__PURE__ */
|
|
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: [
|
|
32450
33090
|
wordCount,
|
|
32451
33091
|
" ",
|
|
32452
33092
|
t("words")
|
|
32453
33093
|
] }),
|
|
32454
|
-
/* @__PURE__ */
|
|
33094
|
+
/* @__PURE__ */ jsxs75("span", { children: [
|
|
32455
33095
|
characterCount,
|
|
32456
33096
|
" ",
|
|
32457
33097
|
t("characters")
|
|
32458
33098
|
] }),
|
|
32459
|
-
maxCharacters && /* @__PURE__ */
|
|
33099
|
+
maxCharacters && /* @__PURE__ */ jsxs75("span", { className: cn(percentage > 90 && "text-destructive", percentage > 100 && "font-bold"), children: [
|
|
32460
33100
|
characterCount,
|
|
32461
33101
|
"/",
|
|
32462
33102
|
maxCharacters
|
|
@@ -33911,7 +34551,7 @@ var NodeRange = class {
|
|
|
33911
34551
|
}
|
|
33912
34552
|
};
|
|
33913
34553
|
var emptyAttrs = /* @__PURE__ */ Object.create(null);
|
|
33914
|
-
var
|
|
34554
|
+
var Node7 = class _Node {
|
|
33915
34555
|
/**
|
|
33916
34556
|
@internal
|
|
33917
34557
|
*/
|
|
@@ -34312,7 +34952,7 @@ var Node5 = class _Node {
|
|
|
34312
34952
|
return node;
|
|
34313
34953
|
}
|
|
34314
34954
|
};
|
|
34315
|
-
|
|
34955
|
+
Node7.prototype.text = void 0;
|
|
34316
34956
|
function wrapMarks(marks, str) {
|
|
34317
34957
|
for (let i = marks.length - 1; i >= 0; i--)
|
|
34318
34958
|
str = marks[i].type.name + "(" + str + ")";
|
|
@@ -37362,7 +38002,7 @@ function buildTableHoverState({
|
|
|
37362
38002
|
}
|
|
37363
38003
|
|
|
37364
38004
|
// src/components/UEditor/table-drag-preview.tsx
|
|
37365
|
-
import { Fragment as Fragment31, jsx as
|
|
38005
|
+
import { Fragment as Fragment31, jsx as jsx90, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
37366
38006
|
function TableDragPreview({
|
|
37367
38007
|
columnDragLabel,
|
|
37368
38008
|
dragPreview,
|
|
@@ -37373,9 +38013,9 @@ function TableDragPreview({
|
|
|
37373
38013
|
const expandPreviewWidth = dragPreview.kind === "add-column" ? layout.tableWidth + dragPreview.previewCols * layout.avgColumnWidth : layout.tableWidth;
|
|
37374
38014
|
const expandPreviewHeight = dragPreview.kind === "add-row" ? layout.tableHeight + dragPreview.previewRows * layout.avgRowHeight : layout.tableHeight;
|
|
37375
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`;
|
|
37376
|
-
return /* @__PURE__ */
|
|
37377
|
-
dragPreview.kind === "row" && /* @__PURE__ */
|
|
37378
|
-
/* @__PURE__ */
|
|
38016
|
+
return /* @__PURE__ */ jsxs76(Fragment31, { children: [
|
|
38017
|
+
dragPreview.kind === "row" && /* @__PURE__ */ jsxs76(Fragment31, { children: [
|
|
38018
|
+
/* @__PURE__ */ jsx90(
|
|
37379
38019
|
"div",
|
|
37380
38020
|
{
|
|
37381
38021
|
"aria-hidden": "true",
|
|
@@ -37388,7 +38028,7 @@ function TableDragPreview({
|
|
|
37388
38028
|
}
|
|
37389
38029
|
}
|
|
37390
38030
|
),
|
|
37391
|
-
/* @__PURE__ */
|
|
38031
|
+
/* @__PURE__ */ jsx90(
|
|
37392
38032
|
"div",
|
|
37393
38033
|
{
|
|
37394
38034
|
"aria-hidden": "true",
|
|
@@ -37402,8 +38042,8 @@ function TableDragPreview({
|
|
|
37402
38042
|
}
|
|
37403
38043
|
)
|
|
37404
38044
|
] }),
|
|
37405
|
-
dragPreview.kind === "column" && /* @__PURE__ */
|
|
37406
|
-
/* @__PURE__ */
|
|
38045
|
+
dragPreview.kind === "column" && /* @__PURE__ */ jsxs76(Fragment31, { children: [
|
|
38046
|
+
/* @__PURE__ */ jsx90(
|
|
37407
38047
|
"div",
|
|
37408
38048
|
{
|
|
37409
38049
|
"aria-hidden": "true",
|
|
@@ -37416,7 +38056,7 @@ function TableDragPreview({
|
|
|
37416
38056
|
}
|
|
37417
38057
|
}
|
|
37418
38058
|
),
|
|
37419
|
-
/* @__PURE__ */
|
|
38059
|
+
/* @__PURE__ */ jsx90(
|
|
37420
38060
|
"div",
|
|
37421
38061
|
{
|
|
37422
38062
|
"aria-hidden": "true",
|
|
@@ -37430,7 +38070,7 @@ function TableDragPreview({
|
|
|
37430
38070
|
}
|
|
37431
38071
|
)
|
|
37432
38072
|
] }),
|
|
37433
|
-
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */
|
|
38073
|
+
(dragPreview.kind === "add-row" || dragPreview.kind === "add-column") && /* @__PURE__ */ jsx90(
|
|
37434
38074
|
"div",
|
|
37435
38075
|
{
|
|
37436
38076
|
"aria-hidden": "true",
|
|
@@ -37443,7 +38083,7 @@ function TableDragPreview({
|
|
|
37443
38083
|
}
|
|
37444
38084
|
}
|
|
37445
38085
|
),
|
|
37446
|
-
/* @__PURE__ */
|
|
38086
|
+
/* @__PURE__ */ jsx90(
|
|
37447
38087
|
"div",
|
|
37448
38088
|
{
|
|
37449
38089
|
role: "status",
|
|
@@ -37459,7 +38099,7 @@ function TableDragPreview({
|
|
|
37459
38099
|
}
|
|
37460
38100
|
|
|
37461
38101
|
// src/components/UEditor/table-add-rails.tsx
|
|
37462
|
-
import { Fragment as Fragment32, jsx as
|
|
38102
|
+
import { Fragment as Fragment32, jsx as jsx91, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
37463
38103
|
var ADD_COLUMN_RAIL_GAP = 4;
|
|
37464
38104
|
var ADD_ROW_RAIL_GAP = 4;
|
|
37465
38105
|
function TableAddRails({
|
|
@@ -37480,13 +38120,13 @@ function TableAddRails({
|
|
|
37480
38120
|
const rowRailLeft = visibleBounds.left;
|
|
37481
38121
|
const showColumnRail = controlsVisible || addColumnVisible;
|
|
37482
38122
|
const showRowRail = controlsVisible || addRowVisible;
|
|
37483
|
-
return /* @__PURE__ */
|
|
37484
|
-
/* @__PURE__ */
|
|
38123
|
+
return /* @__PURE__ */ jsxs77(Fragment32, { children: [
|
|
38124
|
+
/* @__PURE__ */ jsx91(
|
|
37485
38125
|
Tooltip,
|
|
37486
38126
|
{
|
|
37487
38127
|
placement: "right",
|
|
37488
|
-
content: /* @__PURE__ */
|
|
37489
|
-
children: /* @__PURE__ */
|
|
38128
|
+
content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: quickAddColumnLabel }),
|
|
38129
|
+
children: /* @__PURE__ */ jsx91(
|
|
37490
38130
|
"button",
|
|
37491
38131
|
{
|
|
37492
38132
|
type: "button",
|
|
@@ -37513,17 +38153,17 @@ function TableAddRails({
|
|
|
37513
38153
|
transform: showColumnRail ? "scale(1)" : "scale(0.92)",
|
|
37514
38154
|
pointerEvents: showColumnRail ? "auto" : "none"
|
|
37515
38155
|
},
|
|
37516
|
-
children: /* @__PURE__ */
|
|
38156
|
+
children: /* @__PURE__ */ jsx91("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
37517
38157
|
}
|
|
37518
38158
|
)
|
|
37519
38159
|
}
|
|
37520
38160
|
),
|
|
37521
|
-
/* @__PURE__ */
|
|
38161
|
+
/* @__PURE__ */ jsx91(
|
|
37522
38162
|
Tooltip,
|
|
37523
38163
|
{
|
|
37524
38164
|
placement: "bottom",
|
|
37525
|
-
content: /* @__PURE__ */
|
|
37526
|
-
children: /* @__PURE__ */
|
|
38165
|
+
content: /* @__PURE__ */ jsx91("span", { className: "text-xs font-medium", children: quickAddRowLabel }),
|
|
38166
|
+
children: /* @__PURE__ */ jsx91(
|
|
37527
38167
|
"button",
|
|
37528
38168
|
{
|
|
37529
38169
|
type: "button",
|
|
@@ -37550,7 +38190,7 @@ function TableAddRails({
|
|
|
37550
38190
|
transform: showRowRail ? "scale(1)" : "scale(0.92)",
|
|
37551
38191
|
pointerEvents: showRowRail ? "auto" : "none"
|
|
37552
38192
|
},
|
|
37553
|
-
children: /* @__PURE__ */
|
|
38193
|
+
children: /* @__PURE__ */ jsx91("span", { className: "text-sm font-medium leading-none", children: "+" })
|
|
37554
38194
|
}
|
|
37555
38195
|
)
|
|
37556
38196
|
}
|
|
@@ -37560,7 +38200,7 @@ function TableAddRails({
|
|
|
37560
38200
|
|
|
37561
38201
|
// src/components/UEditor/table-control-menu.tsx
|
|
37562
38202
|
import { MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
37563
|
-
import { jsx as
|
|
38203
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
37564
38204
|
function TableControlMenu({
|
|
37565
38205
|
controlsVisible,
|
|
37566
38206
|
isOpen,
|
|
@@ -37572,7 +38212,7 @@ function TableControlMenu({
|
|
|
37572
38212
|
top
|
|
37573
38213
|
}) {
|
|
37574
38214
|
const shown = controlsVisible || menuVisible || isOpen;
|
|
37575
|
-
return /* @__PURE__ */
|
|
38215
|
+
return /* @__PURE__ */ jsx92(
|
|
37576
38216
|
"div",
|
|
37577
38217
|
{
|
|
37578
38218
|
className: "absolute z-30",
|
|
@@ -37581,13 +38221,13 @@ function TableControlMenu({
|
|
|
37581
38221
|
top,
|
|
37582
38222
|
left
|
|
37583
38223
|
},
|
|
37584
|
-
children: /* @__PURE__ */
|
|
38224
|
+
children: /* @__PURE__ */ jsx92(
|
|
37585
38225
|
Tooltip,
|
|
37586
38226
|
{
|
|
37587
38227
|
placement: "top",
|
|
37588
38228
|
disabled: isOpen,
|
|
37589
|
-
content: /* @__PURE__ */
|
|
37590
|
-
children: /* @__PURE__ */
|
|
38229
|
+
content: /* @__PURE__ */ jsx92("span", { className: "text-xs font-medium", children: label }),
|
|
38230
|
+
children: /* @__PURE__ */ jsx92("span", { className: "inline-flex", children: /* @__PURE__ */ jsx92(
|
|
37591
38231
|
DropdownMenu,
|
|
37592
38232
|
{
|
|
37593
38233
|
placement: "bottom-start",
|
|
@@ -37595,7 +38235,7 @@ function TableControlMenu({
|
|
|
37595
38235
|
onOpenChange,
|
|
37596
38236
|
contentClassName: "p-2",
|
|
37597
38237
|
items,
|
|
37598
|
-
trigger: /* @__PURE__ */
|
|
38238
|
+
trigger: /* @__PURE__ */ jsx92(
|
|
37599
38239
|
"button",
|
|
37600
38240
|
{
|
|
37601
38241
|
type: "button",
|
|
@@ -37611,7 +38251,7 @@ function TableControlMenu({
|
|
|
37611
38251
|
transform: shown ? "scale(1)" : "scale(0.82)",
|
|
37612
38252
|
pointerEvents: shown ? "auto" : "none"
|
|
37613
38253
|
},
|
|
37614
|
-
children: /* @__PURE__ */
|
|
38254
|
+
children: /* @__PURE__ */ jsx92(MoreHorizontal2, { className: "h-4 w-4" })
|
|
37615
38255
|
}
|
|
37616
38256
|
)
|
|
37617
38257
|
}
|
|
@@ -37624,7 +38264,7 @@ function TableControlMenu({
|
|
|
37624
38264
|
|
|
37625
38265
|
// src/components/UEditor/table-axis-handles.tsx
|
|
37626
38266
|
import { GripHorizontal, GripVertical as GripVertical3 } from "lucide-react";
|
|
37627
|
-
import { Fragment as Fragment33, jsx as
|
|
38267
|
+
import { Fragment as Fragment33, jsx as jsx93 } from "react/jsx-runtime";
|
|
37628
38268
|
var IDLE_HANDLE_SCALE = "0.78";
|
|
37629
38269
|
function TableRowHandles({
|
|
37630
38270
|
activeRowIndex,
|
|
@@ -37638,12 +38278,12 @@ function TableRowHandles({
|
|
|
37638
38278
|
rowHandleLeft,
|
|
37639
38279
|
rowHandles
|
|
37640
38280
|
}) {
|
|
37641
|
-
return /* @__PURE__ */
|
|
38281
|
+
return /* @__PURE__ */ jsx93(Fragment33, { children: rowHandles.map((rowHandle) => {
|
|
37642
38282
|
const menuKey = `row:${rowHandle.index}`;
|
|
37643
38283
|
const isActive = rowHandle.index === activeRowIndex;
|
|
37644
38284
|
const visible = controlsVisible || hoverRowHandleIndex === rowHandle.index || openMenuKey === menuKey;
|
|
37645
38285
|
const isShown = visible || isActive;
|
|
37646
|
-
return /* @__PURE__ */
|
|
38286
|
+
return /* @__PURE__ */ jsx93(
|
|
37647
38287
|
"div",
|
|
37648
38288
|
{
|
|
37649
38289
|
className: "absolute z-30",
|
|
@@ -37652,13 +38292,13 @@ function TableRowHandles({
|
|
|
37652
38292
|
top: Math.max(8, rowHandle.center - 12),
|
|
37653
38293
|
left: rowHandleLeft
|
|
37654
38294
|
},
|
|
37655
|
-
children: /* @__PURE__ */
|
|
38295
|
+
children: /* @__PURE__ */ jsx93(
|
|
37656
38296
|
Tooltip,
|
|
37657
38297
|
{
|
|
37658
38298
|
placement: "right",
|
|
37659
38299
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
37660
|
-
content: /* @__PURE__ */
|
|
37661
|
-
children: /* @__PURE__ */
|
|
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(
|
|
37662
38302
|
DropdownMenu,
|
|
37663
38303
|
{
|
|
37664
38304
|
placement: "right",
|
|
@@ -37666,7 +38306,7 @@ function TableRowHandles({
|
|
|
37666
38306
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
37667
38307
|
contentClassName: "p-2",
|
|
37668
38308
|
items: getMenuItems(rowHandle),
|
|
37669
|
-
trigger: /* @__PURE__ */
|
|
38309
|
+
trigger: /* @__PURE__ */ jsx93(
|
|
37670
38310
|
"button",
|
|
37671
38311
|
{
|
|
37672
38312
|
type: "button",
|
|
@@ -37685,7 +38325,7 @@ function TableRowHandles({
|
|
|
37685
38325
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
37686
38326
|
pointerEvents: isShown ? "auto" : "none"
|
|
37687
38327
|
},
|
|
37688
|
-
children: visible ? /* @__PURE__ */
|
|
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" })
|
|
37689
38329
|
}
|
|
37690
38330
|
)
|
|
37691
38331
|
}
|
|
@@ -37709,12 +38349,12 @@ function TableColumnHandles({
|
|
|
37709
38349
|
onStartDrag,
|
|
37710
38350
|
openMenuKey
|
|
37711
38351
|
}) {
|
|
37712
|
-
return /* @__PURE__ */
|
|
38352
|
+
return /* @__PURE__ */ jsx93(Fragment33, { children: columnHandles.map((columnHandle) => {
|
|
37713
38353
|
const menuKey = `column:${columnHandle.index}`;
|
|
37714
38354
|
const isActive = columnHandle.index === activeColumnIndex;
|
|
37715
38355
|
const visible = controlsVisible || hoverColumnHandleIndex === columnHandle.index || openMenuKey === menuKey;
|
|
37716
38356
|
const isShown = visible || isActive;
|
|
37717
|
-
return /* @__PURE__ */
|
|
38357
|
+
return /* @__PURE__ */ jsx93(
|
|
37718
38358
|
"div",
|
|
37719
38359
|
{
|
|
37720
38360
|
className: "absolute z-30",
|
|
@@ -37723,13 +38363,13 @@ function TableColumnHandles({
|
|
|
37723
38363
|
top: columnHandleTop,
|
|
37724
38364
|
left: Math.max(8, columnHandle.center - 12)
|
|
37725
38365
|
},
|
|
37726
|
-
children: /* @__PURE__ */
|
|
38366
|
+
children: /* @__PURE__ */ jsx93(
|
|
37727
38367
|
Tooltip,
|
|
37728
38368
|
{
|
|
37729
38369
|
placement: "top",
|
|
37730
38370
|
disabled: openMenuKey === menuKey || !visible && isActive,
|
|
37731
|
-
content: /* @__PURE__ */
|
|
37732
|
-
children: /* @__PURE__ */
|
|
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(
|
|
37733
38373
|
DropdownMenu,
|
|
37734
38374
|
{
|
|
37735
38375
|
placement: "bottom-start",
|
|
@@ -37737,7 +38377,7 @@ function TableColumnHandles({
|
|
|
37737
38377
|
onOpenChange: (open) => onOpenMenuChange(menuKey, open),
|
|
37738
38378
|
contentClassName: "p-2",
|
|
37739
38379
|
items: getMenuItems(columnHandle),
|
|
37740
|
-
trigger: /* @__PURE__ */
|
|
38380
|
+
trigger: /* @__PURE__ */ jsx93(
|
|
37741
38381
|
"button",
|
|
37742
38382
|
{
|
|
37743
38383
|
type: "button",
|
|
@@ -37756,7 +38396,7 @@ function TableColumnHandles({
|
|
|
37756
38396
|
transform: isShown ? "scale(1)" : `scale(${IDLE_HANDLE_SCALE})`,
|
|
37757
38397
|
pointerEvents: isShown ? "auto" : "none"
|
|
37758
38398
|
},
|
|
37759
|
-
children: visible ? /* @__PURE__ */
|
|
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" })
|
|
37760
38400
|
}
|
|
37761
38401
|
)
|
|
37762
38402
|
}
|
|
@@ -37770,7 +38410,7 @@ function TableColumnHandles({
|
|
|
37770
38410
|
}
|
|
37771
38411
|
|
|
37772
38412
|
// src/components/UEditor/table-controls.tsx
|
|
37773
|
-
import { Fragment as Fragment34, jsx as
|
|
38413
|
+
import { Fragment as Fragment34, jsx as jsx94, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
37774
38414
|
var TABLE_MENU_TOP_OFFSET = 10;
|
|
37775
38415
|
function nearestIndex(centers, position) {
|
|
37776
38416
|
let bestIndex = 0;
|
|
@@ -38217,8 +38857,8 @@ function TableControls({ editor, containerRef }) {
|
|
|
38217
38857
|
const menuLeft = Math.max(8, layout.tableLeft);
|
|
38218
38858
|
const rowHandleLeft = layout.tableLeft - 12;
|
|
38219
38859
|
const columnHandleTop = layout.tableTop - 12;
|
|
38220
|
-
return /* @__PURE__ */
|
|
38221
|
-
/* @__PURE__ */
|
|
38860
|
+
return /* @__PURE__ */ jsxs78(Fragment34, { children: [
|
|
38861
|
+
/* @__PURE__ */ jsx94(
|
|
38222
38862
|
TableRowHandles,
|
|
38223
38863
|
{
|
|
38224
38864
|
activeRowIndex: layout.activeRowIndex,
|
|
@@ -38235,7 +38875,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
38235
38875
|
rowHandles: layout.rowHandles
|
|
38236
38876
|
}
|
|
38237
38877
|
),
|
|
38238
|
-
/* @__PURE__ */
|
|
38878
|
+
/* @__PURE__ */ jsx94(
|
|
38239
38879
|
TableColumnHandles,
|
|
38240
38880
|
{
|
|
38241
38881
|
activeColumnIndex: layout.activeColumnIndex,
|
|
@@ -38252,7 +38892,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
38252
38892
|
openMenuKey
|
|
38253
38893
|
}
|
|
38254
38894
|
),
|
|
38255
|
-
/* @__PURE__ */
|
|
38895
|
+
/* @__PURE__ */ jsx94(
|
|
38256
38896
|
TableControlMenu,
|
|
38257
38897
|
{
|
|
38258
38898
|
controlsVisible,
|
|
@@ -38267,7 +38907,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
38267
38907
|
top: menuTop
|
|
38268
38908
|
}
|
|
38269
38909
|
),
|
|
38270
|
-
/* @__PURE__ */
|
|
38910
|
+
/* @__PURE__ */ jsx94(
|
|
38271
38911
|
TableAddRails,
|
|
38272
38912
|
{
|
|
38273
38913
|
addColumnVisible: hoverState.addColumnVisible,
|
|
@@ -38281,7 +38921,7 @@ function TableControls({ editor, containerRef }) {
|
|
|
38281
38921
|
quickAddRowLabel: t("tableMenu.quickAddRowAfter")
|
|
38282
38922
|
}
|
|
38283
38923
|
),
|
|
38284
|
-
/* @__PURE__ */
|
|
38924
|
+
/* @__PURE__ */ jsx94(
|
|
38285
38925
|
TableDragPreview,
|
|
38286
38926
|
{
|
|
38287
38927
|
columnDragLabel: t("tableMenu.dragColumn"),
|
|
@@ -38913,6 +39553,8 @@ import {
|
|
|
38913
39553
|
Trash2 as Trash25,
|
|
38914
39554
|
Underline as UnderlineIcon3,
|
|
38915
39555
|
Undo as UndoIcon2,
|
|
39556
|
+
Square,
|
|
39557
|
+
CircleDot as CircleDot2,
|
|
38916
39558
|
Upload as Upload4
|
|
38917
39559
|
} from "lucide-react";
|
|
38918
39560
|
|
|
@@ -39053,14 +39695,14 @@ function prepareUEditorPreviewHtml(html) {
|
|
|
39053
39695
|
}
|
|
39054
39696
|
|
|
39055
39697
|
// src/components/UEditor/menu-bar.tsx
|
|
39056
|
-
import { Fragment as Fragment35, jsx as
|
|
39698
|
+
import { Fragment as Fragment35, jsx as jsx95, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
39057
39699
|
function MenuTableInsertGrid({
|
|
39058
39700
|
insertLabel,
|
|
39059
39701
|
previewTemplate,
|
|
39060
39702
|
onInsert
|
|
39061
39703
|
}) {
|
|
39062
39704
|
const closeMenu = useDropdownMenuClose();
|
|
39063
|
-
return /* @__PURE__ */
|
|
39705
|
+
return /* @__PURE__ */ jsx95(
|
|
39064
39706
|
TableInsertGrid,
|
|
39065
39707
|
{
|
|
39066
39708
|
insertLabel,
|
|
@@ -39076,9 +39718,9 @@ function renderMenuItems(items) {
|
|
|
39076
39718
|
return items.map((item, i) => {
|
|
39077
39719
|
switch (item.type) {
|
|
39078
39720
|
case "separator":
|
|
39079
|
-
return /* @__PURE__ */
|
|
39721
|
+
return /* @__PURE__ */ jsx95(DropdownMenuSeparator, {}, i);
|
|
39080
39722
|
case "action":
|
|
39081
|
-
return /* @__PURE__ */
|
|
39723
|
+
return /* @__PURE__ */ jsx95(
|
|
39082
39724
|
DropdownMenuItem,
|
|
39083
39725
|
{
|
|
39084
39726
|
label: item.label,
|
|
@@ -39092,9 +39734,9 @@ function renderMenuItems(items) {
|
|
|
39092
39734
|
i
|
|
39093
39735
|
);
|
|
39094
39736
|
case "sub":
|
|
39095
|
-
return /* @__PURE__ */
|
|
39737
|
+
return /* @__PURE__ */ jsx95(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
39096
39738
|
case "custom":
|
|
39097
|
-
return /* @__PURE__ */
|
|
39739
|
+
return /* @__PURE__ */ jsx95(React82.Fragment, { children: item.render() }, item.key);
|
|
39098
39740
|
}
|
|
39099
39741
|
});
|
|
39100
39742
|
}
|
|
@@ -39396,7 +40038,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
39396
40038
|
{
|
|
39397
40039
|
type: "custom",
|
|
39398
40040
|
key: "table-insert-grid",
|
|
39399
|
-
render: () => /* @__PURE__ */
|
|
40041
|
+
render: () => /* @__PURE__ */ jsx95(
|
|
39400
40042
|
MenuTableInsertGrid,
|
|
39401
40043
|
{
|
|
39402
40044
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -39471,7 +40113,7 @@ function buildTableMenuItems(t, editor, onInsertTable) {
|
|
|
39471
40113
|
];
|
|
39472
40114
|
}
|
|
39473
40115
|
var MenuBarTrigger = React82.forwardRef(
|
|
39474
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
40116
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx95(
|
|
39475
40117
|
"button",
|
|
39476
40118
|
{
|
|
39477
40119
|
ref,
|
|
@@ -39574,9 +40216,9 @@ var MenuBar = ({
|
|
|
39574
40216
|
{
|
|
39575
40217
|
type: "custom",
|
|
39576
40218
|
key: "image",
|
|
39577
|
-
render: () => showImageInput ? /* @__PURE__ */
|
|
39578
|
-
/* @__PURE__ */
|
|
39579
|
-
/* @__PURE__ */
|
|
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(
|
|
39580
40222
|
DropdownMenuItem,
|
|
39581
40223
|
{
|
|
39582
40224
|
label: t("menubar.imageUpload"),
|
|
@@ -39591,7 +40233,7 @@ var MenuBar = ({
|
|
|
39591
40233
|
{
|
|
39592
40234
|
type: "custom",
|
|
39593
40235
|
key: "link",
|
|
39594
|
-
render: () => showLinkInput ? /* @__PURE__ */
|
|
40236
|
+
render: () => showLinkInput ? /* @__PURE__ */ jsx95(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx95(
|
|
39595
40237
|
DropdownMenuItem,
|
|
39596
40238
|
{
|
|
39597
40239
|
label: t("menubar.link"),
|
|
@@ -39611,7 +40253,7 @@ var MenuBar = ({
|
|
|
39611
40253
|
{
|
|
39612
40254
|
type: "custom",
|
|
39613
40255
|
key: "table-grid",
|
|
39614
|
-
render: () => /* @__PURE__ */
|
|
40256
|
+
render: () => /* @__PURE__ */ jsx95(
|
|
39615
40257
|
MenuTableInsertGrid,
|
|
39616
40258
|
{
|
|
39617
40259
|
insertLabel: t("tableMenu.insertTable"),
|
|
@@ -39623,6 +40265,26 @@ var MenuBar = ({
|
|
|
39623
40265
|
]
|
|
39624
40266
|
},
|
|
39625
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" },
|
|
39626
40288
|
{
|
|
39627
40289
|
type: "action",
|
|
39628
40290
|
label: t("menubar.horizontalRule"),
|
|
@@ -39664,8 +40326,8 @@ var MenuBar = ({
|
|
|
39664
40326
|
},
|
|
39665
40327
|
{ label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
|
|
39666
40328
|
];
|
|
39667
|
-
return /* @__PURE__ */
|
|
39668
|
-
/* @__PURE__ */
|
|
40329
|
+
return /* @__PURE__ */ jsxs79(Fragment35, { children: [
|
|
40330
|
+
/* @__PURE__ */ jsx95(
|
|
39669
40331
|
"input",
|
|
39670
40332
|
{
|
|
39671
40333
|
ref: fileInputRef,
|
|
@@ -39676,11 +40338,11 @@ var MenuBar = ({
|
|
|
39676
40338
|
onChange: (e) => handleImageFiles(e.target.files)
|
|
39677
40339
|
}
|
|
39678
40340
|
),
|
|
39679
|
-
/* @__PURE__ */
|
|
39680
|
-
menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */
|
|
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(
|
|
39681
40343
|
DropdownMenu,
|
|
39682
40344
|
{
|
|
39683
|
-
trigger: /* @__PURE__ */
|
|
40345
|
+
trigger: /* @__PURE__ */ jsx95(MenuBarTrigger, { children: label }),
|
|
39684
40346
|
placement: "bottom-start",
|
|
39685
40347
|
isOpen: open,
|
|
39686
40348
|
onOpenChange,
|
|
@@ -39688,7 +40350,7 @@ var MenuBar = ({
|
|
|
39688
40350
|
},
|
|
39689
40351
|
label
|
|
39690
40352
|
)),
|
|
39691
|
-
/* @__PURE__ */
|
|
40353
|
+
/* @__PURE__ */ jsx95(
|
|
39692
40354
|
"button",
|
|
39693
40355
|
{
|
|
39694
40356
|
type: "button",
|
|
@@ -39699,20 +40361,20 @@ var MenuBar = ({
|
|
|
39699
40361
|
"ml-auto inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
|
|
39700
40362
|
"hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
39701
40363
|
),
|
|
39702
|
-
children: /* @__PURE__ */
|
|
40364
|
+
children: /* @__PURE__ */ jsx95(Eye3, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
39703
40365
|
}
|
|
39704
40366
|
)
|
|
39705
40367
|
] }),
|
|
39706
|
-
/* @__PURE__ */
|
|
40368
|
+
/* @__PURE__ */ jsx95(
|
|
39707
40369
|
Modal_default,
|
|
39708
40370
|
{
|
|
39709
40371
|
isOpen: showSourceDialog,
|
|
39710
40372
|
onClose: () => setShowSourceDialog(false),
|
|
39711
40373
|
title: t("menubar.sourceCode"),
|
|
39712
40374
|
size: "lg",
|
|
39713
|
-
children: /* @__PURE__ */
|
|
39714
|
-
/* @__PURE__ */
|
|
39715
|
-
/* @__PURE__ */
|
|
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(
|
|
39716
40378
|
"textarea",
|
|
39717
40379
|
{
|
|
39718
40380
|
"data-testid": "source-code-textarea",
|
|
@@ -39722,8 +40384,8 @@ var MenuBar = ({
|
|
|
39722
40384
|
spellCheck: false
|
|
39723
40385
|
}
|
|
39724
40386
|
),
|
|
39725
|
-
/* @__PURE__ */
|
|
39726
|
-
/* @__PURE__ */
|
|
40387
|
+
/* @__PURE__ */ jsxs79("div", { className: "flex gap-2 justify-end", children: [
|
|
40388
|
+
/* @__PURE__ */ jsx95(
|
|
39727
40389
|
"button",
|
|
39728
40390
|
{
|
|
39729
40391
|
type: "button",
|
|
@@ -39732,7 +40394,7 @@ var MenuBar = ({
|
|
|
39732
40394
|
children: t("menubar.applySource")
|
|
39733
40395
|
}
|
|
39734
40396
|
),
|
|
39735
|
-
/* @__PURE__ */
|
|
40397
|
+
/* @__PURE__ */ jsx95(
|
|
39736
40398
|
"button",
|
|
39737
40399
|
{
|
|
39738
40400
|
type: "button",
|
|
@@ -39745,7 +40407,7 @@ var MenuBar = ({
|
|
|
39745
40407
|
] })
|
|
39746
40408
|
}
|
|
39747
40409
|
),
|
|
39748
|
-
/* @__PURE__ */
|
|
40410
|
+
/* @__PURE__ */ jsx95(
|
|
39749
40411
|
Modal_default,
|
|
39750
40412
|
{
|
|
39751
40413
|
isOpen: showPreviewDialog,
|
|
@@ -39756,12 +40418,12 @@ var MenuBar = ({
|
|
|
39756
40418
|
height: "min(860px, calc(100vh - 2rem))",
|
|
39757
40419
|
className: "flex flex-col overflow-hidden rounded-xl md:rounded-2xl",
|
|
39758
40420
|
contentClassName: "flex min-h-0 flex-1 overflow-hidden p-0",
|
|
39759
|
-
children: /* @__PURE__ */
|
|
40421
|
+
children: /* @__PURE__ */ jsx95(
|
|
39760
40422
|
"div",
|
|
39761
40423
|
{
|
|
39762
40424
|
"data-testid": "preview-content",
|
|
39763
40425
|
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain",
|
|
39764
|
-
children: editor.isEmpty ? /* @__PURE__ */
|
|
40426
|
+
children: editor.isEmpty ? /* @__PURE__ */ jsx95("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx95(
|
|
39765
40427
|
"div",
|
|
39766
40428
|
{
|
|
39767
40429
|
className: UEDITOR_PROSEMIRROR_CLASS_NAME,
|
|
@@ -39916,7 +40578,7 @@ function getFormulaRangePickHighlight(container, pickState) {
|
|
|
39916
40578
|
}
|
|
39917
40579
|
|
|
39918
40580
|
// src/components/UEditor/UEditor.tsx
|
|
39919
|
-
import { jsx as
|
|
40581
|
+
import { jsx as jsx96, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
39920
40582
|
var UEditor = React83.forwardRef(({
|
|
39921
40583
|
content = "",
|
|
39922
40584
|
onChange,
|
|
@@ -39936,10 +40598,12 @@ var UEditor = React83.forwardRef(({
|
|
|
39936
40598
|
showToolbar = true,
|
|
39937
40599
|
showBubbleMenu = true,
|
|
39938
40600
|
showCharacterCount = true,
|
|
40601
|
+
showFooter = true,
|
|
39939
40602
|
maxCharacters,
|
|
39940
40603
|
minHeight = "200px",
|
|
39941
40604
|
maxHeight = "auto",
|
|
39942
40605
|
variant = "default",
|
|
40606
|
+
rounded = true,
|
|
39943
40607
|
fontFamilies,
|
|
39944
40608
|
fontSizes,
|
|
39945
40609
|
lineHeights,
|
|
@@ -40145,7 +40809,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40145
40809
|
}
|
|
40146
40810
|
}, [content, editor]);
|
|
40147
40811
|
if (!editor) {
|
|
40148
|
-
return /* @__PURE__ */
|
|
40812
|
+
return /* @__PURE__ */ jsx96(
|
|
40149
40813
|
"div",
|
|
40150
40814
|
{
|
|
40151
40815
|
className: cn("w-full border bg-background flex items-center justify-center text-muted-foreground", className),
|
|
@@ -40154,7 +40818,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40154
40818
|
}
|
|
40155
40819
|
);
|
|
40156
40820
|
}
|
|
40157
|
-
return /* @__PURE__ */
|
|
40821
|
+
return /* @__PURE__ */ jsxs80(
|
|
40158
40822
|
"div",
|
|
40159
40823
|
{
|
|
40160
40824
|
className: cn(
|
|
@@ -40164,12 +40828,13 @@ var UEditor = React83.forwardRef(({
|
|
|
40164
40828
|
"transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
|
|
40165
40829
|
"shadow-sm focus-within:shadow-md focus-within:border-primary/15",
|
|
40166
40830
|
"backdrop-blur-sm",
|
|
40167
|
-
variant === "notion" && "hover:shadow-md"
|
|
40831
|
+
variant === "notion" && "hover:shadow-md",
|
|
40832
|
+
rounded ? "rounded-2xl md:rounded-3xl max-md:rounded-xl" : "rounded-none"
|
|
40168
40833
|
] : "rounded-none",
|
|
40169
40834
|
className
|
|
40170
40835
|
),
|
|
40171
40836
|
children: [
|
|
40172
|
-
editable && showMenuBar && /* @__PURE__ */
|
|
40837
|
+
editable && showMenuBar && /* @__PURE__ */ jsx96(
|
|
40173
40838
|
MenuBar,
|
|
40174
40839
|
{
|
|
40175
40840
|
editor,
|
|
@@ -40184,7 +40849,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40184
40849
|
onPreview
|
|
40185
40850
|
}
|
|
40186
40851
|
),
|
|
40187
|
-
editable && showToolbar && /* @__PURE__ */
|
|
40852
|
+
editable && showToolbar && /* @__PURE__ */ jsx96(
|
|
40188
40853
|
EditorToolbar,
|
|
40189
40854
|
{
|
|
40190
40855
|
editor,
|
|
@@ -40199,7 +40864,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40199
40864
|
letterSpacings
|
|
40200
40865
|
}
|
|
40201
40866
|
),
|
|
40202
|
-
editable && showBubbleMenu && /* @__PURE__ */
|
|
40867
|
+
editable && showBubbleMenu && /* @__PURE__ */ jsx96(
|
|
40203
40868
|
CustomBubbleMenu,
|
|
40204
40869
|
{
|
|
40205
40870
|
editor,
|
|
@@ -40207,7 +40872,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40207
40872
|
lineHeights
|
|
40208
40873
|
}
|
|
40209
40874
|
),
|
|
40210
|
-
/* @__PURE__ */
|
|
40875
|
+
/* @__PURE__ */ jsxs80(
|
|
40211
40876
|
"div",
|
|
40212
40877
|
{
|
|
40213
40878
|
ref: (node) => {
|
|
@@ -40220,7 +40885,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40220
40885
|
maxHeight
|
|
40221
40886
|
},
|
|
40222
40887
|
children: [
|
|
40223
|
-
/* @__PURE__ */
|
|
40888
|
+
/* @__PURE__ */ jsx96(
|
|
40224
40889
|
"span",
|
|
40225
40890
|
{
|
|
40226
40891
|
ref: tableColumnGuideRef,
|
|
@@ -40228,7 +40893,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40228
40893
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
40229
40894
|
}
|
|
40230
40895
|
),
|
|
40231
|
-
/* @__PURE__ */
|
|
40896
|
+
/* @__PURE__ */ jsx96(
|
|
40232
40897
|
"span",
|
|
40233
40898
|
{
|
|
40234
40899
|
ref: tableRowGuideRef,
|
|
@@ -40236,7 +40901,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40236
40901
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
40237
40902
|
}
|
|
40238
40903
|
),
|
|
40239
|
-
/* @__PURE__ */
|
|
40904
|
+
/* @__PURE__ */ jsx96(
|
|
40240
40905
|
"span",
|
|
40241
40906
|
{
|
|
40242
40907
|
ref: activeTableCellHighlightRef,
|
|
@@ -40245,7 +40910,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40245
40910
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10"
|
|
40246
40911
|
}
|
|
40247
40912
|
),
|
|
40248
|
-
formulaRangeHighlight && /* @__PURE__ */
|
|
40913
|
+
formulaRangeHighlight && /* @__PURE__ */ jsx96(
|
|
40249
40914
|
"span",
|
|
40250
40915
|
{
|
|
40251
40916
|
"aria-hidden": "true",
|
|
@@ -40259,8 +40924,8 @@ var UEditor = React83.forwardRef(({
|
|
|
40259
40924
|
}
|
|
40260
40925
|
}
|
|
40261
40926
|
),
|
|
40262
|
-
editable && /* @__PURE__ */
|
|
40263
|
-
/* @__PURE__ */
|
|
40927
|
+
editable && /* @__PURE__ */ jsx96(TableControls, { editor, containerRef: editorContentRef }),
|
|
40928
|
+
/* @__PURE__ */ jsx96(
|
|
40264
40929
|
EditorContent,
|
|
40265
40930
|
{
|
|
40266
40931
|
editor,
|
|
@@ -40270,7 +40935,7 @@ var UEditor = React83.forwardRef(({
|
|
|
40270
40935
|
]
|
|
40271
40936
|
}
|
|
40272
40937
|
),
|
|
40273
|
-
showCharacterCount && /* @__PURE__ */
|
|
40938
|
+
showFooter && showCharacterCount && /* @__PURE__ */ jsx96(CharacterCountDisplay, { editor, maxCharacters })
|
|
40274
40939
|
]
|
|
40275
40940
|
}
|
|
40276
40941
|
);
|