@uva-glass/component-library 1.62.9 → 1.62.10

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 (95) hide show
  1. package/dist/{Lexical.prod-B6kL_nwF.js → Lexical.prod-DOTdxgeo.js} +436 -435
  2. package/dist/Lexical.prod-DOTdxgeo.js.map +1 -0
  3. package/dist/LexicalLink.prod-Cqa5Im8X.js +208 -0
  4. package/dist/LexicalLink.prod-Cqa5Im8X.js.map +1 -0
  5. package/dist/LexicalList.prod-DlqzsJTH.js +564 -0
  6. package/dist/LexicalList.prod-DlqzsJTH.js.map +1 -0
  7. package/dist/LexicalTable.prod-BKz2StgB.js +1525 -0
  8. package/dist/LexicalTable.prod-BKz2StgB.js.map +1 -0
  9. package/dist/{LexicalUtils.prod-BBoyOK4A.js → LexicalUtils.prod-DlLRWqta.js} +2 -2
  10. package/dist/{LexicalUtils.prod-BBoyOK4A.js.map → LexicalUtils.prod-DlLRWqta.js.map} +1 -1
  11. package/dist/RteEditor.module-DcvGRx3a.js +21 -0
  12. package/dist/RteEditor.module-DcvGRx3a.js.map +1 -0
  13. package/dist/TablePlugin-BkczRiUz.js +303 -0
  14. package/dist/TablePlugin-BkczRiUz.js.map +1 -0
  15. package/dist/assets/Flyout.css +1 -1
  16. package/dist/assets/LinkContextMenu.css +1 -0
  17. package/dist/assets/RteEditor.css +1 -1
  18. package/dist/components/CheckboxTree/CheckboxTree.js +4 -3
  19. package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
  20. package/dist/components/FormInput/FormInput.js +8 -7
  21. package/dist/components/FormInput/FormInput.js.map +1 -1
  22. package/dist/components/Icon/icons/index.d.ts +6 -0
  23. package/dist/components/Icon/icons/index.js +46 -41
  24. package/dist/components/Icon/icons/index.js.map +1 -1
  25. package/dist/components/InputField/InputField.stories.js +4 -3
  26. package/dist/components/InputField/InputField.stories.js.map +1 -1
  27. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  28. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  29. package/dist/components/MultiSelect/components/MultiSelectHeader.js +3 -2
  30. package/dist/components/MultiSelect/components/MultiSelectHeader.js.map +1 -1
  31. package/dist/components/MultiSelect/index.js +1 -1
  32. package/dist/components/PeriodSelector/PeriodSelector.js +4 -3
  33. package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
  34. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +4 -3
  35. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
  36. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +8 -7
  37. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
  38. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  39. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +9 -8
  40. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  41. package/dist/components/RteEditor/Plugins/LinkPlugin/{AddLinkFrom.d.ts → AddLinkForm/AddLinkFrom.d.ts} +0 -1
  42. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +32 -0
  43. package/dist/components/RteEditor/Plugins/LinkPlugin/{AddLinkFrom.js.map → AddLinkForm/AddLinkFrom.js.map} +1 -1
  44. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.d.ts +11 -0
  45. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +55 -0
  46. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -0
  47. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +5 -1
  48. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +153 -126
  49. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  50. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
  51. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +69 -10
  52. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  53. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  54. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +3 -2
  55. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js.map +1 -1
  56. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +7 -5
  57. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  58. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +63 -8
  59. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
  60. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  61. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +20 -20
  62. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  63. package/dist/components/RteEditor/Plugins/index.js +5 -5
  64. package/dist/components/RteEditor/RteEditor.d.ts +2 -2
  65. package/dist/components/RteEditor/RteEditor.js +449 -442
  66. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  67. package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +3 -0
  68. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +12 -10
  69. package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
  70. package/dist/components/RteEditor/helpers.d.ts +5 -0
  71. package/dist/components/RteEditor/helpers.js +30 -0
  72. package/dist/components/RteEditor/helpers.js.map +1 -0
  73. package/dist/components/RteEditor/hooks/components/Flyout.d.ts +4 -0
  74. package/dist/components/RteEditor/hooks/components/Flyout.js +18 -10
  75. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  76. package/dist/components/RteEditor/hooks/useFlyout.d.ts +4 -0
  77. package/dist/components/RteEditor/hooks/useFlyout.js +10 -9
  78. package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
  79. package/dist/components/index.js +1 -1
  80. package/dist/helpers-CC9_diXm.js +168 -0
  81. package/dist/helpers-CC9_diXm.js.map +1 -0
  82. package/dist/index.js +1 -1
  83. package/package.json +11 -11
  84. package/dist/Lexical.prod-B6kL_nwF.js.map +0 -1
  85. package/dist/ListPlugin-CpLcVKRP.js +0 -627
  86. package/dist/ListPlugin-CpLcVKRP.js.map +0 -1
  87. package/dist/RteEditor.module-CHbWzGpE.js +0 -28
  88. package/dist/RteEditor.module-CHbWzGpE.js.map +0 -1
  89. package/dist/TablePlugin-DQR5VWGq.js +0 -301
  90. package/dist/TablePlugin-DQR5VWGq.js.map +0 -1
  91. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +0 -31
  92. package/dist/helpers-C7Yo7VY3.js +0 -367
  93. package/dist/helpers-C7Yo7VY3.js.map +0 -1
  94. package/dist/helpers-CVB_4CnL.js +0 -1580
  95. package/dist/helpers-CVB_4CnL.js.map +0 -1
@@ -1,11 +1,66 @@
1
- import { e as t, a as l, b as o, d as r, i as d, c as i } from "../../../../helpers-CVB_4CnL.js";
2
- import "../../../../Lexical.prod-B6kL_nwF.js";
1
+ import { d as S, a as h, n as d, f as C, p as w, o as m, m as D, C as p, T as E } from "../../../../LexicalTable.prod-BKz2StgB.js";
2
+ import { D as u } from "../../../../Lexical.prod-DOTdxgeo.js";
3
+ const b = 100, O = (e, n) => {
4
+ const t = S(0, 0, !1);
5
+ for (let o = 0; o < e; o++) {
6
+ const r = h();
7
+ for (let l = 0; l < n; l++) {
8
+ const s = d(0, void 0, b / n);
9
+ s.append(u()), r.append(s);
10
+ }
11
+ t.append(r);
12
+ }
13
+ return t;
14
+ }, z = (e) => {
15
+ const n = C(e), t = n.getNextSibling() || n.getPreviousSibling(), o = n.getParentOrThrow();
16
+ if (o.getChildrenSize() > 1 ? n.remove() : o.remove(), t !== null) {
17
+ const r = t.getFirstDescendant();
18
+ r && r.select();
19
+ }
20
+ }, I = (e) => {
21
+ w(e).remove();
22
+ }, F = (e, n) => {
23
+ const t = h(), o = C(e), r = o.getChildrenSize();
24
+ for (let s = 0; s < r; s++) {
25
+ const c = d(0);
26
+ c.append(u()), t.append(c);
27
+ }
28
+ n === "insertRowAbove" ? o.insertBefore(t) : o.insertAfter(t);
29
+ const l = t.getFirstDescendant();
30
+ l && l.select();
31
+ }, P = (e, n) => {
32
+ const t = C(e);
33
+ if (!m(e))
34
+ throw new Error("Selected node is not a TableCellNode");
35
+ const o = D(e), r = t.getChildren().length, l = w(e);
36
+ let s = p(e);
37
+ const c = l.getChildren(), T = c.length;
38
+ for (let i = 0; i < T; i++) {
39
+ const a = d(0);
40
+ a.append(u());
41
+ const f = c[i].getChildren()[s];
42
+ f && (n === "insertColumnLeft" ? f.insertBefore(a) : f.insertAfter(a)), c.forEach((R) => {
43
+ R.getChildren().forEach((x) => {
44
+ x.setWidth(b / r);
45
+ });
46
+ });
47
+ }
48
+ s = n === "insertColumnLeft" ? s : s + 1;
49
+ const g = c[o].getChildren()[s];
50
+ g && g.select();
51
+ }, B = (e) => {
52
+ var r;
53
+ if (!m(e))
54
+ throw new Error("Selected node is not a TableCellNode");
55
+ const n = w(e), t = ((r = n.getFirstChild()) == null ? void 0 : r.getChildrenSize()) || 0, o = p(e);
56
+ t === 1 ? I(e) : E(n, o);
57
+ };
3
58
  export {
4
- t as createTable,
5
- l as deleteColumn,
6
- o as deleteRow,
7
- r as deleteTable,
8
- d as insertColumn,
9
- i as insertRow
59
+ O as createTable,
60
+ B as deleteColumn,
61
+ z as deleteRow,
62
+ I as deleteTable,
63
+ P as insertColumn,
64
+ F as insertRow
10
65
  };
11
66
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../../../src/components/RteEditor/Plugins/TablePlugin/helpers.ts"],"sourcesContent":["import {\n $createTableNodeWithDimensions,\n $createTableRowNode,\n $createTableCellNode,\n $deleteTableColumn,\n $isTableCellNode,\n $getTableNodeFromLexicalNodeOrThrow,\n $getTableRowNodeFromTableCellNodeOrThrow,\n $getTableRowIndexFromTableCellNode,\n $getTableColumnIndexFromTableCellNode,\n} from '@lexical/table';\nimport { type TextNode, type ElementNode, $createParagraphNode } from 'lexical';\n\nimport type { TableCellNode } from '@lexical/table';\n\nconst PERCENTAGE = 100;\n\nexport const createTable = (nrOfRows: number, nrOfColumns: number): ElementNode => {\n const tableNode = $createTableNodeWithDimensions(0, 0, false);\n for (let rowIndex = 0; rowIndex < nrOfRows; rowIndex++) {\n const rowNode = $createTableRowNode();\n for (let colIndex = 0; colIndex < nrOfColumns; colIndex++) {\n const cellNode = $createTableCellNode(0, undefined, PERCENTAGE / nrOfColumns);\n cellNode.append($createParagraphNode());\n rowNode.append(cellNode);\n }\n tableNode.append(rowNode);\n }\n return tableNode;\n};\n\nexport const deleteRow = (selectedNode: ElementNode) => {\n const currentRow = $getTableRowNodeFromTableCellNodeOrThrow(selectedNode);\n const nextRow = currentRow.getNextSibling() || currentRow.getPreviousSibling();\n const currentTable = currentRow.getParentOrThrow();\n currentTable.getChildrenSize() > 1 ? currentRow.remove() : currentTable.remove();\n\n if (nextRow !== null) {\n const firstDescendant = (nextRow as ElementNode).getFirstDescendant();\n if (firstDescendant) {\n (firstDescendant as TextNode).select();\n }\n }\n};\n\nexport const deleteTable = (selectedNode: ElementNode) => {\n $getTableNodeFromLexicalNodeOrThrow(selectedNode).remove();\n};\n\nexport const insertRow = (selectedNode: ElementNode, position: 'insertRowAbove' | 'insertRowBelow') => {\n const newRow = $createTableRowNode();\n const currentRow = $getTableRowNodeFromTableCellNodeOrThrow(selectedNode);\n const nrOfCols = currentRow.getChildrenSize();\n for (let rowCount = 0; rowCount < nrOfCols; rowCount++) {\n const newCell = $createTableCellNode(0);\n newCell.append($createParagraphNode());\n newRow.append(newCell);\n }\n position === 'insertRowAbove' ? currentRow.insertBefore(newRow) : currentRow.insertAfter(newRow);\n const firstDescendant = newRow.getFirstDescendant();\n if (firstDescendant) {\n (firstDescendant as TextNode).select();\n }\n};\n\nexport const insertColumn = (selectedNode: ElementNode, position: 'insertColumnLeft' | 'insertColumnRight') => {\n const currentRow = $getTableRowNodeFromTableCellNodeOrThrow(selectedNode);\n if (!$isTableCellNode(selectedNode)) {\n throw new Error('Selected node is not a TableCellNode');\n }\n const rowIndex = $getTableRowIndexFromTableCellNode(selectedNode);\n const nrOfCols = currentRow.getChildren().length;\n const currentTable = $getTableNodeFromLexicalNodeOrThrow(selectedNode);\n let columnIndex = $getTableColumnIndexFromTableCellNode(selectedNode);\n const rowsInTable: TableCellNode[] = currentTable.getChildren();\n const nrOfRows = rowsInTable.length;\n\n for (let rowCount = 0; rowCount < nrOfRows; rowCount++) {\n const newCell = $createTableCellNode(0);\n newCell.append($createParagraphNode());\n const cellInSelectedColumn = rowsInTable[rowCount].getChildren()[columnIndex];\n if (cellInSelectedColumn) {\n if (position === 'insertColumnLeft') {\n cellInSelectedColumn.insertBefore(newCell);\n } else {\n cellInSelectedColumn.insertAfter(newCell);\n }\n }\n\n rowsInTable.forEach((row) => {\n row.getChildren().forEach((cell) => {\n (cell as TableCellNode).setWidth(PERCENTAGE / nrOfCols);\n });\n });\n }\n\n columnIndex = position === 'insertColumnLeft' ? columnIndex : columnIndex + 1;\n const firstDescendant = rowsInTable[rowIndex].getChildren()[columnIndex];\n if (firstDescendant) {\n (firstDescendant as TextNode).select();\n }\n};\n\nexport const deleteColumn = (selectedNode: ElementNode) => {\n if (!$isTableCellNode(selectedNode)) {\n throw new Error('Selected node is not a TableCellNode');\n }\n const currentTable = $getTableNodeFromLexicalNodeOrThrow(selectedNode);\n const numberOfColumns = (currentTable.getFirstChild() as ElementNode)?.getChildrenSize() || 0;\n const columnIndex = $getTableColumnIndexFromTableCellNode(selectedNode);\n\n if (numberOfColumns === 1) {\n deleteTable(selectedNode);\n } else {\n $deleteTableColumn(currentTable, columnIndex);\n }\n};\n"],"names":["PERCENTAGE","createTable","nrOfRows","nrOfColumns","tableNode","$createTableNodeWithDimensions","rowIndex","rowNode","$createTableRowNode","colIndex","cellNode","$createTableCellNode","$createParagraphNode","deleteRow","selectedNode","currentRow","$getTableRowNodeFromTableCellNodeOrThrow","nextRow","currentTable","firstDescendant","deleteTable","$getTableNodeFromLexicalNodeOrThrow","insertRow","position","newRow","nrOfCols","rowCount","newCell","insertColumn","$isTableCellNode","$getTableRowIndexFromTableCellNode","columnIndex","$getTableColumnIndexFromTableCellNode","rowsInTable","cellInSelectedColumn","row","cell","deleteColumn","numberOfColumns","_a","$deleteTableColumn"],"mappings":";;AAeA,MAAMA,IAAa,KAENC,IAAc,CAACC,GAAkBC,MAAqC;AACjF,QAAMC,IAAYC,EAA+B,GAAG,GAAG,EAAK;AAC5D,WAASC,IAAW,GAAGA,IAAWJ,GAAUI,KAAY;AACtD,UAAMC,IAAUC;AAChB,aAASC,IAAW,GAAGA,IAAWN,GAAaM,KAAY;AACzD,YAAMC,IAAWC,EAAqB,GAAG,QAAWX,IAAaG,CAAW;AACnE,MAAAO,EAAA,OAAOE,GAAsB,GACtCL,EAAQ,OAAOG,CAAQ;AAAA,IACzB;AACA,IAAAN,EAAU,OAAOG,CAAO;AAAA,EAC1B;AACO,SAAAH;AACT,GAEaS,IAAY,CAACC,MAA8B;AAChD,QAAAC,IAAaC,EAAyCF,CAAY,GAClEG,IAAUF,EAAW,eAAe,KAAKA,EAAW,mBAAmB,GACvEG,IAAeH,EAAW;AAGhC,MAFAG,EAAa,gBAAoB,IAAA,IAAIH,EAAW,WAAWG,EAAa,UAEpED,MAAY,MAAM;AACd,UAAAE,IAAmBF,EAAwB;AACjD,IAAIE,KACDA,EAA6B,OAAO;AAAA,EAEzC;AACF,GAEaC,IAAc,CAACN,MAA8B;AACpBO,EAAAA,EAAAP,CAAY,EAAE;AACpD,GAEaQ,IAAY,CAACR,GAA2BS,MAAkD;AACrG,QAAMC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,CAAW;AACvE,EAAIZ,KACDA,EAA6B,OAAO;AAEzC,GAEakB,IAAe,CAACvB,MAA8B;;AACrD,MAAA,CAACe,EAAiBf,CAAY;AAC1B,UAAA,IAAI,MAAM,sCAAsC;AAElD,QAAAI,IAAeG,EAAoCP,CAAY,GAC/DwB,MAAmBC,IAAArB,EAAa,cAAc,MAA3B,gBAAAqB,EAA8C,sBAAqB,GACtFR,IAAcC,EAAsClB,CAAY;AAEtE,EAAIwB,MAAoB,IACtBlB,EAAYN,CAAY,IAExB0B,EAAmBtB,GAAca,CAAW;AAEhD;"}
@@ -1,4 +1,4 @@
1
- import { T as o } from "../../../../TablePlugin-DQR5VWGq.js";
1
+ import { T as o } from "../../../../TablePlugin-BkczRiUz.js";
2
2
  import { TableCellContextMenu as t } from "./TableCellContextMenu/TableCellContextMenu.js";
3
3
  export {
4
4
  t as TableCellContextMenu,
@@ -1,20 +1,20 @@
1
1
  import { jsxs as v, jsx as n } from "react/jsx-runtime";
2
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";
3
+ import { M as f, v as g, E as w } from "../../../../Lexical.prod-DOTdxgeo.js";
4
+ import { useState as E, useRef as C, useCallback as L, useEffect as p } from "react";
5
+ import { g as h } from "../../../../LexicalTable.prod-BKz2StgB.js";
6
6
  import { BlockFormatPlugin as T } from "../BlockFormatPlugin/BlockFormatPlugin.js";
7
- import { L as y } from "../../../../ListPlugin-CpLcVKRP.js";
7
+ import { ListPlugin as y } from "../ListPlugin/ListPlugin.js";
8
8
  import { LinkPlugin as N } from "../LinkPlugin/LinkPlugin.js";
9
9
  import { HistoryPlugin as x } from "../HistoryPlugin/HistoryPlugin.js";
10
- import { T as B } from "../../../../TablePlugin-DQR5VWGq.js";
10
+ import { T as B } from "../../../../TablePlugin-BkczRiUz.js";
11
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);
12
+ import { s as z } from "../../../../RteEditor.module-DcvGRx3a.js";
13
+ const G = ({ editorScrollPosition: c }) => {
14
+ const [e] = P(), [i, s] = E(null), m = C(null), d = L(() => {
15
+ const o = f();
16
+ if (g(o)) {
17
+ const u = o.anchor.getNode(), r = h(u);
18
18
  if (r) {
19
19
  const l = e.getElementByKey(r.getKey()), a = l ? l.getBoundingClientRect() : { right: 0, bottom: 0, height: 0 };
20
20
  s({ xPos: a.right, yPos: a.bottom, height: a.height });
@@ -23,19 +23,19 @@ const G = ({ editorScrollPosition: p }) => {
23
23
  }
24
24
  }, [e]), b = (o) => {
25
25
  var t;
26
- (t = c.current) == null || t.mutateTable(o);
26
+ (t = m.current) == null || t.mutateTable(o);
27
27
  };
28
- return g(() => {
28
+ return p(() => {
29
29
  e.registerUpdateListener(({ editorState: o }) => {
30
30
  o.read(() => {
31
- m();
31
+ d();
32
32
  });
33
33
  });
34
- }, [e, m]), g(() => {
34
+ }, [e, d]), p(() => {
35
35
  const o = () => {
36
36
  e.update(() => {
37
- const t = u();
38
- if (f(t)) {
37
+ const t = f();
38
+ if (g(t)) {
39
39
  const r = t.anchor.getNode();
40
40
  h(r) && (w(null), s(null));
41
41
  }
@@ -47,16 +47,16 @@ const G = ({ editorScrollPosition: p }) => {
47
47
  }, [e]), /* @__PURE__ */ v("div", { className: z.editor__toolbar, children: [
48
48
  /* @__PURE__ */ n(T, {}),
49
49
  /* @__PURE__ */ n(y, {}),
50
- /* @__PURE__ */ n(B, { isActive: !!i, ref: c }),
50
+ /* @__PURE__ */ n(B, { isActive: !!i, ref: m }),
51
51
  i && /* @__PURE__ */ n(
52
52
  k,
53
53
  {
54
54
  position: i,
55
- parentScrollPosition: p,
55
+ parentScrollPosition: c,
56
56
  onAction: b
57
57
  }
58
58
  ),
59
- /* @__PURE__ */ n(N, {}),
59
+ /* @__PURE__ */ n(N, { parentScrollPosition: c }),
60
60
  /* @__PURE__ */ n(x, {})
61
61
  ] });
62
62
  };
@@ -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, $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,GAErCC,IAAgBC,EAAY,MAAM;AACtC,UAAMC,IAAYC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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;"}
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 parentScrollPosition={editorScrollPosition} />\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,QA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E7C,MAAM;AACJ,aAAA,oBAAoB,UAAUA,CAAkB,GAChD,OAAA,oBAAoB,UAAUA,CAAkB;AAAA,IAAA;AAAA,EACzD,GACC,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,IAEF,gBAAAS,EAACK,GAAW,EAAA,sBAAsB/B,EAAsB,CAAA;AAAA,sBACvDgC,GAAc,EAAA;AAAA,EACjB,EAAA,CAAA;AAEJ;"}
@@ -1,17 +1,17 @@
1
1
  import { ToolBarPlugin as e } from "./ToolbarPlugin/ToolbarPlugin.js";
2
2
  import { BlockFormatPlugin as l } from "./BlockFormatPlugin/BlockFormatPlugin.js";
3
- import { L as n } from "../../../ListPlugin-CpLcVKRP.js";
3
+ import { ListPlugin as n } from "./ListPlugin/ListPlugin.js";
4
4
  import { LinkPlugin as m, getLinkNodeTag as x } from "./LinkPlugin/LinkPlugin.js";
5
- import { HistoryPlugin as f } from "./HistoryPlugin/HistoryPlugin.js";
6
- import { T as u } from "../../../TablePlugin-DQR5VWGq.js";
5
+ import { HistoryPlugin as p } from "./HistoryPlugin/HistoryPlugin.js";
6
+ import { T as a } from "../../../TablePlugin-BkczRiUz.js";
7
7
  import { TableCellContextMenu as T } from "./TablePlugin/TableCellContextMenu/TableCellContextMenu.js";
8
8
  export {
9
9
  l as BlockFormatPlugin,
10
- f as HistoryPlugin,
10
+ p as HistoryPlugin,
11
11
  m as LinkPlugin,
12
12
  n as ListPlugin,
13
13
  T as TableCellContextMenu,
14
- u as TablePlugin,
14
+ a as TablePlugin,
15
15
  e as ToolBarPlugin,
16
16
  x as getLinkNodeTag
17
17
  };
@@ -9,13 +9,13 @@ export interface RteEditorProps {
9
9
  label?: string;
10
10
  /** explanation of the text to be filled in, in current Language */
11
11
  info?: string;
12
- /** 'true' the rte field mandetory */
12
+ /** 'true' the rte field mandatory */
13
13
  required?: boolean;
14
14
  /** max number of words 'allowed' but not enforced */
15
15
  maxWords?: number;
16
16
  /** max height in rem default = 20rem*/
17
17
  maxHeightInRem?: `${number}rem`;
18
- /** error text to display if required and field is empthy */
18
+ /** error text to display if required and field is empty */
19
19
  notValidatedText?: string;
20
20
  /** updated output */
21
21
  onChange: (content: string) => void;