@uva-glass/component-library 1.55.0 → 1.56.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-BiuZHlIm.js → Lexical.prod-CO0gPAfo.js} +583 -607
- package/dist/Lexical.prod-CO0gPAfo.js.map +1 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js +27 -0
- package/dist/LexicalComposerContext.prod-Dyvim1tK.js.map +1 -0
- package/dist/LexicalList.prod-BceA-cJD.js +562 -0
- package/dist/LexicalList.prod-BceA-cJD.js.map +1 -0
- package/dist/{LexicalUtils.prod-BZOm66mY.js → LexicalUtils.prod-PbdOb6JG.js} +6 -6
- package/dist/{LexicalUtils.prod-BZOm66mY.js.map → LexicalUtils.prod-PbdOb6JG.js.map} +1 -1
- package/dist/RteEditor.module-Dz9a8vaK.js +29 -0
- package/dist/RteEditor.module-Dz9a8vaK.js.map +1 -0
- package/dist/Sortable.module-uk_YuFs1.js +24 -0
- package/dist/{Sortable.module-BrgGu8qp.js.map → Sortable.module-uk_YuFs1.js.map} +1 -1
- package/dist/{SortableProvider-Z0e0qeQT.js → SortableProvider-i4PDjRS_.js} +2 -2
- package/dist/{SortableProvider-Z0e0qeQT.js.map → SortableProvider-i4PDjRS_.js.map} +1 -1
- package/dist/TablePlugin-1L5UZfDH.js +249 -0
- package/dist/TablePlugin-1L5UZfDH.js.map +1 -0
- package/dist/assets/Container.css +1 -1
- package/dist/assets/EditorHeader.css +1 -0
- package/dist/assets/Flyout.css +1 -0
- package/dist/assets/Periods.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/Sortable.css +1 -1
- package/dist/assets/TableCellContextMenu.css +1 -0
- package/dist/assets/TablePlugin.css +1 -0
- package/dist/components/CheckboxTree/CheckboxTree.js +13 -11
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/Icon/icons/index.d.ts +21 -18
- package/dist/components/Icon/icons/index.js +125 -120
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +16 -14
- package/dist/components/InputField/InputField.stories.js.map +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 +5 -3
- package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/Periods/Periods.js +12 -12
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +6 -4
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.d.ts +7 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +53 -0
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -0
- package/dist/components/RteEditor/EditorHeader/index.d.ts +1 -0
- package/dist/components/RteEditor/EditorHeader/index.js +5 -0
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +11 -10
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +18 -15
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +2 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +7 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +2 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +63 -49
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +3 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +6 -4
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +31 -8
- 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 +6 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +8 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +44 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +5 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.d.ts +9 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +8 -6
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.d.ts +7 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +4 -2
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +4 -0
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +48 -38
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +10 -8
- package/dist/components/RteEditor/Plugins/index.js.map +1 -1
- package/dist/components/RteEditor/Providers/LanguageProvider.d.ts +10 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js +18 -0
- package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -0
- package/dist/components/RteEditor/RteEditor.d.ts +9 -1
- package/dist/components/RteEditor/RteEditor.js +476 -401
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -0
- package/dist/components/RteEditor/RteEditor.stories.js +106 -15
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.d.ts +7 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js +14 -0
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +16 -20
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.d.ts +61 -0
- package/dist/components/RteEditor/hooks/useTranslation.js +10 -0
- package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -0
- package/dist/components/RteEditor/index.js +3 -2
- package/dist/components/RteEditor/mockRteContent.d.ts +1 -0
- package/dist/components/RteEditor/mockRteContent.js +98 -0
- package/dist/components/RteEditor/mockRteContent.js.map +1 -0
- package/dist/components/RteEditor/translations.d.ts +64 -0
- package/dist/components/RteEditor/translations.js +68 -0
- package/dist/components/RteEditor/translations.js.map +1 -0
- package/dist/components/Sortable/Sortable.js +1 -1
- package/dist/components/Sortable/SortableProvider.js +1 -1
- package/dist/components/Sortable/components/SortableContainer.js +2 -2
- package/dist/components/Sortable/components/SortableHandle.js +1 -1
- package/dist/components/Sortable/components/SortableItem.js +2 -2
- package/dist/components/index.js +20 -19
- package/dist/helpers-BewZrn6E.js +1512 -0
- package/dist/helpers-BewZrn6E.js.map +1 -0
- package/dist/{helpers-CJF7fErD.js → helpers-Ec7CfNnA.js} +72 -59
- package/dist/helpers-Ec7CfNnA.js.map +1 -0
- package/dist/index.js +20 -19
- package/dist/storyComponents/Container/Container.d.ts +1 -1
- package/dist/storyComponents/Container/Container.js +18 -16
- package/dist/storyComponents/Container/Container.js.map +1 -1
- package/package.json +12 -12
- package/dist/AddTableFrom-CwnPli3F.js +0 -162
- package/dist/AddTableFrom-CwnPli3F.js.map +0 -1
- package/dist/Lexical.prod-BiuZHlIm.js.map +0 -1
- package/dist/ListPlugin-DFFbKLaN.js +0 -588
- package/dist/ListPlugin-DFFbKLaN.js.map +0 -1
- package/dist/RteEditor.module-BBbfV1rk.js +0 -24
- package/dist/RteEditor.module-BBbfV1rk.js.map +0 -1
- package/dist/Sortable.module-BrgGu8qp.js +0 -24
- package/dist/TablePlugin-CKJQiwra.js +0 -1506
- package/dist/TablePlugin-CKJQiwra.js.map +0 -1
- package/dist/assets/AddTableFrom.css +0 -1
- package/dist/assets/useFlyout.css +0 -1
- package/dist/components/RteEditor/hooks/index.d.ts +0 -1
- package/dist/components/RteEditor/hooks/index.js +0 -5
- package/dist/helpers-CJF7fErD.js.map +0 -1
- /package/dist/components/RteEditor/{hooks → EditorHeader}/index.js.map +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
4
|
-
import { U as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { u as y } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { c as L } from "../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { g as N, U as b } from "../../../../helpers-Ec7CfNnA.js";
|
|
5
|
+
import { useRef as _, useEffect as g } from "react";
|
|
6
|
+
import { r as C, I as E, m as P } from "../../../../Lexical.prod-CO0gPAfo.js";
|
|
7
|
+
import { A as x } from "../../../../TablePlugin-1L5UZfDH.js";
|
|
8
|
+
import { useFlyout as I } from "../../hooks/useFlyout.js";
|
|
9
|
+
import { Icon as T } from "../../../Icon/Icon.js";
|
|
9
10
|
import "../../../Buttons/Button.js";
|
|
10
11
|
import "../../../Buttons/LinkButton.js";
|
|
11
12
|
import "@react-aria/button";
|
|
@@ -18,62 +19,75 @@ import "../../../IconButton/IconButton.js";
|
|
|
18
19
|
import "../../../Input/Input.js";
|
|
19
20
|
import "../../../InputField/InputField.js";
|
|
20
21
|
import "react-router-dom";
|
|
21
|
-
import { s as
|
|
22
|
+
import { s as e } from "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
23
|
+
import "../../Providers/LanguageProvider.js";
|
|
22
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
23
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
24
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
25
|
-
import "../../../../SortableProvider-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
import "../../../../SortableProvider-i4PDjRS_.js";
|
|
28
|
+
const A = 200, st = ({
|
|
29
|
+
isLink: l = { active: !1, url: "", target: "_self" },
|
|
30
|
+
isLinkable: k = !1
|
|
31
|
+
}) => {
|
|
32
|
+
const [i] = y(), { flyout: v, showFlyout: p, closeFlyout: s, isVisible: c } = I(), r = _(), m = _(!1), F = (o, t) => {
|
|
33
|
+
i.dispatchCommand(b, {
|
|
34
|
+
url: o,
|
|
35
|
+
target: t
|
|
31
36
|
}), s();
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children: /* @__PURE__ */ i(
|
|
36
|
-
L,
|
|
37
|
+
}, u = {
|
|
38
|
+
children: /* @__PURE__ */ n(
|
|
39
|
+
x,
|
|
37
40
|
{
|
|
38
41
|
isLink: l,
|
|
39
42
|
onCloseHandler: s,
|
|
40
|
-
onSaveHandler: (
|
|
41
|
-
|
|
43
|
+
onSaveHandler: (o, t) => F(o, t),
|
|
44
|
+
onRemoveHandler: () => {
|
|
45
|
+
i.dispatchCommand(b, null), s();
|
|
46
|
+
},
|
|
47
|
+
ref: r
|
|
42
48
|
}
|
|
43
49
|
)
|
|
44
50
|
};
|
|
45
|
-
return
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
children: /* @__PURE__ */ i(f, { name: "Link", size: 20 })
|
|
51
|
+
return g(() => {
|
|
52
|
+
var o, t;
|
|
53
|
+
c ? (m.current = !0, (t = r.current) == null || t.focusFirstField()) : ((o = r.current) == null || o.clearForm(), setTimeout(() => m.current = !1, A));
|
|
54
|
+
}, [r, c]), g(() => {
|
|
55
|
+
const o = i.registerCommand(
|
|
56
|
+
C,
|
|
57
|
+
(t) => {
|
|
58
|
+
const d = E();
|
|
59
|
+
if (P(d)) {
|
|
60
|
+
const a = N(d.anchor.getNode(), "a");
|
|
61
|
+
if (a)
|
|
62
|
+
return t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation(), p(u), setTimeout(() => {
|
|
63
|
+
var f;
|
|
64
|
+
return (f = r.current) == null ? void 0 : f.setDefaults(a.url, a.target === "_blank");
|
|
65
|
+
}, 0), !0;
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
return !1;
|
|
68
|
+
},
|
|
69
|
+
0
|
|
70
|
+
);
|
|
71
|
+
return () => o();
|
|
72
|
+
}, [i]), /* @__PURE__ */ n("div", { className: e["editor__toolbar-button-group"], children: /* @__PURE__ */ h("div", { className: e["editor__toolbar-button-flyoutwrapper"], children: [
|
|
73
|
+
/* @__PURE__ */ n(
|
|
66
74
|
"button",
|
|
67
75
|
{
|
|
68
|
-
onClick:
|
|
69
|
-
className:
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
onClick: () => !m.current && p(u),
|
|
77
|
+
className: L(
|
|
78
|
+
e["editor__toolbar-button"],
|
|
79
|
+
e["editor__toolbar-button--link"],
|
|
80
|
+
l.active && e["editor__toolbar-button--active"]
|
|
81
|
+
),
|
|
82
|
+
disabled: !k,
|
|
83
|
+
"aria-label": "Format link",
|
|
84
|
+
children: /* @__PURE__ */ n(T, { name: "Link", size: 20 })
|
|
72
85
|
}
|
|
73
|
-
)
|
|
74
|
-
|
|
86
|
+
),
|
|
87
|
+
v
|
|
88
|
+
] }) });
|
|
75
89
|
};
|
|
76
90
|
export {
|
|
77
|
-
|
|
91
|
+
st as LinkPlugin
|
|
78
92
|
};
|
|
79
93
|
//# 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 } 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 = ({
|
|
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';\nimport { $getSelection, $isRangeSelection, CLICK_COMMAND } from 'lexical';\n\nimport type { LinkType } from 'components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin';\nimport type { addLinkFormMethods } from './AddLinkFrom';\n\nimport { AddLinkForm } from './AddLinkFrom';\nimport { getNodeTag } from './helpers';\n\nimport { useFlyout } from 'components/RteEditor/hooks/useFlyout';\nimport { Icon } from 'components';\nimport styles from 'components/RteEditor/RteEditor.module.css';\ninterface LinkPluginProps {\n isLink: LinkType;\n isLinkable: boolean;\n}\n\nconst PREVENT_OPEN_DELAY = 200;\n\nexport const LinkPlugin = ({\n isLink = { active: false, url: '', target: '_self' },\n isLinkable = false,\n}: 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 closeFlyout();\n };\n\n const flyoutOptions = {\n children: (\n <AddLinkForm\n isLink={isLink}\n onCloseHandler={closeFlyout}\n onSaveHandler={(url, target) => insertLink(url, target)}\n onRemoveHandler={removeLink}\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 useEffect(() => {\n const unregister = editor.registerCommand(\n CLICK_COMMAND,\n (event) => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const node = getNodeTag(selection.anchor.getNode(), 'a') as LinkType;\n\n if (node) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n showFlyout(flyoutOptions);\n setTimeout(() => addLinkForm.current?.setDefaults(node.url, node.target === '_blank'), 0);\n return true;\n }\n }\n return false;\n },\n 0\n );\n\n return () => unregister();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor]);\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 disabled={!isLinkable}\n aria-label={`Format link`}\n >\n <Icon name=\"Link\" size={20} />\n </button>\n {flyout}\n </div>\n </div>\n );\n};\n"],"names":["PREVENT_OPEN_DELAY","LinkPlugin","isLink","isLinkable","editor","useLexicalComposerContext","flyout","showFlyout","closeFlyout","isVisible","useFlyout","addLinkForm","useRef","preventOpen","insertLink","url","target","TOGGLE_LINK_COMMAND","flyoutOptions","jsx","AddLinkForm","useEffect","_b","_a","unregister","CLICK_COMMAND","event","selection","$getSelection","$isRangeSelection","node","getNodeTag","styles","jsxs","clsx","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,IAAqB,KAEdC,KAAa,CAAC;AAAA,EACzB,QAAAC,IAAS,EAAE,QAAQ,IAAO,KAAK,IAAI,QAAQ,QAAQ;AAAA,EACnD,YAAAC,IAAa;AACf,MAAuB;AACf,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,GAQRU,IAAgB;AAAA,IACpB,UACE,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,QAAAlB;AAAA,QACA,gBAAgBM;AAAA,QAChB,eAAe,CAACO,GAAKC,MAAWF,EAAWC,GAAKC,CAAM;AAAA,QACtD,iBAXa,MAAY;AACtB,UAAAZ,EAAA,gBAAgBa,GAAqB,IAAI,GACpCT;QAAA;AAAA,QAUR,KAAKG;AAAA,MAAA;AAAA,IACP;AAAA,EAAA;AAIJ,SAAAU,EAAU,MAAM;;AACd,IAAKZ,KAIHI,EAAY,UAAU,KACtBS,IAAAX,EAAY,YAAZ,QAAAW,EAAqB,uBAJrBC,IAAAZ,EAAY,YAAZ,QAAAY,EAAqB,aACrB,WAAW,MAAOV,EAAY,UAAU,IAAQb,CAAkB;AAAA,EAIpE,GACC,CAACW,GAAaF,CAAS,CAAC,GAE3BY,EAAU,MAAM;AACd,UAAMG,IAAapB,EAAO;AAAA,MACxBqB;AAAAA,MACA,CAACC,MAAU;AACT,cAAMC,IAAYC;AACd,YAAAC,EAAkBF,CAAS,GAAG;AAChC,gBAAMG,IAAOC,EAAWJ,EAAU,OAAO,QAAA,GAAW,GAAG;AAEvD,cAAIG;AACF,mBAAAJ,EAAM,eAAe,GACrBA,EAAM,gBAAgB,GACtBA,EAAM,yBAAyB,GAC/BnB,EAAWW,CAAa,GACb,WAAA,MAAM;;AAAA,sBAAAK,IAAAZ,EAAY,YAAZ,gBAAAY,EAAqB,YAAYO,EAAK,KAAKA,EAAK,WAAW;AAAA,eAAW,CAAC,GACjF;AAAA,QAEX;AACO,eAAA;AAAA,MACT;AAAA,MACA;AAAA,IAAA;AAGF,WAAO,MAAMN,EAAW;AAAA,EAAA,GAEvB,CAACpB,CAAM,CAAC,GAGT,gBAAAe,EAAC,OAAI,EAAA,WAAWa,EAAO,8BAA8B,GACnD,UAAA,gBAAAC,EAAC,OAAI,EAAA,WAAWD,EAAO,sCAAsC,GAC3D,UAAA;AAAA,IAAA,gBAAAb;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS,MAAM,CAACN,EAAY,WAAWN,EAAWW,CAAa;AAAA,QAC/D,WAAWgB;AAAA,UACTF,EAAO,wBAAwB;AAAA,UAC/BA,EAAO,8BAA8B;AAAA,UACrC9B,EAAO,UAAU8B,EAAO,gCAAgC;AAAA,QAC1D;AAAA,QACA,UAAU,CAAC7B;AAAA,QACX,cAAY;AAAA,QAEZ,UAAC,gBAAAgB,EAAAgB,GAAA,EAAK,MAAK,QAAO,MAAM,IAAI;AAAA,MAAA;AAAA,IAC9B;AAAA,IACC7B;AAAA,EAAA,EACH,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ElementNode, TextNode } from 'lexical';
|
|
2
|
+
import { LinkType } from 'components/RteEditor/Plugins/ToolbarPlugin';
|
|
1
3
|
export declare const validateUrl: (url: string) => boolean;
|
|
2
4
|
export declare const validateUrlWithProtocol: (url: string) => boolean;
|
|
3
5
|
export declare const MATCHERS: ((text: string) => {
|
|
@@ -6,3 +8,4 @@ export declare const MATCHERS: ((text: string) => {
|
|
|
6
8
|
text: string;
|
|
7
9
|
url: string;
|
|
8
10
|
} | null)[];
|
|
11
|
+
export declare const getNodeTag: (anchorNode: ElementNode | TextNode, tagToMatch: string) => boolean | LinkType;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { M as
|
|
1
|
+
import { M as r, g as e, c as l, v as i } from "../../../../helpers-Ec7CfNnA.js";
|
|
2
|
+
import "../../../../LexicalList.prod-BceA-cJD.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
r as MATCHERS,
|
|
5
|
+
e as getNodeTag,
|
|
6
|
+
l as validateUrl,
|
|
7
|
+
i as validateUrlWithProtocol
|
|
6
8
|
};
|
|
7
9
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,11 +1,34 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "../../../../
|
|
3
|
-
import {
|
|
4
|
-
import "react";
|
|
5
|
-
import "../../../../clsx-OuTLNxxd.js";
|
|
6
|
-
import "../../../Icon/Icon.js";
|
|
7
|
-
import "../../../../RteEditor.module-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { u as b } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { Q as s, G as u, Y as c } from "../../../../LexicalList.prod-BceA-cJD.js";
|
|
4
|
+
import { useState as d } from "react";
|
|
5
|
+
import { c as p } from "../../../../clsx-OuTLNxxd.js";
|
|
6
|
+
import { Icon as f } from "../../../Icon/Icon.js";
|
|
7
|
+
import { s as t } from "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
8
|
+
const _ = {
|
|
9
|
+
bullet: "BulletList",
|
|
10
|
+
number: "NumberedList"
|
|
11
|
+
}, h = ["bullet", "number"], I = ({ isOList: i = !1, isUList: l = !1 }) => {
|
|
12
|
+
const [r] = b(), [m, e] = d("paragraph"), n = (o) => {
|
|
13
|
+
o === "number" && m !== "number" ? (r.dispatchCommand(s, void 0), e("number")) : o === "bullet" && m !== "bullet" ? (r.dispatchCommand(u, void 0), e("bullet")) : (r.dispatchCommand(c, void 0), e("paragraph"));
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ a("div", { className: t["editor__toolbar-button-group"], children: h.map((o) => /* @__PURE__ */ a(
|
|
16
|
+
"button",
|
|
17
|
+
{
|
|
18
|
+
onClick: () => n(o),
|
|
19
|
+
className: p(
|
|
20
|
+
t["editor__toolbar-button"],
|
|
21
|
+
t[`editor__toolbar-button--${o}`],
|
|
22
|
+
o === "bullet" && l && t["editor__toolbar-button--active"],
|
|
23
|
+
o === "number" && i && t["editor__toolbar-button--active"]
|
|
24
|
+
),
|
|
25
|
+
"aria-label": `Format ${o}`,
|
|
26
|
+
children: /* @__PURE__ */ a(f, { name: _[o], size: 24 })
|
|
27
|
+
},
|
|
28
|
+
o
|
|
29
|
+
)) });
|
|
30
|
+
};
|
|
8
31
|
export {
|
|
9
|
-
|
|
32
|
+
I as ListPlugin
|
|
10
33
|
};
|
|
11
34
|
//# sourceMappingURL=ListPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListPlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ListPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ListPlugin/ListPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND } from '@lexical/list';\nimport { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { Icon } from 'components/Icon';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\ninterface ListPluginProps {\n isOList: boolean;\n isUList: boolean;\n}\n\ntype ListTypesType = 'bullet' | 'number' | 'paragraph';\nconst LIST_TYPE_ICONS = {\n bullet: 'BulletList',\n number: 'NumberedList',\n};\n\nconst ListTypes = ['bullet', 'number'];\n\nexport const ListPlugin = ({ isOList = false, isUList = false }: ListPluginProps) => {\n const [editor] = useLexicalComposerContext();\n const [blockType, setBlockType] = useState<ListTypesType>('paragraph');\n\n const formatList = (listType: ListTypesType): void => {\n if (listType === 'number' && blockType !== 'number') {\n editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND, undefined);\n setBlockType('number');\n } else if (listType === 'bullet' && blockType !== 'bullet') {\n editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND, undefined);\n setBlockType('bullet');\n } else {\n editor.dispatchCommand(REMOVE_LIST_COMMAND, undefined);\n setBlockType('paragraph');\n }\n };\n\n return (\n <div className={styles['editor__toolbar-button-group']}>\n {ListTypes.map((listType) => (\n <button\n onClick={() => formatList(listType as ListTypesType)}\n key={listType}\n className={clsx(\n styles['editor__toolbar-button'],\n styles[`editor__toolbar-button--${listType}`],\n listType === 'bullet' && isUList && styles['editor__toolbar-button--active'],\n listType === 'number' && isOList && styles['editor__toolbar-button--active']\n )}\n aria-label={`Format ${listType}`}\n >\n <Icon name={LIST_TYPE_ICONS[listType as keyof typeof Icon]} size={24} />\n </button>\n ))}\n </div>\n );\n};\n"],"names":["LIST_TYPE_ICONS","ListTypes","ListPlugin","isOList","isUList","editor","useLexicalComposerContext","blockType","setBlockType","useState","formatList","listType","INSERT_ORDERED_LIST_COMMAND","INSERT_UNORDERED_LIST_COMMAND","REMOVE_LIST_COMMAND","jsx","styles","clsx","Icon"],"mappings":";;;;;;;AAcA,MAAMA,IAAkB;AAAA,EACtB,QAAQ;AAAA,EACR,QAAQ;AACV,GAEMC,IAAY,CAAC,UAAU,QAAQ,GAExBC,IAAa,CAAC,EAAE,SAAAC,IAAU,IAAO,SAAAC,IAAU,SAA6B;AAC7E,QAAA,CAACC,CAAM,IAAIC,KACX,CAACC,GAAWC,CAAY,IAAIC,EAAwB,WAAW,GAE/DC,IAAa,CAACC,MAAkC;AAChD,IAAAA,MAAa,YAAYJ,MAAc,YAClCF,EAAA,gBAAgBO,GAA6B,MAAS,GAC7DJ,EAAa,QAAQ,KACZG,MAAa,YAAYJ,MAAc,YACzCF,EAAA,gBAAgBQ,GAA+B,MAAS,GAC/DL,EAAa,QAAQ,MAEdH,EAAA,gBAAgBS,GAAqB,MAAS,GACrDN,EAAa,WAAW;AAAA,EAC1B;AAIA,SAAA,gBAAAO,EAAC,SAAI,WAAWC,EAAO,8BAA8B,GAClD,UAAAf,EAAU,IAAI,CAACU,MACd,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAS,MAAML,EAAWC,CAAyB;AAAA,MAEnD,WAAWM;AAAA,QACTD,EAAO,wBAAwB;AAAA,QAC/BA,EAAO,2BAA2BL,CAAQ,EAAE;AAAA,QAC5CA,MAAa,YAAYP,KAAWY,EAAO,gCAAgC;AAAA,QAC3EL,MAAa,YAAYR,KAAWa,EAAO,gCAAgC;AAAA,MAC7E;AAAA,MACA,cAAY,UAAUL,CAAQ;AAAA,MAE9B,4BAACO,GAAK,EAAA,MAAMlB,EAAgBW,CAA6B,GAAG,MAAM,IAAI;AAAA,IAAA;AAAA,IATjEA;AAAA,EAWR,CAAA,EACH,CAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { b as v } from "../../../../TablePlugin-1L5UZfDH.js";
|
|
4
4
|
import "../../../Buttons/Button.js";
|
|
5
5
|
import "../../../Buttons/LinkButton.js";
|
|
6
6
|
import "@react-aria/button";
|
|
@@ -15,11 +15,14 @@ import "../../../IconButton/IconButton.js";
|
|
|
15
15
|
import "../../../Input/Input.js";
|
|
16
16
|
import "../../../InputField/InputField.js";
|
|
17
17
|
import "react-router-dom";
|
|
18
|
+
import "../../hooks/components/Flyout.js";
|
|
19
|
+
import "../../hooks/useTranslation.js";
|
|
20
|
+
import "../../Providers/LanguageProvider.js";
|
|
18
21
|
import "../../../SelectListbox/SelectListbox.js";
|
|
19
22
|
import "../../../SelectListbox/SelectProvider.js";
|
|
20
23
|
import "../../../Sortable/components/SortableItem.js";
|
|
21
|
-
import "../../../../SortableProvider-
|
|
24
|
+
import "../../../../SortableProvider-i4PDjRS_.js";
|
|
22
25
|
export {
|
|
23
|
-
|
|
26
|
+
v as AddTableForm
|
|
24
27
|
};
|
|
25
28
|
//# sourceMappingURL=AddTableFrom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddTableFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddTableFrom.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Position } from 'components/RteEditor/Plugins/ToolbarPlugin';
|
|
2
|
+
export type Actions = 'insertRowAbove' | 'insertRowBelow' | 'deleteRow' | 'deleteTable' | 'insertColumnLeft' | 'insertColumnRight' | 'deleteColumn';
|
|
3
|
+
interface TableCellContextMenuProps {
|
|
4
|
+
position: Position;
|
|
5
|
+
onAction: (action: Actions) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableCellContextMenu: ({ position, onAction }: TableCellContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useRef as h, useEffect as p } from "react";
|
|
3
|
+
import { c as C } from "../../../../../clsx-OuTLNxxd.js";
|
|
4
|
+
import { Icon as f } from "../../../../Icon/Icon.js";
|
|
5
|
+
import { useTranslation as w } from "../../../hooks/useTranslation.js";
|
|
6
|
+
import '../../../../../assets/TableCellContextMenu.css';const t = {
|
|
7
|
+
"context-menu__wrapper": "_context-menu__wrapper_1ygrn_1",
|
|
8
|
+
"context-menu__button": "_context-menu__button_1ygrn_9",
|
|
9
|
+
"context-menu": "_context-menu_1ygrn_1",
|
|
10
|
+
"context-menu--open": "_context-menu--open_1ygrn_37",
|
|
11
|
+
"context-menu__item": "_context-menu__item_1ygrn_42",
|
|
12
|
+
"context-menu__item-divider": "_context-menu__item-divider_1ygrn_56"
|
|
13
|
+
}, v = ({ position: r, onAction: u }) => {
|
|
14
|
+
const n = w(), [a, c] = m(!1), [l, d] = m({ xPos: 0, yPos: 0 }), i = h(null), [x, b] = m(0), o = (s) => {
|
|
15
|
+
u(s), c(!1);
|
|
16
|
+
};
|
|
17
|
+
return p(() => {
|
|
18
|
+
d(r), c(!1), b(window.scrollY);
|
|
19
|
+
}, [r]), /* @__PURE__ */ _(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: t["context-menu__wrapper"],
|
|
23
|
+
style: {
|
|
24
|
+
transform: `translate(${((l == null ? void 0 : l.xPos) ?? 0) - (i.current ? i.current.getBoundingClientRect().width : 0)}px, ${l.yPos + x}px)`
|
|
25
|
+
},
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ e("button", { onClick: () => c((s) => !s), className: t["context-menu__button"], children: /* @__PURE__ */ e(f, { name: "CheveronDown", size: 16 }) }),
|
|
28
|
+
/* @__PURE__ */ _("ul", { ref: i, className: C(t["context-menu"], a && t["context-menu--open"]), children: [
|
|
29
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: () => o("insertRowAbove"), className: t["context-menu__item"], children: n.table.insertRowAbove }) }),
|
|
30
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: () => o("insertRowBelow"), className: t["context-menu__item"], children: n.table.insertRowBelow }) }),
|
|
31
|
+
/* @__PURE__ */ e("li", { className: t["context-menu__item-divider"], children: /* @__PURE__ */ e("button", { onClick: () => o("deleteRow"), className: t["context-menu__item"], children: n.table.deleteRow }) }),
|
|
32
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: () => o("insertColumnLeft"), className: t["context-menu__item"], children: n.table.insertColumnLeft }) }),
|
|
33
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: () => o("insertColumnRight"), className: t["context-menu__item"], children: n.table.insertColumnRight }) }),
|
|
34
|
+
/* @__PURE__ */ e("li", { className: t["context-menu__item-divider"], children: /* @__PURE__ */ e("button", { onClick: () => o("deleteColumn"), className: t["context-menu__item"], children: n.table.deleteColumn }) }),
|
|
35
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("button", { onClick: () => o("deleteTable"), className: t["context-menu__item"], children: n.table.deleteTable }) })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
v as TableCellContextMenu
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=TableCellContextMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCellContextMenu.js","sources":["../../../../../../src/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport type { Position } from 'components/RteEditor/Plugins/ToolbarPlugin';\n\nimport styles from './TableCellContextMenu.module.css';\n\nimport { Icon } from 'components/Icon';\nimport { useTranslation } from 'components/RteEditor/hooks/useTranslation';\n\nexport type Actions =\n | 'insertRowAbove'\n | 'insertRowBelow'\n | 'deleteRow'\n | 'deleteTable'\n | 'insertColumnLeft'\n | 'insertColumnRight'\n | 'deleteColumn';\ninterface TableCellContextMenuProps {\n position: Position;\n onAction: (action: Actions) => void;\n}\n\nexport const TableCellContextMenu = ({ position, onAction }: TableCellContextMenuProps) => {\n const t = useTranslation();\n const [isOpen, setIsOpen] = useState(false);\n const [localPosition, setLocalPosition] = useState<Position>({ xPos: 0, yPos: 0 });\n const menuRef = useRef<HTMLUListElement>(null);\n const [scrollTopPosition, setScrollTopPosition] = useState(0);\n\n const handleAction = (action: Actions) => {\n onAction(action);\n setIsOpen(false);\n };\n\n useEffect(() => {\n setLocalPosition(position);\n setIsOpen(false);\n setScrollTopPosition(window.scrollY);\n }, [position]);\n\n return (\n <div\n className={styles['context-menu__wrapper']}\n style={{\n transform: `translate(${(localPosition?.xPos ?? 0) - (menuRef.current ? menuRef.current.getBoundingClientRect().width : 0)}px, ${localPosition.yPos + scrollTopPosition}px)`,\n }}\n >\n <button onClick={() => setIsOpen((prev) => !prev)} className={styles['context-menu__button']}>\n <Icon name=\"CheveronDown\" size={16} />\n </button>\n <ul ref={menuRef} className={clsx(styles['context-menu'], isOpen && styles['context-menu--open'])}>\n <li>\n <button onClick={() => handleAction('insertRowAbove')} className={styles['context-menu__item']}>\n {t.table.insertRowAbove}\n </button>\n </li>\n <li>\n <button onClick={() => handleAction('insertRowBelow')} className={styles['context-menu__item']}>\n {t.table.insertRowBelow}\n </button>\n </li>\n <li className={styles['context-menu__item-divider']}>\n <button onClick={() => handleAction('deleteRow')} className={styles['context-menu__item']}>\n {t.table.deleteRow}\n </button>\n </li>\n\n <li>\n <button onClick={() => handleAction('insertColumnLeft')} className={styles['context-menu__item']}>\n {t.table.insertColumnLeft}\n </button>\n </li>\n <li>\n <button onClick={() => handleAction('insertColumnRight')} className={styles['context-menu__item']}>\n {t.table.insertColumnRight}\n </button>\n </li>\n <li className={styles['context-menu__item-divider']}>\n <button onClick={() => handleAction('deleteColumn')} className={styles['context-menu__item']}>\n {t.table.deleteColumn}\n </button>\n </li>\n\n <li>\n <button onClick={() => handleAction('deleteTable')} className={styles['context-menu__item']}>\n {t.table.deleteTable}\n </button>\n </li>\n </ul>\n </div>\n );\n};\n"],"names":["TableCellContextMenu","position","onAction","t","useTranslation","isOpen","setIsOpen","useState","localPosition","setLocalPosition","menuRef","useRef","scrollTopPosition","setScrollTopPosition","handleAction","action","useEffect","jsxs","styles","jsx","prev","Icon","clsx"],"mappings":";;;;;;;;;;;;GAuBaA,IAAuB,CAAC,EAAE,UAAAC,GAAU,UAAAC,QAA0C;AACzF,QAAMC,IAAIC,KACJ,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC,CAACC,GAAeC,CAAgB,IAAIF,EAAmB,EAAE,MAAM,GAAG,MAAM,EAAA,CAAG,GAC3EG,IAAUC,EAAyB,IAAI,GACvC,CAACC,GAAmBC,CAAoB,IAAIN,EAAS,CAAC,GAEtDO,IAAe,CAACC,MAAoB;AACxC,IAAAb,EAASa,CAAM,GACfT,EAAU,EAAK;AAAA,EAAA;AAGjB,SAAAU,EAAU,MAAM;AACd,IAAAP,EAAiBR,CAAQ,GACzBK,EAAU,EAAK,GACfO,EAAqB,OAAO,OAAO;AAAA,EAAA,GAClC,CAACZ,CAAQ,CAAC,GAGX,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAO,uBAAuB;AAAA,MACzC,OAAO;AAAA,QACL,WAAW,eAAcV,KAAA,gBAAAA,EAAe,SAAQ,MAAME,EAAQ,UAAUA,EAAQ,QAAQ,wBAAwB,QAAQ,EAAE,OAAOF,EAAc,OAAOI,CAAiB;AAAA,MACzK;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAO,EAAC,YAAO,SAAS,MAAMb,EAAU,CAACc,MAAS,CAACA,CAAI,GAAG,WAAWF,EAAO,sBAAsB,GACzF,UAAC,gBAAAC,EAAAE,GAAA,EAAK,MAAK,gBAAe,MAAM,GAAI,CAAA,GACtC;AAAA,QACC,gBAAAJ,EAAA,MAAA,EAAG,KAAKP,GAAS,WAAWY,EAAKJ,EAAO,cAAc,GAAGb,KAAUa,EAAO,oBAAoB,CAAC,GAC9F,UAAA;AAAA,UAAA,gBAAAC,EAAC,MACC,EAAA,UAAA,gBAAAA,EAAC,UAAO,EAAA,SAAS,MAAML,EAAa,gBAAgB,GAAG,WAAWI,EAAO,oBAAoB,GAC1F,UAAEf,EAAA,MAAM,eACX,CAAA,GACF;AAAA,4BACC,MACC,EAAA,UAAA,gBAAAgB,EAAC,UAAO,EAAA,SAAS,MAAML,EAAa,gBAAgB,GAAG,WAAWI,EAAO,oBAAoB,GAC1F,UAAEf,EAAA,MAAM,eACX,CAAA,GACF;AAAA,UACA,gBAAAgB,EAAC,QAAG,WAAWD,EAAO,4BAA4B,GAChD,UAAA,gBAAAC,EAAC,YAAO,SAAS,MAAML,EAAa,WAAW,GAAG,WAAWI,EAAO,oBAAoB,GACrF,UAAEf,EAAA,MAAM,UACX,CAAA,GACF;AAAA,4BAEC,MACC,EAAA,UAAA,gBAAAgB,EAAC,UAAO,EAAA,SAAS,MAAML,EAAa,kBAAkB,GAAG,WAAWI,EAAO,oBAAoB,GAC5F,UAAEf,EAAA,MAAM,iBACX,CAAA,GACF;AAAA,4BACC,MACC,EAAA,UAAA,gBAAAgB,EAAC,UAAO,EAAA,SAAS,MAAML,EAAa,mBAAmB,GAAG,WAAWI,EAAO,oBAAoB,GAC7F,UAAEf,EAAA,MAAM,kBACX,CAAA,GACF;AAAA,UACA,gBAAAgB,EAAC,QAAG,WAAWD,EAAO,4BAA4B,GAChD,UAAA,gBAAAC,EAAC,YAAO,SAAS,MAAML,EAAa,cAAc,GAAG,WAAWI,EAAO,oBAAoB,GACxF,UAAEf,EAAA,MAAM,aACX,CAAA,GACF;AAAA,4BAEC,MACC,EAAA,UAAA,gBAAAgB,EAAC,UAAO,EAAA,SAAS,MAAML,EAAa,aAAa,GAAG,WAAWI,EAAO,oBAAoB,GACvF,UAAEf,EAAA,MAAM,YACX,CAAA,GACF;AAAA,QAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TableCellContextMenu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Actions } from './TableCellContextMenu';
|
|
2
|
+
interface TablePluginProps {
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface TableMutation {
|
|
6
|
+
mutateTable: (type: Actions) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const TablePlugin: import('react').ForwardRefExoticComponent<TablePluginProps & import('react').RefAttributes<unknown>>;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../../../
|
|
2
|
+
import "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
3
|
import "../../../../clsx-OuTLNxxd.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../../../helpers-BewZrn6E.js";
|
|
5
|
+
import "../../../../Lexical.prod-CO0gPAfo.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import "../../../../
|
|
7
|
+
import { T as A } from "../../../../TablePlugin-1L5UZfDH.js";
|
|
7
8
|
import "../../hooks/useFlyout.js";
|
|
8
9
|
import "../../../Icon/Icon.js";
|
|
9
10
|
import "../../../Buttons/Button.js";
|
|
@@ -18,12 +19,13 @@ import "../../../IconButton/IconButton.js";
|
|
|
18
19
|
import "../../../Input/Input.js";
|
|
19
20
|
import "../../../InputField/InputField.js";
|
|
20
21
|
import "react-router-dom";
|
|
21
|
-
import "../../../../RteEditor.module-
|
|
22
|
+
import "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
23
|
+
import "../../Providers/LanguageProvider.js";
|
|
22
24
|
import "../../../SelectListbox/SelectListbox.js";
|
|
23
25
|
import "../../../SelectListbox/SelectProvider.js";
|
|
24
26
|
import "../../../Sortable/components/SortableItem.js";
|
|
25
|
-
import "../../../../SortableProvider-
|
|
27
|
+
import "../../../../SortableProvider-i4PDjRS_.js";
|
|
26
28
|
export {
|
|
27
|
-
|
|
29
|
+
A as TablePlugin
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=TablePlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TablePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TablePlugin.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ElementNode } from 'lexical';
|
|
2
|
+
export declare const createTable: (nrOfRows: number, nrOfColumns: number) => ElementNode;
|
|
3
|
+
export declare const deleteRow: (selectedNode: ElementNode) => void;
|
|
4
|
+
export declare const deleteTable: (selectedNode: ElementNode) => void;
|
|
5
|
+
export declare const insertRow: (selectedNode: ElementNode, position: "insertRowAbove" | "insertRowBelow") => void;
|
|
6
|
+
export declare const insertColumn: (selectedNode: ElementNode, position: "insertColumnLeft" | "insertColumnRight") => void;
|
|
7
|
+
export declare const deleteColumn: (selectedNode: ElementNode) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { e as s, a as l, b as t, d as o, i as r, c as d } from "../../../../helpers-BewZrn6E.js";
|
|
2
|
+
export {
|
|
3
|
+
s as createTable,
|
|
4
|
+
l as deleteColumn,
|
|
5
|
+
t as deleteRow,
|
|
6
|
+
o as deleteTable,
|
|
7
|
+
r as insertColumn,
|
|
8
|
+
d as insertRow
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { T as
|
|
1
|
+
import { T as o } from "../../../../TablePlugin-1L5UZfDH.js";
|
|
2
|
+
import { TableCellContextMenu as t } from "./TableCellContextMenu/TableCellContextMenu.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
t as TableCellContextMenu,
|
|
5
|
+
o as TablePlugin
|
|
4
6
|
};
|
|
5
7
|
//# 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":";;"}
|
|
@@ -1,47 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as N, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { u as x } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
|
|
3
|
+
import { I as C, m as R } from "../../../../Lexical.prod-CO0gPAfo.js";
|
|
4
|
+
import { useState as o, useRef as v, useCallback as A, useEffect as F } from "react";
|
|
5
|
+
import { n as S } from "../../../../helpers-BewZrn6E.js";
|
|
6
|
+
import { g as f } from "../../../../helpers-Ec7CfNnA.js";
|
|
7
|
+
import { BlockFormatPlugin as U } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
8
|
+
import { ListPlugin as _ } from "../ListPlugin/ListPlugin.js";
|
|
9
|
+
import { LinkPlugin as j } from "../LinkPlugin/LinkPlugin.js";
|
|
10
|
+
import { HistoryPlugin as E } from "../HistoryPlugin/HistoryPlugin.js";
|
|
11
|
+
import { T as K } from "../../../../TablePlugin-1L5UZfDH.js";
|
|
12
|
+
import { TableCellContextMenu as M } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
|
|
13
|
+
import { s as O } from "../../../../RteEditor.module-Dz9a8vaK.js";
|
|
14
|
+
const w = (s, l) => {
|
|
15
|
+
let e = s;
|
|
16
|
+
for (; e !== null; ) {
|
|
17
|
+
if (S(e) && l) {
|
|
18
|
+
const r = l.getElementByKey(e.getKey());
|
|
19
|
+
if (r) {
|
|
20
|
+
const a = r.getBoundingClientRect();
|
|
21
|
+
return { xPos: a.right, yPos: a.bottom };
|
|
22
|
+
} else
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
e = e.getParent();
|
|
19
26
|
}
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
const [
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
t
|
|
26
|
-
|
|
27
|
-
c(n(a, "ul")), d(n(a, "ol")), L(n(a, "a"));
|
|
27
|
+
return null;
|
|
28
|
+
}, tt = () => {
|
|
29
|
+
const [s] = x(), [l, e] = o(!1), [r, a] = o(!1), [d, p] = o(!1), [b, h] = o(!1), [I, L] = o({ active: !1, url: "", target: "_self" }), [P, T] = o(!1), [m, B] = o(null), u = v(null), g = A(() => {
|
|
30
|
+
const t = C();
|
|
31
|
+
if (R(t)) {
|
|
32
|
+
const i = t.anchor, c = i.getNode(), y = t.focus;
|
|
33
|
+
e(t.hasFormat("bold")), a(t.hasFormat("italic")), p(f(c, "ul")), h(f(c, "ol")), T(Math.abs(i.offset - y.offset) !== 0), L(f(c, "a")), B(w(c, s));
|
|
28
34
|
}
|
|
29
|
-
}, [])
|
|
30
|
-
|
|
31
|
-
i.
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
}, [s]), k = (t) => {
|
|
36
|
+
var i;
|
|
37
|
+
(i = u.current) == null || i.mutateTable(t);
|
|
38
|
+
};
|
|
39
|
+
return F(() => {
|
|
40
|
+
s.registerUpdateListener(({ editorState: t }) => {
|
|
41
|
+
t.read(() => {
|
|
42
|
+
g();
|
|
34
43
|
});
|
|
35
44
|
});
|
|
36
|
-
}, [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
45
|
+
}, [s, g]), /* @__PURE__ */ N("div", { className: O.editor__toolbar, children: [
|
|
46
|
+
/* @__PURE__ */ n(U, { isBold: l, isItalic: r }),
|
|
47
|
+
/* @__PURE__ */ n(_, { isUList: d, isOList: b }),
|
|
48
|
+
/* @__PURE__ */ n(K, { isActive: !!m, ref: u }),
|
|
49
|
+
m && /* @__PURE__ */ n(M, { position: m, onAction: k }),
|
|
50
|
+
/* @__PURE__ */ n(j, { isLink: I, isLinkable: P }),
|
|
51
|
+
/* @__PURE__ */ n(E, {})
|
|
42
52
|
] });
|
|
43
53
|
};
|
|
44
54
|
export {
|
|
45
|
-
|
|
55
|
+
tt as ToolBarPlugin
|
|
46
56
|
};
|
|
47
57
|
//# sourceMappingURL=ToolbarPlugin.js.map
|