@payloadcms/richtext-lexical 4.0.0-internal.38b7f1d → 4.0.0-internal.5f0cd13

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 (532) hide show
  1. package/dist/cell/rscEntry.d.ts +1 -1
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js.map +1 -1
  4. package/dist/exports/client/{Field-PJW7KUJG.js → Field-G5Z2HM5Y.js} +2 -2
  5. package/dist/exports/client/Field-G5Z2HM5Y.js.map +7 -0
  6. package/dist/exports/client/{RelationshipComponent-5RONAYJM.js → RelationshipComponent-YCPAKOL7.js} +2 -2
  7. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
  8. package/dist/exports/client/bundled.css +1 -1
  9. package/dist/exports/client/{chunk-QJ5EETIB.js → chunk-6QWQ7JV4.js} +2 -2
  10. package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
  11. package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
  12. package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
  13. package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
  14. package/dist/exports/client/{chunk-44G3K3W7.js → chunk-UAKNDD6R.js} +2 -2
  15. package/dist/exports/client/chunk-UAKNDD6R.js.map +7 -0
  16. package/dist/exports/client/component-HKTAZ77E.js +2 -0
  17. package/dist/exports/client/component-HKTAZ77E.js.map +7 -0
  18. package/dist/exports/client/componentInline-D3A6OW76.js +2 -0
  19. package/dist/exports/client/index.js +16 -16
  20. package/dist/exports/client/index.js.map +4 -4
  21. package/dist/exports/react/index.d.ts +1 -1
  22. package/dist/exports/react/index.d.ts.map +1 -1
  23. package/dist/exports/react/index.js.map +1 -1
  24. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  25. package/dist/features/blockquote/server/index.d.ts +1 -4
  26. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  27. package/dist/features/blockquote/server/index.js +2 -0
  28. package/dist/features/blockquote/server/index.js.map +1 -1
  29. package/dist/features/blockquote/server/schema.d.ts +8 -0
  30. package/dist/features/blockquote/server/schema.d.ts.map +1 -0
  31. package/dist/features/blockquote/server/schema.js +15 -0
  32. package/dist/features/blockquote/server/schema.js.map +1 -0
  33. package/dist/features/blocks/client/component/index.d.ts +2 -2
  34. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  35. package/dist/features/blocks/client/component/index.js +2 -2
  36. package/dist/features/blocks/client/component/index.js.map +1 -1
  37. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  38. package/dist/features/blocks/client/componentInline/index.d.ts +2 -2
  39. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  40. package/dist/features/blocks/client/componentInline/index.js +2 -2
  41. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  42. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  43. package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
  44. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  45. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  46. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  47. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  48. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
  49. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  50. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  51. package/dist/features/blocks/client/plugin/index.d.ts +1 -1
  52. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  53. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  54. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
  55. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  56. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  57. package/dist/features/blocks/server/index.d.ts +1 -0
  58. package/dist/features/blocks/server/index.d.ts.map +1 -1
  59. package/dist/features/blocks/server/index.js +20 -66
  60. package/dist/features/blocks/server/index.js.map +1 -1
  61. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  62. package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
  63. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  64. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
  65. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  66. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  67. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
  68. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  70. package/dist/features/blocks/server/schema.d.ts +45 -0
  71. package/dist/features/blocks/server/schema.d.ts.map +1 -0
  72. package/dist/features/blocks/server/schema.js +136 -0
  73. package/dist/features/blocks/server/schema.js.map +1 -0
  74. package/dist/features/blocks/server/validate.d.ts +1 -2
  75. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  76. package/dist/features/blocks/server/validate.js.map +1 -1
  77. package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
  78. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  79. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  80. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
  81. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
  83. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
  84. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  86. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
  87. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
  88. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
  89. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
  90. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
  92. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
  93. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  94. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  95. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
  96. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  97. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  98. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
  99. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
  100. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
  101. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
  102. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
  103. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
  104. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
  105. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
  107. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  108. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
  109. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  110. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  111. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
  112. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  113. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  114. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
  115. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
  116. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
  117. package/dist/features/converters/lexicalToHtml/async/types.d.ts +2 -1
  118. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  119. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  120. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  121. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  122. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
  123. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
  124. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
  125. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
  126. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  127. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  128. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
  129. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
  130. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
  131. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
  132. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
  133. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
  134. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
  135. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  136. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  137. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
  138. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  139. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  140. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
  141. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
  142. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
  143. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
  144. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
  145. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
  146. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
  147. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  148. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
  149. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  150. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
  151. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  152. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  153. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
  154. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  155. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  156. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
  157. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
  158. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
  159. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +2 -1
  160. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  161. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  162. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +4 -2
  163. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  164. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  165. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
  166. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
  167. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  168. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
  169. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  170. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  171. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
  172. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
  173. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  174. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
  175. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
  176. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  177. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
  178. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
  179. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  180. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
  181. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  182. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  183. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
  184. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
  185. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  186. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
  187. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
  188. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
  189. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
  190. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
  191. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  192. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
  193. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
  194. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  195. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
  196. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  197. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  198. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
  199. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
  200. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
  201. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
  202. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  203. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  204. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +1 -1
  205. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  206. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  207. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  208. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
  209. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
  210. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +1 -1
  211. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  212. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  213. package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
  214. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  215. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  216. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +4 -4
  217. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +1 -1
  218. package/dist/features/experimental_table/server/index.d.ts +1 -6
  219. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  220. package/dist/features/experimental_table/server/index.js +4 -0
  221. package/dist/features/experimental_table/server/index.js.map +1 -1
  222. package/dist/features/experimental_table/server/schema.d.ts +27 -0
  223. package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
  224. package/dist/features/experimental_table/server/schema.js +104 -0
  225. package/dist/features/experimental_table/server/schema.js.map +1 -0
  226. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  227. package/dist/features/heading/server/index.d.ts +2 -4
  228. package/dist/features/heading/server/index.d.ts.map +1 -1
  229. package/dist/features/heading/server/index.js +2 -0
  230. package/dist/features/heading/server/index.js.map +1 -1
  231. package/dist/features/heading/server/schema.d.ts +10 -0
  232. package/dist/features/heading/server/schema.d.ts.map +1 -0
  233. package/dist/features/heading/server/schema.js +37 -0
  234. package/dist/features/heading/server/schema.js.map +1 -0
  235. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  236. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  237. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  238. package/dist/features/horizontalRule/server/index.d.ts +1 -0
  239. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  240. package/dist/features/horizontalRule/server/index.js +2 -0
  241. package/dist/features/horizontalRule/server/index.js.map +1 -1
  242. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
  243. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  244. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  245. package/dist/features/horizontalRule/server/schema.d.ts +7 -0
  246. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
  247. package/dist/features/horizontalRule/server/schema.js +25 -0
  248. package/dist/features/horizontalRule/server/schema.js.map +1 -0
  249. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  250. package/dist/features/link/client/index.d.ts.map +1 -1
  251. package/dist/features/link/client/index.js.map +1 -1
  252. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  253. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  254. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  255. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  256. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +2 -2
  257. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
  258. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  259. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  260. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  261. package/dist/features/link/markdownTransformer.d.ts +1 -1
  262. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  263. package/dist/features/link/markdownTransformer.js.map +1 -1
  264. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  265. package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
  266. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  267. package/dist/features/link/nodes/AutoLinkNode.js +2 -1
  268. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  269. package/dist/features/link/nodes/LinkNode.d.ts +3 -3
  270. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  271. package/dist/features/link/nodes/LinkNode.js +2 -1
  272. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  273. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  274. package/dist/features/link/server/baseFields.js.map +1 -1
  275. package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
  276. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  277. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  278. package/dist/features/link/server/index.d.ts +2 -1
  279. package/dist/features/link/server/index.d.ts.map +1 -1
  280. package/dist/features/link/server/index.js +3 -0
  281. package/dist/features/link/server/index.js.map +1 -1
  282. package/dist/features/link/server/schema.d.ts +32 -0
  283. package/dist/features/link/server/schema.d.ts.map +1 -0
  284. package/dist/features/link/server/schema.js +166 -0
  285. package/dist/features/link/server/schema.js.map +1 -0
  286. package/dist/features/link/server/validate.d.ts +1 -1
  287. package/dist/features/link/server/validate.d.ts.map +1 -1
  288. package/dist/features/link/server/validate.js.map +1 -1
  289. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  290. package/dist/features/lists/checklist/server/index.js +3 -0
  291. package/dist/features/lists/checklist/server/index.js.map +1 -1
  292. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  293. package/dist/features/lists/orderedList/server/index.js +3 -0
  294. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  295. package/dist/features/lists/plugin/index.d.ts +0 -9
  296. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  297. package/dist/features/lists/plugin/index.js.map +1 -1
  298. package/dist/features/lists/shared/markdown.d.ts.map +1 -1
  299. package/dist/features/lists/shared/schema.d.ts +18 -0
  300. package/dist/features/lists/shared/schema.d.ts.map +1 -0
  301. package/dist/features/lists/shared/schema.js +62 -0
  302. package/dist/features/lists/shared/schema.js.map +1 -0
  303. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  304. package/dist/features/lists/unorderedList/server/index.js +3 -0
  305. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  306. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  307. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  308. package/dist/features/relationship/client/components/RelationshipComponent.js +2 -2
  309. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  310. package/dist/features/relationship/client/components/index.css +2 -2
  311. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  312. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  313. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  314. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  315. package/dist/features/relationship/client/plugins/index.d.ts +1 -1
  316. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  317. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  318. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  319. package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
  320. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  321. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
  322. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  323. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  324. package/dist/features/relationship/server/index.d.ts +1 -0
  325. package/dist/features/relationship/server/index.d.ts.map +1 -1
  326. package/dist/features/relationship/server/index.js +2 -0
  327. package/dist/features/relationship/server/index.js.map +1 -1
  328. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
  329. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  330. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  331. package/dist/features/relationship/server/schema.d.ts +28 -0
  332. package/dist/features/relationship/server/schema.d.ts.map +1 -0
  333. package/dist/features/relationship/server/schema.js +83 -0
  334. package/dist/features/relationship/server/schema.js.map +1 -0
  335. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
  336. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
  337. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
  338. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
  339. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  340. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  341. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  342. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  343. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +1 -2
  345. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  346. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +4 -4
  347. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  348. package/dist/features/toolbars/types.d.ts +1 -1
  349. package/dist/features/toolbars/types.d.ts.map +1 -1
  350. package/dist/features/toolbars/types.js.map +1 -1
  351. package/dist/features/typesClient.d.ts +1 -1
  352. package/dist/features/typesClient.d.ts.map +1 -1
  353. package/dist/features/typesClient.js.map +1 -1
  354. package/dist/features/typesServer.d.ts +18 -41
  355. package/dist/features/typesServer.d.ts.map +1 -1
  356. package/dist/features/typesServer.js.map +1 -1
  357. package/dist/features/upload/client/component/index.css +14 -18
  358. package/dist/features/upload/client/component/index.d.ts +1 -1
  359. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  360. package/dist/features/upload/client/component/index.js +4 -4
  361. package/dist/features/upload/client/component/index.js.map +1 -1
  362. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  363. package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
  364. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  365. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  366. package/dist/features/upload/client/plugin/index.d.ts +1 -1
  367. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  368. package/dist/features/upload/client/plugin/index.js.map +1 -1
  369. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
  370. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  371. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  372. package/dist/features/upload/server/index.d.ts +1 -0
  373. package/dist/features/upload/server/index.d.ts.map +1 -1
  374. package/dist/features/upload/server/index.js +3 -2
  375. package/dist/features/upload/server/index.js.map +1 -1
  376. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
  377. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  378. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  379. package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
  380. package/dist/features/upload/server/nodes/conversions.js.map +1 -1
  381. package/dist/features/upload/server/schema.d.ts +52 -0
  382. package/dist/features/upload/server/schema.d.ts.map +1 -0
  383. package/dist/features/upload/server/schema.js +113 -0
  384. package/dist/features/upload/server/schema.js.map +1 -0
  385. package/dist/features/upload/server/validate.d.ts +1 -1
  386. package/dist/features/upload/server/validate.d.ts.map +1 -1
  387. package/dist/features/upload/server/validate.js.map +1 -1
  388. package/dist/field/Diff/converters/link.d.ts +1 -1
  389. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  390. package/dist/field/Diff/converters/link.js.map +1 -1
  391. package/dist/field/Diff/converters/listitem/index.css +44 -8
  392. package/dist/field/Diff/converters/listitem/index.d.ts +1 -1
  393. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  394. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  395. package/dist/field/Diff/converters/relationship/index.css +76 -36
  396. package/dist/field/Diff/converters/relationship/index.d.ts +1 -1
  397. package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
  398. package/dist/field/Diff/converters/relationship/index.js +10 -28
  399. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  400. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  401. package/dist/field/Diff/converters/upload/index.css +106 -43
  402. package/dist/field/Diff/converters/upload/index.d.ts +1 -1
  403. package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
  404. package/dist/field/Diff/converters/upload/index.js +6 -2
  405. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  406. package/dist/field/Diff/index.css +116 -61
  407. package/dist/field/Diff/index.js.map +1 -1
  408. package/dist/field/Field.d.ts +1 -1
  409. package/dist/field/Field.d.ts.map +1 -1
  410. package/dist/field/Field.js +3 -4
  411. package/dist/field/Field.js.map +1 -1
  412. package/dist/field/RenderLexical/index.d.ts +2 -2
  413. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  414. package/dist/field/RenderLexical/index.js.map +1 -1
  415. package/dist/field/RichTextViewProvider.d.ts +1 -1
  416. package/dist/field/RichTextViewProvider.d.ts.map +1 -1
  417. package/dist/field/RichTextViewProvider.js.map +1 -1
  418. package/dist/field/bundled.css +1 -1
  419. package/dist/field/index.d.ts +1 -1
  420. package/dist/field/index.d.ts.map +1 -1
  421. package/dist/field/index.js.map +1 -1
  422. package/dist/field/rscEntry.d.ts +1 -1
  423. package/dist/field/rscEntry.d.ts.map +1 -1
  424. package/dist/field/rscEntry.js.map +1 -1
  425. package/dist/hooks.d.ts +6 -0
  426. package/dist/hooks.d.ts.map +1 -0
  427. package/dist/hooks.js +548 -0
  428. package/dist/hooks.js.map +1 -0
  429. package/dist/index.d.ts +11 -8
  430. package/dist/index.d.ts.map +1 -1
  431. package/dist/index.js +9 -618
  432. package/dist/index.js.map +1 -1
  433. package/dist/lexical/LexicalProvider.d.ts +1 -1
  434. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  435. package/dist/lexical/LexicalProvider.js.map +1 -1
  436. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  437. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  438. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  439. package/dist/lexical/config/client/loader.d.ts +1 -1
  440. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  441. package/dist/lexical/config/client/loader.js.map +1 -1
  442. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  443. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  444. package/dist/lexical/config/client/sanitize.js.map +1 -1
  445. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  446. package/dist/lexical/config/server/sanitize.js +9 -11
  447. package/dist/lexical/config/server/sanitize.js.map +1 -1
  448. package/dist/lexical/config/types.d.ts +1 -1
  449. package/dist/lexical/config/types.d.ts.map +1 -1
  450. package/dist/lexical/config/types.js.map +1 -1
  451. package/dist/lexical/nodes/index.d.ts +1 -1
  452. package/dist/lexical/nodes/index.d.ts.map +1 -1
  453. package/dist/lexical/nodes/index.js.map +1 -1
  454. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
  455. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  456. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  457. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  458. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  459. package/dist/lexical/theme/EditorTheme.css +4 -4
  460. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  461. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  462. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  463. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  464. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  465. package/dist/types/builtInNodes.d.ts +14 -0
  466. package/dist/types/builtInNodes.d.ts.map +1 -0
  467. package/dist/types/builtInNodes.js +203 -0
  468. package/dist/types/builtInNodes.js.map +1 -0
  469. package/dist/{types.d.ts → types/index.d.ts} +9 -10
  470. package/dist/types/index.d.ts.map +1 -0
  471. package/dist/types/index.js +2 -0
  472. package/dist/types/index.js.map +1 -0
  473. package/dist/types/jsonSchemaHelpers.d.ts +28 -0
  474. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
  475. package/dist/types/jsonSchemaHelpers.js +54 -0
  476. package/dist/types/jsonSchemaHelpers.js.map +1 -0
  477. package/dist/types/nodeTypes.d.ts +86 -0
  478. package/dist/types/nodeTypes.d.ts.map +1 -0
  479. package/dist/types/nodeTypes.js +6 -0
  480. package/dist/types/nodeTypes.js.map +1 -0
  481. package/dist/types/schema.d.ts +6 -0
  482. package/dist/types/schema.d.ts.map +1 -0
  483. package/dist/types/schema.js +73 -0
  484. package/dist/types/schema.js.map +1 -0
  485. package/dist/utilities/buildEditorState.d.ts +1 -1
  486. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  487. package/dist/utilities/buildEditorState.js.map +1 -1
  488. package/dist/utilities/buildInitialState.js.map +1 -1
  489. package/dist/utilities/createClientFeature.d.ts +1 -1
  490. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  491. package/dist/utilities/createClientFeature.js.map +1 -1
  492. package/dist/utilities/editorConfigFactory.d.ts +1 -1
  493. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  494. package/dist/utilities/editorConfigFactory.js.map +1 -1
  495. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  496. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  497. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  498. package/dist/utilities/generateImportMap.d.ts +1 -1
  499. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  500. package/dist/utilities/generateImportMap.js.map +1 -1
  501. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  502. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  503. package/dist/utilities/initLexicalFeatures.d.ts +1 -1
  504. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  505. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  506. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  507. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  508. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  509. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  510. package/dist/validate/index.d.ts.map +1 -1
  511. package/package.json +13 -13
  512. package/dist/exports/client/Field-PJW7KUJG.js.map +0 -7
  513. package/dist/exports/client/RelationshipComponent-5RONAYJM.js.map +0 -7
  514. package/dist/exports/client/chunk-44G3K3W7.js.map +0 -7
  515. package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
  516. package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
  517. package/dist/exports/client/component-53Y3RYR5.js +0 -2
  518. package/dist/exports/client/component-53Y3RYR5.js.map +0 -7
  519. package/dist/exports/client/componentInline-PM4PLNUK.js +0 -2
  520. package/dist/features/link/nodes/types.d.ts +0 -27
  521. package/dist/features/link/nodes/types.d.ts.map +0 -1
  522. package/dist/features/link/nodes/types.js +0 -2
  523. package/dist/features/link/nodes/types.js.map +0 -1
  524. package/dist/nodeTypes.d.ts +0 -74
  525. package/dist/nodeTypes.d.ts.map +0 -1
  526. package/dist/nodeTypes.js +0 -5
  527. package/dist/nodeTypes.js.map +0 -1
  528. package/dist/types.d.ts.map +0 -1
  529. package/dist/types.js +0 -2
  530. package/dist/types.js.map +0 -1
  531. /package/dist/exports/client/{chunk-QJ5EETIB.js.map → chunk-6QWQ7JV4.js.map} +0 -0
  532. /package/dist/exports/client/{componentInline-PM4PLNUK.js.map → componentInline-D3A6OW76.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.js","names":["loadFeatures","sanitizeServerFeatures","features","sanitized","enabledFeatures","generatedTypes","modifyOutputSchemas","getSubFields","Map","getSubFieldsData","graphQLPopulationPromises","hooks","afterChange","afterRead","beforeChange","beforeValidate","i18n","markdownTransformers","nodeHooks","nodes","validations","size","forEach","feature","modifyOutputSchema","push","length","concat","lang","lexical","key","node","nodeType","replace","getType","set","transformer","allNodes","allTransformers","sanitizeServerEditorConfig","editorConfig","config","parentIsLocalized","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../../../src/lexical/config/server/sanitize.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../../features/typesServer.js'\nimport type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js'\n\nimport { loadFeatures } from './loader.js'\n\nexport const sanitizeServerFeatures = (\n features: ResolvedServerFeatureMap,\n): SanitizedServerFeatures => {\n const sanitized: SanitizedServerFeatures = {\n enabledFeatures: [],\n generatedTypes: {\n modifyOutputSchemas: [],\n },\n getSubFields: new Map(),\n getSubFieldsData: new Map(),\n graphQLPopulationPromises: new Map(),\n hooks: {\n afterChange: [],\n afterRead: [],\n beforeChange: [],\n beforeValidate: [],\n },\n i18n: {},\n markdownTransformers: [],\n nodeHooks: {\n afterChange: new Map(),\n afterRead: new Map(),\n beforeChange: new Map(),\n beforeValidate: new Map(),\n },\n nodes: [],\n\n validations: new Map(),\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature?.generatedTypes?.modifyOutputSchema) {\n sanitized.generatedTypes.modifyOutputSchemas.push(feature.generatedTypes.modifyOutputSchema)\n }\n\n if (feature?.hooks?.beforeValidate?.length) {\n sanitized.hooks.beforeValidate = sanitized.hooks.beforeValidate?.concat(\n feature.hooks.beforeValidate,\n )\n }\n if (feature?.hooks?.beforeChange?.length) {\n sanitized.hooks.beforeChange = sanitized.hooks.beforeChange?.concat(\n feature.hooks.beforeChange,\n )\n }\n if (feature?.hooks?.afterRead?.length) {\n sanitized.hooks.afterRead = sanitized.hooks.afterRead?.concat(feature.hooks.afterRead)\n }\n if (feature?.hooks?.afterChange?.length) {\n sanitized.hooks.afterChange = sanitized.hooks.afterChange?.concat(feature.hooks.afterChange)\n }\n\n if (feature?.i18n) {\n for (const lang in feature.i18n) {\n if (!sanitized.i18n[lang as keyof typeof sanitized.i18n]) {\n sanitized.i18n[lang as keyof typeof sanitized.i18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n sanitized.i18n[lang].lexical[feature.key] = feature.i18n[lang]\n }\n }\n\n if (feature.nodes?.length) {\n // Do not concat here. We need to keep the object reference of sanitized.nodes so that function markdown transformers of features automatically get the updated nodes\n for (const node of feature.nodes) {\n sanitized.nodes.push(node)\n }\n feature.nodes.forEach((node) => {\n const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType() // TODO: Idk if this works for node replacements\n if (node?.graphQLPopulationPromises?.length) {\n sanitized.graphQLPopulationPromises.set(nodeType, node.graphQLPopulationPromises)\n }\n if (node?.validations?.length) {\n sanitized.validations.set(nodeType, node.validations)\n }\n if (node?.hooks?.afterChange) {\n sanitized.nodeHooks?.afterChange?.set(nodeType, node.hooks.afterChange)\n }\n if (node?.hooks?.afterRead) {\n sanitized.nodeHooks?.afterRead?.set(nodeType, node.hooks.afterRead)\n }\n if (node?.hooks?.beforeChange) {\n sanitized.nodeHooks?.beforeChange?.set(nodeType, node.hooks.beforeChange)\n }\n if (node?.hooks?.beforeValidate) {\n sanitized.nodeHooks?.beforeValidate?.set(nodeType, node.hooks.beforeValidate)\n }\n if (node?.getSubFields) {\n sanitized.getSubFields?.set(nodeType, node.getSubFields)\n }\n if (node?.getSubFieldsData) {\n sanitized.getSubFieldsData?.set(nodeType, node.getSubFieldsData)\n }\n })\n }\n\n if (feature.markdownTransformers?.length) {\n // Do not concat here. We need to keep the object reference of feature.markdownTransformers\n\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n\n sanitized.enabledFeatures.push(feature.key)\n })\n\n return sanitized\n}\n\nexport async function sanitizeServerEditorConfig(\n editorConfig: ServerEditorConfig,\n config: SanitizedConfig,\n parentIsLocalized?: boolean,\n): Promise<SanitizedServerEditorConfig> {\n const resolvedFeatureMap = await loadFeatures({\n config,\n parentIsLocalized: parentIsLocalized!,\n unSanitizedEditorConfig: editorConfig,\n })\n\n return {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: editorConfig.lexical!,\n resolvedFeatureMap,\n }\n}\n"],"mappings":"AAQA,SAASA,YAAY,QAAQ;AAE7B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,eAAA,EAAiB,EAAE;IACnBC,cAAA,EAAgB;MACdC,mBAAA,EAAqB;IACvB;IACAC,YAAA,EAAc,IAAIC,GAAA;IAClBC,gBAAA,EAAkB,IAAID,GAAA;IACtBE,yBAAA,EAA2B,IAAIF,GAAA;IAC/BG,KAAA,EAAO;MACLC,WAAA,EAAa,EAAE;MACfC,SAAA,EAAW,EAAE;MACbC,YAAA,EAAc,EAAE;MAChBC,cAAA,EAAgB;IAClB;IACAC,IAAA,EAAM,CAAC;IACPC,oBAAA,EAAsB,EAAE;IACxBC,SAAA,EAAW;MACTN,WAAA,EAAa,IAAIJ,GAAA;MACjBK,SAAA,EAAW,IAAIL,GAAA;MACfM,YAAA,EAAc,IAAIN,GAAA;MAClBO,cAAA,EAAgB,IAAIP,GAAA;IACtB;IACAW,KAAA,EAAO,EAAE;IAETC,WAAA,EAAa,IAAIZ,GAAA;EACnB;EAEA,IAAI,CAACN,QAAA,EAAUmB,IAAA,EAAM;IACnB,OAAOlB,SAAA;EACT;EAEAD,QAAA,CAASoB,OAAO,CAAEC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EA,OAAO;IACLtC,QAAA,EAAUD,sBAAA,CAAuB0C,kBAAA;IACjCd,OAAA,EAASW,YAAA,CAAaX,OAAO;IAC7Bc;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"sanitize.js","names":["loadFeatures","sanitizeServerFeatures","features","sanitized","enabledFeatures","getSubFields","Map","getSubFieldsData","graphQLPopulationPromises","hooks","afterChange","afterRead","beforeChange","beforeValidate","i18n","markdownTransformers","nodeHooks","nodes","validations","size","forEach","feature","length","concat","lang","lexical","key","node","nodeType","replace","getType","alreadyRegistered","some","existing","existingType","Error","push","set","transformer","allNodes","allTransformers","sanitizeServerEditorConfig","editorConfig","config","parentIsLocalized","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../../../src/lexical/config/server/sanitize.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../../features/typesServer.js'\nimport type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js'\n\nimport { loadFeatures } from './loader.js'\n\nexport const sanitizeServerFeatures = (\n features: ResolvedServerFeatureMap,\n): SanitizedServerFeatures => {\n const sanitized: SanitizedServerFeatures = {\n enabledFeatures: [],\n getSubFields: new Map(),\n getSubFieldsData: new Map(),\n graphQLPopulationPromises: new Map(),\n hooks: {\n afterChange: [],\n afterRead: [],\n beforeChange: [],\n beforeValidate: [],\n },\n i18n: {},\n markdownTransformers: [],\n nodeHooks: {\n afterChange: new Map(),\n afterRead: new Map(),\n beforeChange: new Map(),\n beforeValidate: new Map(),\n },\n nodes: [],\n\n validations: new Map(),\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature?.hooks?.beforeValidate?.length) {\n sanitized.hooks.beforeValidate = sanitized.hooks.beforeValidate?.concat(\n feature.hooks.beforeValidate,\n )\n }\n if (feature?.hooks?.beforeChange?.length) {\n sanitized.hooks.beforeChange = sanitized.hooks.beforeChange?.concat(\n feature.hooks.beforeChange,\n )\n }\n if (feature?.hooks?.afterRead?.length) {\n sanitized.hooks.afterRead = sanitized.hooks.afterRead?.concat(feature.hooks.afterRead)\n }\n if (feature?.hooks?.afterChange?.length) {\n sanitized.hooks.afterChange = sanitized.hooks.afterChange?.concat(feature.hooks.afterChange)\n }\n\n if (feature?.i18n) {\n for (const lang in feature.i18n) {\n if (!sanitized.i18n[lang as keyof typeof sanitized.i18n]) {\n sanitized.i18n[lang as keyof typeof sanitized.i18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n sanitized.i18n[lang].lexical[feature.key] = feature.i18n[lang]\n }\n }\n\n if (feature.nodes?.length) {\n // Do not concat here. We need to keep the object reference of sanitized.nodes so that function markdown transformers of features automatically get the updated nodes\n for (const node of feature.nodes) {\n const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType()\n const alreadyRegistered = sanitized.nodes.some((existing) => {\n const existingType =\n 'with' in existing.node ? existing.node.replace.getType() : existing.node.getType()\n return existingType === nodeType\n })\n if (alreadyRegistered) {\n throw new Error(\n `Lexical editor config: node type \"${nodeType}\" was registered more than once (feature \"${feature.key}\"). Each lexical node type may only be registered by a single feature.`,\n )\n }\n sanitized.nodes.push(node)\n if (node?.graphQLPopulationPromises?.length) {\n sanitized.graphQLPopulationPromises.set(nodeType, node.graphQLPopulationPromises)\n }\n if (node?.validations?.length) {\n sanitized.validations.set(nodeType, node.validations)\n }\n if (node?.hooks?.afterChange) {\n sanitized.nodeHooks?.afterChange?.set(nodeType, node.hooks.afterChange)\n }\n if (node?.hooks?.afterRead) {\n sanitized.nodeHooks?.afterRead?.set(nodeType, node.hooks.afterRead)\n }\n if (node?.hooks?.beforeChange) {\n sanitized.nodeHooks?.beforeChange?.set(nodeType, node.hooks.beforeChange)\n }\n if (node?.hooks?.beforeValidate) {\n sanitized.nodeHooks?.beforeValidate?.set(nodeType, node.hooks.beforeValidate)\n }\n if (node?.getSubFields) {\n sanitized.getSubFields?.set(nodeType, node.getSubFields)\n }\n if (node?.getSubFieldsData) {\n sanitized.getSubFieldsData?.set(nodeType, node.getSubFieldsData)\n }\n }\n }\n\n if (feature.markdownTransformers?.length) {\n // Do not concat here. We need to keep the object reference of feature.markdownTransformers\n\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n\n sanitized.enabledFeatures.push(feature.key)\n })\n\n return sanitized\n}\n\nexport async function sanitizeServerEditorConfig(\n editorConfig: ServerEditorConfig,\n config: SanitizedConfig,\n parentIsLocalized?: boolean,\n): Promise<SanitizedServerEditorConfig> {\n const resolvedFeatureMap = await loadFeatures({\n config,\n parentIsLocalized: parentIsLocalized!,\n unSanitizedEditorConfig: editorConfig,\n })\n\n return {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: editorConfig.lexical!,\n resolvedFeatureMap,\n }\n}\n"],"mappings":"AAQA,SAASA,YAAY,QAAQ;AAE7B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,eAAA,EAAiB,EAAE;IACnBC,YAAA,EAAc,IAAIC,GAAA;IAClBC,gBAAA,EAAkB,IAAID,GAAA;IACtBE,yBAAA,EAA2B,IAAIF,GAAA;IAC/BG,KAAA,EAAO;MACLC,WAAA,EAAa,EAAE;MACfC,SAAA,EAAW,EAAE;MACbC,YAAA,EAAc,EAAE;MAChBC,cAAA,EAAgB;IAClB;IACAC,IAAA,EAAM,CAAC;IACPC,oBAAA,EAAsB,EAAE;IACxBC,SAAA,EAAW;MACTN,WAAA,EAAa,IAAIJ,GAAA;MACjBK,SAAA,EAAW,IAAIL,GAAA;MACfM,YAAA,EAAc,IAAIN,GAAA;MAClBO,cAAA,EAAgB,IAAIP,GAAA;IACtB;IACAW,KAAA,EAAO,EAA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,eAAe,CAACgC,IAAI,CAACf,OAAA,CAAQK,GAAG;EAC5C;EAEA,OAAOvB,SAAA;AACT;AAEA,OAAO,eAAesC,2BACpBC,YAAgC,EAChCC,MAAuB,EACvBC,iBAA2B;EAE3B,MAAMC,kBAAA,GAAqB,MAAM7C,YAAA,CAAa;IAC5C2C,MAAA;IACAC,iBAAA,EAAmBA,iBAAA;IACnBE,uBAAA,EAAyBJ;EAC3B;EAEA,OAAO;IACLxC,QAAA,EAAUD,sBAAA,CAAuB4C,kBAAA;IACjCpB,OAAA,EAASiB,YAAA,CAAajB,OAAO;IAC7BoB;EACF;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import type { FeatureProviderClient, ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../features/typesClient.js';
3
3
  import type { FeatureProviderServer, ResolvedServerFeatureMap, SanitizedServerFeatures } from '../../features/typesServer.js';
4
- import type { LexicalFieldAdminClientProps } from '../../types.js';
4
+ import type { LexicalFieldAdminClientProps } from '../../types/index.js';
5
5
  export type ServerEditorConfig = {
6
6
  features: FeatureProviderServer<any, any, any>[];
7
7
  lexical?: LexicalEditorConfig | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lexical/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,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,QAAQ,EAAE,uBAAuB,CAAA;IACjC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAA;IACxC,kBAAkB,EAAE,wBAAwB,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;IAC3C,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,4BAA4B,CAAA;IACpC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/lexical/config/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type {\n FeatureProviderClient,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../features/typesClient.js'\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../features/typesServer.js'\nimport type { LexicalFieldAdminClientProps } from '../../types.js'\n\nexport type ServerEditorConfig = {\n features: FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n}\n\nexport type SanitizedServerEditorConfig = {\n features: SanitizedServerFeatures\n lexical: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n resolvedFeatureMap: ResolvedServerFeatureMap\n}\n\nexport type ClientEditorConfig = {\n features: FeatureProviderClient<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type SanitizedClientEditorConfig = {\n admin?: LexicalFieldAdminClientProps\n features: SanitizedClientFeatures\n lexical: LexicalEditorConfig\n resolvedFeatureMap: ResolvedClientFeatureMap\n /**\n * To identify what view this editor config was created for.\n */\n view?: string\n}\n"],"mappings":"AA8BA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/lexical/config/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type {\n FeatureProviderClient,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../features/typesClient.js'\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../features/typesServer.js'\nimport type { LexicalFieldAdminClientProps } from '../../types/index.js'\n\nexport type ServerEditorConfig = {\n features: FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n}\n\nexport type SanitizedServerEditorConfig = {\n features: SanitizedServerFeatures\n lexical: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n resolvedFeatureMap: ResolvedServerFeatureMap\n}\n\nexport type ClientEditorConfig = {\n features: FeatureProviderClient<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type SanitizedClientEditorConfig = {\n admin?: LexicalFieldAdminClientProps\n features: SanitizedClientFeatures\n lexical: LexicalEditorConfig\n resolvedFeatureMap: ResolvedClientFeatureMap\n /**\n * To identify what view this editor config was created for.\n */\n view?: string\n}\n"],"mappings":"AA8BA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { Klass, LexicalEditor, LexicalNode, LexicalNodeReplacement } from 'lexical';
2
2
  import type { NodeWithHooks } from '../../features/typesServer.js';
3
- import type { LexicalEditorNodeMap } from '../../types.js';
3
+ import type { LexicalEditorNodeMap } from '../../types/index.js';
4
4
  import type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js';
5
5
  /**
6
6
  * Register view definitions for an editor
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lexical/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAMlG;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,oBAAoB,GAC9B,IAAI,CAsCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEhE;AAwKD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,SAAS,GACV,EAAE;IACD,YAAY,EAAE,2BAA2B,GAAG,2BAA2B,CAAA;IACvE,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAyCrD;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,KAAK,GACN,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;CACjF,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAOrD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lexical/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAMlG;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,oBAAoB,GAC9B,IAAI,CAsCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEhE;AAwKD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,SAAS,GACV,EAAE;IACD,YAAY,EAAE,2BAA2B,GAAG,2BAA2B,CAAA;IACvE,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAyCrD;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,KAAK,GACN,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;CACjF,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAOrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","editorNodeViews","WeakMap","registerEditorNodeViews","editor","nodeViews","has","set","Map","editorViews","get","nodeType","value","Object","entries","blockType","viewDef","clearEditorNodeViews","delete","getEditorNodeView","node","applyNodeOverride","getType","NodeClass","prototype","_originalDecorate","decorate","_originalCreateDOM","createDOM","_decorateOverridden","hasCreateDOM","config","Component","isEditor","isJSXConverter","html","htmlContent","createElement","dangerouslySetInnerHTML","__html","Fragment","blockViewDef","Block","Label","originalDecorate","call","_createDOMOverridden","tempDiv","document","innerHTML","firstElementChild","getEnabledNodes","editorConfig","nodes","getEnabledNodesFromServerNodes","features","nodeTypesToOverride","Set","key","keys","length","add","map"],"sources":["../../../src/lexical/nodes/index.ts"],"sourcesContent":["import type {\n EditorConfig,\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n} from 'lexical'\n\nimport React from 'react'\n\nimport type { BlockDecorateFunction } from '../../features/blocks/client/nodes/BlocksNode.js'\nimport type { InlineBlockDecorateFunction } from '../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { NodeWithHooks } from '../../features/typesServer.js'\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapInlineBlockValue,\n NodeMapValue,\n} from '../../types.js'\nimport type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js'\n\n// Store view definitions for each editor and node type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst editorNodeViews = new WeakMap<LexicalEditor, Map<string, NodeMapValue<any>>>()\n\n/**\n * Register view definitions for an editor\n */\nexport function registerEditorNodeViews(\n editor: LexicalEditor,\n nodeViews: LexicalEditorNodeMap,\n): void {\n if (!editorNodeViews.has(editor)) {\n editorNodeViews.set(editor, new Map())\n }\n const editorViews = editorNodeViews.get(editor)!\n\n // Register each node type's view\n for (const [nodeType, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle blocks specially - store each block type with key 'block:blockType'\n if (nodeType === 'blocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`block:${blockType}`, viewDef)\n }\n continue\n }\n\n // Handle inlineBlocks specially - store each block type with key 'inlineBlock:blockType'\n if (nodeType === 'inlineBlocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`inlineBlock:${blockType}`, viewDef)\n }\n continue\n }\n\n // Regular node types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n editorViews.set(nodeType, value as NodeMapValue<any>)\n }\n}\n\n/**\n * Clear all view overrides for an editor (restores default rendering)\n */\nexport function clearEditorNodeViews(editor: LexicalEditor): void {\n editorNodeViews.delete(editor)\n}\n\n/**\n * Get the view definition for a specific editor and node\n */\nfunction getEditorNodeView(\n editor: LexicalEditor,\n nodeType: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node?: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): NodeMapValue<any> | undefined {\n const editorViews = editorNodeViews.get(editor)\n\n // For block nodes, look up by blockType\n if (nodeType === 'block' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`block:${blockType}`)\n }\n\n // For inlineBlock nodes, look up by blockType\n if (nodeType === 'inlineBlock' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`inlineBlock:${blockType}`)\n }\n\n // Regular node types\n return editorViews?.get(nodeType)\n}\n\n/**\n * Apply view overrides to a specific node type by modifying its prototype\n * Uses WeakMap to check per-editor at runtime\n */\nfunction applyNodeOverride({\n node,\n nodeType,\n}: {\n node: Klass<LexicalNode>\n nodeType: string\n}): void {\n if (!('getType' in node) || node.getType() !== nodeType) {\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const NodeClass = node as any\n\n // Store original methods if not already stored\n if (!NodeClass.prototype._originalDecorate) {\n NodeClass.prototype._originalDecorate = NodeClass.prototype.decorate\n }\n if (!NodeClass.prototype._originalCreateDOM) {\n NodeClass.prototype._originalCreateDOM = NodeClass.prototype.createDOM\n }\n\n // Override decorate method (for DecoratorNodes)\n if (NodeClass.prototype.decorate && !NodeClass.prototype._decorateOverridden) {\n NodeClass.prototype._decorateOverridden = true\n const hasCreateDOM = !!NodeClass.prototype.createDOM\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n NodeClass.prototype.decorate = function (editor: LexicalEditor, config: EditorConfig): any {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // Priority 1: If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component({\n config,\n editor,\n isEditor: true,\n isJSXConverter: false,\n node: this,\n })\n }\n\n // Priority 2: If custom createDOM is provided, use html in decorate\n if (viewDef.createDOM && viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n return React.createElement('span', {\n dangerouslySetInnerHTML: { __html: htmlContent },\n })\n }\n\n // Priority 3: If only html is provided (no custom createDOM),\n // createDOM will handle it, so decorate returns empty fragment\n if (viewDef.html && hasCreateDOM && !viewDef.createDOM) {\n return React.createElement(React.Fragment)\n }\n\n if (nodeType === 'block') {\n const blockViewDef: NodeMapBlockValue = viewDef as NodeMapBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: BlockDecorateFunction = NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n } else if (nodeType === 'inlineBlock') {\n const blockViewDef: NodeMapInlineBlockValue = viewDef as NodeMapInlineBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n }\n }\n\n const originalDecorate: BlockDecorateFunction | InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Otherwise use original\n return originalDecorate.call(this, editor, config)\n }\n }\n\n // Override createDOM method (for ElementNodes)\n if (NodeClass.prototype.createDOM && !NodeClass.prototype._createDOMOverridden) {\n NodeClass.prototype._createDOMOverridden = true\n NodeClass.prototype.createDOM = function (\n config: EditorConfig,\n editor: LexicalEditor,\n ): HTMLElement {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // If createDOM is provided, use it\n if (viewDef.createDOM) {\n return viewDef.createDOM({ config, editor, node: this })\n }\n\n // If html is provided (as a function or string), create element from it\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n const tempDiv = document.createElement('div')\n tempDiv.innerHTML = htmlContent\n return (tempDiv.firstElementChild as HTMLElement) || tempDiv\n }\n }\n\n // Otherwise use original\n return NodeClass.prototype._originalCreateDOM.call(this, config, editor)\n }\n }\n}\n\nexport function getEnabledNodes({\n editorConfig,\n nodeViews,\n}: {\n editorConfig: SanitizedClientEditorConfig | SanitizedServerEditorConfig\n nodeViews?: LexicalEditorNodeMap\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n const nodes = getEnabledNodesFromServerNodes({\n nodes: editorConfig.features.nodes,\n })\n\n if (nodeViews) {\n // Apply node overrides by modifying prototypes (once globally)\n // The overrides check per-editor at runtime using WeakMap\n const nodeTypesToOverride = new Set<string>()\n\n for (const [key, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // If 'blocks' key exists with content, we need to override 'block' nodes\n if (key === 'blocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('block')\n }\n // If 'inlineBlocks' key exists with content, we need to override 'inlineBlock' nodes\n else if (key === 'inlineBlocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('inlineBlock')\n }\n // Regular node types\n else {\n nodeTypesToOverride.add(key)\n }\n }\n\n for (const node of nodes) {\n if ('getType' in node) {\n const nodeType = node.getType()\n\n if (nodeTypesToOverride.has(nodeType)) {\n applyNodeOverride({ node, nodeType })\n }\n }\n }\n }\n\n return nodes\n}\n\nexport function getEnabledNodesFromServerNodes({\n nodes,\n}: {\n nodes: Array<Klass<LexicalNode> | LexicalNodeReplacement> | Array<NodeWithHooks>\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n return nodes.map((node) => {\n if ('node' in node) {\n return node.node\n }\n return node\n })\n}\n"],"mappings":"AAQA,OAAOA,KAAA,MAAW;AAalB;AACA;AACA,MAAMC,eAAA,GAAkB,IAAIC,OAAA;AAE5B;;;AAGA,OAAO,SAASC,wBACdC,MAAqB,EACrBC,SAA+B;EAE/B,IAAI,CAACJ,eAAA,CAAgBK,GAAG,CAACF,MAAA,GAAS;IAChCH,eAAA,CAAgBM,GAAG,CAACH,MAAA,EAAQ,IAAII,GAAA;EAClC;EACA,MAAMC,WAAA,GAAcR,eAAA,CAAgBS,GAAG,CAACN,MAAA;EAExC;EACA,KAAK,MAAM,CAACO,QAAA,EAAUC,KAAA,CAAM,IAAIC,MAAA,CAAOC,OAAO,CAACT,SAAA,GAAY;IACzD,IAAI,CAACO,KAAA,IAAS,OAAOA,KAAA,KAAU,UAAU;MACvC;IACF;IAEA;IACA,IAAID,QAAA,KAAa,UAAU;MACzB,KAAK,MAAM,CAACI,SAAA,EAAWC,OAAA,CAAQ,IAAIH,MAAA,CAAOC,OAAO;MAC/C;MACAF,KAAA,GACC;QACDH,WAAA,CAAYF,GAAG,CAAC,SAASQ,SAAA,EAAW,EAAEC,OAAA;MACxC;MACA;IACF;IAEA;IACA,IAAIL,QAAA,KAAa,gBAAgB;MAC/B,KAAK,MAAM,CAACI,SAAA,EAAWC,OAAA,CAAQ,IAAIH,MAAA,CAAOC,OAAO;MAC/C;MACAF,KAAA,GACC;QACDH,WAAA,CAAYF,GAAG,CAAC,eAAeQ,SAAA,EAAW,EAAEC,OAAA;MAC9C;MACA;IACF;IAEA;IACA;IACAP,WAAA,CAAYF,GAAG,CAACI,QAAA,EAAUC,KAAA;EAC5B;AACF;AAEA;;;AAGA,OAAO,SAASK,qBAAqBb,MAAqB;EACxDH,eAAA,CAAgBiB,MAAM,CAACd,MAAA;AACzB;AAEA;;;AAGA,SAASe,kBACPf,MAAqB,EACrBO,QAAgB;AAChB;AACAS,IAA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AAA,GAAW;UACrCU,iBAAA,CAAkB;YAAED,IAAA;YAAMT;UAAS;QACrC;MACF;IACF;EACF;EAEA,OAAO0C,KAAA;AACT;AAEA,OAAO,SAASC,+BAA+B;EAC7CD;AAAK,CAGN;EACC,OAAOA,KAAA,CAAMS,GAAG,CAAE1C,IAAA;IAChB,IAAI,UAAUA,IAAA,EAAM;MAClB,OAAOA,IAAA,CAAKA,IAAI;IAClB;IACA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","editorNodeViews","WeakMap","registerEditorNodeViews","editor","nodeViews","has","set","Map","editorViews","get","nodeType","value","Object","entries","blockType","viewDef","clearEditorNodeViews","delete","getEditorNodeView","node","applyNodeOverride","getType","NodeClass","prototype","_originalDecorate","decorate","_originalCreateDOM","createDOM","_decorateOverridden","hasCreateDOM","config","Component","isEditor","isJSXConverter","html","htmlContent","createElement","dangerouslySetInnerHTML","__html","Fragment","blockViewDef","Block","Label","originalDecorate","call","_createDOMOverridden","tempDiv","document","innerHTML","firstElementChild","getEnabledNodes","editorConfig","nodes","getEnabledNodesFromServerNodes","features","nodeTypesToOverride","Set","key","keys","length","add","map"],"sources":["../../../src/lexical/nodes/index.ts"],"sourcesContent":["import type {\n EditorConfig,\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n} from 'lexical'\n\nimport React from 'react'\n\nimport type { BlockDecorateFunction } from '../../features/blocks/client/nodes/BlocksNode.js'\nimport type { InlineBlockDecorateFunction } from '../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { NodeWithHooks } from '../../features/typesServer.js'\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapInlineBlockValue,\n NodeMapValue,\n} from '../../types/index.js'\nimport type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js'\n\n// Store view definitions for each editor and node type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst editorNodeViews = new WeakMap<LexicalEditor, Map<string, NodeMapValue<any>>>()\n\n/**\n * Register view definitions for an editor\n */\nexport function registerEditorNodeViews(\n editor: LexicalEditor,\n nodeViews: LexicalEditorNodeMap,\n): void {\n if (!editorNodeViews.has(editor)) {\n editorNodeViews.set(editor, new Map())\n }\n const editorViews = editorNodeViews.get(editor)!\n\n // Register each node type's view\n for (const [nodeType, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle blocks specially - store each block type with key 'block:blockType'\n if (nodeType === 'blocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`block:${blockType}`, viewDef)\n }\n continue\n }\n\n // Handle inlineBlocks specially - store each block type with key 'inlineBlock:blockType'\n if (nodeType === 'inlineBlocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`inlineBlock:${blockType}`, viewDef)\n }\n continue\n }\n\n // Regular node types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n editorViews.set(nodeType, value as NodeMapValue<any>)\n }\n}\n\n/**\n * Clear all view overrides for an editor (restores default rendering)\n */\nexport function clearEditorNodeViews(editor: LexicalEditor): void {\n editorNodeViews.delete(editor)\n}\n\n/**\n * Get the view definition for a specific editor and node\n */\nfunction getEditorNodeView(\n editor: LexicalEditor,\n nodeType: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node?: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): NodeMapValue<any> | undefined {\n const editorViews = editorNodeViews.get(editor)\n\n // For block nodes, look up by blockType\n if (nodeType === 'block' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`block:${blockType}`)\n }\n\n // For inlineBlock nodes, look up by blockType\n if (nodeType === 'inlineBlock' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`inlineBlock:${blockType}`)\n }\n\n // Regular node types\n return editorViews?.get(nodeType)\n}\n\n/**\n * Apply view overrides to a specific node type by modifying its prototype\n * Uses WeakMap to check per-editor at runtime\n */\nfunction applyNodeOverride({\n node,\n nodeType,\n}: {\n node: Klass<LexicalNode>\n nodeType: string\n}): void {\n if (!('getType' in node) || node.getType() !== nodeType) {\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const NodeClass = node as any\n\n // Store original methods if not already stored\n if (!NodeClass.prototype._originalDecorate) {\n NodeClass.prototype._originalDecorate = NodeClass.prototype.decorate\n }\n if (!NodeClass.prototype._originalCreateDOM) {\n NodeClass.prototype._originalCreateDOM = NodeClass.prototype.createDOM\n }\n\n // Override decorate method (for DecoratorNodes)\n if (NodeClass.prototype.decorate && !NodeClass.prototype._decorateOverridden) {\n NodeClass.prototype._decorateOverridden = true\n const hasCreateDOM = !!NodeClass.prototype.createDOM\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n NodeClass.prototype.decorate = function (editor: LexicalEditor, config: EditorConfig): any {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // Priority 1: If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component({\n config,\n editor,\n isEditor: true,\n isJSXConverter: false,\n node: this,\n })\n }\n\n // Priority 2: If custom createDOM is provided, use html in decorate\n if (viewDef.createDOM && viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n return React.createElement('span', {\n dangerouslySetInnerHTML: { __html: htmlContent },\n })\n }\n\n // Priority 3: If only html is provided (no custom createDOM),\n // createDOM will handle it, so decorate returns empty fragment\n if (viewDef.html && hasCreateDOM && !viewDef.createDOM) {\n return React.createElement(React.Fragment)\n }\n\n if (nodeType === 'block') {\n const blockViewDef: NodeMapBlockValue = viewDef as NodeMapBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: BlockDecorateFunction = NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n } else if (nodeType === 'inlineBlock') {\n const blockViewDef: NodeMapInlineBlockValue = viewDef as NodeMapInlineBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n }\n }\n\n const originalDecorate: BlockDecorateFunction | InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Otherwise use original\n return originalDecorate.call(this, editor, config)\n }\n }\n\n // Override createDOM method (for ElementNodes)\n if (NodeClass.prototype.createDOM && !NodeClass.prototype._createDOMOverridden) {\n NodeClass.prototype._createDOMOverridden = true\n NodeClass.prototype.createDOM = function (\n config: EditorConfig,\n editor: LexicalEditor,\n ): HTMLElement {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // If createDOM is provided, use it\n if (viewDef.createDOM) {\n return viewDef.createDOM({ config, editor, node: this })\n }\n\n // If html is provided (as a function or string), create element from it\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n const tempDiv = document.createElement('div')\n tempDiv.innerHTML = htmlContent\n return (tempDiv.firstElementChild as HTMLElement) || tempDiv\n }\n }\n\n // Otherwise use original\n return NodeClass.prototype._originalCreateDOM.call(this, config, editor)\n }\n }\n}\n\nexport function getEnabledNodes({\n editorConfig,\n nodeViews,\n}: {\n editorConfig: SanitizedClientEditorConfig | SanitizedServerEditorConfig\n nodeViews?: LexicalEditorNodeMap\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n const nodes = getEnabledNodesFromServerNodes({\n nodes: editorConfig.features.nodes,\n })\n\n if (nodeViews) {\n // Apply node overrides by modifying prototypes (once globally)\n // The overrides check per-editor at runtime using WeakMap\n const nodeTypesToOverride = new Set<string>()\n\n for (const [key, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // If 'blocks' key exists with content, we need to override 'block' nodes\n if (key === 'blocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('block')\n }\n // If 'inlineBlocks' key exists with content, we need to override 'inlineBlock' nodes\n else if (key === 'inlineBlocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('inlineBlock')\n }\n // Regular node types\n else {\n nodeTypesToOverride.add(key)\n }\n }\n\n for (const node of nodes) {\n if ('getType' in node) {\n const nodeType = node.getType()\n\n if (nodeTypesToOverride.has(nodeType)) {\n applyNodeOverride({ node, nodeType })\n }\n }\n }\n }\n\n return nodes\n}\n\nexport function getEnabledNodesFromServerNodes({\n nodes,\n}: {\n nodes: Array<Klass<LexicalNode> | LexicalNodeReplacement> | Array<NodeWithHooks>\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n return nodes.map((node) => {\n if ('node' in node) {\n return node.node\n }\n return node\n })\n}\n"],"mappings":"AAQA,OAAOA,KAAA,MAAW;AAalB;AACA;AACA,MAAMC,eAAA,GAAkB,IAAIC,OAAA;AAE5B;;;AAGA,OAAO,SAASC,wBACdC,MAAqB,EACrBC,SAA+B;EAE/B,IAAI,CAACJ,eAAA,CAAgBK,GAAG,CAACF,MAAA,GAAS;IAChCH,eAAA,CAAgBM,GAAG,CAACH,MAAA,EAAQ,IAAII,GAAA;EAClC;EACA,MAAMC,WAAA,GAAcR,eAAA,CAAgBS,GAAG,CAACN,MAAA;EAExC;EACA,KAAK,MAAM,CAACO,QAAA,EAAUC,KAAA,CAAM,IAAIC,MAAA,CAAOC,OAAO,CAACT,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IhD,SAAA,EAAW;IACb;IACA;IACA,MAAMmD,mBAAA,GAAsB,IAAIC,GAAA;IAEhC,KAAK,MAAM,CAACC,GAAA,EAAK9C,KAAA,CAAM,IAAIC,MAAA,CAAOC,OAAO,CAACT,SAAA,GAAY;MACpD,IAAI,CAACO,KAAA,IAAS,OAAOA,KAAA,KAAU,UAAU;QACvC;MACF;MAEA;MACA,IAAI8C,GAAA,KAAQ,YAAY7C,MAAA,CAAO8C,IAAI,CAAC/C,KAAA,EAAOgD,MAAM,GAAG,GAAG;QACrDJ,mBAAA,CAAoBK,GAAG,CAAC;MAC1B,OAEK,IAAIH,GAAA,KAAQ,kBAAkB7C,MAAA,CAAO8C,IAAI,CAAC/C,KAAA,EAAOgD,MAAM,GAAG,GAAG;QAChEJ,mBAAA,CAAoBK,GAAG,CAAC;MAC1B,OAEK;QACHL,mBAAA,CAAoBK,GAAG,CAACH,GAAA;MAC1B;IACF;IAEA,KAAK,MAAMtC,IAAA,IAAQiC,KAAA,EAAO;MACxB,IAAI,aAAajC,IAAA,EAAM;QACrB,MAAMT,QAAA,GAAWS,IAAA,CAAKE,OAAO;QAE7B,IAAIkC,mBAAA,CAAoBlD,GAAG,CAACK,QAAA,GAAW;UACrCU,iBAAA,CAAkB;YAAED,IAAA;YAAMT;UAAS;QACrC;MACF;IACF;EACF;EAEA,OAAO0C,KAAA;AACT;AAEA,OAAO,SAASC,+BAA+B;EAC7CD;AAAK,CAGN;EACC,OAAOA,KAAA,CAAMS,GAAG,CAAE1C,IAAA;IAChB,IAAI,UAAUA,IAAA,EAAM;MAClB,OAAOA,IAAA,CAAKA,IAAI;IAClB;IACA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
@@ -2,7 +2,7 @@ import type { I18nClient } from '@payloadcms/translations';
2
2
  import type { LexicalEditor, Spread } from 'lexical';
3
3
  import type React from 'react';
4
4
  import type { RefObject } from 'react';
5
- import type { FeatureClientSchemaMap } from '../../../../types.js';
5
+ import type { FeatureClientSchemaMap } from '../../../../types/index.js';
6
6
  export type SlashMenuItem = {
7
7
  /** The icon which is rendered in your slash menu item. */
8
8
  Icon: React.FC;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAElE,MAAM,MAAM,aAAa,GAAG;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,KAAK,CAAC,EAAE,CAAA;IACd,8JAA8J;IAC9J,GAAG,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACxB,iHAAiH;IACjH,KAAK,CAAC,EACF,CAAC,CAAC,IAAI,EAAE;QACN,sBAAsB,EAAE,sBAAsB,CAAA;QAC9C,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC5B,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;IACV,uEAAuE;IACvE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAC5F,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX,sHA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AU,EAAE,MAAM,CAAA;KACnB,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;IACV,uEAAuE;IACvE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAC5F,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX,sHAAsH;IACtH,KAAK,CAAC,EACF,CAAC,CAAC,IAAI,EAAE;QACN,sBAAsB,EAAE,sBAAsB,CAAA;QAC9C,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC5B,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;CACzC,GAAG,aAAa,CAAA;AAEjB,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC;IACE,KAAK,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAA;CACpC,EACD,cAAc,CACf,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { LexicalEditor, Spread } from 'lexical'\nimport type React from 'react'\nimport type { RefObject } from 'react'\n\nimport type { FeatureClientSchemaMap } from '../../../../types.js'\n\nexport type SlashMenuItem = {\n /** The icon which is rendered in your slash menu item. */\n Icon: React.FC\n /** Each slash menu item needs to have a unique key. The key will be matched when typing, displayed if no `label` property is set, and used for classNames. */\n key: string\n /**\n * Keywords are used to match the item for different texts typed after the '/'.\n * E.g. you might want to show a horizontal rule item if you type both /hr, /separator, /horizontal etc.\n * In addition to the keywords, the label and key will be used to find the right slash menu item.\n */\n keywords?: Array<string>\n /** The label will be displayed in your slash menu item. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n /** A function which is called when the slash menu item is selected. */\n onSelect: ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => void\n}\n\nexport type SlashMenuGroup = {\n /**\n * An array of `SlashMenuItem`'s which will be displayed in the slash menu.\n */\n items: Array<SlashMenuItem>\n /**\n * Used for class names and, if label is not provided, for display. Slash menus with the same key will have their items merged together.\n */\n key: string\n /** The label will be displayed before your Slash Menu group. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n}\n\nexport type SlashMenuItemInternal = {\n ref: RefObject<HTMLButtonElement | null>\n} & SlashMenuItem\n\nexport type SlashMenuGroupInternal = Spread<\n {\n items: Array<SlashMenuItemInternal>\n },\n SlashMenuGroup\n>\n"],"mappings":"AAqDA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { LexicalEditor, Spread } from 'lexical'\nimport type React from 'react'\nimport type { RefObject } from 'react'\n\nimport type { FeatureClientSchemaMap } from '../../../../types/index.js'\n\nexport type SlashMenuItem = {\n /** The icon which is rendered in your slash menu item. */\n Icon: React.FC\n /** Each slash menu item needs to have a unique key. The key will be matched when typing, displayed if no `label` property is set, and used for classNames. */\n key: string\n /**\n * Keywords are used to match the item for different texts typed after the '/'.\n * E.g. you might want to show a horizontal rule item if you type both /hr, /separator, /horizontal etc.\n * In addition to the keywords, the label and key will be used to find the right slash menu item.\n */\n keywords?: Array<string>\n /** The label will be displayed in your slash menu item. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n /** A function which is called when the slash menu item is selected. */\n onSelect: ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => void\n}\n\nexport type SlashMenuGroup = {\n /**\n * An array of `SlashMenuItem`'s which will be displayed in the slash menu.\n */\n items: Array<SlashMenuItem>\n /**\n * Used for class names and, if label is not provided, for display. Slash menus with the same key will have their items merged together.\n */\n key: string\n /** The label will be displayed before your Slash Menu group. In order to make use of i18n, this can be a function. */\n label?:\n | ((args: {\n featureClientSchemaMap: FeatureClientSchemaMap\n i18n: I18nClient<{}, string>\n schemaPath: string\n }) => string)\n | string\n}\n\nexport type SlashMenuItemInternal = {\n ref: RefObject<HTMLButtonElement | null>\n} & SlashMenuItem\n\nexport type SlashMenuGroupInternal = Spread<\n {\n items: Array<SlashMenuItemInternal>\n },\n SlashMenuGroup\n>\n"],"mappings":"AAqDA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,aAE/C,SAAS,EAAE,UAUtC"}
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,IAExD,GAAG,MAAM,SAAS,EAAE,UAUtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"calculateDistanceFromScrollerElem.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,iCAAiC,iBAC9B,WAAW,GAAG,IAAI,SACzB,MAAM,SACN,MAAM,UACL,WAAW,qBACD,MAAM,mBACR,MAAM,KACrB,MAwBF,CAAA"}
1
+ {"version":3,"file":"calculateDistanceFromScrollerElem.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAC5C,cAAc,WAAW,GAAG,IAAI,EAChC,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,WAAW,EACnB,mBAAkB,MAAW,EAC7B,iBAAgB,MAAW,KAC1B,MAwBF,CAAA"}
@@ -6,7 +6,7 @@
6
6
  --lexical-h1-font-size: 2rem; /* 32px */
7
7
  --lexical-h1-letter-spacing: -0.544px;
8
8
  --lexical-h2-font-size: 1.5rem; /* 24px */
9
- --lexical-h2-letter-spacing: -0.408px;
9
+ --lexical-h2-letter-spacing: var(--text-heading-large-letter-spacing);
10
10
  --lexical-h2-line-height: 2rem; /* 32px */
11
11
  --lexical-h3-font-size: 1.25rem; /* 20px */
12
12
  --lexical-h3-letter-spacing: -0.34px;
@@ -286,8 +286,8 @@
286
286
  .LexicalEditorTheme__listItemChecked,
287
287
  .LexicalEditorTheme__listItemUnchecked {
288
288
  position: relative;
289
- padding-right: var(--spacer-4);
290
- margin-right: var(--spacer-3);
289
+ padding-left: var(--spacer-4);
290
+ margin-left: var(--spacer-3);
291
291
  list-style-type: none;
292
292
  outline: none;
293
293
  }
@@ -331,7 +331,7 @@
331
331
  }
332
332
 
333
333
  .LexicalEditorTheme__listItemUnchecked:before {
334
- border: 1px solid var(--color-text);
334
+ border: var(--stroke-width-small) solid var(--color-text);
335
335
  background-color: var(--color-bg);
336
336
  }
337
337
 
@@ -1 +1 @@
1
- {"version":3,"file":"createBlockNode.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAA;AAErG,eAAO,MAAM,eAAe,eACd,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,WAAW,KAChD,kBAAkB,CAAC,SAAS,CAS9B,CAAA"}
1
+ {"version":3,"file":"createBlockNode.d.ts","sourceRoot":"","sources":["../../../../src/lexical/utils/markdown/createBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAA;AAErG,eAAO,MAAM,eAAe,GAC1B,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,WAAW,KAChD,kBAAkB,CAAC,SAAS,CAS9B,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { SerializedEditorState } from 'lexical';
2
2
  import type { RichTextAdapter } from 'payload';
3
3
  import type { PopulationPromise } from '../features/typesServer.js';
4
- import type { AdapterProps } from '../types.js';
4
+ import type { AdapterProps } from '../types/index.js';
5
5
  export type Args = {
6
6
  editorPopulationPromises: Map<string, Array<PopulationPromise>>;
7
7
  parentIsLocalized: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"populateLexicalPopulationPromises.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,MAAM,MAAM,IAAI,GAAG;IACjB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC/D,iBAAiB,EAAE,OAAO,CAAA;CAC3B,GAAG,UAAU,CACZ,WAAW,CAAC,eAAe,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAC/F,CAAC,CAAC,CAAC,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,iCAAiC,iNAgB3C,IAAI,SAoCN,CAAA"}
1
+ {"version":3,"file":"populateLexicalPopulationPromises.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,MAAM,MAAM,IAAI,GAAG;IACjB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC/D,iBAAiB,EAAE,OAAO,CAAA;CAC3B,GAAG,UAAU,CACZ,WAAW,CAAC,eAAe,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAC/F,CAAC,CAAC,CAAC,CAAA;AAEJ;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAAI,8MAgB/C,IAAI,SAoCN,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"populateLexicalPopulationPromises.js","names":["recurseNodes","populateLexicalPopulationPromises","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","overrideAccess","parentIsLocalized","populationPromises","req","showHiddenFields","siblingDoc","shouldPopulate","callback","node","editorPopulationPromisesOfNodeType","get","type","promise","nodes","name","root","children"],"sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextAdapter } from 'payload'\n\nimport type { PopulationPromise } from '../features/typesServer.js'\nimport type { AdapterProps } from '../types.js'\n\nimport { recurseNodes } from '../utilities/forEachNodeRecursively.js'\n\nexport type Args = {\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n parentIsLocalized: boolean\n} & Parameters<\n NonNullable<RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']>\n>[0]\n\n/**\n * Appends all new populationPromises to the populationPromises prop\n */\nexport const populateLexicalPopulationPromises = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: Args) => {\n const shouldPopulate = depth && currentDepth! <= depth\n\n if (!shouldPopulate) {\n return\n }\n\n recurseNodes({\n callback: (node) => {\n const editorPopulationPromisesOfNodeType = editorPopulationPromises?.get(node.type)\n if (editorPopulationPromisesOfNodeType) {\n for (const promise of editorPopulationPromisesOfNodeType) {\n promise({\n context,\n currentDepth: currentDepth!,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess: overrideAccess!,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n }\n },\n\n nodes: (siblingDoc[field?.name] as SerializedEditorState)?.root?.children ?? [],\n })\n}\n"],"mappings":"AAMA,SAASA,YAAY,QAAQ;AAS7B;;;AAGA,OAAO,MAAMC,iCAAA,GAAoCA,CAAC;EAChDC,OAAO;EACPC,YAAY;EACZC,KAAK;EACLC,KAAK;EACLC,wBAAwB;EACxBC,KAAK;EACLC,aAAa;EACbC,QAAQ;EACRC,cAAc;EACdC,cAAc;EACdC,iBAAiB;EACjBC,kBAAkB;EAClBC,GAAG;EACHC,gBAAgB;EAChBC;AAAU,CACL;EACL,MAAMC,cAAA,GAAiBb,KAAA,IAASD,YAAA,IAAiBC,KAAA;EAEjD,IAAI,CAACa,cAAA,EAAgB;IACnB;EACF;EAEAjB,YAAA,CAAa;IACXkB,QAAA,EAAWC,IAAA;MACT,MAAMC,kCAAA,GAAqCd,wBAAA,EAA0Be,GAAA,CAAIF,IAAA,CAAKG,IAAI;MAClF,IAAIF,kCAAA,EAAoC;QACtC,KAAK,MAAMG,OAAA,IAAWH,kCAAA,EAAoC;UACxDG,OAAA,CAAQ;YACNrB,OAAA;YACAC,YAAA,EAAcA,YAAA;YACdC,KAAA;YACAC,KAAA;YACAC,wBAAA;YACAC,KAAA;YACAC,aAAA;YACAC,QAAA;YACAC,cAAA;YACAS,IAAA;YACAR,cAAA,EAAgBA,cAAA;YAChBC,iBAAA;YACAC,kBAAA;YACAC,GAAA;YACAC,gBAAA;YACAC;UACF;QACF;MACF;IACF;IAEAQ,KAAA,EAAOR,UAAW,CAACT,KAAA,EAAOkB,IAAA,CAAK,EAA4BC,IAAA,EAAMC,QAAA,IAAY;EAC/E;AACF","ignoreList":[]}
1
+ {"version":3,"file":"populateLexicalPopulationPromises.js","names":["recurseNodes","populateLexicalPopulationPromises","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","overrideAccess","parentIsLocalized","populationPromises","req","showHiddenFields","siblingDoc","shouldPopulate","callback","node","editorPopulationPromisesOfNodeType","get","type","promise","nodes","name","root","children"],"sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextAdapter } from 'payload'\n\nimport type { PopulationPromise } from '../features/typesServer.js'\nimport type { AdapterProps } from '../types/index.js'\n\nimport { recurseNodes } from '../utilities/forEachNodeRecursively.js'\n\nexport type Args = {\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n parentIsLocalized: boolean\n} & Parameters<\n NonNullable<RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']>\n>[0]\n\n/**\n * Appends all new populationPromises to the populationPromises prop\n */\nexport const populateLexicalPopulationPromises = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: Args) => {\n const shouldPopulate = depth && currentDepth! <= depth\n\n if (!shouldPopulate) {\n return\n }\n\n recurseNodes({\n callback: (node) => {\n const editorPopulationPromisesOfNodeType = editorPopulationPromises?.get(node.type)\n if (editorPopulationPromisesOfNodeType) {\n for (const promise of editorPopulationPromisesOfNodeType) {\n promise({\n context,\n currentDepth: currentDepth!,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess: overrideAccess!,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n }\n },\n\n nodes: (siblingDoc[field?.name] as SerializedEditorState)?.root?.children ?? [],\n })\n}\n"],"mappings":"AAMA,SAASA,YAAY,QAAQ;AAS7B;;;AAGA,OAAO,MAAMC,iCAAA,GAAoCA,CAAC;EAChDC,OAAO;EACPC,YAAY;EACZC,KAAK;EACLC,KAAK;EACLC,wBAAwB;EACxBC,KAAK;EACLC,aAAa;EACbC,QAAQ;EACRC,cAAc;EACdC,cAAc;EACdC,iBAAiB;EACjBC,kBAAkB;EAClBC,GAAG;EACHC,gBAAgB;EAChBC;AAAU,CACL;EACL,MAAMC,cAAA,GAAiBb,KAAA,IAASD,YAAA,IAAiBC,KAAA;EAEjD,IAAI,CAACa,cAAA,EAAgB;IACnB;EACF;EAEAjB,YAAA,CAAa;IACXkB,QAAA,EAAWC,IAAA;MACT,MAAMC,kCAAA,GAAqCd,wBAAA,EAA0Be,GAAA,CAAIF,IAAA,CAAKG,IAAI;MAClF,IAAIF,kCAAA,EAAoC;QACtC,KAAK,MAAMG,OAAA,IAAWH,kCAAA,EAAoC;UACxDG,OAAA,CAAQ;YACNrB,OAAA;YACAC,YAAA,EAAcA,YAAA;YACdC,KAAA;YACAC,KAAA;YACAC,wBAAA;YACAC,KAAA;YACAC,aAAA;YACAC,QAAA;YACAC,cAAA;YACAS,IAAA;YACAR,cAAA,EAAgBA,cAAA;YAChBC,iBAAA;YACAC,kBAAA;YACAC,GAAA;YACAC,gBAAA;YACAC;UACF;QACF;MACF;IACF;IAEAQ,KAAA,EAAOR,UAAW,CAACT,KAAA,EAAOkB,IAAA,CAAK,EAA4BC,IAAA,EAAMC,QAAA,IAAY;EAC/E;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"recursivelyPopulateFieldsForGraphQL.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC/D;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACnC,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,mCAAmC,8LAgB7C,wBAAwB,KAAG,IA0B7B,CAAA"}
1
+ {"version":3,"file":"recursivelyPopulateFieldsForGraphQL.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC/D;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACnC,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,mCAAmC,GAAI,2LAgBjD,wBAAwB,KAAG,IA0B7B,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { JSONSchemaFn } from '../features/typesServer.js';
2
+ /**
3
+ * Cross-cutting Lexical types shared by every element node. Inlined into
4
+ * `payload-types.ts`. Must stay byte-for-byte in sync with the runtime twins
5
+ * in `types/nodeTypes.ts` (`LexicalElementFormat`, `LexicalElementDirection`,
6
+ * `SerializedLexicalElementBase`) — cross-module assignability depends on it.
7
+ */
8
+ export declare const CORE_LEXICAL_TYPE_STRING = "/** @internal Core Lexical types \u2014 see @payloadcms/richtext-lexical. */\nexport type LexicalElementFormat = 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';\nexport type LexicalElementDirection = ('ltr' | 'rtl') | null;\n\nexport interface SerializedLexicalElementBase<TChildren> {\n children: TChildren[];\n direction: LexicalElementDirection;\n format: LexicalElementFormat;\n indent: number;\n textFormat?: number;\n textStyle?: string;\n version: number;\n}";
9
+ export declare const textNodeJSONSchema: JSONSchemaFn;
10
+ export declare const tabNodeJSONSchema: JSONSchemaFn;
11
+ export declare const lineBreakNodeJSONSchema: JSONSchemaFn;
12
+ export declare const paragraphNodeJSONSchema: JSONSchemaFn;
13
+ export declare const rootNodeJSONSchema: JSONSchemaFn;
14
+ //# sourceMappingURL=builtInNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInNodes.d.ts","sourceRoot":"","sources":["../../src/types/builtInNodes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,6eAYnC,CAAA;AAqDF,eAAO,MAAM,kBAAkB,EAAE,YAkBhC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,YAkB/B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,YAYrC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,YAerC,CAAA;AAeD,eAAO,MAAM,kBAAkB,EAAE,YAoBhC,CAAA"}
@@ -0,0 +1,203 @@
1
+ import { withNullableJSONSchemaType } from 'payload';
2
+ /**
3
+ * Cross-cutting Lexical types shared by every element node. Inlined into
4
+ * `payload-types.ts`. Must stay byte-for-byte in sync with the runtime twins
5
+ * in `types/nodeTypes.ts` (`LexicalElementFormat`, `LexicalElementDirection`,
6
+ * `SerializedLexicalElementBase`) — cross-module assignability depends on it.
7
+ */
8
+ export const CORE_LEXICAL_TYPE_STRING = `/** @internal Core Lexical types — see @payloadcms/richtext-lexical. */
9
+ export type LexicalElementFormat = 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
10
+ export type LexicalElementDirection = ('ltr' | 'rtl') | null;
11
+
12
+ export interface SerializedLexicalElementBase<TChildren> {
13
+ children: TChildren[];
14
+ direction: LexicalElementDirection;
15
+ format: LexicalElementFormat;
16
+ indent: number;
17
+ textFormat?: number;
18
+ textStyle?: string;
19
+ version: number;
20
+ }`;
21
+ /**
22
+ * Built-in Lexical node schemas (always present regardless of feature config).
23
+ * Co-located with the TS source they reference — each `JSONSchemaFn` adds
24
+ * its helper interface(s) to `typeStringDefinitions` and returns the JSON
25
+ * schema for that node.
26
+ */ /** MUST stay byte-for-byte in sync with `LexicalTextMode` in `types/nodeTypes.ts`. */
27
+ const LEXICAL_TEXT_MODE_TS = `export type LexicalTextMode = 'normal' | 'token' | 'segmented';`;
28
+ /** MUST stay byte-for-byte in sync with `SerializedTextNode` in `types/nodeTypes.ts`. */
29
+ const SERIALIZED_TEXT_NODE_TS = `export interface SerializedTextNode {
30
+ type: 'text';
31
+ detail: number;
32
+ format: number;
33
+ mode: LexicalTextMode;
34
+ style: string;
35
+ text: string;
36
+ version: number;
37
+ }`;
38
+ /** MUST stay byte-for-byte in sync with `SerializedTabNode` in `types/nodeTypes.ts`. */
39
+ const SERIALIZED_TAB_NODE_TS = `export interface SerializedTabNode {
40
+ type: 'tab';
41
+ detail: number;
42
+ format: number;
43
+ mode: LexicalTextMode;
44
+ style: string;
45
+ text: string;
46
+ version: number;
47
+ }`;
48
+ /** MUST stay byte-for-byte in sync with `SerializedLineBreakNode` in `types/nodeTypes.ts`. */
49
+ const SERIALIZED_LINE_BREAK_NODE_TS = `export interface SerializedLineBreakNode {
50
+ type: 'linebreak';
51
+ version: number;
52
+ }`;
53
+ /** MUST stay byte-for-byte in sync with `SerializedParagraphNode` in `types/nodeTypes.ts`. */
54
+ const SERIALIZED_PARAGRAPH_NODE_TS = `export interface SerializedParagraphNode<TChildren> extends SerializedLexicalElementBase<TChildren> {
55
+ type: 'paragraph';
56
+ textFormat: number;
57
+ textStyle: string;
58
+ }`;
59
+ const textModeSchema = {
60
+ type: 'string',
61
+ enum: ['normal', 'token', 'segmented'],
62
+ tsType: 'LexicalTextMode'
63
+ };
64
+ export const textNodeJSONSchema = ({
65
+ typeStringDefinitions
66
+ }) => {
67
+ typeStringDefinitions.add(LEXICAL_TEXT_MODE_TS);
68
+ typeStringDefinitions.add(SERIALIZED_TEXT_NODE_TS);
69
+ return {
70
+ type: 'object',
71
+ additionalProperties: false,
72
+ properties: {
73
+ type: {
74
+ type: 'string',
75
+ const: 'text'
76
+ },
77
+ detail: {
78
+ type: 'integer'
79
+ },
80
+ format: {
81
+ type: 'integer'
82
+ },
83
+ mode: textModeSchema,
84
+ style: {
85
+ type: 'string'
86
+ },
87
+ text: {
88
+ type: 'string'
89
+ },
90
+ version: {
91
+ type: 'integer'
92
+ }
93
+ },
94
+ required: ['detail', 'format', 'mode', 'style', 'text', 'type', 'version'],
95
+ tsType: 'SerializedTextNode'
96
+ };
97
+ };
98
+ export const tabNodeJSONSchema = ({
99
+ typeStringDefinitions
100
+ }) => {
101
+ typeStringDefinitions.add(LEXICAL_TEXT_MODE_TS);
102
+ typeStringDefinitions.add(SERIALIZED_TAB_NODE_TS);
103
+ return {
104
+ type: 'object',
105
+ additionalProperties: false,
106
+ properties: {
107
+ type: {
108
+ type: 'string',
109
+ const: 'tab'
110
+ },
111
+ detail: {
112
+ type: 'integer'
113
+ },
114
+ format: {
115
+ type: 'integer'
116
+ },
117
+ mode: textModeSchema,
118
+ style: {
119
+ type: 'string'
120
+ },
121
+ text: {
122
+ type: 'string'
123
+ },
124
+ version: {
125
+ type: 'integer'
126
+ }
127
+ },
128
+ required: ['detail', 'format', 'mode', 'style', 'text', 'type', 'version'],
129
+ tsType: 'SerializedTabNode'
130
+ };
131
+ };
132
+ export const lineBreakNodeJSONSchema = ({
133
+ typeStringDefinitions
134
+ }) => {
135
+ typeStringDefinitions.add(SERIALIZED_LINE_BREAK_NODE_TS);
136
+ return {
137
+ type: 'object',
138
+ additionalProperties: false,
139
+ properties: {
140
+ type: {
141
+ type: 'string',
142
+ const: 'linebreak'
143
+ },
144
+ version: {
145
+ type: 'integer'
146
+ }
147
+ },
148
+ required: ['type', 'version'],
149
+ tsType: 'SerializedLineBreakNode'
150
+ };
151
+ };
152
+ export const paragraphNodeJSONSchema = ({
153
+ elementNodeSchema,
154
+ nodeUnionName,
155
+ typeStringDefinitions
156
+ }) => {
157
+ typeStringDefinitions.add(SERIALIZED_PARAGRAPH_NODE_TS);
158
+ return elementNodeSchema({
159
+ nodeType: 'paragraph',
160
+ properties: {
161
+ textFormat: {
162
+ type: 'integer'
163
+ },
164
+ textStyle: {
165
+ type: 'string'
166
+ }
167
+ },
168
+ required: ['textFormat', 'textStyle'],
169
+ tsType: `SerializedParagraphNode<${nodeUnionName}>`
170
+ });
171
+ };
172
+ /** MUST stay byte-for-byte in sync with `LexicalRichText` in `types/nodeTypes.ts`. */
173
+ const ROOT_NODE_TS = `/** Shape of a Lexical \`richText\` field. */
174
+ export interface LexicalRichText<TNode> {
175
+ root: {
176
+ children: TNode[];
177
+ direction: LexicalElementDirection;
178
+ format: LexicalElementFormat;
179
+ indent: number;
180
+ type: 'root';
181
+ version: number;
182
+ };
183
+ }`;
184
+ export const rootNodeJSONSchema = ({
185
+ elementNodeSchema,
186
+ field,
187
+ nodeUnionName,
188
+ typeStringDefinitions
189
+ }) => {
190
+ typeStringDefinitions.add(ROOT_NODE_TS);
191
+ return {
192
+ type: withNullableJSONSchemaType('object', !!field.required),
193
+ additionalProperties: false,
194
+ properties: {
195
+ root: elementNodeSchema({
196
+ nodeType: 'root'
197
+ })
198
+ },
199
+ required: ['root'],
200
+ tsType: field.required ? `LexicalRichText<${nodeUnionName}>` : `LexicalRichText<${nodeUnionName}> | null`
201
+ };
202
+ };
203
+ //# sourceMappingURL=builtInNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInNodes.js","names":["withNullableJSONSchemaType","CORE_LEXICAL_TYPE_STRING","LEXICAL_TEXT_MODE_TS","SERIALIZED_TEXT_NODE_TS","SERIALIZED_TAB_NODE_TS","SERIALIZED_LINE_BREAK_NODE_TS","SERIALIZED_PARAGRAPH_NODE_TS","textModeSchema","type","enum","tsType","textNodeJSONSchema","typeStringDefinitions","add","additionalProperties","properties","const","detail","format","mode","style","text","version","required","tabNodeJSONSchema","lineBreakNodeJSONSchema","paragraphNodeJSONSchema","elementNodeSchema","nodeUnionName","nodeType","textFormat","textStyle","ROOT_NODE_TS","rootNodeJSONSchema","field","root"],"sources":["../../src/types/builtInNodes.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\n\nimport { withNullableJSONSchemaType } from 'payload'\n\nimport type { JSONSchemaFn } from '../features/typesServer.js'\n\n/**\n * Cross-cutting Lexical types shared by every element node. Inlined into\n * `payload-types.ts`. Must stay byte-for-byte in sync with the runtime twins\n * in `types/nodeTypes.ts` (`LexicalElementFormat`, `LexicalElementDirection`,\n * `SerializedLexicalElementBase`) — cross-module assignability depends on it.\n */\nexport const CORE_LEXICAL_TYPE_STRING = `/** @internal Core Lexical types — see @payloadcms/richtext-lexical. */\nexport type LexicalElementFormat = 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';\nexport type LexicalElementDirection = ('ltr' | 'rtl') | null;\n\nexport interface SerializedLexicalElementBase<TChildren> {\n children: TChildren[];\n direction: LexicalElementDirection;\n format: LexicalElementFormat;\n indent: number;\n textFormat?: number;\n textStyle?: string;\n version: number;\n}`\n\n/**\n * Built-in Lexical node schemas (always present regardless of feature config).\n * Co-located with the TS source they reference — each `JSONSchemaFn` adds\n * its helper interface(s) to `typeStringDefinitions` and returns the JSON\n * schema for that node.\n */\n\n/** MUST stay byte-for-byte in sync with `LexicalTextMode` in `types/nodeTypes.ts`. */\nconst LEXICAL_TEXT_MODE_TS = `export type LexicalTextMode = 'normal' | 'token' | 'segmented';`\n\n/** MUST stay byte-for-byte in sync with `SerializedTextNode` in `types/nodeTypes.ts`. */\nconst SERIALIZED_TEXT_NODE_TS = `export interface SerializedTextNode {\n type: 'text';\n detail: number;\n format: number;\n mode: LexicalTextMode;\n style: string;\n text: string;\n version: number;\n}`\n\n/** MUST stay byte-for-byte in sync with `SerializedTabNode` in `types/nodeTypes.ts`. */\nconst SERIALIZED_TAB_NODE_TS = `export interface SerializedTabNode {\n type: 'tab';\n detail: number;\n format: number;\n mode: LexicalTextMode;\n style: string;\n text: string;\n version: number;\n}`\n\n/** MUST stay byte-for-byte in sync with `SerializedLineBreakNode` in `types/nodeTypes.ts`. */\nconst SERIALIZED_LINE_BREAK_NODE_TS = `export interface SerializedLineBreakNode {\n type: 'linebreak';\n version: number;\n}`\n\n/** MUST stay byte-for-byte in sync with `SerializedParagraphNode` in `types/nodeTypes.ts`. */\nconst SERIALIZED_PARAGRAPH_NODE_TS = `export interface SerializedParagraphNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'paragraph';\n textFormat: number;\n textStyle: string;\n}`\n\nconst textModeSchema: JSONSchema4 = {\n type: 'string',\n enum: ['normal', 'token', 'segmented'],\n tsType: 'LexicalTextMode',\n}\n\nexport const textNodeJSONSchema: JSONSchemaFn = ({ typeStringDefinitions }) => {\n typeStringDefinitions.add(LEXICAL_TEXT_MODE_TS)\n typeStringDefinitions.add(SERIALIZED_TEXT_NODE_TS)\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'text' },\n detail: { type: 'integer' },\n format: { type: 'integer' },\n mode: textModeSchema,\n style: { type: 'string' },\n text: { type: 'string' },\n version: { type: 'integer' },\n },\n required: ['detail', 'format', 'mode', 'style', 'text', 'type', 'version'],\n tsType: 'SerializedTextNode',\n }\n}\n\nexport const tabNodeJSONSchema: JSONSchemaFn = ({ typeStringDefinitions }) => {\n typeStringDefinitions.add(LEXICAL_TEXT_MODE_TS)\n typeStringDefinitions.add(SERIALIZED_TAB_NODE_TS)\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'tab' },\n detail: { type: 'integer' },\n format: { type: 'integer' },\n mode: textModeSchema,\n style: { type: 'string' },\n text: { type: 'string' },\n version: { type: 'integer' },\n },\n required: ['detail', 'format', 'mode', 'style', 'text', 'type', 'version'],\n tsType: 'SerializedTabNode',\n }\n}\n\nexport const lineBreakNodeJSONSchema: JSONSchemaFn = ({ typeStringDefinitions }) => {\n typeStringDefinitions.add(SERIALIZED_LINE_BREAK_NODE_TS)\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'linebreak' },\n version: { type: 'integer' },\n },\n required: ['type', 'version'],\n tsType: 'SerializedLineBreakNode',\n }\n}\n\nexport const paragraphNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(SERIALIZED_PARAGRAPH_NODE_TS)\n return elementNodeSchema({\n nodeType: 'paragraph',\n properties: {\n textFormat: { type: 'integer' },\n textStyle: { type: 'string' },\n },\n required: ['textFormat', 'textStyle'],\n tsType: `SerializedParagraphNode<${nodeUnionName}>`,\n })\n}\n\n/** MUST stay byte-for-byte in sync with `LexicalRichText` in `types/nodeTypes.ts`. */\nconst ROOT_NODE_TS = `/** Shape of a Lexical \\`richText\\` field. */\nexport interface LexicalRichText<TNode> {\n root: {\n children: TNode[];\n direction: LexicalElementDirection;\n format: LexicalElementFormat;\n indent: number;\n type: 'root';\n version: number;\n };\n}`\n\nexport const rootNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n field,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(ROOT_NODE_TS)\n return {\n type: withNullableJSONSchemaType('object', !!field.required),\n additionalProperties: false,\n properties: {\n root: elementNodeSchema({\n nodeType: 'root',\n }),\n },\n required: ['root'],\n tsType: field.required\n ? `LexicalRichText<${nodeUnionName}>`\n : `LexicalRichText<${nodeUnionName}> | null`,\n }\n}\n"],"mappings":"AAEA,SAASA,0BAA0B,QAAQ;AAI3C;;;;;;AAMA,OAAO,MAAMC,wBAAA,GAA2B;;;;;;;;;;;;EAYtC;AAEF;;;;;GAAA,CAOA;AACA,MAAMC,oBAAA,GAAuB,iEAAiE;AAE9F;AACA,MAAMC,uBAAA,GAA0B;;;;;;;;EAQ9B;AAEF;AACA,MAAMC,sBAAA,GAAyB;;;;;;;;EAQ7B;AAEF;AACA,MAAMC,6BAAA,GAAgC;;;EAGpC;AAEF;AACA,MAAMC,4BAAA,GAA+B;;;;EAInC;AAEF,MAAMC,cAAA,GAA8B;EAClCC,IAAA,EAAM;EACNC,IAAA,EAAM,CAAC,UAAU,SAAS,YAAY;EACtCC,MAAA,EAAQ;AACV;AAEA,OAAO,MAAMC,kBAAA,GAAmCA,CAAC;EAAEC;AAAqB,CAAE;EACxEA,qBAAA,CAAsBC,GAAG,CAACX,oBAAA;EAC1BU,qBAAA,CAAsBC,GAAG,CAACV,uBAAA;EAC1B,OAAO;IACLK,IAAA,EAAM;IACNM,oBAAA,EAAsB;IACtBC,UAAA,EAAY;MACVP,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUQ,KAAA,EAAO;MAAO;MACtCC,MAAA,EAAQ;QAAET,IAAA,EAAM;MAAU;MAC1BU,MAAA,EAAQ;QAAEV,IAAA,EAAM;MAAU;MAC1BW,IAAA,EAAMZ,cAAA;MACNa,KAAA,EAAO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F;AAEA,OAAO,MAAMgB,uBAAA,GAAwCA,CAAC;EACpDC,iBAAiB;EACjBC,aAAa;EACbhB;AAAqB,CACtB;EACCA,qBAAA,CAAsBC,GAAG,CAACP,4BAAA;EAC1B,OAAOqB,iBAAA,CAAkB;IACvBE,QAAA,EAAU;IACVd,UAAA,EAAY;MACVe,UAAA,EAAY;QAAEtB,IAAA,EAAM;MAAU;MAC9BuB,SAAA,EAAW;QAAEvB,IAAA,EAAM;MAAS;IAC9B;IACAe,QAAA,EAAU,CAAC,cAAc,YAAY;IACrCb,MAAA,EAAQ,2BAA2BkB,aAAA;EACrC;AACF;AAEA;AACA,MAAMI,YAAA,GAAe;;;;;;;;;;EAUnB;AAEF,OAAO,MAAMC,kBAAA,GAAmCA,CAAC;EAC/CN,iBAAiB;EACjBO,KAAK;EACLN,aAAa;EACbhB;AAAqB,CACtB;EACCA,qBAAA,CAAsBC,GAAG,CAACmB,YAAA;EAC1B,OAAO;IACLxB,IAAA,EAAMR,0BAAA,CAA2B,UAAU,CAAC,CAACkC,KAAA,CAAMX,QAAQ;IAC3DT,oBAAA,EAAsB;IACtBC,UAAA,EAAY;MACVoB,IAAA,EAAMR,iBAAA,CAAkB;QACtBE,QAAA,EAAU;MACZ;IACF;IACAN,QAAA,EAAU,CAAC,OAAO;IAClBb,MAAA,EAAQwB,KAAA,CAAMX,QAAQ,GAClB,mBAAmBK,aAAA,GAAgB,GACnC,mBAAmBA,aAAA;EACzB;AACF","ignoreList":[]}
@@ -1,22 +1,21 @@
1
1
  import type { DecoratorNode, EditorConfig, LexicalEditor, EditorConfig as LexicalEditorConfig, LexicalNode, SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
2
  import type { ClientField, DefaultServerCellComponentProps, LabelFunction, PayloadComponent, RichTextAdapter, RichTextField, RichTextFieldClient, RichTextFieldClientProps, SanitizedConfig, ServerFieldBase, StaticLabel } from 'payload';
3
- import type { BlockComponentContextType } from './features/blocks/client/component/BlockContent.js';
3
+ import type { BlockComponentContextType } from '../features/blocks/client/component/BlockContent.js';
4
4
  export type { BlockComponentContextType };
5
- import type { BlockComponentProps } from './features/blocks/client/component/index.js';
6
- import type { InlineBlockComponentContextType } from './features/blocks/client/componentInline/index.js';
7
- import type { JSXConverterArgs, JSXConverters, SerializedLexicalNodeWithParent } from './features/converters/lexicalToJSX/converter/types.js';
8
- import type { BaseClientFeatureProps, FeatureProviderProviderClient } from './features/typesClient.js';
9
- import type { FeatureProviderServer } from './features/typesServer.js';
10
- import type { SanitizedServerEditorConfig } from './lexical/config/types.js';
5
+ import type { BlockComponentProps } from '../features/blocks/client/component/index.js';
6
+ import type { InlineBlockComponentContextType } from '../features/blocks/client/componentInline/index.js';
7
+ import type { JSXConverterArgs, JSXConverters, SerializedLexicalNodeWithParent } from '../features/converters/lexicalToJSX/converter/types.js';
8
+ import type { BaseClientFeatureProps, FeatureProviderProviderClient } from '../features/typesClient.js';
9
+ import type { FeatureProviderServer } from '../features/typesServer.js';
10
+ import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
11
+ import type { InitialLexicalFormState } from '../utilities/buildInitialState.js';
11
12
  import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from './nodeTypes.js';
12
- import type { InitialLexicalFormState } from './utilities/buildInitialState.js';
13
13
  /**
14
14
  * Base constraint for serialized Lexical node types.
15
15
  * Used as the generic constraint for node map types.
16
16
  * Extends the base SerializedLexicalNode with optional type for flexibility.
17
17
  */
18
18
  export type SerializedNodeBase = {
19
- [key: string]: unknown;
20
19
  type?: string;
21
20
  };
22
21
  export type LexicalFieldAdminProps = {
@@ -448,4 +447,4 @@ export type GeneratedFeatureProviderComponent = {
448
447
  clientFeatureProps: BaseClientFeatureProps<object>;
449
448
  };
450
449
  export type LexicalRichTextField = RichTextField<SerializedEditorState, AdapterProps>;
451
- //# sourceMappingURL=types.d.ts.map
450
+ //# sourceMappingURL=index.d.ts.map