@uva-glass/component-library 3.52.4 → 3.52.6
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-BAE-wnll.js → Lexical.prod-sd_e2sqT.js} +648 -627
- package/dist/Lexical.prod-sd_e2sqT.js.map +1 -0
- package/dist/{LexicalClipboard.prod-BS4qAkmJ.js → LexicalClipboard.prod-Co2PF1UJ.js} +44 -42
- package/dist/LexicalClipboard.prod-Co2PF1UJ.js.map +1 -0
- package/dist/{LexicalLink.prod-C6Or2Yo6.js → LexicalLink.prod-BCE6Bg2N.js} +354 -334
- package/dist/LexicalLink.prod-BCE6Bg2N.js.map +1 -0
- package/dist/{LexicalList.prod-rTq41CO0.js → LexicalList.prod-CIB0K0ja.js} +141 -138
- package/dist/LexicalList.prod-CIB0K0ja.js.map +1 -0
- package/dist/{LexicalSelection.prod-fLzEGOT_.js → LexicalSelection.prod-CCmcTP6S.js} +41 -41
- package/dist/{LexicalSelection.prod-fLzEGOT_.js.map → LexicalSelection.prod-CCmcTP6S.js.map} +1 -1
- package/dist/{LexicalTable.prod-BBI7yaOy.js → LexicalTable.prod-Oa2YPHLl.js} +359 -359
- package/dist/LexicalTable.prod-Oa2YPHLl.js.map +1 -0
- package/dist/{LexicalUtils.prod-D8DAKg7O.js → LexicalUtils.prod-CjKjgnmx.js} +43 -43
- package/dist/{LexicalUtils.prod-D8DAKg7O.js.map → LexicalUtils.prod-CjKjgnmx.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-HPo4ZkHo.js → TableCellResizerPlugin-DATbSzfg.js} +51 -51
- package/dist/{TableCellResizerPlugin-HPo4ZkHo.js.map → TableCellResizerPlugin-DATbSzfg.js.map} +1 -1
- package/dist/{TablePlugin-BLbsvcuu.js → TablePlugin-CqCjNBW_.js} +83 -83
- package/dist/{TablePlugin-BLbsvcuu.js.map → TablePlugin-CqCjNBW_.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +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/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +52 -52
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +25 -25
- 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 +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +27 -27
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +16 -16
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +185 -185
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +8 -8
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +11 -11
- package/dist/components/SelectListbox/components/SelectButton.js +17 -17
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/Lexical.prod-BAE-wnll.js.map +0 -1
- package/dist/LexicalClipboard.prod-BS4qAkmJ.js.map +0 -1
- package/dist/LexicalLink.prod-C6Or2Yo6.js.map +0 -1
- package/dist/LexicalList.prod-rTq41CO0.js.map +0 -1
- package/dist/LexicalTable.prod-BBI7yaOy.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as Z, u as me, k as
|
|
2
|
-
import { d as R,
|
|
3
|
-
import { F as On, _ as
|
|
4
|
-
const
|
|
5
|
-
class ue extends
|
|
1
|
+
import { l as Z, u as me, k as Rt, U as Xt, N as jt, B as Tt, A as Vt, L as Gt } from "./LexicalUtils.prod-CjKjgnmx.js";
|
|
2
|
+
import { d as R, C as et, a as ve, b as z, y as $, f as tt, j as Zt, l as Ce, k as ht, L as J, s as nt, D as Qt, m as Ft, v as re, x as ie, n as ke, I as ot, S as P, o as en, t as tn, R as nn, p as on, K as Pe, q as Kt, r as rn, u as Ne, A as Ue, T as ln, B as sn, F as an, G as cn, H as Y, J as un, M as hn, N as Ot, O as dn, P as fn, Q as gn, U as mn, _ as pn, V as _n, W as Cn, Y as Sn, Z as wn, $ as ge, a0 as ne, a1 as $e, a2 as yn, c as At, a3 as bn, a4 as Nn, e as vn, a5 as xn, a6 as Rn, a7 as dt, a8 as Tn, a9 as ft, i as Fn, aa as gt, E as mt, g as Fe, ab as Kn } from "./Lexical.prod-sd_e2sqT.js";
|
|
3
|
+
import { F as On, _ as An } from "./LexicalClipboard.prod-Co2PF1UJ.js";
|
|
4
|
+
const rt = /^(\d+(?:\.\d+)?)px$/, W = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
|
|
5
|
+
class ue extends et {
|
|
6
6
|
__colSpan;
|
|
7
7
|
__rowSpan;
|
|
8
8
|
__headerState;
|
|
@@ -19,10 +19,10 @@ class ue extends tt {
|
|
|
19
19
|
super.afterCloneFrom(e), this.__rowSpan = e.__rowSpan, this.__backgroundColor = e.__backgroundColor, this.__verticalAlign = e.__verticalAlign;
|
|
20
20
|
}
|
|
21
21
|
static importDOM() {
|
|
22
|
-
return { td: (e) => ({ conversion:
|
|
22
|
+
return { td: (e) => ({ conversion: pt, priority: 0 }), th: (e) => ({ conversion: pt, priority: 0 }) };
|
|
23
23
|
}
|
|
24
24
|
static importJSON(e) {
|
|
25
|
-
return
|
|
25
|
+
return X().updateFromJSON(e);
|
|
26
26
|
}
|
|
27
27
|
updateFromJSON(e) {
|
|
28
28
|
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);
|
|
@@ -32,7 +32,7 @@ class ue extends tt {
|
|
|
32
32
|
}
|
|
33
33
|
createDOM(e) {
|
|
34
34
|
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),
|
|
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), Je(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), Z(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t;
|
|
36
36
|
}
|
|
37
37
|
exportDOM(e) {
|
|
38
38
|
const t = super.exportDOM(e);
|
|
@@ -43,7 +43,7 @@ class ue extends tt {
|
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
45
|
exportJSON() {
|
|
46
|
-
return { ...super.exportJSON(), ...
|
|
46
|
+
return { ...super.exportJSON(), ...Je(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() };
|
|
47
47
|
}
|
|
48
48
|
getColSpan() {
|
|
49
49
|
return this.getLatest().__colSpan;
|
|
@@ -116,19 +116,19 @@ class ue extends tt {
|
|
|
116
116
|
return !1;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Je(n) {
|
|
120
120
|
return n === "middle" || n === "bottom";
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function pt(n) {
|
|
123
123
|
const e = n, t = n.nodeName.toLowerCase();
|
|
124
124
|
let o;
|
|
125
|
-
|
|
126
|
-
const r =
|
|
125
|
+
rt.test(e.style.width) && (o = parseFloat(e.style.width));
|
|
126
|
+
const r = X(t === "th" ? W.ROW : W.NO_STATUS, e.colSpan, o);
|
|
127
127
|
r.__rowSpan = e.rowSpan;
|
|
128
128
|
const s = e.style.backgroundColor;
|
|
129
129
|
s !== "" && (r.__backgroundColor = s);
|
|
130
130
|
const l = e.style.verticalAlign;
|
|
131
|
-
|
|
131
|
+
Je(l) && (r.__verticalAlign = l);
|
|
132
132
|
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
133
|
return { after: (a) => {
|
|
134
134
|
const c = [];
|
|
@@ -136,27 +136,27 @@ function _t(n) {
|
|
|
136
136
|
const d = () => {
|
|
137
137
|
if (g) {
|
|
138
138
|
const m = g.getFirstChild();
|
|
139
|
-
|
|
139
|
+
ht(m) && g.getChildrenSize() === 1 && m.remove();
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
|
-
for (const m of a)
|
|
143
|
-
return d(), c.length === 0 && c.push(
|
|
142
|
+
for (const m of a) Zt(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 = J().append(m), c.push(g))) : (c.push(m), d(), g = null);
|
|
143
|
+
return d(), c.length === 0 && c.push(J()), c;
|
|
144
144
|
}, node: r };
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
146
|
+
function X(n = W.NO_STATUS, e = 1, t) {
|
|
147
|
+
return tt(new ue(n, e, t));
|
|
148
148
|
}
|
|
149
149
|
function y(n) {
|
|
150
150
|
return n instanceof ue;
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const kn = rn("INSERT_TABLE_COMMAND");
|
|
153
153
|
function w(n, ...e) {
|
|
154
154
|
const t = new URL("https://lexical.dev/docs/error"), o = new URLSearchParams();
|
|
155
155
|
o.append("code", n);
|
|
156
156
|
for (const r of e) o.append("v", r);
|
|
157
157
|
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.`);
|
|
158
158
|
}
|
|
159
|
-
class Te extends
|
|
159
|
+
class Te extends et {
|
|
160
160
|
__height;
|
|
161
161
|
static getType() {
|
|
162
162
|
return "tablerow";
|
|
@@ -165,7 +165,7 @@ class Te extends tt {
|
|
|
165
165
|
return new Te(e.__height, e.__key);
|
|
166
166
|
}
|
|
167
167
|
static importDOM() {
|
|
168
|
-
return { tr: (e) => ({ conversion:
|
|
168
|
+
return { tr: (e) => ({ conversion: En, priority: 0 }) };
|
|
169
169
|
}
|
|
170
170
|
static importJSON(e) {
|
|
171
171
|
return Re().updateFromJSON(e);
|
|
@@ -207,63 +207,63 @@ class Te extends tt {
|
|
|
207
207
|
return !1;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function En(n) {
|
|
211
211
|
const e = n;
|
|
212
212
|
let t;
|
|
213
|
-
return
|
|
213
|
+
return rt.test(e.style.height) && (t = parseFloat(e.style.height)), { after: (o) => Rt(o, y), node: Re(t) };
|
|
214
214
|
}
|
|
215
215
|
function Re(n) {
|
|
216
|
-
return
|
|
216
|
+
return tt(new Te(n));
|
|
217
217
|
}
|
|
218
218
|
function E(n) {
|
|
219
219
|
return n instanceof Te;
|
|
220
220
|
}
|
|
221
|
-
const
|
|
222
|
-
function
|
|
223
|
-
const o =
|
|
221
|
+
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 $n(n, e, t = !0) {
|
|
223
|
+
const o = at();
|
|
224
224
|
for (let r = 0; r < n; r++) {
|
|
225
225
|
const s = Re();
|
|
226
226
|
for (let l = 0; l < e; l++) {
|
|
227
227
|
let i = W.NO_STATUS;
|
|
228
228
|
typeof t == "object" ? (r === 0 && t.rows && (i |= W.ROW), l === 0 && t.columns && (i |= W.COLUMN)) : t && (r === 0 && (i |= W.ROW), l === 0 && (i |= W.COLUMN));
|
|
229
|
-
const u =
|
|
230
|
-
f.append(
|
|
229
|
+
const u = X(i), f = J();
|
|
230
|
+
f.append(nt()), u.append(f), s.append(u);
|
|
231
231
|
}
|
|
232
232
|
o.append(s);
|
|
233
233
|
}
|
|
234
234
|
return o;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function lo(n) {
|
|
237
237
|
const e = R(n, (t) => y(t));
|
|
238
238
|
return y(e) ? e : null;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function kt(n) {
|
|
241
241
|
const e = R(n, (t) => E(t));
|
|
242
242
|
if (E(e)) return e;
|
|
243
243
|
throw new Error("Expected table cell to be inside of table row.");
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Et(n) {
|
|
246
246
|
const e = R(n, (t) => M(t));
|
|
247
247
|
if (M(e)) return e;
|
|
248
248
|
throw new Error("Expected table cell to be inside of table.");
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const e =
|
|
252
|
-
return
|
|
250
|
+
function so(n) {
|
|
251
|
+
const e = kt(n);
|
|
252
|
+
return Et(e).getChildren().findIndex((t) => t.is(e));
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
return
|
|
254
|
+
function io(n) {
|
|
255
|
+
return kt(n).getChildren().findIndex((e) => e.is(n));
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
lt && "InputEvent" in window && !Mn && new window.InputEvent("input");
|
|
258
258
|
const Ye = (n, e) => n === W.BOTH || n === e ? e : W.NO_STATUS;
|
|
259
|
-
function
|
|
260
|
-
const e =
|
|
261
|
-
$(e) ||
|
|
262
|
-
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] =
|
|
259
|
+
function ao(n = !0) {
|
|
260
|
+
const e = z();
|
|
261
|
+
$(e) || K(e) || w(188);
|
|
262
|
+
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] = U(l, s, r), { startRow: f } = u, { startRow: h } = i;
|
|
263
263
|
return n ? qe(f + r.__rowSpan > h + s.__rowSpan ? r : s, !0) : qe(h < f ? s : r, !1);
|
|
264
264
|
}
|
|
265
265
|
function qe(n, e = !0) {
|
|
266
|
-
const [, , t] = I(n), [o, r] =
|
|
266
|
+
const [, , t] = I(n), [o, r] = U(t, n, n), s = o[0].length, { startRow: l } = r;
|
|
267
267
|
let i = null;
|
|
268
268
|
if (e) {
|
|
269
269
|
const u = l + n.__rowSpan - 1, f = o[u], h = Re();
|
|
@@ -271,7 +271,7 @@ function qe(n, e = !0) {
|
|
|
271
271
|
const { cell: a, startRow: c } = f[_];
|
|
272
272
|
if (c + a.__rowSpan - 1 <= u) {
|
|
273
273
|
const g = f[_].cell.__headerState, d = Ye(g, W.COLUMN);
|
|
274
|
-
h.append(
|
|
274
|
+
h.append(X(d).append(J()));
|
|
275
275
|
} else a.setRowSpan(a.__rowSpan + 1);
|
|
276
276
|
}
|
|
277
277
|
const p = t.getChildAtIndex(u);
|
|
@@ -282,7 +282,7 @@ function qe(n, e = !0) {
|
|
|
282
282
|
const { cell: a, startRow: c } = f[_];
|
|
283
283
|
if (c === u) {
|
|
284
284
|
const g = f[_].cell.__headerState, d = Ye(g, W.COLUMN);
|
|
285
|
-
h.append(
|
|
285
|
+
h.append(X(d).append(J()));
|
|
286
286
|
} else a.setRowSpan(a.__rowSpan + 1);
|
|
287
287
|
}
|
|
288
288
|
const p = t.getChildAtIndex(u);
|
|
@@ -290,18 +290,18 @@ function qe(n, e = !0) {
|
|
|
290
290
|
}
|
|
291
291
|
return i;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
const e =
|
|
295
|
-
$(e) ||
|
|
296
|
-
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] =
|
|
297
|
-
return n ?
|
|
293
|
+
function co(n = !0) {
|
|
294
|
+
const e = z();
|
|
295
|
+
$(e) || K(e) || w(188);
|
|
296
|
+
const t = e.anchor.getNode(), o = e.focus.getNode(), [r] = I(t), [s, , l] = I(o), [, i, u] = U(l, s, r), { startColumn: f } = u, { startColumn: h } = i;
|
|
297
|
+
return n ? Xe(f + r.__colSpan > h + s.__colSpan ? r : s, !0) : Xe(h < f ? s : r, !1);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
const [, , o] = I(n), [r, s] =
|
|
299
|
+
function Xe(n, e = !0, t = !0) {
|
|
300
|
+
const [, , o] = I(n), [r, s] = U(o, n, n), l = r.length, { startColumn: i } = s, u = e ? i + n.__colSpan - 1 : i - 1, f = o.getFirstChild();
|
|
301
301
|
E(f) || w(120);
|
|
302
302
|
let h = null;
|
|
303
303
|
function p(c = W.NO_STATUS) {
|
|
304
|
-
const g =
|
|
304
|
+
const g = X(c).append(J());
|
|
305
305
|
return h === null && (h = g), g;
|
|
306
306
|
}
|
|
307
307
|
let _ = f;
|
|
@@ -312,7 +312,7 @@ function je(n, e = !0, t = !0) {
|
|
|
312
312
|
}
|
|
313
313
|
const g = r[c], d = g[u < 0 ? 0 : u].cell.__headerState, m = Ye(d, W.ROW);
|
|
314
314
|
if (u < 0) {
|
|
315
|
-
|
|
315
|
+
Mt(_, p(m));
|
|
316
316
|
continue;
|
|
317
317
|
}
|
|
318
318
|
const { cell: C, startColumn: S, startRow: N } = g[u];
|
|
@@ -324,14 +324,14 @@ function je(n, e = !0, t = !0) {
|
|
|
324
324
|
continue e;
|
|
325
325
|
}
|
|
326
326
|
{
|
|
327
|
-
const { cell: k, startRow:
|
|
328
|
-
b = k, v =
|
|
327
|
+
const { cell: k, startRow: A } = g[T];
|
|
328
|
+
b = k, v = A;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
b.insertAfter(p(m));
|
|
332
332
|
} else C.setColSpan(C.__colSpan + 1);
|
|
333
333
|
}
|
|
334
|
-
h !== null && t &&
|
|
334
|
+
h !== null && t && je(h);
|
|
335
335
|
const a = o.getColWidths();
|
|
336
336
|
if (a) {
|
|
337
337
|
const c = [...a], g = u < 0 ? 0 : u, d = c[g];
|
|
@@ -339,10 +339,10 @@ function je(n, e = !0, t = !0) {
|
|
|
339
339
|
}
|
|
340
340
|
return h;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
const n =
|
|
344
|
-
$(n) ||
|
|
345
|
-
const e = n.anchor.getNode(), t = n.focus.getNode(), [o, , r] = I(e), [s] = I(t), [l, i, u] =
|
|
342
|
+
function uo() {
|
|
343
|
+
const n = z();
|
|
344
|
+
$(n) || K(n) || w(188);
|
|
345
|
+
const e = n.anchor.getNode(), t = n.focus.getNode(), [o, , r] = I(e), [s] = I(t), [l, i, u] = U(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
346
|
if (l[0].length === a - _ + 1) return r.selectPrevious(), void r.remove();
|
|
347
347
|
const g = l.length;
|
|
348
348
|
for (let S = 0; S < g; S++) for (let N = _; N <= a; N++) {
|
|
@@ -362,10 +362,10 @@ function ho() {
|
|
|
362
362
|
const d = l[h], m = f > p ? d[f + o.__colSpan] : d[p + s.__colSpan];
|
|
363
363
|
if (m !== void 0) {
|
|
364
364
|
const { cell: S } = m;
|
|
365
|
-
|
|
365
|
+
je(S);
|
|
366
366
|
} else {
|
|
367
367
|
const S = p < f ? d[p - 1] : d[f - 1], { cell: N } = S;
|
|
368
|
-
|
|
368
|
+
je(N);
|
|
369
369
|
}
|
|
370
370
|
const C = r.getColWidths();
|
|
371
371
|
if (C) {
|
|
@@ -373,17 +373,17 @@ function ho() {
|
|
|
373
373
|
S.splice(_, c), r.setColWidths(S);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function je(n) {
|
|
377
377
|
const e = n.getFirstDescendant();
|
|
378
378
|
e == null ? n.selectStart() : e.getParentOrThrow().selectStart();
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Mt(n, e) {
|
|
381
381
|
const t = n.getFirstChild();
|
|
382
382
|
t !== null ? t.insertBefore(e) : n.append(e);
|
|
383
383
|
}
|
|
384
384
|
function Ln(n) {
|
|
385
385
|
if (n.length === 0) return null;
|
|
386
|
-
const e =
|
|
386
|
+
const e = Et(n[0]), [t] = oe(e, null, null);
|
|
387
387
|
let o = 1 / 0, r = -1 / 0, s = 1 / 0, l = -1 / 0;
|
|
388
388
|
const i = /* @__PURE__ */ new Set();
|
|
389
389
|
for (const a of t) for (const c of a) {
|
|
@@ -405,19 +405,19 @@ function Ln(n) {
|
|
|
405
405
|
const g = t[a][c];
|
|
406
406
|
if (!g.cell) continue;
|
|
407
407
|
const d = g.cell, m = d.getKey();
|
|
408
|
-
_.has(m) || (_.add(m),
|
|
408
|
+
_.has(m) || (_.add(m), zn(d) || p.append(...d.getChildren()), d.remove());
|
|
409
409
|
}
|
|
410
|
-
return p.getChildrenSize() === 0 && p.append(
|
|
410
|
+
return p.getChildrenSize() === 0 && p.append(J()), p;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function zn(n) {
|
|
413
413
|
if (n.getChildrenSize() !== 1) return !1;
|
|
414
414
|
const e = n.getFirstChildOrThrow();
|
|
415
|
-
return !(!
|
|
415
|
+
return !(!ot(e) || !e.isEmpty());
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function Wn(n) {
|
|
418
418
|
const [e, t, o] = I(n), r = e.__colSpan, s = e.__rowSpan;
|
|
419
419
|
if (r === 1 && s === 1) return;
|
|
420
|
-
const [l, i] =
|
|
420
|
+
const [l, i] = U(o, e, e), { startColumn: u, startRow: f } = i, h = e.__headerState & W.COLUMN, p = Array.from({ length: r }, (c, g) => {
|
|
421
421
|
let d = h;
|
|
422
422
|
for (let m = 0; d !== 0 && m < l.length; m++) d &= l[m][g + u].cell.__headerState;
|
|
423
423
|
return d;
|
|
@@ -427,7 +427,7 @@ function Pn(n) {
|
|
|
427
427
|
return d;
|
|
428
428
|
});
|
|
429
429
|
if (r > 1) {
|
|
430
|
-
for (let c = 1; c < r; c++) e.insertAfter(
|
|
430
|
+
for (let c = 1; c < r; c++) e.insertAfter(X(p[c] | a[0]).append(J()));
|
|
431
431
|
e.setColSpan(1);
|
|
432
432
|
}
|
|
433
433
|
if (s > 1) {
|
|
@@ -440,13 +440,13 @@ function Pn(n) {
|
|
|
440
440
|
const N = m[S], b = N.cell;
|
|
441
441
|
N.startRow === d && (C = b), b.__colSpan > 1 && (S += b.__colSpan - 1);
|
|
442
442
|
}
|
|
443
|
-
if (C === null) for (let S = r - 1; S >= 0; S--)
|
|
444
|
-
else for (let S = r - 1; S >= 0; S--) C.insertAfter(
|
|
443
|
+
if (C === null) for (let S = r - 1; S >= 0; S--) Mt(c, X(p[S] | a[g]).append(J()));
|
|
444
|
+
else for (let S = r - 1; S >= 0; S--) C.insertAfter(X(p[S] | a[g]).append(J()));
|
|
445
445
|
}
|
|
446
446
|
e.setRowSpan(1);
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function U(n, e, t) {
|
|
450
450
|
const [o, r, s] = oe(n, e, t);
|
|
451
451
|
return r === null && w(207), s === null && w(208), [o, r, s];
|
|
452
452
|
}
|
|
@@ -505,7 +505,7 @@ function Ee(n, e, t) {
|
|
|
505
505
|
} while (o);
|
|
506
506
|
return { maxColumn: l, maxRow: i, minColumn: r, minRow: s };
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Ct(n) {
|
|
509
509
|
const [e, , t] = I(n), o = t.getChildren(), r = o.length, s = o[0].getChildren().length, l = new Array(r);
|
|
510
510
|
for (let i = 0; i < r; i++) l[i] = new Array(s);
|
|
511
511
|
for (let i = 0; i < r; i++) {
|
|
@@ -521,7 +521,7 @@ function St(n) {
|
|
|
521
521
|
}
|
|
522
522
|
return null;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function St(n) {
|
|
525
525
|
const [[e, t, o, r], [s, l, i, u]] = ["anchor", "focus"].map((f) => {
|
|
526
526
|
const h = n[f].getNode(), p = R(h, y);
|
|
527
527
|
y(p) || w(238, f, h.getKey(), h.getType());
|
|
@@ -532,7 +532,7 @@ function wt(n) {
|
|
|
532
532
|
});
|
|
533
533
|
return r.is(u) || w(241), { anchorCell: t, anchorNode: e, anchorRow: o, anchorTable: r, focusCell: l, focusNode: s, focusRow: i, focusTable: u };
|
|
534
534
|
}
|
|
535
|
-
class
|
|
535
|
+
class Le {
|
|
536
536
|
tableKey;
|
|
537
537
|
anchor;
|
|
538
538
|
focus;
|
|
@@ -559,13 +559,13 @@ class ze {
|
|
|
559
559
|
this._cachedNodes = e;
|
|
560
560
|
}
|
|
561
561
|
is(e) {
|
|
562
|
-
return
|
|
562
|
+
return K(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus);
|
|
563
563
|
}
|
|
564
564
|
set(e, t, o) {
|
|
565
565
|
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
566
|
}
|
|
567
567
|
clone() {
|
|
568
|
-
return new
|
|
568
|
+
return new Le(this.tableKey, ke(this.anchor.key, this.anchor.offset, this.anchor.type), ke(this.focus.key, this.focus.offset, this.focus.type));
|
|
569
569
|
}
|
|
570
570
|
isCollapsed() {
|
|
571
571
|
return !1;
|
|
@@ -581,19 +581,19 @@ class ze {
|
|
|
581
581
|
let t = 0;
|
|
582
582
|
this.getNodes().filter(y).forEach((r) => {
|
|
583
583
|
const s = r.getFirstChild();
|
|
584
|
-
|
|
584
|
+
ot(s) && (t |= s.getTextFormat());
|
|
585
585
|
});
|
|
586
|
-
const o =
|
|
586
|
+
const o = nn[e];
|
|
587
587
|
return (t & o) !== 0;
|
|
588
588
|
}
|
|
589
589
|
insertNodes(e) {
|
|
590
590
|
const t = this.focus.getNode();
|
|
591
|
-
|
|
591
|
+
P(t) || w(151), en(t.select(0, t.getChildrenSize())).insertNodes(e);
|
|
592
592
|
}
|
|
593
593
|
getShape() {
|
|
594
|
-
const { anchorCell: e, focusCell: t } =
|
|
594
|
+
const { anchorCell: e, focusCell: t } = St(this), o = Ct(e);
|
|
595
595
|
o === null && w(153);
|
|
596
|
-
const r =
|
|
596
|
+
const r = Ct(t);
|
|
597
597
|
r === null && w(155);
|
|
598
598
|
const s = Math.min(o.columnIndex, r.columnIndex), l = Math.max(o.columnIndex + o.colSpan - 1, r.columnIndex + r.colSpan - 1), i = Math.min(o.rowIndex, r.rowIndex), u = Math.max(o.rowIndex + o.rowSpan - 1, r.rowIndex + r.rowSpan - 1);
|
|
599
599
|
return { fromX: Math.min(s, l), fromY: Math.min(i, u), toX: Math.max(s, l), toY: Math.max(i, u) };
|
|
@@ -602,7 +602,7 @@ class ze {
|
|
|
602
602
|
if (!this.isValid()) return [];
|
|
603
603
|
const e = this._cachedNodes;
|
|
604
604
|
if (e !== null) return e;
|
|
605
|
-
const { anchorTable: t, anchorCell: o, focusCell: r } =
|
|
605
|
+
const { anchorTable: t, anchorCell: o, focusCell: r } = St(this), s = r.getParents()[1];
|
|
606
606
|
if (s !== t) {
|
|
607
607
|
if (t.isParentOf(r)) {
|
|
608
608
|
const d = s.getParent();
|
|
@@ -613,7 +613,7 @@ class ze {
|
|
|
613
613
|
}
|
|
614
614
|
return this.getNodes();
|
|
615
615
|
}
|
|
616
|
-
const [l, i, u] =
|
|
616
|
+
const [l, i, u] = U(t, o, r), { minColumn: f, maxColumn: h, minRow: p, maxRow: _ } = Ee(l, i, u), a = /* @__PURE__ */ new Map([[t.getKey(), t]]);
|
|
617
617
|
let c = null;
|
|
618
618
|
for (let d = p; d <= _; d++) for (let m = f; m <= h; m++) {
|
|
619
619
|
const { cell: C } = l[d][m], S = C.getParent();
|
|
@@ -622,7 +622,7 @@ class ze {
|
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
624
|
const g = Array.from(a.values());
|
|
625
|
-
return
|
|
625
|
+
return tn() || (this._cachedNodes = g), g;
|
|
626
626
|
}
|
|
627
627
|
getTextContent() {
|
|
628
628
|
const e = this.getNodes().filter((o) => y(o));
|
|
@@ -635,26 +635,26 @@ class ze {
|
|
|
635
635
|
return t;
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
return n instanceof
|
|
638
|
+
function K(n) {
|
|
639
|
+
return n instanceof Le;
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function $t() {
|
|
642
642
|
const n = ke("root", 0, "element"), e = ke("root", 0, "element");
|
|
643
|
-
return new
|
|
643
|
+
return new Le("root", n, e);
|
|
644
644
|
}
|
|
645
645
|
function Hn(n, e, t) {
|
|
646
646
|
n.getKey(), e.getKey(), t.getKey();
|
|
647
|
-
const o =
|
|
647
|
+
const o = z(), r = K(o) ? o.clone() : $t();
|
|
648
648
|
return r.set(n.getKey(), e.getKey(), t.getKey()), r;
|
|
649
649
|
}
|
|
650
650
|
function Bn(n, e) {
|
|
651
651
|
const t = [[n]];
|
|
652
652
|
for (let o = t.at(-1); o !== void 0 && t.length > 0; o = t.at(-1)) {
|
|
653
653
|
const r = o.pop();
|
|
654
|
-
r === void 0 ? t.pop() : e(r) !== !1 &&
|
|
654
|
+
r === void 0 ? t.pop() : e(r) !== !1 && P(r) && t.push(r.getChildren());
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
function Lt(n, e =
|
|
657
|
+
function Lt(n, e = Ft()) {
|
|
658
658
|
const t = ie(n);
|
|
659
659
|
M(t) || w(231, n);
|
|
660
660
|
const o = ae(t, e.getElementByKey(n));
|
|
@@ -719,7 +719,7 @@ class Dn {
|
|
|
719
719
|
const e = this.editor;
|
|
720
720
|
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
721
|
const { tableNode: t, tableElement: o } = this.$lookup();
|
|
722
|
-
|
|
722
|
+
Ke(e, pe(t, o), null), z() !== null && (ne(null), e.dispatchCommand(ge, void 0));
|
|
723
723
|
}
|
|
724
724
|
$enableHighlightStyle() {
|
|
725
725
|
const e = this.editor, { tableElement: t } = this.$lookup();
|
|
@@ -733,7 +733,7 @@ class Dn {
|
|
|
733
733
|
if (e !== null) {
|
|
734
734
|
e.tableKey !== this.tableNodeKey && w(233, e.tableKey, this.tableNodeKey);
|
|
735
735
|
const t = this.editor;
|
|
736
|
-
this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(),
|
|
736
|
+
this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), Ke(t, this.table, this.tableSelection);
|
|
737
737
|
} else this.$clearHighlight();
|
|
738
738
|
}
|
|
739
739
|
setShouldCheckSelection() {
|
|
@@ -761,8 +761,8 @@ class Dn {
|
|
|
761
761
|
if (s === this.focusX && l === this.focusY) return !1;
|
|
762
762
|
} else this.isHighlightingCells = !0, this.$disableHighlightStyle();
|
|
763
763
|
if (this.focusX = s, this.focusY = l, this.isHighlightingCells) {
|
|
764
|
-
const i =
|
|
765
|
-
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),
|
|
764
|
+
const i = Ge(r, e.elem);
|
|
765
|
+
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
766
|
}
|
|
767
767
|
return !1;
|
|
768
768
|
}
|
|
@@ -782,18 +782,18 @@ class Dn {
|
|
|
782
782
|
}
|
|
783
783
|
$setAnchorCellForSelection(e) {
|
|
784
784
|
this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y;
|
|
785
|
-
const { tableNode: t } = this.$lookup(), o =
|
|
785
|
+
const { tableNode: t } = this.$lookup(), o = Ge(t, e.elem);
|
|
786
786
|
if (o !== null) {
|
|
787
787
|
const r = o.getKey();
|
|
788
|
-
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() :
|
|
788
|
+
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : $t(), this.anchorCellNodeKey = r;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
$formatCells(e) {
|
|
792
|
-
const t =
|
|
793
|
-
|
|
794
|
-
const o =
|
|
792
|
+
const t = z();
|
|
793
|
+
K(t) || w(236);
|
|
794
|
+
const o = bn(), r = o.anchor, s = o.focus, l = t.getNodes().filter(y);
|
|
795
795
|
l.length > 0 || w(237);
|
|
796
|
-
const i = l[0].getFirstChild(), u =
|
|
796
|
+
const i = l[0].getFirstChild(), u = ot(i) ? i.getFormatFlags(e, null) : null;
|
|
797
797
|
l.forEach((f) => {
|
|
798
798
|
r.set(f.getKey(), 0, "element"), s.set(f.getKey(), f.getChildrenSize(), "element"), o.formatText(e, u);
|
|
799
799
|
}), ne(t), this.editor.dispatchCommand(ge, void 0);
|
|
@@ -801,25 +801,25 @@ class Dn {
|
|
|
801
801
|
$clearText() {
|
|
802
802
|
const { editor: e } = this, t = ie(this.tableNodeKey);
|
|
803
803
|
if (!M(t)) throw new Error("Expected TableNode.");
|
|
804
|
-
const o =
|
|
805
|
-
|
|
804
|
+
const o = z();
|
|
805
|
+
K(o) || w(253);
|
|
806
806
|
const r = o.getNodes().filter(y), s = t.getFirstChild(), l = t.getLastChild();
|
|
807
807
|
if (r.length > 0 && s !== null && l !== null && E(s) && E(l) && r[0] === s.getFirstChild() && r[r.length - 1] === l.getLastChild()) {
|
|
808
808
|
t.selectPrevious();
|
|
809
809
|
const i = t.getParent();
|
|
810
|
-
return t.remove(), void (
|
|
810
|
+
return t.remove(), void (Nn(i) && i.isEmpty() && e.dispatchCommand(At, void 0));
|
|
811
811
|
}
|
|
812
812
|
r.forEach((i) => {
|
|
813
|
-
if (
|
|
814
|
-
const u =
|
|
813
|
+
if (P(i)) {
|
|
814
|
+
const u = J(), f = nt();
|
|
815
815
|
u.append(f), i.append(u), i.getChildren().forEach((h) => {
|
|
816
816
|
h !== u && h.remove();
|
|
817
817
|
});
|
|
818
818
|
}
|
|
819
|
-
}),
|
|
819
|
+
}), Ke(e, this.table, null), ne(null), e.dispatchCommand(ge, void 0);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
const
|
|
822
|
+
const Ve = "__lexicalTableSelection";
|
|
823
823
|
function fe(n) {
|
|
824
824
|
return ve(n) && n.nodeName === "TABLE";
|
|
825
825
|
}
|
|
@@ -828,7 +828,7 @@ function ae(n, e) {
|
|
|
828
828
|
const t = fe(e) ? e : n.getDOMSlot(e).element;
|
|
829
829
|
return t.nodeName !== "TABLE" && w(245, e.nodeName), t;
|
|
830
830
|
}
|
|
831
|
-
function
|
|
831
|
+
function st(n) {
|
|
832
832
|
return n._window;
|
|
833
833
|
}
|
|
834
834
|
function xe(n, e) {
|
|
@@ -838,22 +838,22 @@ function xe(n, e) {
|
|
|
838
838
|
}
|
|
839
839
|
return null;
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
843
|
-
const r = t.getRootElement(), s =
|
|
841
|
+
const Pn = [[ln, "down"], [sn, "up"], [an, "backward"], [cn, "forward"]], In = [hn, Ot, dn], Un = [fn, gn];
|
|
842
|
+
function Jn(n, e, t, o) {
|
|
843
|
+
const r = t.getRootElement(), s = st(t);
|
|
844
844
|
r !== null && s !== null || w(246);
|
|
845
845
|
const l = new Dn(t, n.getKey()), i = ae(n, e);
|
|
846
846
|
(function(a, c) {
|
|
847
|
-
|
|
847
|
+
wt(a) !== null && w(205), a[Ve] = c;
|
|
848
848
|
})(i, l), l.listenersToRemove.add(() => (function(a, c) {
|
|
849
|
-
|
|
849
|
+
wt(a) === c && delete a[Ve];
|
|
850
850
|
})(i, l));
|
|
851
851
|
const u = (a) => {
|
|
852
852
|
if (l.pointerType = a.pointerType, a.button !== 0 || !Ne(a.target) || !s) return;
|
|
853
853
|
const c = Me(a.target);
|
|
854
854
|
c !== null && t.update(() => {
|
|
855
855
|
const g = Ue();
|
|
856
|
-
if (
|
|
856
|
+
if (_t && a.shiftKey && G(g, n) && ($(g) || K(g))) {
|
|
857
857
|
const d = g.anchor.getNode(), m = xe(n, g.anchor.getNode());
|
|
858
858
|
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
859
|
} else a.pointerType !== "touch" && l.$setAnchorCellForSelection(c);
|
|
@@ -865,9 +865,9 @@ function Xn(n, e, t, o) {
|
|
|
865
865
|
if (1 & ~m.buttons && l.isSelecting) return l.isSelecting = !1, s.removeEventListener("pointerup", g), void s.removeEventListener("pointermove", d);
|
|
866
866
|
if (!Ne(m.target)) return;
|
|
867
867
|
let C = null;
|
|
868
|
-
const S = !(
|
|
869
|
-
if (S) C =
|
|
870
|
-
else for (const N of document.elementsFromPoint(m.clientX, m.clientY)) if (C =
|
|
868
|
+
const S = !(_t || i.contains(m.target));
|
|
869
|
+
if (S) C = yt(i, m.target);
|
|
870
|
+
else for (const N of document.elementsFromPoint(m.clientX, m.clientY)) if (C = yt(i, N), C) break;
|
|
871
871
|
!C || l.focusCell !== null && C.elem === l.focusCell.elem || (l.setNextFocus({ focusCell: C, override: S }), t.dispatchCommand(ge, void 0));
|
|
872
872
|
};
|
|
873
873
|
l.isSelecting = !0, s.addEventListener("pointerup", g, l.listenerOptions), s.addEventListener("pointermove", d, l.listenerOptions);
|
|
@@ -885,176 +885,176 @@ function Xn(n, e, t, o) {
|
|
|
885
885
|
const h = (a) => {
|
|
886
886
|
const c = a.target;
|
|
887
887
|
a.button === 0 && Ne(c) && t.update(() => {
|
|
888
|
-
const g =
|
|
889
|
-
|
|
888
|
+
const g = z();
|
|
889
|
+
K(g) && g.tableKey === l.tableNodeKey && r.contains(c) && l.$clearHighlight();
|
|
890
890
|
});
|
|
891
891
|
};
|
|
892
892
|
s.addEventListener("pointerdown", h, l.listenerOptions), l.listenersToRemove.add(() => {
|
|
893
893
|
s.removeEventListener("pointerdown", h);
|
|
894
894
|
});
|
|
895
|
-
for (const [a, c] of
|
|
896
|
-
l.listenersToRemove.add(t.registerCommand(
|
|
897
|
-
const c =
|
|
898
|
-
if (
|
|
895
|
+
for (const [a, c] of Pn) l.listenersToRemove.add(t.registerCommand(a, (g) => Ht(t, g, c, n, l), Y));
|
|
896
|
+
l.listenersToRemove.add(t.registerCommand(un, (a) => {
|
|
897
|
+
const c = z();
|
|
898
|
+
if (K(c)) {
|
|
899
899
|
const g = xe(n, c.focus.getNode());
|
|
900
900
|
if (g !== null) return ee(a), g.selectEnd(), !0;
|
|
901
901
|
}
|
|
902
902
|
return !1;
|
|
903
|
-
},
|
|
903
|
+
}, Y));
|
|
904
904
|
const p = (a) => () => {
|
|
905
|
-
const c =
|
|
906
|
-
if (!
|
|
907
|
-
if (
|
|
905
|
+
const c = z();
|
|
906
|
+
if (!G(c, n)) return !1;
|
|
907
|
+
if (K(c)) return l.$clearText(), !0;
|
|
908
908
|
if ($(c)) {
|
|
909
909
|
if (!y(xe(n, c.anchor.getNode()))) return !1;
|
|
910
910
|
const g = c.anchor.getNode(), d = c.focus.getNode(), m = n.isParentOf(g), C = n.isParentOf(d);
|
|
911
911
|
if (m && !C || C && !m) return l.$clearText(), !0;
|
|
912
|
-
const S = R(c.anchor.getNode(), (b) =>
|
|
913
|
-
if (!
|
|
912
|
+
const S = R(c.anchor.getNode(), (b) => P(b)), N = S && R(S, (b) => P(b) && y(b.getParent()));
|
|
913
|
+
if (!P(N) || !P(S)) return !1;
|
|
914
914
|
if (a === Ot && N.getPreviousSibling() === null) return !0;
|
|
915
915
|
}
|
|
916
916
|
return !1;
|
|
917
917
|
};
|
|
918
|
-
for (const a of
|
|
918
|
+
for (const a of In) l.listenersToRemove.add(t.registerCommand(a, p(a), Y));
|
|
919
919
|
const _ = (a) => {
|
|
920
|
-
const c =
|
|
921
|
-
if (!
|
|
920
|
+
const c = z();
|
|
921
|
+
if (!K(c) && !$(c)) return !1;
|
|
922
922
|
const g = n.isParentOf(c.anchor.getNode());
|
|
923
923
|
if (g !== n.isParentOf(c.focus.getNode())) {
|
|
924
924
|
const d = g ? "anchor" : "focus", m = g ? "focus" : "anchor", { key: C, offset: S, type: N } = c[m];
|
|
925
925
|
return n[c[d].isBefore(c[m]) ? "selectPrevious" : "selectNext"]()[m].set(C, S, N), !1;
|
|
926
926
|
}
|
|
927
|
-
return !!
|
|
927
|
+
return !!G(c, n) && !!K(c) && (a && (a.preventDefault(), a.stopPropagation()), l.$clearText(), !0);
|
|
928
928
|
};
|
|
929
|
-
for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, _,
|
|
930
|
-
return l.listenersToRemove.add(t.registerCommand(
|
|
931
|
-
const c =
|
|
929
|
+
for (const a of Un) l.listenersToRemove.add(t.registerCommand(a, _, Y));
|
|
930
|
+
return l.listenersToRemove.add(t.registerCommand(mn, (a) => {
|
|
931
|
+
const c = z();
|
|
932
932
|
if (c) {
|
|
933
|
-
if (!
|
|
934
|
-
On(t,
|
|
933
|
+
if (!K(c) && !$(c)) return !1;
|
|
934
|
+
On(t, Gt(a, ClipboardEvent) ? a : null, An(c));
|
|
935
935
|
const g = _(a);
|
|
936
936
|
return $(c) ? (c.removeText(), !0) : g;
|
|
937
937
|
}
|
|
938
938
|
return !1;
|
|
939
|
-
},
|
|
940
|
-
const c =
|
|
941
|
-
if (!
|
|
942
|
-
if (
|
|
939
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(pn, (a) => {
|
|
940
|
+
const c = z();
|
|
941
|
+
if (!G(c, n)) return !1;
|
|
942
|
+
if (K(c)) return l.$formatCells(a), !0;
|
|
943
943
|
if ($(c)) {
|
|
944
944
|
const g = R(c.anchor.getNode(), (d) => y(d));
|
|
945
945
|
if (!y(g)) return !1;
|
|
946
946
|
}
|
|
947
947
|
return !1;
|
|
948
|
-
},
|
|
949
|
-
const c =
|
|
950
|
-
if (!
|
|
948
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(_n, (a) => {
|
|
949
|
+
const c = z();
|
|
950
|
+
if (!K(c) || !G(c, n)) return !1;
|
|
951
951
|
const g = c.anchor.getNode(), d = c.focus.getNode();
|
|
952
952
|
if (!y(g) || !y(d)) return !1;
|
|
953
|
-
if ((function(
|
|
954
|
-
if (A
|
|
955
|
-
const F =
|
|
956
|
-
if (
|
|
957
|
-
const [
|
|
958
|
-
return F.getKey() ===
|
|
953
|
+
if ((function(A, L) {
|
|
954
|
+
if (K(A)) {
|
|
955
|
+
const F = A.anchor.getNode(), O = A.focus.getNode();
|
|
956
|
+
if (L && F && O) {
|
|
957
|
+
const [H] = U(L, F, O);
|
|
958
|
+
return F.getKey() === H[0][0].cell.getKey() && O.getKey() === H[H.length - 1].at(-1).cell.getKey();
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
return !1;
|
|
962
962
|
})(c, n)) return n.setFormat(a), !0;
|
|
963
|
-
const [m, C, S] =
|
|
964
|
-
for (let
|
|
965
|
-
const F = m[
|
|
963
|
+
const [m, C, S] = U(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();
|
|
964
|
+
for (let A = v; A <= N; A++) for (let L = T; L <= b; L++) {
|
|
965
|
+
const F = m[A][L].cell;
|
|
966
966
|
if (k.has(F)) continue;
|
|
967
967
|
k.add(F), F.setFormat(a);
|
|
968
|
-
const
|
|
969
|
-
for (let
|
|
970
|
-
const
|
|
971
|
-
D
|
|
968
|
+
const O = F.getChildren();
|
|
969
|
+
for (let H = 0; H < O.length; H++) {
|
|
970
|
+
const D = O[H];
|
|
971
|
+
P(D) && !D.isInline() && D.setFormat(a);
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
return !0;
|
|
975
|
-
},
|
|
976
|
-
const c =
|
|
977
|
-
if (!
|
|
978
|
-
if (
|
|
975
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(Cn, (a) => {
|
|
976
|
+
const c = z();
|
|
977
|
+
if (!G(c, n)) return !1;
|
|
978
|
+
if (K(c)) return l.$clearHighlight(), !1;
|
|
979
979
|
if ($(c)) {
|
|
980
980
|
const g = R(c.anchor.getNode(), (d) => y(d));
|
|
981
981
|
if (!y(g)) return !1;
|
|
982
982
|
if (typeof a == "string") {
|
|
983
|
-
const d =
|
|
984
|
-
if (d) return
|
|
983
|
+
const d = vt(t, c, n);
|
|
984
|
+
if (d) return Nt(d, n, [nt(a)]), !0;
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
987
|
return !1;
|
|
988
|
-
},
|
|
989
|
-
const c =
|
|
990
|
-
if (!$(c) || !c.isCollapsed() || !
|
|
988
|
+
}, Y)), o && l.listenersToRemove.add(t.registerCommand(Sn, (a) => {
|
|
989
|
+
const c = z();
|
|
990
|
+
if (!$(c) || !c.isCollapsed() || !G(c, n)) return !1;
|
|
991
991
|
const g = be(c.anchor.getNode());
|
|
992
992
|
return !(g === null || !n.is(_e(g))) && (ee(a), (function(d, m) {
|
|
993
993
|
const C = m === "next" ? "getNextSibling" : "getPreviousSibling", S = m === "next" ? "getFirstChild" : "getLastChild", N = d[C]();
|
|
994
|
-
if (
|
|
994
|
+
if (P(N)) return N.selectEnd();
|
|
995
995
|
const b = R(d, E);
|
|
996
996
|
b === null && w(247);
|
|
997
997
|
for (let T = b[C](); E(T); T = T[C]()) {
|
|
998
998
|
const k = T[S]();
|
|
999
|
-
if (
|
|
999
|
+
if (P(k)) return k.selectEnd();
|
|
1000
1000
|
}
|
|
1001
1001
|
const v = R(b, M);
|
|
1002
1002
|
v === null && w(248), m === "next" ? v.selectNext() : v.selectPrevious();
|
|
1003
1003
|
})(g, a.shiftKey ? "previous" : "next"), !0);
|
|
1004
|
-
},
|
|
1004
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(wn, (a) => n.isSelected(), Y)), l.listenersToRemove.add(t.registerCommand(Kt, (a, c) => {
|
|
1005
1005
|
if (t !== c) return !1;
|
|
1006
|
-
const { nodes: g, selection: d } = a, m = d.getStartEndPoints(), C =
|
|
1006
|
+
const { nodes: g, selection: d } = a, m = d.getStartEndPoints(), C = K(d), S = $(d) && R(d.anchor.getNode(), (x) => y(x)) !== null && R(d.focus.getNode(), (x) => y(x)) !== null || C;
|
|
1007
1007
|
if (g.length !== 1 || !M(g[0]) || !S || m === null) return !1;
|
|
1008
|
-
const [N, b] = m, [v, T, k] = I(N),
|
|
1009
|
-
if (!(y(v) && y(
|
|
1010
|
-
const
|
|
1011
|
-
let
|
|
1008
|
+
const [N, b] = m, [v, T, k] = I(N), A = R(b.getNode(), (x) => y(x));
|
|
1009
|
+
if (!(y(v) && y(A) && E(T) && M(k))) return !1;
|
|
1010
|
+
const L = g[0], [F, O, H] = U(k, v, A), [D] = oe(L, null, null), te = F.length, Se = te > 0 ? F[0].length : 0;
|
|
1011
|
+
let j = O.startRow, B = O.startColumn, le = D.length, he = le > 0 ? D[0].length : 0;
|
|
1012
1012
|
if (C) {
|
|
1013
|
-
const x = Ee(F,
|
|
1014
|
-
|
|
1013
|
+
const x = Ee(F, O, H), q = x.maxRow - x.minRow + 1, V = x.maxColumn - x.minColumn + 1;
|
|
1014
|
+
j = x.minRow, B = x.minColumn, le = Math.min(le, q), he = Math.min(he, V);
|
|
1015
1015
|
}
|
|
1016
|
-
let
|
|
1017
|
-
const Bt = Math.min(te,
|
|
1018
|
-
for (let x =
|
|
1019
|
-
const
|
|
1020
|
-
|
|
1016
|
+
let ze = !1;
|
|
1017
|
+
const Bt = Math.min(te, j + le) - 1, Dt = Math.min(Se, B + he) - 1, ct = /* @__PURE__ */ new Set();
|
|
1018
|
+
for (let x = j; x <= Bt; x++) for (let q = B; q <= Dt; q++) {
|
|
1019
|
+
const V = F[x][q];
|
|
1020
|
+
ct.has(V.cell.getKey()) || V.cell.__rowSpan === 1 && V.cell.__colSpan === 1 || (Wn(V.cell), ct.add(V.cell.getKey()), ze = !0);
|
|
1021
1021
|
}
|
|
1022
1022
|
let [we] = oe(k.getWritable(), null, null);
|
|
1023
|
-
const
|
|
1024
|
-
for (let x = 0; x <
|
|
1023
|
+
const Pt = le - te + j;
|
|
1024
|
+
for (let x = 0; x < Pt; x++)
|
|
1025
1025
|
qe(we[te - 1][0].cell);
|
|
1026
|
-
const
|
|
1027
|
-
for (let x = 0; x <
|
|
1028
|
-
|
|
1026
|
+
const It = he - Se + B;
|
|
1027
|
+
for (let x = 0; x < It; x++)
|
|
1028
|
+
Xe(we[0][Se - 1].cell, !0, !1);
|
|
1029
1029
|
[we] = oe(k.getWritable(), null, null);
|
|
1030
|
-
for (let x =
|
|
1031
|
-
const
|
|
1032
|
-
if (We.startRow !==
|
|
1030
|
+
for (let x = j; x < j + le; x++) for (let q = B; q < B + he; q++) {
|
|
1031
|
+
const V = x - j, ut = q - B, We = D[V][ut];
|
|
1032
|
+
if (We.startRow !== V || We.startColumn !== ut) continue;
|
|
1033
1033
|
const ye = We.cell;
|
|
1034
1034
|
if (ye.__rowSpan !== 1 || ye.__colSpan !== 1) {
|
|
1035
|
-
const
|
|
1036
|
-
for (let
|
|
1037
|
-
const qt = we[
|
|
1038
|
-
|
|
1035
|
+
const Q = [], Jt = Math.min(x + ye.__rowSpan, j + le) - 1, Yt = Math.min(q + ye.__colSpan, B + he) - 1;
|
|
1036
|
+
for (let Be = x; Be <= Jt; Be++) for (let De = q; De <= Yt; De++) {
|
|
1037
|
+
const qt = we[Be][De];
|
|
1038
|
+
Q.push(qt.cell);
|
|
1039
1039
|
}
|
|
1040
|
-
Ln(
|
|
1040
|
+
Ln(Q), ze = !0;
|
|
1041
1041
|
}
|
|
1042
|
-
const { cell:
|
|
1043
|
-
ye.getChildren().forEach((
|
|
1044
|
-
Ce(
|
|
1045
|
-
}), Ut.forEach((
|
|
1042
|
+
const { cell: He } = we[x][q], Ut = He.getChildren();
|
|
1043
|
+
ye.getChildren().forEach((Q) => {
|
|
1044
|
+
Ce(Q) && J().append(Q), He.append(Q);
|
|
1045
|
+
}), Ut.forEach((Q) => Q.remove());
|
|
1046
1046
|
}
|
|
1047
|
-
if (C &&
|
|
1047
|
+
if (C && ze) {
|
|
1048
1048
|
const [x] = oe(k.getWritable(), null, null);
|
|
1049
|
-
x[
|
|
1049
|
+
x[O.startRow][O.startColumn].cell.selectEnd();
|
|
1050
1050
|
}
|
|
1051
1051
|
return !0;
|
|
1052
|
-
},
|
|
1053
|
-
const a =
|
|
1052
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(ge, () => {
|
|
1053
|
+
const a = z(), c = Ue(), g = l.getAndClearNextFocus();
|
|
1054
1054
|
if (g !== null) {
|
|
1055
1055
|
const { focusCell: d } = g;
|
|
1056
|
-
if (
|
|
1057
|
-
if (d !== l.anchorCell &&
|
|
1056
|
+
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 && G(a, n)) return l.$setFocusCellForSelection(d), !0;
|
|
1058
1058
|
}
|
|
1059
1059
|
if (l.getAndClearShouldCheckSelection() && $(c) && $(a) && a.isCollapsed()) {
|
|
1060
1060
|
const d = a.anchor.getNode(), m = n.getFirstChild(), C = be(d);
|
|
@@ -1064,46 +1064,46 @@ function Xn(n, e, t, o) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
if ($(a)) {
|
|
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,
|
|
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, L = a.isBackward();
|
|
1068
1068
|
if (k) {
|
|
1069
1069
|
const F = a.clone();
|
|
1070
1070
|
if (T) {
|
|
1071
|
-
const [
|
|
1072
|
-
F.focus.set(
|
|
1071
|
+
const [O] = U(n, b, b), H = O[0][0].cell, D = O[O.length - 1].at(-1).cell;
|
|
1072
|
+
F.focus.set(L ? H.getKey() : D.getKey(), L ? H.getChildrenSize() : D.getChildrenSize(), "element");
|
|
1073
1073
|
} else if (v) {
|
|
1074
|
-
const [
|
|
1075
|
-
F.anchor.set(
|
|
1074
|
+
const [O] = U(n, N, N), H = O[0][0].cell, D = O[O.length - 1].at(-1).cell;
|
|
1075
|
+
F.anchor.set(L ? D.getKey() : H.getKey(), L ? D.getChildrenSize() : 0, "element");
|
|
1076
1076
|
}
|
|
1077
|
-
ne(F),
|
|
1078
|
-
} else if (
|
|
1077
|
+
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() && $(c) && c.isCollapsed())) {
|
|
1079
1079
|
const F = be(c.anchor.getNode());
|
|
1080
1080
|
F && !F.is(b) && (l.$setAnchorCellForSelection(se(l, F)), l.$setFocusCellForSelection(se(l, b), !0), l.pointerType = null);
|
|
1081
1081
|
}
|
|
1082
|
-
} else if (a &&
|
|
1082
|
+
} else if (a && K(a) && a.is(c) && a.tableKey === n.getKey()) {
|
|
1083
1083
|
const d = $e(s);
|
|
1084
1084
|
if (d && d.anchorNode && d.focusNode) {
|
|
1085
1085
|
const m = re(d.focusNode), C = m && !n.isParentOf(m), S = re(d.anchorNode), N = S && n.isParentOf(S);
|
|
1086
1086
|
if (C && N && d.rangeCount > 0) {
|
|
1087
|
-
const b =
|
|
1087
|
+
const b = yn(d, t);
|
|
1088
1088
|
b && (b.anchor.set(n.getKey(), a.isBackward() ? n.getChildrenSize() : 0, "element"), d.removeAllRanges(), ne(b));
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
|
-
return a && !a.is(c) && (
|
|
1093
|
-
m.$enableHighlightStyle(),
|
|
1092
|
+
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
|
+
m.$enableHighlightStyle(), it(m.table, (C) => {
|
|
1094
1094
|
const S = C.elem;
|
|
1095
|
-
C.highlighted = !1,
|
|
1095
|
+
C.highlighted = !1, Wt(d, C), S.getAttribute("style") || S.removeAttribute("style");
|
|
1096
1096
|
});
|
|
1097
|
-
})(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() &&
|
|
1098
|
-
},
|
|
1099
|
-
const a =
|
|
1100
|
-
if (!$(a) || !a.isCollapsed() || !
|
|
1101
|
-
const c =
|
|
1102
|
-
return !!c && (
|
|
1103
|
-
},
|
|
1097
|
+
})(t, l) : !l.hasHijackedSelectionStyles && n.isSelected() && bt(t, l), !1);
|
|
1098
|
+
}, Y)), l.listenersToRemove.add(t.registerCommand(At, () => {
|
|
1099
|
+
const a = z();
|
|
1100
|
+
if (!$(a) || !a.isCollapsed() || !G(a, n)) return !1;
|
|
1101
|
+
const c = vt(t, a, n);
|
|
1102
|
+
return !!c && (Nt(c, n), !0);
|
|
1103
|
+
}, Y)), l;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return n[
|
|
1105
|
+
function wt(n) {
|
|
1106
|
+
return n[Ve] || null;
|
|
1107
1107
|
}
|
|
1108
1108
|
function Me(n) {
|
|
1109
1109
|
let e = n;
|
|
@@ -1117,7 +1117,7 @@ function Me(n) {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
return null;
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function yt(n, e) {
|
|
1121
1121
|
if (!n.contains(e)) return null;
|
|
1122
1122
|
let t = null;
|
|
1123
1123
|
for (let o = e; o != null; o = o.parentNode) {
|
|
@@ -1158,14 +1158,14 @@ function pe(n, e) {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
return o.columns = s + 1, o.rows = l + 1, o;
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Ke(n, e, t) {
|
|
1162
1162
|
const o = new Set(t ? t.getNodes() : []);
|
|
1163
|
-
|
|
1163
|
+
it(e, (r, s) => {
|
|
1164
1164
|
const l = r.elem;
|
|
1165
|
-
o.has(s) ? (r.highlighted = !0,
|
|
1165
|
+
o.has(s) ? (r.highlighted = !0, zt(n, r)) : (r.highlighted = !1, Wt(n, r), l.getAttribute("style") || l.removeAttribute("style"));
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function it(n, e) {
|
|
1169
1169
|
const { domRows: t } = n;
|
|
1170
1170
|
for (let o = 0; o < t.length; o++) {
|
|
1171
1171
|
const r = t[o];
|
|
@@ -1177,9 +1177,9 @@ function at(n, e) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
e.$disableHighlightStyle(),
|
|
1182
|
-
t.highlighted = !0,
|
|
1180
|
+
function bt(n, e) {
|
|
1181
|
+
e.$disableHighlightStyle(), it(e.table, (t) => {
|
|
1182
|
+
t.highlighted = !0, zt(n, t);
|
|
1183
1183
|
});
|
|
1184
1184
|
}
|
|
1185
1185
|
const Yn = (n, e, t, o, r) => {
|
|
@@ -1187,16 +1187,16 @@ const Yn = (n, e, t, o, r) => {
|
|
|
1187
1187
|
switch (r) {
|
|
1188
1188
|
case "backward":
|
|
1189
1189
|
case "forward":
|
|
1190
|
-
return t !== (s ? n.table.columns - 1 : 0) ?
|
|
1190
|
+
return t !== (s ? n.table.columns - 1 : 0) ? Ae(e.getCellNodeFromCordsOrThrow(t + (s ? 1 : -1), o, n.table), s) : o !== (s ? n.table.rows - 1 : 0) ? Ae(e.getCellNodeFromCordsOrThrow(s ? 0 : n.table.columns - 1, o + (s ? 1 : -1), n.table), s) : s ? e.selectNext() : e.selectPrevious(), !0;
|
|
1191
1191
|
case "up":
|
|
1192
|
-
return o !== 0 ?
|
|
1192
|
+
return o !== 0 ? Ae(e.getCellNodeFromCordsOrThrow(t, o - 1, n.table), !1) : e.selectPrevious(), !0;
|
|
1193
1193
|
case "down":
|
|
1194
|
-
return o !== n.table.rows - 1 ?
|
|
1194
|
+
return o !== n.table.rows - 1 ? Ae(e.getCellNodeFromCordsOrThrow(t, o + 1, n.table), !0) : e.selectNext(), !0;
|
|
1195
1195
|
default:
|
|
1196
1196
|
return !1;
|
|
1197
1197
|
}
|
|
1198
1198
|
};
|
|
1199
|
-
function
|
|
1199
|
+
function Ie(n, e) {
|
|
1200
1200
|
let t, o;
|
|
1201
1201
|
if (e.startColumn === n.minColumn) t = "minColumn";
|
|
1202
1202
|
else {
|
|
@@ -1210,7 +1210,7 @@ function Je(n, e) {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
return [t, o];
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function Oe([n, e]) {
|
|
1214
1214
|
return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"];
|
|
1215
1215
|
}
|
|
1216
1216
|
function de(n, e, [t, o]) {
|
|
@@ -1221,16 +1221,16 @@ function de(n, e, [t, o]) {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
function qn(n, e, t, o, r) {
|
|
1223
1223
|
const s = Ee(e, t, o), l = (function(v, T) {
|
|
1224
|
-
const { minColumn: k, maxColumn:
|
|
1225
|
-
let
|
|
1226
|
-
const Se = v[
|
|
1227
|
-
for (let
|
|
1228
|
-
for (let
|
|
1229
|
-
return { bottomSpan: te, leftSpan:
|
|
1224
|
+
const { minColumn: k, maxColumn: A, minRow: L, maxRow: F } = T;
|
|
1225
|
+
let O = 1, H = 1, D = 1, te = 1;
|
|
1226
|
+
const Se = v[L], j = v[F];
|
|
1227
|
+
for (let B = k; B <= A; B++) O = Math.max(O, Se[B].cell.__rowSpan), te = Math.max(te, j[B].cell.__rowSpan);
|
|
1228
|
+
for (let B = L; B <= F; B++) H = Math.max(H, v[B][k].cell.__colSpan), D = Math.max(D, v[B][A].cell.__colSpan);
|
|
1229
|
+
return { bottomSpan: te, leftSpan: H, rightSpan: D, topSpan: O };
|
|
1230
1230
|
})(e, s), { topSpan: i, leftSpan: u, bottomSpan: f, rightSpan: h } = l, p = (function(v, T) {
|
|
1231
|
-
const k =
|
|
1231
|
+
const k = Ie(v, T);
|
|
1232
1232
|
return k === null && w(249, T.cell.getKey()), k;
|
|
1233
|
-
})(s, t), [_, a] =
|
|
1233
|
+
})(s, t), [_, a] = Oe(p);
|
|
1234
1234
|
let c = s[_], g = s[a];
|
|
1235
1235
|
r === "forward" ? c += _ === "maxColumn" ? 1 : u : r === "backward" ? c -= _ === "minColumn" ? 1 : h : r === "down" ? g += a === "maxRow" ? 1 : i : r === "up" && (g -= a === "minRow" ? 1 : f);
|
|
1236
1236
|
const d = e[g];
|
|
@@ -1238,30 +1238,30 @@ function qn(n, e, t, o, r) {
|
|
|
1238
1238
|
const m = d[c];
|
|
1239
1239
|
if (m === void 0) return !1;
|
|
1240
1240
|
const [C, S] = (function(v, T, k) {
|
|
1241
|
-
const
|
|
1242
|
-
if (
|
|
1243
|
-
const F =
|
|
1244
|
-
if (F) return [de(v,
|
|
1245
|
-
const
|
|
1246
|
-
return [de(v,
|
|
1241
|
+
const A = Ee(v, T, k), L = Ie(A, T);
|
|
1242
|
+
if (L) return [de(v, A, L), de(v, A, Oe(L))];
|
|
1243
|
+
const F = Ie(A, k);
|
|
1244
|
+
if (F) return [de(v, A, Oe(F)), de(v, A, F)];
|
|
1245
|
+
const O = ["minColumn", "minRow"];
|
|
1246
|
+
return [de(v, A, O), de(v, A, Oe(O))];
|
|
1247
1247
|
})(e, t, m), N = se(n, C.cell), b = se(n, S.cell);
|
|
1248
1248
|
return n.$setAnchorCellForSelection(N), n.$setFocusCellForSelection(b, !0), !0;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1251
|
-
if ($(n) ||
|
|
1250
|
+
function G(n, e) {
|
|
1251
|
+
if ($(n) || K(n)) {
|
|
1252
1252
|
const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
|
|
1253
1253
|
return t && o;
|
|
1254
1254
|
}
|
|
1255
1255
|
return !1;
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function Ae(n, e) {
|
|
1258
1258
|
e ? n.selectStart() : n.selectEnd();
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function zt(n, e) {
|
|
1261
1261
|
const t = e.elem, o = n._config.theme;
|
|
1262
1262
|
y(re(t)) || w(131), Z(t, o.tableCellSelected);
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function Wt(n, e) {
|
|
1265
1265
|
const t = e.elem;
|
|
1266
1266
|
y(re(t)) || w(131);
|
|
1267
1267
|
const o = n._config.theme;
|
|
@@ -1275,43 +1275,43 @@ function _e(n) {
|
|
|
1275
1275
|
const e = R(n, M);
|
|
1276
1276
|
return M(e) ? e : null;
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
const i =
|
|
1280
|
-
if (
|
|
1278
|
+
function Xn(n, e, t, o, r, s, l) {
|
|
1279
|
+
const i = xn(t.focus, r ? "previous" : "next");
|
|
1280
|
+
if (Rn(i)) return !1;
|
|
1281
1281
|
let u = i;
|
|
1282
|
-
for (const d of
|
|
1283
|
-
if (!
|
|
1282
|
+
for (const d of dt(i).iterNodeCarets("shadowRoot")) {
|
|
1283
|
+
if (!Tn(d) || !P(d.origin)) return !1;
|
|
1284
1284
|
u = d;
|
|
1285
1285
|
}
|
|
1286
1286
|
const f = u.getParentAtCaret();
|
|
1287
1287
|
if (!y(f)) return !1;
|
|
1288
1288
|
const h = f, p = (function(d) {
|
|
1289
|
-
for (const m of
|
|
1289
|
+
for (const m of dt(d).iterNodeCarets("root")) {
|
|
1290
1290
|
const { origin: C } = m;
|
|
1291
1291
|
if (y(C)) {
|
|
1292
|
-
if (
|
|
1292
|
+
if (ft(m)) return Fn(C, d.direction);
|
|
1293
1293
|
} else if (!E(C)) break;
|
|
1294
1294
|
}
|
|
1295
1295
|
return null;
|
|
1296
|
-
})(
|
|
1296
|
+
})(gt(h, u.direction)), _ = R(h, M);
|
|
1297
1297
|
if (!_ || !_.is(s)) return !1;
|
|
1298
1298
|
const a = n.getElementByKey(h.getKey()), c = Me(a);
|
|
1299
1299
|
if (!a || !c) return !1;
|
|
1300
|
-
const g =
|
|
1300
|
+
const g = jn(n, _);
|
|
1301
1301
|
if (l.table = g, p) if (o === "extend") {
|
|
1302
1302
|
const d = Me(n.getElementByKey(p.origin.getKey()));
|
|
1303
1303
|
if (!d) return !1;
|
|
1304
1304
|
l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(d, !0);
|
|
1305
1305
|
} else {
|
|
1306
|
-
const d =
|
|
1306
|
+
const d = mt(p);
|
|
1307
1307
|
Fe(t.anchor, d), Fe(t.focus, d);
|
|
1308
1308
|
}
|
|
1309
1309
|
else if (o === "extend") l.$setAnchorCellForSelection(c), l.$setFocusCellForSelection(c, !0);
|
|
1310
1310
|
else {
|
|
1311
1311
|
const d = (function(m) {
|
|
1312
1312
|
const C = Kn(m);
|
|
1313
|
-
return
|
|
1314
|
-
})(
|
|
1313
|
+
return ft(C) ? mt(C) : m;
|
|
1314
|
+
})(gt(_, i.direction));
|
|
1315
1315
|
Fe(t.anchor, d), Fe(t.focus, d);
|
|
1316
1316
|
}
|
|
1317
1317
|
return ee(e), !0;
|
|
@@ -1321,13 +1321,13 @@ function Ht(n, e, t, o, r) {
|
|
|
1321
1321
|
const i = l.getRootElement();
|
|
1322
1322
|
return i ? i.hasAttribute("aria-controls") && i.getAttribute("aria-controls") === "typeahead-menu" : !1;
|
|
1323
1323
|
})(n)) return !1;
|
|
1324
|
-
const s =
|
|
1325
|
-
if (!
|
|
1324
|
+
const s = z();
|
|
1325
|
+
if (!G(s, o)) {
|
|
1326
1326
|
if ($(s)) {
|
|
1327
1327
|
if (t === "backward") {
|
|
1328
1328
|
if (s.focus.offset > 0) return !1;
|
|
1329
1329
|
const l = (function(u) {
|
|
1330
|
-
for (let f = u, h = u; h !== null; f = h, h = h.getParent()) if (
|
|
1330
|
+
for (let f = u, h = u; h !== null; f = h, h = h.getParent()) if (P(h)) {
|
|
1331
1331
|
if (h !== f && h.getFirstChild() !== f) return null;
|
|
1332
1332
|
if (!h.isInline()) return h;
|
|
1333
1333
|
}
|
|
@@ -1345,13 +1345,13 @@ function Ht(n, e, t, o, r) {
|
|
|
1345
1345
|
const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
|
|
1346
1346
|
if (!u) return !1;
|
|
1347
1347
|
let f = 0;
|
|
1348
|
-
t === "up" &&
|
|
1348
|
+
t === "up" && P(u) && (f = u.getChildrenSize());
|
|
1349
1349
|
let h = u;
|
|
1350
|
-
t === "up" &&
|
|
1350
|
+
t === "up" && P(u) && (h = u.getLastChild() || u, f = Ce(h) ? h.getTextContentSize() : 0);
|
|
1351
1351
|
const p = s.clone();
|
|
1352
1352
|
return p.focus.set(h.getKey(), f, Ce(h) ? "text" : "element"), ne(p), ee(e), !0;
|
|
1353
1353
|
}
|
|
1354
|
-
if (
|
|
1354
|
+
if (vn(l)) {
|
|
1355
1355
|
const i = t === "up" ? s.getNodes()[s.getNodes().length - 1] : s.getNodes()[0];
|
|
1356
1356
|
if (i && xe(o, i) !== null) {
|
|
1357
1357
|
const u = o.getFirstDescendant(), f = o.getLastDescendant();
|
|
@@ -1362,7 +1362,7 @@ function Ht(n, e, t, o, r) {
|
|
|
1362
1362
|
return !1;
|
|
1363
1363
|
}
|
|
1364
1364
|
{
|
|
1365
|
-
let i = R(l, (f) =>
|
|
1365
|
+
let i = R(l, (f) => P(f) && !f.isInline());
|
|
1366
1366
|
if (y(i) && (i = R(i, M)), !i) return !1;
|
|
1367
1367
|
const u = t === "down" ? i.getNextSibling() : i.getPreviousSibling();
|
|
1368
1368
|
if (M(u) && r.tableNodeKey === u.getKey()) {
|
|
@@ -1374,11 +1374,11 @@ function Ht(n, e, t, o, r) {
|
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
1377
|
-
return t === "down" &&
|
|
1377
|
+
return t === "down" && Qe(n) && r.setShouldCheckSelection(), !1;
|
|
1378
1378
|
}
|
|
1379
1379
|
if ($(s)) {
|
|
1380
1380
|
if (t === "backward" || t === "forward")
|
|
1381
|
-
return
|
|
1381
|
+
return Xn(n, e, s, e.shiftKey ? "extend" : "move", t === "backward", o, r);
|
|
1382
1382
|
if (s.isCollapsed()) {
|
|
1383
1383
|
const { anchor: l, focus: i } = s, u = R(l.getNode(), y), f = R(i.getNode(), y);
|
|
1384
1384
|
if (!y(u) || !u.is(f)) return !1;
|
|
@@ -1392,7 +1392,7 @@ function Ht(n, e, t, o, r) {
|
|
|
1392
1392
|
let a;
|
|
1393
1393
|
if (l.type === "element") a = _.getBoundingClientRect();
|
|
1394
1394
|
else {
|
|
1395
|
-
const m = $e(
|
|
1395
|
+
const m = $e(st(n));
|
|
1396
1396
|
if (m === null || m.rangeCount === 0) return !1;
|
|
1397
1397
|
a = m.getRangeAt(0).getBoundingClientRect();
|
|
1398
1398
|
}
|
|
@@ -1412,7 +1412,7 @@ function Ht(n, e, t, o, r) {
|
|
|
1412
1412
|
return !0;
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
-
} else if (
|
|
1415
|
+
} else if (K(s)) {
|
|
1416
1416
|
const { anchor: l, focus: i } = s, u = R(l.getNode(), y), f = R(i.getNode(), y), [h] = s.getNodes();
|
|
1417
1417
|
M(h) || w(251);
|
|
1418
1418
|
const p = ae(h, n.getElementByKey(h.getKey()));
|
|
@@ -1420,7 +1420,7 @@ function Ht(n, e, t, o, r) {
|
|
|
1420
1420
|
r.$updateTableTableSelection(s);
|
|
1421
1421
|
const _ = pe(h, p), a = o.getCordsFromCellNode(u, _), c = o.getDOMCellFromCordsOrThrow(a.x, a.y, _);
|
|
1422
1422
|
if (r.$setAnchorCellForSelection(c), ee(e), e.shiftKey) {
|
|
1423
|
-
const [g, d, m] =
|
|
1423
|
+
const [g, d, m] = U(o, u, f);
|
|
1424
1424
|
return qn(r, g, d, m, t);
|
|
1425
1425
|
}
|
|
1426
1426
|
return f.selectEnd(), !0;
|
|
@@ -1430,14 +1430,14 @@ function Ht(n, e, t, o, r) {
|
|
|
1430
1430
|
function ee(n) {
|
|
1431
1431
|
n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1434
|
-
const o =
|
|
1433
|
+
function Nt(n, e, t) {
|
|
1434
|
+
const o = J();
|
|
1435
1435
|
n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1437
|
+
function vt(n, e, t) {
|
|
1438
1438
|
const o = t.getParent();
|
|
1439
1439
|
if (!o) return;
|
|
1440
|
-
const r = $e(
|
|
1440
|
+
const r = $e(st(n));
|
|
1441
1441
|
if (!r) return;
|
|
1442
1442
|
const s = r.anchorNode, l = n.getElementByKey(o.getKey()), i = ae(t, n.getElementByKey(t.getKey()));
|
|
1443
1443
|
if (!s || !l || !i || !l.contains(s) || i.contains(s)) return;
|
|
@@ -1445,17 +1445,17 @@ function xt(n, e, t) {
|
|
|
1445
1445
|
if (!u) return;
|
|
1446
1446
|
const f = R(u, (C) => M(C));
|
|
1447
1447
|
if (!M(f) || !f.is(t)) return;
|
|
1448
|
-
const [h, p] =
|
|
1448
|
+
const [h, p] = U(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
1449
|
return d ? "first" : m ? "last" : void 0;
|
|
1450
1450
|
}
|
|
1451
1451
|
function se(n, e) {
|
|
1452
1452
|
const { tableNode: t } = n.$lookup(), o = t.getCordsFromCellNode(e, n.table);
|
|
1453
1453
|
return t.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
|
|
1454
1454
|
}
|
|
1455
|
-
function
|
|
1455
|
+
function Ge(n, e, t) {
|
|
1456
1456
|
return xe(n, re(e, t));
|
|
1457
1457
|
}
|
|
1458
|
-
function
|
|
1458
|
+
function xt(n, e, t) {
|
|
1459
1459
|
if (!e.theme.tableAlignment) return;
|
|
1460
1460
|
const o = [], r = [];
|
|
1461
1461
|
for (const s of ["center", "right"]) {
|
|
@@ -1464,14 +1464,14 @@ function Rt(n, e, t) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
me(n, ...o), Z(n, ...r);
|
|
1466
1466
|
}
|
|
1467
|
-
const
|
|
1468
|
-
function
|
|
1469
|
-
return
|
|
1467
|
+
const Ze = /* @__PURE__ */ new WeakSet();
|
|
1468
|
+
function Qe(n = Ft()) {
|
|
1469
|
+
return Ze.has(n);
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1472
|
-
e ?
|
|
1471
|
+
function ho(n, e) {
|
|
1472
|
+
e ? Ze.add(n) : Ze.delete(n);
|
|
1473
1473
|
}
|
|
1474
|
-
class ce extends
|
|
1474
|
+
class ce extends et {
|
|
1475
1475
|
__rowStriping;
|
|
1476
1476
|
__frozenColumnCount;
|
|
1477
1477
|
__frozenRowCount;
|
|
@@ -1493,10 +1493,10 @@ class ce extends tt {
|
|
|
1493
1493
|
super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount;
|
|
1494
1494
|
}
|
|
1495
1495
|
static importDOM() {
|
|
1496
|
-
return { table: (e) => ({ conversion:
|
|
1496
|
+
return { table: (e) => ({ conversion: Vn, priority: 1 }) };
|
|
1497
1497
|
}
|
|
1498
1498
|
static importJSON(e) {
|
|
1499
|
-
return
|
|
1499
|
+
return at().updateFromJSON(e);
|
|
1500
1500
|
}
|
|
1501
1501
|
updateFromJSON(e) {
|
|
1502
1502
|
return super.updateFromJSON(e).setRowStriping(e.rowStriping || !1).setFrozenColumns(e.frozenColumnCount || 0).setFrozenRows(e.frozenRowCount || 0).setColWidths(e.colWidths);
|
|
@@ -1518,7 +1518,7 @@ class ce extends tt {
|
|
|
1518
1518
|
const o = document.createElement("table");
|
|
1519
1519
|
this.__style && (o.style.cssText = this.__style);
|
|
1520
1520
|
const r = document.createElement("colgroup");
|
|
1521
|
-
if (o.appendChild(r),
|
|
1521
|
+
if (o.appendChild(r), Qt(r), Z(o, e.theme.table), this.updateTableElement(null, o, e), Qe(t)) {
|
|
1522
1522
|
const s = document.createElement("div"), l = e.theme.tableScrollableWrapper;
|
|
1523
1523
|
return l ? Z(s, l) : s.style.cssText = "overflow-x: auto;", s.appendChild(o), this.updateTableWrapper(null, s, o, e), s;
|
|
1524
1524
|
}
|
|
@@ -1543,18 +1543,18 @@ class ce extends tt {
|
|
|
1543
1543
|
_ && (p.style.width = `${_}px`), f.push(p);
|
|
1544
1544
|
}
|
|
1545
1545
|
u.replaceChildren(...f);
|
|
1546
|
-
})(t, 0, this.getColumnCount(), this.getColWidths()),
|
|
1546
|
+
})(t, 0, this.getColumnCount(), this.getColWidths()), xt(t, o, this.getFormatType());
|
|
1547
1547
|
}
|
|
1548
1548
|
updateDOM(e, t, o) {
|
|
1549
1549
|
const r = this.getDOMSlot(t).element;
|
|
1550
|
-
return t === r ===
|
|
1550
|
+
return t === r === Qe() || (ve(s = t) && s.nodeName === "DIV" && this.updateTableWrapper(e, t, r, o), this.updateTableElement(e, r, o), !1);
|
|
1551
1551
|
var s;
|
|
1552
1552
|
}
|
|
1553
1553
|
exportDOM(e) {
|
|
1554
1554
|
const t = super.exportDOM(e), { element: o } = t;
|
|
1555
1555
|
return { after: (r) => {
|
|
1556
1556
|
if (t.after && (r = t.after(r)), !fe(r) && ve(r) && (r = r.querySelector("table")), !fe(r)) return null;
|
|
1557
|
-
|
|
1557
|
+
xt(r, e._config, this.getFormatType());
|
|
1558
1558
|
const [s] = oe(this, null, null), l = /* @__PURE__ */ new Map();
|
|
1559
1559
|
for (const h of s) for (const p of h) {
|
|
1560
1560
|
const _ = p.cell.getKey();
|
|
@@ -1598,7 +1598,7 @@ class ce extends tt {
|
|
|
1598
1598
|
if (l != null) for (let i = 0; i < l.length; i++) {
|
|
1599
1599
|
const u = l[i];
|
|
1600
1600
|
if (u == null) continue;
|
|
1601
|
-
const { elem: f } = u, h =
|
|
1601
|
+
const { elem: f } = u, h = Ge(this, f);
|
|
1602
1602
|
if (h !== null && e.is(h)) return { x: i, y: s };
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
@@ -1662,19 +1662,19 @@ class ce extends tt {
|
|
|
1662
1662
|
}), t;
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
function
|
|
1665
|
+
function jn(n, e) {
|
|
1666
1666
|
const t = n.getElementByKey(e.getKey());
|
|
1667
1667
|
return t === null && w(230), pe(e, t);
|
|
1668
1668
|
}
|
|
1669
|
-
function
|
|
1670
|
-
const e =
|
|
1669
|
+
function Vn(n) {
|
|
1670
|
+
const e = at();
|
|
1671
1671
|
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
1672
|
const t = n.querySelector(":scope > colgroup");
|
|
1673
1673
|
if (t) {
|
|
1674
1674
|
let o = [];
|
|
1675
1675
|
for (const r of t.querySelectorAll(":scope > col")) {
|
|
1676
1676
|
let s = r.style.width || "";
|
|
1677
|
-
if (!
|
|
1677
|
+
if (!rt.test(s) && (s = r.getAttribute("width") || "", !/^\d+$/.test(s))) {
|
|
1678
1678
|
o = void 0;
|
|
1679
1679
|
break;
|
|
1680
1680
|
}
|
|
@@ -1682,30 +1682,30 @@ function Qn(n) {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
o && e.setColWidths(o);
|
|
1684
1684
|
}
|
|
1685
|
-
return { after: (o) =>
|
|
1685
|
+
return { after: (o) => Rt(o, E), node: e };
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return
|
|
1687
|
+
function at() {
|
|
1688
|
+
return tt(new ce());
|
|
1689
1689
|
}
|
|
1690
1690
|
function M(n) {
|
|
1691
1691
|
return n instanceof ce;
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1694
|
-
const o =
|
|
1693
|
+
function Gn({ rows: n, columns: e, includeHeaders: t }) {
|
|
1694
|
+
const o = z() || Ue();
|
|
1695
1695
|
if (!o || !$(o) || _e(o.anchor.getNode())) return !1;
|
|
1696
|
-
const r =
|
|
1697
|
-
|
|
1696
|
+
const r = $n(Number(n), Number(e), t);
|
|
1697
|
+
Vt(r);
|
|
1698
1698
|
const s = r.getFirstDescendant();
|
|
1699
1699
|
return Ce(s) && s.select(), !0;
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1702
|
-
E(n.getParent()) ? n.isEmpty() && n.append(
|
|
1701
|
+
function Zn(n) {
|
|
1702
|
+
E(n.getParent()) ? n.isEmpty() && n.append(J()) : n.remove();
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1705
|
-
M(n.getParent()) ?
|
|
1704
|
+
function Qn(n) {
|
|
1705
|
+
M(n.getParent()) ? Tt(n, y) : n.remove();
|
|
1706
1706
|
}
|
|
1707
|
-
function
|
|
1708
|
-
|
|
1707
|
+
function eo(n) {
|
|
1708
|
+
Tt(n, E);
|
|
1709
1709
|
const [e] = oe(n, null, null), t = e.reduce((r, s) => Math.max(r, s.length), 0), o = n.getChildren();
|
|
1710
1710
|
for (let r = 0; r < e.length; ++r) {
|
|
1711
1711
|
const s = o[r];
|
|
@@ -1713,22 +1713,22 @@ function to(n) {
|
|
|
1713
1713
|
E(s) || w(254, s.constructor.name, s.getType());
|
|
1714
1714
|
const l = e[r].reduce((i, u) => u ? 1 + i : i, 0);
|
|
1715
1715
|
if (l !== t) for (let i = l; i < t; ++i) {
|
|
1716
|
-
const u =
|
|
1717
|
-
u.append(
|
|
1716
|
+
const u = X();
|
|
1717
|
+
u.append(J()), s.append(u);
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
|
-
function
|
|
1721
|
+
function to(n) {
|
|
1722
1722
|
if (n.detail < 3 || !Ne(n.target)) return !1;
|
|
1723
1723
|
const e = re(n.target);
|
|
1724
1724
|
if (e === null) return !1;
|
|
1725
|
-
const t = R(e, (o) =>
|
|
1725
|
+
const t = R(e, (o) => P(o) && !o.isInline());
|
|
1726
1726
|
return t === null ? !1 : !!y(t.getParent()) && (t.select(0), !0);
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function fo(n) {
|
|
1729
1729
|
return n.registerNodeTransform(ue, (e) => {
|
|
1730
1730
|
if (e.getColSpan() > 1 || e.getRowSpan() > 1) {
|
|
1731
|
-
const [, , t] = I(e), [o] =
|
|
1731
|
+
const [, , t] = I(e), [o] = U(t, e, e), r = o.length, s = o[0].length;
|
|
1732
1732
|
let l = t.getFirstChild();
|
|
1733
1733
|
E(l) || w(175);
|
|
1734
1734
|
const i = [];
|
|
@@ -1740,8 +1740,8 @@ function go(n) {
|
|
|
1740
1740
|
if (p.startRow === u && p.startColumn === h) f = _, i.push(_);
|
|
1741
1741
|
else if (_.getColSpan() > 1 || _.getRowSpan() > 1) {
|
|
1742
1742
|
y(_) || w(176);
|
|
1743
|
-
const a =
|
|
1744
|
-
f !== null ? f.insertAfter(a) :
|
|
1743
|
+
const a = X(_.__headerState);
|
|
1744
|
+
f !== null ? f.insertAfter(a) : jt(l, a);
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
}
|
|
@@ -1749,9 +1749,9 @@ function go(n) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
|
-
function
|
|
1752
|
+
function go(n, e = !0) {
|
|
1753
1753
|
const t = /* @__PURE__ */ new Map(), o = (s, l, i) => {
|
|
1754
|
-
const u = ae(s, i), f =
|
|
1754
|
+
const u = ae(s, i), f = Jn(s, u, n, e);
|
|
1755
1755
|
t.set(l, [f, u]);
|
|
1756
1756
|
}, r = n.registerMutationListener(ce, (s) => {
|
|
1757
1757
|
n.getEditorState().read(() => {
|
|
@@ -1769,34 +1769,34 @@ function mo(n, e = !0) {
|
|
|
1769
1769
|
for (const [, [s]] of t) s.removeListeners();
|
|
1770
1770
|
};
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1773
|
-
return n.hasNodes([ce]) || w(255),
|
|
1772
|
+
function mo(n) {
|
|
1773
|
+
return n.hasNodes([ce]) || w(255), Xt(n.registerCommand(kn, Gn, Pe), n.registerCommand(Kt, ({ nodes: e, selection: t }, o) => n !== o || !$(t) ? !1 : _e(t.anchor.getNode()) !== null && e.some(M), Pe), n.registerCommand(on, to, Pe), n.registerNodeTransform(ce, eo), n.registerNodeTransform(Te, Qn), n.registerNodeTransform(ue, Zn));
|
|
1774
1774
|
}
|
|
1775
1775
|
export {
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
zn as B,
|
|
1776
|
+
E as $,
|
|
1777
|
+
lo as B,
|
|
1779
1778
|
Et as D,
|
|
1780
|
-
|
|
1781
|
-
|
|
1779
|
+
Te as E,
|
|
1780
|
+
X as F,
|
|
1781
|
+
so as I,
|
|
1782
|
+
$n as L,
|
|
1783
|
+
Re as M,
|
|
1782
1784
|
mo as N,
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1785
|
+
y as O,
|
|
1786
|
+
kt as P,
|
|
1787
|
+
_e as Q,
|
|
1786
1788
|
io as U,
|
|
1787
|
-
co as
|
|
1788
|
-
Me as W,
|
|
1789
|
-
_e as Z,
|
|
1789
|
+
co as Z,
|
|
1790
1790
|
ae as a,
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1791
|
+
Qe as b,
|
|
1792
|
+
fo as c,
|
|
1793
|
+
oe as g,
|
|
1794
|
+
ce as h,
|
|
1795
|
+
ao as j,
|
|
1796
|
+
uo as l,
|
|
1797
|
+
ho as u,
|
|
1798
|
+
ue as x,
|
|
1799
1799
|
go as y,
|
|
1800
|
-
|
|
1800
|
+
Me as z
|
|
1801
1801
|
};
|
|
1802
|
-
//# sourceMappingURL=LexicalTable.prod-
|
|
1802
|
+
//# sourceMappingURL=LexicalTable.prod-Oa2YPHLl.js.map
|