@uva-glass/component-library 3.53.13 → 3.53.14
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-Dgzi-S1E.js → Lexical.prod-YJ1n9pVJ.js} +1334 -1305
- package/dist/Lexical.prod-YJ1n9pVJ.js.map +1 -0
- package/dist/{LexicalClipboard.prod-Dxc8c2F_.js → LexicalClipboard.prod-CDPAGlNs.js} +52 -52
- package/dist/{LexicalClipboard.prod-Dxc8c2F_.js.map → LexicalClipboard.prod-CDPAGlNs.js.map} +1 -1
- package/dist/{LexicalExtension.prod-CNBWjmfs.js → LexicalExtension.prod-2-giLTv9.js} +87 -88
- package/dist/LexicalExtension.prod-2-giLTv9.js.map +1 -0
- package/dist/LexicalLink.prod-u8L4ioQd.js +528 -0
- package/dist/LexicalLink.prod-u8L4ioQd.js.map +1 -0
- package/dist/LexicalList.prod-DMU0XSLO.js +630 -0
- package/dist/LexicalList.prod-DMU0XSLO.js.map +1 -0
- package/dist/{LexicalSelection.prod-B0uiXGSS.js → LexicalSelection.prod-CpZE7Sey.js} +41 -41
- package/dist/{LexicalSelection.prod-B0uiXGSS.js.map → LexicalSelection.prod-CpZE7Sey.js.map} +1 -1
- package/dist/LexicalTable.prod-BOlKc5zf.js +1846 -0
- package/dist/LexicalTable.prod-BOlKc5zf.js.map +1 -0
- package/dist/LexicalUtils.prod-BQnuAaA9.js +92 -0
- package/dist/LexicalUtils.prod-BQnuAaA9.js.map +1 -0
- package/dist/{TableCellResizerPlugin-9kvw_LpH.js → TableCellResizerPlugin-BTfuE_kM.js} +53 -53
- package/dist/{TableCellResizerPlugin-9kvw_LpH.js.map → TableCellResizerPlugin-BTfuE_kM.js.map} +1 -1
- package/dist/{TablePlugin-BlXaQ0U6.js → TablePlugin-bFqq2Yd9.js} +75 -75
- package/dist/{TablePlugin-BlXaQ0U6.js.map → TablePlugin-bFqq2Yd9.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +8 -8
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +58 -58
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +61 -61
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +25 -25
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +13 -13
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +24 -24
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +29 -29
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +252 -252
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +18 -18
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +19 -19
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +12 -12
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +15 -15
- package/dist/Lexical.prod-Dgzi-S1E.js.map +0 -1
- package/dist/LexicalExtension.prod-CNBWjmfs.js.map +0 -1
- package/dist/LexicalLink.prod-EEOzXxej.js +0 -502
- package/dist/LexicalLink.prod-EEOzXxej.js.map +0 -1
- package/dist/LexicalList.prod-DADZlhem.js +0 -627
- package/dist/LexicalList.prod-DADZlhem.js.map +0 -1
- package/dist/LexicalTable.prod-QpQxZNNH.js +0 -1814
- package/dist/LexicalTable.prod-QpQxZNNH.js.map +0 -1
- package/dist/LexicalUtils.prod-D1mwAww-.js +0 -114
- package/dist/LexicalUtils.prod-D1mwAww-.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { o as u } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
3
|
import { c as f } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as _, N as p, a5 as h } from "../../../../Lexical.prod-YJ1n9pVJ.js";
|
|
5
5
|
import { useState as l, useEffect as k } from "react";
|
|
6
6
|
import { Icon as I } from "../../../Icon/Icon.js";
|
|
7
7
|
import { s as a } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
@@ -9,13 +9,13 @@ import { useTranslation as B } from "../../hooks/useTranslation.js";
|
|
|
9
9
|
const C = {
|
|
10
10
|
bold: "Bold",
|
|
11
11
|
italic: "Italic"
|
|
12
|
-
},
|
|
13
|
-
const t = B(), [i] = u(), [e, c] = l(!1), [n, m] = l(!1),
|
|
12
|
+
}, N = ["bold", "italic"], j = () => {
|
|
13
|
+
const t = B(), [i] = u(), [e, c] = l(!1), [n, m] = l(!1), d = (o) => {
|
|
14
14
|
i.dispatchCommand(h, o);
|
|
15
15
|
};
|
|
16
16
|
return k(() => {
|
|
17
|
-
const o = i.registerUpdateListener(({ editorState:
|
|
18
|
-
|
|
17
|
+
const o = i.registerUpdateListener(({ editorState: b }) => {
|
|
18
|
+
b.read(() => {
|
|
19
19
|
const r = _();
|
|
20
20
|
p(r) && (c(r.hasFormat("bold")), m(r.hasFormat("italic")));
|
|
21
21
|
});
|
|
@@ -23,10 +23,10 @@ const C = {
|
|
|
23
23
|
return () => {
|
|
24
24
|
o();
|
|
25
25
|
};
|
|
26
|
-
}, [i]), /* @__PURE__ */ s("div", { className: a["editor__toolbar-button-group"], children:
|
|
26
|
+
}, [i]), /* @__PURE__ */ s("div", { className: a["editor__toolbar-button-group"], children: N.map((o) => /* @__PURE__ */ s(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
|
-
onClick: () =>
|
|
29
|
+
onClick: () => d(o),
|
|
30
30
|
title: o === "bold" ? t.format.boldTooltip : t.format.italicTooltip,
|
|
31
31
|
className: f(
|
|
32
32
|
a["editor__toolbar-button"],
|
|
@@ -43,6 +43,6 @@ const C = {
|
|
|
43
43
|
)) });
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
j as BlockFormatPlugin
|
|
47
47
|
};
|
|
48
48
|
//# sourceMappingURL=BlockFormatPlugin.js.map
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
import { jsx as b, jsxs as O } from "react/jsx-runtime";
|
|
2
|
-
import { useState as k, useRef as
|
|
2
|
+
import { useState as k, useRef as L, useEffect as E } from "react";
|
|
3
3
|
import { c as z } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { o as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { o as Q } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
5
|
+
import { aK as I, an as U, a as T, N as x, _ as P, g as S, aL as X, V as Y, ad as Z, r as ee } from "../../../../Lexical.prod-YJ1n9pVJ.js";
|
|
6
|
+
import { v } from "../../../../LexicalUtils.prod-BQnuAaA9.js";
|
|
7
7
|
import { AddCatalogueLinkForm as te } from "./AddCatalogueLinkForm/AddCatalogueLinkForm.js";
|
|
8
8
|
import { s as l } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
9
9
|
import { useTranslation as oe } from "../../hooks/useTranslation.js";
|
|
10
|
-
import { CourseCatalogueNode as y, $getLinkTypeFromNode as
|
|
10
|
+
import { CourseCatalogueNode as y, $getLinkTypeFromNode as F, REMOVE_COURSE_CATALOGUE_LINK as re, INSERT_COURSE_CATALOGUE_LINK as ne } from "../../nodes/CourseCatalogueNode/CourseCatalogueNode.js";
|
|
11
11
|
import { useOnClickOutside as se } from "../../../hooks/useOnClickOutside.js";
|
|
12
|
-
import { setScrollableContainers as
|
|
12
|
+
import { setScrollableContainers as H, removeScrollableContainers as ae } from "../../helpers.js";
|
|
13
13
|
const ke = ({
|
|
14
|
-
onSearch:
|
|
15
|
-
searchResponse:
|
|
14
|
+
onSearch: A,
|
|
15
|
+
searchResponse: V,
|
|
16
16
|
parentScrollPosition: j
|
|
17
17
|
}) => {
|
|
18
|
-
const [s] =
|
|
19
|
-
|
|
20
|
-
const r = c === "course" ?
|
|
21
|
-
r &&
|
|
18
|
+
const [s] = Q(), d = oe(), [G, _] = k(!1), [M, h] = k(!1), K = L(null), R = L(null), D = L(null), [m, N] = k(null), [B, J] = k("course"), W = L(m !== null), C = (c) => {
|
|
19
|
+
J(c);
|
|
20
|
+
const r = c === "course" ? K.current?.getBoundingClientRect() : R.current?.getBoundingClientRect();
|
|
21
|
+
r && N({ top: r.bottom, left: r.left });
|
|
22
22
|
}, p = () => {
|
|
23
|
-
|
|
23
|
+
A("", B), N(null);
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return E(() => {
|
|
26
26
|
const c = s.registerCommand(
|
|
27
27
|
I,
|
|
28
28
|
(e) => e.ctrlKey && e.shiftKey && e.altKey && e.key === "C" ? (e.preventDefault(), C("course"), !0) : e.ctrlKey && e.shiftKey && e.altKey && e.key === "P" ? (e.preventDefault(), C("programme"), !0) : !1,
|
|
29
29
|
U
|
|
30
30
|
), r = s.registerUpdateListener(({ editorState: e }) => {
|
|
31
31
|
e.read(() => {
|
|
32
|
-
const n =
|
|
33
|
-
if (
|
|
32
|
+
const n = T();
|
|
33
|
+
if (x(n)) {
|
|
34
34
|
const t = n.anchor.getNode(), a = n.anchor.offset;
|
|
35
|
-
if (
|
|
35
|
+
if (P(t) && a === t.getTextContentSize() && t.getNextSibling() instanceof y) {
|
|
36
36
|
const o = t.getNextSibling();
|
|
37
37
|
if (o) {
|
|
38
|
-
const g =
|
|
39
|
-
|
|
38
|
+
const g = F(o);
|
|
39
|
+
_(g === "course"), h(g === "programme");
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
const i =
|
|
43
|
+
const i = v(t, y);
|
|
44
44
|
if (i) {
|
|
45
|
-
const o =
|
|
46
|
-
|
|
45
|
+
const o = F(i);
|
|
46
|
+
_(o === "course"), h(o === "programme");
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
_(!1), h(!1);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}), u = (e) => {
|
|
53
53
|
const n = Z(), t = e.getTextContentSize();
|
|
54
54
|
n.setTextNodeRange(e, t, e, t), ee(n);
|
|
55
|
-
},
|
|
55
|
+
}, w = (e, n) => P(e) && n === e.getTextContentSize() && e.getNextSibling() instanceof y, $ = s.registerCommand(
|
|
56
56
|
I,
|
|
57
57
|
(e) => {
|
|
58
|
-
const n =
|
|
59
|
-
if (
|
|
58
|
+
const n = T();
|
|
59
|
+
if (x(n)) {
|
|
60
60
|
const t = e.key, a = n.anchor.getNode(), i = n.anchor.offset;
|
|
61
|
-
let o =
|
|
62
|
-
if (
|
|
61
|
+
let o = v(a, y);
|
|
62
|
+
if (w(a, i) && (o = a.getNextSibling()), !o)
|
|
63
63
|
return !1;
|
|
64
64
|
const g = o?.getTextContentSize();
|
|
65
65
|
if (o && e.key === "Enter")
|
|
66
66
|
return e.preventDefault(), s.update(() => {
|
|
67
|
-
if (
|
|
67
|
+
if (w(a, i)) {
|
|
68
68
|
const f = S(`
|
|
69
69
|
`);
|
|
70
70
|
o.insertBefore(f);
|
|
@@ -78,7 +78,7 @@ const ke = ({
|
|
|
78
78
|
if (o && (t === " " || e.code === "Space"))
|
|
79
79
|
return e.preventDefault(), s.update(() => {
|
|
80
80
|
const f = S(" ");
|
|
81
|
-
|
|
81
|
+
w(a, i) && (o.insertBefore(f), u(f)), i === g && (o.insertAfter(f), u(f));
|
|
82
82
|
}), !0;
|
|
83
83
|
if (o && (t === "Backspace" || t === "Delete"))
|
|
84
84
|
return e.preventDefault(), s.update(
|
|
@@ -94,11 +94,11 @@ const ke = ({
|
|
|
94
94
|
},
|
|
95
95
|
U
|
|
96
96
|
), q = s.registerCommand(
|
|
97
|
-
|
|
97
|
+
X,
|
|
98
98
|
(e) => {
|
|
99
|
-
const n =
|
|
100
|
-
if (
|
|
101
|
-
const t = n.anchor.getNode(), a =
|
|
99
|
+
const n = T();
|
|
100
|
+
if (x(n)) {
|
|
101
|
+
const t = n.anchor.getNode(), a = v(t, y);
|
|
102
102
|
if (a) {
|
|
103
103
|
e.preventDefault();
|
|
104
104
|
const i = s.getElementByKey(a.getKey());
|
|
@@ -107,72 +107,72 @@ const ke = ({
|
|
|
107
107
|
}
|
|
108
108
|
return !1;
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
Y
|
|
111
111
|
);
|
|
112
112
|
return () => {
|
|
113
|
-
c(), r(),
|
|
113
|
+
c(), r(), $(), q();
|
|
114
114
|
};
|
|
115
|
-
}, [s]), se(
|
|
116
|
-
const c = (u) => (
|
|
115
|
+
}, [s]), se(D, () => N(null)), E(() => {
|
|
116
|
+
const c = (u) => (H(r), u.key === "Escape" && W.current && (u.preventDefault(), u.stopPropagation(), p()), !0);
|
|
117
117
|
window.addEventListener("keydown", c, { capture: !0 });
|
|
118
118
|
const r = () => {
|
|
119
119
|
p();
|
|
120
120
|
};
|
|
121
|
-
return
|
|
121
|
+
return H(r), window.addEventListener("scroll", r), window.addEventListener("resize", r), () => {
|
|
122
122
|
window.removeEventListener("keydown", c), window.removeEventListener("scroll", r), window.removeEventListener("resize", r), ae(r);
|
|
123
123
|
};
|
|
124
|
-
}, []),
|
|
125
|
-
|
|
124
|
+
}, []), E(() => {
|
|
125
|
+
m && p();
|
|
126
126
|
}, [j]), /* @__PURE__ */ b("div", { className: l["editor__toolbar-button-group"], children: /* @__PURE__ */ O("div", { className: l["editor__toolbar-button-flyoutwrapper"], children: [
|
|
127
127
|
/* @__PURE__ */ O("div", { className: l["editor__toolbar-button-group--text"], children: [
|
|
128
128
|
/* @__PURE__ */ b(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
131
|
onClick: () => C("course"),
|
|
132
|
-
title:
|
|
132
|
+
title: d.cataloguelinks.courseTooltip,
|
|
133
133
|
className: z(
|
|
134
134
|
l["editor__toolbar-button"],
|
|
135
135
|
l["editor__toolbar-button--text"],
|
|
136
|
-
|
|
136
|
+
G && l["editor__toolbar-button--active"]
|
|
137
137
|
),
|
|
138
|
-
"aria-label":
|
|
139
|
-
"aria-keyshortcuts":
|
|
138
|
+
"aria-label": d.aria.labels.courselink,
|
|
139
|
+
"aria-keyshortcuts": d.aria.keyshortcuts.courselink,
|
|
140
140
|
type: "button",
|
|
141
|
-
ref:
|
|
142
|
-
children:
|
|
141
|
+
ref: K,
|
|
142
|
+
children: d.cataloguelinks.courseButtonLabel
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ b(
|
|
146
146
|
"button",
|
|
147
147
|
{
|
|
148
148
|
onClick: () => C("programme"),
|
|
149
|
-
title:
|
|
149
|
+
title: d.cataloguelinks.programmeTooltip,
|
|
150
150
|
className: z(
|
|
151
151
|
l["editor__toolbar-button"],
|
|
152
152
|
l["editor__toolbar-button--text"],
|
|
153
|
-
|
|
153
|
+
M && l["editor__toolbar-button--active"]
|
|
154
154
|
),
|
|
155
|
-
"aria-label":
|
|
156
|
-
"aria-keyshortcuts":
|
|
155
|
+
"aria-label": d.aria.labels.programmelink,
|
|
156
|
+
"aria-keyshortcuts": d.aria.keyshortcuts.programmelink,
|
|
157
157
|
type: "button",
|
|
158
|
-
ref:
|
|
159
|
-
children:
|
|
158
|
+
ref: R,
|
|
159
|
+
children: d.cataloguelinks.programmeButtonLabel
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
] }),
|
|
163
|
-
|
|
163
|
+
m && /* @__PURE__ */ b(
|
|
164
164
|
"div",
|
|
165
165
|
{
|
|
166
166
|
className: l["editor__toolbar-flyout-wrapper"],
|
|
167
|
-
style: { top:
|
|
168
|
-
ref:
|
|
167
|
+
style: { top: m.top, left: m.left },
|
|
168
|
+
ref: D,
|
|
169
169
|
children: /* @__PURE__ */ b(
|
|
170
170
|
te,
|
|
171
171
|
{
|
|
172
172
|
linkType: B,
|
|
173
173
|
onCloseHandler: p,
|
|
174
|
-
onSearchHandler:
|
|
175
|
-
searchResponse:
|
|
174
|
+
onSearchHandler: A,
|
|
175
|
+
searchResponse: V,
|
|
176
176
|
onSelect: (c, r, u) => {
|
|
177
177
|
s.dispatchCommand(ne, {
|
|
178
178
|
linkType: u,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { c as e } from "../../../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { o as h } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
4
|
-
import {
|
|
4
|
+
import { aM as _, aN as C, aO as y, aP as k } from "../../../../Lexical.prod-YJ1n9pVJ.js";
|
|
5
5
|
import { useState as m, useEffect as s } from "react";
|
|
6
6
|
import "../../../Accordion/Accordion.js";
|
|
7
7
|
import { Icon as n } from "../../../Icon/Icon.js";
|
|
@@ -18,9 +18,9 @@ import "../../../IconButton/IconButton.js";
|
|
|
18
18
|
import "../../../Input/Input.js";
|
|
19
19
|
import "../../../InputField/InputField.js";
|
|
20
20
|
import "react-router";
|
|
21
|
-
import "../../../../TablePlugin-
|
|
21
|
+
import "../../../../TablePlugin-bFqq2Yd9.js";
|
|
22
22
|
import { s as r } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
23
|
-
import { useTranslation as
|
|
23
|
+
import { useTranslation as x } from "../../hooks/useTranslation.js";
|
|
24
24
|
import "../../Providers/LanguageProvider.js";
|
|
25
25
|
import "../LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
26
26
|
import "../../hooks/components/Flyout.js";
|
|
@@ -33,7 +33,7 @@ import "../../../Sortable/components/SortableItem.js";
|
|
|
33
33
|
import "../../../../SortableProvider-BbwlEPIr.js";
|
|
34
34
|
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
35
35
|
const ro = () => {
|
|
36
|
-
const o =
|
|
36
|
+
const o = x(), [t] = h(), [p, d] = m(!1), [l, c] = m(!1), u = () => {
|
|
37
37
|
t.dispatchCommand(y, void 0);
|
|
38
38
|
}, b = () => {
|
|
39
39
|
t.dispatchCommand(k, void 0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { A as I } from "../../../../../TablePlugin-
|
|
3
|
+
import { A as I } from "../../../../../TablePlugin-bFqq2Yd9.js";
|
|
4
4
|
import "../helpers.js";
|
|
5
5
|
import "../../../../Accordion/Accordion.js";
|
|
6
6
|
import "../../../../Icon/Icon.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as f, jsxs as
|
|
2
|
-
import { o as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import { useRef as a, useState as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { A as rt } from "../../../../TablePlugin-
|
|
1
|
+
import { jsx as f, jsxs as J } from "react/jsx-runtime";
|
|
2
|
+
import { o as W } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { c as Y } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { N as b, E as q, J as G } from "../../../../LexicalLink.prod-u8L4ioQd.js";
|
|
5
|
+
import { useRef as a, useState as Q, useEffect as u } from "react";
|
|
6
|
+
import { aa as X, a as p, x as Z, aK as $, N, an as tt, r as et, g as ot } from "../../../../Lexical.prod-YJ1n9pVJ.js";
|
|
7
|
+
import { v as w } from "../../../../LexicalUtils.prod-BQnuAaA9.js";
|
|
8
|
+
import { A as rt } from "../../../../TablePlugin-bFqq2Yd9.js";
|
|
9
9
|
import { ensureHttps as nt } from "./helpers.js";
|
|
10
10
|
import { LinkContextMenu as it } from "./LinkContextMenu/LinkContextMenu.js";
|
|
11
11
|
import { useFlyout as st } from "../../hooks/useFlyout.js";
|
|
@@ -24,7 +24,7 @@ import "../../../IconButton/IconButton.js";
|
|
|
24
24
|
import "../../../Input/Input.js";
|
|
25
25
|
import "../../../InputField/InputField.js";
|
|
26
26
|
import "react-router";
|
|
27
|
-
import { setScrollableContainers as
|
|
27
|
+
import { setScrollableContainers as U, removeScrollableContainers as at } from "../../helpers.js";
|
|
28
28
|
import { s as g } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
29
29
|
import { useTranslation as lt } from "../../hooks/useTranslation.js";
|
|
30
30
|
import "../../Providers/LanguageProvider.js";
|
|
@@ -36,42 +36,42 @@ import "../../../SelectListbox/SelectProvider.js";
|
|
|
36
36
|
import "../../../Sortable/components/SortableItem.js";
|
|
37
37
|
import "../../../../SortableProvider-BbwlEPIr.js";
|
|
38
38
|
import "../../../WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
39
|
-
const ut = 200,
|
|
40
|
-
const
|
|
39
|
+
const ut = 200, Gt = ({ parentScrollPosition: z }) => {
|
|
40
|
+
const T = lt(), [i] = W(), { flyout: H, showFlyout: S, hideFlyout: h, isVisible: l } = st(), m = a(void 0), x = a(!1), C = a(""), d = a(""), [k, I] = Q({ active: !1, url: "", linktext: "" }), R = a(l), E = a(null), P = a(null), F = a(void 0), v = () => {
|
|
41
41
|
i.update(() => {
|
|
42
42
|
const r = p();
|
|
43
|
-
|
|
43
|
+
E.current = r;
|
|
44
44
|
});
|
|
45
45
|
}, D = () => {
|
|
46
46
|
i.update(() => {
|
|
47
|
-
|
|
47
|
+
E.current && et(E.current);
|
|
48
48
|
});
|
|
49
|
-
},
|
|
50
|
-
|
|
49
|
+
}, O = (r, t) => {
|
|
50
|
+
S({
|
|
51
51
|
position: t,
|
|
52
52
|
children: /* @__PURE__ */ f(
|
|
53
53
|
it,
|
|
54
54
|
{
|
|
55
55
|
url: r,
|
|
56
56
|
onSave: (e) => B(e, ""),
|
|
57
|
-
onDelete: () =>
|
|
57
|
+
onDelete: () => j(),
|
|
58
58
|
onClose: K,
|
|
59
|
-
ref:
|
|
59
|
+
ref: F
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
});
|
|
63
63
|
}, K = () => {
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
const r =
|
|
67
|
-
!
|
|
68
|
-
},
|
|
64
|
+
F.current?.clearForm(), h(), D();
|
|
65
|
+
}, _ = () => {
|
|
66
|
+
const r = P.current?.getBoundingClientRect();
|
|
67
|
+
!x.current && r && (v(), S({ position: { top: r.bottom, left: r.left }, ...A }), setTimeout(() => m.current?.setDefaults("", d.current), 0));
|
|
68
|
+
}, y = () => {
|
|
69
69
|
h(), D();
|
|
70
70
|
}, B = (r, t) => {
|
|
71
71
|
i.update(() => {
|
|
72
72
|
const e = p();
|
|
73
|
-
if (
|
|
74
|
-
const o = e.anchor.getNode(), s =
|
|
73
|
+
if (N(e)) {
|
|
74
|
+
const o = e.anchor.getNode(), s = w(o, b);
|
|
75
75
|
if (t && t !== "") {
|
|
76
76
|
if (s) {
|
|
77
77
|
const n = ot(t);
|
|
@@ -82,47 +82,47 @@ const ut = 200, $t = ({ parentScrollPosition: U }) => {
|
|
|
82
82
|
e.insertText(t), n.offset -= t.length, c.offset = n.offset + t.length;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
G(nt(r), { target: "_blank" });
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
y();
|
|
88
88
|
});
|
|
89
|
-
},
|
|
90
|
-
i.dispatchCommand(
|
|
91
|
-
},
|
|
89
|
+
}, j = () => {
|
|
90
|
+
i.dispatchCommand(q, null), K();
|
|
91
|
+
}, A = {
|
|
92
92
|
children: /* @__PURE__ */ f(
|
|
93
93
|
rt,
|
|
94
94
|
{
|
|
95
95
|
isLink: k,
|
|
96
|
-
onCloseHandler:
|
|
96
|
+
onCloseHandler: y,
|
|
97
97
|
onSaveHandler: (r, t) => B(r, t),
|
|
98
98
|
ref: m
|
|
99
99
|
}
|
|
100
100
|
)
|
|
101
101
|
};
|
|
102
102
|
return u(() => {
|
|
103
|
-
l ? (
|
|
103
|
+
l ? (x.current = !0, m.current?.focusFirstField()) : (m.current?.clearForm(), C.current = d.current = "", setTimeout(() => x.current = !1, ut));
|
|
104
104
|
}, [m, l]), u(() => {
|
|
105
105
|
const r = (o) => {
|
|
106
|
-
if (
|
|
107
|
-
const s = o.anchor.getNode(), n =
|
|
106
|
+
if (N(o) && o.isCollapsed()) {
|
|
107
|
+
const s = o.anchor.getNode(), n = w(s, b);
|
|
108
108
|
if (n) {
|
|
109
|
-
const c = i.getElementByKey(o.anchor.getNode().getKey()),
|
|
110
|
-
return
|
|
109
|
+
const c = i.getElementByKey(o.anchor.getNode().getKey()), L = c ? { top: c.getBoundingClientRect().bottom, left: c.getBoundingClientRect().left } : { top: 0, left: 0 };
|
|
110
|
+
return O(n.getURL(), L), !0;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
return !1;
|
|
114
114
|
}, t = i.registerCommand(
|
|
115
|
-
|
|
115
|
+
X,
|
|
116
116
|
() => {
|
|
117
117
|
const o = p();
|
|
118
118
|
return d.current = o?.getTextContent() ?? "", r(o), !1;
|
|
119
119
|
},
|
|
120
120
|
0
|
|
121
121
|
), e = i.registerCommand(
|
|
122
|
-
|
|
122
|
+
Z,
|
|
123
123
|
(o) => {
|
|
124
124
|
const s = p();
|
|
125
|
-
return
|
|
125
|
+
return v(), o.preventDefault(), o.stopPropagation(), o.stopImmediatePropagation(), r(s), !1;
|
|
126
126
|
},
|
|
127
127
|
0
|
|
128
128
|
);
|
|
@@ -131,29 +131,29 @@ const ut = 200, $t = ({ parentScrollPosition: U }) => {
|
|
|
131
131
|
};
|
|
132
132
|
}, [i]), u(() => {
|
|
133
133
|
const r = i.registerCommand(
|
|
134
|
-
|
|
134
|
+
$,
|
|
135
135
|
(e) => {
|
|
136
136
|
if (e.ctrlKey && e.shiftKey && e.key === "U") {
|
|
137
137
|
const o = p();
|
|
138
|
-
if (
|
|
138
|
+
if (v(), !N(o))
|
|
139
139
|
return !1;
|
|
140
|
-
const s = o.anchor.getNode(), n =
|
|
141
|
-
|
|
140
|
+
const s = o.anchor.getNode(), n = w(s, b), c = (M = "", V = "") => {
|
|
141
|
+
_(), setTimeout(() => m.current?.setDefaults(M, V), 0);
|
|
142
142
|
};
|
|
143
143
|
if (n)
|
|
144
144
|
return e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), C.current = n.getTextContent(), c(n.getURL(), n.getTextContent()), !0;
|
|
145
|
-
const
|
|
146
|
-
return
|
|
145
|
+
const L = o.getTextContent();
|
|
146
|
+
return L !== "" ? (d.current = L, c("", d.current), !0) : (_(), !0);
|
|
147
147
|
}
|
|
148
148
|
return !1;
|
|
149
149
|
},
|
|
150
150
|
tt
|
|
151
151
|
), t = i.registerUpdateListener(({ editorState: e }) => {
|
|
152
|
-
|
|
152
|
+
I(
|
|
153
153
|
e.read(() => {
|
|
154
154
|
const o = p();
|
|
155
|
-
if (
|
|
156
|
-
const s = o.anchor.getNode(), n =
|
|
155
|
+
if (v(), N(o)) {
|
|
156
|
+
const s = o.anchor.getNode(), n = w(s, b);
|
|
157
157
|
if (n)
|
|
158
158
|
return {
|
|
159
159
|
active: !0,
|
|
@@ -173,42 +173,42 @@ const ut = 200, $t = ({ parentScrollPosition: U }) => {
|
|
|
173
173
|
r(), t();
|
|
174
174
|
};
|
|
175
175
|
}, [i]), u(() => {
|
|
176
|
-
R.current = l, l ||
|
|
176
|
+
R.current = l, l || F.current?.clearForm();
|
|
177
177
|
}, [l]), u(() => {
|
|
178
|
-
l &&
|
|
179
|
-
}, [
|
|
178
|
+
l && y();
|
|
179
|
+
}, [z]), u(() => {
|
|
180
180
|
k.active || h();
|
|
181
181
|
}, [k]), u(() => {
|
|
182
|
-
const r = (e) => (
|
|
182
|
+
const r = (e) => (U(t), e.key === "Escape" && R.current && (e.preventDefault(), e.stopPropagation(), y()), !0);
|
|
183
183
|
window.addEventListener("keydown", r, { capture: !0 });
|
|
184
184
|
const t = () => {
|
|
185
185
|
h();
|
|
186
186
|
};
|
|
187
|
-
return
|
|
187
|
+
return U(t), window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
|
|
188
188
|
window.removeEventListener("keydown", r), window.removeEventListener("scroll", t), window.removeEventListener("resize", t), at(t);
|
|
189
189
|
};
|
|
190
|
-
}, []), /* @__PURE__ */ f("div", { className: g["editor__toolbar-button-group"], children: /* @__PURE__ */
|
|
190
|
+
}, []), /* @__PURE__ */ f("div", { className: g["editor__toolbar-button-group"], children: /* @__PURE__ */ J("div", { className: g["editor__toolbar-button-flyoutwrapper"], children: [
|
|
191
191
|
/* @__PURE__ */ f(
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
|
-
onClick:
|
|
195
|
-
title:
|
|
196
|
-
className:
|
|
194
|
+
onClick: _,
|
|
195
|
+
title: T.links.linkTooltip,
|
|
196
|
+
className: Y(
|
|
197
197
|
g["editor__toolbar-button"],
|
|
198
198
|
g["editor__toolbar-button--link"],
|
|
199
199
|
k.active && g["editor__toolbar-button--active"]
|
|
200
200
|
),
|
|
201
|
-
"aria-label":
|
|
202
|
-
"aria-keyshortcuts":
|
|
201
|
+
"aria-label": T.aria.labels.link,
|
|
202
|
+
"aria-keyshortcuts": T.aria.keyshortcuts.link,
|
|
203
203
|
type: "button",
|
|
204
|
-
ref:
|
|
204
|
+
ref: P,
|
|
205
205
|
children: /* @__PURE__ */ f(ct, { name: "Link", size: 20 })
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
|
|
208
|
+
H
|
|
209
209
|
] }) });
|
|
210
210
|
};
|
|
211
211
|
export {
|
|
212
|
-
|
|
212
|
+
Gt as LinkPlugin
|
|
213
213
|
};
|
|
214
214
|
//# sourceMappingURL=LinkPlugin.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as w } from "../../../../LexicalLink.prod-
|
|
1
|
+
import { H as w } from "../../../../LexicalLink.prod-u8L4ioQd.js";
|
|
2
2
|
const a = /^(http|https):\/\//, s = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/, A = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/, z = /^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})?$/, n = (t) => t === "https://" || s.test(t), o = (t) => t === "https://" || z.test(t), r = [
|
|
3
3
|
w(s, (t) => a.test(t) ? t : `//${t}`),
|
|
4
4
|
w(A, (t) => `mailto:${t}`)
|