@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
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/blocks/client/componentInline/index.tsx", "../../../src/features/blocks/client/nodes/InlineBlocksNode.tsx", "../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical'\n\nimport './index.css'\nimport '../../../../utilities/fieldsDrawer/index.css'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types/index.js'\nimport type { InlineBlockFields } from '../../server/schema.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport {\n RegisterFormSubmit,\n useDrawerSubmit,\n} from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient | undefined = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient | undefined\n\n const blockOrSlug = blocksField?.blocks?.[0]\n const clientBlock: ClientBlock | undefined =\n typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n },\n [editor, nodeKey, formData],\n )\n\n const { headerActions, submitRef } = useDrawerSubmit()\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n removeInlineBlock()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n {...(isEditable\n ? {\n onClick: () => toggleDrawer(),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n toggleDrawer()\n }\n },\n role: 'button',\n tabIndex: 0,\n }\n : {})}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType, isEditable, toggleDrawer],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n headerActions={headerActions}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <div className=\"fields-drawer\">\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <RegisterFormSubmit submitRef={submitRef} />\n </div>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n", "'use client'\nimport ObjectID from 'bson-objectid'\nimport {\n $applyNodeReplacement,\n type EditorConfig,\n type LexicalEditor,\n type LexicalNode,\n} from 'lexical'\nimport React, { type JSX } from 'react'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types/index.js'\nimport type { InlineBlockFields, SerializedInlineBlockNode } from '../../server/schema.js'\n\nimport { ServerInlineBlockNode } from '../../server/nodes/InlineBlocksNode.js'\n\nconst InlineBlockComponent = React.lazy(() =>\n import('../componentInline/index.js').then((module) => ({\n default: module.InlineBlockComponent,\n })),\n)\n\nexport type InlineBlockDecorateFunction = (\n editor: LexicalEditor,\n config: EditorConfig,\n CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>,\n CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>,\n) => JSX.Element\n\nexport class InlineBlockNode extends ServerInlineBlockNode {\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode {\n const node = $createInlineBlockNode(serializedNode.fields)\n return node\n }\n\n override decorate(\n ...[_editor, config, CustomBlock, CustomLabel]: Parameters<InlineBlockDecorateFunction>\n ): ReturnType<InlineBlockDecorateFunction> {\n return (\n <InlineBlockComponent\n cacheBuster={this.getCacheBuster()}\n className={config.theme.inlineBlock ?? 'LexicalEditorTheme__inlineBlock'}\n CustomBlock={CustomBlock}\n CustomLabel={CustomLabel}\n formData={this.getFields()}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return super.exportJSON()\n }\n}\n\nexport function $createInlineBlockNode(fields: Exclude<InlineBlockFields, 'id'>): InlineBlockNode {\n return $applyNodeReplacement(\n new InlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isInlineBlockNode(\n node: InlineBlockNode | LexicalNode | null | undefined,\n): node is InlineBlockNode {\n return node instanceof InlineBlockNode\n}\n", "import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n} from 'lexical'\nimport type React from 'react'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\n\nimport type { InlineBlockFields, SerializedInlineBlockNode } from '../schema.js'\n\nexport class ServerInlineBlockNode extends DecoratorNode<null | React.ReactElement> {\n __cacheBuster: number\n __fields: InlineBlockFields\n\n constructor({\n cacheBuster,\n fields,\n key,\n }: {\n cacheBuster?: number\n fields: InlineBlockFields\n key?: NodeKey\n }) {\n super(key)\n this.__fields = fields\n this.__cacheBuster = cacheBuster || 0\n }\n\n static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode {\n return new this({\n cacheBuster: node.__cacheBuster,\n fields: node.__fields,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'inlineBlock'\n }\n\n static override importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {}\n }\n\n static override importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode {\n const node = $createServerInlineBlockNode(serializedNode.fields)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n canIndent() {\n return true\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, config?.theme?.inlineBlock)\n return element\n }\n\n override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n return null\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('span')\n element.classList.add('inline-block-container')\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n override exportJSON(): SerializedInlineBlockNode {\n return {\n type: 'inlineBlock',\n fields: this.getFields(),\n version: 1,\n }\n }\n\n getCacheBuster(): number {\n return this.getLatest().__cacheBuster\n }\n\n getFields(): InlineBlockFields {\n return this.getLatest().__fields\n }\n\n override getTextContent(): string {\n return `Block Field`\n }\n\n override isInline() {\n return true\n }\n\n setFields(fields: InlineBlockFields, preventFormStateUpdate?: boolean): void {\n const writable = this.getWritable()\n writable.__fields = fields\n if (!preventFormStateUpdate) {\n writable.__cacheBuster++\n }\n }\n\n override updateDOM(): boolean {\n return false\n }\n}\n\nexport function $createServerInlineBlockNode(\n fields: Exclude<InlineBlockFields, 'id'>,\n): ServerInlineBlockNode {\n return $applyNodeReplacement(\n new ServerInlineBlockNode({\n fields: {\n ...fields,\n id: fields?.id || new ObjectID.default().toHexString(),\n },\n }),\n )\n}\n\nexport function $isServerInlineBlockNode(\n node: LexicalNode | null | ServerInlineBlockNode | undefined,\n): node is ServerInlineBlockNode {\n return node instanceof ServerInlineBlockNode\n}\n"],
5
- "mappings": "oJAIA,OAASA,6BAAAA,OAAiC,wCAC1C,OAASC,sBAAAA,OAA0B,oCACnC,OAASC,kBAAAA,OAAsB,2BAC/B,OACEC,UAAAA,GACAC,UAAAA,GACAC,qBAAAA,GACAC,QAAAA,GACAC,oBAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,aAAAA,GACAC,mBAAAA,GACAC,mBAAAA,GACAC,gBAAAA,GACAC,sBAAAA,GACAC,kBAAAA,OACK,iBACP,OAASC,kBAAAA,MAAsB,wBAC/B,OAASC,iBAAAA,EAAeC,0BAAAA,OAA8B,UAEtD,OAAO,8CAAAC,EAAA,wBAAAC,OAAA,iBACP,OAAOC,GAAA,iBAAAC,GAAA,eAAAC,EAAA,aAAAC,EAAA,WAAAC,EAAA,UAAAC,MAAA,QAEP,OAASP,MAAAA,OAAAA,gDC3BT,OAAOQ,OAAc,gBACrB,OACEC,yBAAAA,OAIK,UACP,OAAOC,OAAyB,QCGhC,OAASC,0BAAAA,OAA8B,iBACvC,OAAOC,OAAc,gBACrB,OAASC,yBAAAA,GAAuBC,iBAAAA,OAAqB,UAI9C,IAAMC,EAAN,cAAoCD,EAAA,CACzCE,cACAC,SAEAC,YAAY,CACVC,YAAAA,EACAC,OAAAA,EACAC,IAAAA,CAAG,EAKF,CACD,MAAMA,CAAA,EACN,KAAKJ,SAAWG,EAChB,KAAKJ,cAAgBG,GAAe,CACtC,CAEA,OAAgBG,MAAMC,EAAoD,CACxE,OAAO,IAAI,KAAK,CACdJ,YAAaI,EAAKP,cAClBI,OAAQG,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AgB,GAAA,CACA1G,SAAM0F,EAAAiB,GAAA,4BAGJ/B,GACE9G,KAAAA,GACA8G,MAAAA,EAAAA,+BAAe3G,GAAA,GAAA,OAAA,QAAA,GAAA,CACf2I,MAAMlG,GAAArC,EAAA,mCAAA,CACNwI,CAAAA,WACS9E,EAAsB+E,EAAA,MAAA,CAC/B,UAAA,yBAECvJ,CAAAmI,EAAAqB,GACE,CAAIjJ,OAAAkE,GAAU,sBAEXnD,gBAAQmD,GACRgF,WAAW,GACXC,iBAAgB7E,EAChB8E,YAAW,GACXC,SAAAA,CAAAA,IACazB,EAAA0B,GAAA,CACbpE,UAAWC,QAEO4B,YAEpBa,EAAAtI,GAAA,QAGPiD,WAAAA,GAEGgH,aAAAA,EACE5B,qBAAAA,EACAlI,MAAAA,GACAsI,QAAAA,EACAyB,aAAAA,YAEAvC,KACF+B,EAAAjB,EAAA,UAECxF,CAAAA,EAAAA,EAAAA,GAAAA,CAAAA,CAAAA,EAAAA,EAAAA,GAAAA,8BAI0CkH,EAAO7B,EAAA,MAAA,CAAO8B,UAAM,GAAA5J,CAAA,qBAC9D8H,EACCA,EAAC,CAAA,CAAA,IAAI5H,IAAAA,OA5EX2C,EAAqBuB,EAAqB,CAE1C,UAACA,GAAapE,CAAA,aAChB,SAAA,CACGiI,EAAAA,OAAAA,CAAqB/H,SAAW,CAAA,iBAAGG,EAAqB,UAAA,aAAA,MACtDyH,EAAA,MAAA,WAAK,GAAA9H,CAAA,qBACL8H,EACCA,EAAC,CAAA,CAAA,IAAI5H,IAAAA",
6
- "names": ["useLexicalComposerContext", "useLexicalEditable", "getTranslation", "Button", "Drawer", "EditDepthProvider", "Form", "formatDrawerSlug", "RenderFields", "ShimmerEffect", "useConfig", "useDocumentForm", "useDocumentInfo", "useEditDepth", "useServerFunctions", "useTranslation", "abortAndIgnore", "$getNodeByKey", "SKIP_DOM_SELECTION_TAG", "deepCopyObjectSimpleWithoutReactComponents", "reduceFieldsToValues", "React", "createContext", "useCallback", "useEffect", "useMemo", "useRef", "ObjectID", "$applyNodeReplacement", "React", "addClassNamesToElement", "ObjectID", "$applyNodeReplacement", "DecoratorNode", "ServerInlineBlockNode", "__cacheBuster", "__fields", "constructor", "cacheBuster", "fields", "key", "clone", "node", "__key", "getType", "importDOM", "importJSON", "serializedNode", "$createServerInlineBlockNode", "isInline", "canIndent", "createDOM", "config", "element", "document", "createElement", "theme", "inlineBlock", "decorate", "editor", "exportDOM", "classList", "add", "text", "createTextNode", "getTextContent", "append", "exportJSON", "type", "getFields", "version", "getCacheBuster", "getLatest", "setFields", "preventFormStateUpdate", "writable", "getWritable", "updateDOM", "id", "default", "toHexString", "InlineBlockComponent", "React", "lazy", "then", "module", "default", "InlineBlockNode", "ServerInlineBlockNode", "clone", "node", "getType", "importJSON", "serializedNode", "$createInlineBlockNode", "fields", "decorate", "_editor", "config", "CustomBlock", "CustomLabel", "_jsx", "cacheBuster", "getCacheBuster", "className", "theme", "inlineBlock", "formData", "getFields", "nodeKey", "getKey", "exportJSON", "$applyNodeReplacement", "id", "ObjectID", "toHexString", "$isInlineBlockNode", "InlineBlockComponentContext", "createContext", "$isInlineBlockNode", "initialState", "React", "InlineBlockComponent", "props", "cacheBuster", "baseClass", "CustomBlockFromProps", "className", "CustomBlock", "CustomLabel", "formData", "nodeKey", "useLexicalEditable", "i18n", "t", "createdInlineBlock", "fieldProps", "featureClientSchemaMap", "uuidFromContext", "setCreatedInlineBlock", "useEditorConfigContext", "useDocumentForm", "fields", "getFormState", "useServerFunctions", "useRef", "editDepth", "useEditDepth", "setInitialState", "useState", "cachedFormState", "fieldName", "fieldState", "fromEntries", "entries", "initialValue", "prevCacheBuster", "useEffect", "hasMounted", "current", "formUuid", "uuid", "setCustomLabel", "CustomLabelFromProps", "customComponents", "BlockLabel", "resolvedCustomBlock", "useMemo", "isEditor", "useInlineBlockComponentContext", "resolvedCustomLabel", "drawerSlug", "depth", "toggleDrawer", "useLexicalDrawer", "id", "collectionSlug", "getDocPreferences", "globalSlug", "config", "useConfig", "clientSchemaMap", "componentMapRenderedBlockPath", "blocksField", "blockOrSlug", "clientBlockFields", "firstTimeDrawer", "removeInlineBlock", "useCallback", "editor", "length", "$getNodeByKey", "blockDisplayName", "clientBlock", "getTranslation", "labels", "singular", "schemaFieldsPath", "abortController", "state", "data", "docPermissions", "deepCopyObjectSimpleWithoutReactComponents", "parentDocumentFields", "docPreferences", "documentFormState", "initialBlockData", "initialBlockFormState", "operation", "readOnly", "isEditable", "renderAllFields", "signal", "newFormStateData", "reduceFieldsToValues", "node", "newData", "SKIP_DOM_SELECTION_TAG", "setCustomBlock", "awaitInitialState", "abortAndIgnore", "submit", "formState", "controller", "onChangeAbortControllerRef", "excludeFiles", "prevFormState", "state_0", "isStateOutOfSync", "formData_0", "initialState_0", "key", "Object", "onFormSubmit", "blockType", "node_0", "tag", "headerActions", "submitRef", "useDrawerSubmit", "RemoveButton", "buttonStyle", "disabled", "e", "icon", "onClick", "round", "size", "tooltip", "label", "EditButton", "_jsx", "Button", "el", "InlineBlockContainer", "e_0", "onKeyDown", "role", "tabIndex", "children", "ref", "inlineBlockElemElemRef", "formState_0", "beforeSubmit", "onChange", "disableValidationOnSubmit", "onSubmit", "EditDepthProvider", "Drawer", "slug", "title", "_jsxs", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "RegisterFormSubmit", "value", "Label", "height", "width"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as O,b as y}from"./chunk-5VIL27GI.js";import{b as F}from"./chunk-RJ5MAOKZ.js";import{c as q}from"react/compiler-runtime";import{jsx as _}from"react/jsx-runtime";import{Drawer as z,EditDepthProvider as G,useModal as J}from"@payloadcms/ui";import"react";import{jsx as I,jsxs as N}from"react/jsx-runtime";import{useLexicalEditable as T}from"@lexical/react/useLexicalEditable";import{Form as W,RenderFields as $,useDocumentForm as v,useDocumentInfo as k,useServerFunctions as L}from"@payloadcms/ui";import{abortAndIgnore as R}from"@payloadcms/ui/shared";import{deepCopyObjectSimpleWithoutReactComponents as E}from"payload/shared";import{useCallback as B,useEffect as M,useRef as H,useState as U}from"react";import{v4 as V}from"uuid";var j=({data:S,featureKey:e,fieldMapOverride:b,handleDrawerSubmit:w,schemaFieldsPathOverride:r,schemaPath:A,schemaPathSuffix:u,submitRef:D})=>{let{id:o,collectionSlug:a,getDocPreferences:i,globalSlug:n}=k(),{fields:s}=v(),t=T(),m=H(new AbortController),[d,l]=U(!1),{fieldProps:{featureClientSchemaMap:f}}=F(),{getFormState:p}=L(),c=r??`${A}.lexical_internal_feature.${e}${u?`.${u}`:""}`,C=b??f[e]?.[c];M(()=>{let h=new AbortController;return(async()=>{let{state:g}=await p({id:o,collectionSlug:a,data:S??{},docPermissions:{fields:!0},docPreferences:await i(),documentFormState:E(s,{excludeFiles:!0}),globalSlug:n,initialBlockData:S,operation:"update",readOnly:!t,renderAllFields:!0,schemaPath:c,signal:h.signal});l(g)})(),()=>{R(h)}},[c,o,S,p,a,t,n,i,s]);let x=B(async({formState:h})=>{R(m.current);let P=new AbortController;m.current=P;let{state:g}=await p({id:o,collectionSlug:a,docPermissions:{fields:!0},docPreferences:await i(),documentFormState:E(s,{excludeFiles:!0}),formState:h,globalSlug:n,initialBlockFormState:h,operation:"update",readOnly:!t,schemaPath:c,signal:P.signal});return g||h},[p,o,t,a,i,s,n,c]);return M(()=>()=>{R(m.current)},[]),d===!1?null:N(W,{beforeSubmit:[x],className:"fields-drawer",disableValidationOnSubmit:!0,fields:Array.isArray(C)?C:[],initialState:d,onChange:[x],onSubmit:w,uuid:V(),children:[I($,{fields:Array.isArray(C)?C:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:c,permissions:!0,readOnly:!t}),I(y,{submitRef:D})]})};var pe=S=>{let e=q(17),{className:b,data:w,drawerSlug:r,drawerTitle:A,featureKey:u,fieldMapOverride:D,handleDrawerSubmit:o,schemaFieldsPathOverride:a,schemaPath:i,schemaPathSuffix:n}=S,{closeModal:s}=J(),{headerActions:t,submitRef:m}=O(),d=A??"",l;e[0]!==s||e[1]!==r||e[2]!==o?(l=(p,c)=>{s(r),setTimeout(()=>{o(p,c)},1)},e[0]=s,e[1]=r,e[2]=o,e[3]=l):l=e[3];let f;return e[4]!==b||e[5]!==w||e[6]!==r||e[7]!==u||e[8]!==D||e[9]!==t||e[10]!==a||e[11]!==i||e[12]!==n||e[13]!==m||e[14]!==d||e[15]!==l?(f=_(G,{children:_(z,{className:b,headerActions:t,slug:r,title:d,children:_(j,{data:w,featureKey:u,fieldMapOverride:D,handleDrawerSubmit:l,schemaFieldsPathOverride:a,schemaPath:i,schemaPathSuffix:n,submitRef:m})})}),e[4]=b,e[5]=w,e[6]=r,e[7]=u,e[8]=D,e[9]=t,e[10]=a,e[11]=i,e[12]=n,e[13]=m,e[14]=d,e[15]=l,e[16]=f):f=e[16],f};import{createCommand as K}from"lexical";var be=K("INSERT_UPLOAD_WITH_DRAWER_COMMAND");export{pe as a,be as b};
2
- //# sourceMappingURL=chunk-UD4DQ4AK.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/features/upload/client/drawer/commands.ts"],
4
- "sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer, EditDepthProvider, useModal } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\nimport { useDrawerSubmit } from './useDrawerSubmit.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPath: string\n readonly schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n}) => {\n const { closeModal } = useModal()\n const { headerActions, submitRef } = useDrawerSubmit()\n\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <EditDepthProvider>\n <Drawer\n className={className}\n headerActions={headerActions}\n slug={drawerSlug}\n title={drawerTitle ?? ''}\n >\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={(args, args2) => {\n // Simply close drawer - no need for useLexicalDrawer here as at this point,\n // we don't need to restore the cursor position. This is handled by the useEffect in useLexicalDrawer.\n closeModal(drawerSlug)\n\n // Actual drawer submit logic needs to be triggered after the drawer is closed.\n // That's because the lexical selection / cursor restore logic that is striggerer by\n // `useLexicalDrawer` neeeds to be triggered before any editor.update calls that may happen\n // in the `handleDrawerSubmit` function.\n setTimeout(() => {\n handleDrawerSubmit(args, args2)\n }, 1)\n }}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPath={schemaPath}\n schemaPathSuffix={schemaPathSuffix}\n submitRef={submitRef}\n />\n </Drawer>\n </EditDepthProvider>\n )\n}\n", "'use client'\nimport type { FormState } from 'payload'\n\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport {\n Form,\n RenderFields,\n useDocumentForm,\n useDocumentInfo,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\nimport { RegisterFormSubmit } from './useDrawerSubmit.js'\nimport './index.css'\n\nexport const DrawerContent: React.FC<\n {\n submitRef: React.RefObject<(() => void) | null>\n } & Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>\n> = ({\n data,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPath,\n schemaPathSuffix,\n submitRef,\n}) => {\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { fields: parentDocumentFields } = useDocumentForm()\n const isEditable = useLexicalEditable()\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n const [initialState, setInitialState] = useState<false | FormState | undefined>(false)\n\n const {\n fieldProps: { featureClientSchemaMap },\n } = useEditorConfigContext()\n\n const { getFormState } = useServerFunctions()\n\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any = fieldMapOverride ?? featureClientSchemaMap[featureKey]?.[schemaFieldsPath] // Field Schema\n\n useEffect(() => {\n const controller = new AbortController()\n\n const awaitInitialState = async () => {\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: data ?? {},\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: data,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n\n return () => {\n abortAndIgnore(controller)\n }\n }, [\n schemaFieldsPath,\n id,\n data,\n getFormState,\n collectionSlug,\n isEditable,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n const onChange = useCallback(\n async ({ formState: prevFormState }: { formState: FormState }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n return state\n },\n [\n getFormState,\n id,\n isEditable,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n schemaFieldsPath,\n ],\n )\n\n // cleanup effect\n useEffect(() => {\n return () => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [])\n\n if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n className=\"fields-drawer\"\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <RegisterFormSubmit submitRef={submitRef} />\n </Form>\n )\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n"],
5
- "mappings": "uFAAA,OAAAA,KAAAC,MAAA,iEAGA,OAASC,UAAAA,EAAQC,qBAAAA,EAAmBC,YAAAA,MAAgB,iBACpD,MAAkB,0DCDlB,OAASC,sB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EAAAC,iBAAAA,EAAAI,UAAAA,CAAA,CAAA,iHAvBNO,GE1CJ,OAASQ,iBAAAA,MAAqB,UAEvB,IAAMC,GAERD,EAAc,mCAAA",
6
- "names": ["c", "_c", "Drawer", "EditDepthProvider", "useModal", "useLexicalEditable", "Form", "RenderFields", "useDocumentForm", "useDocumentInfo", "useServerFunctions", "abortAndIgnore", "deepCopyObjectSimpleWithoutReactComponents", "useCallback", "useEffect", "useRef", "useState", "v4", "uuid", "DrawerContent", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "submitRef", "id", "collectionSlug", "getDocPreferences", "globalSlug", "useDocumentInfo", "parentDocumentFields", "fields", "useDocumentForm", "useLexicalEditable", "isEditable", "onChangeAbortControllerRef", "useRef", "AbortController", "fieldProps", "useEditorConfigContext", "getFormState", "useServerFunctions", "schemaFieldsPath", "useEffect", "awaitInitialState", "state", "docPermissions", "docPreferences", "deepCopyObjectSimpleWithoutReactComponents", "documentFormState", "initialBlockData", "operation", "readOnly", "renderAllFields", "setInitialState", "abortAndIgnore", "controller", "onChange", "formState", "state_0", "prevFormState", "initialBlockFormState", "initialState", "_jsxs", "Form", "beforeSubmit", "className", "disableValidationOnSubmit", "isArray", "onSubmit", "uuid", "_jsx", "RenderFields", "forceRender", "parentIndexPath", "parentPath", "parentSchemaPath", "permissions", "FieldsDrawer", "t0", "$", "_c", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPath", "schemaPathSuffix", "closeModal", "useModal", "headerActions", "submitRef", "useDrawerSubmit", "t1", "t2", "args", "args2", "setTimeout", "t3", "_jsx", "EditDepthProvider", "children", "Drawer", "slug", "title", "DrawerContent", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";import{a as E,b as U}from"./chunk-UD4DQ4AK.js";import{c as y}from"./chunk-5VIL27GI.js";import{a as L}from"./chunk-WSAPGI3Z.js";import{b as g}from"./chunk-RJ5MAOKZ.js";import{jsx as a,jsxs as f}from"react/jsx-runtime";import{useLexicalComposerContext as ae}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as oe}from"@lexical/react/useLexicalEditable";import{getTranslation as P}from"@payloadcms/translations";import{Button as h,formatDrawerSlug as le,Pill as se,Thumbnail as ie,useConfig as re,useEditDepth as ne,usePayloadAPI as de,useTranslation as ce}from"@payloadcms/ui";import{$getNodeByKey as T,$getSelection as ue,$isNodeSelection as me,$isRangeSelection as pe}from"lexical";import{formatAdminURL as ge,isImage as fe}from"payload/shared";import{useCallback as _,useEffect as F,useId as he,useReducer as _e,useRef as we,useState as I}from"react";var j={depth:0},Te=k=>{let{className:e,data:{fields:z,relationTo:w,value:c},format:A,nodeKey:l}=k;if(typeof c=="object")throw new Error("Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.");let{config:{routes:{api:B},serverURL:K},getEntityConfig:M}=re(),b=we(null),{uuid:O}=g(),W=ne(),[s]=ae(),{editorConfig:H,fieldProps:{schemaPath:q}}=g(),u=oe(),{i18n:D,t:n}=ce(),[S,m]=I(!1),[$,G]=_e(o=>o+1,0),[i]=I(()=>M({collectionSlug:w})),J=he(),x=le({slug:"lexical-upload-drawer-"+O+J,depth:W}),{toggleDrawer:Q}=y(x,!0),{closeDocumentDrawer:C,DocumentDrawer:V,DocumentDrawerToggler:X}=L({id:c,collectionSlug:i.slug}),[{data:t},{setParams:v}]=de(ge({apiRoute:B,path:`/${i.slug}/${c}`,serverURL:K}),{initialParams:j}),N=t?.thumbnailURL||t?.url;F(()=>s.registerUpdateListener(({editorState:o})=>{o.read(()=>{let r=ue();if(me(r))m(r.has(l));else if(pe(r)){let d=r.getNodes();m(d.some(p=>p.getKey()===l))}else m(!1)})}),[s,l]),F(()=>{let o=b.current?.closest(`.${e}`);o&&o.classList.toggle(`${e}--selected`,S)},[S,e]);let Y=_(()=>{s.update(()=>{T(l)?.remove()})},[s,l]),Z=_(o=>{v({...j,cacheBust:$}),G(),C()},[v,$,C]),R=H?.resolvedFeatureMap?.get("upload")?.sanitizedClientFeatureProps.collections?.[i.slug]?.hasExtraFields,ee=_((o,r)=>{s.update(()=>{let d=T(l);if(d){let p={...d.getData(),fields:r};d.setData(p)}})},[s,l]),te=N&&t?.width&&t?.height?t.width>t.height?"landscape":"portrait":"landscape";return f("div",{className:`${e}__contents ${e}__contents--${te}`,"data-align":A||void 0,"data-filename":t?.filename,ref:b,children:[a("div",{className:`${e}__card`,children:f("div",{className:`${e}__media`,children:[a(ie,{collectionSlug:w,fileSrc:fe(t?.mimeType)?N:null,height:t?.height,size:"none",width:t?.width}),u&&f("div",{className:`${e}__floater`,"data-theme":"dark",children:[a(se,{className:`${e}__collectionLabel`,pillStyle:"dark",size:"small",children:P(i.labels.singular,D)}),a(X,{className:`${e}__doc-drawer-toggler`,children:a("span",{className:`${e}__filename`,children:t?.filename||n("general:untitled")})}),R?a(h,{buttonStyle:"ghost",className:`${e}__upload-drawer-toggler`,disabled:!u,el:"button",icon:"write",onClick:Q,round:!0,size:"medium",tooltip:n("fields:editRelationship")}):null,a("div",{className:`${e}__divider`}),a(h,{buttonStyle:"ghost",className:`${e}__swap-drawer-toggler`,disabled:!u,el:"button",icon:"swap",onClick:()=>{s.dispatchCommand(U,{replace:{nodeKey:l}})},round:!0,size:"medium",tooltip:n("fields:swapUpload")}),a(h,{buttonStyle:"ghost",className:`${e}__removeButton`,disabled:!u,icon:"x",onClick:o=>{o.preventDefault(),Y()},round:!0,size:"medium",tooltip:n("fields:removeUpload")})]})]})}),c?a(V,{onSave:Z}):null,R?a(E,{data:z,drawerSlug:x,drawerTitle:n("general:editLabel",{label:P(i.labels.singular,D)}),featureKey:"upload",handleDrawerSubmit:ee,schemaPath:q,schemaPathSuffix:i.slug}):null]})};export{Te as UploadComponent};
2
- //# sourceMappingURL=component-PHZQBOJE.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/upload/client/component/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport type { ClientCollectionConfig, Data, FormState, JsonObject } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n formatDrawerSlug,\n Pill,\n Thumbnail,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n type ElementFormatType,\n} from 'lexical'\nimport { formatAdminURL, isImage } from 'payload/shared'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/schema.js'\nimport type { UploadFeaturePropsClient } from '../index.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport './index.css'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n className: string\n data: UploadData\n format?: ElementFormatType\n nodeKey: string\n}\n\nexport const UploadComponent: React.FC<ElementProps> = (props) => {\n const {\n className: baseClass,\n data: { fields, relationTo, value },\n format,\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n\n const {\n editorConfig,\n fieldProps: { schemaPath },\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation()\n const [isSelected, setIsSelected] = useState(false)\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n getEntityConfig({ collectionSlug: relationTo }),\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n formatAdminURL({ apiRoute: api, path: `/${relatedCollection.slug}/${value}`, serverURL }),\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n const selection = $getSelection()\n\n if ($isNodeSelection(selection)) {\n setIsSelected(selection.has(nodeKey))\n } else if ($isRangeSelection(selection)) {\n const nodes = selection.getNodes()\n setIsSelected(nodes.some((node) => node.getKey() === nodeKey))\n } else {\n setIsSelected(false)\n }\n })\n })\n }, [editor, nodeKey])\n\n useEffect(() => {\n const outerEl = uploadRef.current?.closest(`.${baseClass}`)\n\n if (outerEl) {\n outerEl.classList.toggle(`${baseClass}--selected`, isSelected)\n }\n }, [isSelected, baseClass])\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (_data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_: FormState, data: JsonObject) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n const aspectRatio =\n thumbnailSRC && data?.width && data?.height\n ? data.width > data.height\n ? 'landscape'\n : 'portrait'\n : 'landscape'\n\n return (\n <div\n className={`${baseClass}__contents ${baseClass}__contents--${aspectRatio}`}\n data-align={format || undefined}\n data-filename={data?.filename}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__media`}>\n <Thumbnail\n collectionSlug={relationTo}\n fileSrc={isImage(data?.mimeType) ? thumbnailSRC : null}\n height={data?.height}\n size=\"none\"\n width={data?.width}\n />\n\n {isEditable && (\n <div className={`${baseClass}__floater`} data-theme=\"dark\">\n <Pill className={`${baseClass}__collectionLabel`} pillStyle=\"dark\" size=\"small\">\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </Pill>\n\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <span className={`${baseClass}__filename`}>\n {data?.filename || t('general:untitled')}\n </span>\n </DocumentDrawerToggler>\n\n {hasExtraFields ? (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"write\"\n onClick={toggleDrawer}\n round\n size=\"medium\"\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <div className={`${baseClass}__divider`} />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n size=\"medium\"\n tooltip={t('fields:swapUpload')}\n />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n size=\"medium\"\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPath={schemaPath}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n"],
5
- "mappings": "sOAGA,OAASA,6BAAAA,OAAiC,2CAC1C,OAASC,sBAAAA,OAA0B,oCACnC,OAASC,kBAAAA,MAAsB,2BAC/B,OACEC,UAAAA,EACAC,oBAAAA,GACAC,QAAAA,GACAC,aAAAA,GACAC,aAAAA,GACAC,gBAAAA,GACAC,iBAAAA,GACAC,kBAAAA,OACK,iBACP,OACEC,iBAAAA,EACAC,iBAAAA,GACAC,oBAAAA,GACAC,qBAAAA,OAEK,UACP,OAASC,kBAAAA,GAAgBC,WAAAA,OAAe,iBACxC,OAAgBC,eAAAA,EAAaC,aAAAA,EAAWC,SAAAA,GAAOC,cAAAA,GAAYC,UAAAA,GAAQC,YAAAA,MAAgB,QAYnF,IAAA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AAU,EACRO,EAAEC,GAEJ,MAAA,GACAP,KAAK,SACLX,QAAK1D,EAAA,qBAAA,GACLsE,uBAOT3B,IAAwBkC,KAAQlC,EAAAA,EAAAA,EAAAA,MAAmB/D,EAGhDD,WAAMmC,EACNgE,YAAYhE,EAAAA,oBAAA,CACZiE,MAAAA,EAAetE,EAAqB,OAAA,SAAAV,CAAA,IAEpC,WAAA,SACAiF,mBAAWC,GACXC,WAAAA,EACAC,iBAAYA,EAAA,OACZC,IAAAA",
6
- "names": ["useLexicalComposerContext", "useLexicalEditable", "getTranslation", "Button", "formatDrawerSlug", "Pill", "Thumbnail", "useConfig", "useEditDepth", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "$isRangeSelection", "formatAdminURL", "isImage", "useCallback", "useEffect", "useId", "useReducer", "useRef", "useState", "initialParams", "UploadComponent", "props", "baseClass", "className", "data", "fields", "relationTo", "format", "nodeKey", "value", "config", "routes", "serverURL", "getEntityConfig", "useConfig", "useRef", "uploadRef", "uuid", "useEditorConfigContext", "editDepth", "useLexicalComposerContext", "editorConfig", "fieldProps", "isEditable", "i18n", "t", "useTranslation", "setIsSelected", "useState", "isSelected", "dispatchCacheBust", "state", "cacheBust", "useReducer", "relatedCollection", "collectionSlug", "componentID", "useId", "formatDrawerSlug", "extraFieldsDrawerSlug", "slug", "toggleDrawer", "useLexicalDrawer", "closeDocumentDrawer", "DocumentDrawer", "DocumentDrawerToggler", "useLexicalDocumentDrawer", "id", "setParams", "usePayloadAPI", "apiRoute", "api", "path", "thumbnailSRC", "useEffect", "editor", "editorState", "$getSelection", "$isNodeSelection", "selection", "nodes", "$isRangeSelection", "getNodes", "node", "outerEl", "removeUpload", "useCallback", "_data", "updateUpload", "hasExtraFields", "resolvedFeatureMap", "update", "$getNodeByKey", "uploadNode", "newData", "aspectRatio", "ref", "_jsx", "_jsxs", "Thumbnail", "fileSrc", "isImage", "height", "size", "width", "Pill", "pillStyle", "getTranslation", "labels", "buttonStyle", "disabled", "el", "icon", "onClick", "round", "tooltip", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "dispatchCommand", "replace", "Button", "e", "preventDefault", "onSave", "drawerSlug", "drawerTitle", "featureKey", "onExtraFieldsDrawerSubmit", "handleDrawerSubmit", "schemaPath", "schemaPathSuffix"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";import{a,b}from"./chunk-ESITTE3C.js";import"./chunk-5VIL27GI.js";import"./chunk-RJ5MAOKZ.js";export{b as InlineBlockComponent,a as useInlineBlockComponentContext};
2
- //# sourceMappingURL=componentInline-H24N7GUG.js.map
@@ -1,11 +0,0 @@
1
- /**
2
- * Browser-condition stub for `@payloadcms/richtext-lexical/rsc`.
3
- *
4
- * Bundlers serving the client graph load this file via the `"browser"` export
5
- * condition in `package.json`. The real implementations rely on server-only
6
- * APIs and must never be evaluated in a browser context.
7
- */
8
- export declare const RscEntryLexicalCell: () => null;
9
- export declare const LexicalDiffComponent: () => null;
10
- export declare const RscEntryLexicalField: () => null;
11
- //# sourceMappingURL=rsc.browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rsc.browser.d.ts","sourceRoot":"","sources":["../../../src/exports/server/rsc.browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB,YAAa,CAAA;AAC7C,eAAO,MAAM,oBAAoB,YAAa,CAAA;AAC9C,eAAO,MAAM,oBAAoB,YAAa,CAAA"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Browser-condition stub for `@payloadcms/richtext-lexical/rsc`.
3
- *
4
- * Bundlers serving the client graph load this file via the `"browser"` export
5
- * condition in `package.json`. The real implementations rely on server-only
6
- * APIs and must never be evaluated in a browser context.
7
- */export const RscEntryLexicalCell = () => null;
8
- export const LexicalDiffComponent = () => null;
9
- export const RscEntryLexicalField = () => null;
10
- //# sourceMappingURL=rsc.browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rsc.browser.js","names":["RscEntryLexicalCell","LexicalDiffComponent","RscEntryLexicalField"],"sources":["../../../src/exports/server/rsc.browser.ts"],"sourcesContent":["/**\n * Browser-condition stub for `@payloadcms/richtext-lexical/rsc`.\n *\n * Bundlers serving the client graph load this file via the `\"browser\"` export\n * condition in `package.json`. The real implementations rely on server-only\n * APIs and must never be evaluated in a browser context.\n */\n\nexport const RscEntryLexicalCell = () => null\nexport const LexicalDiffComponent = () => null\nexport const RscEntryLexicalField = () => null\n"],"mappings":"AAAA;;;;;;GAQA,OAAO,MAAMA,mBAAA,GAAsBA,CAAA,KAAM;AACzC,OAAO,MAAMC,oBAAA,GAAuBA,CAAA,KAAM;AAC1C,OAAO,MAAMC,oBAAA,GAAuBA,CAAA,KAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { ElementTransformer } from '../../packages/@lexical/markdown/index.js';
2
- export declare const MarkdownTransformer: ElementTransformer;
3
- //# sourceMappingURL=markdownTransformer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../src/features/blockquote/markdownTransformer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAEnF,eAAO,MAAM,mBAAmB,EAAE,kBAgCjC,CAAA"}
@@ -1,33 +0,0 @@
1
- import { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text';
2
- export const MarkdownTransformer = {
3
- type: 'element',
4
- dependencies: [QuoteNode],
5
- export: (node, exportChildren) => {
6
- if (!$isQuoteNode(node)) {
7
- return null;
8
- }
9
- const lines = exportChildren(node).split('\n');
10
- const output = [];
11
- for (const line of lines) {
12
- output.push('> ' + line);
13
- }
14
- return output.join('\n');
15
- },
16
- regExp: /^>\s/,
17
- replace: (parentNode, children, _match, isImport) => {
18
- if (isImport) {
19
- const previousNode = parentNode.getPreviousSibling();
20
- if ($isQuoteNode(previousNode)) {
21
- previousNode.splice(previousNode.getChildrenSize(), 0, [...children]);
22
- previousNode.select(0, 0);
23
- parentNode.remove();
24
- return;
25
- }
26
- }
27
- const node = $createQuoteNode();
28
- node.append(...children);
29
- parentNode.replace(node);
30
- node.select(0, 0);
31
- }
32
- };
33
- //# sourceMappingURL=markdownTransformer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdownTransformer.js","names":["$createQuoteNode","$isQuoteNode","QuoteNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","lines","split","output","line","push","join","regExp","replace","parentNode","children","_match","isImport","previousNode","getPreviousSibling","splice","getChildrenSize","select","remove","append"],"sources":["../../../src/features/blockquote/markdownTransformer.ts"],"sourcesContent":["import { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text'\n\nimport type { ElementTransformer } from '../../packages/@lexical/markdown/index.js'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [QuoteNode],\n export: (node, exportChildren) => {\n if (!$isQuoteNode(node)) {\n return null\n }\n\n const lines = exportChildren(node).split('\\n')\n const output: string[] = []\n for (const line of lines) {\n output.push('> ' + line)\n }\n return output.join('\\n')\n },\n regExp: /^>\\s/,\n replace: (parentNode, children, _match, isImport) => {\n if (isImport) {\n const previousNode = parentNode.getPreviousSibling()\n if ($isQuoteNode(previousNode)) {\n previousNode.splice(previousNode.getChildrenSize(), 0, [...children])\n previousNode.select(0, 0)\n parentNode.remove()\n return\n }\n }\n\n const node = $createQuoteNode()\n node.append(...children)\n parentNode.replace(node)\n node.select(0, 0)\n },\n}\n"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,QAAQ;AAI1D,OAAO,MAAMC,mBAAA,GAA0C;EACrDC,IAAA,EAAM;EACNC,YAAA,EAAc,CAACH,SAAA,CAAU;EACzBI,MAAA,EAAQA,CAACC,IAAA,EAAMC,cAAA;IACb,IAAI,CAACP,YAAA,CAAaM,IAAA,GAAO;MACvB,OAAO;IACT;IAEA,MAAME,KAAA,GAAQD,cAAA,CAAeD,IAAA,EAAMG,KAAK,CAAC;IACzC,MAAMC,MAAA,GAAmB,EAAE;IAC3B,KAAK,MAAMC,IAAA,IAAQH,KAAA,EAAO;MACxBE,MAAA,CAAOE,IAAI,CAAC,OAAOD,IAAA;IACrB;IACA,OAAOD,MAAA,CAAOG,IAAI,CAAC;EACrB;EACAC,MAAA,EAAQ;EACRC,OAAA,EAASA,CAACC,UAAA,EAAYC,QAAA,EAAUC,MAAA,EAAQC,QAAA;IACtC,IAAIA,QAAA,EAAU;MACZ,MAAMC,YAAA,GAAeJ,UAAA,CAAWK,kBAAkB;MAClD,IAAIrB,YAAA,CAAaoB,YAAA,GAAe;QAC9BA,YAAA,CAAaE,MAAM,CAACF,YAAA,CAAaG,eAAe,IAAI,GAAG,C,GAAIN,QAAA,CAAS;QACpEG,YAAA,CAAaI,MAAM,CAAC,GAAG;QACvBR,UAAA,CAAWS,MAAM;QACjB;MACF;IACF;IAEA,MAAMnB,IAAA,GAAOP,gBAAA;IACbO,IAAA,CAAKoB,MAAM,IAAIT,QAAA;IACfD,UAAA,CAAWD,OAAO,CAACT,IAAA;IACnBA,IAAA,CAAKkB,MAAM,CAAC,GAAG;EACjB;AACF","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import type { FormState } from 'payload';
2
- /**
3
- * By default, if an array field is empty, it will be included in the form state with a value of 0.
4
- * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state
5
- * like that.
6
- * @param fields form state
7
- */
8
- export declare function removeEmptyArrayValues({ fields }: {
9
- fields: FormState;
10
- }): FormState;
11
- //# sourceMappingURL=removeEmptyArrayValues.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"removeEmptyArrayValues.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAQnF"}
@@ -1,20 +0,0 @@
1
- 'use client';
2
-
3
- /**
4
- * By default, if an array field is empty, it will be included in the form state with a value of 0.
5
- * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state
6
- * like that.
7
- * @param fields form state
8
- */
9
- export function removeEmptyArrayValues({
10
- fields
11
- }) {
12
- for (const key in fields) {
13
- const field = fields[key];
14
- if (Array.isArray(field?.rows) && 'value' in field) {
15
- field.disableFormData = true;
16
- }
17
- }
18
- return fields;
19
- }
20
- //# sourceMappingURL=removeEmptyArrayValues.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"removeEmptyArrayValues.js","names":["removeEmptyArrayValues","fields","key","field","Array","isArray","rows","disableFormData"],"sources":["../../../../../src/features/blocks/client/component/removeEmptyArrayValues.ts"],"sourcesContent":["'use client'\nimport type { FormState } from 'payload'\n\n/**\n * By default, if an array field is empty, it will be included in the form state with a value of 0.\n * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state\n * like that.\n * @param fields form state\n */\nexport function removeEmptyArrayValues({ fields }: { fields: FormState }): FormState {\n for (const key in fields) {\n const field = fields[key]\n if (Array.isArray(field?.rows) && 'value' in field) {\n field.disableFormData = true\n }\n }\n return fields\n}\n"],"mappings":"AAAA;;AAGA;;;;;;AAMA,OAAO,SAASA,uBAAuB;EAAEC;AAAM,CAAyB;EACtE,KAAK,MAAMC,GAAA,IAAOD,MAAA,EAAQ;IACxB,MAAME,KAAA,GAAQF,MAAM,CAACC,GAAA,CAAI;IACzB,IAAIE,KAAA,CAAMC,OAAO,CAACF,KAAA,EAAOG,IAAA,KAAS,WAAWH,KAAA,EAAO;MAClDA,KAAA,CAAMI,eAAe,GAAG;IAC1B;EACF;EACA,OAAON,MAAA;AACT","ignoreList":[]}
@@ -1,180 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { convertLexicalToPlaintext } from './sync/index.js';
3
- function textNode(text, bold) {
4
- return {
5
- type: 'text',
6
- detail: 0,
7
- format: bold ? 1 : 0,
8
- mode: 'normal',
9
- style: '',
10
- text,
11
- version: 1
12
- };
13
- }
14
- function linebreakNode() {
15
- return {
16
- type: 'linebreak',
17
- version: 1
18
- };
19
- }
20
- function tabNode() {
21
- return {
22
- type: 'tab',
23
- detail: 0,
24
- format: 0,
25
- mode: 'normal',
26
- style: '',
27
- text: '',
28
- version: 1
29
- };
30
- }
31
- function paragraphNode(children) {
32
- return {
33
- type: 'paragraph',
34
- children,
35
- direction: 'ltr',
36
- format: '',
37
- indent: 0,
38
- textFormat: 0,
39
- version: 1
40
- };
41
- }
42
- function headingNode(children) {
43
- return {
44
- type: 'heading',
45
- children,
46
- direction: 'ltr',
47
- format: '',
48
- indent: 0,
49
- textFormat: 0,
50
- tag: 'h1',
51
- version: 1
52
- };
53
- }
54
- function listItemNode(children) {
55
- return {
56
- type: 'listitem',
57
- children,
58
- checked: false,
59
- direction: 'ltr',
60
- format: '',
61
- indent: 0,
62
- value: 0,
63
- version: 1
64
- };
65
- }
66
- function listNode(children) {
67
- return {
68
- type: 'list',
69
- children,
70
- direction: 'ltr',
71
- format: '',
72
- indent: 0,
73
- listType: 'bullet',
74
- start: 0,
75
- tag: 'ul',
76
- version: 1
77
- };
78
- }
79
- function tableNode(children) {
80
- return {
81
- type: 'table',
82
- children,
83
- direction: 'ltr',
84
- format: '',
85
- indent: 0,
86
- version: 1
87
- };
88
- }
89
- function tableRowNode(children) {
90
- return {
91
- type: 'tablerow',
92
- children,
93
- direction: 'ltr',
94
- format: '',
95
- indent: 0,
96
- version: 1
97
- };
98
- }
99
- function tableCellNode(children) {
100
- return {
101
- type: 'tablecell',
102
- children,
103
- direction: 'ltr',
104
- format: '',
105
- indent: 0,
106
- headerState: 0,
107
- version: 1
108
- };
109
- }
110
- function rootNode(nodes) {
111
- return {
112
- root: {
113
- type: 'root',
114
- children: nodes,
115
- direction: 'ltr',
116
- format: '',
117
- indent: 0,
118
- version: 1
119
- }
120
- };
121
- }
122
- describe('convertLexicalToPlaintext', () => {
123
- it('ensure paragraph with text is correctly converted', () => {
124
- const data = rootNode([paragraphNode([textNode('Basic Text')])]);
125
- const plaintext = convertLexicalToPlaintext({
126
- data
127
- });
128
- expect(plaintext).toBe('Basic Text');
129
- });
130
- it('ensure paragraph with multiple text nodes is correctly converted', () => {
131
- const data = rootNode([paragraphNode([textNode('Basic Text'), textNode(' Bold', true), textNode(' Text')])]);
132
- const plaintext = convertLexicalToPlaintext({
133
- data
134
- });
135
- expect(plaintext).toBe('Basic Text Bold Text');
136
- });
137
- it('ensure linebreaks are converted correctly', () => {
138
- const data = rootNode([paragraphNode([textNode('Basic Text'), linebreakNode(), textNode('Next Line')])]);
139
- const plaintext = convertLexicalToPlaintext({
140
- data
141
- });
142
- expect(plaintext).toBe('Basic Text\nNext Line');
143
- });
144
- it('ensure tabs are converted correctly', () => {
145
- const data = rootNode([paragraphNode([textNode('Basic Text'), tabNode(), textNode('Next Line')])]);
146
- const plaintext = convertLexicalToPlaintext({
147
- data
148
- });
149
- expect(plaintext).toBe('Basic Text\tNext Line');
150
- });
151
- it('ensure new lines are added between paragraphs', () => {
152
- const data = rootNode([paragraphNode([textNode('Basic text')]), paragraphNode([textNode('Next block-node')])]);
153
- const plaintext = convertLexicalToPlaintext({
154
- data
155
- });
156
- expect(plaintext).toBe('Basic text\n\nNext block-node');
157
- });
158
- it('ensure new lines are added between heading nodes', () => {
159
- const data = rootNode([headingNode([textNode('Basic text')]), headingNode([textNode('Next block-node')])]);
160
- const plaintext = convertLexicalToPlaintext({
161
- data
162
- });
163
- expect(plaintext).toBe('Basic text\n\nNext block-node');
164
- });
165
- it('ensure new lines are added between list items and lists', () => {
166
- const data = rootNode([listNode([listItemNode([textNode('First item')]), listItemNode([textNode('Second item')])]), listNode([listItemNode([textNode('Next list')])])]);
167
- const plaintext = convertLexicalToPlaintext({
168
- data
169
- });
170
- expect(plaintext).toBe('First item\nSecond item\n\nNext list');
171
- });
172
- it('ensure new lines are added between tables, table rows, and table cells', () => {
173
- const data = rootNode([tableNode([tableRowNode([tableCellNode([textNode('Cell 1, Row 1')]), tableCellNode([textNode('Cell 2, Row 1')])]), tableRowNode([tableCellNode([textNode('Cell 1, Row 2')]), tableCellNode([textNode('Cell 2, Row 2')])])]), tableNode([tableRowNode([tableCellNode([textNode('Cell in Table 2')])])])]);
174
- const plaintext = convertLexicalToPlaintext({
175
- data
176
- });
177
- expect(plaintext).toBe('Cell 1, Row 1 | Cell 2, Row 1\nCell 1, Row 2 | Cell 2, Row 2\n\nCell in Table 2');
178
- });
179
- });
180
- //# sourceMappingURL=convertLexicalToPlaintext.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertLexicalToPlaintext.spec.js","names":["describe","it","expect","convertLexicalToPlaintext","textNode","text","bold","type","detail","format","mode","style","version","linebreakNode","tabNode","paragraphNode","children","direction","indent","textFormat","headingNode","tag","listItemNode","checked","value","listNode","listType","start","tableNode","tableRowNode","tableCellNode","headerState","rootNode","nodes","root","data","plaintext","toBe"],"sources":["../../../../src/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport type {\n DefaultNodeTypes,\n DefaultTypedEditorState,\n SerializedTabNode,\n SerializedParagraphNode,\n SerializedTextNode,\n SerializedLineBreakNode,\n SerializedHeadingNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedTableRowNode,\n SerializedTableNode,\n SerializedTableCellNode,\n} from '../../../types/nodeTypes.js'\nimport { convertLexicalToPlaintext } from './sync/index.js'\n\nfunction textNode(text: string, bold?: boolean): SerializedTextNode {\n return {\n type: 'text',\n detail: 0,\n format: bold ? 1 : 0,\n mode: 'normal',\n style: '',\n text,\n version: 1,\n }\n}\n\nfunction linebreakNode(): SerializedLineBreakNode {\n return {\n type: 'linebreak',\n version: 1,\n }\n}\n\nfunction tabNode(): SerializedTabNode {\n return {\n type: 'tab',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n }\n}\n\nfunction paragraphNode(children: DefaultNodeTypes[]): SerializedParagraphNode {\n return {\n type: 'paragraph',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n }\n}\n\nfunction headingNode(children: DefaultNodeTypes[]): SerializedHeadingNode {\n return {\n type: 'heading',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n tag: 'h1',\n version: 1,\n }\n}\n\nfunction listItemNode(children: DefaultNodeTypes[]): SerializedListItemNode {\n return {\n type: 'listitem',\n children,\n checked: false,\n direction: 'ltr',\n format: '',\n indent: 0,\n value: 0,\n version: 1,\n }\n}\n\nfunction listNode(children: DefaultNodeTypes[]): SerializedListNode {\n return {\n type: 'list',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n listType: 'bullet',\n start: 0,\n tag: 'ul',\n version: 1,\n }\n}\n\nfunction tableNode(children: (DefaultNodeTypes | SerializedTableRowNode)[]): SerializedTableNode {\n return {\n type: 'table',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableRowNode(\n children: (DefaultNodeTypes | SerializedTableCellNode)[],\n): SerializedTableRowNode {\n return {\n type: 'tablerow',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableCellNode(children: DefaultNodeTypes[]): SerializedTableCellNode {\n return {\n type: 'tablecell',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n headerState: 0,\n version: 1,\n }\n}\n\nfunction rootNode(nodes: (DefaultNodeTypes | SerializedTableNode)[]): DefaultTypedEditorState {\n return {\n root: {\n type: 'root',\n children: nodes,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n },\n }\n}\n\ndescribe('convertLexicalToPlaintext', () => {\n it('ensure paragraph with text is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([paragraphNode([textNode('Basic Text')])])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text')\n })\n\n it('ensure paragraph with multiple text nodes is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), textNode(' Bold', true), textNode(' Text')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text Bold Text')\n })\n\n it('ensure linebreaks are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), linebreakNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\nNext Line')\n })\n\n it('ensure tabs are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), tabNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\tNext Line')\n })\n\n it('ensure new lines are added between paragraphs', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic text')]),\n paragraphNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between heading nodes', () => {\n const data: DefaultTypedEditorState = rootNode([\n headingNode([textNode('Basic text')]),\n headingNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between list items and lists', () => {\n const data: DefaultTypedEditorState = rootNode([\n listNode([listItemNode([textNode('First item')]), listItemNode([textNode('Second item')])]),\n listNode([listItemNode([textNode('Next list')])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('First item\\nSecond item\\n\\nNext list')\n })\n\n it('ensure new lines are added between tables, table rows, and table cells', () => {\n const data: DefaultTypedEditorState = rootNode([\n tableNode([\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 1')]),\n tableCellNode([textNode('Cell 2, Row 1')]),\n ]),\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 2')]),\n tableCellNode([textNode('Cell 2, Row 2')]),\n ]),\n ]),\n tableNode([tableRowNode([tableCellNode([textNode('Cell in Table 2')])])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe(\n 'Cell 1, Row 1 | Cell 2, Row 1\\nCell 1, Row 2 | Cell 2, Row 2\\n\\nCell in Table 2',\n )\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AAerC,SAASC,yBAAyB,QAAQ;AAE1C,SAASC,SAASC,IAAY,EAAEC,IAAc;EAC5C,OAAO;IACLC,IAAA,EAAM;IACNC,MAAA,EAAQ;IACRC,MAAA,EAAQH,IAAA,GAAO,IAAI;IACnBI,IAAA,EAAM;IACNC,KAAA,EAAO;IACPN,IAAA;IACAO,OAAA,EAAS;EACX;AACF;AAEA,SAASC,cAAA;EACP,OAAO;IACLN,IAAA,EAAM;IACNK,OAAA,EAAS;EACX;AACF;AAEA,SAASE,QAAA;EACP,OAAO;IACLP,IAAA,EAAM;IACNC,MAAA,EAAQ;IACRC,MAAA,EAAQ;IACRC,IAAA,EAAM;IACNC,KAAA,EAAO;IACPN,IAAA,EAAM;IACNO,OAAA,EAAS;EACX;AACF;AAEA,SAASG,cAAcC,QAA4B;EACjD,OAAO;IACLT,IAAA,EAAM;IACNS,QAAA;IACAC,SAAA,EAAW;IACXR,MAAA,EAAQ;IACRS,MAAA,EAAQ;IACRC,UAAA,EAAY;IACZP,OAAA,EAAS;EACX;AACF;AAEA,SAASQ,YAAYJ,QAA4B;EAC/C,OAAO;IACLT,IAAA,EAAM;IACNS,QAAA;IACAC,SAAA,EAAW;IACXR,MAAA,EAAQ;IACRS,M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EJ;AACF","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/experimental_table/client/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,8EAmD7B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["TableCellNode","TableNode","TableRowNode","TableIcon","createClientFeature","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","TableMarkdownTransformer","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/experimental_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 { TableMarkdownTransformer } 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: [TableMarkdownTransformer],\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,wBAAwB,QAAQ;AACzC,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,wBAAA,CAAyB;EAChDS,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":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/experimental_table/client/plugins/TableActionMenuPlugin/index.tsx"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAE3E,OAAO,aAAa,CAAA;AA6oBpB,eAAO,MAAM,qBAAqB,EAAE,yBAQnC,CAAA"}