@payloadcms/richtext-lexical 4.0.0-internal.293e026 → 4.0.0-internal.2a3c3bc

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 (794) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-MT4FK3IP.js +2 -0
  3. package/dist/exports/client/Field-MT4FK3IP.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/Collapse/index.css +1 -1
  61. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  62. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  63. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  64. package/dist/features/blocks/server/index.js +2 -2
  65. package/dist/features/blocks/server/index.js.map +1 -1
  66. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  67. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  68. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  69. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  70. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  71. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  72. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  73. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  74. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  75. package/dist/features/blocks/server/schema.d.ts +2 -0
  76. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  77. package/dist/features/blocks/server/schema.js +10 -11
  78. package/dist/features/blocks/server/schema.js.map +1 -1
  79. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  80. package/dist/features/blocks/server/validate.js +1 -1
  81. package/dist/features/blocks/server/validate.js.map +1 -1
  82. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  83. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  84. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  85. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  86. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  87. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  88. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  89. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  90. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  92. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  93. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  94. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  95. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  97. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  98. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  99. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  100. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  101. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  102. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  103. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  104. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  105. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  106. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  107. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  108. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  109. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  110. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  111. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  112. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  113. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  114. package/dist/features/converters/markdownToLexical/index.js +5 -2
  115. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  116. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  117. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  118. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  119. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  120. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  121. package/dist/features/format/bold/feature.client.js +1 -1
  122. package/dist/features/format/bold/feature.client.js.map +1 -1
  123. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  124. package/dist/features/format/bold/feature.server.js +1 -1
  125. package/dist/features/format/bold/feature.server.js.map +1 -1
  126. package/dist/features/format/inlineCode/feature.client.js +1 -1
  127. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  128. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  129. package/dist/features/format/inlineCode/feature.server.js +1 -1
  130. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  131. package/dist/features/format/italic/feature.client.js +1 -1
  132. package/dist/features/format/italic/feature.client.js.map +1 -1
  133. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  134. package/dist/features/format/italic/feature.server.js +1 -1
  135. package/dist/features/format/italic/feature.server.js.map +1 -1
  136. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  137. package/dist/features/format/strikethrough/feature.client.js +1 -1
  138. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  139. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  140. package/dist/features/format/strikethrough/feature.server.js +1 -1
  141. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  142. package/dist/features/heading/client/index.js +2 -2
  143. package/dist/features/heading/client/index.js.map +1 -1
  144. package/dist/features/heading/constants.d.ts +2 -0
  145. package/dist/features/heading/constants.d.ts.map +1 -0
  146. package/dist/features/heading/constants.js +2 -0
  147. package/dist/features/heading/constants.js.map +1 -0
  148. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  149. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  150. package/dist/features/heading/markdownTransformer.js +6 -19
  151. package/dist/features/heading/markdownTransformer.js.map +1 -1
  152. package/dist/features/heading/server/index.d.ts.map +1 -1
  153. package/dist/features/heading/server/index.js +7 -3
  154. package/dist/features/heading/server/index.js.map +1 -1
  155. package/dist/features/heading/server/schema.d.ts.map +1 -1
  156. package/dist/features/heading/server/validate.d.ts +6 -0
  157. package/dist/features/heading/server/validate.d.ts.map +1 -0
  158. package/dist/features/heading/server/validate.js +15 -0
  159. package/dist/features/heading/server/validate.js.map +1 -0
  160. package/dist/features/horizontalRule/client/index.js +2 -2
  161. package/dist/features/horizontalRule/client/index.js.map +1 -1
  162. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  163. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  164. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  165. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  166. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  167. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  168. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  169. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  170. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  171. package/dist/features/horizontalRule/server/index.js +2 -2
  172. package/dist/features/horizontalRule/server/index.js.map +1 -1
  173. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  174. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  175. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  176. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  177. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  178. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  179. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  180. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  181. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  182. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  183. package/dist/features/horizontalRule/server/schema.js +6 -5
  184. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  185. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  186. package/dist/features/indent/client/IndentPlugin.js +122 -1
  187. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  188. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  189. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  190. package/dist/features/indent/server/i18n.js +74 -37
  191. package/dist/features/indent/server/i18n.js.map +1 -1
  192. package/dist/features/link/client/index.js +2 -2
  193. package/dist/features/link/client/index.js.map +1 -1
  194. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  195. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  196. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +11 -8
  197. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  198. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -13
  199. package/dist/features/link/markdownTransformer.d.ts +4 -4
  200. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  201. package/dist/features/link/markdownTransformer.js +2 -2
  202. package/dist/features/link/markdownTransformer.js.map +1 -1
  203. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  204. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  205. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  206. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  207. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  208. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  209. package/dist/features/link/nodes/LinkNode.js +2 -15
  210. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  211. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  212. package/dist/features/link/server/baseFields.js.map +1 -1
  213. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  214. package/dist/features/link/server/index.js +4 -4
  215. package/dist/features/link/server/index.js.map +1 -1
  216. package/dist/features/link/server/schema.d.ts.map +1 -1
  217. package/dist/features/link/server/schema.js +4 -2
  218. package/dist/features/link/server/schema.js.map +1 -1
  219. package/dist/features/link/server/validate.d.ts.map +1 -1
  220. package/dist/features/link/server/validate.js +1 -1
  221. package/dist/features/link/server/validate.js.map +1 -1
  222. package/dist/features/lists/checklist/client/index.js +1 -1
  223. package/dist/features/lists/checklist/client/index.js.map +1 -1
  224. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  225. package/dist/features/lists/checklist/server/index.js +6 -3
  226. package/dist/features/lists/checklist/server/index.js.map +1 -1
  227. package/dist/features/lists/orderedList/client/index.js +1 -1
  228. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  229. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  230. package/dist/features/lists/orderedList/server/index.js +6 -3
  231. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  232. package/dist/features/lists/shared/constants.d.ts +2 -0
  233. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  234. package/dist/features/lists/shared/constants.js +2 -0
  235. package/dist/features/lists/shared/constants.js.map +1 -0
  236. package/dist/features/lists/shared/validate.d.ts +5 -0
  237. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  238. package/dist/features/lists/shared/validate.js +15 -0
  239. package/dist/features/lists/shared/validate.js.map +1 -0
  240. package/dist/features/lists/unorderedList/client/index.js +1 -1
  241. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  242. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  243. package/dist/features/lists/unorderedList/server/index.js +6 -3
  244. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  245. package/dist/features/relationship/client/components/index.css +3 -6
  246. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  247. package/dist/features/relationship/client/index.d.ts +2 -2
  248. package/dist/features/relationship/client/index.d.ts.map +1 -1
  249. package/dist/features/relationship/client/index.js.map +1 -1
  250. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  251. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  252. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  253. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  254. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  255. package/dist/features/relationship/client/plugins/index.js +27 -31
  256. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  257. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  258. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  259. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  260. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  261. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  262. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  263. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  264. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  265. package/dist/features/relationship/server/index.d.ts +8 -1
  266. package/dist/features/relationship/server/index.d.ts.map +1 -1
  267. package/dist/features/relationship/server/index.js +28 -11
  268. package/dist/features/relationship/server/index.js.map +1 -1
  269. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  270. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  271. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  272. package/dist/features/relationship/server/schema.d.ts +6 -5
  273. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  274. package/dist/features/relationship/server/schema.js +31 -17
  275. package/dist/features/relationship/server/schema.js.map +1 -1
  276. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  277. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  278. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  279. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  280. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  281. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  282. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  283. package/dist/features/table/client/index.d.ts.map +1 -0
  284. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  285. package/dist/features/table/client/index.js.map +1 -0
  286. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  287. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  288. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  289. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  290. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  291. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  292. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  293. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  294. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  295. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  296. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  297. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  298. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  299. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  300. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  301. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  302. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  303. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  304. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  305. package/dist/features/table/client/utils/debounce.js.map +1 -0
  306. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  307. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  308. package/dist/features/table/markdownTransformer.d.ts +5 -0
  309. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  310. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  311. package/dist/features/table/markdownTransformer.js.map +1 -0
  312. package/dist/features/table/server/index.d.ts +3 -0
  313. package/dist/features/table/server/index.d.ts.map +1 -0
  314. package/dist/features/{experimental_table → table}/server/index.js +6 -6
  315. package/dist/features/table/server/index.js.map +1 -0
  316. package/dist/features/table/server/schema.d.ts.map +1 -0
  317. package/dist/features/table/server/schema.js.map +1 -0
  318. package/dist/features/textState/feature.client.js +1 -1
  319. package/dist/features/textState/feature.client.js.map +1 -1
  320. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  321. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  322. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  323. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  324. package/dist/features/toolbars/fixed/client/Toolbar/index.css +80 -8
  325. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  326. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  327. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  328. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  329. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  330. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  331. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  332. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  333. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  334. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  335. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  336. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  337. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  338. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +23 -25
  339. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  340. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  341. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  342. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  343. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  344. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  345. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  346. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  347. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  348. package/dist/features/typesClient.d.ts +1 -1
  349. package/dist/features/typesClient.d.ts.map +1 -1
  350. package/dist/features/typesClient.js.map +1 -1
  351. package/dist/features/typesServer.d.ts +19 -14
  352. package/dist/features/typesServer.d.ts.map +1 -1
  353. package/dist/features/typesServer.js.map +1 -1
  354. package/dist/features/upload/client/component/index.css +9 -11
  355. package/dist/features/upload/client/component/index.js +2 -1
  356. package/dist/features/upload/client/component/index.js.map +1 -1
  357. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  358. package/dist/features/upload/client/index.d.ts +3 -2
  359. package/dist/features/upload/client/index.d.ts.map +1 -1
  360. package/dist/features/upload/client/index.js.map +1 -1
  361. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  362. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  363. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  364. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  365. package/dist/features/upload/client/plugin/index.js +53 -56
  366. package/dist/features/upload/client/plugin/index.js.map +1 -1
  367. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  368. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  369. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  370. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  371. package/dist/features/upload/server/index.d.ts +7 -3
  372. package/dist/features/upload/server/index.d.ts.map +1 -1
  373. package/dist/features/upload/server/index.js +22 -18
  374. package/dist/features/upload/server/index.js.map +1 -1
  375. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  376. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  377. package/dist/features/upload/server/markdownTransformer.js +1 -1
  378. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  379. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  380. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  381. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  382. package/dist/features/upload/server/schema.d.ts +6 -18
  383. package/dist/features/upload/server/schema.d.ts.map +1 -1
  384. package/dist/features/upload/server/schema.js +34 -16
  385. package/dist/features/upload/server/schema.js.map +1 -1
  386. package/dist/features/upload/server/validate.d.ts +2 -2
  387. package/dist/features/upload/server/validate.d.ts.map +1 -1
  388. package/dist/features/upload/server/validate.js +4 -1
  389. package/dist/features/upload/server/validate.js.map +1 -1
  390. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  391. package/dist/field/Diff/converters/listitem/index.js +2 -1
  392. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  393. package/dist/field/Diff/converters/relationship/index.css +0 -1
  394. package/dist/field/Diff/converters/unknown/index.css +1 -2
  395. package/dist/field/Diff/converters/upload/index.css +0 -1
  396. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  397. package/dist/field/Diff/index.css +0 -2
  398. package/dist/field/Diff/index.d.ts +3 -2
  399. package/dist/field/Diff/index.d.ts.map +1 -1
  400. package/dist/field/Diff/index.js +3 -2
  401. package/dist/field/Diff/index.js.map +1 -1
  402. package/dist/field/Field.d.ts.map +1 -1
  403. package/dist/field/Field.js +26 -16
  404. package/dist/field/Field.js.map +1 -1
  405. package/dist/field/RenderLexical/index.d.ts +3 -1
  406. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  407. package/dist/field/RenderLexical/index.js +23 -23
  408. package/dist/field/RenderLexical/index.js.map +1 -1
  409. package/dist/field/ViewSelector.css +1 -1
  410. package/dist/field/ViewSelector.d.ts.map +1 -1
  411. package/dist/field/ViewSelector.js +1 -0
  412. package/dist/field/ViewSelector.js.map +1 -1
  413. package/dist/field/bundled.css +1 -1
  414. package/dist/field/index.css +7 -5
  415. package/dist/field/rscEntry.d.ts +2 -2
  416. package/dist/field/rscEntry.d.ts.map +1 -1
  417. package/dist/field/rscEntry.js.map +1 -1
  418. package/dist/i18n.d.ts.map +1 -1
  419. package/dist/i18n.js +68 -0
  420. package/dist/i18n.js.map +1 -1
  421. package/dist/index.d.ts +6 -6
  422. package/dist/index.d.ts.map +1 -1
  423. package/dist/index.js +33 -54
  424. package/dist/index.js.map +1 -1
  425. package/dist/lexical/LexicalEditor.css +30 -19
  426. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  427. package/dist/lexical/LexicalEditor.js +62 -99
  428. package/dist/lexical/LexicalEditor.js.map +1 -1
  429. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  430. package/dist/lexical/LexicalProvider.js +7 -22
  431. package/dist/lexical/LexicalProvider.js.map +1 -1
  432. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  433. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  434. package/dist/lexical/config/server/loader.d.ts +1 -1
  435. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  436. package/dist/lexical/config/server/loader.js +2 -2
  437. package/dist/lexical/config/server/loader.js.map +1 -1
  438. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  439. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  440. package/dist/lexical/config/server/sanitize.js +2 -2
  441. package/dist/lexical/config/server/sanitize.js.map +1 -1
  442. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  443. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  444. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  445. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  446. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  447. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  448. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  449. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  450. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  451. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  452. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  453. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  454. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  455. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  456. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  457. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  458. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  459. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  460. package/dist/lexical/plugins/SlashMenu/index.css +1 -7
  461. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +2 -1
  462. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  463. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  464. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  465. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +5 -3
  466. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  467. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +17 -3
  468. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  469. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  470. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  471. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  472. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  473. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  474. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  475. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  476. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  477. package/dist/lexical/theme/EditorTheme.css +18 -21
  478. package/dist/lexical/ui/ContentEditable.css +22 -17
  479. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  480. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  481. package/dist/lexical/ui/ContentEditable.js +21 -7
  482. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  483. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  484. package/dist/lexical/ui/icons/H3/index.js +13 -6
  485. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  486. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  487. package/dist/lexical/ui/icons/H4/index.js +13 -6
  488. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  489. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  490. package/dist/lexical/ui/icons/H5/index.js +13 -6
  491. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  492. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  493. package/dist/lexical/ui/icons/H6/index.js +13 -6
  494. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  495. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  496. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  497. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  498. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  499. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  500. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  501. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  502. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  503. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  504. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  505. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  506. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  507. package/dist/lexical/utils/point.d.ts.map +1 -1
  508. package/dist/lexical/utils/rect.d.ts.map +1 -1
  509. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  510. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  511. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  512. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  513. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  514. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  515. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  516. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  517. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  518. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  519. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  520. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  521. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  522. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  523. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  524. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  525. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  526. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  527. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  528. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  529. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  530. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  531. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  532. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  533. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  534. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  535. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  536. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  537. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  538. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  539. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  540. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  541. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  542. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  543. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  544. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  545. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  546. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  547. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  548. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  549. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  550. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  551. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  552. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  553. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  554. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  555. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  556. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  557. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  558. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  559. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  560. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  561. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  562. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  563. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  564. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  565. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  566. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  567. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  568. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  569. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  570. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  571. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  572. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  573. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  574. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  575. package/dist/presets/llmInstructions.d.ts +2 -0
  576. package/dist/presets/llmInstructions.d.ts.map +1 -0
  577. package/dist/presets/llmInstructions.js +13 -0
  578. package/dist/presets/llmInstructions.js.map +1 -0
  579. package/dist/types/builtInNodes.d.ts +1 -1
  580. package/dist/types/builtInNodes.d.ts.map +1 -1
  581. package/dist/types/builtInNodes.js +8 -3
  582. package/dist/types/builtInNodes.js.map +1 -1
  583. package/dist/types/index.d.ts +4 -7
  584. package/dist/types/index.d.ts.map +1 -1
  585. package/dist/types/index.js.map +1 -1
  586. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  587. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  588. package/dist/types/jsonSchemaHelpers.js +7 -2
  589. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  590. package/dist/types/nodeTypes.d.ts +6 -1
  591. package/dist/types/nodeTypes.d.ts.map +1 -1
  592. package/dist/types/nodeTypes.js.map +1 -1
  593. package/dist/types/schema.d.ts.map +1 -1
  594. package/dist/types/schema.js +12 -5
  595. package/dist/types/schema.js.map +1 -1
  596. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  597. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  598. package/dist/utilities/buildInitialState.d.ts +3 -2
  599. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  600. package/dist/utilities/buildInitialState.js +1 -0
  601. package/dist/utilities/buildInitialState.js.map +1 -1
  602. package/dist/utilities/createServerFeature.d.ts +1 -1
  603. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  604. package/dist/utilities/createServerFeature.js +2 -2
  605. package/dist/utilities/createServerFeature.js.map +1 -1
  606. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  607. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  608. package/dist/utilities/editorConfigFactory.js +9 -9
  609. package/dist/utilities/editorConfigFactory.js.map +1 -1
  610. package/dist/utilities/fieldsDrawer/index.css +4 -4
  611. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  612. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  613. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  614. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  615. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  616. package/dist/utilities/generateImportMap.d.ts +3 -3
  617. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  618. package/dist/utilities/generateImportMap.js +3 -7
  619. package/dist/utilities/generateImportMap.js.map +1 -1
  620. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  621. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  622. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  623. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  624. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  625. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  626. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  627. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  628. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  629. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  630. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  631. package/dist/validate/hasText.d.ts +2 -2
  632. package/dist/validate/hasText.d.ts.map +1 -1
  633. package/dist/validate/hasText.js.map +1 -1
  634. package/dist/validate/index.d.ts +1 -1
  635. package/dist/validate/index.d.ts.map +1 -1
  636. package/package.json +98 -30
  637. package/dist/@types/assets.d.js +0 -2
  638. package/dist/@types/assets.d.js.map +0 -1
  639. package/dist/dependencyChecker.spec.js +0 -16
  640. package/dist/dependencyChecker.spec.js.map +0 -1
  641. package/dist/exports/client/Field-VYBSMSRY.js +0 -2
  642. package/dist/exports/client/Field-VYBSMSRY.js.map +0 -7
  643. package/dist/exports/client/bundled.css +0 -1
  644. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  645. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  646. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  647. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  648. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  649. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  650. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  651. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  652. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  653. package/dist/exports/server/rsc.browser.d.ts +0 -11
  654. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  655. package/dist/exports/server/rsc.browser.js +0 -10
  656. package/dist/exports/server/rsc.browser.js.map +0 -1
  657. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  658. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  659. package/dist/features/blockquote/markdownTransformer.js +0 -33
  660. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  661. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  662. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  663. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  664. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  665. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  666. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  667. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  668. package/dist/features/experimental_table/client/index.js.map +0 -1
  669. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  670. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  671. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  672. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  673. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  674. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  675. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  676. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  677. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  678. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  679. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  680. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  681. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  682. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  683. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  684. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  685. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  686. package/dist/features/experimental_table/server/index.d.ts +0 -3
  687. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  688. package/dist/features/experimental_table/server/index.js.map +0 -1
  689. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  690. package/dist/features/experimental_table/server/schema.js.map +0 -1
  691. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  692. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  693. package/dist/features/format/bold/markdownTransformers.js +0 -23
  694. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  695. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  696. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  697. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  698. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  699. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  700. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  701. package/dist/features/format/italic/markdownTransformers.js +0 -12
  702. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  703. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  704. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  705. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  706. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  707. package/dist/features/link/markdownTransformer.spec.js +0 -195
  708. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  709. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  710. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  711. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  712. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  713. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  714. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  715. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  716. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  717. package/dist/features/lists/shared/markdown.d.ts +0 -6
  718. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  719. package/dist/features/lists/shared/markdown.js +0 -57
  720. package/dist/features/lists/shared/markdown.js.map +0 -1
  721. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  722. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  723. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  724. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  725. package/dist/field/clientEntry.d.ts +0 -29
  726. package/dist/field/clientEntry.d.ts.map +0 -1
  727. package/dist/field/clientEntry.js +0 -86
  728. package/dist/field/clientEntry.js.map +0 -1
  729. package/dist/lexical/utils/guard.d.ts +0 -5
  730. package/dist/lexical/utils/guard.d.ts.map +0 -1
  731. package/dist/lexical/utils/guard.js +0 -9
  732. package/dist/lexical/utils/guard.js.map +0 -1
  733. package/dist/lexical/utils/url.spec.js +0 -114
  734. package/dist/lexical/utils/url.spec.js.map +0 -1
  735. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  736. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  737. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  738. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  739. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  740. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  741. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  742. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  743. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  744. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  745. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  746. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  747. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  748. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  749. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  750. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  751. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  752. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  753. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  754. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  755. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  756. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  757. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  758. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  759. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  760. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  761. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  762. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  763. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  764. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  765. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  766. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  767. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  768. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  769. package/dist/packages/@lexical/markdown/index.js +0 -39
  770. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  771. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  772. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  773. package/dist/packages/@lexical/markdown/utils.js +0 -267
  774. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  775. package/dist/utilities/jsx/jsx.spec.js +0 -178
  776. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  777. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  778. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  779. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  780. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  781. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  782. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  783. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  784. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  785. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  786. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  787. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  788. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  789. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  790. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  791. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  792. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  793. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  794. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"InlineBlocksNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACR,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAIhC,OAAO,EAAyB,aAAa,EAAE,MAAM,SAAS,CAAA;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAEhF,qBAAa,qBAAsB,SAAQ,aAAa,CAAC,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC;IACjF,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,iBAAiB,CAAA;gBAEf,EACV,WAAW,EACX,MAAM,EACN,GAAG,GACJ,EAAE;QACD,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,MAAM,EAAE,iBAAiB,CAAA;QACzB,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;WAMe,KAAK,CAAC,IAAI,EAAE,qBAAqB,GAAG,qBAAqB;WAQzD,OAAO,IAAI,MAAM;WAIjB,SAAS,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;WAIpD,UAAU,CAAC,cAAc,EAAE,yBAAyB,GAAG,qBAAqB;IAK5F,MAAM,CAAC,QA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
55
  }
56
56
  exportJSON() {
57
57
  return {
58
+ ...super.exportJSON(),
58
59
  type: 'inlineBlock',
59
- fields: this.getFields(),
60
- version: 1
60
+ fields: this.getFields()
61
61
  };
62
62
  }
63
63
  getCacheBuster() {
@@ -1 +1 @@
1
- {"version":3,"file":"InlineBlocksNode.js","names":["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","$isServerInlineBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"sourcesContent":["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"],"mappings":"AAWA,SAASA,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AAIrD,OAAO,MAAMC,qBAAA,SAA8BD,aAAA;EACzCE,aAAA;EACAC,QAAA;EAEAC,YAAY;IACVC,WAAW;IACXC,MAAM;IACNC;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AC,eAAA,EAAyB;IACvB,OAAO,IAAI,CAACC,SAAS,GAAGrC,aAAa;EACvC;EAEAkC,UAAA,EAA+B;IAC7B,OAAO,IAAI,CAACG,SAAS,GAAGpC,QAAQ;EAClC;EAES6B,eAAA,EAAyB;IAChC,OAAO,aAAa;EACtB;EAEShB,SAAA,EAAW;IAClB,OAAO;EACT;EAEAwB,UAAUlC,MAAyB,EAAEmC,sBAAgC,EAAQ;IAC3E,MAAMC,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAASvC,QAAQ,GAAGG,MAAA;IACpB,IAAI,CAACmC,sBAAA,EAAwB;MAC3BC,QAAA,CAASxC,aAAa;IACxB;EACF;EAES0C,UAAA,EAAqB;IAC5B,OAAO;EACT;AACF;AAEA,OAAO,SAAS7B,6BACdT,MAAwC;EAExC,OAAOP,qBAAA,CACL,IAAIE,qBAAA,CAAsB;IACxBK,MAAA,EAAQ;MACN,GAAGA,MAAM;MACTuC,EAAA,EAAIvC,MAAA,EAAQuC,EAAA,IAAM,IAAI/C,QAAA,CAASgD,OAAO,GAAGC,WAAW;IACtD;EACF;AAEJ;AAEA,OAAO,SAASC,yBACdvC,IAA4D;EAE5D,OAAOA,IAAA,YAAgBR,qBAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"InlineBlocksNode.js","names":["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","getCacheBuster","getLatest","setFields","preventFormStateUpdate","writable","getWritable","updateDOM","id","default","toHexString","$isServerInlineBlockNode"],"sources":["../../../../../src/features/blocks/server/nodes/InlineBlocksNode.tsx"],"sourcesContent":["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 ...super.exportJSON(),\n type: 'inlineBlock',\n fields: this.getFields(),\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"],"mappings":"AAWA,SAASA,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AAIrD,OAAO,MAAMC,qBAAA,SAA8BD,aAAA;EACzCE,aAAA;EACAC,QAAA;EAEAC,YAAY;IACVC,WAAW;IACXC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACA,GAAA;IACN,IAAI,CAACJ,QAAQ,GAAGG,MAAA;IAChB,IAAI,CAACJ,aAAa,GAAGG,WAAA,IAAe;EACtC;EAEA,OAAgBG,MAAMC,IAA2B,EAAyB;IACxE,OAAO,IAAI,IAAI,CAAC;MACdJ,WAAA,EAAaI,IAAA,CAAKP,aAAa;MAC/BI,MAAA,EAAQG,IAAA,CAAKN,QAAQ;MACrBI,GAAA,EAAKE,IAAA,CAAKC;IACZ;EACF;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO;EACT;EAEA,OAAgBC,UAAA,EAAqD;IACnE,OAAO,CAAC;EACV;EAEA,OAAgBC,WAAWC,cAAyC,EAAyB;IAC3F,MAAML,IAAA,GAAOM,4BAAA,CAA6BD,cAAA,CAAeR,MAAM;IAC/D,OAAOG,IAAA;EACT;EAEA,OAAOO,SAAA,EAAkB;IACvB,OAAO;EACT;EAEAC,UAAA,EAAY;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MAAM;MACTsC,EAAA,EAAItC,MAAA,EAAQsC,EAAA,IAAM,IAAI9C,QAAA,CAAS+C,OAAO,GAAGC,WAAW;IACtD;EACF;AAEJ;AAEA,OAAO,SAASC,yBACdtC,IAA4D;EAE5D,OAAOA,IAAA,YAAgBR,qBAAA;AACzB","ignoreList":[]}
@@ -26,6 +26,7 @@ export type SerializedBlockNode<TFields extends {
26
26
  } & Omit<TFields, 'blockName' | 'id'>;
27
27
  format: LexicalElementFormat;
28
28
  type: 'block';
29
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
29
30
  version: number;
30
31
  } : never;
31
32
  export type SerializedInlineBlockNode<TFields extends {
@@ -37,6 +38,7 @@ export type SerializedInlineBlockNode<TFields extends {
37
38
  id: string;
38
39
  } & Omit<TFields, 'id'>;
39
40
  type: 'inlineBlock';
41
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
40
42
  version: number;
41
43
  } : never;
42
44
  export declare const createBlockNodeJSONSchema: (blockConfigs: Block[]) => JSONSchemaFn;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIhD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAIxE,KAAK,eAAe,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;IAC9D,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,OAAO,CAAA;AAEX,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;IACjE,EAAE,EAAE,MAAM,CAA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BAAoB,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,wJAAwJ;IACxJ,OAAO,EAAE,MAAM,CAAA;CAChB,GACD,KAAK,CAAA;AAEX,MAAM,MAAM,yBAAyB,CACnC,OAAO,SAAS;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,IAC3D,OAAO,SAAS,OAAO,GACvB;IACE,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC5C,IAAI,EAAE,aAAa,CAAA;IACnB,wJAAwJ;IACxJ,OAAO,EAAE,MAAM,CAAA;CAChB,GACD,KAAK,CAAA;AA2ET,eAAO,MAAM,yBAAyB,iBACrB,KAAK,EAAE,KAAG,YA+BxB,CAAA;AAEH,eAAO,MAAM,+BAA+B,uBACrB,KAAK,EAAE,KAAG,YA8B9B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { fieldsToJSONSchema, flattenAllFields, registerBlockInterface } from 'payload';
2
- import { formatSchema } from '../../../types/jsonSchemaHelpers.js';
2
+ import { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js';
3
3
  /**
4
4
  * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and
5
5
  * `SerializedInlineBlockNode` declared above.
@@ -7,11 +7,13 @@ import { formatSchema } from '../../../types/jsonSchemaHelpers.js';
7
7
  const BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {
8
8
  type: 'block';
9
9
  format: LexicalElementFormat;
10
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
10
11
  version: number;
11
12
  fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;
12
13
  } : never;
13
14
  export type SerializedInlineBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {
14
15
  type: 'inlineBlock';
16
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
15
17
  version: number;
16
18
  fields: { id: string } & Omit<TFields, 'id'>;
17
19
  } : never;`;
@@ -34,7 +36,8 @@ const buildBlockFieldsSchema = (block, args, {
34
36
  fields: flattened,
35
37
  i18n: args.i18n,
36
38
  interfaceNameDefinitions: args.interfaceNameDefinitions,
37
- typeStringDefinitions: args.typeStringDefinitions
39
+ typeStringDefinitions: args.typeStringDefinitions,
40
+ variant: args.variant
38
41
  }) : {
39
42
  properties: {},
40
43
  required: []
@@ -67,7 +70,7 @@ const buildBlockFieldsSchema = (block, args, {
67
70
  properties,
68
71
  required
69
72
  };
70
- return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions);
73
+ return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions, args.variant);
71
74
  };
72
75
  export const createBlockNodeJSONSchema = blockConfigs => args => {
73
76
  args.typeStringDefinitions.add(BLOCK_NODES_TS);
@@ -95,11 +98,9 @@ export const createBlockNodeJSONSchema = blockConfigs => args => {
95
98
  },
96
99
  fields: fieldsSchema,
97
100
  format: formatSchema,
98
- version: {
99
- type: 'integer'
100
- }
101
+ version: versionSchema
101
102
  },
102
- required: ['fields', 'format', 'type', 'version'],
103
+ required: ['fields', 'format', 'type'],
103
104
  tsType
104
105
  };
105
106
  };
@@ -128,11 +129,9 @@ export const createInlineBlockNodeJSONSchema = inlineBlockConfigs => args => {
128
129
  const: 'inlineBlock'
129
130
  },
130
131
  fields: fieldsSchema,
131
- version: {
132
- type: 'integer'
133
- }
132
+ version: versionSchema
134
133
  },
135
- required: ['fields', 'type', 'version'],
134
+ required: ['fields', 'type'],
136
135
  tsType
137
136
  };
138
137
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":["fieldsToJSONSchema","flattenAllFields","registerBlockInterface","formatSchema","BLOCK_NODES_TS","buildBlockFieldsSchema","block","args","isInlineBlock","flattened","fields","userFieldsSchema","config","collectionIDFieldTypes","i18n","interfaceNameDefinitions","typeStringDefinitions","properties","required","id","_stripId","blockName","_stripBlockName","userOnlyProperties","userOnlyRequired","filter","r","type","blockType","const","slug","fieldsSchema","additionalProperties","createBlockNodeJSONSchema","blockConfigs","add","definitionNames","map","length","$ref","oneOf","name","tsType","join","format","version","createInlineBlockNodeJSONSchema","inlineBlockConfigs"],"sources":["../../../../src/features/blocks/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { Block, JsonObject } from 'payload'\n\nimport { fieldsToJSONSchema, flattenAllFields, registerBlockInterface } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaArgs, JSONSchemaFn } from '../../typesServer.js'\n\nimport { formatSchema } from '../../../types/jsonSchemaHelpers.js'\n\ntype BaseBlockFields<TFields extends JsonObject = JsonObject> = {\n blockName?: null | string\n blockType: string\n} & TFields\n\nexport type BlockFields<TFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TFields>\n\nexport type BlockFieldsOptionalID<TFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TFields>\n\nexport type InlineBlockFields<TFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TFields\n\n// Distributive (`TFields extends unknown ?`) so `SerializedBlockNode<A | B>` expands to\n// `SerializedBlockNode<A> | SerializedBlockNode<B>` - i.e. a discriminated union where each block\n// keeps its own fields. Without this, `Omit<A | B, ...>` collapses to the blocks' common keys and\n// every block-specific field is lost. Lets users write either form interchangeably.\nexport type SerializedBlockNode<TFields extends { blockType: string } = { blockType: string }> =\n TFields extends unknown\n ? {\n fields: { blockName?: null | string; id: string } & Omit<TFields, 'blockName' | 'id'>\n format: LexicalElementFormat\n type: 'block'\n version: number\n }\n : never\n\nexport type SerializedInlineBlockNode<\n TFields extends { blockType: string } = { blockType: string },\n> = TFields extends unknown\n ? {\n fields: { id: string } & Omit<TFields, 'id'>\n type: 'inlineBlock'\n version: number\n }\n : never\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and\n * `SerializedInlineBlockNode` declared above.\n */\nconst BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'block';\n format: LexicalElementFormat;\n version: number;\n fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;\n} : never;\nexport type SerializedInlineBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'inlineBlock';\n version: number;\n fields: { id: string } & Omit<TFields, 'id'>;\n} : never;`\n\n/**\n * JSON Schema for one block's `fields:` payload. Strips Payload's auto-added\n * `id`/`blockName` and re-adds them with strict runtime types: required\n * non-null `id`, optional `blockName?: string | null` (omitted for inline\n * blocks). Registers the interface through `registerBlockInterface` (shared with\n * payload core) and returns its collision-safe name.\n */\nconst buildBlockFieldsSchema = (\n block: Block,\n args: JSONSchemaArgs,\n { isInlineBlock }: { isInlineBlock: boolean },\n): string => {\n const flattened = flattenAllFields({ fields: block.fields })\n const userFieldsSchema = args.config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes: args.collectionIDFieldTypes,\n config: args.config,\n fields: flattened,\n i18n: args.i18n,\n interfaceNameDefinitions: args.interfaceNameDefinitions,\n typeStringDefinitions: args.typeStringDefinitions,\n })\n : { properties: {}, required: [] }\n\n const {\n id: _stripId,\n blockName: _stripBlockName,\n ...userOnlyProperties\n } = (userFieldsSchema.properties ?? {}) as { [k: string]: JSONSchema4 }\n const userOnlyRequired = (userFieldsSchema.required ?? []).filter(\n (r) => r !== 'id' && r !== 'blockName',\n )\n\n const properties: { [k: string]: JSONSchema4 } = {\n id: { type: 'string' },\n blockType: { type: 'string', const: block.slug },\n ...userOnlyProperties,\n }\n const required = ['id', 'blockType', ...userOnlyRequired]\n\n if (!isInlineBlock) {\n properties.blockName = { type: ['string', 'null'] }\n }\n\n const fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties,\n required,\n }\n\n return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions)\n}\n\nexport const createBlockNodeJSONSchema =\n (blockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = blockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: false }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'block' },\n fields: fieldsSchema,\n format: formatSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'format', 'type', 'version'],\n tsType,\n }\n }\n\nexport const createInlineBlockNodeJSONSchema =\n (inlineBlockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = inlineBlockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: true }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedInlineBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedInlineBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'inlineBlock' },\n fields: fieldsSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'type', 'version'],\n tsType,\n }\n }\n"],"mappings":"AAGA,SAASA,kBA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,GACVC,kBAAA,IACAxC,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACmB,GAAG,CAAC/B,cAAA;EAC/B,MAAMgC,eAAA,GAAkBW,kBAAA,CAAmBV,GAAG,CAAE/B,KAAA,IAC9CD,sBAAA,CAAuBC,KAAA,EAAOC,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAK;EAG5D,MAAMuB,YAAA,GACJK,eAAA,CAAgBE,MAAM,KAAK,IACvB;IAAEX,IAAA,EAAM;IAAUK,oBAAA,EAAsB;EAAK,IAC7CI,eAAA,CAAgBE,MAAM,KAAK,IACzB;IAAEC,IAAA,EAAM,WAAWH,eAAe,CAAC,EAAE;EAAI,IACzC;IAAEI,KAAA,EAAOJ,eAAA,CAAgBC,GAAG,CAAEI,IAAA,KAAU;MAAEF,IAAA,EAAM,WAAWE,IAAA;IAAO;EAAI;EAE9E,MAAMC,MAAA,GACJN,eAAA,CAAgBE,MAAM,GAAG,IACrB,6BAA6BF,eAAA,CAAgBO,IAAI,CAAC,SAAS,GAC3D,kDAAkD;EAExD,OAAO;IACLhB,IAAA,EAAM;IACNK,oBAAA,EAAsB;IACtBf,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAc;MAC7CnB,MAAA,EAAQqB,YAAA;MACRc,OAAA,EAAS;QAAElB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,QAAQ,UAAU;IACvCwB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"schema.js","names":["fieldsToJSONSchema","flattenAllFields","registerBlockInterface","formatSchema","versionSchema","BLOCK_NODES_TS","buildBlockFieldsSchema","block","args","isInlineBlock","flattened","fields","userFieldsSchema","config","collectionIDFieldTypes","i18n","interfaceNameDefinitions","typeStringDefinitions","variant","properties","required","id","_stripId","blockName","_stripBlockName","userOnlyProperties","userOnlyRequired","filter","r","type","blockType","const","slug","fieldsSchema","additionalProperties","createBlockNodeJSONSchema","blockConfigs","add","definitionNames","map","length","$ref","oneOf","name","tsType","join","format","version","createInlineBlockNodeJSONSchema","inlineBlockConfigs"],"sources":["../../../../src/features/blocks/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { Block, JsonObject } from 'payload'\n\nimport { fieldsToJSONSchema, flattenAllFields, registerBlockInterface } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaArgs, JSONSchemaFn } from '../../typesServer.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\n\ntype BaseBlockFields<TFields extends JsonObject = JsonObject> = {\n blockName?: null | string\n blockType: string\n} & TFields\n\nexport type BlockFields<TFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TFields>\n\nexport type BlockFieldsOptionalID<TFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TFields>\n\nexport type InlineBlockFields<TFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TFields\n\n// Distributive (`TFields extends unknown ?`) so `SerializedBlockNode<A | B>` expands to\n// `SerializedBlockNode<A> | SerializedBlockNode<B>` - i.e. a discriminated union where each block\n// keeps its own fields. Without this, `Omit<A | B, ...>` collapses to the blocks' common keys and\n// every block-specific field is lost. Lets users write either form interchangeably.\nexport type SerializedBlockNode<TFields extends { blockType: string } = { blockType: string }> =\n TFields extends unknown\n ? {\n fields: { blockName?: null | string; id: string } & Omit<TFields, 'blockName' | 'id'>\n format: LexicalElementFormat\n type: 'block'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n }\n : never\n\nexport type SerializedInlineBlockNode<\n TFields extends { blockType: string } = { blockType: string },\n> = TFields extends unknown\n ? {\n fields: { id: string } & Omit<TFields, 'id'>\n type: 'inlineBlock'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n }\n : never\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and\n * `SerializedInlineBlockNode` declared above.\n */\nconst BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'block';\n format: LexicalElementFormat;\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number;\n fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;\n} : never;\nexport type SerializedInlineBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'inlineBlock';\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number;\n fields: { id: string } & Omit<TFields, 'id'>;\n} : never;`\n\n/**\n * JSON Schema for one block's `fields:` payload. Strips Payload's auto-added\n * `id`/`blockName` and re-adds them with strict runtime types: required\n * non-null `id`, optional `blockName?: string | null` (omitted for inline\n * blocks). Registers the interface through `registerBlockInterface` (shared with\n * payload core) and returns its collision-safe name.\n */\nconst buildBlockFieldsSchema = (\n block: Block,\n args: JSONSchemaArgs,\n { isInlineBlock }: { isInlineBlock: boolean },\n): string => {\n const flattened = flattenAllFields({ fields: block.fields })\n const userFieldsSchema = args.config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes: args.collectionIDFieldTypes,\n config: args.config,\n fields: flattened,\n i18n: args.i18n,\n interfaceNameDefinitions: args.interfaceNameDefinitions,\n typeStringDefinitions: args.typeStringDefinitions,\n variant: args.variant,\n })\n : { properties: {}, required: [] }\n\n const {\n id: _stripId,\n blockName: _stripBlockName,\n ...userOnlyProperties\n } = userFieldsSchema.properties ?? {}\n const userOnlyRequired = (userFieldsSchema.required ?? []).filter(\n (r) => r !== 'id' && r !== 'blockName',\n )\n\n const properties: { [k: string]: JSONSchema4 } = {\n id: { type: 'string' },\n blockType: { type: 'string', const: block.slug },\n ...userOnlyProperties,\n }\n const required = ['id', 'blockType', ...userOnlyRequired]\n\n if (!isInlineBlock) {\n properties.blockName = { type: ['string', 'null'] }\n }\n\n const fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties,\n required,\n }\n\n return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions, args.variant)\n}\n\nexport const createBlockNodeJSONSchema =\n (blockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = blockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: false }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'block' },\n fields: fieldsSchema,\n format: formatSchema,\n version: versionSchema,\n },\n required: ['fields', 'format', 'type'],\n tsType,\n }\n }\n\nexport const createInlineBlockNodeJSONSchema =\n (inlineBlockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = inlineBlockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: true }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedInlineBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedInlineBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 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B,YAAA;MACRa,MAAA,EAAQ3C,YAAA;MACR4C,OAAA,EAAS3C;IACX;IACAgB,QAAA,EAAU,CAAC,UAAU,UAAU,OAAO;IACtCwB;EACF;AACF;AAEF,OAAO,MAAMI,+BAAA,GACVC,kBAAA,IACAzC,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACoB,GAAG,CAAChC,cAAA;EAC/B,MAAMiC,eAAA,GAAkBW,kBAAA,CAAmBV,GAAG,CAAEhC,KAAA,IAC9CD,sBAAA,CAAuBC,KAAA,EAAOC,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAK;EAG5D,MAAMwB,YAAA,GACJK,eAAA,CAAgBE,MAAM,KAAK,IACvB;IAAEX,IAAA,EAAM;IAAUK,oBAAA,EAAsB;EAAK,IAC7CI,eAAA,CAAgBE,MAAM,KAAK,IACzB;IAAEC,IAAA,EAAM,WAAWH,eAAe,CAAC,EAAE;EAAI,IACzC;IAAEI,KAAA,EAAOJ,eAAA,CAAgBC,GAAG,CAAEI,IAAA,KAAU;MAAEF,IAAA,EAAM,WAAWE,IAAA;IAAO;EAAI;EAE9E,MAAMC,MAAA,GACJN,eAAA,CAAgBE,MAAM,GAAG,IACrB,6BAA6BF,eAAA,CAAgBO,IAAI,CAAC,SAAS,GAC3D,kDAAkD;EAExD,OAAO;IACLhB,IAAA,EAAM;IACNK,oBAAA,EAAsB;IACtBf,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAc;MAC7CpB,MAAA,EAAQsB,YAAA;MACRc,OAAA,EAAS3C;IACX;IACAgB,QAAA,EAAU,CAAC,UAAU,OAAO;IAC5BwB;EACF;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/server/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAe,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE9F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,KAAK,EAAE,KACd,cAAc,CAAC,mBAAmB,GAAG,yBAAyB,CAqDhE,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/server/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAe,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAE9F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WACrB,KAAK,EAAE,KACd,cAAc,CAAC,mBAAmB,GAAG,yBAAyB,CAqDhE,CAAA"}
@@ -37,7 +37,7 @@ export const blockValidationHOC = blocks => {
37
37
  fields: block.fields,
38
38
  fieldSchemaMap: undefined,
39
39
  initialBlockData: blockFieldData,
40
- operation: operation === 'create' || operation === 'update' ? operation : 'update',
40
+ operation,
41
41
  permissions: {},
42
42
  preferences,
43
43
  renderAllFields: false,
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","blockValidationHOC","blocks","node","validation","blockFieldData","fields","options","id","collectionSlug","data","operation","preferences","req","block","find","slug","blockType","result","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","length","errorPath","add","Array","from","join"],"sources":["../../../../src/features/blocks/server/validate.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { BlockFields, SerializedBlockNode, SerializedInlineBlockNode } from './schema.js'\n\n/**\n * Runs validation for blocks. This function will determine if the rich text field itself is valid. It does not handle\n * block field error paths - this is done by the `beforeChangeTraverseFields` call in the `beforeChange` hook, called from the\n * rich text adapter.\n */\nexport const blockValidationHOC = (\n blocks: Block[],\n): NodeValidation<SerializedBlockNode | SerializedInlineBlockNode> => {\n return async ({ node, validation }) => {\n const blockFieldData = node.fields ?? ({} as BlockFields)\n\n const {\n options: { id, collectionSlug, data, operation, preferences, req },\n } = validation\n\n // find block\n const block = blocks.find((block) => block.slug === blockFieldData.blockType)\n\n // validate block\n if (!block) {\n return `Block ${blockFieldData.blockType} not found`\n }\n\n /**\n * Run fieldSchemasToFormState as that properly validates block and block sub-fields\n */\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug,\n data: blockFieldData,\n documentData: data,\n fields: block.fields,\n fieldSchemaMap: undefined,\n initialBlockData: blockFieldData,\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAEA,SAASA,uBAAuB,QAAQ;AAKxC;;;;;AAKA,OAAO,MAAMC,kBAAA,GACXC,MAAA;EAEA,OAAO,OAAO;IAAEC,IAAI;IAAEC;EAAU,CAAE;IAChC,MAAMC,cAAA,GAAiBF,IAAA,CAAKG,MAAM,IAAK,CAAC;IAExC,MAAM;MACJC,OAAA,EAAS;QAAEC,EAAE;QAAEC,cAAc;QAAEC,IAAI;QAAEC,SAAS;QAAEC,WAAW;QAAEC;MAAG;IAAE,CACnE,GAAGT,UAAA;IAEJ;IACA,MAAMU,KAAA,GAAQZ,MAAA,CAAOa,IAAI,CAAED,KAAA,IAAUA,KAAA,CAAME,IAAI,KAAKX,cAAA,CAAeY,SAAS;IAE5E;IACA,IAAI,CAACH,KAAA,EAAO;MACV,OAAO,SAAST,cAAA,CAAeY,SAAS,YAAY;IACtD;IAEA;;;IAIA,MAAMC,MAAA,GAAS,MAAMlB,uBAAA,CAAwB;MAC3CQ,EAAA;MACAC,cAAA;MACAC,IAAA,EAAML,cAAA;MACNc,YAAA,EAAcT,IAAA;MACdJ,MAAA,EAAQQ,KAAA,CAAMR,MAAM;MACpBc,cAAA,EAAgBC,SAAA;MAChBC,gBAAA,EAAkBjB,cAAA;MAClBM,SAAA,EAAWA,SAAA,KAAc,YAAYA,SAAA,KAAc,WAAWA,SAAA,GAAY;MAC1EY,WAAA,EAAa,CAAC;MACdX,WAAA;MACAY,eAAA,EAAiB;MACjBX,GAAA;MACAY,UAAA,EAAY;IACd;IAEA,MAAMC,aAAA,GAAgB,IAAIC,GAAA;IAC1B,KAAK,MAAMC,QAAA,IAAYV,MAAA,EAAQ;MAC7B,MAAMW,UAAA,GAAaX,MAAM,CAACU,QAAA,CAAS;MACnC,IAAIC,UAAA,EAAYC,UAAA,EAAYC,MAAA,EAAQ;QAClC,KAAK,MAAMC,SAAA,IAAaH,UAAA,CAAWC,UAAU,EAAE;UAC7CJ,aAAA,CAAcO,GAAG,CAACD,SAAA;QACpB;MACF;IACF;IACA,MAAMF,UAAA,GAAaI,KAAA,CAAMC,IAAI,CAACT,aAAA;IAE9B,IAAII,UAAA,CAAWC,MAAM,EAAE;MACrB,OAAO,uCAAuCD,UAAA,CAAWM,IAAI,CAAC;IAChE;IAEA,OAAO;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","blockValidationHOC","blocks","node","validation","blockFieldData","fields","options","id","collectionSlug","data","operation","preferences","req","block","find","slug","blockType","result","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","length","errorPath","add","Array","from","join"],"sources":["../../../../src/features/blocks/server/validate.ts"],"sourcesContent":["import type { Block } from 'payload'\n\nimport { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { BlockFields, SerializedBlockNode, SerializedInlineBlockNode } from './schema.js'\n\n/**\n * Runs validation for blocks. This function will determine if the rich text field itself is valid. It does not handle\n * block field error paths - this is done by the `beforeChangeTraverseFields` call in the `beforeChange` hook, called from the\n * rich text adapter.\n */\nexport const blockValidationHOC = (\n blocks: Block[],\n): NodeValidation<SerializedBlockNode | SerializedInlineBlockNode> => {\n return async ({ node, validation }) => {\n const blockFieldData = node.fields ?? ({} as BlockFields)\n\n const {\n options: { id, collectionSlug, data, operation, preferences, req },\n } = validation\n\n // find block\n const block = blocks.find((block) => block.slug === blockFieldData.blockType)\n\n // validate block\n if (!block) {\n return `Block ${blockFieldData.blockType} not found`\n }\n\n /**\n * Run fieldSchemasToFormState as that properly validates block and block sub-fields\n */\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug,\n data: blockFieldData,\n documentData: data,\n fields: block.fields,\n fieldSchemaMap: undefined,\n initialBlockData: blockFieldData,\n operation,\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAEA,SAASA,uBAAuB,QAAQ;AAKxC;;;;;AAKA,OAAO,MAAMC,kBAAA,GACXC,MAAA;EAEA,OAAO,OAAO;IAAEC,IAAI;IAAEC;EAAU,CAAE;IAChC,MAAMC,cAAA,GAA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ts","sourceRoot":"","sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKrF,eAAO,MAAM,oBAAoB,GAAI,UAAU,SAAS,qBAAqB,GAAG,gBAAgB,EAAE,gCAI/F;IACD,YAAY,EAAE,2BAA2B,CAAA;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,KAAK;QAC3B,MAAM,EAAE;YACN,QAAQ,EAAE,QAAQ,CAAA;SACnB,CAAA;KACF,CAAA;CACF,KAAG,gBAAgB,CAAC,UAAU,CA2B9B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/htmlToLexical/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE7E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKrF,eAAO,MAAM,oBAAoB,GAAI,UAAU,SAAS,qBAAqB,GAAG,gBAAgB,kCAI7F;IACD,YAAY,EAAE,2BAA2B,CAAA;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,KAAK;QAC3B,MAAM,EAAE;YACN,QAAQ,EAAE,QAAQ,CAAA;SACnB,CAAA;KACF,CAAA;CACF,KAAG,gBAAgB,CAAC,UAAU,CA2B9B,CAAA"}
@@ -1,4 +1,4 @@
1
- const ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']);
1
+ import { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js';
2
2
  export const HeadingHTMLConverterAsync = {
3
3
  heading: async ({
4
4
  node,
@@ -1 +1 @@
1
- {"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","Set","HeadingHTMLConverterAsync","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n\nexport const HeadingHTMLConverterAsync: HTMLConvertersAsync<SerializedHeadingNode> = {\n heading: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,MAAMA,oBAAA,GAAuB,IAAIC,GAAA,CAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAEzE,OAAO,MAAMC,yBAAA,GAAwE;EACnFC,OAAA,EAAS,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACrD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMV,oBAAA,CAAqBW,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
1
+ {"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","HeadingHTMLConverterAsync","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js'\n\nexport const HeadingHTMLConverterAsync: HTMLConvertersAsync<SerializedHeadingNode> = {\n heading: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,yBAAA,GAAwE;EACnFC,OAAA,EAAS,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACrD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMT,oBAAA,CAAqBU,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAKtD,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,CACtD,sBAAsB,GAAG,kBAAkB,CAiD5C,CAAA"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAMtD,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,CACtD,sBAAsB,GAAG,kBAAkB,CAiD5C,CAAA"}
@@ -1,5 +1,6 @@
1
+ import escapeHTML from 'escape-html';
1
2
  import { v4 as uuidv4 } from 'uuid';
2
- const ALLOWED_LIST_TAGS = new Set(['ol', 'ul']);
3
+ import { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js';
3
4
  const ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number']);
4
5
  export const ListHTMLConverterAsync = {
5
6
  list: async ({
@@ -32,7 +33,7 @@ export const ListHTMLConverterAsync = {
32
33
  role="checkbox"
33
34
  style="list-style-type: none;${providedCSSString}"
34
35
  tabIndex="-1"
35
- value="${node.value}"
36
+ value="${escapeHTML(String(node.value))}"
36
37
  >
37
38
  ${hasSubLists ? children : `<input${node.checked ? ' checked' : ''} id="${uuid}" readOnly="true" type="checkbox" />
38
39
  <label htmlFor="${uuid}">${children}</label>
@@ -42,7 +43,7 @@ export const ListHTMLConverterAsync = {
42
43
  return `<li
43
44
  class="${hasSubLists ? 'nestedListItem' : ''}"
44
45
  style="${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}"
45
- value="${node.value}"
46
+ value="${escapeHTML(String(node.value))}"
46
47
  >${children}</li>`;
47
48
  }
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","Set","ALLOWED_LIST_TYPES","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nconst ALLOWED_LIST_TAGS = new Set(['ol', 'ul'])\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children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G,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBX,IAAA,CAAKkB,KAAK;;YAGjBN,WAAA,GACIT,QAAA,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DX,IAAA,CAAKkB,KAAK;WAClBf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"list.js","names":["escapeHTML","v4","uuidv4","ALLOWED_LIST_TAGS","ALLOWED_LIST_TYPES","Set","ListHTMLConverterAsync","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","String","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/list.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nimport { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js'\n\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverterAsync: HTMLConvertersAsync<\n SerializedListItemNode | SerializedListNode\n> = {\n list: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${escapeHTML(String(node.value))}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${escapeHTML(String(node.value))}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,EAAA,IAAMC,MAAM,QAAQ;AAK7B,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,kBAAA,GAAqB,IAAIC,GAAA,CAAI,CAAC,UAAU,SAAS,SAAS;AAEhE,OAAO,MAAMC,sBAAA,GAET;EACFC,IAAA,EAAM,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAClD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,MAAMC,GAAA,GAAMX,iBAAA,CAAkBY,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IACzD,MAAME,QAAA,GAAWZ,kBAAA,CAAmBW,GAAG,CAACP,IAAA,CAAKQ,QAAQ,IAAIR,IAAA,CAAKQ,QAAQ,GAAG;IAEzE,OAAO,IAAIF,GAAA,GAAMJ,gBAAA,gBAAgCM,QAAA,KAAaL,QAAA,KAAaG,GAAA,GAAM;EACnF;EACAG,QAAA,EAAU,MAAAA,CAAO;IAAET,IAAI;IAAEC,WAAW;IAAES,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcZ,IAAA,CAAKG,QAAQ,CAACU,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMZ,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP,IAAI,cAAcK,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOtB,MAAA;MACb,OAAO;0BACaM,IAAA,CAAKiB,OAAO,GAAG,SAAS;qCACbjB,IAAA,CAAKiB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBnB,UAAA,CAAW0B,MAAA,CAAOlB,IAAA,CAAKmB,KAAK;;YAGnCP,WAAA,GACIT,QAAA,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DnB,UAAA,CAAW0B,MAAA,CAAOlB,IAAA,CAAKmB,KAAK;WACpChB,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
@@ -29,7 +29,7 @@ export const UploadHTMLConverterAsync = {
29
29
  return `<a${providedStyleTag} href="${url}" rel="noopener noreferrer">${escapeHTML(uploadDoc.filename ?? '')}</a>`;
30
30
  }
31
31
  // 2) If image has no different sizes, return a simple <img />
32
- if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {
32
+ if (!uploadDoc.variants || !Object.keys(uploadDoc.variants).length) {
33
33
  return `
34
34
  <img${providedStyleTag}
35
35
  alt="${alt}"
@@ -41,8 +41,8 @@ export const UploadHTMLConverterAsync = {
41
41
  }
42
42
  // 3) If image has different sizes, build a <picture> element with <source> tags
43
43
  let pictureHTML = '';
44
- for (const size in uploadDoc.sizes) {
45
- const imageSize = uploadDoc.sizes[size];
44
+ for (const size in uploadDoc.variants) {
45
+ const imageSize = uploadDoc.variants[size];
46
46
  if (!imageSize || !imageSize.width || !imageSize.height || !imageSize.mimeType || !imageSize.filesize || !imageSize.filename || !imageSize.url) {
47
47
  continue;
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverterAsync","upload","node","populate","providedStyleTag","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","url","mimeType","startsWith","filename","sizes","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"sourcesContent":["import type { FileData, FileSize, TypeWithID } from 'payload'\n\nimport escapeHTML from 'escape-html'\n\nimport type { SerializedUploadNode } from '../../../../../types/nodeTypes.js'\nimport type { UploadDataImproved } from '../../../../upload/server/schema.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const UploadHTMLConverterAsync: HTMLConvertersAsync<SerializedUploadNode> = {\n upload: async ({ node, populate, providedStyleTag }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = escapeHTML(\n (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || '',\n )\n\n const url = escapeHTML(uploadDoc.url ?? '')\n\n // 1) If upload is NOT an image, return a link\n if (!uploadDoc.mimeType.startsWith('image')) {\n return `<a${providedStyleTag} href=\"${url}\" rel=\"noopener noreferrer\">${escapeHTML(uploadDoc.filename ?? '')}</a>`\n }\n\n // 2) If image has no different sizes, return a simple <img />\n if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {\n return `\n <img${providedStyleTag}\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n }\n\n // 3) If image has different sizes, build a <picture> element with <source> tags\n let pictureHTML = ''\n\n for (const size in uploadDoc.sizes) {\n const imageSize = uploadDoc.sizes[size] as FileSize\n\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n\n pictureHTML += `\n <source\n media=\"(max-width: ${escapeHTML(String(imageSize.width))}px)\"\n srcset=\"${escapeHTML(imageSize.url)}\"\n type=\"${escapeHTML(imageSize.mimeType)}\"\n />\n `\n }\n\n pictureHTML += `\n <img\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n\n return `<picture${providedStyleTag}>${pictureHTML}</picture>`\n },\n}\n"],"mappings":"AAEA,OAAOA,UAAA,MAAgB;AAMvB,OAAO,MAAMC,wBAAA,GAAsE;EACjFC,MAAA,EAAQ,MAAAA,CAAO;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAgB,CAAE;IACjD,MAAMC,UAAA,GAAaH,IAAA;IAEnB,IAAII,SAAA,GAAiDC,SAAA;IAErD;IACA,IAAI,OAAOF,UAAA,CAAWG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SAAA,CAAUC,QAAQ,IACnB,CAACD,SAAA,CAAUV,QAAQ,IACnB,CAACU,SAAA,CAAUb,GAAG,EACd;QACA;MACF;MAEAW,WAAA,IAAe;;+BAEU1B,UAAA,CAAWuB,MAAA,CAAOK,SAAA,CAAUH,KAAK;oBAC5CzB,UAAA,CAAW4B,SAAA,CAAUb,GAAG;kBAC1Bf,UAAA,CAAW4B,SAAA,CAAUZ,QAAQ;;OAExC;IACH;IAEAU,WAAA,IAAe;;eAEJb,GAAA;kBACGb,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUiB,MAAM,IAAI;eACzCT,GAAA;iBACEf,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUkB,KAAK,IAAI;;KAEjD;IAED,OAAO,WAAWpB,gBAAA,IAAoBqB,WAAA,YAAuB;EAC/D;AACF","ignoreList":[]}
1
+ {"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverterAsync","upload","node","populate","providedStyleTag","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","url","mimeType","startsWith","filename","variants","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/async/converters/upload.ts"],"sourcesContent":["import type { FileData, FileSize, TypeWithID } from 'payload'\n\nimport escapeHTML from 'escape-html'\n\nimport type { SerializedUploadNode } from '../../../../../types/nodeTypes.js'\nimport type { UploadData } from '../../../../upload/server/schema.js'\nimport type { HTMLConvertersAsync } from '../types.js'\n\nexport const UploadHTMLConverterAsync: HTMLConvertersAsync<SerializedUploadNode> = {\n upload: async ({ node, populate, providedStyleTag }) => {\n const uploadNode = node as UploadData\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = escapeHTML(\n (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || '',\n )\n\n const url = escapeHTML(uploadDoc.url ?? '')\n\n // 1) If upload is NOT an image, return a link\n if (!uploadDoc.mimeType.startsWith('image')) {\n return `<a${providedStyleTag} href=\"${url}\" rel=\"noopener noreferrer\">${escapeHTML(uploadDoc.filename ?? '')}</a>`\n }\n\n // 2) If image has no different sizes, return a simple <img />\n if (!uploadDoc.variants || !Object.keys(uploadDoc.variants).length) {\n return `\n <img${providedStyleTag}\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n }\n\n // 3) If image has different sizes, build a <picture> element with <source> tags\n let pictureHTML = ''\n\n for (const size in uploadDoc.variants) {\n const imageSize = uploadDoc.variants[size] as FileSize\n\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n\n pictureHTML += `\n <source\n media=\"(max-width: ${escapeHTML(String(imageSize.width))}px)\"\n srcset=\"${escapeHTML(imageSize.url)}\"\n type=\"${escapeHTML(imageSize.mimeType)}\"\n />\n `\n }\n\n pictureHTML += `\n <img\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n\n return `<picture${providedStyleTag}>${pictureHTML}</picture>`\n },\n}\n"],"mappings":"AAEA,OAAOA,UAAA,MAAgB;AAMvB,OAAO,MAAMC,wBAAA,GAAsE;EACjFC,MAAA,EAAQ,MAAAA,CAAO;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAgB,CAAE;IACjD,MAAMC,UAAA,GAAaH,IAAA;IA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AACG,SAAA,CAAUJ,MAAM,IACjB,CAACI,SAAA,CAAUZ,QAAQ,IACnB,CAACY,SAAA,CAAUC,QAAQ,IACnB,CAACD,SAAA,CAAUV,QAAQ,IACnB,CAACU,SAAA,CAAUb,GAAG,EACd;QACA;MACF;MAEAW,WAAA,IAAe;;+BAEU1B,UAAA,CAAWuB,MAAA,CAAOK,SAAA,CAAUH,KAAK;oBAC5CzB,UAAA,CAAW4B,SAAA,CAAUb,GAAG;kBAC1Bf,UAAA,CAAW4B,SAAA,CAAUZ,QAAQ;;OAExC;IACH;IAEAU,WAAA,IAAe;;eAEJb,GAAA;kBACGb,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUiB,MAAM,IAAI;eACzCT,GAAA;iBACEf,UAAA,CAAWuB,MAAA,CAAOhB,SAAA,CAAUkB,KAAK,IAAI;;KAEjD;IAED,OAAO,WAAWpB,gBAAA,IAAoBqB,WAAA,YAAuB;EAC/D;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"cssColors.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/shared/cssColors.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,aA0J3B,CAAA;AAKF,qFAAqF;AACrF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,OAE9C,CAAA"}
1
+ {"version":3,"file":"cssColors.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/shared/cssColors.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,aA0J3B,CAAA;AAKF,qFAAqF;AACrF,eAAO,MAAM,cAAc,UAAW,MAAM,KAAG,OAE9C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"findConverterForNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGrE,wBAAgB,oBAAoB,CAClC,WAAW,SAAS,cAAc,GAAG,mBAAmB,EACxD,UAAU,SAAS,aAAa,GAAG,kBAAkB,EACrD,EACA,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,gBAAgB,EAAE,UAAU,CAAA;CAC7B,GAAG;IACF,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CA8EA"}
1
+ {"version":3,"file":"findConverterForNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGrE,wBAAgB,oBAAoB,CAClC,WAAW,SAAS,cAAc,GAAG,mBAAmB,EACxD,UAAU,SAAS,aAAa,GAAG,kBAAkB,EACrD,EACA,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,GACjB,EAAE;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,gBAAgB,EAAE,UAAU,CAAA;CAC7B,GAAG;IACF,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CA6EA"}
@@ -28,18 +28,19 @@
28
28
  style['text-align'] = 'center';
29
29
  break;
30
30
  case 'end':
31
- style['text-align'] = 'right';
31
+ style['text-align'] = 'end';
32
32
  break;
33
33
  case 'justify':
34
34
  style['text-align'] = 'justify';
35
35
  break;
36
36
  case 'left':
37
+ style['text-align'] = 'left';
37
38
  break;
38
39
  case 'right':
39
40
  style['text-align'] = 'right';
40
41
  break;
41
42
  case 'start':
42
- style['text-align'] = 'left';
43
+ style['text-align'] = 'start';
43
44
  break;
44
45
  }
45
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","disableIndent","disableTextAlign","node","unknownConverter","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","style","Array","isArray","includes","format","indent","Number","providedCSSString","key","Object","keys","providedStyleTag","length"],"sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { HTMLConverterAsync, HTMLConvertersAsync } from '../async/types.js'\nimport type { HTMLConverter, HTMLConverters } from '../sync/types.js'\nimport type { ProvidedCSS } from './types.js'\n\nexport function findConverterForNode<\n TConverters extends HTMLConverters | HTMLConvertersAsync,\n TConverter extends HTMLConverter | HTMLConverterAsync,\n>({\n converters,\n disableIndent,\n disableTextAlign,\n node,\n unknownConverter,\n}: {\n converters: TConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n node: SerializedLexicalNode\n unknownConverter: TConverter\n}): {\n converterForNode: TConverter | undefined\n providedCSSString: string\n providedStyleTag: string\n} {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n const style: ProvidedCSS = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style['text-align'] = 'center'\n break\n case 'end':\n style['text-align'] = 'right'\n break\n case 'justify':\n style['text-align'] = 'justify'\n break\n case 'left':\n //style['text-align'] = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style['text-align'] = 'right'\n break\n case 'start':\n style['text-align'] = 'left'\n break\n }\n }\n }\n\n if (!disableIndent && (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style['padding-inline-start'] = `${Number(node.indent) * 40}px`\n }\n }\n\n let providedCSSString: string = ''\n for (const key of Object.keys(style)) {\n // @ts-expect-error we're iterating over the keys of the object\n providedCSSString += `${key}: ${style[key]};`\n }\n const providedStyleTag = providedCSSString?.length ? ` style=\"${providedCSSString}\"` : ''\n\n return {\n converterForNode: converterForNode ?? unknownConverter,\n providedCSSString,\n providedStyleTag,\n }\n}\n"],"mappings":"AAAA,+BAQA,OAAO,SAASA,qBAGd;EACAC,UAAU;EACVC,aAAa;EACbC,gBAAgB;EAChBC,IAAI;EACJC;AAAgB,CAOjB;EAKC,IAAIC,gBAAA;EACJ,IAAIF,IAAA,CAAKG,IAAI,KAAK,SAAS;IACzBD,gBAAA,GAAmBL,UAAA,EAAYO,MAAA,GAC5BJ,IAAA,EAA8BK,MAAA,EAAQC,SAAA,CACxC;IACD,IAAI,CAACJ,gBAAA,IAAoB,CAACD,gBAAA,EAAkB;MAC1CM,OAAA,CAAQC,KAAK,CACX,sDAAuDR,IAAA,EAA8BK,MAAA,EAAQC,SAAA,sCAA+C;IAEhJ;EACF,OAAO,IAAIN,IAAA,CAAKG,IAAI,KAAK,eAAe;IACtCD,gBAAA,GAAmBL,UAAA,EAAYY,YAAA,GAC5BT,IAAA,EAAoCK,MAAA,EAAQC,SAAA,CAC9C;IACD,IAAI,CAACJ,gBAAA,IAAoB,CAACD,gBAAA,EAAkB;MAC1CM,OAAA,CAAQC,KAAK,CACX,6DAA8DR,IAAA,EAAoCK,MAAA,EAAQC,SAAA,6CAAsD;IAEpK;EACF,OAAO;IACLJ,gBAAA,GAAmBL,UAAU,CAACG,IAAA,CAAKG,IAAI,CAAC;EAC1C;EAEA,MAAMO,KAAA,GAAqB,CAAC;EAE5B;EACA,IACE,CAACX,gBAAA,KACA,CAACY,KAAA,CAAMC,OAAO,CAACb,gBAAA,KAAqB,CAACA,gBAAA,EAAkBc,QAAA,CAASb,IAAA,CAAKG,IAAI,IAC1E;IACA,IAAI,YAAYH,IAAA,IAAQA,IAAA,CAAKc,MAAM,EAAE;MACnC,QAAQd,IAAA,CAAKc,MAAM;QACjB,KAAK;UACHJ,KAAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UAGH;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;MACJ;IACF;EACF;EAEA,IAAI,CAACZ,aAAA,KAAkB,CAACa,KAAA,CAAMC,OAAO,CAACd,aAAA,KAAkB,CAACA,aAAA,EAAee,QAAA,CAASb,IAAA,CAAKG,IAAI,IAAI;IAC5F,IAAI,YAAYH,IAAA,IAAQA,IAAA,CAAKe,MAAM,IAAIf,IAAA,CAAKG,IAAI,KAAK,YAAY;MAC/D;MACA;MACA;MACA;MACAO,KAAK,CAAC,uBAAuB,GAAG,GAAGM,MAAA,CAAOhB,IAAA,CAAKe,MAAM,IAAI,MAAM;IACjE;EACF;EAEA,IAAIE,iBAAA,GAA4B;EAChC,KAAK,MAAMC,GAAA,IAAOC,MAAA,CAAOC,IAAI,CAACV,KAAA,GAAQ;IACpC;IACAO,iBAAA,IAAqB,GAAGC,GAAA,KAAQR,KAAK,CAACQ,GAAA,CAAI,GAAG;EAC/C;EACA,MAAMG,gBAAA,GAAmBJ,iBAAA,EAAmBK,MAAA,GAAS,WAAWL,iBAAA,GAAoB,GAAG;EAEvF,OAAO;IACLf,gBAAA,EAAkBA,gBAAA,IAAoBD,gBAAA;IACtCgB,iBAAA;IACAI;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","disableIndent","disableTextAlign","node","unknownConverter","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","style","Array","isArray","includes","format","indent","Number","providedCSSString","key","Object","keys","providedStyleTag","length"],"sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { HTMLConverterAsync, HTMLConvertersAsync } from '../async/types.js'\nimport type { HTMLConverter, HTMLConverters } from '../sync/types.js'\nimport type { ProvidedCSS } from './types.js'\n\nexport function findConverterForNode<\n TConverters extends HTMLConverters | HTMLConvertersAsync,\n TConverter extends HTMLConverter | HTMLConverterAsync,\n>({\n converters,\n disableIndent,\n disableTextAlign,\n node,\n unknownConverter,\n}: {\n converters: TConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n node: SerializedLexicalNode\n unknownConverter: TConverter\n}): {\n converterForNode: TConverter | undefined\n providedCSSString: string\n providedStyleTag: string\n} {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n const style: ProvidedCSS = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style['text-align'] = 'center'\n break\n case 'end':\n style['text-align'] = 'end'\n break\n case 'justify':\n style['text-align'] = 'justify'\n break\n case 'left':\n style['text-align'] = 'left'\n break\n case 'right':\n style['text-align'] = 'right'\n break\n case 'start':\n style['text-align'] = 'start'\n break\n }\n }\n }\n\n if (!disableIndent && (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style['padding-inline-start'] = `${Number(node.indent) * 40}px`\n }\n }\n\n let providedCSSString: string = ''\n for (const key of Object.keys(style)) {\n // @ts-expect-error we're iterating over the keys of the object\n providedCSSString += `${key}: ${style[key]};`\n }\n const providedStyleTag = providedCSSString?.length ? ` style=\"${providedCSSString}\"` : ''\n\n return {\n converterForNode: converterForNode ?? unknownConverter,\n providedCSSString,\n providedStyleTag,\n }\n}\n"],"mappings":"AAAA,+BAQA,OAAO,SAASA,qBAGd;EACAC,UAAU;EACVC,aAAa;EACbC,gBAAgB;EAChBC,IAAI;EACJC;AAAgB,CAOjB;EAKC,IAAIC,gBAAA;EACJ,IAAIF,IAAA,CAAKG,IAAI,KAAK,SAAS;IACzBD,gBAAA,GAAmBL,UAAA,EAAYO,MAAA,GAC5BJ,IAAA,EAA8BK,MAAA,EAAQC,SAAA,CACxC;IACD,IAAI,CAACJ,gBAAA,IAAoB,CAACD,gBAAA,EAAkB;MAC1CM,OAAA,CAAQC,KAAK,CACX,sDAAuDR,IAAA,EAA8BK,MAAA,EAAQC,SAAA,sCAA+C;IAEhJ;EACF,OAAO,IAAIN,IAAA,CAAKG,IAAI,KAAK,eAAe;IACtCD,gBAAA,GAAmBL,UAAA,EAAYY,YAAA,GAC5BT,IAAA,EAAoCK,MAAA,EAAQC,SAAA,CAC9C;IACD,IAAI,CAACJ,gBAAA,IAAoB,CAACD,gBAAA,EAAkB;MAC1CM,OAAA,CAAQC,KAAK,CACX,6DAA8DR,IAAA,EAAoCK,MAAA,EAAQC,SAAA,6CAAsD;IAEpK;EACF,OAAO;IACLJ,gBAAA,GAAmBL,UAAU,CAACG,IAAA,CAAKG,IAAI,CAAC;EAC1C;EAEA,MAAMO,KAAA,GAAqB,CAAC;EAE5B;EACA,I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1,4 +1,4 @@
1
- const ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']);
1
+ import { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js';
2
2
  export const HeadingHTMLConverter = {
3
3
  heading: ({
4
4
  node,
@@ -1 +1 @@
1
- {"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","Set","HeadingHTMLConverter","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nconst ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n\nexport const HeadingHTMLConverter: HTMLConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,MAAMA,oBAAA,GAAuB,IAAIC,GAAA,CAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAEzE,OAAO,MAAMC,oBAAA,GAA8D;EACzEC,OAAA,EAASA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC/C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAAMV,oBAAA,CAAqBW,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
1
+ {"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","HeadingHTMLConverter","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nimport { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js'\n\nexport const HeadingHTMLConverter: HTMLConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,oBAAA,GAA8D;EACzEC,OAAA,EAASA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC/C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAAMT,oBAAA,CAAqBU,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAKjD,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,sBAAsB,GAAG,kBAAkB,CA4CzF,CAAA"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMjD,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,sBAAsB,GAAG,kBAAkB,CA4CzF,CAAA"}
@@ -1,5 +1,6 @@
1
+ import escapeHTML from 'escape-html';
1
2
  import { v4 as uuidv4 } from 'uuid';
2
- const ALLOWED_LIST_TAGS = new Set(['ol', 'ul']);
3
+ import { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js';
3
4
  const ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number']);
4
5
  export const ListHTMLConverter = {
5
6
  list: ({
@@ -32,7 +33,7 @@ export const ListHTMLConverter = {
32
33
  role="checkbox"
33
34
  style="list-style-type: none;${providedCSSString}"
34
35
  tabIndex="-1"
35
- value="${node.value}"
36
+ value="${escapeHTML(String(node.value))}"
36
37
  >
37
38
  ${hasSubLists ? children : `<input${node.checked ? ' checked' : ''} id="${uuid}" readOnly="true" type="checkbox" />
38
39
  <label htmlFor="${uuid}">${children}</label>
@@ -42,7 +43,7 @@ export const ListHTMLConverter = {
42
43
  return `<li
43
44
  class="${hasSubLists ? 'nestedListItem' : ''}"
44
45
  style="${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}"
45
- value="${node.value}"
46
+ value="${escapeHTML(String(node.value))}"
46
47
  >${children}</li>`;
47
48
  }
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","Set","ALLOWED_LIST_TYPES","ListHTMLConverter","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nconst ALLOWED_LIST_TAGS = new Set(['ol', 'ul'])\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverter: HTMLConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${node.value}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,MAA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,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DX,IAAA,CAAKkB,KAAK;WAClBf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"list.js","names":["escapeHTML","v4","uuidv4","ALLOWED_LIST_TAGS","ALLOWED_LIST_TYPES","Set","ListHTMLConverter","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","String","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nimport { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js'\n\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverter: HTMLConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${escapeHTML(String(node.value))}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${escapeHTML(String(node.value))}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,EAAA,IAAMC,MAAM,QAAQ;AAK7B,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,kBAAA,GAAqB,IAAIC,GAAA,CAAI,CAAC,UAAU,SAAS,SAAS;AAEhE,OAAO,MAAMC,iBAAA,GAAiF;EAC5FC,IAAA,EAAMA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC5C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAAMX,iBAAA,CAAkBY,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IACzD,MAAME,QAAA,GAAWZ,kBAAA,CAAmBW,GAAG,CAACP,IAAA,CAAKQ,QAAQ,IAAIR,IAAA,CAAKQ,QAAQ,GAAG;IAEzE,OAAO,IAAIF,GAAA,GAAMJ,gBAAA,gBAAgCM,QAAA,KAAaL,QAAA,KAAaG,GAAA,GAAM;EACnF;EACAG,QAAA,EAAUA,CAAC;IAAET,IAAI;IAAEC,WAAW;IAAES,MAAM;IAAEC;EAAiB,CAAE;IACzD,MAAMC,WAAA,GAAcZ,IAAA,CAAKG,QAAQ,CAACU,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMZ,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,IAAI,cAAcK,MAAA,IAAUA,MAAA,EAAQF,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOtB,MAAA;MACb,OAAO;0BACaM,IAAA,CAAKiB,OAAO,GAAG,SAAS;qCACbjB,IAAA,CAAKiB,OAAO,GAAG,gCAAgC,kCAAkCL,WAAA,GAAc,oBAAoB;;yCAE/GD,iBAAA;;mBAEtBnB,UAAA,CAAW0B,MAAA,CAAOlB,IAAA,CAAKmB,KAAK;;YAGnCP,WAAA,GACIT,QAAA,GACA,SAASH,IAAA,CAAKiB,OAAO,GAAG,aAAa,UAAUD,IAAA;8BACjCA,IAAA,KAASb,QAAA;mBACpB;cAEL;IACV,OAAO;MACL,OAAO;mBACMS,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DnB,UAAA,CAAW0B,MAAA,CAAOlB,IAAA,CAAKmB,KAAK;WACpChB,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
@@ -22,7 +22,7 @@ export const UploadHTMLConverter = {
22
22
  return `<a${providedStyleTag} href="${url}" rel="noopener noreferrer">${escapeHTML(uploadDoc.filename ?? '')}</a>`;
23
23
  }
24
24
  // 2) If image has no different sizes, return a simple <img />
25
- if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {
25
+ if (!uploadDoc.variants || !Object.keys(uploadDoc.variants).length) {
26
26
  return `
27
27
  <img${providedStyleTag}
28
28
  alt="${alt}"
@@ -34,8 +34,8 @@ export const UploadHTMLConverter = {
34
34
  }
35
35
  // 3) If image has different sizes, build a <picture> element with <source> tags
36
36
  let pictureHTML = '';
37
- for (const size in uploadDoc.sizes) {
38
- const imageSize = uploadDoc.sizes[size];
37
+ for (const size in uploadDoc.variants) {
38
+ const imageSize = uploadDoc.variants[size];
39
39
  if (!imageSize || !imageSize.width || !imageSize.height || !imageSize.mimeType || !imageSize.filesize || !imageSize.filename || !imageSize.url) {
40
40
  continue;
41
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverter","upload","node","providedStyleTag","uploadNode","uploadDoc","undefined","value","alt","fields","url","mimeType","startsWith","filename","sizes","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/upload.ts"],"sourcesContent":["import type { FileData, FileSize, TypeWithID } from 'payload'\n\nimport escapeHTML from 'escape-html'\n\nimport type { SerializedUploadNode } from '../../../../../types/nodeTypes.js'\nimport type { UploadDataImproved } from '../../../../upload/server/schema.js'\nimport type { HTMLConverters } from '../types.js'\n\nexport const UploadHTMLConverter: HTMLConverters<SerializedUploadNode> = {\n upload: ({ node, providedStyleTag }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n return ''\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = escapeHTML(\n (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || '',\n )\n\n const url = escapeHTML(uploadDoc.url ?? '')\n\n // 1) If upload is NOT an image, return a link\n if (!uploadDoc.mimeType.startsWith('image')) {\n return `<a${providedStyleTag} href=\"${url}\" rel=\"noopener noreferrer\">${escapeHTML(uploadDoc.filename ?? '')}</a>`\n }\n\n // 2) If image has no different sizes, return a simple <img />\n if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {\n return `\n <img${providedStyleTag}\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n }\n\n // 3) If image has different sizes, build a <picture> element with <source> tags\n let pictureHTML = ''\n\n for (const size in uploadDoc.sizes) {\n const imageSize = uploadDoc.sizes[size] as FileSize\n\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n\n pictureHTML += `\n <source\n media=\"(max-width: ${escapeHTML(String(imageSize.width))}px)\"\n srcset=\"${escapeHTML(imageSize.url)}\"\n type=\"${escapeHTML(imageSize.mimeType)}\"\n />\n `\n }\n\n pictureHTML += `\n <img\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n\n return `<picture${providedStyleTag}>${pictureHTML}</picture>`\n },\n}\n"],"mappings":"AAEA,OAAOA,UAAA,MAAgB;AAMvB,OAAO,MAAMC,mBAAA,GAA4D;EACvEC,MAAA,EAAQA,CAAC;IAAEC,IAAI;IAAEC;EAAgB,CAAE;IACjC,MAAMC,UAAA,GAAaF,IAAA;IAEnB,IAAIG,SAAA,GAAiDC,SAAA;IAErD;IACA,IAAI,OAAOF,UAAA,CAAWG,KAAK,KAAK,UAAU;MACxC,OAAO;IACT,OAAO;MACLF,SAAA,GAAYD,UAAA,CAAWG,KAAK;IAC9B;IAEA,IAAI,CAACF,SAAA,EAAW;MACd,OAAO;IACT;IAEA,MAAMG,GAAA,GAAMT,UAAA,CACVG,IAAC,CAAKO,MAAM,EAAED,GAAA,IAAmBH,SAAA,EAAgCG,GAAA,IAAO;IAG1E,MAAME,GAAA,GAAMX,UAAA,CAAWM,SAAA,CAAUK,GAAG,IAAI;IAExC;IACA,IAAI,CAACL,SAAA,CAAUM,QAAQ,CAAC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","ignoreList":[]}
1
+ {"version":3,"file":"upload.js","names":["escapeHTML","UploadHTMLConverter","upload","node","providedStyleTag","uploadNode","uploadDoc","undefined","value","alt","fields","url","mimeType","startsWith","filename","variants","Object","keys","length","String","height","width","pictureHTML","size","imageSize","filesize"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/upload.ts"],"sourcesContent":["import type { FileData, FileSize, TypeWithID } from 'payload'\n\nimport escapeHTML from 'escape-html'\n\nimport type { SerializedUploadNode } from '../../../../../types/nodeTypes.js'\nimport type { UploadData } from '../../../../upload/server/schema.js'\nimport type { HTMLConverters } from '../types.js'\n\nexport const UploadHTMLConverter: HTMLConverters<SerializedUploadNode> = {\n upload: ({ node, providedStyleTag }) => {\n const uploadNode = node as UploadData\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n return ''\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = escapeHTML(\n (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || '',\n )\n\n const url = escapeHTML(uploadDoc.url ?? '')\n\n // 1) If upload is NOT an image, return a link\n if (!uploadDoc.mimeType.startsWith('image')) {\n return `<a${providedStyleTag} href=\"${url}\" rel=\"noopener noreferrer\">${escapeHTML(uploadDoc.filename ?? '')}</a>`\n }\n\n // 2) If image has no different sizes, return a simple <img />\n if (!uploadDoc.variants || !Object.keys(uploadDoc.variants).length) {\n return `\n <img${providedStyleTag}\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n }\n\n // 3) If image has different sizes, build a <picture> element with <source> tags\n let pictureHTML = ''\n\n for (const size in uploadDoc.variants) {\n const imageSize = uploadDoc.variants[size] as FileSize\n\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n\n pictureHTML += `\n <source\n media=\"(max-width: ${escapeHTML(String(imageSize.width))}px)\"\n srcset=\"${escapeHTML(imageSize.url)}\"\n type=\"${escapeHTML(imageSize.mimeType)}\"\n />\n `\n }\n\n pictureHTML += `\n <img\n alt=\"${alt}\"\n height=\"${escapeHTML(String(uploadDoc.height ?? ''))}\"\n src=\"${url}\"\n width=\"${escapeHTML(String(uploadDoc.width ?? ''))}\"\n />\n `\n\n return `<picture${providedStyleTag}>${pictureHTML}</picture>`\n },\n}\n"],"mappings":"AAEA,OAAOA,UAAA,MAAgB;AAMvB,OAAO,MAAMC,mBAAA,GAA4D;EACvEC,MAAA,EAAQA,CAAC;IAAEC,IAAI;IAAEC;EAAgB,CAAE;IACjC,MAAMC,UAAA,GAAaF,IAAA;IAEnB,IAAIG,SAAA,GAAiDC,SAAA;IAErD;IACA,IAAI,OAAOF,UAAA,CAAWG,KAAK,KAAK,UAAU;MACxC,OAAO;IACT,OAAO;MACLF,SAAA,GAAYD,UAAA,CAAWG,KAAK;IAC9B;IAEA,IAAI,CAACF,SAAA,EAAW;MACd,OAAO;IACT;IAEA,MAAMG,GAAA,GAAMT,UAAA,CACVG,IAAC,CAAKO,MAAM,EAAED,GAAA,IAAmBH,SAAA,EAAgCG,GAAA,IAAO;IAG1E,MAAME,GAAA,GAAMX,UAAA,CAAWM,SAAA,CAAUK,GAAG,IAAI;IAExC;IACA,IAAI,CAACL,SAAA,CAAUM,QAAQ,CAACC,UAAU,CAAC,UAAU;MAC3C,OAAO,KAAKT,gBAAA,UAA0BO,GAAA,+BAAkCX,UAAA,CAAWM,SAAA,CAAUQ,QAAQ,IAAI,SAAS;IACpH;IAEA;IACA,IAAI,CAACR,SAAA,CAAUS,QAAQ,IAAI,CAACC,MAAA,CAAOC,IAAI,CAACX,SAAA,CAAUS,QAAQ,EAAEG,MAAM,EAAE;MAClE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