@payloadcms/richtext-lexical 3.0.0-beta.73 → 3.0.0-beta.75

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 (106) hide show
  1. package/dist/exports/client/Field-5GGTGCKC.js +2 -0
  2. package/dist/exports/client/Field-5GGTGCKC.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/index.js +7 -7
  5. package/dist/exports/client/index.js.map +4 -4
  6. package/dist/features/blockquote/feature.server.d.ts.map +1 -1
  7. package/dist/features/blockquote/feature.server.js +5 -2
  8. package/dist/features/blockquote/feature.server.js.map +1 -1
  9. package/dist/features/blocks/validate.d.ts.map +1 -1
  10. package/dist/features/blocks/validate.js +2 -1
  11. package/dist/features/blocks/validate.js.map +1 -1
  12. package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
  13. package/dist/features/converters/html/converter/converters/paragraph.js +5 -2
  14. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  15. package/dist/features/converters/html/converter/index.d.ts +8 -2
  16. package/dist/features/converters/html/converter/index.d.ts.map +1 -1
  17. package/dist/features/converters/html/converter/index.js +14 -5
  18. package/dist/features/converters/html/converter/index.js.map +1 -1
  19. package/dist/features/converters/html/converter/types.d.ts +5 -2
  20. package/dist/features/converters/html/converter/types.d.ts.map +1 -1
  21. package/dist/features/converters/html/converter/types.js.map +1 -1
  22. package/dist/features/converters/html/feature.server.d.ts +2 -2
  23. package/dist/features/converters/html/feature.server.d.ts.map +1 -1
  24. package/dist/features/converters/html/feature.server.js.map +1 -1
  25. package/dist/features/converters/html/field/index.d.ts.map +1 -1
  26. package/dist/features/converters/html/field/index.js +5 -2
  27. package/dist/features/converters/html/field/index.js.map +1 -1
  28. package/dist/features/experimental_table/feature.client.d.ts.map +1 -1
  29. package/dist/features/experimental_table/feature.client.js +5 -0
  30. package/dist/features/experimental_table/feature.client.js.map +1 -1
  31. package/dist/features/experimental_table/feature.server.d.ts +11 -0
  32. package/dist/features/experimental_table/feature.server.d.ts.map +1 -1
  33. package/dist/features/experimental_table/feature.server.js +79 -6
  34. package/dist/features/experimental_table/feature.server.js.map +1 -1
  35. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  36. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js +2 -0
  37. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js.map +1 -1
  38. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts +0 -1
  39. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  40. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js +13 -8
  41. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js.map +1 -1
  42. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +12 -0
  43. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  44. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +181 -0
  45. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  46. package/dist/features/experimental_table/utils/debounce.d.ts +61 -0
  47. package/dist/features/experimental_table/utils/debounce.d.ts.map +1 -0
  48. package/dist/features/experimental_table/utils/debounce.js +202 -0
  49. package/dist/features/experimental_table/utils/debounce.js.map +1 -0
  50. package/dist/features/experimental_table/utils/useDebounce.d.ts +6 -0
  51. package/dist/features/experimental_table/utils/useDebounce.d.ts.map +1 -0
  52. package/dist/features/experimental_table/utils/useDebounce.js +18 -0
  53. package/dist/features/experimental_table/utils/useDebounce.js.map +1 -0
  54. package/dist/features/heading/feature.server.d.ts.map +1 -1
  55. package/dist/features/heading/feature.server.js +5 -2
  56. package/dist/features/heading/feature.server.js.map +1 -1
  57. package/dist/features/link/feature.server.d.ts.map +1 -1
  58. package/dist/features/link/feature.server.js +10 -4
  59. package/dist/features/link/feature.server.js.map +1 -1
  60. package/dist/features/link/plugins/autoLink/index.d.ts.map +1 -1
  61. package/dist/features/link/plugins/autoLink/index.js +19 -6
  62. package/dist/features/link/plugins/autoLink/index.js.map +1 -1
  63. package/dist/features/link/validate.d.ts.map +1 -1
  64. package/dist/features/link/validate.js +2 -1
  65. package/dist/features/link/validate.js.map +1 -1
  66. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  67. package/dist/features/lists/htmlConverter.js +10 -4
  68. package/dist/features/lists/htmlConverter.js.map +1 -1
  69. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  70. package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
  71. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  72. package/dist/features/typesServer.d.ts +2 -1
  73. package/dist/features/typesServer.d.ts.map +1 -1
  74. package/dist/features/typesServer.js.map +1 -1
  75. package/dist/features/upload/feature.server.js +4 -4
  76. package/dist/features/upload/feature.server.js.map +1 -1
  77. package/dist/features/upload/validate.d.ts.map +1 -1
  78. package/dist/features/upload/validate.js +1 -0
  79. package/dist/features/upload/validate.js.map +1 -1
  80. package/dist/field/Field.d.ts.map +1 -1
  81. package/dist/field/Field.js +8 -7
  82. package/dist/field/Field.js.map +1 -1
  83. package/dist/field/index.js +8 -8
  84. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  85. package/dist/lexical/LexicalEditor.js +0 -6
  86. package/dist/lexical/LexicalEditor.js.map +1 -1
  87. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  88. package/dist/lexical/ui/ContentEditable.js +8 -1
  89. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  90. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  91. package/dist/lexical/ui/icons/Table/index.js +1 -0
  92. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  93. package/dist/lexical/ui/icons/Upload/index.js +1 -1
  94. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  95. package/dist/nodeTypes.d.ts +3 -1
  96. package/dist/nodeTypes.d.ts.map +1 -1
  97. package/dist/nodeTypes.js.map +1 -1
  98. package/dist/populateGraphQL/defaultValue.d.ts.map +1 -1
  99. package/dist/populateGraphQL/defaultValue.js +1 -0
  100. package/dist/populateGraphQL/defaultValue.js.map +1 -1
  101. package/dist/utilities/generateComponentMap.d.ts.map +1 -1
  102. package/dist/utilities/generateComponentMap.js +3 -1
  103. package/dist/utilities/generateComponentMap.js.map +1 -1
  104. package/package.json +33 -33
  105. package/dist/exports/client/Field-YNHIDK3D.js +0 -2
  106. package/dist/exports/client/Field-YNHIDK3D.js.map +0 -7
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
+ import { $getTableColumnIndexFromTableCellNode, $getTableRowIndexFromTableCellNode, $insertTableColumn__EXPERIMENTAL, $insertTableRow__EXPERIMENTAL, $isTableCellNode, $isTableNode, TableNode } from '@lexical/table';
10
+ import { $findMatchingParent, mergeRegister } from '@lexical/utils';
11
+ import { $getNearestNodeFromDOMNode } from 'lexical';
12
+ import { useEffect, useRef, useState } from 'react';
13
+ import * as React from 'react';
14
+ import { createPortal } from 'react-dom';
15
+ import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
16
+ import { useDebounce } from '../../utils/useDebounce.js';
17
+ const BUTTON_WIDTH_PX = 20;
18
+ function TableHoverActionsContainer({ anchorElem }) {
19
+ const [editor] = useLexicalComposerContext();
20
+ const editorConfig = useEditorConfigContext();
21
+ const [isShownRow, setShownRow] = useState(false);
22
+ const [isShownColumn, setShownColumn] = useState(false);
23
+ const [shouldListenMouseMove, setShouldListenMouseMove] = useState(false);
24
+ const [position, setPosition] = useState({});
25
+ const codeSetRef = useRef(new Set());
26
+ const tableDOMNodeRef = useRef(null);
27
+ const debouncedOnMouseMove = useDebounce((event)=>{
28
+ const { isOutside, tableDOMNode } = getMouseInfo(event, editorConfig.editorConfig?.lexical);
29
+ if (isOutside) {
30
+ setShownRow(false);
31
+ setShownColumn(false);
32
+ return;
33
+ }
34
+ if (!tableDOMNode) {
35
+ return;
36
+ }
37
+ tableDOMNodeRef.current = tableDOMNode;
38
+ let hoveredRowNode = null;
39
+ let hoveredColumnNode = null;
40
+ let tableDOMElement = null;
41
+ editor.update(()=>{
42
+ const maybeTableCell = $getNearestNodeFromDOMNode(tableDOMNode);
43
+ if ($isTableCellNode(maybeTableCell)) {
44
+ const table = $findMatchingParent(maybeTableCell, (node)=>$isTableNode(node));
45
+ if (!$isTableNode(table)) {
46
+ return;
47
+ }
48
+ tableDOMElement = editor.getElementByKey(table?.getKey());
49
+ if (tableDOMElement) {
50
+ const rowCount = table.getChildrenSize();
51
+ const colCount = // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
52
+ table.getChildAtIndex(0)?.getChildrenSize();
53
+ const rowIndex = $getTableRowIndexFromTableCellNode(maybeTableCell);
54
+ const colIndex = $getTableColumnIndexFromTableCellNode(maybeTableCell);
55
+ if (rowIndex === rowCount - 1) {
56
+ hoveredRowNode = maybeTableCell;
57
+ } else if (colIndex === colCount - 1) {
58
+ hoveredColumnNode = maybeTableCell;
59
+ }
60
+ }
61
+ }
62
+ });
63
+ if (tableDOMElement) {
64
+ const { bottom: tableElemBottom, height: tableElemHeight, right: tableElemRight, width: tableElemWidth, x: tableElemX, y: tableElemY } = tableDOMElement.getBoundingClientRect();
65
+ const { left: editorElemLeft, y: editorElemY } = anchorElem.getBoundingClientRect();
66
+ if (hoveredRowNode) {
67
+ setShownColumn(false);
68
+ setShownRow(true);
69
+ setPosition({
70
+ height: BUTTON_WIDTH_PX,
71
+ left: tableElemX - editorElemLeft,
72
+ top: tableElemBottom - editorElemY + 5,
73
+ width: tableElemWidth
74
+ });
75
+ } else if (hoveredColumnNode) {
76
+ setShownColumn(true);
77
+ setShownRow(false);
78
+ setPosition({
79
+ height: tableElemHeight,
80
+ left: tableElemRight - editorElemLeft + 5,
81
+ top: tableElemY - editorElemY,
82
+ width: BUTTON_WIDTH_PX
83
+ });
84
+ }
85
+ }
86
+ }, 50, 250);
87
+ useEffect(()=>{
88
+ if (!shouldListenMouseMove) {
89
+ return;
90
+ }
91
+ document.addEventListener('mousemove', debouncedOnMouseMove);
92
+ return ()=>{
93
+ setShownRow(false);
94
+ setShownColumn(false);
95
+ document.removeEventListener('mousemove', debouncedOnMouseMove);
96
+ };
97
+ }, [
98
+ shouldListenMouseMove,
99
+ debouncedOnMouseMove
100
+ ]);
101
+ useEffect(()=>{
102
+ return mergeRegister(editor.registerMutationListener(TableNode, (mutations)=>{
103
+ editor.getEditorState().read(()=>{
104
+ for (const [key, type] of mutations){
105
+ switch(type){
106
+ case 'created':
107
+ codeSetRef.current.add(key);
108
+ setShouldListenMouseMove(codeSetRef.current.size > 0);
109
+ break;
110
+ case 'destroyed':
111
+ codeSetRef.current.delete(key);
112
+ setShouldListenMouseMove(codeSetRef.current.size > 0);
113
+ break;
114
+ default:
115
+ break;
116
+ }
117
+ }
118
+ });
119
+ }, {
120
+ skipInitialization: false
121
+ }));
122
+ }, [
123
+ editor
124
+ ]);
125
+ const insertAction = (insertRow)=>{
126
+ editor.update(()=>{
127
+ if (tableDOMNodeRef.current) {
128
+ const maybeTableNode = $getNearestNodeFromDOMNode(tableDOMNodeRef.current);
129
+ maybeTableNode?.selectEnd();
130
+ if (insertRow) {
131
+ $insertTableRow__EXPERIMENTAL();
132
+ setShownRow(false);
133
+ } else {
134
+ $insertTableColumn__EXPERIMENTAL();
135
+ setShownColumn(false);
136
+ }
137
+ }
138
+ });
139
+ };
140
+ return /*#__PURE__*/ _jsxs(_Fragment, {
141
+ children: [
142
+ isShownRow && /*#__PURE__*/ _jsx("button", {
143
+ className: editorConfig.editorConfig.lexical.theme.tableAddRows,
144
+ onClick: ()=>insertAction(true),
145
+ style: {
146
+ ...position
147
+ }
148
+ }),
149
+ isShownColumn && /*#__PURE__*/ _jsx("button", {
150
+ className: editorConfig.editorConfig.lexical.theme.tableAddColumns,
151
+ onClick: ()=>insertAction(false),
152
+ style: {
153
+ ...position
154
+ }
155
+ })
156
+ ]
157
+ });
158
+ }
159
+ function getMouseInfo(event, editorConfig) {
160
+ const target = event.target;
161
+ if (target && target instanceof HTMLElement) {
162
+ const tableDOMNode = target.closest(`td.${editorConfig.theme.tableCell}, th.${editorConfig.theme.tableCell}`);
163
+ const isOutside = !(tableDOMNode || target.closest(`button.${editorConfig.theme.tableAddRows}`) || target.closest(`button.${editorConfig.theme.tableAddColumns}`) || target.closest(`div.${editorConfig.theme.tableCellResizer}`));
164
+ return {
165
+ isOutside,
166
+ tableDOMNode
167
+ };
168
+ } else {
169
+ return {
170
+ isOutside: true,
171
+ tableDOMNode: null
172
+ };
173
+ }
174
+ }
175
+ export function TableHoverActionsPlugin({ anchorElem = document.body }) {
176
+ return /*#__PURE__*/ createPortal(/*#__PURE__*/ _jsx(TableHoverActionsContainer, {
177
+ anchorElem: anchorElem
178
+ }), anchorElem);
179
+ }
180
+
181
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/features/experimental_table/plugins/TableHoverActionsPlugin/index.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport type { TableCellNode, TableRowNode } from '@lexical/table'\nimport type { EditorConfig, NodeKey } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport {\n $getTableColumnIndexFromTableCellNode,\n $getTableRowIndexFromTableCellNode,\n $insertTableColumn__EXPERIMENTAL,\n $insertTableRow__EXPERIMENTAL,\n $isTableCellNode,\n $isTableNode,\n TableNode,\n} from '@lexical/table'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode } from 'lexical'\nimport { useEffect, useRef, useState } from 'react'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { useDebounce } from '../../utils/useDebounce.js'\n\nconst BUTTON_WIDTH_PX = 20\n\nfunction TableHoverActionsContainer({ anchorElem }: { anchorElem: HTMLElement }): JSX.Element {\n const [editor] = useLexicalComposerContext()\n const editorConfig = useEditorConfigContext()\n const [isShownRow, setShownRow] = useState<boolean>(false)\n const [isShownColumn, setShownColumn] = useState<boolean>(false)\n const [shouldListenMouseMove, setShouldListenMouseMove] = useState<boolean>(false)\n const [position, setPosition] = useState({})\n const codeSetRef = useRef<Set<NodeKey>>(new Set())\n const tableDOMNodeRef = useRef<HTMLElement | null>(null)\n\n const debouncedOnMouseMove = useDebounce(\n (event: MouseEvent) => {\n const { isOutside, tableDOMNode } = getMouseInfo(event, editorConfig.editorConfig?.lexical)\n\n if (isOutside) {\n setShownRow(false)\n setShownColumn(false)\n return\n }\n\n if (!tableDOMNode) {\n return\n }\n\n tableDOMNodeRef.current = tableDOMNode\n\n let hoveredRowNode: TableCellNode | null = null\n let hoveredColumnNode: TableCellNode | null = null\n let tableDOMElement: HTMLElement | null = null\n\n editor.update(() => {\n const maybeTableCell = $getNearestNodeFromDOMNode(tableDOMNode)\n\n if ($isTableCellNode(maybeTableCell)) {\n const table = $findMatchingParent(maybeTableCell, (node) => $isTableNode(node))\n if (!$isTableNode(table)) {\n return\n }\n\n tableDOMElement = editor.getElementByKey(table?.getKey())\n\n if (tableDOMElement) {\n const rowCount = table.getChildrenSize()\n const colCount =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ((table as TableNode).getChildAtIndex(0) as TableRowNode)?.getChildrenSize()\n\n const rowIndex = $getTableRowIndexFromTableCellNode(maybeTableCell)\n const colIndex = $getTableColumnIndexFromTableCellNode(maybeTableCell)\n\n if (rowIndex === rowCount - 1) {\n hoveredRowNode = maybeTableCell\n } else if (colIndex === colCount - 1) {\n hoveredColumnNode = maybeTableCell\n }\n }\n }\n })\n\n if (tableDOMElement) {\n const {\n bottom: tableElemBottom,\n height: tableElemHeight,\n right: tableElemRight,\n width: tableElemWidth,\n x: tableElemX,\n y: tableElemY,\n } = (tableDOMElement as HTMLTableElement).getBoundingClientRect()\n\n const { left: editorElemLeft, y: editorElemY } = anchorElem.getBoundingClientRect()\n\n if (hoveredRowNode) {\n setShownColumn(false)\n setShownRow(true)\n setPosition({\n height: BUTTON_WIDTH_PX,\n left: tableElemX - editorElemLeft,\n top: tableElemBottom - editorElemY + 5,\n width: tableElemWidth,\n })\n } else if (hoveredColumnNode) {\n setShownColumn(true)\n setShownRow(false)\n setPosition({\n height: tableElemHeight,\n left: tableElemRight - editorElemLeft + 5,\n top: tableElemY - editorElemY,\n width: BUTTON_WIDTH_PX,\n })\n }\n }\n },\n 50,\n 250,\n )\n\n useEffect(() => {\n if (!shouldListenMouseMove) {\n return\n }\n\n document.addEventListener('mousemove', debouncedOnMouseMove)\n\n return () => {\n setShownRow(false)\n setShownColumn(false)\n\n document.removeEventListener('mousemove', debouncedOnMouseMove)\n }\n }, [shouldListenMouseMove, debouncedOnMouseMove])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerMutationListener(\n TableNode,\n (mutations) => {\n editor.getEditorState().read(() => {\n for (const [key, type] of mutations) {\n switch (type) {\n case 'created':\n codeSetRef.current.add(key)\n setShouldListenMouseMove(codeSetRef.current.size > 0)\n break\n\n case 'destroyed':\n codeSetRef.current.delete(key)\n setShouldListenMouseMove(codeSetRef.current.size > 0)\n break\n\n default:\n break\n }\n }\n })\n },\n { skipInitialization: false },\n ),\n )\n }, [editor])\n\n const insertAction = (insertRow: boolean) => {\n editor.update(() => {\n if (tableDOMNodeRef.current) {\n const maybeTableNode = $getNearestNodeFromDOMNode(tableDOMNodeRef.current)\n maybeTableNode?.selectEnd()\n if (insertRow) {\n $insertTableRow__EXPERIMENTAL()\n setShownRow(false)\n } else {\n $insertTableColumn__EXPERIMENTAL()\n setShownColumn(false)\n }\n }\n })\n }\n\n return (\n <>\n {isShownRow && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddRows}\n onClick={() => insertAction(true)}\n style={{ ...position }}\n />\n )}\n {isShownColumn && (\n <button\n className={editorConfig.editorConfig.lexical.theme.tableAddColumns}\n onClick={() => insertAction(false)}\n style={{ ...position }}\n />\n )}\n </>\n )\n}\n\nfunction getMouseInfo(\n event: MouseEvent,\n editorConfig: EditorConfig,\n): {\n isOutside: boolean\n tableDOMNode: HTMLElement | null\n} {\n const target = event.target\n\n if (target && target instanceof HTMLElement) {\n const tableDOMNode = target.closest<HTMLElement>(\n `td.${editorConfig.theme.tableCell}, th.${editorConfig.theme.tableCell}`,\n )\n\n const isOutside = !(\n tableDOMNode ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddRows}`) ||\n target.closest<HTMLElement>(`button.${editorConfig.theme.tableAddColumns}`) ||\n target.closest<HTMLElement>(`div.${editorConfig.theme.tableCellResizer}`)\n )\n\n return { isOutside, tableDOMNode }\n } else {\n return { isOutside: true, tableDOMNode: null }\n }\n}\n\nexport function TableHoverActionsPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactPortal | null {\n return createPortal(<TableHoverActionsContainer anchorElem={anchorElem} />, anchorElem)\n}\n"],"names":["useLexicalComposerContext","$getTableColumnIndexFromTableCellNode","$getTableRowIndexFromTableCellNode","$insertTableColumn__EXPERIMENTAL","$insertTableRow__EXPERIMENTAL","$isTableCellNode","$isTableNode","TableNode","$findMatchingParent","mergeRegister","$getNearestNodeFromDOMNode","useEffect","useRef","useState","React","createPortal","useEditorConfigContext","useDebounce","BUTTON_WIDTH_PX","TableHoverActionsContainer","anchorElem","editor","editorConfig","isShownRow","setShownRow","isShownColumn","setShownColumn","shouldListenMouseMove","setShouldListenMouseMove","position","setPosition","codeSetRef","Set","tableDOMNodeRef","debouncedOnMouseMove","event","isOutside","tableDOMNode","getMouseInfo","lexical","current","hoveredRowNode","hoveredColumnNode","tableDOMElement","update","maybeTableCell","table","node","getElementByKey","getKey","rowCount","getChildrenSize","colCount","getChildAtIndex","rowIndex","colIndex","bottom","tableElemBottom","height","tableElemHeight","right","tableElemRight","width","tableElemWidth","x","tableElemX","y","tableElemY","getBoundingClientRect","left","editorElemLeft","editorElemY","top","document","addEventListener","removeEventListener","registerMutationListener","mutations","getEditorState","read","key","type","add","size","delete","skipInitialization","insertAction","insertRow","maybeTableNode","selectEnd","button","className","theme","tableAddRows","onClick","style","tableAddColumns","target","HTMLElement","closest","tableCell","tableCellResizer","TableHoverActionsPlugin","body"],"mappings":"AAAA;;;;;;CAMC;AAMD,SAASA,yBAAyB,QAAQ,wCAAuC;AACjF,SACEC,qCAAqC,EACrCC,kCAAkC,EAClCC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gBAAgB,EAChBC,YAAY,EACZC,SAAS,QACJ,iBAAgB;AACvB,SAASC,mBAAmB,EAAEC,aAAa,QAAQ,iBAAgB;AACnE,SAASC,0BAA0B,QAAQ,UAAS;AACpD,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACnD,YAAYC,WAAW,QAAO;AAC9B,SAASC,YAAY,QAAQ,YAAW;AAExC,SAASC,sBAAsB,QAAQ,4DAA2D;AAClG,SAASC,WAAW,QAAQ,6BAA4B;AAExD,MAAMC,kBAAkB;AAExB,SAASC,2BAA2B,EAAEC,UAAU,EAA+B;IAC7E,MAAM,CAACC,OAAO,GAAGrB;IACjB,MAAMsB,eAAeN;IACrB,MAAM,CAACO,YAAYC,YAAY,GAAGX,SAAkB;IACpD,MAAM,CAACY,eAAeC,eAAe,GAAGb,SAAkB;IAC1D,MAAM,CAACc,uBAAuBC,yBAAyB,GAAGf,SAAkB;IAC5E,MAAM,CAACgB,UAAUC,YAAY,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I;QAA2BC,YAAYA;QAAgBA;AAC9E"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Creates a debounced function that delays invoking `func` until after `wait`
3
+ * milliseconds have elapsed since the last time the debounced function was
4
+ * invoked. The debounced function comes with a `cancel` method to cancel
5
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
6
+ * Provide `options` to indicate whether `func` should be invoked on the
7
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
8
+ * with the last arguments provided to the debounced function. Subsequent
9
+ * calls to the debounced function return the result of the last `func`
10
+ * invocation.
11
+ *
12
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
13
+ * invoked on the trailing edge of the timeout only if the debounced function
14
+ * is invoked more than once during the `wait` timeout.
15
+ *
16
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
17
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
18
+ *
19
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
20
+ * for details over the differences between `_.debounce` and `_.throttle`.
21
+ *
22
+ * @static
23
+ * @memberOf _
24
+ * @since 0.1.0
25
+ * @category Function
26
+ * @param {Function} func The function to debounce.
27
+ * @param {number} [wait=0] The number of milliseconds to delay.
28
+ * @param {Object} [options={}] The options object.
29
+ * @param {boolean} [options.leading=false]
30
+ * Specify invoking on the leading edge of the timeout.
31
+ * @param {number} [options.maxWait]
32
+ * The maximum time `func` is allowed to be delayed before it's invoked.
33
+ * @param {boolean} [options.trailing=true]
34
+ * Specify invoking on the trailing edge of the timeout.
35
+ * @returns {Function} Returns the new debounced function.
36
+ * @example
37
+ *
38
+ * // Avoid costly calculations while the window size is in flux.
39
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
40
+ *
41
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
42
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
43
+ * 'leading': true,
44
+ * 'trailing': false
45
+ * }));
46
+ *
47
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
48
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
49
+ * var source = new EventSource('/stream');
50
+ * jQuery(source).on('message', debounced);
51
+ *
52
+ * // Cancel the trailing debounced invocation.
53
+ * jQuery(window).on('popstate', debounced.cancel);
54
+ */
55
+ declare function debounce(func: any, wait: any, options: any): {
56
+ (): any;
57
+ cancel: () => void;
58
+ flush: () => any;
59
+ };
60
+ export default debounce;
61
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../src/features/experimental_table/utils/debounce.ts"],"names":[],"mappings":"AA4DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,iBAAS,QAAQ,CAAC,IAAI,KAAA,EAAE,IAAI,KAAA,EAAE,OAAO,KAAA;;;;EA+HpC;AAED,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,202 @@
1
+ // Copied & modified from https://github.com/lodash/lodash/blob/main/src/debounce.ts
2
+ /*
3
+ The MIT License
4
+
5
+ Copyright JS Foundation and other contributors <https://js.foundation/>
6
+
7
+ Based on Underscore.js, copyright Jeremy Ashkenas,
8
+ DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
9
+
10
+ This software consists of voluntary contributions made by many
11
+ individuals. For exact contribution history, see the revision history
12
+ available at https://github.com/lodash/lodash
13
+
14
+ The following license applies to all parts of this software except as
15
+ documented below:
16
+
17
+ ====
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining
20
+ a copy of this software and associated documentation files (the
21
+ "Software"), to deal in the Software without restriction, including
22
+ without limitation the rights to use, copy, modify, merge, publish,
23
+ distribute, sublicense, and/or sell copies of the Software, and to
24
+ permit persons to whom the Software is furnished to do so, subject to
25
+ the following conditions:
26
+
27
+ The above copyright notice and this permission notice shall be
28
+ included in all copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
+
38
+ ====
39
+
40
+ Copyright and related rights for sample code are waived via CC0. Sample
41
+ code is defined as all source code displayed within the prose of the
42
+ documentation.
43
+
44
+ CC0: http://creativecommons.org/publicdomain/zero/1.0/
45
+
46
+ ====
47
+
48
+ Files located in the node_modules and vendor directories are externally
49
+ maintained libraries used by this software which have their own
50
+ licenses; we recommend you read them, as their terms may differ from the
51
+ terms above.
52
+ */ /** Error message constants. */ const FUNC_ERROR_TEXT = 'Expected a function';
53
+ /* Built-in method references for those with the same name as other `lodash` methods. */ const nativeMax = Math.max, nativeMin = Math.min;
54
+ /**
55
+ * Creates a debounced function that delays invoking `func` until after `wait`
56
+ * milliseconds have elapsed since the last time the debounced function was
57
+ * invoked. The debounced function comes with a `cancel` method to cancel
58
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
59
+ * Provide `options` to indicate whether `func` should be invoked on the
60
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
61
+ * with the last arguments provided to the debounced function. Subsequent
62
+ * calls to the debounced function return the result of the last `func`
63
+ * invocation.
64
+ *
65
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
66
+ * invoked on the trailing edge of the timeout only if the debounced function
67
+ * is invoked more than once during the `wait` timeout.
68
+ *
69
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
70
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
71
+ *
72
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
73
+ * for details over the differences between `_.debounce` and `_.throttle`.
74
+ *
75
+ * @static
76
+ * @memberOf _
77
+ * @since 0.1.0
78
+ * @category Function
79
+ * @param {Function} func The function to debounce.
80
+ * @param {number} [wait=0] The number of milliseconds to delay.
81
+ * @param {Object} [options={}] The options object.
82
+ * @param {boolean} [options.leading=false]
83
+ * Specify invoking on the leading edge of the timeout.
84
+ * @param {number} [options.maxWait]
85
+ * The maximum time `func` is allowed to be delayed before it's invoked.
86
+ * @param {boolean} [options.trailing=true]
87
+ * Specify invoking on the trailing edge of the timeout.
88
+ * @returns {Function} Returns the new debounced function.
89
+ * @example
90
+ *
91
+ * // Avoid costly calculations while the window size is in flux.
92
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
93
+ *
94
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
95
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
96
+ * 'leading': true,
97
+ * 'trailing': false
98
+ * }));
99
+ *
100
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
101
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
102
+ * var source = new EventSource('/stream');
103
+ * jQuery(source).on('message', debounced);
104
+ *
105
+ * // Cancel the trailing debounced invocation.
106
+ * jQuery(window).on('popstate', debounced.cancel);
107
+ */ function debounce(func, wait, options) {
108
+ let lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
109
+ if (typeof func != 'function') {
110
+ throw new TypeError(FUNC_ERROR_TEXT);
111
+ }
112
+ wait = wait || 0;
113
+ if (typeof options === 'object') {
114
+ leading = !!options.leading;
115
+ maxing = 'maxWait' in options;
116
+ maxWait = maxing ? nativeMax(options.maxWait || 0, wait) : maxWait;
117
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
118
+ }
119
+ function invokeFunc(time) {
120
+ const args = lastArgs, thisArg = lastThis;
121
+ lastArgs = lastThis = undefined;
122
+ lastInvokeTime = time;
123
+ result = func.apply(thisArg, args);
124
+ return result;
125
+ }
126
+ function leadingEdge(time) {
127
+ // Reset any `maxWait` timer.
128
+ lastInvokeTime = time;
129
+ // Start the timer for the trailing edge.
130
+ timerId = setTimeout(timerExpired, wait);
131
+ // Invoke the leading edge.
132
+ return leading ? invokeFunc(time) : result;
133
+ }
134
+ function remainingWait(time) {
135
+ const timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
136
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
137
+ }
138
+ function shouldInvoke(time) {
139
+ const timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
140
+ // Either this is the first call, activity has stopped and we're at the
141
+ // trailing edge, the system time has gone backwards and we're treating
142
+ // it as the trailing edge, or we've hit the `maxWait` limit.
143
+ return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
144
+ }
145
+ function timerExpired() {
146
+ const time = Date.now();
147
+ if (shouldInvoke(time)) {
148
+ return trailingEdge(time);
149
+ }
150
+ // Restart the timer.
151
+ timerId = setTimeout(timerExpired, remainingWait(time));
152
+ }
153
+ function trailingEdge(time) {
154
+ timerId = undefined;
155
+ // Only invoke if we have `lastArgs` which means `func` has been
156
+ // debounced at least once.
157
+ if (trailing && lastArgs) {
158
+ return invokeFunc(time);
159
+ }
160
+ lastArgs = lastThis = undefined;
161
+ return result;
162
+ }
163
+ function cancel() {
164
+ if (timerId !== undefined) {
165
+ clearTimeout(timerId);
166
+ }
167
+ lastInvokeTime = 0;
168
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
169
+ }
170
+ function flush() {
171
+ return timerId === undefined ? result : trailingEdge(Date.now());
172
+ }
173
+ function debounced() {
174
+ const time = Date.now(), isInvoking = shouldInvoke(time);
175
+ // eslint-disable-next-line prefer-rest-params
176
+ lastArgs = arguments;
177
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
178
+ lastThis = this;
179
+ lastCallTime = time;
180
+ if (isInvoking) {
181
+ if (timerId === undefined) {
182
+ return leadingEdge(lastCallTime);
183
+ }
184
+ if (maxing) {
185
+ // Handle invocations in a tight loop.
186
+ clearTimeout(timerId);
187
+ timerId = setTimeout(timerExpired, wait);
188
+ return invokeFunc(lastCallTime);
189
+ }
190
+ }
191
+ if (timerId === undefined) {
192
+ timerId = setTimeout(timerExpired, wait);
193
+ }
194
+ return result;
195
+ }
196
+ debounced.cancel = cancel;
197
+ debounced.flush = flush;
198
+ return debounced;
199
+ }
200
+ export default debounce;
201
+
202
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/features/experimental_table/utils/debounce.ts"],"sourcesContent":["// Copied & modified from https://github.com/lodash/lodash/blob/main/src/debounce.ts\n/*\nThe MIT License\n\nCopyright JS Foundation and other contributors <https://js.foundation/>\n\nBased on Underscore.js, copyright Jeremy Ashkenas,\nDocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>\n\nThis software consists of voluntary contributions made by many\nindividuals. For exact contribution history, see the revision history\navailable at https://github.com/lodash/lodash\n\nThe following license applies to all parts of this software except as\ndocumented below:\n\n====\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n====\n\nCopyright and related rights for sample code are waived via CC0. Sample\ncode is defined as all source code displayed within the prose of the\ndocumentation.\n\nCC0: http://creativecommons.org/publicdomain/zero/1.0/\n\n====\n\nFiles located in the node_modules and vendor directories are externally\nmaintained libraries used by this software which have their own\nlicenses; we recommend you read them, as their terms may differ from the\nterms above.\n */\n\n/** Error message constants. */\nconst FUNC_ERROR_TEXT = 'Expected a function'\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nconst nativeMax = Math.max,\n nativeMin = Math.min\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n let lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT)\n }\n wait = wait || 0\n if (typeof options === 'object') {\n leading = !!options.leading\n maxing = 'maxWait' in options\n maxWait = maxing ? nativeMax(options.maxWait || 0, wait) : maxWait\n trailing = 'trailing' in options ? !!options.trailing : trailing\n }\n\n function invokeFunc(time) {\n const args = lastArgs,\n thisArg = lastThis\n\n lastArgs = lastThis = undefined\n lastInvokeTime = time\n result = func.apply(thisArg, args)\n return result\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait)\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result\n }\n\n function remainingWait(time) {\n const timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall\n\n return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting\n }\n\n function shouldInvoke(time) {\n const timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (\n lastCallTime === undefined ||\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxing && timeSinceLastInvoke >= maxWait)\n )\n }\n\n function timerExpired() {\n const time = Date.now()\n if (shouldInvoke(time)) {\n return trailingEdge(time)\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time))\n }\n\n function trailingEdge(time) {\n timerId = undefined\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time)\n }\n lastArgs = lastThis = undefined\n return result\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId)\n }\n lastInvokeTime = 0\n lastArgs = lastCallTime = lastThis = timerId = undefined\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now())\n }\n\n function debounced() {\n const time = Date.now(),\n isInvoking = shouldInvoke(time)\n\n // eslint-disable-next-line prefer-rest-params\n lastArgs = arguments\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n lastThis = this\n lastCallTime = time\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime)\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId)\n timerId = setTimeout(timerExpired, wait)\n return invokeFunc(lastCallTime)\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait)\n }\n return result\n }\n debounced.cancel = cancel\n debounced.flush = flush\n return debounced\n}\n\nexport default debounce\n"],"names":["FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","Date","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K,GAAGA;IAClB,OAAOC;AACT;AAEA,eAAenC,SAAQ"}
@@ -0,0 +1,6 @@
1
+ export declare function useDebounce<T extends (...args: never[]) => void>(fn: T, ms: number, maxWait?: number): {
2
+ (): any;
3
+ cancel: () => void;
4
+ flush: () => any;
5
+ };
6
+ //# sourceMappingURL=useDebounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebounce.d.ts","sourceRoot":"","sources":["../../../../src/features/experimental_table/utils/useDebounce.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,IAAI,EAC9D,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,MAAM;;;;EAkBjB"}
@@ -0,0 +1,18 @@
1
+ import { useMemo, useRef } from 'react';
2
+ import debounce from './debounce.js';
3
+ export function useDebounce(fn, ms, maxWait) {
4
+ const funcRef = useRef(null);
5
+ funcRef.current = fn;
6
+ return useMemo(()=>debounce((...args)=>{
7
+ if (funcRef.current) {
8
+ funcRef.current(...args);
9
+ }
10
+ }, ms, {
11
+ maxWait
12
+ }), [
13
+ ms,
14
+ maxWait
15
+ ]);
16
+ }
17
+
18
+ //# sourceMappingURL=useDebounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/features/experimental_table/utils/useDebounce.ts"],"sourcesContent":["import { useMemo, useRef } from 'react'\n\nimport debounce from './debounce.js'\n\nexport function useDebounce<T extends (...args: never[]) => void>(\n fn: T,\n ms: number,\n maxWait?: number,\n) {\n const funcRef = useRef<T | null>(null)\n funcRef.current = fn\n\n return useMemo(\n () =>\n debounce(\n (...args: Parameters<T>) => {\n if (funcRef.current) {\n funcRef.current(...args)\n }\n },\n ms,\n { maxWait },\n ),\n [ms, maxWait],\n )\n}\n"],"names":["useMemo","useRef","debounce","useDebounce","fn","ms","maxWait","funcRef","current","args"],"mappings":"AAAA,SAASA,OAAO,EAAEC,MAAM,QAAQ,QAAO;AAEvC,OAAOC,cAAc,gBAAe;AAEpC,OAAO,SAASC,YACdC,EAAK,EACLC,EAAU,EACVC,OAAgB;IAEhB,MAAMC,UAAUN,OAAiB;IACjCM,QAAQC,OAAO,GAAGJ;IAElB,OAAOJ,QACL,IACEE,SACE,CAAC,GAAGO;YACF,IAAIF,QAAQC,OAAO,EAAE;gBACnBD,QAAQC,OAAO,IAAIC;YACrB;QACF,GACAJ,IACA;YAAEC;QAAQ,IAEd;QAACD;QAAIC;KAAQ;AAEjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/heading/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,IAAI,sBAAsB,EAC/C,cAAc,EACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAYrC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,IAAI,EAAE,SAAS,CAAA;CAChB,EACD,sBAAsB,CACvB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,cAAc,0HA4CzB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/heading/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,IAAI,sBAAsB,EAC/C,cAAc,EACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAYrC,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,IAAI,EAAE,SAAS,CAAA;CAChB,EACD,sBAAsB,CACvB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,cAAc,0HAuDzB,CAAA"}
@@ -30,15 +30,18 @@ export const HeadingFeature = createServerFeature({
30
30
  createNode({
31
31
  converters: {
32
32
  html: {
33
- converter: async ({ converters, node, parent, req })=>{
33
+ converter: async ({ converters, draft, node, overrideAccess, parent, req, showHiddenFields })=>{
34
34
  const childrenText = await convertLexicalNodesToHTML({
35
35
  converters,
36
+ draft,
36
37
  lexicalNodes: node.children,
38
+ overrideAccess,
37
39
  parent: {
38
40
  ...node,
39
41
  parent
40
42
  },
41
- req
43
+ req,
44
+ showHiddenFields
42
45
  });
43
46
  return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>';
44
47
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/heading/feature.server.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { HeadingFeatureClient } from '../../exports/client/index.js'\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { createNode } from '../typeUtilities.js'\nimport { i18n } from './i18n.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n _SerializedHeadingNode\n>\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n ClientFeature: HeadingFeatureClient,\n clientFeatureProps: props,\n i18n,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({ converters, node, parent, req }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n req,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"names":["HeadingNode","HeadingFeatureClient","createServerFeature","convertLexicalNodesToHTML","createNode","i18n","MarkdownTransformer","HeadingFeature","feature","props","enabledHeadingSizes","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","node","parent","req","childrenText","lexicalNodes","children","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"mappings":"AAMA,SAASA,WAAW,QAAQ,qBAAoB;AAEhD,+DAA+D;AAC/D,SAASC,oBAAoB,QAAQ,gCAA+B;AACpE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,mBAAmB,QAAQ,2BAA0B;AAa9D,OAAO,MAAMC,iBAAiBL,oBAI5B;IACAM,SAAS,CAAC,EAAEC,KAAK,EAAE;QACjB,IAAI,CAACA,OAAO;YACVA,QAAQ,CAAC;QACX;QAEA,MAAM,EAAEC,sBAAsB;YAAC;YAAM;YAAM;YAAM;YAAM;YAAM;SAAK,EAAE,GAAGD;QAEvE,OAAO;YACLE,eAAeV;YACfW,oBAAoBH;YACpBJ;YACAQ,sBAAsB;gBAACP,oBAAoBI;aAAqB;YAChEI,OAAO;gBACLV,WAAW;oBACTW,YAAY;wBACVC,MAAM;4BACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,GAAG,EAAE;gCACjD,MAAMC,eAAe,MAAMlB,0BAA0B;oCACnDY;oCACAO,cAAcJ,KAAKK,QAAQ;oCAC3BJ,QAAQ;wCACN,GAAGD,IAAI;wCACPC;oCACF;oCACAC;gCACF;gCAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;4BACnE;4BACAC,WAAW;gCAACzB,YAAY0B,OAAO;6BAAG;wBACpC;oBACF;oBACAR,MAAMlB;gBACR;aACD;YACD2B,6BAA6BlB;QAC/B;IACF;IACAmB,KAAK;AACP,GAAE"}
1
+ {"version":3,"sources":["../../../src/features/heading/feature.server.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { HeadingFeatureClient } from '../../exports/client/index.js'\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { createNode } from '../typeUtilities.js'\nimport { i18n } from './i18n.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n _SerializedHeadingNode\n>\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n ClientFeature: HeadingFeatureClient,\n clientFeatureProps: props,\n i18n,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"names":["HeadingNode","HeadingFeatureClient","createServerFeature","convertLexicalNodesToHTML","createNode","i18n","MarkdownTransformer","HeadingFeature","feature","props","enabledHeadingSizes","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"mappings":"AAMA,SAASA,WAAW,QAAQ,qBAAoB;AAEhD,+DAA+D;AAC/D,SAASC,oBAAoB,QAAQ,gCAA+B;AACpE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,mBAAmB,QAAQ,2BAA0B;AAa9D,OAAO,MAAMC,iBAAiBL,oBAI5B;IACAM,SAAS,CAAC,EAAEC,KAAK,EAAE;QACjB,IAAI,CAACA,OAAO;YACVA,QAAQ,CAAC;QACX;QAEA,MAAM,EAAEC,sBAAsB;YAAC;YAAM;YAAM;YAAM;YAAM;YAAM;SAAK,EAAE,GAAGD;QAEvE,OAAO;YACLE,eAAeV;YACfW,oBAAoBH;YACpBJ;YACAQ,sBAAsB;gBAACP,oBAAoBI;aAAqB;YAChEI,OAAO;gBACLV,WAAW;oBACTW,YAAY;wBACVC,MAAM;4BACJC,WAAW,OAAO,EAChBF,UAAU,EACVG,KAAK,EACLC,IAAI,EACJC,cAAc,EACdC,MAAM,EACNC,GAAG,EACHC,gBAAgB,EACjB;gCACC,MAAMC,eAAe,MAAMrB,0BAA0B;oCACnDY;oCACAG;oCACAO,cAAcN,KAAKO,QAAQ;oCAC3BN;oCACAC,QAAQ;wCACN,GAAGF,IAAI;wCACPE;oCACF;oCACAC;oCACAC;gCACF;gCAEA,OAAO,MAAMJ,MAAMQ,MAAM,MAAMH,eAAe,OAAOL,MAAMQ,MAAM;4BACnE;4BACAC,WAAW;gCAAC5B,YAAY6B,OAAO;6BAAG;wBACpC;oBACF;oBACAV,MAAMnB;gBACR;aACD;YACD8B,6BAA6BrB;QAC/B;IACF;IACAsB,KAAK;AACP,GAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAU,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAoBjG,MAAM,MAAM,6BAA6B,GACrC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,MAAM,CAAC,EACH,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,eAAe,CAAA;QACvB,aAAa,EAAE,kBAAkB,EAAE,CAAA;KACpC,KAAK,CAAC,KAAK,GAAG,kBAAkB,CAAC,EAAE,CAAC,GACrC,KAAK,EAAE,CAAA;IACX;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,6BAA6B,CAAA;AAEjC,eAAO,MAAM,WAAW,0IAiItB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAU,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAoBjG,MAAM,MAAM,6BAA6B,GACrC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;IAGtC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAA;CACtC,CAAA;AAEL,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,MAAM,CAAC,EACH,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,eAAe,CAAA;QACvB,aAAa,EAAE,kBAAkB,EAAE,CAAA;KACpC,KAAK,CAAC,KAAK,GAAG,kBAAkB,CAAC,EAAE,CAAC,GACrC,KAAK,EAAE,CAAA;IACX;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,6BAA6B,CAAA;AAEjC,eAAO,MAAM,WAAW,0IAuJtB,CAAA"}
@@ -52,15 +52,18 @@ export const LinkFeature = createServerFeature({
52
52
  createNode({
53
53
  converters: {
54
54
  html: {
55
- converter: async ({ converters, node, parent, req })=>{
55
+ converter: async ({ converters, draft, node, overrideAccess, parent, req, showHiddenFields })=>{
56
56
  const childrenText = await convertLexicalNodesToHTML({
57
57
  converters,
58
+ draft,
58
59
  lexicalNodes: node.children,
60
+ overrideAccess,
59
61
  parent: {
60
62
  ...node,
61
63
  parent
62
64
  },
63
- req
65
+ req,
66
+ showHiddenFields
64
67
  });
65
68
  const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
66
69
  const target = node.fields.newTab ? ' target="_blank"' : '';
@@ -84,15 +87,18 @@ export const LinkFeature = createServerFeature({
84
87
  createNode({
85
88
  converters: {
86
89
  html: {
87
- converter: async ({ converters, node, parent, req })=>{
90
+ converter: async ({ converters, draft, node, overrideAccess, parent, req, showHiddenFields })=>{
88
91
  const childrenText = await convertLexicalNodesToHTML({
89
92
  converters,
93
+ draft,
90
94
  lexicalNodes: node.children,
95
+ overrideAccess,
91
96
  parent: {
92
97
  ...node,
93
98
  parent
94
99
  },
95
- req
100
+ req,
101
+ showHiddenFields
96
102
  });
97
103
  const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
98
104
  const target = node.fields.newTab ? ' target="_blank"' : '';