@uva-glass/component-library 1.54.0 → 1.55.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/AddTableFrom-CwnPli3F.js +162 -0
- package/dist/AddTableFrom-CwnPli3F.js.map +1 -0
- package/dist/{Lexical.prod-DNRTKPfN.js → Lexical.prod-BiuZHlIm.js} +927 -897
- package/dist/Lexical.prod-BiuZHlIm.js.map +1 -0
- package/dist/LexicalUtils.prod-BZOm66mY.js +94 -0
- package/dist/{LexicalUtils.prod-D_BPEjfg.js.map → LexicalUtils.prod-BZOm66mY.js.map} +1 -1
- package/dist/{ListPlugin-CgNBzfIl.js → ListPlugin-DFFbKLaN.js} +4 -4
- package/dist/{ListPlugin-CgNBzfIl.js.map → ListPlugin-DFFbKLaN.js.map} +1 -1
- package/dist/RteEditor.module-BBbfV1rk.js +24 -0
- package/dist/RteEditor.module-BBbfV1rk.js.map +1 -0
- package/dist/TablePlugin-CKJQiwra.js +1506 -0
- package/dist/TablePlugin-CKJQiwra.js.map +1 -0
- package/dist/assets/AddTableFrom.css +1 -0
- package/dist/assets/PageOverlay.css +1 -0
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/useFlyout.css +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/Icon/icons/index.d.ts +3 -0
- package/dist/components/Icon/icons/index.js +18 -13
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PageOverlay/PageOverlay.d.ts +25 -0
- package/dist/components/PageOverlay/PageOverlay.js +100 -0
- package/dist/components/PageOverlay/PageOverlay.js.map +1 -0
- package/dist/components/PageOverlay/PageOverlay.stories.d.ts +7 -0
- package/dist/components/PageOverlay/PageOverlay.stories.js +167 -0
- package/dist/components/PageOverlay/PageOverlay.stories.js.map +1 -0
- package/dist/components/PageOverlay/index.d.ts +1 -0
- package/dist/components/PageOverlay/index.js +5 -0
- package/dist/components/PageOverlay/index.js.map +1 -0
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +12 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +28 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +47 -68
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.d.ts +10 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +25 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +29 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +5 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +26 -24
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/index.js +6 -4
- package/dist/components/RteEditor/Plugins/index.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.js +557 -774
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +5 -4
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
- package/dist/components/RteEditor/hooks/useFlyout.d.ts +1 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +18 -38
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/hooks/useOnClickOuside.d.ts +4 -0
- package/dist/components/hooks/useOnClickOuside.js +15 -0
- package/dist/components/hooks/useOnClickOuside.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +40 -38
- package/dist/components/index.js.map +1 -1
- package/dist/{helpers-TSjo3aAv.js → helpers-CJF7fErD.js} +3 -3
- package/dist/{helpers-TSjo3aAv.js.map → helpers-CJF7fErD.js.map} +1 -1
- package/dist/index.js +40 -38
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/Lexical.prod-DNRTKPfN.js.map +0 -1
- package/dist/LexicalUtils.prod-D_BPEjfg.js +0 -64
- package/dist/MultiSelect-DQaqItEH.js +0 -55
- package/dist/MultiSelect-DQaqItEH.js.map +0 -1
- package/dist/RteEditor.module-BjGyWKhW.js +0 -26
- package/dist/RteEditor.module-BjGyWKhW.js.map +0 -1
|
@@ -1,100 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { U as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { u as F } from "../../../../Lexical.prod-BiuZHlIm.js";
|
|
3
|
+
import { c as p } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { U as u } from "../../../../helpers-CJF7fErD.js";
|
|
5
|
+
import { useRef as d, useEffect as y } from "react";
|
|
6
|
+
import { A as L } from "../../../../AddTableFrom-CwnPli3F.js";
|
|
7
|
+
import { useFlyout as N } from "../../hooks/useFlyout.js";
|
|
8
|
+
import { Icon as f } from "../../../Icon/Icon.js";
|
|
9
|
+
import "../../../Buttons/Button.js";
|
|
9
10
|
import "../../../Buttons/LinkButton.js";
|
|
10
11
|
import "@react-aria/button";
|
|
11
|
-
import { Checkbox as V } from "../../../Checkbox/Checkbox.js";
|
|
12
|
-
import { Label as y } from "../../../Label/Label.js";
|
|
13
12
|
import "@react-aria/dialog";
|
|
14
13
|
import "@react-aria/focus";
|
|
15
14
|
import "@react-aria/overlays";
|
|
16
15
|
import "../../../OverlayCloseButton/OverlayCloseButton.js";
|
|
17
|
-
import { FeedbackBox as j } from "../../../FeedbackBox/FeedbackBox.js";
|
|
18
|
-
import { FormField as C } from "../../../FormField/FormField.js";
|
|
19
16
|
import "../../../GridRow/GridRow.js";
|
|
20
17
|
import "../../../IconButton/IconButton.js";
|
|
21
18
|
import "../../../Input/Input.js";
|
|
22
|
-
import
|
|
19
|
+
import "../../../InputField/InputField.js";
|
|
23
20
|
import "react-router-dom";
|
|
24
|
-
import "../../../../
|
|
25
|
-
import { s as t } from "../../../../RteEditor.module-BjGyWKhW.js";
|
|
21
|
+
import { s as o } from "../../../../RteEditor.module-BBbfV1rk.js";
|
|
26
22
|
import "../../../SelectListbox/SelectListbox.js";
|
|
27
23
|
import "../../../SelectListbox/SelectProvider.js";
|
|
28
24
|
import "../../../Sortable/components/SortableItem.js";
|
|
29
25
|
import "../../../../SortableProvider-Z0e0qeQT.js";
|
|
30
|
-
const
|
|
31
|
-
const [m
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */ i(C, { className: t["editor__linkform-input-field"], children: [
|
|
49
|
-
/* @__PURE__ */ r(y, { htmlFor: "lnikUrl", children: "Link" }),
|
|
50
|
-
/* @__PURE__ */ r(z, { id: "lnikUrl", ref: o, placeholder: "http(s)://" }),
|
|
51
|
-
a && /* @__PURE__ */ r(j, { level: "error", feedback: a })
|
|
52
|
-
] }),
|
|
53
|
-
/* @__PURE__ */ i(C, { inline: !0, children: [
|
|
54
|
-
/* @__PURE__ */ r(V, { id: "linkTarget", onChange: x, checked: m }),
|
|
55
|
-
/* @__PURE__ */ r(y, { htmlFor: "linkTarget", children: "Open in nieuwe window" })
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ i("div", { className: t["editor__linkform-footer"], children: [
|
|
58
|
-
/* @__PURE__ */ r(F, { variant: "secondary", onClick: u, children: "Annuleer" }),
|
|
59
|
-
/* @__PURE__ */ r(F, { variant: "primary", onClick: w, children: "Link" })
|
|
60
|
-
] })
|
|
61
|
-
] })
|
|
26
|
+
const C = 200, W = ({ isLink: l = { active: !1, url: "", target: "_self" } }) => {
|
|
27
|
+
const [m] = F(), { flyout: b, showFlyout: _, closeFlyout: s, isVisible: a } = N(), e = d(), n = d(!1), k = (t, r) => {
|
|
28
|
+
m.dispatchCommand(u, {
|
|
29
|
+
url: t,
|
|
30
|
+
target: r
|
|
31
|
+
}), s();
|
|
32
|
+
}, h = () => {
|
|
33
|
+
m.dispatchCommand(u, null);
|
|
34
|
+
}, v = {
|
|
35
|
+
children: /* @__PURE__ */ i(
|
|
36
|
+
L,
|
|
37
|
+
{
|
|
38
|
+
isLink: l,
|
|
39
|
+
onCloseHandler: s,
|
|
40
|
+
onSaveHandler: (t, r) => k(t, r),
|
|
41
|
+
ref: e
|
|
42
|
+
}
|
|
43
|
+
)
|
|
62
44
|
};
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [n, e.url, e.target]), /* @__PURE__ */ i("div", { className: t["editor__toolbar-button-group"], children: [
|
|
70
|
-
/* @__PURE__ */ i("div", { className: t["editor__toolbar-button-flyoutwrapper"], children: [
|
|
71
|
-
/* @__PURE__ */ r(
|
|
45
|
+
return y(() => {
|
|
46
|
+
var t, r;
|
|
47
|
+
a ? (n.current = !0, (r = e.current) == null || r.focusFirstField()) : ((t = e.current) == null || t.clearForm(), setTimeout(() => n.current = !1, C));
|
|
48
|
+
}, [e, a]), /* @__PURE__ */ c("div", { className: o["editor__toolbar-button-group"], children: [
|
|
49
|
+
/* @__PURE__ */ c("div", { className: o["editor__toolbar-button-flyoutwrapper"], children: [
|
|
50
|
+
/* @__PURE__ */ i(
|
|
72
51
|
"button",
|
|
73
52
|
{
|
|
74
|
-
onClick: () => n
|
|
75
|
-
className:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
53
|
+
onClick: () => !n.current && _(v),
|
|
54
|
+
className: p(
|
|
55
|
+
o["editor__toolbar-button"],
|
|
56
|
+
o["editor__toolbar-button--link"],
|
|
57
|
+
l.active && o["editor__toolbar-button--active"]
|
|
79
58
|
),
|
|
80
59
|
"aria-label": "Format link",
|
|
81
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ i(f, { name: "Link", size: 20 })
|
|
82
61
|
}
|
|
83
62
|
),
|
|
84
|
-
|
|
63
|
+
b
|
|
85
64
|
] }),
|
|
86
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ i(
|
|
87
66
|
"button",
|
|
88
67
|
{
|
|
89
|
-
onClick:
|
|
90
|
-
className:
|
|
68
|
+
onClick: h,
|
|
69
|
+
className: p(o["editor__toolbar-button"], o["editor__toolbar-button--link"]),
|
|
91
70
|
"aria-label": "Remove link",
|
|
92
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ i(f, { name: "LinkSlash", size: 20 })
|
|
93
72
|
}
|
|
94
73
|
)
|
|
95
74
|
] });
|
|
96
75
|
};
|
|
97
76
|
export {
|
|
98
|
-
|
|
77
|
+
W as LinkPlugin
|
|
99
78
|
};
|
|
100
79
|
//# sourceMappingURL=LinkPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { TOGGLE_LINK_COMMAND } from '@lexical/link';\nimport { useEffect, useRef
|
|
1
|
+
{"version":3,"file":"LinkPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport clsx from 'clsx';\nimport { TOGGLE_LINK_COMMAND } from '@lexical/link';\nimport { useEffect, useRef } from 'react';\n\nimport type { LinkType } from 'components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin';\nimport type { addLinkFormMethods } from './AddLinkFrom';\n\nimport { AddLinkForm } from './AddLinkFrom';\n\nimport { useFlyout } from 'components/RteEditor/hooks';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\ninterface LinkPluginProps {\n isLink: LinkType;\n}\n\nconst PREVENT_OPEN_DELAY = 200;\n\nexport const LinkPlugin = ({ isLink = { active: false, url: '', target: '_self' } }: LinkPluginProps) => {\n const [editor] = useLexicalComposerContext();\n const { flyout, showFlyout, closeFlyout, isVisible } = useFlyout();\n const addLinkForm = useRef<addLinkFormMethods>();\n const preventOpen = useRef(false);\n\n const insertLink = (url: string, target: string) => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, {\n url,\n target,\n });\n\n closeFlyout();\n };\n\n const removeLink = (): void => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);\n };\n\n const flyoutOptions = {\n children: (\n <AddLinkForm\n isLink={isLink}\n onCloseHandler={closeFlyout}\n onSaveHandler={(url, target) => insertLink(url, target)}\n ref={addLinkForm}\n />\n ),\n };\n\n useEffect(() => {\n if (!isVisible) {\n addLinkForm.current?.clearForm();\n setTimeout(() => (preventOpen.current = false), PREVENT_OPEN_DELAY);\n } else {\n preventOpen.current = true;\n addLinkForm.current?.focusFirstField();\n }\n }, [addLinkForm, isVisible]);\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n <div className={styles['editor__toolbar-button-flyoutwrapper']}>\n <button\n onClick={() => !preventOpen.current && showFlyout(flyoutOptions)}\n className={clsx(\n styles['editor__toolbar-button'],\n styles[`editor__toolbar-button--link`],\n isLink.active && styles['editor__toolbar-button--active']\n )}\n aria-label={`Format link`}\n >\n <Icon name=\"Link\" size={20} />\n </button>\n {flyout}\n </div>\n <button\n onClick={removeLink}\n className={clsx(styles['editor__toolbar-button'], styles[`editor__toolbar-button--link`])}\n aria-label={`Remove link`}\n >\n <Icon name=\"LinkSlash\" size={20} />\n </button>\n </div>\n );\n};\n"],"names":["PREVENT_OPEN_DELAY","LinkPlugin","isLink","editor","useLexicalComposerContext","flyout","showFlyout","closeFlyout","isVisible","useFlyout","addLinkForm","useRef","preventOpen","insertLink","url","target","TOGGLE_LINK_COMMAND","removeLink","flyoutOptions","jsx","AddLinkForm","useEffect","_b","_a","jsxs","styles","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAqB,KAEdC,IAAa,CAAC,EAAE,QAAAC,IAAS,EAAE,QAAQ,IAAO,KAAK,IAAI,QAAQ,QAAQ,QAAyB;AACjG,QAAA,CAACC,CAAM,IAAIC,KACX,EAAE,QAAAC,GAAQ,YAAAC,GAAY,aAAAC,GAAa,WAAAC,EAAA,IAAcC,KACjDC,IAAcC,KACdC,IAAcD,EAAO,EAAK,GAE1BE,IAAa,CAACC,GAAaC,MAAmB;AAClD,IAAAZ,EAAO,gBAAgBa,GAAqB;AAAA,MAC1C,KAAAF;AAAA,MACA,QAAAC;AAAA,IAAA,CACD,GAEWR;EAAA,GAGRU,IAAa,MAAY;AACtB,IAAAd,EAAA,gBAAgBa,GAAqB,IAAI;AAAA,EAAA,GAG5CE,IAAgB;AAAA,IACpB,UACE,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAAlB;AAAA,QACA,gBAAgBK;AAAA,QAChB,eAAe,CAACO,GAAKC,MAAWF,EAAWC,GAAKC,CAAM;AAAA,QACtD,KAAKL;AAAA,MAAA;AAAA,IACP;AAAA,EAAA;AAIJ,SAAAW,EAAU,MAAM;;AACd,IAAKb,KAIHI,EAAY,UAAU,KACtBU,IAAAZ,EAAY,YAAZ,QAAAY,EAAqB,uBAJrBC,IAAAb,EAAY,YAAZ,QAAAa,EAAqB,aACrB,WAAW,MAAOX,EAAY,UAAU,IAAQZ,CAAkB;AAAA,EAIpE,GACC,CAACU,GAAaF,CAAS,CAAC,GAGxB,gBAAAgB,EAAA,OAAA,EAAI,WAAWC,EAAO,8BAA8B,GACnD,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAI,EAAA,WAAWC,EAAO,sCAAsC,GAC3D,UAAA;AAAA,MAAA,gBAAAN;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,MAAM,CAACP,EAAY,WAAWN,EAAWY,CAAa;AAAA,UAC/D,WAAWQ;AAAA,YACTD,EAAO,wBAAwB;AAAA,YAC/BA,EAAO,8BAA8B;AAAA,YACrCvB,EAAO,UAAUuB,EAAO,gCAAgC;AAAA,UAC1D;AAAA,UACA,cAAY;AAAA,UAEZ,UAAC,gBAAAN,EAAAQ,GAAA,EAAK,MAAK,QAAO,MAAM,IAAI;AAAA,QAAA;AAAA,MAC9B;AAAA,MACCtB;AAAA,IAAA,GACH;AAAA,IACA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAASF;AAAA,QACT,WAAWS,EAAKD,EAAO,wBAAwB,GAAGA,EAAO,8BAA8B,CAAC;AAAA,QACxF,cAAY;AAAA,QAEZ,UAAC,gBAAAN,EAAAQ,GAAA,EAAK,MAAK,aAAY,MAAM,IAAI;AAAA,MAAA;AAAA,IACnC;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../../../Lexical.prod-
|
|
3
|
-
import { L as a } from "../../../../ListPlugin-
|
|
2
|
+
import "../../../../Lexical.prod-BiuZHlIm.js";
|
|
3
|
+
import { L as a } from "../../../../ListPlugin-DFFbKLaN.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../../../clsx-OuTLNxxd.js";
|
|
6
6
|
import "../../../Icon/Icon.js";
|
|
7
|
-
import "../../../../RteEditor.module-
|
|
7
|
+
import "../../../../RteEditor.module-BBbfV1rk.js";
|
|
8
8
|
export {
|
|
9
9
|
a as ListPlugin
|
|
10
10
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface AddTableFormProps {
|
|
2
|
+
onCloseHandler: () => void;
|
|
3
|
+
onSaveHandler: (nrfOfRows: number, nrOfColumns: number) => void;
|
|
4
|
+
}
|
|
5
|
+
export interface addTableForm {
|
|
6
|
+
clearForm: () => void;
|
|
7
|
+
focusFirstField: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AddTableForm: import('react').ForwardRefExoticComponent<AddTableFormProps & import('react').RefAttributes<unknown>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { a as n } from "../../../../AddTableFrom-CwnPli3F.js";
|
|
4
|
+
import "../../../Buttons/Button.js";
|
|
5
|
+
import "../../../Buttons/LinkButton.js";
|
|
6
|
+
import "@react-aria/button";
|
|
7
|
+
import "../../../Label/Label.js";
|
|
8
|
+
import "@react-aria/dialog";
|
|
9
|
+
import "@react-aria/focus";
|
|
10
|
+
import "@react-aria/overlays";
|
|
11
|
+
import "../../../OverlayCloseButton/OverlayCloseButton.js";
|
|
12
|
+
import "../../../FormField/FormField.js";
|
|
13
|
+
import "../../../GridRow/GridRow.js";
|
|
14
|
+
import "../../../IconButton/IconButton.js";
|
|
15
|
+
import "../../../Input/Input.js";
|
|
16
|
+
import "../../../InputField/InputField.js";
|
|
17
|
+
import "react-router-dom";
|
|
18
|
+
import "../../../SelectListbox/SelectListbox.js";
|
|
19
|
+
import "../../../SelectListbox/SelectProvider.js";
|
|
20
|
+
import "../../../Sortable/components/SortableItem.js";
|
|
21
|
+
import "../../../../SortableProvider-Z0e0qeQT.js";
|
|
22
|
+
export {
|
|
23
|
+
n as AddTableForm
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=AddTableFrom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddTableFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TablePlugin: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../../../Lexical.prod-BiuZHlIm.js";
|
|
3
|
+
import "../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { T as y } from "../../../../TablePlugin-CKJQiwra.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import "../../../../AddTableFrom-CwnPli3F.js";
|
|
7
|
+
import "../../hooks/useFlyout.js";
|
|
8
|
+
import "../../../Icon/Icon.js";
|
|
9
|
+
import "../../../Buttons/Button.js";
|
|
10
|
+
import "../../../Buttons/LinkButton.js";
|
|
11
|
+
import "@react-aria/button";
|
|
12
|
+
import "@react-aria/dialog";
|
|
13
|
+
import "@react-aria/focus";
|
|
14
|
+
import "@react-aria/overlays";
|
|
15
|
+
import "../../../OverlayCloseButton/OverlayCloseButton.js";
|
|
16
|
+
import "../../../GridRow/GridRow.js";
|
|
17
|
+
import "../../../IconButton/IconButton.js";
|
|
18
|
+
import "../../../Input/Input.js";
|
|
19
|
+
import "../../../InputField/InputField.js";
|
|
20
|
+
import "react-router-dom";
|
|
21
|
+
import "../../../../RteEditor.module-BBbfV1rk.js";
|
|
22
|
+
import "../../../SelectListbox/SelectListbox.js";
|
|
23
|
+
import "../../../SelectListbox/SelectProvider.js";
|
|
24
|
+
import "../../../Sortable/components/SortableItem.js";
|
|
25
|
+
import "../../../../SortableProvider-Z0e0qeQT.js";
|
|
26
|
+
export {
|
|
27
|
+
y as TablePlugin
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=TablePlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TablePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TablePlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as _, jsx as
|
|
2
|
-
import { u as I, I as P, m as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { L as B, H as h } from "../../../../ListPlugin-
|
|
5
|
-
import { g as v } from "../../../../helpers-
|
|
1
|
+
import { jsxs as _, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { u as I, I as P, m as b } from "../../../../Lexical.prod-BiuZHlIm.js";
|
|
3
|
+
import { useState as o, useCallback as k, useEffect as N } from "react";
|
|
4
|
+
import { L as B, H as h } from "../../../../ListPlugin-DFFbKLaN.js";
|
|
5
|
+
import { g as v } from "../../../../helpers-CJF7fErD.js";
|
|
6
6
|
import { BlockFormatPlugin as x } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
7
7
|
import { LinkPlugin as F } from "../LinkPlugin/LinkPlugin.js";
|
|
8
|
-
import { HistoryPlugin as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { HistoryPlugin as T } from "../HistoryPlugin/HistoryPlugin.js";
|
|
9
|
+
import { T as U } from "../../../../TablePlugin-CKJQiwra.js";
|
|
10
|
+
import { s as j } from "../../../../RteEditor.module-BBbfV1rk.js";
|
|
11
|
+
const n = (i, s) => {
|
|
12
|
+
let t = i, l;
|
|
12
13
|
for (; t !== null; ) {
|
|
13
14
|
if (s === "a" && v(t))
|
|
14
15
|
return { active: !0, url: t.__url, target: t.__target ? t.__target : "_self" };
|
|
15
16
|
if ((s === "ul" || s === "ol") && h(t))
|
|
16
|
-
return
|
|
17
|
+
return l = t.getTag(), l === s;
|
|
17
18
|
t = t.getParent();
|
|
18
19
|
}
|
|
19
20
|
return !1;
|
|
20
|
-
},
|
|
21
|
-
const [
|
|
21
|
+
}, D = () => {
|
|
22
|
+
const [i] = I(), [s, t] = o(!1), [l, f] = o(!1), [u, c] = o(!1), [g, d] = o(!1), [p, L] = o({ active: !1, url: "", target: "_self" }), m = k(() => {
|
|
22
23
|
const e = P();
|
|
23
|
-
if (
|
|
24
|
-
t(e.hasFormat("bold")),
|
|
24
|
+
if (b(e)) {
|
|
25
|
+
t(e.hasFormat("bold")), f(e.hasFormat("italic"));
|
|
25
26
|
const a = e.anchor.getNode();
|
|
26
|
-
|
|
27
|
+
c(n(a, "ul")), d(n(a, "ol")), L(n(a, "a"));
|
|
27
28
|
}
|
|
28
29
|
}, []);
|
|
29
|
-
return
|
|
30
|
-
|
|
30
|
+
return N(() => {
|
|
31
|
+
i.registerUpdateListener(({ editorState: e }) => {
|
|
31
32
|
e.read(() => {
|
|
32
|
-
|
|
33
|
+
m();
|
|
33
34
|
});
|
|
34
35
|
});
|
|
35
|
-
}, [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
36
|
+
}, [i, m]), /* @__PURE__ */ _("div", { className: j.editor__toolbar, children: [
|
|
37
|
+
/* @__PURE__ */ r(x, { isBold: s, isItalic: l }),
|
|
38
|
+
/* @__PURE__ */ r(B, { isUList: u, isOList: g }),
|
|
39
|
+
/* @__PURE__ */ r(F, { isLink: p }),
|
|
40
|
+
/* @__PURE__ */ r(U, {}),
|
|
41
|
+
/* @__PURE__ */ r(T, {})
|
|
40
42
|
] });
|
|
41
43
|
};
|
|
42
44
|
export {
|
|
43
|
-
|
|
45
|
+
D as ToolBarPlugin
|
|
44
46
|
};
|
|
45
47
|
//# sourceMappingURL=ToolbarPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection } from 'lexical';\nimport { useCallback, useEffect, useState } from 'react';\nimport { $isListNode } from '@lexical/list';\nimport { $isLinkNode } from '@lexical/link';\n\nimport type { ElementNode, TextNode } from 'lexical';\n\nimport { LinkPlugin, BlockFormatPlugin, ListPlugin, HistoryPlugin } from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type TargetType = '_blank' | '_self';\nexport interface LinkType {\n active: boolean;\n url: string;\n target: TargetType | string;\n}\n\nconst getNodeTag = (anchorNode: ElementNode | TextNode, tagToMatch: string): boolean | LinkType => {\n let currentNode: TextNode | ElementNode | null = anchorNode;\n let tag: string | null;\n\n while (currentNode !== null) {\n if (tagToMatch === 'a') {\n if ($isLinkNode(currentNode)) {\n return { active: true, url: currentNode.__url, target: !currentNode.__target ? '_self' : currentNode.__target };\n }\n }\n\n if (tagToMatch === 'ul' || tagToMatch === 'ol') {\n if ($isListNode(currentNode)) {\n tag = currentNode.getTag();\n return tag === tagToMatch;\n }\n }\n\n currentNode = currentNode.getParent();\n }\n\n return false;\n};\n\nexport const ToolBarPlugin = (): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [isBold, setIsBold] = useState(false);\n const [isItalic, setIsItalic] = useState(false);\n const [isUList, setIsUList] = useState<boolean>(false);\n const [isOList, setIsOList] = useState<boolean>(false);\n const [isLink, setIsLink] = useState<LinkType>({ active: false, url: '', target: '_self' });\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n setIsBold(selection.hasFormat('bold'));\n setIsItalic(selection.hasFormat('italic'));\n\n const anchorNode = selection.anchor.getNode();\n setIsUList(getNodeTag(anchorNode, 'ul') as boolean);\n setIsOList(getNodeTag(anchorNode, 'ol') as boolean);\n setIsLink(getNodeTag(anchorNode, 'a') as LinkType);\n }\n }, []);\n\n useEffect(() => {\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateToolbar();\n });\n });\n }, [editor, updateToolbar]);\n\n return (\n <div className={styles['editor__toolbar']}>\n <BlockFormatPlugin isBold={isBold} isItalic={isItalic} />\n <ListPlugin isUList={isUList} isOList={isOList} />\n <LinkPlugin isLink={isLink} />\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["getNodeTag","anchorNode","tagToMatch","currentNode","tag","$isLinkNode","$isListNode","ToolBarPlugin","editor","useLexicalComposerContext","isBold","setIsBold","useState","isItalic","setIsItalic","isUList","setIsUList","isOList","setIsOList","isLink","setIsLink","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","useEffect","editorState","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","LinkPlugin","HistoryPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection } from 'lexical';\nimport { useCallback, useEffect, useState } from 'react';\nimport { $isListNode } from '@lexical/list';\nimport { $isLinkNode } from '@lexical/link';\n\nimport type { ElementNode, TextNode } from 'lexical';\n\nimport { LinkPlugin, BlockFormatPlugin, ListPlugin, HistoryPlugin, TablePlugin } from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type TargetType = '_blank' | '_self';\nexport interface LinkType {\n active: boolean;\n url: string;\n target: TargetType | string;\n}\n\nconst getNodeTag = (anchorNode: ElementNode | TextNode, tagToMatch: string): boolean | LinkType => {\n let currentNode: TextNode | ElementNode | null = anchorNode;\n let tag: string | null;\n\n while (currentNode !== null) {\n if (tagToMatch === 'a') {\n if ($isLinkNode(currentNode)) {\n return { active: true, url: currentNode.__url, target: !currentNode.__target ? '_self' : currentNode.__target };\n }\n }\n\n if (tagToMatch === 'ul' || tagToMatch === 'ol') {\n if ($isListNode(currentNode)) {\n tag = currentNode.getTag();\n return tag === tagToMatch;\n }\n }\n\n currentNode = currentNode.getParent();\n }\n\n return false;\n};\n\nexport const ToolBarPlugin = (): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [isBold, setIsBold] = useState(false);\n const [isItalic, setIsItalic] = useState(false);\n const [isUList, setIsUList] = useState<boolean>(false);\n const [isOList, setIsOList] = useState<boolean>(false);\n const [isLink, setIsLink] = useState<LinkType>({ active: false, url: '', target: '_self' });\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n setIsBold(selection.hasFormat('bold'));\n setIsItalic(selection.hasFormat('italic'));\n\n const anchorNode = selection.anchor.getNode();\n setIsUList(getNodeTag(anchorNode, 'ul') as boolean);\n setIsOList(getNodeTag(anchorNode, 'ol') as boolean);\n setIsLink(getNodeTag(anchorNode, 'a') as LinkType);\n }\n }, []);\n\n useEffect(() => {\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateToolbar();\n });\n });\n }, [editor, updateToolbar]);\n\n return (\n <div className={styles['editor__toolbar']}>\n <BlockFormatPlugin isBold={isBold} isItalic={isItalic} />\n <ListPlugin isUList={isUList} isOList={isOList} />\n <LinkPlugin isLink={isLink} />\n <TablePlugin />\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["getNodeTag","anchorNode","tagToMatch","currentNode","tag","$isLinkNode","$isListNode","ToolBarPlugin","editor","useLexicalComposerContext","isBold","setIsBold","useState","isItalic","setIsItalic","isUList","setIsUList","isOList","setIsOList","isLink","setIsLink","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","useEffect","editorState","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","LinkPlugin","TablePlugin","HistoryPlugin"],"mappings":";;;;;;;;;;AAkBA,MAAMA,IAAa,CAACC,GAAoCC,MAA2C;AACjG,MAAIC,IAA6CF,GAC7CG;AAEJ,SAAOD,MAAgB,QAAM;AAC3B,QAAID,MAAe,OACbG,EAAYF,CAAW;AACzB,aAAO,EAAE,QAAQ,IAAM,KAAKA,EAAY,OAAO,QAASA,EAAY,WAAqBA,EAAY,WAAtB,QAA+B;AAI9G,SAAAD,MAAe,QAAQA,MAAe,SACpCI,EAAYH,CAAW;AACzB,aAAAC,IAAMD,EAAY,UACXC,MAAQF;AAInB,IAAAC,IAAcA,EAAY;EAC5B;AAEO,SAAA;AACT,GAEaI,IAAgB,MAAmB;AACxC,QAAA,CAACC,CAAM,IAAIC,KACX,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAK,GACxC,CAACG,GAASC,CAAU,IAAIJ,EAAkB,EAAK,GAC/C,CAACK,GAASC,CAAU,IAAIN,EAAkB,EAAK,GAC/C,CAACO,GAAQC,CAAS,IAAIR,EAAmB,EAAE,QAAQ,IAAO,KAAK,IAAI,QAAQ,QAAS,CAAA,GAEpFS,IAAgBC,EAAY,MAAM;AACtC,UAAMC,IAAYC;AACd,QAAAC,EAAkBF,CAAS,GAAG;AACtB,MAAAZ,EAAAY,EAAU,UAAU,MAAM,CAAC,GACzBT,EAAAS,EAAU,UAAU,QAAQ,CAAC;AAEnC,YAAAtB,IAAasB,EAAU,OAAO,QAAQ;AACjC,MAAAP,EAAAhB,EAAWC,GAAY,IAAI,CAAY,GACvCiB,EAAAlB,EAAWC,GAAY,IAAI,CAAY,GACxCmB,EAAApB,EAAWC,GAAY,GAAG,CAAa;AAAA,IACnD;AAAA,EACF,GAAG,CAAE,CAAA;AAEL,SAAAyB,EAAU,MAAM;AACd,IAAAlB,EAAO,uBAAuB,CAAC,EAAE,aAAAmB,QAAkB;AACjD,MAAAA,EAAY,KAAK,MAAM;AACP,QAAAN;MAAA,CACf;AAAA,IAAA,CACF;AAAA,EAAA,GACA,CAACb,GAAQa,CAAa,CAAC,GAGvB,gBAAAO,EAAA,OAAA,EAAI,WAAWC,EAAO,iBACrB,UAAA;AAAA,IAAC,gBAAAC,EAAAC,GAAA,EAAkB,QAAArB,GAAgB,UAAAG,EAAoB,CAAA;AAAA,IACvD,gBAAAiB,EAACE,GAAW,EAAA,SAAAjB,GAAkB,SAAAE,EAAkB,CAAA;AAAA,IAChD,gBAAAa,EAACG,KAAW,QAAAd,GAAgB;AAAA,sBAC3Be,GAAY,EAAA;AAAA,sBACZC,GAAc,EAAA;AAAA,EACjB,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ToolBarPlugin as i } from "./ToolbarPlugin/ToolbarPlugin.js";
|
|
2
|
-
import { BlockFormatPlugin as
|
|
3
|
-
import { L as
|
|
2
|
+
import { BlockFormatPlugin as t } from "./BlockFormatPlugin/BlockFormatPlugin.js";
|
|
3
|
+
import { L as m } from "../../../ListPlugin-DFFbKLaN.js";
|
|
4
4
|
import { LinkPlugin as f } from "./LinkPlugin/LinkPlugin.js";
|
|
5
5
|
import { HistoryPlugin as p } from "./HistoryPlugin/HistoryPlugin.js";
|
|
6
|
+
import { T as x } from "../../../TablePlugin-CKJQiwra.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
t as BlockFormatPlugin,
|
|
8
9
|
p as HistoryPlugin,
|
|
9
10
|
f as LinkPlugin,
|
|
10
|
-
|
|
11
|
+
m as ListPlugin,
|
|
12
|
+
x as TablePlugin,
|
|
11
13
|
i as ToolBarPlugin
|
|
12
14
|
};
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|