@uva-glass/component-library 3.53.1 → 3.53.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-CNQPQ6W-.js → Lexical.prod-Dgzi-S1E.js} +2 -2
- package/dist/{Lexical.prod-CNQPQ6W-.js.map → Lexical.prod-Dgzi-S1E.js.map} +1 -1
- package/dist/{LexicalClipboard.prod-BdghxvkJ.js → LexicalClipboard.prod-Dxc8c2F_.js} +4 -4
- package/dist/{LexicalClipboard.prod-BdghxvkJ.js.map → LexicalClipboard.prod-Dxc8c2F_.js.map} +1 -1
- package/dist/{LexicalExtension.prod-qYTg6Mah.js → LexicalExtension.prod-CNBWjmfs.js} +5 -5
- package/dist/{LexicalExtension.prod-qYTg6Mah.js.map → LexicalExtension.prod-CNBWjmfs.js.map} +1 -1
- package/dist/{LexicalLink.prod-DjG5QZHP.js → LexicalLink.prod-EEOzXxej.js} +4 -4
- package/dist/{LexicalLink.prod-DjG5QZHP.js.map → LexicalLink.prod-EEOzXxej.js.map} +1 -1
- package/dist/{LexicalList.prod-CzxWmBG3.js → LexicalList.prod-DADZlhem.js} +4 -4
- package/dist/{LexicalList.prod-CzxWmBG3.js.map → LexicalList.prod-DADZlhem.js.map} +1 -1
- package/dist/{LexicalSelection.prod-CqTp0hfr.js → LexicalSelection.prod-B0uiXGSS.js} +2 -2
- package/dist/{LexicalSelection.prod-CqTp0hfr.js.map → LexicalSelection.prod-B0uiXGSS.js.map} +1 -1
- package/dist/{LexicalTable.prod-C97KnedB.js → LexicalTable.prod-QpQxZNNH.js} +5 -5
- package/dist/{LexicalTable.prod-C97KnedB.js.map → LexicalTable.prod-QpQxZNNH.js.map} +1 -1
- package/dist/{LexicalUtils.prod-lqA_upYF.js → LexicalUtils.prod-D1mwAww-.js} +2 -2
- package/dist/{LexicalUtils.prod-lqA_upYF.js.map → LexicalUtils.prod-D1mwAww-.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-BdgrIlKp.js → TableCellResizerPlugin-9kvw_LpH.js} +4 -4
- package/dist/{TableCellResizerPlugin-BdgrIlKp.js.map → TableCellResizerPlugin-9kvw_LpH.js.map} +1 -1
- package/dist/{TablePlugin-DBKzGTIm.js → TablePlugin-Culqb83M.js} +4 -4
- package/dist/{TablePlugin-DBKzGTIm.js.map → TablePlugin-Culqb83M.js.map} +1 -1
- package/dist/{chunk-GPBRNGY5-UqVYj0H5.js → chunk-GPBRNGY5-BSRMHXbx.js} +2 -2
- package/dist/{chunk-GPBRNGY5-UqVYj0H5.js.map → chunk-GPBRNGY5-BSRMHXbx.js.map} +1 -1
- package/dist/{client-DkvV9jg_.js → client-DdSuZDnt.js} +4 -6
- package/dist/{client-DkvV9jg_.js.map → client-DdSuZDnt.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +2 -2
- package/dist/components/AccordionCard/AccordionCard.test.js +2 -2
- package/dist/components/ActionList/ActionList.d.ts +1 -1
- package/dist/components/ActionList/ActionList.test.js +2 -2
- package/dist/components/AppStatusBar/AppStatusBar.test.js +1 -1
- package/dist/components/Attention/Attention.test.js +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +1 -1
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +1 -1
- package/dist/components/Buttons/MenuButton.d.ts +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +1 -1
- package/dist/components/Card/Card.test.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +2 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +2 -2
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.d.ts +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InfoBanner/InfoBanner.d.ts +1 -1
- package/dist/components/InfoBanner/InfoBanner.stories.d.ts +1 -1
- package/dist/components/InputField/InputField.stories.js +2 -2
- package/dist/components/Label/Label.test.js +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.d.ts +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +1 -1
- package/dist/components/Notification/Notification.stories.js +1 -1
- package/dist/components/Notification/Notification.test.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.d.ts +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +33 -33
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +3 -3
- 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/TableCellContextMenu/TableCellContextMenu.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- 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.d.ts +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +10 -10
- 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/SectionNotification/SectionNotification.stories.d.ts +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/components/SelectButton.d.ts +1 -1
- package/dist/components/SelectListbox/components/SelectOption.d.ts +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/Sortable/components/SortableItem.d.ts +1 -1
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +2 -2
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +2 -2
- package/dist/components/WeekSelector/WeekSelector.stories.d.ts +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorOption.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-BmvI9fji.js → index-Cfzi-sRQ.js} +27 -27
- package/dist/{index-BmvI9fji.js.map → index-Cfzi-sRQ.js.map} +1 -1
- package/dist/{index-Daa6JVq6.js → index-DcECbqp4.js} +12 -12
- package/dist/{index-Daa6JVq6.js.map → index-DcECbqp4.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react-18-vQ75Numl.js → react-18-plvLTuyc.js} +2 -2
- package/dist/{react-18-vQ75Numl.js.map → react-18-plvLTuyc.js.map} +1 -1
- package/dist/{react.esm-CzkD5JmE.js → react.esm-BpII5CMY.js} +712 -733
- package/dist/{react.esm-CzkD5JmE.js.map → react.esm-BpII5CMY.js.map} +1 -1
- package/dist/storybook__react.d.js +8 -8
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as p, jsxs as O } from "react/jsx-runtime";
|
|
2
2
|
import { useState as C, useRef as L, useEffect as I } from "react";
|
|
3
3
|
import { c as U } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { o as
|
|
5
|
-
import { aF as F, V as
|
|
6
|
-
import { x as E } from "../../../../LexicalUtils.prod-
|
|
7
|
-
import { AddCatalogueLinkForm as
|
|
4
|
+
import { o as $ } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
5
|
+
import { aF as F, V as W, c as T, b as A, p as v, _ as S, ah as X, aG as q, Y as J, a7 as Q, l as Z } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
6
|
+
import { x as E } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
7
|
+
import { AddCatalogueLinkForm as tt } from "./AddCatalogueLinkForm/AddCatalogueLinkForm.js";
|
|
8
8
|
import { s as i } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { CourseCatalogueNode as g, $getLinkTypeFromNode as
|
|
11
|
-
import { useOnClickOutside as
|
|
12
|
-
const
|
|
9
|
+
import { useTranslation as et } from "../../hooks/useTranslation.js";
|
|
10
|
+
import { CourseCatalogueNode as g, $getLinkTypeFromNode as z, REMOVE_COURSE_CATALOGUE_LINK as ot, INSERT_COURSE_CATALOGUE_LINK as rt } from "../../nodes/CourseCatalogueNode/CourseCatalogueNode.js";
|
|
11
|
+
import { useOnClickOutside as st } from "../../../hooks/useOnClickOutside.js";
|
|
12
|
+
const bt = ({
|
|
13
13
|
onSearch: D,
|
|
14
|
-
searchResponse:
|
|
15
|
-
parentScrollPosition:
|
|
14
|
+
searchResponse: P,
|
|
15
|
+
parentScrollPosition: G
|
|
16
16
|
}) => {
|
|
17
|
-
const [s] =
|
|
18
|
-
|
|
17
|
+
const [s] = $(), c = et(), [H, k] = C(!1), [j, _] = C(!1), K = L(null), w = L(null), B = L(null), [b, h] = C(null), [R, V] = C("course"), y = (f) => {
|
|
18
|
+
V(f);
|
|
19
19
|
const u = f === "course" ? K.current?.getBoundingClientRect() : w.current?.getBoundingClientRect();
|
|
20
20
|
u && h({ top: u.bottom + window.scrollY, left: u.left + window.scrollX });
|
|
21
21
|
}, N = () => {
|
|
@@ -23,27 +23,27 @@ const gt = ({
|
|
|
23
23
|
};
|
|
24
24
|
return I(() => {
|
|
25
25
|
b && N();
|
|
26
|
-
}, [
|
|
26
|
+
}, [G]), I(() => {
|
|
27
27
|
const f = s.registerCommand(
|
|
28
28
|
F,
|
|
29
29
|
(t) => t.ctrlKey && t.shiftKey && t.altKey && t.key === "C" ? (t.preventDefault(), y("course"), !0) : t.ctrlKey && t.shiftKey && t.altKey && t.key === "P" ? (t.preventDefault(), y("programme"), !0) : !1,
|
|
30
|
-
|
|
30
|
+
W
|
|
31
31
|
), u = s.registerUpdateListener(({ editorState: t }) => {
|
|
32
32
|
t.read(() => {
|
|
33
33
|
const r = T();
|
|
34
34
|
if (A(r)) {
|
|
35
35
|
const e = r.anchor.getNode(), n = r.anchor.offset;
|
|
36
|
-
if (
|
|
36
|
+
if (v(e) && n === e.getTextContentSize() && e.getNextSibling() instanceof g) {
|
|
37
37
|
const o = e.getNextSibling();
|
|
38
38
|
if (o) {
|
|
39
|
-
const d =
|
|
39
|
+
const d = z(o);
|
|
40
40
|
k(d === "course"), _(d === "programme");
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const a = E(e, g);
|
|
45
45
|
if (a) {
|
|
46
|
-
const o =
|
|
46
|
+
const o = z(a);
|
|
47
47
|
k(o === "course"), _(o === "programme");
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -51,9 +51,9 @@ const gt = ({
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}), m = (t) => {
|
|
54
|
-
const r =
|
|
55
|
-
r.setTextNodeRange(t, e, t, e),
|
|
56
|
-
}, x = (t, r) =>
|
|
54
|
+
const r = Q(), e = t.getTextContentSize();
|
|
55
|
+
r.setTextNodeRange(t, e, t, e), Z(r);
|
|
56
|
+
}, x = (t, r) => v(t) && r === t.getTextContentSize() && t.getNextSibling() instanceof g, Y = s.registerCommand(
|
|
57
57
|
F,
|
|
58
58
|
(t) => {
|
|
59
59
|
const r = T();
|
|
@@ -84,7 +84,7 @@ const gt = ({
|
|
|
84
84
|
if (o && (e === "Backspace" || e === "Delete"))
|
|
85
85
|
return t.preventDefault(), s.update(
|
|
86
86
|
() => {
|
|
87
|
-
s.dispatchCommand(
|
|
87
|
+
s.dispatchCommand(ot, void 0);
|
|
88
88
|
},
|
|
89
89
|
{ discrete: !0 }
|
|
90
90
|
), !0;
|
|
@@ -93,9 +93,9 @@ const gt = ({
|
|
|
93
93
|
}
|
|
94
94
|
return !1;
|
|
95
95
|
},
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
|
|
96
|
+
X
|
|
97
|
+
), M = s.registerCommand(
|
|
98
|
+
q,
|
|
99
99
|
(t) => {
|
|
100
100
|
const r = T();
|
|
101
101
|
if (A(r)) {
|
|
@@ -108,12 +108,12 @@ const gt = ({
|
|
|
108
108
|
}
|
|
109
109
|
return !1;
|
|
110
110
|
},
|
|
111
|
-
|
|
111
|
+
J
|
|
112
112
|
);
|
|
113
113
|
return () => {
|
|
114
|
-
f(), u(),
|
|
114
|
+
f(), u(), Y(), M();
|
|
115
115
|
};
|
|
116
|
-
}, [s]),
|
|
116
|
+
}, [s]), st(B, () => h(null)), /* @__PURE__ */ p("div", { className: i["editor__toolbar-button-group"], children: /* @__PURE__ */ O("div", { className: i["editor__toolbar-button-flyoutwrapper"], children: [
|
|
117
117
|
/* @__PURE__ */ O("div", { className: i["editor__toolbar-button-group--text"], children: [
|
|
118
118
|
/* @__PURE__ */ p(
|
|
119
119
|
"button",
|
|
@@ -123,7 +123,7 @@ const gt = ({
|
|
|
123
123
|
className: U(
|
|
124
124
|
i["editor__toolbar-button"],
|
|
125
125
|
i["editor__toolbar-button--text"],
|
|
126
|
-
|
|
126
|
+
H && i["editor__toolbar-button--active"]
|
|
127
127
|
),
|
|
128
128
|
"aria-label": c.aria.labels.courselink,
|
|
129
129
|
"aria-keyshortcuts": c.aria.keyshortcuts.courselink,
|
|
@@ -140,7 +140,7 @@ const gt = ({
|
|
|
140
140
|
className: U(
|
|
141
141
|
i["editor__toolbar-button"],
|
|
142
142
|
i["editor__toolbar-button--text"],
|
|
143
|
-
|
|
143
|
+
j && i["editor__toolbar-button--active"]
|
|
144
144
|
),
|
|
145
145
|
"aria-label": c.aria.labels.programmelink,
|
|
146
146
|
"aria-keyshortcuts": c.aria.keyshortcuts.programmelink,
|
|
@@ -157,14 +157,14 @@ const gt = ({
|
|
|
157
157
|
style: { top: b.top, left: b.left },
|
|
158
158
|
ref: B,
|
|
159
159
|
children: /* @__PURE__ */ p(
|
|
160
|
-
|
|
160
|
+
tt,
|
|
161
161
|
{
|
|
162
162
|
linkType: R,
|
|
163
163
|
onCloseHandler: N,
|
|
164
164
|
onSearchHandler: D,
|
|
165
|
-
searchResponse:
|
|
165
|
+
searchResponse: P,
|
|
166
166
|
onSelect: (f, u, m) => {
|
|
167
|
-
s.dispatchCommand(
|
|
167
|
+
s.dispatchCommand(rt, {
|
|
168
168
|
linkType: m,
|
|
169
169
|
code: f,
|
|
170
170
|
label: u
|
|
@@ -177,6 +177,6 @@ const gt = ({
|
|
|
177
177
|
] }) });
|
|
178
178
|
};
|
|
179
179
|
export {
|
|
180
|
-
|
|
180
|
+
bt as CourseCataloguePlugin
|
|
181
181
|
};
|
|
182
182
|
//# sourceMappingURL=CourseCataloguePlugin.js.map
|
package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CourseCataloguePlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport { clsx } from 'clsx';\r\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\r\nimport {\r\n $createRangeSelection,\r\n $createTextNode,\r\n $getSelection,\r\n $isRangeSelection,\r\n $isTextNode,\r\n $setSelection,\r\n COMMAND_PRIORITY_EDITOR,\r\n COMMAND_PRIORITY_LOW,\r\n COPY_COMMAND,\r\n KEY_DOWN_COMMAND,\r\n} from 'lexical';\r\nimport { $getNearestNodeOfType } from '@lexical/utils';\r\n\r\nimport type { RefObject } from 'react';\r\nimport type { LexicalNode, TextNode } from 'lexical';\r\nimport type { SearchResponse } from './AddCatalogueLinkForm';\r\n\r\nimport { AddCatalogueLinkForm } from './AddCatalogueLinkForm';\r\n\r\nimport styles from 'components/RteEditor/RteEditor.module.css';\r\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\r\nimport {\r\n $getLinkTypeFromNode,\r\n CourseCatalogueNode,\r\n INSERT_COURSE_CATALOGUE_LINK,\r\n REMOVE_COURSE_CATALOGUE_LINK,\r\n} from 'components/RteEditor/nodes/CourseCatalogueNode';\r\nimport { useOnClickOutside } from 'components/hooks/useOnClickOutside';\r\n\r\ninterface CourseCataloguePluginProps {\r\n onSearch: (query: string, linkType: 'course' | 'programme') => void;\r\n searchResponse: SearchResponse;\r\n parentScrollPosition: number;\r\n}\r\n\r\nexport const CourseCataloguePlugin = ({\r\n onSearch,\r\n searchResponse,\r\n parentScrollPosition,\r\n}: CourseCataloguePluginProps) => {\r\n const [editor] = useLexicalComposerContext();\r\n const t = useTranslation();\r\n const [courseIsActive, setCourseIsActive] = useState(false);\r\n const [programmeIsActive, setProgrammeIsActive] = useState(false);\r\n const courseButtonRef = useRef<HTMLButtonElement>(null);\r\n const programmeButtonRef = useRef<HTMLButtonElement>(null);\r\n const flyoutRef = useRef<HTMLDivElement>(null);\r\n const [flyoutPosition, setFlyoutPosition] = useState<{ top: number; left: number } | null>(null);\r\n const [type, setType] = useState<'course' | 'programme'>('course');\r\n\r\n const openFlyout = (type: 'course' | 'programme') => {\r\n setType(type);\r\n const rect =\r\n type === 'course'\r\n ? courseButtonRef.current?.getBoundingClientRect()\r\n : programmeButtonRef.current?.getBoundingClientRect();\r\n if (rect) {\r\n setFlyoutPosition({ top: rect.bottom + window.scrollY, left: rect.left + window.scrollX });\r\n }\r\n };\r\n\r\n const closeFlyout = () => {\r\n onSearch('', type);\r\n setFlyoutPosition(null);\r\n };\r\n\r\n useEffect(() => {\r\n if (flyoutPosition) {\r\n closeFlyout();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [parentScrollPosition]);\r\n\r\n useEffect(() => {\r\n const removeKeyboardShortcut = editor.registerCommand(\r\n KEY_DOWN_COMMAND,\r\n (event: KeyboardEvent) => {\r\n if (event.ctrlKey && event.shiftKey && event.altKey && event.key === 'C') {\r\n event.preventDefault();\r\n openFlyout('course');\r\n return true;\r\n }\r\n if (event.ctrlKey && event.shiftKey && event.altKey && event.key === 'P') {\r\n event.preventDefault();\r\n openFlyout('programme');\r\n return true;\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_EDITOR\r\n );\r\n\r\n const removeStatusListener = editor.registerUpdateListener(({ editorState }) => {\r\n editorState.read(() => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const anchorNode = selection.anchor.getNode();\r\n const offset = selection.anchor.offset;\r\n\r\n if (\r\n $isTextNode(anchorNode) &&\r\n offset === anchorNode.getTextContentSize() &&\r\n anchorNode.getNextSibling() instanceof CourseCatalogueNode\r\n ) {\r\n // Cursor staat aan het begin van de link!\r\n const courseCatalogueLink = anchorNode.getNextSibling();\r\n if (courseCatalogueLink) {\r\n const linkType = $getLinkTypeFromNode(courseCatalogueLink);\r\n setCourseIsActive(linkType === 'course');\r\n setProgrammeIsActive(linkType === 'programme');\r\n return;\r\n }\r\n }\r\n\r\n const courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n if (courseCatalogueLink) {\r\n const linkType = $getLinkTypeFromNode(courseCatalogueLink);\r\n setCourseIsActive(linkType === 'course');\r\n setProgrammeIsActive(linkType === 'programme');\r\n return;\r\n }\r\n setCourseIsActive(false);\r\n setProgrammeIsActive(false);\r\n }\r\n });\r\n });\r\n\r\n const moveToEndOfWhiteSpace = (whiteSpace: TextNode) => {\r\n const selection = $createRangeSelection();\r\n const endOffset = whiteSpace.getTextContentSize();\r\n selection.setTextNodeRange(whiteSpace, endOffset, whiteSpace, endOffset);\r\n $setSelection(selection);\r\n };\r\n\r\n const isCursorBeforeLink = (anchorNode: LexicalNode, offset: number) =>\r\n $isTextNode(anchorNode) &&\r\n offset === anchorNode.getTextContentSize() &&\r\n anchorNode.getNextSibling() instanceof CourseCatalogueNode;\r\n\r\n const removeUnEditable = editor.registerCommand(\r\n KEY_DOWN_COMMAND,\r\n (event: KeyboardEvent) => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const key = event.key;\r\n const anchorNode = selection.anchor.getNode();\r\n const offset = selection.anchor.offset;\r\n let courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n\r\n // Detect if cursor is right before the link\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n courseCatalogueLink = anchorNode.getNextSibling();\r\n }\r\n\r\n if (!courseCatalogueLink) {\r\n return false;\r\n }\r\n\r\n const nodeLength = courseCatalogueLink?.getTextContentSize();\r\n\r\n // Prevent Enter if in the middle of the link, allow only at start or end\r\n if (courseCatalogueLink && event.key === 'Enter') {\r\n event.preventDefault();\r\n editor.update(() => {\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n const brNode = $createTextNode('\\n');\r\n courseCatalogueLink.insertBefore(brNode);\r\n }\r\n if (offset === nodeLength) {\r\n const brNode = $createTextNode('\\n');\r\n courseCatalogueLink.insertAfter(brNode);\r\n moveToEndOfWhiteSpace(brNode);\r\n }\r\n });\r\n return true;\r\n }\r\n\r\n // Allow add space before or after the link\r\n if (courseCatalogueLink && (key === ' ' || event.code === 'Space')) {\r\n event.preventDefault();\r\n editor.update(() => {\r\n const spaceToAdd = $createTextNode(' ');\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n courseCatalogueLink.insertBefore(spaceToAdd);\r\n moveToEndOfWhiteSpace(spaceToAdd);\r\n }\r\n if (offset === nodeLength) {\r\n courseCatalogueLink.insertAfter(spaceToAdd);\r\n moveToEndOfWhiteSpace(spaceToAdd);\r\n }\r\n });\r\n return true;\r\n }\r\n\r\n // Delete link if selected and Backspace or Del is pressed\r\n if (courseCatalogueLink && (key === 'Backspace' || key === 'Delete')) {\r\n event.preventDefault();\r\n editor.update(\r\n () => {\r\n editor.dispatchCommand(REMOVE_COURSE_CATALOGUE_LINK, undefined);\r\n },\r\n { discrete: true }\r\n );\r\n return true;\r\n }\r\n\r\n // Allow Home, End and Arrow navigation\r\n if (\r\n courseCatalogueLink &&\r\n key !== 'ArrowLeft' &&\r\n key !== 'ArrowRight' &&\r\n key !== 'ArrowUp' &&\r\n key !== 'ArrowDown' &&\r\n key !== 'Home' &&\r\n key !== 'End' &&\r\n !(event.ctrlKey && (key.toLowerCase() === 'z' || key.toLowerCase() === 'y')) &&\r\n !(event.ctrlKey && key.toLowerCase() === 'c')\r\n ) {\r\n event.preventDefault();\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_EDITOR\r\n );\r\n\r\n const removeCopy = editor.registerCommand(\r\n COPY_COMMAND,\r\n (event: ClipboardEvent) => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const anchorNode = selection.anchor.getNode();\r\n const courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n if (courseCatalogueLink) {\r\n event.preventDefault();\r\n const domElement = editor.getElementByKey(courseCatalogueLink.getKey());\r\n if (domElement) {\r\n event.clipboardData?.setData('text/html', domElement.outerHTML);\r\n event.clipboardData?.setData('text/plain', courseCatalogueLink.getTextContent());\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n );\r\n return () => {\r\n removeKeyboardShortcut();\r\n removeStatusListener();\r\n removeUnEditable();\r\n removeCopy();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [editor]);\r\n\r\n useOnClickOutside(flyoutRef as RefObject<HTMLElement>, () => setFlyoutPosition(null));\r\n\r\n return (\r\n <div className={styles['editor__toolbar-button-group']}>\r\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\r\n <div className={styles['editor__toolbar-button-group--text']}>\r\n <button\r\n onClick={() => openFlyout('course')}\r\n title={t.cataloguelinks.courseTooltip}\r\n className={clsx(\r\n styles['editor__toolbar-button'],\r\n styles['editor__toolbar-button--text'],\r\n courseIsActive && styles[`editor__toolbar-button--active`]\r\n )}\r\n aria-label={t.aria.labels.courselink}\r\n aria-keyshortcuts={t.aria.keyshortcuts.courselink}\r\n type=\"button\"\r\n ref={courseButtonRef}\r\n >\r\n {t.cataloguelinks.courseButtonLabel}\r\n </button>\r\n <button\r\n onClick={() => openFlyout('programme')}\r\n title={t.cataloguelinks.programmeTooltip}\r\n className={clsx(\r\n styles['editor__toolbar-button'],\r\n styles['editor__toolbar-button--text'],\r\n programmeIsActive && styles[`editor__toolbar-button--active`]\r\n )}\r\n aria-label={t.aria.labels.programmelink}\r\n aria-keyshortcuts={t.aria.keyshortcuts.programmelink}\r\n type=\"button\"\r\n ref={programmeButtonRef}\r\n >\r\n {t.cataloguelinks.programmeButtonLabel}\r\n </button>\r\n </div>\r\n {flyoutPosition && (\r\n <div\r\n className={styles['editor__toolbar-flyout-wrapper']}\r\n style={{ top: flyoutPosition.top, left: flyoutPosition.left }}\r\n ref={flyoutRef}\r\n >\r\n <AddCatalogueLinkForm\r\n linkType={type}\r\n onCloseHandler={closeFlyout}\r\n onSearchHandler={onSearch}\r\n searchResponse={searchResponse}\r\n onSelect={(code, label, linkType) => {\r\n editor.dispatchCommand(INSERT_COURSE_CATALOGUE_LINK, {\r\n linkType,\r\n code,\r\n label,\r\n });\r\n closeFlyout();\r\n }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["CourseCataloguePlugin","onSearch","searchResponse","parentScrollPosition","editor","useLexicalComposerContext","t","useTranslation","courseIsActive","setCourseIsActive","useState","programmeIsActive","setProgrammeIsActive","courseButtonRef","useRef","programmeButtonRef","flyoutRef","flyoutPosition","setFlyoutPosition","type","setType","openFlyout","rect","closeFlyout","useEffect","removeKeyboardShortcut","KEY_DOWN_COMMAND","event","COMMAND_PRIORITY_EDITOR","removeStatusListener","editorState","selection","$getSelection","$isRangeSelection","anchorNode","offset","$isTextNode","CourseCatalogueNode","courseCatalogueLink","linkType","$getLinkTypeFromNode","$getNearestNodeOfType","moveToEndOfWhiteSpace","whiteSpace","$createRangeSelection","endOffset","$setSelection","isCursorBeforeLink","removeUnEditable","key","nodeLength","brNode","$createTextNode","spaceToAdd","REMOVE_COURSE_CATALOGUE_LINK","removeCopy","COPY_COMMAND","domElement","COMMAND_PRIORITY_LOW","useOnClickOutside","jsx","styles","jsxs","clsx","AddCatalogueLinkForm","code","label","INSERT_COURSE_CATALOGUE_LINK"],"mappings":";;;;;;;;;;;AAuCO,MAAMA,KAAwB,CAAC;AAAA,EACpC,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,sBAAAC;AACF,MAAkC;AAChC,QAAM,CAACC,CAAM,IAAIC,EAAA,GACXC,IAAIC,GAAA,GACJ,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAmBC,CAAoB,IAAIF,EAAS,EAAK,GAC1DG,IAAkBC,EAA0B,IAAI,GAChDC,IAAqBD,EAA0B,IAAI,GACnDE,IAAYF,EAAuB,IAAI,GACvC,CAACG,GAAgBC,CAAiB,IAAIR,EAA+C,IAAI,GACzF,CAACS,GAAMC,CAAO,IAAIV,EAAiC,QAAQ,GAE3DW,IAAa,CAACF,MAAiC;AACnD,IAAAC,EAAQD,CAAI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vC,MAAK;AAAA,UACL,KAAKS;AAAA,UAEJ,YAAE,eAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IACpB,GACF;AAAA,IACCE,KACC,gBAAA2C;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAO,gCAAgC;AAAA,QAClD,OAAO,EAAE,KAAK5C,EAAe,KAAK,MAAMA,EAAe,KAAA;AAAA,QACvD,KAAKD;AAAA,QAEL,UAAA,gBAAA4C;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,UAAU7C;AAAA,YACV,gBAAgBI;AAAA,YAChB,iBAAiBtB;AAAA,YACjB,gBAAAC;AAAA,YACA,UAAU,CAAC+D,GAAMC,GAAO3B,MAAa;AACnC,cAAAnC,EAAO,gBAAgB+D,IAA8B;AAAA,gBACnD,UAAA5B;AAAA,gBACA,MAAA0B;AAAA,gBACA,OAAAC;AAAA,cAAA,CACD,GACD3C,EAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"CourseCataloguePlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport { clsx } from 'clsx';\r\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\r\nimport {\r\n $createRangeSelection,\r\n $createTextNode,\r\n $getSelection,\r\n $isRangeSelection,\r\n $isTextNode,\r\n $setSelection,\r\n COMMAND_PRIORITY_CRITICAL,\r\n COMMAND_PRIORITY_EDITOR,\r\n COMMAND_PRIORITY_LOW,\r\n COPY_COMMAND,\r\n KEY_DOWN_COMMAND,\r\n} from 'lexical';\r\nimport { $getNearestNodeOfType } from '@lexical/utils';\r\n\r\nimport type { RefObject } from 'react';\r\nimport type { LexicalNode, TextNode } from 'lexical';\r\nimport type { SearchResponse } from './AddCatalogueLinkForm';\r\n\r\nimport { AddCatalogueLinkForm } from './AddCatalogueLinkForm';\r\n\r\nimport styles from 'components/RteEditor/RteEditor.module.css';\r\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\r\nimport {\r\n $getLinkTypeFromNode,\r\n CourseCatalogueNode,\r\n INSERT_COURSE_CATALOGUE_LINK,\r\n REMOVE_COURSE_CATALOGUE_LINK,\r\n} from 'components/RteEditor/nodes/CourseCatalogueNode';\r\nimport { useOnClickOutside } from 'components/hooks/useOnClickOutside';\r\n\r\ninterface CourseCataloguePluginProps {\r\n onSearch: (query: string, linkType: 'course' | 'programme') => void;\r\n searchResponse: SearchResponse;\r\n parentScrollPosition: number;\r\n}\r\n\r\nexport const CourseCataloguePlugin = ({\r\n onSearch,\r\n searchResponse,\r\n parentScrollPosition,\r\n}: CourseCataloguePluginProps) => {\r\n const [editor] = useLexicalComposerContext();\r\n const t = useTranslation();\r\n const [courseIsActive, setCourseIsActive] = useState(false);\r\n const [programmeIsActive, setProgrammeIsActive] = useState(false);\r\n const courseButtonRef = useRef<HTMLButtonElement>(null);\r\n const programmeButtonRef = useRef<HTMLButtonElement>(null);\r\n const flyoutRef = useRef<HTMLDivElement>(null);\r\n const [flyoutPosition, setFlyoutPosition] = useState<{ top: number; left: number } | null>(null);\r\n const [type, setType] = useState<'course' | 'programme'>('course');\r\n\r\n const openFlyout = (type: 'course' | 'programme') => {\r\n setType(type);\r\n const rect =\r\n type === 'course'\r\n ? courseButtonRef.current?.getBoundingClientRect()\r\n : programmeButtonRef.current?.getBoundingClientRect();\r\n if (rect) {\r\n setFlyoutPosition({ top: rect.bottom + window.scrollY, left: rect.left + window.scrollX });\r\n }\r\n };\r\n\r\n const closeFlyout = () => {\r\n onSearch('', type);\r\n setFlyoutPosition(null);\r\n };\r\n\r\n useEffect(() => {\r\n if (flyoutPosition) {\r\n closeFlyout();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [parentScrollPosition]);\r\n\r\n useEffect(() => {\r\n const removeKeyboardShortcut = editor.registerCommand(\r\n KEY_DOWN_COMMAND,\r\n (event: KeyboardEvent) => {\r\n if (event.ctrlKey && event.shiftKey && event.altKey && event.key === 'C') {\r\n event.preventDefault();\r\n openFlyout('course');\r\n return true;\r\n }\r\n if (event.ctrlKey && event.shiftKey && event.altKey && event.key === 'P') {\r\n event.preventDefault();\r\n openFlyout('programme');\r\n return true;\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_EDITOR\r\n );\r\n\r\n const removeStatusListener = editor.registerUpdateListener(({ editorState }) => {\r\n editorState.read(() => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const anchorNode = selection.anchor.getNode();\r\n const offset = selection.anchor.offset;\r\n\r\n if (\r\n $isTextNode(anchorNode) &&\r\n offset === anchorNode.getTextContentSize() &&\r\n anchorNode.getNextSibling() instanceof CourseCatalogueNode\r\n ) {\r\n // Cursor staat aan het begin van de link!\r\n const courseCatalogueLink = anchorNode.getNextSibling();\r\n if (courseCatalogueLink) {\r\n const linkType = $getLinkTypeFromNode(courseCatalogueLink);\r\n setCourseIsActive(linkType === 'course');\r\n setProgrammeIsActive(linkType === 'programme');\r\n return;\r\n }\r\n }\r\n\r\n const courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n if (courseCatalogueLink) {\r\n const linkType = $getLinkTypeFromNode(courseCatalogueLink);\r\n setCourseIsActive(linkType === 'course');\r\n setProgrammeIsActive(linkType === 'programme');\r\n return;\r\n }\r\n setCourseIsActive(false);\r\n setProgrammeIsActive(false);\r\n }\r\n });\r\n });\r\n\r\n const moveToEndOfWhiteSpace = (whiteSpace: TextNode) => {\r\n const selection = $createRangeSelection();\r\n const endOffset = whiteSpace.getTextContentSize();\r\n selection.setTextNodeRange(whiteSpace, endOffset, whiteSpace, endOffset);\r\n $setSelection(selection);\r\n };\r\n\r\n const isCursorBeforeLink = (anchorNode: LexicalNode, offset: number) =>\r\n $isTextNode(anchorNode) &&\r\n offset === anchorNode.getTextContentSize() &&\r\n anchorNode.getNextSibling() instanceof CourseCatalogueNode;\r\n\r\n const removeUnEditable = editor.registerCommand(\r\n KEY_DOWN_COMMAND,\r\n (event: KeyboardEvent) => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const key = event.key;\r\n const anchorNode = selection.anchor.getNode();\r\n const offset = selection.anchor.offset;\r\n let courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n\r\n // Detect if cursor is right before the link\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n courseCatalogueLink = anchorNode.getNextSibling();\r\n }\r\n\r\n if (!courseCatalogueLink) {\r\n return false;\r\n }\r\n\r\n const nodeLength = courseCatalogueLink?.getTextContentSize();\r\n\r\n // Prevent Enter if in the middle of the link, allow only at start or end\r\n if (courseCatalogueLink && event.key === 'Enter') {\r\n event.preventDefault();\r\n editor.update(() => {\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n const brNode = $createTextNode('\\n');\r\n courseCatalogueLink.insertBefore(brNode);\r\n }\r\n if (offset === nodeLength) {\r\n const brNode = $createTextNode('\\n');\r\n courseCatalogueLink.insertAfter(brNode);\r\n moveToEndOfWhiteSpace(brNode);\r\n }\r\n });\r\n return true;\r\n }\r\n\r\n // Allow add space before or after the link\r\n if (courseCatalogueLink && (key === ' ' || event.code === 'Space')) {\r\n event.preventDefault();\r\n editor.update(() => {\r\n const spaceToAdd = $createTextNode(' ');\r\n if (isCursorBeforeLink(anchorNode, offset)) {\r\n courseCatalogueLink.insertBefore(spaceToAdd);\r\n moveToEndOfWhiteSpace(spaceToAdd);\r\n }\r\n if (offset === nodeLength) {\r\n courseCatalogueLink.insertAfter(spaceToAdd);\r\n moveToEndOfWhiteSpace(spaceToAdd);\r\n }\r\n });\r\n return true;\r\n }\r\n\r\n // Delete link if selected and Backspace or Del is pressed\r\n if (courseCatalogueLink && (key === 'Backspace' || key === 'Delete')) {\r\n event.preventDefault();\r\n editor.update(\r\n () => {\r\n editor.dispatchCommand(REMOVE_COURSE_CATALOGUE_LINK, undefined);\r\n },\r\n { discrete: true }\r\n );\r\n return true;\r\n }\r\n\r\n // Allow Home, End and Arrow navigation\r\n if (\r\n courseCatalogueLink &&\r\n key !== 'ArrowLeft' &&\r\n key !== 'ArrowRight' &&\r\n key !== 'ArrowUp' &&\r\n key !== 'ArrowDown' &&\r\n key !== 'Home' &&\r\n key !== 'End' &&\r\n !(event.ctrlKey && (key.toLowerCase() === 'z' || key.toLowerCase() === 'y')) &&\r\n !(event.ctrlKey && key.toLowerCase() === 'c')\r\n ) {\r\n event.preventDefault();\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_CRITICAL\r\n );\r\n\r\n const removeCopy = editor.registerCommand(\r\n COPY_COMMAND,\r\n (event: ClipboardEvent) => {\r\n const selection = $getSelection();\r\n if ($isRangeSelection(selection)) {\r\n const anchorNode = selection.anchor.getNode();\r\n const courseCatalogueLink = $getNearestNodeOfType(anchorNode, CourseCatalogueNode);\r\n if (courseCatalogueLink) {\r\n event.preventDefault();\r\n const domElement = editor.getElementByKey(courseCatalogueLink.getKey());\r\n if (domElement) {\r\n event.clipboardData?.setData('text/html', domElement.outerHTML);\r\n event.clipboardData?.setData('text/plain', courseCatalogueLink.getTextContent());\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n COMMAND_PRIORITY_LOW\r\n );\r\n return () => {\r\n removeKeyboardShortcut();\r\n removeStatusListener();\r\n removeUnEditable();\r\n removeCopy();\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [editor]);\r\n\r\n useOnClickOutside(flyoutRef as RefObject<HTMLElement>, () => setFlyoutPosition(null));\r\n\r\n return (\r\n <div className={styles['editor__toolbar-button-group']}>\r\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\r\n <div className={styles['editor__toolbar-button-group--text']}>\r\n <button\r\n onClick={() => openFlyout('course')}\r\n title={t.cataloguelinks.courseTooltip}\r\n className={clsx(\r\n styles['editor__toolbar-button'],\r\n styles['editor__toolbar-button--text'],\r\n courseIsActive && styles[`editor__toolbar-button--active`]\r\n )}\r\n aria-label={t.aria.labels.courselink}\r\n aria-keyshortcuts={t.aria.keyshortcuts.courselink}\r\n type=\"button\"\r\n ref={courseButtonRef}\r\n >\r\n {t.cataloguelinks.courseButtonLabel}\r\n </button>\r\n <button\r\n onClick={() => openFlyout('programme')}\r\n title={t.cataloguelinks.programmeTooltip}\r\n className={clsx(\r\n styles['editor__toolbar-button'],\r\n styles['editor__toolbar-button--text'],\r\n programmeIsActive && styles[`editor__toolbar-button--active`]\r\n )}\r\n aria-label={t.aria.labels.programmelink}\r\n aria-keyshortcuts={t.aria.keyshortcuts.programmelink}\r\n type=\"button\"\r\n ref={programmeButtonRef}\r\n >\r\n {t.cataloguelinks.programmeButtonLabel}\r\n </button>\r\n </div>\r\n {flyoutPosition && (\r\n <div\r\n className={styles['editor__toolbar-flyout-wrapper']}\r\n style={{ top: flyoutPosition.top, left: flyoutPosition.left }}\r\n ref={flyoutRef}\r\n >\r\n <AddCatalogueLinkForm\r\n linkType={type}\r\n onCloseHandler={closeFlyout}\r\n onSearchHandler={onSearch}\r\n searchResponse={searchResponse}\r\n onSelect={(code, label, linkType) => {\r\n editor.dispatchCommand(INSERT_COURSE_CATALOGUE_LINK, {\r\n linkType,\r\n code,\r\n label,\r\n });\r\n closeFlyout();\r\n }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["CourseCataloguePlugin","onSearch","searchResponse","parentScrollPosition","editor","useLexicalComposerContext","t","useTranslation","courseIsActive","setCourseIsActive","useState","programmeIsActive","setProgrammeIsActive","courseButtonRef","useRef","programmeButtonRef","flyoutRef","flyoutPosition","setFlyoutPosition","type","setType","openFlyout","rect","closeFlyout","useEffect","removeKeyboardShortcut","KEY_DOWN_COMMAND","event","COMMAND_PRIORITY_EDITOR","removeStatusListener","editorState","selection","$getSelection","$isRangeSelection","anchorNode","offset","$isTextNode","CourseCatalogueNode","courseCatalogueLink","linkType","$getLinkTypeFromNode","$getNearestNodeOfType","moveToEndOfWhiteSpace","whiteSpace","$createRangeSelection","endOffset","$setSelection","isCursorBeforeLink","removeUnEditable","key","nodeLength","brNode","$createTextNode","spaceToAdd","REMOVE_COURSE_CATALOGUE_LINK","COMMAND_PRIORITY_CRITICAL","removeCopy","COPY_COMMAND","domElement","COMMAND_PRIORITY_LOW","useOnClickOutside","jsx","styles","jsxs","clsx","AddCatalogueLinkForm","code","label","INSERT_COURSE_CATALOGUE_LINK"],"mappings":";;;;;;;;;;;AAwCO,MAAMA,KAAwB,CAAC;AAAA,EACpC,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,sBAAAC;AACF,MAAkC;AAChC,QAAM,CAACC,CAAM,IAAIC,EAAA,GACXC,IAAIC,GAAA,GACJ,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAK,GACpD,CAACC,GAAmBC,CAAoB,IAAIF,EAAS,EAAK,GAC1DG,IAAkBC,EAA0B,IAAI,GAChDC,IAAqBD,EAA0B,IAAI,GACnDE,IAAYF,EAAuB,IAAI,GACvC,CAACG,GAAgBC,CAAiB,IAAIR,EAA+C,IAAI,GACzF,CAACS,GAAMC,CAAO,IAAIV,EAAiC,QAAQ,GAE3DW,IAAa,CAACF,MAAiC;AACnD,IAAAC,EAAQD,CAAI;AACZ,UAAMG,IACJH,MAAS,WACLN,EAAgB,SAAS,0BACzBE,EAAmB,SAAS,sBAAA;AAClC,IAAIO,KACFJ,EAAkB,EAAE,KAAKI,EAAK,SAAS,OAAO,SAAS,MAAMA,EAAK,OAAO,OAAO,QAAA,CAAS;AAAA,EAE7F,GAEMC,IAAc,MAAM;AACxB,IAAAtB,EAAS,IAAIkB,CAAI,GACjBD,EAAkB,IAAI;AAAA,EACxB;AAEA,SAAAM,EAAU,MAAM;AACd,IAAIP,KACFM,EAAA;AAAA,EAGJ,GAAG,CAAC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AgBI;AAAA,YAChB,iBAAiBtB;AAAA,YACjB,gBAAAC;AAAA,YACA,UAAU,CAACgE,GAAMC,GAAO5B,MAAa;AACnC,cAAAnC,EAAO,gBAAgBgE,IAA8B;AAAA,gBACnD,UAAA7B;AAAA,gBACA,MAAA2B;AAAA,gBACA,OAAAC;AAAA,cAAA,CACD,GACD5C,EAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF,EAAA,CAEJ,EAAA,CACF;AAEJ;"}
|
|
@@ -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 { aH as _, aI as C, aJ as y, aK as k } from "../../../../Lexical.prod-
|
|
4
|
+
import { aH as _, aI as C, aJ as y, aK as k } from "../../../../Lexical.prod-Dgzi-S1E.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,7 +18,7 @@ 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-Culqb83M.js";
|
|
22
22
|
import { s as r } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
23
23
|
import { useTranslation as g } from "../../hooks/useTranslation.js";
|
|
24
24
|
import "../../Providers/LanguageProvider.js";
|
|
@@ -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-Culqb83M.js";
|
|
4
4
|
import "../helpers.js";
|
|
5
5
|
import "../../../../Accordion/Accordion.js";
|
|
6
6
|
import "../../../../Icon/Icon.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as f, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import { o as W } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
3
|
import { c as Y } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { y as L, P as $, J as q } from "../../../../LexicalLink.prod-
|
|
4
|
+
import { y as L, P as $, J as q } from "../../../../LexicalLink.prod-EEOzXxej.js";
|
|
5
5
|
import { useRef as a, useState as G, useEffect as u } from "react";
|
|
6
|
-
import { a4 as Q, c as p, u as X, aF as Z, b as w, V as tt, l as et, _ as ot } from "../../../../Lexical.prod-
|
|
7
|
-
import { x as N } from "../../../../LexicalUtils.prod-
|
|
8
|
-
import { A as rt } from "../../../../TablePlugin-
|
|
6
|
+
import { a4 as Q, c as p, u as X, aF as Z, b as w, V as tt, l as et, _ as ot } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
7
|
+
import { x as N } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
8
|
+
import { A as rt } from "../../../../TablePlugin-Culqb83M.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as w } from "../../../../LexicalLink.prod-
|
|
1
|
+
import { H as w } from "../../../../LexicalLink.prod-EEOzXxej.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}`)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { o as I } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
-
import { k as b, x as _, S as v, o as K, d as N, h as P, l as y } from "../../../../LexicalList.prod-
|
|
3
|
+
import { k as b, x as _, S as v, o as K, d as N, h as P, l as y } from "../../../../LexicalList.prod-DADZlhem.js";
|
|
4
4
|
import { useState as p, useEffect as k } from "react";
|
|
5
5
|
import { c as $ } from "../../../../clsx-OuTLNxxd.js";
|
|
6
|
-
import { aF as O, V as U, a2 as Y, c as x, b as S, Y as B } from "../../../../Lexical.prod-
|
|
7
|
-
import { x as E } from "../../../../LexicalUtils.prod-
|
|
6
|
+
import { aF as O, V as U, a2 as Y, c as x, b as S, Y as B } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
7
|
+
import { x as E } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
8
8
|
import { Icon as F } from "../../../Icon/Icon.js";
|
|
9
9
|
import { s as n } from "../../../../RteEditor.module-DaBh86FK.js";
|
|
10
10
|
import { useTranslation as V } from "../../hooks/useTranslation.js";
|
|
@@ -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 { n as f, ah as p, c as u } from "../../../../Lexical.prod-
|
|
4
|
-
import { P as i } from "../../../../LexicalUtils.prod-
|
|
5
|
-
import { R as d } from "../../../../LexicalClipboard.prod-
|
|
3
|
+
import { n as f, ah as p, c as u } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
4
|
+
import { P as i } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
5
|
+
import { R as d } from "../../../../LexicalClipboard.prod-Dxc8c2F_.js";
|
|
6
6
|
import { d as D } from "../../../../index-yEhaxKq-.js";
|
|
7
7
|
const w = () => {
|
|
8
8
|
const [e] = m(), l = (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-9kvw_LpH.js";
|
|
5
|
+
import "../../../../LexicalTable.prod-QpQxZNNH.js";
|
|
6
|
+
import "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
7
|
+
import "../../../../Lexical.prod-Dgzi-S1E.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-Culqb83M.js";
|
|
4
4
|
import "../../../Accordion/Accordion.js";
|
|
5
5
|
import "../../../Buttons/Button.js";
|
|
6
6
|
import "../../../Buttons/LinkButton.js";
|
package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Position } from '
|
|
1
|
+
import { Position } from '../../ToolbarPlugin';
|
|
2
2
|
export type Actions = 'insertRowAbove' | 'insertRowBelow' | 'deleteRow' | 'deleteTable' | 'insertColumnLeft' | 'insertColumnRight' | 'deleteColumn';
|
|
3
3
|
interface TableCellContextMenuProps {
|
|
4
4
|
position: Position;
|
|
@@ -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-QpQxZNNH.js";
|
|
5
|
+
import "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
6
|
+
import "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { T as L } from "../../../../TablePlugin-
|
|
8
|
+
import { T as L } from "../../../../TablePlugin-Culqb83M.js";
|
|
9
9
|
import "./helpers.js";
|
|
10
10
|
import "../../nodes/TableWrapperNode/TableWrapperNode.js";
|
|
11
11
|
import "../../hooks/useFlyout.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as p, A as i, I as w, s as T, J as u, U as b, e as E, D, $ as g, V as I, B as R, O as x } from "../../../../LexicalTable.prod-
|
|
2
|
-
import { $ as S } from "../../../../Lexical.prod-
|
|
1
|
+
import { Z as p, A as i, I as w, s as T, J as u, U as b, e as E, D, $ as g, V as I, B as R, O as x } from "../../../../LexicalTable.prod-QpQxZNNH.js";
|
|
2
|
+
import { $ as S } from "../../../../Lexical.prod-Dgzi-S1E.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, B = 200, P = 320, A = (t, e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { SearchResponse } from '
|
|
2
|
+
import { SearchResponse } from '../CourseCataloguePlugin/AddCatalogueLinkForm';
|
|
3
3
|
export type Position = {
|
|
4
4
|
xPos: number;
|
|
5
5
|
yPos: number;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { o as E } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
-
import { c as g, b, l as L } from "../../../../Lexical.prod-
|
|
3
|
+
import { c as g, b, l as L } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
4
4
|
import { useState as T, useRef as N, useCallback as x, useEffect as m } from "react";
|
|
5
|
-
import { P as w } from "../../../../LexicalTable.prod-
|
|
5
|
+
import { P as w } from "../../../../LexicalTable.prod-QpQxZNNH.js";
|
|
6
6
|
import { CourseCataloguePlugin as B } from "../CourseCataloguePlugin/CourseCataloguePlugin.js";
|
|
7
7
|
import { BlockFormatPlugin as k } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
8
8
|
import { ListPlugin as S } from "../ListPlugin/ListPlugin.js";
|
|
9
9
|
import { LinkPlugin as z } from "../LinkPlugin/LinkPlugin.js";
|
|
10
10
|
import { HistoryPlugin as A } from "../HistoryPlugin/HistoryPlugin.js";
|
|
11
|
-
import { T as K } from "../../../../TablePlugin-
|
|
11
|
+
import { T as K } from "../../../../TablePlugin-Culqb83M.js";
|
|
12
12
|
import { TableCellContextMenu as R } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
13
13
|
import "react-dom";
|
|
14
14
|
import "../../../../index-yEhaxKq-.js";
|
|
@@ -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-Culqb83M.js";
|
|
7
7
|
import { TableCellContextMenu as g } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
8
|
-
import { T } from "../../../TableCellResizerPlugin-
|
|
8
|
+
import { T } from "../../../TableCellResizerPlugin-9kvw_LpH.js";
|
|
9
9
|
import { PasteHandlerPlugin as C } from "./PasteHandlerPlugin/PasteHandlerPlugin.js";
|
|
10
10
|
export {
|
|
11
11
|
t as BlockFormatPlugin,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as f, jsxs as A, Fragment as Le } from "react/jsx-runtime";
|
|
2
2
|
import { t as Ye, r as qe, o as D } from "../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
-
import { ar as Pe, al as F, $ as Ge, c as p, az as oe, at as ae, aA as H, M as se, U as Ve, p as I, b as g, a2 as Ze, V as c, aX as Qe, n as et, r as tt, i as rt, aY as nt, aZ as ot, X as at, k as $, aG as st, a_ as it, a$ as lt, b0 as ut, A as re, b1 as dt, b2 as ct, a7 as ft, S as mt, l as De, P as pt, b3 as gt, b4 as ue, h as de, W as ht, G as Z, T as vt, a8 as Te, b5 as ce, B as yt, N as Ct, y as bt, b6 as fe, z as Et, b7 as wt, b8 as St, aj as $e, aT as xt, a0 as Nt, d as Be, Z as _t, b9 as kt, a1 as Lt, F as Pt, D as Dt, u as Tt, aI as Y, aH as q, ba as $t, bb as Bt, aK as It, bc as ne, aJ as Rt, bd as Mt, be as At, ax as Ft } from "../../Lexical.prod-
|
|
3
|
+
import { ar as Pe, al as F, $ as Ge, c as p, az as oe, at as ae, aA as H, M as se, U as Ve, p as I, b as g, a2 as Ze, V as c, aX as Qe, n as et, r as tt, i as rt, aY as nt, aZ as ot, X as at, k as $, aG as st, a_ as it, a$ as lt, b0 as ut, A as re, b1 as dt, b2 as ct, a7 as ft, S as mt, l as De, P as pt, b3 as gt, b4 as ue, h as de, W as ht, G as Z, T as vt, a8 as Te, b5 as ce, B as yt, N as Ct, y as bt, b6 as fe, z as Et, b7 as wt, b8 as St, aj as $e, aT as xt, a0 as Nt, d as Be, Z as _t, b9 as kt, a1 as Lt, F as Pt, D as Dt, u as Tt, aI as Y, aH as q, ba as $t, bb as Bt, aK as It, bc as ne, aJ as Rt, bd as Mt, be as At, ax as Ft } from "../../Lexical.prod-Dgzi-S1E.js";
|
|
4
4
|
import * as Ut from "react";
|
|
5
5
|
import { useMemo as O, useLayoutEffect as j, useEffect as b, useState as M, Suspense as zt, forwardRef as Ie, useCallback as Kt, Component as Ht, createElement as me, createContext as Ot, useId as jt } from "react";
|
|
6
|
-
import { a as Wt, T as Jt } from "../../TableCellResizerPlugin-
|
|
7
|
-
import { B as Xt, a as ie, G as Yt, d as Re, F as qt, X as Gt } from "../../LexicalExtension.prod-
|
|
6
|
+
import { a as Wt, T as Jt } from "../../TableCellResizerPlugin-9kvw_LpH.js";
|
|
7
|
+
import { B as Xt, a as ie, G as Yt, d as Re, F as qt, X as Gt } from "../../LexicalExtension.prod-CNBWjmfs.js";
|
|
8
8
|
import { flushSync as Vt, createPortal as Zt } from "react-dom";
|
|
9
|
-
import { U as W, P as z, E as Qt } from "../../LexicalUtils.prod-
|
|
10
|
-
import { R as pe, F as ge, m as er, g as tr } from "../../LexicalClipboard.prod-
|
|
11
|
-
import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-
|
|
12
|
-
import { l as Me, n as Ae, L as rr, b as nr } from "../../LexicalList.prod-
|
|
13
|
-
import { y as Fe, F as or, A as Ue, l as ar, z as sr } from "../../LexicalLink.prod-
|
|
14
|
-
import { u as ir, h as lr, d as ze, N as ur, y as dr, b as cr, T as Ke, E as fr } from "../../LexicalTable.prod-
|
|
9
|
+
import { U as W, P as z, E as Qt } from "../../LexicalUtils.prod-D1mwAww-.js";
|
|
10
|
+
import { R as pe, F as ge, m as er, g as tr } from "../../LexicalClipboard.prod-Dxc8c2F_.js";
|
|
11
|
+
import { A as he, Z as ve, n as ye } from "../../LexicalSelection.prod-B0uiXGSS.js";
|
|
12
|
+
import { l as Me, n as Ae, L as rr, b as nr } from "../../LexicalList.prod-DADZlhem.js";
|
|
13
|
+
import { y as Fe, F as or, A as Ue, l as ar, z as sr } from "../../LexicalLink.prod-EEOzXxej.js";
|
|
14
|
+
import { u as ir, h as lr, d as ze, N as ur, y as dr, b as cr, T as Ke, E as fr } from "../../LexicalTable.prod-QpQxZNNH.js";
|
|
15
15
|
import { c as Ce } from "../../clsx-OuTLNxxd.js";
|
|
16
16
|
import { exportMap as mr, mergeBoldStrongTags as pr, cleanUpTable as gr } from "./helpers.js";
|
|
17
17
|
import { validateUrl as hr, MATCHERS as vr } from "./Plugins/LinkPlugin/helpers.js";
|
|
18
18
|
import { s as B } from "../../RteEditor.module-DaBh86FK.js";
|
|
19
19
|
import { ToolBarPlugin as yr } from "./Plugins/ToolbarPlugin/ToolbarPlugin.js";
|
|
20
20
|
import { useTranslation as Cr } from "./hooks/useTranslation.js";
|
|
21
|
-
import "../../TablePlugin-
|
|
21
|
+
import "../../TablePlugin-Culqb83M.js";
|
|
22
22
|
import "./Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js";
|
|
23
23
|
import "./hooks/components/Flyout.js";
|
|
24
24
|
import "../Accordion/Accordion.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { y as s } from "../../LexicalLink.prod-
|
|
2
|
-
import { l as n, n as i } from "../../LexicalList.prod-
|
|
3
|
-
import { ag as a, s as c } from "../../Lexical.prod-
|
|
4
|
-
import { T as m } from "../../LexicalTable.prod-
|
|
1
|
+
import { y as s } from "../../LexicalLink.prod-EEOzXxej.js";
|
|
2
|
+
import { l as n, n as i } from "../../LexicalList.prod-DADZlhem.js";
|
|
3
|
+
import { ag as a, s as c } from "../../Lexical.prod-Dgzi-S1E.js";
|
|
4
|
+
import { T as m } from "../../LexicalTable.prod-QpQxZNNH.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { CourseCatalogueNode as g } from "./nodes/CourseCatalogueNode/CourseCatalogueNode.js";
|
|
7
7
|
const y = (t) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as f } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
2
|
-
import { O as g, r as p, _ as l, aj as C, ai as _, c as m, b as k, p as d } from "../../../../Lexical.prod-
|
|
2
|
+
import { O as g, r as p, _ as l, aj as C, ai as _, c as m, b as k, p as d } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
3
3
|
import { useEffect as T } from "react";
|
|
4
|
-
import { x as b } from "../../../../LexicalUtils.prod-
|
|
4
|
+
import { x as b } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
5
5
|
class s extends g {
|
|
6
6
|
__linkType;
|
|
7
7
|
__code;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as W } from "../../../../LexicalComposerContext.prod-DOyoZx0P.js";
|
|
2
|
-
import { O as b, $ as d, r as f, c as p, b as l, ai as u, M as N } from "../../../../Lexical.prod-
|
|
3
|
-
import { x as T } from "../../../../LexicalUtils.prod-
|
|
4
|
-
import { W as E } from "../../../../LexicalSelection.prod-
|
|
2
|
+
import { O as b, $ as d, r as f, c as p, b as l, ai as u, M as N } from "../../../../Lexical.prod-Dgzi-S1E.js";
|
|
3
|
+
import { x as T } from "../../../../LexicalUtils.prod-D1mwAww-.js";
|
|
4
|
+
import { W as E } from "../../../../LexicalSelection.prod-B0uiXGSS.js";
|
|
5
5
|
import { useEffect as g } from "react";
|
|
6
6
|
class o extends b {
|
|
7
7
|
static getType() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { Meta } from '@storybook/react';
|
|
3
|
-
import { SectionNotificationProps } from '
|
|
3
|
+
import { SectionNotificationProps } from '.';
|
|
4
4
|
declare const _default: Meta<PropsWithChildren<SectionNotificationProps>>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const SectionNotificationExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, PropsWithChildren<SectionNotificationProps>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionValue } from '
|
|
1
|
+
import { OptionValue } from '../SelectProvider';
|
|
2
2
|
export interface SelectButtonProps {
|
|
3
3
|
variant?: 'noborder' | 'pill' | 'pillLeft' | 'pillRight' | 'darkBorder' | 'roundedLeft' | 'roundedRight';
|
|
4
4
|
size?: 'small' | 'medium' | 'default';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { f as s } from "../../index-
|
|
2
|
+
import { f as s } from "../../index-Cfzi-sRQ.js";
|
|
3
3
|
import { Sortable as l } from "./Sortable.js";
|
|
4
4
|
import { InputField as d } from "../InputField/InputField.js";
|
|
5
5
|
import { Icon as c } from "../Icon/Icon.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { SortableHandleProps } from './SortableHandle';
|
|
3
|
-
import { SortableItemColors } from '
|
|
3
|
+
import { SortableItemColors } from '../Sortable';
|
|
4
4
|
export interface SortableItemProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
handlePlacement: SortableHandleProps['placement'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react';
|
|
2
|
-
import { StatusBadgeProps } from '
|
|
2
|
+
import { StatusBadgeProps } from '.';
|
|
3
3
|
declare const _default: Meta<StatusBadgeProps>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const StatusBadgeExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, StatusBadgeProps>;
|