@payloadcms/richtext-lexical 4.0.0-internal.bc5cf8c → 4.0.0-internal.bf4bcce

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 (793) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-W2ABOM7M.js +2 -0
  3. package/dist/exports/client/Field-W2ABOM7M.js.map +7 -0
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/chunk-3LRZDIIG.js.map +7 -0
  6. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  7. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  9. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  10. package/dist/exports/client/component-6DQLENIE.js +2 -0
  11. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  12. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -3
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +28 -29
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  18. package/dist/features/blockquote/client/index.js +2 -2
  19. package/dist/features/blockquote/client/index.js.map +1 -1
  20. package/dist/features/blockquote/server/index.js +2 -2
  21. package/dist/features/blockquote/server/index.js.map +1 -1
  22. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  23. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  24. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  25. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  26. package/dist/features/blocks/client/component/index.css +2 -2
  27. package/dist/features/blocks/client/component/index.d.ts +0 -6
  28. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  29. package/dist/features/blocks/client/component/index.js +169 -101
  30. package/dist/features/blocks/client/component/index.js.map +1 -1
  31. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  32. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  33. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  34. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  35. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  36. package/dist/features/blocks/client/componentInline/index.css +8 -9
  37. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  38. package/dist/features/blocks/client/componentInline/index.js +30 -22
  39. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  40. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  41. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  42. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  43. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  44. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  45. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  46. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  47. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  48. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  49. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  50. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  51. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  52. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  53. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  54. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  55. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  56. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  57. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  58. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  59. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  60. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  61. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  62. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  63. package/dist/features/blocks/server/index.js +2 -2
  64. package/dist/features/blocks/server/index.js.map +1 -1
  65. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  66. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  67. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  68. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  70. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  71. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  72. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  73. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  74. package/dist/features/blocks/server/schema.d.ts +2 -0
  75. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  76. package/dist/features/blocks/server/schema.js +10 -11
  77. package/dist/features/blocks/server/schema.js.map +1 -1
  78. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  79. package/dist/features/blocks/server/validate.js +1 -1
  80. package/dist/features/blocks/server/validate.js.map +1 -1
  81. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  83. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  84. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  86. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  87. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  88. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  89. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  90. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  92. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  93. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  94. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  95. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  97. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  98. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  99. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  100. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  101. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  102. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  103. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  104. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  105. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  106. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  107. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  108. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  109. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  110. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  111. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  112. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  113. package/dist/features/converters/markdownToLexical/index.js +5 -2
  114. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  115. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  116. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  117. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  118. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  119. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  120. package/dist/features/format/bold/feature.client.js +1 -1
  121. package/dist/features/format/bold/feature.client.js.map +1 -1
  122. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  123. package/dist/features/format/bold/feature.server.js +1 -1
  124. package/dist/features/format/bold/feature.server.js.map +1 -1
  125. package/dist/features/format/inlineCode/feature.client.js +1 -1
  126. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  127. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  128. package/dist/features/format/inlineCode/feature.server.js +1 -1
  129. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  130. package/dist/features/format/italic/feature.client.js +1 -1
  131. package/dist/features/format/italic/feature.client.js.map +1 -1
  132. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  133. package/dist/features/format/italic/feature.server.js +1 -1
  134. package/dist/features/format/italic/feature.server.js.map +1 -1
  135. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  136. package/dist/features/format/strikethrough/feature.client.js +1 -1
  137. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  138. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  139. package/dist/features/format/strikethrough/feature.server.js +1 -1
  140. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  141. package/dist/features/heading/client/index.js +2 -2
  142. package/dist/features/heading/client/index.js.map +1 -1
  143. package/dist/features/heading/constants.d.ts +2 -0
  144. package/dist/features/heading/constants.d.ts.map +1 -0
  145. package/dist/features/heading/constants.js +2 -0
  146. package/dist/features/heading/constants.js.map +1 -0
  147. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  148. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  149. package/dist/features/heading/markdownTransformer.js +6 -19
  150. package/dist/features/heading/markdownTransformer.js.map +1 -1
  151. package/dist/features/heading/server/index.d.ts.map +1 -1
  152. package/dist/features/heading/server/index.js +7 -3
  153. package/dist/features/heading/server/index.js.map +1 -1
  154. package/dist/features/heading/server/schema.d.ts.map +1 -1
  155. package/dist/features/heading/server/validate.d.ts +6 -0
  156. package/dist/features/heading/server/validate.d.ts.map +1 -0
  157. package/dist/features/heading/server/validate.js +15 -0
  158. package/dist/features/heading/server/validate.js.map +1 -0
  159. package/dist/features/horizontalRule/client/index.js +2 -2
  160. package/dist/features/horizontalRule/client/index.js.map +1 -1
  161. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  162. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  163. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  164. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  165. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  166. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  167. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  168. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  169. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  170. package/dist/features/horizontalRule/server/index.js +2 -2
  171. package/dist/features/horizontalRule/server/index.js.map +1 -1
  172. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  173. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  174. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  175. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  176. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  177. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  178. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  179. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  180. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  181. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  182. package/dist/features/horizontalRule/server/schema.js +6 -5
  183. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  184. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  185. package/dist/features/indent/client/IndentPlugin.js +122 -1
  186. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  187. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  188. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  189. package/dist/features/indent/server/i18n.js +74 -37
  190. package/dist/features/indent/server/i18n.js.map +1 -1
  191. package/dist/features/link/client/index.js +2 -2
  192. package/dist/features/link/client/index.js.map +1 -1
  193. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  194. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  195. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  196. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  197. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -13
  198. package/dist/features/link/markdownTransformer.d.ts +4 -4
  199. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  200. package/dist/features/link/markdownTransformer.js +2 -2
  201. package/dist/features/link/markdownTransformer.js.map +1 -1
  202. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  203. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  204. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  205. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  206. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  207. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  208. package/dist/features/link/nodes/LinkNode.js +2 -15
  209. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  210. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  211. package/dist/features/link/server/baseFields.js.map +1 -1
  212. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  213. package/dist/features/link/server/index.js +4 -4
  214. package/dist/features/link/server/index.js.map +1 -1
  215. package/dist/features/link/server/schema.d.ts.map +1 -1
  216. package/dist/features/link/server/schema.js +4 -2
  217. package/dist/features/link/server/schema.js.map +1 -1
  218. package/dist/features/link/server/validate.d.ts.map +1 -1
  219. package/dist/features/link/server/validate.js +1 -1
  220. package/dist/features/link/server/validate.js.map +1 -1
  221. package/dist/features/lists/checklist/client/index.js +1 -1
  222. package/dist/features/lists/checklist/client/index.js.map +1 -1
  223. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  224. package/dist/features/lists/checklist/server/index.js +6 -3
  225. package/dist/features/lists/checklist/server/index.js.map +1 -1
  226. package/dist/features/lists/orderedList/client/index.js +1 -1
  227. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  228. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  229. package/dist/features/lists/orderedList/server/index.js +6 -3
  230. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  231. package/dist/features/lists/shared/constants.d.ts +2 -0
  232. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  233. package/dist/features/lists/shared/constants.js +2 -0
  234. package/dist/features/lists/shared/constants.js.map +1 -0
  235. package/dist/features/lists/shared/validate.d.ts +5 -0
  236. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  237. package/dist/features/lists/shared/validate.js +15 -0
  238. package/dist/features/lists/shared/validate.js.map +1 -0
  239. package/dist/features/lists/unorderedList/client/index.js +1 -1
  240. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  241. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  242. package/dist/features/lists/unorderedList/server/index.js +6 -3
  243. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  244. package/dist/features/relationship/client/components/index.css +3 -6
  245. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  246. package/dist/features/relationship/client/index.d.ts +2 -2
  247. package/dist/features/relationship/client/index.d.ts.map +1 -1
  248. package/dist/features/relationship/client/index.js.map +1 -1
  249. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  250. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  251. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  252. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  253. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  254. package/dist/features/relationship/client/plugins/index.js +27 -31
  255. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  256. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  257. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  258. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  259. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  260. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  261. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  262. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  263. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  264. package/dist/features/relationship/server/index.d.ts +8 -1
  265. package/dist/features/relationship/server/index.d.ts.map +1 -1
  266. package/dist/features/relationship/server/index.js +28 -11
  267. package/dist/features/relationship/server/index.js.map +1 -1
  268. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  269. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  270. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  271. package/dist/features/relationship/server/schema.d.ts +6 -5
  272. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  273. package/dist/features/relationship/server/schema.js +31 -17
  274. package/dist/features/relationship/server/schema.js.map +1 -1
  275. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  276. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  277. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  278. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  279. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  280. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  281. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  282. package/dist/features/table/client/index.d.ts.map +1 -0
  283. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  284. package/dist/features/table/client/index.js.map +1 -0
  285. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  286. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  287. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  288. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  289. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  290. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  291. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  292. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  293. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  294. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  295. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  296. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  297. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  298. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  299. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  300. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  301. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  302. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  303. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  304. package/dist/features/table/client/utils/debounce.js.map +1 -0
  305. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  306. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  307. package/dist/features/table/markdownTransformer.d.ts +5 -0
  308. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  309. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  310. package/dist/features/table/markdownTransformer.js.map +1 -0
  311. package/dist/features/table/server/index.d.ts +3 -0
  312. package/dist/features/table/server/index.d.ts.map +1 -0
  313. package/dist/features/{experimental_table → table}/server/index.js +6 -6
  314. package/dist/features/table/server/index.js.map +1 -0
  315. package/dist/features/table/server/schema.d.ts.map +1 -0
  316. package/dist/features/table/server/schema.js.map +1 -0
  317. package/dist/features/textState/feature.client.js +1 -1
  318. package/dist/features/textState/feature.client.js.map +1 -1
  319. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  320. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  321. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  322. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  323. package/dist/features/toolbars/fixed/client/Toolbar/index.css +80 -8
  324. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  325. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  326. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  327. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  328. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  329. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  330. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  331. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  332. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  333. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  334. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  335. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  336. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  337. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +23 -25
  338. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  339. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  340. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  341. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  342. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  343. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  345. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  346. package/dist/features/typesClient.d.ts +1 -1
  347. package/dist/features/typesClient.d.ts.map +1 -1
  348. package/dist/features/typesClient.js.map +1 -1
  349. package/dist/features/typesServer.d.ts +19 -14
  350. package/dist/features/typesServer.d.ts.map +1 -1
  351. package/dist/features/typesServer.js.map +1 -1
  352. package/dist/features/upload/client/component/index.css +9 -11
  353. package/dist/features/upload/client/component/index.js +2 -1
  354. package/dist/features/upload/client/component/index.js.map +1 -1
  355. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  356. package/dist/features/upload/client/index.d.ts +3 -2
  357. package/dist/features/upload/client/index.d.ts.map +1 -1
  358. package/dist/features/upload/client/index.js.map +1 -1
  359. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  360. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  361. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  362. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  363. package/dist/features/upload/client/plugin/index.js +50 -53
  364. package/dist/features/upload/client/plugin/index.js.map +1 -1
  365. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  366. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  367. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  368. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  369. package/dist/features/upload/server/index.d.ts +7 -3
  370. package/dist/features/upload/server/index.d.ts.map +1 -1
  371. package/dist/features/upload/server/index.js +22 -18
  372. package/dist/features/upload/server/index.js.map +1 -1
  373. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  374. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  375. package/dist/features/upload/server/markdownTransformer.js +1 -1
  376. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  377. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  378. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  379. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  380. package/dist/features/upload/server/schema.d.ts +6 -18
  381. package/dist/features/upload/server/schema.d.ts.map +1 -1
  382. package/dist/features/upload/server/schema.js +34 -16
  383. package/dist/features/upload/server/schema.js.map +1 -1
  384. package/dist/features/upload/server/validate.d.ts +2 -2
  385. package/dist/features/upload/server/validate.d.ts.map +1 -1
  386. package/dist/features/upload/server/validate.js +4 -1
  387. package/dist/features/upload/server/validate.js.map +1 -1
  388. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  389. package/dist/field/Diff/converters/listitem/index.js +2 -1
  390. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  391. package/dist/field/Diff/converters/relationship/index.css +0 -1
  392. package/dist/field/Diff/converters/unknown/index.css +1 -2
  393. package/dist/field/Diff/converters/upload/index.css +0 -1
  394. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  395. package/dist/field/Diff/index.css +0 -2
  396. package/dist/field/Diff/index.d.ts +3 -2
  397. package/dist/field/Diff/index.d.ts.map +1 -1
  398. package/dist/field/Diff/index.js +3 -2
  399. package/dist/field/Diff/index.js.map +1 -1
  400. package/dist/field/Field.d.ts.map +1 -1
  401. package/dist/field/Field.js +26 -16
  402. package/dist/field/Field.js.map +1 -1
  403. package/dist/field/RenderLexical/index.d.ts +3 -1
  404. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  405. package/dist/field/RenderLexical/index.js +23 -23
  406. package/dist/field/RenderLexical/index.js.map +1 -1
  407. package/dist/field/ViewSelector.css +1 -1
  408. package/dist/field/ViewSelector.d.ts.map +1 -1
  409. package/dist/field/ViewSelector.js +1 -0
  410. package/dist/field/ViewSelector.js.map +1 -1
  411. package/dist/field/bundled.css +1 -1
  412. package/dist/field/index.css +4 -5
  413. package/dist/field/rscEntry.d.ts +2 -2
  414. package/dist/field/rscEntry.d.ts.map +1 -1
  415. package/dist/field/rscEntry.js.map +1 -1
  416. package/dist/i18n.d.ts.map +1 -1
  417. package/dist/i18n.js +68 -0
  418. package/dist/i18n.js.map +1 -1
  419. package/dist/index.d.ts +6 -6
  420. package/dist/index.d.ts.map +1 -1
  421. package/dist/index.js +33 -54
  422. package/dist/index.js.map +1 -1
  423. package/dist/lexical/LexicalEditor.css +30 -19
  424. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  425. package/dist/lexical/LexicalEditor.js +62 -99
  426. package/dist/lexical/LexicalEditor.js.map +1 -1
  427. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  428. package/dist/lexical/LexicalProvider.js +7 -22
  429. package/dist/lexical/LexicalProvider.js.map +1 -1
  430. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  431. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  432. package/dist/lexical/config/server/loader.d.ts +1 -1
  433. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  434. package/dist/lexical/config/server/loader.js +2 -2
  435. package/dist/lexical/config/server/loader.js.map +1 -1
  436. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  437. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  438. package/dist/lexical/config/server/sanitize.js +2 -2
  439. package/dist/lexical/config/server/sanitize.js.map +1 -1
  440. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  441. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  442. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  443. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  444. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  445. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  446. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  447. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  448. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  449. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  450. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  451. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  452. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  453. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  454. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  455. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  456. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  457. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  458. package/dist/lexical/plugins/SlashMenu/index.css +1 -7
  459. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +2 -1
  460. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  461. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  462. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  463. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +5 -3
  464. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  465. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +17 -3
  466. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  467. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  468. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  469. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  470. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  471. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  472. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  473. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  474. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  475. package/dist/lexical/theme/EditorTheme.css +18 -21
  476. package/dist/lexical/ui/ContentEditable.css +22 -17
  477. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  478. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  479. package/dist/lexical/ui/ContentEditable.js +32 -11
  480. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  481. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  482. package/dist/lexical/ui/icons/H3/index.js +13 -6
  483. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  484. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  485. package/dist/lexical/ui/icons/H4/index.js +13 -6
  486. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  487. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  488. package/dist/lexical/ui/icons/H5/index.js +13 -6
  489. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  490. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  491. package/dist/lexical/ui/icons/H6/index.js +13 -6
  492. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  493. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  494. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  495. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  496. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  497. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  498. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  499. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  500. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  501. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  502. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  503. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  504. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  505. package/dist/lexical/utils/point.d.ts.map +1 -1
  506. package/dist/lexical/utils/rect.d.ts.map +1 -1
  507. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  508. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  509. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  510. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  511. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  512. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  513. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  514. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  515. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  516. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  517. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  518. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  519. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  520. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  521. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  522. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  523. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  524. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  525. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  526. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  527. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  528. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  529. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  530. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  531. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  532. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  533. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  534. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  535. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  536. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  537. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  538. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  539. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  540. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  541. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  542. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  543. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  544. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  545. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  546. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  547. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  548. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  549. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  550. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  551. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  552. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  553. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  554. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  555. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  556. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  557. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  558. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  559. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  560. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  561. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  562. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  563. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  564. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  565. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  566. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  567. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  568. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  569. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  570. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  571. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  572. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  573. package/dist/presets/llmInstructions.d.ts +2 -0
  574. package/dist/presets/llmInstructions.d.ts.map +1 -0
  575. package/dist/presets/llmInstructions.js +13 -0
  576. package/dist/presets/llmInstructions.js.map +1 -0
  577. package/dist/types/builtInNodes.d.ts +1 -1
  578. package/dist/types/builtInNodes.d.ts.map +1 -1
  579. package/dist/types/builtInNodes.js +8 -3
  580. package/dist/types/builtInNodes.js.map +1 -1
  581. package/dist/types/index.d.ts +4 -7
  582. package/dist/types/index.d.ts.map +1 -1
  583. package/dist/types/index.js.map +1 -1
  584. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  585. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  586. package/dist/types/jsonSchemaHelpers.js +7 -2
  587. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  588. package/dist/types/nodeTypes.d.ts +6 -1
  589. package/dist/types/nodeTypes.d.ts.map +1 -1
  590. package/dist/types/nodeTypes.js.map +1 -1
  591. package/dist/types/schema.d.ts.map +1 -1
  592. package/dist/types/schema.js +12 -5
  593. package/dist/types/schema.js.map +1 -1
  594. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  595. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  596. package/dist/utilities/buildInitialState.d.ts +3 -2
  597. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  598. package/dist/utilities/buildInitialState.js +1 -0
  599. package/dist/utilities/buildInitialState.js.map +1 -1
  600. package/dist/utilities/createServerFeature.d.ts +1 -1
  601. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  602. package/dist/utilities/createServerFeature.js +2 -2
  603. package/dist/utilities/createServerFeature.js.map +1 -1
  604. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  605. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  606. package/dist/utilities/editorConfigFactory.js +9 -9
  607. package/dist/utilities/editorConfigFactory.js.map +1 -1
  608. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  609. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  610. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  611. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  612. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  613. package/dist/utilities/generateImportMap.d.ts +3 -3
  614. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  615. package/dist/utilities/generateImportMap.js +3 -7
  616. package/dist/utilities/generateImportMap.js.map +1 -1
  617. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  618. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  619. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  620. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  621. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  622. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  623. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  624. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  625. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  626. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  627. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  628. package/dist/validate/hasText.d.ts +2 -2
  629. package/dist/validate/hasText.d.ts.map +1 -1
  630. package/dist/validate/hasText.js.map +1 -1
  631. package/dist/validate/index.d.ts +1 -1
  632. package/dist/validate/index.d.ts.map +1 -1
  633. package/package.json +98 -30
  634. package/dist/@types/assets.d.js +0 -2
  635. package/dist/@types/assets.d.js.map +0 -1
  636. package/dist/dependencyChecker.spec.js +0 -16
  637. package/dist/dependencyChecker.spec.js.map +0 -1
  638. package/dist/exports/client/Field-JXXWHUE4.js +0 -2
  639. package/dist/exports/client/Field-JXXWHUE4.js.map +0 -7
  640. package/dist/exports/client/bundled.css +0 -1
  641. package/dist/exports/client/chunk-4EIYXZ6H.js +0 -12
  642. package/dist/exports/client/chunk-4EIYXZ6H.js.map +0 -7
  643. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  644. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  645. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  646. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  647. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  648. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  649. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  650. package/dist/exports/server/rsc.browser.d.ts +0 -11
  651. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  652. package/dist/exports/server/rsc.browser.js +0 -10
  653. package/dist/exports/server/rsc.browser.js.map +0 -1
  654. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  655. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  656. package/dist/features/blockquote/markdownTransformer.js +0 -33
  657. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  658. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  659. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  660. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  661. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  662. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  663. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  664. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  665. package/dist/features/experimental_table/client/index.js.map +0 -1
  666. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  667. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  668. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  669. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  670. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  671. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  672. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  673. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  674. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  675. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  676. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  677. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  678. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  679. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  680. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  681. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  682. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  683. package/dist/features/experimental_table/server/index.d.ts +0 -3
  684. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  685. package/dist/features/experimental_table/server/index.js.map +0 -1
  686. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  687. package/dist/features/experimental_table/server/schema.js.map +0 -1
  688. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  689. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  690. package/dist/features/format/bold/markdownTransformers.js +0 -23
  691. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  692. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  693. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  694. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  695. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  696. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  697. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  698. package/dist/features/format/italic/markdownTransformers.js +0 -12
  699. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  700. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  701. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  702. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  703. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  704. package/dist/features/link/markdownTransformer.spec.js +0 -195
  705. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  706. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  707. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  708. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  709. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  710. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  711. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  712. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  713. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  714. package/dist/features/lists/shared/markdown.d.ts +0 -6
  715. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  716. package/dist/features/lists/shared/markdown.js +0 -57
  717. package/dist/features/lists/shared/markdown.js.map +0 -1
  718. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  719. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  720. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  721. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  722. package/dist/field/clientEntry.d.ts +0 -29
  723. package/dist/field/clientEntry.d.ts.map +0 -1
  724. package/dist/field/clientEntry.js +0 -86
  725. package/dist/field/clientEntry.js.map +0 -1
  726. package/dist/lexical/utils/guard.d.ts +0 -5
  727. package/dist/lexical/utils/guard.d.ts.map +0 -1
  728. package/dist/lexical/utils/guard.js +0 -9
  729. package/dist/lexical/utils/guard.js.map +0 -1
  730. package/dist/lexical/utils/url.spec.js +0 -114
  731. package/dist/lexical/utils/url.spec.js.map +0 -1
  732. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  733. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  734. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  735. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  736. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js +0 -160
  737. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js.map +0 -1
  738. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  739. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  740. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -220
  741. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  742. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  743. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  744. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -199
  745. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  746. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  747. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  748. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  749. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  750. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -173
  751. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  752. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -352
  753. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  754. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  755. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  756. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  757. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  758. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  759. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  760. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  761. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  762. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  763. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  764. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  765. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  766. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  767. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  768. package/dist/packages/@lexical/markdown/index.js +0 -39
  769. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  770. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  771. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  772. package/dist/packages/@lexical/markdown/utils.js +0 -267
  773. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  774. package/dist/utilities/jsx/jsx.spec.js +0 -178
  775. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  776. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  777. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  778. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  779. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  780. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  781. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  782. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  783. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  784. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  785. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  786. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  787. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  788. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  789. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  790. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  791. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  792. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  793. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -49,9 +49,6 @@ export class RelationshipServerNode extends DecoratorBlockNode {
49
49
  };
50
50
  }
51
51
  static importJSON(serializedNode) {
52
- if (serializedNode.version === 1 && serializedNode?.value?.id) {
53
- serializedNode.value = serializedNode.value.id;
54
- }
55
52
  const importedData = {
56
53
  relationTo: serializedNode.relationTo,
57
54
  value: serializedNode.value
@@ -85,8 +82,7 @@ export class RelationshipServerNode extends DecoratorBlockNode {
85
82
  return {
86
83
  ...super.exportJSON(),
87
84
  ...this.getData(),
88
- type: 'relationship',
89
- version: 2
85
+ type: 'relationship'
90
86
  };
91
87
  }
92
88
  getData() {
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipNode.js","names":["DecoratorBlockNode","addClassNamesToElement","$applyNodeReplacement","$relationshipElementToServerNode","domNode","id","getAttribute","relationTo","node","$createServerRelationshipNode","value","RelationshipServerNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","createDOM","config","element","document","createElement","theme","relationship","decorate","_editor","_config","exportDOM","setAttribute","String","text","createTextNode","getTextContent","append","exportJSON","getData","type","getLatest","setData","writable","getWritable","$isServerRelationshipNode"],"sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"sourcesContent":["import type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport {\n $applyNodeReplacement,\n type DOMConversionMap,\n type DOMConversionOutput,\n type DOMExportOutput,\n type EditorConfig,\n type ElementFormatType,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n} from 'lexical'\n\nimport type { RelationshipData, SerializedRelationshipNode } from '../schema.js'\n\nfunction $relationshipElementToServerNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createServerRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipServerNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: RelationshipServerNode): RelationshipServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'relationship'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToServerNode,\n priority: 2,\n }\n },\n }\n }\n\n static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createServerRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.relationship)\n return element\n }\n\n override decorate(_editor: LexicalEditor, _config: EditorConfig): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute(\n 'data-lexical-relationship-id',\n String(typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value),\n )\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'relationship',\n version: 2,\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n override getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createServerRelationshipNode(data: RelationshipData): RelationshipServerNode {\n return $applyNodeReplacement(\n new RelationshipServerNode({\n data,\n }),\n )\n}\n\nexport function $isServerRelationshipNode(\n node: LexicalNode | null | RelationshipServerNode | undefined,\n): node is RelationshipServerNode {\n return node instanceof RelationshipServerNode\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"RelationshipNode.js","names":["DecoratorBlockNode","addClassNamesToElement","$applyNodeReplacement","$relationshipElementToServerNode","domNode","id","getAttribute","relationTo","node","$createServerRelationshipNode","value","RelationshipServerNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","importedData","setFormat","isInline","createDOM","config","element","document","createElement","theme","relationship","decorate","_editor","_config","exportDOM","setAttribute","String","text","createTextNode","getTextContent","append","exportJSON","getData","type","getLatest","setData","writable","getWritable","$isServerRelationshipNode"],"sources":["../../../../../src/features/relationship/server/nodes/RelationshipNode.tsx"],"sourcesContent":["import type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport {\n $applyNodeReplacement,\n type DOMConversionMap,\n type DOMConversionOutput,\n type DOMExportOutput,\n type EditorConfig,\n type ElementFormatType,\n type LexicalEditor,\n type LexicalNode,\n type NodeKey,\n} from 'lexical'\n\nimport type { RelationshipData, SerializedRelationshipNode } from '../schema.js'\n\nfunction $relationshipElementToServerNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createServerRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipServerNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: RelationshipServerNode): RelationshipServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'relationship'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToServerNode,\n priority: 2,\n }\n },\n }\n }\n\n static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode {\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createServerRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.relationship)\n return element\n }\n\n override decorate(_editor: LexicalEditor, _config: EditorConfig): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute(\n 'data-lexical-relationship-id',\n String(typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value),\n )\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'relationship',\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n override getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createServerRelationshipNode(data: RelationshipData): RelationshipServerNode {\n return $applyNodeReplacement(\n new RelationshipServerNode({\n data,\n }),\n )\n}\n\nexport function $isServerRelationshipNode(\n node: LexicalNode | null | RelationshipServerNode | undefined,\n): node is RelationshipServerNode {\n return node instanceof RelationshipServerNode\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,11 +1,11 @@
1
- import type { CollectionSlug, DataFromCollectionSlug, UploadCollectionSlug } from 'payload';
1
+ import type { CollectionSlug, DataFromCollectionSlug, IDTypeForCollectionSlug, UploadCollectionSlug } from 'payload';
2
2
  import type { LexicalElementFormat } from '../../../types/nodeTypes.js';
3
3
  import type { JSONSchemaFn } from '../../typesServer.js';
4
- import type { RelationshipFeatureProps } from './index.js';
4
+ import type { RelationshipFeatureServerProps } from './index.js';
5
5
  export type RelationshipData = {
6
6
  [TCollectionSlug in CollectionSlug]: {
7
7
  relationTo: TCollectionSlug;
8
- value: DataFromCollectionSlug<TCollectionSlug> | number | string;
8
+ value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>;
9
9
  };
10
10
  }[CollectionSlug];
11
11
  /**
@@ -17,12 +17,13 @@ export type NonUploadCollectionSlug = [Exclude<CollectionSlug, UploadCollectionS
17
17
  export type SerializedRelationshipNode<TSlugs extends CollectionSlug = NonUploadCollectionSlug> = {
18
18
  [TSlug in TSlugs]: {
19
19
  relationTo: TSlug;
20
- value: DataFromCollectionSlug<TSlug> | number | string;
20
+ value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>;
21
21
  };
22
22
  }[TSlugs] & {
23
23
  format: LexicalElementFormat;
24
24
  type: 'relationship';
25
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
25
26
  version: number;
26
27
  };
27
- export declare const createRelationshipNodeJSONSchema: (props: RelationshipFeatureProps | undefined) => JSONSchemaFn;
28
+ export declare const createRelationshipNodeJSONSchema: (props: RelationshipFeatureServerProps) => JSONSchemaFn;
28
29
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAE3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAK1D,MAAM,MAAM,gBAAgB,GAAG;KAC5B,eAAe,IAAI,cAAc,GAAG;QACnC,UAAU,EAAE,eAAe,CAAA;QAC3B,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACjE;CACF,CAAC,cAAc,CAAC,CAAA;AAEjB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,SAAS;IAC5F,KAAK;CACN,GACG,cAAc,GACd,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAA;AAEjD,MAAM,MAAM,0BAA0B,CAAC,MAAM,SAAS,cAAc,GAAG,uBAAuB,IAAI;KAC/F,KAAK,IAAI,MAAM,GAAG;QACjB,UAAU,EAAE,KAAK,CAAA;QACjB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACvD;CACF,CAAC,MAAM,CAAC,GAAG;IACV,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,cAAc,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAcD,eAAO,MAAM,gCAAgC,GAC1C,OAAO,wBAAwB,GAAG,SAAS,KAAG,YAkD9C,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/relationship/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAA;AAIhE,MAAM,MAAM,gBAAgB,GAAG;KAC5B,eAAe,IAAI,cAAc,GAAG;QACnC,UAAU,EAAE,eAAe,CAAA;QAC3B,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAA;KAC1F;CACF,CAAC,cAAc,CAAC,CAAA;AAEjB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,SAAS;IAC5F,KAAK;CACN,GACG,cAAc,GACd,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAA;AAEjD,MAAM,MAAM,0BAA0B,CAAC,MAAM,SAAS,cAAc,GAAG,uBAAuB,IAAI;KAC/F,KAAK,IAAI,MAAM,GAAG;QACjB,UAAU,EAAE,KAAK,CAAA;QACjB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;KACtE;CACF,CAAC,MAAM,CAAC,GAAG;IACV,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,cAAc,CAAA;IACpB,wJAAwJ;IACxJ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA4BD,eAAO,MAAM,gCAAgC,UACnC,8BAA8B,KAAG,YAiDxC,CAAA"}
@@ -1,29 +1,39 @@
1
1
  import { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js';
2
- import { filterEnabledRelationshipCollections } from '../shared/filterEnabledRelationshipCollections.js';
3
2
  /** MUST stay byte-for-byte in sync with the runtime `SerializedRelationshipNode` declared above. */
4
3
  const SERIALIZED_RELATIONSHIP_NODE_TS = `export type SerializedRelationshipNode<TSlugs extends keyof Config['collections']> = {
5
4
  type: 'relationship';
6
5
  format: LexicalElementFormat;
6
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
7
7
  version: number;
8
8
  } & {
9
9
  [TSlug in TSlugs]: {
10
10
  relationTo: TSlug;
11
- value: number | string | Config['collections'][TSlug];
11
+ value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];
12
+ };
13
+ }[TSlugs];`;
14
+ /** Input variant of `SerializedRelationshipNode`: `value` is ID-only (you only ever write an ID). */
15
+ const SERIALIZED_RELATIONSHIP_NODE_INPUT_TS = `export type SerializedRelationshipNodeInput<TSlugs extends keyof Config['collections']> = {
16
+ type: 'relationship';
17
+ format: LexicalElementFormat;
18
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
19
+ version: number;
20
+ } & {
21
+ [TSlug in TSlugs]: {
22
+ relationTo: TSlug;
23
+ value: Config['collections'][TSlug]['id'];
12
24
  };
13
25
  }[TSlugs];`;
14
26
  export const createRelationshipNodeJSONSchema = props => ({
15
27
  collectionIDFieldTypes,
16
- config,
17
- typeStringDefinitions
28
+ typeStringDefinitions,
29
+ variant
18
30
  }) => {
19
- typeStringDefinitions.add(SERIALIZED_RELATIONSHIP_NODE_TS);
20
- const enabledCollections = config?.collections ? filterEnabledRelationshipCollections(config.collections, {
21
- disabledCollections: props?.disabledCollections,
22
- enabledCollections: props?.enabledCollections,
23
- uploads: false
24
- }) : [];
25
- const variants = enabledCollections.map(collection => {
26
- const slug = collection.slug;
31
+ const isInput = variant === 'input';
32
+ typeStringDefinitions.add(isInput ? SERIALIZED_RELATIONSHIP_NODE_INPUT_TS : SERIALIZED_RELATIONSHIP_NODE_TS);
33
+ const {
34
+ enabledCollectionSlugs
35
+ } = props;
36
+ const variants = enabledCollectionSlugs.map(slug => {
27
37
  const idType = collectionIDFieldTypes[slug] ?? 'string';
28
38
  return {
29
39
  type: 'object',
@@ -38,7 +48,10 @@ export const createRelationshipNodeJSONSchema = props => ({
38
48
  type: 'string',
39
49
  const: slug
40
50
  },
41
- value: {
51
+ value: isInput ? {
52
+ type: idType,
53
+ description: 'The related document ID.'
54
+ } : {
42
55
  description: 'The related document by ID (string or number). Populated to the full document when read at depth > 0.',
43
56
  oneOf: [{
44
57
  type: idType
@@ -48,7 +61,7 @@ export const createRelationshipNodeJSONSchema = props => ({
48
61
  },
49
62
  version: versionSchema
50
63
  },
51
- required: ['format', 'relationTo', 'type', 'value', 'version']
64
+ required: ['format', 'relationTo', 'type', 'value']
52
65
  };
53
66
  });
54
67
  let schema;
@@ -63,16 +76,17 @@ export const createRelationshipNodeJSONSchema = props => ({
63
76
  },
64
77
  version: versionSchema
65
78
  },
66
- required: ['type', 'version']
79
+ required: ['type']
67
80
  };
68
81
  } else {
69
- const slugUnion = enabledCollections.map(c => `'${c.slug}'`).join(' | ');
82
+ const slugUnion = enabledCollectionSlugs.map(slug => `'${slug}'`).join(' | ');
70
83
  const baseSchema = variants.length === 1 ? variants[0] : {
71
84
  oneOf: variants
72
85
  };
86
+ const tsName = isInput ? 'SerializedRelationshipNodeInput' : 'SerializedRelationshipNode';
73
87
  schema = {
74
88
  ...baseSchema,
75
- tsType: `SerializedRelationshipNode<${slugUnion}>`
89
+ tsType: `${tsName}<${slugUnion}>`
76
90
  };
77
91
  }
78
92
  return schema;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":["formatSchema","versionSchema","filterEnabledRelationshipCollections","SERIALIZED_RELATIONSHIP_NODE_TS","createRelationshipNodeJSONSchema","props","collectionIDFieldTypes","config","typeStringDefinitions","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","tsType"],"sources":["../../../../src/features/relationship/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { CollectionSlug, DataFromCollectionSlug, UploadCollectionSlug } 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> | number | string\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> | number | string\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: number | string | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\nexport const createRelationshipNodeJSONSchema =\n (props: RelationshipFeatureProps | undefined): JSONSchemaFn =>\n ({ collectionIDFieldTypes, config, typeStringDefinitions }) => {\n typeStringDefinitions.add(SERIALIZED_RELATIONSHIP_NODE_TS)\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: {\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 schema = { ...baseSchema, tsType: `SerializedRelationshipNode<${slugUnion}>` }\n }\n\n return schema\n }\n"],"mappings":"AAOA,SAASA,YAAY,EAAEC,aAAa,QAAQ;AAC5C,SAASC,oCAAoC,QAAQ;AA6BrD;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;WAS7B;AAEX,OAAO,MAAMC,gCAAA,GACVC,KAAA,IACD,CAAC;EAAEC,sBAAsB;EAAEC,MAAM;EAAEC;AAAqB,CAAE;EACxDA,qBAAA,CAAsBC,GAAG,CAACN,+BAAA;EAC1B,MAAMO,kBAAA,GAAqBH,MAAA,EAAQI,WAAA,GAC/BT,oCAAA,CAAqCK,MAAA,CAAOI,WAAW,EAAE;IACvDC,mBAAA,EAAqBP,KAAA,EAAOO,mBAAA;IAC5BF,kBAAA,EAAoBL,KAAA,EAAOK,kBAAA;IAC3BG,OAAA,EAAS;EACX,KACA,EAAE;EAEN,MAAMC,QAAA,GAA0BJ,kBAAA,CAAmBK,GAAG,CAAEC,UAAA;IACtD,MAAMC,IAAA,GAAOD,UAAA,CAAWC,IAAI;IAC5B,MAAMC,MAAA,GAA8BZ,sBAAsB,CAACW,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,EAAQvB,YAAA;QACRwB,UAAA,EAAY;UAAEL,IAAA,EAAM;UAAUG,KAAA,EAAOL;QAAK;QAC1CQ,KAAA,EAAO;UACLC,WAAA,EACE;UACFC,KAAA,EAAO,CAAC;YAAER,IAAA,EAAMD;UAAO,GAAG;YAAEU,IAAA,EAAM,WAAWX,IAAA;UAAO;QACtD;QACAY,OAAA,EAAS5B;MACX;MACA6B,QAAA,EAAU,CAAC,UAAU,cAAc,QAAQ,SAAS;IACtD;EACF;EAEA,IAAIC,MAAA;EACJ,IAAIjB,QAAA,CAASkB,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,EAAS5B;MACX;MACA6B,QAAA,EAAU,CAAC,QAAQ;IACrB;EACF,OAAO;IACL,MAAMG,SAAA,GAAYvB,kBAAA,CAAmBK,GAAG,CAAEmB,CAAA,IAAM,IAAIA,CAAA,CAAEjB,IAAI,GAAG,EAAEkB,IAAI,CAAC;IACpE,MAAMC,UAAA,GAA0BtB,QAAA,CAASkB,MAAM,KAAK,IAAIlB,QAAQ,CAAC,EAAE,GAAI;MAAEa,KAAA,EAAOb;IAAS;IACzFiB,MAAA,GAAS;MAAE,GAAGK,UAAU;MAAEC,MAAA,EAAQ,8BAA8BJ,SAAA;IAAa;EAC/E;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 /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\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 /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\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 /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\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'],\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'],\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;AA8B5C;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;;WAU7B;AAEX;AACA,MAAMC,qCAAA,GAAwC;;;;;;;;;;WAUnC;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;IAC7C;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;IACb;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,EACrF,aAAa,SAAS,WAAW,EAAE,EACnC,qEAKG,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":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAQ5E,CAAA"}
1
+ {"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,UAAW,gBAAgB,EAAE,KAAG,YAQ5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAO/E,CAAA"}
1
+ {"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,UAAW,gBAAgB,EAAE,KAAG,YAO/E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,GAAI,OAAO,gBAAgB,EAAE,KAAG,YAQ7E,CAAA"}
1
+ {"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../src/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,UAAW,gBAAgB,EAAE,KAAG,YAQ7E,CAAA"}
@@ -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"}
@@ -5,13 +5,13 @@ import { TableIcon } from '../../../lexical/ui/icons/Table/index.js';
5
5
  import { createClientFeature } from '../../../utilities/createClientFeature.js';
6
6
  import { slashMenuBasicGroupWithItems } from '../../shared/slashMenu/basicGroup.js';
7
7
  import { toolbarAddDropdownGroupWithItems } from '../../shared/toolbar/addDropdownGroup.js';
8
- import { TableMarkdownTransformer } from '../markdownTransformer.js';
8
+ import { PAYLOAD_TABLE } from '../markdownTransformer.js';
9
9
  import { TableActionMenuPlugin } from './plugins/TableActionMenuPlugin/index.js';
10
10
  import { TableCellResizerPlugin } from './plugins/TableCellResizerPlugin/index.js';
11
11
  import { TableHoverActionsPlugin } from './plugins/TableHoverActionsPlugin/index.js';
12
12
  import { OPEN_TABLE_DRAWER_COMMAND, TableContext, TablePlugin } from './plugins/TablePlugin/index.js';
13
13
  export const TableFeatureClient = createClientFeature({
14
- markdownTransformers: [TableMarkdownTransformer],
14
+ markdownTransformers: [PAYLOAD_TABLE],
15
15
  nodes: [TableNode, TableCellNode, TableRowNode],
16
16
  plugins: [{
17
17
  Component: TablePlugin,
@@ -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":[]}
@@ -65,7 +65,6 @@
65
65
  color: var(--ramp-white-800);
66
66
  background: transparent;
67
67
  cursor: pointer;
68
- font-family: var(--text-body-medium-font-family);
69
68
  font-size: var(--text-body-medium-font-size);
70
69
  font-weight: var(--text-body-medium-font-weight);
71
70
  line-height: var(--text-body-medium-line-height);
@@ -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,