@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.
Files changed (74) hide show
  1. package/dist/{Lexical.prod-A4JuKqM3.js → Lexical.prod-o6Eq_uLx.js} +27 -27
  2. package/dist/{Lexical.prod-A4JuKqM3.js.map → Lexical.prod-o6Eq_uLx.js.map} +1 -1
  3. package/dist/{LexicalClipboard.prod-CoyZP29w.js → LexicalClipboard.prod-CnUrf2_p.js} +20 -20
  4. package/dist/{LexicalClipboard.prod-CoyZP29w.js.map → LexicalClipboard.prod-CnUrf2_p.js.map} +1 -1
  5. package/dist/{LexicalExtension.prod-DFPuTMk1.js → LexicalExtension.prod-CanXuzFO.js} +19 -19
  6. package/dist/{LexicalExtension.prod-DFPuTMk1.js.map → LexicalExtension.prod-CanXuzFO.js.map} +1 -1
  7. package/dist/{LexicalLink.prod-Dp06n3Hn.js → LexicalLink.prod-DAVbKER8.js} +4 -4
  8. package/dist/{LexicalLink.prod-Dp06n3Hn.js.map → LexicalLink.prod-DAVbKER8.js.map} +1 -1
  9. package/dist/{LexicalList.prod-D3TdO_Pq.js → LexicalList.prod-C6cknPBV.js} +4 -4
  10. package/dist/{LexicalList.prod-D3TdO_Pq.js.map → LexicalList.prod-C6cknPBV.js.map} +1 -1
  11. package/dist/{LexicalSelection.prod-BapitO0n.js → LexicalSelection.prod-B8GGrzJ3.js} +18 -18
  12. package/dist/{LexicalSelection.prod-BapitO0n.js.map → LexicalSelection.prod-B8GGrzJ3.js.map} +1 -1
  13. package/dist/{LexicalTable.prod-bzYpvqMi.js → LexicalTable.prod-upbwOtcE.js} +5 -5
  14. package/dist/{LexicalTable.prod-bzYpvqMi.js.map → LexicalTable.prod-upbwOtcE.js.map} +1 -1
  15. package/dist/{LexicalUtils.prod-CAsHFX57.js → LexicalUtils.prod-CF7x-KWm.js} +5 -5
  16. package/dist/{LexicalUtils.prod-CAsHFX57.js.map → LexicalUtils.prod-CF7x-KWm.js.map} +1 -1
  17. package/dist/RteEditor.module-CoTOIw5i.js +41 -0
  18. package/dist/RteEditor.module-CoTOIw5i.js.map +1 -0
  19. package/dist/{TableCellResizerPlugin-ffA1s2mD.js → TableCellResizerPlugin-qMtSAoKT.js} +4 -4
  20. package/dist/{TableCellResizerPlugin-ffA1s2mD.js.map → TableCellResizerPlugin-qMtSAoKT.js.map} +1 -1
  21. package/dist/{TablePlugin-CzmrXpxk.js → TablePlugin-BRZcXq73.js} +28 -28
  22. package/dist/{TablePlugin-CzmrXpxk.js.map → TablePlugin-BRZcXq73.js.map} +1 -1
  23. package/dist/assets/RteEditor.css +1 -1
  24. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  25. package/dist/components/FormInput/FormInput.js +1 -1
  26. package/dist/components/Icon/icons/index.d.ts +24 -0
  27. package/dist/components/Icon/icons/index.js +207 -187
  28. package/dist/components/Icon/icons/index.js.map +1 -1
  29. package/dist/components/InputField/InputField.stories.js +1 -1
  30. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  31. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  32. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  33. package/dist/components/MultiSelect/index.js +1 -1
  34. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  35. package/dist/components/Periods/Periods.d.ts +1 -1
  36. package/dist/components/Periods/Periods.js.map +1 -1
  37. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  38. package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
  39. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  40. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  41. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +108 -105
  42. package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
  43. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +3 -3
  44. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
  45. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +35 -31
  46. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -1
  47. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +121 -118
  48. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  49. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  50. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +12 -12
  51. package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
  52. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
  53. package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
  54. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  55. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +5 -5
  56. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +2 -2
  57. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  58. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +70 -65
  59. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  60. package/dist/components/RteEditor/Plugins/index.js +2 -2
  61. package/dist/components/RteEditor/RteEditor.d.ts +4 -2
  62. package/dist/components/RteEditor/RteEditor.js +218 -215
  63. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  64. package/dist/components/RteEditor/RteEditor.stories.js +23 -19
  65. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  66. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  67. package/dist/components/RteEditor/helpers.js +4 -4
  68. package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +2 -2
  69. package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +3 -3
  70. package/dist/components/index.js +1 -1
  71. package/dist/index.js +1 -1
  72. package/package.json +18 -18
  73. package/dist/RteEditor.module-DaBh86FK.js +0 -41
  74. 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-D3TdO_Pq.js";
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 O } from "../../../../clsx-OuTLNxxd.js";
6
- import { aO as $, ap as w, ab as U, $ as D, w as S, H as B } from "../../../../Lexical.prod-A4JuKqM3.js";
7
- import { v as E } from "../../../../LexicalUtils.prod-CAsHFX57.js";
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-DaBh86FK.js";
9
+ import { s as n } from "../../../../RteEditor.module-CoTOIw5i.js";
10
10
  import { useTranslation as j } from "../../hooks/useTranslation.js";
11
- const z = {
11
+ const q = {
12
12
  bullet: "BulletList",
13
13
  number: "NumberedList"
14
- }, Q = ["bullet", "number"], W = () => {
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
- w
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: Q.map((t) => /* @__PURE__ */ f(
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: O(
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: z[t], size: 24 })
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 p, ap as f, $ as u } from "../../../../Lexical.prod-A4JuKqM3.js";
4
- import { A as i } from "../../../../LexicalUtils.prod-CAsHFX57.js";
5
- import { R as d } from "../../../../LexicalClipboard.prod-CoyZP29w.js";
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
- p,
19
+ f,
20
20
  (r) => r instanceof ClipboardEvent ? (l(r), !0) : !1,
21
- f
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-ffA1s2mD.js";
5
- import "../../../../LexicalTable.prod-bzYpvqMi.js";
6
- import "../../../../LexicalUtils.prod-CAsHFX57.js";
7
- import "../../../../Lexical.prod-A4JuKqM3.js";
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,4 +1,4 @@
1
- import { T as r } from "../../../../TableCellResizerPlugin-ffA1s2mD.js";
1
+ import { T as r } from "../../../../TableCellResizerPlugin-qMtSAoKT.js";
2
2
  export {
3
3
  r as TableCellResizerPlugin
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { b as G } from "../../../../TablePlugin-CzmrXpxk.js";
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-bzYpvqMi.js";
5
- import "../../../../Lexical.prod-A4JuKqM3.js";
6
- import "../../../../LexicalUtils.prod-CAsHFX57.js";
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-CzmrXpxk.js";
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-DaBh86FK.js";
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-bzYpvqMi.js";
2
- import { V as S } from "../../../../Lexical.prod-A4JuKqM3.js";
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,4 +1,4 @@
1
- import { T as o } from "../../../../TablePlugin-CzmrXpxk.js";
1
+ import { T as o } from "../../../../TablePlugin-BRZcXq73.js";
2
2
  import { TableCellContextMenu as t } from "./TableCellContextMenu/TableCellContextMenu.js";
3
3
  export {
4
4
  t as TableCellContextMenu,
@@ -1,85 +1,90 @@
1
- import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
- import { o as E } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
3
- import { $ as g, w, m as L } from "../../../../Lexical.prod-A4JuKqM3.js";
4
- import { useState as T, useRef as N, useCallback as x, useEffect as m } from "react";
5
- import { J as b } from "../../../../LexicalTable.prod-bzYpvqMi.js";
6
- import { CourseCataloguePlugin as B } from "../CourseCataloguePlugin/CourseCataloguePlugin.js";
7
- import { BlockFormatPlugin as k } from "../BlockFormatPlugin/BlockFormatPlugin.js";
8
- import { ListPlugin as z } from "../ListPlugin/ListPlugin.js";
9
- import { LinkPlugin as S } from "../LinkPlugin/LinkPlugin.js";
10
- import { HistoryPlugin as A } from "../HistoryPlugin/HistoryPlugin.js";
11
- import { T as K } from "../../../../TablePlugin-CzmrXpxk.js";
12
- import { TableCellContextMenu as R } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
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 j } from "../../../../RteEditor.module-DaBh86FK.js";
16
- import { setScrollableContainers as v, removeScrollableContainers as J } from "../../helpers.js";
17
- const Z = ({
18
- editorScrollPosition: r,
19
- onCatalogueLinkSearch: d,
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 [n] = E(), [i, s] = T(null), p = N(null), f = x(() => {
21
+ const [e] = y(), [a, n] = v(null), p = A(null), d = b(() => {
23
22
  const o = g();
24
- if (w(o)) {
25
- const l = o.anchor.getNode(), a = b(l);
26
- if (a) {
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
- }, [n]), P = (o) => {
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
- }, e = () => {
35
- n.update(() => {
42
+ }, s = b(() => {
43
+ e.update(() => {
36
44
  const o = g();
37
- if (w(o)) {
38
- const l = o.anchor.getNode();
39
- b(l) && (L(null), s(null));
45
+ if (h(o)) {
46
+ const i = o.anchor.getNode();
47
+ P(i) && (N(null), n(null));
40
48
  }
41
49
  });
42
- };
43
- return m(() => {
44
- n.registerUpdateListener(({ editorState: o }) => {
45
- o.read(() => {
46
- f();
47
- });
48
- });
49
- }, [n, f]), m(() => (v(e), window.addEventListener("scroll", e), window.addEventListener("resize", e), () => {
50
- window.removeEventListener("scroll", e), window.removeEventListener("resize", e), J(e);
51
- }), [n]), m(() => {
52
- const o = () => {
53
- v(e);
54
- };
55
- return window.addEventListener("keydown", o, { capture: !0 }), () => {
56
- window.removeEventListener("keydown", o);
57
- };
58
- }, []), /* @__PURE__ */ y("div", { className: j.editor__toolbar, children: [
59
- /* @__PURE__ */ t(k, {}),
60
- /* @__PURE__ */ t(z, {}),
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: i,
66
- parentScrollPosition: r,
67
- onAction: P
70
+ position: a,
71
+ parentScrollPosition: l,
72
+ onAction: C
68
73
  }
69
74
  ),
70
- /* @__PURE__ */ t(S, { parentScrollPosition: r }),
71
- d && u && /* @__PURE__ */ t(
72
- B,
75
+ /* @__PURE__ */ t(k, { parentScrollPosition: l }),
76
+ u && f && /* @__PURE__ */ t(
77
+ R,
73
78
  {
74
- parentScrollPosition: r,
75
- onSearch: d,
76
- searchResponse: u
79
+ parentScrollPosition: l,
80
+ onSearch: u,
81
+ searchResponse: f
77
82
  }
78
83
  ),
79
- /* @__PURE__ */ t(A, {})
84
+ /* @__PURE__ */ t(w, {})
80
85
  ] });
81
86
  };
82
87
  export {
83
- Z as ToolBarPlugin
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';\nimport { removeScrollableContainers, setScrollableContainers } from 'components/RteEditor/helpers';\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 const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (tableCell) {\n const domNode = editor.getElementByKey(tableCell.getKey());\n const position = domNode ? domNode.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };\n setPosition({ xPos: position.right, yPos: position.bottom, height: position.height });\n } else {\n setPosition(null);\n }\n }\n }, [editor]);\n\n const handleTableAction = (action: Actions) => {\n tableref.current?.mutateTable(action);\n };\n\n const handleResizeScroll = () => {\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 };\n\n useEffect(() => {\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateToolbar();\n });\n });\n }, [editor, updateToolbar]);\n\n useEffect(() => {\n setScrollableContainers(handleResizeScroll);\n\n window.addEventListener('scroll', handleResizeScroll);\n window.addEventListener('resize', handleResizeScroll);\n\n return () => {\n window.removeEventListener('scroll', handleResizeScroll);\n window.removeEventListener('resize', handleResizeScroll);\n removeScrollableContainers(handleResizeScroll);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n useEffect(() => {\n const removeKeydown = () => {\n setScrollableContainers(handleResizeScroll);\n };\n\n window.addEventListener('keydown', removeKeydown, { capture: true });\n\n return () => {\n window.removeEventListener('keydown', removeKeydown);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\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","handleTableAction","action","handleResizeScroll","$setSelection","useEffect","editorState","setScrollableContainers","removeScrollableContainers","removeKeydown","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,QAAIC,EAAkBF,CAAS,GAAG;AAEhC,YAAMG,IADSH,EAAU,OACC,QAAA,GAEpBI,IAAYC,EAAiCF,CAAU;AAC7D,UAAIC,GAAW;AACb,cAAME,IAAUf,EAAO,gBAAgBa,EAAU,QAAQ,GACnDX,IAAWa,IAAUA,EAAQ,sBAAA,IAA0B,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,EAAA;AAC5F,QAAAZ,EAAY,EAAE,MAAMD,EAAS,OAAO,MAAMA,EAAS,QAAQ,QAAQA,EAAS,OAAA,CAAQ;AAAA,MACtF;AACE,QAAAC,EAAY,IAAI;AAAA,IAEpB;AA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GAAW,KAAKG,GAAU;AAAA,IACxDH,KACC,gBAAAyB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,UAAA7B;AAAA,QACA,sBAAsBL;AAAA,QACtB,UAAUmB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGd,gBAAAW,EAACK,GAAA,EAAW,sBAAsBnC,EAAA,CAAsB;AAAA,IACvDC,KAAyBC,KACxB,gBAAA4B;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,sBAAsBpC;AAAA,QACtB,UAAUC;AAAA,QACV,gBAAgBC;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGnBmC,GAAA,CAAA,CAAc;AAAA,EAAA,GACjB;AAEJ;"}
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,U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C,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-CzmrXpxk.js";
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-ffA1s2mD.js";
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;