@uva-glass/component-library 3.52.11 → 3.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Lexical.prod-sd_e2sqT.js → Lexical.prod-CNQPQ6W-.js} +1428 -1410
- package/dist/Lexical.prod-CNQPQ6W-.js.map +1 -0
- package/dist/{LexicalClipboard.prod-Co2PF1UJ.js → LexicalClipboard.prod-BdghxvkJ.js} +75 -75
- package/dist/{LexicalClipboard.prod-Co2PF1UJ.js.map → LexicalClipboard.prod-BdghxvkJ.js.map} +1 -1
- package/dist/LexicalExtension.prod-qYTg6Mah.js +551 -0
- package/dist/LexicalExtension.prod-qYTg6Mah.js.map +1 -0
- package/dist/LexicalLink.prod-DjG5QZHP.js +502 -0
- package/dist/LexicalLink.prod-DjG5QZHP.js.map +1 -0
- package/dist/{LexicalList.prod-CIB0K0ja.js → LexicalList.prod-CzxWmBG3.js} +65 -65
- package/dist/LexicalList.prod-CzxWmBG3.js.map +1 -0
- package/dist/{LexicalSelection.prod-CCmcTP6S.js → LexicalSelection.prod-CqTp0hfr.js} +44 -44
- package/dist/LexicalSelection.prod-CqTp0hfr.js.map +1 -0
- package/dist/{LexicalTable.prod-Oa2YPHLl.js → LexicalTable.prod-C97KnedB.js} +331 -319
- package/dist/LexicalTable.prod-C97KnedB.js.map +1 -0
- package/dist/{LexicalUtils.prod-CjKjgnmx.js → LexicalUtils.prod-lqA_upYF.js} +39 -39
- package/dist/LexicalUtils.prod-lqA_upYF.js.map +1 -0
- package/dist/RteEditor.module-DaBh86FK.js +41 -0
- package/dist/RteEditor.module-DaBh86FK.js.map +1 -0
- package/dist/{TableCellResizerPlugin-DATbSzfg.js → TableCellResizerPlugin-BdgrIlKp.js} +57 -57
- package/dist/{TableCellResizerPlugin-DATbSzfg.js.map → TableCellResizerPlugin-BdgrIlKp.js.map} +1 -1
- package/dist/{TablePlugin-CqCjNBW_.js → TablePlugin-DBKzGTIm.js} +70 -70
- package/dist/{TablePlugin-CqCjNBW_.js.map → TablePlugin-DBKzGTIm.js.map} +1 -1
- package/dist/assets/AddCatalogueLinkForm.css +1 -0
- package/dist/assets/Flyout.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/variables.css +72 -72
- package/dist/chunk-GPBRNGY5-UqVYj0H5.js +4507 -0
- package/dist/chunk-GPBRNGY5-UqVYj0H5.js.map +1 -0
- package/dist/{client-CFLMKOFW.js → client-DkvV9jg_.js} +90 -90
- package/dist/{client-CFLMKOFW.js.map → client-DkvV9jg_.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +2 -2
- package/dist/components/AccordionCard/AccordionCard.test.js +2 -2
- package/dist/components/ActionList/ActionList.test.js +2 -2
- package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
- package/dist/components/Attention/Attention.test.js +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +1 -1
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +1 -1
- package/dist/components/Card/Card.test.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +2 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +111 -55
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +2 -2
- package/dist/components/Label/Label.test.js +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +1 -1
- package/dist/components/Notification/Notification.stories.js +1 -1
- package/dist/components/Notification/Notification.test.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.d.ts +22 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js +108 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/AddCatalogueLinkForm.js.map +1 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js +5 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.d.ts +8 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +182 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js +5 -0
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +0 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +108 -128
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +2 -3
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +52 -57
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +25 -24
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +66 -53
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +8 -9
- package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +2 -2
- package/dist/components/RteEditor/Providers/LanguageProvider.js +4 -4
- package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.d.ts +8 -3
- package/dist/components/RteEditor/RteEditor.js +375 -347
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +69 -33
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +3 -2
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +26 -23
- package/dist/components/RteEditor/helpers.js.map +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.js +6 -16
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.d.ts +39 -1
- package/dist/components/RteEditor/hooks/useTranslation.js +6 -6
- package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -1
- package/dist/components/RteEditor/mockCatalogueSearchData.d.ts +18 -0
- package/dist/components/RteEditor/mockCatalogueSearchData.js +485 -0
- package/dist/components/RteEditor/mockCatalogueSearchData.js.map +1 -0
- package/dist/components/RteEditor/mockRteContent.d.ts +1 -1
- package/dist/components/RteEditor/mockRteContent.js +8 -6
- package/dist/components/RteEditor/mockRteContent.js.map +1 -1
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.d.ts +29 -0
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +126 -0
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js.map +1 -0
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.d.ts +1 -0
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js +11 -0
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/index.js.map +1 -0
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +58 -52
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js.map +1 -1
- package/dist/components/RteEditor/nodes/index.d.ts +1 -0
- package/dist/components/RteEditor/nodes/index.js +14 -6
- package/dist/components/RteEditor/nodes/index.js.map +1 -1
- package/dist/components/RteEditor/translations.d.ts +41 -3
- package/dist/components/RteEditor/translations.js +44 -6
- package/dist/components/RteEditor/translations.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +2 -2
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +2 -2
- package/dist/components/index.js +1 -1
- package/dist/{index-DRQMriwT.js → index-BmvI9fji.js} +8665 -10000
- package/dist/index-BmvI9fji.js.map +1 -0
- package/dist/{index-BKK3EWVW.js → index-Daa6JVq6.js} +2 -2
- package/dist/{index-BKK3EWVW.js.map → index-Daa6JVq6.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/react-18-vQ75Numl.js +41 -0
- package/dist/react-18-vQ75Numl.js.map +1 -0
- package/dist/{react.esm-BjO203QT.js → react.esm-CzkD5JmE.js} +2 -2
- package/dist/{react.esm-BjO203QT.js.map → react.esm-CzkD5JmE.js.map} +1 -1
- package/dist/storybook__react.d.js +4252 -4509
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +27 -27
- package/dist/Lexical.prod-sd_e2sqT.js.map +0 -1
- package/dist/LexicalLink.prod-BCE6Bg2N.js +0 -1047
- package/dist/LexicalLink.prod-BCE6Bg2N.js.map +0 -1
- package/dist/LexicalList.prod-CIB0K0ja.js.map +0 -1
- package/dist/LexicalSelection.prod-CCmcTP6S.js.map +0 -1
- package/dist/LexicalTable.prod-Oa2YPHLl.js.map +0 -1
- package/dist/LexicalUtils.prod-CjKjgnmx.js.map +0 -1
- package/dist/RteEditor.module-CUi7Vqe8.js +0 -37
- package/dist/RteEditor.module-CUi7Vqe8.js.map +0 -1
- package/dist/chunk-HERDX7MO-DaYu-eWo.js +0 -11320
- package/dist/chunk-HERDX7MO-DaYu-eWo.js.map +0 -1
- package/dist/index-DRQMriwT.js.map +0 -1
- package/dist/react-18-C6foUf2n.js +0 -42
- package/dist/react-18-C6foUf2n.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
import { d as R,
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { l as G, u as me, $ as Rt, U as qt, C as Vt, M as jt, _ as Tt, P as Qt } from "./LexicalUtils.prod-lqA_upYF.js";
|
|
2
|
+
import { d as R, O as et, a as ve, c as W, b as M, C as tt, o as Gt, p as Ce, Q as ht, $ as U, _ as nt, J as Zt, L as Ft, A as re, E as ie, q as ke, U as ot, M as B, S as en, t as tn, R as nn, u as on, V as Be, w as Kt, r as rn, x as Je, i as Ne, y as ln, z as sn, N as an, B as cn, H as X, P as un, D as hn, F as Ot, G as dn, T as fn, W as gn, X as mn, Z as pn, a0 as _n, a1 as Cn, a2 as Sn, a3 as wn, a4 as ge, l as ne, a5 as Me, a6 as yn, h as At, a7 as bn, a8 as Nn, m as vn, a9 as xn, aa as Rn, ab as dt, ac as Tn, ad as ft, f as Fn, ae as gt, K as mt, e as Fe, af as Kn } from "./Lexical.prod-CNQPQ6W-.js";
|
|
3
|
+
import { X as On } from "./LexicalExtension.prod-qYTg6Mah.js";
|
|
4
|
+
import { F as An, _ as kn } from "./LexicalClipboard.prod-BdghxvkJ.js";
|
|
5
|
+
const rt = /^(\d+(?:\.\d+)?)px$/, L = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
|
|
5
6
|
class ue extends et {
|
|
6
7
|
__colSpan;
|
|
7
8
|
__rowSpan;
|
|
@@ -22,17 +23,17 @@ class ue extends et {
|
|
|
22
23
|
return { td: (e) => ({ conversion: pt, priority: 0 }), th: (e) => ({ conversion: pt, priority: 0 }) };
|
|
23
24
|
}
|
|
24
25
|
static importJSON(e) {
|
|
25
|
-
return
|
|
26
|
+
return q().updateFromJSON(e);
|
|
26
27
|
}
|
|
27
28
|
updateFromJSON(e) {
|
|
28
29
|
return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan || 1).setRowSpan(e.rowSpan || 1).setWidth(e.width || void 0).setBackgroundColor(e.backgroundColor || null).setVerticalAlign(e.verticalAlign || void 0);
|
|
29
30
|
}
|
|
30
|
-
constructor(e =
|
|
31
|
+
constructor(e = L.NO_STATUS, t = 1, o, r) {
|
|
31
32
|
super(r), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = o, this.__backgroundColor = null, this.__verticalAlign = void 0;
|
|
32
33
|
}
|
|
33
34
|
createDOM(e) {
|
|
34
35
|
const t = document.createElement(this.getTag());
|
|
35
|
-
return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor),
|
|
36
|
+
return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), Ue(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), G(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
|
|
36
37
|
}
|
|
37
38
|
exportDOM(e) {
|
|
38
39
|
const t = super.exportDOM(e);
|
|
@@ -43,7 +44,7 @@ class ue extends et {
|
|
|
43
44
|
return t;
|
|
44
45
|
}
|
|
45
46
|
exportJSON() {
|
|
46
|
-
return { ...super.exportJSON(), ...
|
|
47
|
+
return { ...super.exportJSON(), ...Ue(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
|
|
47
48
|
}
|
|
48
49
|
getColSpan() {
|
|
49
50
|
return this.getLatest().__colSpan;
|
|
@@ -62,7 +63,7 @@ class ue extends et {
|
|
|
62
63
|
getTag() {
|
|
63
64
|
return this.hasHeader() ? "th" : "td";
|
|
64
65
|
}
|
|
65
|
-
setHeaderStyles(e, t =
|
|
66
|
+
setHeaderStyles(e, t = L.BOTH) {
|
|
66
67
|
const o = this.getWritable();
|
|
67
68
|
return o.__headerState = e & t | o.__headerState & ~t, o;
|
|
68
69
|
}
|
|
@@ -98,7 +99,7 @@ class ue extends et {
|
|
|
98
99
|
return (this.getHeaderStyles() & e) === e;
|
|
99
100
|
}
|
|
100
101
|
hasHeader() {
|
|
101
|
-
return this.getLatest().__headerState !==
|
|
102
|
+
return this.getLatest().__headerState !== L.NO_STATUS;
|
|
102
103
|
}
|
|
103
104
|
updateDOM(e) {
|
|
104
105
|
return e.__headerState !== this.__headerState || e.__width !== this.__width || e.__colSpan !== this.__colSpan || e.__rowSpan !== this.__rowSpan || e.__backgroundColor !== this.__backgroundColor || e.__verticalAlign !== this.__verticalAlign;
|
|
@@ -116,19 +117,19 @@ class ue extends et {
|
|
|
116
117
|
return !1;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function Ue(n) {
|
|
120
121
|
return n === "middle" || n === "bottom";
|
|
121
122
|
}
|
|
122
123
|
function pt(n) {
|
|
123
124
|
const e = n, t = n.nodeName.toLowerCase();
|
|
124
125
|
let o;
|
|
125
126
|
rt.test(e.style.width) && (o = parseFloat(e.style.width));
|
|
126
|
-
const r =
|
|
127
|
+
const r = q(t === "th" ? L.ROW : L.NO_STATUS, e.colSpan, o);
|
|
127
128
|
r.__rowSpan = e.rowSpan;
|
|
128
129
|
const s = e.style.backgroundColor;
|
|
129
130
|
s !== "" && (r.__backgroundColor = s);
|
|
130
131
|
const l = e.style.verticalAlign;
|
|
131
|
-
|
|
132
|
+
Ue(l) && (r.__verticalAlign = l);
|
|
132
133
|
const i = e.style, u = (i && i.textDecoration || "").split(" "), f = i.fontWeight === "700" || i.fontWeight === "bold", h = u.includes("line-through"), p = i.fontStyle === "italic", _ = u.includes("underline");
|
|
133
134
|
return { after: (a) => {
|
|
134
135
|
const c = [];
|
|
@@ -139,17 +140,17 @@ function pt(n) {
|
|
|
139
140
|
ht(m) && g.getChildrenSize() === 1 && m.remove();
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
|
-
for (const m of a)
|
|
143
|
-
return d(), c.length === 0 && c.push(
|
|
143
|
+
for (const m of a) Gt(m) || Ce(m) || ht(m) ? (Ce(m) && (f && m.toggleFormat("bold"), h && m.toggleFormat("strikethrough"), p && m.toggleFormat("italic"), _ && m.toggleFormat("underline")), g ? g.append(m) : (g = U().append(m), c.push(g))) : (c.push(m), d(), g = null);
|
|
144
|
+
return d(), c.length === 0 && c.push(U()), c;
|
|
144
145
|
}, node: r };
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function q(n = L.NO_STATUS, e = 1, t) {
|
|
147
148
|
return tt(new ue(n, e, t));
|
|
148
149
|
}
|
|
149
150
|
function y(n) {
|
|
150
151
|
return n instanceof ue;
|
|
151
152
|
}
|
|
152
|
-
const
|
|
153
|
+
const En = rn("INSERT_TABLE_COMMAND");
|
|
153
154
|
function w(n, ...e) {
|
|
154
155
|
const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
155
156
|
o.append("code", n);
|
|
@@ -165,7 +166,7 @@ class Te extends et {
|
|
|
165
166
|
return new Te(e.__height, e.__key);
|
|
166
167
|
}
|
|
167
168
|
static importDOM() {
|
|
168
|
-
return { tr: (e) => ({ conversion:
|
|
169
|
+
return { tr: (e) => ({ conversion: $n, priority: 0 }) };
|
|
169
170
|
}
|
|
170
171
|
static importJSON(e) {
|
|
171
172
|
return Re().updateFromJSON(e);
|
|
@@ -182,7 +183,7 @@ class Te extends et {
|
|
|
182
183
|
}
|
|
183
184
|
createDOM(e) {
|
|
184
185
|
const t = document.createElement("tr");
|
|
185
|
-
return this.__height && (t.style.height = `${this.__height}px`),
|
|
186
|
+
return this.__height && (t.style.height = `${this.__height}px`), G(t, e.theme.tableRow), t;
|
|
186
187
|
}
|
|
187
188
|
extractWithChild(e, t, o) {
|
|
188
189
|
return o === "html";
|
|
@@ -207,7 +208,7 @@ class Te extends et {
|
|
|
207
208
|
return !1;
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
+
function $n(n) {
|
|
211
212
|
const e = n;
|
|
212
213
|
let t;
|
|
213
214
|
return rt.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => Rt(o, y), node: Re(t) };
|
|
@@ -219,21 +220,21 @@ function E(n) {
|
|
|
219
220
|
return n instanceof Te;
|
|
220
221
|
}
|
|
221
222
|
const lt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Mn = lt && "documentMode" in document ? document.documentMode : null, _t = lt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
222
|
-
function
|
|
223
|
+
function zn(n, e, t = !0) {
|
|
223
224
|
const o = at();
|
|
224
225
|
for (let r = 0; r < n; r++) {
|
|
225
226
|
const s = Re();
|
|
226
227
|
for (let l = 0; l < e; l++) {
|
|
227
|
-
let i =
|
|
228
|
-
typeof t == "object" ? (r === 0 && t.rows && (i |=
|
|
229
|
-
const u =
|
|
228
|
+
let i = L.NO_STATUS;
|
|
229
|
+
typeof t == "object" ? (r === 0 && t.rows && (i |= L.ROW), l === 0 && t.columns && (i |= L.COLUMN)) : t && (r === 0 && (i |= L.ROW), l === 0 && (i |= L.COLUMN));
|
|
230
|
+
const u = q(i), f = U();
|
|
230
231
|
f.append(nt()), u.append(f), s.append(u);
|
|
231
232
|
}
|
|
232
233
|
o.append(s);
|
|
233
234
|
}
|
|
234
235
|
return o;
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function so(n) {
|
|
237
238
|
const e = R(n, (t) => y(t));
|
|
238
239
|
return y(e) ? e : null;
|
|
239
240
|
}
|
|
@@ -243,35 +244,35 @@ function kt(n) {
|
|
|
243
244
|
throw new Error("Expected table cell to be inside of table row.");
|
|
244
245
|
}
|
|
245
246
|
function Et(n) {
|
|
246
|
-
const e = R(n, (t) =>
|
|
247
|
-
if (
|
|
247
|
+
const e = R(n, (t) => $(t));
|
|
248
|
+
if ($(e)) return e;
|
|
248
249
|
throw new Error("Expected table cell to be inside of table.");
|
|
249
250
|
}
|
|
250
|
-
function
|
|
251
|
+
function io(n) {
|
|
251
252
|
const e = kt(n);
|
|
252
253
|
return Et(e).getChildren().findIndex((t) => t.is(e));
|
|
253
254
|
}
|
|
254
|
-
function
|
|
255
|
+
function ao(n) {
|
|
255
256
|
return kt(n).getChildren().findIndex((e) => e.is(n));
|
|
256
257
|
}
|
|
257
258
|
lt && "InputEvent" in window && !Mn && new window.InputEvent("input");
|
|
258
|
-
const
|
|
259
|
-
function
|
|
260
|
-
const e =
|
|
261
|
-
|
|
262
|
-
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] =
|
|
263
|
-
return n ?
|
|
264
|
-
}
|
|
265
|
-
function
|
|
266
|
-
const [, , t] = I(n), [o, r] =
|
|
259
|
+
const Xe = (n, e) => n === L.BOTH || n === e ? e : L.NO_STATUS;
|
|
260
|
+
function co(n = !0) {
|
|
261
|
+
const e = W();
|
|
262
|
+
M(e) || K(e) || w(188);
|
|
263
|
+
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] = J(l, s, r), { startRow: f } = u, { startRow: h } = i;
|
|
264
|
+
return n ? Ye(f + r.__rowSpan > h + s.__rowSpan ? r : s, !0) : Ye(h < f ? s : r, !1);
|
|
265
|
+
}
|
|
266
|
+
function Ye(n, e = !0) {
|
|
267
|
+
const [, , t] = I(n), [o, r] = J(t, n, n), s = o[0].length, { startRow: l } = r;
|
|
267
268
|
let i = null;
|
|
268
269
|
if (e) {
|
|
269
270
|
const u = l + n.__rowSpan - 1, f = o[u], h = Re();
|
|
270
271
|
for (let _ = 0; _ < s; _++) {
|
|
271
272
|
const { cell: a, startRow: c } = f[_];
|
|
272
273
|
if (c + a.__rowSpan - 1 <= u) {
|
|
273
|
-
const g = f[_].cell.__headerState, d =
|
|
274
|
-
h.append(
|
|
274
|
+
const g = f[_].cell.__headerState, d = Xe(g, L.COLUMN);
|
|
275
|
+
h.append(q(d).append(U()));
|
|
275
276
|
} else a.setRowSpan(a.__rowSpan + 1);
|
|
276
277
|
}
|
|
277
278
|
const p = t.getChildAtIndex(u);
|
|
@@ -281,8 +282,8 @@ function qe(n, e = !0) {
|
|
|
281
282
|
for (let _ = 0; _ < s; _++) {
|
|
282
283
|
const { cell: a, startRow: c } = f[_];
|
|
283
284
|
if (c === u) {
|
|
284
|
-
const g = f[_].cell.__headerState, d =
|
|
285
|
-
h.append(
|
|
285
|
+
const g = f[_].cell.__headerState, d = Xe(g, L.COLUMN);
|
|
286
|
+
h.append(q(d).append(U()));
|
|
286
287
|
} else a.setRowSpan(a.__rowSpan + 1);
|
|
287
288
|
}
|
|
288
289
|
const p = t.getChildAtIndex(u);
|
|
@@ -290,18 +291,18 @@ function qe(n, e = !0) {
|
|
|
290
291
|
}
|
|
291
292
|
return i;
|
|
292
293
|
}
|
|
293
|
-
function
|
|
294
|
-
const e =
|
|
295
|
-
|
|
296
|
-
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] =
|
|
297
|
-
return n ?
|
|
294
|
+
function uo(n = !0) {
|
|
295
|
+
const e = W();
|
|
296
|
+
M(e) || K(e) || w(188);
|
|
297
|
+
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] = J(l, s, r), { startColumn: f } = u, { startColumn: h } = i;
|
|
298
|
+
return n ? qe(f + r.__colSpan > h + s.__colSpan ? r : s, !0) : qe(h < f ? s : r, !1);
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
-
const [, , o] = I(n), [r, s] =
|
|
300
|
+
function qe(n, e = !0, t = !0) {
|
|
301
|
+
const [, , o] = I(n), [r, s] = J(o, n, n), l = r.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, f = o.getFirstChild();
|
|
301
302
|
E(f) || w(120);
|
|
302
303
|
let h = null;
|
|
303
|
-
function p(c =
|
|
304
|
-
const g =
|
|
304
|
+
function p(c = L.NO_STATUS) {
|
|
305
|
+
const g = q(c).append(U());
|
|
305
306
|
return h === null && (h = g), g;
|
|
306
307
|
}
|
|
307
308
|
let _ = f;
|
|
@@ -310,9 +311,9 @@ function Xe(n, e = !0, t = !0) {
|
|
|
310
311
|
const b = _.getNextSibling();
|
|
311
312
|
E(b) || w(121), _ = b;
|
|
312
313
|
}
|
|
313
|
-
const g = r[c], d = g[u < 0 ? 0 : u].cell.__headerState, m =
|
|
314
|
+
const g = r[c], d = g[u < 0 ? 0 : u].cell.__headerState, m = Xe(d, L.ROW);
|
|
314
315
|
if (u < 0) {
|
|
315
|
-
|
|
316
|
+
$t(_, p(m));
|
|
316
317
|
continue;
|
|
317
318
|
}
|
|
318
319
|
const { cell: C, startColumn: S, startRow: N } = g[u];
|
|
@@ -331,7 +332,7 @@ function Xe(n, e = !0, t = !0) {
|
|
|
331
332
|
b.insertAfter(p(m));
|
|
332
333
|
} else C.setColSpan(C.__colSpan + 1);
|
|
333
334
|
}
|
|
334
|
-
h !== null && t &&
|
|
335
|
+
h !== null && t && Ve(h);
|
|
335
336
|
const a = o.getColWidths();
|
|
336
337
|
if (a) {
|
|
337
338
|
const c = [...a], g = u < 0 ? 0 : u, d = c[g];
|
|
@@ -339,10 +340,10 @@ function Xe(n, e = !0, t = !0) {
|
|
|
339
340
|
}
|
|
340
341
|
return h;
|
|
341
342
|
}
|
|
342
|
-
function
|
|
343
|
-
const n =
|
|
344
|
-
|
|
345
|
-
const e = n.anchor.getNode(), t = n.focus.getNode(), [o, , r] = I(e), [s] = I(t), [l, i, u] =
|
|
343
|
+
function ho() {
|
|
344
|
+
const n = W();
|
|
345
|
+
M(n) || K(n) || w(188);
|
|
346
|
+
const e = n.anchor.getNode(), t = n.focus.getNode(), [o, , r] = I(e), [s] = I(t), [l, i, u] = J(r, o, s), { startColumn: f } = i, { startRow: h, startColumn: p } = u, _ = Math.min(f, p), a = Math.max(f + o.__colSpan - 1, p + s.__colSpan - 1), c = a - _ + 1;
|
|
346
347
|
if (l[0].length === a - _ + 1) return r.selectPrevious(), void r.remove();
|
|
347
348
|
const g = l.length;
|
|
348
349
|
for (let S = 0; S < g; S++) for (let N = _; N <= a; N++) {
|
|
@@ -362,10 +363,10 @@ function uo() {
|
|
|
362
363
|
const d = l[h], m = f > p ? d[f + o.__colSpan] : d[p + s.__colSpan];
|
|
363
364
|
if (m !== void 0) {
|
|
364
365
|
const { cell: S } = m;
|
|
365
|
-
|
|
366
|
+
Ve(S);
|
|
366
367
|
} else {
|
|
367
368
|
const S = p < f ? d[p - 1] : d[f - 1], { cell: N } = S;
|
|
368
|
-
|
|
369
|
+
Ve(N);
|
|
369
370
|
}
|
|
370
371
|
const C = r.getColWidths();
|
|
371
372
|
if (C) {
|
|
@@ -373,15 +374,15 @@ function uo() {
|
|
|
373
374
|
S.splice(_, c), r.setColWidths(S);
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function Ve(n) {
|
|
377
378
|
const e = n.getFirstDescendant();
|
|
378
379
|
e == null ? n.selectStart() : e.getParentOrThrow().selectStart();
|
|
379
380
|
}
|
|
380
|
-
function
|
|
381
|
+
function $t(n, e) {
|
|
381
382
|
const t = n.getFirstChild();
|
|
382
383
|
t !== null ? t.insertBefore(e) : n.append(e);
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
+
function Wn(n) {
|
|
385
386
|
if (n.length === 0) return null;
|
|
386
387
|
const e = Et(n[0]), [t] = oe(e, null, null);
|
|
387
388
|
let o = 1 / 0, r = -1 / 0, s = 1 / 0, l = -1 / 0;
|
|
@@ -405,29 +406,29 @@ function Ln(n) {
|
|
|
405
406
|
const g = t[a][c];
|
|
406
407
|
if (!g.cell) continue;
|
|
407
408
|
const d = g.cell, m = d.getKey();
|
|
408
|
-
_.has(m) || (_.add(m),
|
|
409
|
+
_.has(m) || (_.add(m), Ln(d) || p.append(...d.getChildren()), d.remove());
|
|
409
410
|
}
|
|
410
|
-
return p.getChildrenSize() === 0 && p.append(
|
|
411
|
+
return p.getChildrenSize() === 0 && p.append(U()), p;
|
|
411
412
|
}
|
|
412
|
-
function
|
|
413
|
+
function Ln(n) {
|
|
413
414
|
if (n.getChildrenSize() !== 1) return !1;
|
|
414
415
|
const e = n.getFirstChildOrThrow();
|
|
415
416
|
return !(!ot(e) || !e.isEmpty());
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function Pn(n) {
|
|
418
419
|
const [e, t, o] = I(n), r = e.__colSpan, s = e.__rowSpan;
|
|
419
420
|
if (r === 1 && s === 1) return;
|
|
420
|
-
const [l, i] =
|
|
421
|
+
const [l, i] = J(o, e, e), { startColumn: u, startRow: f } = i, h = e.__headerState & L.COLUMN, p = Array.from({ length: r }, (c, g) => {
|
|
421
422
|
let d = h;
|
|
422
423
|
for (let m = 0; d !== 0 && m < l.length; m++) d &= l[m][g + u].cell.__headerState;
|
|
423
424
|
return d;
|
|
424
|
-
}), _ = e.__headerState &
|
|
425
|
+
}), _ = e.__headerState & L.ROW, a = Array.from({ length: s }, (c, g) => {
|
|
425
426
|
let d = _;
|
|
426
427
|
for (let m = 0; d !== 0 && m < l[0].length; m++) d &= l[g + f][m].cell.__headerState;
|
|
427
428
|
return d;
|
|
428
429
|
});
|
|
429
430
|
if (r > 1) {
|
|
430
|
-
for (let c = 1; c < r; c++) e.insertAfter(
|
|
431
|
+
for (let c = 1; c < r; c++) e.insertAfter(q(p[c] | a[0]).append(U()));
|
|
431
432
|
e.setColSpan(1);
|
|
432
433
|
}
|
|
433
434
|
if (s > 1) {
|
|
@@ -440,13 +441,13 @@ function Wn(n) {
|
|
|
440
441
|
const N = m[S], b = N.cell;
|
|
441
442
|
N.startRow === d && (C = b), b.__colSpan > 1 && (S += b.__colSpan - 1);
|
|
442
443
|
}
|
|
443
|
-
if (C === null) for (let S = r - 1; S >= 0; S--)
|
|
444
|
-
else for (let S = r - 1; S >= 0; S--) C.insertAfter(
|
|
444
|
+
if (C === null) for (let S = r - 1; S >= 0; S--) $t(c, q(p[S] | a[g]).append(U()));
|
|
445
|
+
else for (let S = r - 1; S >= 0; S--) C.insertAfter(q(p[S] | a[g]).append(U()));
|
|
445
446
|
}
|
|
446
447
|
e.setRowSpan(1);
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
|
-
function
|
|
450
|
+
function J(n, e, t) {
|
|
450
451
|
const [o, r, s] = oe(n, e, t);
|
|
451
452
|
return r === null && w(207), s === null && w(208), [o, r, s];
|
|
452
453
|
}
|
|
@@ -487,7 +488,7 @@ function I(n) {
|
|
|
487
488
|
const t = e.getParent();
|
|
488
489
|
E(t) || w(149);
|
|
489
490
|
const o = t.getParent();
|
|
490
|
-
return
|
|
491
|
+
return $(o) || w(210), [e, t, o];
|
|
491
492
|
}
|
|
492
493
|
function Ee(n, e, t) {
|
|
493
494
|
let o, r = Math.min(e.startColumn, t.startColumn), s = Math.min(e.startRow, t.startRow), l = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), i = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1);
|
|
@@ -528,11 +529,11 @@ function St(n) {
|
|
|
528
529
|
const _ = p.getParent();
|
|
529
530
|
E(_) || w(239, f);
|
|
530
531
|
const a = _.getParent();
|
|
531
|
-
return
|
|
532
|
+
return $(a) || w(240, f), [h, p, _, a];
|
|
532
533
|
});
|
|
533
534
|
return r.is(u) || w(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: u };
|
|
534
535
|
}
|
|
535
|
-
class
|
|
536
|
+
class ze {
|
|
536
537
|
tableKey;
|
|
537
538
|
anchor;
|
|
538
539
|
focus;
|
|
@@ -565,7 +566,7 @@ class Le {
|
|
|
565
566
|
this.dirty = this.dirty || e !== this.tableKey || t !== this.anchor.key || o !== this.focus.key, this.tableKey = e, this.anchor.key = t, this.focus.key = o, this._cachedNodes = null;
|
|
566
567
|
}
|
|
567
568
|
clone() {
|
|
568
|
-
return new
|
|
569
|
+
return new ze(this.tableKey, ke(this.anchor.key, this.anchor.offset, this.anchor.type), ke(this.focus.key, this.focus.offset, this.focus.type));
|
|
569
570
|
}
|
|
570
571
|
isCollapsed() {
|
|
571
572
|
return !1;
|
|
@@ -588,7 +589,7 @@ class Le {
|
|
|
588
589
|
}
|
|
589
590
|
insertNodes(e) {
|
|
590
591
|
const t = this.focus.getNode();
|
|
591
|
-
|
|
592
|
+
B(t) || w(151), en(t.select(0, t.getChildrenSize())).insertNodes(e);
|
|
592
593
|
}
|
|
593
594
|
getShape() {
|
|
594
595
|
const { anchorCell: e, focusCell: t } = St(this), o = Ct(e);
|
|
@@ -613,11 +614,11 @@ class Le {
|
|
|
613
614
|
}
|
|
614
615
|
return this.getNodes();
|
|
615
616
|
}
|
|
616
|
-
const [l, i, u] =
|
|
617
|
+
const [l, i, u] = J(t, o, r), { minColumn: f, maxColumn: h, minRow: p, maxRow: _ } = Ee(l, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
|
|
617
618
|
let c = null;
|
|
618
619
|
for (let d = p; d <= _; d++) for (let m = f; m <= h; m++) {
|
|
619
620
|
const { cell: C } = l[d][m], S = C.getParent();
|
|
620
|
-
E(S) || w(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(C.getKey()) ||
|
|
621
|
+
E(S) || w(160), S !== c && (a.set(S.getKey(), S), c = S), a.has(C.getKey()) || Dn(C, (N) => {
|
|
621
622
|
a.set(N.getKey(), N);
|
|
622
623
|
});
|
|
623
624
|
}
|
|
@@ -636,31 +637,31 @@ class Le {
|
|
|
636
637
|
}
|
|
637
638
|
}
|
|
638
639
|
function K(n) {
|
|
639
|
-
return n instanceof
|
|
640
|
+
return n instanceof ze;
|
|
640
641
|
}
|
|
641
|
-
function
|
|
642
|
+
function Mt() {
|
|
642
643
|
const n = ke("root", 0, "element"), e = ke("root", 0, "element");
|
|
643
|
-
return new
|
|
644
|
+
return new ze("root", n, e);
|
|
644
645
|
}
|
|
645
646
|
function Hn(n, e, t) {
|
|
646
647
|
n.getKey(), e.getKey(), t.getKey();
|
|
647
|
-
const o =
|
|
648
|
+
const o = W(), r = K(o) ? o.clone() : Mt();
|
|
648
649
|
return r.set(n.getKey(), e.getKey(), t.getKey()), r;
|
|
649
650
|
}
|
|
650
|
-
function
|
|
651
|
+
function Dn(n, e) {
|
|
651
652
|
const t = [[n]];
|
|
652
653
|
for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
|
|
653
654
|
const r = o.pop();
|
|
654
|
-
r === void 0 ? t.pop() : e(r) !== !1 &&
|
|
655
|
+
r === void 0 ? t.pop() : e(r) !== !1 && B(r) && t.push(r.getChildren());
|
|
655
656
|
}
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
+
function zt(n, e = Ft()) {
|
|
658
659
|
const t = ie(n);
|
|
659
|
-
|
|
660
|
+
$(t) || w(231, n);
|
|
660
661
|
const o = ae(t, e.getElementByKey(n));
|
|
661
662
|
return o === null && w(232, n), { tableElement: o, tableNode: t };
|
|
662
663
|
}
|
|
663
|
-
class
|
|
664
|
+
class Bn {
|
|
664
665
|
focusX;
|
|
665
666
|
focusY;
|
|
666
667
|
listenersToRemove;
|
|
@@ -692,7 +693,7 @@ class Dn {
|
|
|
692
693
|
this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach((e) => e()), this.listenersToRemove.clear();
|
|
693
694
|
}
|
|
694
695
|
$lookup() {
|
|
695
|
-
return
|
|
696
|
+
return zt(this.tableNodeKey, this.editor);
|
|
696
697
|
}
|
|
697
698
|
trackTable() {
|
|
698
699
|
const e = new MutationObserver((t) => {
|
|
@@ -719,7 +720,7 @@ class Dn {
|
|
|
719
720
|
const e = this.editor;
|
|
720
721
|
this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.$enableHighlightStyle();
|
|
721
722
|
const { tableNode: t, tableElement: o } = this.$lookup();
|
|
722
|
-
Ke(e, pe(t, o), null),
|
|
723
|
+
Ke(e, pe(t, o), null), W() !== null && (ne(null), e.dispatchCommand(ge, void 0));
|
|
723
724
|
}
|
|
724
725
|
$enableHighlightStyle() {
|
|
725
726
|
const e = this.editor, { tableElement: t } = this.$lookup();
|
|
@@ -727,7 +728,7 @@ class Dn {
|
|
|
727
728
|
}
|
|
728
729
|
$disableHighlightStyle() {
|
|
729
730
|
const { tableElement: e } = this.$lookup();
|
|
730
|
-
|
|
731
|
+
G(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0;
|
|
731
732
|
}
|
|
732
733
|
$updateTableTableSelection(e) {
|
|
733
734
|
if (e !== null) {
|
|
@@ -751,7 +752,7 @@ class Dn {
|
|
|
751
752
|
}
|
|
752
753
|
updateDOMSelection() {
|
|
753
754
|
if (this.anchorCell !== null && this.focusCell !== null) {
|
|
754
|
-
const e =
|
|
755
|
+
const e = Me(this.editor._window);
|
|
755
756
|
e && e.rangeCount > 0 && e.removeAllRanges();
|
|
756
757
|
}
|
|
757
758
|
}
|
|
@@ -761,7 +762,7 @@ class Dn {
|
|
|
761
762
|
if (s === this.focusX && l === this.focusY) return !1;
|
|
762
763
|
} else this.isHighlightingCells = !0, this.$disableHighlightStyle();
|
|
763
764
|
if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
|
|
764
|
-
const i =
|
|
765
|
+
const i = Qe(r, e.elem);
|
|
765
766
|
if (this.tableSelection != null && this.anchorCellNodeKey != null && i !== null) return this.focusCellNodeKey = i.getKey(), this.tableSelection = Hn(r, this.$getAnchorTableCellOrThrow(), i), ne(this.tableSelection), o.dispatchCommand(ge, void 0), Ke(o, this.table, this.tableSelection), !0;
|
|
766
767
|
}
|
|
767
768
|
return !1;
|
|
@@ -782,14 +783,14 @@ class Dn {
|
|
|
782
783
|
}
|
|
783
784
|
$setAnchorCellForSelection(e) {
|
|
784
785
|
this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
|
|
785
|
-
const { tableNode: t } = this.$lookup(), o =
|
|
786
|
+
const { tableNode: t } = this.$lookup(), o = Qe(t, e.elem);
|
|
786
787
|
if (o !== null) {
|
|
787
788
|
const r = o.getKey();
|
|
788
|
-
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() :
|
|
789
|
+
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Mt(), this.anchorCellNodeKey = r;
|
|
789
790
|
}
|
|
790
791
|
}
|
|
791
792
|
$formatCells(e) {
|
|
792
|
-
const t =
|
|
793
|
+
const t = W();
|
|
793
794
|
K(t) || w(236);
|
|
794
795
|
const o = bn(), r = o.anchor, s = o.focus, l = t.getNodes().filter(y);
|
|
795
796
|
l.length > 0 || w(237);
|
|
@@ -800,8 +801,8 @@ class Dn {
|
|
|
800
801
|
}
|
|
801
802
|
$clearText() {
|
|
802
803
|
const { editor: e } = this, t = ie(this.tableNodeKey);
|
|
803
|
-
if (
|
|
804
|
-
const o =
|
|
804
|
+
if (!$(t)) throw new Error("Expected TableNode.");
|
|
805
|
+
const o = W();
|
|
805
806
|
K(o) || w(253);
|
|
806
807
|
const r = o.getNodes().filter(y), s = t.getFirstChild(), l = t.getLastChild();
|
|
807
808
|
if (r.length > 0 && s !== null && l !== null && E(s) && E(l) && r[0] === s.getFirstChild() && r[r.length - 1] === l.getLastChild()) {
|
|
@@ -810,8 +811,8 @@ class Dn {
|
|
|
810
811
|
return t.remove(), void (Nn(i) && i.isEmpty() && e.dispatchCommand(At, void 0));
|
|
811
812
|
}
|
|
812
813
|
r.forEach((i) => {
|
|
813
|
-
if (
|
|
814
|
-
const u =
|
|
814
|
+
if (B(i)) {
|
|
815
|
+
const u = U(), f = nt();
|
|
815
816
|
u.append(f), i.append(u), i.getChildren().forEach((h) => {
|
|
816
817
|
h !== u && h.remove();
|
|
817
818
|
});
|
|
@@ -819,7 +820,7 @@ class Dn {
|
|
|
819
820
|
}), Ke(e, this.table, null), ne(null), e.dispatchCommand(ge, void 0);
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
|
-
const
|
|
823
|
+
const je = "__lexicalTableSelection";
|
|
823
824
|
function fe(n) {
|
|
824
825
|
return ve(n) && n.nodeName === "TABLE";
|
|
825
826
|
}
|
|
@@ -838,22 +839,22 @@ function xe(n, e) {
|
|
|
838
839
|
}
|
|
839
840
|
return null;
|
|
840
841
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
842
|
+
const In = [[ln, "down"], [sn, "up"], [an, "backward"], [cn, "forward"]], Jn = [hn, Ot, dn], Un = [fn, gn];
|
|
843
|
+
function Xn(n, e, t, o) {
|
|
843
844
|
const r = t.getRootElement(), s = st(t);
|
|
844
845
|
r !== null && s !== null || w(246);
|
|
845
|
-
const l = new
|
|
846
|
+
const l = new Bn(t, n.getKey()), i = ae(n, e);
|
|
846
847
|
(function(a, c) {
|
|
847
|
-
wt(a) !== null && w(205), a[
|
|
848
|
+
wt(a) !== null && w(205), a[je] = c;
|
|
848
849
|
})(i, l), l.listenersToRemove.add(() => (function(a, c) {
|
|
849
|
-
wt(a) === c && delete a[
|
|
850
|
+
wt(a) === c && delete a[je];
|
|
850
851
|
})(i, l));
|
|
851
852
|
const u = (a) => {
|
|
852
853
|
if (l.pointerType = a.pointerType, a.button !== 0 || !Ne(a.target) || !s) return;
|
|
853
|
-
const c =
|
|
854
|
+
const c = $e(a.target);
|
|
854
855
|
c !== null && t.update(() => {
|
|
855
|
-
const g =
|
|
856
|
-
if (_t && a.shiftKey &&
|
|
856
|
+
const g = Je();
|
|
857
|
+
if (_t && a.shiftKey && Q(g, n) && (M(g) || K(g))) {
|
|
857
858
|
const d = g.anchor.getNode(), m = xe(n, g.anchor.getNode());
|
|
858
859
|
m ? (l.$setAnchorCellForSelection(se(l, m)), l.$setFocusCellForSelection(c), ee(a)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(g.anchor.key, g.anchor.offset, g.anchor.type);
|
|
859
860
|
} else a.pointerType !== "touch" && l.$setAnchorCellForSelection(c);
|
|
@@ -877,7 +878,7 @@ function Jn(n, e, t, o) {
|
|
|
877
878
|
i.removeEventListener("pointerdown", u);
|
|
878
879
|
});
|
|
879
880
|
const f = (a) => {
|
|
880
|
-
a.detail >= 3 && Ne(a.target) &&
|
|
881
|
+
a.detail >= 3 && Ne(a.target) && $e(a.target) !== null && a.preventDefault();
|
|
881
882
|
};
|
|
882
883
|
i.addEventListener("mousedown", f, l.listenerOptions), l.listenersToRemove.add(() => {
|
|
883
884
|
i.removeEventListener("mousedown", f);
|
|
@@ -885,98 +886,98 @@ function Jn(n, e, t, o) {
|
|
|
885
886
|
const h = (a) => {
|
|
886
887
|
const c = a.target;
|
|
887
888
|
a.button === 0 && Ne(c) && t.update(() => {
|
|
888
|
-
const g =
|
|
889
|
+
const g = W();
|
|
889
890
|
K(g) && g.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
|
|
890
891
|
});
|
|
891
892
|
};
|
|
892
893
|
s.addEventListener("pointerdown", h, l.listenerOptions), l.listenersToRemove.add(() => {
|
|
893
894
|
s.removeEventListener("pointerdown", h);
|
|
894
895
|
});
|
|
895
|
-
for (const [a, c] of
|
|
896
|
+
for (const [a, c] of In) l.listenersToRemove.add(t.registerCommand(a, (g) => Pt(t, g, c, n, l), X));
|
|
896
897
|
l.listenersToRemove.add(t.registerCommand(un, (a) => {
|
|
897
|
-
const c =
|
|
898
|
+
const c = W();
|
|
898
899
|
if (K(c)) {
|
|
899
900
|
const g = xe(n, c.focus.getNode());
|
|
900
901
|
if (g !== null) return ee(a), g.selectEnd(), !0;
|
|
901
902
|
}
|
|
902
903
|
return !1;
|
|
903
|
-
},
|
|
904
|
+
}, X));
|
|
904
905
|
const p = (a) => () => {
|
|
905
|
-
const c =
|
|
906
|
-
if (!
|
|
906
|
+
const c = W();
|
|
907
|
+
if (!Q(c, n)) return !1;
|
|
907
908
|
if (K(c)) return l.$clearText(), !0;
|
|
908
|
-
if (
|
|
909
|
+
if (M(c)) {
|
|
909
910
|
if (!y(xe(n, c.anchor.getNode()))) return !1;
|
|
910
911
|
const g = c.anchor.getNode(), d = c.focus.getNode(), m = n.isParentOf(g), C = n.isParentOf(d);
|
|
911
912
|
if (m && !C || C && !m) return l.$clearText(), !0;
|
|
912
|
-
const S = R(c.anchor.getNode(), (b) =>
|
|
913
|
-
if (!
|
|
913
|
+
const S = R(c.anchor.getNode(), (b) => B(b)), N = S && R(S, (b) => B(b) && y(b.getParent()));
|
|
914
|
+
if (!B(N) || !B(S)) return !1;
|
|
914
915
|
if (a === Ot && N.getPreviousSibling() === null) return !0;
|
|
915
916
|
}
|
|
916
917
|
return !1;
|
|
917
918
|
};
|
|
918
|
-
for (const a of
|
|
919
|
+
for (const a of Jn) l.listenersToRemove.add(t.registerCommand(a, p(a), X));
|
|
919
920
|
const _ = (a) => {
|
|
920
|
-
const c =
|
|
921
|
-
if (!K(c) &&
|
|
921
|
+
const c = W();
|
|
922
|
+
if (!K(c) && !M(c)) return !1;
|
|
922
923
|
const g = n.isParentOf(c.anchor.getNode());
|
|
923
924
|
if (g !== n.isParentOf(c.focus.getNode())) {
|
|
924
925
|
const d = g ? "anchor" : "focus", m = g ? "focus" : "anchor", { key: C, offset: S, type: N } = c[m];
|
|
925
926
|
return n[c[d].isBefore(c[m]) ? "selectPrevious" : "selectNext"]()[m].set(C, S, N), !1;
|
|
926
927
|
}
|
|
927
|
-
return !!
|
|
928
|
+
return !!Q(c, n) && !!K(c) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
|
|
928
929
|
};
|
|
929
|
-
for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, _,
|
|
930
|
+
for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, _, X));
|
|
930
931
|
return l.listenersToRemove.add(t.registerCommand(mn, (a) => {
|
|
931
|
-
const c =
|
|
932
|
+
const c = W();
|
|
932
933
|
if (c) {
|
|
933
|
-
if (!K(c) &&
|
|
934
|
-
|
|
934
|
+
if (!K(c) && !M(c)) return !1;
|
|
935
|
+
An(t, Qt(a, ClipboardEvent) ? a : null, kn(c));
|
|
935
936
|
const g = _(a);
|
|
936
|
-
return
|
|
937
|
+
return M(c) ? (c.removeText(), !0) : g;
|
|
937
938
|
}
|
|
938
939
|
return !1;
|
|
939
|
-
},
|
|
940
|
-
const c =
|
|
941
|
-
if (!
|
|
940
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(pn, (a) => {
|
|
941
|
+
const c = W();
|
|
942
|
+
if (!Q(c, n)) return !1;
|
|
942
943
|
if (K(c)) return l.$formatCells(a), !0;
|
|
943
|
-
if (
|
|
944
|
+
if (M(c)) {
|
|
944
945
|
const g = R(c.anchor.getNode(), (d) => y(d));
|
|
945
946
|
if (!y(g)) return !1;
|
|
946
947
|
}
|
|
947
948
|
return !1;
|
|
948
|
-
},
|
|
949
|
-
const c =
|
|
950
|
-
if (!K(c) || !
|
|
949
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(_n, (a) => {
|
|
950
|
+
const c = W();
|
|
951
|
+
if (!K(c) || !Q(c, n)) return !1;
|
|
951
952
|
const g = c.anchor.getNode(), d = c.focus.getNode();
|
|
952
953
|
if (!y(g) || !y(d)) return !1;
|
|
953
|
-
if ((function(A,
|
|
954
|
+
if ((function(A, z) {
|
|
954
955
|
if (K(A)) {
|
|
955
956
|
const F = A.anchor.getNode(), O = A.focus.getNode();
|
|
956
|
-
if (
|
|
957
|
-
const [H] =
|
|
957
|
+
if (z && F && O) {
|
|
958
|
+
const [H] = J(z, F, O);
|
|
958
959
|
return F.getKey() === H[0][0].cell.getKey() && O.getKey() === H[H.length - 1].at(-1).cell.getKey();
|
|
959
960
|
}
|
|
960
961
|
}
|
|
961
962
|
return !1;
|
|
962
963
|
})(c, n)) return n.setFormat(a), !0;
|
|
963
|
-
const [m, C, S] =
|
|
964
|
-
for (let A = v; A <= N; A++) for (let
|
|
965
|
-
const F = m[A][
|
|
964
|
+
const [m, C, S] = J(n, g, d), N = Math.max(C.startRow + C.cell.__rowSpan - 1, S.startRow + S.cell.__rowSpan - 1), b = Math.max(C.startColumn + C.cell.__colSpan - 1, S.startColumn + S.cell.__colSpan - 1), v = Math.min(C.startRow, S.startRow), T = Math.min(C.startColumn, S.startColumn), k = /* @__PURE__ */ new Set();
|
|
965
|
+
for (let A = v; A <= N; A++) for (let z = T; z <= b; z++) {
|
|
966
|
+
const F = m[A][z].cell;
|
|
966
967
|
if (k.has(F)) continue;
|
|
967
968
|
k.add(F), F.setFormat(a);
|
|
968
969
|
const O = F.getChildren();
|
|
969
970
|
for (let H = 0; H < O.length; H++) {
|
|
970
971
|
const D = O[H];
|
|
971
|
-
|
|
972
|
+
B(D) && !D.isInline() && D.setFormat(a);
|
|
972
973
|
}
|
|
973
974
|
}
|
|
974
975
|
return !0;
|
|
975
|
-
},
|
|
976
|
-
const c =
|
|
977
|
-
if (!
|
|
976
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(Cn, (a) => {
|
|
977
|
+
const c = W();
|
|
978
|
+
if (!Q(c, n)) return !1;
|
|
978
979
|
if (K(c)) return l.$clearHighlight(), !1;
|
|
979
|
-
if (
|
|
980
|
+
if (M(c)) {
|
|
980
981
|
const g = R(c.anchor.getNode(), (d) => y(d));
|
|
981
982
|
if (!y(g)) return !1;
|
|
982
983
|
if (typeof a == "string") {
|
|
@@ -985,102 +986,102 @@ function Jn(n, e, t, o) {
|
|
|
985
986
|
}
|
|
986
987
|
}
|
|
987
988
|
return !1;
|
|
988
|
-
},
|
|
989
|
-
const c =
|
|
990
|
-
if (
|
|
989
|
+
}, X)), o && l.listenersToRemove.add(t.registerCommand(Sn, (a) => {
|
|
990
|
+
const c = W();
|
|
991
|
+
if (!M(c) || !c.isCollapsed() || !Q(c, n)) return !1;
|
|
991
992
|
const g = be(c.anchor.getNode());
|
|
992
993
|
return !(g === null || !n.is(_e(g))) && (ee(a), (function(d, m) {
|
|
993
994
|
const C = m === "next" ? "getNextSibling" : "getPreviousSibling", S = m === "next" ? "getFirstChild" : "getLastChild", N = d[C]();
|
|
994
|
-
if (
|
|
995
|
+
if (B(N)) return N.selectEnd();
|
|
995
996
|
const b = R(d, E);
|
|
996
997
|
b === null && w(247);
|
|
997
998
|
for (let T = b[C](); E(T); T = T[C]()) {
|
|
998
999
|
const k = T[S]();
|
|
999
|
-
if (
|
|
1000
|
+
if (B(k)) return k.selectEnd();
|
|
1000
1001
|
}
|
|
1001
|
-
const v = R(b,
|
|
1002
|
+
const v = R(b, $);
|
|
1002
1003
|
v === null && w(248), m === "next" ? v.selectNext() : v.selectPrevious();
|
|
1003
1004
|
})(g, a.shiftKey ? "previous" : "next"), !0);
|
|
1004
|
-
},
|
|
1005
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(wn, (a) => n.isSelected(), X)), l.listenersToRemove.add(t.registerCommand(Kt, (a, c) => {
|
|
1005
1006
|
if (t !== c) return !1;
|
|
1006
|
-
const { nodes: g, selection: d } = a, m = d.getStartEndPoints(), C = K(d), S =
|
|
1007
|
-
if (g.length !== 1 ||
|
|
1007
|
+
const { nodes: g, selection: d } = a, m = d.getStartEndPoints(), C = K(d), S = M(d) && R(d.anchor.getNode(), (x) => y(x)) !== null && R(d.focus.getNode(), (x) => y(x)) !== null || C;
|
|
1008
|
+
if (g.length !== 1 || !$(g[0]) || !S || m === null) return !1;
|
|
1008
1009
|
const [N, b] = m, [v, T, k] = I(N), A = R(b.getNode(), (x) => y(x));
|
|
1009
|
-
if (!(y(v) && y(A) && E(T) &&
|
|
1010
|
-
const
|
|
1011
|
-
let
|
|
1010
|
+
if (!(y(v) && y(A) && E(T) && $(k))) return !1;
|
|
1011
|
+
const z = g[0], [F, O, H] = J(k, v, A), [D] = oe(z, null, null), te = F.length, Se = te > 0 ? F[0].length : 0;
|
|
1012
|
+
let V = O.startRow, P = O.startColumn, le = D.length, he = le > 0 ? D[0].length : 0;
|
|
1012
1013
|
if (C) {
|
|
1013
|
-
const x = Ee(F, O, H),
|
|
1014
|
-
|
|
1014
|
+
const x = Ee(F, O, H), Y = x.maxRow - x.minRow + 1, j = x.maxColumn - x.minColumn + 1;
|
|
1015
|
+
V = x.minRow, P = x.minColumn, le = Math.min(le, Y), he = Math.min(he, j);
|
|
1015
1016
|
}
|
|
1016
|
-
let
|
|
1017
|
-
const
|
|
1018
|
-
for (let x =
|
|
1019
|
-
const
|
|
1020
|
-
ct.has(
|
|
1017
|
+
let We = !1;
|
|
1018
|
+
const Ht = Math.min(te, V + le) - 1, Dt = Math.min(Se, P + he) - 1, ct = /* @__PURE__ */ new Set();
|
|
1019
|
+
for (let x = V; x <= Ht; x++) for (let Y = P; Y <= Dt; Y++) {
|
|
1020
|
+
const j = F[x][Y];
|
|
1021
|
+
ct.has(j.cell.getKey()) || j.cell.__rowSpan === 1 && j.cell.__colSpan === 1 || (Pn(j.cell), ct.add(j.cell.getKey()), We = !0);
|
|
1021
1022
|
}
|
|
1022
1023
|
let [we] = oe(k.getWritable(), null, null);
|
|
1023
|
-
const
|
|
1024
|
-
for (let x = 0; x <
|
|
1025
|
-
|
|
1026
|
-
const It = he - Se +
|
|
1024
|
+
const Bt = le - te + V;
|
|
1025
|
+
for (let x = 0; x < Bt; x++)
|
|
1026
|
+
Ye(we[te - 1][0].cell);
|
|
1027
|
+
const It = he - Se + P;
|
|
1027
1028
|
for (let x = 0; x < It; x++)
|
|
1028
|
-
|
|
1029
|
+
qe(we[0][Se - 1].cell, !0, !1);
|
|
1029
1030
|
[we] = oe(k.getWritable(), null, null);
|
|
1030
|
-
for (let x =
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
const ye =
|
|
1031
|
+
for (let x = V; x < V + le; x++) for (let Y = P; Y < P + he; Y++) {
|
|
1032
|
+
const j = x - V, ut = Y - P, Le = D[j][ut];
|
|
1033
|
+
if (Le.startRow !== j || Le.startColumn !== ut) continue;
|
|
1034
|
+
const ye = Le.cell;
|
|
1034
1035
|
if (ye.__rowSpan !== 1 || ye.__colSpan !== 1) {
|
|
1035
|
-
const
|
|
1036
|
-
for (let
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1036
|
+
const Z = [], Ut = Math.min(x + ye.__rowSpan, V + le) - 1, Xt = Math.min(Y + ye.__colSpan, P + he) - 1;
|
|
1037
|
+
for (let He = x; He <= Ut; He++) for (let De = Y; De <= Xt; De++) {
|
|
1038
|
+
const Yt = we[He][De];
|
|
1039
|
+
Z.push(Yt.cell);
|
|
1039
1040
|
}
|
|
1040
|
-
|
|
1041
|
+
Wn(Z), We = !0;
|
|
1041
1042
|
}
|
|
1042
|
-
const { cell:
|
|
1043
|
-
ye.getChildren().forEach((
|
|
1044
|
-
Ce(
|
|
1045
|
-
}),
|
|
1043
|
+
const { cell: Pe } = we[x][Y], Jt = Pe.getChildren();
|
|
1044
|
+
ye.getChildren().forEach((Z) => {
|
|
1045
|
+
Ce(Z) && U().append(Z), Pe.append(Z);
|
|
1046
|
+
}), Jt.forEach((Z) => Z.remove());
|
|
1046
1047
|
}
|
|
1047
|
-
if (C &&
|
|
1048
|
+
if (C && We) {
|
|
1048
1049
|
const [x] = oe(k.getWritable(), null, null);
|
|
1049
1050
|
x[O.startRow][O.startColumn].cell.selectEnd();
|
|
1050
1051
|
}
|
|
1051
1052
|
return !0;
|
|
1052
|
-
},
|
|
1053
|
-
const a =
|
|
1053
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(ge, () => {
|
|
1054
|
+
const a = W(), c = Je(), g = l.getAndClearNextFocus();
|
|
1054
1055
|
if (g !== null) {
|
|
1055
1056
|
const { focusCell: d } = g;
|
|
1056
1057
|
if (K(a) && a.tableKey === l.tableNodeKey) return (d.x !== l.focusX || d.y !== l.focusY) && (l.$setFocusCellForSelection(d), !0);
|
|
1057
|
-
if (d !== l.anchorCell &&
|
|
1058
|
+
if (d !== l.anchorCell && Q(a, n)) return l.$setFocusCellForSelection(d), !0;
|
|
1058
1059
|
}
|
|
1059
|
-
if (l.getAndClearShouldCheckSelection() &&
|
|
1060
|
+
if (l.getAndClearShouldCheckSelection() && M(c) && M(a) && a.isCollapsed()) {
|
|
1060
1061
|
const d = a.anchor.getNode(), m = n.getFirstChild(), C = be(d);
|
|
1061
1062
|
if (C !== null && E(m)) {
|
|
1062
1063
|
const S = m.getFirstChild();
|
|
1063
1064
|
if (y(S) && n.is(R(C, (N) => N.is(n) || N.is(S)))) return S.selectStart(), !0;
|
|
1064
1065
|
}
|
|
1065
1066
|
}
|
|
1066
|
-
if (
|
|
1067
|
-
const { anchor: d, focus: m } = a, C = d.getNode(), S = m.getNode(), N = be(C), b = be(S), v = !(!N || !n.is(_e(N))), T = !(!b || !n.is(_e(b))), k = v !== T, A = v && T,
|
|
1067
|
+
if (M(a)) {
|
|
1068
|
+
const { anchor: d, focus: m } = a, C = d.getNode(), S = m.getNode(), N = be(C), b = be(S), v = !(!N || !n.is(_e(N))), T = !(!b || !n.is(_e(b))), k = v !== T, A = v && T, z = a.isBackward();
|
|
1068
1069
|
if (k) {
|
|
1069
1070
|
const F = a.clone();
|
|
1070
1071
|
if (T) {
|
|
1071
|
-
const [O] =
|
|
1072
|
-
F.focus.set(
|
|
1072
|
+
const [O] = J(n, b, b), H = O[0][0].cell, D = O[O.length - 1].at(-1).cell;
|
|
1073
|
+
F.focus.set(z ? H.getKey() : D.getKey(), z ? 0 : D.getChildrenSize(), "element");
|
|
1073
1074
|
} else if (v) {
|
|
1074
|
-
const [O] =
|
|
1075
|
-
F.anchor.set(
|
|
1075
|
+
const [O] = J(n, N, N), H = O[0][0].cell, D = O[O.length - 1].at(-1).cell;
|
|
1076
|
+
F.anchor.set(z ? D.getKey() : H.getKey(), z ? D.getChildrenSize() : 0, "element");
|
|
1076
1077
|
}
|
|
1077
1078
|
ne(F), bt(t, l);
|
|
1078
|
-
} else if (A && (N.is(b) || (l.$setAnchorCellForSelection(se(l, N)), l.$setFocusCellForSelection(se(l, b), !0)), l.pointerType === "touch" && l.isSelecting && a.isCollapsed() &&
|
|
1079
|
+
} else if (A && (N.is(b) || (l.$setAnchorCellForSelection(se(l, N)), l.$setFocusCellForSelection(se(l, b), !0)), l.pointerType === "touch" && l.isSelecting && a.isCollapsed() && M(c) && c.isCollapsed())) {
|
|
1079
1080
|
const F = be(c.anchor.getNode());
|
|
1080
1081
|
F && !F.is(b) && (l.$setAnchorCellForSelection(se(l, F)), l.$setFocusCellForSelection(se(l, b), !0), l.pointerType = null);
|
|
1081
1082
|
}
|
|
1082
1083
|
} else if (a && K(a) && a.is(c) && a.tableKey === n.getKey()) {
|
|
1083
|
-
const d =
|
|
1084
|
+
const d = Me(s);
|
|
1084
1085
|
if (d && d.anchorNode && d.focusNode) {
|
|
1085
1086
|
const m = re(d.focusNode), C = m && !n.isParentOf(m), S = re(d.anchorNode), N = S && n.isParentOf(S);
|
|
1086
1087
|
if (C && N && d.rangeCount > 0) {
|
|
@@ -1092,20 +1093,20 @@ function Jn(n, e, t, o) {
|
|
|
1092
1093
|
return a && !a.is(c) && (K(a) || K(c)) && l.tableSelection && !l.tableSelection.is(c) ? (K(a) && a.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(a) : !K(a) && K(c) && c.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? (function(d, m) {
|
|
1093
1094
|
m.$enableHighlightStyle(), it(m.table, (C) => {
|
|
1094
1095
|
const S = C.elem;
|
|
1095
|
-
C.highlighted = !1,
|
|
1096
|
+
C.highlighted = !1, Lt(d, C), S.getAttribute("style") || S.removeAttribute("style");
|
|
1096
1097
|
});
|
|
1097
1098
|
})(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && bt(t, l), !1);
|
|
1098
|
-
},
|
|
1099
|
-
const a =
|
|
1100
|
-
if (
|
|
1099
|
+
}, X)), l.listenersToRemove.add(t.registerCommand(At, () => {
|
|
1100
|
+
const a = W();
|
|
1101
|
+
if (!M(a) || !a.isCollapsed() || !Q(a, n)) return !1;
|
|
1101
1102
|
const c = vt(t, a, n);
|
|
1102
1103
|
return !!c && (Nt(c, n), !0);
|
|
1103
|
-
},
|
|
1104
|
+
}, X)), l;
|
|
1104
1105
|
}
|
|
1105
1106
|
function wt(n) {
|
|
1106
|
-
return n[
|
|
1107
|
+
return n[je] || null;
|
|
1107
1108
|
}
|
|
1108
|
-
function
|
|
1109
|
+
function $e(n) {
|
|
1109
1110
|
let e = n;
|
|
1110
1111
|
for (; e != null; ) {
|
|
1111
1112
|
const t = e.nodeName;
|
|
@@ -1162,7 +1163,7 @@ function Ke(n, e, t) {
|
|
|
1162
1163
|
const o = new Set(t ? t.getNodes() : []);
|
|
1163
1164
|
it(e, (r, s) => {
|
|
1164
1165
|
const l = r.elem;
|
|
1165
|
-
o.has(s) ? (r.highlighted = !0,
|
|
1166
|
+
o.has(s) ? (r.highlighted = !0, Wt(n, r)) : (r.highlighted = !1, Lt(n, r), l.getAttribute("style") || l.removeAttribute("style"));
|
|
1166
1167
|
});
|
|
1167
1168
|
}
|
|
1168
1169
|
function it(n, e) {
|
|
@@ -1179,7 +1180,7 @@ function it(n, e) {
|
|
|
1179
1180
|
}
|
|
1180
1181
|
function bt(n, e) {
|
|
1181
1182
|
e.$disableHighlightStyle(), it(e.table, (t) => {
|
|
1182
|
-
t.highlighted = !0,
|
|
1183
|
+
t.highlighted = !0, Wt(n, t);
|
|
1183
1184
|
});
|
|
1184
1185
|
}
|
|
1185
1186
|
const Yn = (n, e, t, o, r) => {
|
|
@@ -1221,11 +1222,11 @@ function de(n, e, [t, o]) {
|
|
|
1221
1222
|
}
|
|
1222
1223
|
function qn(n, e, t, o, r) {
|
|
1223
1224
|
const s = Ee(e, t, o), l = (function(v, T) {
|
|
1224
|
-
const { minColumn: k, maxColumn: A, minRow:
|
|
1225
|
+
const { minColumn: k, maxColumn: A, minRow: z, maxRow: F } = T;
|
|
1225
1226
|
let O = 1, H = 1, D = 1, te = 1;
|
|
1226
|
-
const Se = v[
|
|
1227
|
-
for (let
|
|
1228
|
-
for (let
|
|
1227
|
+
const Se = v[z], V = v[F];
|
|
1228
|
+
for (let P = k; P <= A; P++) O = Math.max(O, Se[P].cell.__rowSpan), te = Math.max(te, V[P].cell.__rowSpan);
|
|
1229
|
+
for (let P = z; P <= F; P++) H = Math.max(H, v[P][k].cell.__colSpan), D = Math.max(D, v[P][A].cell.__colSpan);
|
|
1229
1230
|
return { bottomSpan: te, leftSpan: H, rightSpan: D, topSpan: O };
|
|
1230
1231
|
})(e, s), { topSpan: i, leftSpan: u, bottomSpan: f, rightSpan: h } = l, p = (function(v, T) {
|
|
1231
1232
|
const k = Ie(v, T);
|
|
@@ -1238,8 +1239,8 @@ function qn(n, e, t, o, r) {
|
|
|
1238
1239
|
const m = d[c];
|
|
1239
1240
|
if (m === void 0) return !1;
|
|
1240
1241
|
const [C, S] = (function(v, T, k) {
|
|
1241
|
-
const A = Ee(v, T, k),
|
|
1242
|
-
if (
|
|
1242
|
+
const A = Ee(v, T, k), z = Ie(A, T);
|
|
1243
|
+
if (z) return [de(v, A, z), de(v, A, Oe(z))];
|
|
1243
1244
|
const F = Ie(A, k);
|
|
1244
1245
|
if (F) return [de(v, A, Oe(F)), de(v, A, F)];
|
|
1245
1246
|
const O = ["minColumn", "minRow"];
|
|
@@ -1247,8 +1248,8 @@ function qn(n, e, t, o, r) {
|
|
|
1247
1248
|
})(e, t, m), N = se(n, C.cell), b = se(n, S.cell);
|
|
1248
1249
|
return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(b, !0), !0;
|
|
1249
1250
|
}
|
|
1250
|
-
function
|
|
1251
|
-
if (
|
|
1251
|
+
function Q(n, e) {
|
|
1252
|
+
if (M(n) || K(n)) {
|
|
1252
1253
|
const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
|
|
1253
1254
|
return t && o;
|
|
1254
1255
|
}
|
|
@@ -1257,11 +1258,11 @@ function G(n, e) {
|
|
|
1257
1258
|
function Ae(n, e) {
|
|
1258
1259
|
e ? n.selectStart() : n.selectEnd();
|
|
1259
1260
|
}
|
|
1260
|
-
function
|
|
1261
|
+
function Wt(n, e) {
|
|
1261
1262
|
const t = e.elem, o = n._config.theme;
|
|
1262
|
-
y(re(t)) || w(131),
|
|
1263
|
+
y(re(t)) || w(131), G(t, o.tableCellSelected);
|
|
1263
1264
|
}
|
|
1264
|
-
function
|
|
1265
|
+
function Lt(n, e) {
|
|
1265
1266
|
const t = e.elem;
|
|
1266
1267
|
y(re(t)) || w(131);
|
|
1267
1268
|
const o = n._config.theme;
|
|
@@ -1272,15 +1273,15 @@ function be(n) {
|
|
|
1272
1273
|
return y(e) ? e : null;
|
|
1273
1274
|
}
|
|
1274
1275
|
function _e(n) {
|
|
1275
|
-
const e = R(n,
|
|
1276
|
-
return
|
|
1276
|
+
const e = R(n, $);
|
|
1277
|
+
return $(e) ? e : null;
|
|
1277
1278
|
}
|
|
1278
|
-
function
|
|
1279
|
+
function Vn(n, e, t, o, r, s, l) {
|
|
1279
1280
|
const i = xn(t.focus, r ? "previous" : "next");
|
|
1280
1281
|
if (Rn(i)) return !1;
|
|
1281
1282
|
let u = i;
|
|
1282
1283
|
for (const d of dt(i).iterNodeCarets("shadowRoot")) {
|
|
1283
|
-
if (!Tn(d) || !
|
|
1284
|
+
if (!Tn(d) || !B(d.origin)) return !1;
|
|
1284
1285
|
u = d;
|
|
1285
1286
|
}
|
|
1286
1287
|
const f = u.getParentAtCaret();
|
|
@@ -1293,13 +1294,13 @@ function Xn(n, e, t, o, r, s, l) {
|
|
|
1293
1294
|
} else if (!E(C)) break;
|
|
1294
1295
|
}
|
|
1295
1296
|
return null;
|
|
1296
|
-
})(gt(h, u.direction)), _ = R(h,
|
|
1297
|
+
})(gt(h, u.direction)), _ = R(h, $);
|
|
1297
1298
|
if (!_ || !_.is(s)) return !1;
|
|
1298
|
-
const a = n.getElementByKey(h.getKey()), c =
|
|
1299
|
+
const a = n.getElementByKey(h.getKey()), c = $e(a);
|
|
1299
1300
|
if (!a || !c) return !1;
|
|
1300
1301
|
const g = jn(n, _);
|
|
1301
1302
|
if (l.table = g, p) if (o === "extend") {
|
|
1302
|
-
const d =
|
|
1303
|
+
const d = $e(n.getElementByKey(p.origin.getKey()));
|
|
1303
1304
|
if (!d) return !1;
|
|
1304
1305
|
l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(d, !0);
|
|
1305
1306
|
} else {
|
|
@@ -1316,18 +1317,18 @@ function Xn(n, e, t, o, r, s, l) {
|
|
|
1316
1317
|
}
|
|
1317
1318
|
return ee(e), !0;
|
|
1318
1319
|
}
|
|
1319
|
-
function
|
|
1320
|
+
function Pt(n, e, t, o, r) {
|
|
1320
1321
|
if ((t === "up" || t === "down") && (function(l) {
|
|
1321
1322
|
const i = l.getRootElement();
|
|
1322
1323
|
return i ? i.hasAttribute("aria-controls") && i.getAttribute("aria-controls") === "typeahead-menu" : !1;
|
|
1323
1324
|
})(n)) return !1;
|
|
1324
|
-
const s =
|
|
1325
|
-
if (!
|
|
1326
|
-
if (
|
|
1325
|
+
const s = W();
|
|
1326
|
+
if (!Q(s, o)) {
|
|
1327
|
+
if (M(s)) {
|
|
1327
1328
|
if (t === "backward") {
|
|
1328
1329
|
if (s.focus.offset > 0) return !1;
|
|
1329
1330
|
const l = (function(u) {
|
|
1330
|
-
for (let f = u, h = u; h !== null; f = h, h = h.getParent()) if (
|
|
1331
|
+
for (let f = u, h = u; h !== null; f = h, h = h.getParent()) if (B(h)) {
|
|
1331
1332
|
if (h !== f && h.getFirstChild() !== f) return null;
|
|
1332
1333
|
if (!h.isInline()) return h;
|
|
1333
1334
|
}
|
|
@@ -1335,19 +1336,19 @@ function Ht(n, e, t, o, r) {
|
|
|
1335
1336
|
})(s.focus.getNode());
|
|
1336
1337
|
if (!l) return !1;
|
|
1337
1338
|
const i = l.getPreviousSibling();
|
|
1338
|
-
return
|
|
1339
|
+
return !!$(i) && (ee(e), e.shiftKey ? s.focus.set(i.getParentOrThrow().getKey(), i.getIndexWithinParent(), "element") : i.selectEnd(), !0);
|
|
1339
1340
|
}
|
|
1340
1341
|
if (e.shiftKey && (t === "up" || t === "down")) {
|
|
1341
1342
|
const l = s.focus.getNode();
|
|
1342
1343
|
if (!s.isCollapsed() && (t === "up" && !s.isBackward() || t === "down" && s.isBackward())) {
|
|
1343
|
-
let i = R(l, (_) =>
|
|
1344
|
-
if (y(i) && (i = R(i,
|
|
1344
|
+
let i = R(l, (_) => $(_));
|
|
1345
|
+
if (y(i) && (i = R(i, $)), i !== o || !i) return !1;
|
|
1345
1346
|
const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
|
|
1346
1347
|
if (!u) return !1;
|
|
1347
1348
|
let f = 0;
|
|
1348
|
-
t === "up" &&
|
|
1349
|
+
t === "up" && B(u) && (f = u.getChildrenSize());
|
|
1349
1350
|
let h = u;
|
|
1350
|
-
t === "up" &&
|
|
1351
|
+
t === "up" && B(u) && (h = u.getLastChild() || u, f = Ce(h) ? h.getTextContentSize() : 0);
|
|
1351
1352
|
const p = s.clone();
|
|
1352
1353
|
return p.focus.set(h.getKey(), f, Ce(h) ? "text" : "element"), ne(p), ee(e), !0;
|
|
1353
1354
|
}
|
|
@@ -1362,10 +1363,10 @@ function Ht(n, e, t, o, r) {
|
|
|
1362
1363
|
return !1;
|
|
1363
1364
|
}
|
|
1364
1365
|
{
|
|
1365
|
-
let i = R(l, (f) =>
|
|
1366
|
-
if (y(i) && (i = R(i,
|
|
1366
|
+
let i = R(l, (f) => B(f) && !f.isInline());
|
|
1367
|
+
if (y(i) && (i = R(i, $)), !i) return !1;
|
|
1367
1368
|
const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
|
|
1368
|
-
if (
|
|
1369
|
+
if ($(u) && r.tableNodeKey === u.getKey()) {
|
|
1369
1370
|
const f = u.getFirstDescendant(), h = u.getLastDescendant();
|
|
1370
1371
|
if (!f || !h) return !1;
|
|
1371
1372
|
const [p] = I(f), [_] = I(h), a = s.clone();
|
|
@@ -1374,25 +1375,25 @@ function Ht(n, e, t, o, r) {
|
|
|
1374
1375
|
}
|
|
1375
1376
|
}
|
|
1376
1377
|
}
|
|
1377
|
-
return t === "down" &&
|
|
1378
|
+
return t === "down" && Ze(n) && r.setShouldCheckSelection(), !1;
|
|
1378
1379
|
}
|
|
1379
|
-
if (
|
|
1380
|
+
if (M(s)) {
|
|
1380
1381
|
if (t === "backward" || t === "forward")
|
|
1381
|
-
return
|
|
1382
|
+
return Vn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
|
|
1382
1383
|
if (s.isCollapsed()) {
|
|
1383
1384
|
const { anchor: l, focus: i } = s, u = R(l.getNode(), y), f = R(i.getNode(), y);
|
|
1384
1385
|
if (!y(u) || !u.is(f)) return !1;
|
|
1385
1386
|
const h = _e(u);
|
|
1386
1387
|
if (h !== o && h != null) {
|
|
1387
1388
|
const m = ae(h, n.getElementByKey(h.getKey()));
|
|
1388
|
-
if (m != null) return r.table = pe(h, m),
|
|
1389
|
+
if (m != null) return r.table = pe(h, m), Pt(n, e, t, h, r);
|
|
1389
1390
|
}
|
|
1390
1391
|
const p = n.getElementByKey(u.__key), _ = n.getElementByKey(l.key);
|
|
1391
1392
|
if (_ == null || p == null) return !1;
|
|
1392
1393
|
let a;
|
|
1393
1394
|
if (l.type === "element") a = _.getBoundingClientRect();
|
|
1394
1395
|
else {
|
|
1395
|
-
const m =
|
|
1396
|
+
const m = Me(st(n));
|
|
1396
1397
|
if (m === null || m.rangeCount === 0) return !1;
|
|
1397
1398
|
a = m.getRangeAt(0).getBoundingClientRect();
|
|
1398
1399
|
}
|
|
@@ -1414,13 +1415,13 @@ function Ht(n, e, t, o, r) {
|
|
|
1414
1415
|
}
|
|
1415
1416
|
} else if (K(s)) {
|
|
1416
1417
|
const { anchor: l, focus: i } = s, u = R(l.getNode(), y), f = R(i.getNode(), y), [h] = s.getNodes();
|
|
1417
|
-
|
|
1418
|
+
$(h) || w(251);
|
|
1418
1419
|
const p = ae(h, n.getElementByKey(h.getKey()));
|
|
1419
|
-
if (!y(u) || !y(f) ||
|
|
1420
|
+
if (!y(u) || !y(f) || !$(h) || p == null) return !1;
|
|
1420
1421
|
r.$updateTableTableSelection(s);
|
|
1421
1422
|
const _ = pe(h, p), a = o.getCordsFromCellNode(u, _), c = o.getDOMCellFromCordsOrThrow(a.x, a.y, _);
|
|
1422
1423
|
if (r.$setAnchorCellForSelection(c), ee(e), e.shiftKey) {
|
|
1423
|
-
const [g, d, m] =
|
|
1424
|
+
const [g, d, m] = J(o, u, f);
|
|
1424
1425
|
return qn(r, g, d, m, t);
|
|
1425
1426
|
}
|
|
1426
1427
|
return f.selectEnd(), !0;
|
|
@@ -1431,28 +1432,28 @@ function ee(n) {
|
|
|
1431
1432
|
n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
|
|
1432
1433
|
}
|
|
1433
1434
|
function Nt(n, e, t) {
|
|
1434
|
-
const o =
|
|
1435
|
+
const o = U();
|
|
1435
1436
|
n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
|
|
1436
1437
|
}
|
|
1437
1438
|
function vt(n, e, t) {
|
|
1438
1439
|
const o = t.getParent();
|
|
1439
1440
|
if (!o) return;
|
|
1440
|
-
const r =
|
|
1441
|
+
const r = Me(st(n));
|
|
1441
1442
|
if (!r) return;
|
|
1442
1443
|
const s = r.anchorNode, l = n.getElementByKey(o.getKey()), i = ae(t, n.getElementByKey(t.getKey()));
|
|
1443
1444
|
if (!s || !l || !i || !l.contains(s) || i.contains(s)) return;
|
|
1444
1445
|
const u = R(e.anchor.getNode(), (C) => y(C));
|
|
1445
1446
|
if (!u) return;
|
|
1446
|
-
const f = R(u, (C) =>
|
|
1447
|
-
if (
|
|
1448
|
-
const [h, p] =
|
|
1447
|
+
const f = R(u, (C) => $(C));
|
|
1448
|
+
if (!$(f) || !f.is(t)) return;
|
|
1449
|
+
const [h, p] = J(t, u, u), _ = h[0][0], a = h[h.length - 1][h[0].length - 1], { startRow: c, startColumn: g } = p, d = c === _.startRow && g === _.startColumn, m = c === a.startRow && g === a.startColumn;
|
|
1449
1450
|
return d ? "first" : m ? "last" : void 0;
|
|
1450
1451
|
}
|
|
1451
1452
|
function se(n, e) {
|
|
1452
1453
|
const { tableNode: t } = n.$lookup(), o = t.getCordsFromCellNode(e, n.table);
|
|
1453
1454
|
return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
|
|
1454
1455
|
}
|
|
1455
|
-
function
|
|
1456
|
+
function Qe(n, e, t) {
|
|
1456
1457
|
return xe(n, re(e, t));
|
|
1457
1458
|
}
|
|
1458
1459
|
function xt(n, e, t) {
|
|
@@ -1462,14 +1463,14 @@ function xt(n, e, t) {
|
|
|
1462
1463
|
const l = e.theme.tableAlignment[s];
|
|
1463
1464
|
l && (s === t ? r : o).push(l);
|
|
1464
1465
|
}
|
|
1465
|
-
me(n, ...o),
|
|
1466
|
+
me(n, ...o), G(n, ...r);
|
|
1466
1467
|
}
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
return
|
|
1468
|
+
const Ge = /* @__PURE__ */ new WeakSet();
|
|
1469
|
+
function Ze(n = Ft()) {
|
|
1470
|
+
return Ge.has(n);
|
|
1470
1471
|
}
|
|
1471
|
-
function
|
|
1472
|
-
e ?
|
|
1472
|
+
function fo(n, e) {
|
|
1473
|
+
e ? Ge.add(n) : Ge.delete(n);
|
|
1473
1474
|
}
|
|
1474
1475
|
class ce extends et {
|
|
1475
1476
|
__rowStriping;
|
|
@@ -1493,7 +1494,7 @@ class ce extends et {
|
|
|
1493
1494
|
super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
|
|
1494
1495
|
}
|
|
1495
1496
|
static importDOM() {
|
|
1496
|
-
return { table: (e) => ({ conversion:
|
|
1497
|
+
return { table: (e) => ({ conversion: Qn, priority: 1 }) };
|
|
1497
1498
|
}
|
|
1498
1499
|
static importJSON(e) {
|
|
1499
1500
|
return at().updateFromJSON(e);
|
|
@@ -1518,22 +1519,22 @@ class ce extends et {
|
|
|
1518
1519
|
const o = document.createElement("table");
|
|
1519
1520
|
this.__style && (o.style.cssText = this.__style);
|
|
1520
1521
|
const r = document.createElement("colgroup");
|
|
1521
|
-
if (o.appendChild(r),
|
|
1522
|
+
if (o.appendChild(r), Zt(r), G(o, e.theme.table), this.updateTableElement(null, o, e), Ze(t)) {
|
|
1522
1523
|
const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
|
|
1523
|
-
return l ?
|
|
1524
|
+
return l ? G(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
|
|
1524
1525
|
}
|
|
1525
1526
|
return o;
|
|
1526
1527
|
}
|
|
1527
1528
|
updateTableWrapper(e, t, o, r) {
|
|
1528
1529
|
this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && (function(s, l, i, u) {
|
|
1529
|
-
u > 0 ? (
|
|
1530
|
+
u > 0 ? (G(s, i.theme.tableFrozenColumn), l.setAttribute("data-lexical-frozen-column", "true")) : (me(s, i.theme.tableFrozenColumn), l.removeAttribute("data-lexical-frozen-column"));
|
|
1530
1531
|
})(t, o, r, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && (function(s, l, i, u) {
|
|
1531
|
-
u > 0 ? (
|
|
1532
|
+
u > 0 ? (G(s, i.theme.tableFrozenRow), l.setAttribute("data-lexical-frozen-row", "true")) : (me(s, i.theme.tableFrozenRow), l.removeAttribute("data-lexical-frozen-row"));
|
|
1532
1533
|
})(t, o, r, this.__frozenRowCount);
|
|
1533
1534
|
}
|
|
1534
1535
|
updateTableElement(e, t, o) {
|
|
1535
1536
|
this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && (function(r, s, l) {
|
|
1536
|
-
l ? (
|
|
1537
|
+
l ? (G(r, s.theme.tableRowStriping), r.setAttribute("data-lexical-row-striping", "true")) : (me(r, s.theme.tableRowStriping), r.removeAttribute("data-lexical-row-striping"));
|
|
1537
1538
|
})(t, o, this.__rowStriping), (function(r, s, l, i) {
|
|
1538
1539
|
const u = r.querySelector("colgroup");
|
|
1539
1540
|
if (!u) return;
|
|
@@ -1547,7 +1548,7 @@ class ce extends et {
|
|
|
1547
1548
|
}
|
|
1548
1549
|
updateDOM(e, t, o) {
|
|
1549
1550
|
const r = this.getDOMSlot(t).element;
|
|
1550
|
-
return t === r ===
|
|
1551
|
+
return t === r === Ze() || (ve(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, r, o), this.updateTableElement(e, r, o), !1);
|
|
1551
1552
|
var s;
|
|
1552
1553
|
}
|
|
1553
1554
|
exportDOM(e) {
|
|
@@ -1598,7 +1599,7 @@ class ce extends et {
|
|
|
1598
1599
|
if (l != null) for (let i = 0; i < l.length; i++) {
|
|
1599
1600
|
const u = l[i];
|
|
1600
1601
|
if (u == null) continue;
|
|
1601
|
-
const { elem: f } = u, h =
|
|
1602
|
+
const { elem: f } = u, h = Qe(this, f);
|
|
1602
1603
|
if (h !== null && e.is(h)) return { x: i, y: s };
|
|
1603
1604
|
}
|
|
1604
1605
|
}
|
|
@@ -1666,7 +1667,7 @@ function jn(n, e) {
|
|
|
1666
1667
|
const t = n.getElementByKey(e.getKey());
|
|
1667
1668
|
return t === null && w(230), pe(e, t);
|
|
1668
1669
|
}
|
|
1669
|
-
function
|
|
1670
|
+
function Qn(n) {
|
|
1670
1671
|
const e = at();
|
|
1671
1672
|
n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0), n.hasAttribute("data-lexical-frozen-column") && e.setFrozenColumns(1), n.hasAttribute("data-lexical-frozen-row") && e.setFrozenRows(1);
|
|
1672
1673
|
const t = n.querySelector(":scope > colgroup");
|
|
@@ -1687,48 +1688,50 @@ function Vn(n) {
|
|
|
1687
1688
|
function at() {
|
|
1688
1689
|
return tt(new ce());
|
|
1689
1690
|
}
|
|
1690
|
-
function
|
|
1691
|
+
function $(n) {
|
|
1691
1692
|
return n instanceof ce;
|
|
1692
1693
|
}
|
|
1693
|
-
function Gn(
|
|
1694
|
-
|
|
1695
|
-
if (!o || !$(o) || _e(o.anchor.getNode())) return !1;
|
|
1696
|
-
const r = $n(Number(n), Number(e), t);
|
|
1697
|
-
Vt(r);
|
|
1698
|
-
const s = r.getFirstDescendant();
|
|
1699
|
-
return Ce(s) && s.select(), !0;
|
|
1694
|
+
function Gn(n) {
|
|
1695
|
+
E(n.getParent()) ? n.isEmpty() && n.append(U()) : n.remove();
|
|
1700
1696
|
}
|
|
1701
1697
|
function Zn(n) {
|
|
1702
|
-
|
|
1703
|
-
}
|
|
1704
|
-
function Qn(n) {
|
|
1705
|
-
M(n.getParent()) ? Tt(n, y) : n.remove();
|
|
1698
|
+
$(n.getParent()) ? Tt(n, y) : n.remove();
|
|
1706
1699
|
}
|
|
1707
1700
|
function eo(n) {
|
|
1708
1701
|
Tt(n, E);
|
|
1709
|
-
const [e] = oe(n, null, null), t = e.reduce((
|
|
1710
|
-
for (let
|
|
1711
|
-
const
|
|
1712
|
-
if (!
|
|
1713
|
-
E(
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
|
|
1702
|
+
const [e] = oe(n, null, null), t = e.reduce((l, i) => Math.max(l, i.length), 0), o = n.getChildren();
|
|
1703
|
+
for (let l = 0; l < e.length; ++l) {
|
|
1704
|
+
const i = o[l];
|
|
1705
|
+
if (!i) continue;
|
|
1706
|
+
E(i) || w(254, i.constructor.name, i.getType());
|
|
1707
|
+
const u = e[l].reduce((f, h) => h ? 1 + f : f, 0);
|
|
1708
|
+
if (u !== t) for (let f = u; f < t; ++f) {
|
|
1709
|
+
const h = q();
|
|
1710
|
+
h.append(U()), i.append(h);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
const r = n.getColWidths(), s = n.getColumnCount();
|
|
1714
|
+
if (r && r.length !== s) {
|
|
1715
|
+
let l;
|
|
1716
|
+
if (s < r.length) l = r.slice(0, s);
|
|
1717
|
+
else if (r.length > 0) {
|
|
1718
|
+
const i = r[r.length - 1];
|
|
1719
|
+
l = [...r, ...Array(s - r.length).fill(i)];
|
|
1718
1720
|
}
|
|
1721
|
+
n.setColWidths(l);
|
|
1719
1722
|
}
|
|
1720
1723
|
}
|
|
1721
1724
|
function to(n) {
|
|
1722
1725
|
if (n.detail < 3 || !Ne(n.target)) return !1;
|
|
1723
1726
|
const e = re(n.target);
|
|
1724
1727
|
if (e === null) return !1;
|
|
1725
|
-
const t = R(e, (o) =>
|
|
1728
|
+
const t = R(e, (o) => B(o) && !o.isInline());
|
|
1726
1729
|
return t === null ? !1 : !!y(t.getParent()) && (t.select(0), !0);
|
|
1727
1730
|
}
|
|
1728
|
-
function
|
|
1731
|
+
function go(n) {
|
|
1729
1732
|
return n.registerNodeTransform(ue, (e) => {
|
|
1730
1733
|
if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
|
|
1731
|
-
const [, , t] = I(e), [o] =
|
|
1734
|
+
const [, , t] = I(e), [o] = J(t, e, e), r = o.length, s = o[0].length;
|
|
1732
1735
|
let l = t.getFirstChild();
|
|
1733
1736
|
E(l) || w(175);
|
|
1734
1737
|
const i = [];
|
|
@@ -1740,7 +1743,7 @@ function fo(n) {
|
|
|
1740
1743
|
if (p.startRow === u && p.startColumn === h) f = _, i.push(_);
|
|
1741
1744
|
else if (_.getColSpan() > 1 || _.getRowSpan() > 1) {
|
|
1742
1745
|
y(_) || w(176);
|
|
1743
|
-
const a =
|
|
1746
|
+
const a = q(_.__headerState);
|
|
1744
1747
|
f !== null ? f.insertAfter(a) : jt(l, a);
|
|
1745
1748
|
}
|
|
1746
1749
|
}
|
|
@@ -1749,16 +1752,16 @@ function fo(n) {
|
|
|
1749
1752
|
}
|
|
1750
1753
|
});
|
|
1751
1754
|
}
|
|
1752
|
-
function
|
|
1755
|
+
function mo(n, e = !0) {
|
|
1753
1756
|
const t = /* @__PURE__ */ new Map(), o = (s, l, i) => {
|
|
1754
|
-
const u = ae(s, i), f =
|
|
1757
|
+
const u = ae(s, i), f = Xn(s, u, n, e);
|
|
1755
1758
|
t.set(l, [f, u]);
|
|
1756
1759
|
}, r = n.registerMutationListener(ce, (s) => {
|
|
1757
1760
|
n.getEditorState().read(() => {
|
|
1758
1761
|
for (const [l, i] of s) {
|
|
1759
1762
|
const u = t.get(l);
|
|
1760
1763
|
if (i === "created" || i === "updated") {
|
|
1761
|
-
const { tableNode: f, tableElement: h } =
|
|
1764
|
+
const { tableNode: f, tableElement: h } = zt(l);
|
|
1762
1765
|
u === void 0 ? o(f, l, h) : h !== u[1] && (u[0].removeListeners(), t.delete(l), o(f, l, h));
|
|
1763
1766
|
} else i === "destroyed" && u !== void 0 && (u[0].removeListeners(), t.delete(l));
|
|
1764
1767
|
}
|
|
@@ -1769,34 +1772,43 @@ function go(n, e = !0) {
|
|
|
1769
1772
|
for (const [, [s]] of t) s.removeListeners();
|
|
1770
1773
|
};
|
|
1771
1774
|
}
|
|
1772
|
-
function
|
|
1773
|
-
|
|
1775
|
+
function po(n, e) {
|
|
1776
|
+
n.hasNodes([ce]) || w(255);
|
|
1777
|
+
const { hasNestedTables: t = On(!1) } = e ?? {};
|
|
1778
|
+
return qt(n.registerCommand(En, (o) => (function({ rows: r, columns: s, includeHeaders: l }, i) {
|
|
1779
|
+
const u = W() || Je();
|
|
1780
|
+
if (!u || !M(u) || !i && _e(u.anchor.getNode())) return !1;
|
|
1781
|
+
const f = zn(Number(r), Number(s), l);
|
|
1782
|
+
Vt(f);
|
|
1783
|
+
const h = f.getFirstDescendant();
|
|
1784
|
+
return Ce(h) && h.select(), !0;
|
|
1785
|
+
})(o, t.peek()), Be), n.registerCommand(Kt, ({ nodes: o, selection: r }, s) => t.peek() || n !== s || !M(r) ? !1 : _e(r.anchor.getNode()) !== null && o.some($), Be), n.registerCommand(on, to, Be), n.registerNodeTransform(ce, eo), n.registerNodeTransform(Te, Zn), n.registerNodeTransform(ue, Gn));
|
|
1774
1786
|
}
|
|
1775
1787
|
export {
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1788
|
+
Re as $,
|
|
1789
|
+
y as A,
|
|
1790
|
+
zn as B,
|
|
1791
|
+
kt as D,
|
|
1779
1792
|
Te as E,
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
kt as P,
|
|
1787
|
-
_e as Q,
|
|
1793
|
+
Et as I,
|
|
1794
|
+
ao as J,
|
|
1795
|
+
po as N,
|
|
1796
|
+
q as O,
|
|
1797
|
+
so as P,
|
|
1798
|
+
ue as T,
|
|
1788
1799
|
io as U,
|
|
1789
|
-
co as
|
|
1800
|
+
co as V,
|
|
1801
|
+
E as W,
|
|
1802
|
+
_e as Z,
|
|
1790
1803
|
ae as a,
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
Me as z
|
|
1804
|
+
go as b,
|
|
1805
|
+
ce as d,
|
|
1806
|
+
uo as e,
|
|
1807
|
+
fo as h,
|
|
1808
|
+
oe as m,
|
|
1809
|
+
ho as s,
|
|
1810
|
+
Ze as u,
|
|
1811
|
+
mo as y,
|
|
1812
|
+
$e as z
|
|
1801
1813
|
};
|
|
1802
|
-
//# sourceMappingURL=LexicalTable.prod-
|
|
1814
|
+
//# sourceMappingURL=LexicalTable.prod-C97KnedB.js.map
|