@uva-glass/component-library 3.0.10 → 3.0.12
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/Column-BL3dsYxn.js +101 -0
- package/dist/{Column-BUyVh2Oo.js.map → Column-BL3dsYxn.js.map} +1 -1
- package/dist/{Lexical.prod-CoFvB6ST.js → Lexical.prod-pVkgOp1j.js} +6 -6
- package/dist/Lexical.prod-pVkgOp1j.js.map +1 -0
- package/dist/{LexicalClipboard.prod-BceK2u8q.js → LexicalClipboard.prod-DIvwPtmL.js} +4 -4
- package/dist/{LexicalClipboard.prod-BceK2u8q.js.map → LexicalClipboard.prod-DIvwPtmL.js.map} +1 -1
- package/dist/{LexicalLink.prod-DgAdBBH7.js → LexicalLink.prod-NMeHB9CR.js} +3 -3
- package/dist/{LexicalLink.prod-DgAdBBH7.js.map → LexicalLink.prod-NMeHB9CR.js.map} +1 -1
- package/dist/{LexicalList.prod-BsGg0KUo.js → LexicalList.prod-CicvwkCx.js} +10 -8
- package/dist/LexicalList.prod-CicvwkCx.js.map +1 -0
- package/dist/{LexicalSelection.prod-CajyzNb9.js → LexicalSelection.prod-mQvH0_ap.js} +2 -2
- package/dist/{LexicalSelection.prod-CajyzNb9.js.map → LexicalSelection.prod-mQvH0_ap.js.map} +1 -1
- package/dist/{LexicalTable.prod-CNsOdwua.js → LexicalTable.prod-Bb6g8CAC.js} +240 -231
- package/dist/LexicalTable.prod-Bb6g8CAC.js.map +1 -0
- package/dist/{LexicalUtils.prod-CqRL6ZhZ.js → LexicalUtils.prod-C_aSRWfh.js} +2 -2
- package/dist/{LexicalUtils.prod-CqRL6ZhZ.js.map → LexicalUtils.prod-C_aSRWfh.js.map} +1 -1
- package/dist/{TablePlugin-CFD5PSMc.js → TablePlugin-o1MveXq2.js} +4 -4
- package/dist/{TablePlugin-CFD5PSMc.js.map → TablePlugin-o1MveXq2.js.map} +1 -1
- package/dist/TimelineItem-DmrymETS.js +52 -0
- package/dist/TimelineItem-DmrymETS.js.map +1 -0
- package/dist/__mocks__/svgrMock.js.map +1 -1
- package/dist/assets/Column.css +1 -1
- package/dist/assets/TimelineItem.css +1 -0
- package/dist/assets/VarIndicator.css +1 -1
- package/dist/assets/variables.css +3 -3
- package/dist/components/Accordion/Accordion.test.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.test.js.map +1 -1
- package/dist/components/ActionList/ActionList.test.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.test.js.map +1 -1
- package/dist/components/Attention/Attention.test.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.test.js.map +1 -1
- package/dist/components/Buttons/Button.test.js.map +1 -1
- package/dist/components/Buttons/LinkButton.test.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js.map +1 -1
- package/dist/components/Buttons/MenuButton.test.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js.map +1 -1
- package/dist/components/Card/Card.test.d.ts +0 -0
- package/dist/components/Card/Card.test.js +10 -0
- package/dist/components/Card/Card.test.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -0
- package/dist/components/Checkbox/Checkbox.test.js +16 -0
- package/dist/components/Checkbox/Checkbox.test.js.map +1 -0
- package/dist/components/CheckboxButton/CheckboxButton.test.d.ts +0 -0
- package/dist/components/CheckboxButton/CheckboxButton.test.js +51 -0
- package/dist/components/CheckboxButton/CheckboxButton.test.js.map +1 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.d.ts +0 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +90 -0
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -0
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/GridRow/Column/Column.js +1 -1
- package/dist/components/GridRow/Column/index.js +1 -1
- package/dist/components/GridRow/GridRow.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/Label/Label.test.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/OverlayStepBar/OverlayStepBar.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +31 -31
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/Timeline/Timeline.d.ts +28 -0
- package/dist/components/Timeline/Timeline.js +29 -0
- package/dist/components/Timeline/Timeline.js.map +1 -0
- package/dist/components/Timeline/Timeline.stories.d.ts +5 -0
- package/dist/components/Timeline/Timeline.stories.js +43 -0
- package/dist/components/Timeline/Timeline.stories.js.map +1 -0
- package/dist/components/Timeline/Timeline.test.d.ts +0 -0
- package/dist/components/Timeline/Timeline.test.js +80 -0
- package/dist/components/Timeline/Timeline.test.js.map +1 -0
- package/dist/components/Timeline/TimelineItem.d.ts +2 -0
- package/dist/components/Timeline/TimelineItem.js +7 -0
- package/dist/components/Timeline/TimelineItem.js.map +1 -0
- package/dist/components/Timeline/index.d.ts +1 -0
- package/dist/components/Timeline/index.js +5 -0
- package/dist/components/Timeline/index.js.map +1 -0
- package/dist/components/Timeline/mockTimelineItem.d.ts +30 -0
- package/dist/components/Timeline/mockTimelineItem.js +95 -0
- package/dist/components/Timeline/mockTimelineItem.js.map +1 -0
- package/dist/components/VarIndicator/VarIndicator.js +11 -11
- package/dist/components/VarIndicator/VarIndicator.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +23 -21
- package/dist/components/index.js.map +1 -1
- package/dist/{helpers-C-JeRM2f.js → helpers-CtrLGKFA.js} +4 -4
- package/dist/{helpers-C-JeRM2f.js.map → helpers-CtrLGKFA.js.map} +1 -1
- package/dist/index.js +23 -21
- package/dist/index.js.map +1 -1
- package/dist/setupTests.js.map +1 -1
- package/package.json +8 -8
- package/dist/Column-BUyVh2Oo.js +0 -101
- package/dist/Lexical.prod-CoFvB6ST.js.map +0 -1
- package/dist/LexicalList.prod-BsGg0KUo.js.map +0 -1
- package/dist/LexicalTable.prod-CNsOdwua.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as N, e as X, T as
|
|
2
|
-
import { f as Pe, e as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { h as N, e as X, T as pt, n as se, $ as Mt, A as zt, P as _t, w as Lt, E as Pt } from "./LexicalUtils.prod-C_aSRWfh.js";
|
|
2
|
+
import { f as Pe, e as we, U as Be, d as P, T as j, O as Bt, X as he, Q as He, _ as Ht, h as St, r as V, i as Wt, N as Ke, j as wt, l as z, o as Dt, n as ae, a as L, k as be, m as It, p as Jt, q as Xt, u as Yt, F as Ae, L as qt, v as Ut, x as bt, y as jt, z as I, A as Vt, B as Qt, G as Gt, I as Zt, J as en, K as tn, M as nn, P as on, S as ne, V as Ze, g as q, W as xe, Y as rn, b as yt, Z as ln, w as Nt, a0 as sn, $ as an, a1 as ye, a2 as cn, a3 as un, a4 as et, a5 as hn, a6 as tt, D as dn, a7 as nt, s as ot, c as me, a8 as fn, C as gn, a9 as mn, aa as Cn } from "./Lexical.prod-pVkgOp1j.js";
|
|
3
|
+
import { _ as pn, M as _n } from "./LexicalClipboard.prod-DIvwPtmL.js";
|
|
4
4
|
const We = /^(\d+(?:\.\d+)?)px$/, D = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
|
|
5
5
|
class Z extends Pe {
|
|
6
6
|
static getType() {
|
|
@@ -16,7 +16,7 @@ class Z extends Pe {
|
|
|
16
16
|
return { td: (e) => ({ conversion: rt, priority: 0 }), th: (e) => ({ conversion: rt, priority: 0 }) };
|
|
17
17
|
}
|
|
18
18
|
static importJSON(e) {
|
|
19
|
-
return
|
|
19
|
+
return de().updateFromJSON(e);
|
|
20
20
|
}
|
|
21
21
|
updateFromJSON(e) {
|
|
22
22
|
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);
|
|
@@ -30,7 +30,7 @@ class Z extends Pe {
|
|
|
30
30
|
}
|
|
31
31
|
exportDOM(e) {
|
|
32
32
|
const t = super.exportDOM(e);
|
|
33
|
-
if (
|
|
33
|
+
if (we(t.element)) {
|
|
34
34
|
const o = t.element;
|
|
35
35
|
o.setAttribute("data-temporary-table-cell-lexical-key", this.getKey()), o.style.border = "1px solid black", this.__colSpan > 1 && (o.colSpan = this.__colSpan), this.__rowSpan > 1 && (o.rowSpan = this.__rowSpan), o.style.width = `${this.getWidth() || 75}px`, o.style.verticalAlign = this.getVerticalAlign() || "top", o.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (o.style.backgroundColor = "#f2f3f5");
|
|
36
36
|
}
|
|
@@ -117,7 +117,7 @@ function rt(n) {
|
|
|
117
117
|
const e = n, t = n.nodeName.toLowerCase();
|
|
118
118
|
let o;
|
|
119
119
|
We.test(e.style.width) && (o = parseFloat(e.style.width));
|
|
120
|
-
const r =
|
|
120
|
+
const r = de(t === "th" ? D.ROW : D.NO_STATUS, e.colSpan, o);
|
|
121
121
|
r.__rowSpan = e.rowSpan;
|
|
122
122
|
const s = e.style.backgroundColor;
|
|
123
123
|
s !== "" && (r.__backgroundColor = s);
|
|
@@ -127,34 +127,34 @@ function rt(n) {
|
|
|
127
127
|
return { after: (i) => (i.length === 0 && i.push(j()), i), forChild: (i, u) => {
|
|
128
128
|
if (S(u) && !P(i)) {
|
|
129
129
|
const g = j();
|
|
130
|
-
return
|
|
131
|
-
` ? null : (
|
|
130
|
+
return Bt(i) && i.getTextContent() === `
|
|
131
|
+
` ? null : (he(i) && (f && i.toggleFormat("bold"), h && i.toggleFormat("strikethrough"), C && i.toggleFormat("italic"), p && i.toggleFormat("underline")), g.append(i), g);
|
|
132
132
|
}
|
|
133
133
|
return i;
|
|
134
134
|
}, node: r };
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function de(n = D.NO_STATUS, e = 1, t) {
|
|
137
137
|
return Be(new Z(n, e, t));
|
|
138
138
|
}
|
|
139
139
|
function S(n) {
|
|
140
140
|
return n instanceof Z;
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const Sn = Dt();
|
|
143
143
|
function w(n, ...e) {
|
|
144
144
|
const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
145
145
|
o.append("code", n);
|
|
146
146
|
for (const r of e) o.append("v", r);
|
|
147
147
|
throw t.search = o.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
148
148
|
}
|
|
149
|
-
class
|
|
149
|
+
class fe extends Pe {
|
|
150
150
|
static getType() {
|
|
151
151
|
return "tablerow";
|
|
152
152
|
}
|
|
153
153
|
static clone(e) {
|
|
154
|
-
return new
|
|
154
|
+
return new fe(e.__height, e.__key);
|
|
155
155
|
}
|
|
156
156
|
static importDOM() {
|
|
157
|
-
return { tr: (e) => ({ conversion:
|
|
157
|
+
return { tr: (e) => ({ conversion: wn, priority: 0 }) };
|
|
158
158
|
}
|
|
159
159
|
static importJSON(e) {
|
|
160
160
|
return De().updateFromJSON(e);
|
|
@@ -196,55 +196,55 @@ class ge extends Pe {
|
|
|
196
196
|
return !1;
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function wn(n) {
|
|
200
200
|
const e = n;
|
|
201
201
|
let t;
|
|
202
|
-
return We.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) =>
|
|
202
|
+
return We.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => pt(o, S), node: De(t) };
|
|
203
203
|
}
|
|
204
204
|
function De(n) {
|
|
205
|
-
return Be(new
|
|
205
|
+
return Be(new fe(n));
|
|
206
206
|
}
|
|
207
207
|
function k(n) {
|
|
208
|
-
return n instanceof
|
|
208
|
+
return n instanceof fe;
|
|
209
209
|
}
|
|
210
|
-
const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0,
|
|
211
|
-
function
|
|
210
|
+
const Ie = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, bn = Ie && "documentMode" in document ? document.documentMode : null, lt = Ie && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);
|
|
211
|
+
function yn(n, e, t = !0) {
|
|
212
212
|
const o = qe();
|
|
213
213
|
for (let r = 0; r < n; r++) {
|
|
214
214
|
const s = De();
|
|
215
215
|
for (let l = 0; l < e; l++) {
|
|
216
216
|
let a = D.NO_STATUS;
|
|
217
217
|
typeof t == "object" ? (r === 0 && t.rows && (a |= D.ROW), l === 0 && t.columns && (a |= D.COLUMN)) : t && (r === 0 && (a |= D.ROW), l === 0 && (a |= D.COLUMN));
|
|
218
|
-
const c =
|
|
218
|
+
const c = de(a), f = j();
|
|
219
219
|
f.append(He()), c.append(f), s.append(c);
|
|
220
220
|
}
|
|
221
221
|
o.append(s);
|
|
222
222
|
}
|
|
223
223
|
return o;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Xn(n) {
|
|
226
226
|
const e = N(n, (t) => S(t));
|
|
227
227
|
return S(e) ? e : null;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function xt(n) {
|
|
230
230
|
const e = N(n, (t) => k(t));
|
|
231
231
|
if (k(e)) return e;
|
|
232
232
|
throw new Error("Expected table cell to be inside of table row.");
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Nn(n) {
|
|
235
235
|
const e = N(n, (t) => K(t));
|
|
236
236
|
if (K(e)) return e;
|
|
237
237
|
throw new Error("Expected table cell to be inside of table.");
|
|
238
238
|
}
|
|
239
|
-
function Xn(n) {
|
|
240
|
-
const e = yt(n);
|
|
241
|
-
return yn(e).getChildren().findIndex((t) => t.is(e));
|
|
242
|
-
}
|
|
243
239
|
function Yn(n) {
|
|
244
|
-
|
|
240
|
+
const e = xt(n);
|
|
241
|
+
return Nn(e).getChildren().findIndex((t) => t.is(e));
|
|
242
|
+
}
|
|
243
|
+
function qn(n) {
|
|
244
|
+
return xt(n).getChildren().findIndex((e) => e.is(n));
|
|
245
245
|
}
|
|
246
|
-
Ie && "InputEvent" in window && !
|
|
247
|
-
function
|
|
246
|
+
Ie && "InputEvent" in window && !bn && new window.InputEvent("input");
|
|
247
|
+
function Un(n, e) {
|
|
248
248
|
const t = n.getChildren();
|
|
249
249
|
for (let o = 0; o < t.length; o++) {
|
|
250
250
|
const r = t[o];
|
|
@@ -315,7 +315,7 @@ function $e(n, e, t) {
|
|
|
315
315
|
} while (o);
|
|
316
316
|
return { maxColumn: l, maxRow: a, minColumn: r, minRow: s };
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function st(n) {
|
|
319
319
|
const [e, , t] = oe(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
|
|
320
320
|
for (let a = 0; a < r; a++) l[a] = new Array(s);
|
|
321
321
|
for (let a = 0; a < r; a++) {
|
|
@@ -331,7 +331,7 @@ function lt(n) {
|
|
|
331
331
|
}
|
|
332
332
|
return null;
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function it(n) {
|
|
335
335
|
const [[e, t, o, r], [s, l, a, c]] = ["anchor", "focus"].map((f) => {
|
|
336
336
|
const h = n[f].getNode(), C = N(h, S);
|
|
337
337
|
S(C) || w(238, f, h.getKey(), h.getType());
|
|
@@ -368,7 +368,7 @@ class Te {
|
|
|
368
368
|
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;
|
|
369
369
|
}
|
|
370
370
|
clone() {
|
|
371
|
-
return new Te(this.tableKey,
|
|
371
|
+
return new Te(this.tableKey, ye(this.anchor.key, this.anchor.offset, this.anchor.type), ye(this.focus.key, this.focus.offset, this.focus.type));
|
|
372
372
|
}
|
|
373
373
|
isCollapsed() {
|
|
374
374
|
return !1;
|
|
@@ -384,19 +384,19 @@ class Te {
|
|
|
384
384
|
let t = 0;
|
|
385
385
|
this.getNodes().filter(S).forEach((r) => {
|
|
386
386
|
const s = r.getFirstChild();
|
|
387
|
-
|
|
387
|
+
Nt(s) && (t |= s.getTextFormat());
|
|
388
388
|
});
|
|
389
|
-
const o =
|
|
389
|
+
const o = Cn[e];
|
|
390
390
|
return !!(t & o);
|
|
391
391
|
}
|
|
392
392
|
insertNodes(e) {
|
|
393
393
|
const t = this.focus.getNode();
|
|
394
|
-
P(t) || w(151),
|
|
394
|
+
P(t) || w(151), gn(t.select(0, t.getChildrenSize())).insertNodes(e);
|
|
395
395
|
}
|
|
396
396
|
getShape() {
|
|
397
|
-
const { anchorCell: e, focusCell: t } =
|
|
397
|
+
const { anchorCell: e, focusCell: t } = it(this), o = st(e);
|
|
398
398
|
o === null && w(153);
|
|
399
|
-
const r =
|
|
399
|
+
const r = st(t);
|
|
400
400
|
r === null && w(155);
|
|
401
401
|
const s = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), a = Math.min(o.rowIndex, r.rowIndex), c = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
|
|
402
402
|
return { fromX: Math.min(s, l), fromY: Math.min(a, c), toX: Math.max(s, l), toY: Math.max(a, c) };
|
|
@@ -405,7 +405,7 @@ class Te {
|
|
|
405
405
|
if (!this.isValid()) return [];
|
|
406
406
|
const e = this._cachedNodes;
|
|
407
407
|
if (e !== null) return e;
|
|
408
|
-
const { anchorTable: t, anchorCell: o, focusCell: r } =
|
|
408
|
+
const { anchorTable: t, anchorCell: o, focusCell: r } = it(this), s = r.getParents()[1];
|
|
409
409
|
if (s !== t) {
|
|
410
410
|
if (t.isParentOf(r)) {
|
|
411
411
|
const d = s.getParent();
|
|
@@ -420,12 +420,12 @@ class Te {
|
|
|
420
420
|
let u = null;
|
|
421
421
|
for (let d = C; d <= p; d++) for (let m = f; m <= h; m++) {
|
|
422
422
|
const { cell: _ } = l[d][m], b = _.getParent();
|
|
423
|
-
k(b) || w(160), b !== u && (i.set(b.getKey(), b), u = b), i.has(_.getKey()) ||
|
|
423
|
+
k(b) || w(160), b !== u && (i.set(b.getKey(), b), u = b), i.has(_.getKey()) || Tn(_, (y) => {
|
|
424
424
|
i.set(y.getKey(), y);
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
const g = Array.from(i.values());
|
|
428
|
-
return
|
|
428
|
+
return mn() || (this._cachedNodes = g), g;
|
|
429
429
|
}
|
|
430
430
|
getTextContent() {
|
|
431
431
|
const e = this.getNodes().filter((o) => S(o));
|
|
@@ -441,29 +441,29 @@ class Te {
|
|
|
441
441
|
function v(n) {
|
|
442
442
|
return n instanceof Te;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
const n =
|
|
444
|
+
function Tt() {
|
|
445
|
+
const n = ye("root", 0, "element"), e = ye("root", 0, "element");
|
|
446
446
|
return new Te("root", n, e);
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function xn(n, e, t) {
|
|
449
449
|
n.getKey(), e.getKey(), t.getKey();
|
|
450
|
-
const o = L(), r = v(o) ? o.clone() :
|
|
450
|
+
const o = L(), r = v(o) ? o.clone() : Tt();
|
|
451
451
|
return r.set(n.getKey(), e.getKey(), t.getKey()), r;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Tn(n, e) {
|
|
454
454
|
const t = [[n]];
|
|
455
455
|
for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
|
|
456
456
|
const r = o.pop();
|
|
457
457
|
r === void 0 ? t.pop() : e(r) !== !1 && P(r) && t.push(r.getChildren());
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
const t =
|
|
460
|
+
function Ft(n, e = St()) {
|
|
461
|
+
const t = be(n);
|
|
462
462
|
K(t) || w(231, n);
|
|
463
463
|
const o = Q(t, e.getElementByKey(n));
|
|
464
464
|
return o === null && w(232, n), { tableElement: o, tableNode: t };
|
|
465
465
|
}
|
|
466
|
-
class
|
|
466
|
+
class Fn {
|
|
467
467
|
constructor(e, t) {
|
|
468
468
|
this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.listenersToRemove = /* @__PURE__ */ new Set(), this.tableNodeKey = t, this.editor = e, this.table = { columns: 0, domRows: [], rows: 0 }, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.isSelecting = !1, this.shouldCheckSelection = !1, this.abortController = new AbortController(), this.listenerOptions = { signal: this.abortController.signal }, this.nextFocus = null, this.trackTable();
|
|
469
469
|
}
|
|
@@ -474,7 +474,7 @@ class Tn {
|
|
|
474
474
|
this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach((e) => e()), this.listenersToRemove.clear();
|
|
475
475
|
}
|
|
476
476
|
$lookup() {
|
|
477
|
-
return
|
|
477
|
+
return Ft(this.tableNodeKey, this.editor);
|
|
478
478
|
}
|
|
479
479
|
trackTable() {
|
|
480
480
|
const e = new MutationObserver((t) => {
|
|
@@ -489,23 +489,23 @@ class Tn {
|
|
|
489
489
|
}
|
|
490
490
|
if (!o) return;
|
|
491
491
|
const { tableNode: r, tableElement: s } = this.$lookup();
|
|
492
|
-
this.table =
|
|
492
|
+
this.table = re(r, s);
|
|
493
493
|
}, { editor: this.editor });
|
|
494
494
|
});
|
|
495
495
|
this.editor.getEditorState().read(() => {
|
|
496
496
|
const { tableNode: t, tableElement: o } = this.$lookup();
|
|
497
|
-
this.table =
|
|
497
|
+
this.table = re(t, o), e.observe(o, { attributes: !0, childList: !0, subtree: !0 });
|
|
498
498
|
}, { editor: this.editor });
|
|
499
499
|
}
|
|
500
500
|
$clearHighlight() {
|
|
501
501
|
const e = this.editor;
|
|
502
502
|
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();
|
|
503
503
|
const { tableNode: t, tableElement: o } = this.$lookup();
|
|
504
|
-
|
|
504
|
+
Ce(e, re(t, o), null), L() !== null && (q(null), e.dispatchCommand(ne, void 0));
|
|
505
505
|
}
|
|
506
506
|
$enableHighlightStyle() {
|
|
507
507
|
const e = this.editor, { tableElement: t } = this.$lookup();
|
|
508
|
-
|
|
508
|
+
se(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
|
|
509
509
|
}
|
|
510
510
|
$disableHighlightStyle() {
|
|
511
511
|
const { tableElement: e } = this.$lookup();
|
|
@@ -515,7 +515,7 @@ class Tn {
|
|
|
515
515
|
if (e !== null) {
|
|
516
516
|
e.tableKey !== this.tableNodeKey && w(233, e.tableKey, this.tableNodeKey);
|
|
517
517
|
const t = this.editor;
|
|
518
|
-
this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(),
|
|
518
|
+
this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Ce(t, this.table, this.tableSelection);
|
|
519
519
|
} else this.$clearHighlight();
|
|
520
520
|
}
|
|
521
521
|
setShouldCheckSelection() {
|
|
@@ -544,19 +544,19 @@ class Tn {
|
|
|
544
544
|
} else this.isHighlightingCells = !0, this.$disableHighlightStyle();
|
|
545
545
|
if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
|
|
546
546
|
const a = ze(r, e.elem);
|
|
547
|
-
if (this.tableSelection != null && this.anchorCellNodeKey != null && a !== null) return this.focusCellNodeKey = a.getKey(), this.tableSelection =
|
|
547
|
+
if (this.tableSelection != null && this.anchorCellNodeKey != null && a !== null) return this.focusCellNodeKey = a.getKey(), this.tableSelection = xn(r, this.$getAnchorTableCellOrThrow(), a), q(this.tableSelection), o.dispatchCommand(ne, void 0), Ce(o, this.table, this.tableSelection), !0;
|
|
548
548
|
}
|
|
549
549
|
return !1;
|
|
550
550
|
}
|
|
551
551
|
$getAnchorTableCell() {
|
|
552
|
-
return this.anchorCellNodeKey ?
|
|
552
|
+
return this.anchorCellNodeKey ? be(this.anchorCellNodeKey) : null;
|
|
553
553
|
}
|
|
554
554
|
$getAnchorTableCellOrThrow() {
|
|
555
555
|
const e = this.$getAnchorTableCell();
|
|
556
556
|
return e === null && w(234), e;
|
|
557
557
|
}
|
|
558
558
|
$getFocusTableCell() {
|
|
559
|
-
return this.focusCellNodeKey ?
|
|
559
|
+
return this.focusCellNodeKey ? be(this.focusCellNodeKey) : null;
|
|
560
560
|
}
|
|
561
561
|
$getFocusTableCellOrThrow() {
|
|
562
562
|
const e = this.$getFocusTableCell();
|
|
@@ -567,21 +567,21 @@ class Tn {
|
|
|
567
567
|
const { tableNode: t } = this.$lookup(), o = ze(t, e.elem);
|
|
568
568
|
if (o !== null) {
|
|
569
569
|
const r = o.getKey();
|
|
570
|
-
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() :
|
|
570
|
+
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Tt(), this.anchorCellNodeKey = r;
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
$formatCells(e) {
|
|
574
574
|
const t = L();
|
|
575
575
|
v(t) || w(236);
|
|
576
|
-
const o =
|
|
576
|
+
const o = ln(), r = o.anchor, s = o.focus, l = t.getNodes().filter(S);
|
|
577
577
|
l.length > 0 || w(237);
|
|
578
|
-
const a = l[0].getFirstChild(), c =
|
|
578
|
+
const a = l[0].getFirstChild(), c = Nt(a) ? a.getFormatFlags(e, null) : null;
|
|
579
579
|
l.forEach((f) => {
|
|
580
580
|
r.set(f.getKey(), 0, "element"), s.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(e, c);
|
|
581
581
|
}), q(t), this.editor.dispatchCommand(ne, void 0);
|
|
582
582
|
}
|
|
583
583
|
$clearText() {
|
|
584
|
-
const { editor: e } = this, t =
|
|
584
|
+
const { editor: e } = this, t = be(this.tableNodeKey);
|
|
585
585
|
if (!K(t)) throw new Error("Expected TableNode.");
|
|
586
586
|
const o = L();
|
|
587
587
|
v(o) || w(253);
|
|
@@ -589,7 +589,7 @@ class Tn {
|
|
|
589
589
|
if (r.length === this.table.columns * this.table.rows) {
|
|
590
590
|
t.selectPrevious();
|
|
591
591
|
const s = t.getParent();
|
|
592
|
-
return t.remove(), void (
|
|
592
|
+
return t.remove(), void (sn(s) && s.isEmpty() && e.dispatchCommand(yt, void 0));
|
|
593
593
|
}
|
|
594
594
|
r.forEach((s) => {
|
|
595
595
|
if (P(s)) {
|
|
@@ -598,10 +598,10 @@ class Tn {
|
|
|
598
598
|
c !== l && c.remove();
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
|
-
}),
|
|
601
|
+
}), Ce(e, this.table, null), q(null), e.dispatchCommand(ne, void 0);
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
const Me = "__lexicalTableSelection",
|
|
604
|
+
const Me = "__lexicalTableSelection", vn = (n) => !(1 & ~n.buttons);
|
|
605
605
|
function Q(n, e) {
|
|
606
606
|
if (!e) return e;
|
|
607
607
|
const t = e.nodeName === "TABLE" ? e : n.getDOMSlot(e).element;
|
|
@@ -610,45 +610,44 @@ function Q(n, e) {
|
|
|
610
610
|
function Xe(n) {
|
|
611
611
|
return n._window;
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function ce(n, e) {
|
|
614
614
|
for (let t = e, o = null; t !== null; t = t.getParent()) {
|
|
615
615
|
if (n.is(t)) return o;
|
|
616
616
|
S(t) && (o = t);
|
|
617
617
|
}
|
|
618
618
|
return null;
|
|
619
619
|
}
|
|
620
|
-
const
|
|
621
|
-
function
|
|
620
|
+
const Rn = [[It, "down"], [Jt, "up"], [Xt, "backward"], [Yt, "forward"]], Kn = [Ut, bt, jt], An = [Vt, Qt];
|
|
621
|
+
function On(n, e, t, o) {
|
|
622
622
|
const r = t.getRootElement(), s = Xe(t);
|
|
623
623
|
r !== null && s !== null || w(246);
|
|
624
|
-
const l = new
|
|
624
|
+
const l = new Fn(t, n.getKey()), a = Q(n, e);
|
|
625
625
|
(function(i, u) {
|
|
626
|
-
|
|
626
|
+
at(i) !== null && w(205), i[Me] = u;
|
|
627
627
|
})(a, l), l.listenersToRemove.add(() => function(i, u) {
|
|
628
|
-
|
|
628
|
+
at(i) === u && delete i[Me];
|
|
629
629
|
}(a, l));
|
|
630
630
|
const c = (i) => {
|
|
631
|
-
if (i.button !== 0 || !
|
|
632
|
-
const u =
|
|
631
|
+
if (i.button !== 0 || !ae(i.target) || !s) return;
|
|
632
|
+
const u = Ne(i.target);
|
|
633
633
|
u !== null && t.update(() => {
|
|
634
634
|
const g = Ze();
|
|
635
|
-
if (
|
|
636
|
-
const d = g.anchor.getNode(), m =
|
|
637
|
-
m ? (l.$setAnchorCellForSelection(
|
|
635
|
+
if (lt && i.shiftKey && J(g, n) && (z(g) || v(g))) {
|
|
636
|
+
const d = g.anchor.getNode(), m = ce(n, g.anchor.getNode());
|
|
637
|
+
m ? (l.$setAnchorCellForSelection(ue(l, m)), l.$setFocusCellForSelection(u), Y(i)) : (n.isBefore(d) ? n.selectStart() : n.selectEnd()).anchor.set(g.anchor.key, g.anchor.offset, g.anchor.type);
|
|
638
638
|
} else l.$setAnchorCellForSelection(u);
|
|
639
639
|
}), (() => {
|
|
640
640
|
if (l.isSelecting) return;
|
|
641
641
|
const g = () => {
|
|
642
642
|
l.isSelecting = !1, s.removeEventListener("mouseup", g), s.removeEventListener("mousemove", d);
|
|
643
643
|
}, d = (m) => {
|
|
644
|
-
if (!
|
|
645
|
-
if (!
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
if (_)
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
!b || l.focusCell !== null && b.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: b, override: _ }), t.dispatchCommand(ne, void 0));
|
|
644
|
+
if (!vn(m) && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("mouseup", g), void s.removeEventListener("mousemove", d);
|
|
645
|
+
if (!ae(m.target)) return;
|
|
646
|
+
let _ = null;
|
|
647
|
+
const b = !(lt || a.contains(m.target));
|
|
648
|
+
if (b) _ = ct(a, m.target);
|
|
649
|
+
else for (const y of document.elementsFromPoint(m.clientX, m.clientY)) if (_ = ct(a, y), _) break;
|
|
650
|
+
!_ || l.focusCell !== null && _.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: _, override: b }), t.dispatchCommand(ne, void 0));
|
|
652
651
|
};
|
|
653
652
|
l.isSelecting = !0, s.addEventListener("mouseup", g, l.listenerOptions), s.addEventListener("mousemove", d, l.listenerOptions);
|
|
654
653
|
})();
|
|
@@ -657,14 +656,14 @@ function An(n, e, t, o) {
|
|
|
657
656
|
a.removeEventListener("mousedown", c);
|
|
658
657
|
});
|
|
659
658
|
const f = (i) => {
|
|
660
|
-
i.detail >= 3 &&
|
|
659
|
+
i.detail >= 3 && ae(i.target) && Ne(i.target) !== null && i.preventDefault();
|
|
661
660
|
};
|
|
662
661
|
a.addEventListener("mousedown", f, l.listenerOptions), l.listenersToRemove.add(() => {
|
|
663
662
|
a.removeEventListener("mousedown", f);
|
|
664
663
|
});
|
|
665
664
|
const h = (i) => {
|
|
666
665
|
const u = i.target;
|
|
667
|
-
i.button === 0 &&
|
|
666
|
+
i.button === 0 && ae(u) && t.update(() => {
|
|
668
667
|
const g = L();
|
|
669
668
|
v(g) && g.tableKey === l.tableNodeKey && r.contains(u) && l.$clearHighlight();
|
|
670
669
|
});
|
|
@@ -672,11 +671,11 @@ function An(n, e, t, o) {
|
|
|
672
671
|
s.addEventListener("mousedown", h, l.listenerOptions), l.listenersToRemove.add(() => {
|
|
673
672
|
s.removeEventListener("mousedown", h);
|
|
674
673
|
});
|
|
675
|
-
for (const [i, u] of
|
|
676
|
-
l.listenersToRemove.add(t.registerCommand(
|
|
674
|
+
for (const [i, u] of Rn) l.listenersToRemove.add(t.registerCommand(i, (g) => Kt(t, g, u, n, l), Ae));
|
|
675
|
+
l.listenersToRemove.add(t.registerCommand(qt, (i) => {
|
|
677
676
|
const u = L();
|
|
678
677
|
if (v(u)) {
|
|
679
|
-
const g =
|
|
678
|
+
const g = ce(n, u.focus.getNode());
|
|
680
679
|
if (g !== null) return Y(i), g.selectEnd(), !0;
|
|
681
680
|
}
|
|
682
681
|
return !1;
|
|
@@ -686,16 +685,16 @@ function An(n, e, t, o) {
|
|
|
686
685
|
if (!J(u, n)) return !1;
|
|
687
686
|
if (v(u)) return l.$clearText(), !0;
|
|
688
687
|
if (z(u)) {
|
|
689
|
-
if (!S(
|
|
688
|
+
if (!S(ce(n, u.anchor.getNode()))) return !1;
|
|
690
689
|
const g = u.anchor.getNode(), d = u.focus.getNode(), m = n.isParentOf(g), _ = n.isParentOf(d);
|
|
691
690
|
if (m && !_ || _ && !m) return l.$clearText(), !0;
|
|
692
691
|
const b = N(u.anchor.getNode(), (F) => P(F)), y = b && N(b, (F) => P(F) && S(F.getParent()));
|
|
693
692
|
if (!P(y) || !P(b)) return !1;
|
|
694
|
-
if (i ===
|
|
693
|
+
if (i === bt && y.getPreviousSibling() === null) return !0;
|
|
695
694
|
}
|
|
696
695
|
return !1;
|
|
697
696
|
};
|
|
698
|
-
for (const i of
|
|
697
|
+
for (const i of Kn) l.listenersToRemove.add(t.registerCommand(i, C(i), I));
|
|
699
698
|
const p = (i) => {
|
|
700
699
|
const u = L();
|
|
701
700
|
if (!v(u) && !z(u)) return !1;
|
|
@@ -706,17 +705,17 @@ function An(n, e, t, o) {
|
|
|
706
705
|
}
|
|
707
706
|
return !!J(u, n) && !!v(u) && (i && (i.preventDefault(), i.stopPropagation()), l.$clearText(), !0);
|
|
708
707
|
};
|
|
709
|
-
for (const i of
|
|
710
|
-
return l.listenersToRemove.add(t.registerCommand(
|
|
708
|
+
for (const i of An) l.listenersToRemove.add(t.registerCommand(i, p, I));
|
|
709
|
+
return l.listenersToRemove.add(t.registerCommand(Gt, (i) => {
|
|
711
710
|
const u = L();
|
|
712
711
|
if (u) {
|
|
713
712
|
if (!v(u) && !z(u)) return !1;
|
|
714
|
-
|
|
713
|
+
pn(t, Pt(i, ClipboardEvent) ? i : null, _n(u));
|
|
715
714
|
const g = p(i);
|
|
716
715
|
return z(u) ? (u.removeText(), !0) : g;
|
|
717
716
|
}
|
|
718
717
|
return !1;
|
|
719
|
-
}, I)), l.listenersToRemove.add(t.registerCommand(
|
|
718
|
+
}, I)), l.listenersToRemove.add(t.registerCommand(Zt, (i) => {
|
|
720
719
|
const u = L();
|
|
721
720
|
if (!J(u, n)) return !1;
|
|
722
721
|
if (v(u)) return l.$formatCells(i), !0;
|
|
@@ -725,7 +724,7 @@ function An(n, e, t, o) {
|
|
|
725
724
|
if (!S(g)) return !1;
|
|
726
725
|
}
|
|
727
726
|
return !1;
|
|
728
|
-
}, I)), l.listenersToRemove.add(t.registerCommand(
|
|
727
|
+
}, I)), l.listenersToRemove.add(t.registerCommand(en, (i) => {
|
|
729
728
|
const u = L();
|
|
730
729
|
if (!v(u) || !J(u, n)) return !1;
|
|
731
730
|
const g = u.anchor.getNode(), d = u.focus.getNode();
|
|
@@ -752,7 +751,7 @@ function An(n, e, t, o) {
|
|
|
752
751
|
}
|
|
753
752
|
}
|
|
754
753
|
return !0;
|
|
755
|
-
}, I)), l.listenersToRemove.add(t.registerCommand(
|
|
754
|
+
}, I)), l.listenersToRemove.add(t.registerCommand(tn, (i) => {
|
|
756
755
|
const u = L();
|
|
757
756
|
if (!J(u, n)) return !1;
|
|
758
757
|
if (v(u)) return l.$clearHighlight(), !1;
|
|
@@ -760,16 +759,16 @@ function An(n, e, t, o) {
|
|
|
760
759
|
const g = N(u.anchor.getNode(), (d) => S(d));
|
|
761
760
|
if (!S(g)) return !1;
|
|
762
761
|
if (typeof i == "string") {
|
|
763
|
-
const d =
|
|
764
|
-
if (d) return
|
|
762
|
+
const d = dt(t, u, n);
|
|
763
|
+
if (d) return ht(d, n, [He(i)]), !0;
|
|
765
764
|
}
|
|
766
765
|
}
|
|
767
766
|
return !1;
|
|
768
|
-
}, I)), o && l.listenersToRemove.add(t.registerCommand(
|
|
767
|
+
}, I)), o && l.listenersToRemove.add(t.registerCommand(nn, (i) => {
|
|
769
768
|
const u = L();
|
|
770
769
|
if (!z(u) || !u.isCollapsed() || !J(u, n)) return !1;
|
|
771
|
-
const g =
|
|
772
|
-
return !(g === null || !n.is(
|
|
770
|
+
const g = Se(u.anchor.getNode());
|
|
771
|
+
return !(g === null || !n.is(le(g))) && (Y(i), function(d, m) {
|
|
773
772
|
const _ = m === "next" ? "getNextSibling" : "getPreviousSibling", b = m === "next" ? "getFirstChild" : "getLastChild", y = d[_]();
|
|
774
773
|
if (P(y)) return y.selectEnd();
|
|
775
774
|
const F = N(d, k);
|
|
@@ -781,29 +780,29 @@ function An(n, e, t, o) {
|
|
|
781
780
|
const T = N(F, K);
|
|
782
781
|
T === null && w(248), m === "next" ? T.selectNext() : T.selectPrevious();
|
|
783
782
|
}(g, i.shiftKey ? "previous" : "next"), !0);
|
|
784
|
-
}, I)), l.listenersToRemove.add(t.registerCommand(
|
|
783
|
+
}, I)), l.listenersToRemove.add(t.registerCommand(on, (i) => n.isSelected(), Ae)), l.listenersToRemove.add(t.registerCommand(wt, (i) => {
|
|
785
784
|
const { nodes: u, selection: g } = i, d = g.getStartEndPoints(), m = v(g), _ = z(g) && N(g.anchor.getNode(), (H) => S(H)) !== null && N(g.focus.getNode(), (H) => S(H)) !== null || m;
|
|
786
785
|
if (u.length !== 1 || !K(u[0]) || !_ || d === null) return !1;
|
|
787
786
|
const [b] = d, y = u[0], F = y.getChildren(), T = y.getFirstChildOrThrow().getChildrenSize(), $ = y.getChildrenSize(), E = N(b.getNode(), (H) => S(H)), x = E && N(E, (H) => k(H)), O = x && N(x, (H) => K(H));
|
|
788
787
|
if (!S(E) || !k(x) || !K(O)) return !1;
|
|
789
|
-
const A = x.getIndexWithinParent(), R = Math.min(O.getChildrenSize() - 1, A + $ - 1), M = E.getIndexWithinParent(), B = Math.min(x.getChildrenSize() - 1, M + T - 1),
|
|
788
|
+
const A = x.getIndexWithinParent(), R = Math.min(O.getChildrenSize() - 1, A + $ - 1), M = E.getIndexWithinParent(), B = Math.min(x.getChildrenSize() - 1, M + T - 1), ie = Math.min(M, B), Fe = Math.min(A, R), ve = Math.max(M, B), W = Math.max(A, R), Ot = O.getChildren();
|
|
790
789
|
let Ue = 0;
|
|
791
790
|
for (let H = Fe; H <= W; H++) {
|
|
792
|
-
const je =
|
|
791
|
+
const je = Ot[H];
|
|
793
792
|
if (!k(je)) return !1;
|
|
794
793
|
const Ve = F[Ue];
|
|
795
794
|
if (!k(Ve)) return !1;
|
|
796
|
-
const
|
|
795
|
+
const Et = je.getChildren(), kt = Ve.getChildren();
|
|
797
796
|
let Qe = 0;
|
|
798
|
-
for (let Re =
|
|
799
|
-
const
|
|
800
|
-
if (!S(
|
|
801
|
-
const Ge =
|
|
797
|
+
for (let Re = ie; Re <= ve; Re++) {
|
|
798
|
+
const ge = Et[Re];
|
|
799
|
+
if (!S(ge)) return !1;
|
|
800
|
+
const Ge = kt[Qe];
|
|
802
801
|
if (!S(Ge)) return !1;
|
|
803
|
-
const
|
|
802
|
+
const $t = ge.getChildren();
|
|
804
803
|
Ge.getChildren().forEach((ee) => {
|
|
805
|
-
|
|
806
|
-
}),
|
|
804
|
+
he(ee) && j().append(ee), ge.append(ee);
|
|
805
|
+
}), $t.forEach((ee) => ee.remove()), Qe++;
|
|
807
806
|
}
|
|
808
807
|
Ue++;
|
|
809
808
|
}
|
|
@@ -816,14 +815,14 @@ function An(n, e, t, o) {
|
|
|
816
815
|
if (d !== l.anchorCell && J(i, n)) return l.$setFocusCellForSelection(d), !0;
|
|
817
816
|
}
|
|
818
817
|
if (l.getAndClearShouldCheckSelection() && z(u) && z(i) && i.isCollapsed()) {
|
|
819
|
-
const d = i.anchor.getNode(), m = n.getFirstChild(), _ =
|
|
818
|
+
const d = i.anchor.getNode(), m = n.getFirstChild(), _ = Se(d);
|
|
820
819
|
if (_ !== null && k(m)) {
|
|
821
820
|
const b = m.getFirstChild();
|
|
822
821
|
if (S(b) && n.is(N(_, (y) => y.is(n) || y.is(b)))) return b.selectStart(), !0;
|
|
823
822
|
}
|
|
824
823
|
}
|
|
825
824
|
if (z(i)) {
|
|
826
|
-
const { anchor: d, focus: m } = i, _ = d.getNode(), b = m.getNode(), y =
|
|
825
|
+
const { anchor: d, focus: m } = i, _ = d.getNode(), b = m.getNode(), y = Se(_), F = Se(b), T = !(!y || !n.is(le(y))), $ = !(!F || !n.is(le(F))), E = T !== $, x = T && $, O = i.isBackward();
|
|
827
826
|
if (E) {
|
|
828
827
|
const A = i.clone();
|
|
829
828
|
if ($) {
|
|
@@ -833,14 +832,14 @@ function An(n, e, t, o) {
|
|
|
833
832
|
const [R] = U(n, y, y), M = R[0][0].cell, B = R[R.length - 1].at(-1).cell;
|
|
834
833
|
A.anchor.set(O ? B.getKey() : M.getKey(), O ? B.getChildrenSize() : 0, "element");
|
|
835
834
|
}
|
|
836
|
-
q(A),
|
|
837
|
-
} else x && (y.is(F) || (l.$setAnchorCellForSelection(
|
|
835
|
+
q(A), ut(t, l);
|
|
836
|
+
} else x && (y.is(F) || (l.$setAnchorCellForSelection(ue(l, y)), l.$setFocusCellForSelection(ue(l, F), !0)));
|
|
838
837
|
} else if (i && v(i) && i.is(u) && i.tableKey === n.getKey()) {
|
|
839
838
|
const d = xe(s);
|
|
840
839
|
if (d && d.anchorNode && d.focusNode) {
|
|
841
840
|
const m = V(d.focusNode), _ = m && !n.isParentOf(m), b = V(d.anchorNode), y = b && n.isParentOf(b);
|
|
842
841
|
if (_ && y && d.rangeCount > 0) {
|
|
843
|
-
const F =
|
|
842
|
+
const F = rn(d, t);
|
|
844
843
|
F && (F.anchor.set(n.getKey(), i.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), q(F));
|
|
845
844
|
}
|
|
846
845
|
}
|
|
@@ -848,20 +847,20 @@ function An(n, e, t, o) {
|
|
|
848
847
|
return i && !i.is(u) && (v(i) || v(u)) && l.tableSelection && !l.tableSelection.is(u) ? (v(i) && i.tableKey === l.tableNodeKey ? l.$updateTableTableSelection(i) : !v(i) && v(u) && u.tableKey === l.tableNodeKey && l.$updateTableTableSelection(null), !1) : (l.hasHijackedSelectionStyles && !n.isSelected() ? function(d, m) {
|
|
849
848
|
m.$enableHighlightStyle(), Ye(m.table, (_) => {
|
|
850
849
|
const b = _.elem;
|
|
851
|
-
_.highlighted = !1,
|
|
850
|
+
_.highlighted = !1, Rt(d, _), b.getAttribute("style") || b.removeAttribute("style");
|
|
852
851
|
});
|
|
853
|
-
}(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() &&
|
|
854
|
-
}, I)), l.listenersToRemove.add(t.registerCommand(
|
|
852
|
+
}(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && ut(t, l), !1);
|
|
853
|
+
}, I)), l.listenersToRemove.add(t.registerCommand(yt, () => {
|
|
855
854
|
const i = L();
|
|
856
855
|
if (!z(i) || !i.isCollapsed() || !J(i, n)) return !1;
|
|
857
|
-
const u =
|
|
858
|
-
return !!u && (
|
|
856
|
+
const u = dt(t, i, n);
|
|
857
|
+
return !!u && (ht(u, n), !0);
|
|
859
858
|
}, I)), l;
|
|
860
859
|
}
|
|
861
|
-
function
|
|
860
|
+
function at(n) {
|
|
862
861
|
return n[Me] || null;
|
|
863
862
|
}
|
|
864
|
-
function
|
|
863
|
+
function Ne(n) {
|
|
865
864
|
let e = n;
|
|
866
865
|
for (; e != null; ) {
|
|
867
866
|
const t = e.nodeName;
|
|
@@ -873,7 +872,17 @@ function re(n) {
|
|
|
873
872
|
}
|
|
874
873
|
return null;
|
|
875
874
|
}
|
|
876
|
-
function
|
|
875
|
+
function ct(n, e) {
|
|
876
|
+
if (!n.contains(e)) return null;
|
|
877
|
+
let t = null;
|
|
878
|
+
for (let o = e; o != null; o = o.parentNode) {
|
|
879
|
+
if (o === n) return t;
|
|
880
|
+
const r = o.nodeName;
|
|
881
|
+
r !== "TD" && r !== "TH" || (t = o._cell || null);
|
|
882
|
+
}
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
function re(n, e) {
|
|
877
886
|
const t = [], o = { columns: 0, domRows: t, rows: 0 };
|
|
878
887
|
let r = Q(n, e).querySelector("tr"), s = 0, l = 0;
|
|
879
888
|
for (t.length = 0; r != null; ) {
|
|
@@ -904,11 +913,11 @@ function le(n, e) {
|
|
|
904
913
|
}
|
|
905
914
|
return o.columns = s + 1, o.rows = l + 1, o;
|
|
906
915
|
}
|
|
907
|
-
function
|
|
916
|
+
function Ce(n, e, t) {
|
|
908
917
|
const o = new Set(t ? t.getNodes() : []);
|
|
909
918
|
Ye(e, (r, s) => {
|
|
910
919
|
const l = r.elem;
|
|
911
|
-
o.has(s) ? (r.highlighted = !0,
|
|
920
|
+
o.has(s) ? (r.highlighted = !0, vt(n, r)) : (r.highlighted = !1, Rt(n, r), l.getAttribute("style") || l.removeAttribute("style"));
|
|
912
921
|
});
|
|
913
922
|
}
|
|
914
923
|
function Ye(n, e) {
|
|
@@ -923,21 +932,21 @@ function Ye(n, e) {
|
|
|
923
932
|
}
|
|
924
933
|
}
|
|
925
934
|
}
|
|
926
|
-
function
|
|
935
|
+
function ut(n, e) {
|
|
927
936
|
e.$disableHighlightStyle(), Ye(e.table, (t) => {
|
|
928
|
-
t.highlighted = !0,
|
|
937
|
+
t.highlighted = !0, vt(n, t);
|
|
929
938
|
});
|
|
930
939
|
}
|
|
931
|
-
const
|
|
940
|
+
const En = (n, e, t, o, r) => {
|
|
932
941
|
const s = r === "forward";
|
|
933
942
|
switch (r) {
|
|
934
943
|
case "backward":
|
|
935
944
|
case "forward":
|
|
936
|
-
return t !== (s ? n.table.columns - 1 : 0) ?
|
|
945
|
+
return t !== (s ? n.table.columns - 1 : 0) ? _e(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? _e(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
|
|
937
946
|
case "up":
|
|
938
|
-
return o !== 0 ?
|
|
947
|
+
return o !== 0 ? _e(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
|
|
939
948
|
case "down":
|
|
940
|
-
return o !== n.table.rows - 1 ?
|
|
949
|
+
return o !== n.table.rows - 1 ? _e(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
|
|
941
950
|
default:
|
|
942
951
|
return !1;
|
|
943
952
|
}
|
|
@@ -956,7 +965,7 @@ function Oe(n, e) {
|
|
|
956
965
|
}
|
|
957
966
|
return [t, o];
|
|
958
967
|
}
|
|
959
|
-
function
|
|
968
|
+
function pe([n, e]) {
|
|
960
969
|
return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
|
|
961
970
|
}
|
|
962
971
|
function te(n, e, [t, o]) {
|
|
@@ -965,18 +974,18 @@ function te(n, e, [t, o]) {
|
|
|
965
974
|
const l = e[t], a = s[l];
|
|
966
975
|
return a === void 0 && w(250, t, String(l)), a;
|
|
967
976
|
}
|
|
968
|
-
function
|
|
977
|
+
function kn(n, e, t, o, r) {
|
|
969
978
|
const s = $e(e, t, o), l = function(T, $) {
|
|
970
979
|
const { minColumn: E, maxColumn: x, minRow: O, maxRow: A } = $;
|
|
971
|
-
let R = 1, M = 1, B = 1,
|
|
980
|
+
let R = 1, M = 1, B = 1, ie = 1;
|
|
972
981
|
const Fe = T[O], ve = T[A];
|
|
973
|
-
for (let W = E; W <= x; W++) R = Math.max(R, Fe[W].cell.__rowSpan),
|
|
982
|
+
for (let W = E; W <= x; W++) R = Math.max(R, Fe[W].cell.__rowSpan), ie = Math.max(ie, ve[W].cell.__rowSpan);
|
|
974
983
|
for (let W = O; W <= A; W++) M = Math.max(M, T[W][E].cell.__colSpan), B = Math.max(B, T[W][x].cell.__colSpan);
|
|
975
|
-
return { bottomSpan:
|
|
984
|
+
return { bottomSpan: ie, leftSpan: M, rightSpan: B, topSpan: R };
|
|
976
985
|
}(e, s), { topSpan: a, leftSpan: c, bottomSpan: f, rightSpan: h } = l, C = function(T, $) {
|
|
977
986
|
const E = Oe(T, $);
|
|
978
987
|
return E === null && w(249, $.cell.getKey()), E;
|
|
979
|
-
}(s, t), [p, i] =
|
|
988
|
+
}(s, t), [p, i] = pe(C);
|
|
980
989
|
let u = s[p], g = s[i];
|
|
981
990
|
r === "forward" ? u += p === "maxColumn" ? 1 : c : r === "backward" ? u -= p === "minColumn" ? 1 : h : r === "down" ? g += i === "maxRow" ? 1 : a : r === "up" && (g -= i === "minRow" ? 1 : f);
|
|
982
991
|
const d = e[g];
|
|
@@ -985,12 +994,12 @@ function En(n, e, t, o, r) {
|
|
|
985
994
|
if (m === void 0) return !1;
|
|
986
995
|
const [_, b] = function(T, $, E) {
|
|
987
996
|
const x = $e(T, $, E), O = Oe(x, $);
|
|
988
|
-
if (O) return [te(T, x, O), te(T, x,
|
|
997
|
+
if (O) return [te(T, x, O), te(T, x, pe(O))];
|
|
989
998
|
const A = Oe(x, E);
|
|
990
|
-
if (A) return [te(T, x,
|
|
999
|
+
if (A) return [te(T, x, pe(A)), te(T, x, A)];
|
|
991
1000
|
const R = ["minColumn", "minRow"];
|
|
992
|
-
return [te(T, x, R), te(T, x,
|
|
993
|
-
}(e, t, m), y =
|
|
1001
|
+
return [te(T, x, R), te(T, x, pe(R))];
|
|
1002
|
+
}(e, t, m), y = ue(n, _.cell), F = ue(n, b.cell);
|
|
994
1003
|
return n.$setAnchorCellForSelection(y), n.$setFocusCellForSelection(F, !0), !0;
|
|
995
1004
|
}
|
|
996
1005
|
function J(n, e) {
|
|
@@ -1000,33 +1009,33 @@ function J(n, e) {
|
|
|
1000
1009
|
}
|
|
1001
1010
|
return !1;
|
|
1002
1011
|
}
|
|
1003
|
-
function
|
|
1012
|
+
function _e(n, e) {
|
|
1004
1013
|
e ? n.selectStart() : n.selectEnd();
|
|
1005
1014
|
}
|
|
1006
|
-
function
|
|
1015
|
+
function vt(n, e) {
|
|
1007
1016
|
const t = e.elem, o = n._config.theme;
|
|
1008
1017
|
S(V(t)) || w(131), X(t, o.tableCellSelected);
|
|
1009
1018
|
}
|
|
1010
|
-
function
|
|
1019
|
+
function Rt(n, e) {
|
|
1011
1020
|
const t = e.elem;
|
|
1012
1021
|
S(V(t)) || w(131);
|
|
1013
1022
|
const o = n._config.theme;
|
|
1014
|
-
|
|
1023
|
+
se(t, o.tableCellSelected);
|
|
1015
1024
|
}
|
|
1016
|
-
function
|
|
1025
|
+
function Se(n) {
|
|
1017
1026
|
const e = N(n, S);
|
|
1018
1027
|
return S(e) ? e : null;
|
|
1019
1028
|
}
|
|
1020
|
-
function
|
|
1029
|
+
function le(n) {
|
|
1021
1030
|
const e = N(n, K);
|
|
1022
1031
|
return K(e) ? e : null;
|
|
1023
1032
|
}
|
|
1024
|
-
function
|
|
1025
|
-
const a =
|
|
1026
|
-
if (
|
|
1033
|
+
function $n(n, e, t, o, r, s, l) {
|
|
1034
|
+
const a = cn(t.focus, r ? "previous" : "next");
|
|
1035
|
+
if (un(a)) return !1;
|
|
1027
1036
|
let c = a;
|
|
1028
1037
|
for (const d of et(a).iterNodeCarets("shadowRoot")) {
|
|
1029
|
-
if (!
|
|
1038
|
+
if (!hn(d) || !P(d.origin)) return !1;
|
|
1030
1039
|
c = d;
|
|
1031
1040
|
}
|
|
1032
1041
|
const f = c.getParentAtCaret();
|
|
@@ -1035,34 +1044,34 @@ function kn(n, e, t, o, r, s, l) {
|
|
|
1035
1044
|
for (const m of et(d).iterNodeCarets("root")) {
|
|
1036
1045
|
const { origin: _ } = m;
|
|
1037
1046
|
if (S(_)) {
|
|
1038
|
-
if (tt(m)) return
|
|
1047
|
+
if (tt(m)) return dn(_, d.direction);
|
|
1039
1048
|
} else if (!k(_)) break;
|
|
1040
1049
|
}
|
|
1041
1050
|
return null;
|
|
1042
1051
|
}(nt(h, c.direction)), p = N(h, K);
|
|
1043
1052
|
if (!p || !p.is(s)) return !1;
|
|
1044
|
-
const i = n.getElementByKey(h.getKey()), u =
|
|
1053
|
+
const i = n.getElementByKey(h.getKey()), u = Ne(i);
|
|
1045
1054
|
if (!i || !u) return !1;
|
|
1046
|
-
const g =
|
|
1055
|
+
const g = Mn(n, p);
|
|
1047
1056
|
if (l.table = g, C) if (o === "extend") {
|
|
1048
|
-
const d =
|
|
1057
|
+
const d = Ne(n.getElementByKey(C.origin.getKey()));
|
|
1049
1058
|
if (!d) return !1;
|
|
1050
1059
|
l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(d, !0);
|
|
1051
1060
|
} else {
|
|
1052
1061
|
const d = ot(C);
|
|
1053
|
-
|
|
1062
|
+
me(t.anchor, d), me(t.focus, d);
|
|
1054
1063
|
}
|
|
1055
1064
|
else if (o === "extend") l.$setAnchorCellForSelection(u), l.$setFocusCellForSelection(u, !0);
|
|
1056
1065
|
else {
|
|
1057
1066
|
const d = function(m) {
|
|
1058
|
-
const _ =
|
|
1067
|
+
const _ = fn(m);
|
|
1059
1068
|
return tt(_) ? ot(_) : m;
|
|
1060
1069
|
}(nt(p, a.direction));
|
|
1061
|
-
|
|
1070
|
+
me(t.anchor, d), me(t.focus, d);
|
|
1062
1071
|
}
|
|
1063
1072
|
return Y(e), !0;
|
|
1064
1073
|
}
|
|
1065
|
-
function
|
|
1074
|
+
function Kt(n, e, t, o, r) {
|
|
1066
1075
|
if ((t === "up" || t === "down") && function(l) {
|
|
1067
1076
|
const a = l.getRootElement();
|
|
1068
1077
|
return a ? a.hasAttribute("aria-controls") && a.getAttribute("aria-controls") === "typeahead-menu" : !1;
|
|
@@ -1093,13 +1102,13 @@ function vt(n, e, t, o, r) {
|
|
|
1093
1102
|
let f = 0;
|
|
1094
1103
|
t === "up" && P(c) && (f = c.getChildrenSize());
|
|
1095
1104
|
let h = c;
|
|
1096
|
-
t === "up" && P(c) && (h = c.getLastChild() || c, f =
|
|
1105
|
+
t === "up" && P(c) && (h = c.getLastChild() || c, f = he(h) ? h.getTextContentSize() : 0);
|
|
1097
1106
|
const C = s.clone();
|
|
1098
|
-
return C.focus.set(h.getKey(), f,
|
|
1107
|
+
return C.focus.set(h.getKey(), f, he(h) ? "text" : "element"), q(C), Y(e), !0;
|
|
1099
1108
|
}
|
|
1100
|
-
if (
|
|
1109
|
+
if (an(l)) {
|
|
1101
1110
|
const a = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
|
|
1102
|
-
if (a &&
|
|
1111
|
+
if (a && ce(o, a) !== null) {
|
|
1103
1112
|
const c = o.getFirstDescendant(), f = o.getLastDescendant();
|
|
1104
1113
|
if (!c || !f) return !1;
|
|
1105
1114
|
const [h] = oe(c), [C] = oe(f), p = o.getCordsFromCellNode(h, r.table), i = o.getCordsFromCellNode(C, r.table), u = o.getDOMCellFromCordsOrThrow(p.x, p.y, r.table), g = o.getDOMCellFromCordsOrThrow(i.x, i.y, r.table);
|
|
@@ -1120,18 +1129,18 @@ function vt(n, e, t, o, r) {
|
|
|
1120
1129
|
}
|
|
1121
1130
|
}
|
|
1122
1131
|
}
|
|
1123
|
-
return t === "down" &&
|
|
1132
|
+
return t === "down" && At(n) && r.setShouldCheckSelection(), !1;
|
|
1124
1133
|
}
|
|
1125
1134
|
if (z(s)) {
|
|
1126
1135
|
if (t === "backward" || t === "forward")
|
|
1127
|
-
return
|
|
1136
|
+
return $n(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
|
|
1128
1137
|
if (s.isCollapsed()) {
|
|
1129
1138
|
const { anchor: l, focus: a } = s, c = N(l.getNode(), S), f = N(a.getNode(), S);
|
|
1130
1139
|
if (!S(c) || !c.is(f)) return !1;
|
|
1131
|
-
const h =
|
|
1140
|
+
const h = le(c);
|
|
1132
1141
|
if (h !== o && h != null) {
|
|
1133
1142
|
const m = Q(h, n.getElementByKey(h.getKey()));
|
|
1134
|
-
if (m != null) return r.table =
|
|
1143
|
+
if (m != null) return r.table = re(h, m), Kt(n, e, t, h, r);
|
|
1135
1144
|
}
|
|
1136
1145
|
const C = n.getElementByKey(c.__key), p = n.getElementByKey(l.key);
|
|
1137
1146
|
if (p == null || C == null) return !1;
|
|
@@ -1150,7 +1159,7 @@ function vt(n, e, t, o, r) {
|
|
|
1150
1159
|
if (t === "up" ? d.top > i.top - i.height : i.bottom + i.height > d.bottom) {
|
|
1151
1160
|
Y(e);
|
|
1152
1161
|
const m = o.getCordsFromCellNode(c, r.table);
|
|
1153
|
-
if (!e.shiftKey) return
|
|
1162
|
+
if (!e.shiftKey) return En(r, o, m.x, m.y, t);
|
|
1154
1163
|
{
|
|
1155
1164
|
const _ = o.getDOMCellFromCordsOrThrow(m.x, m.y, r.table);
|
|
1156
1165
|
r.$setAnchorCellForSelection(_), r.$setFocusCellForSelection(_, !0);
|
|
@@ -1164,10 +1173,10 @@ function vt(n, e, t, o, r) {
|
|
|
1164
1173
|
const C = Q(h, n.getElementByKey(h.getKey()));
|
|
1165
1174
|
if (!S(c) || !S(f) || !K(h) || C == null) return !1;
|
|
1166
1175
|
r.$updateTableTableSelection(s);
|
|
1167
|
-
const p =
|
|
1176
|
+
const p = re(h, C), i = o.getCordsFromCellNode(c, p), u = o.getDOMCellFromCordsOrThrow(i.x, i.y, p);
|
|
1168
1177
|
if (r.$setAnchorCellForSelection(u), Y(e), e.shiftKey) {
|
|
1169
1178
|
const [g, d, m] = U(o, c, f);
|
|
1170
|
-
return
|
|
1179
|
+
return kn(r, g, d, m, t);
|
|
1171
1180
|
}
|
|
1172
1181
|
return f.selectEnd(), !0;
|
|
1173
1182
|
}
|
|
@@ -1176,11 +1185,11 @@ function vt(n, e, t, o, r) {
|
|
|
1176
1185
|
function Y(n) {
|
|
1177
1186
|
n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
|
|
1178
1187
|
}
|
|
1179
|
-
function
|
|
1188
|
+
function ht(n, e, t) {
|
|
1180
1189
|
const o = j();
|
|
1181
1190
|
n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
|
|
1182
1191
|
}
|
|
1183
|
-
function
|
|
1192
|
+
function dt(n, e, t) {
|
|
1184
1193
|
const o = t.getParent();
|
|
1185
1194
|
if (!o) return;
|
|
1186
1195
|
const r = xe(Xe(n));
|
|
@@ -1194,14 +1203,14 @@ function ut(n, e, t) {
|
|
|
1194
1203
|
const [h, C] = U(t, c, c), p = h[0][0], i = h[h.length - 1][h[0].length - 1], { startRow: u, startColumn: g } = C, d = u === p.startRow && g === p.startColumn, m = u === i.startRow && g === i.startColumn;
|
|
1195
1204
|
return d ? "first" : m ? "last" : void 0;
|
|
1196
1205
|
}
|
|
1197
|
-
function
|
|
1206
|
+
function ue(n, e) {
|
|
1198
1207
|
const { tableNode: t } = n.$lookup(), o = t.getCordsFromCellNode(e, n.table);
|
|
1199
1208
|
return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
|
|
1200
1209
|
}
|
|
1201
1210
|
function ze(n, e, t) {
|
|
1202
|
-
return
|
|
1211
|
+
return ce(n, V(e, t));
|
|
1203
1212
|
}
|
|
1204
|
-
function
|
|
1213
|
+
function ft(n, e, t, o) {
|
|
1205
1214
|
const r = n.querySelector("colgroup");
|
|
1206
1215
|
if (!r) return;
|
|
1207
1216
|
const s = [];
|
|
@@ -1211,14 +1220,14 @@ function ht(n, e, t, o) {
|
|
|
1211
1220
|
}
|
|
1212
1221
|
r.replaceChildren(...s);
|
|
1213
1222
|
}
|
|
1214
|
-
function
|
|
1215
|
-
t ? (X(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (
|
|
1223
|
+
function gt(n, e, t) {
|
|
1224
|
+
t ? (X(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (se(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
|
|
1216
1225
|
}
|
|
1217
|
-
function
|
|
1218
|
-
t > 0 ? (X(n, e.theme.tableFrozenColumn), n.setAttribute("data-lexical-frozen-column", "true")) : (
|
|
1226
|
+
function mt(n, e, t) {
|
|
1227
|
+
t > 0 ? (X(n, e.theme.tableFrozenColumn), n.setAttribute("data-lexical-frozen-column", "true")) : (se(n, e.theme.tableFrozenColumn), n.removeAttribute("data-lexical-frozen-column"));
|
|
1219
1228
|
}
|
|
1220
|
-
function
|
|
1221
|
-
t > 0 ? (X(n, e.theme.tableFrozenRow), n.setAttribute("data-lexical-frozen-row", "true")) : (
|
|
1229
|
+
function Ct(n, e, t) {
|
|
1230
|
+
t > 0 ? (X(n, e.theme.tableFrozenRow), n.setAttribute("data-lexical-frozen-row", "true")) : (se(n, e.theme.tableFrozenRow), n.removeAttribute("data-lexical-frozen-row"));
|
|
1222
1231
|
}
|
|
1223
1232
|
function Ee(n, e, t) {
|
|
1224
1233
|
if (!e.theme.tableAlignment) return;
|
|
@@ -1227,13 +1236,13 @@ function Ee(n, e, t) {
|
|
|
1227
1236
|
const l = e.theme.tableAlignment[s];
|
|
1228
1237
|
l && (s === t ? r : o).push(l);
|
|
1229
1238
|
}
|
|
1230
|
-
|
|
1239
|
+
se(n, ...o), X(n, ...r);
|
|
1231
1240
|
}
|
|
1232
1241
|
const Le = /* @__PURE__ */ new WeakSet();
|
|
1233
|
-
function
|
|
1242
|
+
function At(n = St()) {
|
|
1234
1243
|
return Le.has(n);
|
|
1235
1244
|
}
|
|
1236
|
-
function
|
|
1245
|
+
function jn(n, e) {
|
|
1237
1246
|
e ? Le.add(n) : Le.delete(n);
|
|
1238
1247
|
}
|
|
1239
1248
|
class G extends Pe {
|
|
@@ -1254,7 +1263,7 @@ class G extends Pe {
|
|
|
1254
1263
|
super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
|
|
1255
1264
|
}
|
|
1256
1265
|
static importDOM() {
|
|
1257
|
-
return { table: (e) => ({ conversion:
|
|
1266
|
+
return { table: (e) => ({ conversion: zn, priority: 1 }) };
|
|
1258
1267
|
}
|
|
1259
1268
|
static importJSON(e) {
|
|
1260
1269
|
return qe().updateFromJSON(e);
|
|
@@ -1279,21 +1288,21 @@ class G extends Pe {
|
|
|
1279
1288
|
const o = document.createElement("table");
|
|
1280
1289
|
this.__style && (o.style.cssText = this.__style);
|
|
1281
1290
|
const r = document.createElement("colgroup");
|
|
1282
|
-
if (o.appendChild(r),
|
|
1291
|
+
if (o.appendChild(r), ft(o, 0, this.getColumnCount(), this.getColWidths()), Ht(r), X(o, e.theme.table), Ee(o, e, this.getFormatType()), this.__frozenColumnCount && mt(o, e, this.__frozenColumnCount), this.__frozenRowCount && Ct(o, e, this.__frozenRowCount), this.__rowStriping && gt(o, e, !0), At(t)) {
|
|
1283
1292
|
const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
|
|
1284
1293
|
return l ? X(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), s;
|
|
1285
1294
|
}
|
|
1286
1295
|
return o;
|
|
1287
1296
|
}
|
|
1288
1297
|
updateDOM(e, t, o) {
|
|
1289
|
-
e.__rowStriping !== this.__rowStriping &&
|
|
1298
|
+
e.__rowStriping !== this.__rowStriping && gt(t, o, this.__rowStriping), e.__frozenColumnCount !== this.__frozenColumnCount && mt(t, o, this.__frozenColumnCount), e.__frozenRowCount !== this.__frozenRowCount && Ct(t, o, this.__frozenRowCount), ft(t, 0, this.getColumnCount(), this.getColWidths());
|
|
1290
1299
|
const r = this.getDOMSlot(t).element;
|
|
1291
1300
|
return e.__style !== this.__style && (r.style.cssText = this.__style), Ee(r, o, this.getFormatType()), !1;
|
|
1292
1301
|
}
|
|
1293
1302
|
exportDOM(e) {
|
|
1294
1303
|
const t = super.exportDOM(e), { element: o } = t;
|
|
1295
1304
|
return { after: (r) => {
|
|
1296
|
-
if (t.after && (r = t.after(r), this.__format && Ee(r, e._config, this.getFormatType())),
|
|
1305
|
+
if (t.after && (r = t.after(r), this.__format && Ee(r, e._config, this.getFormatType())), we(r) && r.nodeName !== "TABLE" && (r = r.querySelector("table")), !we(r)) return null;
|
|
1297
1306
|
const [s] = Je(this, null, null), l = /* @__PURE__ */ new Map();
|
|
1298
1307
|
for (const h of s) for (const C of h) {
|
|
1299
1308
|
const p = C.cell.getKey();
|
|
@@ -1322,7 +1331,7 @@ class G extends Pe {
|
|
|
1322
1331
|
r.append(h);
|
|
1323
1332
|
}
|
|
1324
1333
|
return r;
|
|
1325
|
-
}, element:
|
|
1334
|
+
}, element: we(o) && o.nodeName !== "TABLE" ? o.querySelector("table") : o };
|
|
1326
1335
|
}
|
|
1327
1336
|
canBeEmpty() {
|
|
1328
1337
|
return !1;
|
|
@@ -1401,11 +1410,11 @@ class G extends Pe {
|
|
|
1401
1410
|
}), t;
|
|
1402
1411
|
}
|
|
1403
1412
|
}
|
|
1404
|
-
function
|
|
1413
|
+
function Mn(n, e) {
|
|
1405
1414
|
const t = n.getElementByKey(e.getKey());
|
|
1406
|
-
return t === null && w(230),
|
|
1415
|
+
return t === null && w(230), re(e, t);
|
|
1407
1416
|
}
|
|
1408
|
-
function
|
|
1417
|
+
function zn(n) {
|
|
1409
1418
|
const e = qe();
|
|
1410
1419
|
n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
|
|
1411
1420
|
const t = n.querySelector(":scope > colgroup");
|
|
@@ -1421,7 +1430,7 @@ function Mn(n) {
|
|
|
1421
1430
|
}
|
|
1422
1431
|
o && e.setColWidths(o);
|
|
1423
1432
|
}
|
|
1424
|
-
return { after: (o) =>
|
|
1433
|
+
return { after: (o) => pt(o, k), node: e };
|
|
1425
1434
|
}
|
|
1426
1435
|
function qe() {
|
|
1427
1436
|
return Be(new G());
|
|
@@ -1429,22 +1438,22 @@ function qe() {
|
|
|
1429
1438
|
function K(n) {
|
|
1430
1439
|
return n instanceof G;
|
|
1431
1440
|
}
|
|
1432
|
-
function
|
|
1441
|
+
function Ln({ rows: n, columns: e, includeHeaders: t }) {
|
|
1433
1442
|
const o = L();
|
|
1434
|
-
if (!o || !z(o) ||
|
|
1435
|
-
const r =
|
|
1436
|
-
|
|
1443
|
+
if (!o || !z(o) || le(o.anchor.getNode())) return !1;
|
|
1444
|
+
const r = yn(Number(n), Number(e), t);
|
|
1445
|
+
Lt(r);
|
|
1437
1446
|
const s = r.getFirstDescendant();
|
|
1438
|
-
return
|
|
1439
|
-
}
|
|
1440
|
-
function Ln(n) {
|
|
1441
|
-
k(n.getParent()) ? n.isEmpty() && n.append(j()) : n.remove();
|
|
1447
|
+
return he(s) && s.select(), !0;
|
|
1442
1448
|
}
|
|
1443
1449
|
function Pn(n) {
|
|
1444
|
-
|
|
1450
|
+
k(n.getParent()) ? n.isEmpty() && n.append(j()) : n.remove();
|
|
1445
1451
|
}
|
|
1446
1452
|
function Bn(n) {
|
|
1447
|
-
|
|
1453
|
+
K(n.getParent()) ? _t(n, S) : n.remove();
|
|
1454
|
+
}
|
|
1455
|
+
function Hn(n) {
|
|
1456
|
+
_t(n, k);
|
|
1448
1457
|
const [e] = Je(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
|
|
1449
1458
|
for (let r = 0; r < e.length; ++r) {
|
|
1450
1459
|
const s = o[r];
|
|
@@ -1452,19 +1461,19 @@ function Bn(n) {
|
|
|
1452
1461
|
k(s) || w(254, s.constructor.name, s.getType());
|
|
1453
1462
|
const l = e[r].reduce((a, c) => c ? 1 + a : a, 0);
|
|
1454
1463
|
if (l !== t) for (let a = l; a < t; ++a) {
|
|
1455
|
-
const c =
|
|
1464
|
+
const c = de();
|
|
1456
1465
|
c.append(j()), s.append(c);
|
|
1457
1466
|
}
|
|
1458
1467
|
}
|
|
1459
1468
|
}
|
|
1460
|
-
function
|
|
1461
|
-
if (n.detail < 3 || !
|
|
1469
|
+
function Wn(n) {
|
|
1470
|
+
if (n.detail < 3 || !ae(n.target)) return !1;
|
|
1462
1471
|
const e = V(n.target);
|
|
1463
1472
|
if (e === null) return !1;
|
|
1464
1473
|
const t = N(e, (o) => P(o) && !o.isInline());
|
|
1465
1474
|
return t === null ? !1 : !!S(t.getParent()) && (t.select(0), !0);
|
|
1466
1475
|
}
|
|
1467
|
-
function
|
|
1476
|
+
function Vn(n) {
|
|
1468
1477
|
return n.registerNodeTransform(Z, (e) => {
|
|
1469
1478
|
if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
|
|
1470
1479
|
const [, , t] = oe(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
|
|
@@ -1479,8 +1488,8 @@ function jn(n) {
|
|
|
1479
1488
|
if (C.startRow === c && C.startColumn === h) f = p, a.push(p);
|
|
1480
1489
|
else if (p.getColSpan() > 1 || p.getRowSpan() > 1) {
|
|
1481
1490
|
S(p) || w(176);
|
|
1482
|
-
const i =
|
|
1483
|
-
f !== null ? f.insertAfter(i) :
|
|
1491
|
+
const i = de(p.__headerState);
|
|
1492
|
+
f !== null ? f.insertAfter(i) : zt(l, i);
|
|
1484
1493
|
}
|
|
1485
1494
|
}
|
|
1486
1495
|
}
|
|
@@ -1488,16 +1497,16 @@ function jn(n) {
|
|
|
1488
1497
|
}
|
|
1489
1498
|
});
|
|
1490
1499
|
}
|
|
1491
|
-
function
|
|
1500
|
+
function Qn(n, e = !0) {
|
|
1492
1501
|
const t = /* @__PURE__ */ new Map(), o = (s, l, a) => {
|
|
1493
|
-
const c = Q(s, a), f =
|
|
1502
|
+
const c = Q(s, a), f = On(s, c, n, e);
|
|
1494
1503
|
t.set(l, [f, c]);
|
|
1495
1504
|
}, r = n.registerMutationListener(G, (s) => {
|
|
1496
1505
|
n.getEditorState().read(() => {
|
|
1497
1506
|
for (const [l, a] of s) {
|
|
1498
1507
|
const c = t.get(l);
|
|
1499
1508
|
if (a === "created" || a === "updated") {
|
|
1500
|
-
const { tableNode: f, tableElement: h } =
|
|
1509
|
+
const { tableNode: f, tableElement: h } = Ft(l);
|
|
1501
1510
|
c === void 0 ? o(f, l, h) : h !== c[1] && (c[0].removeListeners(), t.delete(l), o(f, l, h));
|
|
1502
1511
|
} else a === "destroyed" && c !== void 0 && (c[0].removeListeners(), t.delete(l));
|
|
1503
1512
|
}
|
|
@@ -1508,26 +1517,26 @@ function Vn(n, e = !0) {
|
|
|
1508
1517
|
for (const [, [s]] of t) s.removeListeners();
|
|
1509
1518
|
};
|
|
1510
1519
|
}
|
|
1511
|
-
function
|
|
1512
|
-
return n.hasNodes([G]) || w(255),
|
|
1520
|
+
function Gn(n) {
|
|
1521
|
+
return n.hasNodes([G]) || w(255), Mt(n.registerCommand(Sn, Ln, Ke), n.registerCommand(wt, ({ nodes: e, selection: t }) => z(t) ? le(t.anchor.getNode()) !== null && e.some(K) : !1, Ke), n.registerCommand(Wt, Wn, Ke), n.registerNodeTransform(G, Hn), n.registerNodeTransform(fe, Bn), n.registerNodeTransform(Z, Pn));
|
|
1513
1522
|
}
|
|
1514
1523
|
export {
|
|
1515
|
-
|
|
1524
|
+
yn as $,
|
|
1516
1525
|
De as A,
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
Un as Z,
|
|
1526
|
+
qn as B,
|
|
1527
|
+
fe as F,
|
|
1528
|
+
Yn as H,
|
|
1529
|
+
Xn as L,
|
|
1530
|
+
Nn as W,
|
|
1531
|
+
Un as X,
|
|
1524
1532
|
Z as b,
|
|
1525
1533
|
Vn as d,
|
|
1526
|
-
|
|
1534
|
+
jn as e,
|
|
1527
1535
|
Qn as f,
|
|
1528
|
-
|
|
1536
|
+
Gn as g,
|
|
1537
|
+
G as t,
|
|
1529
1538
|
S as v,
|
|
1530
|
-
|
|
1531
|
-
|
|
1539
|
+
de as x,
|
|
1540
|
+
xt as z
|
|
1532
1541
|
};
|
|
1533
|
-
//# sourceMappingURL=LexicalTable.prod-
|
|
1542
|
+
//# sourceMappingURL=LexicalTable.prod-Bb6g8CAC.js.map
|