@notectl/core 1.0.9 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AttrRegistry-D-przlzb.mjs → AttrRegistry-I-VdmRnN.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-D-przlzb.mjs.map → AttrRegistry-I-VdmRnN.mjs.map} +1 -1
- package/dist/chunks/CaretNavigation-CAJXoaae.mjs +311 -0
- package/dist/chunks/CaretNavigation-CAJXoaae.mjs.map +1 -0
- package/dist/chunks/ColorNames-BdsHwA2f.mjs +59 -0
- package/dist/chunks/ColorNames-BdsHwA2f.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs +125 -0
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs.map +1 -0
- package/dist/chunks/Commands-CicwYoTQ.mjs +286 -0
- package/dist/chunks/Commands-CicwYoTQ.mjs.map +1 -0
- package/dist/chunks/{Document-CI3iCwEP.mjs → Document-CuwE73FF.mjs} +35 -22
- package/dist/chunks/{Document-CI3iCwEP.mjs.map → Document-CuwE73FF.mjs.map} +1 -1
- package/dist/chunks/HTMLUtils-DTqQzcKR.mjs +35 -0
- package/dist/chunks/HTMLUtils-DTqQzcKR.mjs.map +1 -0
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs +94 -0
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs.map +1 -0
- package/dist/chunks/NavigationUtils-CyW0Vo8A.mjs +47 -0
- package/dist/chunks/NavigationUtils-CyW0Vo8A.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-D68ZLXti.mjs → NodeResolver-B-wzthAQ.mjs} +2 -2
- package/dist/chunks/{NodeResolver-D68ZLXti.mjs.map → NodeResolver-B-wzthAQ.mjs.map} +1 -1
- package/dist/chunks/Platform-S_xqIqcM.mjs +26 -0
- package/dist/chunks/Platform-S_xqIqcM.mjs.map +1 -0
- package/dist/chunks/Selection-DmFDwiPJ.mjs +52 -0
- package/dist/chunks/Selection-DmFDwiPJ.mjs.map +1 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs +8 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -0
- package/dist/chunks/{ToolbarPlugin-DFkl1uYO.mjs → ToolbarPlugin-B6JETWaw.mjs} +3 -3
- package/dist/chunks/{ToolbarPlugin-DFkl1uYO.mjs.map → ToolbarPlugin-B6JETWaw.mjs.map} +1 -1
- package/dist/chunks/index--z_Txzej.mjs +467 -0
- package/dist/chunks/index--z_Txzej.mjs.map +1 -0
- package/dist/chunks/{index-o6hDR07y.mjs → index-83QoUENW.mjs} +25 -20
- package/dist/chunks/index-83QoUENW.mjs.map +1 -0
- package/dist/chunks/{index-DfO_fKw6.mjs → index-B0UFAfyb.mjs} +15 -15
- package/dist/chunks/{index-DfO_fKw6.mjs.map → index-B0UFAfyb.mjs.map} +1 -1
- package/dist/chunks/{index-BFsYGsBR.mjs → index-BDMP86F4.mjs} +39 -39
- package/dist/chunks/{index-BFsYGsBR.mjs.map → index-BDMP86F4.mjs.map} +1 -1
- package/dist/chunks/{index-Bsp4LC5t.mjs → index-BWXkaC2Z.mjs} +36 -36
- package/dist/chunks/index-BWXkaC2Z.mjs.map +1 -0
- package/dist/chunks/{index-DAFCISBN.mjs → index-BigJ0z6n.mjs} +3 -3
- package/dist/chunks/{index-DAFCISBN.mjs.map → index-BigJ0z6n.mjs.map} +1 -1
- package/dist/chunks/{index-uTnc9y7M.mjs → index-CPjf45-o.mjs} +28 -28
- package/dist/chunks/index-CPjf45-o.mjs.map +1 -0
- package/dist/chunks/{index-DGrRWMlW.mjs → index-CPyHuEzh.mjs} +105 -105
- package/dist/chunks/index-CPyHuEzh.mjs.map +1 -0
- package/dist/chunks/{index-BL56fbXt.mjs → index-D4GKlc-A.mjs} +89 -87
- package/dist/chunks/index-D4GKlc-A.mjs.map +1 -0
- package/dist/chunks/{index-BRYzYOYC.mjs → index-D67mP19g.mjs} +29 -29
- package/dist/chunks/index-D67mP19g.mjs.map +1 -0
- package/dist/chunks/{index-BIL37LSL.mjs → index-D8tbbW97.mjs} +18 -18
- package/dist/chunks/{index-BIL37LSL.mjs.map → index-D8tbbW97.mjs.map} +1 -1
- package/dist/chunks/{index-DC1EK22F.mjs → index-DIAXWwgJ.mjs} +24 -19
- package/dist/chunks/index-DIAXWwgJ.mjs.map +1 -0
- package/dist/chunks/{index-BSFLNveF.mjs → index-DQryjfJs.mjs} +352 -341
- package/dist/chunks/index-DQryjfJs.mjs.map +1 -0
- package/dist/chunks/{index-BTJfyJlJ.mjs → index-DRZwd-1W.mjs} +104 -104
- package/dist/chunks/index-DRZwd-1W.mjs.map +1 -0
- package/dist/chunks/{index-BQ8iIYLn.mjs → index-DUC1X43Z.mjs} +54 -54
- package/dist/chunks/index-DUC1X43Z.mjs.map +1 -0
- package/dist/chunks/{index-BCvuDpVr.mjs → index-DipAT_Q9.mjs} +31 -31
- package/dist/chunks/index-DipAT_Q9.mjs.map +1 -0
- package/dist/chunks/{index-DA8TG2S8.mjs → index-tBDVaSjG.mjs} +56 -56
- package/dist/chunks/index-tBDVaSjG.mjs.map +1 -0
- package/dist/chunks/resolvePluginLocale-B4w1OkPy.mjs.map +1 -1
- package/dist/commands/Commands.d.ts +13 -45
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/DeleteCommands.d.ts +15 -0
- package/dist/commands/DeleteCommands.d.ts.map +1 -0
- package/dist/commands/GapCursorCommands.d.ts +24 -0
- package/dist/commands/GapCursorCommands.d.ts.map +1 -0
- package/dist/commands/MarkCommands.d.ts +19 -0
- package/dist/commands/MarkCommands.d.ts.map +1 -0
- package/dist/commands/MovementCommands.d.ts +27 -0
- package/dist/commands/MovementCommands.d.ts.map +1 -0
- package/dist/commands/NodeSelectionCommands.d.ts +24 -0
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -0
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/commands/WordBoundary.d.ts +12 -0
- package/dist/commands/WordBoundary.d.ts.map +1 -0
- package/dist/editor/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +7 -1
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/index.d.ts +25 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/CompositionTracker.d.ts +14 -0
- package/dist/input/CompositionTracker.d.ts.map +1 -0
- package/dist/input/FileHandlerRegistry.d.ts +16 -0
- package/dist/input/FileHandlerRegistry.d.ts.map +1 -0
- package/dist/input/InputHandler.d.ts +6 -4
- package/dist/input/InputHandler.d.ts.map +1 -1
- package/dist/input/InputRuleRegistry.d.ts +9 -0
- package/dist/input/InputRuleRegistry.d.ts.map +1 -0
- package/dist/input/KeyboardHandler.d.ts +20 -5
- package/dist/input/KeyboardHandler.d.ts.map +1 -1
- package/dist/input/Keymap.d.ts +11 -0
- package/dist/input/Keymap.d.ts.map +1 -1
- package/dist/input/KeymapRegistry.d.ts +19 -0
- package/dist/input/KeymapRegistry.d.ts.map +1 -0
- package/dist/input/PasteHandler.d.ts +3 -0
- package/dist/input/PasteHandler.d.ts.map +1 -1
- package/dist/model/Document.d.ts +8 -0
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/GraphemeUtils.d.ts +20 -0
- package/dist/model/GraphemeUtils.d.ts.map +1 -0
- package/dist/model/HTMLUtils.d.ts +6 -1
- package/dist/model/HTMLUtils.d.ts.map +1 -1
- package/dist/model/NavigationUtils.d.ts +16 -0
- package/dist/model/NavigationUtils.d.ts.map +1 -0
- package/dist/model/SchemaRegistry.d.ts +0 -39
- package/dist/model/SchemaRegistry.d.ts.map +1 -1
- package/dist/model/Selection.d.ts +14 -3
- package/dist/model/Selection.d.ts.map +1 -1
- package/dist/notectl-core.mjs +2755 -2496
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +2672 -1680
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/Plugin.d.ts +17 -3
- package/dist/plugins/Plugin.d.ts.map +1 -1
- package/dist/plugins/PluginManager.d.ts +14 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts +35 -0
- package/dist/plugins/caret-navigation/CaretNavigationPlugin.d.ts.map +1 -0
- package/dist/plugins/caret-navigation/index.d.ts +2 -0
- package/dist/plugins/caret-navigation/index.d.ts.map +1 -0
- package/dist/plugins/caret-navigation.mjs +5 -0
- package/dist/plugins/caret-navigation.mjs.map +1 -0
- package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
- package/dist/plugins/font-size.mjs +1 -1
- package/dist/plugins/font.mjs +1 -1
- package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts +15 -0
- package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -0
- package/dist/plugins/gap-cursor/index.d.ts +2 -0
- package/dist/plugins/gap-cursor/index.d.ts.map +1 -0
- package/dist/plugins/gap-cursor.mjs +65 -0
- package/dist/plugins/gap-cursor.mjs.map +1 -0
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/BlockTypePickerRegistry.d.ts +9 -0
- package/dist/plugins/heading/BlockTypePickerRegistry.d.ts.map +1 -0
- package/dist/plugins/heading/HeadingInputRules.d.ts.map +1 -1
- package/dist/plugins/heading/HeadingKeyboardHandlers.d.ts.map +1 -1
- package/dist/plugins/heading.mjs +1 -1
- package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
- package/dist/plugins/highlight.mjs +1 -1
- package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
- package/dist/plugins/horizontal-rule.mjs +1 -1
- package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
- package/dist/plugins/image.mjs +1 -1
- package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
- package/dist/plugins/link.mjs +1 -1
- package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
- package/dist/plugins/list.mjs +1 -1
- package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
- package/dist/plugins/print/PrintTypes.d.ts +5 -1
- package/dist/plugins/print/PrintTypes.d.ts.map +1 -1
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
- package/dist/plugins/shared/ColorValidation.d.ts +7 -0
- package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableCommands.d.ts.map +1 -1
- package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
- package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts +12 -0
- package/dist/plugins/toolbar/ToolbarRegistry.d.ts.map +1 -0
- package/dist/plugins/toolbar.mjs +2 -2
- package/dist/state/EditorState.d.ts.map +1 -1
- package/dist/state/History.d.ts.map +1 -1
- package/dist/state/SelectionTransactions.d.ts +10 -0
- package/dist/state/SelectionTransactions.d.ts.map +1 -0
- package/dist/test/TestUtils.d.ts +23 -0
- package/dist/test/TestUtils.d.ts.map +1 -1
- package/dist/view/CaretNavigation.d.ts +48 -0
- package/dist/view/CaretNavigation.d.ts.map +1 -0
- package/dist/view/CursorWrapper.d.ts +19 -0
- package/dist/view/CursorWrapper.d.ts.map +1 -0
- package/dist/view/DomPointUtils.d.ts +20 -0
- package/dist/view/DomPointUtils.d.ts.map +1 -0
- package/dist/view/EditorView.d.ts +43 -0
- package/dist/view/EditorView.d.ts.map +1 -1
- package/dist/view/MarkRendering.d.ts +7 -0
- package/dist/view/MarkRendering.d.ts.map +1 -0
- package/dist/view/NodeViewRegistry.d.ts +9 -0
- package/dist/view/NodeViewRegistry.d.ts.map +1 -0
- package/dist/view/Platform.d.ts +29 -0
- package/dist/view/Platform.d.ts.map +1 -0
- package/dist/view/Reconciler.d.ts +4 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/dist/view/SelectionSync.d.ts +2 -0
- package/dist/view/SelectionSync.d.ts.map +1 -1
- package/dist/view/ViewMovementCommands.d.ts +40 -0
- package/dist/view/ViewMovementCommands.d.ts.map +1 -0
- package/package.json +10 -2
- package/dist/chunks/ColorNames-iaWsSZx1.mjs +0 -35
- package/dist/chunks/ColorNames-iaWsSZx1.mjs.map +0 -1
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs +0 -140
- package/dist/chunks/ColorValidation-Dyy4Bye8.mjs.map +0 -1
- package/dist/chunks/Commands-CSpSwGXv.mjs +0 -461
- package/dist/chunks/Commands-CSpSwGXv.mjs.map +0 -1
- package/dist/chunks/HTMLUtils-0wvCRvJc.mjs +0 -7
- package/dist/chunks/HTMLUtils-0wvCRvJc.mjs.map +0 -1
- package/dist/chunks/Selection-D5ZjXoB7.mjs +0 -44
- package/dist/chunks/Selection-D5ZjXoB7.mjs.map +0 -1
- package/dist/chunks/ToolbarItem-ugDymuXi.mjs +0 -7
- package/dist/chunks/ToolbarItem-ugDymuXi.mjs.map +0 -1
- package/dist/chunks/index-BCvuDpVr.mjs.map +0 -1
- package/dist/chunks/index-BL56fbXt.mjs.map +0 -1
- package/dist/chunks/index-BQ8iIYLn.mjs.map +0 -1
- package/dist/chunks/index-BRYzYOYC.mjs.map +0 -1
- package/dist/chunks/index-BSFLNveF.mjs.map +0 -1
- package/dist/chunks/index-BTJfyJlJ.mjs.map +0 -1
- package/dist/chunks/index-Bsp4LC5t.mjs.map +0 -1
- package/dist/chunks/index-DA8TG2S8.mjs.map +0 -1
- package/dist/chunks/index-DC1EK22F.mjs.map +0 -1
- package/dist/chunks/index-DGrRWMlW.mjs.map +0 -1
- package/dist/chunks/index-o6hDR07y.mjs.map +0 -1
- package/dist/chunks/index-uTnc9y7M.mjs.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { S as t, r as e } from "./resolvePluginLocale-B4w1OkPy.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { e as n } from "./HTMLUtils-DTqQzcKR.mjs";
|
|
3
|
+
import { i as o, a as r, c as l, e as i, b as a } from "./Selection-DmFDwiPJ.mjs";
|
|
4
|
+
import { g as s, a as c, b as d } from "./ColorNames-BdsHwA2f.mjs";
|
|
5
|
+
import { n as u } from "./ToolbarKeyboardNav-B32OMv8r.mjs";
|
|
6
|
+
import { u as b, e as h, f as p, j as f, b as m } from "./Document-CuwE73FF.mjs";
|
|
7
|
+
import { n as g } from "./TypeBrands-C09nE2qO.mjs";
|
|
8
|
+
function w() {
|
|
9
|
+
const t2 = p(g("paragraph"), [f("")], h());
|
|
10
|
+
return p(g("table_cell"), [t2], h());
|
|
11
|
+
}
|
|
12
|
+
function v(t2, e2) {
|
|
12
13
|
const n2 = t2.getNodePath(e2);
|
|
13
14
|
if (!n2) return null;
|
|
14
15
|
let o2 = null, r2 = null, l2 = null, i2 = null;
|
|
@@ -18,48 +19,48 @@ function m(t2, e2) {
|
|
|
18
19
|
}
|
|
19
20
|
const a2 = t2.getBlock(e2);
|
|
20
21
|
if ("table_cell" === a2?.type && (i2 = e2), !(o2 && r2 && i2 && l2)) return null;
|
|
21
|
-
const s2 = t2.doc.children.findIndex((t3) => t3.id === o2),
|
|
22
|
-
if (-1 ===
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const h2 =
|
|
22
|
+
const s2 = t2.doc.children.findIndex((t3) => t3.id === o2), c2 = b(r2), d2 = c2.findIndex((t3) => t3.id === l2);
|
|
23
|
+
if (-1 === d2) return null;
|
|
24
|
+
const u2 = c2[d2];
|
|
25
|
+
if (!u2) return null;
|
|
26
|
+
const h2 = b(u2), p2 = h2.findIndex((t3) => t3.id === i2);
|
|
26
27
|
if (-1 === p2) return null;
|
|
27
|
-
const f2 = h2.length, m2 =
|
|
28
|
-
return { tableId: o2, tableIndex: s2, rowId: l2, rowIndex:
|
|
28
|
+
const f2 = h2.length, m2 = c2.length;
|
|
29
|
+
return { tableId: o2, tableIndex: s2, rowId: l2, rowIndex: d2, cellId: i2, colIndex: p2, totalRows: m2, totalCols: f2 };
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function x(t2, e2, n2, o2) {
|
|
31
32
|
const r2 = t2.getBlock(e2);
|
|
32
33
|
if (!r2) return null;
|
|
33
|
-
const l2 =
|
|
34
|
+
const l2 = b(r2)[n2];
|
|
34
35
|
if (!l2) return null;
|
|
35
|
-
const i2 =
|
|
36
|
+
const i2 = b(l2)[o2];
|
|
36
37
|
return i2?.id ?? null;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function C(t2, e2) {
|
|
39
40
|
const n2 = t2.getBlock(e2);
|
|
40
41
|
if (!n2) return e2;
|
|
41
|
-
const o2 =
|
|
42
|
+
const o2 = b(n2)[0];
|
|
42
43
|
if (!o2) return e2;
|
|
43
44
|
let r2 = o2;
|
|
44
45
|
for (; ; ) {
|
|
45
|
-
const t3 =
|
|
46
|
+
const t3 = b(r2)[0];
|
|
46
47
|
if (!t3) return r2.id;
|
|
47
48
|
r2 = t3;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function y(t2, e2) {
|
|
51
52
|
const n2 = t2.getBlock(e2);
|
|
52
53
|
if (!n2) return e2;
|
|
53
|
-
const o2 =
|
|
54
|
+
const o2 = b(n2), r2 = o2[o2.length - 1];
|
|
54
55
|
if (!r2) return e2;
|
|
55
56
|
let l2 = r2;
|
|
56
57
|
for (; ; ) {
|
|
57
|
-
const t3 =
|
|
58
|
+
const t3 = b(l2), e3 = t3[t3.length - 1];
|
|
58
59
|
if (!e3) return l2.id;
|
|
59
60
|
l2 = e3;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function I(t2, e2) {
|
|
63
64
|
const n2 = t2.getNodePath(e2);
|
|
64
65
|
if (!n2) return false;
|
|
65
66
|
for (const e3 of n2) {
|
|
@@ -68,8 +69,8 @@ function x(t2, e2) {
|
|
|
68
69
|
}
|
|
69
70
|
return false;
|
|
70
71
|
}
|
|
71
|
-
const C = { insertRowAbove: "Insert Row Above", insertRowBelow: "Insert Row Below", insertColumnLeft: "Insert Column Left", insertColumnRight: "Insert Column Right", deleteRow: "Delete Row", deleteColumn: "Delete Column", borderColorLabel: "Border Color...", deleteTable: "Delete Table", tableActions: "Table actions", menuKeyboardHint: "↑↓ Navigate · Enter Select · Esc Close", insertRow: "Insert row", insertColumn: "Insert column", addRow: "Add row", addColumn: "Add column", tableActionsHint: "Table actions (Right-click or Shift+F10)", contextMenuHint: "Right-click or Shift+F10 for table actions", borderColor: "Border color", defaultColor: "Default", noBorders: "No borders", borderColorPicker: "Border color picker", announceBorderColorSet: (t2) => `Table border color set to ${t2}`, announceBorderReset: "Table borders reset to default", borderSwatchLabel: (t2) => `Border ${t2}`, announceRowInsertedAbove: "Row inserted above", announceRowInsertedBelow: "Row inserted below", announceColumnInserted: (t2) => `Column inserted ${t2}`, announceRowDeleted: "Row deleted", announceColumnDeleted: "Column deleted", announceTableDeleted: "Table deleted", insertTable: "Insert Table", tableAriaLabel: (t2, e2) => `Table with ${t2} rows and ${e2} columns`, tableAriaDescription: "Right-click or press Shift+F10 for table actions" }, I = { insertRowAbove: "Zeile oberhalb einfügen", insertRowBelow: "Zeile unterhalb einfügen", insertColumnLeft: "Spalte links einfügen", insertColumnRight: "Spalte rechts einfügen", deleteRow: "Zeile löschen", deleteColumn: "Spalte löschen", borderColorLabel: "Rahmenfarbe…", deleteTable: "Tabelle löschen", tableActions: "Tabellenaktionen", menuKeyboardHint: "↑↓ Navigieren · Eingabe Auswählen · Esc Schließen", insertRow: "Zeile einfügen", insertColumn: "Spalte einfügen", addRow: "Zeile hinzufügen", addColumn: "Spalte hinzufügen", tableActionsHint: "Tabellenaktionen (Rechtsklick oder Umschalt+F10)", contextMenuHint: "Rechtsklick oder Umschalt+F10 für Tabellenaktionen", borderColor: "Rahmenfarbe", defaultColor: "Standard", noBorders: "Keine Rahmen", borderColorPicker: "Rahmenfarbe auswählen", announceBorderColorSet: (t2) => `Tabellenrahmenfarbe auf ${t2} gesetzt`, announceBorderReset: "Tabellenrahmen auf Standard zurückgesetzt", borderSwatchLabel: (t2) => `Rahmen ${t2}`, announceRowInsertedAbove: "Zeile oberhalb eingefügt", announceRowInsertedBelow: "Zeile unterhalb eingefügt", announceColumnInserted: (t2) => `Spalte ${t2} eingefügt`, announceRowDeleted: "Zeile gelöscht", announceColumnDeleted: "Spalte gelöscht", announceTableDeleted: "Tabelle gelöscht", insertTable: "Tabelle einfügen", tableAriaLabel: (t2, e2) => `Tabelle mit ${t2} Zeilen und ${e2} Spalten`, tableAriaDescription: "Rechtsklick oder Umschalt+F10 für Tabellenaktionen" }, y = { insertRowAbove: "Insertar fila arriba", insertRowBelow: "Insertar fila abajo", insertColumnLeft: "Insertar columna a la izquierda", insertColumnRight: "Insertar columna a la derecha", deleteRow: "Eliminar fila", deleteColumn: "Eliminar columna", borderColorLabel: "Color del borde…", deleteTable: "Eliminar tabla", tableActions: "Acciones de tabla", menuKeyboardHint: "↑↓ Navegar · Enter Seleccionar · Esc Cerrar", insertRow: "Insertar fila", insertColumn: "Insertar columna", addRow: "Añadir fila", addColumn: "Añadir columna", tableActionsHint: "Acciones de tabla (clic derecho o Mayús+F10)", contextMenuHint: "Clic derecho o Mayús+F10 para acciones de tabla", borderColor: "Color del borde", defaultColor: "Predeterminado", noBorders: "Sin bordes", borderColorPicker: "Selector de color de borde", announceBorderColorSet: (t2) => `Color del borde de tabla establecido en ${t2}`, announceBorderReset: "Bordes de tabla restablecidos a predeterminado", borderSwatchLabel: (t2) => `Borde ${t2}`, announceRowInsertedAbove: "Fila insertada arriba", announceRowInsertedBelow: "Fila insertada abajo", announceColumnInserted: (t2) => `Columna insertada ${t2}`, announceRowDeleted: "Fila eliminada", announceColumnDeleted: "Columna eliminada", announceTableDeleted: "Tabla eliminada", insertTable: "Insertar tabla", tableAriaLabel: (t2, e2) => `Tabla con ${t2} filas y ${e2} columnas`, tableAriaDescription: "Clic derecho o Mayús+F10 para acciones de tabla" }, R = { insertRowAbove: "Insérer une ligne au-dessus", insertRowBelow: "Insérer une ligne en dessous", insertColumnLeft: "Insérer une colonne à gauche", insertColumnRight: "Insérer une colonne à droite", deleteRow: "Supprimer la ligne", deleteColumn: "Supprimer la colonne", borderColorLabel: "Couleur de bordure…", deleteTable: "Supprimer le tableau", tableActions: "Actions du tableau", menuKeyboardHint: "↑↓ Naviguer · Entrée Sélectionner · Échap Fermer", insertRow: "Insérer une ligne", insertColumn: "Insérer une colonne", addRow: "Ajouter une ligne", addColumn: "Ajouter une colonne", tableActionsHint: "Actions du tableau (clic droit ou Maj+F10)", contextMenuHint: "Clic droit ou Maj+F10 pour les actions du tableau", borderColor: "Couleur de bordure", defaultColor: "Par défaut", noBorders: "Sans bordure", borderColorPicker: "Sélecteur de couleur de bordure", announceBorderColorSet: (t2) => `Couleur de bordure du tableau définie sur ${t2}`, announceBorderReset: "Bordures du tableau réinitialisées par défaut", borderSwatchLabel: (t2) => `Bordure ${t2}`, announceRowInsertedAbove: "Ligne insérée au-dessus", announceRowInsertedBelow: "Ligne insérée en dessous", announceColumnInserted: (t2) => `Colonne insérée à ${t2}`, announceRowDeleted: "Ligne supprimée", announceColumnDeleted: "Colonne supprimée", announceTableDeleted: "Tableau supprimé", insertTable: "Insérer un tableau", tableAriaLabel: (t2, e2) => `Tableau avec ${t2} lignes et ${e2} colonnes`, tableAriaDescription: "Clic droit ou Maj+F10 pour les actions du tableau" }, k = { insertRowAbove: "在上方插入行", insertRowBelow: "在下方插入行", insertColumnLeft: "在左侧插入列", insertColumnRight: "在右侧插入列", deleteRow: "删除行", deleteColumn: "删除列", borderColorLabel: "边框颜色…", deleteTable: "删除表格", tableActions: "表格操作", menuKeyboardHint: "↑↓ 导航 · Enter 选择 · Esc 关闭", insertRow: "插入行", insertColumn: "插入列", addRow: "添加行", addColumn: "添加列", tableActionsHint: "表格操作(右键或 Shift+F10)", contextMenuHint: "右键或 Shift+F10 打开表格操作", borderColor: "边框颜色", defaultColor: "默认", noBorders: "无边框", borderColorPicker: "边框颜色选择器", announceBorderColorSet: (t2) => `表格边框颜色已设置为${t2}`, announceBorderReset: "表格边框已重置为默认", borderSwatchLabel: (t2) => `边框 ${t2}`, announceRowInsertedAbove: "已在上方插入行", announceRowInsertedBelow: "已在下方插入行", announceColumnInserted: (t2) => `已插入列到${t2}`, announceRowDeleted: "行已删除", announceColumnDeleted: "列已删除", announceTableDeleted: "表格已删除", insertTable: "插入表格", tableAriaLabel: (t2, e2) => `表格,${t2} 行 ${e2} 列`, tableAriaDescription: "右键或 Shift+F10 打开表格操作" }, A = { insertRowAbove: "Вставить строку сверху", insertRowBelow: "Вставить строку снизу", insertColumnLeft: "Вставить столбец слева", insertColumnRight: "Вставить столбец справа", deleteRow: "Удалить строку", deleteColumn: "Удалить столбец", borderColorLabel: "Цвет границы…", deleteTable: "Удалить таблицу", tableActions: "Действия с таблицей", menuKeyboardHint: "↑↓ Навигация · Enter Выбрать · Esc Закрыть", insertRow: "Вставить строку", insertColumn: "Вставить столбец", addRow: "Добавить строку", addColumn: "Добавить столбец", tableActionsHint: "Действия с таблицей (ПКМ или Shift+F10)", contextMenuHint: "ПКМ или Shift+F10 для действий с таблицей", borderColor: "Цвет границы", defaultColor: "По умолчанию", noBorders: "Без границ", borderColorPicker: "Выбор цвета границы", announceBorderColorSet: (t2) => `Цвет границы таблицы установлен на ${t2}`, announceBorderReset: "Границы таблицы сброшены по умолчанию", borderSwatchLabel: (t2) => `Граница ${t2}`, announceRowInsertedAbove: "Строка вставлена сверху", announceRowInsertedBelow: "Строка вставлена снизу", announceColumnInserted: (t2) => `Столбец вставлен ${t2}`, announceRowDeleted: "Строка удалена", announceColumnDeleted: "Столбец удален", announceTableDeleted: "Таблица удалена", insertTable: "Вставить таблицу", tableAriaLabel: (t2, e2) => `Таблица: ${t2} строк, ${e2} столбцов`, tableAriaDescription: "ПКМ или Shift+F10 для действий с таблицей" }, S = { insertRowAbove: "إدراج صف أعلى", insertRowBelow: "إدراج صف أسفل", insertColumnLeft: "إدراج عمود على اليسار", insertColumnRight: "إدراج عمود على اليمين", deleteRow: "حذف الصف", deleteColumn: "حذف العمود", borderColorLabel: "لون الحدود…", deleteTable: "حذف الجدول", tableActions: "إجراءات الجدول", menuKeyboardHint: "↑↓ تنقل · Enter تحديد · Esc إغلاق", insertRow: "إدراج صف", insertColumn: "إدراج عمود", addRow: "إضافة صف", addColumn: "إضافة عمود", tableActionsHint: "إجراءات الجدول (انقر بزر الماوس الأيمن أو Shift+F10)", contextMenuHint: "انقر بزر الماوس الأيمن أو Shift+F10 لإجراءات الجدول", borderColor: "لون الحدود", defaultColor: "افتراضي", noBorders: "بدون حدود", borderColorPicker: "منتقي لون الحدود", announceBorderColorSet: (t2) => `تم تعيين لون حدود الجدول إلى ${t2}`, announceBorderReset: "تم إعادة تعيين حدود الجدول إلى الافتراضي", borderSwatchLabel: (t2) => `حدود ${t2}`, announceRowInsertedAbove: "تم إدراج صف أعلى", announceRowInsertedBelow: "تم إدراج صف أسفل", announceColumnInserted: (t2) => `تم إدراج عمود ${t2}`, announceRowDeleted: "تم حذف الصف", announceColumnDeleted: "تم حذف العمود", announceTableDeleted: "تم حذف الجدول", insertTable: "إدراج جدول", tableAriaLabel: (t2, e2) => `جدول من ${t2} صفوف و ${e2} أعمدة`, tableAriaDescription: "انقر بزر الماوس الأيمن أو Shift+F10 لإجراءات الجدول" }, L = { insertRowAbove: "ऊपर पंक्ति डालें", insertRowBelow: "नीचे पंक्ति डालें", insertColumnLeft: "बाएं स्तंभ डालें", insertColumnRight: "दाएं स्तंभ डालें", deleteRow: "पंक्ति हटाएं", deleteColumn: "स्तंभ हटाएं", borderColorLabel: "बॉर्डर रंग…", deleteTable: "तालिका हटाएं", tableActions: "तालिका क्रियाएं", menuKeyboardHint: "↑↓ नेविगेशन · Enter चुनें · Esc बंद करें", insertRow: "पंक्ति डालें", insertColumn: "स्तंभ डालें", addRow: "पंक्ति जोड़ें", addColumn: "स्तंभ जोड़ें", tableActionsHint: "तालिका क्रियाएं (राइट-क्लिक या Shift+F10)", contextMenuHint: "तालिका क्रियाओं के लिए राइट-क्लिक या Shift+F10", borderColor: "बॉर्डर रंग", defaultColor: "डिफ़ॉल्ट", noBorders: "कोई बॉर्डर नहीं", borderColorPicker: "बॉर्डर रंग चुनें", announceBorderColorSet: (t2) => `तालिका बॉर्डर रंग ${t2} पर सेट किया गया`, announceBorderReset: "तालिका बॉर्डर डिफ़ॉल्ट पर रीसेट किया गया", borderSwatchLabel: (t2) => `बॉर्डर ${t2}`, announceRowInsertedAbove: "ऊपर पंक्ति डाली गई", announceRowInsertedBelow: "नीचे पंक्ति डाली गई", announceColumnInserted: (t2) => `स्तंभ ${t2} डाला गया`, announceRowDeleted: "पंक्ति हटाई गई", announceColumnDeleted: "स्तंभ हटाया गया", announceTableDeleted: "तालिका हटाई गई", insertTable: "तालिका डालें", tableAriaLabel: (t2, e2) => `तालिका: ${t2} पंक्तियां और ${e2} स्तंभ`, tableAriaDescription: "तालिका क्रियाओं के लिए राइट-क्लिक या Shift+F10" }, B = { en: C, de: I, es: y, fr: R, zh: k, ru: A, ar: S, hi: L }, E = ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#980000", "#cc0000", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3c78d8", "#3d85c6", "#674ea7", "#a64d79", "#0b5394", "#38761d"], T = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
72
|
-
function
|
|
72
|
+
const R = { insertRowAbove: "Insert Row Above", insertRowBelow: "Insert Row Below", insertColumnLeft: "Insert Column Left", insertColumnRight: "Insert Column Right", deleteRow: "Delete Row", deleteColumn: "Delete Column", borderColorLabel: "Border Color...", deleteTable: "Delete Table", tableActions: "Table actions", menuKeyboardHint: "↑↓ Navigate · Enter Select · Esc Close", insertRow: "Insert row", insertColumn: "Insert column", addRow: "Add row", addColumn: "Add column", tableActionsHint: "Table actions (Right-click or Shift+F10)", contextMenuHint: "Right-click or Shift+F10 for table actions", borderColor: "Border color", defaultColor: "Default", noBorders: "No borders", borderColorPicker: "Border color picker", announceBorderColorSet: (t2) => `Table border color set to ${t2}`, announceBorderReset: "Table borders reset to default", borderSwatchLabel: (t2) => `Border ${t2}`, announceRowInsertedAbove: "Row inserted above", announceRowInsertedBelow: "Row inserted below", announceColumnInserted: (t2) => `Column inserted ${t2}`, announceRowDeleted: "Row deleted", announceColumnDeleted: "Column deleted", announceTableDeleted: "Table deleted", insertTable: "Insert Table", tableAriaLabel: (t2, e2) => `Table with ${t2} rows and ${e2} columns`, tableAriaDescription: "Right-click or press Shift+F10 for table actions" }, k = { insertRowAbove: "Zeile oberhalb einfügen", insertRowBelow: "Zeile unterhalb einfügen", insertColumnLeft: "Spalte links einfügen", insertColumnRight: "Spalte rechts einfügen", deleteRow: "Zeile löschen", deleteColumn: "Spalte löschen", borderColorLabel: "Rahmenfarbe…", deleteTable: "Tabelle löschen", tableActions: "Tabellenaktionen", menuKeyboardHint: "↑↓ Navigieren · Eingabe Auswählen · Esc Schließen", insertRow: "Zeile einfügen", insertColumn: "Spalte einfügen", addRow: "Zeile hinzufügen", addColumn: "Spalte hinzufügen", tableActionsHint: "Tabellenaktionen (Rechtsklick oder Umschalt+F10)", contextMenuHint: "Rechtsklick oder Umschalt+F10 für Tabellenaktionen", borderColor: "Rahmenfarbe", defaultColor: "Standard", noBorders: "Keine Rahmen", borderColorPicker: "Rahmenfarbe auswählen", announceBorderColorSet: (t2) => `Tabellenrahmenfarbe auf ${t2} gesetzt`, announceBorderReset: "Tabellenrahmen auf Standard zurückgesetzt", borderSwatchLabel: (t2) => `Rahmen ${t2}`, announceRowInsertedAbove: "Zeile oberhalb eingefügt", announceRowInsertedBelow: "Zeile unterhalb eingefügt", announceColumnInserted: (t2) => `Spalte ${t2} eingefügt`, announceRowDeleted: "Zeile gelöscht", announceColumnDeleted: "Spalte gelöscht", announceTableDeleted: "Tabelle gelöscht", insertTable: "Tabelle einfügen", tableAriaLabel: (t2, e2) => `Tabelle mit ${t2} Zeilen und ${e2} Spalten`, tableAriaDescription: "Rechtsklick oder Umschalt+F10 für Tabellenaktionen" }, A = { insertRowAbove: "Insertar fila arriba", insertRowBelow: "Insertar fila abajo", insertColumnLeft: "Insertar columna a la izquierda", insertColumnRight: "Insertar columna a la derecha", deleteRow: "Eliminar fila", deleteColumn: "Eliminar columna", borderColorLabel: "Color del borde…", deleteTable: "Eliminar tabla", tableActions: "Acciones de tabla", menuKeyboardHint: "↑↓ Navegar · Enter Seleccionar · Esc Cerrar", insertRow: "Insertar fila", insertColumn: "Insertar columna", addRow: "Añadir fila", addColumn: "Añadir columna", tableActionsHint: "Acciones de tabla (clic derecho o Mayús+F10)", contextMenuHint: "Clic derecho o Mayús+F10 para acciones de tabla", borderColor: "Color del borde", defaultColor: "Predeterminado", noBorders: "Sin bordes", borderColorPicker: "Selector de color de borde", announceBorderColorSet: (t2) => `Color del borde de tabla establecido en ${t2}`, announceBorderReset: "Bordes de tabla restablecidos a predeterminado", borderSwatchLabel: (t2) => `Borde ${t2}`, announceRowInsertedAbove: "Fila insertada arriba", announceRowInsertedBelow: "Fila insertada abajo", announceColumnInserted: (t2) => `Columna insertada ${t2}`, announceRowDeleted: "Fila eliminada", announceColumnDeleted: "Columna eliminada", announceTableDeleted: "Tabla eliminada", insertTable: "Insertar tabla", tableAriaLabel: (t2, e2) => `Tabla con ${t2} filas y ${e2} columnas`, tableAriaDescription: "Clic derecho o Mayús+F10 para acciones de tabla" }, S = { insertRowAbove: "Insérer une ligne au-dessus", insertRowBelow: "Insérer une ligne en dessous", insertColumnLeft: "Insérer une colonne à gauche", insertColumnRight: "Insérer une colonne à droite", deleteRow: "Supprimer la ligne", deleteColumn: "Supprimer la colonne", borderColorLabel: "Couleur de bordure…", deleteTable: "Supprimer le tableau", tableActions: "Actions du tableau", menuKeyboardHint: "↑↓ Naviguer · Entrée Sélectionner · Échap Fermer", insertRow: "Insérer une ligne", insertColumn: "Insérer une colonne", addRow: "Ajouter une ligne", addColumn: "Ajouter une colonne", tableActionsHint: "Actions du tableau (clic droit ou Maj+F10)", contextMenuHint: "Clic droit ou Maj+F10 pour les actions du tableau", borderColor: "Couleur de bordure", defaultColor: "Par défaut", noBorders: "Sans bordure", borderColorPicker: "Sélecteur de couleur de bordure", announceBorderColorSet: (t2) => `Couleur de bordure du tableau définie sur ${t2}`, announceBorderReset: "Bordures du tableau réinitialisées par défaut", borderSwatchLabel: (t2) => `Bordure ${t2}`, announceRowInsertedAbove: "Ligne insérée au-dessus", announceRowInsertedBelow: "Ligne insérée en dessous", announceColumnInserted: (t2) => `Colonne insérée à ${t2}`, announceRowDeleted: "Ligne supprimée", announceColumnDeleted: "Colonne supprimée", announceTableDeleted: "Tableau supprimé", insertTable: "Insérer un tableau", tableAriaLabel: (t2, e2) => `Tableau avec ${t2} lignes et ${e2} colonnes`, tableAriaDescription: "Clic droit ou Maj+F10 pour les actions du tableau" }, L = { insertRowAbove: "在上方插入行", insertRowBelow: "在下方插入行", insertColumnLeft: "在左侧插入列", insertColumnRight: "在右侧插入列", deleteRow: "删除行", deleteColumn: "删除列", borderColorLabel: "边框颜色…", deleteTable: "删除表格", tableActions: "表格操作", menuKeyboardHint: "↑↓ 导航 · Enter 选择 · Esc 关闭", insertRow: "插入行", insertColumn: "插入列", addRow: "添加行", addColumn: "添加列", tableActionsHint: "表格操作(右键或 Shift+F10)", contextMenuHint: "右键或 Shift+F10 打开表格操作", borderColor: "边框颜色", defaultColor: "默认", noBorders: "无边框", borderColorPicker: "边框颜色选择器", announceBorderColorSet: (t2) => `表格边框颜色已设置为${t2}`, announceBorderReset: "表格边框已重置为默认", borderSwatchLabel: (t2) => `边框 ${t2}`, announceRowInsertedAbove: "已在上方插入行", announceRowInsertedBelow: "已在下方插入行", announceColumnInserted: (t2) => `已插入列到${t2}`, announceRowDeleted: "行已删除", announceColumnDeleted: "列已删除", announceTableDeleted: "表格已删除", insertTable: "插入表格", tableAriaLabel: (t2, e2) => `表格,${t2} 行 ${e2} 列`, tableAriaDescription: "右键或 Shift+F10 打开表格操作" }, B = { insertRowAbove: "Вставить строку сверху", insertRowBelow: "Вставить строку снизу", insertColumnLeft: "Вставить столбец слева", insertColumnRight: "Вставить столбец справа", deleteRow: "Удалить строку", deleteColumn: "Удалить столбец", borderColorLabel: "Цвет границы…", deleteTable: "Удалить таблицу", tableActions: "Действия с таблицей", menuKeyboardHint: "↑↓ Навигация · Enter Выбрать · Esc Закрыть", insertRow: "Вставить строку", insertColumn: "Вставить столбец", addRow: "Добавить строку", addColumn: "Добавить столбец", tableActionsHint: "Действия с таблицей (ПКМ или Shift+F10)", contextMenuHint: "ПКМ или Shift+F10 для действий с таблицей", borderColor: "Цвет границы", defaultColor: "По умолчанию", noBorders: "Без границ", borderColorPicker: "Выбор цвета границы", announceBorderColorSet: (t2) => `Цвет границы таблицы установлен на ${t2}`, announceBorderReset: "Границы таблицы сброшены по умолчанию", borderSwatchLabel: (t2) => `Граница ${t2}`, announceRowInsertedAbove: "Строка вставлена сверху", announceRowInsertedBelow: "Строка вставлена снизу", announceColumnInserted: (t2) => `Столбец вставлен ${t2}`, announceRowDeleted: "Строка удалена", announceColumnDeleted: "Столбец удален", announceTableDeleted: "Таблица удалена", insertTable: "Вставить таблицу", tableAriaLabel: (t2, e2) => `Таблица: ${t2} строк, ${e2} столбцов`, tableAriaDescription: "ПКМ или Shift+F10 для действий с таблицей" }, E = { insertRowAbove: "إدراج صف أعلى", insertRowBelow: "إدراج صف أسفل", insertColumnLeft: "إدراج عمود على اليسار", insertColumnRight: "إدراج عمود على اليمين", deleteRow: "حذف الصف", deleteColumn: "حذف العمود", borderColorLabel: "لون الحدود…", deleteTable: "حذف الجدول", tableActions: "إجراءات الجدول", menuKeyboardHint: "↑↓ تنقل · Enter تحديد · Esc إغلاق", insertRow: "إدراج صف", insertColumn: "إدراج عمود", addRow: "إضافة صف", addColumn: "إضافة عمود", tableActionsHint: "إجراءات الجدول (انقر بزر الماوس الأيمن أو Shift+F10)", contextMenuHint: "انقر بزر الماوس الأيمن أو Shift+F10 لإجراءات الجدول", borderColor: "لون الحدود", defaultColor: "افتراضي", noBorders: "بدون حدود", borderColorPicker: "منتقي لون الحدود", announceBorderColorSet: (t2) => `تم تعيين لون حدود الجدول إلى ${t2}`, announceBorderReset: "تم إعادة تعيين حدود الجدول إلى الافتراضي", borderSwatchLabel: (t2) => `حدود ${t2}`, announceRowInsertedAbove: "تم إدراج صف أعلى", announceRowInsertedBelow: "تم إدراج صف أسفل", announceColumnInserted: (t2) => `تم إدراج عمود ${t2}`, announceRowDeleted: "تم حذف الصف", announceColumnDeleted: "تم حذف العمود", announceTableDeleted: "تم حذف الجدول", insertTable: "إدراج جدول", tableAriaLabel: (t2, e2) => `جدول من ${t2} صفوف و ${e2} أعمدة`, tableAriaDescription: "انقر بزر الماوس الأيمن أو Shift+F10 لإجراءات الجدول" }, T = { insertRowAbove: "ऊपर पंक्ति डालें", insertRowBelow: "नीचे पंक्ति डालें", insertColumnLeft: "बाएं स्तंभ डालें", insertColumnRight: "दाएं स्तंभ डालें", deleteRow: "पंक्ति हटाएं", deleteColumn: "स्तंभ हटाएं", borderColorLabel: "बॉर्डर रंग…", deleteTable: "तालिका हटाएं", tableActions: "तालिका क्रियाएं", menuKeyboardHint: "↑↓ नेविगेशन · Enter चुनें · Esc बंद करें", insertRow: "पंक्ति डालें", insertColumn: "स्तंभ डालें", addRow: "पंक्ति जोड़ें", addColumn: "स्तंभ जोड़ें", tableActionsHint: "तालिका क्रियाएं (राइट-क्लिक या Shift+F10)", contextMenuHint: "तालिका क्रियाओं के लिए राइट-क्लिक या Shift+F10", borderColor: "बॉर्डर रंग", defaultColor: "डिफ़ॉल्ट", noBorders: "कोई बॉर्डर नहीं", borderColorPicker: "बॉर्डर रंग चुनें", announceBorderColorSet: (t2) => `तालिका बॉर्डर रंग ${t2} पर सेट किया गया`, announceBorderReset: "तालिका बॉर्डर डिफ़ॉल्ट पर रीसेट किया गया", borderSwatchLabel: (t2) => `बॉर्डर ${t2}`, announceRowInsertedAbove: "ऊपर पंक्ति डाली गई", announceRowInsertedBelow: "नीचे पंक्ति डाली गई", announceColumnInserted: (t2) => `स्तंभ ${t2} डाला गया`, announceRowDeleted: "पंक्ति हटाई गई", announceColumnDeleted: "स्तंभ हटाया गया", announceTableDeleted: "तालिका हटाई गई", insertTable: "तालिका डालें", tableAriaLabel: (t2, e2) => `तालिका: ${t2} पंक्तियां और ${e2} स्तंभ`, tableAriaDescription: "तालिका क्रियाओं के लिए राइट-क्लिक या Shift+F10" }, D = { en: R, de: k, es: A, fr: S, zh: L, ru: B, ar: E, hi: T }, M = ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#980000", "#cc0000", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3c78d8", "#3d85c6", "#674ea7", "#a64d79", "#0b5394", "#38761d"], H = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
73
|
+
function $(t2, e2, n2) {
|
|
73
74
|
const o2 = t2.getBlock(e2);
|
|
74
75
|
if (!o2 || "table" !== o2.type) return null;
|
|
75
76
|
const r2 = t2.getNodePath(e2);
|
|
@@ -81,40 +82,40 @@ function D(t2, e2, n2) {
|
|
|
81
82
|
const l2 = { ...o2.attrs, borderColor: n2 };
|
|
82
83
|
return t2.transaction("command").setNodeAttr(r2, l2).setSelection(t2.selection).build();
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
89
|
-
const a2 =
|
|
85
|
+
function N(t2, e2, n2 = R) {
|
|
86
|
+
const l2 = t2.getState();
|
|
87
|
+
if (o(l2.selection) || r(l2.selection)) return false;
|
|
88
|
+
const i2 = v(l2, l2.selection.anchor.blockId);
|
|
89
|
+
if (!i2) return false;
|
|
90
|
+
const a2 = $(l2, i2.tableId, e2);
|
|
90
91
|
if (!a2) return false;
|
|
91
92
|
t2.dispatch(a2);
|
|
92
|
-
const
|
|
93
|
-
return t2.announce(
|
|
94
|
-
}
|
|
95
|
-
function
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
-
const
|
|
101
|
-
return !!
|
|
102
|
-
}
|
|
103
|
-
function
|
|
93
|
+
const c2 = "none" === e2 ? "none" : s(e2);
|
|
94
|
+
return t2.announce(n2.announceBorderColorSet(c2)), true;
|
|
95
|
+
}
|
|
96
|
+
function P(t2, e2 = R) {
|
|
97
|
+
const n2 = t2.getState();
|
|
98
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
99
|
+
const l2 = v(n2, n2.selection.anchor.blockId);
|
|
100
|
+
if (!l2) return false;
|
|
101
|
+
const i2 = $(n2, l2.tableId, void 0);
|
|
102
|
+
return !!i2 && (t2.dispatch(i2), t2.announce(e2.announceBorderReset), true);
|
|
103
|
+
}
|
|
104
|
+
function z(t2, e2) {
|
|
104
105
|
const n2 = t2.getBlock(e2);
|
|
105
106
|
if (n2) return n2.attrs?.borderColor;
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function F(t2, e2, n2, o2, r2 = R) {
|
|
108
109
|
t2.classList.add("notectl-color-picker");
|
|
109
|
-
const l2 =
|
|
110
|
-
|
|
111
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
112
|
-
}),
|
|
110
|
+
const l2 = z(e2.getState(), n2), i2 = M.length, a2 = Math.ceil(i2 / 5), d2 = document.createElement("button");
|
|
111
|
+
d2.type = "button", d2.className = "notectl-color-picker__default", d2.textContent = r2.defaultColor, d2.addEventListener("mousedown", (t3) => {
|
|
112
|
+
t3.preventDefault(), t3.stopPropagation(), P(e2, r2), o2();
|
|
113
|
+
}), d2.addEventListener("keydown", (t3) => {
|
|
113
114
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
114
|
-
}), t2.appendChild(
|
|
115
|
+
}), t2.appendChild(d2);
|
|
115
116
|
const b2 = document.createElement("button");
|
|
116
117
|
b2.type = "button", b2.className = "notectl-color-picker__default", b2.textContent = r2.noBorders, b2.addEventListener("mousedown", (t3) => {
|
|
117
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
118
|
+
t3.preventDefault(), t3.stopPropagation(), N(e2, "none", r2), o2();
|
|
118
119
|
}), b2.addEventListener("keydown", (t3) => {
|
|
119
120
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
120
121
|
}), t2.appendChild(b2);
|
|
@@ -122,206 +123,208 @@ function N(t2, e2, n2, o2, r2 = C) {
|
|
|
122
123
|
h2.className = "notectl-color-picker__grid", h2.setAttribute("role", "grid"), h2.setAttribute("aria-label", r2.borderColorPicker);
|
|
123
124
|
const p2 = [];
|
|
124
125
|
let f2 = 0;
|
|
125
|
-
for (let t3 = 0; t3 <
|
|
126
|
+
for (let t3 = 0; t3 < a2; t3++) {
|
|
126
127
|
const n3 = document.createElement("div");
|
|
127
128
|
n3.setAttribute("role", "row");
|
|
128
|
-
for (let
|
|
129
|
-
const d3 = 5 * t3 +
|
|
130
|
-
if (d3 >=
|
|
131
|
-
const
|
|
132
|
-
m2.type = "button", m2.className = "notectl-color-picker__swatch", m2.setAttribute("role", "gridcell"), m2.setAttribute("aria-label", r2.borderSwatchLabel(b3)), m2.setAttribute("aria-selected", String(h3)), m2.dataset.index = String(d3), m2.style.backgroundColor =
|
|
133
|
-
t4.preventDefault(), t4.stopPropagation(),
|
|
129
|
+
for (let a3 = 0; a3 < 5; a3++) {
|
|
130
|
+
const d3 = 5 * t3 + a3;
|
|
131
|
+
if (d3 >= i2) break;
|
|
132
|
+
const u2 = M[d3], b3 = s(u2), h3 = !!l2 && l2.toLowerCase() === u2.toLowerCase(), m2 = document.createElement("button");
|
|
133
|
+
m2.type = "button", m2.className = "notectl-color-picker__swatch", m2.setAttribute("role", "gridcell"), m2.setAttribute("aria-label", r2.borderSwatchLabel(b3)), m2.setAttribute("aria-selected", String(h3)), m2.dataset.index = String(d3), m2.style.backgroundColor = u2, m2.title = b3, c(u2) && (m2.style.border = "1px solid #d0d0d0"), h3 && (m2.classList.add("notectl-color-picker__swatch--active"), f2 = d3), m2.addEventListener("mousedown", (t4) => {
|
|
134
|
+
t4.preventDefault(), t4.stopPropagation(), N(e2, u2, r2), o2();
|
|
134
135
|
}), p2.push(m2), n3.appendChild(m2);
|
|
135
136
|
}
|
|
136
137
|
h2.appendChild(n3);
|
|
137
138
|
}
|
|
138
|
-
|
|
139
|
+
_(p2, f2), h2.addEventListener("keydown", (t3) => {
|
|
139
140
|
if ("Escape" === t3.key) return t3.preventDefault(), void o2();
|
|
140
141
|
if ("Enter" === t3.key || " " === t3.key) {
|
|
141
142
|
t3.preventDefault();
|
|
142
143
|
const n3 = t3.target.dataset.index;
|
|
143
144
|
if (void 0 !== n3) {
|
|
144
|
-
const t4 =
|
|
145
|
-
t4 && (
|
|
145
|
+
const t4 = M[Number(n3)];
|
|
146
|
+
t4 && (N(e2, t4, r2), o2());
|
|
146
147
|
}
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
|
-
if (
|
|
150
|
+
if (H.has(t3.key)) {
|
|
150
151
|
t3.preventDefault();
|
|
151
|
-
const e3 = Math.floor(f2 / 5) + 1, n3 = f2 % 5 + 1, [o3, r3] =
|
|
152
|
+
const e3 = Math.floor(f2 / 5) + 1, n3 = f2 % 5 + 1, [o3, r3] = u(e3, n3, a2, 5, t3.key);
|
|
152
153
|
let l3 = 5 * (o3 - 1) + (r3 - 1);
|
|
153
|
-
return l3 >=
|
|
154
|
+
return l3 >= i2 && (l3 = i2 - 1), f2 = l3, _(p2, f2), void p2[f2]?.focus();
|
|
154
155
|
}
|
|
155
156
|
if ("Home" === t3.key || "End" === t3.key) {
|
|
156
157
|
t3.preventDefault();
|
|
157
|
-
const e3 = 5 * Math.floor(f2 / 5), n3 = Math.min(e3 + 5 - 1,
|
|
158
|
-
f2 = "Home" === t3.key ? e3 : n3,
|
|
158
|
+
const e3 = 5 * Math.floor(f2 / 5), n3 = Math.min(e3 + 5 - 1, i2 - 1);
|
|
159
|
+
f2 = "Home" === t3.key ? e3 : n3, _(p2, f2), p2[f2]?.focus();
|
|
159
160
|
}
|
|
160
161
|
}), t2.appendChild(h2);
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
+
function _(t2, e2) {
|
|
163
164
|
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
164
165
|
const o2 = t2[n2];
|
|
165
166
|
o2 && o2.setAttribute("tabindex", n2 === e2 ? "0" : "-1");
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
171
|
-
const
|
|
169
|
+
function j(t2, e2, n2) {
|
|
170
|
+
const o2 = t2.getBlock(e2);
|
|
171
|
+
if (!o2) return null;
|
|
172
|
+
const r2 = b(o2), i2 = r2[0] ? b(r2[0]).length : 0;
|
|
172
173
|
if (0 === i2) return null;
|
|
173
174
|
const a2 = (function(t3) {
|
|
174
175
|
const e3 = [];
|
|
175
|
-
for (let n3 = 0; n3 < t3; n3++) e3.push(
|
|
176
|
-
return
|
|
177
|
-
})(i2), s2 = t2.transaction("command").insertNode([e2], n2, a2),
|
|
178
|
-
return
|
|
176
|
+
for (let n3 = 0; n3 < t3; n3++) e3.push(w());
|
|
177
|
+
return p(g("table_row"), e3, h());
|
|
178
|
+
})(i2), s2 = t2.transaction("command").insertNode([e2], n2, a2), c2 = b(a2)[0], d2 = c2 ? b(c2)[0] : void 0;
|
|
179
|
+
return d2 ? s2.setSelection(l(d2.id, 0)) : c2 && s2.setSelection(l(c2.id, 0)), s2.build();
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function V(t2, e2, n2) {
|
|
181
182
|
const o2 = t2.getBlock(e2);
|
|
182
183
|
if (!o2) return null;
|
|
183
|
-
const r2 =
|
|
184
|
+
const r2 = b(o2), l2 = t2.transaction("command");
|
|
184
185
|
for (const t3 of r2) {
|
|
185
|
-
const o3 =
|
|
186
|
+
const o3 = w();
|
|
186
187
|
l2.insertNode([e2, t3.id], n2, o3);
|
|
187
188
|
}
|
|
188
189
|
return l2.setSelection(t2.selection), l2.build();
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
if (
|
|
194
|
-
const i2 = t2.transaction("command").removeNode([e2], n2), a2 =
|
|
191
|
+
function Z(t2, e2, n2, o2 = 0) {
|
|
192
|
+
const r2 = t2.getBlock(e2);
|
|
193
|
+
if (!r2) return null;
|
|
194
|
+
if (b(r2).length <= 1) return O(t2, e2);
|
|
195
|
+
const i2 = t2.transaction("command").removeNode([e2], n2), a2 = x(t2, e2, n2 > 0 ? n2 - 1 : 1, o2);
|
|
195
196
|
if (a2) {
|
|
196
|
-
const e3 =
|
|
197
|
-
i2.setSelection(
|
|
197
|
+
const e3 = C(t2, a2);
|
|
198
|
+
i2.setSelection(l(e3, 0));
|
|
198
199
|
}
|
|
199
200
|
return i2.build();
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
if (!
|
|
204
|
-
const i2 =
|
|
205
|
-
if ((i2[0] ?
|
|
202
|
+
function q(t2, e2, n2, o2 = 0) {
|
|
203
|
+
const r2 = t2.getBlock(e2);
|
|
204
|
+
if (!r2) return null;
|
|
205
|
+
const i2 = b(r2);
|
|
206
|
+
if ((i2[0] ? b(i2[0]).length : 0) <= 1) return O(t2, e2);
|
|
206
207
|
const a2 = t2.transaction("command");
|
|
207
208
|
for (let t3 = i2.length - 1; t3 >= 0; t3--) {
|
|
208
|
-
const
|
|
209
|
-
|
|
209
|
+
const o3 = i2[t3];
|
|
210
|
+
o3 && a2.removeNode([e2, o3.id], n2);
|
|
210
211
|
}
|
|
211
|
-
const s2 =
|
|
212
|
+
const s2 = x(t2, e2, o2, n2 > 0 ? n2 - 1 : 1);
|
|
212
213
|
if (s2) {
|
|
213
|
-
const e3 =
|
|
214
|
-
a2.setSelection(
|
|
214
|
+
const e3 = C(t2, s2);
|
|
215
|
+
a2.setSelection(l(e3, 0));
|
|
215
216
|
}
|
|
216
217
|
return a2.build();
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
+
function O(t2, e2) {
|
|
219
220
|
const n2 = t2.doc.children.findIndex((t3) => t3.id === e2);
|
|
220
221
|
if (-1 === n2) return null;
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
222
|
+
const o2 = t2.transaction("command").removeNode([], n2), r2 = t2.doc.children[n2 + 1];
|
|
223
|
+
if (r2) return o2.setSelection(l(r2.id, 0)), o2.build();
|
|
223
224
|
const i2 = t2.doc.children[n2 - 1];
|
|
224
|
-
return i2 &&
|
|
225
|
-
}
|
|
226
|
-
function
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
const
|
|
230
|
-
let
|
|
231
|
-
for (let t3 = 0; t3 <
|
|
232
|
-
const e3 =
|
|
225
|
+
return i2 && o2.setSelection(l(i2.id, 0)), o2.build();
|
|
226
|
+
}
|
|
227
|
+
function K(t2, e2, n2) {
|
|
228
|
+
const i2 = t2.getState(), a2 = i2.selection;
|
|
229
|
+
if (o(a2) || r(a2)) return false;
|
|
230
|
+
const s2 = a2.anchor.blockId;
|
|
231
|
+
let c2 = -1;
|
|
232
|
+
for (let t3 = 0; t3 < i2.doc.children.length; t3++) {
|
|
233
|
+
const e3 = i2.doc.children[t3];
|
|
233
234
|
if (!e3) continue;
|
|
234
|
-
if (e3.id ===
|
|
235
|
-
|
|
235
|
+
if (e3.id === s2) {
|
|
236
|
+
c2 = t3;
|
|
236
237
|
break;
|
|
237
238
|
}
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
|
|
239
|
+
const n3 = i2.getNodePath(s2);
|
|
240
|
+
if (n3 && n3[0] === e3.id) {
|
|
241
|
+
c2 = t3;
|
|
241
242
|
break;
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
-1 ===
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
for (let
|
|
245
|
+
-1 === c2 && (c2 = i2.doc.children.length - 1);
|
|
246
|
+
const d2 = (function(t3, e3) {
|
|
247
|
+
const n3 = h(), o2 = [];
|
|
248
|
+
for (let n4 = 0; n4 < t3; n4++) {
|
|
248
249
|
const t4 = [];
|
|
249
|
-
for (let
|
|
250
|
-
o2.push(
|
|
250
|
+
for (let n5 = 0; n5 < e3; n5++) t4.push(w());
|
|
251
|
+
o2.push(p(g("table_row"), t4, h()));
|
|
251
252
|
}
|
|
252
|
-
return
|
|
253
|
-
})(e2,
|
|
254
|
-
return
|
|
255
|
-
}
|
|
256
|
-
function
|
|
257
|
-
const
|
|
258
|
-
if (
|
|
259
|
-
const
|
|
260
|
-
if (!r2) return false;
|
|
261
|
-
const l2 = z(o2, r2.tableId, r2.rowIndex + 1);
|
|
262
|
-
return !!l2 && (t2.dispatch(l2), t2.announce(e2?.announceRowInsertedBelow ?? "Row inserted below"), true);
|
|
263
|
-
}
|
|
264
|
-
function O(t2, e2, o2) {
|
|
265
|
-
const r2 = t2.getState();
|
|
266
|
-
if (n(r2.selection)) return false;
|
|
267
|
-
const l2 = m(r2, r2.selection.anchor.blockId);
|
|
253
|
+
return p(g("table"), o2, n3);
|
|
254
|
+
})(e2, n2), u2 = p(g("paragraph")), f2 = c2 + 1, m2 = i2.transaction("command").insertNode([], f2, d2).insertNode([], f2 + 1, u2), v2 = b(d2)[0], x2 = v2 ? b(v2)[0] : void 0, C2 = x2 ? b(x2)[0] : void 0;
|
|
255
|
+
return C2 ? m2.setSelection(l(C2.id, 0)) : x2 && m2.setSelection(l(x2.id, 0)), t2.dispatch(m2.build()), true;
|
|
256
|
+
}
|
|
257
|
+
function U(t2, e2) {
|
|
258
|
+
const n2 = t2.getState();
|
|
259
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
260
|
+
const l2 = v(n2, n2.selection.anchor.blockId);
|
|
268
261
|
if (!l2) return false;
|
|
269
|
-
const i2 =
|
|
270
|
-
return !!
|
|
271
|
-
}
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
262
|
+
const i2 = j(n2, l2.tableId, l2.rowIndex + 1);
|
|
263
|
+
return !!i2 && (t2.dispatch(i2), t2.announce(e2?.announceRowInsertedBelow ?? "Row inserted below"), true);
|
|
264
|
+
}
|
|
265
|
+
function Y(t2, e2, n2) {
|
|
266
|
+
const l2 = t2.getState();
|
|
267
|
+
if (o(l2.selection) || r(l2.selection)) return false;
|
|
268
|
+
const i2 = v(l2, l2.selection.anchor.blockId);
|
|
269
|
+
if (!i2) return false;
|
|
270
|
+
const a2 = "left" === e2 ? i2.colIndex : i2.colIndex + 1, s2 = V(l2, i2.tableId, a2);
|
|
271
|
+
return !!s2 && (t2.dispatch(s2), t2.announce(n2?.announceColumnInserted(e2) ?? `Column inserted ${e2}`), true);
|
|
272
|
+
}
|
|
273
|
+
function W(t2, e2) {
|
|
274
|
+
t2.registerCommand("insertTable", () => K(t2, 3, 3)), t2.registerCommand("addRowAbove", () => (function(t3, e3) {
|
|
275
|
+
const n2 = t3.getState();
|
|
276
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
277
|
+
const l2 = v(n2, n2.selection.anchor.blockId);
|
|
278
|
+
if (!l2) return false;
|
|
279
|
+
const i2 = j(n2, l2.tableId, l2.rowIndex);
|
|
280
|
+
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowInsertedAbove ?? "Row inserted above"), true);
|
|
281
|
+
})(t2, e2)), t2.registerCommand("addRowBelow", () => U(t2, e2)), t2.registerCommand("addColumnLeft", () => (function(t3, e3) {
|
|
282
|
+
return Y(t3, "left", e3);
|
|
282
283
|
})(t2, e2)), t2.registerCommand("addColumnRight", () => (function(t3, e3) {
|
|
283
|
-
return
|
|
284
|
+
return Y(t3, "right", e3);
|
|
284
285
|
})(t2, e2)), t2.registerCommand("deleteRow", () => (function(t3, e3) {
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
289
|
-
const
|
|
290
|
-
return !!
|
|
286
|
+
const n2 = t3.getState();
|
|
287
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
288
|
+
const l2 = v(n2, n2.selection.anchor.blockId);
|
|
289
|
+
if (!l2) return false;
|
|
290
|
+
const i2 = Z(n2, l2.tableId, l2.rowIndex, l2.colIndex);
|
|
291
|
+
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowDeleted ?? "Row deleted"), true);
|
|
291
292
|
})(t2, e2)), t2.registerCommand("deleteColumn", () => (function(t3, e3) {
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
296
|
-
const
|
|
297
|
-
return !!
|
|
293
|
+
const n2 = t3.getState();
|
|
294
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
295
|
+
const l2 = v(n2, n2.selection.anchor.blockId);
|
|
296
|
+
if (!l2) return false;
|
|
297
|
+
const i2 = q(n2, l2.tableId, l2.colIndex, l2.rowIndex);
|
|
298
|
+
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceColumnDeleted ?? "Column deleted"), true);
|
|
298
299
|
})(t2, e2)), t2.registerCommand("selectTable", () => (function(t3) {
|
|
299
|
-
const e3 = t3.getState(),
|
|
300
|
-
if (
|
|
301
|
-
const t4 = e3.getBlock(
|
|
300
|
+
const e3 = t3.getState(), n2 = e3.selection;
|
|
301
|
+
if (o(n2)) {
|
|
302
|
+
const t4 = e3.getBlock(n2.nodeId);
|
|
302
303
|
return "table" === t4?.type;
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
+
if (r(n2)) return false;
|
|
306
|
+
const l2 = v(e3, n2.anchor.blockId);
|
|
305
307
|
if (!l2) return false;
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
308
|
-
const
|
|
309
|
-
return t3.dispatch(
|
|
308
|
+
const a2 = e3.getNodePath(l2.tableId);
|
|
309
|
+
if (!a2) return false;
|
|
310
|
+
const s2 = e3.transaction("command").setSelection(i(l2.tableId, a2)).build();
|
|
311
|
+
return t3.dispatch(s2), true;
|
|
310
312
|
})(t2)), t2.registerCommand("deleteTable", () => (function(t3, e3) {
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
+
const n2 = t3.getState(), l2 = (function(t4) {
|
|
314
|
+
if (o(t4.selection)) {
|
|
313
315
|
const e5 = t4.getBlock(t4.selection.nodeId);
|
|
314
316
|
return "table" !== e5?.type ? null : { tableId: e5.id };
|
|
315
317
|
}
|
|
316
|
-
|
|
318
|
+
if (r(t4.selection)) return null;
|
|
319
|
+
const e4 = v(t4, t4.selection.anchor.blockId);
|
|
317
320
|
return e4 ? { tableId: e4.tableId } : null;
|
|
318
|
-
})(
|
|
319
|
-
if (!
|
|
320
|
-
const
|
|
321
|
-
return !!
|
|
321
|
+
})(n2);
|
|
322
|
+
if (!l2) return false;
|
|
323
|
+
const i2 = O(n2, l2.tableId);
|
|
324
|
+
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceTableDeleted ?? "Table deleted"), true);
|
|
322
325
|
})(t2, e2));
|
|
323
326
|
}
|
|
324
|
-
function
|
|
327
|
+
function X(t2, e2, n2, o2, r2, l2 = R) {
|
|
325
328
|
let i2 = true, a2 = null;
|
|
326
329
|
const s2 = document.createElement("div");
|
|
327
330
|
s2.className = "notectl-table-context-menu", s2.setAttribute("role", "menu"), s2.setAttribute("aria-label", l2.tableActions), s2.setAttribute("contenteditable", "false");
|
|
@@ -347,7 +350,7 @@ function Y(t2, e2, n2, o2, r2, l2 = C) {
|
|
|
347
350
|
function h2(o3) {
|
|
348
351
|
p2(), o3.setAttribute("aria-expanded", "true"), a2 = document.createElement("div"), a2.className = "notectl-table-context-menu", a2.style.position = "fixed", a2.setAttribute("contenteditable", "false"), a2.addEventListener("keydown", (t3) => {
|
|
349
352
|
t3.stopPropagation(), "ArrowLeft" === t3.key && (t3.preventDefault(), p2(), o3.focus());
|
|
350
|
-
}),
|
|
353
|
+
}), F(a2, e2, n2, () => {
|
|
351
354
|
m2();
|
|
352
355
|
}, l2), t2.appendChild(a2);
|
|
353
356
|
const r3 = o3.getBoundingClientRect(), i3 = s2.getBoundingClientRect();
|
|
@@ -362,14 +365,14 @@ function Y(t2, e2, n2, o2, r2, l2 = C) {
|
|
|
362
365
|
a2 && (a2.remove(), a2 = null);
|
|
363
366
|
for (const t3 of c2) t3.dataset.submenu && t3.setAttribute("aria-expanded", "false");
|
|
364
367
|
}
|
|
365
|
-
b2.className = "notectl-table-context-menu__hint", b2.setAttribute("aria-hidden", "true"), b2.textContent = l2.menuKeyboardHint, s2.appendChild(b2),
|
|
368
|
+
b2.className = "notectl-table-context-menu__hint", b2.setAttribute("aria-hidden", "true"), b2.textContent = l2.menuKeyboardHint, s2.appendChild(b2), G(c2, d2), s2.addEventListener("keydown", (t3) => {
|
|
366
369
|
switch (t3.stopPropagation(), t3.key) {
|
|
367
370
|
case "Escape":
|
|
368
371
|
return t3.preventDefault(), void m2();
|
|
369
372
|
case "ArrowDown":
|
|
370
|
-
return t3.preventDefault(), d2 = (d2 + 1) % c2.length,
|
|
373
|
+
return t3.preventDefault(), d2 = (d2 + 1) % c2.length, G(c2, d2), void c2[d2]?.focus();
|
|
371
374
|
case "ArrowUp":
|
|
372
|
-
return t3.preventDefault(), d2 = (d2 - 1 + c2.length) % c2.length,
|
|
375
|
+
return t3.preventDefault(), d2 = (d2 - 1 + c2.length) % c2.length, G(c2, d2), void c2[d2]?.focus();
|
|
373
376
|
case "ArrowRight": {
|
|
374
377
|
t3.preventDefault();
|
|
375
378
|
const e3 = c2[d2];
|
|
@@ -385,9 +388,9 @@ function Y(t2, e2, n2, o2, r2, l2 = C) {
|
|
|
385
388
|
return void (n3.dataset.submenu ? h2(n3) : n3.dataset.command && (e2.executeCommand(n3.dataset.command), m2()));
|
|
386
389
|
}
|
|
387
390
|
case "Home":
|
|
388
|
-
return t3.preventDefault(), d2 = 0,
|
|
391
|
+
return t3.preventDefault(), d2 = 0, G(c2, d2), void c2[d2]?.focus();
|
|
389
392
|
case "End":
|
|
390
|
-
return t3.preventDefault(), d2 = c2.length - 1,
|
|
393
|
+
return t3.preventDefault(), d2 = c2.length - 1, G(c2, d2), void c2[d2]?.focus();
|
|
391
394
|
}
|
|
392
395
|
}), (function(t3, e3) {
|
|
393
396
|
const n3 = window.innerWidth, o3 = window.innerHeight;
|
|
@@ -407,91 +410,91 @@ function Y(t2, e2, n2, o2, r2, l2 = C) {
|
|
|
407
410
|
document.addEventListener("mousedown", f2, true);
|
|
408
411
|
}, 0), { isOpen: () => i2, close: m2, destroy: m2 };
|
|
409
412
|
}
|
|
410
|
-
function
|
|
413
|
+
function G(t2, e2) {
|
|
411
414
|
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
412
415
|
const o2 = t2[n2];
|
|
413
416
|
o2 && o2.setAttribute("tabindex", n2 === e2 ? "0" : "-1");
|
|
414
417
|
}
|
|
415
418
|
}
|
|
416
|
-
function
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
419
|
-
const
|
|
420
|
-
return !!
|
|
421
|
-
}
|
|
422
|
-
function
|
|
423
|
-
return
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
const i2 = e2.doc.children[
|
|
419
|
+
function J(t2, e2) {
|
|
420
|
+
const n2 = t2.getState();
|
|
421
|
+
if (o(n2.selection) || r(n2.selection)) return false;
|
|
422
|
+
const l2 = n2.selection, i2 = v(n2, l2.anchor.blockId);
|
|
423
|
+
return !!i2 && e2(n2, l2, i2);
|
|
424
|
+
}
|
|
425
|
+
function Q(t2) {
|
|
426
|
+
return J(t2, (e2, n2, o2) => {
|
|
427
|
+
const r2 = o2.tableIndex + 1;
|
|
428
|
+
if (r2 >= e2.doc.children.length) return false;
|
|
429
|
+
const i2 = e2.doc.children[r2];
|
|
427
430
|
if (!i2) return false;
|
|
428
|
-
const a2 = e2.transaction("command").setSelection(
|
|
431
|
+
const a2 = e2.transaction("command").setSelection(l(i2.id, 0)).build();
|
|
429
432
|
return t2.dispatch(a2), true;
|
|
430
433
|
});
|
|
431
434
|
}
|
|
432
|
-
let
|
|
433
|
-
function
|
|
434
|
-
const
|
|
435
|
+
let tt = null;
|
|
436
|
+
function et(t2, e2, n2, o2) {
|
|
437
|
+
const r2 = t2.getState(), i2 = x(r2, e2, n2, o2);
|
|
435
438
|
if (!i2) return false;
|
|
436
|
-
const a2 =
|
|
439
|
+
const a2 = C(r2, i2), s2 = r2.transaction("command").setSelection(l(a2, 0)).build();
|
|
437
440
|
return t2.dispatch(s2), true;
|
|
438
441
|
}
|
|
439
|
-
function
|
|
440
|
-
const
|
|
442
|
+
function nt(t2, e2, n2, o2) {
|
|
443
|
+
const r2 = t2.getState(), i2 = x(r2, e2, n2, o2);
|
|
441
444
|
if (!i2) return false;
|
|
442
|
-
const a2 =
|
|
445
|
+
const a2 = y(r2, i2), s2 = r2.getBlock(a2);
|
|
443
446
|
if (!s2) return false;
|
|
444
|
-
const c2 =
|
|
447
|
+
const c2 = m(s2), d2 = r2.transaction("command").setSelection(l(a2, c2)).build();
|
|
445
448
|
return t2.dispatch(d2), true;
|
|
446
449
|
}
|
|
447
|
-
function
|
|
450
|
+
function ot(t2, e2) {
|
|
448
451
|
const n2 = t2.getState(), o2 = n2.getNodePath(e2);
|
|
449
452
|
if (!o2) return false;
|
|
450
|
-
const
|
|
451
|
-
return t2.dispatch(
|
|
453
|
+
const r2 = n2.transaction("input").setSelection(i(e2, o2)).build();
|
|
454
|
+
return t2.dispatch(r2), true;
|
|
452
455
|
}
|
|
453
|
-
const
|
|
454
|
-
function
|
|
456
|
+
const rt = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 1v10M1 6h10" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>';
|
|
457
|
+
function lt(t2, e2, n2) {
|
|
455
458
|
const o2 = document.createElement("button");
|
|
456
459
|
return o2.className = t2, o2.innerHTML = e2, o2.title = n2, o2.type = "button", o2.setAttribute("aria-label", n2), o2.setAttribute("contenteditable", "false"), o2.addEventListener("mousedown", (t3) => {
|
|
457
460
|
t3.preventDefault(), t3.stopPropagation();
|
|
458
461
|
}), o2;
|
|
459
462
|
}
|
|
460
|
-
function
|
|
463
|
+
function it(t2, e2) {
|
|
461
464
|
const n2 = document.createElement("div");
|
|
462
465
|
n2.className = `ntbl-insert-line ntbl-insert-line--${t2}`, n2.setAttribute("contenteditable", "false"), n2.setAttribute("data-notectl-no-print", "");
|
|
463
|
-
const o2 =
|
|
466
|
+
const o2 = lt("ntbl-insert-btn", rt, e2 ?? ("horizontal" === t2 ? "Insert row" : "Insert column"));
|
|
464
467
|
return n2.appendChild(o2), n2;
|
|
465
468
|
}
|
|
466
|
-
function
|
|
469
|
+
function at(t2, e2) {
|
|
467
470
|
const n2 = document.createElement("button");
|
|
468
471
|
n2.className = `ntbl-add-zone ${t2}`, n2.type = "button", n2.setAttribute("contenteditable", "false"), n2.setAttribute("aria-label", e2), n2.setAttribute("data-notectl-no-print", ""), n2.title = e2;
|
|
469
472
|
const o2 = document.createElement("span");
|
|
470
|
-
return o2.className = "ntbl-add-icon", o2.innerHTML =
|
|
473
|
+
return o2.className = "ntbl-add-icon", o2.innerHTML = rt, n2.appendChild(o2), n2.addEventListener("mousedown", (t3) => {
|
|
471
474
|
t3.preventDefault(), t3.stopPropagation();
|
|
472
475
|
}), n2;
|
|
473
476
|
}
|
|
474
|
-
function
|
|
477
|
+
function st(t2) {
|
|
475
478
|
const e2 = document.createElement("div");
|
|
476
479
|
return e2.className = t2, e2.setAttribute("contenteditable", "false"), e2.setAttribute("data-notectl-no-print", ""), e2;
|
|
477
480
|
}
|
|
478
|
-
function
|
|
481
|
+
function ct(t2, e2) {
|
|
479
482
|
"none" === e2 ? (t2.style.backgroundColor = "transparent", t2.style.border = "1px dashed rgba(128,128,128,0.4)") : e2 ? (t2.style.backgroundColor = e2, t2.style.border = "1px solid rgba(0,0,0,0.15)") : (t2.style.backgroundColor = "var(--notectl-border)", t2.style.border = "1px solid rgba(0,0,0,0.15)");
|
|
480
483
|
}
|
|
481
|
-
function
|
|
484
|
+
function dt(t2, e2, n2, o2) {
|
|
482
485
|
const r2 = document.createElement("div");
|
|
483
486
|
r2.className = `ntbl-handle ${t2}`, r2.dataset.index = String(e2);
|
|
484
|
-
const l2 =
|
|
487
|
+
const l2 = lt("ntbl-handle-delete", '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M2 2l6 6M8 2l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>', n2);
|
|
485
488
|
return l2.addEventListener("click", (t3) => {
|
|
486
489
|
t3.preventDefault(), t3.stopPropagation(), o2(e2);
|
|
487
490
|
}), r2.appendChild(l2), r2;
|
|
488
491
|
}
|
|
489
|
-
function
|
|
492
|
+
function ut(t2, e2) {
|
|
490
493
|
let n2 = 0, o2 = 0, r2 = t2;
|
|
491
494
|
for (; r2 && r2 !== e2; ) n2 += r2.offsetTop, o2 += r2.offsetLeft, r2 = r2.offsetParent;
|
|
492
495
|
return { top: n2, left: o2 };
|
|
493
496
|
}
|
|
494
|
-
class
|
|
497
|
+
class bt {
|
|
495
498
|
tableId;
|
|
496
499
|
numRows;
|
|
497
500
|
numCols;
|
|
@@ -549,16 +552,16 @@ class ct {
|
|
|
549
552
|
onMouseLeave = () => {
|
|
550
553
|
this.hideInsertLines();
|
|
551
554
|
};
|
|
552
|
-
constructor(t2, e2, n2, o2, r2, l2, i2 =
|
|
553
|
-
if (this.container = t2, this.tableEl = e2, this.getState = o2, this.dispatchFn = r2, this.pluginContext = l2 ?? null, this.locale = i2, this.tableId = n2.id, this.numRows =
|
|
554
|
-
const t3 =
|
|
555
|
+
constructor(t2, e2, n2, o2, r2, l2, i2 = R) {
|
|
556
|
+
if (this.container = t2, this.tableEl = e2, this.getState = o2, this.dispatchFn = r2, this.pluginContext = l2 ?? null, this.locale = i2, this.tableId = n2.id, this.numRows = b(n2).length, this.numCols = this.countCols(n2), this.colBar = st("ntbl-col-bar"), this.rowBar = st("ntbl-row-bar"), this.insertLineH = it("horizontal", i2.insertRow), this.insertLineV = it("vertical", i2.insertColumn), this.addRowZone = at("ntbl-add-row", i2.addRow), this.addColZone = at("ntbl-add-col", i2.addColumn), this.deleteTableBtn = lt("ntbl-delete-table-btn", '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M9 3h6m-9 4h12M10 11v6m4-6v6m-9 3h14l-1-13H6L5 20z" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>', i2.deleteTable), this.deleteTableBtn.setAttribute("data-notectl-no-print", ""), l2) {
|
|
557
|
+
const t3 = z(o2(), this.tableId);
|
|
555
558
|
this.borderColorBtn = (function(t4) {
|
|
556
|
-
const e3 =
|
|
559
|
+
const e3 = lt("ntbl-border-color-btn", '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M3 3h18v18H3V3zm0 6h18M3 15h18M9 3v18M15 3v18" stroke="currentColor" stroke-width="1.5"/></svg>', "Border color");
|
|
557
560
|
e3.setAttribute("data-notectl-no-print", "");
|
|
558
561
|
const n3 = document.createElement("span");
|
|
559
|
-
return n3.className = "ntbl-border-color-swatch",
|
|
562
|
+
return n3.className = "ntbl-border-color-swatch", ct(n3, t4), e3.appendChild(n3), e3;
|
|
560
563
|
})(t3), this.actionsBtn = (function(t4) {
|
|
561
|
-
const e3 =
|
|
564
|
+
const e3 = lt("ntbl-actions-btn", '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/></svg>', t4 ?? "Table actions (Right-click or Shift+F10)");
|
|
562
565
|
return e3.setAttribute("data-notectl-no-print", ""), e3;
|
|
563
566
|
})(i2.tableActionsHint);
|
|
564
567
|
} else this.borderColorBtn = null, this.actionsBtn = null;
|
|
@@ -571,12 +574,12 @@ class ct {
|
|
|
571
574
|
}
|
|
572
575
|
update(t2) {
|
|
573
576
|
this.tableId = t2.id;
|
|
574
|
-
const e2 =
|
|
577
|
+
const e2 = b(t2).length, n2 = this.countCols(t2);
|
|
575
578
|
if (e2 === this.numRows && n2 === this.numCols || (this.numRows = e2, this.numCols = n2, this.rebuildColHandles(), this.rebuildRowHandles()), this.borderColorBtn) {
|
|
576
579
|
const e3 = this.borderColorBtn.querySelector(".ntbl-border-color-swatch");
|
|
577
580
|
if (e3) {
|
|
578
581
|
const n3 = t2.attrs?.borderColor;
|
|
579
|
-
|
|
582
|
+
ct(e3, n3);
|
|
580
583
|
}
|
|
581
584
|
}
|
|
582
585
|
requestAnimationFrame(() => this.positionControls());
|
|
@@ -587,15 +590,15 @@ class ct {
|
|
|
587
590
|
bindEventListeners() {
|
|
588
591
|
const t2 = this.insertLineH.querySelector(".ntbl-insert-btn"), e2 = this.insertLineV.querySelector(".ntbl-insert-btn");
|
|
589
592
|
if (t2.addEventListener("click", () => {
|
|
590
|
-
this.activeRowIndex >= 0 && this.dispatchTransaction(
|
|
593
|
+
this.activeRowIndex >= 0 && this.dispatchTransaction(j(this.getState(), this.tableId, this.activeRowIndex));
|
|
591
594
|
}), e2.addEventListener("click", () => {
|
|
592
|
-
this.activeColIndex >= 0 && this.dispatchTransaction(
|
|
595
|
+
this.activeColIndex >= 0 && this.dispatchTransaction(V(this.getState(), this.tableId, this.activeColIndex));
|
|
593
596
|
}), this.addRowZone.addEventListener("click", () => {
|
|
594
|
-
this.dispatchTransaction(
|
|
597
|
+
this.dispatchTransaction(j(this.getState(), this.tableId, this.numRows));
|
|
595
598
|
}), this.addColZone.addEventListener("click", () => {
|
|
596
|
-
this.dispatchTransaction(
|
|
599
|
+
this.dispatchTransaction(V(this.getState(), this.tableId, this.numCols));
|
|
597
600
|
}), this.deleteTableBtn.addEventListener("click", () => {
|
|
598
|
-
this.dispatchTransaction(
|
|
601
|
+
this.dispatchTransaction(O(this.getState(), this.tableId));
|
|
599
602
|
}), this.borderColorBtn && this.pluginContext) {
|
|
600
603
|
const t3 = this.pluginContext;
|
|
601
604
|
this.borderColorBtn.addEventListener("click", () => {
|
|
@@ -614,12 +617,12 @@ class ct {
|
|
|
614
617
|
if (this.activeContextMenu?.isOpen()) return this.activeContextMenu.close(), void (this.activeContextMenu = null);
|
|
615
618
|
if (!this.actionsBtn) return;
|
|
616
619
|
const e2 = this.actionsBtn.getBoundingClientRect(), n2 = new DOMRect(e2.left, e2.bottom + 4, 0, 0);
|
|
617
|
-
this.activeContextMenu =
|
|
620
|
+
this.activeContextMenu = X(this.container, t2, this.tableId, n2, () => {
|
|
618
621
|
this.activeContextMenu = null;
|
|
619
622
|
}, this.locale);
|
|
620
623
|
}
|
|
621
624
|
toggleBorderColorPopup(t2) {
|
|
622
|
-
this.borderColorPopup ? this.closeBorderColorPopup() : (this.borderColorPopup = document.createElement("div"), this.borderColorPopup.className = "notectl-table-context-menu", this.borderColorPopup.style.position = "absolute", this.borderColorPopup.style.top = "24px", this.borderColorPopup.style.left = "24px", this.borderColorPopup.style.zIndex = "10000", this.borderColorPopup.setAttribute("contenteditable", "false"),
|
|
625
|
+
this.borderColorPopup ? this.closeBorderColorPopup() : (this.borderColorPopup = document.createElement("div"), this.borderColorPopup.className = "notectl-table-context-menu", this.borderColorPopup.style.position = "absolute", this.borderColorPopup.style.top = "24px", this.borderColorPopup.style.left = "24px", this.borderColorPopup.style.zIndex = "10000", this.borderColorPopup.setAttribute("contenteditable", "false"), F(this.borderColorPopup, t2, this.tableId, () => {
|
|
623
626
|
this.closeBorderColorPopup();
|
|
624
627
|
}, this.locale), this.container.appendChild(this.borderColorPopup));
|
|
625
628
|
}
|
|
@@ -630,8 +633,8 @@ class ct {
|
|
|
630
633
|
t2 && this.dispatchFn(t2);
|
|
631
634
|
}
|
|
632
635
|
countCols(t2) {
|
|
633
|
-
const e2 =
|
|
634
|
-
return e2[0] ?
|
|
636
|
+
const e2 = b(t2);
|
|
637
|
+
return e2[0] ? b(e2[0]).length : 0;
|
|
635
638
|
}
|
|
636
639
|
positionControls() {
|
|
637
640
|
!(function(t2, e2, n2) {
|
|
@@ -657,18 +660,18 @@ class ct {
|
|
|
657
660
|
}
|
|
658
661
|
t2.style.height = `${l2}px`;
|
|
659
662
|
})(this.rowBar, this.tableEl), (function(t2, e2, n2, o2) {
|
|
660
|
-
const r2 =
|
|
663
|
+
const r2 = ut(n2, o2), l2 = n2.offsetHeight, i2 = n2.offsetWidth;
|
|
661
664
|
t2.style.width = `${i2}px`, t2.style.left = `${r2.left}px`, e2.style.height = `${l2}px`, e2.style.top = `${r2.top}px`;
|
|
662
665
|
})(this.addRowZone, this.addColZone, this.tableEl, this.container);
|
|
663
666
|
}
|
|
664
667
|
showHorizontalLine(t2) {
|
|
665
668
|
this.activeRowIndex = t2.index;
|
|
666
|
-
const e2 =
|
|
669
|
+
const e2 = ut(this.tableEl, this.container);
|
|
667
670
|
this.insertLineH.style.top = e2.top + t2.position - 1 + "px", this.insertLineH.style.left = `${e2.left}px`, this.insertLineH.style.width = `${this.tableEl.offsetWidth}px`, this.insertLineH.classList.add("ntbl-insert-line--visible");
|
|
668
671
|
}
|
|
669
672
|
showVerticalLine(t2) {
|
|
670
673
|
this.activeColIndex = t2.index;
|
|
671
|
-
const e2 =
|
|
674
|
+
const e2 = ut(this.tableEl, this.container);
|
|
672
675
|
this.insertLineV.style.left = e2.left + t2.position - 1 + "px", this.insertLineV.style.top = `${e2.top}px`, this.insertLineV.style.height = `${this.tableEl.offsetHeight}px`, this.insertLineV.classList.add("ntbl-insert-line--visible");
|
|
673
676
|
}
|
|
674
677
|
hideInsertLines() {
|
|
@@ -683,8 +686,8 @@ class ct {
|
|
|
683
686
|
rebuildColHandles() {
|
|
684
687
|
this.colBar.innerHTML = "";
|
|
685
688
|
for (let t2 = 0; t2 < this.numCols; t2++) {
|
|
686
|
-
const e2 =
|
|
687
|
-
this.dispatchTransaction(
|
|
689
|
+
const e2 = dt("ntbl-col-handle", t2, "Delete column", (t3) => {
|
|
690
|
+
this.dispatchTransaction(q(this.getState(), this.tableId, t3));
|
|
688
691
|
});
|
|
689
692
|
this.colBar.appendChild(e2);
|
|
690
693
|
}
|
|
@@ -692,19 +695,19 @@ class ct {
|
|
|
692
695
|
rebuildRowHandles() {
|
|
693
696
|
this.rowBar.innerHTML = "";
|
|
694
697
|
for (let t2 = 0; t2 < this.numRows; t2++) {
|
|
695
|
-
const e2 =
|
|
696
|
-
this.dispatchTransaction(
|
|
698
|
+
const e2 = dt("ntbl-row-handle", t2, "Delete row", (t3) => {
|
|
699
|
+
this.dispatchTransaction(Z(this.getState(), this.tableId, t3));
|
|
697
700
|
});
|
|
698
701
|
this.rowBar.appendChild(e2);
|
|
699
702
|
}
|
|
700
703
|
}
|
|
701
704
|
}
|
|
702
|
-
function
|
|
705
|
+
function ht(t2, e2) {
|
|
703
706
|
"none" === e2 ? (t2.style.setProperty("--ntbl-border-color", "transparent"), t2.classList.add("notectl-table--borderless")) : e2 ? (t2.style.setProperty("--ntbl-border-color", e2), t2.classList.remove("notectl-table--borderless")) : (t2.style.removeProperty("--ntbl-border-color"), t2.classList.remove("notectl-table--borderless"));
|
|
704
707
|
}
|
|
705
|
-
const
|
|
706
|
-
const
|
|
707
|
-
class
|
|
708
|
+
const pt = new t("tableSelection");
|
|
709
|
+
const ft = { maxPickerRows: 8, maxPickerCols: 8 }, mt = "border-collapse: collapse; width: 100%; table-layout: fixed";
|
|
710
|
+
class gt {
|
|
708
711
|
id = "table";
|
|
709
712
|
name = "Table";
|
|
710
713
|
priority = 40;
|
|
@@ -714,78 +717,78 @@ class ht {
|
|
|
714
717
|
cleanupMouseSelection = null;
|
|
715
718
|
context = null;
|
|
716
719
|
constructor(t2) {
|
|
717
|
-
this.config = { ...
|
|
720
|
+
this.config = { ...ft, ...t2 };
|
|
718
721
|
}
|
|
719
722
|
init(t2) {
|
|
720
|
-
this.locale = e(B, t2, this.config.locale), t2.registerStyleSheet('\n/* Table */\n.notectl-table-wrapper {\n margin: 8px 0;\n overflow-x: auto;\n position: relative;\n}\n\n.notectl-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.notectl-table td {\n border: 1px solid var(--ntbl-border-color, var(--notectl-border));\n padding: 8px 12px;\n min-width: 60px;\n vertical-align: top;\n min-height: 1.6em;\n}\n\n.notectl-table--borderless td {\n border: 1px dashed rgba(128, 128, 128, 0.15);\n}\n\n@media print {\n .notectl-table--borderless td {\n border: none;\n }\n}\n\n.notectl-table td:focus-within {\n outline: 2px solid var(--notectl-primary);\n outline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n background: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n position: fixed;\n background: var(--notectl-surface-overlay);\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n box-shadow: 0 4px 12px var(--notectl-shadow);\n padding: 4px 0;\n min-width: 180px;\n z-index: 10000;\n}\n\n.notectl-table-context-menu button {\n display: block;\n width: 100%;\n padding: 8px 12px;\n text-align: left;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n font-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n position: relative;\n margin: 8px 0;\n padding: 24px 0 0 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n margin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n outline: 2px solid var(--notectl-primary-fg);\n outline-offset: 2px;\n border-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n position: absolute;\n top: 0;\n left: 24px;\n height: 20px;\n display: flex;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n position: absolute;\n top: 24px;\n left: 0;\n width: 20px;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background 0.15s ease;\n border-radius: 3px;\n}\n\n.ntbl-col-handle {\n height: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n background: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n width: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 0 0 4px;\n}\n\n.ntbl-row-handle:hover {\n background: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n border: none;\n background: transparent;\n color: var(--notectl-fg-muted);\n cursor: pointer;\n border-radius: 3px;\n padding: 0;\n opacity: 0;\n transform: scale(0.7);\n transition: opacity 0.15s, transform 0.15s,\n background 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n opacity: 1;\n transform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n background: var(--notectl-danger-muted);\n color: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n position: absolute;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n z-index: 6;\n}\n\n.ntbl-insert-line--visible {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n height: 2px;\n background: linear-gradient(\n 90deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n width: 2px;\n background: linear-gradient(\n 180deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: var(--notectl-bg);\n border: 2px solid var(--notectl-primary);\n color: var(--notectl-primary);\n cursor: pointer;\n pointer-events: all;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n box-shadow: 0 2px 8px var(--notectl-focus-ring);\n transition: background 0.15s, color 0.15s,\n transform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n left: 50%;\n top: -9px;\n transform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n top: 50%;\n left: -9px;\n transform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n background: var(--notectl-primary);\n color: var(--notectl-bg);\n box-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n transform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n transform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n user-select: none;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease,\n border-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn {\n position: absolute;\n top: 0;\n left: 0;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-danger);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-danger);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n background: var(--notectl-danger-muted);\n border-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Context Menu Discovery Hint --- */\n.ntbl-context-hint {\n position: absolute;\n top: 4px;\n right: 0;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n padding: 2px 8px;\n border-radius: 4px;\n opacity: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n white-space: nowrap;\n z-index: 5;\n}\n\n.ntbl-container:hover .ntbl-context-hint,\n.ntbl-container:focus-within .ntbl-context-hint,\n.ntbl-container.notectl-table--selected .ntbl-context-hint {\n opacity: 1;\n}\n\n/* --- Table Actions Button --- */\n.ntbl-actions-btn {\n position: absolute;\n top: 0;\n left: 48px;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-fg-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n cursor: pointer;\n padding: 0;\n}\n\n.ntbl-container:hover .ntbl-actions-btn,\n.ntbl-container:focus-within .ntbl-actions-btn,\n.ntbl-container.notectl-table--selected .ntbl-actions-btn {\n opacity: 1;\n}\n\n.ntbl-actions-btn:hover,\n.ntbl-actions-btn:focus-visible {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-primary);\n}\n\n.ntbl-actions-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Border Color Button --- */\n.ntbl-border-color-btn {\n position: absolute;\n top: 0;\n left: 24px;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-fg-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n cursor: pointer;\n padding: 0;\n}\n\n.ntbl-container:hover .ntbl-border-color-btn,\n.ntbl-container:focus-within .ntbl-border-color-btn,\n.ntbl-container.notectl-table--selected .ntbl-border-color-btn {\n opacity: 1;\n}\n\n.ntbl-border-color-btn:hover,\n.ntbl-border-color-btn:focus-visible {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-primary);\n}\n\n.ntbl-border-color-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-border-color-swatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n}\n\n/* --- Context Menu Keyboard Hint --- */\n.notectl-table-context-menu__hint {\n padding: 4px 12px 6px;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n border-top: 1px solid var(--notectl-border);\n margin-top: 4px;\n text-align: center;\n user-select: none;\n}\n\n/* --- Context Menu Focus --- */\n.notectl-table-context-menu button:focus-visible {\n outline: none;\n background: var(--notectl-primary-muted);\n box-shadow: inset 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-table-context-menu [role="separator"] {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 4px 0;\n height: 0;\n}\n\n.ntbl-add-row {\n bottom: 0;\n height: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 0 6px 6px;\n border-top: none;\n color: var(--notectl-fg-muted);\n transform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n right: 0;\n top: 24px;\n width: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 6px 6px 0;\n border-left: none;\n color: var(--notectl-fg-muted);\n transform: translateX(100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n transform: scale(1.15);\n}\n'), this.context = t2, this.registerNodeSpecs(t2), this.registerNodeViews(t2), K(t2, this.locale), t2.registerCommand("resetTableBorderColor", () => H(t2, this.locale)), (function(t3, e2) {
|
|
721
|
-
const
|
|
722
|
-
return
|
|
723
|
+
this.locale = e(D, t2, this.config.locale), t2.registerStyleSheet('\n/* Table */\n.notectl-table-wrapper {\n margin: 8px 0;\n overflow-x: auto;\n position: relative;\n}\n\n.notectl-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.notectl-table td {\n border: 1px solid var(--ntbl-border-color, var(--notectl-border));\n padding: 8px 12px;\n min-width: 60px;\n vertical-align: top;\n min-height: 1.6em;\n}\n\n.notectl-table--borderless td {\n border: 1px dashed rgba(128, 128, 128, 0.15);\n}\n\n@media print {\n .notectl-table--borderless td {\n border: none;\n }\n}\n\n.notectl-table td:focus-within {\n outline: 2px solid var(--notectl-primary);\n outline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n background: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n position: fixed;\n background: var(--notectl-surface-overlay);\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n box-shadow: 0 4px 12px var(--notectl-shadow);\n padding: 4px 0;\n min-width: 180px;\n z-index: 10000;\n}\n\n.notectl-table-context-menu button {\n display: block;\n width: 100%;\n padding: 8px 12px;\n text-align: left;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n font-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n position: relative;\n margin: 8px 0;\n padding: 24px 0 0 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n margin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n outline: 2px solid var(--notectl-primary-fg);\n outline-offset: 2px;\n border-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n position: absolute;\n top: 0;\n left: 24px;\n height: 20px;\n display: flex;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n position: absolute;\n top: 24px;\n left: 0;\n width: 20px;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background 0.15s ease;\n border-radius: 3px;\n}\n\n.ntbl-col-handle {\n height: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n background: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n width: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 0 0 4px;\n}\n\n.ntbl-row-handle:hover {\n background: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n border: none;\n background: transparent;\n color: var(--notectl-fg-muted);\n cursor: pointer;\n border-radius: 3px;\n padding: 0;\n opacity: 0;\n transform: scale(0.7);\n transition: opacity 0.15s, transform 0.15s,\n background 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n opacity: 1;\n transform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n background: var(--notectl-danger-muted);\n color: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n position: absolute;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n z-index: 6;\n}\n\n.ntbl-insert-line--visible {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n height: 2px;\n background: linear-gradient(\n 90deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n width: 2px;\n background: linear-gradient(\n 180deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: var(--notectl-bg);\n border: 2px solid var(--notectl-primary);\n color: var(--notectl-primary);\n cursor: pointer;\n pointer-events: all;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n box-shadow: 0 2px 8px var(--notectl-focus-ring);\n transition: background 0.15s, color 0.15s,\n transform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n left: 50%;\n top: -9px;\n transform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n top: 50%;\n left: -9px;\n transform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n background: var(--notectl-primary);\n color: var(--notectl-bg);\n box-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n transform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n transform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n user-select: none;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease,\n border-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn {\n position: absolute;\n top: 0;\n left: 0;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-danger);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-danger);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n background: var(--notectl-danger-muted);\n border-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Context Menu Discovery Hint --- */\n.ntbl-context-hint {\n position: absolute;\n top: 4px;\n right: 0;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n padding: 2px 8px;\n border-radius: 4px;\n opacity: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n white-space: nowrap;\n z-index: 5;\n}\n\n.ntbl-container:hover .ntbl-context-hint,\n.ntbl-container:focus-within .ntbl-context-hint,\n.ntbl-container.notectl-table--selected .ntbl-context-hint {\n opacity: 1;\n}\n\n/* --- Table Actions Button --- */\n.ntbl-actions-btn {\n position: absolute;\n top: 0;\n left: 48px;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-fg-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n cursor: pointer;\n padding: 0;\n}\n\n.ntbl-container:hover .ntbl-actions-btn,\n.ntbl-container:focus-within .ntbl-actions-btn,\n.ntbl-container.notectl-table--selected .ntbl-actions-btn {\n opacity: 1;\n}\n\n.ntbl-actions-btn:hover,\n.ntbl-actions-btn:focus-visible {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-primary);\n}\n\n.ntbl-actions-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Border Color Button --- */\n.ntbl-border-color-btn {\n position: absolute;\n top: 0;\n left: 24px;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-fg-muted);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n cursor: pointer;\n padding: 0;\n}\n\n.ntbl-container:hover .ntbl-border-color-btn,\n.ntbl-container:focus-within .ntbl-border-color-btn,\n.ntbl-container.notectl-table--selected .ntbl-border-color-btn {\n opacity: 1;\n}\n\n.ntbl-border-color-btn:hover,\n.ntbl-border-color-btn:focus-visible {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-primary);\n}\n\n.ntbl-border-color-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-border-color-swatch {\n width: 10px;\n height: 10px;\n border-radius: 2px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n}\n\n/* --- Context Menu Keyboard Hint --- */\n.notectl-table-context-menu__hint {\n padding: 4px 12px 6px;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n border-top: 1px solid var(--notectl-border);\n margin-top: 4px;\n text-align: center;\n user-select: none;\n}\n\n/* --- Context Menu Focus --- */\n.notectl-table-context-menu button:focus-visible {\n outline: none;\n background: var(--notectl-primary-muted);\n box-shadow: inset 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-table-context-menu [role="separator"] {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 4px 0;\n height: 0;\n}\n\n.ntbl-add-row {\n bottom: 0;\n height: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 0 6px 6px;\n border-top: none;\n color: var(--notectl-fg-muted);\n transform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n right: 0;\n top: 24px;\n width: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 6px 6px 0;\n border-left: none;\n color: var(--notectl-fg-muted);\n transform: translateX(100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n transform: scale(1.15);\n}\n'), this.context = t2, this.registerNodeSpecs(t2), this.registerNodeViews(t2), W(t2, this.locale), t2.registerCommand("resetTableBorderColor", () => P(t2, this.locale)), (function(t3, e2) {
|
|
724
|
+
const n2 = { Tab: () => (function(t4, e3) {
|
|
725
|
+
return J(t4, (n3, o2, r2) => r2.colIndex < r2.totalCols - 1 ? et(t4, r2.tableId, r2.rowIndex, r2.colIndex + 1) : r2.rowIndex < r2.totalRows - 1 ? et(t4, r2.tableId, r2.rowIndex + 1, 0) : (U(t4, e3), true));
|
|
723
726
|
})(t3, e2), "Shift-Tab": () => (function(t4) {
|
|
724
|
-
return
|
|
727
|
+
return J(t4, (e3, n3, o2) => o2.colIndex > 0 ? et(t4, o2.tableId, o2.rowIndex, o2.colIndex - 1) : !(o2.rowIndex > 0) || et(t4, o2.tableId, o2.rowIndex - 1, o2.totalCols - 1));
|
|
725
728
|
})(t3), Enter: () => (function(t4) {
|
|
726
729
|
const e3 = t4.getState();
|
|
727
|
-
if (
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
730
|
-
const
|
|
731
|
-
return !!
|
|
730
|
+
if (o(e3.selection) || r(e3.selection)) return false;
|
|
731
|
+
const n3 = e3.getBlock(e3.selection.anchor.blockId);
|
|
732
|
+
if (n3 && "paragraph" !== n3.type) return false;
|
|
733
|
+
const l2 = v(e3, e3.selection.anchor.blockId);
|
|
734
|
+
return !!l2 && (!(l2.rowIndex < l2.totalRows - 1) || et(t4, l2.tableId, l2.rowIndex + 1, l2.colIndex));
|
|
732
735
|
})(t3), Backspace: () => (function(t4) {
|
|
733
|
-
return
|
|
734
|
-
if (!
|
|
735
|
-
if (0 !==
|
|
736
|
-
if (0 !==
|
|
737
|
-
const r2 =
|
|
738
|
-
return
|
|
736
|
+
return J(t4, (e3, n3, o2) => {
|
|
737
|
+
if (!a(n3)) return false;
|
|
738
|
+
if (0 !== n3.anchor.offset) return false;
|
|
739
|
+
if (0 !== o2.rowIndex || 0 !== o2.colIndex) return false;
|
|
740
|
+
const r2 = C(e3, o2.cellId);
|
|
741
|
+
return n3.anchor.blockId === r2 && ot(t4, o2.tableId);
|
|
739
742
|
});
|
|
740
743
|
})(t3), Delete: () => (function(t4) {
|
|
741
|
-
return
|
|
742
|
-
if (!
|
|
743
|
-
const r2 = e3.getBlock(
|
|
744
|
+
return J(t4, (e3, n3, o2) => {
|
|
745
|
+
if (!a(n3)) return false;
|
|
746
|
+
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
744
747
|
if (!r2) return false;
|
|
745
|
-
const
|
|
746
|
-
if (
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
return
|
|
748
|
+
const l2 = m(r2);
|
|
749
|
+
if (n3.anchor.offset !== l2) return false;
|
|
750
|
+
if (o2.rowIndex !== o2.totalRows - 1 || o2.colIndex !== o2.totalCols - 1) return false;
|
|
751
|
+
const i2 = y(e3, o2.cellId);
|
|
752
|
+
return n3.anchor.blockId === i2 && ot(t4, o2.tableId);
|
|
750
753
|
});
|
|
751
754
|
})(t3), ArrowDown: () => (function(t4) {
|
|
752
|
-
return
|
|
753
|
-
const r2 =
|
|
754
|
-
return
|
|
755
|
+
return J(t4, (e3, n3, o2) => {
|
|
756
|
+
const r2 = y(e3, o2.cellId);
|
|
757
|
+
return n3.anchor.blockId === r2 && (o2.rowIndex >= o2.totalRows - 1 ? Q(t4) : et(t4, o2.tableId, o2.rowIndex + 1, o2.colIndex));
|
|
755
758
|
});
|
|
756
759
|
})(t3), ArrowUp: () => (function(t4) {
|
|
757
|
-
return
|
|
758
|
-
const r2 =
|
|
759
|
-
return
|
|
760
|
+
return J(t4, (e3, n3, o2) => {
|
|
761
|
+
const r2 = C(e3, o2.cellId);
|
|
762
|
+
return n3.anchor.blockId === r2 && !(o2.rowIndex <= 0) && et(t4, o2.tableId, o2.rowIndex - 1, o2.colIndex);
|
|
760
763
|
});
|
|
761
764
|
})(t3), ArrowRight: () => (function(t4) {
|
|
762
|
-
return
|
|
763
|
-
if (!
|
|
764
|
-
const r2 = e3.getBlock(
|
|
765
|
+
return J(t4, (e3, n3, o2) => {
|
|
766
|
+
if (!a(n3)) return false;
|
|
767
|
+
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
765
768
|
if (!r2) return false;
|
|
766
|
-
const
|
|
767
|
-
if (
|
|
768
|
-
const
|
|
769
|
-
return
|
|
769
|
+
const l2 = m(r2);
|
|
770
|
+
if (n3.anchor.offset !== l2) return false;
|
|
771
|
+
const i2 = y(e3, o2.cellId);
|
|
772
|
+
return n3.anchor.blockId === i2 && (o2.colIndex < o2.totalCols - 1 ? et(t4, o2.tableId, o2.rowIndex, o2.colIndex + 1) : !(o2.rowIndex < o2.totalRows - 1) || et(t4, o2.tableId, o2.rowIndex + 1, 0));
|
|
770
773
|
});
|
|
771
774
|
})(t3), ArrowLeft: () => (function(t4) {
|
|
772
|
-
return
|
|
773
|
-
if (!
|
|
774
|
-
if (0 !==
|
|
775
|
-
const r2 =
|
|
776
|
-
return
|
|
775
|
+
return J(t4, (e3, n3, o2) => {
|
|
776
|
+
if (!a(n3)) return false;
|
|
777
|
+
if (0 !== n3.anchor.offset) return false;
|
|
778
|
+
const r2 = C(e3, o2.cellId);
|
|
779
|
+
return n3.anchor.blockId === r2 && (o2.colIndex > 0 ? nt(t4, o2.tableId, o2.rowIndex, o2.colIndex - 1) : !(o2.rowIndex > 0) || nt(t4, o2.tableId, o2.rowIndex - 1, o2.totalCols - 1));
|
|
777
780
|
});
|
|
778
|
-
})(t3), Escape: () =>
|
|
779
|
-
return
|
|
780
|
-
const r2 = t4.getContainer(), l2 = r2.querySelector(`[data-block-id="${
|
|
781
|
+
})(t3), Escape: () => Q(t3), "Shift-F10": () => (function(t4) {
|
|
782
|
+
return J(t4, (e3, n3, o2) => {
|
|
783
|
+
const r2 = t4.getContainer(), l2 = r2.querySelector(`[data-block-id="${o2.cellId}"]`);
|
|
781
784
|
if (!l2) return false;
|
|
782
|
-
const i2 = l2.getBoundingClientRect(), a2 = new DOMRect(i2.left + i2.width / 2, i2.bottom, 0, 0), s2 = r2.querySelector(`[data-block-id="${
|
|
783
|
-
return
|
|
784
|
-
|
|
785
|
+
const i2 = l2.getBoundingClientRect(), a2 = new DOMRect(i2.left + i2.width / 2, i2.bottom, 0, 0), s2 = r2.querySelector(`[data-block-id="${o2.tableId}"].ntbl-container`) ?? r2;
|
|
786
|
+
return tt?.close(), tt = X(s2, t4, o2.tableId, a2, () => {
|
|
787
|
+
tt = null;
|
|
785
788
|
}), true;
|
|
786
789
|
});
|
|
787
790
|
})(t3) };
|
|
788
|
-
t3.registerKeymap(
|
|
791
|
+
t3.registerKeymap(n2, { priority: "context" });
|
|
789
792
|
})(t2, this.locale), this.registerToolbarItem(t2), this.selectionService = (function(t3) {
|
|
790
793
|
let e2 = null, n2 = [], o2 = /* @__PURE__ */ new Set();
|
|
791
794
|
const r2 = { getSelectedRange: () => e2, setSelectedRange(r3) {
|
|
@@ -793,7 +796,7 @@ class ht {
|
|
|
793
796
|
if (!e2) return n2 = [], void (o2 = /* @__PURE__ */ new Set());
|
|
794
797
|
const r4 = t3.getState(), l2 = [], i2 = Math.min(e2.fromRow, e2.toRow), a2 = Math.max(e2.fromRow, e2.toRow), s2 = Math.min(e2.fromCol, e2.toCol), c2 = Math.max(e2.fromCol, e2.toCol);
|
|
795
798
|
for (let t4 = i2; t4 <= a2; t4++) for (let n3 = s2; n3 <= c2; n3++) {
|
|
796
|
-
const o3 =
|
|
799
|
+
const o3 = x(r4, e2.tableId, t4, n3);
|
|
797
800
|
o3 && l2.push(o3);
|
|
798
801
|
}
|
|
799
802
|
n2 = l2, o2 = new Set(l2);
|
|
@@ -805,7 +808,7 @@ class ht {
|
|
|
805
808
|
}
|
|
806
809
|
})(t3, o2);
|
|
807
810
|
}, getSelectedCellIds: () => n2, isSelected: (t4) => o2.has(t4) };
|
|
808
|
-
return t3.registerService(
|
|
811
|
+
return t3.registerService(pt, r2), r2;
|
|
809
812
|
})(t2);
|
|
810
813
|
}
|
|
811
814
|
onReady() {
|
|
@@ -816,13 +819,13 @@ class ht {
|
|
|
816
819
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
817
820
|
if (l3) if (n3.shiftKey) {
|
|
818
821
|
if (o2) {
|
|
819
|
-
const r3 =
|
|
822
|
+
const r3 = v(t2.getState(), l3.getAttribute("data-block-id"));
|
|
820
823
|
if (!r3 || r3.tableId !== o2.tableId) return;
|
|
821
824
|
n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: r3.rowIndex, toCol: r3.colIndex });
|
|
822
825
|
}
|
|
823
826
|
} else {
|
|
824
827
|
e2.setSelectedRange(null);
|
|
825
|
-
const n4 =
|
|
828
|
+
const n4 = v(t2.getState(), l3.getAttribute("data-block-id"));
|
|
826
829
|
if (!n4) return;
|
|
827
830
|
o2 = { tableId: n4.tableId, row: n4.rowIndex, col: n4.colIndex }, r2 = true;
|
|
828
831
|
}
|
|
@@ -832,7 +835,7 @@ class ht {
|
|
|
832
835
|
if (!r2 || !o2) return;
|
|
833
836
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
834
837
|
if (!l3) return;
|
|
835
|
-
const i3 =
|
|
838
|
+
const i3 = v(t2.getState(), l3.getAttribute("data-block-id"));
|
|
836
839
|
i3 && i3.tableId === o2.tableId && (i3.rowIndex === o2.row && i3.colIndex === o2.col || (n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: i3.rowIndex, toCol: i3.colIndex })));
|
|
837
840
|
}
|
|
838
841
|
function a2() {
|
|
@@ -846,26 +849,34 @@ class ht {
|
|
|
846
849
|
destroy() {
|
|
847
850
|
this.cleanupMouseSelection?.(), this.cleanupMouseSelection = null, this.selectionService = null, this.context = null;
|
|
848
851
|
}
|
|
849
|
-
onStateChange(t2, e2,
|
|
852
|
+
onStateChange(t2, e2, n2) {
|
|
850
853
|
if (this.selectionService?.getSelectedRange()) {
|
|
851
854
|
const t3 = e2.selection;
|
|
852
|
-
|
|
855
|
+
(o(t3) || r(t3) || !I(e2, t3.anchor.blockId)) && this.selectionService.setSelectedRange(null);
|
|
853
856
|
}
|
|
854
857
|
}
|
|
855
858
|
registerNodeSpecs(t2) {
|
|
856
859
|
t2.registerNodeSpec({ type: "table", group: "block", content: { allow: ["table_row"], min: 1 }, isolating: true, selectable: true, toDOM(t3) {
|
|
857
860
|
const e2 = document.createElement("div");
|
|
858
861
|
return e2.className = "notectl-table-wrapper", e2.setAttribute("data-block-id", t3.id), e2;
|
|
859
|
-
}
|
|
862
|
+
}, toHTML(t3, e2) {
|
|
863
|
+
const o2 = t3.attrs?.borderColor, r2 = (function(t4) {
|
|
864
|
+
return t4 ? "none" === t4 ? `${mt}; --ntbl-bc: transparent` : d(t4) ? `${mt}; --ntbl-bc: ${n(t4)}` : mt : mt;
|
|
865
|
+
})(o2);
|
|
866
|
+
return `<table style="${r2}">${e2}</table>`;
|
|
867
|
+
}, sanitize: { tags: ["table", "tbody"] } }), t2.registerNodeSpec({ type: "table_row", group: "table_content", content: { allow: ["table_cell"], min: 1 }, toDOM(t3) {
|
|
860
868
|
const e2 = document.createElement("tr");
|
|
861
869
|
return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "row"), e2;
|
|
862
|
-
} }), t2.registerNodeSpec({ type: "table_cell", group: "table_content", content: { allow: ["paragraph", "list_item", "heading", "blockquote", "image", "horizontal_rule"] }, isolating: true, toDOM(t3) {
|
|
870
|
+
}, toHTML: (t3, e2) => `<tr>${e2}</tr>`, sanitize: { tags: ["tr"] } }), t2.registerNodeSpec({ type: "table_cell", group: "table_content", content: { allow: ["paragraph", "list_item", "heading", "blockquote", "image", "horizontal_rule"] }, isolating: true, toDOM(t3) {
|
|
863
871
|
const e2 = document.createElement("td");
|
|
864
872
|
return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "cell"), e2;
|
|
865
|
-
}
|
|
873
|
+
}, toHTML(t3, e2) {
|
|
874
|
+
const n2 = t3.attrs?.colspan ?? 1, o2 = t3.attrs?.rowspan ?? 1, r2 = [' style="border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top"'];
|
|
875
|
+
return n2 > 1 && r2.push(` colspan="${n2}"`), o2 > 1 && r2.push(` rowspan="${o2}"`), `<td${r2.join("")}>${e2}</td>`;
|
|
876
|
+
}, sanitize: { tags: ["td"], attrs: ["colspan", "rowspan"] } });
|
|
866
877
|
}
|
|
867
878
|
registerNodeViews(t2) {
|
|
868
|
-
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 =
|
|
879
|
+
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 = R) {
|
|
869
880
|
return (t4, o2, r2) => {
|
|
870
881
|
const l2 = document.createElement("div");
|
|
871
882
|
l2.className = "ntbl-container", l2.setAttribute("data-block-id", t4.id), l2.setAttribute("data-selectable", "true");
|
|
@@ -873,29 +884,29 @@ class ht {
|
|
|
873
884
|
i2.className = "notectl-table-wrapper";
|
|
874
885
|
const a2 = document.createElement("table");
|
|
875
886
|
a2.className = "notectl-table", a2.setAttribute("role", "table");
|
|
876
|
-
const s2 =
|
|
877
|
-
a2.setAttribute("aria-label", n2.tableAriaLabel(
|
|
878
|
-
const
|
|
879
|
-
a2.appendChild(
|
|
887
|
+
const s2 = b(t4), c2 = s2.length, d2 = s2[0] ? b(s2[0]).length : 0;
|
|
888
|
+
a2.setAttribute("aria-label", n2.tableAriaLabel(c2, d2)), a2.setAttribute("aria-description", n2.tableAriaDescription);
|
|
889
|
+
const u2 = document.createElement("tbody");
|
|
890
|
+
a2.appendChild(u2), i2.appendChild(a2), l2.appendChild(i2), ht(a2, t4.attrs?.borderColor);
|
|
880
891
|
const h2 = document.createElement("div");
|
|
881
892
|
h2.className = "notectl-sr-only", h2.setAttribute("aria-live", "polite"), h2.setAttribute("aria-atomic", "true"), l2.appendChild(h2);
|
|
882
893
|
const p2 = (function(t5, e3, n3, o3, r3, l3, i3) {
|
|
883
|
-
return new
|
|
894
|
+
return new bt(t5, e3, n3, o3, r3, l3, i3);
|
|
884
895
|
})(l2, a2, t4, o2, r2, e2, n2);
|
|
885
896
|
let f2 = null, m2 = t4.id;
|
|
886
897
|
const g2 = (t5) => {
|
|
887
898
|
if (!e2) return;
|
|
888
899
|
t5.preventDefault(), t5.stopPropagation(), f2?.close();
|
|
889
900
|
const o3 = new DOMRect(t5.clientX, t5.clientY, 0, 0);
|
|
890
|
-
f2 =
|
|
901
|
+
f2 = X(l2, e2, m2, o3, () => {
|
|
891
902
|
f2 = null;
|
|
892
903
|
}, n2);
|
|
893
904
|
};
|
|
894
|
-
return a2.addEventListener("contextmenu", g2), { dom: l2, contentDOM:
|
|
905
|
+
return a2.addEventListener("contextmenu", g2), { dom: l2, contentDOM: u2, update(t5) {
|
|
895
906
|
if ("table" !== t5.type) return false;
|
|
896
907
|
m2 = t5.id, l2.setAttribute("data-block-id", t5.id), l2.setAttribute("data-selectable", "true");
|
|
897
|
-
const e3 =
|
|
898
|
-
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)),
|
|
908
|
+
const e3 = b(t5), o3 = e3.length, r3 = e3[0] ? b(e3[0]).length : 0;
|
|
909
|
+
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)), ht(a2, t5.attrs?.borderColor), p2.update(t5), false;
|
|
899
910
|
}, destroy() {
|
|
900
911
|
f2?.destroy(), a2.removeEventListener("contextmenu", g2), p2.destroy();
|
|
901
912
|
}, selectNode() {
|
|
@@ -924,30 +935,30 @@ class ht {
|
|
|
924
935
|
});
|
|
925
936
|
}
|
|
926
937
|
registerToolbarItem(t2) {
|
|
927
|
-
const e2 = this.config.maxPickerRows ?? 8,
|
|
928
|
-
t2.registerToolbarItem({ id: "table", group: "insert", icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>', label: this.locale.insertTable, tooltip: this.locale.insertTable, command: "insertTable", priority: 80, separatorAfter: this.config.separatorAfter, popupType: "gridPicker", popupConfig: { maxRows: e2, maxCols:
|
|
929
|
-
|
|
930
|
-
} }, isActive: (t3) => !
|
|
938
|
+
const e2 = this.config.maxPickerRows ?? 8, n2 = this.config.maxPickerCols ?? 8;
|
|
939
|
+
t2.registerToolbarItem({ id: "table", group: "insert", icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>', label: this.locale.insertTable, tooltip: this.locale.insertTable, command: "insertTable", priority: 80, separatorAfter: this.config.separatorAfter, popupType: "gridPicker", popupConfig: { maxRows: e2, maxCols: n2, onSelect: (e3, n3) => {
|
|
940
|
+
K(t2, e3, n3);
|
|
941
|
+
} }, isActive: (t3) => !o(t3.selection) && !r(t3.selection) && I(t3, t3.selection.anchor.blockId) });
|
|
931
942
|
}
|
|
932
943
|
}
|
|
933
944
|
export {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
945
|
+
M as B,
|
|
946
|
+
D as T,
|
|
947
|
+
E as a,
|
|
948
|
+
k as b,
|
|
949
|
+
R as c,
|
|
950
|
+
A as d,
|
|
951
|
+
S as e,
|
|
952
|
+
T as f,
|
|
953
|
+
B as g,
|
|
954
|
+
L as h,
|
|
955
|
+
gt as i,
|
|
956
|
+
pt as j,
|
|
957
|
+
v as k,
|
|
958
|
+
I as l,
|
|
959
|
+
X as m,
|
|
960
|
+
z as n,
|
|
961
|
+
P as r,
|
|
962
|
+
N as s
|
|
952
963
|
};
|
|
953
|
-
//# sourceMappingURL=index-
|
|
964
|
+
//# sourceMappingURL=index-DQryjfJs.mjs.map
|