@notectl/core 1.7.0 → 1.7.2
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/README.md +2 -2
- package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs → AttrRegistry-D9Jx_RVb.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs.map → AttrRegistry-D9Jx_RVb.mjs.map} +1 -1
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs +80 -0
- package/dist/chunks/AttributedMarkCommands-BtLea72z.mjs.map +1 -0
- package/dist/chunks/{CaretNavigation-CAJXoaae.mjs → CaretNavigation-7JYpIKbs.mjs} +56 -56
- package/dist/chunks/{CaretNavigation-CAJXoaae.mjs.map → CaretNavigation-7JYpIKbs.mjs.map} +1 -1
- package/dist/chunks/ColorGrid-Dneqb8if.mjs +81 -0
- package/dist/chunks/ColorGrid-Dneqb8if.mjs.map +1 -0
- package/dist/chunks/ColorPickerPopup-CiCLBbe9.mjs +37 -0
- package/dist/chunks/ColorPickerPopup-CiCLBbe9.mjs.map +1 -0
- package/dist/chunks/ColorValidation-CV4f1wu6.mjs +39 -0
- package/dist/chunks/ColorValidation-CV4f1wu6.mjs.map +1 -0
- package/dist/chunks/{Document-CuwE73FF.mjs → Document-Brtw2jL1.mjs} +18 -18
- package/dist/chunks/{Document-CuwE73FF.mjs.map → Document-Brtw2jL1.mjs.map} +1 -1
- package/dist/chunks/MarkCommands-6RUJ4L3r.mjs +94 -0
- package/dist/chunks/MarkCommands-6RUJ4L3r.mjs.map +1 -0
- package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs → NavigationUtils-Cspt2ZrK.mjs} +3 -3
- package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs.map → NavigationUtils-Cspt2ZrK.mjs.map} +1 -1
- package/dist/chunks/{NodeResolver-B-wzthAQ.mjs → NodeResolver-C2XYkeOi.mjs} +2 -2
- package/dist/chunks/{NodeResolver-B-wzthAQ.mjs.map → NodeResolver-C2XYkeOi.mjs.map} +1 -1
- package/dist/chunks/PopupPositioning-BTT-_pQ3.mjs +32 -0
- package/dist/chunks/PopupPositioning-BTT-_pQ3.mjs.map +1 -0
- package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +16 -0
- package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs.map +1 -0
- package/dist/chunks/{Selection-DmFDwiPJ.mjs → Selection-BRTab5hO.mjs} +7 -7
- package/dist/chunks/{Selection-DmFDwiPJ.mjs.map → Selection-BRTab5hO.mjs.map} +1 -1
- package/dist/chunks/StyleRuntime-ChRjVQwL.mjs +239 -0
- package/dist/chunks/StyleRuntime-ChRjVQwL.mjs.map +1 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
- package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs → ToolbarKeyboardNav-DhpL8zNV.mjs} +3 -3
- package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs.map → ToolbarKeyboardNav-DhpL8zNV.mjs.map} +1 -1
- package/dist/chunks/{ToolbarPlugin-B6JETWaw.mjs → ToolbarPlugin-DpLVJ71w.mjs} +348 -135
- package/dist/chunks/ToolbarPlugin-DpLVJ71w.mjs.map +1 -0
- package/dist/chunks/index--n1RGpq-.mjs +171 -0
- package/dist/chunks/index--n1RGpq-.mjs.map +1 -0
- package/dist/chunks/index-4or5UzNO.mjs +168 -0
- package/dist/chunks/index-4or5UzNO.mjs.map +1 -0
- package/dist/chunks/{index-pxbbDHVH.mjs → index-ABlTDvEX.mjs} +20 -19
- package/dist/chunks/index-ABlTDvEX.mjs.map +1 -0
- package/dist/chunks/{index--z_Txzej.mjs → index-BAke7kNL.mjs} +45 -45
- package/dist/chunks/{index--z_Txzej.mjs.map → index-BAke7kNL.mjs.map} +1 -1
- package/dist/chunks/{index-DMt3ojrY.mjs → index-BXtw5PNN.mjs} +2 -2
- package/dist/chunks/{index-DMt3ojrY.mjs.map → index-BXtw5PNN.mjs.map} +1 -1
- package/dist/chunks/{index-FlTg80Pk.mjs → index-BhDXjueu.mjs} +285 -325
- package/dist/chunks/index-BhDXjueu.mjs.map +1 -0
- package/dist/chunks/{index-D0s0Q8Wc.mjs → index-BqNUfq-y.mjs} +43 -35
- package/dist/chunks/index-BqNUfq-y.mjs.map +1 -0
- package/dist/chunks/{index-CflvcXSd.mjs → index-BvqkuEY1.mjs} +21 -17
- package/dist/chunks/index-BvqkuEY1.mjs.map +1 -0
- package/dist/chunks/{index-C9gc3Bws.mjs → index-C1opJocO.mjs} +32 -32
- package/dist/chunks/{index-C9gc3Bws.mjs.map → index-C1opJocO.mjs.map} +1 -1
- package/dist/chunks/index-CWltg1wK.mjs +124 -0
- package/dist/chunks/index-CWltg1wK.mjs.map +1 -0
- package/dist/chunks/{index-D8tbbW97.mjs → index-Cd3uJLP3.mjs} +2 -2
- package/dist/chunks/{index-D8tbbW97.mjs.map → index-Cd3uJLP3.mjs.map} +1 -1
- package/dist/chunks/{index-C0cEs7Jc.mjs → index-CluzpB2b.mjs} +10 -10
- package/dist/chunks/{index-C0cEs7Jc.mjs.map → index-CluzpB2b.mjs.map} +1 -1
- package/dist/chunks/{index-CoeD4T9-.mjs → index-D3NlpmT1.mjs} +15 -11
- package/dist/chunks/index-D3NlpmT1.mjs.map +1 -0
- package/dist/chunks/{index-CAV2N-fF.mjs → index-D515iymW.mjs} +75 -74
- package/dist/chunks/{index-CAV2N-fF.mjs.map → index-D515iymW.mjs.map} +1 -1
- package/dist/chunks/{index-B-NSeaM4.mjs → index-Dk49P9N4.mjs} +2 -2
- package/dist/chunks/{index-B-NSeaM4.mjs.map → index-Dk49P9N4.mjs.map} +1 -1
- package/dist/chunks/index-DyzigvbZ.mjs +410 -0
- package/dist/chunks/index-DyzigvbZ.mjs.map +1 -0
- package/dist/chunks/index-ErZ5_a1o.mjs +296 -0
- package/dist/chunks/index-ErZ5_a1o.mjs.map +1 -0
- package/dist/chunks/{index-CNs4QQ8l.mjs → index-fsVJLutn.mjs} +52 -64
- package/dist/chunks/index-fsVJLutn.mjs.map +1 -0
- package/dist/commands/AttributedMarkCommands.d.ts +46 -0
- package/dist/commands/AttributedMarkCommands.d.ts.map +1 -0
- package/dist/commands/CommandHelpers.d.ts +21 -0
- package/dist/commands/CommandHelpers.d.ts.map +1 -0
- package/dist/commands/Commands.d.ts +2 -8
- package/dist/commands/Commands.d.ts.map +1 -1
- package/dist/commands/DeleteCommands.d.ts.map +1 -1
- package/dist/commands/GapCursorCommands.d.ts.map +1 -1
- package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
- package/dist/commands/PasteCommand.d.ts.map +1 -1
- package/dist/commands/RangeIterator.d.ts +10 -0
- package/dist/commands/RangeIterator.d.ts.map +1 -0
- package/dist/editor/DocumentParser.d.ts.map +1 -1
- package/dist/editor/DocumentSerializer.d.ts +2 -0
- package/dist/editor/DocumentSerializer.d.ts.map +1 -1
- package/dist/editor/EditorThemeController.d.ts +3 -0
- package/dist/editor/EditorThemeController.d.ts.map +1 -1
- package/dist/editor/MarkSerializer.d.ts +11 -0
- package/dist/editor/MarkSerializer.d.ts.map +1 -0
- package/dist/editor/NotectlEditor.d.ts +19 -3
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- package/dist/editor/PaperLayoutController.d.ts +2 -0
- package/dist/editor/PaperLayoutController.d.ts.map +1 -1
- package/dist/editor/styles/font-select.d.ts +1 -1
- package/dist/editor/styles/font-select.d.ts.map +1 -1
- package/dist/editor/styles/font-size-select.d.ts +1 -1
- package/dist/editor/styles/font-size-select.d.ts.map +1 -1
- package/dist/editor/styles/heading-select.d.ts +1 -1
- package/dist/editor/styles/heading-select.d.ts.map +1 -1
- package/dist/editor/styles/toolbar.d.ts +1 -1
- package/dist/editor/styles/toolbar.d.ts.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/input/ClipboardHandler.d.ts +0 -2
- package/dist/input/ClipboardHandler.d.ts.map +1 -1
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -1
- package/dist/model/MarkSpec.d.ts +6 -0
- package/dist/model/MarkSpec.d.ts.map +1 -1
- package/dist/notectl-core.mjs +2244 -2095
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +2862 -2415
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/PluginManager.d.ts +2 -0
- package/dist/plugins/PluginManager.d.ts.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.mjs +1 -1
- package/dist/plugins/blockquote.mjs +1 -1
- package/dist/plugins/caret-navigation.mjs +1 -1
- package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts +0 -6
- 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/FontSizePlugin.d.ts +0 -5
- package/dist/plugins/font-size/FontSizePlugin.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.mjs +2 -2
- package/dist/plugins/hard-break.mjs +2 -25
- package/dist/plugins/hard-break.mjs.map +1 -1
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts +1 -7
- package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
- package/dist/plugins/heading/HeadingPlugin.d.ts +0 -6
- package/dist/plugins/heading/HeadingPlugin.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.mjs +1 -1
- package/dist/plugins/image/ImageNodeView.d.ts.map +1 -1
- package/dist/plugins/image/ImagePlugin.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/PrintContentPreparer.d.ts.map +1 -1
- package/dist/plugins/shared/ColorGrid.d.ts +25 -0
- package/dist/plugins/shared/ColorGrid.d.ts.map +1 -0
- package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
- package/dist/plugins/shared/ColorValidation.d.ts +13 -2
- package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
- package/dist/plugins/shared/PopupKeyboardPatterns.d.ts +43 -0
- package/dist/plugins/shared/PopupKeyboardPatterns.d.ts.map +1 -0
- package/dist/plugins/shared/PopupManager.d.ts +45 -0
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -0
- package/dist/plugins/shared/PopupPositioning.d.ts +21 -0
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -0
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -1
- package/dist/plugins/table/TableBorderColor.d.ts.map +1 -1
- package/dist/plugins/table/TableContextMenu.d.ts +2 -1
- package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
- package/dist/plugins/table/TableControls.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
- package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
- package/dist/plugins/table/TableNodeViews.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 +11 -2
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +5 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts +1 -0
- package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts +9 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -1
- package/dist/plugins/toolbar/index.d.ts +1 -1
- package/dist/plugins/toolbar/index.d.ts.map +1 -1
- package/dist/plugins/toolbar.mjs +1 -1
- package/dist/state/BlockTreeOps.d.ts +21 -0
- package/dist/state/BlockTreeOps.d.ts.map +1 -0
- package/dist/state/InlineContentOps.d.ts +37 -0
- package/dist/state/InlineContentOps.d.ts.map +1 -0
- package/dist/state/StepApplication.d.ts.map +1 -1
- package/dist/style/StyleRuntime.d.ts +38 -0
- package/dist/style/StyleRuntime.d.ts.map +1 -0
- package/dist/test/PluginTestUtils.d.ts +4 -0
- package/dist/test/PluginTestUtils.d.ts.map +1 -1
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/ColorNames-BdsHwA2f.mjs +0 -59
- package/dist/chunks/ColorNames-BdsHwA2f.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs +0 -125
- package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs.map +0 -1
- package/dist/chunks/Commands-CicwYoTQ.mjs +0 -286
- package/dist/chunks/Commands-CicwYoTQ.mjs.map +0 -1
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs +0 -94
- package/dist/chunks/MarkCommands-CC37WA7Z.mjs.map +0 -1
- package/dist/chunks/ToolbarPlugin-B6JETWaw.mjs.map +0 -1
- package/dist/chunks/index-B9GkDVsx.mjs +0 -187
- package/dist/chunks/index-B9GkDVsx.mjs.map +0 -1
- package/dist/chunks/index-CKPrAOr6.mjs +0 -209
- package/dist/chunks/index-CKPrAOr6.mjs.map +0 -1
- package/dist/chunks/index-CNs4QQ8l.mjs.map +0 -1
- package/dist/chunks/index-CflvcXSd.mjs.map +0 -1
- package/dist/chunks/index-CoeD4T9-.mjs.map +0 -1
- package/dist/chunks/index-D0s0Q8Wc.mjs.map +0 -1
- package/dist/chunks/index-DfzCof6H.mjs +0 -191
- package/dist/chunks/index-DfzCof6H.mjs.map +0 -1
- package/dist/chunks/index-DyIwN_67.mjs +0 -404
- package/dist/chunks/index-DyIwN_67.mjs.map +0 -1
- package/dist/chunks/index-FlTg80Pk.mjs.map +0 -1
- package/dist/chunks/index-pxbbDHVH.mjs.map +0 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { S as t, r as e } from "./resolvePluginLocale-B4w1OkPy.mjs";
|
|
2
2
|
import { e as n } from "./HTMLUtils-DTqQzcKR.mjs";
|
|
3
|
-
import { i as o, a as r,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { u as b,
|
|
7
|
-
import { n as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import { i as o, a as r, d as l, e as i, b as a } from "./Selection-BRTab5hO.mjs";
|
|
4
|
+
import { a as s } from "./ColorValidation-CV4f1wu6.mjs";
|
|
5
|
+
import { g as c, r as d } from "./ColorGrid-Dneqb8if.mjs";
|
|
6
|
+
import { q as u, u as b, k as h, f as p, c as f } from "./Document-Brtw2jL1.mjs";
|
|
7
|
+
import { n as m } from "./TypeBrands-C09nE2qO.mjs";
|
|
8
|
+
import { a as g, s as w, f as v } from "./StyleRuntime-ChRjVQwL.mjs";
|
|
9
|
+
import { p as x } from "./PopupPositioning-BTT-_pQ3.mjs";
|
|
10
|
+
import { a as C } from "./ToolbarKeyboardNav-DhpL8zNV.mjs";
|
|
11
|
+
function I() {
|
|
12
|
+
const t2 = h(m("paragraph"), [p("")], b());
|
|
13
|
+
return h(m("table_cell"), [t2], b());
|
|
14
|
+
}
|
|
15
|
+
function R(t2, e2) {
|
|
13
16
|
const n2 = t2.getNodePath(e2);
|
|
14
17
|
if (!n2) return null;
|
|
15
18
|
let o2 = null, r2 = null, l2 = null, i2 = null;
|
|
@@ -19,48 +22,48 @@ function v(t2, e2) {
|
|
|
19
22
|
}
|
|
20
23
|
const a2 = t2.getBlock(e2);
|
|
21
24
|
if ("table_cell" === a2?.type && (i2 = e2), !(o2 && r2 && i2 && l2)) return null;
|
|
22
|
-
const s2 = t2.doc.children.findIndex((t3) => t3.id === o2), c2 =
|
|
25
|
+
const s2 = t2.doc.children.findIndex((t3) => t3.id === o2), c2 = u(r2), d2 = c2.findIndex((t3) => t3.id === l2);
|
|
23
26
|
if (-1 === d2) return null;
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
const h2 =
|
|
27
|
+
const b2 = c2[d2];
|
|
28
|
+
if (!b2) return null;
|
|
29
|
+
const h2 = u(b2), p2 = h2.findIndex((t3) => t3.id === i2);
|
|
27
30
|
if (-1 === p2) return null;
|
|
28
31
|
const f2 = h2.length, m2 = c2.length;
|
|
29
32
|
return { tableId: o2, tableIndex: s2, rowId: l2, rowIndex: d2, cellId: i2, colIndex: p2, totalRows: m2, totalCols: f2 };
|
|
30
33
|
}
|
|
31
|
-
function
|
|
34
|
+
function y(t2, e2, n2, o2) {
|
|
32
35
|
const r2 = t2.getBlock(e2);
|
|
33
36
|
if (!r2) return null;
|
|
34
|
-
const l2 =
|
|
37
|
+
const l2 = u(r2)[n2];
|
|
35
38
|
if (!l2) return null;
|
|
36
|
-
const i2 =
|
|
39
|
+
const i2 = u(l2)[o2];
|
|
37
40
|
return i2?.id ?? null;
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function k(t2, e2) {
|
|
40
43
|
const n2 = t2.getBlock(e2);
|
|
41
44
|
if (!n2) return e2;
|
|
42
|
-
const o2 =
|
|
45
|
+
const o2 = u(n2)[0];
|
|
43
46
|
if (!o2) return e2;
|
|
44
47
|
let r2 = o2;
|
|
45
48
|
for (; ; ) {
|
|
46
|
-
const t3 =
|
|
49
|
+
const t3 = u(r2)[0];
|
|
47
50
|
if (!t3) return r2.id;
|
|
48
51
|
r2 = t3;
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
function
|
|
54
|
+
function S(t2, e2) {
|
|
52
55
|
const n2 = t2.getBlock(e2);
|
|
53
56
|
if (!n2) return e2;
|
|
54
|
-
const o2 =
|
|
57
|
+
const o2 = u(n2), r2 = o2[o2.length - 1];
|
|
55
58
|
if (!r2) return e2;
|
|
56
59
|
let l2 = r2;
|
|
57
60
|
for (; ; ) {
|
|
58
|
-
const t3 =
|
|
61
|
+
const t3 = u(l2), e3 = t3[t3.length - 1];
|
|
59
62
|
if (!e3) return l2.id;
|
|
60
63
|
l2 = e3;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
function
|
|
66
|
+
function A(t2, e2) {
|
|
64
67
|
const n2 = t2.getNodePath(e2);
|
|
65
68
|
if (!n2) return false;
|
|
66
69
|
for (const e3 of n2) {
|
|
@@ -69,8 +72,8 @@ function I(t2, e2) {
|
|
|
69
72
|
}
|
|
70
73
|
return false;
|
|
71
74
|
}
|
|
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
|
|
75
|
+
const B = { 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" }, L = { 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" }, T = { 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" }, E = { 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" }, D = { 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 打开表格操作" }, M = { 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 для действий с таблицей" }, H = { 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 لإجراءات الجدول" }, $ = { 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" }, N = { en: B, de: L, es: T, fr: E, zh: D, ru: M, ar: H, hi: $ }, P = ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#980000", "#cc0000", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3c78d8", "#3d85c6", "#674ea7", "#a64d79", "#0b5394", "#38761d"];
|
|
76
|
+
function z(t2, e2, n2) {
|
|
74
77
|
const o2 = t2.getBlock(e2);
|
|
75
78
|
if (!o2 || "table" !== o2.type) return null;
|
|
76
79
|
const r2 = t2.getNodePath(e2);
|
|
@@ -82,141 +85,97 @@ function $(t2, e2, n2) {
|
|
|
82
85
|
const l2 = { ...o2.attrs, borderColor: n2 };
|
|
83
86
|
return t2.transaction("command").setNodeAttr(r2, l2).setSelection(t2.selection).build();
|
|
84
87
|
}
|
|
85
|
-
function
|
|
88
|
+
function F(t2, e2, n2 = B) {
|
|
86
89
|
const l2 = t2.getState();
|
|
87
90
|
if (o(l2.selection) || r(l2.selection)) return false;
|
|
88
|
-
const i2 =
|
|
91
|
+
const i2 = R(l2, l2.selection.anchor.blockId);
|
|
89
92
|
if (!i2) return false;
|
|
90
|
-
const a2 =
|
|
93
|
+
const a2 = z(l2, i2.tableId, e2);
|
|
91
94
|
if (!a2) return false;
|
|
92
95
|
t2.dispatch(a2);
|
|
93
|
-
const
|
|
94
|
-
return t2.announce(n2.announceBorderColorSet(
|
|
96
|
+
const s2 = "none" === e2 ? "none" : c(e2);
|
|
97
|
+
return t2.announce(n2.announceBorderColorSet(s2)), true;
|
|
95
98
|
}
|
|
96
|
-
function
|
|
99
|
+
function j(t2, e2 = B) {
|
|
97
100
|
const n2 = t2.getState();
|
|
98
101
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
99
|
-
const l2 =
|
|
102
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
100
103
|
if (!l2) return false;
|
|
101
|
-
const i2 =
|
|
104
|
+
const i2 = z(n2, l2.tableId, void 0);
|
|
102
105
|
return !!i2 && (t2.dispatch(i2), t2.announce(e2.announceBorderReset), true);
|
|
103
106
|
}
|
|
104
|
-
function
|
|
107
|
+
function _(t2, e2) {
|
|
105
108
|
const n2 = t2.getBlock(e2);
|
|
106
109
|
if (n2) return n2.attrs?.borderColor;
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function V(t2, e2, n2, o2, r2 = B) {
|
|
109
112
|
t2.classList.add("notectl-color-picker");
|
|
110
|
-
const l2 =
|
|
111
|
-
|
|
112
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
113
|
-
}),
|
|
113
|
+
const l2 = _(e2.getState(), n2), i2 = document.createElement("button");
|
|
114
|
+
i2.type = "button", i2.className = "notectl-color-picker__default", i2.textContent = r2.defaultColor, i2.addEventListener("mousedown", (t3) => {
|
|
115
|
+
t3.preventDefault(), t3.stopPropagation(), j(e2, r2), o2();
|
|
116
|
+
}), i2.addEventListener("keydown", (t3) => {
|
|
114
117
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
115
|
-
}), t2.appendChild(
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
119
|
-
}),
|
|
118
|
+
}), t2.appendChild(i2);
|
|
119
|
+
const a2 = document.createElement("button");
|
|
120
|
+
a2.type = "button", a2.className = "notectl-color-picker__default", a2.textContent = r2.noBorders, a2.addEventListener("mousedown", (t3) => {
|
|
121
|
+
t3.preventDefault(), t3.stopPropagation(), F(e2, "none", r2), o2();
|
|
122
|
+
}), a2.addEventListener("keydown", (t3) => {
|
|
120
123
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
121
|
-
}), t2.appendChild(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const p2 = [];
|
|
125
|
-
let f2 = 0;
|
|
126
|
-
for (let t3 = 0; t3 < a2; t3++) {
|
|
127
|
-
const n3 = document.createElement("div");
|
|
128
|
-
n3.setAttribute("role", "row");
|
|
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();
|
|
135
|
-
}), p2.push(m2), n3.appendChild(m2);
|
|
136
|
-
}
|
|
137
|
-
h2.appendChild(n3);
|
|
138
|
-
}
|
|
139
|
-
_(p2, f2), h2.addEventListener("keydown", (t3) => {
|
|
140
|
-
if ("Escape" === t3.key) return t3.preventDefault(), void o2();
|
|
141
|
-
if ("Enter" === t3.key || " " === t3.key) {
|
|
142
|
-
t3.preventDefault();
|
|
143
|
-
const n3 = t3.target.dataset.index;
|
|
144
|
-
if (void 0 !== n3) {
|
|
145
|
-
const t4 = M[Number(n3)];
|
|
146
|
-
t4 && (N(e2, t4, r2), o2());
|
|
147
|
-
}
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
if (H.has(t3.key)) {
|
|
151
|
-
t3.preventDefault();
|
|
152
|
-
const e3 = Math.floor(f2 / 5) + 1, n3 = f2 % 5 + 1, [o3, r3] = u(e3, n3, a2, 5, t3.key);
|
|
153
|
-
let l3 = 5 * (o3 - 1) + (r3 - 1);
|
|
154
|
-
return l3 >= i2 && (l3 = i2 - 1), f2 = l3, _(p2, f2), void p2[f2]?.focus();
|
|
155
|
-
}
|
|
156
|
-
if ("Home" === t3.key || "End" === t3.key) {
|
|
157
|
-
t3.preventDefault();
|
|
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();
|
|
160
|
-
}
|
|
161
|
-
}), t2.appendChild(h2);
|
|
124
|
+
}), t2.appendChild(a2), d(t2, { colors: P, columns: 5, ariaLabel: r2.borderColorPicker, ariaLabelPrefix: "", activeColor: l2 ?? null, swatchLabel: r2.borderSwatchLabel, titleAsName: true, onSelect: (t3) => {
|
|
125
|
+
F(e2, t3, r2), o2();
|
|
126
|
+
}, onClose: o2 });
|
|
162
127
|
}
|
|
163
|
-
function
|
|
164
|
-
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
165
|
-
const o2 = t2[n2];
|
|
166
|
-
o2 && o2.setAttribute("tabindex", n2 === e2 ? "0" : "-1");
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function j(t2, e2, n2) {
|
|
128
|
+
function Z(t2, e2, n2) {
|
|
170
129
|
const o2 = t2.getBlock(e2);
|
|
171
130
|
if (!o2) return null;
|
|
172
|
-
const r2 =
|
|
131
|
+
const r2 = u(o2), i2 = r2[0] ? u(r2[0]).length : 0;
|
|
173
132
|
if (0 === i2) return null;
|
|
174
133
|
const a2 = (function(t3) {
|
|
175
134
|
const e3 = [];
|
|
176
|
-
for (let n3 = 0; n3 < t3; n3++) e3.push(
|
|
177
|
-
return
|
|
178
|
-
})(i2), s2 = t2.transaction("command").insertNode([e2], n2, a2), c2 =
|
|
135
|
+
for (let n3 = 0; n3 < t3; n3++) e3.push(I());
|
|
136
|
+
return h(m("table_row"), e3, b());
|
|
137
|
+
})(i2), s2 = t2.transaction("command").insertNode([e2], n2, a2), c2 = u(a2)[0], d2 = c2 ? u(c2)[0] : void 0;
|
|
179
138
|
return d2 ? s2.setSelection(l(d2.id, 0)) : c2 && s2.setSelection(l(c2.id, 0)), s2.build();
|
|
180
139
|
}
|
|
181
|
-
function
|
|
140
|
+
function q(t2, e2, n2) {
|
|
182
141
|
const o2 = t2.getBlock(e2);
|
|
183
142
|
if (!o2) return null;
|
|
184
|
-
const r2 =
|
|
143
|
+
const r2 = u(o2), l2 = t2.transaction("command");
|
|
185
144
|
for (const t3 of r2) {
|
|
186
|
-
const o3 =
|
|
145
|
+
const o3 = I();
|
|
187
146
|
l2.insertNode([e2, t3.id], n2, o3);
|
|
188
147
|
}
|
|
189
148
|
return l2.setSelection(t2.selection), l2.build();
|
|
190
149
|
}
|
|
191
|
-
function
|
|
150
|
+
function O(t2, e2, n2, o2 = 0) {
|
|
192
151
|
const r2 = t2.getBlock(e2);
|
|
193
152
|
if (!r2) return null;
|
|
194
|
-
if (
|
|
195
|
-
const i2 = t2.transaction("command").removeNode([e2], n2), a2 =
|
|
153
|
+
if (u(r2).length <= 1) return Y(t2, e2);
|
|
154
|
+
const i2 = t2.transaction("command").removeNode([e2], n2), a2 = y(t2, e2, n2 > 0 ? n2 - 1 : 1, o2);
|
|
196
155
|
if (a2) {
|
|
197
|
-
const e3 =
|
|
156
|
+
const e3 = k(t2, a2);
|
|
198
157
|
i2.setSelection(l(e3, 0));
|
|
199
158
|
}
|
|
200
159
|
return i2.build();
|
|
201
160
|
}
|
|
202
|
-
function
|
|
161
|
+
function K(t2, e2, n2, o2 = 0) {
|
|
203
162
|
const r2 = t2.getBlock(e2);
|
|
204
163
|
if (!r2) return null;
|
|
205
|
-
const i2 =
|
|
206
|
-
if ((i2[0] ?
|
|
164
|
+
const i2 = u(r2);
|
|
165
|
+
if ((i2[0] ? u(i2[0]).length : 0) <= 1) return Y(t2, e2);
|
|
207
166
|
const a2 = t2.transaction("command");
|
|
208
167
|
for (let t3 = i2.length - 1; t3 >= 0; t3--) {
|
|
209
168
|
const o3 = i2[t3];
|
|
210
169
|
o3 && a2.removeNode([e2, o3.id], n2);
|
|
211
170
|
}
|
|
212
|
-
const s2 =
|
|
171
|
+
const s2 = y(t2, e2, o2, n2 > 0 ? n2 - 1 : 1);
|
|
213
172
|
if (s2) {
|
|
214
|
-
const e3 =
|
|
173
|
+
const e3 = k(t2, s2);
|
|
215
174
|
a2.setSelection(l(e3, 0));
|
|
216
175
|
}
|
|
217
176
|
return a2.build();
|
|
218
177
|
}
|
|
219
|
-
function
|
|
178
|
+
function Y(t2, e2) {
|
|
220
179
|
const n2 = t2.doc.children.findIndex((t3) => t3.id === e2);
|
|
221
180
|
if (-1 === n2) return null;
|
|
222
181
|
const o2 = t2.transaction("command").removeNode([], n2), r2 = t2.doc.children[n2 + 1];
|
|
@@ -224,7 +183,7 @@ function O(t2, e2) {
|
|
|
224
183
|
const i2 = t2.doc.children[n2 - 1];
|
|
225
184
|
return i2 && o2.setSelection(l(i2.id, 0)), o2.build();
|
|
226
185
|
}
|
|
227
|
-
function
|
|
186
|
+
function U(t2, e2, n2) {
|
|
228
187
|
const i2 = t2.getState(), a2 = i2.selection;
|
|
229
188
|
if (o(a2) || r(a2)) return false;
|
|
230
189
|
const s2 = a2.anchor.blockId;
|
|
@@ -244,57 +203,57 @@ function K(t2, e2, n2) {
|
|
|
244
203
|
}
|
|
245
204
|
-1 === c2 && (c2 = i2.doc.children.length - 1);
|
|
246
205
|
const d2 = (function(t3, e3) {
|
|
247
|
-
const n3 =
|
|
206
|
+
const n3 = b(), o2 = [];
|
|
248
207
|
for (let n4 = 0; n4 < t3; n4++) {
|
|
249
208
|
const t4 = [];
|
|
250
|
-
for (let n5 = 0; n5 < e3; n5++) t4.push(
|
|
251
|
-
o2.push(
|
|
209
|
+
for (let n5 = 0; n5 < e3; n5++) t4.push(I());
|
|
210
|
+
o2.push(h(m("table_row"), t4, b()));
|
|
252
211
|
}
|
|
253
|
-
return
|
|
254
|
-
})(e2, n2),
|
|
255
|
-
return
|
|
212
|
+
return h(m("table"), o2, n3);
|
|
213
|
+
})(e2, n2), p2 = h(m("paragraph")), f2 = c2 + 1, g2 = i2.transaction("command").insertNode([], f2, d2).insertNode([], f2 + 1, p2), w2 = u(d2)[0], v2 = w2 ? u(w2)[0] : void 0, x2 = v2 ? u(v2)[0] : void 0;
|
|
214
|
+
return x2 ? g2.setSelection(l(x2.id, 0)) : v2 && g2.setSelection(l(v2.id, 0)), t2.dispatch(g2.build()), true;
|
|
256
215
|
}
|
|
257
|
-
function
|
|
216
|
+
function W(t2, e2) {
|
|
258
217
|
const n2 = t2.getState();
|
|
259
218
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
260
|
-
const l2 =
|
|
219
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
261
220
|
if (!l2) return false;
|
|
262
|
-
const i2 =
|
|
221
|
+
const i2 = Z(n2, l2.tableId, l2.rowIndex + 1);
|
|
263
222
|
return !!i2 && (t2.dispatch(i2), t2.announce(e2?.announceRowInsertedBelow ?? "Row inserted below"), true);
|
|
264
223
|
}
|
|
265
|
-
function
|
|
224
|
+
function X(t2, e2, n2) {
|
|
266
225
|
const l2 = t2.getState();
|
|
267
226
|
if (o(l2.selection) || r(l2.selection)) return false;
|
|
268
|
-
const i2 =
|
|
227
|
+
const i2 = R(l2, l2.selection.anchor.blockId);
|
|
269
228
|
if (!i2) return false;
|
|
270
|
-
const a2 = "left" === e2 ? i2.colIndex : i2.colIndex + 1, s2 =
|
|
229
|
+
const a2 = "left" === e2 ? i2.colIndex : i2.colIndex + 1, s2 = q(l2, i2.tableId, a2);
|
|
271
230
|
return !!s2 && (t2.dispatch(s2), t2.announce(n2?.announceColumnInserted(e2) ?? `Column inserted ${e2}`), true);
|
|
272
231
|
}
|
|
273
|
-
function
|
|
274
|
-
t2.registerCommand("insertTable", () =>
|
|
232
|
+
function G(t2, e2) {
|
|
233
|
+
t2.registerCommand("insertTable", () => U(t2, 3, 3)), t2.registerCommand("addRowAbove", () => (function(t3, e3) {
|
|
275
234
|
const n2 = t3.getState();
|
|
276
235
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
277
|
-
const l2 =
|
|
236
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
278
237
|
if (!l2) return false;
|
|
279
|
-
const i2 =
|
|
238
|
+
const i2 = Z(n2, l2.tableId, l2.rowIndex);
|
|
280
239
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowInsertedAbove ?? "Row inserted above"), true);
|
|
281
|
-
})(t2, e2)), t2.registerCommand("addRowBelow", () =>
|
|
282
|
-
return
|
|
240
|
+
})(t2, e2)), t2.registerCommand("addRowBelow", () => W(t2, e2)), t2.registerCommand("addColumnLeft", () => (function(t3, e3) {
|
|
241
|
+
return X(t3, "left", e3);
|
|
283
242
|
})(t2, e2)), t2.registerCommand("addColumnRight", () => (function(t3, e3) {
|
|
284
|
-
return
|
|
243
|
+
return X(t3, "right", e3);
|
|
285
244
|
})(t2, e2)), t2.registerCommand("deleteRow", () => (function(t3, e3) {
|
|
286
245
|
const n2 = t3.getState();
|
|
287
246
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
288
|
-
const l2 =
|
|
247
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
289
248
|
if (!l2) return false;
|
|
290
|
-
const i2 =
|
|
249
|
+
const i2 = O(n2, l2.tableId, l2.rowIndex, l2.colIndex);
|
|
291
250
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowDeleted ?? "Row deleted"), true);
|
|
292
251
|
})(t2, e2)), t2.registerCommand("deleteColumn", () => (function(t3, e3) {
|
|
293
252
|
const n2 = t3.getState();
|
|
294
253
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
295
|
-
const l2 =
|
|
254
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
296
255
|
if (!l2) return false;
|
|
297
|
-
const i2 =
|
|
256
|
+
const i2 = K(n2, l2.tableId, l2.colIndex, l2.rowIndex);
|
|
298
257
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceColumnDeleted ?? "Column deleted"), true);
|
|
299
258
|
})(t2, e2)), t2.registerCommand("selectTable", () => (function(t3) {
|
|
300
259
|
const e3 = t3.getState(), n2 = e3.selection;
|
|
@@ -303,7 +262,7 @@ function W(t2, e2) {
|
|
|
303
262
|
return "table" === t4?.type;
|
|
304
263
|
}
|
|
305
264
|
if (r(n2)) return false;
|
|
306
|
-
const l2 =
|
|
265
|
+
const l2 = R(e3, n2.anchor.blockId);
|
|
307
266
|
if (!l2) return false;
|
|
308
267
|
const a2 = e3.getNodePath(l2.tableId);
|
|
309
268
|
if (!a2) return false;
|
|
@@ -316,114 +275,115 @@ function W(t2, e2) {
|
|
|
316
275
|
return "table" !== e5?.type ? null : { tableId: e5.id };
|
|
317
276
|
}
|
|
318
277
|
if (r(t4.selection)) return null;
|
|
319
|
-
const e4 =
|
|
278
|
+
const e4 = R(t4, t4.selection.anchor.blockId);
|
|
320
279
|
return e4 ? { tableId: e4.tableId } : null;
|
|
321
280
|
})(n2);
|
|
322
281
|
if (!l2) return false;
|
|
323
|
-
const i2 =
|
|
282
|
+
const i2 = Y(n2, l2.tableId);
|
|
324
283
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceTableDeleted ?? "Table deleted"), true);
|
|
325
284
|
})(t2, e2));
|
|
326
285
|
}
|
|
327
|
-
function
|
|
328
|
-
let
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
let
|
|
333
|
-
const
|
|
286
|
+
function J(t2, e2, n2, o2, r2, l2 = B, i2) {
|
|
287
|
+
let a2 = true, s2 = null, c2 = null;
|
|
288
|
+
const d2 = document.createElement("div");
|
|
289
|
+
d2.className = "notectl-table-context-menu", d2.setAttribute("role", "menu"), d2.setAttribute("aria-label", l2.tableActions), d2.setAttribute("contenteditable", "false");
|
|
290
|
+
const u2 = [];
|
|
291
|
+
let b2 = 0;
|
|
292
|
+
const h2 = (function(t3) {
|
|
334
293
|
return [{ type: "item", label: t3.insertRowAbove, command: "addRowAbove" }, { type: "item", label: t3.insertRowBelow, command: "addRowBelow" }, { type: "separator" }, { type: "item", label: t3.insertColumnLeft, command: "addColumnLeft" }, { type: "item", label: t3.insertColumnRight, command: "addColumnRight" }, { type: "separator" }, { type: "item", label: t3.deleteRow, command: "deleteRow" }, { type: "item", label: t3.deleteColumn, command: "deleteColumn" }, { type: "separator" }, { type: "submenu", label: t3.borderColorLabel, id: "borderColor" }, { type: "separator" }, { type: "item", label: t3.deleteTable, command: "deleteTable" }];
|
|
335
294
|
})(l2);
|
|
336
|
-
for (const t3 of
|
|
295
|
+
for (const t3 of h2) {
|
|
337
296
|
if ("separator" === t3.type) {
|
|
338
297
|
const t4 = document.createElement("div");
|
|
339
|
-
t4.setAttribute("role", "separator"),
|
|
298
|
+
t4.setAttribute("role", "separator"), d2.appendChild(t4);
|
|
340
299
|
continue;
|
|
341
300
|
}
|
|
342
301
|
const n3 = document.createElement("button");
|
|
343
302
|
n3.type = "button", n3.setAttribute("role", "menuitem"), n3.textContent = t3.label, "submenu" === t3.type && (n3.dataset.submenu = t3.id, n3.setAttribute("aria-haspopup", "true"), n3.setAttribute("aria-expanded", "false")), "item" === t3.type && (n3.dataset.command = t3.command), n3.addEventListener("mousedown", (t4) => {
|
|
344
303
|
t4.preventDefault(), t4.stopPropagation();
|
|
345
304
|
}), n3.addEventListener("click", (o3) => {
|
|
346
|
-
o3.stopPropagation(), "item" === t3.type ? (e2.executeCommand(t3.command),
|
|
347
|
-
}),
|
|
348
|
-
}
|
|
349
|
-
const
|
|
350
|
-
function
|
|
351
|
-
|
|
352
|
-
t3
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
305
|
+
o3.stopPropagation(), "item" === t3.type ? (e2.executeCommand(t3.command), R2()) : "submenu" === t3.type && f2(n3);
|
|
306
|
+
}), u2.push(n3), d2.appendChild(n3);
|
|
307
|
+
}
|
|
308
|
+
const p2 = document.createElement("div");
|
|
309
|
+
function f2(o3) {
|
|
310
|
+
if (m2(), o3.setAttribute("aria-expanded", "true"), i2) {
|
|
311
|
+
const t3 = { close: () => R2(), getElement: () => d2 };
|
|
312
|
+
c2 = i2.open({ anchor: o3, position: "right", referenceNode: d2, parent: t3, onClose: () => {
|
|
313
|
+
c2 = null, s2 = null, v2();
|
|
314
|
+
}, content: (t4, r3) => {
|
|
315
|
+
t4.className = "notectl-table-context-menu", t4.setAttribute("contenteditable", "false"), s2 = t4, t4.addEventListener("keydown", (t5) => {
|
|
316
|
+
t5.stopPropagation(), "ArrowLeft" === t5.key && (t5.preventDefault(), r3(), o3.focus());
|
|
317
|
+
}), V(t4, e2, n2, () => R2(), l2);
|
|
318
|
+
} });
|
|
319
|
+
} else {
|
|
320
|
+
s2 = document.createElement("div"), s2.className = "notectl-table-context-menu", g(s2, "position", "fixed"), s2.setAttribute("contenteditable", "false"), s2.addEventListener("keydown", (t3) => {
|
|
321
|
+
t3.stopPropagation(), "ArrowLeft" === t3.key && (t3.preventDefault(), m2(), o3.focus());
|
|
322
|
+
}), V(s2, e2, n2, () => R2(), l2), t2.appendChild(s2);
|
|
323
|
+
const r3 = o3.getBoundingClientRect(), i3 = d2.getBoundingClientRect();
|
|
324
|
+
let a3 = i3.right + 2, c3 = r3.top;
|
|
325
|
+
const u3 = window.innerWidth, b3 = window.innerHeight;
|
|
326
|
+
a3 + 200 > u3 && (a3 = i3.left - 200 - 2), c3 + 200 > b3 && (c3 = b3 - 200), w(s2, { left: `${a3}px`, top: `${c3}px` }), requestAnimationFrame(() => {
|
|
327
|
+
const t3 = s2?.querySelector("button");
|
|
328
|
+
t3?.focus();
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function m2() {
|
|
333
|
+
c2 ? (c2.close(), c2 = null, s2 = null) : s2 && (s2.remove(), s2 = null), v2();
|
|
363
334
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
for (const t3 of c2) t3.dataset.submenu && t3.setAttribute("aria-expanded", "false");
|
|
335
|
+
function v2() {
|
|
336
|
+
for (const t3 of u2) t3.dataset.submenu && t3.setAttribute("aria-expanded", "false");
|
|
367
337
|
}
|
|
368
|
-
|
|
338
|
+
p2.className = "notectl-table-context-menu__hint", p2.setAttribute("aria-hidden", "true"), p2.textContent = l2.menuKeyboardHint, d2.appendChild(p2), C(u2, b2), d2.addEventListener("keydown", (t3) => {
|
|
369
339
|
switch (t3.stopPropagation(), t3.key) {
|
|
370
340
|
case "Escape":
|
|
371
|
-
return t3.preventDefault(), void
|
|
341
|
+
return t3.preventDefault(), void R2();
|
|
372
342
|
case "ArrowDown":
|
|
373
|
-
return t3.preventDefault(),
|
|
343
|
+
return t3.preventDefault(), b2 = (b2 + 1) % u2.length, C(u2, b2), void u2[b2]?.focus();
|
|
374
344
|
case "ArrowUp":
|
|
375
|
-
return t3.preventDefault(),
|
|
345
|
+
return t3.preventDefault(), b2 = (b2 - 1 + u2.length) % u2.length, C(u2, b2), void u2[b2]?.focus();
|
|
376
346
|
case "ArrowRight": {
|
|
377
347
|
t3.preventDefault();
|
|
378
|
-
const e3 =
|
|
379
|
-
return void (e3?.dataset.submenu &&
|
|
348
|
+
const e3 = u2[b2];
|
|
349
|
+
return void (e3?.dataset.submenu && f2(e3));
|
|
380
350
|
}
|
|
381
351
|
case "ArrowLeft":
|
|
382
|
-
return t3.preventDefault(),
|
|
352
|
+
return t3.preventDefault(), m2(), void u2[b2]?.focus();
|
|
383
353
|
case "Enter":
|
|
384
354
|
case " ": {
|
|
385
355
|
t3.preventDefault();
|
|
386
|
-
const n3 =
|
|
356
|
+
const n3 = u2[b2];
|
|
387
357
|
if (!n3) return;
|
|
388
|
-
return void (n3.dataset.submenu ?
|
|
358
|
+
return void (n3.dataset.submenu ? f2(n3) : n3.dataset.command && (e2.executeCommand(n3.dataset.command), R2()));
|
|
389
359
|
}
|
|
390
360
|
case "Home":
|
|
391
|
-
return t3.preventDefault(),
|
|
361
|
+
return t3.preventDefault(), b2 = 0, C(u2, b2), void u2[b2]?.focus();
|
|
392
362
|
case "End":
|
|
393
|
-
return t3.preventDefault(),
|
|
363
|
+
return t3.preventDefault(), b2 = u2.length - 1, C(u2, b2), void u2[b2]?.focus();
|
|
394
364
|
}
|
|
395
|
-
}), (
|
|
396
|
-
|
|
397
|
-
let r3 = e3.left, l3 = e3.top;
|
|
398
|
-
r3 + 200 > n3 && (r3 = n3 - 200), l3 + 340 > o3 && (l3 = o3 - 340), r3 < 0 && (r3 = 0), l3 < 0 && (l3 = 0), t3.style.left = `${r3}px`, t3.style.top = `${l3}px`;
|
|
399
|
-
})(s2, o2), t2.appendChild(s2), c2[0]?.focus(), requestAnimationFrame(() => {
|
|
400
|
-
i2 && c2[0] && c2[0].focus();
|
|
365
|
+
}), x(d2, o2, { position: "below-start" }), t2.appendChild(d2), u2[0]?.focus(), requestAnimationFrame(() => {
|
|
366
|
+
a2 && u2[0] && u2[0].focus();
|
|
401
367
|
});
|
|
402
|
-
const
|
|
368
|
+
const I2 = (t3) => {
|
|
403
369
|
const e3 = t3.composedPath();
|
|
404
|
-
e3.includes(
|
|
370
|
+
e3.includes(d2) || s2 && e3.includes(s2) || R2();
|
|
405
371
|
};
|
|
406
|
-
function
|
|
407
|
-
|
|
372
|
+
function R2() {
|
|
373
|
+
a2 && (a2 = false, m2(), d2.remove(), document.removeEventListener("mousedown", I2, true), r2?.());
|
|
408
374
|
}
|
|
409
375
|
return setTimeout(() => {
|
|
410
|
-
document.addEventListener("mousedown",
|
|
411
|
-
}, 0), { isOpen: () =>
|
|
412
|
-
}
|
|
413
|
-
function G(t2, e2) {
|
|
414
|
-
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
415
|
-
const o2 = t2[n2];
|
|
416
|
-
o2 && o2.setAttribute("tabindex", n2 === e2 ? "0" : "-1");
|
|
417
|
-
}
|
|
376
|
+
document.addEventListener("mousedown", I2, true);
|
|
377
|
+
}, 0), { isOpen: () => a2, close: R2, destroy: R2 };
|
|
418
378
|
}
|
|
419
|
-
function
|
|
379
|
+
function Q(t2, e2) {
|
|
420
380
|
const n2 = t2.getState();
|
|
421
381
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
422
|
-
const l2 = n2.selection, i2 =
|
|
382
|
+
const l2 = n2.selection, i2 = R(n2, l2.anchor.blockId);
|
|
423
383
|
return !!i2 && e2(n2, l2, i2);
|
|
424
384
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
385
|
+
function tt(t2) {
|
|
386
|
+
return Q(t2, (e2, n2, o2) => {
|
|
427
387
|
const r2 = o2.tableIndex + 1;
|
|
428
388
|
if (r2 >= e2.doc.children.length) return false;
|
|
429
389
|
const i2 = e2.doc.children[r2];
|
|
@@ -432,69 +392,69 @@ function Q(t2) {
|
|
|
432
392
|
return t2.dispatch(a2), true;
|
|
433
393
|
});
|
|
434
394
|
}
|
|
435
|
-
let
|
|
436
|
-
function
|
|
437
|
-
const r2 = t2.getState(), i2 =
|
|
395
|
+
let et = null;
|
|
396
|
+
function nt(t2, e2, n2, o2) {
|
|
397
|
+
const r2 = t2.getState(), i2 = y(r2, e2, n2, o2);
|
|
438
398
|
if (!i2) return false;
|
|
439
|
-
const a2 =
|
|
399
|
+
const a2 = k(r2, i2), s2 = r2.transaction("command").setSelection(l(a2, 0)).build();
|
|
440
400
|
return t2.dispatch(s2), true;
|
|
441
401
|
}
|
|
442
|
-
function
|
|
443
|
-
const r2 = t2.getState(), i2 =
|
|
402
|
+
function ot(t2, e2, n2, o2) {
|
|
403
|
+
const r2 = t2.getState(), i2 = y(r2, e2, n2, o2);
|
|
444
404
|
if (!i2) return false;
|
|
445
|
-
const a2 =
|
|
405
|
+
const a2 = S(r2, i2), s2 = r2.getBlock(a2);
|
|
446
406
|
if (!s2) return false;
|
|
447
|
-
const c2 =
|
|
407
|
+
const c2 = f(s2), d2 = r2.transaction("command").setSelection(l(a2, c2)).build();
|
|
448
408
|
return t2.dispatch(d2), true;
|
|
449
409
|
}
|
|
450
|
-
function
|
|
410
|
+
function rt(t2, e2) {
|
|
451
411
|
const n2 = t2.getState(), o2 = n2.getNodePath(e2);
|
|
452
412
|
if (!o2) return false;
|
|
453
413
|
const r2 = n2.transaction("input").setSelection(i(e2, o2)).build();
|
|
454
414
|
return t2.dispatch(r2), true;
|
|
455
415
|
}
|
|
456
|
-
const
|
|
457
|
-
function
|
|
416
|
+
const lt = '<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>';
|
|
417
|
+
function it(t2, e2, n2) {
|
|
458
418
|
const o2 = document.createElement("button");
|
|
459
419
|
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) => {
|
|
460
420
|
t3.preventDefault(), t3.stopPropagation();
|
|
461
421
|
}), o2;
|
|
462
422
|
}
|
|
463
|
-
function
|
|
423
|
+
function at(t2, e2) {
|
|
464
424
|
const n2 = document.createElement("div");
|
|
465
425
|
n2.className = `ntbl-insert-line ntbl-insert-line--${t2}`, n2.setAttribute("contenteditable", "false"), n2.setAttribute("data-notectl-no-print", "");
|
|
466
|
-
const o2 =
|
|
426
|
+
const o2 = it("ntbl-insert-btn", lt, e2 ?? ("horizontal" === t2 ? "Insert row" : "Insert column"));
|
|
467
427
|
return n2.appendChild(o2), n2;
|
|
468
428
|
}
|
|
469
|
-
function
|
|
429
|
+
function st(t2, e2) {
|
|
470
430
|
const n2 = document.createElement("button");
|
|
471
431
|
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;
|
|
472
432
|
const o2 = document.createElement("span");
|
|
473
|
-
return o2.className = "ntbl-add-icon", o2.innerHTML =
|
|
433
|
+
return o2.className = "ntbl-add-icon", o2.innerHTML = lt, n2.appendChild(o2), n2.addEventListener("mousedown", (t3) => {
|
|
474
434
|
t3.preventDefault(), t3.stopPropagation();
|
|
475
435
|
}), n2;
|
|
476
436
|
}
|
|
477
|
-
function
|
|
437
|
+
function ct(t2) {
|
|
478
438
|
const e2 = document.createElement("div");
|
|
479
439
|
return e2.className = t2, e2.setAttribute("contenteditable", "false"), e2.setAttribute("data-notectl-no-print", ""), e2;
|
|
480
440
|
}
|
|
481
|
-
function
|
|
482
|
-
"none" === e2 ?
|
|
441
|
+
function dt(t2, e2) {
|
|
442
|
+
w(t2, "none" === e2 ? { backgroundColor: "transparent", border: "1px dashed rgba(128,128,128,0.4)" } : e2 ? { backgroundColor: e2, border: "1px solid rgba(0,0,0,0.15)" } : { backgroundColor: "var(--notectl-border)", border: "1px solid rgba(0,0,0,0.15)" });
|
|
483
443
|
}
|
|
484
|
-
function
|
|
444
|
+
function ut(t2, e2, n2, o2) {
|
|
485
445
|
const r2 = document.createElement("div");
|
|
486
446
|
r2.className = `ntbl-handle ${t2}`, r2.dataset.index = String(e2);
|
|
487
|
-
const l2 =
|
|
447
|
+
const l2 = it("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);
|
|
488
448
|
return l2.addEventListener("click", (t3) => {
|
|
489
449
|
t3.preventDefault(), t3.stopPropagation(), o2(e2);
|
|
490
450
|
}), r2.appendChild(l2), r2;
|
|
491
451
|
}
|
|
492
|
-
function
|
|
452
|
+
function bt(t2, e2) {
|
|
493
453
|
let n2 = 0, o2 = 0, r2 = t2;
|
|
494
454
|
for (; r2 && r2 !== e2; ) n2 += r2.offsetTop, o2 += r2.offsetLeft, r2 = r2.offsetParent;
|
|
495
455
|
return { top: n2, left: o2 };
|
|
496
456
|
}
|
|
497
|
-
class
|
|
457
|
+
class ht {
|
|
498
458
|
tableId;
|
|
499
459
|
numRows;
|
|
500
460
|
numCols;
|
|
@@ -552,16 +512,16 @@ class bt {
|
|
|
552
512
|
onMouseLeave = () => {
|
|
553
513
|
this.hideInsertLines();
|
|
554
514
|
};
|
|
555
|
-
constructor(t2, e2, n2, o2, r2, l2, i2 =
|
|
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 =
|
|
557
|
-
const t3 =
|
|
515
|
+
constructor(t2, e2, n2, o2, r2, l2, i2 = B) {
|
|
516
|
+
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 = u(n2).length, this.numCols = this.countCols(n2), this.colBar = ct("ntbl-col-bar"), this.rowBar = ct("ntbl-row-bar"), this.insertLineH = at("horizontal", i2.insertRow), this.insertLineV = at("vertical", i2.insertColumn), this.addRowZone = st("ntbl-add-row", i2.addRow), this.addColZone = st("ntbl-add-col", i2.addColumn), this.deleteTableBtn = it("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) {
|
|
517
|
+
const t3 = _(o2(), this.tableId);
|
|
558
518
|
this.borderColorBtn = (function(t4) {
|
|
559
|
-
const e3 =
|
|
519
|
+
const e3 = it("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");
|
|
560
520
|
e3.setAttribute("data-notectl-no-print", "");
|
|
561
521
|
const n3 = document.createElement("span");
|
|
562
|
-
return n3.className = "ntbl-border-color-swatch",
|
|
522
|
+
return n3.className = "ntbl-border-color-swatch", dt(n3, t4), e3.appendChild(n3), e3;
|
|
563
523
|
})(t3), this.actionsBtn = (function(t4) {
|
|
564
|
-
const e3 =
|
|
524
|
+
const e3 = it("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)");
|
|
565
525
|
return e3.setAttribute("data-notectl-no-print", ""), e3;
|
|
566
526
|
})(i2.tableActionsHint);
|
|
567
527
|
} else this.borderColorBtn = null, this.actionsBtn = null;
|
|
@@ -574,12 +534,12 @@ class bt {
|
|
|
574
534
|
}
|
|
575
535
|
update(t2) {
|
|
576
536
|
this.tableId = t2.id;
|
|
577
|
-
const e2 =
|
|
537
|
+
const e2 = u(t2).length, n2 = this.countCols(t2);
|
|
578
538
|
if (e2 === this.numRows && n2 === this.numCols || (this.numRows = e2, this.numCols = n2, this.rebuildColHandles(), this.rebuildRowHandles()), this.borderColorBtn) {
|
|
579
539
|
const e3 = this.borderColorBtn.querySelector(".ntbl-border-color-swatch");
|
|
580
540
|
if (e3) {
|
|
581
541
|
const n3 = t2.attrs?.borderColor;
|
|
582
|
-
|
|
542
|
+
dt(e3, n3);
|
|
583
543
|
}
|
|
584
544
|
}
|
|
585
545
|
requestAnimationFrame(() => this.positionControls());
|
|
@@ -590,15 +550,15 @@ class bt {
|
|
|
590
550
|
bindEventListeners() {
|
|
591
551
|
const t2 = this.insertLineH.querySelector(".ntbl-insert-btn"), e2 = this.insertLineV.querySelector(".ntbl-insert-btn");
|
|
592
552
|
if (t2.addEventListener("click", () => {
|
|
593
|
-
this.activeRowIndex >= 0 && this.dispatchTransaction(
|
|
553
|
+
this.activeRowIndex >= 0 && this.dispatchTransaction(Z(this.getState(), this.tableId, this.activeRowIndex));
|
|
594
554
|
}), e2.addEventListener("click", () => {
|
|
595
|
-
this.activeColIndex >= 0 && this.dispatchTransaction(
|
|
555
|
+
this.activeColIndex >= 0 && this.dispatchTransaction(q(this.getState(), this.tableId, this.activeColIndex));
|
|
596
556
|
}), this.addRowZone.addEventListener("click", () => {
|
|
597
|
-
this.dispatchTransaction(
|
|
557
|
+
this.dispatchTransaction(Z(this.getState(), this.tableId, this.numRows));
|
|
598
558
|
}), this.addColZone.addEventListener("click", () => {
|
|
599
|
-
this.dispatchTransaction(
|
|
559
|
+
this.dispatchTransaction(q(this.getState(), this.tableId, this.numCols));
|
|
600
560
|
}), this.deleteTableBtn.addEventListener("click", () => {
|
|
601
|
-
this.dispatchTransaction(
|
|
561
|
+
this.dispatchTransaction(Y(this.getState(), this.tableId));
|
|
602
562
|
}), this.borderColorBtn && this.pluginContext) {
|
|
603
563
|
const t3 = this.pluginContext;
|
|
604
564
|
this.borderColorBtn.addEventListener("click", () => {
|
|
@@ -617,12 +577,12 @@ class bt {
|
|
|
617
577
|
if (this.activeContextMenu?.isOpen()) return this.activeContextMenu.close(), void (this.activeContextMenu = null);
|
|
618
578
|
if (!this.actionsBtn) return;
|
|
619
579
|
const e2 = this.actionsBtn.getBoundingClientRect(), n2 = new DOMRect(e2.left, e2.bottom + 4, 0, 0);
|
|
620
|
-
this.activeContextMenu =
|
|
580
|
+
this.activeContextMenu = J(this.container, t2, this.tableId, n2, () => {
|
|
621
581
|
this.activeContextMenu = null;
|
|
622
582
|
}, this.locale);
|
|
623
583
|
}
|
|
624
584
|
toggleBorderColorPopup(t2) {
|
|
625
|
-
this.borderColorPopup ? this.closeBorderColorPopup() : (this.borderColorPopup = document.createElement("div"), this.borderColorPopup.className = "notectl-table-context-menu", this.borderColorPopup
|
|
585
|
+
this.borderColorPopup ? this.closeBorderColorPopup() : (this.borderColorPopup = document.createElement("div"), this.borderColorPopup.className = "notectl-table-context-menu", w(this.borderColorPopup, { position: "absolute", top: "24px", left: "24px", zIndex: "10000" }), this.borderColorPopup.setAttribute("contenteditable", "false"), V(this.borderColorPopup, t2, this.tableId, () => {
|
|
626
586
|
this.closeBorderColorPopup();
|
|
627
587
|
}, this.locale), this.container.appendChild(this.borderColorPopup));
|
|
628
588
|
}
|
|
@@ -633,8 +593,8 @@ class bt {
|
|
|
633
593
|
t2 && this.dispatchFn(t2);
|
|
634
594
|
}
|
|
635
595
|
countCols(t2) {
|
|
636
|
-
const e2 =
|
|
637
|
-
return e2[0] ?
|
|
596
|
+
const e2 = u(t2);
|
|
597
|
+
return e2[0] ? u(e2[0]).length : 0;
|
|
638
598
|
}
|
|
639
599
|
positionControls() {
|
|
640
600
|
!(function(t2, e2, n2) {
|
|
@@ -643,9 +603,9 @@ class bt {
|
|
|
643
603
|
const r2 = e2 / n2;
|
|
644
604
|
for (let t3 = 0; t3 < o2.length; t3++) {
|
|
645
605
|
const e3 = o2[t3];
|
|
646
|
-
e3
|
|
606
|
+
w(e3, { left: `${Math.round(r2 * t3)}px`, width: `${Math.round(r2)}px` });
|
|
647
607
|
}
|
|
648
|
-
t2
|
|
608
|
+
g(t2, "width", `${e2}px`);
|
|
649
609
|
})(this.colBar, this.tableEl.offsetWidth, this.numCols), (function(t2, e2) {
|
|
650
610
|
const n2 = t2.children;
|
|
651
611
|
if (0 === n2.length) return;
|
|
@@ -655,24 +615,24 @@ class bt {
|
|
|
655
615
|
const e3 = n2[t3], i2 = o2[t3];
|
|
656
616
|
if (i2) {
|
|
657
617
|
const t4 = i2.offsetTop - r2, n3 = i2.offsetHeight;
|
|
658
|
-
e3
|
|
618
|
+
w(e3, { top: `${t4}px`, height: `${n3}px` }), l2 = t4 + n3;
|
|
659
619
|
}
|
|
660
620
|
}
|
|
661
|
-
t2
|
|
621
|
+
g(t2, "height", `${l2}px`);
|
|
662
622
|
})(this.rowBar, this.tableEl), (function(t2, e2, n2, o2) {
|
|
663
|
-
const r2 =
|
|
664
|
-
t2
|
|
623
|
+
const r2 = bt(n2, o2), l2 = n2.offsetHeight, i2 = n2.offsetWidth;
|
|
624
|
+
w(t2, { width: `${i2}px`, left: `${r2.left}px` }), w(e2, { height: `${l2}px`, top: `${r2.top}px` });
|
|
665
625
|
})(this.addRowZone, this.addColZone, this.tableEl, this.container);
|
|
666
626
|
}
|
|
667
627
|
showHorizontalLine(t2) {
|
|
668
628
|
this.activeRowIndex = t2.index;
|
|
669
|
-
const e2 =
|
|
670
|
-
this.insertLineH
|
|
629
|
+
const e2 = bt(this.tableEl, this.container);
|
|
630
|
+
w(this.insertLineH, { top: e2.top + t2.position - 1 + "px", left: `${e2.left}px`, width: `${this.tableEl.offsetWidth}px` }), this.insertLineH.classList.add("ntbl-insert-line--visible");
|
|
671
631
|
}
|
|
672
632
|
showVerticalLine(t2) {
|
|
673
633
|
this.activeColIndex = t2.index;
|
|
674
|
-
const e2 =
|
|
675
|
-
this.insertLineV
|
|
634
|
+
const e2 = bt(this.tableEl, this.container);
|
|
635
|
+
w(this.insertLineV, { left: e2.left + t2.position - 1 + "px", top: `${e2.top}px`, height: `${this.tableEl.offsetHeight}px` }), this.insertLineV.classList.add("ntbl-insert-line--visible");
|
|
676
636
|
}
|
|
677
637
|
hideInsertLines() {
|
|
678
638
|
this.hideHorizontalLine(), this.hideVerticalLine();
|
|
@@ -686,8 +646,8 @@ class bt {
|
|
|
686
646
|
rebuildColHandles() {
|
|
687
647
|
this.colBar.innerHTML = "";
|
|
688
648
|
for (let t2 = 0; t2 < this.numCols; t2++) {
|
|
689
|
-
const e2 =
|
|
690
|
-
this.dispatchTransaction(
|
|
649
|
+
const e2 = ut("ntbl-col-handle", t2, "Delete column", (t3) => {
|
|
650
|
+
this.dispatchTransaction(K(this.getState(), this.tableId, t3));
|
|
691
651
|
});
|
|
692
652
|
this.colBar.appendChild(e2);
|
|
693
653
|
}
|
|
@@ -695,19 +655,19 @@ class bt {
|
|
|
695
655
|
rebuildRowHandles() {
|
|
696
656
|
this.rowBar.innerHTML = "";
|
|
697
657
|
for (let t2 = 0; t2 < this.numRows; t2++) {
|
|
698
|
-
const e2 =
|
|
699
|
-
this.dispatchTransaction(
|
|
658
|
+
const e2 = ut("ntbl-row-handle", t2, "Delete row", (t3) => {
|
|
659
|
+
this.dispatchTransaction(O(this.getState(), this.tableId, t3));
|
|
700
660
|
});
|
|
701
661
|
this.rowBar.appendChild(e2);
|
|
702
662
|
}
|
|
703
663
|
}
|
|
704
664
|
}
|
|
705
|
-
function
|
|
706
|
-
"none" === e2 ? (t2
|
|
665
|
+
function pt(t2, e2) {
|
|
666
|
+
"none" === e2 ? (g(t2, "--ntbl-border-color", "transparent"), t2.classList.add("notectl-table--borderless")) : e2 ? (g(t2, "--ntbl-border-color", e2), t2.classList.remove("notectl-table--borderless")) : (v(t2, "--ntbl-border-color"), t2.classList.remove("notectl-table--borderless"));
|
|
707
667
|
}
|
|
708
|
-
const
|
|
709
|
-
const
|
|
710
|
-
class
|
|
668
|
+
const ft = new t("tableSelection");
|
|
669
|
+
const mt = { maxPickerRows: 8, maxPickerCols: 8 }, gt = "border-collapse: collapse; width: 100%; table-layout: fixed";
|
|
670
|
+
class wt {
|
|
711
671
|
id = "table";
|
|
712
672
|
name = "Table";
|
|
713
673
|
priority = 40;
|
|
@@ -717,74 +677,74 @@ class gt {
|
|
|
717
677
|
cleanupMouseSelection = null;
|
|
718
678
|
context = null;
|
|
719
679
|
constructor(t2) {
|
|
720
|
-
this.config = { ...
|
|
680
|
+
this.config = { ...mt, ...t2 };
|
|
721
681
|
}
|
|
722
682
|
init(t2) {
|
|
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) {
|
|
683
|
+
this.locale = e(N, 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), G(t2, this.locale), t2.registerCommand("resetTableBorderColor", () => j(t2, this.locale)), (function(t3, e2) {
|
|
724
684
|
const n2 = { Tab: () => (function(t4, e3) {
|
|
725
|
-
return
|
|
685
|
+
return Q(t4, (n3, o2, r2) => r2.colIndex < r2.totalCols - 1 ? nt(t4, r2.tableId, r2.rowIndex, r2.colIndex + 1) : r2.rowIndex < r2.totalRows - 1 ? nt(t4, r2.tableId, r2.rowIndex + 1, 0) : (W(t4, e3), true));
|
|
726
686
|
})(t3, e2), "Shift-Tab": () => (function(t4) {
|
|
727
|
-
return
|
|
687
|
+
return Q(t4, (e3, n3, o2) => 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));
|
|
728
688
|
})(t3), Enter: () => (function(t4) {
|
|
729
689
|
const e3 = t4.getState();
|
|
730
690
|
if (o(e3.selection) || r(e3.selection)) return false;
|
|
731
691
|
const n3 = e3.getBlock(e3.selection.anchor.blockId);
|
|
732
692
|
if (n3 && "paragraph" !== n3.type) return false;
|
|
733
|
-
const l2 =
|
|
734
|
-
return !!l2 && (!(l2.rowIndex < l2.totalRows - 1) ||
|
|
693
|
+
const l2 = R(e3, e3.selection.anchor.blockId);
|
|
694
|
+
return !!l2 && (!(l2.rowIndex < l2.totalRows - 1) || nt(t4, l2.tableId, l2.rowIndex + 1, l2.colIndex));
|
|
735
695
|
})(t3), Backspace: () => (function(t4) {
|
|
736
|
-
return
|
|
696
|
+
return Q(t4, (e3, n3, o2) => {
|
|
737
697
|
if (!a(n3)) return false;
|
|
738
698
|
if (0 !== n3.anchor.offset) return false;
|
|
739
699
|
if (0 !== o2.rowIndex || 0 !== o2.colIndex) return false;
|
|
740
|
-
const r2 =
|
|
741
|
-
return n3.anchor.blockId === r2 &&
|
|
700
|
+
const r2 = k(e3, o2.cellId);
|
|
701
|
+
return n3.anchor.blockId === r2 && rt(t4, o2.tableId);
|
|
742
702
|
});
|
|
743
703
|
})(t3), Delete: () => (function(t4) {
|
|
744
|
-
return
|
|
704
|
+
return Q(t4, (e3, n3, o2) => {
|
|
745
705
|
if (!a(n3)) return false;
|
|
746
706
|
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
747
707
|
if (!r2) return false;
|
|
748
|
-
const l2 =
|
|
708
|
+
const l2 = f(r2);
|
|
749
709
|
if (n3.anchor.offset !== l2) return false;
|
|
750
710
|
if (o2.rowIndex !== o2.totalRows - 1 || o2.colIndex !== o2.totalCols - 1) return false;
|
|
751
|
-
const i2 =
|
|
752
|
-
return n3.anchor.blockId === i2 &&
|
|
711
|
+
const i2 = S(e3, o2.cellId);
|
|
712
|
+
return n3.anchor.blockId === i2 && rt(t4, o2.tableId);
|
|
753
713
|
});
|
|
754
714
|
})(t3), ArrowDown: () => (function(t4) {
|
|
755
|
-
return
|
|
756
|
-
const r2 =
|
|
757
|
-
return n3.anchor.blockId === r2 && (o2.rowIndex >= o2.totalRows - 1 ?
|
|
715
|
+
return Q(t4, (e3, n3, o2) => {
|
|
716
|
+
const r2 = S(e3, o2.cellId);
|
|
717
|
+
return n3.anchor.blockId === r2 && (o2.rowIndex >= o2.totalRows - 1 ? tt(t4) : nt(t4, o2.tableId, o2.rowIndex + 1, o2.colIndex));
|
|
758
718
|
});
|
|
759
719
|
})(t3), ArrowUp: () => (function(t4) {
|
|
760
|
-
return
|
|
761
|
-
const r2 =
|
|
762
|
-
return n3.anchor.blockId === r2 && !(o2.rowIndex <= 0) &&
|
|
720
|
+
return Q(t4, (e3, n3, o2) => {
|
|
721
|
+
const r2 = k(e3, o2.cellId);
|
|
722
|
+
return n3.anchor.blockId === r2 && !(o2.rowIndex <= 0) && nt(t4, o2.tableId, o2.rowIndex - 1, o2.colIndex);
|
|
763
723
|
});
|
|
764
724
|
})(t3), ArrowRight: () => (function(t4) {
|
|
765
|
-
return
|
|
725
|
+
return Q(t4, (e3, n3, o2) => {
|
|
766
726
|
if (!a(n3)) return false;
|
|
767
727
|
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
768
728
|
if (!r2) return false;
|
|
769
|
-
const l2 =
|
|
729
|
+
const l2 = f(r2);
|
|
770
730
|
if (n3.anchor.offset !== l2) return false;
|
|
771
|
-
const i2 =
|
|
772
|
-
return n3.anchor.blockId === i2 && (o2.colIndex < o2.totalCols - 1 ?
|
|
731
|
+
const i2 = S(e3, o2.cellId);
|
|
732
|
+
return n3.anchor.blockId === i2 && (o2.colIndex < o2.totalCols - 1 ? nt(t4, o2.tableId, o2.rowIndex, o2.colIndex + 1) : !(o2.rowIndex < o2.totalRows - 1) || nt(t4, o2.tableId, o2.rowIndex + 1, 0));
|
|
773
733
|
});
|
|
774
734
|
})(t3), ArrowLeft: () => (function(t4) {
|
|
775
|
-
return
|
|
735
|
+
return Q(t4, (e3, n3, o2) => {
|
|
776
736
|
if (!a(n3)) return false;
|
|
777
737
|
if (0 !== n3.anchor.offset) return false;
|
|
778
|
-
const r2 =
|
|
779
|
-
return n3.anchor.blockId === r2 && (o2.colIndex > 0 ?
|
|
738
|
+
const r2 = k(e3, o2.cellId);
|
|
739
|
+
return n3.anchor.blockId === r2 && (o2.colIndex > 0 ? ot(t4, o2.tableId, o2.rowIndex, o2.colIndex - 1) : !(o2.rowIndex > 0) || ot(t4, o2.tableId, o2.rowIndex - 1, o2.totalCols - 1));
|
|
780
740
|
});
|
|
781
|
-
})(t3), Escape: () =>
|
|
782
|
-
return
|
|
741
|
+
})(t3), Escape: () => tt(t3), "Shift-F10": () => (function(t4) {
|
|
742
|
+
return Q(t4, (e3, n3, o2) => {
|
|
783
743
|
const r2 = t4.getContainer(), l2 = r2.querySelector(`[data-block-id="${o2.cellId}"]`);
|
|
784
744
|
if (!l2) return false;
|
|
785
745
|
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
|
|
787
|
-
|
|
746
|
+
return et?.close(), et = J(s2, t4, o2.tableId, a2, () => {
|
|
747
|
+
et = null;
|
|
788
748
|
}), true;
|
|
789
749
|
});
|
|
790
750
|
})(t3) };
|
|
@@ -796,7 +756,7 @@ class gt {
|
|
|
796
756
|
if (!e2) return n2 = [], void (o2 = /* @__PURE__ */ new Set());
|
|
797
757
|
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);
|
|
798
758
|
for (let t4 = i2; t4 <= a2; t4++) for (let n3 = s2; n3 <= c2; n3++) {
|
|
799
|
-
const o3 =
|
|
759
|
+
const o3 = y(r4, e2.tableId, t4, n3);
|
|
800
760
|
o3 && l2.push(o3);
|
|
801
761
|
}
|
|
802
762
|
n2 = l2, o2 = new Set(l2);
|
|
@@ -808,7 +768,7 @@ class gt {
|
|
|
808
768
|
}
|
|
809
769
|
})(t3, o2);
|
|
810
770
|
}, getSelectedCellIds: () => n2, isSelected: (t4) => o2.has(t4) };
|
|
811
|
-
return t3.registerService(
|
|
771
|
+
return t3.registerService(ft, r2), r2;
|
|
812
772
|
})(t2);
|
|
813
773
|
}
|
|
814
774
|
onReady() {
|
|
@@ -819,13 +779,13 @@ class gt {
|
|
|
819
779
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
820
780
|
if (l3) if (n3.shiftKey) {
|
|
821
781
|
if (o2) {
|
|
822
|
-
const r3 =
|
|
782
|
+
const r3 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
823
783
|
if (!r3 || r3.tableId !== o2.tableId) return;
|
|
824
784
|
n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: r3.rowIndex, toCol: r3.colIndex });
|
|
825
785
|
}
|
|
826
786
|
} else {
|
|
827
787
|
e2.setSelectedRange(null);
|
|
828
|
-
const n4 =
|
|
788
|
+
const n4 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
829
789
|
if (!n4) return;
|
|
830
790
|
o2 = { tableId: n4.tableId, row: n4.rowIndex, col: n4.colIndex }, r2 = true;
|
|
831
791
|
}
|
|
@@ -835,7 +795,7 @@ class gt {
|
|
|
835
795
|
if (!r2 || !o2) return;
|
|
836
796
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
837
797
|
if (!l3) return;
|
|
838
|
-
const i3 =
|
|
798
|
+
const i3 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
839
799
|
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 })));
|
|
840
800
|
}
|
|
841
801
|
function a2() {
|
|
@@ -852,7 +812,7 @@ class gt {
|
|
|
852
812
|
onStateChange(t2, e2, n2) {
|
|
853
813
|
if (this.selectionService?.getSelectedRange()) {
|
|
854
814
|
const t3 = e2.selection;
|
|
855
|
-
(o(t3) || r(t3) || !
|
|
815
|
+
(o(t3) || r(t3) || !A(e2, t3.anchor.blockId)) && this.selectionService.setSelectedRange(null);
|
|
856
816
|
}
|
|
857
817
|
}
|
|
858
818
|
registerNodeSpecs(t2) {
|
|
@@ -861,7 +821,7 @@ class gt {
|
|
|
861
821
|
return e2.className = "notectl-table-wrapper", e2.setAttribute("data-block-id", t3.id), e2;
|
|
862
822
|
}, toHTML(t3, e2) {
|
|
863
823
|
const o2 = t3.attrs?.borderColor, r2 = (function(t4) {
|
|
864
|
-
return t4 ? "none" === t4 ? `${
|
|
824
|
+
return t4 ? "none" === t4 ? `${gt}; --ntbl-bc: transparent` : s(t4) ? `${gt}; --ntbl-bc: ${n(t4)}` : gt : gt;
|
|
865
825
|
})(o2);
|
|
866
826
|
return `<table style="${r2}">${e2}</table>`;
|
|
867
827
|
}, sanitize: { tags: ["table", "tbody"] } }), t2.registerNodeSpec({ type: "table_row", group: "table_content", content: { allow: ["table_cell"], min: 1 }, toDOM(t3) {
|
|
@@ -876,7 +836,7 @@ class gt {
|
|
|
876
836
|
}, sanitize: { tags: ["td"], attrs: ["colspan", "rowspan"] } });
|
|
877
837
|
}
|
|
878
838
|
registerNodeViews(t2) {
|
|
879
|
-
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 =
|
|
839
|
+
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 = B) {
|
|
880
840
|
return (t4, o2, r2) => {
|
|
881
841
|
const l2 = document.createElement("div");
|
|
882
842
|
l2.className = "ntbl-container", l2.setAttribute("data-block-id", t4.id), l2.setAttribute("data-selectable", "true");
|
|
@@ -884,29 +844,29 @@ class gt {
|
|
|
884
844
|
i2.className = "notectl-table-wrapper";
|
|
885
845
|
const a2 = document.createElement("table");
|
|
886
846
|
a2.className = "notectl-table", a2.setAttribute("role", "table");
|
|
887
|
-
const s2 =
|
|
847
|
+
const s2 = u(t4), c2 = s2.length, d2 = s2[0] ? u(s2[0]).length : 0;
|
|
888
848
|
a2.setAttribute("aria-label", n2.tableAriaLabel(c2, d2)), a2.setAttribute("aria-description", n2.tableAriaDescription);
|
|
889
|
-
const
|
|
890
|
-
a2.appendChild(
|
|
849
|
+
const b2 = document.createElement("tbody");
|
|
850
|
+
a2.appendChild(b2), i2.appendChild(a2), l2.appendChild(i2), pt(a2, t4.attrs?.borderColor);
|
|
891
851
|
const h2 = document.createElement("div");
|
|
892
852
|
h2.className = "notectl-sr-only", h2.setAttribute("aria-live", "polite"), h2.setAttribute("aria-atomic", "true"), l2.appendChild(h2);
|
|
893
853
|
const p2 = (function(t5, e3, n3, o3, r3, l3, i3) {
|
|
894
|
-
return new
|
|
854
|
+
return new ht(t5, e3, n3, o3, r3, l3, i3);
|
|
895
855
|
})(l2, a2, t4, o2, r2, e2, n2);
|
|
896
856
|
let f2 = null, m2 = t4.id;
|
|
897
857
|
const g2 = (t5) => {
|
|
898
858
|
if (!e2) return;
|
|
899
859
|
t5.preventDefault(), t5.stopPropagation(), f2?.close();
|
|
900
860
|
const o3 = new DOMRect(t5.clientX, t5.clientY, 0, 0);
|
|
901
|
-
f2 =
|
|
861
|
+
f2 = J(l2, e2, m2, o3, () => {
|
|
902
862
|
f2 = null;
|
|
903
863
|
}, n2);
|
|
904
864
|
};
|
|
905
|
-
return a2.addEventListener("contextmenu", g2), { dom: l2, contentDOM:
|
|
865
|
+
return a2.addEventListener("contextmenu", g2), { dom: l2, contentDOM: b2, update(t5) {
|
|
906
866
|
if ("table" !== t5.type) return false;
|
|
907
867
|
m2 = t5.id, l2.setAttribute("data-block-id", t5.id), l2.setAttribute("data-selectable", "true");
|
|
908
|
-
const e3 =
|
|
909
|
-
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)),
|
|
868
|
+
const e3 = u(t5), o3 = e3.length, r3 = e3[0] ? u(e3[0]).length : 0;
|
|
869
|
+
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)), pt(a2, t5.attrs?.borderColor), p2.update(t5), false;
|
|
910
870
|
}, destroy() {
|
|
911
871
|
f2?.destroy(), a2.removeEventListener("contextmenu", g2), p2.destroy();
|
|
912
872
|
}, selectNode() {
|
|
@@ -925,7 +885,7 @@ class gt {
|
|
|
925
885
|
const r2 = t3.attrs?.colspan ?? 1, l2 = t3.attrs?.rowspan ?? 1;
|
|
926
886
|
r2 > 1 && (o2.colSpan = r2), l2 > 1 && (o2.rowSpan = l2);
|
|
927
887
|
const i2 = t3.attrs?.align;
|
|
928
|
-
return i2 && "left" !== i2 && (o2
|
|
888
|
+
return i2 && "left" !== i2 && g(o2, "textAlign", i2), { dom: o2, contentDOM: o2, update(t4) {
|
|
929
889
|
if ("table_cell" !== t4.type) return false;
|
|
930
890
|
o2.setAttribute("data-block-id", t4.id);
|
|
931
891
|
const e3 = t4.attrs?.colspan ?? 1, n3 = t4.attrs?.rowspan ?? 1;
|
|
@@ -937,28 +897,28 @@ class gt {
|
|
|
937
897
|
registerToolbarItem(t2) {
|
|
938
898
|
const e2 = this.config.maxPickerRows ?? 8, n2 = this.config.maxPickerCols ?? 8;
|
|
939
899
|
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
|
-
|
|
941
|
-
} }, isActive: (t3) => !o(t3.selection) && !r(t3.selection) &&
|
|
900
|
+
U(t2, e3, n3);
|
|
901
|
+
} }, isActive: (t3) => !o(t3.selection) && !r(t3.selection) && A(t3, t3.selection.anchor.blockId) });
|
|
942
902
|
}
|
|
943
903
|
}
|
|
944
904
|
export {
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
905
|
+
P as B,
|
|
906
|
+
wt as T,
|
|
907
|
+
N as a,
|
|
908
|
+
H as b,
|
|
909
|
+
L as c,
|
|
910
|
+
B as d,
|
|
911
|
+
T as e,
|
|
912
|
+
E as f,
|
|
913
|
+
$ as g,
|
|
914
|
+
M as h,
|
|
915
|
+
D as i,
|
|
916
|
+
ft as j,
|
|
917
|
+
R as k,
|
|
918
|
+
A as l,
|
|
919
|
+
J as m,
|
|
920
|
+
_ as n,
|
|
921
|
+
j as r,
|
|
922
|
+
F as s
|
|
963
923
|
};
|
|
964
|
-
//# sourceMappingURL=index-
|
|
924
|
+
//# sourceMappingURL=index-BhDXjueu.mjs.map
|