@notectl/core 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AttrRegistry-Ci0qAvtS.mjs → AttrRegistry-D9Jx_RVb.mjs} +2 -2
- package/dist/chunks/{AttrRegistry-Ci0qAvtS.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-qLfeL0So.mjs → CaretNavigation-7JYpIKbs.mjs} +3 -3
- package/dist/chunks/{CaretNavigation-qLfeL0So.mjs.map → CaretNavigation-7JYpIKbs.mjs.map} +1 -1
- package/dist/chunks/{ColorGrid-BBkN0AOb.mjs → ColorGrid--lBQ7jCK.mjs} +56 -55
- package/dist/chunks/ColorGrid--lBQ7jCK.mjs.map +1 -0
- package/dist/chunks/{ColorPickerPopup-D3ysvOH-.mjs → ColorPickerPopup-TpIRlXc8.mjs} +15 -15
- package/dist/chunks/ColorPickerPopup-TpIRlXc8.mjs.map +1 -0
- package/dist/chunks/{Document-DfZ1NOjs.mjs → Document-Brtw2jL1.mjs} +6 -6
- package/dist/chunks/Document-Brtw2jL1.mjs.map +1 -0
- package/dist/chunks/{MarkCommands-uybmkw9l.mjs → MarkCommands-6RUJ4L3r.mjs} +3 -3
- package/dist/chunks/MarkCommands-6RUJ4L3r.mjs.map +1 -0
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs → NodeResolver-C2XYkeOi.mjs} +2 -2
- package/dist/chunks/{NodeResolver-CzLmmrph.mjs.map → NodeResolver-C2XYkeOi.mjs.map} +1 -1
- package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +1 -1
- package/dist/chunks/PopupPositioning-CgjgAKjp.mjs +34 -0
- package/dist/chunks/PopupPositioning-CgjgAKjp.mjs.map +1 -0
- package/dist/chunks/RangeIterator-Bh4Vl_6D.mjs +16 -0
- package/dist/chunks/{RangeIterator-Bye0UtbY.mjs.map → RangeIterator-Bh4Vl_6D.mjs.map} +1 -1
- package/dist/chunks/StyleRuntime-CP4NCwKT.mjs +235 -0
- package/dist/chunks/StyleRuntime-CP4NCwKT.mjs.map +1 -0
- package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
- package/dist/chunks/{index-Bt_d4IqB.mjs → index--7pBhSF4.mjs} +74 -73
- package/dist/chunks/index--7pBhSF4.mjs.map +1 -0
- package/dist/chunks/{index-DayTn6Re.mjs → index-BXCkjDax.mjs} +78 -83
- package/dist/chunks/index-BXCkjDax.mjs.map +1 -0
- package/dist/chunks/{index-DGKQhSAl.mjs → index-BXtw5PNN.mjs} +2 -2
- package/dist/chunks/{index-DGKQhSAl.mjs.map → index-BXtw5PNN.mjs.map} +1 -1
- package/dist/chunks/{ToolbarPlugin-B7oJRzpl.mjs → index-BcDRT4K2.mjs} +110 -121
- package/dist/chunks/index-BcDRT4K2.mjs.map +1 -0
- package/dist/chunks/{index-DoCvDkfj.mjs → index-BjFBWBOC.mjs} +23 -25
- package/dist/chunks/index-BjFBWBOC.mjs.map +1 -0
- package/dist/chunks/{index-CrKz_IEn.mjs → index-C1opJocO.mjs} +2 -2
- package/dist/chunks/{index-CrKz_IEn.mjs.map → index-C1opJocO.mjs.map} +1 -1
- package/dist/chunks/{index-CfyS_pgH.mjs → index-CCyqQ0Dz.mjs} +32 -31
- package/dist/chunks/index-CCyqQ0Dz.mjs.map +1 -0
- package/dist/chunks/{index-E7OgN7hM.mjs → index-Cd3uJLP3.mjs} +2 -2
- package/dist/chunks/{index-E7OgN7hM.mjs.map → index-Cd3uJLP3.mjs.map} +1 -1
- package/dist/chunks/{index-yhz2qeeh.mjs → index-DSAuGP4n.mjs} +131 -127
- package/dist/chunks/index-DSAuGP4n.mjs.map +1 -0
- package/dist/chunks/{index-CH1r7DL-.mjs → index-DtRfqsq5.mjs} +211 -210
- package/dist/chunks/index-DtRfqsq5.mjs.map +1 -0
- package/dist/chunks/{index-CFPP456m.mjs → index-DxbQirny.mjs} +8 -8
- package/dist/chunks/{index-CFPP456m.mjs.map → index-DxbQirny.mjs.map} +1 -1
- package/dist/chunks/{index-DuRNETFv.mjs → index-ErZ5_a1o.mjs} +3 -3
- package/dist/chunks/{index-DuRNETFv.mjs.map → index-ErZ5_a1o.mjs.map} +1 -1
- package/dist/chunks/{index-Deag_lVi.mjs → index-WpbK_s_H.mjs} +29 -31
- package/dist/chunks/index-WpbK_s_H.mjs.map +1 -0
- package/dist/chunks/{index-DIvHQtE2.mjs → index-WrqH1wG8.mjs} +15 -14
- package/dist/chunks/index-WrqH1wG8.mjs.map +1 -0
- package/dist/chunks/{index-Dy6SllXW.mjs → index-fsVJLutn.mjs} +3 -3
- package/dist/chunks/{index-Dy6SllXW.mjs.map → index-fsVJLutn.mjs.map} +1 -1
- package/dist/chunks/{index-Ckzqtn5D.mjs → index-fx3KIap3.mjs} +15 -14
- package/dist/chunks/index-fx3KIap3.mjs.map +1 -0
- package/dist/chunks/{index-DmuuFS5D.mjs → index-oOJo-ywB.mjs} +4 -4
- package/dist/chunks/{index-DmuuFS5D.mjs.map → index-oOJo-ywB.mjs.map} +1 -1
- package/dist/chunks/{index-CFJFD4lF.mjs → index-toj88jtL.mjs} +19 -18
- package/dist/chunks/index-toj88jtL.mjs.map +1 -0
- package/dist/commands/AttributedMarkCommands.d.ts.map +1 -1
- package/dist/commands/MarkCommands.d.ts +3 -3
- package/dist/commands/MarkCommands.d.ts.map +1 -1
- package/dist/editor/CSSClassCollector.d.ts +36 -0
- package/dist/editor/CSSClassCollector.d.ts.map +1 -0
- package/dist/editor/ContentHTMLTypes.d.ts +29 -0
- package/dist/editor/ContentHTMLTypes.d.ts.map +1 -0
- package/dist/editor/ContentStyleInjector.d.ts +69 -0
- package/dist/editor/ContentStyleInjector.d.ts.map +1 -0
- package/dist/editor/DocumentParser.d.ts +9 -1
- package/dist/editor/DocumentParser.d.ts.map +1 -1
- package/dist/editor/DocumentSerializer.d.ts +6 -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 +7 -0
- package/dist/editor/MarkSerializer.d.ts.map +1 -1
- package/dist/editor/NotectlEditor.d.ts +13 -3
- package/dist/editor/NotectlEditor.d.ts.map +1 -1
- 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 +10 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/input/LegacyHTMLNormalizer.d.ts.map +1 -1
- package/dist/model/Document.d.ts +0 -4
- package/dist/model/Document.d.ts.map +1 -1
- package/dist/model/NodeSpec.d.ts +19 -2
- package/dist/model/NodeSpec.d.ts.map +1 -1
- package/dist/notectl-core.mjs +613 -477
- package/dist/notectl-core.mjs.map +1 -1
- package/dist/notectl-core.umd.js +1571 -1225
- package/dist/notectl-core.umd.js.map +1 -1
- package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
- package/dist/plugins/alignment.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/CodeBlockPlugin.d.ts +0 -1
- package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -1
- package/dist/plugins/code-block/index.d.ts +2 -1
- package/dist/plugins/code-block/index.d.ts.map +1 -1
- package/dist/plugins/code-block.mjs +1 -1
- package/dist/plugins/font/FontPlugin.d.ts +0 -1
- package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePlugin.d.ts +0 -2
- package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
- package/dist/plugins/font-size/FontSizePopup.d.ts +3 -1
- package/dist/plugins/font-size/FontSizePopup.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 +6 -6
- package/dist/plugins/hard-break.mjs +1 -1
- package/dist/plugins/heading/HeadingBlockTypePicker.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.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.map +1 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts +2 -1
- package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
- package/dist/plugins/shared/PopupManager.d.ts +12 -2
- package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
- package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
- package/dist/plugins/strikethrough.mjs +1 -1
- package/dist/plugins/super-sub.mjs +1 -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/TablePlugin.d.ts.map +1 -1
- package/dist/plugins/table.mjs +1 -1
- package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
- package/dist/plugins/text-color.mjs +1 -1
- package/dist/plugins/text-formatting.mjs +1 -1
- package/dist/plugins/toolbar/ToolbarItem.d.ts +3 -2
- package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
- package/dist/plugins/toolbar/ToolbarPopupController.d.ts +0 -3
- 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.mjs +2 -2
- package/dist/presets/PresetTypes.d.ts +1 -1
- package/dist/presets/PresetTypes.d.ts.map +1 -1
- package/dist/style/StyleRuntime.d.ts +34 -0
- package/dist/style/StyleRuntime.d.ts.map +1 -0
- package/dist/view/Reconciler.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +0 -58
- package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +0 -1
- package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +0 -1
- package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs.map +0 -1
- package/dist/chunks/Document-DfZ1NOjs.mjs.map +0 -1
- package/dist/chunks/MarkCommands-uybmkw9l.mjs.map +0 -1
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +0 -30
- package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +0 -1
- package/dist/chunks/RangeIterator-Bye0UtbY.mjs +0 -16
- package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +0 -1
- package/dist/chunks/index-Bt_d4IqB.mjs.map +0 -1
- package/dist/chunks/index-CFJFD4lF.mjs.map +0 -1
- package/dist/chunks/index-CH1r7DL-.mjs.map +0 -1
- package/dist/chunks/index-CfyS_pgH.mjs.map +0 -1
- package/dist/chunks/index-Ckzqtn5D.mjs.map +0 -1
- package/dist/chunks/index-DIvHQtE2.mjs.map +0 -1
- package/dist/chunks/index-DayTn6Re.mjs.map +0 -1
- package/dist/chunks/index-Deag_lVi.mjs.map +0 -1
- package/dist/chunks/index-DoCvDkfj.mjs.map +0 -1
- package/dist/chunks/index-yhz2qeeh.mjs.map +0 -1
|
@@ -2,16 +2,17 @@ import { S as t, r as e } from "./resolvePluginLocale-B4w1OkPy.mjs";
|
|
|
2
2
|
import { e as n } from "./HTMLUtils-DTqQzcKR.mjs";
|
|
3
3
|
import { i as o, a as r, d as l, e as i, b as a } from "./Selection-BRTab5hO.mjs";
|
|
4
4
|
import { a as s } from "./ColorValidation-CV4f1wu6.mjs";
|
|
5
|
-
import { g as c, r as d } from "./ColorGrid
|
|
6
|
-
import { q as u, u as b, k as h, f as p,
|
|
5
|
+
import { g as c, r as d } from "./ColorGrid--lBQ7jCK.mjs";
|
|
6
|
+
import { q as u, u as b, k as h, f as p, c as f } from "./Document-Brtw2jL1.mjs";
|
|
7
7
|
import { n as m } from "./TypeBrands-C09nE2qO.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { a as g, s as w, e as v } from "./StyleRuntime-CP4NCwKT.mjs";
|
|
9
|
+
import { p as x } from "./PopupPositioning-CgjgAKjp.mjs";
|
|
10
|
+
import { a as C } from "./ToolbarKeyboardNav-DhpL8zNV.mjs";
|
|
11
|
+
function I() {
|
|
11
12
|
const t2 = h(m("paragraph"), [p("")], b());
|
|
12
13
|
return h(m("table_cell"), [t2], b());
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function R(t2, e2) {
|
|
15
16
|
const n2 = t2.getNodePath(e2);
|
|
16
17
|
if (!n2) return null;
|
|
17
18
|
let o2 = null, r2 = null, l2 = null, i2 = null;
|
|
@@ -30,7 +31,7 @@ function x(t2, e2) {
|
|
|
30
31
|
const f2 = h2.length, m2 = c2.length;
|
|
31
32
|
return { tableId: o2, tableIndex: s2, rowId: l2, rowIndex: d2, cellId: i2, colIndex: p2, totalRows: m2, totalCols: f2 };
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function y(t2, e2, n2, o2) {
|
|
34
35
|
const r2 = t2.getBlock(e2);
|
|
35
36
|
if (!r2) return null;
|
|
36
37
|
const l2 = u(r2)[n2];
|
|
@@ -38,7 +39,7 @@ function C(t2, e2, n2, o2) {
|
|
|
38
39
|
const i2 = u(l2)[o2];
|
|
39
40
|
return i2?.id ?? null;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function k(t2, e2) {
|
|
42
43
|
const n2 = t2.getBlock(e2);
|
|
43
44
|
if (!n2) return e2;
|
|
44
45
|
const o2 = u(n2)[0];
|
|
@@ -50,7 +51,7 @@ function I(t2, e2) {
|
|
|
50
51
|
r2 = t3;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function S(t2, e2) {
|
|
54
55
|
const n2 = t2.getBlock(e2);
|
|
55
56
|
if (!n2) return e2;
|
|
56
57
|
const o2 = u(n2), r2 = o2[o2.length - 1];
|
|
@@ -62,7 +63,7 @@ function y(t2, e2) {
|
|
|
62
63
|
l2 = e3;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function A(t2, e2) {
|
|
66
67
|
const n2 = t2.getNodePath(e2);
|
|
67
68
|
if (!n2) return false;
|
|
68
69
|
for (const e3 of n2) {
|
|
@@ -71,8 +72,8 @@ function R(t2, e2) {
|
|
|
71
72
|
}
|
|
72
73
|
return false;
|
|
73
74
|
}
|
|
74
|
-
const k = { 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" }, S = { 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" }, L = { 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" }, 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 打开表格操作" }, 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 для действий с таблицей" }, 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 لإجراءات الجدول" }, 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 = { en: k, de: S, es: A, fr: L, zh: B, ru: T, ar: E, hi: D }, H = ["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#980000", "#cc0000", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3c78d8", "#3d85c6", "#674ea7", "#a64d79", "#0b5394", "#38761d"];
|
|
75
|
-
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) {
|
|
76
77
|
const o2 = t2.getBlock(e2);
|
|
77
78
|
if (!o2 || "table" !== o2.type) return null;
|
|
78
79
|
const r2 = t2.getNodePath(e2);
|
|
@@ -84,97 +85,97 @@ function $(t2, e2, n2) {
|
|
|
84
85
|
const l2 = { ...o2.attrs, borderColor: n2 };
|
|
85
86
|
return t2.transaction("command").setNodeAttr(r2, l2).setSelection(t2.selection).build();
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function F(t2, e2, n2 = B) {
|
|
88
89
|
const l2 = t2.getState();
|
|
89
90
|
if (o(l2.selection) || r(l2.selection)) return false;
|
|
90
|
-
const i2 =
|
|
91
|
+
const i2 = R(l2, l2.selection.anchor.blockId);
|
|
91
92
|
if (!i2) return false;
|
|
92
|
-
const a2 =
|
|
93
|
+
const a2 = z(l2, i2.tableId, e2);
|
|
93
94
|
if (!a2) return false;
|
|
94
95
|
t2.dispatch(a2);
|
|
95
96
|
const s2 = "none" === e2 ? "none" : c(e2);
|
|
96
97
|
return t2.announce(n2.announceBorderColorSet(s2)), true;
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function j(t2, e2 = B) {
|
|
99
100
|
const n2 = t2.getState();
|
|
100
101
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
101
|
-
const l2 =
|
|
102
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
102
103
|
if (!l2) return false;
|
|
103
|
-
const i2 =
|
|
104
|
+
const i2 = z(n2, l2.tableId, void 0);
|
|
104
105
|
return !!i2 && (t2.dispatch(i2), t2.announce(e2.announceBorderReset), true);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function _(t2, e2) {
|
|
107
108
|
const n2 = t2.getBlock(e2);
|
|
108
109
|
if (n2) return n2.attrs?.borderColor;
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function V(t2, e2, n2, o2, r2 = B) {
|
|
111
112
|
t2.classList.add("notectl-color-picker");
|
|
112
|
-
const l2 =
|
|
113
|
+
const l2 = _(e2.getState(), n2), i2 = document.createElement("button");
|
|
113
114
|
i2.type = "button", i2.className = "notectl-color-picker__default", i2.textContent = r2.defaultColor, i2.addEventListener("mousedown", (t3) => {
|
|
114
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
115
|
+
t3.preventDefault(), t3.stopPropagation(), j(e2, r2), o2();
|
|
115
116
|
}), i2.addEventListener("keydown", (t3) => {
|
|
116
117
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
117
118
|
}), t2.appendChild(i2);
|
|
118
119
|
const a2 = document.createElement("button");
|
|
119
120
|
a2.type = "button", a2.className = "notectl-color-picker__default", a2.textContent = r2.noBorders, a2.addEventListener("mousedown", (t3) => {
|
|
120
|
-
t3.preventDefault(), t3.stopPropagation(),
|
|
121
|
+
t3.preventDefault(), t3.stopPropagation(), F(e2, "none", r2), o2();
|
|
121
122
|
}), a2.addEventListener("keydown", (t3) => {
|
|
122
123
|
"Escape" === t3.key && (t3.preventDefault(), o2());
|
|
123
|
-
}), t2.appendChild(a2), d(t2, { colors:
|
|
124
|
-
|
|
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();
|
|
125
126
|
}, onClose: o2 });
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function Z(t2, e2, n2) {
|
|
128
129
|
const o2 = t2.getBlock(e2);
|
|
129
130
|
if (!o2) return null;
|
|
130
131
|
const r2 = u(o2), i2 = r2[0] ? u(r2[0]).length : 0;
|
|
131
132
|
if (0 === i2) return null;
|
|
132
133
|
const a2 = (function(t3) {
|
|
133
134
|
const e3 = [];
|
|
134
|
-
for (let n3 = 0; n3 < t3; n3++) e3.push(
|
|
135
|
+
for (let n3 = 0; n3 < t3; n3++) e3.push(I());
|
|
135
136
|
return h(m("table_row"), e3, b());
|
|
136
137
|
})(i2), s2 = t2.transaction("command").insertNode([e2], n2, a2), c2 = u(a2)[0], d2 = c2 ? u(c2)[0] : void 0;
|
|
137
138
|
return d2 ? s2.setSelection(l(d2.id, 0)) : c2 && s2.setSelection(l(c2.id, 0)), s2.build();
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function q(t2, e2, n2) {
|
|
140
141
|
const o2 = t2.getBlock(e2);
|
|
141
142
|
if (!o2) return null;
|
|
142
143
|
const r2 = u(o2), l2 = t2.transaction("command");
|
|
143
144
|
for (const t3 of r2) {
|
|
144
|
-
const o3 =
|
|
145
|
+
const o3 = I();
|
|
145
146
|
l2.insertNode([e2, t3.id], n2, o3);
|
|
146
147
|
}
|
|
147
148
|
return l2.setSelection(t2.selection), l2.build();
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function O(t2, e2, n2, o2 = 0) {
|
|
150
151
|
const r2 = t2.getBlock(e2);
|
|
151
152
|
if (!r2) return null;
|
|
152
|
-
if (u(r2).length <= 1) return
|
|
153
|
-
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);
|
|
154
155
|
if (a2) {
|
|
155
|
-
const e3 =
|
|
156
|
+
const e3 = k(t2, a2);
|
|
156
157
|
i2.setSelection(l(e3, 0));
|
|
157
158
|
}
|
|
158
159
|
return i2.build();
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function K(t2, e2, n2, o2 = 0) {
|
|
161
162
|
const r2 = t2.getBlock(e2);
|
|
162
163
|
if (!r2) return null;
|
|
163
164
|
const i2 = u(r2);
|
|
164
|
-
if ((i2[0] ? u(i2[0]).length : 0) <= 1) return
|
|
165
|
+
if ((i2[0] ? u(i2[0]).length : 0) <= 1) return Y(t2, e2);
|
|
165
166
|
const a2 = t2.transaction("command");
|
|
166
167
|
for (let t3 = i2.length - 1; t3 >= 0; t3--) {
|
|
167
168
|
const o3 = i2[t3];
|
|
168
169
|
o3 && a2.removeNode([e2, o3.id], n2);
|
|
169
170
|
}
|
|
170
|
-
const s2 =
|
|
171
|
+
const s2 = y(t2, e2, o2, n2 > 0 ? n2 - 1 : 1);
|
|
171
172
|
if (s2) {
|
|
172
|
-
const e3 =
|
|
173
|
+
const e3 = k(t2, s2);
|
|
173
174
|
a2.setSelection(l(e3, 0));
|
|
174
175
|
}
|
|
175
176
|
return a2.build();
|
|
176
177
|
}
|
|
177
|
-
function
|
|
178
|
+
function Y(t2, e2) {
|
|
178
179
|
const n2 = t2.doc.children.findIndex((t3) => t3.id === e2);
|
|
179
180
|
if (-1 === n2) return null;
|
|
180
181
|
const o2 = t2.transaction("command").removeNode([], n2), r2 = t2.doc.children[n2 + 1];
|
|
@@ -182,7 +183,7 @@ function q(t2, e2) {
|
|
|
182
183
|
const i2 = t2.doc.children[n2 - 1];
|
|
183
184
|
return i2 && o2.setSelection(l(i2.id, 0)), o2.build();
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
+
function U(t2, e2, n2) {
|
|
186
187
|
const i2 = t2.getState(), a2 = i2.selection;
|
|
187
188
|
if (o(a2) || r(a2)) return false;
|
|
188
189
|
const s2 = a2.anchor.blockId;
|
|
@@ -205,54 +206,54 @@ function O(t2, e2, n2) {
|
|
|
205
206
|
const n3 = b(), o2 = [];
|
|
206
207
|
for (let n4 = 0; n4 < t3; n4++) {
|
|
207
208
|
const t4 = [];
|
|
208
|
-
for (let n5 = 0; n5 < e3; n5++) t4.push(
|
|
209
|
+
for (let n5 = 0; n5 < e3; n5++) t4.push(I());
|
|
209
210
|
o2.push(h(m("table_row"), t4, b()));
|
|
210
211
|
}
|
|
211
212
|
return h(m("table"), o2, n3);
|
|
212
|
-
})(e2, n2), p2 = h(m("paragraph")), f2 = c2 + 1, g2 = i2.transaction("command").insertNode([], f2, d2).insertNode([], f2 + 1, p2), w2 = u(d2)[0],
|
|
213
|
-
return
|
|
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;
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function W(t2, e2) {
|
|
216
217
|
const n2 = t2.getState();
|
|
217
218
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
218
|
-
const l2 =
|
|
219
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
219
220
|
if (!l2) return false;
|
|
220
|
-
const i2 =
|
|
221
|
+
const i2 = Z(n2, l2.tableId, l2.rowIndex + 1);
|
|
221
222
|
return !!i2 && (t2.dispatch(i2), t2.announce(e2?.announceRowInsertedBelow ?? "Row inserted below"), true);
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function X(t2, e2, n2) {
|
|
224
225
|
const l2 = t2.getState();
|
|
225
226
|
if (o(l2.selection) || r(l2.selection)) return false;
|
|
226
|
-
const i2 =
|
|
227
|
+
const i2 = R(l2, l2.selection.anchor.blockId);
|
|
227
228
|
if (!i2) return false;
|
|
228
|
-
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);
|
|
229
230
|
return !!s2 && (t2.dispatch(s2), t2.announce(n2?.announceColumnInserted(e2) ?? `Column inserted ${e2}`), true);
|
|
230
231
|
}
|
|
231
|
-
function
|
|
232
|
-
t2.registerCommand("insertTable", () =>
|
|
232
|
+
function G(t2, e2) {
|
|
233
|
+
t2.registerCommand("insertTable", () => U(t2, 3, 3)), t2.registerCommand("addRowAbove", () => (function(t3, e3) {
|
|
233
234
|
const n2 = t3.getState();
|
|
234
235
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
235
|
-
const l2 =
|
|
236
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
236
237
|
if (!l2) return false;
|
|
237
|
-
const i2 =
|
|
238
|
+
const i2 = Z(n2, l2.tableId, l2.rowIndex);
|
|
238
239
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowInsertedAbove ?? "Row inserted above"), true);
|
|
239
|
-
})(t2, e2)), t2.registerCommand("addRowBelow", () =>
|
|
240
|
-
return
|
|
240
|
+
})(t2, e2)), t2.registerCommand("addRowBelow", () => W(t2, e2)), t2.registerCommand("addColumnLeft", () => (function(t3, e3) {
|
|
241
|
+
return X(t3, "left", e3);
|
|
241
242
|
})(t2, e2)), t2.registerCommand("addColumnRight", () => (function(t3, e3) {
|
|
242
|
-
return
|
|
243
|
+
return X(t3, "right", e3);
|
|
243
244
|
})(t2, e2)), t2.registerCommand("deleteRow", () => (function(t3, e3) {
|
|
244
245
|
const n2 = t3.getState();
|
|
245
246
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
246
|
-
const l2 =
|
|
247
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
247
248
|
if (!l2) return false;
|
|
248
|
-
const i2 =
|
|
249
|
+
const i2 = O(n2, l2.tableId, l2.rowIndex, l2.colIndex);
|
|
249
250
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceRowDeleted ?? "Row deleted"), true);
|
|
250
251
|
})(t2, e2)), t2.registerCommand("deleteColumn", () => (function(t3, e3) {
|
|
251
252
|
const n2 = t3.getState();
|
|
252
253
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
253
|
-
const l2 =
|
|
254
|
+
const l2 = R(n2, n2.selection.anchor.blockId);
|
|
254
255
|
if (!l2) return false;
|
|
255
|
-
const i2 =
|
|
256
|
+
const i2 = K(n2, l2.tableId, l2.colIndex, l2.rowIndex);
|
|
256
257
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceColumnDeleted ?? "Column deleted"), true);
|
|
257
258
|
})(t2, e2)), t2.registerCommand("selectTable", () => (function(t3) {
|
|
258
259
|
const e3 = t3.getState(), n2 = e3.selection;
|
|
@@ -261,7 +262,7 @@ function U(t2, e2) {
|
|
|
261
262
|
return "table" === t4?.type;
|
|
262
263
|
}
|
|
263
264
|
if (r(n2)) return false;
|
|
264
|
-
const l2 =
|
|
265
|
+
const l2 = R(e3, n2.anchor.blockId);
|
|
265
266
|
if (!l2) return false;
|
|
266
267
|
const a2 = e3.getNodePath(l2.tableId);
|
|
267
268
|
if (!a2) return false;
|
|
@@ -274,15 +275,15 @@ function U(t2, e2) {
|
|
|
274
275
|
return "table" !== e5?.type ? null : { tableId: e5.id };
|
|
275
276
|
}
|
|
276
277
|
if (r(t4.selection)) return null;
|
|
277
|
-
const e4 =
|
|
278
|
+
const e4 = R(t4, t4.selection.anchor.blockId);
|
|
278
279
|
return e4 ? { tableId: e4.tableId } : null;
|
|
279
280
|
})(n2);
|
|
280
281
|
if (!l2) return false;
|
|
281
|
-
const i2 =
|
|
282
|
+
const i2 = Y(n2, l2.tableId);
|
|
282
283
|
return !!i2 && (t3.dispatch(i2), t3.announce(e3?.announceTableDeleted ?? "Table deleted"), true);
|
|
283
284
|
})(t2, e2));
|
|
284
285
|
}
|
|
285
|
-
function
|
|
286
|
+
function J(t2, e2, n2, o2, r2, l2 = B, i2) {
|
|
286
287
|
let a2 = true, s2 = null, c2 = null;
|
|
287
288
|
const d2 = document.createElement("div");
|
|
288
289
|
d2.className = "notectl-table-context-menu", d2.setAttribute("role", "menu"), d2.setAttribute("aria-label", l2.tableActions), d2.setAttribute("contenteditable", "false");
|
|
@@ -301,28 +302,28 @@ function W(t2, e2, n2, o2, r2, l2 = k, i2) {
|
|
|
301
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) => {
|
|
302
303
|
t4.preventDefault(), t4.stopPropagation();
|
|
303
304
|
}), n3.addEventListener("click", (o3) => {
|
|
304
|
-
o3.stopPropagation(), "item" === t3.type ? (e2.executeCommand(t3.command),
|
|
305
|
+
o3.stopPropagation(), "item" === t3.type ? (e2.executeCommand(t3.command), R2()) : "submenu" === t3.type && f2(n3);
|
|
305
306
|
}), u2.push(n3), d2.appendChild(n3);
|
|
306
307
|
}
|
|
307
308
|
const p2 = document.createElement("div");
|
|
308
309
|
function f2(o3) {
|
|
309
310
|
if (m2(), o3.setAttribute("aria-expanded", "true"), i2) {
|
|
310
|
-
const t3 = { close: () =>
|
|
311
|
+
const t3 = { close: () => R2(), getElement: () => d2 };
|
|
311
312
|
c2 = i2.open({ anchor: o3, position: "right", referenceNode: d2, parent: t3, onClose: () => {
|
|
312
313
|
c2 = null, s2 = null, v2();
|
|
313
314
|
}, content: (t4, r3) => {
|
|
314
315
|
t4.className = "notectl-table-context-menu", t4.setAttribute("contenteditable", "false"), s2 = t4, t4.addEventListener("keydown", (t5) => {
|
|
315
316
|
t5.stopPropagation(), "ArrowLeft" === t5.key && (t5.preventDefault(), r3(), o3.focus());
|
|
316
|
-
}),
|
|
317
|
+
}), V(t4, e2, n2, () => R2(), l2);
|
|
317
318
|
} });
|
|
318
319
|
} else {
|
|
319
|
-
s2 = document.createElement("div"), s2.className = "notectl-table-context-menu", s2
|
|
320
|
+
s2 = document.createElement("div"), s2.className = "notectl-table-context-menu", g(s2, "position", "fixed"), s2.setAttribute("contenteditable", "false"), s2.addEventListener("keydown", (t3) => {
|
|
320
321
|
t3.stopPropagation(), "ArrowLeft" === t3.key && (t3.preventDefault(), m2(), o3.focus());
|
|
321
|
-
}),
|
|
322
|
+
}), V(s2, e2, n2, () => R2(), l2), t2.appendChild(s2);
|
|
322
323
|
const r3 = o3.getBoundingClientRect(), i3 = d2.getBoundingClientRect();
|
|
323
324
|
let a3 = i3.right + 2, c3 = r3.top;
|
|
324
325
|
const u3 = window.innerWidth, b3 = window.innerHeight;
|
|
325
|
-
a3 + 200 > u3 && (a3 = i3.left - 200 - 2), c3 + 200 > b3 && (c3 = b3 - 200), s2
|
|
326
|
+
a3 + 200 > u3 && (a3 = i3.left - 200 - 2), c3 + 200 > b3 && (c3 = b3 - 200), w(s2, { left: `${a3}px`, top: `${c3}px` }), requestAnimationFrame(() => {
|
|
326
327
|
const t3 = s2?.querySelector("button");
|
|
327
328
|
t3?.focus();
|
|
328
329
|
});
|
|
@@ -334,14 +335,14 @@ function W(t2, e2, n2, o2, r2, l2 = k, i2) {
|
|
|
334
335
|
function v2() {
|
|
335
336
|
for (const t3 of u2) t3.dataset.submenu && t3.setAttribute("aria-expanded", "false");
|
|
336
337
|
}
|
|
337
|
-
p2.className = "notectl-table-context-menu__hint", p2.setAttribute("aria-hidden", "true"), p2.textContent = l2.menuKeyboardHint, d2.appendChild(p2),
|
|
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) => {
|
|
338
339
|
switch (t3.stopPropagation(), t3.key) {
|
|
339
340
|
case "Escape":
|
|
340
|
-
return t3.preventDefault(), void
|
|
341
|
+
return t3.preventDefault(), void R2();
|
|
341
342
|
case "ArrowDown":
|
|
342
|
-
return t3.preventDefault(), b2 = (b2 + 1) % u2.length,
|
|
343
|
+
return t3.preventDefault(), b2 = (b2 + 1) % u2.length, C(u2, b2), void u2[b2]?.focus();
|
|
343
344
|
case "ArrowUp":
|
|
344
|
-
return t3.preventDefault(), b2 = (b2 - 1 + u2.length) % u2.length,
|
|
345
|
+
return t3.preventDefault(), b2 = (b2 - 1 + u2.length) % u2.length, C(u2, b2), void u2[b2]?.focus();
|
|
345
346
|
case "ArrowRight": {
|
|
346
347
|
t3.preventDefault();
|
|
347
348
|
const e3 = u2[b2];
|
|
@@ -354,35 +355,35 @@ function W(t2, e2, n2, o2, r2, l2 = k, i2) {
|
|
|
354
355
|
t3.preventDefault();
|
|
355
356
|
const n3 = u2[b2];
|
|
356
357
|
if (!n3) return;
|
|
357
|
-
return void (n3.dataset.submenu ? f2(n3) : n3.dataset.command && (e2.executeCommand(n3.dataset.command),
|
|
358
|
+
return void (n3.dataset.submenu ? f2(n3) : n3.dataset.command && (e2.executeCommand(n3.dataset.command), R2()));
|
|
358
359
|
}
|
|
359
360
|
case "Home":
|
|
360
|
-
return t3.preventDefault(), b2 = 0,
|
|
361
|
+
return t3.preventDefault(), b2 = 0, C(u2, b2), void u2[b2]?.focus();
|
|
361
362
|
case "End":
|
|
362
|
-
return t3.preventDefault(), b2 = u2.length - 1,
|
|
363
|
+
return t3.preventDefault(), b2 = u2.length - 1, C(u2, b2), void u2[b2]?.focus();
|
|
363
364
|
}
|
|
364
|
-
}),
|
|
365
|
+
}), x(d2, o2, { position: "below-start" }), t2.appendChild(d2), u2[0]?.focus(), requestAnimationFrame(() => {
|
|
365
366
|
a2 && u2[0] && u2[0].focus();
|
|
366
367
|
});
|
|
367
|
-
const
|
|
368
|
+
const I2 = (t3) => {
|
|
368
369
|
const e3 = t3.composedPath();
|
|
369
|
-
e3.includes(d2) || s2 && e3.includes(s2) ||
|
|
370
|
+
e3.includes(d2) || s2 && e3.includes(s2) || R2();
|
|
370
371
|
};
|
|
371
|
-
function
|
|
372
|
-
a2 && (a2 = false, m2(), d2.remove(), document.removeEventListener("mousedown",
|
|
372
|
+
function R2() {
|
|
373
|
+
a2 && (a2 = false, m2(), d2.remove(), document.removeEventListener("mousedown", I2, true), r2?.());
|
|
373
374
|
}
|
|
374
375
|
return setTimeout(() => {
|
|
375
|
-
document.addEventListener("mousedown",
|
|
376
|
-
}, 0), { isOpen: () => a2, close:
|
|
376
|
+
document.addEventListener("mousedown", I2, true);
|
|
377
|
+
}, 0), { isOpen: () => a2, close: R2, destroy: R2 };
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function Q(t2, e2) {
|
|
379
380
|
const n2 = t2.getState();
|
|
380
381
|
if (o(n2.selection) || r(n2.selection)) return false;
|
|
381
|
-
const l2 = n2.selection, i2 =
|
|
382
|
+
const l2 = n2.selection, i2 = R(n2, l2.anchor.blockId);
|
|
382
383
|
return !!i2 && e2(n2, l2, i2);
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
-
return
|
|
385
|
+
function tt(t2) {
|
|
386
|
+
return Q(t2, (e2, n2, o2) => {
|
|
386
387
|
const r2 = o2.tableIndex + 1;
|
|
387
388
|
if (r2 >= e2.doc.children.length) return false;
|
|
388
389
|
const i2 = e2.doc.children[r2];
|
|
@@ -391,69 +392,69 @@ function G(t2) {
|
|
|
391
392
|
return t2.dispatch(a2), true;
|
|
392
393
|
});
|
|
393
394
|
}
|
|
394
|
-
let
|
|
395
|
-
function
|
|
396
|
-
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);
|
|
397
398
|
if (!i2) return false;
|
|
398
|
-
const a2 =
|
|
399
|
+
const a2 = k(r2, i2), s2 = r2.transaction("command").setSelection(l(a2, 0)).build();
|
|
399
400
|
return t2.dispatch(s2), true;
|
|
400
401
|
}
|
|
401
|
-
function
|
|
402
|
-
const r2 = t2.getState(), i2 =
|
|
402
|
+
function ot(t2, e2, n2, o2) {
|
|
403
|
+
const r2 = t2.getState(), i2 = y(r2, e2, n2, o2);
|
|
403
404
|
if (!i2) return false;
|
|
404
|
-
const a2 =
|
|
405
|
+
const a2 = S(r2, i2), s2 = r2.getBlock(a2);
|
|
405
406
|
if (!s2) return false;
|
|
406
407
|
const c2 = f(s2), d2 = r2.transaction("command").setSelection(l(a2, c2)).build();
|
|
407
408
|
return t2.dispatch(d2), true;
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function rt(t2, e2) {
|
|
410
411
|
const n2 = t2.getState(), o2 = n2.getNodePath(e2);
|
|
411
412
|
if (!o2) return false;
|
|
412
413
|
const r2 = n2.transaction("input").setSelection(i(e2, o2)).build();
|
|
413
414
|
return t2.dispatch(r2), true;
|
|
414
415
|
}
|
|
415
|
-
const
|
|
416
|
-
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) {
|
|
417
418
|
const o2 = document.createElement("button");
|
|
418
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) => {
|
|
419
420
|
t3.preventDefault(), t3.stopPropagation();
|
|
420
421
|
}), o2;
|
|
421
422
|
}
|
|
422
|
-
function
|
|
423
|
+
function at(t2, e2) {
|
|
423
424
|
const n2 = document.createElement("div");
|
|
424
425
|
n2.className = `ntbl-insert-line ntbl-insert-line--${t2}`, n2.setAttribute("contenteditable", "false"), n2.setAttribute("data-notectl-no-print", "");
|
|
425
|
-
const o2 =
|
|
426
|
+
const o2 = it("ntbl-insert-btn", lt, e2 ?? ("horizontal" === t2 ? "Insert row" : "Insert column"));
|
|
426
427
|
return n2.appendChild(o2), n2;
|
|
427
428
|
}
|
|
428
|
-
function
|
|
429
|
+
function st(t2, e2) {
|
|
429
430
|
const n2 = document.createElement("button");
|
|
430
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;
|
|
431
432
|
const o2 = document.createElement("span");
|
|
432
|
-
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) => {
|
|
433
434
|
t3.preventDefault(), t3.stopPropagation();
|
|
434
435
|
}), n2;
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function ct(t2) {
|
|
437
438
|
const e2 = document.createElement("div");
|
|
438
439
|
return e2.className = t2, e2.setAttribute("contenteditable", "false"), e2.setAttribute("data-notectl-no-print", ""), e2;
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
-
"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)" });
|
|
442
443
|
}
|
|
443
|
-
function
|
|
444
|
+
function ut(t2, e2, n2, o2) {
|
|
444
445
|
const r2 = document.createElement("div");
|
|
445
446
|
r2.className = `ntbl-handle ${t2}`, r2.dataset.index = String(e2);
|
|
446
|
-
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);
|
|
447
448
|
return l2.addEventListener("click", (t3) => {
|
|
448
449
|
t3.preventDefault(), t3.stopPropagation(), o2(e2);
|
|
449
450
|
}), r2.appendChild(l2), r2;
|
|
450
451
|
}
|
|
451
|
-
function
|
|
452
|
+
function bt(t2, e2) {
|
|
452
453
|
let n2 = 0, o2 = 0, r2 = t2;
|
|
453
454
|
for (; r2 && r2 !== e2; ) n2 += r2.offsetTop, o2 += r2.offsetLeft, r2 = r2.offsetParent;
|
|
454
455
|
return { top: n2, left: o2 };
|
|
455
456
|
}
|
|
456
|
-
class
|
|
457
|
+
class ht {
|
|
457
458
|
tableId;
|
|
458
459
|
numRows;
|
|
459
460
|
numCols;
|
|
@@ -511,16 +512,16 @@ class dt {
|
|
|
511
512
|
onMouseLeave = () => {
|
|
512
513
|
this.hideInsertLines();
|
|
513
514
|
};
|
|
514
|
-
constructor(t2, e2, n2, o2, r2, l2, i2 =
|
|
515
|
-
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 =
|
|
516
|
-
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);
|
|
517
518
|
this.borderColorBtn = (function(t4) {
|
|
518
|
-
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");
|
|
519
520
|
e3.setAttribute("data-notectl-no-print", "");
|
|
520
521
|
const n3 = document.createElement("span");
|
|
521
|
-
return n3.className = "ntbl-border-color-swatch",
|
|
522
|
+
return n3.className = "ntbl-border-color-swatch", dt(n3, t4), e3.appendChild(n3), e3;
|
|
522
523
|
})(t3), this.actionsBtn = (function(t4) {
|
|
523
|
-
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)");
|
|
524
525
|
return e3.setAttribute("data-notectl-no-print", ""), e3;
|
|
525
526
|
})(i2.tableActionsHint);
|
|
526
527
|
} else this.borderColorBtn = null, this.actionsBtn = null;
|
|
@@ -538,7 +539,7 @@ class dt {
|
|
|
538
539
|
const e3 = this.borderColorBtn.querySelector(".ntbl-border-color-swatch");
|
|
539
540
|
if (e3) {
|
|
540
541
|
const n3 = t2.attrs?.borderColor;
|
|
541
|
-
|
|
542
|
+
dt(e3, n3);
|
|
542
543
|
}
|
|
543
544
|
}
|
|
544
545
|
requestAnimationFrame(() => this.positionControls());
|
|
@@ -549,15 +550,15 @@ class dt {
|
|
|
549
550
|
bindEventListeners() {
|
|
550
551
|
const t2 = this.insertLineH.querySelector(".ntbl-insert-btn"), e2 = this.insertLineV.querySelector(".ntbl-insert-btn");
|
|
551
552
|
if (t2.addEventListener("click", () => {
|
|
552
|
-
this.activeRowIndex >= 0 && this.dispatchTransaction(
|
|
553
|
+
this.activeRowIndex >= 0 && this.dispatchTransaction(Z(this.getState(), this.tableId, this.activeRowIndex));
|
|
553
554
|
}), e2.addEventListener("click", () => {
|
|
554
|
-
this.activeColIndex >= 0 && this.dispatchTransaction(
|
|
555
|
+
this.activeColIndex >= 0 && this.dispatchTransaction(q(this.getState(), this.tableId, this.activeColIndex));
|
|
555
556
|
}), this.addRowZone.addEventListener("click", () => {
|
|
556
|
-
this.dispatchTransaction(
|
|
557
|
+
this.dispatchTransaction(Z(this.getState(), this.tableId, this.numRows));
|
|
557
558
|
}), this.addColZone.addEventListener("click", () => {
|
|
558
|
-
this.dispatchTransaction(
|
|
559
|
+
this.dispatchTransaction(q(this.getState(), this.tableId, this.numCols));
|
|
559
560
|
}), this.deleteTableBtn.addEventListener("click", () => {
|
|
560
|
-
this.dispatchTransaction(
|
|
561
|
+
this.dispatchTransaction(Y(this.getState(), this.tableId));
|
|
561
562
|
}), this.borderColorBtn && this.pluginContext) {
|
|
562
563
|
const t3 = this.pluginContext;
|
|
563
564
|
this.borderColorBtn.addEventListener("click", () => {
|
|
@@ -576,12 +577,12 @@ class dt {
|
|
|
576
577
|
if (this.activeContextMenu?.isOpen()) return this.activeContextMenu.close(), void (this.activeContextMenu = null);
|
|
577
578
|
if (!this.actionsBtn) return;
|
|
578
579
|
const e2 = this.actionsBtn.getBoundingClientRect(), n2 = new DOMRect(e2.left, e2.bottom + 4, 0, 0);
|
|
579
|
-
this.activeContextMenu =
|
|
580
|
+
this.activeContextMenu = J(this.container, t2, this.tableId, n2, () => {
|
|
580
581
|
this.activeContextMenu = null;
|
|
581
582
|
}, this.locale);
|
|
582
583
|
}
|
|
583
584
|
toggleBorderColorPopup(t2) {
|
|
584
|
-
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, () => {
|
|
585
586
|
this.closeBorderColorPopup();
|
|
586
587
|
}, this.locale), this.container.appendChild(this.borderColorPopup));
|
|
587
588
|
}
|
|
@@ -602,9 +603,9 @@ class dt {
|
|
|
602
603
|
const r2 = e2 / n2;
|
|
603
604
|
for (let t3 = 0; t3 < o2.length; t3++) {
|
|
604
605
|
const e3 = o2[t3];
|
|
605
|
-
e3
|
|
606
|
+
w(e3, { left: `${Math.round(r2 * t3)}px`, width: `${Math.round(r2)}px` });
|
|
606
607
|
}
|
|
607
|
-
t2
|
|
608
|
+
g(t2, "width", `${e2}px`);
|
|
608
609
|
})(this.colBar, this.tableEl.offsetWidth, this.numCols), (function(t2, e2) {
|
|
609
610
|
const n2 = t2.children;
|
|
610
611
|
if (0 === n2.length) return;
|
|
@@ -614,24 +615,24 @@ class dt {
|
|
|
614
615
|
const e3 = n2[t3], i2 = o2[t3];
|
|
615
616
|
if (i2) {
|
|
616
617
|
const t4 = i2.offsetTop - r2, n3 = i2.offsetHeight;
|
|
617
|
-
e3
|
|
618
|
+
w(e3, { top: `${t4}px`, height: `${n3}px` }), l2 = t4 + n3;
|
|
618
619
|
}
|
|
619
620
|
}
|
|
620
|
-
t2
|
|
621
|
+
g(t2, "height", `${l2}px`);
|
|
621
622
|
})(this.rowBar, this.tableEl), (function(t2, e2, n2, o2) {
|
|
622
|
-
const r2 =
|
|
623
|
-
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` });
|
|
624
625
|
})(this.addRowZone, this.addColZone, this.tableEl, this.container);
|
|
625
626
|
}
|
|
626
627
|
showHorizontalLine(t2) {
|
|
627
628
|
this.activeRowIndex = t2.index;
|
|
628
|
-
const e2 =
|
|
629
|
-
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");
|
|
630
631
|
}
|
|
631
632
|
showVerticalLine(t2) {
|
|
632
633
|
this.activeColIndex = t2.index;
|
|
633
|
-
const e2 =
|
|
634
|
-
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");
|
|
635
636
|
}
|
|
636
637
|
hideInsertLines() {
|
|
637
638
|
this.hideHorizontalLine(), this.hideVerticalLine();
|
|
@@ -645,8 +646,8 @@ class dt {
|
|
|
645
646
|
rebuildColHandles() {
|
|
646
647
|
this.colBar.innerHTML = "";
|
|
647
648
|
for (let t2 = 0; t2 < this.numCols; t2++) {
|
|
648
|
-
const e2 =
|
|
649
|
-
this.dispatchTransaction(
|
|
649
|
+
const e2 = ut("ntbl-col-handle", t2, "Delete column", (t3) => {
|
|
650
|
+
this.dispatchTransaction(K(this.getState(), this.tableId, t3));
|
|
650
651
|
});
|
|
651
652
|
this.colBar.appendChild(e2);
|
|
652
653
|
}
|
|
@@ -654,19 +655,19 @@ class dt {
|
|
|
654
655
|
rebuildRowHandles() {
|
|
655
656
|
this.rowBar.innerHTML = "";
|
|
656
657
|
for (let t2 = 0; t2 < this.numRows; t2++) {
|
|
657
|
-
const e2 =
|
|
658
|
-
this.dispatchTransaction(
|
|
658
|
+
const e2 = ut("ntbl-row-handle", t2, "Delete row", (t3) => {
|
|
659
|
+
this.dispatchTransaction(O(this.getState(), this.tableId, t3));
|
|
659
660
|
});
|
|
660
661
|
this.rowBar.appendChild(e2);
|
|
661
662
|
}
|
|
662
663
|
}
|
|
663
664
|
}
|
|
664
|
-
function
|
|
665
|
-
"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"));
|
|
666
667
|
}
|
|
667
|
-
const
|
|
668
|
-
const
|
|
669
|
-
class
|
|
668
|
+
const ft = new t("tableSelection");
|
|
669
|
+
const mt = { maxPickerRows: 8, maxPickerCols: 8 }, gt = "border-collapse: collapse; width: 100%; table-layout: fixed", wt = "border: 1px solid var(--ntbl-bc, #d0d0d0); padding: 8px 12px; vertical-align: top";
|
|
670
|
+
class vt {
|
|
670
671
|
id = "table";
|
|
671
672
|
name = "Table";
|
|
672
673
|
priority = 40;
|
|
@@ -676,74 +677,74 @@ class ft {
|
|
|
676
677
|
cleanupMouseSelection = null;
|
|
677
678
|
context = null;
|
|
678
679
|
constructor(t2) {
|
|
679
|
-
this.config = { ...
|
|
680
|
+
this.config = { ...mt, ...t2 };
|
|
680
681
|
}
|
|
681
682
|
init(t2) {
|
|
682
|
-
this.locale = e(M, 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), U(t2, this.locale), t2.registerCommand("resetTableBorderColor", () => N(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) {
|
|
683
684
|
const n2 = { Tab: () => (function(t4, e3) {
|
|
684
|
-
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));
|
|
685
686
|
})(t3, e2), "Shift-Tab": () => (function(t4) {
|
|
686
|
-
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));
|
|
687
688
|
})(t3), Enter: () => (function(t4) {
|
|
688
689
|
const e3 = t4.getState();
|
|
689
690
|
if (o(e3.selection) || r(e3.selection)) return false;
|
|
690
691
|
const n3 = e3.getBlock(e3.selection.anchor.blockId);
|
|
691
692
|
if (n3 && "paragraph" !== n3.type) return false;
|
|
692
|
-
const l2 =
|
|
693
|
-
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));
|
|
694
695
|
})(t3), Backspace: () => (function(t4) {
|
|
695
|
-
return
|
|
696
|
+
return Q(t4, (e3, n3, o2) => {
|
|
696
697
|
if (!a(n3)) return false;
|
|
697
698
|
if (0 !== n3.anchor.offset) return false;
|
|
698
699
|
if (0 !== o2.rowIndex || 0 !== o2.colIndex) return false;
|
|
699
|
-
const r2 =
|
|
700
|
-
return n3.anchor.blockId === r2 &&
|
|
700
|
+
const r2 = k(e3, o2.cellId);
|
|
701
|
+
return n3.anchor.blockId === r2 && rt(t4, o2.tableId);
|
|
701
702
|
});
|
|
702
703
|
})(t3), Delete: () => (function(t4) {
|
|
703
|
-
return
|
|
704
|
+
return Q(t4, (e3, n3, o2) => {
|
|
704
705
|
if (!a(n3)) return false;
|
|
705
706
|
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
706
707
|
if (!r2) return false;
|
|
707
708
|
const l2 = f(r2);
|
|
708
709
|
if (n3.anchor.offset !== l2) return false;
|
|
709
710
|
if (o2.rowIndex !== o2.totalRows - 1 || o2.colIndex !== o2.totalCols - 1) return false;
|
|
710
|
-
const i2 =
|
|
711
|
-
return n3.anchor.blockId === i2 &&
|
|
711
|
+
const i2 = S(e3, o2.cellId);
|
|
712
|
+
return n3.anchor.blockId === i2 && rt(t4, o2.tableId);
|
|
712
713
|
});
|
|
713
714
|
})(t3), ArrowDown: () => (function(t4) {
|
|
714
|
-
return
|
|
715
|
-
const r2 =
|
|
716
|
-
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));
|
|
717
718
|
});
|
|
718
719
|
})(t3), ArrowUp: () => (function(t4) {
|
|
719
|
-
return
|
|
720
|
-
const r2 =
|
|
721
|
-
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);
|
|
722
723
|
});
|
|
723
724
|
})(t3), ArrowRight: () => (function(t4) {
|
|
724
|
-
return
|
|
725
|
+
return Q(t4, (e3, n3, o2) => {
|
|
725
726
|
if (!a(n3)) return false;
|
|
726
727
|
const r2 = e3.getBlock(n3.anchor.blockId);
|
|
727
728
|
if (!r2) return false;
|
|
728
729
|
const l2 = f(r2);
|
|
729
730
|
if (n3.anchor.offset !== l2) return false;
|
|
730
|
-
const i2 =
|
|
731
|
-
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));
|
|
732
733
|
});
|
|
733
734
|
})(t3), ArrowLeft: () => (function(t4) {
|
|
734
|
-
return
|
|
735
|
+
return Q(t4, (e3, n3, o2) => {
|
|
735
736
|
if (!a(n3)) return false;
|
|
736
737
|
if (0 !== n3.anchor.offset) return false;
|
|
737
|
-
const r2 =
|
|
738
|
-
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));
|
|
739
740
|
});
|
|
740
|
-
})(t3), Escape: () =>
|
|
741
|
-
return
|
|
741
|
+
})(t3), Escape: () => tt(t3), "Shift-F10": () => (function(t4) {
|
|
742
|
+
return Q(t4, (e3, n3, o2) => {
|
|
742
743
|
const r2 = t4.getContainer(), l2 = r2.querySelector(`[data-block-id="${o2.cellId}"]`);
|
|
743
744
|
if (!l2) return false;
|
|
744
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;
|
|
745
|
-
return
|
|
746
|
-
|
|
746
|
+
return et?.close(), et = J(s2, t4, o2.tableId, a2, () => {
|
|
747
|
+
et = null;
|
|
747
748
|
}), true;
|
|
748
749
|
});
|
|
749
750
|
})(t3) };
|
|
@@ -755,7 +756,7 @@ class ft {
|
|
|
755
756
|
if (!e2) return n2 = [], void (o2 = /* @__PURE__ */ new Set());
|
|
756
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);
|
|
757
758
|
for (let t4 = i2; t4 <= a2; t4++) for (let n3 = s2; n3 <= c2; n3++) {
|
|
758
|
-
const o3 =
|
|
759
|
+
const o3 = y(r4, e2.tableId, t4, n3);
|
|
759
760
|
o3 && l2.push(o3);
|
|
760
761
|
}
|
|
761
762
|
n2 = l2, o2 = new Set(l2);
|
|
@@ -767,7 +768,7 @@ class ft {
|
|
|
767
768
|
}
|
|
768
769
|
})(t3, o2);
|
|
769
770
|
}, getSelectedCellIds: () => n2, isSelected: (t4) => o2.has(t4) };
|
|
770
|
-
return t3.registerService(
|
|
771
|
+
return t3.registerService(ft, r2), r2;
|
|
771
772
|
})(t2);
|
|
772
773
|
}
|
|
773
774
|
onReady() {
|
|
@@ -778,13 +779,13 @@ class ft {
|
|
|
778
779
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
779
780
|
if (l3) if (n3.shiftKey) {
|
|
780
781
|
if (o2) {
|
|
781
|
-
const r3 =
|
|
782
|
+
const r3 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
782
783
|
if (!r3 || r3.tableId !== o2.tableId) return;
|
|
783
784
|
n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: r3.rowIndex, toCol: r3.colIndex });
|
|
784
785
|
}
|
|
785
786
|
} else {
|
|
786
787
|
e2.setSelectedRange(null);
|
|
787
|
-
const n4 =
|
|
788
|
+
const n4 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
788
789
|
if (!n4) return;
|
|
789
790
|
o2 = { tableId: n4.tableId, row: n4.rowIndex, col: n4.colIndex }, r2 = true;
|
|
790
791
|
}
|
|
@@ -794,7 +795,7 @@ class ft {
|
|
|
794
795
|
if (!r2 || !o2) return;
|
|
795
796
|
const l3 = n3.target.closest("td[data-block-id]");
|
|
796
797
|
if (!l3) return;
|
|
797
|
-
const i3 =
|
|
798
|
+
const i3 = R(t2.getState(), l3.getAttribute("data-block-id"));
|
|
798
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 })));
|
|
799
800
|
}
|
|
800
801
|
function a2() {
|
|
@@ -811,31 +812,31 @@ class ft {
|
|
|
811
812
|
onStateChange(t2, e2, n2) {
|
|
812
813
|
if (this.selectionService?.getSelectedRange()) {
|
|
813
814
|
const t3 = e2.selection;
|
|
814
|
-
(o(t3) || r(t3) || !
|
|
815
|
+
(o(t3) || r(t3) || !A(e2, t3.anchor.blockId)) && this.selectionService.setSelectedRange(null);
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
818
|
registerNodeSpecs(t2) {
|
|
818
819
|
t2.registerNodeSpec({ type: "table", group: "block", content: { allow: ["table_row"], min: 1 }, isolating: true, selectable: true, toDOM(t3) {
|
|
819
820
|
const e2 = document.createElement("div");
|
|
820
821
|
return e2.className = "notectl-table-wrapper", e2.setAttribute("data-block-id", t3.id), e2;
|
|
821
|
-
}, toHTML(t3, e2) {
|
|
822
|
-
const
|
|
823
|
-
return t4 ? "none" === t4 ? `${
|
|
824
|
-
})(
|
|
825
|
-
return `<table style="${
|
|
822
|
+
}, toHTML(t3, e2, o2) {
|
|
823
|
+
const r2 = t3.attrs?.borderColor, l2 = (function(t4) {
|
|
824
|
+
return t4 ? "none" === t4 ? `${gt}; --ntbl-bc: transparent` : s(t4) ? `${gt}; --ntbl-bc: ${n(t4)}` : gt : gt;
|
|
825
|
+
})(r2);
|
|
826
|
+
return `<table${o2?.styleAttr(l2) ?? ` style="${l2}"`}>${e2}</table>`;
|
|
826
827
|
}, sanitize: { tags: ["table", "tbody"] } }), t2.registerNodeSpec({ type: "table_row", group: "table_content", content: { allow: ["table_cell"], min: 1 }, toDOM(t3) {
|
|
827
828
|
const e2 = document.createElement("tr");
|
|
828
829
|
return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "row"), e2;
|
|
829
830
|
}, toHTML: (t3, e2) => `<tr>${e2}</tr>`, sanitize: { tags: ["tr"] } }), t2.registerNodeSpec({ type: "table_cell", group: "table_content", content: { allow: ["paragraph", "list_item", "heading", "blockquote", "image", "horizontal_rule"] }, isolating: true, toDOM(t3) {
|
|
830
831
|
const e2 = document.createElement("td");
|
|
831
832
|
return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "cell"), e2;
|
|
832
|
-
}, toHTML(t3, e2) {
|
|
833
|
-
const
|
|
834
|
-
return
|
|
833
|
+
}, toHTML(t3, e2, n2) {
|
|
834
|
+
const o2 = t3.attrs?.colspan ?? 1, r2 = t3.attrs?.rowspan ?? 1, l2 = [n2?.styleAttr(wt) ?? ` style="${wt}"`];
|
|
835
|
+
return o2 > 1 && l2.push(` colspan="${o2}"`), r2 > 1 && l2.push(` rowspan="${r2}"`), `<td${l2.join("")}>${e2}</td>`;
|
|
835
836
|
}, sanitize: { tags: ["td"], attrs: ["colspan", "rowspan"] } });
|
|
836
837
|
}
|
|
837
838
|
registerNodeViews(t2) {
|
|
838
|
-
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 =
|
|
839
|
+
t2.getSchemaRegistry(), t2.registerNodeView("table", /* @__PURE__ */ (function(t3, e2, n2 = B) {
|
|
839
840
|
return (t4, o2, r2) => {
|
|
840
841
|
const l2 = document.createElement("div");
|
|
841
842
|
l2.className = "ntbl-container", l2.setAttribute("data-block-id", t4.id), l2.setAttribute("data-selectable", "true");
|
|
@@ -846,18 +847,18 @@ class ft {
|
|
|
846
847
|
const s2 = u(t4), c2 = s2.length, d2 = s2[0] ? u(s2[0]).length : 0;
|
|
847
848
|
a2.setAttribute("aria-label", n2.tableAriaLabel(c2, d2)), a2.setAttribute("aria-description", n2.tableAriaDescription);
|
|
848
849
|
const b2 = document.createElement("tbody");
|
|
849
|
-
a2.appendChild(b2), i2.appendChild(a2), l2.appendChild(i2),
|
|
850
|
+
a2.appendChild(b2), i2.appendChild(a2), l2.appendChild(i2), pt(a2, t4.attrs?.borderColor);
|
|
850
851
|
const h2 = document.createElement("div");
|
|
851
852
|
h2.className = "notectl-sr-only", h2.setAttribute("aria-live", "polite"), h2.setAttribute("aria-atomic", "true"), l2.appendChild(h2);
|
|
852
853
|
const p2 = (function(t5, e3, n3, o3, r3, l3, i3) {
|
|
853
|
-
return new
|
|
854
|
+
return new ht(t5, e3, n3, o3, r3, l3, i3);
|
|
854
855
|
})(l2, a2, t4, o2, r2, e2, n2);
|
|
855
856
|
let f2 = null, m2 = t4.id;
|
|
856
857
|
const g2 = (t5) => {
|
|
857
858
|
if (!e2) return;
|
|
858
859
|
t5.preventDefault(), t5.stopPropagation(), f2?.close();
|
|
859
860
|
const o3 = new DOMRect(t5.clientX, t5.clientY, 0, 0);
|
|
860
|
-
f2 =
|
|
861
|
+
f2 = J(l2, e2, m2, o3, () => {
|
|
861
862
|
f2 = null;
|
|
862
863
|
}, n2);
|
|
863
864
|
};
|
|
@@ -865,7 +866,7 @@ class ft {
|
|
|
865
866
|
if ("table" !== t5.type) return false;
|
|
866
867
|
m2 = t5.id, l2.setAttribute("data-block-id", t5.id), l2.setAttribute("data-selectable", "true");
|
|
867
868
|
const e3 = u(t5), o3 = e3.length, r3 = e3[0] ? u(e3[0]).length : 0;
|
|
868
|
-
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)),
|
|
869
|
+
return a2.setAttribute("aria-label", n2.tableAriaLabel(o3, r3)), pt(a2, t5.attrs?.borderColor), p2.update(t5), false;
|
|
869
870
|
}, destroy() {
|
|
870
871
|
f2?.destroy(), a2.removeEventListener("contextmenu", g2), p2.destroy();
|
|
871
872
|
}, selectNode() {
|
|
@@ -884,7 +885,7 @@ class ft {
|
|
|
884
885
|
const r2 = t3.attrs?.colspan ?? 1, l2 = t3.attrs?.rowspan ?? 1;
|
|
885
886
|
r2 > 1 && (o2.colSpan = r2), l2 > 1 && (o2.rowSpan = l2);
|
|
886
887
|
const i2 = t3.attrs?.align;
|
|
887
|
-
return i2 && "left" !== i2 && (o2
|
|
888
|
+
return i2 && "left" !== i2 && g(o2, "textAlign", i2), { dom: o2, contentDOM: o2, update(t4) {
|
|
888
889
|
if ("table_cell" !== t4.type) return false;
|
|
889
890
|
o2.setAttribute("data-block-id", t4.id);
|
|
890
891
|
const e3 = t4.attrs?.colspan ?? 1, n3 = t4.attrs?.rowspan ?? 1;
|
|
@@ -896,28 +897,28 @@ class ft {
|
|
|
896
897
|
registerToolbarItem(t2) {
|
|
897
898
|
const e2 = this.config.maxPickerRows ?? 8, n2 = this.config.maxPickerCols ?? 8;
|
|
898
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) => {
|
|
899
|
-
|
|
900
|
-
} }, 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) });
|
|
901
902
|
}
|
|
902
903
|
}
|
|
903
904
|
export {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
905
|
+
P as B,
|
|
906
|
+
vt 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
|
|
922
923
|
};
|
|
923
|
-
//# sourceMappingURL=index-
|
|
924
|
+
//# sourceMappingURL=index-DtRfqsq5.mjs.map
|