@uva-glass/component-library 1.62.8 → 1.62.9

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.
Files changed (44) hide show
  1. package/dist/TablePlugin-DQR5VWGq.js +301 -0
  2. package/dist/TablePlugin-DQR5VWGq.js.map +1 -0
  3. package/dist/assets/favicon/android-chrome-192x192.png +0 -0
  4. package/dist/assets/favicon/android-chrome-512x512.png +0 -0
  5. package/dist/assets/favicon/apple-touch-icon.png +0 -0
  6. package/dist/assets/favicon/favicon-16x16.png +0 -0
  7. package/dist/assets/favicon/favicon-32x32.png +0 -0
  8. package/dist/assets/favicon/favicon.ico +0 -0
  9. package/dist/assets/favicon/favicon.svg +27 -0
  10. package/dist/assets/favicon/site.webmanifest +19 -0
  11. package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
  12. package/dist/components/FormInput/FormInput.js +1 -1
  13. package/dist/components/InputField/InputField.stories.js +1 -1
  14. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  15. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  16. package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
  17. package/dist/components/MultiSelect/index.js +1 -1
  18. package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
  19. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
  20. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
  21. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -1
  22. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +1 -1
  23. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -1
  24. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
  25. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +2 -2
  26. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +7 -6
  27. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
  28. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  29. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +50 -37
  30. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/index.js +1 -1
  32. package/dist/components/RteEditor/RteEditor.d.ts +1 -1
  33. package/dist/components/RteEditor/RteEditor.js +96 -94
  34. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  35. package/dist/components/RteEditor/RteEditor.stories.js +1 -1
  36. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  37. package/dist/components/index.js +1 -1
  38. package/dist/{helpers-pUTvcL4e.js → helpers-CVB_4CnL.js} +70 -68
  39. package/dist/helpers-CVB_4CnL.js.map +1 -0
  40. package/dist/index.js +1 -1
  41. package/package.json +5 -5
  42. package/dist/TablePlugin-B-yAWpsC.js +0 -310
  43. package/dist/TablePlugin-B-yAWpsC.js.map +0 -1
  44. package/dist/helpers-pUTvcL4e.js.map +0 -1
@@ -1,53 +1,66 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import { u as h } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
3
- import { M as d, v as b } from "../../../../Lexical.prod-B6kL_nwF.js";
4
- import { useState as P, useRef as T, useCallback as y, useEffect as x } from "react";
5
- import { g as B } from "../../../../helpers-pUTvcL4e.js";
6
- import { BlockFormatPlugin as C } from "../BlockFormatPlugin/BlockFormatPlugin.js";
7
- import { L as v } from "../../../../ListPlugin-CpLcVKRP.js";
8
- import { LinkPlugin as L } from "../LinkPlugin/LinkPlugin.js";
9
- import { HistoryPlugin as N } from "../HistoryPlugin/HistoryPlugin.js";
10
- import { T as k } from "../../../../TablePlugin-B-yAWpsC.js";
11
- import { TableCellContextMenu as A } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
12
- import { s as M } from "../../../../RteEditor.module-CHbWzGpE.js";
13
- const D = ({ editorScrollPosition: u }) => {
14
- const [e] = h(), [r, s] = P(null), l = T(null), a = y(() => {
15
- const o = d();
16
- if (b(o)) {
17
- const g = o.anchor.getNode(), m = B(g);
18
- if (m) {
19
- const c = e.getElementByKey(m.getKey()), n = c ? c.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };
20
- s({ xPos: n.right, yPos: n.bottom, height: n.height });
1
+ import { jsxs as v, jsx as n } from "react/jsx-runtime";
2
+ import { u as P } from "../../../../LexicalComposerContext.prod-Dyvim1tK.js";
3
+ import { M as u, v as f, E as w } from "../../../../Lexical.prod-B6kL_nwF.js";
4
+ import { useState as E, useRef as L, useCallback as C, useEffect as g } from "react";
5
+ import { g as h } from "../../../../helpers-CVB_4CnL.js";
6
+ import { BlockFormatPlugin as T } from "../BlockFormatPlugin/BlockFormatPlugin.js";
7
+ import { L as y } from "../../../../ListPlugin-CpLcVKRP.js";
8
+ import { LinkPlugin as N } from "../LinkPlugin/LinkPlugin.js";
9
+ import { HistoryPlugin as x } from "../HistoryPlugin/HistoryPlugin.js";
10
+ import { T as B } from "../../../../TablePlugin-DQR5VWGq.js";
11
+ import { TableCellContextMenu as k } from "../TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
12
+ import { s as z } from "../../../../RteEditor.module-CHbWzGpE.js";
13
+ const G = ({ editorScrollPosition: p }) => {
14
+ const [e] = P(), [i, s] = E(null), c = L(null), m = C(() => {
15
+ const o = u();
16
+ if (f(o)) {
17
+ const d = o.anchor.getNode(), r = h(d);
18
+ if (r) {
19
+ const l = e.getElementByKey(r.getKey()), a = l ? l.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };
20
+ s({ xPos: a.right, yPos: a.bottom, height: a.height });
21
21
  } else
22
22
  s(null);
23
23
  }
24
- }, [e]), f = (o) => {
25
- var i;
26
- (i = l.current) == null || i.mutateTable(o);
24
+ }, [e]), b = (o) => {
25
+ var t;
26
+ (t = c.current) == null || t.mutateTable(o);
27
27
  };
28
- return x(() => {
28
+ return g(() => {
29
29
  e.registerUpdateListener(({ editorState: o }) => {
30
30
  o.read(() => {
31
- a();
31
+ m();
32
32
  });
33
33
  });
34
- }, [e, a]), /* @__PURE__ */ p("div", { className: M.editor__toolbar, children: [
35
- /* @__PURE__ */ t(C, {}),
36
- /* @__PURE__ */ t(v, {}),
37
- /* @__PURE__ */ t(k, { isActive: !!r, ref: l }),
38
- r && /* @__PURE__ */ t(
39
- A,
34
+ }, [e, m]), g(() => {
35
+ const o = () => {
36
+ e.update(() => {
37
+ const t = u();
38
+ if (f(t)) {
39
+ const r = t.anchor.getNode();
40
+ h(r) && (w(null), s(null));
41
+ }
42
+ });
43
+ };
44
+ return window.addEventListener("scroll", o), window.addEventListener("resize", o), () => {
45
+ window.removeEventListener("scroll", o), window.removeEventListener("resize", o);
46
+ };
47
+ }, [e]), /* @__PURE__ */ v("div", { className: z.editor__toolbar, children: [
48
+ /* @__PURE__ */ n(T, {}),
49
+ /* @__PURE__ */ n(y, {}),
50
+ /* @__PURE__ */ n(B, { isActive: !!i, ref: c }),
51
+ i && /* @__PURE__ */ n(
52
+ k,
40
53
  {
41
- position: r,
42
- parentScrollPosition: u,
43
- onAction: f
54
+ position: i,
55
+ parentScrollPosition: p,
56
+ onAction: b
44
57
  }
45
58
  ),
46
- /* @__PURE__ */ t(L, {}),
47
- /* @__PURE__ */ t(N, {})
59
+ /* @__PURE__ */ n(N, {}),
60
+ /* @__PURE__ */ n(x, {})
48
61
  ] });
49
62
  };
50
63
  export {
51
- D as ToolBarPlugin
64
+ G as ToolBarPlugin
52
65
  };
53
66
  //# 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, useRef, useState } from 'react';\nimport { $getTableCellNodeFromLexicalNode } from '@lexical/table';\n\nimport type { Actions } from 'components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu';\nimport type { TableMutation } from 'components/RteEditor/Plugins/TablePlugin/TablePlugin';\n\nimport {\n LinkPlugin,\n BlockFormatPlugin,\n ListPlugin,\n HistoryPlugin,\n TablePlugin,\n TableCellContextMenu,\n} from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type Position = {\n xPos: number;\n yPos: number;\n height: number;\n};\n\ninterface ToolBarProps {\n editorScrollPosition: number;\n}\n\nexport const ToolBarPlugin = ({ editorScrollPosition }: ToolBarProps): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [position, setPosition] = useState<Position | null>(null);\n const tableref = useRef<TableMutation>(null);\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (tableCell) {\n const domNode = editor.getElementByKey(tableCell.getKey());\n const position = domNode ? domNode.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };\n setPosition({ xPos: position.right, yPos: position.bottom, height: position.height });\n } else {\n setPosition(null);\n }\n }\n }, [editor]);\n\n const handleTableAction = (action: Actions) => {\n tableref.current?.mutateTable(action);\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 />\n <ListPlugin />\n <TablePlugin isActive={Boolean(position)} ref={tableref} />\n {position && (\n <TableCellContextMenu\n position={position}\n parentScrollPosition={editorScrollPosition}\n onAction={handleTableAction}\n />\n )}\n <LinkPlugin />\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["ToolBarPlugin","editorScrollPosition","editor","useLexicalComposerContext","position","setPosition","useState","tableref","useRef","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","anchorNode","tableCell","$getTableCellNodeFromLexicalNode","domNode","handleTableAction","action","_a","useEffect","editorState","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","TablePlugin","TableCellContextMenu","LinkPlugin","HistoryPlugin"],"mappings":";;;;;;;;;;;;AA4BO,MAAMA,IAAgB,CAAC,EAAE,sBAAAC,QAAsD;AAC9E,QAAA,CAACC,CAAM,IAAIC,KACX,CAACC,GAAUC,CAAW,IAAIC,EAA0B,IAAI,GACxDC,IAAWC,EAAsB,IAAI,GAErCC,IAAgBC,EAAY,MAAM;AACtC,UAAMC,IAAYC;AACd,QAAAC,EAAkBF,CAAS,GAAG;AAE1B,YAAAG,IADSH,EAAU,OACC,WAEpBI,IAAYC,EAAiCF,CAAU;AAC7D,UAAIC,GAAW;AACb,cAAME,IAAUf,EAAO,gBAAgBa,EAAU,OAAQ,CAAA,GACnDX,IAAWa,IAAUA,EAAQ,sBAAsB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,EAAE;AAClF,QAAAZ,EAAA,EAAE,MAAMD,EAAS,OAAO,MAAMA,EAAS,QAAQ,QAAQA,EAAS,OAAQ,CAAA;AAAA,MAAA;AAEpF,QAAAC,EAAY,IAAI;AAAA,IAEpB;AAAA,EAAA,GACC,CAACH,CAAM,CAAC,GAELgB,IAAoB,CAACC,MAAoB;;AACpC,KAAAC,IAAAb,EAAA,YAAA,QAAAa,EAAS,YAAYD;AAAA,EAAM;AAGtC,SAAAE,EAAU,MAAM;AACd,IAAAnB,EAAO,uBAAuB,CAAC,EAAE,aAAAoB,QAAkB;AACjD,MAAAA,EAAY,KAAK,MAAM;AACP,QAAAb;MAAA,CACf;AAAA,IAAA,CACF;AAAA,EAAA,GACA,CAACP,GAAQO,CAAa,CAAC,GAGvB,gBAAAc,EAAA,OAAA,EAAI,WAAWC,EAAO,iBACrB,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAkB,EAAA;AAAA,sBAClBC,GAAW,EAAA;AAAA,sBACXC,GAAY,EAAA,UAAU,EAAQxB,GAAW,KAAKG,GAAU;AAAA,IACxDH,KACC,gBAAAqB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,UAAAzB;AAAA,QACA,sBAAsBH;AAAA,QACtB,UAAUiB;AAAA,MAAA;AAAA,IACZ;AAAA,sBAEDY,GAAW,EAAA;AAAA,sBACXC,GAAc,EAAA;AAAA,EACjB,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"ToolbarPlugin.js","sources":["../../../../../src/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\nimport { $getSelection, $isRangeSelection, $setSelection } from 'lexical';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { $getTableCellNodeFromLexicalNode } from '@lexical/table';\n\nimport type { Actions } from 'components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu';\nimport type { TableMutation } from 'components/RteEditor/Plugins/TablePlugin/TablePlugin';\n\nimport {\n LinkPlugin,\n BlockFormatPlugin,\n ListPlugin,\n HistoryPlugin,\n TablePlugin,\n TableCellContextMenu,\n} from 'components/RteEditor/Plugins';\nimport styles from 'components/RteEditor/RteEditor.module.css';\n\nexport type Position = {\n xPos: number;\n yPos: number;\n height: number;\n};\n\ninterface ToolBarProps {\n editorScrollPosition: number;\n}\n\nexport const ToolBarPlugin = ({ editorScrollPosition }: ToolBarProps): JSX.Element => {\n const [editor] = useLexicalComposerContext();\n const [position, setPosition] = useState<Position | null>(null);\n const tableref = useRef<TableMutation>(null);\n\n const updateToolbar = useCallback(() => {\n const selection = $getSelection();\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (tableCell) {\n const domNode = editor.getElementByKey(tableCell.getKey());\n const position = domNode ? domNode.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };\n setPosition({ xPos: position.right, yPos: position.bottom, height: position.height });\n } else {\n setPosition(null);\n }\n }\n }, [editor]);\n\n const handleTableAction = (action: Actions) => {\n tableref.current?.mutateTable(action);\n };\n\n useEffect(() => {\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateToolbar();\n });\n });\n }, [editor, updateToolbar]);\n\n useEffect(() => {\n const handleResizeScroll = () => {\n editor.update(() => {\n const selection = $getSelection();\n\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const anchorNode = anchor.getNode();\n\n const tableCell = $getTableCellNodeFromLexicalNode(anchorNode);\n if (tableCell) {\n $setSelection(null);\n setPosition(null);\n }\n }\n });\n };\n\n window.addEventListener('scroll', handleResizeScroll);\n window.addEventListener('resize', handleResizeScroll);\n\n return () => {\n window.removeEventListener('scroll', handleResizeScroll);\n window.removeEventListener('resize', handleResizeScroll);\n };\n }, [editor]);\n\n return (\n <div className={styles['editor__toolbar']}>\n <BlockFormatPlugin />\n <ListPlugin />\n <TablePlugin isActive={Boolean(position)} ref={tableref} />\n {position && (\n <TableCellContextMenu\n position={position}\n parentScrollPosition={editorScrollPosition}\n onAction={handleTableAction}\n />\n )}\n <LinkPlugin />\n <HistoryPlugin />\n </div>\n );\n};\n"],"names":["ToolBarPlugin","editorScrollPosition","editor","useLexicalComposerContext","position","setPosition","useState","tableref","useRef","updateToolbar","useCallback","selection","$getSelection","$isRangeSelection","anchorNode","tableCell","$getTableCellNodeFromLexicalNode","domNode","handleTableAction","action","_a","useEffect","editorState","handleResizeScroll","$setSelection","jsxs","styles","jsx","BlockFormatPlugin","ListPlugin","TablePlugin","TableCellContextMenu","LinkPlugin","HistoryPlugin"],"mappings":";;;;;;;;;;;;AA4BO,MAAMA,IAAgB,CAAC,EAAE,sBAAAC,QAAsD;AAC9E,QAAA,CAACC,CAAM,IAAIC,KACX,CAACC,GAAUC,CAAW,IAAIC,EAA0B,IAAI,GACxDC,IAAWC,EAAsB,IAAI,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CAACrB,CAAM,CAAC,GAGR,gBAAAuB,EAAA,OAAA,EAAI,WAAWC,EAAO,iBACrB,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAkB,EAAA;AAAA,sBAClBC,GAAW,EAAA;AAAA,sBACXC,GAAY,EAAA,UAAU,EAAQ1B,GAAW,KAAKG,GAAU;AAAA,IACxDH,KACC,gBAAAuB;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,UAAA3B;AAAA,QACA,sBAAsBH;AAAA,QACtB,UAAUiB;AAAA,MAAA;AAAA,IACZ;AAAA,sBAEDc,GAAW,EAAA;AAAA,sBACXC,GAAc,EAAA;AAAA,EACjB,EAAA,CAAA;AAEJ;"}
@@ -3,7 +3,7 @@ import { BlockFormatPlugin as l } from "./BlockFormatPlugin/BlockFormatPlugin.js
3
3
  import { L as n } from "../../../ListPlugin-CpLcVKRP.js";
4
4
  import { LinkPlugin as m, getLinkNodeTag as x } from "./LinkPlugin/LinkPlugin.js";
5
5
  import { HistoryPlugin as f } from "./HistoryPlugin/HistoryPlugin.js";
6
- import { T as u } from "../../../TablePlugin-B-yAWpsC.js";
6
+ import { T as u } from "../../../TablePlugin-DQR5VWGq.js";
7
7
  import { TableCellContextMenu as T } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
8
8
  export {
9
9
  l as BlockFormatPlugin,
@@ -1,5 +1,5 @@
1
1
  export interface RteEditorProps {
2
- /** current language setting for the editor labels NOT title ans label*/
2
+ /** current language setting for the editor labels NOT title ans label */
3
3
  currentLanguage?: 'NL' | 'EN';
4
4
  /** imported content to edit */
5
5
  initialValue?: string;