@uva-glass/component-library 3.57.0 → 3.57.2
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-DApSVwEN.js → Lexical.prod-nAj5fF96.js} +2200 -1708
- package/dist/Lexical.prod-nAj5fF96.js.map +1 -0
- package/dist/LexicalClipboard.prod-B9sWgdS2.js +348 -0
- package/dist/LexicalClipboard.prod-B9sWgdS2.js.map +1 -0
- package/dist/{LexicalComposerContext.prod-o3ynMZsi.js → LexicalComposerContext.prod-DumMmRBt.js} +2 -2
- package/dist/LexicalComposerContext.prod-DumMmRBt.js.map +1 -0
- package/dist/LexicalHtml.prod-RCMsF0qt.js +2139 -0
- package/dist/LexicalHtml.prod-RCMsF0qt.js.map +1 -0
- package/dist/{LexicalLink.prod-DCBvBDd1.js → LexicalLink.prod-BcBNTFEb.js} +212 -195
- package/dist/LexicalLink.prod-BcBNTFEb.js.map +1 -0
- package/dist/LexicalList.prod-THQt9B32.js +890 -0
- package/dist/LexicalList.prod-THQt9B32.js.map +1 -0
- package/dist/{LexicalTable.prod-Dw8vTvL0.js → LexicalTable.prod-BpHQYpBM.js} +691 -608
- package/dist/LexicalTable.prod-BpHQYpBM.js.map +1 -0
- package/dist/LexicalUtils.prod-7S6iuu9A.js +347 -0
- package/dist/LexicalUtils.prod-7S6iuu9A.js.map +1 -0
- package/dist/{LinkContextMenu-Jna2w4Ob.js → LinkContextMenu-Byu3AEqp.js} +2 -2
- package/dist/{LinkContextMenu-Jna2w4Ob.js.map → LinkContextMenu-Byu3AEqp.js.map} +1 -1
- package/dist/{PasteHandlerPlugin-IsbHaMUu.js → PasteHandlerPlugin-DyTXcFsj.js} +5 -5
- package/dist/{PasteHandlerPlugin-IsbHaMUu.js.map → PasteHandlerPlugin-DyTXcFsj.js.map} +1 -1
- package/dist/{TableCellContextMenu-Dm-UNfH8.js → TableCellContextMenu--4IdoKAU.js} +2 -2
- package/dist/{TableCellContextMenu-Dm-UNfH8.js.map → TableCellContextMenu--4IdoKAU.js.map} +1 -1
- package/dist/TableCellResizerPlugin-Dn8Ks2Lm.js +208 -0
- package/dist/TableCellResizerPlugin-Dn8Ks2Lm.js.map +1 -0
- package/dist/__mocks__/reactRouterMock.d.ts +27 -0
- package/dist/__mocks__/reactRouterMock.js +17 -0
- package/dist/__mocks__/reactRouterMock.js.map +1 -0
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/CheckboxTree/index.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/FormInput/index.js +1 -1
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +3 -2
- 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/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/PeriodSelector/index.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/RadioTabSelector/index.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/EditorHeader/index.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +35 -35
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +14 -14
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +1 -1
- 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/TableCellContextMenu/TableCellContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +30 -30
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +2 -2
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/index.js +4 -4
- package/dist/components/RteEditor/RteEditor.js +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/RteEditor/index.js +1 -1
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +18 -18
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +17 -17
- package/dist/components/index.js +64 -63
- package/dist/{components-DHB1OMJ8.js → components-KU0q76JR.js} +841 -686
- package/dist/components-KU0q76JR.js.map +1 -0
- package/dist/{helpers-C3IJbMVf.js → helpers-BzYayeT-.js} +9 -9
- package/dist/helpers-BzYayeT-.js.map +1 -0
- package/dist/index.js +64 -63
- package/package.json +17 -17
- package/dist/Lexical.prod-DApSVwEN.js.map +0 -1
- package/dist/LexicalClipboard.prod--xxt8Vi4.js +0 -651
- package/dist/LexicalClipboard.prod--xxt8Vi4.js.map +0 -1
- package/dist/LexicalComposerContext.prod-o3ynMZsi.js.map +0 -1
- package/dist/LexicalExtension.prod-efmFsltb.js +0 -913
- package/dist/LexicalExtension.prod-efmFsltb.js.map +0 -1
- package/dist/LexicalLink.prod-DCBvBDd1.js.map +0 -1
- package/dist/LexicalList.prod-DA6gHLh6.js +0 -806
- package/dist/LexicalList.prod-DA6gHLh6.js.map +0 -1
- package/dist/LexicalTable.prod-Dw8vTvL0.js.map +0 -1
- package/dist/LexicalUtils.prod-DRNc5TMZ.js +0 -343
- package/dist/LexicalUtils.prod-DRNc5TMZ.js.map +0 -1
- package/dist/TableCellResizerPlugin-OgsG5jSq.js +0 -208
- package/dist/TableCellResizerPlugin-OgsG5jSq.js.map +0 -1
- package/dist/components-DHB1OMJ8.js.map +0 -1
- package/dist/helpers-C3IJbMVf.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#region node_modules/.pnpm/@lexical+link@0.
|
|
5
|
-
var
|
|
1
|
+
import { At as e, C as t, Cn as n, Dt as r, E as i, Gn as a, Ln as o, M as s, Nt as c, O as l, On as u, Qn as d, S as f, U as p, Ut as m, Y as ee, Yt as h, ar as g, bn as te, c as _, dn as ne, ft as re, gt as v, j as y, k as b, ln as x, lt as ie, rn as S, y as C, z as w, zn as ae, zt as T } from "./Lexical.prod-nAj5fF96.js";
|
|
2
|
+
import { c as oe, s as se } from "./LexicalUtils.prod-7S6iuu9A.js";
|
|
3
|
+
import { b as E, c as ce, d as le, m as ue, o as de, p as fe, y as pe } from "./LexicalHtml.prod-RCMsF0qt.js";
|
|
4
|
+
//#region node_modules/.pnpm/@lexical+link@0.45.0/node_modules/@lexical/link/dist/LexicalLink.prod.mjs
|
|
5
|
+
var me = new Set([
|
|
6
6
|
"http:",
|
|
7
7
|
"https:",
|
|
8
8
|
"mailto:",
|
|
9
9
|
"sms:",
|
|
10
10
|
"tel:"
|
|
11
|
-
]), D = class e extends
|
|
11
|
+
]), D = class e extends ne {
|
|
12
12
|
__url;
|
|
13
13
|
__target;
|
|
14
14
|
__rel;
|
|
@@ -33,10 +33,10 @@ var ce = new Set([
|
|
|
33
33
|
}
|
|
34
34
|
createDOM(e) {
|
|
35
35
|
let t = document.createElement("a");
|
|
36
|
-
return this.updateLinkDOM(null, t, e),
|
|
36
|
+
return this.updateLinkDOM(null, t, e), c(t, e.theme.link), t;
|
|
37
37
|
}
|
|
38
38
|
updateLinkDOM(e, t, n) {
|
|
39
|
-
if (
|
|
39
|
+
if (u(t)) {
|
|
40
40
|
e && e.__url === this.__url || (t.href = this.sanitizeUrl(this.__url));
|
|
41
41
|
for (let n of [
|
|
42
42
|
"target",
|
|
@@ -53,7 +53,7 @@ var ce = new Set([
|
|
|
53
53
|
}
|
|
54
54
|
static importDOM() {
|
|
55
55
|
return { a: (e) => ({
|
|
56
|
-
conversion:
|
|
56
|
+
conversion: ge,
|
|
57
57
|
priority: 1
|
|
58
58
|
}) };
|
|
59
59
|
}
|
|
@@ -64,10 +64,10 @@ var ce = new Set([
|
|
|
64
64
|
return super.updateFromJSON(e).setURL(e.url).setRel(e.rel || null).setTarget(e.target || null).setTitle(e.title || null);
|
|
65
65
|
}
|
|
66
66
|
sanitizeUrl(e) {
|
|
67
|
-
e =
|
|
67
|
+
e = z(e);
|
|
68
68
|
try {
|
|
69
|
-
let t = new URL(
|
|
70
|
-
if (!
|
|
69
|
+
let t = new URL(z(e));
|
|
70
|
+
if (!me.has(t.protocol)) return "about:blank";
|
|
71
71
|
} catch {
|
|
72
72
|
return e;
|
|
73
73
|
}
|
|
@@ -111,7 +111,7 @@ var ce = new Set([
|
|
|
111
111
|
return t.__title = e, t;
|
|
112
112
|
}
|
|
113
113
|
insertNewAfter(e, t = !0) {
|
|
114
|
-
let n =
|
|
114
|
+
let n = m(this);
|
|
115
115
|
return this.insertAfter(n, t), n;
|
|
116
116
|
}
|
|
117
117
|
canInsertTextBefore() {
|
|
@@ -127,7 +127,7 @@ var ce = new Set([
|
|
|
127
127
|
return !0;
|
|
128
128
|
}
|
|
129
129
|
extractWithChild(e, t, n) {
|
|
130
|
-
if (!
|
|
130
|
+
if (!d(t)) return !1;
|
|
131
131
|
let r = t.anchor.getNode(), i = t.focus.getNode();
|
|
132
132
|
return this.isParentOf(r) && this.isParentOf(i) && t.getTextContent().length > 0;
|
|
133
133
|
}
|
|
@@ -142,56 +142,56 @@ var ce = new Set([
|
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
function O(e) {
|
|
145
|
-
let t =
|
|
145
|
+
let t = ee(e, "next");
|
|
146
146
|
return [t, t.getFlipped()];
|
|
147
147
|
}
|
|
148
148
|
function k(e, t) {
|
|
149
149
|
for (let n of t) if (n.origin.isAttached()) {
|
|
150
|
-
|
|
150
|
+
p(e, w(n));
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
let
|
|
161
|
-
for (let
|
|
162
|
-
let
|
|
163
|
-
if (
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
let t =
|
|
167
|
-
t.append(...
|
|
154
|
+
function he(e) {
|
|
155
|
+
let n = v(), r = null, i = null;
|
|
156
|
+
function a() {
|
|
157
|
+
d(n) && (k(n.anchor, r), k(n.focus, i), _(n));
|
|
158
|
+
}
|
|
159
|
+
d(n) && (r = O(n.anchor), i = O(n.focus));
|
|
160
|
+
let s = !1;
|
|
161
|
+
for (let n of x(e, "next")) {
|
|
162
|
+
let r = n.origin;
|
|
163
|
+
if (T(r) && !r.isInline()) {
|
|
164
|
+
let i = r.getChildren();
|
|
165
|
+
if (i.length > 0) {
|
|
166
|
+
let t = m(e);
|
|
167
|
+
t.append(...i), r.append(t), s = !0;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
se(r, t(n), { $shouldSplit: () => !1 });
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
let [r, i] = e, a = (e) =>
|
|
172
|
+
function c(e, t, n) {
|
|
173
|
+
let [r, i] = e, a = (e) => o(e) && e.origin.is(t);
|
|
174
174
|
if (!a(r) && !a(i)) return e;
|
|
175
|
-
let
|
|
176
|
-
return [
|
|
175
|
+
let s = w(x(n, "next"));
|
|
176
|
+
return [s, s.getFlipped()];
|
|
177
177
|
}
|
|
178
178
|
if (e.isAttached()) {
|
|
179
179
|
let t = e.getPreviousSibling();
|
|
180
|
-
if (j(t) && t.shouldMergeAdjacentLink(e)) return
|
|
181
|
-
let
|
|
182
|
-
j(
|
|
180
|
+
if (j(t) && t.shouldMergeAdjacentLink(e)) return r &&= c(r, t, e), i &&= c(i, t, e), t.append(...e.getChildren()), e.remove(), void a();
|
|
181
|
+
let n = e.getNextSibling();
|
|
182
|
+
j(n) && e.shouldMergeAdjacentLink(n) && (r &&= c(r, e, n), i &&= c(i, e, n), e.append(...n.getChildren()), n.remove(), s = !0);
|
|
183
183
|
}
|
|
184
|
-
if (
|
|
184
|
+
if (s) {
|
|
185
185
|
if (!e.canBeEmpty() && e.isEmpty()) {
|
|
186
186
|
let t = e.getParent();
|
|
187
187
|
e.remove(), t && t.isEmpty() && t.remove();
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
a();
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function ge(e) {
|
|
193
193
|
let t = null;
|
|
194
|
-
if (
|
|
194
|
+
if (u(e)) {
|
|
195
195
|
let n = e.textContent;
|
|
196
196
|
(n !== null && n !== "" || e.children.length > 0) && (t = A(e.getAttribute("href") || "", {
|
|
197
197
|
rel: e.getAttribute("rel"),
|
|
@@ -202,7 +202,7 @@ function ue(e) {
|
|
|
202
202
|
return { node: t };
|
|
203
203
|
}
|
|
204
204
|
function A(e = "", t) {
|
|
205
|
-
return
|
|
205
|
+
return g(new D(e, t));
|
|
206
206
|
}
|
|
207
207
|
function j(e) {
|
|
208
208
|
return e instanceof D;
|
|
@@ -268,16 +268,16 @@ var M = class e extends D {
|
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
270
|
function N(e = "", t) {
|
|
271
|
-
return
|
|
271
|
+
return g(new M(e, t));
|
|
272
272
|
}
|
|
273
273
|
function P(e) {
|
|
274
274
|
return e instanceof M;
|
|
275
275
|
}
|
|
276
|
-
var F =
|
|
276
|
+
var F = te("TOGGLE_LINK_COMMAND");
|
|
277
277
|
function I(e, t) {
|
|
278
278
|
if (e.type === "element") {
|
|
279
279
|
let n = e.getNode();
|
|
280
|
-
return
|
|
280
|
+
return T(n) || function(e, ...t) {
|
|
281
281
|
let n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
282
282
|
r.append("code", e);
|
|
283
283
|
for (let e of t) r.append("v", e);
|
|
@@ -286,31 +286,31 @@ function I(e, t) {
|
|
|
286
286
|
}
|
|
287
287
|
return null;
|
|
288
288
|
}
|
|
289
|
-
function L(e,
|
|
290
|
-
let
|
|
289
|
+
function L(e, t = {}) {
|
|
290
|
+
let n;
|
|
291
291
|
if (e && typeof e == "object") {
|
|
292
|
-
let { url:
|
|
293
|
-
|
|
292
|
+
let { url: r, ...i } = e;
|
|
293
|
+
n = r, t = {
|
|
294
294
|
...i,
|
|
295
|
-
...
|
|
295
|
+
...t
|
|
296
296
|
};
|
|
297
|
-
} else
|
|
298
|
-
let { target:
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
301
|
-
let e =
|
|
297
|
+
} else n = e;
|
|
298
|
+
let { target: r, title: i } = t, a = t.rel === void 0 ? "noreferrer" : t.rel, o = v();
|
|
299
|
+
if (o === null || !d(o) && !h(o)) return;
|
|
300
|
+
if (h(o)) {
|
|
301
|
+
let e = o.getNodes();
|
|
302
302
|
if (e.length === 0) return;
|
|
303
303
|
e.forEach((e) => {
|
|
304
|
-
if (
|
|
305
|
-
let t =
|
|
304
|
+
if (n === null) {
|
|
305
|
+
let t = y(e, (e) => !P(e) && j(e));
|
|
306
306
|
t && (t.insertBefore(e), t.getChildren().length === 0 && t.remove());
|
|
307
307
|
} else {
|
|
308
|
-
let t =
|
|
309
|
-
if (t) t.setURL(
|
|
308
|
+
let t = y(e, (e) => !P(e) && j(e));
|
|
309
|
+
if (t) t.setURL(n), r !== void 0 && t.setTarget(r), a !== void 0 && t.setRel(a);
|
|
310
310
|
else {
|
|
311
|
-
let t = A(
|
|
312
|
-
rel:
|
|
313
|
-
target:
|
|
311
|
+
let t = A(n, {
|
|
312
|
+
rel: a,
|
|
313
|
+
target: r
|
|
314
314
|
});
|
|
315
315
|
e.insertBefore(t), t.append(e);
|
|
316
316
|
}
|
|
@@ -318,23 +318,21 @@ function L(e, n = {}) {
|
|
|
318
318
|
});
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
|
-
if (
|
|
322
|
-
let t =
|
|
323
|
-
t !== null && (t.
|
|
324
|
-
t.insertBefore(e);
|
|
325
|
-
}), t.remove());
|
|
321
|
+
if (o.isCollapsed() && n === null) for (let e of o.getNodes()) {
|
|
322
|
+
let t = y(e, (e) => !P(e) && j(e));
|
|
323
|
+
t !== null && (t.getParentOrThrow().splice(t.getIndexWithinParent(), 0, t.getChildren()), t.remove());
|
|
326
324
|
return;
|
|
327
325
|
}
|
|
328
|
-
let
|
|
329
|
-
if (
|
|
326
|
+
let s = o.extract();
|
|
327
|
+
if (n === null) {
|
|
330
328
|
let e = /* @__PURE__ */ new Set();
|
|
331
|
-
|
|
332
|
-
let n =
|
|
329
|
+
s.forEach((t) => {
|
|
330
|
+
let n = y(t, (e) => !P(e) && j(e));
|
|
333
331
|
if (n !== null) {
|
|
334
332
|
let t = n.getKey();
|
|
335
333
|
if (e.has(t)) return;
|
|
336
334
|
(function(e, t) {
|
|
337
|
-
let n = new Set(t.filter((t) => e.isParentOf(t)).map((e) => e.getKey())), r = e.getChildren(), i = (r) => n.has(r.getKey()) ||
|
|
335
|
+
let n = new Set(t.filter((t) => e.isParentOf(t)).map((e) => e.getKey())), r = e.getChildren(), i = (r) => n.has(r.getKey()) || T(r) && t.some((t) => e.isParentOf(t) && r.isParentOf(t)), a = r.filter(i);
|
|
338
336
|
if (a.length === r.length) return r.forEach((t) => e.insertBefore(t)), void e.remove();
|
|
339
337
|
let o = r.findIndex(i), s = r.findLastIndex(i), c = o === 0, l = s === r.length - 1;
|
|
340
338
|
if (c) a.forEach((t) => e.insertBefore(t));
|
|
@@ -343,55 +341,55 @@ function L(e, n = {}) {
|
|
|
343
341
|
for (let t = a.length - 1; t >= 0; t--) e.insertAfter(a[t]);
|
|
344
342
|
let t = r.slice(s + 1);
|
|
345
343
|
if (t.length > 0) {
|
|
346
|
-
let n =
|
|
344
|
+
let n = m(e);
|
|
347
345
|
a[a.length - 1].insertAfter(n), t.forEach((e) => n.append(e));
|
|
348
346
|
}
|
|
349
347
|
}
|
|
350
|
-
})(n,
|
|
348
|
+
})(n, s), e.add(t);
|
|
351
349
|
}
|
|
352
350
|
});
|
|
353
351
|
return;
|
|
354
352
|
}
|
|
355
|
-
let
|
|
356
|
-
|
|
353
|
+
let c = /* @__PURE__ */ new Set(), l = (e) => {
|
|
354
|
+
c.has(e.getKey()) || (c.add(e.getKey()), e.setURL(n), r !== void 0 && e.setTarget(r), a !== void 0 && e.setRel(a), i !== void 0 && e.setTitle(i));
|
|
357
355
|
};
|
|
358
|
-
if (
|
|
359
|
-
let e =
|
|
360
|
-
if (t !== null) return
|
|
356
|
+
if (s.length === 1) {
|
|
357
|
+
let e = s[0], t = y(e, j);
|
|
358
|
+
if (t !== null) return l(t);
|
|
361
359
|
}
|
|
362
360
|
(function(e) {
|
|
363
|
-
let t =
|
|
364
|
-
if (!
|
|
365
|
-
let n =
|
|
366
|
-
if (e(),
|
|
367
|
-
let e =
|
|
368
|
-
if (
|
|
361
|
+
let t = v();
|
|
362
|
+
if (!d(t)) return e();
|
|
363
|
+
let n = _(t), r = n.isBackward(), i = I(n.anchor, r ? -1 : 0), a = I(n.focus, r ? 0 : -1);
|
|
364
|
+
if (e(), i || a) {
|
|
365
|
+
let e = v();
|
|
366
|
+
if (d(e)) {
|
|
369
367
|
let t = e.clone();
|
|
368
|
+
if (i) {
|
|
369
|
+
let e = i.getParent();
|
|
370
|
+
e && t.anchor.set(e.getKey(), i.getIndexWithinParent() + +!!r, "element");
|
|
371
|
+
}
|
|
370
372
|
if (a) {
|
|
371
373
|
let e = a.getParent();
|
|
372
|
-
e && t.
|
|
373
|
-
}
|
|
374
|
-
if (o) {
|
|
375
|
-
let e = o.getParent();
|
|
376
|
-
e && t.focus.set(e.getKey(), o.getIndexWithinParent() + +!r, "element");
|
|
374
|
+
e && t.focus.set(e.getKey(), a.getIndexWithinParent() + +!r, "element");
|
|
377
375
|
}
|
|
378
|
-
|
|
376
|
+
f(_(t));
|
|
379
377
|
}
|
|
380
378
|
}
|
|
381
379
|
})(() => {
|
|
382
380
|
let e = null;
|
|
383
|
-
for (let t of
|
|
381
|
+
for (let t of s) {
|
|
384
382
|
if (!t.isAttached()) continue;
|
|
385
|
-
let
|
|
386
|
-
if (
|
|
387
|
-
|
|
383
|
+
let o = y(t, j);
|
|
384
|
+
if (o) {
|
|
385
|
+
l(o);
|
|
388
386
|
continue;
|
|
389
387
|
}
|
|
390
|
-
if (
|
|
388
|
+
if (T(t)) {
|
|
391
389
|
if (!t.isInline()) continue;
|
|
392
390
|
if (j(t)) {
|
|
393
391
|
if (!(P(t) || e !== null && e.getParentOrThrow().isParentOf(t))) {
|
|
394
|
-
|
|
392
|
+
l(t), e = t;
|
|
395
393
|
continue;
|
|
396
394
|
}
|
|
397
395
|
for (let e of t.getChildren()) t.insertBefore(e);
|
|
@@ -399,21 +397,21 @@ function L(e, n = {}) {
|
|
|
399
397
|
continue;
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
|
-
let
|
|
403
|
-
j(
|
|
404
|
-
rel:
|
|
405
|
-
target:
|
|
406
|
-
title:
|
|
400
|
+
let s = t.getPreviousSibling();
|
|
401
|
+
j(s) && s.is(e) ? s.append(t) : (e = A(n, {
|
|
402
|
+
rel: a,
|
|
403
|
+
target: r,
|
|
404
|
+
title: i
|
|
407
405
|
}), t.insertAfter(e), e.append(t));
|
|
408
406
|
}
|
|
409
407
|
});
|
|
410
408
|
}
|
|
411
|
-
var
|
|
412
|
-
function
|
|
413
|
-
return e.match(/^[a-z][a-z0-9+.-]*:/i) || e.match(/^[/#.]/) ? e : e.includes("@") ? `mailto:${e}` :
|
|
409
|
+
var R = /^\+?[0-9\s()-]{5,}$/;
|
|
410
|
+
function z(e) {
|
|
411
|
+
return e.match(/^[a-z][a-z0-9+.-]*:/i) || e.match(/^[/#.]/) ? e : e.includes("@") ? `mailto:${e}` : R.test(e) ? `tel:${e}` : `https://${e}`;
|
|
414
412
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
413
|
+
function B(e, t) {
|
|
414
|
+
return S(e.registerNodeTransform(D, he), e.registerCommand(F, (e) => {
|
|
417
415
|
let n = t.validateUrl.peek(), r = t.attributes.peek();
|
|
418
416
|
if (e === null) return L(null), !0;
|
|
419
417
|
if (typeof e == "string") return !(n !== void 0 && !n(e)) && (L(e, r), !0);
|
|
@@ -426,47 +424,47 @@ function z(e, t) {
|
|
|
426
424
|
title: a
|
|
427
425
|
}), !0;
|
|
428
426
|
}
|
|
429
|
-
}, 0),
|
|
427
|
+
}, 0), pe(() => {
|
|
430
428
|
let n = t.validateUrl.value;
|
|
431
429
|
if (!n) return;
|
|
432
430
|
let r = t.attributes.value;
|
|
433
|
-
return e.registerCommand(
|
|
434
|
-
let i =
|
|
435
|
-
if (!
|
|
431
|
+
return e.registerCommand(s, (t) => {
|
|
432
|
+
let i = v();
|
|
433
|
+
if (!d(i) || i.isCollapsed() || !oe(t, ClipboardEvent) || t.clipboardData === null) return !1;
|
|
436
434
|
let a = t.clipboardData.getData("text");
|
|
437
|
-
return !!n(a) && !i.getNodes().some((e) =>
|
|
435
|
+
return !!n(a) && !i.getNodes().some((e) => T(e)) && (e.dispatchCommand(F, {
|
|
438
436
|
...r,
|
|
439
437
|
url: a
|
|
440
438
|
}), t.preventDefault(), !0);
|
|
441
439
|
}, 1);
|
|
442
440
|
}));
|
|
443
441
|
}
|
|
444
|
-
var
|
|
442
|
+
var V = b({
|
|
445
443
|
build: (e, t, n) => E(t),
|
|
446
444
|
config: {
|
|
447
445
|
attributes: void 0,
|
|
448
446
|
validateUrl: void 0
|
|
449
447
|
},
|
|
450
448
|
mergeConfig(e, t) {
|
|
451
|
-
let n =
|
|
452
|
-
return e.attributes && (n.attributes =
|
|
449
|
+
let n = r(e, t);
|
|
450
|
+
return e.attributes && (n.attributes = r(e.attributes, n.attributes)), n;
|
|
453
451
|
},
|
|
454
452
|
name: "@lexical/link/Link",
|
|
455
453
|
nodes: () => [D],
|
|
456
|
-
register: (e, t, n) =>
|
|
454
|
+
register: (e, t, n) => B(e, n.getOutput())
|
|
457
455
|
});
|
|
458
|
-
function
|
|
459
|
-
let
|
|
460
|
-
let
|
|
461
|
-
if (!
|
|
462
|
-
let
|
|
463
|
-
if (
|
|
464
|
-
let
|
|
465
|
-
if (
|
|
466
|
-
let e =
|
|
456
|
+
function H(e, t, r = {}) {
|
|
457
|
+
let i = (r) => {
|
|
458
|
+
let i = r.target;
|
|
459
|
+
if (!re(i)) return;
|
|
460
|
+
let a = ae(i);
|
|
461
|
+
if (a === null) return;
|
|
462
|
+
let o = null, s = null;
|
|
463
|
+
if (a.update(() => {
|
|
464
|
+
let e = n(i);
|
|
467
465
|
if (e !== null) {
|
|
468
|
-
let n =
|
|
469
|
-
if (!t.disabled.peek()) if (j(n))
|
|
466
|
+
let n = y(e, T);
|
|
467
|
+
if (!t.disabled.peek()) if (j(n)) o = n.sanitizeUrl(n.getURL()), s = n.getTarget();
|
|
470
468
|
else {
|
|
471
469
|
let e = function(e, t) {
|
|
472
470
|
let n = e;
|
|
@@ -475,35 +473,35 @@ function V(e, t, n = {}) {
|
|
|
475
473
|
n = n.parentNode;
|
|
476
474
|
}
|
|
477
475
|
return null;
|
|
478
|
-
}(
|
|
479
|
-
e !== null && (
|
|
476
|
+
}(i, u);
|
|
477
|
+
e !== null && (o = e.href, s = e.target);
|
|
480
478
|
}
|
|
481
479
|
}
|
|
482
|
-
}),
|
|
483
|
-
let
|
|
484
|
-
if (
|
|
485
|
-
let l =
|
|
486
|
-
window.open(
|
|
487
|
-
},
|
|
488
|
-
e.button === 1 &&
|
|
480
|
+
}), o === null || o === "") return;
|
|
481
|
+
let c = e.getEditorState().read(v, { editor: e });
|
|
482
|
+
if (d(c) && !c.isCollapsed()) return void r.preventDefault();
|
|
483
|
+
let l = r.type === "auxclick" && r.button === 1;
|
|
484
|
+
window.open(o, t.newTab.peek() || l || r.metaKey || r.ctrlKey || s === "_blank" ? "_blank" : "_self"), r.preventDefault();
|
|
485
|
+
}, a = (e) => {
|
|
486
|
+
e.button === 1 && i(e);
|
|
489
487
|
};
|
|
490
488
|
return e.registerRootListener((e) => {
|
|
491
|
-
if (e) return e.addEventListener("click",
|
|
492
|
-
e.removeEventListener("click",
|
|
489
|
+
if (e) return e.addEventListener("click", i, r), e.addEventListener("mouseup", a, r), () => {
|
|
490
|
+
e.removeEventListener("click", i), e.removeEventListener("mouseup", a);
|
|
493
491
|
};
|
|
494
492
|
});
|
|
495
493
|
}
|
|
496
|
-
|
|
494
|
+
b({
|
|
497
495
|
build: (e, t, n) => E(t),
|
|
498
|
-
config:
|
|
496
|
+
config: i({
|
|
499
497
|
disabled: !1,
|
|
500
498
|
newTab: !1
|
|
501
499
|
}),
|
|
502
|
-
dependencies: [
|
|
500
|
+
dependencies: [V],
|
|
503
501
|
name: "@lexical/link/ClickableLink",
|
|
504
|
-
register: (e, t, n) =>
|
|
502
|
+
register: (e, t, n) => H(e, n.getOutput())
|
|
505
503
|
});
|
|
506
|
-
function
|
|
504
|
+
function _e(e, t = (e) => e) {
|
|
507
505
|
return (n) => {
|
|
508
506
|
let r = e.exec(n);
|
|
509
507
|
return r === null ? null : {
|
|
@@ -514,35 +512,35 @@ function fe(e, t = (e) => e) {
|
|
|
514
512
|
};
|
|
515
513
|
};
|
|
516
514
|
}
|
|
517
|
-
function
|
|
515
|
+
function U(e, t) {
|
|
518
516
|
for (let n = 0; n < t.length; n++) {
|
|
519
517
|
let r = t[n](e);
|
|
520
518
|
if (r) return r;
|
|
521
519
|
}
|
|
522
520
|
return null;
|
|
523
521
|
}
|
|
524
|
-
var
|
|
525
|
-
function W(e, t) {
|
|
526
|
-
return t.test(e);
|
|
527
|
-
}
|
|
522
|
+
var W = /[.,;\s]/;
|
|
528
523
|
function G(e, t) {
|
|
529
|
-
return
|
|
524
|
+
return t.test(e);
|
|
530
525
|
}
|
|
531
526
|
function K(e, t) {
|
|
532
|
-
return
|
|
527
|
+
return G(e[e.length - 1], t);
|
|
533
528
|
}
|
|
534
529
|
function q(e, t) {
|
|
535
|
-
|
|
536
|
-
return u(r) && (r = r.getLastDescendant()), r === null || n(r) || b(r) && G(r.getTextContent(), t);
|
|
530
|
+
return G(e[0], t);
|
|
537
531
|
}
|
|
538
532
|
function J(e, t) {
|
|
539
|
-
let
|
|
540
|
-
return
|
|
533
|
+
let n = e.getPreviousSibling();
|
|
534
|
+
return T(n) && (n = n.getLastDescendant()), n === null || C(n) || l(n) && K(n.getTextContent(), t);
|
|
535
|
+
}
|
|
536
|
+
function Y(e, t) {
|
|
537
|
+
let n = e.getNextSibling();
|
|
538
|
+
return T(n) && (n = n.getFirstDescendant()), n === null || C(n) || l(n) && q(n.getTextContent(), t);
|
|
541
539
|
}
|
|
542
|
-
function
|
|
543
|
-
return (e > 0 ?
|
|
540
|
+
function ve(e, t, n, r, i) {
|
|
541
|
+
return (e > 0 ? G(r[e - 1], n) : J(i[0], n)) ? t < r.length ? G(r[t], n) : Y(i[i.length - 1], n) : !1;
|
|
544
542
|
}
|
|
545
|
-
function
|
|
543
|
+
function ye(e, t, n) {
|
|
546
544
|
let r = [], i = [], a = [], o = 0, s = 0, c = [...e];
|
|
547
545
|
for (; c.length > 0;) {
|
|
548
546
|
let e = c[0], l = e.getTextContent().length, u = s;
|
|
@@ -555,39 +553,39 @@ function pe(e, t, n) {
|
|
|
555
553
|
a
|
|
556
554
|
];
|
|
557
555
|
}
|
|
558
|
-
function
|
|
559
|
-
let
|
|
556
|
+
function be(e, t, n, r) {
|
|
557
|
+
let i = N(r.url, r.attributes);
|
|
560
558
|
if (e.length === 1) {
|
|
561
|
-
let
|
|
562
|
-
|
|
563
|
-
let
|
|
564
|
-
return
|
|
559
|
+
let o, s = e[0];
|
|
560
|
+
t === 0 ? [o, s] = s.splitText(n) : [, o, s] = s.splitText(t, n);
|
|
561
|
+
let c = a(r.text);
|
|
562
|
+
return c.setFormat(o.getFormat()), c.setDetail(o.getDetail()), c.setStyle(o.getStyle()), i.append(c), o.replace(i), s;
|
|
565
563
|
}
|
|
566
564
|
if (e.length > 1) {
|
|
567
|
-
let
|
|
568
|
-
|
|
569
|
-
let c = [],
|
|
565
|
+
let r = e[0], o, s = r.getTextContent().length;
|
|
566
|
+
t === 0 ? o = r : [, o] = r.splitText(t);
|
|
567
|
+
let c = [], u;
|
|
570
568
|
for (let t = 1; t < e.length; t++) {
|
|
571
|
-
let
|
|
572
|
-
if (a <
|
|
569
|
+
let r = e[t], i = r.getTextContent().length, a = s;
|
|
570
|
+
if (a < n) if (s + i <= n) c.push(r);
|
|
573
571
|
else {
|
|
574
|
-
let [e, t] =
|
|
575
|
-
c.push(e),
|
|
572
|
+
let [e, t] = r.splitText(n - a);
|
|
573
|
+
c.push(e), u = t;
|
|
576
574
|
}
|
|
577
575
|
s += i;
|
|
578
576
|
}
|
|
579
|
-
let
|
|
580
|
-
return
|
|
577
|
+
let f = v(), p = f ? f.getNodes().find(l) : void 0, m = a(o.getTextContent());
|
|
578
|
+
return m.setFormat(o.getFormat()), m.setDetail(o.getDetail()), m.setStyle(o.getStyle()), i.append(m, ...c), p && p === o && (d(f) ? m.select(f.anchor.offset, f.focus.offset) : h(f) && m.select(0, m.getTextContent().length)), o.replace(i), u;
|
|
581
579
|
}
|
|
582
580
|
}
|
|
583
581
|
function X(e, t, n, r) {
|
|
584
582
|
let i = e.getChildren(), a = i.length;
|
|
585
583
|
for (let t = 0; t < a; t++) {
|
|
586
584
|
let r = i[t];
|
|
587
|
-
if (!
|
|
585
|
+
if (!l(r) || !r.isSimpleText()) return Z(e), void n(null, e.getURL());
|
|
588
586
|
}
|
|
589
|
-
let o = e.getTextContent(), s =
|
|
590
|
-
if (s === null || s.text !== o || !
|
|
587
|
+
let o = e.getTextContent(), s = U(o, t);
|
|
588
|
+
if (s === null || s.text !== o || !J(e, r) || !Y(e, r)) return Z(e), void n(null, e.getURL());
|
|
591
589
|
let c = e.getURL();
|
|
592
590
|
if (c !== s.url && (e.setURL(s.url), n(s.url, c)), s.attributes) {
|
|
593
591
|
let t = e.getRel();
|
|
@@ -605,24 +603,24 @@ var Q = {
|
|
|
605
603
|
changeHandlers: [],
|
|
606
604
|
excludeParents: [],
|
|
607
605
|
matchers: [],
|
|
608
|
-
separatorRegex:
|
|
606
|
+
separatorRegex: W
|
|
609
607
|
};
|
|
610
608
|
function $(e, t = Q) {
|
|
611
|
-
let { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex: a =
|
|
609
|
+
let { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex: a = W } = t, o = (e, t) => {
|
|
612
610
|
for (let n of r) n(e, t);
|
|
613
611
|
};
|
|
614
|
-
return
|
|
612
|
+
return S(e.registerNodeTransform(ie, (e) => {
|
|
615
613
|
let t = e.getParentOrThrow(), r = e.getPreviousSibling();
|
|
616
|
-
P(t) ? X(t, n, o, a) : !j(t) && !i.some((e) => e(t)) && (e.isSimpleText() && (
|
|
614
|
+
P(t) ? X(t, n, o, a) : !j(t) && !i.some((e) => e(t)) && (e.isSimpleText() && (q(e.getTextContent(), a) || !P(r)) && (function(e, t, n, r) {
|
|
617
615
|
for (let t of e) {
|
|
618
616
|
let e = t.getParent();
|
|
619
617
|
if (P(e) && !e.getIsUnlinked()) return;
|
|
620
618
|
}
|
|
621
619
|
let i = [...e], a = i.map((e) => e.getTextContent()).join(""), o, s = a, c = 0;
|
|
622
|
-
for (; (o =
|
|
620
|
+
for (; (o = U(s, t)) && o !== null;) {
|
|
623
621
|
let e = o.index, t = e + o.length;
|
|
624
|
-
if (
|
|
625
|
-
let [r, , a, l] =
|
|
622
|
+
if (ve(c + e, c + t, r, a, i)) {
|
|
623
|
+
let [r, , a, l] = ye(i, c + e, c + t), u = !1;
|
|
626
624
|
for (let e of a) {
|
|
627
625
|
let t = e.getParent();
|
|
628
626
|
if (P(t) && !t.getIsUnlinked()) {
|
|
@@ -634,42 +632,42 @@ function $(e, t = Q) {
|
|
|
634
632
|
c += t, s = s.substring(t);
|
|
635
633
|
continue;
|
|
636
634
|
}
|
|
637
|
-
let d =
|
|
635
|
+
let d = be(a, c + e - r, c + t - r, o);
|
|
638
636
|
i = d ? [d, ...l] : l, n(o.url, null), c = 0;
|
|
639
637
|
} else c += t;
|
|
640
638
|
s = s.substring(t);
|
|
641
639
|
}
|
|
642
640
|
})(function(e) {
|
|
643
641
|
let t = [e], n = e.getNextSibling();
|
|
644
|
-
for (; n !== null &&
|
|
642
|
+
for (; n !== null && l(n) && n.isSimpleText() && (t.push(n), !/[\s]/.test(n.getTextContent()));) n = n.getNextSibling();
|
|
645
643
|
return t;
|
|
646
644
|
}(e), n, o, a), (function(e, t, n, r) {
|
|
647
645
|
let i = e.getParent(), a = e.getPreviousSibling(), o = e.getNextSibling(), s = e.getTextContent();
|
|
648
646
|
if (!P(i) || i.getIsUnlinked()) {
|
|
649
647
|
if (P(a) && !a.getIsUnlinked() && a.is(e.getPreviousSibling()) && e.getParent() === a.getParent()) {
|
|
650
|
-
if (!
|
|
648
|
+
if (!q(s, r)) return Z(a), void n(null, a.getURL());
|
|
651
649
|
if (c = s, a.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(c) : /^\.[a-zA-Z0-9]{1,}/.test(c)) {
|
|
652
|
-
let i = a.getTextContent() + s, o =
|
|
650
|
+
let i = a.getTextContent() + s, o = U(i, t);
|
|
653
651
|
o !== null && o.text === i && (a.append(e), X(a, t, n, r), n(null, a.getURL()));
|
|
654
652
|
}
|
|
655
653
|
}
|
|
656
654
|
var c;
|
|
657
|
-
!P(o) || o.getIsUnlinked() ||
|
|
655
|
+
!P(o) || o.getIsUnlinked() || K(s, r) || o.is(e.getNextSibling()) && e.getParent() === o.getParent() && (Z(o), n(null, o.getURL()));
|
|
658
656
|
}
|
|
659
657
|
})(e, n, o, a));
|
|
660
658
|
}), e.registerCommand(F, (e) => {
|
|
661
|
-
let t =
|
|
662
|
-
return e !== null || !
|
|
659
|
+
let t = v();
|
|
660
|
+
return e !== null || !d(t) || t.extract().forEach((e) => {
|
|
663
661
|
let t = e.getParent();
|
|
664
662
|
P(t) && (t.setIsUnlinked(!t.getIsUnlinked()), t.markDirty());
|
|
665
663
|
}), !1;
|
|
666
664
|
}, 1));
|
|
667
665
|
}
|
|
668
|
-
|
|
666
|
+
b({
|
|
669
667
|
config: Q,
|
|
670
|
-
dependencies: [
|
|
668
|
+
dependencies: [V],
|
|
671
669
|
mergeConfig(e, t) {
|
|
672
|
-
let n =
|
|
670
|
+
let n = r(e, t);
|
|
673
671
|
for (let r of [
|
|
674
672
|
"matchers",
|
|
675
673
|
"changeHandlers",
|
|
@@ -683,8 +681,27 @@ r({
|
|
|
683
681
|
name: "@lexical/link/AutoLink",
|
|
684
682
|
nodes: [M],
|
|
685
683
|
register: $
|
|
684
|
+
}), b({
|
|
685
|
+
dependencies: [
|
|
686
|
+
le,
|
|
687
|
+
V,
|
|
688
|
+
e(de, { rules: [fe({
|
|
689
|
+
$import: (e, t) => {
|
|
690
|
+
if (!t.textContent && t.children.length === 0) return [];
|
|
691
|
+
let n = t.getAttribute("href") || "", r = {
|
|
692
|
+
rel: t.getAttribute("rel"),
|
|
693
|
+
target: t.getAttribute("target"),
|
|
694
|
+
title: t.getAttribute("title")
|
|
695
|
+
};
|
|
696
|
+
return ce(e.$importChildren(t), () => A(n, r));
|
|
697
|
+
},
|
|
698
|
+
match: ue.tag("a"),
|
|
699
|
+
name: "@lexical/link/a"
|
|
700
|
+
})] })
|
|
701
|
+
],
|
|
702
|
+
name: "@lexical/link/Import"
|
|
686
703
|
});
|
|
687
704
|
//#endregion
|
|
688
|
-
export {
|
|
705
|
+
export { L as a, D as c, B as i, M as n, H as o, _e as r, F as s, $ as t };
|
|
689
706
|
|
|
690
|
-
//# sourceMappingURL=LexicalLink.prod-
|
|
707
|
+
//# sourceMappingURL=LexicalLink.prod-BcBNTFEb.js.map
|