@uva-glass/component-library 1.59.1 → 1.59.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Lexical.prod-CO0gPAfo.js → Lexical.prod-BhH9TCLN.js} +952 -944
- package/dist/Lexical.prod-BhH9TCLN.js.map +1 -0
- package/dist/{LexicalList.prod-BceA-cJD.js → LexicalList.prod-Czb3Osbz.js} +25 -23
- package/dist/LexicalList.prod-Czb3Osbz.js.map +1 -0
- package/dist/{LexicalUtils.prod-PbdOb6JG.js → LexicalUtils.prod-Bsuvahba.js} +20 -20
- package/dist/{LexicalUtils.prod-PbdOb6JG.js.map → LexicalUtils.prod-Bsuvahba.js.map} +1 -1
- package/dist/{TablePlugin-Cj6IBz2k.js → TablePlugin-deK-rcE1.js} +32 -32
- package/dist/{TablePlugin-Cj6IBz2k.js.map → TablePlugin-deK-rcE1.js.map} +1 -1
- package/dist/assets/Periods.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.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/Periods/Periods.js +28 -25
- package/dist/components/Periods/Periods.js.map +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/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +11 -11
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +2 -2
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +1 -1
- 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 +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +25 -25
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +505 -505
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-Ec7CfNnA.js → helpers-BRIyyVa6.js} +23 -23
- package/dist/{helpers-Ec7CfNnA.js.map → helpers-BRIyyVa6.js.map} +1 -1
- package/dist/{helpers-BewZrn6E.js → helpers-CaU5T9i-.js} +462 -423
- package/dist/helpers-CaU5T9i-.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +9 -9
- package/dist/Lexical.prod-CO0gPAfo.js.map +0 -1
- package/dist/LexicalList.prod-BceA-cJD.js.map +0 -1
- package/dist/helpers-BewZrn6E.js.map +0 -1
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
1
|
+
import { i as Ze, $ as ue, t as N, U as Qe } from "./LexicalUtils.prod-Bsuvahba.js";
|
|
2
|
+
import { C as Nt, X as xt, i as et, m as T, j as vt, N as tt, J as nt, w as ve, k as ot, c as $, v as rt, n as De, a as st, P as Ne, p as Ae, T as Le, F as V, x as A, A as P, q as Tt, s as lt, u as Ot, z as Et, B, E as Mt, G as Ft, f as Te, l as Oe, y as Ee, U as Rt, t as Kt, H as Y, I as kt, L as Q, Q as Pt, R as Dt, V as At, W as Lt, Y as Ht, a0 as He, a1 as Bt, a2 as Wt, a3 as It, a4 as zt, d as Ut, a5 as Jt, a6 as Yt, a7 as Xt, a8 as jt, a9 as se, M as qt, aa as q, ab as $t, o as Gt, ac as ae, ad as Vt, D as it, ae as Zt, af as Qt, ag as en, ah as Be } from "./Lexical.prod-BhH9TCLN.js";
|
|
3
|
+
function tn(n) {
|
|
4
4
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
tn(function(n) {
|
|
7
7
|
const e = new URLSearchParams();
|
|
8
8
|
e.append("code", n);
|
|
9
9
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
10
10
|
throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
11
11
|
});
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
const e = {}
|
|
12
|
+
const nn = /* @__PURE__ */ new Map();
|
|
13
|
+
function on(n) {
|
|
14
|
+
const e = {};
|
|
15
|
+
if (!n) return e;
|
|
16
|
+
const t = n.split(";");
|
|
15
17
|
for (const o of t) if (o !== "") {
|
|
16
18
|
const [s, r] = o.split(/:([^]+)/);
|
|
17
19
|
s && r && (e[s.trim()] = r.trim());
|
|
18
20
|
}
|
|
19
21
|
return e;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function at(n, e) {
|
|
22
24
|
const t = n.getStartEndPoints();
|
|
23
25
|
if (e.isSelected(n) && !e.isSegmented() && !e.isToken() && t !== null) {
|
|
24
26
|
const [o, s] = t, r = n.isBackward(), l = o.getNode(), a = s.getNode(), d = e.is(l), h = e.is(a);
|
|
25
27
|
if (d || h) {
|
|
26
|
-
const [i, c] =
|
|
27
|
-
let
|
|
28
|
-
return u ? (w = i > c ? c : i,
|
|
28
|
+
const [i, c] = Nt(n), u = l.is(a), g = e.is(r ? a : l), f = e.is(r ? l : a);
|
|
29
|
+
let p, w = 0;
|
|
30
|
+
return u ? (w = i > c ? c : i, p = i > c ? i : c) : g ? (w = r ? c : i, p = void 0) : f && (w = 0, p = r ? i : c), e.__text = e.__text.slice(w, p), e;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
return e;
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
const e = n.getStyle(), t =
|
|
35
|
-
|
|
35
|
+
function rn(n) {
|
|
36
|
+
const e = n.getStyle(), t = on(e);
|
|
37
|
+
nn.set(e, t);
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
const t =
|
|
39
|
-
return
|
|
39
|
+
function kn(n, e) {
|
|
40
|
+
const t = xt(n.focus, e);
|
|
41
|
+
return et(t) && !t.isIsolated() || T(t) && !t.isInline() && !t.canBeEmpty();
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function sn(n, e, t, o) {
|
|
42
44
|
n.modify(e ? "extend" : "move", t, o);
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function ln(n) {
|
|
45
47
|
const e = n.anchor.getNode();
|
|
46
|
-
return (
|
|
48
|
+
return (vt(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
47
49
|
}
|
|
48
|
-
function
|
|
49
|
-
const o =
|
|
50
|
-
|
|
50
|
+
function Pn(n, e, t) {
|
|
51
|
+
const o = ln(n);
|
|
52
|
+
sn(n, e, t ? !o : o, "character");
|
|
51
53
|
}
|
|
52
|
-
function
|
|
54
|
+
function an(n, e) {
|
|
53
55
|
const t = e.body ? e.body.childNodes : [];
|
|
54
56
|
let o = [];
|
|
55
57
|
const s = [];
|
|
56
58
|
for (let r = 0; r < t.length; r++) {
|
|
57
59
|
const l = t[r];
|
|
58
|
-
if (!
|
|
59
|
-
const a =
|
|
60
|
+
if (!ut.has(l.nodeName)) {
|
|
61
|
+
const a = dt(l, n, s, !1);
|
|
60
62
|
a !== null && (o = o.concat(a));
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
return function(r) {
|
|
64
|
-
for (const l of r) l.getNextSibling() instanceof
|
|
66
|
+
for (const l of r) l.getNextSibling() instanceof tt && l.insertAfter(nt());
|
|
65
67
|
for (const l of r) {
|
|
66
68
|
const a = l.getChildren();
|
|
67
69
|
for (const d of a) l.insertBefore(d);
|
|
@@ -69,49 +71,49 @@ function ln(n, e) {
|
|
|
69
71
|
}
|
|
70
72
|
}(s), o;
|
|
71
73
|
}
|
|
72
|
-
function
|
|
74
|
+
function cn(n, e) {
|
|
73
75
|
if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
|
|
74
76
|
const t = document.createElement("div"), o = ve().getChildren();
|
|
75
77
|
for (let s = 0; s < o.length; s++)
|
|
76
|
-
|
|
78
|
+
ct(n, o[s], t, e);
|
|
77
79
|
return t.innerHTML;
|
|
78
80
|
}
|
|
79
|
-
function
|
|
81
|
+
function ct(n, e, t, o = null) {
|
|
80
82
|
let s = o === null || e.isSelected(o);
|
|
81
|
-
const r =
|
|
83
|
+
const r = T(e) && e.excludeFromCopy("html");
|
|
82
84
|
let l = e;
|
|
83
85
|
if (o !== null) {
|
|
84
|
-
let g =
|
|
85
|
-
g =
|
|
86
|
+
let g = ot(e);
|
|
87
|
+
g = $(g) && o !== null ? at(o, g) : g, l = g;
|
|
86
88
|
}
|
|
87
|
-
const a =
|
|
89
|
+
const a = T(l) ? l.getChildren() : [], d = n._nodes.get(l.getType());
|
|
88
90
|
let h;
|
|
89
91
|
h = d && d.exportDOM !== void 0 ? d.exportDOM(n, l) : l.exportDOM(n);
|
|
90
92
|
const { element: i, after: c } = h;
|
|
91
93
|
if (!i) return !1;
|
|
92
94
|
const u = document.createDocumentFragment();
|
|
93
95
|
for (let g = 0; g < a.length; g++) {
|
|
94
|
-
const f = a[g],
|
|
95
|
-
!s &&
|
|
96
|
+
const f = a[g], p = ct(n, f, u, o);
|
|
97
|
+
!s && T(e) && p && e.extractWithChild(f, o, "html") && (s = !0);
|
|
96
98
|
}
|
|
97
99
|
if (s && !r) {
|
|
98
|
-
if ((
|
|
100
|
+
if ((rt(i) || De(i)) && i.append(u), t.append(i), c) {
|
|
99
101
|
const g = c.call(l, i);
|
|
100
|
-
g && (
|
|
102
|
+
g && (De(i) ? i.replaceChildren(g) : i.replaceWith(g));
|
|
101
103
|
}
|
|
102
104
|
} else t.append(u);
|
|
103
105
|
return s;
|
|
104
106
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
107
|
+
const ut = /* @__PURE__ */ new Set(["STYLE", "SCRIPT"]);
|
|
108
|
+
function dt(n, e, t, o, s = /* @__PURE__ */ new Map(), r) {
|
|
107
109
|
let l = [];
|
|
108
|
-
if (
|
|
110
|
+
if (ut.has(n.nodeName)) return l;
|
|
109
111
|
let a = null;
|
|
110
|
-
const d = function(f,
|
|
111
|
-
const { nodeName: w } = f, C =
|
|
112
|
+
const d = function(f, p) {
|
|
113
|
+
const { nodeName: w } = f, C = p._htmlConversions.get(w.toLowerCase());
|
|
112
114
|
let _ = null;
|
|
113
|
-
if (C !== void 0) for (const
|
|
114
|
-
const v =
|
|
115
|
+
if (C !== void 0) for (const O of C) {
|
|
116
|
+
const v = O(f);
|
|
115
117
|
v !== null && (_ === null || (_.priority || 0) < (v.priority || 0)) && (_ = v);
|
|
116
118
|
}
|
|
117
119
|
return _ !== null ? _.conversion : null;
|
|
@@ -121,23 +123,23 @@ function ct(n, e, t, o, s = /* @__PURE__ */ new Map(), r) {
|
|
|
121
123
|
i = h.after;
|
|
122
124
|
const f = h.node;
|
|
123
125
|
if (a = Array.isArray(f) ? f[f.length - 1] : f, a !== null) {
|
|
124
|
-
for (const [,
|
|
126
|
+
for (const [, p] of s) if (a = p(a, r), !a) break;
|
|
125
127
|
a && l.push(...Array.isArray(f) ? f : [a]);
|
|
126
128
|
}
|
|
127
129
|
h.forChild != null && s.set(n.nodeName, h.forChild);
|
|
128
130
|
}
|
|
129
131
|
const c = n.childNodes;
|
|
130
132
|
let u = [];
|
|
131
|
-
const g = (a == null || !
|
|
132
|
-
for (let f = 0; f < c.length; f++) u.push(...
|
|
133
|
-
return i != null && (u = i(u)),
|
|
134
|
-
const f = new
|
|
133
|
+
const g = (a == null || !st(a)) && (a != null && Ne(a) || o);
|
|
134
|
+
for (let f = 0; f < c.length; f++) u.push(...dt(c[f], e, t, g, new Map(s), a));
|
|
135
|
+
return i != null && (u = i(u)), Ae(n) && (u = un(n, u, g ? () => {
|
|
136
|
+
const f = new tt();
|
|
135
137
|
return t.push(f), f;
|
|
136
|
-
} :
|
|
137
|
-
return f.nextSibling == null || f.previousSibling == null ? !1 :
|
|
138
|
-
}(n) && (l = l.concat(
|
|
138
|
+
} : V)), a == null ? u.length > 0 ? l = l.concat(u) : Ae(n) && function(f) {
|
|
139
|
+
return f.nextSibling == null || f.previousSibling == null ? !1 : Le(f.nextSibling) && Le(f.previousSibling);
|
|
140
|
+
}(n) && (l = l.concat(nt())) : T(a) && a.append(...u), l;
|
|
139
141
|
}
|
|
140
|
-
function
|
|
142
|
+
function un(n, e, t) {
|
|
141
143
|
const o = n.style.textAlign, s = [];
|
|
142
144
|
let r = [];
|
|
143
145
|
for (let l = 0; l < e.length; l++) {
|
|
@@ -150,77 +152,79 @@ function cn(n, e, t) {
|
|
|
150
152
|
}
|
|
151
153
|
return s;
|
|
152
154
|
}
|
|
153
|
-
function
|
|
155
|
+
function dn(n) {
|
|
154
156
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
155
157
|
}
|
|
156
|
-
var pe =
|
|
158
|
+
var pe = dn(function(n) {
|
|
157
159
|
const e = new URLSearchParams();
|
|
158
160
|
e.append("code", n);
|
|
159
161
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
160
162
|
throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
161
163
|
});
|
|
162
|
-
const
|
|
163
|
-
function
|
|
164
|
-
return e == null && pe(166),
|
|
164
|
+
const hn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, ht = (n) => hn ? (n || window).getSelection() : null;
|
|
165
|
+
function gn(n, e = P()) {
|
|
166
|
+
return e == null && pe(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : cn(n, e);
|
|
165
167
|
}
|
|
166
|
-
function
|
|
167
|
-
return e == null && pe(166),
|
|
168
|
+
function fn(n, e = P()) {
|
|
169
|
+
return e == null && pe(166), A(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(mn(n, e));
|
|
168
170
|
}
|
|
169
|
-
function
|
|
171
|
+
function Dn(n, e, t) {
|
|
170
172
|
const o = n.getData("application/x-lexical-editor");
|
|
171
173
|
if (o) try {
|
|
172
174
|
const l = JSON.parse(o);
|
|
173
175
|
if (l.namespace === t._config.namespace && Array.isArray(l.nodes))
|
|
174
|
-
return
|
|
176
|
+
return We(t, pn(l.nodes), e);
|
|
175
177
|
} catch {
|
|
176
178
|
}
|
|
177
179
|
const s = n.getData("text/html");
|
|
178
180
|
if (s) try {
|
|
179
|
-
const l = new DOMParser().parseFromString(
|
|
180
|
-
|
|
181
|
+
const l = new DOMParser().parseFromString(function(a) {
|
|
182
|
+
return window.trustedTypes && window.trustedTypes.createPolicy ? window.trustedTypes.createPolicy("lexical", { createHTML: (d) => d }).createHTML(a) : a;
|
|
183
|
+
}(s), "text/html");
|
|
184
|
+
return We(t, an(t, l), e);
|
|
181
185
|
} catch {
|
|
182
186
|
}
|
|
183
187
|
const r = n.getData("text/plain") || n.getData("text/uri-list");
|
|
184
|
-
if (r != null) if (
|
|
188
|
+
if (r != null) if (A(e)) {
|
|
185
189
|
const l = r.split(/(\r?\n|\t)/);
|
|
186
190
|
l[l.length - 1] === "" && l.pop();
|
|
187
191
|
for (let a = 0; a < l.length; a++) {
|
|
188
|
-
const d =
|
|
189
|
-
if (
|
|
192
|
+
const d = P();
|
|
193
|
+
if (A(d)) {
|
|
190
194
|
const h = l[a];
|
|
191
195
|
h === `
|
|
192
196
|
` || h === `\r
|
|
193
|
-
` ? d.insertParagraph() : h === " " ? d.insertNodes([
|
|
197
|
+
` ? d.insertParagraph() : h === " " ? d.insertNodes([Tt()]) : d.insertText(h);
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
} else e.insertRawText(r);
|
|
197
201
|
}
|
|
198
|
-
function
|
|
199
|
-
n.dispatchCommand(
|
|
202
|
+
function We(n, e, t) {
|
|
203
|
+
n.dispatchCommand(lt, { nodes: e, selection: t }) || t.insertNodes(e);
|
|
200
204
|
}
|
|
201
|
-
function
|
|
205
|
+
function gt(n, e, t, o = []) {
|
|
202
206
|
let s = e === null || t.isSelected(e);
|
|
203
|
-
const r =
|
|
207
|
+
const r = T(t) && t.excludeFromCopy("html");
|
|
204
208
|
let l = t;
|
|
205
209
|
if (e !== null) {
|
|
206
|
-
let h =
|
|
207
|
-
h =
|
|
210
|
+
let h = ot(t);
|
|
211
|
+
h = $(h) && e !== null ? at(e, h) : h, l = h;
|
|
208
212
|
}
|
|
209
|
-
const a =
|
|
213
|
+
const a = T(l) ? l.getChildren() : [], d = function(h) {
|
|
210
214
|
const i = h.exportJSON(), c = h.constructor;
|
|
211
|
-
if (i.type !== c.getType() && pe(58, c.name),
|
|
215
|
+
if (i.type !== c.getType() && pe(58, c.name), T(h)) {
|
|
212
216
|
const u = i.children;
|
|
213
217
|
Array.isArray(u) || pe(59, c.name);
|
|
214
218
|
}
|
|
215
219
|
return i;
|
|
216
220
|
}(l);
|
|
217
|
-
if (
|
|
221
|
+
if ($(l)) {
|
|
218
222
|
const h = l.__text;
|
|
219
223
|
h.length > 0 ? d.text = h : s = !1;
|
|
220
224
|
}
|
|
221
225
|
for (let h = 0; h < a.length; h++) {
|
|
222
|
-
const i = a[h], c =
|
|
223
|
-
!s &&
|
|
226
|
+
const i = a[h], c = gt(n, e, i, d.children);
|
|
227
|
+
!s && T(t) && c && t.extractWithChild(i, e, "clone") && (s = !0);
|
|
224
228
|
}
|
|
225
229
|
if (s && !r) o.push(d);
|
|
226
230
|
else if (Array.isArray(d.children)) for (let h = 0; h < d.children.length; h++) {
|
|
@@ -229,73 +233,73 @@ function dt(n, e, t, o = []) {
|
|
|
229
233
|
}
|
|
230
234
|
return s;
|
|
231
235
|
}
|
|
232
|
-
function
|
|
236
|
+
function mn(n, e) {
|
|
233
237
|
const t = [], o = ve().getChildren();
|
|
234
238
|
for (let s = 0; s < o.length; s++)
|
|
235
|
-
|
|
239
|
+
gt(n, e, o[s], t);
|
|
236
240
|
return { namespace: n._config.namespace, nodes: t };
|
|
237
241
|
}
|
|
238
|
-
function
|
|
242
|
+
function pn(n) {
|
|
239
243
|
const e = [];
|
|
240
244
|
for (let t = 0; t < n.length; t++) {
|
|
241
|
-
const o = n[t], s =
|
|
242
|
-
|
|
245
|
+
const o = n[t], s = Ot(o);
|
|
246
|
+
$(s) && rn(s), e.push(s);
|
|
243
247
|
}
|
|
244
248
|
return e;
|
|
245
249
|
}
|
|
246
|
-
let
|
|
247
|
-
async function
|
|
248
|
-
if (
|
|
250
|
+
let ee = null;
|
|
251
|
+
async function wn(n, e, t) {
|
|
252
|
+
if (ee !== null) return !1;
|
|
249
253
|
if (e !== null) return new Promise((d, h) => {
|
|
250
254
|
n.update(() => {
|
|
251
|
-
d(
|
|
255
|
+
d(Ie(n, e, t));
|
|
252
256
|
});
|
|
253
257
|
});
|
|
254
|
-
const o = n.getRootElement(), s = n._window == null ? window.document : n._window.document, r =
|
|
258
|
+
const o = n.getRootElement(), s = n._window == null ? window.document : n._window.document, r = ht(n._window);
|
|
255
259
|
if (o === null || r === null) return !1;
|
|
256
260
|
const l = s.createElement("span");
|
|
257
261
|
l.style.cssText = "position: fixed; top: -1000px;", l.append(s.createTextNode("#")), o.append(l);
|
|
258
262
|
const a = new Range();
|
|
259
263
|
return a.setStart(l, 0), a.setEnd(l, 1), r.removeAllRanges(), r.addRange(a), new Promise((d, h) => {
|
|
260
|
-
const i = n.registerCommand(
|
|
261
|
-
|
|
262
|
-
i(),
|
|
264
|
+
const i = n.registerCommand(Et, (c) => (Ze(c, ClipboardEvent) && (i(), ee !== null && (window.clearTimeout(ee), ee = null), d(Ie(n, c, t))), !0), B);
|
|
265
|
+
ee = window.setTimeout(() => {
|
|
266
|
+
i(), ee = null, d(!1);
|
|
263
267
|
}, 50), s.execCommand("copy"), l.remove();
|
|
264
268
|
});
|
|
265
269
|
}
|
|
266
|
-
function
|
|
270
|
+
function Ie(n, e, t) {
|
|
267
271
|
if (t === void 0) {
|
|
268
|
-
const s =
|
|
272
|
+
const s = ht(n._window);
|
|
269
273
|
if (!s) return !1;
|
|
270
274
|
const r = s.anchorNode, l = s.focusNode;
|
|
271
|
-
if (r !== null && l !== null && !
|
|
272
|
-
const a =
|
|
275
|
+
if (r !== null && l !== null && !Mt(n, r, l)) return !1;
|
|
276
|
+
const a = P();
|
|
273
277
|
if (a === null) return !1;
|
|
274
|
-
t =
|
|
278
|
+
t = ft(a);
|
|
275
279
|
}
|
|
276
280
|
e.preventDefault();
|
|
277
281
|
const o = e.clipboardData;
|
|
278
|
-
return o !== null && (
|
|
282
|
+
return o !== null && (Sn(o, t), !0);
|
|
279
283
|
}
|
|
280
|
-
const
|
|
281
|
-
function
|
|
284
|
+
const Cn = [["text/html", gn], ["application/x-lexical-editor", fn]];
|
|
285
|
+
function ft(n = P()) {
|
|
282
286
|
const e = { "text/plain": n ? n.getTextContent() : "" };
|
|
283
287
|
if (n) {
|
|
284
|
-
const t =
|
|
285
|
-
for (const [o, s] of
|
|
288
|
+
const t = Ft();
|
|
289
|
+
for (const [o, s] of Cn) {
|
|
286
290
|
const r = s(t, n);
|
|
287
291
|
r !== null && (e[o] = r);
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
return e;
|
|
291
295
|
}
|
|
292
|
-
function
|
|
296
|
+
function Sn(n, e) {
|
|
293
297
|
for (const t in e) {
|
|
294
298
|
const o = e[t];
|
|
295
299
|
o !== void 0 && n.setData(t, o);
|
|
296
300
|
}
|
|
297
301
|
}
|
|
298
|
-
const
|
|
302
|
+
const Me = /^(\d+(?:\.\d+)?)px$/, W = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
|
|
299
303
|
class de extends Ee {
|
|
300
304
|
static getType() {
|
|
301
305
|
return "tablecell";
|
|
@@ -307,7 +311,7 @@ class de extends Ee {
|
|
|
307
311
|
super.afterCloneFrom(e), this.__rowSpan = e.__rowSpan, this.__backgroundColor = e.__backgroundColor;
|
|
308
312
|
}
|
|
309
313
|
static importDOM() {
|
|
310
|
-
return { td: (e) => ({ conversion:
|
|
314
|
+
return { td: (e) => ({ conversion: ze, priority: 0 }), th: (e) => ({ conversion: ze, priority: 0 }) };
|
|
311
315
|
}
|
|
312
316
|
static importJSON(e) {
|
|
313
317
|
const t = e.colSpan || 1, o = e.rowSpan || 1;
|
|
@@ -397,20 +401,20 @@ class de extends Ee {
|
|
|
397
401
|
return !1;
|
|
398
402
|
}
|
|
399
403
|
}
|
|
400
|
-
function
|
|
404
|
+
function ze(n) {
|
|
401
405
|
const e = n, t = n.nodeName.toLowerCase();
|
|
402
406
|
let o;
|
|
403
|
-
|
|
407
|
+
Me.test(e.style.width) && (o = parseFloat(e.style.width));
|
|
404
408
|
const s = oe(t === "th" ? W.ROW : W.NO_STATUS, e.colSpan, o);
|
|
405
409
|
s.__rowSpan = e.rowSpan;
|
|
406
410
|
const r = e.style.backgroundColor;
|
|
407
411
|
r !== "" && (s.__backgroundColor = r);
|
|
408
|
-
const l = e.style, a = l.textDecoration.split(" "), d = l.fontWeight === "700" || l.fontWeight === "bold", h = a.includes("line-through"), i = l.fontStyle === "italic", c = a.includes("underline");
|
|
409
|
-
return { after: (u) => (u.length === 0 && u.push(
|
|
410
|
-
if (
|
|
411
|
-
const f =
|
|
412
|
-
return
|
|
413
|
-
` ? null : (
|
|
412
|
+
const l = e.style, a = (l && l.textDecoration || "").split(" "), d = l.fontWeight === "700" || l.fontWeight === "bold", h = a.includes("line-through"), i = l.fontStyle === "italic", c = a.includes("underline");
|
|
413
|
+
return { after: (u) => (u.length === 0 && u.push(V()), u), forChild: (u, g) => {
|
|
414
|
+
if (m(g) && !T(u)) {
|
|
415
|
+
const f = V();
|
|
416
|
+
return Rt(u) && u.getTextContent() === `
|
|
417
|
+
` ? null : ($(u) && (d && u.toggleFormat("bold"), h && u.toggleFormat("strikethrough"), i && u.toggleFormat("italic"), c && u.toggleFormat("underline")), f.append(u), f);
|
|
414
418
|
}
|
|
415
419
|
return u;
|
|
416
420
|
}, node: s };
|
|
@@ -418,20 +422,20 @@ function Ie(n) {
|
|
|
418
422
|
function oe(n, e = 1, t) {
|
|
419
423
|
return Te(new de(n, e, t));
|
|
420
424
|
}
|
|
421
|
-
function
|
|
425
|
+
function m(n) {
|
|
422
426
|
return n instanceof de;
|
|
423
427
|
}
|
|
424
|
-
const
|
|
425
|
-
function
|
|
428
|
+
const An = Kt();
|
|
429
|
+
function bn(n) {
|
|
426
430
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
427
431
|
}
|
|
428
|
-
var x =
|
|
432
|
+
var x = bn(function(n) {
|
|
429
433
|
const e = new URLSearchParams();
|
|
430
434
|
e.append("code", n);
|
|
431
435
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
432
436
|
throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
433
437
|
});
|
|
434
|
-
const
|
|
438
|
+
const yn = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
|
|
435
439
|
class we extends Ee {
|
|
436
440
|
static getType() {
|
|
437
441
|
return "tablerow";
|
|
@@ -440,7 +444,7 @@ class we extends Ee {
|
|
|
440
444
|
return new we(e.__height, e.__key);
|
|
441
445
|
}
|
|
442
446
|
static importDOM() {
|
|
443
|
-
return { tr: (e) => ({ conversion:
|
|
447
|
+
return { tr: (e) => ({ conversion: _n, priority: 0 }) };
|
|
444
448
|
}
|
|
445
449
|
static importJSON(e) {
|
|
446
450
|
return he(e.height);
|
|
@@ -474,10 +478,10 @@ class we extends Ee {
|
|
|
474
478
|
return !1;
|
|
475
479
|
}
|
|
476
480
|
}
|
|
477
|
-
function
|
|
481
|
+
function _n(n) {
|
|
478
482
|
const e = n;
|
|
479
483
|
let t;
|
|
480
|
-
return
|
|
484
|
+
return Me.test(e.style.height) && (t = parseFloat(e.style.height)), { node: he(t) };
|
|
481
485
|
}
|
|
482
486
|
function he(n) {
|
|
483
487
|
return Te(new we(n));
|
|
@@ -485,21 +489,21 @@ function he(n) {
|
|
|
485
489
|
function J(n) {
|
|
486
490
|
return n instanceof we;
|
|
487
491
|
}
|
|
488
|
-
function
|
|
489
|
-
const o =
|
|
492
|
+
function Nn(n, e, t = !0) {
|
|
493
|
+
const o = Re();
|
|
490
494
|
for (let s = 0; s < n; s++) {
|
|
491
495
|
const r = he();
|
|
492
496
|
for (let l = 0; l < e; l++) {
|
|
493
497
|
let a = W.NO_STATUS;
|
|
494
498
|
typeof t == "object" ? (s === 0 && t.rows && (a |= W.ROW), l === 0 && t.columns && (a |= W.COLUMN)) : t && (s === 0 && (a |= W.ROW), l === 0 && (a |= W.COLUMN));
|
|
495
|
-
const d = oe(a), h =
|
|
499
|
+
const d = oe(a), h = V();
|
|
496
500
|
h.append(Oe()), d.append(h), r.append(d);
|
|
497
501
|
}
|
|
498
502
|
o.append(r);
|
|
499
503
|
}
|
|
500
504
|
return o;
|
|
501
505
|
}
|
|
502
|
-
function
|
|
506
|
+
function xn(n, e) {
|
|
503
507
|
const t = n.getChildren();
|
|
504
508
|
for (let o = 0; o < t.length; o++) {
|
|
505
509
|
const s = t[o];
|
|
@@ -511,11 +515,11 @@ function Nn(n, e) {
|
|
|
511
515
|
}
|
|
512
516
|
return n;
|
|
513
517
|
}
|
|
514
|
-
function
|
|
515
|
-
const [o, s, r] =
|
|
518
|
+
function ne(n, e, t) {
|
|
519
|
+
const [o, s, r] = vn(n, e, t);
|
|
516
520
|
return s === null && x(207), r === null && x(208), [o, s, r];
|
|
517
521
|
}
|
|
518
|
-
function
|
|
522
|
+
function vn(n, e, t) {
|
|
519
523
|
const o = [];
|
|
520
524
|
let s = null, r = null;
|
|
521
525
|
function l(d) {
|
|
@@ -527,13 +531,13 @@ function xn(n, e, t) {
|
|
|
527
531
|
const h = a[d];
|
|
528
532
|
J(h) || x(209);
|
|
529
533
|
for (let i = h.getFirstChild(), c = 0; i != null; i = i.getNextSibling()) {
|
|
530
|
-
|
|
534
|
+
m(i) || x(147);
|
|
531
535
|
const u = l(d);
|
|
532
536
|
for (; u[c] !== void 0; ) c++;
|
|
533
|
-
const g = { cell: i, startColumn: c, startRow: d }, { __rowSpan: f, __colSpan:
|
|
537
|
+
const g = { cell: i, startColumn: c, startRow: d }, { __rowSpan: f, __colSpan: p } = i;
|
|
534
538
|
for (let w = 0; w < f && !(d + w >= a.length); w++) {
|
|
535
539
|
const C = l(d + w);
|
|
536
|
-
for (let _ = 0; _ <
|
|
540
|
+
for (let _ = 0; _ < p; _++) C[c + _] = g;
|
|
537
541
|
}
|
|
538
542
|
e !== null && s === null && e.is(i) && (s = g), t !== null && r === null && t.is(i) && (r = g);
|
|
539
543
|
}
|
|
@@ -544,18 +548,18 @@ function le(n) {
|
|
|
544
548
|
let e;
|
|
545
549
|
if (n instanceof de) e = n;
|
|
546
550
|
else if ("__type" in n) {
|
|
547
|
-
const s = N(n,
|
|
548
|
-
|
|
551
|
+
const s = N(n, m);
|
|
552
|
+
m(s) || x(148), e = s;
|
|
549
553
|
} else {
|
|
550
|
-
const s = N(n.getNode(),
|
|
551
|
-
|
|
554
|
+
const s = N(n.getNode(), m);
|
|
555
|
+
m(s) || x(148), e = s;
|
|
552
556
|
}
|
|
553
557
|
const t = e.getParent();
|
|
554
558
|
J(t) || x(149);
|
|
555
559
|
const o = t.getParent();
|
|
556
|
-
return
|
|
560
|
+
return K(o) || x(210), [e, t, o];
|
|
557
561
|
}
|
|
558
|
-
function
|
|
562
|
+
function Ue(n) {
|
|
559
563
|
const [e, , t] = le(n), o = t.getChildren(), s = o.length, r = o[0].getChildren().length, l = new Array(s);
|
|
560
564
|
for (let a = 0; a < s; a++) l[a] = new Array(r);
|
|
561
565
|
for (let a = 0; a < s; a++) {
|
|
@@ -564,7 +568,7 @@ function ze(n) {
|
|
|
564
568
|
for (let i = 0; i < d.length; i++) {
|
|
565
569
|
for (; l[a][h]; ) h++;
|
|
566
570
|
const c = d[i], u = c.__rowSpan || 1, g = c.__colSpan || 1;
|
|
567
|
-
for (let f = 0; f < u; f++) for (let
|
|
571
|
+
for (let f = 0; f < u; f++) for (let p = 0; p < g; p++) l[a + f][h + p] = c;
|
|
568
572
|
if (e === c) return { colSpan: g, columnIndex: h, rowIndex: a, rowSpan: u };
|
|
569
573
|
h += g;
|
|
570
574
|
}
|
|
@@ -606,18 +610,27 @@ class Ce {
|
|
|
606
610
|
}
|
|
607
611
|
insertText() {
|
|
608
612
|
}
|
|
613
|
+
hasFormat(e) {
|
|
614
|
+
let t = 0;
|
|
615
|
+
this.getNodes().filter(m).forEach((s) => {
|
|
616
|
+
const r = s.getFirstChild();
|
|
617
|
+
it(r) && (t |= r.getTextFormat());
|
|
618
|
+
});
|
|
619
|
+
const o = Zt[e];
|
|
620
|
+
return !!(t & o);
|
|
621
|
+
}
|
|
609
622
|
insertNodes(e) {
|
|
610
623
|
const t = this.focus.getNode();
|
|
611
|
-
|
|
624
|
+
T(t) || x(151), Qt(t.select(0, t.getChildrenSize())).insertNodes(e);
|
|
612
625
|
}
|
|
613
626
|
getShape() {
|
|
614
627
|
const e = ae(this.anchor.key);
|
|
615
|
-
|
|
616
|
-
const t =
|
|
628
|
+
m(e) || x(152);
|
|
629
|
+
const t = Ue(e);
|
|
617
630
|
t === null && x(153);
|
|
618
631
|
const o = ae(this.focus.key);
|
|
619
|
-
|
|
620
|
-
const s =
|
|
632
|
+
m(o) || x(154);
|
|
633
|
+
const s = Ue(o);
|
|
621
634
|
s === null && x(155);
|
|
622
635
|
const r = Math.min(t.columnIndex, s.columnIndex), l = Math.max(t.columnIndex + t.colSpan - 1, s.columnIndex + s.colSpan - 1), a = Math.min(t.rowIndex, s.rowIndex), d = Math.max(t.rowIndex + t.rowSpan - 1, s.rowIndex + s.rowSpan - 1);
|
|
623
636
|
return { fromX: Math.min(r, l), fromY: Math.min(a, d), toX: Math.max(r, l), toY: Math.max(a, d) };
|
|
@@ -625,12 +638,12 @@ class Ce {
|
|
|
625
638
|
getNodes() {
|
|
626
639
|
const e = this._cachedNodes;
|
|
627
640
|
if (e !== null) return e;
|
|
628
|
-
const t = this.anchor.getNode(), o = this.focus.getNode(), s = N(t,
|
|
629
|
-
|
|
641
|
+
const t = this.anchor.getNode(), o = this.focus.getNode(), s = N(t, m), r = N(o, m);
|
|
642
|
+
m(s) || x(152), m(r) || x(154);
|
|
630
643
|
const l = s.getParent();
|
|
631
644
|
J(l) || x(156);
|
|
632
645
|
const a = l.getParent();
|
|
633
|
-
|
|
646
|
+
K(a) || x(157);
|
|
634
647
|
const d = r.getParents()[1];
|
|
635
648
|
if (d !== a) {
|
|
636
649
|
if (a.isParentOf(r)) {
|
|
@@ -642,15 +655,15 @@ class Ce {
|
|
|
642
655
|
}
|
|
643
656
|
return this.getNodes();
|
|
644
657
|
}
|
|
645
|
-
const [h, i, c] =
|
|
646
|
-
let u = Math.min(i.startColumn, c.startColumn), g = Math.min(i.startRow, c.startRow), f = Math.max(i.startColumn + i.cell.__colSpan - 1, c.startColumn + c.cell.__colSpan - 1),
|
|
658
|
+
const [h, i, c] = ne(a, s, r);
|
|
659
|
+
let u = Math.min(i.startColumn, c.startColumn), g = Math.min(i.startRow, c.startRow), f = Math.max(i.startColumn + i.cell.__colSpan - 1, c.startColumn + c.cell.__colSpan - 1), p = Math.max(i.startRow + i.cell.__rowSpan - 1, c.startRow + c.cell.__rowSpan - 1), w = u, C = g, _ = u, O = g;
|
|
647
660
|
function v(b) {
|
|
648
|
-
const { cell: y, startColumn: S, startRow:
|
|
649
|
-
u = Math.min(u, S), g = Math.min(g,
|
|
661
|
+
const { cell: y, startColumn: S, startRow: D } = b;
|
|
662
|
+
u = Math.min(u, S), g = Math.min(g, D), f = Math.max(f, S + y.__colSpan - 1), p = Math.max(p, D + y.__rowSpan - 1);
|
|
650
663
|
}
|
|
651
|
-
for (; u < w || g < C || f > _ ||
|
|
664
|
+
for (; u < w || g < C || f > _ || p > O; ) {
|
|
652
665
|
if (u < w) {
|
|
653
|
-
const b =
|
|
666
|
+
const b = O - C, y = w - 1;
|
|
654
667
|
for (let S = 0; S <= b; S++) v(h[C + S][y]);
|
|
655
668
|
w = y;
|
|
656
669
|
}
|
|
@@ -660,29 +673,29 @@ class Ce {
|
|
|
660
673
|
C = y;
|
|
661
674
|
}
|
|
662
675
|
if (f > _) {
|
|
663
|
-
const b =
|
|
676
|
+
const b = O - C, y = _ + 1;
|
|
664
677
|
for (let S = 0; S <= b; S++) v(h[C + S][y]);
|
|
665
678
|
_ = y;
|
|
666
679
|
}
|
|
667
|
-
if (
|
|
668
|
-
const b = _ - w, y =
|
|
680
|
+
if (p > O) {
|
|
681
|
+
const b = _ - w, y = O + 1;
|
|
669
682
|
for (let S = 0; S <= b; S++) v(h[y][w + S]);
|
|
670
|
-
|
|
683
|
+
O = y;
|
|
671
684
|
}
|
|
672
685
|
}
|
|
673
686
|
const R = /* @__PURE__ */ new Map([[a.getKey(), a]]);
|
|
674
|
-
let
|
|
675
|
-
for (let b = g; b <=
|
|
676
|
-
const { cell: S } = h[b][y],
|
|
677
|
-
J(
|
|
678
|
-
for (const
|
|
679
|
-
|
|
687
|
+
let E = null;
|
|
688
|
+
for (let b = g; b <= p; b++) for (let y = u; y <= f; y++) {
|
|
689
|
+
const { cell: S } = h[b][y], D = S.getParent();
|
|
690
|
+
J(D) || x(160), D !== E && R.set(D.getKey(), D), R.set(S.getKey(), S);
|
|
691
|
+
for (const L of Tn(S)) R.set(L.getKey(), L);
|
|
692
|
+
E = D;
|
|
680
693
|
}
|
|
681
694
|
const M = Array.from(R.values());
|
|
682
|
-
return
|
|
695
|
+
return en() || (this._cachedNodes = M), M;
|
|
683
696
|
}
|
|
684
697
|
getTextContent() {
|
|
685
|
-
const e = this.getNodes().filter((o) =>
|
|
698
|
+
const e = this.getNodes().filter((o) => m(o));
|
|
686
699
|
let t = "";
|
|
687
700
|
for (let o = 0; o < e.length; o++) {
|
|
688
701
|
const s = e[o], r = s.__parent, l = (e[o + 1] || {}).__parent;
|
|
@@ -699,15 +712,15 @@ function Je() {
|
|
|
699
712
|
const n = Be("root", 0, "element"), e = Be("root", 0, "element");
|
|
700
713
|
return new Ce("root", n, e);
|
|
701
714
|
}
|
|
702
|
-
function
|
|
715
|
+
function Tn(n) {
|
|
703
716
|
const e = [], t = [n];
|
|
704
717
|
for (; t.length > 0; ) {
|
|
705
718
|
const o = t.pop();
|
|
706
|
-
o === void 0 && x(112),
|
|
719
|
+
o === void 0 && x(112), T(o) && t.unshift(...o.getChildren()), o !== n && e.push(o);
|
|
707
720
|
}
|
|
708
721
|
return e;
|
|
709
722
|
}
|
|
710
|
-
class
|
|
723
|
+
class On {
|
|
711
724
|
constructor(e, t) {
|
|
712
725
|
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.trackTable(), this.isSelecting = !1, this.abortController = new AbortController(), this.listenerOptions = { signal: this.abortController.signal };
|
|
713
726
|
}
|
|
@@ -743,7 +756,7 @@ class Tn {
|
|
|
743
756
|
clearHighlight() {
|
|
744
757
|
const e = this.editor;
|
|
745
758
|
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(), e.update(() => {
|
|
746
|
-
if (!
|
|
759
|
+
if (!K(ae(this.tableNodeKey))) throw new Error("Expected TableNode.");
|
|
747
760
|
const t = e.getElementByKey(this.tableNodeKey);
|
|
748
761
|
if (!t) throw new Error("Expected to find TableElement in DOM");
|
|
749
762
|
const o = ce(t);
|
|
@@ -755,7 +768,7 @@ class Tn {
|
|
|
755
768
|
e.update(() => {
|
|
756
769
|
const t = e.getElementByKey(this.tableNodeKey);
|
|
757
770
|
if (!t) throw new Error("Expected to find TableElement in DOM");
|
|
758
|
-
|
|
771
|
+
Qe(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
|
|
759
772
|
});
|
|
760
773
|
}
|
|
761
774
|
disableHighlightStyle() {
|
|
@@ -776,19 +789,19 @@ class Tn {
|
|
|
776
789
|
const o = this.editor;
|
|
777
790
|
o.update(() => {
|
|
778
791
|
const s = ae(this.tableNodeKey);
|
|
779
|
-
if (!
|
|
792
|
+
if (!K(s)) throw new Error("Expected TableNode.");
|
|
780
793
|
if (!o.getElementByKey(this.tableNodeKey)) throw new Error("Expected to find TableElement in DOM");
|
|
781
794
|
const r = e.x, l = e.y;
|
|
782
795
|
if (this.focusCell = e, this.anchorCell !== null) {
|
|
783
|
-
const a =
|
|
796
|
+
const a = mt(o._window);
|
|
784
797
|
a && a.setBaseAndExtent(this.anchorCell.elem, 0, this.focusCell.elem, 0);
|
|
785
798
|
}
|
|
786
799
|
if (this.isHighlightingCells || this.anchorX === r && this.anchorY === l && !t) {
|
|
787
800
|
if (r === this.focusX && l === this.focusY) return;
|
|
788
801
|
} else this.isHighlightingCells = !0, this.disableHighlightStyle();
|
|
789
802
|
if (this.focusX = r, this.focusY = l, this.isHighlightingCells) {
|
|
790
|
-
const a =
|
|
791
|
-
if (this.tableSelection != null && this.anchorCellNodeKey != null &&
|
|
803
|
+
const a = Y(e.elem);
|
|
804
|
+
if (this.tableSelection != null && this.anchorCellNodeKey != null && m(a) && s.is(te(a))) {
|
|
792
805
|
const d = a.getKey();
|
|
793
806
|
this.tableSelection = this.tableSelection.clone() || Je(), this.focusCellNodeKey = d, this.tableSelection.set(this.tableNodeKey, this.anchorCellNodeKey, this.focusCellNodeKey), q(this.tableSelection), o.dispatchCommand(se, void 0), fe(o, this.table, this.tableSelection);
|
|
794
807
|
}
|
|
@@ -797,8 +810,8 @@ class Tn {
|
|
|
797
810
|
}
|
|
798
811
|
setAnchorCellForSelection(e) {
|
|
799
812
|
this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y, this.editor.update(() => {
|
|
800
|
-
const t =
|
|
801
|
-
if (
|
|
813
|
+
const t = Y(e.elem);
|
|
814
|
+
if (m(t)) {
|
|
802
815
|
const o = t.getKey();
|
|
803
816
|
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Je(), this.anchorCellNodeKey = o;
|
|
804
817
|
}
|
|
@@ -806,9 +819,9 @@ class Tn {
|
|
|
806
819
|
}
|
|
807
820
|
formatCells(e) {
|
|
808
821
|
this.editor.update(() => {
|
|
809
|
-
const t =
|
|
822
|
+
const t = P();
|
|
810
823
|
F(t) || x(11);
|
|
811
|
-
const o =
|
|
824
|
+
const o = Vt(), s = o.anchor, r = o.focus, l = t.getNodes().filter(m), a = l[0].getFirstChild(), d = it(a) ? a.getFormatFlags(e, null) : null;
|
|
812
825
|
l.forEach((h) => {
|
|
813
826
|
s.set(h.getKey(), 0, "element"), r.set(h.getKey(), h.getChildrenSize(), "element"), o.formatText(e, d);
|
|
814
827
|
}), q(t), this.editor.dispatchCommand(se, void 0);
|
|
@@ -818,13 +831,13 @@ class Tn {
|
|
|
818
831
|
const e = this.editor;
|
|
819
832
|
e.update(() => {
|
|
820
833
|
const t = ae(this.tableNodeKey);
|
|
821
|
-
if (!
|
|
822
|
-
const o =
|
|
834
|
+
if (!K(t)) throw new Error("Expected TableNode.");
|
|
835
|
+
const o = P();
|
|
823
836
|
F(o) || x(11);
|
|
824
|
-
const s = o.getNodes().filter(
|
|
837
|
+
const s = o.getNodes().filter(m);
|
|
825
838
|
s.length !== this.table.columns * this.table.rows ? (s.forEach((r) => {
|
|
826
|
-
if (
|
|
827
|
-
const l =
|
|
839
|
+
if (T(r)) {
|
|
840
|
+
const l = V(), a = Oe();
|
|
828
841
|
l.append(a), r.append(l), r.getChildren().forEach((d) => {
|
|
829
842
|
d !== l && d.remove();
|
|
830
843
|
});
|
|
@@ -833,15 +846,15 @@ class Tn {
|
|
|
833
846
|
});
|
|
834
847
|
}
|
|
835
848
|
}
|
|
836
|
-
const xe = "__lexicalTableSelection",
|
|
837
|
-
function
|
|
849
|
+
const xe = "__lexicalTableSelection", mt = (n) => yn ? (n || window).getSelection() : null;
|
|
850
|
+
function Ln(n, e, t, o) {
|
|
838
851
|
const s = t.getRootElement();
|
|
839
852
|
if (s === null) throw new Error("No root element.");
|
|
840
|
-
const r = new
|
|
853
|
+
const r = new On(t, n.getKey()), l = t._window || window;
|
|
841
854
|
(function(i, c) {
|
|
842
|
-
|
|
855
|
+
Ye(i) !== null && x(205), i[xe] = c;
|
|
843
856
|
})(e, r), r.listenersToRemove.add(() => function(i, c) {
|
|
844
|
-
|
|
857
|
+
Ye(i) === c && delete i[xe];
|
|
845
858
|
}(e, r));
|
|
846
859
|
const a = () => {
|
|
847
860
|
const i = () => {
|
|
@@ -849,7 +862,7 @@ function An(n, e, t, o) {
|
|
|
849
862
|
}, c = (u) => {
|
|
850
863
|
setTimeout(() => {
|
|
851
864
|
if (1 & ~u.buttons && r.isSelecting) return r.isSelecting = !1, l.removeEventListener("mouseup", i), void l.removeEventListener("mousemove", c);
|
|
852
|
-
const g =
|
|
865
|
+
const g = Xe(u.target);
|
|
853
866
|
g === null || r.anchorX === g.x && r.anchorY === g.y || (u.preventDefault(), r.setFocusCellForSelection(g));
|
|
854
867
|
}, 0);
|
|
855
868
|
};
|
|
@@ -858,47 +871,47 @@ function An(n, e, t, o) {
|
|
|
858
871
|
e.addEventListener("mousedown", (i) => {
|
|
859
872
|
setTimeout(() => {
|
|
860
873
|
if (i.button !== 0 || !l) return;
|
|
861
|
-
const c =
|
|
862
|
-
c !== null && (
|
|
874
|
+
const c = Xe(i.target);
|
|
875
|
+
c !== null && (U(i), r.setAnchorCellForSelection(c));
|
|
863
876
|
const { onMouseUp: u, onMouseMove: g } = a();
|
|
864
877
|
r.isSelecting = !0, l.addEventListener("mouseup", u, r.listenerOptions), l.addEventListener("mousemove", g, r.listenerOptions);
|
|
865
878
|
}, 0);
|
|
866
879
|
}, r.listenerOptions), l.addEventListener("mousedown", (i) => {
|
|
867
880
|
i.button === 0 && t.update(() => {
|
|
868
|
-
const c =
|
|
881
|
+
const c = P(), u = i.target;
|
|
869
882
|
F(c) && c.tableKey === r.tableNodeKey && s.contains(u) && r.clearHighlight();
|
|
870
883
|
});
|
|
871
|
-
}, r.listenerOptions), r.listenersToRemove.add(t.registerCommand(
|
|
872
|
-
const c =
|
|
884
|
+
}, r.listenerOptions), r.listenersToRemove.add(t.registerCommand(kt, (i) => ie(t, i, "down", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Pt, (i) => ie(t, i, "up", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Dt, (i) => ie(t, i, "backward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(At, (i) => ie(t, i, "forward", n, r), Q)), r.listenersToRemove.add(t.registerCommand(Lt, (i) => {
|
|
885
|
+
const c = P();
|
|
873
886
|
if (F(c)) {
|
|
874
|
-
const u = N(c.focus.getNode(),
|
|
875
|
-
if (
|
|
887
|
+
const u = N(c.focus.getNode(), m);
|
|
888
|
+
if (m(u)) return U(i), u.selectEnd(), !0;
|
|
876
889
|
}
|
|
877
890
|
return !1;
|
|
878
|
-
},
|
|
891
|
+
}, Q)), [Ht, He, Bt].forEach((i) => {
|
|
879
892
|
r.listenersToRemove.add(t.registerCommand(i, /* @__PURE__ */ ((c) => () => {
|
|
880
|
-
const u =
|
|
881
|
-
if (!
|
|
893
|
+
const u = P();
|
|
894
|
+
if (!G(u, n)) return !1;
|
|
882
895
|
if (F(u)) return r.clearText(), !0;
|
|
883
|
-
if (
|
|
884
|
-
const g = N(u.anchor.getNode(), (v) =>
|
|
885
|
-
if (!
|
|
886
|
-
const f = u.anchor.getNode(),
|
|
896
|
+
if (A(u)) {
|
|
897
|
+
const g = N(u.anchor.getNode(), (v) => m(v));
|
|
898
|
+
if (!m(g)) return !1;
|
|
899
|
+
const f = u.anchor.getNode(), p = u.focus.getNode(), w = n.isParentOf(f), C = n.isParentOf(p);
|
|
887
900
|
if (w && !C || C && !w) return r.clearText(), !0;
|
|
888
|
-
const _ = N(u.anchor.getNode(), (v) =>
|
|
889
|
-
if (!
|
|
890
|
-
if (c === He &&
|
|
901
|
+
const _ = N(u.anchor.getNode(), (v) => T(v)), O = _ && N(_, (v) => T(v) && m(v.getParent()));
|
|
902
|
+
if (!T(O) || !T(_)) return !1;
|
|
903
|
+
if (c === He && O.getPreviousSibling() === null) return !0;
|
|
891
904
|
}
|
|
892
905
|
return !1;
|
|
893
|
-
})(i),
|
|
906
|
+
})(i), B));
|
|
894
907
|
});
|
|
895
908
|
const d = (i) => {
|
|
896
|
-
const c =
|
|
897
|
-
if (!F(c) && !
|
|
909
|
+
const c = P();
|
|
910
|
+
if (!F(c) && !A(c)) return !1;
|
|
898
911
|
const u = n.isParentOf(c.anchor.getNode());
|
|
899
912
|
if (u !== n.isParentOf(c.focus.getNode())) {
|
|
900
|
-
const g = u ? "anchor" : "focus", f = u ? "focus" : "anchor", { key:
|
|
901
|
-
return n[c[g].isBefore(c[f]) ? "selectPrevious" : "selectNext"]()[f].set(
|
|
913
|
+
const g = u ? "anchor" : "focus", f = u ? "focus" : "anchor", { key: p, offset: w, type: C } = c[f];
|
|
914
|
+
return n[c[g].isBefore(c[f]) ? "selectPrevious" : "selectNext"]()[f].set(p, w, C), !1;
|
|
902
915
|
}
|
|
903
916
|
return !!F(c) && (i && (i.preventDefault(), i.stopPropagation()), r.clearText(), !0);
|
|
904
917
|
};
|
|
@@ -906,133 +919,133 @@ function An(n, e, t, o) {
|
|
|
906
919
|
const c = n.getCordsFromCellNode(i, r.table);
|
|
907
920
|
return n.getDOMCellFromCordsOrThrow(c.x, c.y, r.table);
|
|
908
921
|
}
|
|
909
|
-
return r.listenersToRemove.add(t.registerCommand(
|
|
910
|
-
const c =
|
|
922
|
+
return r.listenersToRemove.add(t.registerCommand(Wt, d, B)), r.listenersToRemove.add(t.registerCommand(It, d, B)), r.listenersToRemove.add(t.registerCommand(zt, (i) => {
|
|
923
|
+
const c = P();
|
|
911
924
|
if (c) {
|
|
912
|
-
if (!F(c) && !
|
|
913
|
-
|
|
925
|
+
if (!F(c) && !A(c)) return !1;
|
|
926
|
+
wn(t, Ze(i, ClipboardEvent) ? i : null, ft(c));
|
|
914
927
|
const u = d(i);
|
|
915
|
-
return
|
|
928
|
+
return A(c) ? (c.removeText(), !0) : u;
|
|
916
929
|
}
|
|
917
930
|
return !1;
|
|
918
|
-
},
|
|
919
|
-
const c =
|
|
920
|
-
if (!
|
|
931
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(Ut, (i) => {
|
|
932
|
+
const c = P();
|
|
933
|
+
if (!G(c, n)) return !1;
|
|
921
934
|
if (F(c)) return r.formatCells(i), !0;
|
|
922
|
-
if (
|
|
923
|
-
const u = N(c.anchor.getNode(), (g) =>
|
|
924
|
-
if (!
|
|
935
|
+
if (A(c)) {
|
|
936
|
+
const u = N(c.anchor.getNode(), (g) => m(g));
|
|
937
|
+
if (!m(u)) return !1;
|
|
925
938
|
}
|
|
926
939
|
return !1;
|
|
927
|
-
},
|
|
928
|
-
const c =
|
|
929
|
-
if (!F(c) || !
|
|
940
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(Jt, (i) => {
|
|
941
|
+
const c = P();
|
|
942
|
+
if (!F(c) || !G(c, n)) return !1;
|
|
930
943
|
const u = c.anchor.getNode(), g = c.focus.getNode();
|
|
931
|
-
if (!
|
|
932
|
-
const [f,
|
|
933
|
-
for (let R =
|
|
934
|
-
const M = f[R][
|
|
944
|
+
if (!m(u) || !m(g)) return !1;
|
|
945
|
+
const [f, p, w] = ne(n, u, g), C = Math.max(p.startRow, w.startRow), _ = Math.max(p.startColumn, w.startColumn), O = Math.min(p.startRow, w.startRow), v = Math.min(p.startColumn, w.startColumn);
|
|
946
|
+
for (let R = O; R <= C; R++) for (let E = v; E <= _; E++) {
|
|
947
|
+
const M = f[R][E].cell;
|
|
935
948
|
M.setFormat(i);
|
|
936
949
|
const b = M.getChildren();
|
|
937
950
|
for (let y = 0; y < b.length; y++) {
|
|
938
951
|
const S = b[y];
|
|
939
|
-
|
|
952
|
+
T(S) && !S.isInline() && S.setFormat(i);
|
|
940
953
|
}
|
|
941
954
|
}
|
|
942
955
|
return !0;
|
|
943
|
-
},
|
|
944
|
-
const c =
|
|
945
|
-
if (!
|
|
956
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(Yt, (i) => {
|
|
957
|
+
const c = P();
|
|
958
|
+
if (!G(c, n)) return !1;
|
|
946
959
|
if (F(c)) return r.clearHighlight(), !1;
|
|
947
|
-
if (
|
|
948
|
-
const u = N(c.anchor.getNode(), (g) =>
|
|
949
|
-
if (!
|
|
960
|
+
if (A(c)) {
|
|
961
|
+
const u = N(c.anchor.getNode(), (g) => m(g));
|
|
962
|
+
if (!m(u)) return !1;
|
|
950
963
|
if (typeof i == "string") {
|
|
951
|
-
const g =
|
|
952
|
-
if (g) return
|
|
964
|
+
const g = $e(t, c, n);
|
|
965
|
+
if (g) return qe(g, n, [Oe(i)]), !0;
|
|
953
966
|
}
|
|
954
967
|
}
|
|
955
968
|
return !1;
|
|
956
|
-
},
|
|
957
|
-
const c =
|
|
958
|
-
if (!
|
|
969
|
+
}, B)), o && r.listenersToRemove.add(t.registerCommand(Xt, (i) => {
|
|
970
|
+
const c = P();
|
|
971
|
+
if (!A(c) || !c.isCollapsed() || !G(c, n)) return !1;
|
|
959
972
|
const u = _e(c.anchor.getNode());
|
|
960
973
|
if (u === null) return !1;
|
|
961
|
-
|
|
974
|
+
U(i);
|
|
962
975
|
const g = n.getCordsFromCellNode(u, r.table);
|
|
963
|
-
return
|
|
964
|
-
},
|
|
965
|
-
const { nodes: c, selection: u } = i, g = u.getStartEndPoints(), f = F(u),
|
|
966
|
-
if (c.length !== 1 || !
|
|
967
|
-
const [w] = g, C = c[0], _ = C.getChildren(),
|
|
968
|
-
if (!
|
|
969
|
-
const b =
|
|
976
|
+
return pt(r, n, g.x, g.y, i.shiftKey ? "backward" : "forward"), !0;
|
|
977
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(jt, (i) => n.isSelected(), Q)), r.listenersToRemove.add(t.registerCommand(lt, (i) => {
|
|
978
|
+
const { nodes: c, selection: u } = i, g = u.getStartEndPoints(), f = F(u), p = A(u) && N(u.anchor.getNode(), (k) => m(k)) !== null && N(u.focus.getNode(), (k) => m(k)) !== null || f;
|
|
979
|
+
if (c.length !== 1 || !K(c[0]) || !p || g === null) return !1;
|
|
980
|
+
const [w] = g, C = c[0], _ = C.getChildren(), O = C.getFirstChildOrThrow().getChildrenSize(), v = C.getChildrenSize(), R = N(w.getNode(), (k) => m(k)), E = R && N(R, (k) => J(k)), M = E && N(E, (k) => K(k));
|
|
981
|
+
if (!m(R) || !J(E) || !K(M)) return !1;
|
|
982
|
+
const b = E.getIndexWithinParent(), y = Math.min(M.getChildrenSize() - 1, b + v - 1), S = R.getIndexWithinParent(), D = Math.min(E.getChildrenSize() - 1, S + O - 1), L = Math.min(S, D), H = Math.min(b, y), X = Math.max(S, D), I = Math.max(b, y), j = M.getChildren();
|
|
970
983
|
let z = 0;
|
|
971
|
-
for (let
|
|
972
|
-
const re =
|
|
984
|
+
for (let k = H; k <= I; k++) {
|
|
985
|
+
const re = j[k];
|
|
973
986
|
if (!J(re)) return !1;
|
|
974
|
-
const
|
|
975
|
-
if (!J(
|
|
976
|
-
const
|
|
977
|
-
let
|
|
978
|
-
for (let be =
|
|
979
|
-
const ge =
|
|
980
|
-
if (!
|
|
981
|
-
const
|
|
982
|
-
if (!
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
}),
|
|
987
|
+
const Ke = _[z];
|
|
988
|
+
if (!J(Ke)) return !1;
|
|
989
|
+
const bt = re.getChildren(), yt = Ke.getChildren();
|
|
990
|
+
let ke = 0;
|
|
991
|
+
for (let be = L; be <= X; be++) {
|
|
992
|
+
const ge = bt[be];
|
|
993
|
+
if (!m(ge)) return !1;
|
|
994
|
+
const Pe = yt[ke];
|
|
995
|
+
if (!m(Pe)) return !1;
|
|
996
|
+
const _t = ge.getChildren();
|
|
997
|
+
Pe.getChildren().forEach((Z) => {
|
|
998
|
+
$(Z) && V().append(Z), ge.append(Z);
|
|
999
|
+
}), _t.forEach((Z) => Z.remove()), ke++;
|
|
987
1000
|
}
|
|
988
1001
|
z++;
|
|
989
1002
|
}
|
|
990
1003
|
return !0;
|
|
991
|
-
},
|
|
992
|
-
const i =
|
|
993
|
-
if (
|
|
994
|
-
const { anchor: u, focus: g } = i, f = u.getNode(),
|
|
1004
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(se, () => {
|
|
1005
|
+
const i = P(), c = qt();
|
|
1006
|
+
if (A(i)) {
|
|
1007
|
+
const { anchor: u, focus: g } = i, f = u.getNode(), p = g.getNode(), w = _e(f), C = _e(p), _ = !(!w || !n.is(te(w))), O = !(!C || !n.is(te(C))), v = _ !== O, R = _ && O, E = i.isBackward();
|
|
995
1008
|
if (v) {
|
|
996
1009
|
const M = i.clone();
|
|
997
|
-
if (
|
|
998
|
-
const [b] =
|
|
999
|
-
M.focus.set(
|
|
1010
|
+
if (O) {
|
|
1011
|
+
const [b] = ne(n, C, C), y = b[0][0].cell, S = b[b.length - 1].at(-1).cell;
|
|
1012
|
+
M.focus.set(E ? y.getKey() : S.getKey(), E ? y.getChildrenSize() : S.getChildrenSize(), "element");
|
|
1000
1013
|
} else if (_) {
|
|
1001
|
-
const [b] =
|
|
1002
|
-
M.anchor.set(
|
|
1014
|
+
const [b] = ne(n, w, w), y = b[0][0].cell, S = b[b.length - 1].at(-1).cell;
|
|
1015
|
+
M.anchor.set(E ? S.getKey() : y.getKey(), E ? S.getChildrenSize() : 0, "element");
|
|
1003
1016
|
}
|
|
1004
|
-
q(M),
|
|
1017
|
+
q(M), je(t, r);
|
|
1005
1018
|
} else R && (w.is(C) || (r.setAnchorCellForSelection(h(w)), r.setFocusCellForSelection(h(C), !0), r.isSelecting || setTimeout(() => {
|
|
1006
1019
|
const { onMouseUp: M, onMouseMove: b } = a();
|
|
1007
1020
|
r.isSelecting = !0, l.addEventListener("mouseup", M), l.addEventListener("mousemove", b);
|
|
1008
1021
|
}, 0)));
|
|
1009
1022
|
} else if (i && F(i) && i.is(c) && i.tableKey === n.getKey()) {
|
|
1010
|
-
const u =
|
|
1023
|
+
const u = mt(t._window);
|
|
1011
1024
|
if (u && u.anchorNode && u.focusNode) {
|
|
1012
|
-
const g =
|
|
1025
|
+
const g = Y(u.focusNode), f = g && !n.is(te(g)), p = Y(u.anchorNode), w = p && n.is(te(p));
|
|
1013
1026
|
if (f && w && u.rangeCount > 0) {
|
|
1014
|
-
const C =
|
|
1027
|
+
const C = $t(u, t);
|
|
1015
1028
|
C && (C.anchor.set(n.getKey(), i.isBackward() ? n.getChildrenSize() : 0, "element"), u.removeAllRanges(), q(C));
|
|
1016
1029
|
}
|
|
1017
1030
|
}
|
|
1018
1031
|
}
|
|
1019
1032
|
return i && !i.is(c) && (F(i) || F(c)) && r.tableSelection && !r.tableSelection.is(c) ? (F(i) && i.tableKey === r.tableNodeKey ? r.updateTableTableSelection(i) : !F(i) && F(c) && c.tableKey === r.tableNodeKey && r.updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(u, g) {
|
|
1020
|
-
g.enableHighlightStyle(),
|
|
1021
|
-
const
|
|
1022
|
-
f.highlighted = !1,
|
|
1033
|
+
g.enableHighlightStyle(), Fe(g.table, (f) => {
|
|
1034
|
+
const p = f.elem;
|
|
1035
|
+
f.highlighted = !1, Ct(u, f), p.getAttribute("style") || p.removeAttribute("style");
|
|
1023
1036
|
});
|
|
1024
|
-
}(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() &&
|
|
1025
|
-
},
|
|
1026
|
-
const i =
|
|
1027
|
-
if (!
|
|
1028
|
-
const c =
|
|
1029
|
-
return !!c && (
|
|
1030
|
-
},
|
|
1037
|
+
}(t, r) : !r.hasHijackedSelectionStyles && n.isSelected() && je(t, r), !1);
|
|
1038
|
+
}, B)), r.listenersToRemove.add(t.registerCommand(Gt, () => {
|
|
1039
|
+
const i = P();
|
|
1040
|
+
if (!A(i) || !i.isCollapsed() || !G(i, n)) return !1;
|
|
1041
|
+
const c = $e(t, i, n);
|
|
1042
|
+
return !!c && (qe(c, n), !0);
|
|
1043
|
+
}, B)), r;
|
|
1031
1044
|
}
|
|
1032
|
-
function
|
|
1045
|
+
function Ye(n) {
|
|
1033
1046
|
return n[xe] || null;
|
|
1034
1047
|
}
|
|
1035
|
-
function
|
|
1048
|
+
function Xe(n) {
|
|
1036
1049
|
let e = n;
|
|
1037
1050
|
for (; e != null; ) {
|
|
1038
1051
|
const t = e.nodeName;
|
|
@@ -1077,29 +1090,29 @@ function ce(n) {
|
|
|
1077
1090
|
}
|
|
1078
1091
|
function fe(n, e, t) {
|
|
1079
1092
|
const o = new Set(t ? t.getNodes() : []);
|
|
1080
|
-
|
|
1093
|
+
Fe(e, (s, r) => {
|
|
1081
1094
|
const l = s.elem;
|
|
1082
|
-
o.has(r) ? (s.highlighted = !0,
|
|
1095
|
+
o.has(r) ? (s.highlighted = !0, wt(n, s)) : (s.highlighted = !1, Ct(n, s), l.getAttribute("style") || l.removeAttribute("style"));
|
|
1083
1096
|
});
|
|
1084
1097
|
}
|
|
1085
|
-
function
|
|
1098
|
+
function Fe(n, e) {
|
|
1086
1099
|
const { domRows: t } = n;
|
|
1087
1100
|
for (let o = 0; o < t.length; o++) {
|
|
1088
1101
|
const s = t[o];
|
|
1089
1102
|
if (s) for (let r = 0; r < s.length; r++) {
|
|
1090
1103
|
const l = s[r];
|
|
1091
1104
|
if (!l) continue;
|
|
1092
|
-
const a =
|
|
1105
|
+
const a = Y(l.elem);
|
|
1093
1106
|
a !== null && e(l, a, { x: r, y: o });
|
|
1094
1107
|
}
|
|
1095
1108
|
}
|
|
1096
1109
|
}
|
|
1097
|
-
function
|
|
1098
|
-
e.disableHighlightStyle(),
|
|
1099
|
-
t.highlighted = !0,
|
|
1110
|
+
function je(n, e) {
|
|
1111
|
+
e.disableHighlightStyle(), Fe(e.table, (t) => {
|
|
1112
|
+
t.highlighted = !0, wt(n, t);
|
|
1100
1113
|
});
|
|
1101
1114
|
}
|
|
1102
|
-
const
|
|
1115
|
+
const pt = (n, e, t, o, s) => {
|
|
1103
1116
|
const r = s === "forward";
|
|
1104
1117
|
switch (s) {
|
|
1105
1118
|
case "backward":
|
|
@@ -1112,7 +1125,7 @@ const mt = (n, e, t, o, s) => {
|
|
|
1112
1125
|
default:
|
|
1113
1126
|
return !1;
|
|
1114
1127
|
}
|
|
1115
|
-
},
|
|
1128
|
+
}, En = (n, e, t, o, s) => {
|
|
1116
1129
|
const r = s === "forward";
|
|
1117
1130
|
switch (s) {
|
|
1118
1131
|
case "backward":
|
|
@@ -1126,8 +1139,8 @@ const mt = (n, e, t, o, s) => {
|
|
|
1126
1139
|
return !1;
|
|
1127
1140
|
}
|
|
1128
1141
|
};
|
|
1129
|
-
function
|
|
1130
|
-
if (
|
|
1142
|
+
function G(n, e) {
|
|
1143
|
+
if (A(n) || F(n)) {
|
|
1131
1144
|
const t = e.isParentOf(n.anchor.getNode()), o = e.isParentOf(n.focus.getNode());
|
|
1132
1145
|
return t && o;
|
|
1133
1146
|
}
|
|
@@ -1137,107 +1150,119 @@ function me(n, e) {
|
|
|
1137
1150
|
e ? n.selectStart() : n.selectEnd();
|
|
1138
1151
|
}
|
|
1139
1152
|
const ye = "172,206,247";
|
|
1140
|
-
function pt(n, e) {
|
|
1141
|
-
const t = e.elem, o = U(t);
|
|
1142
|
-
p(o) || x(131), o.getBackgroundColor() === null ? t.style.setProperty("background-color", `rgb(${ye})`) : t.style.setProperty("background-image", `linear-gradient(to right, rgba(${ye},0.85), rgba(${ye},0.85))`), t.style.setProperty("caret-color", "transparent");
|
|
1143
|
-
}
|
|
1144
1153
|
function wt(n, e) {
|
|
1145
|
-
const t = e.elem, o =
|
|
1146
|
-
|
|
1154
|
+
const t = e.elem, o = Y(t);
|
|
1155
|
+
m(o) || x(131), o.getBackgroundColor() === null ? t.style.setProperty("background-color", `rgb(${ye})`) : t.style.setProperty("background-image", `linear-gradient(to right, rgba(${ye},0.85), rgba(${ye},0.85))`), t.style.setProperty("caret-color", "transparent");
|
|
1156
|
+
}
|
|
1157
|
+
function Ct(n, e) {
|
|
1158
|
+
const t = e.elem, o = Y(t);
|
|
1159
|
+
m(o) || x(131), o.getBackgroundColor() === null && t.style.removeProperty("background-color"), t.style.removeProperty("background-image"), t.style.removeProperty("caret-color");
|
|
1147
1160
|
}
|
|
1148
1161
|
function _e(n) {
|
|
1149
|
-
const e = N(n,
|
|
1150
|
-
return
|
|
1162
|
+
const e = N(n, m);
|
|
1163
|
+
return m(e) ? e : null;
|
|
1151
1164
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const e = N(n,
|
|
1154
|
-
return
|
|
1165
|
+
function te(n) {
|
|
1166
|
+
const e = N(n, K);
|
|
1167
|
+
return K(e) ? e : null;
|
|
1155
1168
|
}
|
|
1156
1169
|
function ie(n, e, t, o, s) {
|
|
1157
1170
|
if ((t === "up" || t === "down") && function(l) {
|
|
1158
1171
|
const a = l.getRootElement();
|
|
1159
1172
|
return a ? a.hasAttribute("aria-controls") && a.getAttribute("aria-controls") === "typeahead-menu" : !1;
|
|
1160
1173
|
}(n)) return !1;
|
|
1161
|
-
const r =
|
|
1162
|
-
if (!
|
|
1163
|
-
if (
|
|
1174
|
+
const r = P();
|
|
1175
|
+
if (!G(r, o)) {
|
|
1176
|
+
if (A(r)) {
|
|
1164
1177
|
if (r.isCollapsed() && t === "backward") {
|
|
1165
1178
|
const l = r.anchor.type, a = r.anchor.offset;
|
|
1166
1179
|
if (l !== "element" && (l !== "text" || a !== 0)) return !1;
|
|
1167
1180
|
const d = r.anchor.getNode();
|
|
1168
1181
|
if (!d) return !1;
|
|
1169
|
-
const h = N(d, (c) =>
|
|
1182
|
+
const h = N(d, (c) => T(c) && !c.isInline());
|
|
1170
1183
|
if (!h) return !1;
|
|
1171
1184
|
const i = h.getPreviousSibling();
|
|
1172
|
-
return !(!i || !
|
|
1185
|
+
return !(!i || !K(i)) && (U(e), i.selectEnd(), !0);
|
|
1173
1186
|
}
|
|
1174
1187
|
if (e.shiftKey && (t === "up" || t === "down")) {
|
|
1175
1188
|
const l = r.focus.getNode();
|
|
1176
|
-
if (
|
|
1177
|
-
|
|
1189
|
+
if (!r.isCollapsed() && (t === "up" && !r.isBackward() || t === "down" && r.isBackward())) {
|
|
1190
|
+
let a = N(l, (u) => K(u));
|
|
1191
|
+
if (m(a) && (a = N(a, K)), a !== o || !a) return !1;
|
|
1192
|
+
const d = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
|
|
1193
|
+
if (!d) return !1;
|
|
1194
|
+
let h = 0;
|
|
1195
|
+
t === "up" && T(d) && (h = d.getChildrenSize());
|
|
1196
|
+
let i = d;
|
|
1197
|
+
t === "up" && T(d) && (i = d.getLastChild() || d, h = $(i) ? i.getTextContentSize() : 0);
|
|
1198
|
+
const c = r.clone();
|
|
1199
|
+
return c.focus.set(i.getKey(), h, $(i) ? "text" : "element"), q(c), U(e), !0;
|
|
1200
|
+
}
|
|
1201
|
+
if (st(l)) {
|
|
1202
|
+
const a = t === "up" ? r.getNodes()[r.getNodes().length - 1] : r.getNodes()[0];
|
|
1178
1203
|
if (a) {
|
|
1179
|
-
const d = N(a,
|
|
1204
|
+
const d = N(a, m);
|
|
1180
1205
|
if (d && o.isParentOf(d)) {
|
|
1181
1206
|
const h = o.getFirstDescendant(), i = o.getLastDescendant();
|
|
1182
1207
|
if (!h || !i) return !1;
|
|
1183
|
-
const [c] = le(h), [u] = le(i), g = o.getCordsFromCellNode(c, s.table), f = o.getCordsFromCellNode(u, s.table),
|
|
1184
|
-
return s.setAnchorCellForSelection(
|
|
1208
|
+
const [c] = le(h), [u] = le(i), g = o.getCordsFromCellNode(c, s.table), f = o.getCordsFromCellNode(u, s.table), p = o.getDOMCellFromCordsOrThrow(g.x, g.y, s.table), w = o.getDOMCellFromCordsOrThrow(f.x, f.y, s.table);
|
|
1209
|
+
return s.setAnchorCellForSelection(p), s.setFocusCellForSelection(w, !0), !0;
|
|
1185
1210
|
}
|
|
1186
1211
|
}
|
|
1187
1212
|
return !1;
|
|
1188
1213
|
}
|
|
1189
1214
|
{
|
|
1190
|
-
|
|
1191
|
-
if (!a) return !1;
|
|
1215
|
+
let a = N(l, (h) => T(h) && !h.isInline());
|
|
1216
|
+
if (m(a) && (a = N(a, K)), !a) return !1;
|
|
1192
1217
|
const d = t === "down" ? a.getNextSibling() : a.getPreviousSibling();
|
|
1193
|
-
if (
|
|
1218
|
+
if (K(d) && s.tableNodeKey === d.getKey()) {
|
|
1194
1219
|
const h = d.getFirstDescendant(), i = d.getLastDescendant();
|
|
1195
1220
|
if (!h || !i) return !1;
|
|
1196
1221
|
const [c] = le(h), [u] = le(i), g = r.clone();
|
|
1197
|
-
return g.focus.set((t === "up" ? c : u).getKey(), t === "up" ? 0 : u.getChildrenSize(), "element"), q(g), !0;
|
|
1222
|
+
return g.focus.set((t === "up" ? c : u).getKey(), t === "up" ? 0 : u.getChildrenSize(), "element"), U(e), q(g), !0;
|
|
1198
1223
|
}
|
|
1199
1224
|
}
|
|
1200
1225
|
}
|
|
1201
1226
|
}
|
|
1202
1227
|
return !1;
|
|
1203
1228
|
}
|
|
1204
|
-
if (
|
|
1205
|
-
const { anchor: l, focus: a } = r, d = N(l.getNode(),
|
|
1206
|
-
if (!
|
|
1207
|
-
const i =
|
|
1229
|
+
if (A(r) && r.isCollapsed()) {
|
|
1230
|
+
const { anchor: l, focus: a } = r, d = N(l.getNode(), m), h = N(a.getNode(), m);
|
|
1231
|
+
if (!m(d) || !d.is(h)) return !1;
|
|
1232
|
+
const i = te(d);
|
|
1208
1233
|
if (i !== o && i != null) {
|
|
1209
1234
|
const C = n.getElementByKey(i.getKey());
|
|
1210
1235
|
if (C != null) return s.table = ce(C), ie(n, e, t, i, s);
|
|
1211
1236
|
}
|
|
1212
1237
|
if (t === "backward" || t === "forward") {
|
|
1213
|
-
const C = l.type, _ = l.offset,
|
|
1214
|
-
if (!
|
|
1238
|
+
const C = l.type, _ = l.offset, O = l.getNode();
|
|
1239
|
+
if (!O) return !1;
|
|
1215
1240
|
const v = r.getNodes();
|
|
1216
|
-
return (v.length !== 1 || !
|
|
1217
|
-
return function(y, S,
|
|
1218
|
-
return y === "element" && (
|
|
1219
|
-
}(R, M, b) || function(y, S,
|
|
1220
|
-
const
|
|
1221
|
-
if (!
|
|
1222
|
-
const
|
|
1223
|
-
return y === "text" &&
|
|
1224
|
-
}(R,
|
|
1225
|
-
}(C, _,
|
|
1226
|
-
const y = N(
|
|
1227
|
-
if (!
|
|
1228
|
-
const [S,
|
|
1229
|
-
if (!function(
|
|
1230
|
-
const
|
|
1231
|
-
return I === "backward" ?
|
|
1232
|
-
}(S,
|
|
1233
|
-
const
|
|
1234
|
-
const
|
|
1235
|
-
if (!
|
|
1236
|
-
const z =
|
|
1237
|
-
return z &&
|
|
1238
|
-
}(
|
|
1239
|
-
return !
|
|
1240
|
-
}(e,
|
|
1241
|
+
return (v.length !== 1 || !et(v[0])) && !!function(R, E, M, b) {
|
|
1242
|
+
return function(y, S, D) {
|
|
1243
|
+
return y === "element" && (D === "backward" ? S.getPreviousSibling() === null : S.getNextSibling() === null);
|
|
1244
|
+
}(R, M, b) || function(y, S, D, L) {
|
|
1245
|
+
const H = N(D, (I) => T(I) && !I.isInline());
|
|
1246
|
+
if (!H) return !1;
|
|
1247
|
+
const X = L === "backward" ? S === 0 : S === D.getTextContentSize();
|
|
1248
|
+
return y === "text" && X && (L === "backward" ? H.getPreviousSibling() === null : H.getNextSibling() === null);
|
|
1249
|
+
}(R, E, M, b);
|
|
1250
|
+
}(C, _, O, t) && function(R, E, M, b) {
|
|
1251
|
+
const y = N(E, m);
|
|
1252
|
+
if (!m(y)) return !1;
|
|
1253
|
+
const [S, D] = ne(M, y, y);
|
|
1254
|
+
if (!function(H, X, I) {
|
|
1255
|
+
const j = H[0][0], z = H[H.length - 1][H[0].length - 1], { startColumn: k, startRow: re } = X;
|
|
1256
|
+
return I === "backward" ? k === j.startColumn && re === j.startRow : k === z.startColumn && re === z.startRow;
|
|
1257
|
+
}(S, D, b)) return !1;
|
|
1258
|
+
const L = function(H, X, I) {
|
|
1259
|
+
const j = N(H, (k) => T(k) && !k.isInline());
|
|
1260
|
+
if (!j) return;
|
|
1261
|
+
const z = X === "backward" ? j.getPreviousSibling() : j.getNextSibling();
|
|
1262
|
+
return z && K(z) ? z : X === "backward" ? I.getPreviousSibling() : I.getNextSibling();
|
|
1263
|
+
}(E, b, M);
|
|
1264
|
+
return !L || K(L) ? !1 : (U(R), b === "backward" ? L.selectEnd() : L.selectStart(), !0);
|
|
1265
|
+
}(e, O, o, t);
|
|
1241
1266
|
}
|
|
1242
1267
|
const c = n.getElementByKey(d.__key), u = n.getElementByKey(l.key);
|
|
1243
1268
|
if (u == null || c == null) return !1;
|
|
@@ -1250,13 +1275,13 @@ function ie(n, e, t, o, s) {
|
|
|
1250
1275
|
}
|
|
1251
1276
|
const f = t === "up" ? d.getFirstChild() : d.getLastChild();
|
|
1252
1277
|
if (f == null) return !1;
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
const w =
|
|
1278
|
+
const p = n.getElementByKey(f.__key);
|
|
1279
|
+
if (p == null) return !1;
|
|
1280
|
+
const w = p.getBoundingClientRect();
|
|
1256
1281
|
if (t === "up" ? w.top > g.top - g.height : g.bottom + g.height > w.bottom) {
|
|
1257
|
-
|
|
1282
|
+
U(e);
|
|
1258
1283
|
const C = o.getCordsFromCellNode(d, s.table);
|
|
1259
|
-
if (!e.shiftKey) return
|
|
1284
|
+
if (!e.shiftKey) return pt(s, o, C.x, C.y, t);
|
|
1260
1285
|
{
|
|
1261
1286
|
const _ = o.getDOMCellFromCordsOrThrow(C.x, C.y, s.table);
|
|
1262
1287
|
s.setAnchorCellForSelection(_), s.setFocusCellForSelection(_, !0);
|
|
@@ -1264,40 +1289,40 @@ function ie(n, e, t, o, s) {
|
|
|
1264
1289
|
return !0;
|
|
1265
1290
|
}
|
|
1266
1291
|
} else if (F(r)) {
|
|
1267
|
-
const { anchor: l, focus: a } = r, d = N(l.getNode(),
|
|
1268
|
-
if (!
|
|
1292
|
+
const { anchor: l, focus: a } = r, d = N(l.getNode(), m), h = N(a.getNode(), m), [i] = r.getNodes(), c = n.getElementByKey(i.getKey());
|
|
1293
|
+
if (!m(d) || !m(h) || !K(i) || c == null) return !1;
|
|
1269
1294
|
s.updateTableTableSelection(r);
|
|
1270
1295
|
const u = ce(c), g = o.getCordsFromCellNode(d, u), f = o.getDOMCellFromCordsOrThrow(g.x, g.y, u);
|
|
1271
|
-
if (s.setAnchorCellForSelection(f),
|
|
1272
|
-
const
|
|
1273
|
-
return
|
|
1296
|
+
if (s.setAnchorCellForSelection(f), U(e), e.shiftKey) {
|
|
1297
|
+
const p = o.getCordsFromCellNode(h, u);
|
|
1298
|
+
return En(s, i, p.x, p.y, t);
|
|
1274
1299
|
}
|
|
1275
1300
|
return h.selectEnd(), !0;
|
|
1276
1301
|
}
|
|
1277
1302
|
return !1;
|
|
1278
1303
|
}
|
|
1279
|
-
function
|
|
1304
|
+
function U(n) {
|
|
1280
1305
|
n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
|
|
1281
1306
|
}
|
|
1282
|
-
function
|
|
1283
|
-
const o =
|
|
1307
|
+
function qe(n, e, t) {
|
|
1308
|
+
const o = V();
|
|
1284
1309
|
n === "first" ? e.insertBefore(o) : e.insertAfter(o), o.append(...t || []), o.selectEnd();
|
|
1285
1310
|
}
|
|
1286
|
-
function
|
|
1311
|
+
function $e(n, e, t) {
|
|
1287
1312
|
const o = t.getParent();
|
|
1288
1313
|
if (!o) return;
|
|
1289
1314
|
const s = n.getElementByKey(o.getKey());
|
|
1290
1315
|
if (!s) return;
|
|
1291
1316
|
const r = window.getSelection();
|
|
1292
1317
|
if (!r || r.anchorNode !== s) return;
|
|
1293
|
-
const l = N(e.anchor.getNode(), (w) =>
|
|
1318
|
+
const l = N(e.anchor.getNode(), (w) => m(w));
|
|
1294
1319
|
if (!l) return;
|
|
1295
|
-
const a = N(l, (w) =>
|
|
1296
|
-
if (!
|
|
1297
|
-
const [d, h] =
|
|
1298
|
-
return f ? "first" :
|
|
1320
|
+
const a = N(l, (w) => K(w));
|
|
1321
|
+
if (!K(a) || !a.is(t)) return;
|
|
1322
|
+
const [d, h] = ne(t, l, l), i = d[0][0], c = d[d.length - 1][d[0].length - 1], { startRow: u, startColumn: g } = h, f = u === i.startRow && g === i.startColumn, p = u === c.startRow && g === c.startColumn;
|
|
1323
|
+
return f ? "first" : p ? "last" : void 0;
|
|
1299
1324
|
}
|
|
1300
|
-
function
|
|
1325
|
+
function Ge(n, e, t, o) {
|
|
1301
1326
|
const s = n.querySelector("colgroup");
|
|
1302
1327
|
if (!s) return;
|
|
1303
1328
|
const r = [];
|
|
@@ -1307,8 +1332,8 @@ function $e(n, e, t, o) {
|
|
|
1307
1332
|
}
|
|
1308
1333
|
s.replaceChildren(...r);
|
|
1309
1334
|
}
|
|
1310
|
-
function
|
|
1311
|
-
t ? (ue(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (
|
|
1335
|
+
function Ve(n, e, t) {
|
|
1336
|
+
t ? (ue(n, e.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (Qe(n, e.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
|
|
1312
1337
|
}
|
|
1313
1338
|
class Se extends Ee {
|
|
1314
1339
|
static getType() {
|
|
@@ -1328,10 +1353,10 @@ class Se extends Ee {
|
|
|
1328
1353
|
super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping;
|
|
1329
1354
|
}
|
|
1330
1355
|
static importDOM() {
|
|
1331
|
-
return { table: (e) => ({ conversion:
|
|
1356
|
+
return { table: (e) => ({ conversion: Mn, priority: 1 }) };
|
|
1332
1357
|
}
|
|
1333
1358
|
static importJSON(e) {
|
|
1334
|
-
const t =
|
|
1359
|
+
const t = Re();
|
|
1335
1360
|
return t.__rowStriping = e.rowStriping || !1, t.__colWidths = e.colWidths, t;
|
|
1336
1361
|
}
|
|
1337
1362
|
constructor(e) {
|
|
@@ -1342,16 +1367,16 @@ class Se extends Ee {
|
|
|
1342
1367
|
}
|
|
1343
1368
|
createDOM(e, t) {
|
|
1344
1369
|
const o = document.createElement("table"), s = document.createElement("colgroup");
|
|
1345
|
-
return o.appendChild(s),
|
|
1370
|
+
return o.appendChild(s), Ge(o, 0, this.getColumnCount(), this.getColWidths()), ue(o, e.theme.table), this.__rowStriping && Ve(o, e, !0), o;
|
|
1346
1371
|
}
|
|
1347
1372
|
updateDOM(e, t, o) {
|
|
1348
|
-
return e.__rowStriping !== this.__rowStriping &&
|
|
1373
|
+
return e.__rowStriping !== this.__rowStriping && Ve(t, o, this.__rowStriping), Ge(t, 0, this.getColumnCount(), this.getColWidths()), !1;
|
|
1349
1374
|
}
|
|
1350
1375
|
exportDOM(e) {
|
|
1351
1376
|
return { ...super.exportDOM(e), after: (t) => {
|
|
1352
1377
|
if (t) {
|
|
1353
1378
|
const o = t.cloneNode(), s = document.createElement("colgroup"), r = document.createElement("tbody");
|
|
1354
|
-
if (
|
|
1379
|
+
if (rt(t)) {
|
|
1355
1380
|
const l = t.querySelectorAll("col");
|
|
1356
1381
|
s.append(...l);
|
|
1357
1382
|
const a = t.querySelectorAll("tr");
|
|
@@ -1375,7 +1400,7 @@ class Se extends Ee {
|
|
|
1375
1400
|
const a = l.findIndex((d) => {
|
|
1376
1401
|
if (!d) return;
|
|
1377
1402
|
const { elem: h } = d;
|
|
1378
|
-
return
|
|
1403
|
+
return Y(h) === e;
|
|
1379
1404
|
});
|
|
1380
1405
|
if (a !== -1) return { x: a, y: r };
|
|
1381
1406
|
}
|
|
@@ -1395,8 +1420,8 @@ class Se extends Ee {
|
|
|
1395
1420
|
getCellNodeFromCords(e, t, o) {
|
|
1396
1421
|
const s = this.getDOMCellFromCords(e, t, o);
|
|
1397
1422
|
if (s == null) return null;
|
|
1398
|
-
const r =
|
|
1399
|
-
return
|
|
1423
|
+
const r = Y(s.elem);
|
|
1424
|
+
return m(r) ? r : null;
|
|
1400
1425
|
}
|
|
1401
1426
|
getCellNodeFromCordsOrThrow(e, t, o) {
|
|
1402
1427
|
const s = this.getCellNodeFromCords(e, t, o);
|
|
@@ -1420,26 +1445,40 @@ class Se extends Ee {
|
|
|
1420
1445
|
if (!e) return 0;
|
|
1421
1446
|
let t = 0;
|
|
1422
1447
|
return e.getChildren().forEach((o) => {
|
|
1423
|
-
|
|
1448
|
+
m(o) && (t += o.getColSpan());
|
|
1424
1449
|
}), t;
|
|
1425
1450
|
}
|
|
1426
1451
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const e =
|
|
1429
|
-
|
|
1452
|
+
function Mn(n) {
|
|
1453
|
+
const e = Re();
|
|
1454
|
+
n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0);
|
|
1455
|
+
const t = n.querySelector(":scope > colgroup");
|
|
1456
|
+
if (t) {
|
|
1457
|
+
let o = [];
|
|
1458
|
+
for (const s of t.querySelectorAll(":scope > col")) {
|
|
1459
|
+
const r = s.style.width;
|
|
1460
|
+
if (!r || !Me.test(r)) {
|
|
1461
|
+
o = void 0;
|
|
1462
|
+
break;
|
|
1463
|
+
}
|
|
1464
|
+
o.push(parseFloat(r));
|
|
1465
|
+
}
|
|
1466
|
+
o && e.setColWidths(o);
|
|
1467
|
+
}
|
|
1468
|
+
return { node: e };
|
|
1430
1469
|
}
|
|
1431
|
-
function
|
|
1470
|
+
function Re() {
|
|
1432
1471
|
return Te(new Se());
|
|
1433
1472
|
}
|
|
1434
|
-
function
|
|
1473
|
+
function K(n) {
|
|
1435
1474
|
return n instanceof Se;
|
|
1436
1475
|
}
|
|
1437
|
-
const
|
|
1438
|
-
const t =
|
|
1476
|
+
const St = 100, Hn = (n, e) => {
|
|
1477
|
+
const t = Nn(0, 0, !1);
|
|
1439
1478
|
for (let o = 0; o < n; o++) {
|
|
1440
1479
|
const s = he();
|
|
1441
1480
|
for (let r = 0; r < e; r++) {
|
|
1442
|
-
const l = oe(0, void 0,
|
|
1481
|
+
const l = oe(0, void 0, St / e);
|
|
1443
1482
|
s.append(l);
|
|
1444
1483
|
}
|
|
1445
1484
|
t.append(s);
|
|
@@ -1451,9 +1490,9 @@ const Ct = 100, Hn = (n, e) => {
|
|
|
1451
1490
|
const s = t.getFirstDescendant();
|
|
1452
1491
|
s && s.select();
|
|
1453
1492
|
}
|
|
1454
|
-
},
|
|
1493
|
+
}, Fn = (n) => {
|
|
1455
1494
|
n.getParentOrThrow().getParentOrThrow().remove();
|
|
1456
|
-
},
|
|
1495
|
+
}, Wn = (n, e) => {
|
|
1457
1496
|
const t = he(), o = n.getParentOrThrow(), s = o.getChildrenSize();
|
|
1458
1497
|
for (let l = 0; l < s; l++) {
|
|
1459
1498
|
const a = oe(0);
|
|
@@ -1462,7 +1501,7 @@ const Ct = 100, Hn = (n, e) => {
|
|
|
1462
1501
|
e === "insertRowAbove" ? o.insertBefore(t) : o.insertAfter(t);
|
|
1463
1502
|
const r = t.getFirstDescendant();
|
|
1464
1503
|
r && r.select();
|
|
1465
|
-
},
|
|
1504
|
+
}, In = (n, e) => {
|
|
1466
1505
|
const t = n.getParentOrThrow(), o = t.getParentOrThrow().getChildren().indexOf(t), s = t.getChildren().length, r = t.getParentOrThrow();
|
|
1467
1506
|
let l = t.getChildren().indexOf(n);
|
|
1468
1507
|
const a = r.getChildren(), d = a.length;
|
|
@@ -1470,43 +1509,43 @@ const Ct = 100, Hn = (n, e) => {
|
|
|
1470
1509
|
const c = oe(0), u = a[i].getChildren()[l];
|
|
1471
1510
|
u && (e === "insertColumnLeft" ? u.insertBefore(c) : u.insertAfter(c)), a.forEach((g) => {
|
|
1472
1511
|
g.getChildren().forEach((f) => {
|
|
1473
|
-
f.setWidth(
|
|
1512
|
+
f.setWidth(St / s);
|
|
1474
1513
|
});
|
|
1475
1514
|
});
|
|
1476
1515
|
}
|
|
1477
1516
|
l = e === "insertColumnLeft" ? l : l + 1;
|
|
1478
1517
|
const h = a[o].getChildren()[l];
|
|
1479
1518
|
h && h.select();
|
|
1480
|
-
},
|
|
1519
|
+
}, zn = (n) => {
|
|
1481
1520
|
var r;
|
|
1482
1521
|
const e = n.getParentOrThrow(), t = e.getParentOrThrow(), o = ((r = t.getFirstChild()) == null ? void 0 : r.getChildrenSize()) || 0, s = e.getChildren().indexOf(n);
|
|
1483
|
-
o === 1 ?
|
|
1522
|
+
o === 1 ? Fn(n) : xn(t, s);
|
|
1484
1523
|
};
|
|
1485
1524
|
export {
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
de as Z,
|
|
1495
|
-
In as a,
|
|
1525
|
+
Pn as $,
|
|
1526
|
+
ne as F,
|
|
1527
|
+
vn as K,
|
|
1528
|
+
kn as L,
|
|
1529
|
+
wn as O,
|
|
1530
|
+
Ln as U,
|
|
1531
|
+
Dn as _,
|
|
1532
|
+
zn as a,
|
|
1496
1533
|
Bn as b,
|
|
1497
|
-
|
|
1498
|
-
|
|
1534
|
+
Wn as c,
|
|
1535
|
+
Fn as d,
|
|
1499
1536
|
Hn as e,
|
|
1500
|
-
|
|
1537
|
+
de as f,
|
|
1501
1538
|
we as g,
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1539
|
+
Nn as h,
|
|
1540
|
+
In as i,
|
|
1541
|
+
K as j,
|
|
1542
|
+
le as k,
|
|
1543
|
+
J as l,
|
|
1506
1544
|
an as m,
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1545
|
+
oe as n,
|
|
1546
|
+
m as o,
|
|
1547
|
+
cn as p,
|
|
1548
|
+
An as r,
|
|
1549
|
+
Se as u
|
|
1511
1550
|
};
|
|
1512
|
-
//# sourceMappingURL=helpers-
|
|
1551
|
+
//# sourceMappingURL=helpers-CaU5T9i-.js.map
|