@underverse-ui/underverse 1.0.138 → 1.0.139
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 +1418 -369
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +621 -0
- package/dist/index.d.ts +621 -0
- package/dist/index.js +1111 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -859,6 +859,83 @@ var en_default = {
|
|
|
859
859
|
unnamed: "Unnamed file",
|
|
860
860
|
uploading: "(Uploading...)",
|
|
861
861
|
uploadFailed: "Upload failed"
|
|
862
|
+
},
|
|
863
|
+
menubar: {
|
|
864
|
+
file: "File",
|
|
865
|
+
edit: "Edit",
|
|
866
|
+
view: "View",
|
|
867
|
+
insert: "Insert",
|
|
868
|
+
format: "Format",
|
|
869
|
+
tools: "Tools",
|
|
870
|
+
table: "Table",
|
|
871
|
+
save: "Save",
|
|
872
|
+
exportHtml: "Export HTML",
|
|
873
|
+
undo: "Undo",
|
|
874
|
+
undoShortcut: "Ctrl+Z",
|
|
875
|
+
redo: "Redo",
|
|
876
|
+
redoShortcut: "Ctrl+Y",
|
|
877
|
+
cut: "Cut",
|
|
878
|
+
cutShortcut: "Ctrl+X",
|
|
879
|
+
copy: "Copy",
|
|
880
|
+
copyShortcut: "Ctrl+C",
|
|
881
|
+
paste: "Paste",
|
|
882
|
+
pasteShortcut: "Ctrl+V",
|
|
883
|
+
pasteAsText: "Paste as plain text",
|
|
884
|
+
selectAll: "Select All",
|
|
885
|
+
selectAllShortcut: "Ctrl+A",
|
|
886
|
+
sourceCode: "Source code",
|
|
887
|
+
preview: "Preview",
|
|
888
|
+
fullscreen: "Fullscreen",
|
|
889
|
+
fullscreenShortcut: "Ctrl+Shift+F",
|
|
890
|
+
image: "Image",
|
|
891
|
+
link: "Link",
|
|
892
|
+
linkShortcut: "Ctrl+K",
|
|
893
|
+
insertTable: "Table",
|
|
894
|
+
horizontalRule: "Horizontal line",
|
|
895
|
+
bold: "Bold",
|
|
896
|
+
boldShortcut: "Ctrl+B",
|
|
897
|
+
italic: "Italic",
|
|
898
|
+
italicShortcut: "Ctrl+I",
|
|
899
|
+
underline: "Underline",
|
|
900
|
+
underlineShortcut: "Ctrl+U",
|
|
901
|
+
strike: "Strikethrough",
|
|
902
|
+
superscript: "Superscript",
|
|
903
|
+
subscript: "Subscript",
|
|
904
|
+
code: "Code",
|
|
905
|
+
wrap: "Block",
|
|
906
|
+
align: "Align",
|
|
907
|
+
clearFormatting: "Clear formatting",
|
|
908
|
+
paragraph: "Paragraph",
|
|
909
|
+
heading1: "Heading 1",
|
|
910
|
+
heading2: "Heading 2",
|
|
911
|
+
heading3: "Heading 3",
|
|
912
|
+
blockquote: "Blockquote",
|
|
913
|
+
codeBlock: "Code block",
|
|
914
|
+
taskList: "Task list",
|
|
915
|
+
alignLeft: "Left",
|
|
916
|
+
alignCenter: "Center",
|
|
917
|
+
alignRight: "Right",
|
|
918
|
+
alignJustify: "Justify",
|
|
919
|
+
tableProperties: "Table properties",
|
|
920
|
+
deleteTable: "Delete table",
|
|
921
|
+
row: "Row",
|
|
922
|
+
column: "Column",
|
|
923
|
+
cell: "Cell",
|
|
924
|
+
addRowBefore: "Insert row above",
|
|
925
|
+
addRowAfter: "Insert row below",
|
|
926
|
+
deleteRow: "Delete row",
|
|
927
|
+
addColumnBefore: "Insert column left",
|
|
928
|
+
addColumnAfter: "Insert column right",
|
|
929
|
+
deleteColumn: "Delete column",
|
|
930
|
+
mergeCells: "Merge cells",
|
|
931
|
+
splitCell: "Split cell",
|
|
932
|
+
imageUpload: "Upload Image",
|
|
933
|
+
applySource: "Apply",
|
|
934
|
+
closeDialog: "Close",
|
|
935
|
+
copyHtml: "Copy HTML",
|
|
936
|
+
exportDefault: "Export HTML",
|
|
937
|
+
previewEmpty: "Nothing to preview.",
|
|
938
|
+
sourceCodeHint: "Edit HTML directly and click Apply to update the editor."
|
|
862
939
|
}
|
|
863
940
|
}
|
|
864
941
|
};
|
|
@@ -1158,6 +1235,83 @@ var vi_default = {
|
|
|
1158
1235
|
unnamed: "T\u1EC7p kh\xF4ng t\xEAn",
|
|
1159
1236
|
uploading: "(\u0110ang t\u1EA3i l\xEAn...)",
|
|
1160
1237
|
uploadFailed: "T\u1EA3i l\xEAn th\u1EA5t b\u1EA1i"
|
|
1238
|
+
},
|
|
1239
|
+
menubar: {
|
|
1240
|
+
file: "T\u1EADp tin",
|
|
1241
|
+
edit: "S\u1EEDa",
|
|
1242
|
+
view: "Xem",
|
|
1243
|
+
insert: "Th\xEAm",
|
|
1244
|
+
format: "\u0110\u1ECBnh d\u1EA1ng",
|
|
1245
|
+
tools: "C\xF4ng c\u1EE5",
|
|
1246
|
+
table: "B\u1EA3ng",
|
|
1247
|
+
save: "L\u01B0u",
|
|
1248
|
+
exportHtml: "Xu\u1EA5t HTML",
|
|
1249
|
+
undo: "Hu\u1EF7 thao t\xE1c",
|
|
1250
|
+
undoShortcut: "Ctrl+Z",
|
|
1251
|
+
redo: "Ho\xE0n t\xE1c",
|
|
1252
|
+
redoShortcut: "Ctrl+Y",
|
|
1253
|
+
cut: "C\u1EAFt",
|
|
1254
|
+
cutShortcut: "Ctrl+X",
|
|
1255
|
+
copy: "Ch\xE9p",
|
|
1256
|
+
copyShortcut: "Ctrl+C",
|
|
1257
|
+
paste: "D\xE1n",
|
|
1258
|
+
pasteShortcut: "Ctrl+V",
|
|
1259
|
+
pasteAsText: "D\xE1n nh\u01B0 v\u0103n b\u1EA3n",
|
|
1260
|
+
selectAll: "Ch\u1ECDn t\u1EA5t c\u1EA3",
|
|
1261
|
+
selectAllShortcut: "Ctrl+A",
|
|
1262
|
+
sourceCode: "M\xE3 ngu\u1ED3n",
|
|
1263
|
+
preview: "Xem tr\u01B0\u1EDBc",
|
|
1264
|
+
fullscreen: "\u0110\u1EA7y m\xE0n h\xECnh",
|
|
1265
|
+
fullscreenShortcut: "Ctrl+Shift+F",
|
|
1266
|
+
image: "H\xECnh \u1EA3nh",
|
|
1267
|
+
link: "Li\xEAn k\u1EBFt",
|
|
1268
|
+
linkShortcut: "Ctrl+K",
|
|
1269
|
+
insertTable: "B\u1EA3ng",
|
|
1270
|
+
horizontalRule: "\u0110\u01B0\u1EDDng k\u1EBB ngang",
|
|
1271
|
+
bold: "T\xF4 \u0111\u1EADm",
|
|
1272
|
+
boldShortcut: "Ctrl+B",
|
|
1273
|
+
italic: "In nghi\xEAng",
|
|
1274
|
+
italicShortcut: "Ctrl+I",
|
|
1275
|
+
underline: "G\u1EA1ch d\u01B0\u1EDBi",
|
|
1276
|
+
underlineShortcut: "Ctrl+U",
|
|
1277
|
+
strike: "G\u1EA1ch ngang",
|
|
1278
|
+
superscript: "Tr\xEAn d\xF2ng",
|
|
1279
|
+
subscript: "D\u01B0\u1EDBi d\xF2ng",
|
|
1280
|
+
code: "M\xE3",
|
|
1281
|
+
wrap: "Bao",
|
|
1282
|
+
align: "C\u0103n ch\u1EC9nh",
|
|
1283
|
+
clearFormatting: "Xo\xE1 \u0111\u1ECBnh d\u1EA1ng",
|
|
1284
|
+
paragraph: "\u0110o\u1EA1n v\u0103n",
|
|
1285
|
+
heading1: "Ti\xEAu \u0111\u1EC1 1",
|
|
1286
|
+
heading2: "Ti\xEAu \u0111\u1EC1 2",
|
|
1287
|
+
heading3: "Ti\xEAu \u0111\u1EC1 3",
|
|
1288
|
+
blockquote: "Tr\xEDch d\u1EABn",
|
|
1289
|
+
codeBlock: "Kh\u1ED1i m\xE3",
|
|
1290
|
+
taskList: "Danh s\xE1ch vi\u1EC7c",
|
|
1291
|
+
alignLeft: "Tr\xE1i",
|
|
1292
|
+
alignCenter: "Gi\u1EEFa",
|
|
1293
|
+
alignRight: "Ph\u1EA3i",
|
|
1294
|
+
alignJustify: "\u0110\u1EC1u",
|
|
1295
|
+
tableProperties: "Thu\u1ED9c t\xEDnh b\u1EA3ng",
|
|
1296
|
+
deleteTable: "Xo\xE1 b\u1EA3ng",
|
|
1297
|
+
row: "D\xF2ng",
|
|
1298
|
+
column: "C\u1ED9t",
|
|
1299
|
+
cell: "\xD4",
|
|
1300
|
+
addRowBefore: "Th\xEAm h\xE0ng ph\xEDa tr\xEAn",
|
|
1301
|
+
addRowAfter: "Th\xEAm h\xE0ng ph\xEDa d\u01B0\u1EDBi",
|
|
1302
|
+
deleteRow: "Xo\xE1 h\xE0ng",
|
|
1303
|
+
addColumnBefore: "Th\xEAm c\u1ED9t b\xEAn tr\xE1i",
|
|
1304
|
+
addColumnAfter: "Th\xEAm c\u1ED9t b\xEAn ph\u1EA3i",
|
|
1305
|
+
deleteColumn: "Xo\xE1 c\u1ED9t",
|
|
1306
|
+
mergeCells: "G\u1ED9p \xF4",
|
|
1307
|
+
splitCell: "T\xE1ch \xF4",
|
|
1308
|
+
imageUpload: "T\u1EA3i \u1EA3nh l\xEAn",
|
|
1309
|
+
applySource: "\xC1p d\u1EE5ng",
|
|
1310
|
+
closeDialog: "\u0110\xF3ng",
|
|
1311
|
+
copyHtml: "Sao ch\xE9p HTML",
|
|
1312
|
+
exportDefault: "Xu\u1EA5t HTML",
|
|
1313
|
+
previewEmpty: "Kh\xF4ng c\xF3 n\u1ED9i dung \u0111\u1EC3 xem tr\u01B0\u1EDBc.",
|
|
1314
|
+
sourceCodeHint: "Ch\u1EC9nh s\u1EEDa HTML tr\u1EF1c ti\u1EBFp v\xE0 nh\u1EA5n \xC1p d\u1EE5ng \u0111\u1EC3 c\u1EADp nh\u1EADt n\u1ED9i dung."
|
|
1161
1315
|
}
|
|
1162
1316
|
}
|
|
1163
1317
|
};
|
|
@@ -1456,6 +1610,83 @@ var ko_default = {
|
|
|
1456
1610
|
unnamed: "\uC774\uB984 \uC5C6\uB294 \uD30C\uC77C",
|
|
1457
1611
|
uploading: "(\uC5C5\uB85C\uB4DC \uC911...)",
|
|
1458
1612
|
uploadFailed: "\uC5C5\uB85C\uB4DC \uC2E4\uD328"
|
|
1613
|
+
},
|
|
1614
|
+
menubar: {
|
|
1615
|
+
file: "\uD30C\uC77C",
|
|
1616
|
+
edit: "\uD3B8\uC9D1",
|
|
1617
|
+
view: "\uBCF4\uAE30",
|
|
1618
|
+
insert: "\uC0BD\uC785",
|
|
1619
|
+
format: "\uC11C\uC2DD",
|
|
1620
|
+
tools: "\uB3C4\uAD6C",
|
|
1621
|
+
table: "\uD45C",
|
|
1622
|
+
save: "\uC800\uC7A5",
|
|
1623
|
+
exportHtml: "HTML \uB0B4\uBCF4\uB0B4\uAE30",
|
|
1624
|
+
undo: "\uC2E4\uD589 \uCDE8\uC18C",
|
|
1625
|
+
undoShortcut: "Ctrl+Z",
|
|
1626
|
+
redo: "\uB2E4\uC2DC \uC2E4\uD589",
|
|
1627
|
+
redoShortcut: "Ctrl+Y",
|
|
1628
|
+
cut: "\uC798\uB77C\uB0B4\uAE30",
|
|
1629
|
+
cutShortcut: "Ctrl+X",
|
|
1630
|
+
copy: "\uBCF5\uC0AC",
|
|
1631
|
+
copyShortcut: "Ctrl+C",
|
|
1632
|
+
paste: "\uBD99\uC5EC\uB123\uAE30",
|
|
1633
|
+
pasteShortcut: "Ctrl+V",
|
|
1634
|
+
pasteAsText: "\uC77C\uBC18 \uD14D\uC2A4\uD2B8\uB85C \uBD99\uC5EC\uB123\uAE30",
|
|
1635
|
+
selectAll: "\uC804\uCCB4 \uC120\uD0DD",
|
|
1636
|
+
selectAllShortcut: "Ctrl+A",
|
|
1637
|
+
sourceCode: "\uC18C\uC2A4 \uCF54\uB4DC",
|
|
1638
|
+
preview: "\uBBF8\uB9AC\uBCF4\uAE30",
|
|
1639
|
+
fullscreen: "\uC804\uCCB4 \uD654\uBA74",
|
|
1640
|
+
fullscreenShortcut: "Ctrl+Shift+F",
|
|
1641
|
+
image: "\uC774\uBBF8\uC9C0",
|
|
1642
|
+
link: "\uB9C1\uD06C",
|
|
1643
|
+
linkShortcut: "Ctrl+K",
|
|
1644
|
+
insertTable: "\uD45C",
|
|
1645
|
+
horizontalRule: "\uAC00\uB85C\uC904",
|
|
1646
|
+
bold: "\uAD75\uAC8C",
|
|
1647
|
+
boldShortcut: "Ctrl+B",
|
|
1648
|
+
italic: "\uAE30\uC6B8\uC784\uAF34",
|
|
1649
|
+
italicShortcut: "Ctrl+I",
|
|
1650
|
+
underline: "\uBC11\uC904",
|
|
1651
|
+
underlineShortcut: "Ctrl+U",
|
|
1652
|
+
strike: "\uCDE8\uC18C\uC120",
|
|
1653
|
+
superscript: "\uC704 \uCCA8\uC790",
|
|
1654
|
+
subscript: "\uC544\uB798 \uCCA8\uC790",
|
|
1655
|
+
code: "\uCF54\uB4DC",
|
|
1656
|
+
wrap: "\uBE14\uB85D",
|
|
1657
|
+
align: "\uC815\uB82C",
|
|
1658
|
+
clearFormatting: "\uC11C\uC2DD \uC9C0\uC6B0\uAE30",
|
|
1659
|
+
paragraph: "\uB2E8\uB77D",
|
|
1660
|
+
heading1: "\uC81C\uBAA9 1",
|
|
1661
|
+
heading2: "\uC81C\uBAA9 2",
|
|
1662
|
+
heading3: "\uC81C\uBAA9 3",
|
|
1663
|
+
blockquote: "\uC778\uC6A9",
|
|
1664
|
+
codeBlock: "\uCF54\uB4DC \uBE14\uB85D",
|
|
1665
|
+
taskList: "\uC791\uC5C5 \uBAA9\uB85D",
|
|
1666
|
+
alignLeft: "\uC67C\uCABD",
|
|
1667
|
+
alignCenter: "\uAC00\uC6B4\uB370",
|
|
1668
|
+
alignRight: "\uC624\uB978\uCABD",
|
|
1669
|
+
alignJustify: "\uC591\uCABD",
|
|
1670
|
+
tableProperties: "\uD45C \uC18D\uC131",
|
|
1671
|
+
deleteTable: "\uD45C \uC0AD\uC81C",
|
|
1672
|
+
row: "\uD589",
|
|
1673
|
+
column: "\uC5F4",
|
|
1674
|
+
cell: "\uC140",
|
|
1675
|
+
addRowBefore: "\uC704\uC5D0 \uD589 \uC0BD\uC785",
|
|
1676
|
+
addRowAfter: "\uC544\uB798\uC5D0 \uD589 \uC0BD\uC785",
|
|
1677
|
+
deleteRow: "\uD589 \uC0AD\uC81C",
|
|
1678
|
+
addColumnBefore: "\uC67C\uCABD\uC5D0 \uC5F4 \uC0BD\uC785",
|
|
1679
|
+
addColumnAfter: "\uC624\uB978\uCABD\uC5D0 \uC5F4 \uC0BD\uC785",
|
|
1680
|
+
deleteColumn: "\uC5F4 \uC0AD\uC81C",
|
|
1681
|
+
mergeCells: "\uC140 \uBCD1\uD569",
|
|
1682
|
+
splitCell: "\uC140 \uBD84\uD560",
|
|
1683
|
+
imageUpload: "\uC774\uBBF8\uC9C0 \uC5C5\uB85C\uB4DC",
|
|
1684
|
+
applySource: "\uC801\uC6A9",
|
|
1685
|
+
closeDialog: "\uB2EB\uAE30",
|
|
1686
|
+
copyHtml: "HTML \uBCF5\uC0AC",
|
|
1687
|
+
exportDefault: "HTML \uB0B4\uBCF4\uB0B4\uAE30",
|
|
1688
|
+
previewEmpty: "\uBBF8\uB9AC\uBCFC \uB0B4\uC6A9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
1689
|
+
sourceCodeHint: "HTML\uC744 \uC9C1\uC811 \uD3B8\uC9D1\uD558\uACE0 \uC801\uC6A9\uC744 \uD074\uB9AD\uD558\uC5EC \uC5D0\uB514\uD130\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC138\uC694."
|
|
1459
1690
|
}
|
|
1460
1691
|
}
|
|
1461
1692
|
};
|
|
@@ -1754,6 +1985,83 @@ var ja_default = {
|
|
|
1754
1985
|
unnamed: "\u540D\u524D\u306A\u3057\u30D5\u30A1\u30A4\u30EB",
|
|
1755
1986
|
uploading: "(\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D...)",
|
|
1756
1987
|
uploadFailed: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u5931\u6557"
|
|
1988
|
+
},
|
|
1989
|
+
menubar: {
|
|
1990
|
+
file: "\u30D5\u30A1\u30A4\u30EB",
|
|
1991
|
+
edit: "\u7DE8\u96C6",
|
|
1992
|
+
view: "\u8868\u793A",
|
|
1993
|
+
insert: "\u633F\u5165",
|
|
1994
|
+
format: "\u66F8\u5F0F",
|
|
1995
|
+
tools: "\u30C4\u30FC\u30EB",
|
|
1996
|
+
table: "\u8868",
|
|
1997
|
+
save: "\u4FDD\u5B58",
|
|
1998
|
+
exportHtml: "HTML\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",
|
|
1999
|
+
undo: "\u5143\u306B\u623B\u3059",
|
|
2000
|
+
undoShortcut: "Ctrl+Z",
|
|
2001
|
+
redo: "\u3084\u308A\u76F4\u3057",
|
|
2002
|
+
redoShortcut: "Ctrl+Y",
|
|
2003
|
+
cut: "\u5207\u308A\u53D6\u308A",
|
|
2004
|
+
cutShortcut: "Ctrl+X",
|
|
2005
|
+
copy: "\u30B3\u30D4\u30FC",
|
|
2006
|
+
copyShortcut: "Ctrl+C",
|
|
2007
|
+
paste: "\u8CBC\u308A\u4ED8\u3051",
|
|
2008
|
+
pasteShortcut: "Ctrl+V",
|
|
2009
|
+
pasteAsText: "\u30C6\u30AD\u30B9\u30C8\u3068\u3057\u3066\u8CBC\u308A\u4ED8\u3051",
|
|
2010
|
+
selectAll: "\u3059\u3079\u3066\u9078\u629E",
|
|
2011
|
+
selectAllShortcut: "Ctrl+A",
|
|
2012
|
+
sourceCode: "\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9",
|
|
2013
|
+
preview: "\u30D7\u30EC\u30D3\u30E5\u30FC",
|
|
2014
|
+
fullscreen: "\u30D5\u30EB\u30B9\u30AF\u30EA\u30FC\u30F3",
|
|
2015
|
+
fullscreenShortcut: "Ctrl+Shift+F",
|
|
2016
|
+
image: "\u753B\u50CF",
|
|
2017
|
+
link: "\u30EA\u30F3\u30AF",
|
|
2018
|
+
linkShortcut: "Ctrl+K",
|
|
2019
|
+
insertTable: "\u8868",
|
|
2020
|
+
horizontalRule: "\u6C34\u5E73\u7DDA",
|
|
2021
|
+
bold: "\u592A\u5B57",
|
|
2022
|
+
boldShortcut: "Ctrl+B",
|
|
2023
|
+
italic: "\u659C\u4F53",
|
|
2024
|
+
italicShortcut: "Ctrl+I",
|
|
2025
|
+
underline: "\u4E0B\u7DDA",
|
|
2026
|
+
underlineShortcut: "Ctrl+U",
|
|
2027
|
+
strike: "\u53D6\u308A\u6D88\u3057\u7DDA",
|
|
2028
|
+
superscript: "\u4E0A\u4ED8\u304D\u6587\u5B57",
|
|
2029
|
+
subscript: "\u4E0B\u4ED8\u304D\u6587\u5B57",
|
|
2030
|
+
code: "\u30B3\u30FC\u30C9",
|
|
2031
|
+
wrap: "\u30D6\u30ED\u30C3\u30AF",
|
|
2032
|
+
align: "\u914D\u7F6E",
|
|
2033
|
+
clearFormatting: "\u66F8\u5F0F\u3092\u30AF\u30EA\u30A2",
|
|
2034
|
+
paragraph: "\u6BB5\u843D",
|
|
2035
|
+
heading1: "\u898B\u51FA\u3057 1",
|
|
2036
|
+
heading2: "\u898B\u51FA\u3057 2",
|
|
2037
|
+
heading3: "\u898B\u51FA\u3057 3",
|
|
2038
|
+
blockquote: "\u5F15\u7528",
|
|
2039
|
+
codeBlock: "\u30B3\u30FC\u30C9\u30D6\u30ED\u30C3\u30AF",
|
|
2040
|
+
taskList: "\u30BF\u30B9\u30AF\u30EA\u30B9\u30C8",
|
|
2041
|
+
alignLeft: "\u5DE6\u63C3\u3048",
|
|
2042
|
+
alignCenter: "\u4E2D\u592E\u63C3\u3048",
|
|
2043
|
+
alignRight: "\u53F3\u63C3\u3048",
|
|
2044
|
+
alignJustify: "\u4E21\u7AEF\u63C3\u3048",
|
|
2045
|
+
tableProperties: "\u8868\u306E\u30D7\u30ED\u30D1\u30C6\u30A3",
|
|
2046
|
+
deleteTable: "\u8868\u3092\u524A\u9664",
|
|
2047
|
+
row: "\u884C",
|
|
2048
|
+
column: "\u5217",
|
|
2049
|
+
cell: "\u30BB\u30EB",
|
|
2050
|
+
addRowBefore: "\u4E0A\u306B\u884C\u3092\u633F\u5165",
|
|
2051
|
+
addRowAfter: "\u4E0B\u306B\u884C\u3092\u633F\u5165",
|
|
2052
|
+
deleteRow: "\u884C\u3092\u524A\u9664",
|
|
2053
|
+
addColumnBefore: "\u5DE6\u306B\u5217\u3092\u633F\u5165",
|
|
2054
|
+
addColumnAfter: "\u53F3\u306B\u5217\u3092\u633F\u5165",
|
|
2055
|
+
deleteColumn: "\u5217\u3092\u524A\u9664",
|
|
2056
|
+
mergeCells: "\u30BB\u30EB\u3092\u7D50\u5408",
|
|
2057
|
+
splitCell: "\u30BB\u30EB\u3092\u5206\u5272",
|
|
2058
|
+
imageUpload: "\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
|
|
2059
|
+
applySource: "\u9069\u7528",
|
|
2060
|
+
closeDialog: "\u9589\u3058\u308B",
|
|
2061
|
+
copyHtml: "HTML\u3092\u30B3\u30D4\u30FC",
|
|
2062
|
+
exportDefault: "HTML\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",
|
|
2063
|
+
previewEmpty: "\u30D7\u30EC\u30D3\u30E5\u30FC\u3059\u308B\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u3042\u308A\u307E\u305B\u3093\u3002",
|
|
2064
|
+
sourceCodeHint: "HTML\u3092\u76F4\u63A5\u7DE8\u96C6\u3057\u3001\u9069\u7528\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30A8\u30C7\u30A3\u30BF\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002"
|
|
1757
2065
|
}
|
|
1758
2066
|
}
|
|
1759
2067
|
};
|
|
@@ -7165,6 +7473,7 @@ var VerticalTabs = ({ sidebarWidth = "w-48", className, ...props }) => {
|
|
|
7165
7473
|
|
|
7166
7474
|
// src/components/DropdownMenu.tsx
|
|
7167
7475
|
import React25, { useState as useState17 } from "react";
|
|
7476
|
+
import { ChevronRight as ChevronRight2 } from "lucide-react";
|
|
7168
7477
|
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7169
7478
|
function useResettingIndex(resetToken) {
|
|
7170
7479
|
const [state, setState] = React25.useState({ resetToken, index: -1 });
|
|
@@ -7359,6 +7668,32 @@ var DropdownMenuItem = ({
|
|
|
7359
7668
|
}
|
|
7360
7669
|
);
|
|
7361
7670
|
var DropdownMenuSeparator = ({ className }) => /* @__PURE__ */ jsx29("div", { className: cn("h-px bg-border my-1", className) });
|
|
7671
|
+
var DropdownMenuSub = ({ label, icon: Icon, disabled, children }) => /* @__PURE__ */ jsx29(
|
|
7672
|
+
DropdownMenu,
|
|
7673
|
+
{
|
|
7674
|
+
trigger: /* @__PURE__ */ jsxs21(
|
|
7675
|
+
"button",
|
|
7676
|
+
{
|
|
7677
|
+
type: "button",
|
|
7678
|
+
disabled,
|
|
7679
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
7680
|
+
className: cn(
|
|
7681
|
+
"flex w-full items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer",
|
|
7682
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
7683
|
+
"focus:bg-accent focus:text-accent-foreground focus:outline-none",
|
|
7684
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
7685
|
+
),
|
|
7686
|
+
children: [
|
|
7687
|
+
Icon && /* @__PURE__ */ jsx29(Icon, { className: "w-4 h-4 shrink-0 opacity-60" }),
|
|
7688
|
+
/* @__PURE__ */ jsx29("span", { className: "flex-1 text-left", children: label }),
|
|
7689
|
+
/* @__PURE__ */ jsx29(ChevronRight2, { className: "w-3 h-3 opacity-50" })
|
|
7690
|
+
]
|
|
7691
|
+
}
|
|
7692
|
+
),
|
|
7693
|
+
placement: "right",
|
|
7694
|
+
children
|
|
7695
|
+
}
|
|
7696
|
+
);
|
|
7362
7697
|
var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", className }) => /* @__PURE__ */ jsx29(
|
|
7363
7698
|
DropdownMenu,
|
|
7364
7699
|
{
|
|
@@ -7387,7 +7722,7 @@ var DropdownMenu_default = DropdownMenu;
|
|
|
7387
7722
|
|
|
7388
7723
|
// src/components/Pagination.tsx
|
|
7389
7724
|
import * as React27 from "react";
|
|
7390
|
-
import { ChevronLeft, ChevronRight as
|
|
7725
|
+
import { ChevronLeft, ChevronRight as ChevronRight3, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
7391
7726
|
|
|
7392
7727
|
// src/components/Combobox.tsx
|
|
7393
7728
|
import * as React26 from "react";
|
|
@@ -8127,7 +8462,7 @@ var Pagination = ({
|
|
|
8127
8462
|
),
|
|
8128
8463
|
title: labels?.nextPage || t("nextPage"),
|
|
8129
8464
|
"aria-label": labels?.nextPage || t("nextPage"),
|
|
8130
|
-
children: /* @__PURE__ */ jsx31(
|
|
8465
|
+
children: /* @__PURE__ */ jsx31(ChevronRight3, { className: "h-4 w-4" })
|
|
8131
8466
|
}
|
|
8132
8467
|
),
|
|
8133
8468
|
showFirstLast && /* @__PURE__ */ jsx31(
|
|
@@ -8227,7 +8562,7 @@ var SimplePagination = ({
|
|
|
8227
8562
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
8228
8563
|
),
|
|
8229
8564
|
"aria-label": t("nextPage"),
|
|
8230
|
-
children: /* @__PURE__ */ jsx31(
|
|
8565
|
+
children: /* @__PURE__ */ jsx31(ChevronRight3, { className: "h-4 w-4" })
|
|
8231
8566
|
}
|
|
8232
8567
|
)
|
|
8233
8568
|
] }),
|
|
@@ -8282,7 +8617,7 @@ var CompactPagination = ({ page, totalPages, onChange, className, disabled = fal
|
|
|
8282
8617
|
),
|
|
8283
8618
|
title: t("nextPage"),
|
|
8284
8619
|
"aria-label": t("nextPage"),
|
|
8285
|
-
children: /* @__PURE__ */ jsx31(
|
|
8620
|
+
children: /* @__PURE__ */ jsx31(ChevronRight3, { className: "h-3.5 w-3.5" })
|
|
8286
8621
|
}
|
|
8287
8622
|
),
|
|
8288
8623
|
/* @__PURE__ */ jsx31(
|
|
@@ -8687,7 +9022,7 @@ function parseDateString(str, locale = "en") {
|
|
|
8687
9022
|
}
|
|
8688
9023
|
|
|
8689
9024
|
// src/components/DatePicker.tsx
|
|
8690
|
-
import { Calendar, ChevronLeft as ChevronLeft2, ChevronRight as
|
|
9025
|
+
import { Calendar, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight4, Sparkles, X as XIcon } from "lucide-react";
|
|
8691
9026
|
import * as React30 from "react";
|
|
8692
9027
|
import { useId as useId7 } from "react";
|
|
8693
9028
|
import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
@@ -9097,7 +9432,7 @@ var DatePicker = ({
|
|
|
9097
9432
|
"hover:scale-110 active:scale-95 hover:shadow-md",
|
|
9098
9433
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
|
|
9099
9434
|
),
|
|
9100
|
-
children: /* @__PURE__ */ jsx35(
|
|
9435
|
+
children: /* @__PURE__ */ jsx35(ChevronRight4, { className: "h-4 w-4" })
|
|
9101
9436
|
}
|
|
9102
9437
|
)
|
|
9103
9438
|
] }),
|
|
@@ -9859,7 +10194,7 @@ var DateRangePicker = ({
|
|
|
9859
10194
|
"hover:scale-110 active:scale-95 hover:shadow-md",
|
|
9860
10195
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50"
|
|
9861
10196
|
),
|
|
9862
|
-
children: /* @__PURE__ */ jsx35(
|
|
10197
|
+
children: /* @__PURE__ */ jsx35(ChevronRight4, { className: sizeStyles8[size].navIcon })
|
|
9863
10198
|
}
|
|
9864
10199
|
)
|
|
9865
10200
|
] }),
|
|
@@ -10069,7 +10404,7 @@ import * as React34 from "react";
|
|
|
10069
10404
|
import { Calendar as CalendarIcon, X as X12 } from "lucide-react";
|
|
10070
10405
|
|
|
10071
10406
|
// src/components/Calendar.tsx
|
|
10072
|
-
import { ChevronLeft as ChevronLeft3, ChevronRight as
|
|
10407
|
+
import { ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight5 } from "lucide-react";
|
|
10073
10408
|
import * as React32 from "react";
|
|
10074
10409
|
|
|
10075
10410
|
// src/components/MonthYearPicker.tsx
|
|
@@ -11425,7 +11760,7 @@ function Calendar3({
|
|
|
11425
11760
|
nextDisabled && "opacity-40 cursor-not-allowed hover:bg-transparent hover:shadow-none active:scale-100"
|
|
11426
11761
|
),
|
|
11427
11762
|
"aria-label": labels?.next || (display === "week" ? "Next week" : "Next month"),
|
|
11428
|
-
children: /* @__PURE__ */ jsx37(
|
|
11763
|
+
children: /* @__PURE__ */ jsx37(ChevronRight5, { className: "h-4 w-4" })
|
|
11429
11764
|
}
|
|
11430
11765
|
)
|
|
11431
11766
|
] }),
|
|
@@ -13741,7 +14076,7 @@ function resourcesById(resources) {
|
|
|
13741
14076
|
|
|
13742
14077
|
// src/components/CalendarTimeline/CalendarTimelineHeader.tsx
|
|
13743
14078
|
import * as React36 from "react";
|
|
13744
|
-
import { Calendar as Calendar4, CalendarDays, CalendarRange, ChevronLeft as ChevronLeft4, ChevronRight as
|
|
14079
|
+
import { Calendar as Calendar4, CalendarDays, CalendarRange, ChevronLeft as ChevronLeft4, ChevronRight as ChevronRight6, GripVertical, Plus } from "lucide-react";
|
|
13745
14080
|
import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
13746
14081
|
var VIEW_ICONS = {
|
|
13747
14082
|
month: /* @__PURE__ */ jsx41(CalendarRange, { className: "h-4 w-4" }),
|
|
@@ -13943,7 +14278,7 @@ function CalendarTimelineHeader(props) {
|
|
|
13943
14278
|
onClick: () => navigate(1),
|
|
13944
14279
|
"aria-label": labels.next,
|
|
13945
14280
|
className: cn(sizeConfig.controlButtonIconClass, "rounded-full hover:bg-card/80 transition-all duration-200"),
|
|
13946
|
-
children: /* @__PURE__ */ jsx41(
|
|
14281
|
+
children: /* @__PURE__ */ jsx41(ChevronRight6, { className: "h-4 w-4" })
|
|
13947
14282
|
}
|
|
13948
14283
|
)
|
|
13949
14284
|
] }),
|
|
@@ -17845,7 +18180,7 @@ function OverlayControls({
|
|
|
17845
18180
|
// src/components/CategoryTreeSelect.tsx
|
|
17846
18181
|
import { useEffect as useEffect25, useId as useId11, useMemo as useMemo19, useRef as useRef20, useState as useState31 } from "react";
|
|
17847
18182
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
17848
|
-
import { ChevronRight as
|
|
18183
|
+
import { ChevronRight as ChevronRight7, ChevronDown as ChevronDown5, FolderTree, Layers, Search as Search6, SearchX as SearchX3, X as X14 } from "lucide-react";
|
|
17849
18184
|
import { jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
17850
18185
|
var defaultLabels = {
|
|
17851
18186
|
emptyText: "No categories",
|
|
@@ -18318,7 +18653,7 @@ function CategoryTreeSelect(props) {
|
|
|
18318
18653
|
shouldAutoExpandSearchResults && "opacity-60 cursor-not-allowed hover:scale-100 active:scale-100"
|
|
18319
18654
|
),
|
|
18320
18655
|
disabled: shouldAutoExpandSearchResults,
|
|
18321
|
-
children: /* @__PURE__ */ jsx50("div", { className: cn("transition-transform duration-200", isExpanded && "rotate-90"), children: /* @__PURE__ */ jsx50(
|
|
18656
|
+
children: /* @__PURE__ */ jsx50("div", { className: cn("transition-transform duration-200", isExpanded && "rotate-90"), children: /* @__PURE__ */ jsx50(ChevronRight7, { className: "w-4 h-4" }) })
|
|
18322
18657
|
}
|
|
18323
18658
|
) : /* @__PURE__ */ jsx50("span", { className: TREE_EXPANDER_PLACEHOLDER_CLASS }),
|
|
18324
18659
|
viewOnly ? (
|
|
@@ -19485,7 +19820,7 @@ function FileUpload({
|
|
|
19485
19820
|
|
|
19486
19821
|
// src/components/Carousel.tsx
|
|
19487
19822
|
import * as React46 from "react";
|
|
19488
|
-
import { ChevronLeft as ChevronLeft5, ChevronRight as
|
|
19823
|
+
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight8 } from "lucide-react";
|
|
19489
19824
|
import { Fragment as Fragment18, jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
19490
19825
|
function Carousel({
|
|
19491
19826
|
children,
|
|
@@ -19940,7 +20275,7 @@ function Carousel({
|
|
|
19940
20275
|
onClick: scrollNext,
|
|
19941
20276
|
variant: "ghost",
|
|
19942
20277
|
size: "icon",
|
|
19943
|
-
icon:
|
|
20278
|
+
icon: ChevronRight8,
|
|
19944
20279
|
noHoverOverlay: true,
|
|
19945
20280
|
disabled: !loop && currentIndex >= maxIndex,
|
|
19946
20281
|
className: cn(
|
|
@@ -20286,7 +20621,7 @@ function FallingIcons({
|
|
|
20286
20621
|
|
|
20287
20622
|
// src/components/List.tsx
|
|
20288
20623
|
import * as React48 from "react";
|
|
20289
|
-
import { ChevronRight as
|
|
20624
|
+
import { ChevronRight as ChevronRight9 } from "lucide-react";
|
|
20290
20625
|
import { Fragment as Fragment19, jsx as jsx55, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
20291
20626
|
var SIZE_STYLES2 = {
|
|
20292
20627
|
xs: { label: "text-xs", desc: "text-[11px]", icon: "h-3.5 w-3.5", avatar: "h-6 w-6" },
|
|
@@ -20473,7 +20808,7 @@ var ListItem = React48.forwardRef(
|
|
|
20473
20808
|
"span",
|
|
20474
20809
|
{
|
|
20475
20810
|
className: cn("text-muted-foreground shrink-0 transition-transform cursor-pointer select-none", sz.icon, isExpanded && "rotate-90"),
|
|
20476
|
-
children: /* @__PURE__ */ jsx55(
|
|
20811
|
+
children: /* @__PURE__ */ jsx55(ChevronRight9, { className: cn(sz.icon) })
|
|
20477
20812
|
}
|
|
20478
20813
|
) : Right && /* @__PURE__ */ jsx55("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ jsx55(Right, { className: cn(sz.icon) }) })
|
|
20479
20814
|
] }),
|
|
@@ -24266,7 +24601,7 @@ function useLocale2() {
|
|
|
24266
24601
|
}
|
|
24267
24602
|
|
|
24268
24603
|
// src/components/UEditor/UEditor.tsx
|
|
24269
|
-
import
|
|
24604
|
+
import React82, { useEffect as useEffect38, useImperativeHandle as useImperativeHandle3, useMemo as useMemo24, useRef as useRef37 } from "react";
|
|
24270
24605
|
import { useEditor, EditorContent } from "@tiptap/react";
|
|
24271
24606
|
|
|
24272
24607
|
// src/components/UEditor/extensions.ts
|
|
@@ -35636,9 +35971,730 @@ function useUEditorTableInteractions(editor, editable = true) {
|
|
|
35636
35971
|
};
|
|
35637
35972
|
}
|
|
35638
35973
|
|
|
35974
|
+
// src/components/UEditor/menu-bar.tsx
|
|
35975
|
+
import React81, { useRef as useRef36, useState as useState49 } from "react";
|
|
35976
|
+
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
35977
|
+
import {
|
|
35978
|
+
AlignCenter as AlignCenter4,
|
|
35979
|
+
AlignJustify as AlignJustify2,
|
|
35980
|
+
AlignLeft as AlignLeft4,
|
|
35981
|
+
AlignRight as AlignRight4,
|
|
35982
|
+
Bold as BoldIcon3,
|
|
35983
|
+
Code as CodeIcon3,
|
|
35984
|
+
FileCode as FileCode4,
|
|
35985
|
+
Heading1 as Heading1Icon2,
|
|
35986
|
+
Heading2 as Heading2Icon2,
|
|
35987
|
+
Heading3 as Heading3Icon2,
|
|
35988
|
+
Image as ImageIcon3,
|
|
35989
|
+
Italic as ItalicIcon3,
|
|
35990
|
+
Link as LinkIcon3,
|
|
35991
|
+
ListTodo as ListTodo3,
|
|
35992
|
+
Maximize2 as Maximize22,
|
|
35993
|
+
Quote as QuoteIcon2,
|
|
35994
|
+
Redo as RedoIcon2,
|
|
35995
|
+
Scissors,
|
|
35996
|
+
Strikethrough as StrikethroughIcon3,
|
|
35997
|
+
Subscript as SubscriptIcon3,
|
|
35998
|
+
Superscript as SuperscriptIcon3,
|
|
35999
|
+
Table as TableIcon3,
|
|
36000
|
+
Trash2 as Trash25,
|
|
36001
|
+
Underline as UnderlineIcon3,
|
|
36002
|
+
Undo as UndoIcon2,
|
|
36003
|
+
Upload as Upload4
|
|
36004
|
+
} from "lucide-react";
|
|
36005
|
+
import { Fragment as Fragment35, jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
36006
|
+
function renderMenuItems(items) {
|
|
36007
|
+
return items.map((item, i) => {
|
|
36008
|
+
switch (item.type) {
|
|
36009
|
+
case "separator":
|
|
36010
|
+
return /* @__PURE__ */ jsx92(DropdownMenuSeparator, {}, i);
|
|
36011
|
+
case "action":
|
|
36012
|
+
return /* @__PURE__ */ jsx92(
|
|
36013
|
+
DropdownMenuItem,
|
|
36014
|
+
{
|
|
36015
|
+
label: item.label,
|
|
36016
|
+
icon: item.icon,
|
|
36017
|
+
shortcut: item.shortcut,
|
|
36018
|
+
onClick: item.onClick,
|
|
36019
|
+
disabled: item.disabled,
|
|
36020
|
+
active: item.active,
|
|
36021
|
+
destructive: item.destructive
|
|
36022
|
+
},
|
|
36023
|
+
i
|
|
36024
|
+
);
|
|
36025
|
+
case "sub":
|
|
36026
|
+
return /* @__PURE__ */ jsx92(DropdownMenuSub, { label: item.label, icon: item.icon, disabled: item.disabled, children: renderMenuItems(item.items) }, i);
|
|
36027
|
+
case "custom":
|
|
36028
|
+
return /* @__PURE__ */ jsx92(React81.Fragment, { children: item.render() }, item.key);
|
|
36029
|
+
}
|
|
36030
|
+
});
|
|
36031
|
+
}
|
|
36032
|
+
function buildFileMenuItems(t, editor, { onSave, onExport }) {
|
|
36033
|
+
return [
|
|
36034
|
+
{
|
|
36035
|
+
type: "action",
|
|
36036
|
+
label: t("menubar.save"),
|
|
36037
|
+
shortcut: "Ctrl+S",
|
|
36038
|
+
onClick: () => onSave?.(),
|
|
36039
|
+
disabled: !onSave
|
|
36040
|
+
},
|
|
36041
|
+
{
|
|
36042
|
+
type: "action",
|
|
36043
|
+
label: t("menubar.exportHtml"),
|
|
36044
|
+
onClick: () => {
|
|
36045
|
+
if (onExport) {
|
|
36046
|
+
onExport();
|
|
36047
|
+
} else {
|
|
36048
|
+
const html = editor.getHTML();
|
|
36049
|
+
const blob = new Blob([`<!DOCTYPE html><html><body>${html}</body></html>`], { type: "text/html" });
|
|
36050
|
+
const url = URL.createObjectURL(blob);
|
|
36051
|
+
const a = document.createElement("a");
|
|
36052
|
+
a.href = url;
|
|
36053
|
+
a.download = "document.html";
|
|
36054
|
+
a.click();
|
|
36055
|
+
URL.revokeObjectURL(url);
|
|
36056
|
+
}
|
|
36057
|
+
}
|
|
36058
|
+
}
|
|
36059
|
+
];
|
|
36060
|
+
}
|
|
36061
|
+
function buildEditMenuItems(t, editor) {
|
|
36062
|
+
return [
|
|
36063
|
+
{
|
|
36064
|
+
type: "action",
|
|
36065
|
+
label: t("menubar.undo"),
|
|
36066
|
+
icon: UndoIcon2,
|
|
36067
|
+
shortcut: t("menubar.undoShortcut"),
|
|
36068
|
+
onClick: () => editor.chain().focus().undo().run(),
|
|
36069
|
+
disabled: !editor.can().undo()
|
|
36070
|
+
},
|
|
36071
|
+
{
|
|
36072
|
+
type: "action",
|
|
36073
|
+
label: t("menubar.redo"),
|
|
36074
|
+
icon: RedoIcon2,
|
|
36075
|
+
shortcut: t("menubar.redoShortcut"),
|
|
36076
|
+
onClick: () => editor.chain().focus().redo().run(),
|
|
36077
|
+
disabled: !editor.can().redo()
|
|
36078
|
+
},
|
|
36079
|
+
{ type: "separator" },
|
|
36080
|
+
{
|
|
36081
|
+
type: "action",
|
|
36082
|
+
label: t("menubar.cut"),
|
|
36083
|
+
icon: Scissors,
|
|
36084
|
+
shortcut: t("menubar.cutShortcut"),
|
|
36085
|
+
onClick: () => document.execCommand("cut")
|
|
36086
|
+
},
|
|
36087
|
+
{
|
|
36088
|
+
type: "action",
|
|
36089
|
+
label: t("menubar.copy"),
|
|
36090
|
+
shortcut: t("menubar.copyShortcut"),
|
|
36091
|
+
onClick: () => document.execCommand("copy")
|
|
36092
|
+
},
|
|
36093
|
+
{
|
|
36094
|
+
type: "action",
|
|
36095
|
+
label: t("menubar.paste"),
|
|
36096
|
+
shortcut: t("menubar.pasteShortcut"),
|
|
36097
|
+
onClick: () => document.execCommand("paste")
|
|
36098
|
+
},
|
|
36099
|
+
{
|
|
36100
|
+
type: "action",
|
|
36101
|
+
label: t("menubar.pasteAsText"),
|
|
36102
|
+
onClick: async () => {
|
|
36103
|
+
try {
|
|
36104
|
+
const text = await navigator.clipboard.readText();
|
|
36105
|
+
editor.chain().focus().insertContent(text).run();
|
|
36106
|
+
} catch {
|
|
36107
|
+
document.execCommand("paste");
|
|
36108
|
+
}
|
|
36109
|
+
}
|
|
36110
|
+
},
|
|
36111
|
+
{ type: "separator" },
|
|
36112
|
+
{
|
|
36113
|
+
type: "action",
|
|
36114
|
+
label: t("menubar.selectAll"),
|
|
36115
|
+
shortcut: t("menubar.selectAllShortcut"),
|
|
36116
|
+
onClick: () => editor.chain().focus().selectAll().run()
|
|
36117
|
+
}
|
|
36118
|
+
];
|
|
36119
|
+
}
|
|
36120
|
+
function buildViewMenuItems(t, {
|
|
36121
|
+
containerRef,
|
|
36122
|
+
onSourceCode,
|
|
36123
|
+
openSourceDialog,
|
|
36124
|
+
onPreview,
|
|
36125
|
+
openPreviewDialog
|
|
36126
|
+
}) {
|
|
36127
|
+
return [
|
|
36128
|
+
{
|
|
36129
|
+
type: "action",
|
|
36130
|
+
label: t("menubar.sourceCode"),
|
|
36131
|
+
icon: FileCode4,
|
|
36132
|
+
onClick: () => onSourceCode ? onSourceCode() : openSourceDialog()
|
|
36133
|
+
},
|
|
36134
|
+
{
|
|
36135
|
+
type: "action",
|
|
36136
|
+
label: t("menubar.preview"),
|
|
36137
|
+
onClick: () => onPreview ? onPreview() : openPreviewDialog()
|
|
36138
|
+
},
|
|
36139
|
+
{ type: "separator" },
|
|
36140
|
+
{
|
|
36141
|
+
type: "action",
|
|
36142
|
+
label: t("menubar.fullscreen"),
|
|
36143
|
+
icon: Maximize22,
|
|
36144
|
+
shortcut: t("menubar.fullscreenShortcut"),
|
|
36145
|
+
onClick: () => {
|
|
36146
|
+
const el = containerRef.current;
|
|
36147
|
+
if (!el) return;
|
|
36148
|
+
if (!document.fullscreenElement) {
|
|
36149
|
+
el.requestFullscreen?.();
|
|
36150
|
+
} else {
|
|
36151
|
+
document.exitFullscreen?.();
|
|
36152
|
+
}
|
|
36153
|
+
}
|
|
36154
|
+
}
|
|
36155
|
+
];
|
|
36156
|
+
}
|
|
36157
|
+
function buildFormatMenuItems(t, editor) {
|
|
36158
|
+
return [
|
|
36159
|
+
{
|
|
36160
|
+
type: "action",
|
|
36161
|
+
label: t("menubar.bold"),
|
|
36162
|
+
icon: BoldIcon3,
|
|
36163
|
+
shortcut: t("menubar.boldShortcut"),
|
|
36164
|
+
active: editor.isActive("bold"),
|
|
36165
|
+
onClick: () => editor.chain().focus().toggleBold().run()
|
|
36166
|
+
},
|
|
36167
|
+
{
|
|
36168
|
+
type: "action",
|
|
36169
|
+
label: t("menubar.italic"),
|
|
36170
|
+
icon: ItalicIcon3,
|
|
36171
|
+
shortcut: t("menubar.italicShortcut"),
|
|
36172
|
+
active: editor.isActive("italic"),
|
|
36173
|
+
onClick: () => editor.chain().focus().toggleItalic().run()
|
|
36174
|
+
},
|
|
36175
|
+
{
|
|
36176
|
+
type: "action",
|
|
36177
|
+
label: t("menubar.underline"),
|
|
36178
|
+
icon: UnderlineIcon3,
|
|
36179
|
+
shortcut: t("menubar.underlineShortcut"),
|
|
36180
|
+
active: editor.isActive("underline"),
|
|
36181
|
+
onClick: () => editor.chain().focus().toggleUnderline().run()
|
|
36182
|
+
},
|
|
36183
|
+
{
|
|
36184
|
+
type: "action",
|
|
36185
|
+
label: t("menubar.strike"),
|
|
36186
|
+
icon: StrikethroughIcon3,
|
|
36187
|
+
active: editor.isActive("strike"),
|
|
36188
|
+
onClick: () => editor.chain().focus().toggleStrike().run()
|
|
36189
|
+
},
|
|
36190
|
+
{
|
|
36191
|
+
type: "action",
|
|
36192
|
+
label: t("menubar.superscript"),
|
|
36193
|
+
icon: SuperscriptIcon3,
|
|
36194
|
+
active: editor.isActive("superscript"),
|
|
36195
|
+
onClick: () => editor.chain().focus().toggleSuperscript().run()
|
|
36196
|
+
},
|
|
36197
|
+
{
|
|
36198
|
+
type: "action",
|
|
36199
|
+
label: t("menubar.subscript"),
|
|
36200
|
+
icon: SubscriptIcon3,
|
|
36201
|
+
active: editor.isActive("subscript"),
|
|
36202
|
+
onClick: () => editor.chain().focus().toggleSubscript().run()
|
|
36203
|
+
},
|
|
36204
|
+
{
|
|
36205
|
+
type: "action",
|
|
36206
|
+
label: t("menubar.code"),
|
|
36207
|
+
icon: CodeIcon3,
|
|
36208
|
+
active: editor.isActive("code"),
|
|
36209
|
+
onClick: () => editor.chain().focus().toggleCode().run()
|
|
36210
|
+
},
|
|
36211
|
+
{ type: "separator" },
|
|
36212
|
+
{
|
|
36213
|
+
type: "sub",
|
|
36214
|
+
label: t("menubar.wrap"),
|
|
36215
|
+
items: [
|
|
36216
|
+
{
|
|
36217
|
+
type: "action",
|
|
36218
|
+
label: t("menubar.paragraph"),
|
|
36219
|
+
active: editor.isActive("paragraph"),
|
|
36220
|
+
onClick: () => editor.chain().focus().setParagraph().run()
|
|
36221
|
+
},
|
|
36222
|
+
{
|
|
36223
|
+
type: "action",
|
|
36224
|
+
label: t("menubar.heading1"),
|
|
36225
|
+
icon: Heading1Icon2,
|
|
36226
|
+
active: editor.isActive("heading", { level: 1 }),
|
|
36227
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run()
|
|
36228
|
+
},
|
|
36229
|
+
{
|
|
36230
|
+
type: "action",
|
|
36231
|
+
label: t("menubar.heading2"),
|
|
36232
|
+
icon: Heading2Icon2,
|
|
36233
|
+
active: editor.isActive("heading", { level: 2 }),
|
|
36234
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run()
|
|
36235
|
+
},
|
|
36236
|
+
{
|
|
36237
|
+
type: "action",
|
|
36238
|
+
label: t("menubar.heading3"),
|
|
36239
|
+
icon: Heading3Icon2,
|
|
36240
|
+
active: editor.isActive("heading", { level: 3 }),
|
|
36241
|
+
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run()
|
|
36242
|
+
},
|
|
36243
|
+
{ type: "separator" },
|
|
36244
|
+
{
|
|
36245
|
+
type: "action",
|
|
36246
|
+
label: t("menubar.blockquote"),
|
|
36247
|
+
icon: QuoteIcon2,
|
|
36248
|
+
active: editor.isActive("blockquote"),
|
|
36249
|
+
onClick: () => editor.chain().focus().toggleBlockquote().run()
|
|
36250
|
+
},
|
|
36251
|
+
{
|
|
36252
|
+
type: "action",
|
|
36253
|
+
label: t("menubar.codeBlock"),
|
|
36254
|
+
icon: FileCode4,
|
|
36255
|
+
active: editor.isActive("codeBlock"),
|
|
36256
|
+
onClick: () => editor.chain().focus().toggleCodeBlock().run()
|
|
36257
|
+
},
|
|
36258
|
+
{
|
|
36259
|
+
type: "action",
|
|
36260
|
+
label: t("menubar.taskList"),
|
|
36261
|
+
icon: ListTodo3,
|
|
36262
|
+
active: editor.isActive("taskList"),
|
|
36263
|
+
onClick: () => editor.chain().focus().toggleTaskList().run()
|
|
36264
|
+
}
|
|
36265
|
+
]
|
|
36266
|
+
},
|
|
36267
|
+
{
|
|
36268
|
+
type: "sub",
|
|
36269
|
+
label: t("menubar.align"),
|
|
36270
|
+
items: [
|
|
36271
|
+
{
|
|
36272
|
+
type: "action",
|
|
36273
|
+
label: t("menubar.alignLeft"),
|
|
36274
|
+
icon: AlignLeft4,
|
|
36275
|
+
active: editor.isActive({ textAlign: "left" }),
|
|
36276
|
+
onClick: () => editor.chain().focus().setTextAlign("left").run()
|
|
36277
|
+
},
|
|
36278
|
+
{
|
|
36279
|
+
type: "action",
|
|
36280
|
+
label: t("menubar.alignCenter"),
|
|
36281
|
+
icon: AlignCenter4,
|
|
36282
|
+
active: editor.isActive({ textAlign: "center" }),
|
|
36283
|
+
onClick: () => editor.chain().focus().setTextAlign("center").run()
|
|
36284
|
+
},
|
|
36285
|
+
{
|
|
36286
|
+
type: "action",
|
|
36287
|
+
label: t("menubar.alignRight"),
|
|
36288
|
+
icon: AlignRight4,
|
|
36289
|
+
active: editor.isActive({ textAlign: "right" }),
|
|
36290
|
+
onClick: () => editor.chain().focus().setTextAlign("right").run()
|
|
36291
|
+
},
|
|
36292
|
+
{
|
|
36293
|
+
type: "action",
|
|
36294
|
+
label: t("menubar.alignJustify"),
|
|
36295
|
+
icon: AlignJustify2,
|
|
36296
|
+
active: editor.isActive({ textAlign: "justify" }),
|
|
36297
|
+
onClick: () => editor.chain().focus().setTextAlign("justify").run()
|
|
36298
|
+
}
|
|
36299
|
+
]
|
|
36300
|
+
},
|
|
36301
|
+
{ type: "separator" },
|
|
36302
|
+
{
|
|
36303
|
+
type: "action",
|
|
36304
|
+
label: t("menubar.clearFormatting"),
|
|
36305
|
+
onClick: () => editor.chain().focus().unsetAllMarks().clearNodes().run()
|
|
36306
|
+
}
|
|
36307
|
+
];
|
|
36308
|
+
}
|
|
36309
|
+
function buildToolsMenuItems(t, { onSourceCode, openSourceDialog }) {
|
|
36310
|
+
return [
|
|
36311
|
+
{
|
|
36312
|
+
type: "action",
|
|
36313
|
+
label: t("menubar.sourceCode"),
|
|
36314
|
+
icon: FileCode4,
|
|
36315
|
+
onClick: () => onSourceCode ? onSourceCode() : openSourceDialog()
|
|
36316
|
+
}
|
|
36317
|
+
];
|
|
36318
|
+
}
|
|
36319
|
+
function buildTableMenuItems(t, editor, onInsertTable) {
|
|
36320
|
+
const inTable = getTableAnchorPos(editor) !== null;
|
|
36321
|
+
return [
|
|
36322
|
+
{
|
|
36323
|
+
type: "sub",
|
|
36324
|
+
label: t("menubar.insertTable"),
|
|
36325
|
+
icon: TableIcon3,
|
|
36326
|
+
items: [
|
|
36327
|
+
{
|
|
36328
|
+
type: "custom",
|
|
36329
|
+
key: "table-insert-grid",
|
|
36330
|
+
render: () => /* @__PURE__ */ jsx92(
|
|
36331
|
+
TableInsertGrid,
|
|
36332
|
+
{
|
|
36333
|
+
insertLabel: t("tableMenu.insertTable"),
|
|
36334
|
+
previewTemplate: t("tableMenu.gridPreview"),
|
|
36335
|
+
onInsert: onInsertTable
|
|
36336
|
+
}
|
|
36337
|
+
)
|
|
36338
|
+
}
|
|
36339
|
+
]
|
|
36340
|
+
},
|
|
36341
|
+
{
|
|
36342
|
+
type: "action",
|
|
36343
|
+
label: t("menubar.tableProperties"),
|
|
36344
|
+
disabled: true,
|
|
36345
|
+
onClick: () => {
|
|
36346
|
+
}
|
|
36347
|
+
},
|
|
36348
|
+
{
|
|
36349
|
+
type: "action",
|
|
36350
|
+
label: t("menubar.deleteTable"),
|
|
36351
|
+
icon: Trash25,
|
|
36352
|
+
destructive: true,
|
|
36353
|
+
disabled: !inTable,
|
|
36354
|
+
onClick: () => editor.chain().focus().deleteTable().run()
|
|
36355
|
+
},
|
|
36356
|
+
{ type: "separator" },
|
|
36357
|
+
{
|
|
36358
|
+
type: "sub",
|
|
36359
|
+
label: t("menubar.row"),
|
|
36360
|
+
disabled: !inTable,
|
|
36361
|
+
items: [
|
|
36362
|
+
{
|
|
36363
|
+
type: "action",
|
|
36364
|
+
label: t("menubar.addRowBefore"),
|
|
36365
|
+
onClick: () => editor.chain().focus().addRowBefore().run()
|
|
36366
|
+
},
|
|
36367
|
+
{
|
|
36368
|
+
type: "action",
|
|
36369
|
+
label: t("menubar.addRowAfter"),
|
|
36370
|
+
onClick: () => editor.chain().focus().addRowAfter().run()
|
|
36371
|
+
},
|
|
36372
|
+
{ type: "separator" },
|
|
36373
|
+
{
|
|
36374
|
+
type: "action",
|
|
36375
|
+
label: t("menubar.deleteRow"),
|
|
36376
|
+
destructive: true,
|
|
36377
|
+
onClick: () => editor.chain().focus().deleteRow().run()
|
|
36378
|
+
}
|
|
36379
|
+
]
|
|
36380
|
+
},
|
|
36381
|
+
{
|
|
36382
|
+
type: "sub",
|
|
36383
|
+
label: t("menubar.column"),
|
|
36384
|
+
disabled: !inTable,
|
|
36385
|
+
items: [
|
|
36386
|
+
{
|
|
36387
|
+
type: "action",
|
|
36388
|
+
label: t("menubar.addColumnBefore"),
|
|
36389
|
+
onClick: () => editor.chain().focus().addColumnBefore().run()
|
|
36390
|
+
},
|
|
36391
|
+
{
|
|
36392
|
+
type: "action",
|
|
36393
|
+
label: t("menubar.addColumnAfter"),
|
|
36394
|
+
onClick: () => editor.chain().focus().addColumnAfter().run()
|
|
36395
|
+
},
|
|
36396
|
+
{ type: "separator" },
|
|
36397
|
+
{
|
|
36398
|
+
type: "action",
|
|
36399
|
+
label: t("menubar.deleteColumn"),
|
|
36400
|
+
destructive: true,
|
|
36401
|
+
onClick: () => editor.chain().focus().deleteColumn().run()
|
|
36402
|
+
}
|
|
36403
|
+
]
|
|
36404
|
+
},
|
|
36405
|
+
{
|
|
36406
|
+
type: "sub",
|
|
36407
|
+
label: t("menubar.cell"),
|
|
36408
|
+
disabled: !inTable,
|
|
36409
|
+
items: [
|
|
36410
|
+
{
|
|
36411
|
+
type: "action",
|
|
36412
|
+
label: t("menubar.mergeCells"),
|
|
36413
|
+
onClick: () => editor.chain().focus().mergeCells().run(),
|
|
36414
|
+
disabled: !editor.can().mergeCells()
|
|
36415
|
+
},
|
|
36416
|
+
{
|
|
36417
|
+
type: "action",
|
|
36418
|
+
label: t("menubar.splitCell"),
|
|
36419
|
+
onClick: () => editor.chain().focus().splitCell().run(),
|
|
36420
|
+
disabled: !editor.can().splitCell()
|
|
36421
|
+
}
|
|
36422
|
+
]
|
|
36423
|
+
}
|
|
36424
|
+
];
|
|
36425
|
+
}
|
|
36426
|
+
var MenuBarTrigger = React81.forwardRef(
|
|
36427
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx92(
|
|
36428
|
+
"button",
|
|
36429
|
+
{
|
|
36430
|
+
ref,
|
|
36431
|
+
type: "button",
|
|
36432
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
36433
|
+
className: cn(
|
|
36434
|
+
"px-2 py-0.5 rounded text-sm transition-colors cursor-pointer",
|
|
36435
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
36436
|
+
"focus:outline-none focus:bg-accent focus:text-accent-foreground",
|
|
36437
|
+
className
|
|
36438
|
+
),
|
|
36439
|
+
...props,
|
|
36440
|
+
children
|
|
36441
|
+
}
|
|
36442
|
+
)
|
|
36443
|
+
);
|
|
36444
|
+
MenuBarTrigger.displayName = "MenuBarTrigger";
|
|
36445
|
+
var MenuBar = ({
|
|
36446
|
+
editor,
|
|
36447
|
+
containerRef,
|
|
36448
|
+
uploadImage,
|
|
36449
|
+
imageInsertMode = "base64",
|
|
36450
|
+
maxImageFileSize = DEFAULT_UEDITOR_IMAGE_MAX_FILE_SIZE,
|
|
36451
|
+
allowedImageMimeTypes = DEFAULT_UEDITOR_IMAGE_MIME_TYPES,
|
|
36452
|
+
onSave,
|
|
36453
|
+
onExport,
|
|
36454
|
+
onSourceCode,
|
|
36455
|
+
onPreview
|
|
36456
|
+
}) => {
|
|
36457
|
+
const t = useSmartTranslations("UEditor");
|
|
36458
|
+
useEditorState3({
|
|
36459
|
+
editor,
|
|
36460
|
+
selector: ({ transactionNumber }) => transactionNumber
|
|
36461
|
+
});
|
|
36462
|
+
const fileInputRef = useRef36(null);
|
|
36463
|
+
const [showImageInput, setShowImageInput] = useState49(false);
|
|
36464
|
+
const [showLinkInput, setShowLinkInput] = useState49(false);
|
|
36465
|
+
const [isInsertMenuOpen, setIsInsertMenuOpen] = useState49(false);
|
|
36466
|
+
const [showSourceDialog, setShowSourceDialog] = useState49(false);
|
|
36467
|
+
const [sourceHtml, setSourceHtml] = useState49("");
|
|
36468
|
+
const [showPreviewDialog, setShowPreviewDialog] = useState49(false);
|
|
36469
|
+
const openSourceDialog = () => {
|
|
36470
|
+
setSourceHtml(editor.getHTML());
|
|
36471
|
+
setShowSourceDialog(true);
|
|
36472
|
+
};
|
|
36473
|
+
const openPreviewDialog = () => {
|
|
36474
|
+
setShowPreviewDialog(true);
|
|
36475
|
+
};
|
|
36476
|
+
const applySourceHtml = () => {
|
|
36477
|
+
editor.chain().focus().setContent(sourceHtml).run();
|
|
36478
|
+
setShowSourceDialog(false);
|
|
36479
|
+
};
|
|
36480
|
+
const closeInsertMenu = () => {
|
|
36481
|
+
setIsInsertMenuOpen(false);
|
|
36482
|
+
setShowImageInput(false);
|
|
36483
|
+
setShowLinkInput(false);
|
|
36484
|
+
};
|
|
36485
|
+
const handleImageUrl = (url, alt) => {
|
|
36486
|
+
const safe = sanitizeUEditorUrl(url, "image");
|
|
36487
|
+
if (safe) {
|
|
36488
|
+
editor.chain().focus().setImage({ src: safe, alt: alt ?? "" }).run();
|
|
36489
|
+
editor.commands.createParagraphNear();
|
|
36490
|
+
}
|
|
36491
|
+
closeInsertMenu();
|
|
36492
|
+
};
|
|
36493
|
+
const handleImageFiles = async (files) => {
|
|
36494
|
+
if (!files?.length) return;
|
|
36495
|
+
for (const file of Array.from(files)) {
|
|
36496
|
+
if (!file.type.startsWith("image/")) continue;
|
|
36497
|
+
if (file.size > maxImageFileSize) continue;
|
|
36498
|
+
if (allowedImageMimeTypes.length > 0 && !allowedImageMimeTypes.includes(file.type)) continue;
|
|
36499
|
+
try {
|
|
36500
|
+
const src = imageInsertMode === "upload" && uploadImage ? await uploadImage(file) : await fileToDataUrl2(file);
|
|
36501
|
+
const safe = sanitizeUEditorUrl(src, "image");
|
|
36502
|
+
if (!safe) continue;
|
|
36503
|
+
editor.chain().focus().setImage({ src: safe, alt: file.name }).run();
|
|
36504
|
+
editor.commands.createParagraphNear();
|
|
36505
|
+
} catch {
|
|
36506
|
+
}
|
|
36507
|
+
}
|
|
36508
|
+
setIsInsertMenuOpen(false);
|
|
36509
|
+
};
|
|
36510
|
+
const handleInsertTable = (rows, cols) => {
|
|
36511
|
+
editor.chain().focus().insertTable({ rows, cols, withHeaderRow: true }).run();
|
|
36512
|
+
closeInsertMenu();
|
|
36513
|
+
};
|
|
36514
|
+
const handleLinkSubmit = (url) => {
|
|
36515
|
+
editor.chain().focus().setLink({ href: url }).run();
|
|
36516
|
+
closeInsertMenu();
|
|
36517
|
+
};
|
|
36518
|
+
const insertMenuItems = [
|
|
36519
|
+
{
|
|
36520
|
+
type: "custom",
|
|
36521
|
+
key: "image",
|
|
36522
|
+
render: () => showImageInput ? /* @__PURE__ */ jsx92(ImageInput, { onSubmit: handleImageUrl, onCancel: () => setShowImageInput(false) }) : /* @__PURE__ */ jsxs77(Fragment35, { children: [
|
|
36523
|
+
/* @__PURE__ */ jsx92(DropdownMenuItem, { label: t("menubar.image"), icon: ImageIcon3, onClick: () => setShowImageInput(true) }),
|
|
36524
|
+
/* @__PURE__ */ jsx92(
|
|
36525
|
+
DropdownMenuItem,
|
|
36526
|
+
{
|
|
36527
|
+
label: t("menubar.imageUpload"),
|
|
36528
|
+
icon: Upload4,
|
|
36529
|
+
onClick: () => fileInputRef.current?.click()
|
|
36530
|
+
}
|
|
36531
|
+
)
|
|
36532
|
+
] })
|
|
36533
|
+
},
|
|
36534
|
+
{ type: "separator" },
|
|
36535
|
+
{
|
|
36536
|
+
type: "custom",
|
|
36537
|
+
key: "link",
|
|
36538
|
+
render: () => showLinkInput ? /* @__PURE__ */ jsx92(LinkInput, { onSubmit: handleLinkSubmit, onCancel: () => setShowLinkInput(false), initialUrl: editor.getAttributes("link").href ?? "" }) : /* @__PURE__ */ jsx92(
|
|
36539
|
+
DropdownMenuItem,
|
|
36540
|
+
{
|
|
36541
|
+
label: t("menubar.link"),
|
|
36542
|
+
icon: LinkIcon3,
|
|
36543
|
+
shortcut: t("menubar.linkShortcut"),
|
|
36544
|
+
onClick: () => setShowLinkInput(true)
|
|
36545
|
+
}
|
|
36546
|
+
)
|
|
36547
|
+
},
|
|
36548
|
+
{ type: "separator" },
|
|
36549
|
+
{
|
|
36550
|
+
type: "sub",
|
|
36551
|
+
label: t("menubar.insertTable"),
|
|
36552
|
+
icon: TableIcon3,
|
|
36553
|
+
items: [
|
|
36554
|
+
{
|
|
36555
|
+
type: "custom",
|
|
36556
|
+
key: "table-grid",
|
|
36557
|
+
render: () => /* @__PURE__ */ jsx92(
|
|
36558
|
+
TableInsertGrid,
|
|
36559
|
+
{
|
|
36560
|
+
insertLabel: t("tableMenu.insertTable"),
|
|
36561
|
+
previewTemplate: t("tableMenu.gridPreview"),
|
|
36562
|
+
onInsert: handleInsertTable
|
|
36563
|
+
}
|
|
36564
|
+
)
|
|
36565
|
+
}
|
|
36566
|
+
]
|
|
36567
|
+
},
|
|
36568
|
+
{ type: "separator" },
|
|
36569
|
+
{
|
|
36570
|
+
type: "action",
|
|
36571
|
+
label: t("menubar.horizontalRule"),
|
|
36572
|
+
onClick: () => editor.chain().focus().setHorizontalRule().run()
|
|
36573
|
+
}
|
|
36574
|
+
];
|
|
36575
|
+
const menus = [
|
|
36576
|
+
{
|
|
36577
|
+
label: t("menubar.file"),
|
|
36578
|
+
items: buildFileMenuItems(t, editor, { onSave, onExport }),
|
|
36579
|
+
open: void 0,
|
|
36580
|
+
onOpenChange: void 0
|
|
36581
|
+
},
|
|
36582
|
+
{ label: t("menubar.edit"), items: buildEditMenuItems(t, editor), open: void 0, onOpenChange: void 0 },
|
|
36583
|
+
{
|
|
36584
|
+
label: t("menubar.view"),
|
|
36585
|
+
items: buildViewMenuItems(t, { containerRef, onSourceCode, openSourceDialog, onPreview, openPreviewDialog }),
|
|
36586
|
+
open: void 0,
|
|
36587
|
+
onOpenChange: void 0
|
|
36588
|
+
},
|
|
36589
|
+
{
|
|
36590
|
+
label: t("menubar.insert"),
|
|
36591
|
+
items: insertMenuItems,
|
|
36592
|
+
open: isInsertMenuOpen,
|
|
36593
|
+
onOpenChange: (open) => {
|
|
36594
|
+
setIsInsertMenuOpen(open);
|
|
36595
|
+
if (!open) {
|
|
36596
|
+
setShowImageInput(false);
|
|
36597
|
+
setShowLinkInput(false);
|
|
36598
|
+
}
|
|
36599
|
+
}
|
|
36600
|
+
},
|
|
36601
|
+
{ label: t("menubar.format"), items: buildFormatMenuItems(t, editor), open: void 0, onOpenChange: void 0 },
|
|
36602
|
+
{
|
|
36603
|
+
label: t("menubar.tools"),
|
|
36604
|
+
items: buildToolsMenuItems(t, { onSourceCode, openSourceDialog }),
|
|
36605
|
+
open: void 0,
|
|
36606
|
+
onOpenChange: void 0
|
|
36607
|
+
},
|
|
36608
|
+
{ label: t("menubar.table"), items: buildTableMenuItems(t, editor, handleInsertTable), open: void 0, onOpenChange: void 0 }
|
|
36609
|
+
];
|
|
36610
|
+
return /* @__PURE__ */ jsxs77(Fragment35, { children: [
|
|
36611
|
+
/* @__PURE__ */ jsx92(
|
|
36612
|
+
"input",
|
|
36613
|
+
{
|
|
36614
|
+
ref: fileInputRef,
|
|
36615
|
+
type: "file",
|
|
36616
|
+
accept: allowedImageMimeTypes.join(","),
|
|
36617
|
+
multiple: true,
|
|
36618
|
+
className: "hidden",
|
|
36619
|
+
onChange: (e) => handleImageFiles(e.target.files)
|
|
36620
|
+
}
|
|
36621
|
+
),
|
|
36622
|
+
/* @__PURE__ */ jsx92("div", { className: "flex items-center gap-0.5 border-b border-border/35 bg-muted/20 px-1.5 py-0.5", children: menus.map(({ label, items, open, onOpenChange }) => /* @__PURE__ */ jsx92(
|
|
36623
|
+
DropdownMenu,
|
|
36624
|
+
{
|
|
36625
|
+
trigger: /* @__PURE__ */ jsx92(MenuBarTrigger, { children: label }),
|
|
36626
|
+
placement: "bottom-start",
|
|
36627
|
+
isOpen: open,
|
|
36628
|
+
onOpenChange,
|
|
36629
|
+
children: renderMenuItems(items)
|
|
36630
|
+
},
|
|
36631
|
+
label
|
|
36632
|
+
)) }),
|
|
36633
|
+
/* @__PURE__ */ jsx92(
|
|
36634
|
+
Modal_default,
|
|
36635
|
+
{
|
|
36636
|
+
isOpen: showSourceDialog,
|
|
36637
|
+
onClose: () => setShowSourceDialog(false),
|
|
36638
|
+
title: t("menubar.sourceCode"),
|
|
36639
|
+
size: "lg",
|
|
36640
|
+
children: /* @__PURE__ */ jsxs77("div", { className: "space-y-3", children: [
|
|
36641
|
+
/* @__PURE__ */ jsx92("p", { className: "text-xs text-muted-foreground", children: t("menubar.sourceCodeHint") }),
|
|
36642
|
+
/* @__PURE__ */ jsx92(
|
|
36643
|
+
"textarea",
|
|
36644
|
+
{
|
|
36645
|
+
"data-testid": "source-code-textarea",
|
|
36646
|
+
className: "w-full h-64 font-mono text-xs p-3 bg-muted rounded-lg border border-border resize-y focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
36647
|
+
value: sourceHtml,
|
|
36648
|
+
onChange: (e) => setSourceHtml(e.target.value),
|
|
36649
|
+
spellCheck: false
|
|
36650
|
+
}
|
|
36651
|
+
),
|
|
36652
|
+
/* @__PURE__ */ jsxs77("div", { className: "flex gap-2 justify-end", children: [
|
|
36653
|
+
/* @__PURE__ */ jsx92(
|
|
36654
|
+
"button",
|
|
36655
|
+
{
|
|
36656
|
+
type: "button",
|
|
36657
|
+
onClick: applySourceHtml,
|
|
36658
|
+
className: "px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm hover:bg-primary/90 transition-colors",
|
|
36659
|
+
children: t("menubar.applySource")
|
|
36660
|
+
}
|
|
36661
|
+
),
|
|
36662
|
+
/* @__PURE__ */ jsx92(
|
|
36663
|
+
"button",
|
|
36664
|
+
{
|
|
36665
|
+
type: "button",
|
|
36666
|
+
onClick: () => setShowSourceDialog(false),
|
|
36667
|
+
className: "px-4 py-2 bg-muted rounded-lg text-sm hover:bg-accent transition-colors",
|
|
36668
|
+
children: t("menubar.closeDialog")
|
|
36669
|
+
}
|
|
36670
|
+
)
|
|
36671
|
+
] })
|
|
36672
|
+
] })
|
|
36673
|
+
}
|
|
36674
|
+
),
|
|
36675
|
+
/* @__PURE__ */ jsx92(
|
|
36676
|
+
Modal_default,
|
|
36677
|
+
{
|
|
36678
|
+
isOpen: showPreviewDialog,
|
|
36679
|
+
onClose: () => setShowPreviewDialog(false),
|
|
36680
|
+
title: t("menubar.preview"),
|
|
36681
|
+
size: "lg",
|
|
36682
|
+
children: editor.isEmpty ? /* @__PURE__ */ jsx92("p", { className: "text-muted-foreground text-sm", children: t("menubar.previewEmpty") }) : /* @__PURE__ */ jsx92(
|
|
36683
|
+
"div",
|
|
36684
|
+
{
|
|
36685
|
+
"data-testid": "preview-content",
|
|
36686
|
+
className: "prose prose-sm sm:prose dark:prose-invert max-w-none p-2",
|
|
36687
|
+
dangerouslySetInnerHTML: { __html: editor.getHTML() }
|
|
36688
|
+
}
|
|
36689
|
+
)
|
|
36690
|
+
}
|
|
36691
|
+
)
|
|
36692
|
+
] });
|
|
36693
|
+
};
|
|
36694
|
+
|
|
35639
36695
|
// src/components/UEditor/UEditor.tsx
|
|
35640
|
-
import { jsx as
|
|
35641
|
-
var UEditor =
|
|
36696
|
+
import { jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
36697
|
+
var UEditor = React82.forwardRef(({
|
|
35642
36698
|
content = "",
|
|
35643
36699
|
onChange,
|
|
35644
36700
|
onHtmlChange,
|
|
@@ -35670,12 +36726,17 @@ var UEditor = React81.forwardRef(({
|
|
|
35670
36726
|
uploadFile,
|
|
35671
36727
|
uploadFileForSave,
|
|
35672
36728
|
collaborationOptions,
|
|
35673
|
-
extraExtensions
|
|
36729
|
+
extraExtensions,
|
|
36730
|
+
showMenuBar = false,
|
|
36731
|
+
onSave,
|
|
36732
|
+
onExport,
|
|
36733
|
+
onSourceCode,
|
|
36734
|
+
onPreview
|
|
35674
36735
|
}, ref) => {
|
|
35675
36736
|
const t = useSmartTranslations("UEditor");
|
|
35676
36737
|
const effectivePlaceholder = placeholder ?? t("placeholder");
|
|
35677
|
-
const inFlightPrepareRef =
|
|
35678
|
-
const lastAppliedContentRef =
|
|
36738
|
+
const inFlightPrepareRef = useRef37(null);
|
|
36739
|
+
const lastAppliedContentRef = useRef37(content ?? "");
|
|
35679
36740
|
const resolvedUploadFile = useMemo24(() => {
|
|
35680
36741
|
if (uploadFile) return uploadFile;
|
|
35681
36742
|
if (uploadFileForSave) {
|
|
@@ -35791,7 +36852,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35791
36852
|
}
|
|
35792
36853
|
}, [content, editor]);
|
|
35793
36854
|
if (!editor) {
|
|
35794
|
-
return /* @__PURE__ */
|
|
36855
|
+
return /* @__PURE__ */ jsx93(
|
|
35795
36856
|
"div",
|
|
35796
36857
|
{
|
|
35797
36858
|
className: cn("w-full rounded-lg border bg-background flex items-center justify-center text-muted-foreground", className),
|
|
@@ -35800,7 +36861,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35800
36861
|
}
|
|
35801
36862
|
);
|
|
35802
36863
|
}
|
|
35803
|
-
return /* @__PURE__ */
|
|
36864
|
+
return /* @__PURE__ */ jsxs78(
|
|
35804
36865
|
"div",
|
|
35805
36866
|
{
|
|
35806
36867
|
className: cn(
|
|
@@ -35815,7 +36876,22 @@ var UEditor = React81.forwardRef(({
|
|
|
35815
36876
|
className
|
|
35816
36877
|
),
|
|
35817
36878
|
children: [
|
|
35818
|
-
editable &&
|
|
36879
|
+
editable && showMenuBar && /* @__PURE__ */ jsx93(
|
|
36880
|
+
MenuBar,
|
|
36881
|
+
{
|
|
36882
|
+
editor,
|
|
36883
|
+
containerRef: editorContentRef,
|
|
36884
|
+
uploadImage,
|
|
36885
|
+
imageInsertMode,
|
|
36886
|
+
maxImageFileSize,
|
|
36887
|
+
allowedImageMimeTypes,
|
|
36888
|
+
onSave,
|
|
36889
|
+
onExport,
|
|
36890
|
+
onSourceCode,
|
|
36891
|
+
onPreview
|
|
36892
|
+
}
|
|
36893
|
+
),
|
|
36894
|
+
editable && showToolbar && /* @__PURE__ */ jsx93(
|
|
35819
36895
|
EditorToolbar,
|
|
35820
36896
|
{
|
|
35821
36897
|
editor,
|
|
@@ -35830,7 +36906,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35830
36906
|
letterSpacings
|
|
35831
36907
|
}
|
|
35832
36908
|
),
|
|
35833
|
-
editable && showBubbleMenu && /* @__PURE__ */
|
|
36909
|
+
editable && showBubbleMenu && /* @__PURE__ */ jsx93(
|
|
35834
36910
|
CustomBubbleMenu,
|
|
35835
36911
|
{
|
|
35836
36912
|
editor,
|
|
@@ -35838,8 +36914,8 @@ var UEditor = React81.forwardRef(({
|
|
|
35838
36914
|
lineHeights
|
|
35839
36915
|
}
|
|
35840
36916
|
),
|
|
35841
|
-
editable && showFloatingMenu && /* @__PURE__ */
|
|
35842
|
-
/* @__PURE__ */
|
|
36917
|
+
editable && showFloatingMenu && /* @__PURE__ */ jsx93(CustomFloatingMenu, { editor }),
|
|
36918
|
+
/* @__PURE__ */ jsxs78(
|
|
35843
36919
|
"div",
|
|
35844
36920
|
{
|
|
35845
36921
|
ref: editorContentRef,
|
|
@@ -35849,7 +36925,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35849
36925
|
maxHeight
|
|
35850
36926
|
},
|
|
35851
36927
|
children: [
|
|
35852
|
-
/* @__PURE__ */
|
|
36928
|
+
/* @__PURE__ */ jsx93(
|
|
35853
36929
|
"span",
|
|
35854
36930
|
{
|
|
35855
36931
|
ref: tableColumnGuideRef,
|
|
@@ -35857,7 +36933,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35857
36933
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
35858
36934
|
}
|
|
35859
36935
|
),
|
|
35860
|
-
/* @__PURE__ */
|
|
36936
|
+
/* @__PURE__ */ jsx93(
|
|
35861
36937
|
"span",
|
|
35862
36938
|
{
|
|
35863
36939
|
ref: tableRowGuideRef,
|
|
@@ -35865,7 +36941,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35865
36941
|
className: "pointer-events-none absolute z-20 bg-primary opacity-0 transition-opacity duration-100"
|
|
35866
36942
|
}
|
|
35867
36943
|
),
|
|
35868
|
-
/* @__PURE__ */
|
|
36944
|
+
/* @__PURE__ */ jsx93(
|
|
35869
36945
|
"span",
|
|
35870
36946
|
{
|
|
35871
36947
|
ref: activeTableCellHighlightRef,
|
|
@@ -35874,8 +36950,8 @@ var UEditor = React81.forwardRef(({
|
|
|
35874
36950
|
className: "pointer-events-none hidden absolute z-20 rounded-[2px] border-2 border-primary bg-primary/10 transition-[left,top,width,height] duration-100"
|
|
35875
36951
|
}
|
|
35876
36952
|
),
|
|
35877
|
-
editable && /* @__PURE__ */
|
|
35878
|
-
/* @__PURE__ */
|
|
36953
|
+
editable && /* @__PURE__ */ jsx93(TableControls, { editor, containerRef: editorContentRef }),
|
|
36954
|
+
/* @__PURE__ */ jsx93(
|
|
35879
36955
|
EditorContent,
|
|
35880
36956
|
{
|
|
35881
36957
|
editor,
|
|
@@ -35885,7 +36961,7 @@ var UEditor = React81.forwardRef(({
|
|
|
35885
36961
|
]
|
|
35886
36962
|
}
|
|
35887
36963
|
),
|
|
35888
|
-
showCharacterCount && /* @__PURE__ */
|
|
36964
|
+
showCharacterCount && /* @__PURE__ */ jsx93(CharacterCountDisplay, { editor, maxCharacters })
|
|
35889
36965
|
]
|
|
35890
36966
|
}
|
|
35891
36967
|
);
|