@payloadcms/richtext-lexical 4.0.0-internal.c7d5de4 → 4.0.0-internal.cb69780

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 (432) hide show
  1. package/dist/exports/client/Field-TS5CRYHE.js +2 -0
  2. package/dist/exports/client/Field-TS5CRYHE.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
  6. package/dist/exports/client/chunk-43E5QYAA.js +2 -0
  7. package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
  8. package/dist/exports/client/{chunk-ESITTE3C.js → chunk-ZFGDYZDE.js} +2 -2
  9. package/dist/exports/client/{chunk-ESITTE3C.js.map → chunk-ZFGDYZDE.js.map} +2 -2
  10. package/dist/exports/client/component-D5QLYS7W.js +2 -0
  11. package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
  12. package/dist/exports/client/componentInline-55HZXGUS.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -1
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +26 -26
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  18. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  19. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  20. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  21. package/dist/features/blocks/client/component/index.d.ts +0 -6
  22. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  23. package/dist/features/blocks/client/component/index.js +133 -76
  24. package/dist/features/blocks/client/component/index.js.map +1 -1
  25. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  26. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  27. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  28. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  29. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  30. package/dist/features/blocks/client/componentInline/index.js +2 -2
  31. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  32. package/dist/features/blocks/server/index.js +2 -2
  33. package/dist/features/blocks/server/index.js.map +1 -1
  34. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  35. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  36. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  37. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  38. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  39. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  40. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  41. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  42. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  43. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  44. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  45. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  46. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  47. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  48. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  49. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  50. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  51. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  52. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  53. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  54. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  55. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  56. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  57. package/dist/features/heading/constants.d.ts +2 -0
  58. package/dist/features/heading/constants.d.ts.map +1 -0
  59. package/dist/features/heading/constants.js +2 -0
  60. package/dist/features/heading/constants.js.map +1 -0
  61. package/dist/features/heading/server/index.d.ts.map +1 -1
  62. package/dist/features/heading/server/index.js +5 -1
  63. package/dist/features/heading/server/index.js.map +1 -1
  64. package/dist/features/heading/server/validate.d.ts +6 -0
  65. package/dist/features/heading/server/validate.d.ts.map +1 -0
  66. package/dist/features/heading/server/validate.js +15 -0
  67. package/dist/features/heading/server/validate.js.map +1 -0
  68. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  69. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  70. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
  71. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  72. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  73. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  74. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  75. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  76. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  77. package/dist/features/indent/client/IndentPlugin.js +122 -1
  78. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  79. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  80. package/dist/features/indent/server/i18n.js +74 -37
  81. package/dist/features/indent/server/i18n.js.map +1 -1
  82. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  83. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +6 -3
  84. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  85. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  86. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  87. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  88. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  89. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  90. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  91. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  92. package/dist/features/link/server/index.js +2 -2
  93. package/dist/features/link/server/index.js.map +1 -1
  94. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  95. package/dist/features/lists/checklist/server/index.js +5 -2
  96. package/dist/features/lists/checklist/server/index.js.map +1 -1
  97. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  98. package/dist/features/lists/orderedList/server/index.js +5 -2
  99. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  100. package/dist/features/lists/shared/constants.d.ts +2 -0
  101. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  102. package/dist/features/lists/shared/constants.js +2 -0
  103. package/dist/features/lists/shared/constants.js.map +1 -0
  104. package/dist/features/lists/shared/validate.d.ts +5 -0
  105. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  106. package/dist/features/lists/shared/validate.js +15 -0
  107. package/dist/features/lists/shared/validate.js.map +1 -0
  108. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  109. package/dist/features/lists/unorderedList/server/index.js +5 -2
  110. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  111. package/dist/features/relationship/client/index.d.ts +2 -2
  112. package/dist/features/relationship/client/index.d.ts.map +1 -1
  113. package/dist/features/relationship/client/index.js.map +1 -1
  114. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  115. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  116. package/dist/features/relationship/client/plugins/index.js +27 -31
  117. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  118. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  119. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  120. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  121. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  122. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  123. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  124. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  125. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  126. package/dist/features/relationship/server/index.d.ts +8 -1
  127. package/dist/features/relationship/server/index.d.ts.map +1 -1
  128. package/dist/features/relationship/server/index.js +28 -11
  129. package/dist/features/relationship/server/index.js.map +1 -1
  130. package/dist/features/relationship/server/schema.d.ts +2 -2
  131. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  132. package/dist/features/relationship/server/schema.js +5 -10
  133. package/dist/features/relationship/server/schema.js.map +1 -1
  134. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  135. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  136. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  137. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  138. package/dist/features/table/client/index.d.ts.map +1 -0
  139. package/dist/features/table/client/index.js.map +1 -0
  140. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  141. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  142. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  143. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  144. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  145. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  146. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  147. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  148. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  149. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  150. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  151. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  152. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  153. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  154. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  155. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  156. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  157. package/dist/features/table/client/utils/debounce.js.map +1 -0
  158. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  159. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  160. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  161. package/dist/features/table/markdownTransformer.js.map +1 -0
  162. package/dist/features/table/server/index.d.ts +3 -0
  163. package/dist/features/table/server/index.d.ts.map +1 -0
  164. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  165. package/dist/features/table/server/index.js.map +1 -0
  166. package/dist/features/table/server/schema.d.ts.map +1 -0
  167. package/dist/features/table/server/schema.js.map +1 -0
  168. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  169. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  170. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  171. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  172. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  173. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  174. package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
  175. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  176. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  177. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  178. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  179. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  180. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  181. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  182. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  183. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -13
  184. package/dist/features/typesServer.d.ts +1 -1
  185. package/dist/features/typesServer.d.ts.map +1 -1
  186. package/dist/features/typesServer.js.map +1 -1
  187. package/dist/features/upload/client/component/index.js +2 -1
  188. package/dist/features/upload/client/component/index.js.map +1 -1
  189. package/dist/features/upload/client/index.d.ts +3 -2
  190. package/dist/features/upload/client/index.d.ts.map +1 -1
  191. package/dist/features/upload/client/index.js.map +1 -1
  192. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  193. package/dist/features/upload/client/plugin/index.js +47 -52
  194. package/dist/features/upload/client/plugin/index.js.map +1 -1
  195. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  196. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  197. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  198. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  199. package/dist/features/upload/server/index.d.ts +6 -2
  200. package/dist/features/upload/server/index.d.ts.map +1 -1
  201. package/dist/features/upload/server/index.js +20 -16
  202. package/dist/features/upload/server/index.js.map +1 -1
  203. package/dist/features/upload/server/schema.d.ts +2 -2
  204. package/dist/features/upload/server/schema.d.ts.map +1 -1
  205. package/dist/features/upload/server/schema.js +4 -8
  206. package/dist/features/upload/server/schema.js.map +1 -1
  207. package/dist/features/upload/server/validate.d.ts +2 -2
  208. package/dist/features/upload/server/validate.d.ts.map +1 -1
  209. package/dist/features/upload/server/validate.js +3 -0
  210. package/dist/features/upload/server/validate.js.map +1 -1
  211. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  212. package/dist/field/Diff/converters/listitem/index.js +2 -1
  213. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  214. package/dist/field/Diff/index.d.ts +3 -2
  215. package/dist/field/Diff/index.d.ts.map +1 -1
  216. package/dist/field/Diff/index.js +1 -0
  217. package/dist/field/Diff/index.js.map +1 -1
  218. package/dist/field/RenderLexical/index.d.ts +3 -1
  219. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  220. package/dist/field/RenderLexical/index.js +23 -23
  221. package/dist/field/RenderLexical/index.js.map +1 -1
  222. package/dist/field/ViewSelector.d.ts.map +1 -1
  223. package/dist/field/ViewSelector.js +1 -0
  224. package/dist/field/ViewSelector.js.map +1 -1
  225. package/dist/field/bundled.css +1 -1
  226. package/dist/field/index.css +10 -10
  227. package/dist/i18n.d.ts.map +1 -1
  228. package/dist/i18n.js +68 -0
  229. package/dist/i18n.js.map +1 -1
  230. package/dist/index.d.ts +2 -2
  231. package/dist/index.d.ts.map +1 -1
  232. package/dist/index.js +5 -5
  233. package/dist/index.js.map +1 -1
  234. package/dist/lexical/LexicalEditor.css +29 -20
  235. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  236. package/dist/lexical/LexicalEditor.js +61 -64
  237. package/dist/lexical/LexicalEditor.js.map +1 -1
  238. package/dist/lexical/config/server/loader.d.ts +1 -1
  239. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  240. package/dist/lexical/config/server/loader.js +2 -2
  241. package/dist/lexical/config/server/loader.js.map +1 -1
  242. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  243. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  244. package/dist/lexical/config/server/sanitize.js +2 -2
  245. package/dist/lexical/config/server/sanitize.js.map +1 -1
  246. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  247. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  248. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  249. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  250. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  251. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  252. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  253. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  254. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  255. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  256. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  257. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  258. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
  259. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  260. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  261. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  262. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  263. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  264. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  265. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  266. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  267. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  268. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  269. package/dist/lexical/ui/ContentEditable.css +16 -15
  270. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  271. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  272. package/dist/lexical/ui/ContentEditable.js +9 -6
  273. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  274. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  275. package/dist/lexical/ui/icons/H3/index.js +13 -6
  276. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  277. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  278. package/dist/lexical/ui/icons/H4/index.js +13 -6
  279. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  280. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  281. package/dist/lexical/ui/icons/H5/index.js +13 -6
  282. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  283. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  284. package/dist/lexical/ui/icons/H6/index.js +13 -6
  285. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  286. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  287. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  288. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  289. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  290. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  291. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  292. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  293. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  294. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  295. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  296. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  297. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  298. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  299. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  300. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  301. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  302. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  303. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  304. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  305. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  306. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  307. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  308. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  309. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  310. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  311. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  312. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  313. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  314. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  315. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  316. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  317. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  318. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  319. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  320. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  321. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  322. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  323. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  324. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  325. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  326. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  327. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  328. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  329. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  330. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  331. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  332. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  333. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  334. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  335. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  336. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  337. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  338. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  339. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  340. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  341. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  342. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  343. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  344. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  345. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  346. package/dist/types/index.d.ts +1 -1
  347. package/dist/types/index.d.ts.map +1 -1
  348. package/dist/types/index.js.map +1 -1
  349. package/dist/types/nodeTypes.d.ts +1 -1
  350. package/dist/types/nodeTypes.d.ts.map +1 -1
  351. package/dist/types/nodeTypes.js.map +1 -1
  352. package/dist/utilities/createServerFeature.d.ts +1 -1
  353. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  354. package/dist/utilities/createServerFeature.js +2 -2
  355. package/dist/utilities/createServerFeature.js.map +1 -1
  356. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  357. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  358. package/dist/utilities/editorConfigFactory.js +9 -9
  359. package/dist/utilities/editorConfigFactory.js.map +1 -1
  360. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  361. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  362. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  363. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  364. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  365. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  366. package/package.json +97 -23
  367. package/dist/dependencyChecker.spec.js +0 -16
  368. package/dist/dependencyChecker.spec.js.map +0 -1
  369. package/dist/exports/client/Field-QGSHF22S.js +0 -2
  370. package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
  371. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  372. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  373. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  374. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  375. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  376. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  377. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  378. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  379. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  380. package/dist/features/experimental_table/client/index.js.map +0 -1
  381. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  382. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  383. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  384. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  385. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  386. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  387. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  388. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  389. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  390. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  391. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  392. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  393. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  394. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  395. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  396. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  397. package/dist/features/experimental_table/server/index.d.ts +0 -3
  398. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  399. package/dist/features/experimental_table/server/index.js.map +0 -1
  400. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  401. package/dist/features/experimental_table/server/schema.js.map +0 -1
  402. package/dist/features/link/markdownTransformer.spec.js +0 -195
  403. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  404. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  405. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  406. package/dist/lexical/utils/url.spec.js +0 -114
  407. package/dist/lexical/utils/url.spec.js.map +0 -1
  408. package/dist/utilities/jsx/jsx.spec.js +0 -178
  409. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  410. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-55HZXGUS.js.map} +0 -0
  411. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  412. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  413. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
  414. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  415. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  416. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  417. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  418. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  419. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
  420. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  421. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  422. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  423. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  424. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  425. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  426. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  427. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  428. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  429. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  430. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  431. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  432. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":["formatSchema","versionSchema","filterEnabledRelationshipCollections","SERIALIZED_RELATIONSHIP_NODE_TS","SERIALIZED_RELATIONSHIP_NODE_INPUT_TS","createRelationshipNodeJSONSchema","props","collectionIDFieldTypes","config","typeStringDefinitions","variant","isInput","add","enabledCollections","collections","disabledCollections","uploads","variants","map","collection","slug","idType","type","additionalProperties","properties","const","format","relationTo","value","description","oneOf","$ref","version","required","schema","length","slugUnion","c","join","baseSchema","tsName","tsType"],"sources":["../../../../src/features/relationship/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type {\n CollectionSlug,\n DataFromCollectionSlug,\n IDTypeForCollectionSlug,\n UploadCollectionSlug,\n} from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { RelationshipFeatureProps } from './index.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\nimport { filterEnabledRelationshipCollections } from '../shared/filterEnabledRelationshipCollections.js'\n\nexport type RelationshipData = {\n [TCollectionSlug in CollectionSlug]: {\n relationTo: TCollectionSlug\n value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>\n }\n}[CollectionSlug]\n\n/**\n * Exclude upload collection slugs. This matches runtime behavior, as well as the json schema.\n */\nexport type NonUploadCollectionSlug = [Exclude<CollectionSlug, UploadCollectionSlug>] extends [\n never,\n]\n ? CollectionSlug\n : Exclude<CollectionSlug, UploadCollectionSlug>\n\nexport type SerializedRelationshipNode<TSlugs extends CollectionSlug = NonUploadCollectionSlug> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>\n }\n}[TSlugs] & {\n format: LexicalElementFormat\n type: 'relationship'\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedRelationshipNode` declared above. */\nconst SERIALIZED_RELATIONSHIP_NODE_TS = `export type SerializedRelationshipNode<TSlugs extends keyof Config['collections']> = {\n type: 'relationship';\n format: LexicalElementFormat;\n version: number;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\n/** Input variant of `SerializedRelationshipNode`: `value` is ID-only (you only ever write an ID). */\nconst SERIALIZED_RELATIONSHIP_NODE_INPUT_TS = `export type SerializedRelationshipNodeInput<TSlugs extends keyof Config['collections']> = {\n type: 'relationship';\n format: LexicalElementFormat;\n version: number;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'];\n };\n}[TSlugs];`\n\nexport const createRelationshipNodeJSONSchema =\n (props: RelationshipFeatureProps | undefined): JSONSchemaFn =>\n ({ collectionIDFieldTypes, config, typeStringDefinitions, variant }) => {\n const isInput = variant === 'input'\n typeStringDefinitions.add(\n isInput ? SERIALIZED_RELATIONSHIP_NODE_INPUT_TS : SERIALIZED_RELATIONSHIP_NODE_TS,\n )\n const enabledCollections = config?.collections\n ? filterEnabledRelationshipCollections(config.collections, {\n disabledCollections: props?.disabledCollections,\n enabledCollections: props?.enabledCollections,\n uploads: false,\n })\n : []\n\n const variants: JSONSchema4[] = enabledCollections.map((collection) => {\n const slug = collection.slug\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'relationship' },\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: isInput\n ? { type: idType, description: 'The related document ID.' }\n : {\n description:\n 'The related document by ID (string or number). Populated to the full document when read at depth > 0.',\n oneOf: [{ type: idType }, { $ref: `#/$defs/${slug}` }],\n },\n version: versionSchema,\n },\n required: ['format', 'relationTo', 'type', 'value', 'version'],\n }\n })\n\n let schema: JSONSchema4\n if (variants.length === 0) {\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'relationship' },\n version: versionSchema,\n },\n required: ['type', 'version'],\n }\n } else {\n const slugUnion = enabledCollections.map((c) => `'${c.slug}'`).join(' | ')\n const baseSchema: JSONSchema4 = variants.length === 1 ? variants[0]! : { oneOf: variants }\n const tsName = isInput ? 'SerializedRelationshipNodeInput' : 'SerializedRelationshipNode'\n schema = { ...baseSchema, tsType: `${tsName}<${slugUnion}>` }\n }\n\n return schema\n }\n"],"mappings":"AAYA,SAASA,YAAY,EAAEC,aAAa,QAAQ;AAC5C,SAASC,oCAAoC,QAAQ;AA6BrD;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;WAS7B;AAEX;AACA,MAAMC,qCAAA,GAAwC;;;;;;;;;WASnC;AAEX,OAAO,MAAMC,gCAAA,GACVC,KAAA,IACD,CAAC;EAAEC,sBAAsB;EAAEC,MAAM;EAAEC,qBAAqB;EAAEC;AAAO,CAAE;EACjE,MAAMC,OAAA,GAAUD,OAAA,KAAY;EAC5BD,qBAAA,CAAsBG,GAAG,CACvBD,OAAA,GAAUP,qCAAA,GAAwCD,+BAAA;EAEpD,MAAMU,kBAAA,GAAqBL,MAAA,EAAQM,WAAA,GAC/BZ,oCAAA,CAAqCM,MAAA,CAAOM,WAAW,EAAE;IACvDC,mBAAA,EAAqB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tB,QAAA,CAASkB,MAAM,KAAK,IAAIlB,QAAQ,CAAC,EAAE,GAAI;MAAEa,KAAA,EAAOb;IAAS;IACzF,MAAMuB,MAAA,GAAS7B,OAAA,GAAU,oCAAoC;IAC7DuB,MAAA,GAAS;MAAE,GAAGK,UAAU;MAAEE,MAAA,EAAQ,GAAGD,MAAA,IAAUJ,SAAA;IAAa;EAC9D;EAEA,OAAOF,MAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"schema.js","names":["formatSchema","versionSchema","SERIALIZED_RELATIONSHIP_NODE_TS","SERIALIZED_RELATIONSHIP_NODE_INPUT_TS","createRelationshipNodeJSONSchema","props","collectionIDFieldTypes","typeStringDefinitions","variant","isInput","add","enabledCollectionSlugs","variants","map","slug","idType","type","additionalProperties","properties","const","format","relationTo","value","description","oneOf","$ref","version","required","schema","length","slugUnion","join","baseSchema","tsName","tsType"],"sources":["../../../../src/features/relationship/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type {\n CollectionSlug,\n DataFromCollectionSlug,\n IDTypeForCollectionSlug,\n UploadCollectionSlug,\n} from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { RelationshipFeatureServerProps } from './index.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\n\nexport type RelationshipData = {\n [TCollectionSlug in CollectionSlug]: {\n relationTo: TCollectionSlug\n value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>\n }\n}[CollectionSlug]\n\n/**\n * Exclude upload collection slugs. This matches runtime behavior, as well as the json schema.\n */\nexport type NonUploadCollectionSlug = [Exclude<CollectionSlug, UploadCollectionSlug>] extends [\n never,\n]\n ? CollectionSlug\n : Exclude<CollectionSlug, UploadCollectionSlug>\n\nexport type SerializedRelationshipNode<TSlugs extends CollectionSlug = NonUploadCollectionSlug> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>\n }\n}[TSlugs] & {\n format: LexicalElementFormat\n type: 'relationship'\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedRelationshipNode` declared above. */\nconst SERIALIZED_RELATIONSHIP_NODE_TS = `export type SerializedRelationshipNode<TSlugs extends keyof Config['collections']> = {\n type: 'relationship';\n format: LexicalElementFormat;\n version: number;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\n/** Input variant of `SerializedRelationshipNode`: `value` is ID-only (you only ever write an ID). */\nconst SERIALIZED_RELATIONSHIP_NODE_INPUT_TS = `export type SerializedRelationshipNodeInput<TSlugs extends keyof Config['collections']> = {\n type: 'relationship';\n format: LexicalElementFormat;\n version: number;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'];\n };\n}[TSlugs];`\n\nexport const createRelationshipNodeJSONSchema =\n (props: RelationshipFeatureServerProps): JSONSchemaFn =>\n ({ collectionIDFieldTypes, typeStringDefinitions, variant }) => {\n const isInput = variant === 'input'\n typeStringDefinitions.add(\n isInput ? SERIALIZED_RELATIONSHIP_NODE_INPUT_TS : SERIALIZED_RELATIONSHIP_NODE_TS,\n )\n const { enabledCollectionSlugs } = props\n\n const variants: JSONSchema4[] = enabledCollectionSlugs.map((slug) => {\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'relationship' },\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: isInput\n ? { type: idType, description: 'The related document ID.' }\n : {\n description:\n 'The related document by ID (string or number). Populated to the full document when read at depth > 0.',\n oneOf: [{ type: idType }, { $ref: `#/$defs/${slug}` }],\n },\n version: versionSchema,\n },\n required: ['format', 'relationTo', 'type', 'value', 'version'],\n }\n })\n\n let schema: JSONSchema4\n if (variants.length === 0) {\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'relationship' },\n version: versionSchema,\n },\n required: ['type', 'version'],\n }\n } else {\n const slugUnion = enabledCollectionSlugs.map((slug) => `'${slug}'`).join(' | ')\n const baseSchema: JSONSchema4 = variants.length === 1 ? variants[0]! : { oneOf: variants }\n const tsName = isInput ? 'SerializedRelationshipNodeInput' : 'SerializedRelationshipNode'\n schema = { ...baseSchema, tsType: `${tsName}<${slugUnion}>` }\n }\n\n return schema\n }\n"],"mappings":"AAYA,SAASA,YAAY,EAAEC,aAAa,QAAQ;AA6B5C;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;WAS7B;AAEX;AACA,MAAMC,qCAAA,GAAwC;;;;;;;;;WASnC;AAEX,OAAO,MAAMC,gCAAA,GACVC,KAAA,IACD,CAAC;EAAEC,sBAAsB;EAAEC,qBAAqB;EAAEC;AAAO,CAAE;EACzD,MAAMC,OAAA,GAAUD,OAAA,KAAY;EAC5BD,qBAAA,CAAsBG,GAAG,CACvBD,OAAA,GAAUN,qCAAA,GAAwCD,+BAAA;EAEpD,MAAM;IAAES;EAAsB,CAAE,GAAGN,KAAA;EAEnC,MAAMO,QAAA,GAA0BD,sBAAA,CAAuBE,GAAG,CAAEC,IAAA;IAC1D,MAAMC,MAAA,GAA8BT,sBAAsB,CAACQ,IAAA,CAAK,IAAI;IACpE,OAAO;MACLE,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBC,UAAA,EAAY;QACVF,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUG,KAAA,EAAO;QAAe;QAC9CC,MAAA,EAAQpB,YAAA;QACRqB,UAAA,EAAY;UAAEL,IAAA,EAAM;UAAUG,KAAA,EAAOL;QAAK;QAC1CQ,KAAA,EAAOb,OAAA,GACH;UAAEO,IAAA,EAAMD,MAAA;UAAQQ,WAAA,EAAa;QAA2B,IACxD;UACEA,WAAA,EACE;UACFC,KAAA,EAAO,CAAC;YAAER,IAAA,EAAMD;UAAO,GAAG;YAAEU,IAAA,EAAM,WAAWX,IAAA;UAAO;QACtD;QACJY,OAAA,EAASzB;MACX;MACA0B,QAAA,EAAU,CAAC,UAAU,cAAc,QAAQ,SAAS;IACtD;EACF;EAEA,IAAIC,MAAA;EACJ,IAAIhB,QAAA,CAASiB,MAAM,KAAK,GAAG;IACzBD,MAAA,GAAS;MACPZ,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBC,UAAA,EAAY;QACVF,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUG,KAAA,EAAO;QAAe;QAC9CO,OAAA,EAASzB;MACX;MACA0B,QAAA,EAAU,CAAC,QAAQ;IACrB;EACF,OAAO;IACL,MAAMG,SAAA,GAAYnB,sBAAA,CAAuBE,GAAG,CAAEC,IAAA,IAAS,IAAIA,IAAA,GAAO,EAAEiB,IAAI,CAAC;IACzE,MAAMC,UAAA,GAA0BpB,QAAA,CAASiB,MAAM,KAAK,IAAIjB,QAAQ,CAAC,EAAE,GAAI;MAAEY,KAAA,EAAOZ;IAAS;IACzF,MAAMqB,MAAA,GAASxB,OAAA,GAAU,oCAAoC;IAC7DmB,MAAA,GAAS;MAAE,GAAGI,UAAU;MAAEE,MAAA,EAAQ,GAAGD,MAAA,IAAUH,SAAA;IAAa;EAC9D;EAEA,OAAOF,MAAA;AACT","ignoreList":[]}
@@ -12,12 +12,7 @@ export type FilterEnabledRelationshipCollectionsOptions = {
12
12
  enabledCollections?: readonly string[];
13
13
  /** When `true`, only upload-enabled collections; when `false`, only non-upload ones. */
14
14
  uploads: boolean;
15
- /**
16
- * Slugs the current user can see, supplied by the client at runtime.
17
- * Server-side type generation passes `undefined` to skip the check.
18
- */
19
- visibleSlugs?: readonly string[];
20
15
  };
21
- export declare const filterEnabledRelationshipCollections: <TCollection extends CollectionLike>(collections: readonly TCollection[], { disabledCollections, enabledCollections, uploads, visibleSlugs, }: FilterEnabledRelationshipCollectionsOptions) => TCollection[];
16
+ export declare const filterEnabledRelationshipCollections: <TCollection extends CollectionLike>(collections: readonly TCollection[], { disabledCollections, enabledCollections, uploads }: FilterEnabledRelationshipCollectionsOptions) => TCollection[];
22
17
  export {};
23
18
  //# sourceMappingURL=filterEnabledRelationshipCollections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterEnabledRelationshipCollections.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE;QACN,0BAA0B,CAAC,EAAE,OAAO,CAAA;KACrC,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,2CAA2C,GAAG;IACxD,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,WAAW,SAAS,cAAc,eACxE,SAAS,WAAW,EAAE,uEAMhC,2CAA2C,KAC7C,WAAW,EA4Bb,CAAA"}
1
+ {"version":3,"file":"filterEnabledRelationshipCollections.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE;QACN,0BAA0B,CAAC,EAAE,OAAO,CAAA;KACrC,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,2CAA2C,GAAG;IACxD,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,WAAW,SAAS,cAAc,eACxE,SAAS,WAAW,EAAE,wDACmB,2CAA2C,KAChG,WAAW,EAwBb,CAAA"}
@@ -1,8 +1,7 @@
1
1
  export const filterEnabledRelationshipCollections = (collections, {
2
2
  disabledCollections,
3
3
  enabledCollections,
4
- uploads,
5
- visibleSlugs
4
+ uploads
6
5
  }) => {
7
6
  const whitelistSet = enabledCollections?.length ? new Set(enabledCollections) : null;
8
7
  const blacklistSet = disabledCollections?.length ? new Set(disabledCollections) : null;
@@ -12,9 +11,6 @@ export const filterEnabledRelationshipCollections = (collections, {
12
11
  admin,
13
12
  upload
14
13
  } = collection;
15
- if (visibleSlugs && !visibleSlugs.includes(slug)) {
16
- return false;
17
- }
18
14
  if (uploads) {
19
15
  if (!admin?.enableRichTextRelationship || !upload) {
20
16
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"filterEnabledRelationshipCollections.js","names":["filterEnabledRelationshipCollections","collections","disabledCollections","enabledCollections","uploads","visibleSlugs","whitelistSet","length","Set","blacklistSet","filter","collection","slug","admin","upload","includes","enableRichTextRelationship","has"],"sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"sourcesContent":["type CollectionLike = {\n admin?: {\n enableRichTextRelationship?: boolean\n }\n slug: string\n upload?: unknown\n}\n\nexport type FilterEnabledRelationshipCollectionsOptions = {\n /** `disabledCollections` feature prop — slug blacklist. */\n disabledCollections?: readonly string[]\n /** `enabledCollections` feature prop — slug whitelist. */\n enabledCollections?: readonly string[]\n /** When `true`, only upload-enabled collections; when `false`, only non-upload ones. */\n uploads: boolean\n /**\n * Slugs the current user can see, supplied by the client at runtime.\n * Server-side type generation passes `undefined` to skip the check.\n */\n visibleSlugs?: readonly string[]\n}\n\nexport const filterEnabledRelationshipCollections = <TCollection extends CollectionLike>(\n collections: readonly TCollection[],\n {\n disabledCollections,\n enabledCollections,\n uploads,\n visibleSlugs,\n }: FilterEnabledRelationshipCollectionsOptions,\n): TCollection[] => {\n const whitelistSet = enabledCollections?.length ? new Set(enabledCollections) : null\n const blacklistSet = disabledCollections?.length ? new Set(disabledCollections) : null\n\n return collections.filter((collection) => {\n const { slug, admin, upload } = collection\n\n if (visibleSlugs && !visibleSlugs.includes(slug)) {\n return false\n }\n\n if (uploads) {\n if (!admin?.enableRichTextRelationship || !upload) {\n return false\n }\n } else if (upload || !admin?.enableRichTextRelationship) {\n return false\n }\n\n if (whitelistSet && !whitelistSet.has(slug)) {\n return false\n }\n if (blacklistSet && blacklistSet.has(slug)) {\n return false\n }\n\n return true\n })\n}\n"],"mappings":"AAsBA,OAAO,MAAMA,oCAAA,GAAuCA,CAClDC,WAAA,EACA;EACEC,mBAAmB;EACnBC,kBAAkB;EAClBC,OAAO;EACPC;AAAY,CACgC;EAE9C,MAAMC,YAAA,GAAeH,kBAAA,EAAoBI,MAAA,GAAS,IAAIC,GAAA,CAAIL,kBAAA,IAAsB;EAChF,MAAMM,YAAA,GAAeP,mBAAA,EAAqBK,MAAA,GAAS,IAAIC,GAAA,CAAIN,mBAAA,IAAuB;EAElF,OAAOD,WAAA,CAAYS,MAAM,CAAEC,UAAA;IACzB,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC;IAAM,CAAE,GAAGH,UAAA;IAEhC,IAAIN,YAAA,IAAgB,CAACA,YAAA,CAAaU,QAAQ,CAACH,IAAA,GAAO;MAChD,OAAO;IACT;IAEA,IAAIR,OAAA,EAAS;MACX,IAAI,CAACS,KAAA,EAAOG,0BAAA,IAA8B,CAACF,MAAA,EAAQ;QACjD,OAAO;MACT;IACF,OAAO,IAAIA,MAAA,IAAU,CAACD,KAAA,EAAOG,0BAAA,EAA4B;MACvD,OAAO;IACT;IAEA,IAAIV,YAAA,IAAgB,CAACA,YAAA,CAAaW,GAAG,CAACL,IAAA,GAAO;MAC3C,OAAO;IACT;IACA,IAAIH,YAAA,IAAgBA,YAAA,CAAaQ,GAAG,CAACL,IAAA,GAAO;MAC1C,OAAO;IACT;IAEA,OAAO;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"filterEnabledRelationshipCollections.js","names":["filterEnabledRelationshipCollections","collections","disabledCollections","enabledCollections","uploads","whitelistSet","length","Set","blacklistSet","filter","collection","slug","admin","upload","enableRichTextRelationship","has"],"sources":["../../../../src/features/relationship/shared/filterEnabledRelationshipCollections.ts"],"sourcesContent":["type CollectionLike = {\n admin?: {\n enableRichTextRelationship?: boolean\n }\n slug: string\n upload?: unknown\n}\n\nexport type FilterEnabledRelationshipCollectionsOptions = {\n /** `disabledCollections` feature prop — slug blacklist. */\n disabledCollections?: readonly string[]\n /** `enabledCollections` feature prop — slug whitelist. */\n enabledCollections?: readonly string[]\n /** When `true`, only upload-enabled collections; when `false`, only non-upload ones. */\n uploads: boolean\n}\n\nexport const filterEnabledRelationshipCollections = <TCollection extends CollectionLike>(\n collections: readonly TCollection[],\n { disabledCollections, enabledCollections, uploads }: FilterEnabledRelationshipCollectionsOptions,\n): TCollection[] => {\n const whitelistSet = enabledCollections?.length ? new Set(enabledCollections) : null\n const blacklistSet = disabledCollections?.length ? new Set(disabledCollections) : null\n\n return collections.filter((collection) => {\n const { slug, admin, upload } = collection\n\n if (uploads) {\n if (!admin?.enableRichTextRelationship || !upload) {\n return false\n }\n } else if (upload || !admin?.enableRichTextRelationship) {\n return false\n }\n\n if (whitelistSet && !whitelistSet.has(slug)) {\n return false\n }\n if (blacklistSet && blacklistSet.has(slug)) {\n return false\n }\n\n return true\n })\n}\n"],"mappings":"AAiBA,OAAO,MAAMA,oCAAA,GAAuCA,CAClDC,WAAA,EACA;EAAEC,mBAAmB;EAAEC,kBAAkB;EAAEC;AAAO,CAA+C;EAEjG,MAAMC,YAAA,GAAeF,kBAAA,EAAoBG,MAAA,GAAS,IAAIC,GAAA,CAAIJ,kBAAA,IAAsB;EAChF,MAAMK,YAAA,GAAeN,mBAAA,EAAqBI,MAAA,GAAS,IAAIC,GAAA,CAAIL,mBAAA,IAAuB;EAElF,OAAOD,WAAA,CAAYQ,MAAM,CAAEC,UAAA;IACzB,MAAM;MAAEC,IAAI;MAAEC,KAAK;MAAEC;IAAM,CAAE,GAAGH,UAAA;IAEhC,IAAIN,OAAA,EAAS;MACX,IAAI,CAACQ,KAAA,EAAOE,0BAAA,IAA8B,CAACD,MAAA,EAAQ;QACjD,OAAO;MACT;IACF,OAAO,IAAIA,MAAA,IAAU,CAACD,KAAA,EAAOE,0BAAA,EAA4B;MACvD,OAAO;IACT;IAEA,IAAIT,YAAA,IAAgB,CAACA,YAAA,CAAaU,GAAG,CAACJ,IAAA,GAAO;MAC3C,OAAO;IACT;IACA,IAAIH,YAAA,IAAgBA,YAAA,CAAaO,GAAG,CAACJ,IAAA,GAAO;MAC1C,OAAO;IACT;IAEA,OAAO;EACT;AACF","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/table/client/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,8EAmD7B,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["TableCellNode","TableNode","TableRowNode","TableIcon","createClientFeature","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","PAYLOAD_TABLE","TableActionMenuPlugin","TableCellResizerPlugin","TableHoverActionsPlugin","OPEN_TABLE_DRAWER_COMMAND","TableContext","TablePlugin","TableFeatureClient","markdownTransformers","nodes","plugins","Component","position","providers","slashMenu","groups","Icon","key","keywords","label","onSelect","editor","dispatchCommand","toolbarFixed","ChildComponent"],"sources":["../../../../src/features/table/client/index.ts"],"sourcesContent":["'use client'\n\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table'\n\nimport { TableIcon } from '../../../lexical/ui/icons/Table/index.js'\nimport { createClientFeature } from '../../../utilities/createClientFeature.js'\nimport { slashMenuBasicGroupWithItems } from '../../shared/slashMenu/basicGroup.js'\nimport { toolbarAddDropdownGroupWithItems } from '../../shared/toolbar/addDropdownGroup.js'\nimport { PAYLOAD_TABLE } from '../markdownTransformer.js'\nimport { TableActionMenuPlugin } from './plugins/TableActionMenuPlugin/index.js'\nimport { TableCellResizerPlugin } from './plugins/TableCellResizerPlugin/index.js'\nimport { TableHoverActionsPlugin } from './plugins/TableHoverActionsPlugin/index.js'\nimport {\n OPEN_TABLE_DRAWER_COMMAND,\n TableContext,\n TablePlugin,\n} from './plugins/TablePlugin/index.js'\n\nexport const TableFeatureClient = createClientFeature({\n markdownTransformers: [PAYLOAD_TABLE],\n nodes: [TableNode, TableCellNode, TableRowNode],\n plugins: [\n {\n Component: TablePlugin,\n position: 'normal',\n },\n {\n Component: TableCellResizerPlugin,\n position: 'normal',\n },\n {\n Component: TableActionMenuPlugin,\n position: 'floatingAnchorElem',\n },\n {\n Component: TableHoverActionsPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n providers: [TableContext],\n slashMenu: {\n groups: [\n slashMenuBasicGroupWithItems([\n {\n Icon: TableIcon,\n key: 'table',\n keywords: ['table'],\n label: 'Table',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {})\n },\n },\n ]),\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: TableIcon,\n key: 'table',\n label: 'Table',\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_TABLE_DRAWER_COMMAND, {})\n },\n },\n ]),\n ],\n },\n})\n"],"mappings":"AAAA;;AAEA,SAASA,aAAa,EAAEC,SAAS,EAAEC,YAAY,QAAQ;AAEvD,SAASC,SAAS,QAAQ;AAC1B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,gCAAgC,QAAQ;AACjD,SAASC,aAAa,QAAQ;AAC9B,SAASC,qBAAqB,QAAQ;AACtC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,uBAAuB,QAAQ;AACxC,SACEC,yBAAyB,EACzBC,YAAY,EACZC,WAAW,QACN;AAEP,OAAO,MAAMC,kBAAA,GAAqBV,mBAAA,CAAoB;EACpDW,oBAAA,EAAsB,CAACR,aAAA,CAAc;EACrCS,KAAA,EAAO,CAACf,SAAA,EAAWD,aAAA,EAAeE,YAAA,CAAa;EAC/Ce,OAAA,EAAS,CACP;IACEC,SAAA,EAAWL,WAAA;IACXM,QAAA,EAAU;EACZ,GACA;IACED,SAAA,EAAWT,sBAAA;IACXU,QAAA,EAAU;EACZ,GACA;IACED,SAAA,EAAWV,qBAAA;IACXW,QAAA,EAAU;EACZ,GACA;IACED,SAAA,EAAWR,uBAAA;IACXS,QAAA,EAAU;EACZ,EACD;EACDC,SAAA,EAAW,CAACR,YAAA,CAAa;EACzBS,SAAA,EAAW;IACTC,MAAA,EAAQ,CACNjB,4BAAA,CAA6B,CAC3B;MACEkB,IAAA,EAAMpB,SAAA;MACNqB,GAAA,EAAK;MACLC,QAAA,EAAU,CAAC,QAAQ;MACnBC,KAAA,EAAO;MACPC,QAAA,EAAUA,CAAC;QAAEC;MAAM,CAAE;QACnBA,MAAA,CAAOC,eAAe,CAAClB,yBAAA,EAA2B,CAAC;MACrD;IACF,EACD;EAEL;EACAmB,YAAA,EAAc;IACZR,MAAA,EAAQ,CACNhB,gCAAA,CAAiC,CAC/B;MACEyB,cAAA,EAAgB5B,SAAA;MAChBqB,GAAA,EAAK;MACLE,KAAA,EAAO;MACPC,QAAA,EAAUA,CAAC;QAAEC;MAAM,CAAE;QACnBA,MAAA,CAAOC,eAAe,CAAClB,yBAAA,EAA2B,CAAC;MACrD;IACF,EACD;EAEL;AACF","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import type { TableSelection } from '@lexical/table';
2
+ export declare function $computeSelectionCount({ selection }: {
3
+ selection: TableSelection;
4
+ }): {
5
+ columns: number;
6
+ rows: number;
7
+ };
8
+ //# sourceMappingURL=computeSelectionCount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeSelectionCount.d.ts","sourceRoot":"","sources":["../../../../../../src/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,cAAc,CAAA;CAAE,GAAG;IACpF,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb,CAUA"}
@@ -0,0 +1,19 @@
1
+ import { $computeTableCellRectBoundary, $computeTableMap, $getNodeTriplet } from '@lexical/table';
2
+ export function $computeSelectionCount({
3
+ selection
4
+ }) {
5
+ const [anchorCell,, table] = $getNodeTriplet(selection.anchor);
6
+ const [focusCell] = $getNodeTriplet(selection.focus);
7
+ const [map, anchor, focus] = $computeTableMap(table, anchorCell, focusCell);
8
+ const {
9
+ maxColumn,
10
+ maxRow,
11
+ minColumn,
12
+ minRow
13
+ } = $computeTableCellRectBoundary(map, anchor, focus);
14
+ return {
15
+ columns: maxColumn - minColumn + 1,
16
+ rows: maxRow - minRow + 1
17
+ };
18
+ }
19
+ //# sourceMappingURL=computeSelectionCount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeSelectionCount.js","names":["$computeTableCellRectBoundary","$computeTableMap","$getNodeTriplet","$computeSelectionCount","selection","anchorCell","table","anchor","focusCell","focus","map","maxColumn","maxRow","minColumn","minRow","columns","rows"],"sources":["../../../../../../src/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.ts"],"sourcesContent":["import type { TableSelection } from '@lexical/table'\n\nimport { $computeTableCellRectBoundary, $computeTableMap, $getNodeTriplet } from '@lexical/table'\n\nexport function $computeSelectionCount({ selection }: { selection: TableSelection }): {\n columns: number\n rows: number\n} {\n const [anchorCell, , table] = $getNodeTriplet(selection.anchor)\n const [focusCell] = $getNodeTriplet(selection.focus)\n const [map, anchor, focus] = $computeTableMap(table, anchorCell, focusCell)\n const { maxColumn, maxRow, minColumn, minRow } = $computeTableCellRectBoundary(map, anchor, focus)\n\n return {\n columns: maxColumn - minColumn + 1,\n rows: maxRow - minRow + 1,\n }\n}\n"],"mappings":"AAEA,SAASA,6BAA6B,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ;AAEjF,OAAO,SAASC,uBAAuB;EAAEC;AAAS,CAAiC;EAIjF,MAAM,CAACC,UAAA,GAAcC,KAAA,CAAM,GAAGJ,eAAA,CAAgBE,SAAA,CAAUG,MAAM;EAC9D,MAAM,CAACC,SAAA,CAAU,GAAGN,eAAA,CAAgBE,SAAA,CAAUK,KAAK;EACnD,MAAM,CAACC,GAAA,EAAKH,MAAA,EAAQE,KAAA,CAAM,GAAGR,gBAAA,CAAiBK,KAAA,EAAOD,UAAA,EAAYG,SAAA;EACjE,MAAM;IAAEG,SAAS;IAAEC,MAAM;IAAEC,SAAS;IAAEC;EAAM,CAAE,GAAGd,6BAAA,CAA8BU,GAAA,EAAKH,MAAA,EAAQE,KAAA;EAE5F,OAAO;IACLM,OAAA,EAASJ,SAAA,GAAYE,SAAA,GAAY;IACjCG,IAAA,EAAMJ,MAAA,GAASE,MAAA,GAAS;EAC1B;AACF","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/table/client/plugins/TableActionMenuPlugin/index.tsx"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAE3E,OAAO,aAAa,CAAA;AAqmBpB,eAAO,MAAM,qBAAqB,EAAE,yBAQnC,CAAA"}
@@ -4,7 +4,7 @@ import { c as _c } from "react/compiler-runtime";
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
6
6
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
7
- import { $computeTableMapSkipCellCheck, $deleteTableColumnAtSelection, $deleteTableRowAtSelection, $getNodeTriplet, $getTableCellNodeFromLexicalNode, $getTableColumnIndexFromTableCellNode, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $insertTableColumnAtSelection, $insertTableRowAtSelection, $isTableCellNode, $isTableSelection, $mergeCells, $unmergeCell, getTableElement, getTableObserverFromTableElement, TableCellHeaderStates, TableCellNode } from '@lexical/table';
7
+ import { $computeTableMap, $deleteTableColumnAtSelection, $deleteTableRowAtSelection, $getNodeTriplet, $getTableCellNodeFromLexicalNode, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $insertTableColumnAtSelection, $insertTableRowAtSelection, $isTableCellNode, $isTableSelection, $mergeCells, $setTableColumnIsHeader, $setTableRowIsHeader, $unmergeCell, getTableElement, getTableObserverFromTableElement, TableCellHeaderStates, TableCellNode } from '@lexical/table';
8
8
  import { mergeRegister } from '@lexical/utils';
9
9
  import { useScrollInfo } from '@payloadcms/ui';
10
10
  import { $getSelection, $isElementNode, $isRangeSelection, $isTextNode, $setSelection, COMMAND_PRIORITY_CRITICAL, getDOMSelection, isDOMNode, SELECTION_CHANGE_COMMAND } from 'lexical';
@@ -13,13 +13,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
13
13
  import { createPortal } from 'react-dom';
14
14
  import './index.css';
15
15
  import { MeatballsIcon } from '../../../../../lexical/ui/icons/Meatballs/index.js';
16
- function computeSelectionCount(selection) {
17
- const selectionShape = selection.getShape();
18
- return {
19
- columns: selectionShape.toX - selectionShape.fromX + 1,
20
- rows: selectionShape.toY - selectionShape.fromY + 1
21
- };
22
- }
16
+ import { $computeSelectionCount } from './computeSelectionCount.js';
23
17
  function $canUnmerge() {
24
18
  const selection = $getSelection();
25
19
  if ($isRangeSelection(selection) && !selection.isCollapsed() || $isTableSelection(selection) && !selection.anchor.is(selection.focus) || !$isRangeSelection(selection) && !$isTableSelection(selection)) {
@@ -74,9 +68,12 @@ function TableActionMenu({
74
68
  const selection = $getSelection();
75
69
  // Merge cells
76
70
  if ($isTableSelection(selection)) {
77
- const currentSelectionCounts = computeSelectionCount(selection);
78
- updateSelectionCounts(computeSelectionCount(selection));
79
- setCanMergeCells(currentSelectionCounts.columns > 1 || currentSelectionCounts.rows > 1);
71
+ const currentSelectionCounts = $computeSelectionCount({
72
+ selection
73
+ });
74
+ updateSelectionCounts(currentSelectionCounts);
75
+ const isCollapsedTableSelection = selection.anchor.is(selection.focus);
76
+ setCanMergeCells(!isCollapsedTableSelection && (currentSelectionCounts.columns > 1 || currentSelectionCounts.rows > 1));
80
77
  }
81
78
  // Unmerge cell
82
79
  setCanUnmergeCell($canUnmerge());
@@ -152,6 +149,7 @@ function TableActionMenu({
152
149
  editor.update(() => {
153
150
  $unmergeCell();
154
151
  });
152
+ clearTableSelection();
155
153
  };
156
154
  const insertTableRowAtSelection = useCallback(shouldInsertAfter => {
157
155
  editor.update(() => {
@@ -192,22 +190,9 @@ function TableActionMenu({
192
190
  const toggleTableRowIsHeader = useCallback(() => {
193
191
  editor.update(() => {
194
192
  const tableNode_1 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
195
- const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
196
- const [gridMap] = $computeTableMapSkipCellCheck(tableNode_1, null, null);
197
- const rowCells = new Set();
198
- const newStyle = tableCellNode.getHeaderStyles() ^ TableCellHeaderStates.ROW;
199
- if (gridMap[tableRowIndex]) {
200
- for (let col = 0; col < gridMap[tableRowIndex].length; col++) {
201
- const mapCell = gridMap[tableRowIndex][col];
202
- if (!mapCell?.cell) {
203
- continue;
204
- }
205
- if (!rowCells.has(mapCell.cell)) {
206
- rowCells.add(mapCell.cell);
207
- mapCell.cell.setHeaderStyles(newStyle, TableCellHeaderStates.ROW);
208
- }
209
- }
210
- }
193
+ const rowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
194
+ const isHeader = !tableCellNode.hasHeaderState(TableCellHeaderStates.ROW);
195
+ $setTableRowIsHeader(tableNode_1, rowIndex, isHeader);
211
196
  clearTableSelection();
212
197
  onClose();
213
198
  });
@@ -215,22 +200,10 @@ function TableActionMenu({
215
200
  const toggleTableColumnIsHeader = useCallback(() => {
216
201
  editor.update(() => {
217
202
  const tableNode_2 = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
218
- const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
219
- const [gridMap_0] = $computeTableMapSkipCellCheck(tableNode_2, null, null);
220
- const columnCells = new Set();
221
- const newStyle_0 = tableCellNode.getHeaderStyles() ^ TableCellHeaderStates.COLUMN;
222
- if (gridMap_0) {
223
- for (let row = 0; row < gridMap_0.length; row++) {
224
- const mapCell_0 = gridMap_0?.[row]?.[tableColumnIndex];
225
- if (!mapCell_0?.cell) {
226
- continue;
227
- }
228
- if (!columnCells.has(mapCell_0.cell)) {
229
- columnCells.add(mapCell_0.cell);
230
- mapCell_0.cell.setHeaderStyles(newStyle_0, TableCellHeaderStates.COLUMN);
231
- }
232
- }
233
- }
203
+ // Merged cells can make the grid column differ from the cell's index in its row.
204
+ const [, cellMap] = $computeTableMap(tableNode_2, tableCellNode, tableCellNode);
205
+ const isHeader_0 = !tableCellNode.hasHeaderState(TableCellHeaderStates.COLUMN);
206
+ $setTableColumnIsHeader(tableNode_2, cellMap.startColumn, isHeader_0);
234
207
  clearTableSelection();
235
208
  onClose();
236
209
  });
@@ -396,7 +369,7 @@ function TableActionMenu({
396
369
  children: [(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) === TableCellHeaderStates.COLUMN ? 'Remove' : 'Add', ' ', "column header"]
397
370
  })
398
371
  })]
399
- }), document.body);
372
+ }), editor.getRootElement()?.closest('dialog, [role="dialog"]') ?? document.body);
400
373
  }
401
374
  function TableCellActionMenuContainer({
402
375
  anchorElem,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","$computeTableMap","$deleteTableColumnAtSelection","$deleteTableRowAtSelection","$getNodeTriplet","$getTableCellNodeFromLexicalNode","$getTableNodeFromLexicalNodeOrThrow","$getTableRowIndexFromTableCellNode","$insertTableColumnAtSelection","$insertTableRowAtSelection","$isTableCellNode","$isTableSelection","$mergeCells","$setTableColumnIsHeader","$setTableRowIsHeader","$unmergeCell","getTableElement","getTableObserverFromTableElement","TableCellHeaderStates","TableCellNode","mergeRegister","useScrollInfo","$getSelection","$isElementNode","$isRangeSelection","$isTextNode","$setSelection","COMMAND_PRIORITY_CRITICAL","getDOMSelection","isDOMNode","SELECTION_CHANGE_COMMAND","React","useCallback","useEffect","useRef","useState","createPortal","MeatballsIcon","$computeSelectionCount","$canUnmerge","selection","isCollapsed","anchor","is","focus","cell","__colSpan","__rowSpan","$selectLastDescendant","node","lastDescendant","getLastDescendant","select","selectEnd","selectNext","TableActionMenu","cellMerge","contextRef","onClose","setIsMenuOpen","tableCellNode","_tableCellNode","editor","dropDownRef","updateTableCellNode","selectionCounts","updateSelectionCounts","columns","rows","canMergeCells","setCanMergeCells","canUnmergeCell","setCanUnmergeCell","y","registerMutationListener","nodeMutations","nodeUpdated","get","getKey","getEditorState","read","getLatest","skipInitialization","currentSelectionCounts","isCollapsedTableSelection","menuButtonElement","current","dropDownElement","rootElement","getRootElement","rootEleRect","getBoundingClientRect","menuButtonRect","style","opacity","dropDownElementRect","margin","leftPosition","right","width","window","innerWidth","position","left","pageXOffset","topPosition","top","height","innerHeight","bottom","handleClickOutside","event","target","contains","addEventListener","removeEventListener","clearTableSelection","update","isAttached","tableNode","tableElement","getElementByKey","Error","tableObserver","$clearHighlight","markDirty","mergeTableCellsAtSelection","nodes","getNodes","tableCells","filter","targetCell","unmergeTableCellsAtSelection","insertTableRowAtSelection","shouldInsertAfter","i","insertTableColumnAtSelection","deleteTableRowAtSelection","deleteTableAtSelection","remove","deleteTableColumnAtSelection","toggleTableRowIsHeader","rowIndex","isHeader","hasHeaderState","ROW","toggleTableColumnIsHeader","cellMap","COLUMN","startColumn","toggleRowStriping","setRowStriping","getRowStriping","toggleFirstColumnFreeze","setFrozenColumns","getFrozenColumns","mergeCellButton","_jsx","className","onClick","type","_jsxs","e","stopPropagation","ref","Fragment","__headerState","closest","document","body","TableCellActionMenuContainer","anchorElem","menuButtonRef","menuRootRef","isMenuOpen","setTableMenuCellNode","$moveMenu","menu","nativeSelection","_window","activeElement","disable","classList","add","tableCellParentNodeDOM","anchorNode","tableCellNodeFromSelection","getNode","enabled","isSelecting","toggle","tableCellRect","anchorRect","transform","timeoutId","undefined","callback","delayedCallback","setTimeout","registerUpdateListener","registerCommand","registerRootListener","prevRootElement","clearTimeout","prevTableCellDOM","TableActionMenuPlugin","t0","$","isEditable","t1"],"sources":["../../../../../../src/features/table/client/plugins/TableActionMenuPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableObserver } from '@lexical/table'\nimport type { ElementNode } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n $computeTableMap,\n $deleteTableColumnAtSelection,\n $deleteTableRowAtSelection,\n $getNodeTriplet,\n $getTableCellNodeFromLexicalNode,\n $getTableNodeFromLexicalNodeOrThrow,\n $getTableRowIndexFromTableCellNode,\n $insertTableColumnAtSelection,\n $insertTableRowAtSelection,\n $isTableCellNode,\n $isTableSelection,\n $mergeCells,\n $setTableColumnIsHeader,\n $setTableRowIsHeader,\n $unmergeCell,\n getTableElement,\n getTableObserverFromTableElement,\n TableCellHeaderStates,\n TableCellNode,\n} from '@lexical/table'\nimport { mergeRegister } from '@lexical/utils'\nimport { useScrollInfo } from '@payloadcms/ui'\nimport {\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n $isTextNode,\n $setSelection,\n COMMAND_PRIORITY_CRITICAL,\n getDOMSelection,\n isDOMNode,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { PluginComponentWithAnchor } from '../../../../typesClient.js'\n\nimport './index.css'\nimport { MeatballsIcon } from '../../../../../lexical/ui/icons/Meatballs/index.js'\nimport { $computeSelectionCount } from './computeSelectionCount.js'\n\nfunction $canUnmerge(): boolean {\n const selection = $getSelection()\n if (\n ($isRangeSelection(selection) && !selection.isCollapsed()) ||\n ($isTableSelection(selection) && !selection.anchor.is(selection.focus)) ||\n (!$isRangeSelection(selection) && !$isTableSelection(selection))\n ) {\n return false\n }\n const [cell] = $getNodeTriplet(selection.anchor)\n return cell.__colSpan > 1 || cell.__rowSpan > 1\n}\n\nfunction $selectLastDescendant(node: ElementNode): void {\n const lastDescendant = node.getLastDescendant()\n if ($isTextNode(lastDescendant)) {\n lastDescendant.select()\n } else if ($isElementNode(lastDescendant)) {\n lastDescendant.selectEnd()\n } else if (lastDescendant !== null) {\n lastDescendant.selectNext()\n }\n}\n\ntype TableCellActionMenuProps = Readonly<{\n cellMerge: boolean\n contextRef: { current: HTMLElement | null }\n onClose: () => void\n setIsMenuOpen: (isOpen: boolean) => void\n tableCellNode: TableCellNode\n}>\n\nfunction TableActionMenu({\n cellMerge,\n contextRef,\n onClose,\n setIsMenuOpen,\n tableCellNode: _tableCellNode,\n}: TableCellActionMenuProps) {\n const [editor] = useLexicalComposerContext()\n const dropDownRef = useRef<HTMLDivElement | null>(null)\n const [tableCellNode, updateTableCellNode] = useState(_tableCellNode)\n const [selectionCounts, updateSelectionCounts] = useState({\n columns: 1,\n rows: 1,\n })\n const [canMergeCells, setCanMergeCells] = useState(false)\n const [canUnmergeCell, setCanUnmergeCell] = useState(false)\n const { y } = useScrollInfo()\n\n useEffect(() => {\n return editor.registerMutationListener(\n TableCellNode,\n (nodeMutations) => {\n const nodeUpdated = nodeMutations.get(tableCellNode.getKey()) === 'updated'\n\n if (nodeUpdated) {\n editor.getEditorState().read(() => {\n updateTableCellNode(tableCellNode.getLatest())\n })\n }\n },\n { skipInitialization: true },\n )\n }, [editor, tableCellNode])\n\n useEffect(() => {\n editor.getEditorState().read(() => {\n const selection = $getSelection()\n // Merge cells\n if ($isTableSelection(selection)) {\n const currentSelectionCounts = $computeSelectionCount({ selection })\n updateSelectionCounts(currentSelectionCounts)\n\n const isCollapsedTableSelection = selection.anchor.is(selection.focus)\n setCanMergeCells(\n !isCollapsedTableSelection &&\n (currentSelectionCounts.columns > 1 || currentSelectionCounts.rows > 1),\n )\n }\n // Unmerge cell\n setCanUnmergeCell($canUnmerge())\n })\n }, [editor])\n\n useEffect(() => {\n const menuButtonElement = contextRef.current\n const dropDownElement = dropDownRef.current\n const rootElement = editor.getRootElement()\n\n if (menuButtonElement != null && dropDownElement != null && rootElement != null) {\n const rootEleRect = rootElement.getBoundingClientRect()\n const menuButtonRect = menuButtonElement.getBoundingClientRect()\n dropDownElement.style.opacity = '1'\n const dropDownElementRect = dropDownElement.getBoundingClientRect()\n const margin = 5\n let leftPosition = menuButtonRect.right + margin\n if (\n leftPosition + dropDownElementRect.width > window.innerWidth ||\n leftPosition + dropDownElementRect.width > rootEleRect.right\n ) {\n const position = menuButtonRect.left - dropDownElementRect.width - margin\n leftPosition = (position < 0 ? margin : position) + window.pageXOffset\n }\n dropDownElement.style.left = `${leftPosition + window.pageXOffset}px`\n\n let topPosition = menuButtonRect.top\n if (topPosition + dropDownElementRect.height > window.innerHeight) {\n const position = menuButtonRect.bottom - dropDownElementRect.height\n topPosition = position < 0 ? margin : position\n }\n dropDownElement.style.top = `${topPosition}px`\n }\n }, [contextRef, dropDownRef, editor, y])\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (\n dropDownRef.current != null &&\n contextRef.current != null &&\n isDOMNode(event.target) &&\n !dropDownRef.current.contains(event.target) &&\n !contextRef.current.contains(event.target)\n ) {\n setIsMenuOpen(false)\n }\n }\n\n window.addEventListener('click', handleClickOutside)\n\n return () => window.removeEventListener('click', handleClickOutside)\n }, [setIsMenuOpen, contextRef])\n\n const clearTableSelection = useCallback(() => {\n editor.update(() => {\n if (tableCellNode.isAttached()) {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()))\n\n if (tableElement === null) {\n throw new Error('Expected to find tableElement in DOM')\n }\n\n const tableObserver = getTableObserverFromTableElement(tableElement)\n if (tableObserver !== null) {\n tableObserver.$clearHighlight()\n }\n\n tableNode.markDirty()\n updateTableCellNode(tableCellNode.getLatest())\n }\n\n $setSelection(null)\n })\n }, [editor, tableCellNode])\n\n const mergeTableCellsAtSelection = () => {\n editor.update(() => {\n const selection = $getSelection()\n if (!$isTableSelection(selection)) {\n return\n }\n const nodes = selection.getNodes()\n const tableCells = nodes.filter($isTableCellNode)\n const targetCell = $mergeCells(tableCells)\n\n if (targetCell) {\n $selectLastDescendant(targetCell)\n onClose()\n }\n })\n }\n\n const unmergeTableCellsAtSelection = () => {\n editor.update(() => {\n $unmergeCell()\n })\n clearTableSelection()\n }\n\n const insertTableRowAtSelection = useCallback(\n (shouldInsertAfter: boolean) => {\n editor.update(() => {\n for (let i = 0; i < selectionCounts.rows; i++) {\n $insertTableRowAtSelection(shouldInsertAfter)\n }\n onClose()\n })\n },\n [editor, onClose, selectionCounts.rows],\n )\n\n const insertTableColumnAtSelection = useCallback(\n (shouldInsertAfter: boolean) => {\n editor.update(() => {\n for (let i = 0; i < selectionCounts.columns; i++) {\n $insertTableColumnAtSelection(shouldInsertAfter)\n }\n onClose()\n })\n },\n [editor, onClose, selectionCounts.columns],\n )\n\n const deleteTableRowAtSelection = useCallback(() => {\n editor.update(() => {\n $deleteTableRowAtSelection()\n onClose()\n })\n }, [editor, onClose])\n\n const deleteTableAtSelection = useCallback(() => {\n editor.update(() => {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n tableNode.remove()\n\n clearTableSelection()\n onClose()\n })\n }, [editor, tableCellNode, clearTableSelection, onClose])\n\n const deleteTableColumnAtSelection = useCallback(() => {\n editor.update(() => {\n $deleteTableColumnAtSelection()\n onClose()\n })\n }, [editor, onClose])\n\n const toggleTableRowIsHeader = useCallback(() => {\n editor.update(() => {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n\n const rowIndex = $getTableRowIndexFromTableCellNode(tableCellNode)\n const isHeader = !tableCellNode.hasHeaderState(TableCellHeaderStates.ROW)\n $setTableRowIsHeader(tableNode, rowIndex, isHeader)\n\n clearTableSelection()\n onClose()\n })\n }, [editor, tableCellNode, clearTableSelection, onClose])\n\n const toggleTableColumnIsHeader = useCallback(() => {\n editor.update(() => {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n\n // Merged cells can make the grid column differ from the cell's index in its row.\n const [, cellMap] = $computeTableMap(tableNode, tableCellNode, tableCellNode)\n const isHeader = !tableCellNode.hasHeaderState(TableCellHeaderStates.COLUMN)\n $setTableColumnIsHeader(tableNode, cellMap.startColumn, isHeader)\n\n clearTableSelection()\n onClose()\n })\n }, [editor, tableCellNode, clearTableSelection, onClose])\n\n const toggleRowStriping = useCallback(() => {\n editor.update(() => {\n if (tableCellNode.isAttached()) {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n if (tableNode) {\n tableNode.setRowStriping(!tableNode.getRowStriping())\n }\n }\n\n clearTableSelection()\n onClose()\n })\n }, [editor, tableCellNode, clearTableSelection, onClose])\n\n const toggleFirstColumnFreeze = useCallback(() => {\n editor.update(() => {\n if (tableCellNode.isAttached()) {\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n if (tableNode) {\n tableNode.setFrozenColumns(tableNode.getFrozenColumns() === 0 ? 1 : 0)\n }\n }\n clearTableSelection()\n onClose()\n })\n }, [editor, tableCellNode, clearTableSelection, onClose])\n\n let mergeCellButton: JSX.Element | null = null\n if (cellMerge) {\n if (canMergeCells) {\n mergeCellButton = (\n <button\n className=\"item\"\n data-test-id=\"table-merge-cells\"\n onClick={() => mergeTableCellsAtSelection()}\n type=\"button\"\n >\n <span className=\"text\">Merge cells</span>\n </button>\n )\n } else if (canUnmergeCell) {\n mergeCellButton = (\n <button\n className=\"item\"\n data-test-id=\"table-unmerge-cells\"\n onClick={() => unmergeTableCellsAtSelection()}\n type=\"button\"\n >\n <span className=\"text\">Unmerge cells</span>\n </button>\n )\n }\n }\n\n return createPortal(\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events\n <div\n className=\"table-action-menu-dropdown\"\n onClick={(e) => {\n e.stopPropagation()\n }}\n ref={dropDownRef}\n >\n {mergeCellButton ? (\n <React.Fragment>\n {mergeCellButton}\n <hr />\n </React.Fragment>\n ) : null}\n\n <button\n className=\"item\"\n data-test-id=\"table-row-striping\"\n onClick={() => toggleRowStriping()}\n type=\"button\"\n >\n <span className=\"text\">Toggle row striping</span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-freeze-first-column\"\n onClick={() => toggleFirstColumnFreeze()}\n type=\"button\"\n >\n <span className=\"text\">Toggle first column freeze</span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-insert-row-above\"\n onClick={() => insertTableRowAtSelection(false)}\n type=\"button\"\n >\n <span className=\"text\">\n Insert {selectionCounts.rows === 1 ? 'row' : `${selectionCounts.rows} rows`} above\n </span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-insert-row-below\"\n onClick={() => insertTableRowAtSelection(true)}\n type=\"button\"\n >\n <span className=\"text\">\n Insert {selectionCounts.rows === 1 ? 'row' : `${selectionCounts.rows} rows`} below\n </span>\n </button>\n <hr />\n <button\n className=\"item\"\n data-test-id=\"table-insert-column-before\"\n onClick={() => insertTableColumnAtSelection(false)}\n type=\"button\"\n >\n <span className=\"text\">\n Insert {selectionCounts.columns === 1 ? 'column' : `${selectionCounts.columns} columns`}{' '}\n left\n </span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-insert-column-after\"\n onClick={() => insertTableColumnAtSelection(true)}\n type=\"button\"\n >\n <span className=\"text\">\n Insert {selectionCounts.columns === 1 ? 'column' : `${selectionCounts.columns} columns`}{' '}\n right\n </span>\n </button>\n <hr />\n <button\n className=\"item\"\n data-test-id=\"table-delete-columns\"\n onClick={() => deleteTableColumnAtSelection()}\n type=\"button\"\n >\n <span className=\"text\">Delete column</span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-delete-rows\"\n onClick={() => deleteTableRowAtSelection()}\n type=\"button\"\n >\n <span className=\"text\">Delete row</span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-delete\"\n onClick={() => deleteTableAtSelection()}\n type=\"button\"\n >\n <span className=\"text\">Delete table</span>\n </button>\n <hr />\n <button\n className=\"item\"\n data-test-id=\"table-row-header\"\n onClick={() => toggleTableRowIsHeader()}\n type=\"button\"\n >\n <span className=\"text\">\n {(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW\n ? 'Remove'\n : 'Add'}{' '}\n row header\n </span>\n </button>\n <button\n className=\"item\"\n data-test-id=\"table-column-header\"\n onClick={() => toggleTableColumnIsHeader()}\n type=\"button\"\n >\n <span className=\"text\">\n {(tableCellNode.__headerState & TableCellHeaderStates.COLUMN) ===\n TableCellHeaderStates.COLUMN\n ? 'Remove'\n : 'Add'}{' '}\n column header\n </span>\n </button>\n </div>,\n editor.getRootElement()?.closest('dialog, [role=\"dialog\"]') ?? document.body,\n )\n}\n\nfunction TableCellActionMenuContainer({\n anchorElem,\n cellMerge,\n}: {\n anchorElem: HTMLElement\n cellMerge: boolean\n}): JSX.Element {\n const [editor] = useLexicalComposerContext()\n\n const menuButtonRef = useRef<HTMLDivElement | null>(null)\n const menuRootRef = useRef<HTMLButtonElement | null>(null)\n const [isMenuOpen, setIsMenuOpen] = useState(false)\n\n const [tableCellNode, setTableMenuCellNode] = useState<null | TableCellNode>(null)\n\n const $moveMenu = useCallback(() => {\n const menu = menuButtonRef.current\n const selection = $getSelection()\n const nativeSelection = getDOMSelection(editor._window)\n const activeElement = document.activeElement\n function disable() {\n if (menu) {\n menu.classList.remove('table-cell-action-button-container--active')\n menu.classList.add('table-cell-action-button-container--inactive')\n }\n setTableMenuCellNode(null)\n }\n\n if (selection == null || menu == null) {\n return disable()\n }\n\n const rootElement = editor.getRootElement()\n let tableObserver: null | TableObserver = null\n let tableCellParentNodeDOM: HTMLElement | null = null\n\n if (\n $isRangeSelection(selection) &&\n rootElement !== null &&\n nativeSelection !== null &&\n rootElement.contains(nativeSelection.anchorNode)\n ) {\n const tableCellNodeFromSelection = $getTableCellNodeFromLexicalNode(\n selection.anchor.getNode(),\n )\n\n if (tableCellNodeFromSelection == null) {\n return disable()\n }\n\n tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey())\n\n if (tableCellParentNodeDOM == null || !tableCellNodeFromSelection.isAttached()) {\n return disable()\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNodeFromSelection)\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()))\n\n if (tableElement === null) {\n throw new Error('TableActionMenu: Expected to find tableElement in DOM')\n }\n\n tableObserver = getTableObserverFromTableElement(tableElement)\n setTableMenuCellNode(tableCellNodeFromSelection)\n } else if ($isTableSelection(selection)) {\n const anchorNode = $getTableCellNodeFromLexicalNode(selection.anchor.getNode())\n if (!$isTableCellNode(anchorNode)) {\n throw new Error('TableSelection anchorNode must be a TableCellNode')\n }\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(anchorNode)\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()))\n\n if (tableElement === null) {\n throw new Error('TableActionMenu: Expected to find tableElement in DOM')\n }\n\n tableObserver = getTableObserverFromTableElement(tableElement)\n tableCellParentNodeDOM = editor.getElementByKey(anchorNode.getKey())\n } else if (!activeElement) {\n return disable()\n }\n if (tableObserver === null || tableCellParentNodeDOM === null) {\n return disable()\n }\n const enabled = !tableObserver || !tableObserver.isSelecting\n menu.classList.toggle('table-cell-action-button-container--active', enabled)\n menu.classList.toggle('table-cell-action-button-container--inactive', !enabled)\n if (enabled) {\n const tableCellRect = tableCellParentNodeDOM.getBoundingClientRect()\n const anchorRect = anchorElem.getBoundingClientRect()\n const top = tableCellRect.top - anchorRect.top\n const left = tableCellRect.right - anchorRect.left\n menu.style.transform = `translate(${left}px, ${top}px)`\n }\n }, [editor, anchorElem])\n\n useEffect(() => {\n // We call the $moveMenu callback every time the selection changes,\n // once up front, and once after each pointerup\n let timeoutId: ReturnType<typeof setTimeout> | undefined = undefined\n const callback = () => {\n timeoutId = undefined\n editor.getEditorState().read($moveMenu)\n }\n const delayedCallback = () => {\n if (timeoutId === undefined) {\n timeoutId = setTimeout(callback, 0)\n }\n return false\n }\n return mergeRegister(\n editor.registerUpdateListener(delayedCallback),\n editor.registerCommand(SELECTION_CHANGE_COMMAND, delayedCallback, COMMAND_PRIORITY_CRITICAL),\n editor.registerRootListener((rootElement, prevRootElement) => {\n if (prevRootElement) {\n prevRootElement.removeEventListener('pointerup', delayedCallback)\n }\n if (rootElement) {\n rootElement.addEventListener('pointerup', delayedCallback)\n delayedCallback()\n }\n }),\n () => clearTimeout(timeoutId),\n )\n })\n\n const prevTableCellDOM = useRef(tableCellNode)\n\n useEffect(() => {\n if (prevTableCellDOM.current !== tableCellNode) {\n setIsMenuOpen(false)\n }\n\n prevTableCellDOM.current = tableCellNode\n }, [prevTableCellDOM, tableCellNode])\n\n return (\n <div className=\"table-cell-action-button-container\" ref={menuButtonRef}>\n {tableCellNode != null && (\n <React.Fragment>\n <button\n className=\"table-cell-action-button\"\n onClick={(e) => {\n e.stopPropagation()\n setIsMenuOpen(!isMenuOpen)\n }}\n ref={menuRootRef}\n type=\"button\"\n >\n <MeatballsIcon />\n </button>\n {isMenuOpen && (\n <TableActionMenu\n cellMerge={cellMerge}\n contextRef={menuRootRef}\n onClose={() => setIsMenuOpen(false)}\n setIsMenuOpen={setIsMenuOpen}\n tableCellNode={tableCellNode}\n />\n )}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nexport const TableActionMenuPlugin: PluginComponentWithAnchor = ({ anchorElem }) => {\n const isEditable = useLexicalEditable()\n return createPortal(\n isEditable ? (\n <TableCellActionMenuContainer anchorElem={anchorElem ?? document.body} cellMerge />\n ) : null,\n anchorElem ?? document.body,\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAMA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SACEC,gBAAgB,EAChBC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,eAAe,EACfC,gCAAgC,EAChCC,mCAAmC,EACnCC,kCAAkC,EAClCC,6BAA6B,EAC7BC,0BAA0B,EAC1BC,gBAAgB,EAChBC,iBAAiB,EACjBC,WAAW,EACXC,uBAAuB,EACvBC,oBAAoB,EACpBC,YAAY,EACZC,eAAe,EACfC,gCAAgC,EAChCC,qBAAqB,EACrBC,aAAa,QACR;AACP,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;AAC9B,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,WAAW,EACXC,aAAa,EACbC,yBAAyB,EACzBC,eAAe,EACfC,SAAS,EACTC,wBAAwB,QACnB;AACP,YAAYC,KAAA,MAAW;AACvB,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ;AAI7B,OAAO;AACP,SAASC,aAAa,QAAQ;AAC9B,SAASC,sBAAsB,QAAQ;AAEvC,SAASC,YAAA;EACP,MAAMC,SAAA,GAAYlB,aAAA;EAClB,IACEE,iBAAC,CAAkBgB,SAAA,KAAc,CAACA,SAAA,CAAUC,WAAW,MACtD9B,iBAAA,CAAkB6B,SAAA,KAAc,CAACA,SAAA,CAAUE,MAAM,CA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GAAA7K,YAAA,CACL4K,UAAA,GACEnD,IAAA,CAAAa,4BAAA;MAAAC,UAAA,EAA0CA,UAAA,IAAAH,QAAA,CAAAC,IAA2B;MAAAjH,SAAA;IAAA,C,QACnE,EACJmH,UAAA,IAAAH,QAAA,CAAAC,IAA2B;IAAAsC,CAAA,MAAApC,UAAA;IAAAoC,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAA,OAJtBE,EAIsB;AAAA,CAE/B","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/table/client/plugins/TableCellResizerPlugin/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,aAAa,CAAA;AA2ZpB,eAAO,MAAM,sBAAsB,EAAE,eAoBpC,CAAA"}
@@ -265,6 +265,10 @@ function TableCellResizer({
265
265
  width: width_0
266
266
  } = activeCell.elem.getBoundingClientRect();
267
267
  const zoom_0 = calculateZoomLevel(activeCell.elem);
268
+ const isInModal = Boolean(editor.getRootElement()?.closest('dialog, [role="dialog"]'));
269
+ const scrollX = isInModal ? 0 : window.scrollX;
270
+ const scrollY = isInModal ? 0 : window.scrollY;
271
+ const position = isInModal ? 'fixed' : 'absolute';
268
272
  const zoneWidth = 10 // Pixel width of the zone where you can drag the edge
269
273
  ;
270
274
  const styles = {
@@ -272,29 +276,31 @@ function TableCellResizer({
272
276
  backgroundColor: 'none',
273
277
  cursor: 'row-resize',
274
278
  height: `${zoneWidth}px`,
275
- left: `${window.scrollX + left}px`,
276
- top: `${window.scrollY + top + height_0 - zoneWidth / 2}px`,
279
+ left: `${scrollX + left}px`,
280
+ position,
281
+ top: `${scrollY + top + height_0 - zoneWidth / 2}px`,
277
282
  width: `${width_0}px`
278
283
  },
279
284
  right: {
280
285
  backgroundColor: 'none',
281
286
  cursor: 'col-resize',
282
287
  height: `${height_0}px`,
283
- left: `${window.scrollX + left + width_0 - zoneWidth / 2}px`,
284
- top: `${window.scrollY + top}px`,
288
+ left: `${scrollX + left + width_0 - zoneWidth / 2}px`,
289
+ position,
290
+ top: `${scrollY + top}px`,
285
291
  width: `${zoneWidth}px`
286
292
  }
287
293
  };
288
294
  const tableRect = tableRectRef.current;
289
295
  if (draggingDirection && mouseCurrentPos && tableRect) {
290
296
  if (isHeightChanging(draggingDirection)) {
291
- styles[draggingDirection].left = `${window.scrollX + tableRect.left}px`;
292
- styles[draggingDirection].top = `${window.scrollY + mouseCurrentPos.y / zoom_0}px`;
297
+ styles[draggingDirection].left = `${scrollX + tableRect.left}px`;
298
+ styles[draggingDirection].top = `${scrollY + mouseCurrentPos.y / zoom_0}px`;
293
299
  styles[draggingDirection].height = '3px';
294
300
  styles[draggingDirection].width = `${tableRect.width}px`;
295
301
  } else {
296
- styles[draggingDirection].top = `${window.scrollY + tableRect.top}px`;
297
- styles[draggingDirection].left = `${window.scrollX + mouseCurrentPos.x / zoom_0}px`;
302
+ styles[draggingDirection].top = `${scrollY + tableRect.top}px`;
303
+ styles[draggingDirection].left = `${scrollX + mouseCurrentPos.x / zoom_0}px`;
298
304
  styles[draggingDirection].width = '3px';
299
305
  styles[draggingDirection].height = `${tableRect.height}px`;
300
306
  }
@@ -309,7 +315,7 @@ function TableCellResizer({
309
315
  top: null
310
316
  });
311
317
  }
312
- }, [activeCell, draggingDirection, mouseCurrentPos]);
318
+ }, [activeCell, draggingDirection, editor, mouseCurrentPos]);
313
319
  return /*#__PURE__*/_jsx("div", {
314
320
  ref: resizerRef,
315
321
  children: activeCell != null && !isMouseDown && /*#__PURE__*/_jsxs(React.Fragment, {
@@ -326,20 +332,37 @@ function TableCellResizer({
326
332
  });
327
333
  }
328
334
  export const TableCellResizerPlugin = () => {
329
- const $ = _c(3);
335
+ const $ = _c(7);
330
336
  const [editor] = useLexicalComposerContext();
331
337
  const isEditable = useLexicalEditable();
338
+ const [portalTarget, setPortalTarget] = useState(null);
332
339
  let t0;
333
- if ($[0] !== editor || $[1] !== isEditable) {
334
- t0 = isEditable ? createPortal(_jsx(TableCellResizer, {
335
- editor
336
- }), document.body) : null;
340
+ let t1;
341
+ if ($[0] !== editor) {
342
+ t0 = () => editor.registerRootListener(root => {
343
+ setPortalTarget(root?.closest("dialog, [role=\"dialog\"]") ?? document.body);
344
+ });
345
+ t1 = [editor];
337
346
  $[0] = editor;
338
- $[1] = isEditable;
339
- $[2] = t0;
347
+ $[1] = t0;
348
+ $[2] = t1;
349
+ } else {
350
+ t0 = $[1];
351
+ t1 = $[2];
352
+ }
353
+ useEffect(t0, t1);
354
+ let t2;
355
+ if ($[3] !== editor || $[4] !== isEditable || $[5] !== portalTarget) {
356
+ t2 = isEditable && portalTarget ? createPortal(_jsx(TableCellResizer, {
357
+ editor
358
+ }), portalTarget) : null;
359
+ $[3] = editor;
360
+ $[4] = isEditable;
361
+ $[5] = portalTarget;
362
+ $[6] = t2;
340
363
  } else {
341
- t0 = $[2];
364
+ t2 = $[6];
342
365
  }
343
- return t0;
366
+ return t2;
344
367
  };
345
368
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","$computeTableMapSkipCellCheck","$getTableNodeFromLexicalNodeOrThrow","$getTableRowIndexFromTableCellNode","$isTableCellNode","$isTableRowNode","getDOMCellFromTarget","getTableElement","TableNode","calculateZoomLevel","mergeRegister","$getNearestNodeFromDOMNode","isHTMLElement","SKIP_SCROLL_INTO_VIEW_TAG","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","useEditorConfigContext","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","TableCellResizer","editor","targetRef","resizerRef","tableRectRef","hasTable","setHasTable","editorConfig","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","current","isMouseDownOnEvent","event","buttons","tableKeys","Set","registerMutationListener","nodeMutations","nodeKey","mutation","delete","add","size","registerNodeTransform","tableNode","getColWidths","numColumns","getColumnCount","columnWidth","setColWidths","Array","fill","onMouseMove","target","x","clientX","y","clientY","contains","cell","getEditorState","read","tableCellNode","elem","Error","tableElement","getElementByKey","getKey","getBoundingClientRect","onMouseDown","onMouseUp","removeRootListener","registerRootListener","rootElement","prevRootElement","removeEventListener","addEventListener","isHeightChanging","direction","updateRowHeight","heightChange","update","baseRowIndex","tableRows","getChildren","isFullRowMerge","getColSpan","tableRowIndex","getRowSpan","length","tableRow","height","getHeight","undefined","rowCells","Math","min","map","getCellNodeHeight","Infinity","newHeight","max","setHeight","tag","activeEditor","domCellNode","clientHeight","getCellColumnIndex","tableMap","columnIndex","forEach","row","columnIndexInner","updateColumnWidth","widthChange","colWidths","width","newColWidths","newWidth","mouseUpHandler","handler","preventDefault","stopPropagation","zoom","document","toggleResize","resizerStyles","setResizerStyles","bottom","left","right","top","isInModal","Boolean","getRootElement","closest","scrollX","window","scrollY","position","zoneWidth","styles","backgroundColor","cursor","tableRect","_jsx","ref","_jsxs","Fragment","className","lexical","theme","tableCellResizer","style","TableCellResizerPlugin","$","isEditable","portalTarget","setPortalTarget","t0","t1","root","body","t2"],"sources":["../../../../../../src/features/table/client/plugins/TableCellResizerPlugin/index.tsx"],"sourcesContent":["'use client'\n\nimport type { TableCellNode, TableDOMCell, TableMapType } from '@lexical/table'\nimport type { LexicalEditor, NodeKey } from 'lexical'\nimport type { JSX, MouseEventHandler } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n $computeTableMapSkipCellCheck,\n $getTableNodeFromLexicalNodeOrThrow,\n $getTableRowIndexFromTableCellNode,\n $isTableCellNode,\n $isTableRowNode,\n getDOMCellFromTarget,\n getTableElement,\n TableNode,\n} from '@lexical/table'\nimport { calculateZoomLevel, mergeRegister } from '@lexical/utils'\nimport { $getNearestNodeFromDOMNode, isHTMLElement, SKIP_SCROLL_INTO_VIEW_TAG } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport './index.css'\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\n\ntype MousePosition = {\n x: number\n y: number\n}\n\ntype MouseDraggingDirection = 'bottom' | 'right'\n\nconst MIN_ROW_HEIGHT = 33\nconst MIN_COLUMN_WIDTH = 92\n\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\n const targetRef = useRef<HTMLElement | null>(null)\n const resizerRef = useRef<HTMLDivElement | null>(null)\n const tableRectRef = useRef<ClientRect | null>(null)\n const [hasTable, setHasTable] = useState(false)\n const editorConfig = useEditorConfigContext()\n\n const mouseStartPosRef = useRef<MousePosition | null>(null)\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null)\n\n const [activeCell, updateActiveCell] = useState<null | TableDOMCell>(null)\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false)\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null)\n\n const resetState = useCallback(() => {\n updateActiveCell(null)\n targetRef.current = null\n updateDraggingDirection(null)\n mouseStartPosRef.current = null\n tableRectRef.current = null\n }, [])\n\n const isMouseDownOnEvent = (event: MouseEvent) => {\n return (event.buttons & 1) === 1\n }\n\n useEffect(() => {\n const tableKeys = new Set<NodeKey>()\n return mergeRegister(\n editor.registerMutationListener(TableNode, (nodeMutations) => {\n for (const [nodeKey, mutation] of nodeMutations) {\n if (mutation === 'destroyed') {\n tableKeys.delete(nodeKey)\n } else {\n tableKeys.add(nodeKey)\n }\n }\n setHasTable(tableKeys.size > 0)\n }),\n editor.registerNodeTransform(TableNode, (tableNode) => {\n if (tableNode.getColWidths()) {\n return tableNode\n }\n\n const numColumns = tableNode.getColumnCount()\n const columnWidth = MIN_COLUMN_WIDTH\n\n tableNode.setColWidths(Array(numColumns).fill(columnWidth))\n return tableNode\n }),\n )\n }, [editor])\n\n useEffect(() => {\n if (!hasTable) {\n return\n }\n\n const onMouseMove = (event: MouseEvent) => {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n if (draggingDirection) {\n updateMouseCurrentPos({\n x: event.clientX,\n y: event.clientY,\n })\n return\n }\n updateIsMouseDown(isMouseDownOnEvent(event))\n if (resizerRef.current && resizerRef.current.contains(target)) {\n return\n }\n\n if (targetRef.current !== target) {\n targetRef.current = target\n const cell = getDOMCellFromTarget(target)\n\n if (cell && activeCell !== cell) {\n editor.getEditorState().read(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem)\n\n if (!tableCellNode) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const tableElement = getTableElement(\n tableNode,\n editor.getElementByKey(tableNode.getKey()),\n )\n if (!tableElement) {\n throw new Error('TableCellResizer: Table element not found.')\n }\n\n targetRef.current = target\n tableRectRef.current = tableElement.getBoundingClientRect()\n updateActiveCell(cell)\n },\n { editor },\n )\n } else if (cell == null) {\n resetState()\n }\n }\n }\n\n const onMouseDown = (event: MouseEvent) => {\n updateIsMouseDown(true)\n }\n\n const onMouseUp = (event: MouseEvent) => {\n updateIsMouseDown(false)\n }\n\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\n prevRootElement?.removeEventListener('mousemove', onMouseMove)\n prevRootElement?.removeEventListener('mousedown', onMouseDown)\n prevRootElement?.removeEventListener('mouseup', onMouseUp)\n rootElement?.addEventListener('mousemove', onMouseMove)\n rootElement?.addEventListener('mousedown', onMouseDown)\n rootElement?.addEventListener('mouseup', onMouseUp)\n })\n\n return () => {\n removeRootListener()\n }\n }, [activeCell, draggingDirection, editor, hasTable, resetState])\n\n const isHeightChanging = (direction: MouseDraggingDirection) => {\n if (direction === 'bottom') {\n return true\n }\n return false\n }\n\n const updateRowHeight = useCallback(\n (heightChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n\n const baseRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode)\n const tableRows = tableNode.getChildren()\n\n // Determine if this is a full row merge by checking colspan\n const isFullRowMerge = tableCellNode.getColSpan() === tableNode.getColumnCount()\n\n // For full row merges, apply to first row. For partial merges, apply to last row\n const tableRowIndex = isFullRowMerge\n ? baseRowIndex\n : baseRowIndex + tableCellNode.getRowSpan() - 1\n\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\n throw new Error('Expected table cell to be inside of table row.')\n }\n\n const tableRow = tableRows[tableRowIndex]\n\n if (!$isTableRowNode(tableRow)) {\n throw new Error('Expected table row')\n }\n\n let height = tableRow.getHeight()\n if (height === undefined) {\n const rowCells = tableRow.getChildren<TableCellNode>()\n height = Math.min(\n ...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity),\n )\n }\n\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT)\n tableRow.setHeight(newHeight)\n },\n { tag: SKIP_SCROLL_INTO_VIEW_TAG },\n )\n },\n [activeCell, editor],\n )\n\n const getCellNodeHeight = (\n cell: TableCellNode,\n activeEditor: LexicalEditor,\n ): number | undefined => {\n const domCellNode = activeEditor.getElementByKey(cell.getKey())\n return domCellNode?.clientHeight\n }\n\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\n let columnIndex: number | undefined\n tableMap.forEach((row) => {\n row.forEach((cell, columnIndexInner) => {\n if (cell.cell === tableCellNode) {\n columnIndex = columnIndexInner\n }\n })\n })\n return columnIndex\n }\n\n const updateColumnWidth = useCallback(\n (widthChange: number) => {\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n editor.update(\n () => {\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem)\n if (!$isTableCellNode(tableCellNode)) {\n throw new Error('TableCellResizer: Table cell node not found.')\n }\n\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode)\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null)\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap)\n if (columnIndex === undefined) {\n throw new Error('TableCellResizer: Table column not found.')\n }\n\n const colWidths = tableNode.getColWidths()\n if (!colWidths) {\n return\n }\n const width = colWidths[columnIndex]\n if (width === undefined) {\n return\n }\n const newColWidths = [...colWidths]\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH)\n newColWidths[columnIndex] = newWidth\n tableNode.setColWidths(newColWidths)\n },\n { tag: SKIP_SCROLL_INTO_VIEW_TAG },\n )\n },\n [activeCell, editor],\n )\n\n const mouseUpHandler = useCallback(\n (direction: MouseDraggingDirection) => {\n const handler = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n if (mouseStartPosRef.current) {\n const { x, y } = mouseStartPosRef.current\n\n if (activeCell === null) {\n return\n }\n const zoom = calculateZoomLevel(event.target as Element)\n\n if (isHeightChanging(direction)) {\n const heightChange = (event.clientY - y) / zoom\n updateRowHeight(heightChange)\n } else {\n const widthChange = (event.clientX - x) / zoom\n updateColumnWidth(widthChange)\n }\n\n resetState()\n document.removeEventListener('mouseup', handler)\n }\n }\n return handler\n },\n [activeCell, resetState, updateColumnWidth, updateRowHeight],\n )\n\n const toggleResize = useCallback(\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\n (event) => {\n event.preventDefault()\n event.stopPropagation()\n\n if (!activeCell) {\n throw new Error('TableCellResizer: Expected active cell.')\n }\n\n mouseStartPosRef.current = {\n x: event.clientX,\n y: event.clientY,\n }\n updateMouseCurrentPos(mouseStartPosRef.current)\n updateDraggingDirection(direction)\n\n document.addEventListener('mouseup', mouseUpHandler(direction))\n },\n [activeCell, mouseUpHandler],\n )\n\n const [resizerStyles, setResizerStyles] = useState<{\n bottom?: null | React.CSSProperties\n left?: null | React.CSSProperties\n right?: null | React.CSSProperties\n top?: null | React.CSSProperties\n }>({\n bottom: null,\n left: null,\n right: null,\n top: null,\n })\n\n useEffect(() => {\n if (activeCell) {\n const { height, left, top, width } = activeCell.elem.getBoundingClientRect()\n const zoom = calculateZoomLevel(activeCell.elem)\n const isInModal = Boolean(editor.getRootElement()?.closest('dialog, [role=\"dialog\"]'))\n const scrollX = isInModal ? 0 : window.scrollX\n const scrollY = isInModal ? 0 : window.scrollY\n const position = isInModal ? ('fixed' as const) : ('absolute' as const)\n const zoneWidth = 10 // Pixel width of the zone where you can drag the edge\n const styles = {\n bottom: {\n backgroundColor: 'none',\n cursor: 'row-resize',\n height: `${zoneWidth}px`,\n left: `${scrollX + left}px`,\n position,\n top: `${scrollY + top + height - zoneWidth / 2}px`,\n width: `${width}px`,\n },\n right: {\n backgroundColor: 'none',\n cursor: 'col-resize',\n height: `${height}px`,\n left: `${scrollX + left + width - zoneWidth / 2}px`,\n position,\n top: `${scrollY + top}px`,\n width: `${zoneWidth}px`,\n },\n }\n\n const tableRect = tableRectRef.current\n\n if (draggingDirection && mouseCurrentPos && tableRect) {\n if (isHeightChanging(draggingDirection)) {\n styles[draggingDirection].left = `${scrollX + tableRect.left}px`\n styles[draggingDirection].top = `${scrollY + mouseCurrentPos.y / zoom}px`\n styles[draggingDirection].height = '3px'\n styles[draggingDirection].width = `${tableRect.width}px`\n } else {\n styles[draggingDirection].top = `${scrollY + tableRect.top}px`\n styles[draggingDirection].left = `${scrollX + mouseCurrentPos.x / zoom}px`\n styles[draggingDirection].width = '3px'\n styles[draggingDirection].height = `${tableRect.height}px`\n }\n\n styles[draggingDirection].backgroundColor = '#adf'\n }\n\n setResizerStyles(styles)\n } else {\n setResizerStyles({\n bottom: null,\n left: null,\n right: null,\n top: null,\n })\n }\n }, [activeCell, draggingDirection, editor, mouseCurrentPos])\n\n return (\n <div ref={resizerRef}>\n {activeCell != null && !isMouseDown && (\n <React.Fragment>\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('right')}\n style={resizerStyles.right || undefined}\n />\n <div\n className={`${editorConfig.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`}\n onMouseDown={toggleResize('bottom')}\n style={resizerStyles.bottom || undefined}\n />\n </React.Fragment>\n )}\n </div>\n )\n}\n\nexport const TableCellResizerPlugin: PluginComponent = () => {\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const [portalTarget, setPortalTarget] = useState<Element | null>(null)\n\n useEffect(\n () =>\n editor.registerRootListener((root) => {\n setPortalTarget(root?.closest('dialog, [role=\"dialog\"]') ?? document.body)\n }),\n [editor],\n )\n\n return useMemo(\n () =>\n isEditable && portalTarget\n ? createPortal(<TableCellResizer editor={editor} />, portalTarget)\n : null,\n [editor, isEditable, portalTarget],\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAMA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SACEC,6BAA6B,EAC7BC,mCAAmC,EACnCC,kCAAkC,EAClCC,gBAAgB,EAChBC,eAAe,EACfC,oBAAoB,EACpBC,eAAe,EACfC,SAAS,QACJ;AACP,SAASC,kBAAkB,EAAEC,aAAa,QAAQ;AAClD,SAASC,0BAA0B,EAAEC,aAAa,EAAEC,yBAAyB,QAAQ;AACrF,YAAYC,KAAA,MAAW;AACvB,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAClE,SAASC,YAAY,QAAQ;AAI7B,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C;;;;AAM3C;AAEA,OAAO,MAAM6D,sBAAA,GAA0CA,CAAA;EAAA,MAAAC,CAAA,GAAAzK,EAAA;EACrD,OAAA2B,MAAA,IAAiB1B,yBAAA;EACjB,MAAAyK,UAAA,GAAmBxK,kBAAA;EACnB,OAAAyK,YAAA,EAAAC,eAAA,IAAwCvJ,QAAA,KAAyB;EAAA,IAAAwJ,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAL,CAAA,QAAA9I,MAAA;IAG/DkJ,EAAA,GAAAA,CAAA,KACElJ,MAAA,CAAA2D,oBAAA,CAAAyF,IAAA;MACEH,eAAA,CAAgBG,IAAA,EAAA1B,OAAA,CAAc,gCAAAX,QAAA,CAAAsC,IAA2C;IAAA,CAC3E;IACFF,EAAA,IAACnJ,MAAA;IAAO8I,CAAA,MAAA9I,MAAA;IAAA8I,CAAA,MAAAI,EAAA;IAAAJ,CAAA,MAAAK,EAAA;EAAA;IAAAD,EAAA,GAAAJ,CAAA;IAAAK,EAAA,GAAAL,CAAA;EAAA;EALVvJ,SAAA,CACE2J,EAGE,EACFC,EAAQ;EAAA,IAAAG,EAAA;EAAA,IAAAR,CAAA,QAAA9I,MAAA,IAAA8I,CAAA,QAAAC,UAAA,IAAAD,CAAA,QAAAE,YAAA;IAKNM,EAAA,GAAAP,UAAA,IAAcC,YAAA,GACVrJ,YAAA,CAAayI,IAAA,CAAArI,gBAAA;MAAAC;IAAA,C,GAAsCgJ,YAAA,QACnD;IAAAF,CAAA,MAAA9I,MAAA;IAAA8I,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,YAAA;IAAAF,CAAA,MAAAQ,EAAA;EAAA;IAAAA,EAAA,GAAAR,CAAA;EAAA;EAAA,OAFJQ,EAEI;AAAA,CAGV","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/table/client/plugins/TableHoverActionsPlugin/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK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