@uva-glass/component-library 1.59.2 → 1.61.0
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-CO0gPAfo.js → Lexical.prod-qM_1BY0u.js} +961 -952
- package/dist/Lexical.prod-qM_1BY0u.js.map +1 -0
- package/dist/{LexicalUtils.prod-PbdOb6JG.js → LexicalUtils.prod-BFSPHHi1.js} +20 -20
- package/dist/{LexicalUtils.prod-PbdOb6JG.js.map → LexicalUtils.prod-BFSPHHi1.js.map} +1 -1
- package/dist/ListPlugin-Bhkh3IBK.js +625 -0
- package/dist/ListPlugin-Bhkh3IBK.js.map +1 -0
- package/dist/RteEditor.module-Cku3JY-0.js +29 -0
- package/dist/RteEditor.module-Cku3JY-0.js.map +1 -0
- package/dist/TablePlugin-CLPV2OjO.js +294 -0
- package/dist/TablePlugin-CLPV2OjO.js.map +1 -0
- package/dist/assets/EditorHeader.css +1 -1
- package/dist/assets/Periods.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/TableCellContextMenu.css +1 -1
- package/dist/assets/TablePlugin.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
- package/dist/components/InputField/InputField.stories.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/Periods/Periods.js +19 -19
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +19 -19
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.d.ts +1 -6
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +34 -20
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +36 -31
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +3 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +4 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +7 -6
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +157 -54
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +1 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +5 -6
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +3 -2
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.d.ts +1 -6
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +10 -31
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +2 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +104 -31
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -5
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- 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.d.ts +6 -7
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +42 -46
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +13 -12
- package/dist/components/RteEditor/RteEditor.d.ts +13 -4
- package/dist/components/RteEditor/RteEditor.js +593 -601
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.d.ts +98 -6
- package/dist/components/RteEditor/translations.d.ts +98 -6
- package/dist/components/RteEditor/translations.js +104 -12
- package/dist/components/RteEditor/translations.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{helpers-Ec7CfNnA.js → helpers-BB6Byf50.js} +92 -103
- package/dist/helpers-BB6Byf50.js.map +1 -0
- package/dist/{helpers-BewZrn6E.js → helpers-D9T1Tgkj.js} +581 -515
- package/dist/helpers-D9T1Tgkj.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +9 -9
- package/dist/Lexical.prod-CO0gPAfo.js.map +0 -1
- package/dist/LexicalList.prod-BceA-cJD.js +0 -562
- package/dist/LexicalList.prod-BceA-cJD.js.map +0 -1
- package/dist/RteEditor.module-Dz9a8vaK.js +0 -29
- package/dist/RteEditor.module-Dz9a8vaK.js.map +0 -1
- package/dist/TablePlugin-Cj6IBz2k.js +0 -249
- package/dist/TablePlugin-Cj6IBz2k.js.map +0 -1
- package/dist/helpers-BewZrn6E.js.map +0 -1
- package/dist/helpers-Ec7CfNnA.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useId as
|
|
4
|
-
import '../../assets/Periods.css';const
|
|
5
|
-
periods__container:
|
|
6
|
-
periods__item:
|
|
7
|
-
"periods__item--active": "_periods__item--
|
|
8
|
-
}, S = 6, O = ({ periods: i, tooltipTranslations: u, maxPeriods:
|
|
9
|
-
const
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { c as P } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { useId as N } from "react";
|
|
4
|
+
import '../../assets/Periods.css';const g = "_periods__container_197yl_1", v = "_periods__item_197yl_6", _ = {
|
|
5
|
+
periods__container: g,
|
|
6
|
+
periods__item: v,
|
|
7
|
+
"periods__item--active": "_periods__item--active_197yl_23"
|
|
8
|
+
}, S = 6, O = ({ periods: i, tooltipTranslations: u, maxPeriods: p = S }) => {
|
|
9
|
+
const f = Array.from({ length: p }, (e, t) => t + 1), $ = N(), a = i.some((e) => typeof e == "number"), b = (e) => {
|
|
10
10
|
const t = {};
|
|
11
11
|
return a ? i.forEach((s) => {
|
|
12
12
|
if (typeof s == "number") {
|
|
@@ -17,23 +17,23 @@ import '../../assets/Periods.css';const N = "_periods__container_1cv1o_1", g = "
|
|
|
17
17
|
const { semesterNumber: r, periodInSemester: o } = s;
|
|
18
18
|
t[r] || (t[r] = []), t[r].push(o);
|
|
19
19
|
}), Object.keys(t).reduce((s, r, o) => {
|
|
20
|
-
const
|
|
20
|
+
const c = Number(r), n = t[c];
|
|
21
21
|
let m = "";
|
|
22
|
-
const d =
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
m = `Semester ${
|
|
22
|
+
const d = n.length > 1 ? e.periods : e.period;
|
|
23
|
+
if (n.length > 1) {
|
|
24
|
+
const h = n.pop();
|
|
25
|
+
m = `Semester ${c} ${d} ${n.join(", ")} ${e.and} ${h}`;
|
|
26
26
|
} else
|
|
27
|
-
m = `Semester ${
|
|
27
|
+
m = `Semester ${c} ${d} ${n[0]}`;
|
|
28
28
|
return `${s}${o > 0 ? ". " : ""}${m}`;
|
|
29
29
|
}, "").trim() + ".";
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
}, y = (e) => a ? i.includes(e) : !!i.find((t) => t.number === e);
|
|
31
|
+
return /* @__PURE__ */ l("div", { className: _.periods__container, title: u ? b(u) : "", children: f.map((e) => /* @__PURE__ */ l(
|
|
32
32
|
"span",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: P(
|
|
35
35
|
_.periods__item,
|
|
36
|
-
|
|
36
|
+
y(e) ? _["periods__item--active"] : ""
|
|
37
37
|
)
|
|
38
38
|
},
|
|
39
39
|
`${$}-${e}`
|
|
@@ -16,10 +16,10 @@ 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-
|
|
19
|
+
import "../../TablePlugin-CLPV2OjO.js";
|
|
20
20
|
import { Repeater as i } from "../Repeater/Repeater.js";
|
|
21
|
-
import "../RteEditor/hooks/components/Flyout.js";
|
|
22
21
|
import "../RteEditor/Providers/LanguageProvider.js";
|
|
22
|
+
import "../RteEditor/hooks/components/Flyout.js";
|
|
23
23
|
import "../SelectListbox/SelectListbox.js";
|
|
24
24
|
import "../SelectListbox/SelectProvider.js";
|
|
25
25
|
import "../Sortable/components/SortableItem.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
2
|
+
import { useState as p, useId as c } from "react";
|
|
3
|
+
import { c as f } from "../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { Icon as h } from "../../Icon/Icon.js";
|
|
5
5
|
import "../../Buttons/Button.js";
|
|
6
6
|
import "../../Buttons/LinkButton.js";
|
|
7
7
|
import "@react-aria/button";
|
|
8
|
-
import { Label as
|
|
8
|
+
import { Label as l } from "../../Label/Label.js";
|
|
9
9
|
import "@react-aria/dialog";
|
|
10
10
|
import "@react-aria/focus";
|
|
11
11
|
import "@react-aria/overlays";
|
|
@@ -15,39 +15,39 @@ import "../../IconButton/IconButton.js";
|
|
|
15
15
|
import "../../Input/Input.js";
|
|
16
16
|
import "../../InputField/InputField.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
-
import "../../../TablePlugin-
|
|
19
|
-
import "../hooks/components/Flyout.js";
|
|
18
|
+
import "../../../TablePlugin-CLPV2OjO.js";
|
|
20
19
|
import "../Providers/LanguageProvider.js";
|
|
20
|
+
import "../hooks/components/Flyout.js";
|
|
21
21
|
import "../../SelectListbox/SelectListbox.js";
|
|
22
22
|
import "../../SelectListbox/SelectProvider.js";
|
|
23
23
|
import "../../Sortable/components/SortableItem.js";
|
|
24
24
|
import "../../../SortableProvider-BUsvniX7.js";
|
|
25
25
|
import '../../../assets/EditorHeader.css';const o = {
|
|
26
|
-
"editor-header__container": "_editor-
|
|
27
|
-
"editor-header__info-icon": "_editor-header__info-
|
|
28
|
-
"editor-header__info": "_editor-
|
|
29
|
-
"editor-header__info--visible": "_editor-header__info--
|
|
30
|
-
},
|
|
31
|
-
const [_,
|
|
32
|
-
|
|
26
|
+
"editor-header__container": "_editor-header__container_1s1pa_1",
|
|
27
|
+
"editor-header__info-icon": "_editor-header__info-icon_1s1pa_10",
|
|
28
|
+
"editor-header__info": "_editor-header__info_1s1pa_10",
|
|
29
|
+
"editor-header__info--visible": "_editor-header__info--visible_1s1pa_25"
|
|
30
|
+
}, J = ({ label: r, info: t = "", required: n = !1 }) => {
|
|
31
|
+
const [_, d] = p(!1), m = `info_${c()}`, a = () => {
|
|
32
|
+
d((s) => !s);
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ e("div", { className: o["editor-header__container"], children: [
|
|
35
35
|
r !== "" && /* @__PURE__ */ e("div", { children: [
|
|
36
|
-
/* @__PURE__ */ i(
|
|
36
|
+
/* @__PURE__ */ i(l, { htmlFor: m, required: n, children: r }),
|
|
37
37
|
/* @__PURE__ */ i(
|
|
38
|
-
|
|
38
|
+
h,
|
|
39
39
|
{
|
|
40
40
|
name: "InformationCircle",
|
|
41
|
-
size:
|
|
41
|
+
size: 16,
|
|
42
42
|
className: o["editor-header__info-icon"],
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: a
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
] }),
|
|
47
|
-
/* @__PURE__ */ i("div", { className:
|
|
47
|
+
/* @__PURE__ */ i("div", { className: f(o["editor-header__info"], { [o["editor-header__info--visible"]]: _ }), children: t })
|
|
48
48
|
] });
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
|
|
51
|
+
J as EditorHeader
|
|
52
52
|
};
|
|
53
53
|
//# sourceMappingURL=EditorHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorHeader.js","sources":["../../../../src/components/RteEditor/EditorHeader/EditorHeader.tsx"],"sourcesContent":["import { useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './EditorHeader.module.css';\n\nimport { Icon, Label } from 'components';\n\ninterface EditorHeaderProps {\n label: string;\n info?: string;\n required?: boolean;\n}\n\nexport const EditorHeader = ({ label, info = '', required = false }: EditorHeaderProps) => {\n const [showInfo, setShowInfo] = useState(false);\n\n const toggleInfo = () => {\n setShowInfo((prev) => !prev);\n };\n\n return (\n <div className={styles['editor-header__container']}>\n {label !== '' && (\n <div>\n <Label htmlFor
|
|
1
|
+
{"version":3,"file":"EditorHeader.js","sources":["../../../../src/components/RteEditor/EditorHeader/EditorHeader.tsx"],"sourcesContent":["import { useState, useId } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './EditorHeader.module.css';\n\nimport { Icon, Label } from 'components';\n\ninterface EditorHeaderProps {\n label: string;\n info?: string;\n required?: boolean;\n}\n\nexport const EditorHeader = ({ label, info = '', required = false }: EditorHeaderProps) => {\n const [showInfo, setShowInfo] = useState(false);\n const infoId = `info_${useId()}`;\n\n const toggleInfo = () => {\n setShowInfo((prev) => !prev);\n };\n\n return (\n <div className={styles['editor-header__container']}>\n {label !== '' && (\n <div>\n <Label htmlFor={infoId} required={required}>\n {label}\n </Label>\n <Icon\n name=\"InformationCircle\"\n size={16}\n className={styles['editor-header__info-icon']}\n onClick={toggleInfo}\n />\n </div>\n )}\n <div className={clsx(styles['editor-header__info'], { [styles['editor-header__info--visible']]: showInfo })}>\n {info}\n </div>\n </div>\n );\n};\n"],"names":["EditorHeader","label","info","required","showInfo","setShowInfo","useState","infoId","useId","toggleInfo","prev","jsxs","styles","jsx","Label","Icon","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAaaA,IAAe,CAAC,EAAE,OAAAC,GAAO,MAAAC,IAAO,IAAI,UAAAC,IAAW,SAA+B;AACzF,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAS,QAAQC,EAAA,CAAO,IAExBC,IAAa,MAAM;AACX,IAAAJ,EAAA,CAACK,MAAS,CAACA,CAAI;AAAA,EAAA;AAG7B,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,0BAA0B,GAC9C,UAAA;AAAA,IAAUX,MAAA,wBACR,OACC,EAAA,UAAA;AAAA,MAAA,gBAAAY,EAACC,GAAM,EAAA,SAASP,GAAQ,UAAAJ,GACrB,UACHF,GAAA;AAAA,MACA,gBAAAY;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,MAAM;AAAA,UACN,WAAWH,EAAO,0BAA0B;AAAA,UAC5C,SAASH;AAAA,QAAA;AAAA,MACX;AAAA,IAAA,GACF;AAAA,sBAED,OAAI,EAAA,WAAWO,EAAKJ,EAAO,qBAAqB,GAAG,EAAE,CAACA,EAAO,8BAA8B,CAAC,GAAGR,EAAU,CAAA,GACvG,UACHF,GAAA;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,33 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { u
|
|
3
|
-
import { c as
|
|
4
|
-
import { d as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { u } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { c as f } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { A as _, x as h, d as p } from "../../../../Lexical.prod-qM_1BY0u.js";
|
|
5
|
+
import { useState as l, useEffect as k } from "react";
|
|
6
|
+
import { Icon as I } from "../../../Icon/Icon.js";
|
|
7
|
+
import { s as a } from "../../../../RteEditor.module-Cku3JY-0.js";
|
|
8
|
+
import { useTranslation as B } from "../../hooks/useTranslation.js";
|
|
9
|
+
const x = {
|
|
8
10
|
bold: "Bold",
|
|
9
11
|
italic: "Italic"
|
|
10
|
-
},
|
|
11
|
-
const [
|
|
12
|
-
|
|
12
|
+
}, C = ["bold", "italic"], A = () => {
|
|
13
|
+
const t = B(), [i] = u(), [c, e] = l(!1), [n, m] = l(!1), d = (o) => {
|
|
14
|
+
i.dispatchCommand(p, o);
|
|
13
15
|
};
|
|
14
|
-
return
|
|
16
|
+
return k(() => {
|
|
17
|
+
const o = i.registerUpdateListener(({ editorState: b }) => {
|
|
18
|
+
b.read(() => {
|
|
19
|
+
const r = _();
|
|
20
|
+
h(r) && (e(r.hasFormat("bold")), m(r.hasFormat("italic")));
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
o();
|
|
25
|
+
};
|
|
26
|
+
}, [i]), /* @__PURE__ */ s("div", { className: a["editor__toolbar-button-group"], children: C.map((o) => /* @__PURE__ */ s(
|
|
15
27
|
"button",
|
|
16
28
|
{
|
|
17
|
-
onClick: () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
o === "
|
|
29
|
+
onClick: () => d(o),
|
|
30
|
+
title: o === "bold" ? t.format.boldTooltip : t.format.italicTooltip,
|
|
31
|
+
className: f(
|
|
32
|
+
a["editor__toolbar-button"],
|
|
33
|
+
a[`editor__toolbar-button--${o}`],
|
|
34
|
+
o === "bold" && c && a["editor__toolbar-button--active"],
|
|
35
|
+
o === "italic" && n && a["editor__toolbar-button--active"]
|
|
23
36
|
),
|
|
24
|
-
"aria-label":
|
|
25
|
-
|
|
37
|
+
"aria-label": `${o === "bold" ? t.aria.labels.bold : t.aria.labels.italic}`,
|
|
38
|
+
"aria-keyshortcuts": `${o === "bold" ? t.aria.keyshortcuts.bold : t.aria.keyshortcuts.italic}`,
|
|
39
|
+
children: /* @__PURE__ */ s(I, { name: x[o], size: 24 })
|
|
26
40
|
},
|
|
27
41
|
o
|
|
28
42
|
)) });
|
|
29
43
|
};
|
|
30
44
|
export {
|
|
31
|
-
|
|
45
|
+
A as BlockFormatPlugin
|
|
32
46
|
};
|
|
33
47
|
//# sourceMappingURL=BlockFormatPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockFormatPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { FORMAT_TEXT_COMMAND } from 'lexical';\n\nimport { Icon } from 'components/Icon';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\ntype BlockTypesType = 'bold' | 'italic';\nconst BLOCK_TYPE_ICONS = {\n bold: 'Bold',\n italic: 'Italic',\n};\n\
|
|
1
|
+
{"version":3,"file":"BlockFormatPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { $getSelection, $isRangeSelection, FORMAT_TEXT_COMMAND } from 'lexical';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from 'components/Icon';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\ntype BlockTypesType = 'bold' | 'italic';\nconst BLOCK_TYPE_ICONS = {\n bold: 'Bold',\n italic: 'Italic',\n};\n\nconst BlockTypes = ['bold', 'italic'];\n\nexport const BlockFormatPlugin = (): JSX.Element => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const [isBold, setIsBold] = useState(false);\n const [isItalic, setIsItalic] = useState(false);\n\n const onClick = (type: BlockTypesType): void => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, type);\n };\n\n useEffect(() => {\n const removeStatusListener = editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n setIsBold(selection.hasFormat('bold'));\n setIsItalic(selection.hasFormat('italic'));\n }\n });\n });\n\n return () => {\n removeStatusListener();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n {BlockTypes.map((type) => (\n <button\n onClick={() => onClick(type as BlockTypesType)}\n key={type}\n title={type === 'bold' ? t.format.boldTooltip : t.format.italicTooltip}\n className={clsx(\n styles['editor__toolbar-button'],\n styles[`editor__toolbar-button--${type}`],\n type === 'bold' && isBold && styles['editor__toolbar-button--active'],\n type === 'italic' && isItalic && styles['editor__toolbar-button--active']\n )}\n aria-label={`${type === 'bold' ? t.aria.labels.bold : t.aria.labels.italic}`}\n aria-keyshortcuts={`${type === 'bold' ? t.aria.keyshortcuts.bold : t.aria.keyshortcuts.italic}`}\n >\n <Icon name={BLOCK_TYPE_ICONS[type as keyof typeof Icon]} size={24} />\n </button>\n ))}\n </div>\n );\n};\n"],"names":["BLOCK_TYPE_ICONS","BlockTypes","BlockFormatPlugin","useTranslation","editor","useLexicalComposerContext","isBold","setIsBold","useState","isItalic","setIsItalic","onClick","type","FORMAT_TEXT_COMMAND","useEffect","removeStatusListener","editorState","selection","$getSelection","$isRangeSelection","jsx","styles","clsx","Icon"],"mappings":";;;;;;;;AAUA,MAAMA,IAAmB;AAAA,EACvB,MAAM;AAAA,EACN,QAAQ;AACV,GAEMC,IAAa,CAAC,QAAQ,QAAQ,GAEvBC,IAAoB,MAAmB;AAClD,QAAM,IAAIC,KACJ,CAACC,CAAM,IAAIC,KACX,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAK,GAExCG,IAAU,CAACC,MAA+B;AACvC,IAAAR,EAAA,gBAAgBS,GAAqBD,CAAI;AAAA,EAAA;AAGlD,SAAAE,EAAU,MAAM;AACd,UAAMC,IAAuBX,EAAO,uBAAuB,CAAC,EAAE,aAAAY,QAAkB;AAC9E,MAAAA,EAAY,KAAK,MAAM;AACrB,cAAMC,IAAYC;AACd,QAAAC,EAAkBF,CAAS,MACnBV,EAAAU,EAAU,UAAU,MAAM,CAAC,GACzBP,EAAAO,EAAU,UAAU,QAAQ,CAAC;AAAA,MAC3C,CACD;AAAA,IAAA,CACF;AAED,WAAO,MAAM;AACU,MAAAF;IAAA;AAAA,EACvB,GAEC,CAACX,CAAM,CAAC,GAGT,gBAAAgB,EAAC,SAAI,WAAWC,EAAO,8BAA8B,GAClD,UAAApB,EAAW,IAAI,CAACW,MACf,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAS,MAAMT,EAAQC,CAAsB;AAAA,MAE7C,OAAOA,MAAS,SAAS,EAAE,OAAO,cAAc,EAAE,OAAO;AAAA,MACzD,WAAWU;AAAA,QACTD,EAAO,wBAAwB;AAAA,QAC/BA,EAAO,2BAA2BT,CAAI,EAAE;AAAA,QACxCA,MAAS,UAAUN,KAAUe,EAAO,gCAAgC;AAAA,QACpET,MAAS,YAAYH,KAAYY,EAAO,gCAAgC;AAAA,MAC1E;AAAA,MACA,cAAY,GAAGT,MAAS,SAAS,EAAE,KAAK,OAAO,OAAO,EAAE,KAAK,OAAO,MAAM;AAAA,MAC1E,qBAAmB,GAAGA,MAAS,SAAS,EAAE,KAAK,aAAa,OAAO,EAAE,KAAK,aAAa,MAAM;AAAA,MAE7F,4BAACW,GAAK,EAAA,MAAMvB,EAAiBY,CAAyB,GAAG,MAAM,IAAI;AAAA,IAAA;AAAA,IAX9DA;AAAA,EAaR,CAAA,EACH,CAAA;AAEJ;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { $ as _, K as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { Icon as
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as a } from "../../../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { u as h } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
4
|
+
import { $ as _, K as C, h as k, g as y } from "../../../../Lexical.prod-qM_1BY0u.js";
|
|
5
|
+
import { useState as s, useEffect as m } from "react";
|
|
6
|
+
import { Icon as n } from "../../../Icon/Icon.js";
|
|
7
7
|
import "../../../Buttons/Button.js";
|
|
8
8
|
import "../../../Buttons/LinkButton.js";
|
|
9
9
|
import "@react-aria/button";
|
|
@@ -16,52 +16,57 @@ 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
|
|
19
|
+
import "../../../../TablePlugin-CLPV2OjO.js";
|
|
20
|
+
import { s as r } from "../../../../RteEditor.module-Cku3JY-0.js";
|
|
21
|
+
import { useTranslation as g } from "../../hooks/useTranslation.js";
|
|
21
22
|
import "../../hooks/components/Flyout.js";
|
|
22
23
|
import "../../Providers/LanguageProvider.js";
|
|
23
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
24
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
25
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
26
27
|
import "../../../../SortableProvider-BUsvniX7.js";
|
|
27
|
-
const
|
|
28
|
-
const [
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
28
|
+
const V = () => {
|
|
29
|
+
const o = g(), [t] = h(), [d, l] = s(!1), [p, c] = s(!1), u = () => {
|
|
30
|
+
t.dispatchCommand(k, void 0);
|
|
31
|
+
}, b = () => {
|
|
32
|
+
t.dispatchCommand(y, void 0);
|
|
32
33
|
};
|
|
33
|
-
return
|
|
34
|
+
return m(() => t.registerCommand(
|
|
34
35
|
_,
|
|
35
|
-
(
|
|
36
|
+
(e) => (l(e), !1),
|
|
36
37
|
1
|
|
37
|
-
), [
|
|
38
|
-
|
|
39
|
-
(
|
|
38
|
+
), [t]), m(() => t.registerCommand(
|
|
39
|
+
C,
|
|
40
|
+
(e) => (c(e), !1),
|
|
40
41
|
1
|
|
41
|
-
), [
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
), [t]), /* @__PURE__ */ f("div", { className: r["editor__toolbar-button-group"], children: [
|
|
43
|
+
/* @__PURE__ */ i(
|
|
43
44
|
"button",
|
|
44
45
|
{
|
|
45
|
-
onClick:
|
|
46
|
-
className:
|
|
47
|
-
"aria-label":
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
onClick: u,
|
|
47
|
+
className: a(r["editor__toolbar-button"], r["editor__toolbar-button--undo"]),
|
|
48
|
+
"aria-label": o.aria.labels.undo,
|
|
49
|
+
"aria-keyshortcuts": o.aria.keyshortcuts.undo,
|
|
50
|
+
disabled: !d,
|
|
51
|
+
title: o.format.undoTooltip,
|
|
52
|
+
children: /* @__PURE__ */ i(n, { name: "StepBack", size: 24 })
|
|
50
53
|
}
|
|
51
54
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ i(
|
|
53
56
|
"button",
|
|
54
57
|
{
|
|
55
|
-
onClick:
|
|
56
|
-
className:
|
|
57
|
-
"aria-label":
|
|
58
|
+
onClick: b,
|
|
59
|
+
className: a(r["editor__toolbar-button"], r["editor__toolbar-button--redo"]),
|
|
60
|
+
"aria-label": o.aria.labels.redo,
|
|
61
|
+
"aria-keyshortcuts": o.aria.keyshortcuts.redo,
|
|
58
62
|
disabled: !p,
|
|
59
|
-
|
|
63
|
+
title: o.format.redoTooltip,
|
|
64
|
+
children: /* @__PURE__ */ i(n, { name: "StepForwards", size: 24 })
|
|
60
65
|
}
|
|
61
66
|
)
|
|
62
67
|
] });
|
|
63
68
|
};
|
|
64
69
|
export {
|
|
65
|
-
|
|
70
|
+
V as HistoryPlugin
|
|
66
71
|
};
|
|
67
72
|
//# sourceMappingURL=HistoryPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { CAN_UNDO_COMMAND, CAN_REDO_COMMAND, UNDO_COMMAND, REDO_COMMAND } from 'lexical';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport const HistoryPlugin = () => {\n const [editor] = useLexicalComposerContext();\n const [canUndo, setCanUndo] = useState(false);\n const [canRedo, setCanRedo] = useState(false);\n\n const handleUndo = () => {\n editor.dispatchCommand(UNDO_COMMAND, undefined);\n };\n\n const handleRedo = () => {\n editor.dispatchCommand(REDO_COMMAND, undefined);\n };\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_UNDO_COMMAND,\n (payload) => {\n setCanUndo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_REDO_COMMAND,\n (payload) => {\n setCanRedo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <button\n onClick={handleUndo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--undo`])}\n aria-label={
|
|
1
|
+
{"version":3,"file":"HistoryPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { CAN_UNDO_COMMAND, CAN_REDO_COMMAND, UNDO_COMMAND, REDO_COMMAND } from 'lexical';\nimport { useEffect, useState } from 'react';\n\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\nexport const HistoryPlugin = () => {\n const t = useTranslation();\n const [editor] = useLexicalComposerContext();\n const [canUndo, setCanUndo] = useState(false);\n const [canRedo, setCanRedo] = useState(false);\n\n const handleUndo = () => {\n editor.dispatchCommand(UNDO_COMMAND, undefined);\n };\n\n const handleRedo = () => {\n editor.dispatchCommand(REDO_COMMAND, undefined);\n };\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_UNDO_COMMAND,\n (payload) => {\n setCanUndo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n useEffect(() => {\n return editor.registerCommand<boolean>(\n CAN_REDO_COMMAND,\n (payload) => {\n setCanRedo(payload);\n return false;\n },\n 1\n );\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <button\n onClick={handleUndo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--undo`])}\n aria-label={t.aria.labels.undo}\n aria-keyshortcuts={t.aria.keyshortcuts.undo}\n disabled={!canUndo}\n title={t.format.undoTooltip}\n >\n <Icon name=\"StepBack\" size={24} />\n </button>\n <button\n onClick={handleRedo}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--redo`])}\n aria-label={t.aria.labels.redo}\n aria-keyshortcuts={t.aria.keyshortcuts.redo}\n disabled={!canRedo}\n title={t.format.redoTooltip}\n >\n <Icon name=\"StepForwards\" size={24} />\n </button>\n </div>\n );\n};\n"],"names":["HistoryPlugin","t","useTranslation","editor","useLexicalComposerContext","canUndo","setCanUndo","useState","canRedo","setCanRedo","handleUndo","UNDO_COMMAND","handleRedo","REDO_COMMAND","useEffect","CAN_UNDO_COMMAND","payload","CAN_REDO_COMMAND","jsxs","styles","jsx","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAMA,IAAgB,MAAM;AACjC,QAAMC,IAAIC,KACJ,CAACC,CAAM,IAAIC,KACX,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GAEtCG,IAAa,MAAM;AAChB,IAAAP,EAAA,gBAAgBQ,GAAc,MAAS;AAAA,EAAA,GAG1CC,IAAa,MAAM;AAChB,IAAAT,EAAA,gBAAgBU,GAAc,MAAS;AAAA,EAAA;AAGhD,SAAAC,EAAU,MACDX,EAAO;AAAA,IACZY;AAAAA,IACA,CAACC,OACCV,EAAWU,CAAO,GACX;AAAA,IAET;AAAA,EAAA,GAED,CAACb,CAAM,CAAC,GAEXW,EAAU,MACDX,EAAO;AAAA,IACZc;AAAAA,IACA,CAACD,OACCP,EAAWO,CAAO,GACX;AAAA,IAET;AAAA,EAAA,GAED,CAACb,CAAM,CAAC,GAGR,gBAAAe,EAAA,OAAA,EAAI,WAAWC,EAAO,8BAA8B,GACnD,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASV;AAAA,QACT,WAAWW,EAAKF,EAAO,wBAAwB,GAAGA,EAAO,8BAA8B,CAAC;AAAA,QACxF,cAAYlB,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,UAAU,CAACI;AAAA,QACX,OAAOJ,EAAE,OAAO;AAAA,QAEhB,UAAC,gBAAAmB,EAAAE,GAAA,EAAK,MAAK,YAAW,MAAM,IAAI;AAAA,MAAA;AAAA,IAClC;AAAA,IACA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASR;AAAA,QACT,WAAWS,EAAKF,EAAO,wBAAwB,GAAGA,EAAO,8BAA8B,CAAC;AAAA,QACxF,cAAYlB,EAAE,KAAK,OAAO;AAAA,QAC1B,qBAAmBA,EAAE,KAAK,aAAa;AAAA,QACvC,UAAU,CAACO;AAAA,QACX,OAAOP,EAAE,OAAO;AAAA,QAEhB,UAAC,gBAAAmB,EAAAE,GAAA,EAAK,MAAK,gBAAe,MAAM,IAAI;AAAA,MAAA;AAAA,IACtC;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LinkType } from 'components/RteEditor/Plugins/
|
|
1
|
+
import { LinkType } from 'components/RteEditor/Plugins/LinkPlugin';
|
|
2
2
|
interface AddLinkFormProps {
|
|
3
3
|
onCloseHandler: () => void;
|
|
4
|
-
onSaveHandler: (url: string,
|
|
4
|
+
onSaveHandler: (url: string, linktext: string) => void;
|
|
5
5
|
onRemoveHandler?: () => void;
|
|
6
6
|
isLink: LinkType;
|
|
7
7
|
}
|
|
8
8
|
export interface addLinkFormMethods {
|
|
9
9
|
clearForm: () => void;
|
|
10
10
|
focusFirstField: () => void;
|
|
11
|
-
setDefaults: (url: string,
|
|
11
|
+
setDefaults: (url: string, linktext: string) => void;
|
|
12
12
|
}
|
|
13
13
|
export declare const AddLinkForm: import('react').ForwardRefExoticComponent<AddLinkFormProps & import('react').RefAttributes<unknown>>;
|
|
14
14
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../../../helpers-
|
|
4
|
-
import { A as z } from "../../../../TablePlugin-
|
|
3
|
+
import "../../../../helpers-BB6Byf50.js";
|
|
4
|
+
import { A as z } from "../../../../TablePlugin-CLPV2OjO.js";
|
|
5
|
+
import "../../../Icon/Icon.js";
|
|
5
6
|
import "../../../Buttons/Button.js";
|
|
6
7
|
import "../../../Buttons/LinkButton.js";
|
|
7
8
|
import "@react-aria/button";
|
|
8
|
-
import "../../../Checkbox/Checkbox.js";
|
|
9
9
|
import "../../../Label/Label.js";
|
|
10
10
|
import "@react-aria/dialog";
|
|
11
11
|
import "@react-aria/focus";
|
|
@@ -18,8 +18,8 @@ import "../../../IconButton/IconButton.js";
|
|
|
18
18
|
import "../../../Input/Input.js";
|
|
19
19
|
import "../../../InputField/InputField.js";
|
|
20
20
|
import "react-router-dom";
|
|
21
|
-
import "../../hooks/components/Flyout.js";
|
|
22
21
|
import "../../hooks/useTranslation.js";
|
|
22
|
+
import "../../hooks/components/Flyout.js";
|
|
23
23
|
import "../../Providers/LanguageProvider.js";
|
|
24
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
25
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ElementNode, TextNode } from 'lexical';
|
|
2
|
+
export interface LinkType {
|
|
3
|
+
active: boolean;
|
|
4
|
+
url: string;
|
|
5
|
+
linktext: string;
|
|
5
6
|
}
|
|
6
|
-
export declare const
|
|
7
|
-
export
|
|
7
|
+
export declare const getLinkNodeTag: (anchorNode: ElementNode | TextNode) => boolean | LinkType;
|
|
8
|
+
export declare const LinkPlugin: () => import("react/jsx-runtime").JSX.Element;
|