@uva-glass/component-library 3.54.3 → 3.55.1
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-A4JuKqM3.js → Lexical.prod-o6Eq_uLx.js} +27 -27
- package/dist/{Lexical.prod-A4JuKqM3.js.map → Lexical.prod-o6Eq_uLx.js.map} +1 -1
- package/dist/{LexicalClipboard.prod-CoyZP29w.js → LexicalClipboard.prod-CnUrf2_p.js} +20 -20
- package/dist/{LexicalClipboard.prod-CoyZP29w.js.map → LexicalClipboard.prod-CnUrf2_p.js.map} +1 -1
- package/dist/{LexicalExtension.prod-DFPuTMk1.js → LexicalExtension.prod-CanXuzFO.js} +19 -19
- package/dist/{LexicalExtension.prod-DFPuTMk1.js.map → LexicalExtension.prod-CanXuzFO.js.map} +1 -1
- package/dist/{LexicalLink.prod-Dp06n3Hn.js → LexicalLink.prod-DAVbKER8.js} +4 -4
- package/dist/{LexicalLink.prod-Dp06n3Hn.js.map → LexicalLink.prod-DAVbKER8.js.map} +1 -1
- package/dist/{LexicalList.prod-D3TdO_Pq.js → LexicalList.prod-C6cknPBV.js} +4 -4
- package/dist/{LexicalList.prod-D3TdO_Pq.js.map → LexicalList.prod-C6cknPBV.js.map} +1 -1
- package/dist/{LexicalSelection.prod-BapitO0n.js → LexicalSelection.prod-B8GGrzJ3.js} +18 -18
- package/dist/{LexicalSelection.prod-BapitO0n.js.map → LexicalSelection.prod-B8GGrzJ3.js.map} +1 -1
- package/dist/{LexicalTable.prod-bzYpvqMi.js → LexicalTable.prod-upbwOtcE.js} +5 -5
- package/dist/{LexicalTable.prod-bzYpvqMi.js.map → LexicalTable.prod-upbwOtcE.js.map} +1 -1
- package/dist/{LexicalUtils.prod-CAsHFX57.js → LexicalUtils.prod-CF7x-KWm.js} +5 -5
- package/dist/{LexicalUtils.prod-CAsHFX57.js.map → LexicalUtils.prod-CF7x-KWm.js.map} +1 -1
- package/dist/RteEditor.module-CoTOIw5i.js +41 -0
- package/dist/RteEditor.module-CoTOIw5i.js.map +1 -0
- package/dist/{TableCellResizerPlugin-ffA1s2mD.js → TableCellResizerPlugin-qMtSAoKT.js} +4 -4
- package/dist/{TableCellResizerPlugin-ffA1s2mD.js.map → TableCellResizerPlugin-qMtSAoKT.js.map} +1 -1
- package/dist/{TablePlugin-CzmrXpxk.js → TablePlugin-BRZcXq73.js} +28 -28
- package/dist/{TablePlugin-CzmrXpxk.js.map → TablePlugin-BRZcXq73.js.map} +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/Icon/icons/index.d.ts +24 -0
- package/dist/components/Icon/icons/index.js +207 -187
- package/dist/components/Icon/icons/index.js.map +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/Periods/Periods.d.ts +1 -1
- package/dist/components/Periods/Periods.js.map +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 +2 -2
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +108 -105
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +35 -31
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +121 -118
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +12 -12
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- 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 +5 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +70 -65
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.d.ts +4 -2
- package/dist/components/RteEditor/RteEditor.js +218 -215
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +23 -19
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/helpers.js +4 -4
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +2 -2
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +3 -3
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +18 -18
- package/dist/RteEditor.module-DaBh86FK.js +0 -41
- package/dist/RteEditor.module-DaBh86FK.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { o as I } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
-
import { b, k as _, x as v, a as K, m as N, p as P, u as y } from "../../../../LexicalList.prod-
|
|
3
|
+
import { b, k as _, x as v, a as K, m as N, p as P, u as y } from "../../../../LexicalList.prod-C6cknPBV.js";
|
|
4
4
|
import { useState as p, useEffect as k } from "react";
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import { v as E } from "../../../../LexicalUtils.prod-
|
|
5
|
+
import { c as $ } from "../../../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { ap as w, aq as O, ab as U, $ as D, w as S, H as B } from "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
7
|
+
import { v as E } from "../../../../LexicalUtils.prod-CF7x-KWm.js";
|
|
8
8
|
import { Icon as H } from "../../../Icon/Icon.js";
|
|
9
|
-
import { s as n } from "../../../../RteEditor.module-
|
|
9
|
+
import { s as n } from "../../../../RteEditor.module-CoTOIw5i.js";
|
|
10
10
|
import { useTranslation as j } from "../../hooks/useTranslation.js";
|
|
11
|
-
const
|
|
11
|
+
const q = {
|
|
12
12
|
bullet: "BulletList",
|
|
13
13
|
number: "NumberedList"
|
|
14
|
-
},
|
|
14
|
+
}, z = ["bullet", "number"], W = () => {
|
|
15
15
|
const m = j(), [e] = I(), [h, s] = p(null), [u, g] = p(!1), [c, L] = p(!1), x = (t) => {
|
|
16
16
|
t === "number" && h !== "number" ? (e.dispatchCommand(_, void 0), s("number")) : t === "bullet" && h !== "bullet" ? (e.dispatchCommand(v, void 0), s("bullet")) : (e.dispatchCommand(b, void 0), s(null));
|
|
17
17
|
};
|
|
18
18
|
return k(() => {
|
|
19
19
|
const t = e.registerCommand(
|
|
20
|
-
|
|
20
|
+
w,
|
|
21
21
|
(o) => o.ctrlKey && o.shiftKey && o.code === "Digit7" ? (o.preventDefault(), c ? e.dispatchCommand(b, void 0) : e.dispatchCommand(_, void 0), !0) : o.ctrlKey && o.shiftKey && o.code === "Digit8" ? (o.preventDefault(), u ? e.dispatchCommand(b, void 0) : e.dispatchCommand(v, void 0), !0) : !1,
|
|
22
|
-
|
|
22
|
+
O
|
|
23
23
|
);
|
|
24
24
|
return () => {
|
|
25
25
|
t();
|
|
@@ -59,12 +59,12 @@ const z = {
|
|
|
59
59
|
return () => {
|
|
60
60
|
o(), t();
|
|
61
61
|
};
|
|
62
|
-
}, [e]), /* @__PURE__ */ f("div", { className: n["editor__toolbar-button-group"], children:
|
|
62
|
+
}, [e]), /* @__PURE__ */ f("div", { className: n["editor__toolbar-button-group"], children: z.map((t) => /* @__PURE__ */ f(
|
|
63
63
|
"button",
|
|
64
64
|
{
|
|
65
65
|
onClick: () => x(t),
|
|
66
66
|
title: m.format[`${t}Tooltip`],
|
|
67
|
-
className:
|
|
67
|
+
className: $(
|
|
68
68
|
n["editor__toolbar-button"],
|
|
69
69
|
n[`editor__toolbar-button--${t}`],
|
|
70
70
|
t === "bullet" && u && n["editor__toolbar-button--active"],
|
|
@@ -73,7 +73,7 @@ const z = {
|
|
|
73
73
|
"aria-label": m.aria.labels[t],
|
|
74
74
|
"aria-keyshortcuts": m.aria.keyshortcuts[t],
|
|
75
75
|
type: "button",
|
|
76
|
-
children: /* @__PURE__ */ f(H, { name:
|
|
76
|
+
children: /* @__PURE__ */ f(H, { name: q[t], size: 24 })
|
|
77
77
|
},
|
|
78
78
|
t
|
|
79
79
|
)) });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as m } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
2
2
|
import { useEffect as c } from "react";
|
|
3
|
-
import { o as
|
|
4
|
-
import { A as i } from "../../../../LexicalUtils.prod-
|
|
5
|
-
import { R as d } from "../../../../LexicalClipboard.prod-
|
|
3
|
+
import { o as f, aq as p, $ as u } from "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
4
|
+
import { A as i } from "../../../../LexicalUtils.prod-CF7x-KWm.js";
|
|
5
|
+
import { R as d } from "../../../../LexicalClipboard.prod-CnUrf2_p.js";
|
|
6
6
|
import { d as D } from "../../../../index-yEhaxKq-.js";
|
|
7
7
|
const P = () => {
|
|
8
8
|
const [e] = m(), l = (t) => {
|
|
@@ -16,9 +16,9 @@ const P = () => {
|
|
|
16
16
|
};
|
|
17
17
|
return c(() => {
|
|
18
18
|
const t = e.registerCommand(
|
|
19
|
-
|
|
19
|
+
f,
|
|
20
20
|
(r) => r instanceof ClipboardEvent ? (l(r), !0) : !1,
|
|
21
|
-
|
|
21
|
+
p
|
|
22
22
|
);
|
|
23
23
|
return () => {
|
|
24
24
|
t();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
4
|
-
import { T as b } from "../../../../TableCellResizerPlugin-
|
|
5
|
-
import "../../../../LexicalTable.prod-
|
|
6
|
-
import "../../../../LexicalUtils.prod-
|
|
7
|
-
import "../../../../Lexical.prod-
|
|
4
|
+
import { T as b } from "../../../../TableCellResizerPlugin-qMtSAoKT.js";
|
|
5
|
+
import "../../../../LexicalTable.prod-upbwOtcE.js";
|
|
6
|
+
import "../../../../LexicalUtils.prod-CF7x-KWm.js";
|
|
7
|
+
import "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "../TablePlugin/helpers.js";
|
|
10
10
|
import "../../nodes/TableWrapperNode/TableWrapperNode.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { b as G } from "../../../../TablePlugin-
|
|
3
|
+
import { b as G } from "../../../../TablePlugin-BRZcXq73.js";
|
|
4
4
|
import "../../../Accordion/Accordion.js";
|
|
5
5
|
import "../../../Buttons/Button.js";
|
|
6
6
|
import "../../../Buttons/LinkButton.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
3
|
import "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import "../../../../LexicalTable.prod-
|
|
5
|
-
import "../../../../Lexical.prod-
|
|
6
|
-
import "../../../../LexicalUtils.prod-
|
|
4
|
+
import "../../../../LexicalTable.prod-upbwOtcE.js";
|
|
5
|
+
import "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
6
|
+
import "../../../../LexicalUtils.prod-CF7x-KWm.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { T as L } from "../../../../TablePlugin-
|
|
8
|
+
import { T as L } from "../../../../TablePlugin-BRZcXq73.js";
|
|
9
9
|
import "./helpers.js";
|
|
10
10
|
import "../../nodes/TableWrapperNode/TableWrapperNode.js";
|
|
11
11
|
import "../../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 "../../../../RteEditor.module-
|
|
27
|
+
import "../../../../RteEditor.module-CoTOIw5i.js";
|
|
28
28
|
import "../../hooks/useTranslation.js";
|
|
29
29
|
import "../../Providers/LanguageProvider.js";
|
|
30
30
|
import "../LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as p, M as i, X as w, u as T, V as u, q as b, r as E, Y as D, L as g, e as I, U as R, E as x } from "../../../../LexicalTable.prod-
|
|
2
|
-
import { V as S } from "../../../../Lexical.prod-
|
|
1
|
+
import { l as p, M as i, X as w, u as T, V as u, q as b, r as E, Y as D, L as g, e as I, U as R, E as x } from "../../../../LexicalTable.prod-upbwOtcE.js";
|
|
2
|
+
import { V as S } from "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
3
3
|
import { TableWrapperNode as N } from "../../nodes/TableWrapperNode/TableWrapperNode.js";
|
|
4
4
|
import "react";
|
|
5
5
|
const F = 32, a = 48, W = 1, M = 200, P = 320, H = (t, e) => {
|
|
@@ -1,85 +1,90 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { o as
|
|
3
|
-
import { $ as g, w, m as L } from "../../../../Lexical.prod-
|
|
4
|
-
import { useState as
|
|
5
|
-
import { J as
|
|
6
|
-
import { CourseCataloguePlugin as
|
|
7
|
-
import { BlockFormatPlugin as
|
|
8
|
-
import { ListPlugin as
|
|
9
|
-
import { LinkPlugin as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { T as
|
|
12
|
-
import { TableCellContextMenu as
|
|
1
|
+
import { jsxs as T, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { o as y } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
+
import { $ as g, w as h, m as N, e as x, ap as B, H as L } from "../../../../Lexical.prod-o6Eq_uLx.js";
|
|
4
|
+
import { useState as v, useRef as A, useCallback as b, useEffect as H } from "react";
|
|
5
|
+
import { J as P } from "../../../../LexicalTable.prod-upbwOtcE.js";
|
|
6
|
+
import { CourseCataloguePlugin as R } from "../CourseCataloguePlugin/CourseCataloguePlugin.js";
|
|
7
|
+
import { BlockFormatPlugin as S } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
8
|
+
import { ListPlugin as j } from "../ListPlugin/ListPlugin.js";
|
|
9
|
+
import { LinkPlugin as k } from "../LinkPlugin/LinkPlugin.js";
|
|
10
|
+
import { HistoryPlugin as w } from "../HistoryPlugin/HistoryPlugin.js";
|
|
11
|
+
import { T as z } from "../../../../TablePlugin-BRZcXq73.js";
|
|
12
|
+
import { TableCellContextMenu as E } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
13
13
|
import "react-dom";
|
|
14
14
|
import "../../../../index-yEhaxKq-.js";
|
|
15
|
-
import { s as
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
catalogueSearchResponse: u
|
|
15
|
+
import { s as J } from "../../../../RteEditor.module-CoTOIw5i.js";
|
|
16
|
+
const Y = ({
|
|
17
|
+
editorScrollPosition: l,
|
|
18
|
+
onCatalogueLinkSearch: u,
|
|
19
|
+
catalogueSearchResponse: f
|
|
21
20
|
}) => {
|
|
22
|
-
const [
|
|
21
|
+
const [e] = y(), [a, n] = v(null), p = A(null), d = b(() => {
|
|
23
22
|
const o = g();
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const h = n.getElementByKey(a.getKey()), c = h ? h.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };
|
|
28
|
-
s({ xPos: c.right, yPos: c.bottom, height: c.height });
|
|
29
|
-
} else
|
|
30
|
-
s(null);
|
|
23
|
+
if (!h(o)) {
|
|
24
|
+
n(null);
|
|
25
|
+
return;
|
|
31
26
|
}
|
|
32
|
-
|
|
27
|
+
const r = o.anchor.getNode(), i = P(r);
|
|
28
|
+
if (!i) {
|
|
29
|
+
n(null);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const c = e.getElementByKey(i.getKey());
|
|
33
|
+
if (!c) return;
|
|
34
|
+
const m = c.getBoundingClientRect();
|
|
35
|
+
n({
|
|
36
|
+
xPos: m.right,
|
|
37
|
+
yPos: m.bottom,
|
|
38
|
+
height: m.height
|
|
39
|
+
});
|
|
40
|
+
}, [e]), C = (o) => {
|
|
33
41
|
p.current?.mutateTable(o);
|
|
34
|
-
},
|
|
35
|
-
|
|
42
|
+
}, s = b(() => {
|
|
43
|
+
e.update(() => {
|
|
36
44
|
const o = g();
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
|
|
45
|
+
if (h(o)) {
|
|
46
|
+
const i = o.anchor.getNode();
|
|
47
|
+
P(i) && (N(null), n(null));
|
|
40
48
|
}
|
|
41
49
|
});
|
|
42
|
-
};
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
o.read(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */ t(
|
|
60
|
-
|
|
61
|
-
/* @__PURE__ */ t(K, { isActive: !!i, ref: p }),
|
|
62
|
-
i && /* @__PURE__ */ t(
|
|
63
|
-
R,
|
|
50
|
+
}, [e]);
|
|
51
|
+
return H(() => x(
|
|
52
|
+
e.registerUpdateListener(({ editorState: o }) => {
|
|
53
|
+
o.read(d);
|
|
54
|
+
}),
|
|
55
|
+
e.registerCommand(
|
|
56
|
+
B,
|
|
57
|
+
() => (s(), !1),
|
|
58
|
+
L
|
|
59
|
+
),
|
|
60
|
+
e.registerRootListener((o, r) => {
|
|
61
|
+
r && r.removeEventListener("scroll", s), o && o.addEventListener("scroll", s);
|
|
62
|
+
})
|
|
63
|
+
), [e, d, s]), /* @__PURE__ */ T("div", { className: J.editor__toolbar, children: [
|
|
64
|
+
/* @__PURE__ */ t(S, {}),
|
|
65
|
+
/* @__PURE__ */ t(j, {}),
|
|
66
|
+
/* @__PURE__ */ t(z, { isActive: !!a, ref: p }),
|
|
67
|
+
a && /* @__PURE__ */ t(
|
|
68
|
+
E,
|
|
64
69
|
{
|
|
65
|
-
position:
|
|
66
|
-
parentScrollPosition:
|
|
67
|
-
onAction:
|
|
70
|
+
position: a,
|
|
71
|
+
parentScrollPosition: l,
|
|
72
|
+
onAction: C
|
|
68
73
|
}
|
|
69
74
|
),
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
/* @__PURE__ */ t(k, { parentScrollPosition: l }),
|
|
76
|
+
u && f && /* @__PURE__ */ t(
|
|
77
|
+
R,
|
|
73
78
|
{
|
|
74
|
-
parentScrollPosition:
|
|
75
|
-
onSearch:
|
|
76
|
-
searchResponse:
|
|
79
|
+
parentScrollPosition: l,
|
|
80
|
+
onSearch: u,
|
|
81
|
+
searchResponse: f
|
|
77
82
|
}
|
|
78
83
|
),
|
|
79
|
-
/* @__PURE__ */ t(
|
|
84
|
+
/* @__PURE__ */ t(w, {})
|
|
80
85
|
] });
|
|
81
86
|
};
|
|
82
87
|
export {
|
|
83
|
-
|
|
88
|
+
Y as ToolBarPlugin
|
|
84
89
|
};
|
|
85
90
|
//# sourceMappingURL=ToolbarPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection, $setSelection } from 'lexical';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { $getTableCellNodeFromLexicalNode } from '@lexical/table';\n\nimport type { JSX } from 'react';\nimport type { Actions } from 'components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu';\nimport type { TableMutation } from 'components/RteEditor/Plugins/TablePlugin/TablePlugin';\nimport type { SearchResponse } from 'components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm';\n\nimport { CourseCataloguePlugin } from 'components/RteEditor/Plugins/CourseCataloguePlugin';\nimport {\n LinkPlugin,\n BlockFormatPlugin,\n ListPlugin,\n HistoryPlugin,\n TablePlugin,\n TableCellContextMenu,\n} from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\
|
|
1
|
+
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection, $setSelection, KEY_DOWN_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical';\nimport { mergeRegister } from '@lexical/utils';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { $getTableCellNodeFromLexicalNode } from '@lexical/table';\n\nimport type { JSX } from 'react';\nimport type { Actions } from 'components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu';\nimport type { TableMutation } from 'components/RteEditor/Plugins/TablePlugin/TablePlugin';\nimport type { SearchResponse } from 'components/RteEditor/Plugins/CourseCataloguePlugin/AddCatalogueLinkForm';\n\nimport { CourseCataloguePlugin } from 'components/RteEditor/Plugins/CourseCataloguePlugin';\nimport {\n LinkPlugin,\n BlockFormatPlugin,\n ListPlugin,\n HistoryPlugin,\n TablePlugin,\n TableCellContextMenu,\n} from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type Position = {\n xPos: number;\n yPos: number;\n height: number;\n};\n\ninterface ToolBarProps {\n editorScrollPosition: number;\n onCatalogueLinkSearch?: (query: string, linkType: 'course' | 'programme') => void;\n catalogueSearchResponse?: SearchResponse;\n}\n\nexport const ToolBarPlugin = ({\n editorScrollPosition,\n onCatalogueLinkSearch,\n catalogueSearchResponse,\n}: ToolBarProps): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [position, setPosition] = useState<Position | null>(null);\n const tableref = useRef<TableMutation>(null);\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if (!$isRangeSelection(selection)) {\n setPosition(null);\n return;\n }\n\n const anchorNode = selection.anchor.getNode();\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (!tableCell) {\n setPosition(null);\n return;\n }\n\n const domNode = editor.getElementByKey(tableCell.getKey());\n if (!domNode) return;\n\n const rect = domNode.getBoundingClientRect();\n setPosition({\n xPos: rect.right,\n yPos: rect.bottom,\n height: rect.height,\n });\n }, [editor]);\n\n const handleTableAction = (action: Actions) => {\n tableref.current?.mutateTable(action);\n };\n\n const handleResizeScroll = useCallback(() => {\n editor.update(() => {\n const selection = $getSelection();\n\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (tableCell) {\n $setSelection(null);\n setPosition(null);\n }\n }\n });\n }, [editor]);\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(updateToolbar);\n }),\n\n editor.registerCommand(\n KEY_DOWN_COMMAND,\n () => {\n handleResizeScroll();\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n\n editor.registerRootListener((rootElement, prevRootElement) => {\n if (prevRootElement) {\n prevRootElement.removeEventListener('scroll', handleResizeScroll);\n }\n\n if (rootElement) {\n rootElement.addEventListener('scroll', handleResizeScroll);\n }\n })\n );\n }, [editor, updateToolbar, handleResizeScroll]);\n\n return (\n <div className={styles['editor__toolbar']}>\n <BlockFormatPlugin />\n <ListPlugin />\n <TablePlugin isActive={Boolean(position)} ref={tableref} />\n {position && (\n <TableCellContextMenu\n position={position}\n parentScrollPosition={editorScrollPosition}\n onAction={handleTableAction}\n />\n )}\n <LinkPlugin parentScrollPosition={editorScrollPosition} />\n {onCatalogueLinkSearch && catalogueSearchResponse && (\n <CourseCataloguePlugin\n parentScrollPosition={editorScrollPosition}\n onSearch={onCatalogueLinkSearch}\n searchResponse={catalogueSearchResponse}\n />\n )}\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["ToolBarPlugin","editorScrollPosition","onCatalogueLinkSearch","catalogueSearchResponse","editor","useLexicalComposerContext","position","setPosition","useState","tableref","useRef","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","anchorNode","tableCell","$getTableCellNodeFromLexicalNode","domNode","rect","handleTableAction","action","handleResizeScroll","$setSelection","useEffect","mergeRegister","editorState","KEY_DOWN_COMMAND","COMMAND_PRIORITY_LOW","rootElement","prevRootElement","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","TablePlugin","TableCellContextMenu","LinkPlugin","CourseCataloguePlugin","HistoryPlugin"],"mappings":";;;;;;;;;;;;;;;AAkCO,MAAMA,IAAgB,CAAC;AAAA,EAC5B,sBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,yBAAAC;AACF,MAAiC;AAC/B,QAAM,CAACC,CAAM,IAAIC,EAAA,GACX,CAACC,GAAUC,CAAW,IAAIC,EAA0B,IAAI,GACxDC,IAAWC,EAAsB,IAAI,GAErCC,IAAgBC,EAAY,MAAM;AACtC,UAAMC,IAAYC,EAAA;AAClB,QAAI,CAACC,EAAkBF,CAAS,GAAG;AACjC,MAAAN,EAAY,IAAI;AAChB;AAAA,IACF;AAEA,UAAMS,IAAaH,EAAU,OAAO,QAAA,GAC9BI,IAAYC,EAAiCF,CAAU;AAC7D,QAAI,CAACC,GAAW;AACd,MAAAV,EAAY,IAAI;AAChB;AAAA,IACF;AAEA,UAAMY,IAAUf,EAAO,gBAAgBa,EAAU,QAAQ;AACzD,QAAI,CAACE,EAAS;AAEd,UAAMC,IAAOD,EAAQ,sBAAA;AACrB,IAAAZ,EAAY;AAAA,MACV,MAAMa,EAAK;AAAA,MACX,MAAMA,EAAK;AAAA,MACX,QAAQA,EAAK;AAAA,IAAA,CACd;AAAA,EACH,GAAG,CAAChB,CAAM,CAAC,GAELiB,IAAoB,CAACC,MAAoB;AAC7C,IAAAb,EAAS,SAAS,YAAYa,CAAM;AAAA,EACtC,GAEMC,IAAqBX,EAAY,MAAM;AAC3C,IAAAR,EAAO,OAAO,MAAM;AAClB,YAAMS,IAAYC,EAAA;AAElB,UAAIC,EAAkBF,CAAS,GAAG;AAEhC,cAAMG,IADSH,EAAU,OACC,QAAA;AAG1B,QADkBK,EAAiCF,CAAU,MAE3DQ,EAAc,IAAI,GAClBjB,EAAY,IAAI;AAAA,MAEpB;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAACH,CAAM,CAAC;AAEX,SAAAqB,EAAU,MACDC;AAAAA,IACLtB,EAAO,uBAAuB,CAAC,EAAE,aAAAuB,QAAkB;AACjD,MAAAA,EAAY,KAAKhB,CAAa;AAAA,IAChC,CAAC;AAAA,IAEDP,EAAO;AAAA,MACLwB;AAAAA,MACA,OACEL,EAAA,GACO;AAAA,MAETM;AAAAA,IAAA;AAAA,IAGFzB,EAAO,qBAAqB,CAAC0B,GAAaC,MAAoB;AAC5D,MAAIA,KACFA,EAAgB,oBAAoB,UAAUR,CAAkB,GAG9DO,KACFA,EAAY,iBAAiB,UAAUP,CAAkB;AAAA,IAE7D,CAAC;AAAA,EAAA,GAEF,CAACnB,GAAQO,GAAeY,CAAkB,CAAC,GAG5C,gBAAAS,EAAC,OAAA,EAAI,WAAWC,EAAO,iBACrB,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAkB;AAAA,sBAClBC,GAAA,EAAW;AAAA,sBACXC,GAAA,EAAY,UAAU,EAAQ/B,GAAW,KAAKG,GAAU;AAAA,IACxDH,KACC,gBAAA4B;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,UAAAhC;AAAA,QACA,sBAAsBL;AAAA,QACtB,UAAUoB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGd,gBAAAa,EAACK,GAAA,EAAW,sBAAsBtC,EAAA,CAAsB;AAAA,IACvDC,KAAyBC,KACxB,gBAAA+B;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,sBAAsBvC;AAAA,QACtB,UAAUC;AAAA,QACV,gBAAgBC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGnBsC,GAAA,CAAA,CAAc;AAAA,EAAA,GACjB;AAEJ;"}
|
|
@@ -3,9 +3,9 @@ import { BlockFormatPlugin as t } from "./BlockFormatPlugin/BlockFormatPlugin.js
|
|
|
3
3
|
import { ListPlugin as n } from "./ListPlugin/ListPlugin.js";
|
|
4
4
|
import { LinkPlugin as x } from "./LinkPlugin/LinkPlugin.js";
|
|
5
5
|
import { HistoryPlugin as f } from "./HistoryPlugin/HistoryPlugin.js";
|
|
6
|
-
import { T as u } from "../../../TablePlugin-
|
|
6
|
+
import { T as u } from "../../../TablePlugin-BRZcXq73.js";
|
|
7
7
|
import { TableCellContextMenu as g } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
8
|
-
import { T } from "../../../TableCellResizerPlugin-
|
|
8
|
+
import { T } from "../../../TableCellResizerPlugin-qMtSAoKT.js";
|
|
9
9
|
import { PasteHandlerPlugin as C } from "./PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
10
10
|
export {
|
|
11
11
|
t as BlockFormatPlugin,
|
|
@@ -4,6 +4,8 @@ import { SearchResponse } from './Plugins/CourseCataloguePlugin/AddCatalogueLink
|
|
|
4
4
|
export interface RteEditorProps {
|
|
5
5
|
/** current language setting for the editor labels NOT title ans label */
|
|
6
6
|
currentLanguage?: 'NL' | 'EN' | 'nl' | 'en';
|
|
7
|
+
/** unique id mandatory for the rte */
|
|
8
|
+
editorId: string;
|
|
7
9
|
/** imported content to edit */
|
|
8
10
|
initialValue?: string;
|
|
9
11
|
/** placeholder text in current Language */
|
|
@@ -31,5 +33,5 @@ export interface RteEditorProps {
|
|
|
31
33
|
/** updated catalogue search results */
|
|
32
34
|
catalogueSearchResponse?: SearchResponse;
|
|
33
35
|
}
|
|
34
|
-
export declare const Rte: ({ currentLanguage, initialValue, placeholder, label, info, required, notValid, notValidatedText, maxHeightInRem, maxWords, rteRef, onChange, onCatalogueLinkSearch, catalogueSearchResponse, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export declare const RteEditor: ({ currentLanguage, initialValue, placeholder, label, info, required, notValid, notValidatedText, maxWords, rteRef, onChange, onCatalogueLinkSearch, catalogueSearchResponse, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const Rte: ({ currentLanguage, editorId, initialValue, placeholder, label, info, required, notValid, notValidatedText, maxHeightInRem, maxWords, rteRef, onChange, onCatalogueLinkSearch, catalogueSearchResponse, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const RteEditor: ({ currentLanguage, editorId, initialValue, placeholder, label, info, required, notValid, notValidatedText, maxWords, rteRef, onChange, onCatalogueLinkSearch, catalogueSearchResponse, }: RteEditorProps) => import("react/jsx-runtime").JSX.Element;
|