@uva-glass/component-library 1.51.0 → 1.52.1
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-DSsdOWxu.js → Lexical.prod-zUeT_jIr.js} +253 -246
- package/dist/Lexical.prod-zUeT_jIr.js.map +1 -0
- package/dist/LexicalUtils.prod-DtRifALg.js +64 -0
- package/dist/LexicalUtils.prod-DtRifALg.js.map +1 -0
- package/dist/ListPlugin-CxyYg2bv.js +588 -0
- package/dist/ListPlugin-CxyYg2bv.js.map +1 -0
- package/dist/RteEditor.module--4R0Ql6Y.js +26 -0
- package/dist/RteEditor.module--4R0Ql6Y.js.map +1 -0
- package/dist/assets/HorizontalList.css +1 -1
- package/dist/assets/RteEditor.css +1 -1
- package/dist/assets/useFlyout.css +1 -0
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.stories.js.map +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +5 -5
- package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +10 -10
- package/dist/components/Buttons/MenuButton.stories.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.d.ts +3 -2
- package/dist/components/HorizontalList/HorizontalList.js +10 -9
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.stories.d.ts +1 -0
- package/dist/components/HorizontalList/HorizontalList.stories.js +35 -14
- package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +6 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +98 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +8 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.d.ts +1 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +5 -0
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js.map +1 -0
- 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/ToolbarPlugin/ToolbarPlugin.d.ts +6 -0
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +33 -28
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +532 -457
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +1 -1
- package/dist/components/RteEditor/RteEditor.stories.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/index.d.ts +1 -0
- package/dist/components/RteEditor/hooks/index.js +5 -0
- package/dist/components/RteEditor/hooks/index.js.map +1 -0
- package/dist/components/RteEditor/hooks/useFlyout.d.ts +12 -0
- package/dist/components/RteEditor/hooks/useFlyout.js +45 -0
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -0
- package/dist/helpers-DpGAANJ8.js +365 -0
- package/dist/helpers-DpGAANJ8.js.map +1 -0
- package/package.json +15 -15
- package/dist/Lexical.prod-DSsdOWxu.js.map +0 -1
- package/dist/ListPlugin-Bu2AbCDB.js +0 -643
- package/dist/ListPlugin-Bu2AbCDB.js.map +0 -1
- package/dist/RteEditor.module-RkKUrkOO.js +0 -21
- package/dist/RteEditor.module-RkKUrkOO.js.map +0 -1
|
@@ -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-zUeT_jIr.js";
|
|
3
|
+
import { L as a } from "../../../../ListPlugin-CxyYg2bv.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--4R0Ql6Y.js";
|
|
8
8
|
export {
|
|
9
9
|
a as ListPlugin
|
|
10
10
|
};
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { u as I, I as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as _, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { u as I, I as k, m as N } from "../../../../Lexical.prod-zUeT_jIr.js";
|
|
3
|
+
import { useState as r, useCallback as P, useEffect as b } from "react";
|
|
4
|
+
import { L as B, H as h } from "../../../../ListPlugin-CxyYg2bv.js";
|
|
5
|
+
import { g as v } from "../../../../helpers-DpGAANJ8.js";
|
|
6
|
+
import { LinkPlugin as x } from "../LinkPlugin/LinkPlugin.js";
|
|
7
|
+
import { BlockFormatPlugin as F } from "../BlockFormatPlugin/BlockFormatPlugin.js";
|
|
8
|
+
import { s as U } from "../../../../RteEditor.module--4R0Ql6Y.js";
|
|
9
|
+
const n = (o, s) => {
|
|
10
|
+
let t = o, i;
|
|
11
|
+
for (; t !== null; ) {
|
|
12
|
+
if (s === "a" && v(t))
|
|
13
|
+
return { active: !0, url: t.__url, target: t.__target ? t.__target : "_self" };
|
|
14
|
+
if ((s === "ul" || s === "ol") && h(t))
|
|
15
|
+
return i = t.getTag(), i === s;
|
|
16
|
+
t = t.getParent();
|
|
17
|
+
}
|
|
18
|
+
return !1;
|
|
19
|
+
}, T = () => {
|
|
20
|
+
const [o] = I(), [s, t] = r(!1), [i, c] = r(!1), [m, u] = r(!1), [d, g] = r(!1), [p, L] = r({ active: !1, url: "", target: "_self" }), f = P(() => {
|
|
21
|
+
const e = k();
|
|
22
|
+
if (N(e)) {
|
|
23
|
+
t(e.hasFormat("bold")), c(e.hasFormat("italic"));
|
|
24
|
+
const l = e.anchor.getNode();
|
|
25
|
+
u(n(l, "ul")), g(n(l, "ol")), L(n(l, "a"));
|
|
22
26
|
}
|
|
23
27
|
}, []);
|
|
24
28
|
return b(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
o.registerUpdateListener(({ editorState: e }) => {
|
|
30
|
+
e.read(() => {
|
|
31
|
+
f();
|
|
28
32
|
});
|
|
29
33
|
});
|
|
30
|
-
}, [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
}, [o, f]), /* @__PURE__ */ _("div", { className: U.editor__toolbar, children: [
|
|
35
|
+
/* @__PURE__ */ a(F, { isBold: s, isItalic: i }),
|
|
36
|
+
/* @__PURE__ */ a(B, { isUList: m, isOList: d }),
|
|
37
|
+
/* @__PURE__ */ a(x, { isLink: p })
|
|
33
38
|
] });
|
|
34
39
|
};
|
|
35
40
|
export {
|
|
36
|
-
|
|
41
|
+
T as ToolBarPlugin
|
|
37
42
|
};
|
|
38
43
|
//# 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';\n\nimport type { ElementNode, TextNode } from 'lexical';\n\nimport { BlockFormatPlugin, ListPlugin } from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\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(false);\n const [isOList, setIsOList] = useState(false);\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
|
|
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 } from 'components/RteEditor/Plugins/LinkPlugin';\nimport { BlockFormatPlugin, ListPlugin } 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 </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"],"mappings":";;;;;;;;AAmBA,MAAMA,IAAa,CAACC,GAAoCC,MAA2C;AACjG,MAAIC,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,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,EAC9B,EAAA,CAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolBarPlugin as l } from "./ToolbarPlugin/ToolbarPlugin.js";
|
|
2
2
|
import { BlockFormatPlugin as i } from "./BlockFormatPlugin/BlockFormatPlugin.js";
|
|
3
|
-
import { L as a } from "../../../ListPlugin-
|
|
3
|
+
import { L as a } from "../../../ListPlugin-CxyYg2bv.js";
|
|
4
4
|
export {
|
|
5
5
|
i as BlockFormatPlugin,
|
|
6
6
|
a as ListPlugin,
|