@uva-glass/component-library 1.62.6 → 1.62.8
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-eo-UKDld.js → Lexical.prod-B6kL_nwF.js} +159 -159
- package/dist/Lexical.prod-B6kL_nwF.js.map +1 -0
- package/dist/{LexicalUtils.prod-DzksRdFe.js → LexicalUtils.prod-BBoyOK4A.js} +22 -22
- package/dist/{LexicalUtils.prod-DzksRdFe.js.map → LexicalUtils.prod-BBoyOK4A.js.map} +1 -1
- package/dist/{ListPlugin-B-2w9EIN.js → ListPlugin-CpLcVKRP.js} +18 -18
- package/dist/{ListPlugin-B-2w9EIN.js.map → ListPlugin-CpLcVKRP.js.map} +1 -1
- package/dist/RteEditor.module-CHbWzGpE.js +28 -0
- package/dist/RteEditor.module-CHbWzGpE.js.map +1 -0
- package/dist/{TablePlugin-C4BuRRYL.js → TablePlugin-B-yAWpsC.js} +40 -40
- package/dist/{TablePlugin-C4BuRRYL.js.map → TablePlugin-B-yAWpsC.js.map} +1 -1
- package/dist/assets/FormInput.css +1 -1
- package/dist/assets/PeriodSelector.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +27 -24
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +32 -33
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +8 -8
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +33 -33
- 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/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +14 -14
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +75 -75
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-BD3Y_bqE.js → helpers-C7Yo7VY3.js} +34 -34
- package/dist/{helpers-BD3Y_bqE.js.map → helpers-C7Yo7VY3.js.map} +1 -1
- package/dist/{helpers-DONVwywj.js → helpers-pUTvcL4e.js} +83 -83
- package/dist/helpers-pUTvcL4e.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/Lexical.prod-eo-UKDld.js.map +0 -1
- package/dist/RteEditor.module-XCAFrP3U.js +0 -28
- package/dist/RteEditor.module-XCAFrP3U.js.map +0 -1
- package/dist/helpers-DONVwywj.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useRef as M, useState as
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useRef as M, useState as $, useEffect as N } from "react";
|
|
4
4
|
import "../Buttons/Button.js";
|
|
5
5
|
import "../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
@@ -16,68 +16,67 @@ import "../Input/Input.js";
|
|
|
16
16
|
import "../InputField/InputField.js";
|
|
17
17
|
import { Label as D } from "../Label/Label.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-B-yAWpsC.js";
|
|
20
20
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
21
21
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
22
|
import "../SelectListbox/SelectListbox.js";
|
|
23
23
|
import "../SelectListbox/SelectProvider.js";
|
|
24
24
|
import "../Sortable/components/SortableItem.js";
|
|
25
25
|
import "../../SortableProvider-BUsvniX7.js";
|
|
26
|
-
import '../../assets/PeriodSelector.css';const
|
|
27
|
-
"period-selector__container": "_period-
|
|
28
|
-
"period-selector__container--label-left": "_period-selector__container--label-
|
|
29
|
-
"period-selector__container--label-top": "_period-selector__container--label-
|
|
30
|
-
"period-selector__selector-container": "_period-selector__selector-
|
|
31
|
-
"period-selector__selector-row": "_period-selector__selector-
|
|
32
|
-
}, S = 0, f = 1, E = 2,
|
|
26
|
+
import '../../assets/PeriodSelector.css';const l = {
|
|
27
|
+
"period-selector__container": "_period-selector__container_10t7p_1",
|
|
28
|
+
"period-selector__container--label-left": "_period-selector__container--label-left_10t7p_6",
|
|
29
|
+
"period-selector__container--label-top": "_period-selector__container--label-top_10t7p_12",
|
|
30
|
+
"period-selector__selector-container": "_period-selector__selector-container_10t7p_19",
|
|
31
|
+
"period-selector__selector-row": "_period-selector__selector-row_10t7p_25"
|
|
32
|
+
}, S = 0, f = 1, E = 2, p = 3, I = 7, T = (i) => {
|
|
33
33
|
const c = [];
|
|
34
|
-
for (let t = 0; t <
|
|
35
|
-
c.push(
|
|
34
|
+
for (let t = 0; t < i.length; t += p)
|
|
35
|
+
c.push(i.slice(t, t + p));
|
|
36
36
|
return c;
|
|
37
37
|
}, nr = ({
|
|
38
|
-
maxPeriods:
|
|
38
|
+
maxPeriods: i = I,
|
|
39
39
|
defaultValues: c,
|
|
40
40
|
label: t,
|
|
41
41
|
labelPosition: b = "top",
|
|
42
|
-
required:
|
|
42
|
+
required: _ = !1,
|
|
43
43
|
notValidatedText: m = "",
|
|
44
|
-
onChange:
|
|
44
|
+
onChange: g
|
|
45
45
|
}) => {
|
|
46
|
-
const
|
|
47
|
-
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) %
|
|
46
|
+
const R = Array.from({ length: i }, (r, e) => e + 1), a = T(R), x = a.map((r, e) => r.map((o) => ({
|
|
47
|
+
label: `${e + 1}${r.length === 1 ? "" : `.${(o - 1) % p + 1}`}`,
|
|
48
48
|
value: o.toString()
|
|
49
49
|
}))), n = M(
|
|
50
50
|
a.map(
|
|
51
51
|
(r) => r.reduce((e, o) => (c != null && c.includes(o) && e.push(o), e), [])
|
|
52
52
|
)
|
|
53
|
-
), [
|
|
54
|
-
n.current[e] = r.map((o) => Number(o)), d(
|
|
53
|
+
), [P, u] = $([]), d = (r) => r[S].length !== 0 || r[f].length !== 0 ? [E] : r[E].length !== 0 ? [S, f] : [], k = (r, e) => {
|
|
54
|
+
n.current[e] = r.map((o) => Number(o)), u(d(n.current)), g([...n.current.flat()].sort());
|
|
55
55
|
};
|
|
56
|
-
return
|
|
57
|
-
d(
|
|
56
|
+
return N(() => {
|
|
57
|
+
u(d(n.current));
|
|
58
58
|
}, []), /* @__PURE__ */ h(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
className: v(
|
|
62
|
+
l["period-selector__container"],
|
|
63
|
+
l[`period-selector__container--label-${b}`]
|
|
64
64
|
),
|
|
65
65
|
children: [
|
|
66
|
-
t && /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ h("div", { className:
|
|
68
|
-
/* @__PURE__ */
|
|
66
|
+
t && /* @__PURE__ */ s(D, { htmlFor: "", required: _, children: t }),
|
|
67
|
+
/* @__PURE__ */ h("div", { className: l["period-selector__selector-container"], children: [
|
|
68
|
+
/* @__PURE__ */ s("div", { className: l["period-selector__selector-row"], children: x.map((r, e) => /* @__PURE__ */ s(
|
|
69
69
|
w,
|
|
70
70
|
{
|
|
71
71
|
checkboxes: r,
|
|
72
72
|
defaultValues: n.current[e].map((o) => o.toString()),
|
|
73
|
-
disableGroup:
|
|
74
|
-
required:
|
|
75
|
-
onSetValues: (o) =>
|
|
73
|
+
disableGroup: P.includes(e),
|
|
74
|
+
required: _,
|
|
75
|
+
onSetValues: (o) => k(o, e)
|
|
76
76
|
},
|
|
77
77
|
`group_${e}`
|
|
78
78
|
)) }),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
m !== "" && /* @__PURE__ */ i(B, { level: "error", feedback: m })
|
|
79
|
+
m !== "" && /* @__PURE__ */ s(B, { level: "error", feedback: m })
|
|
81
80
|
] })
|
|
82
81
|
]
|
|
83
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n />\n ))}\n </div>\n
|
|
1
|
+
{"version":3,"file":"PeriodSelector.js","sources":["../../../src/components/PeriodSelector/PeriodSelector.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEffect, useRef, useState } from 'react';\n\nimport styles from './PeriodSelector.module.css';\n\nimport { Label, CheckboxButtonBar, FeedbackBox } from 'components';\n\nexport interface PeriodSelectorProps {\n /** Indicates how many periods are shown. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods: 6 | 7;\n /** array of period values [3, 5 ...] */\n defaultValues?: number[];\n label: string;\n labelPosition?: 'top' | 'left';\n /** Shows red * */\n required?: boolean;\n /** error text to display if set */\n notValidatedText?: string;\n /** Returns array of selected values as number */\n onChange: (values: number[]) => void;\n}\n\nconst SEMESTER_1 = 0;\nconst SEMESTER_2 = 1;\nconst SEMESTER_3 = 2;\n\nconst PERIODS_PER_SEMESTER = 3;\nconst MAX_PERIODS = 7;\n\nconst chunkPeriods = (array: number[]): number[][] => {\n const result: number[][] = [];\n for (let count = 0; count < array.length; count += PERIODS_PER_SEMESTER) {\n result.push(array.slice(count, count + PERIODS_PER_SEMESTER));\n }\n return result;\n};\n\n/** Checkbox group for selecting periods */\nexport const PeriodSelector = ({\n maxPeriods = MAX_PERIODS,\n defaultValues,\n label,\n labelPosition = 'top',\n required = false,\n notValidatedText = '',\n onChange,\n}: PeriodSelectorProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const chunkedPeriods = chunkPeriods(maxPeriodsList);\n\n const checkboxItems = chunkedPeriods.map((periods, semester) => {\n return periods.map((period) => ({\n label: `${semester + 1}${periods.length === 1 ? '' : `.${((period - 1) % PERIODS_PER_SEMESTER) + 1}`}`,\n value: period.toString(),\n }));\n });\n\n const returnValues = useRef<number[][]>(\n chunkedPeriods.map((semester) =>\n semester.reduce((periods, period) => {\n if (defaultValues?.includes(period)) periods.push(period);\n return periods;\n }, [] as number[])\n )\n );\n const [disableSemesters, setDisableSemesters] = useState<number[]>([]);\n\n const disableGroups = (selects: number[][]) => {\n if (selects[SEMESTER_1].length !== 0 || selects[SEMESTER_2].length !== 0) return [SEMESTER_3];\n if (selects[SEMESTER_3].length !== 0) return [SEMESTER_1, SEMESTER_2];\n return [];\n };\n\n const handleChange = (values: string[], index: number) => {\n returnValues.current[index] = values.map((num) => Number(num));\n setDisableSemesters(disableGroups(returnValues.current));\n onChange([...returnValues.current.flat()].sort());\n };\n\n useEffect(() => {\n setDisableSemesters(disableGroups(returnValues.current));\n }, []);\n\n return (\n <div\n className={clsx(\n styles['period-selector__container'],\n styles[`period-selector__container--label-${labelPosition}`]\n )}\n >\n {label && (\n <Label htmlFor=\"\" required={required}>\n {label}\n </Label>\n )}\n <div className={styles['period-selector__selector-container']}>\n <div className={styles['period-selector__selector-row']}>\n {checkboxItems.map((checkboxes, semester) => (\n <CheckboxButtonBar\n key={`group_${semester}`}\n checkboxes={checkboxes}\n defaultValues={returnValues.current[semester].map((num) => num.toString())}\n disableGroup={disableSemesters.includes(semester)}\n required={required}\n onSetValues={(event) => handleChange(event, semester)}\n />\n ))}\n </div>\n {notValidatedText !== '' && <FeedbackBox level=\"error\" feedback={notValidatedText} />}\n </div>\n </div>\n );\n};\n"],"names":["SEMESTER_1","SEMESTER_2","SEMESTER_3","PERIODS_PER_SEMESTER","MAX_PERIODS","chunkPeriods","array","result","count","PeriodSelector","maxPeriods","defaultValues","label","labelPosition","required","notValidatedText","onChange","maxPeriodsList","_","index","chunkedPeriods","checkboxItems","periods","semester","period","returnValues","useRef","disableSemesters","setDisableSemesters","useState","disableGroups","selects","handleChange","values","num","useEffect","jsxs","clsx","styles","jsx","Label","checkboxes","CheckboxButtonBar","event","FeedbackBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/IconButton.js";
|
|
|
16
16
|
import "../Input/Input.js";
|
|
17
17
|
import "../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../TablePlugin-
|
|
19
|
+
import "../../TablePlugin-B-yAWpsC.js";
|
|
20
20
|
import { Repeater as i } from "../Repeater/Repeater.js";
|
|
21
21
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
22
22
|
import "../RteEditor/hooks/components/Flyout.js";
|
|
@@ -13,7 +13,7 @@ import "../../IconButton/IconButton.js";
|
|
|
13
13
|
import "../../Input/Input.js";
|
|
14
14
|
import "../../InputField/InputField.js";
|
|
15
15
|
import "react-router-dom";
|
|
16
|
-
import "../../../TablePlugin-
|
|
16
|
+
import "../../../TablePlugin-B-yAWpsC.js";
|
|
17
17
|
import "../Providers/LanguageProvider.js";
|
|
18
18
|
import "../hooks/components/Flyout.js";
|
|
19
19
|
import "../../SelectListbox/SelectListbox.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { u } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
3
|
import { c as f } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import {
|
|
4
|
+
import { M as _, v as p, d as h } from "../../../../Lexical.prod-B6kL_nwF.js";
|
|
5
5
|
import { useState as l, useEffect as k } from "react";
|
|
6
6
|
import { Icon as I } from "../../../Icon/Icon.js";
|
|
7
|
-
import { s as a } from "../../../../RteEditor.module-
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
const
|
|
7
|
+
import { s as a } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
8
|
+
import { useTranslation as v } from "../../hooks/useTranslation.js";
|
|
9
|
+
const B = {
|
|
10
10
|
bold: "Bold",
|
|
11
11
|
italic: "Italic"
|
|
12
|
-
}, C = ["bold", "italic"],
|
|
13
|
-
const t =
|
|
12
|
+
}, C = ["bold", "italic"], E = () => {
|
|
13
|
+
const t = v(), [i] = u(), [e, c] = l(!1), [n, m] = l(!1), d = (o) => {
|
|
14
14
|
i.dispatchCommand(h, o);
|
|
15
15
|
};
|
|
16
16
|
return k(() => {
|
|
@@ -37,12 +37,12 @@ const x = {
|
|
|
37
37
|
"aria-label": `${o === "bold" ? t.aria.labels.bold : t.aria.labels.italic}`,
|
|
38
38
|
"aria-keyshortcuts": `${o === "bold" ? t.aria.keyshortcuts.bold : t.aria.keyshortcuts.italic}`,
|
|
39
39
|
type: "button",
|
|
40
|
-
children: /* @__PURE__ */ s(I, { name:
|
|
40
|
+
children: /* @__PURE__ */ s(I, { name: B[o], size: 24 })
|
|
41
41
|
},
|
|
42
42
|
o
|
|
43
43
|
)) });
|
|
44
44
|
};
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
E as BlockFormatPlugin
|
|
47
47
|
};
|
|
48
48
|
//# sourceMappingURL=BlockFormatPlugin.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { c as a } from "../../../../clsx-OuTLNxxd.js";
|
|
3
3
|
import { u as h } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
4
|
-
import { $ as _, K as y, h as C, g as k } from "../../../../Lexical.prod-
|
|
4
|
+
import { $ as _, K as y, h as C, g as k } from "../../../../Lexical.prod-B6kL_nwF.js";
|
|
5
5
|
import { useState as s, useEffect as m } from "react";
|
|
6
6
|
import { Icon as n } from "../../../Icon/Icon.js";
|
|
7
7
|
import "../../../Buttons/Button.js";
|
|
@@ -16,8 +16,8 @@ import "../../../IconButton/IconButton.js";
|
|
|
16
16
|
import "../../../Input/Input.js";
|
|
17
17
|
import "../../../InputField/InputField.js";
|
|
18
18
|
import "react-router-dom";
|
|
19
|
-
import "../../../../TablePlugin-
|
|
20
|
-
import { s as r } from "../../../../RteEditor.module-
|
|
19
|
+
import "../../../../TablePlugin-B-yAWpsC.js";
|
|
20
|
+
import { s as r } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
21
21
|
import { useTranslation as g } from "../../hooks/useTranslation.js";
|
|
22
22
|
import "../../hooks/components/Flyout.js";
|
|
23
23
|
import "../../Providers/LanguageProvider.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../../../helpers-
|
|
4
|
-
import { A as z } from "../../../../TablePlugin-
|
|
3
|
+
import "../../../../helpers-C7Yo7VY3.js";
|
|
4
|
+
import { A as z } from "../../../../TablePlugin-B-yAWpsC.js";
|
|
5
5
|
import "../../../Icon/Icon.js";
|
|
6
6
|
import "../../../Buttons/Button.js";
|
|
7
7
|
import "../../../Buttons/LinkButton.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as b, jsxs as A } from "react/jsx-runtime";
|
|
2
2
|
import { u as V } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
3
|
import { c as j } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { g as D, m as
|
|
5
|
-
import { useRef as m, useState as
|
|
6
|
-
import { e as
|
|
7
|
-
import { A as Z } from "../../../../TablePlugin-
|
|
4
|
+
import { g as D, m as M, e as z, U as W } from "../../../../helpers-C7Yo7VY3.js";
|
|
5
|
+
import { useRef as m, useState as Y, useEffect as g } from "react";
|
|
6
|
+
import { e as q, M as f, r as B, v as x, _ as G, O as J, c as Q, E as X } from "../../../../Lexical.prod-B6kL_nwF.js";
|
|
7
|
+
import { A as Z } from "../../../../TablePlugin-B-yAWpsC.js";
|
|
8
8
|
import { useFlyout as $ } from "../../hooks/useFlyout.js";
|
|
9
9
|
import { Icon as tt } from "../../../Icon/Icon.js";
|
|
10
10
|
import "../../../Buttons/Button.js";
|
|
@@ -19,7 +19,7 @@ import "../../../IconButton/IconButton.js";
|
|
|
19
19
|
import "../../../Input/Input.js";
|
|
20
20
|
import "../../../InputField/InputField.js";
|
|
21
21
|
import "react-router-dom";
|
|
22
|
-
import { s as k } from "../../../../RteEditor.module-
|
|
22
|
+
import { s as k } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
23
23
|
import { useTranslation as et } from "../../hooks/useTranslation.js";
|
|
24
24
|
import "../../Providers/LanguageProvider.js";
|
|
25
25
|
import "../../../SelectListbox/SelectListbox.js";
|
|
@@ -47,17 +47,17 @@ const rt = 200, F = (u) => {
|
|
|
47
47
|
}
|
|
48
48
|
return !1;
|
|
49
49
|
}, Rt = () => {
|
|
50
|
-
const u = et(), [t] = V(), { flyout: R, showFlyout: h, hideFlyout: S, isVisible: p } = $(), a = m(), N = m(!1), d = m(""), l = m(""), [_,
|
|
50
|
+
const u = et(), [t] = V(), { flyout: R, showFlyout: h, hideFlyout: S, isVisible: p } = $(), a = m(), N = m(!1), d = m(""), l = m(""), [_, O] = Y({ active: !1, url: "", linktext: "" }), w = m(p), v = m(null), y = () => {
|
|
51
51
|
t.update(() => {
|
|
52
52
|
const o = f();
|
|
53
|
-
|
|
53
|
+
v.current = o;
|
|
54
54
|
});
|
|
55
55
|
}, U = () => {
|
|
56
56
|
t.update(() => {
|
|
57
|
-
|
|
57
|
+
v.current && X(v.current);
|
|
58
58
|
});
|
|
59
59
|
}, H = () => {
|
|
60
|
-
N.current || (y(), h(
|
|
60
|
+
N.current || (y(), h(T), l.current !== "" && setTimeout(() => {
|
|
61
61
|
var o;
|
|
62
62
|
return (o = a.current) == null ? void 0 : o.setDefaults("", l.current);
|
|
63
63
|
}, 0));
|
|
@@ -66,7 +66,7 @@ const rt = 200, F = (u) => {
|
|
|
66
66
|
}, I = (o, r) => {
|
|
67
67
|
t.update(() => {
|
|
68
68
|
const e = f();
|
|
69
|
-
if (
|
|
69
|
+
if (x(e)) {
|
|
70
70
|
const n = e.anchor.getNode(), i = F(n);
|
|
71
71
|
if (r && r !== "") {
|
|
72
72
|
if (i) {
|
|
@@ -74,23 +74,23 @@ const rt = 200, F = (u) => {
|
|
|
74
74
|
i.replace(c), c.select();
|
|
75
75
|
}
|
|
76
76
|
if (r !== d.current && d.current === "") {
|
|
77
|
-
const { anchor: c, focus:
|
|
78
|
-
e.insertText(r), c.offset -= r.length,
|
|
77
|
+
const { anchor: c, focus: C } = e;
|
|
78
|
+
e.insertText(r), c.offset -= r.length, C.offset = c.offset + r.length;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
z(
|
|
81
|
+
M(z(o), { target: "_blank" });
|
|
82
82
|
}
|
|
83
83
|
L();
|
|
84
84
|
});
|
|
85
|
-
},
|
|
86
|
-
children: /* @__PURE__ */
|
|
85
|
+
}, T = {
|
|
86
|
+
children: /* @__PURE__ */ b(
|
|
87
87
|
Z,
|
|
88
88
|
{
|
|
89
89
|
isLink: _,
|
|
90
90
|
onCloseHandler: L,
|
|
91
91
|
onSaveHandler: (o, r) => I(o, r),
|
|
92
92
|
onRemoveHandler: () => {
|
|
93
|
-
t.dispatchCommand(
|
|
93
|
+
t.dispatchCommand(W, null), L();
|
|
94
94
|
},
|
|
95
95
|
ref: a
|
|
96
96
|
}
|
|
@@ -101,21 +101,21 @@ const rt = 200, F = (u) => {
|
|
|
101
101
|
p ? (N.current = !0, (r = a.current) == null || r.focusFirstField()) : ((o = a.current) == null || o.clearForm(), d.current = l.current = "", setTimeout(() => N.current = !1, rt));
|
|
102
102
|
}, [a, p]), g(() => {
|
|
103
103
|
const o = t.registerCommand(
|
|
104
|
-
|
|
104
|
+
q,
|
|
105
105
|
() => {
|
|
106
106
|
const e = f();
|
|
107
107
|
return l.current = (e == null ? void 0 : e.getTextContent()) ?? "", !1;
|
|
108
108
|
},
|
|
109
109
|
0
|
|
110
110
|
), r = t.registerCommand(
|
|
111
|
-
|
|
111
|
+
B,
|
|
112
112
|
(e) => {
|
|
113
113
|
const s = f();
|
|
114
|
-
if (
|
|
114
|
+
if (x(s)) {
|
|
115
115
|
y();
|
|
116
116
|
const n = E(s.anchor.getNode());
|
|
117
117
|
if (n)
|
|
118
|
-
return e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), h(
|
|
118
|
+
return e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), h(T), d.current = n.linktext, setTimeout(() => {
|
|
119
119
|
var i;
|
|
120
120
|
return (i = a.current) == null ? void 0 : i.setDefaults(n.url, n.linktext);
|
|
121
121
|
}, 0), !0;
|
|
@@ -131,31 +131,31 @@ const rt = 200, F = (u) => {
|
|
|
131
131
|
};
|
|
132
132
|
}, [t]), g(() => {
|
|
133
133
|
const o = t.registerCommand(
|
|
134
|
-
|
|
134
|
+
G,
|
|
135
135
|
(e) => {
|
|
136
136
|
if (e.ctrlKey && e.shiftKey && e.key === "U") {
|
|
137
137
|
const s = f();
|
|
138
|
-
if (y(), !
|
|
138
|
+
if (y(), !x(s))
|
|
139
139
|
return !1;
|
|
140
|
-
const n = E(s.anchor.getNode()), i = (
|
|
141
|
-
h(
|
|
140
|
+
const n = E(s.anchor.getNode()), i = (C = "", K = "") => {
|
|
141
|
+
h(T), setTimeout(() => {
|
|
142
142
|
var P;
|
|
143
|
-
return (P = a.current) == null ? void 0 : P.setDefaults(
|
|
143
|
+
return (P = a.current) == null ? void 0 : P.setDefaults(C, K);
|
|
144
144
|
}, 0);
|
|
145
145
|
};
|
|
146
146
|
if (n)
|
|
147
147
|
return e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), d.current = n.linktext, i(n.url, n.linktext), !0;
|
|
148
148
|
const c = s.getTextContent();
|
|
149
|
-
return c !== "" ? (l.current = c, i("", l.current), !0) : (h(
|
|
149
|
+
return c !== "" ? (l.current = c, i("", l.current), !0) : (h(T), !0);
|
|
150
150
|
}
|
|
151
151
|
return !1;
|
|
152
152
|
},
|
|
153
|
-
|
|
153
|
+
J
|
|
154
154
|
), r = t.registerUpdateListener(({ editorState: e }) => {
|
|
155
|
-
|
|
155
|
+
O(
|
|
156
156
|
e.read(() => {
|
|
157
157
|
const s = f();
|
|
158
|
-
if (y(),
|
|
158
|
+
if (y(), x(s)) {
|
|
159
159
|
const n = s.anchor.getNode(), i = F(n);
|
|
160
160
|
if (i)
|
|
161
161
|
return {
|
|
@@ -182,8 +182,8 @@ const rt = 200, F = (u) => {
|
|
|
182
182
|
return window.addEventListener("keydown", o, { capture: !0 }), () => {
|
|
183
183
|
window.removeEventListener("keydown", o);
|
|
184
184
|
};
|
|
185
|
-
}, []), /* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
185
|
+
}, []), /* @__PURE__ */ b("div", { className: k["editor__toolbar-button-group"], children: /* @__PURE__ */ A("div", { className: k["editor__toolbar-button-flyoutwrapper"], children: [
|
|
186
|
+
/* @__PURE__ */ b(
|
|
187
187
|
"button",
|
|
188
188
|
{
|
|
189
189
|
onClick: H,
|
|
@@ -196,7 +196,7 @@ const rt = 200, F = (u) => {
|
|
|
196
196
|
"aria-label": u.aria.labels.link,
|
|
197
197
|
"aria-keyshortcuts": u.aria.keyshortcuts.link,
|
|
198
198
|
type: "button",
|
|
199
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ b(tt, { name: "Link", size: 20 })
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
202
|
R
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
-
import { L as f } from "../../../../ListPlugin-
|
|
3
|
+
import { L as f } from "../../../../ListPlugin-CpLcVKRP.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../../../clsx-OuTLNxxd.js";
|
|
6
|
-
import "../../../../Lexical.prod-
|
|
6
|
+
import "../../../../Lexical.prod-B6kL_nwF.js";
|
|
7
7
|
import "../../../Icon/Icon.js";
|
|
8
|
-
import "../../../../RteEditor.module-
|
|
8
|
+
import "../../../../RteEditor.module-CHbWzGpE.js";
|
|
9
9
|
import "../../hooks/useTranslation.js";
|
|
10
10
|
export {
|
|
11
11
|
f as ListPlugin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { b as v } from "../../../../TablePlugin-
|
|
3
|
+
import { b as v } from "../../../../TablePlugin-B-yAWpsC.js";
|
|
4
4
|
import "../../../Buttons/Button.js";
|
|
5
5
|
import "../../../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
3
|
import "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import "../../../../helpers-
|
|
5
|
-
import "../../../../Lexical.prod-
|
|
4
|
+
import "../../../../helpers-pUTvcL4e.js";
|
|
5
|
+
import "../../../../Lexical.prod-B6kL_nwF.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { T as B } from "../../../../TablePlugin-
|
|
7
|
+
import { T as B } from "../../../../TablePlugin-B-yAWpsC.js";
|
|
8
8
|
import "../../hooks/useFlyout.js";
|
|
9
9
|
import "../../../Icon/Icon.js";
|
|
10
10
|
import "../../../Buttons/Button.js";
|
|
@@ -19,7 +19,7 @@ import "../../../IconButton/IconButton.js";
|
|
|
19
19
|
import "../../../Input/Input.js";
|
|
20
20
|
import "../../../InputField/InputField.js";
|
|
21
21
|
import "react-router-dom";
|
|
22
|
-
import "../../../../RteEditor.module-
|
|
22
|
+
import "../../../../RteEditor.module-CHbWzGpE.js";
|
|
23
23
|
import "../../hooks/useTranslation.js";
|
|
24
24
|
import "../../Providers/LanguageProvider.js";
|
|
25
25
|
import "../../../SelectListbox/SelectListbox.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { u as h } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useState as P, useRef as
|
|
5
|
-
import { g as
|
|
6
|
-
import { BlockFormatPlugin as
|
|
7
|
-
import { L as
|
|
3
|
+
import { M as d, v as b } from "../../../../Lexical.prod-B6kL_nwF.js";
|
|
4
|
+
import { useState as P, useRef as T, useCallback as y, useEffect as x } from "react";
|
|
5
|
+
import { g as B } from "../../../../helpers-pUTvcL4e.js";
|
|
6
|
+
import { BlockFormatPlugin as C } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
7
|
+
import { L as v } from "../../../../ListPlugin-CpLcVKRP.js";
|
|
8
8
|
import { LinkPlugin as L } from "../LinkPlugin/LinkPlugin.js";
|
|
9
9
|
import { HistoryPlugin as N } from "../HistoryPlugin/HistoryPlugin.js";
|
|
10
|
-
import { T as k } from "../../../../TablePlugin-
|
|
11
|
-
import { TableCellContextMenu as
|
|
12
|
-
import { s as
|
|
10
|
+
import { T as k } from "../../../../TablePlugin-B-yAWpsC.js";
|
|
11
|
+
import { TableCellContextMenu as A } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
12
|
+
import { s as M } from "../../../../RteEditor.module-CHbWzGpE.js";
|
|
13
13
|
const D = ({ editorScrollPosition: u }) => {
|
|
14
|
-
const [e] = h(), [r, s] = P(null), l =
|
|
14
|
+
const [e] = h(), [r, s] = P(null), l = T(null), a = y(() => {
|
|
15
15
|
const o = d();
|
|
16
16
|
if (b(o)) {
|
|
17
|
-
const g = o.anchor.getNode(), m =
|
|
17
|
+
const g = o.anchor.getNode(), m = B(g);
|
|
18
18
|
if (m) {
|
|
19
19
|
const c = e.getElementByKey(m.getKey()), n = c ? c.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };
|
|
20
20
|
s({ xPos: n.right, yPos: n.bottom, height: n.height });
|
|
@@ -25,18 +25,18 @@ const D = ({ editorScrollPosition: u }) => {
|
|
|
25
25
|
var i;
|
|
26
26
|
(i = l.current) == null || i.mutateTable(o);
|
|
27
27
|
};
|
|
28
|
-
return
|
|
28
|
+
return x(() => {
|
|
29
29
|
e.registerUpdateListener(({ editorState: o }) => {
|
|
30
30
|
o.read(() => {
|
|
31
31
|
a();
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
}, [e, a]), /* @__PURE__ */ p("div", { className:
|
|
35
|
-
/* @__PURE__ */ t(B, {}),
|
|
34
|
+
}, [e, a]), /* @__PURE__ */ p("div", { className: M.editor__toolbar, children: [
|
|
36
35
|
/* @__PURE__ */ t(C, {}),
|
|
36
|
+
/* @__PURE__ */ t(v, {}),
|
|
37
37
|
/* @__PURE__ */ t(k, { isActive: !!r, ref: l }),
|
|
38
38
|
r && /* @__PURE__ */ t(
|
|
39
|
-
|
|
39
|
+
A,
|
|
40
40
|
{
|
|
41
41
|
position: r,
|
|
42
42
|
parentScrollPosition: u,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToolBarPlugin as e } from "./ToolbarPlugin/ToolbarPlugin.js";
|
|
2
2
|
import { BlockFormatPlugin as l } from "./BlockFormatPlugin/BlockFormatPlugin.js";
|
|
3
|
-
import { L as n } from "../../../ListPlugin-
|
|
3
|
+
import { L as n } from "../../../ListPlugin-CpLcVKRP.js";
|
|
4
4
|
import { LinkPlugin as m, getLinkNodeTag 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-B-yAWpsC.js";
|
|
7
7
|
import { TableCellContextMenu as T } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
8
8
|
export {
|
|
9
9
|
l as BlockFormatPlugin,
|