@payloadcms/richtext-lexical 4.0.0-internal.1f9ae9a → 4.0.0-internal.21320b5

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 (719) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js +5 -5
  4. package/dist/cell/rscEntry.js.map +1 -1
  5. package/dist/exports/client/Field-F22V5L4V.js +2 -0
  6. package/dist/exports/client/Field-F22V5L4V.js.map +7 -0
  7. package/dist/exports/client/{RelationshipComponent-RZL743CS.js → RelationshipComponent-YCPAKOL7.js} +1 -1
  8. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/chunk-43E5QYAA.js +2 -0
  11. package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
  12. package/dist/exports/client/chunk-5VIL27GI.js +2 -0
  13. package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
  14. package/dist/exports/client/chunk-ESITTE3C.js +2 -0
  15. package/dist/exports/client/chunk-ESITTE3C.js.map +7 -0
  16. package/dist/exports/client/chunk-LN6VX25I.js +2 -0
  17. package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
  18. package/dist/exports/client/component-D5QLYS7W.js +2 -0
  19. package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
  20. package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
  21. package/dist/exports/client/index.d.ts +1 -2
  22. package/dist/exports/client/index.d.ts.map +1 -1
  23. package/dist/exports/client/index.js +27 -28
  24. package/dist/exports/client/index.js.map +4 -4
  25. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  26. package/dist/features/blockquote/client/index.js +2 -2
  27. package/dist/features/blockquote/client/index.js.map +1 -1
  28. package/dist/features/blockquote/server/index.d.ts +1 -4
  29. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  30. package/dist/features/blockquote/server/index.js +4 -2
  31. package/dist/features/blockquote/server/index.js.map +1 -1
  32. package/dist/features/blockquote/server/schema.d.ts +8 -0
  33. package/dist/features/blockquote/server/schema.d.ts.map +1 -0
  34. package/dist/features/blockquote/server/schema.js +15 -0
  35. package/dist/features/blockquote/server/schema.js.map +1 -0
  36. package/dist/features/blocks/client/component/index.css +2 -2
  37. package/dist/features/blocks/client/component/index.d.ts +2 -1
  38. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  39. package/dist/features/blocks/client/component/index.js +16 -8
  40. package/dist/features/blocks/client/component/index.js.map +1 -1
  41. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  42. package/dist/features/blocks/client/componentInline/index.css +8 -8
  43. package/dist/features/blocks/client/componentInline/index.d.ts +2 -1
  44. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  45. package/dist/features/blocks/client/componentInline/index.js +15 -7
  46. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  47. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  48. package/dist/features/blocks/client/index.d.ts.map +1 -1
  49. package/dist/features/blocks/client/index.js +4 -2
  50. package/dist/features/blocks/client/index.js.map +1 -1
  51. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  52. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  53. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  54. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  55. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  56. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  57. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  58. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  59. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  60. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  61. package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
  62. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  63. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +1 -1
  64. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  65. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  66. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +1 -1
  67. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  68. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  69. package/dist/features/blocks/client/plugin/index.d.ts +1 -1
  70. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  71. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  72. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  73. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +1 -0
  74. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  75. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +1 -1
  76. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  77. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  78. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
  79. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  80. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  81. package/dist/features/blocks/server/index.d.ts +1 -0
  82. package/dist/features/blocks/server/index.d.ts.map +1 -1
  83. package/dist/features/blocks/server/index.js +26 -74
  84. package/dist/features/blocks/server/index.js.map +1 -1
  85. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  86. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  87. package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
  88. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  89. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
  90. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  91. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  92. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
  93. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  94. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  95. package/dist/features/blocks/server/schema.d.ts +45 -0
  96. package/dist/features/blocks/server/schema.d.ts.map +1 -0
  97. package/dist/features/blocks/server/schema.js +140 -0
  98. package/dist/features/blocks/server/schema.js.map +1 -0
  99. package/dist/features/blocks/server/validate.d.ts +1 -2
  100. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  101. package/dist/features/blocks/server/validate.js.map +1 -1
  102. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  103. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  104. package/dist/features/converters/lexicalToHtml/async/types.d.ts +14 -15
  105. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  107. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  108. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  109. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +14 -15
  110. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  111. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  112. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +4 -2
  113. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  114. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -4
  115. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  116. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  117. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +12 -14
  118. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  119. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  120. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  121. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  122. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  123. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +12 -14
  124. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  125. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  126. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  127. package/dist/features/converters/markdownToLexical/index.js +5 -2
  128. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  129. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  130. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  131. package/dist/features/format/bold/feature.client.js +1 -1
  132. package/dist/features/format/bold/feature.client.js.map +1 -1
  133. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  134. package/dist/features/format/bold/feature.server.js +1 -1
  135. package/dist/features/format/bold/feature.server.js.map +1 -1
  136. package/dist/features/format/inlineCode/feature.client.js +1 -1
  137. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  138. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  139. package/dist/features/format/inlineCode/feature.server.js +1 -1
  140. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  141. package/dist/features/format/italic/feature.client.js +1 -1
  142. package/dist/features/format/italic/feature.client.js.map +1 -1
  143. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  144. package/dist/features/format/italic/feature.server.js +1 -1
  145. package/dist/features/format/italic/feature.server.js.map +1 -1
  146. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  147. package/dist/features/format/strikethrough/feature.client.js +1 -1
  148. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  149. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  150. package/dist/features/format/strikethrough/feature.server.js +1 -1
  151. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  152. package/dist/features/heading/client/index.js +2 -2
  153. package/dist/features/heading/client/index.js.map +1 -1
  154. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  155. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  156. package/dist/features/heading/markdownTransformer.js +6 -19
  157. package/dist/features/heading/markdownTransformer.js.map +1 -1
  158. package/dist/features/heading/server/index.d.ts +2 -4
  159. package/dist/features/heading/server/index.d.ts.map +1 -1
  160. package/dist/features/heading/server/index.js +4 -2
  161. package/dist/features/heading/server/index.js.map +1 -1
  162. package/dist/features/heading/server/schema.d.ts +10 -0
  163. package/dist/features/heading/server/schema.d.ts.map +1 -0
  164. package/dist/features/heading/server/schema.js +37 -0
  165. package/dist/features/heading/server/schema.js.map +1 -0
  166. package/dist/features/horizontalRule/client/index.js +2 -2
  167. package/dist/features/horizontalRule/client/index.js.map +1 -1
  168. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  169. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  170. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  171. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  172. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +2 -2
  173. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  174. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
  175. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  176. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  177. package/dist/features/horizontalRule/server/index.d.ts +1 -0
  178. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  179. package/dist/features/horizontalRule/server/index.js +4 -2
  180. package/dist/features/horizontalRule/server/index.js.map +1 -1
  181. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  182. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  183. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  184. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  185. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -6
  186. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  187. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  188. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  189. package/dist/features/horizontalRule/server/schema.d.ts +7 -0
  190. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
  191. package/dist/features/horizontalRule/server/schema.js +25 -0
  192. package/dist/features/horizontalRule/server/schema.js.map +1 -0
  193. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  194. package/dist/features/link/client/index.d.ts.map +1 -1
  195. package/dist/features/link/client/index.js +2 -2
  196. package/dist/features/link/client/index.js.map +1 -1
  197. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  198. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  199. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  200. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +3 -3
  201. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  202. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -12
  203. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
  204. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  205. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  206. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  207. package/dist/features/link/markdownTransformer.d.ts +5 -5
  208. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  209. package/dist/features/link/markdownTransformer.js +2 -2
  210. package/dist/features/link/markdownTransformer.js.map +1 -1
  211. package/dist/features/link/markdownTransformer.spec.js +10 -10
  212. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  213. package/dist/features/link/nodes/AutoLinkNode.d.ts +4 -4
  214. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  215. package/dist/features/link/nodes/AutoLinkNode.js +2 -1
  216. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  217. package/dist/features/link/nodes/LinkNode.d.ts +4 -4
  218. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  219. package/dist/features/link/nodes/LinkNode.js +2 -1
  220. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  221. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  222. package/dist/features/link/server/baseFields.js.map +1 -1
  223. package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
  224. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  225. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  226. package/dist/features/link/server/index.d.ts +2 -1
  227. package/dist/features/link/server/index.d.ts.map +1 -1
  228. package/dist/features/link/server/index.js +7 -4
  229. package/dist/features/link/server/index.js.map +1 -1
  230. package/dist/features/link/server/schema.d.ts +32 -0
  231. package/dist/features/link/server/schema.d.ts.map +1 -0
  232. package/dist/features/link/server/schema.js +171 -0
  233. package/dist/features/link/server/schema.js.map +1 -0
  234. package/dist/features/link/server/validate.d.ts +1 -1
  235. package/dist/features/link/server/validate.d.ts.map +1 -1
  236. package/dist/features/link/server/validate.js.map +1 -1
  237. package/dist/features/lists/checklist/client/index.js +1 -1
  238. package/dist/features/lists/checklist/client/index.js.map +1 -1
  239. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  240. package/dist/features/lists/checklist/server/index.js +4 -1
  241. package/dist/features/lists/checklist/server/index.js.map +1 -1
  242. package/dist/features/lists/orderedList/client/index.js +1 -1
  243. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  244. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  245. package/dist/features/lists/orderedList/server/index.js +4 -1
  246. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  247. package/dist/features/lists/plugin/index.d.ts +0 -9
  248. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  249. package/dist/features/lists/plugin/index.js.map +1 -1
  250. package/dist/features/lists/shared/schema.d.ts +18 -0
  251. package/dist/features/lists/shared/schema.d.ts.map +1 -0
  252. package/dist/features/lists/shared/schema.js +62 -0
  253. package/dist/features/lists/shared/schema.js.map +1 -0
  254. package/dist/features/lists/unorderedList/client/index.js +1 -1
  255. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  256. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  257. package/dist/features/lists/unorderedList/server/index.js +4 -1
  258. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  259. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  260. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  261. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  262. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  263. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  264. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  265. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  266. package/dist/features/relationship/client/plugins/index.d.ts +1 -1
  267. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  268. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  269. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  270. package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
  271. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  272. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
  273. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  274. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  275. package/dist/features/relationship/server/index.d.ts +1 -0
  276. package/dist/features/relationship/server/index.d.ts.map +1 -1
  277. package/dist/features/relationship/server/index.js +2 -0
  278. package/dist/features/relationship/server/index.js.map +1 -1
  279. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
  280. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  281. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  282. package/dist/features/relationship/server/schema.d.ts +28 -0
  283. package/dist/features/relationship/server/schema.d.ts.map +1 -0
  284. package/dist/features/relationship/server/schema.js +97 -0
  285. package/dist/features/relationship/server/schema.js.map +1 -0
  286. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
  287. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
  288. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
  289. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
  290. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  291. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  292. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  293. package/dist/features/table/client/index.d.ts.map +1 -0
  294. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  295. package/dist/features/table/client/index.js.map +1 -0
  296. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  297. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  298. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  299. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  300. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  301. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  302. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  303. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  304. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  305. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  306. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  307. package/dist/features/table/client/utils/debounce.js.map +1 -0
  308. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  309. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  310. package/dist/features/table/markdownTransformer.d.ts +5 -0
  311. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  312. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  313. package/dist/features/table/markdownTransformer.js.map +1 -0
  314. package/dist/features/table/server/index.d.ts +3 -0
  315. package/dist/features/table/server/index.d.ts.map +1 -0
  316. package/dist/features/{experimental_table → table}/server/index.js +10 -6
  317. package/dist/features/table/server/index.js.map +1 -0
  318. package/dist/features/table/server/schema.d.ts +27 -0
  319. package/dist/features/table/server/schema.d.ts.map +1 -0
  320. package/dist/features/table/server/schema.js +107 -0
  321. package/dist/features/table/server/schema.js.map +1 -0
  322. package/dist/features/textState/feature.client.js +1 -1
  323. package/dist/features/textState/feature.client.js.map +1 -1
  324. package/dist/features/toolbars/fixed/client/Toolbar/index.css +4 -6
  325. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  326. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  327. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +8 -14
  328. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  329. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  330. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  331. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  332. package/dist/features/typesClient.d.ts +1 -1
  333. package/dist/features/typesClient.d.ts.map +1 -1
  334. package/dist/features/typesClient.js.map +1 -1
  335. package/dist/features/typesServer.d.ts +19 -42
  336. package/dist/features/typesServer.d.ts.map +1 -1
  337. package/dist/features/typesServer.js.map +1 -1
  338. package/dist/features/upload/client/component/index.css +11 -11
  339. package/dist/features/upload/client/component/index.d.ts +1 -1
  340. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  341. package/dist/features/upload/client/component/index.js +2 -1
  342. package/dist/features/upload/client/component/index.js.map +1 -1
  343. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  344. package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
  345. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  346. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  347. package/dist/features/upload/client/plugin/index.d.ts +1 -1
  348. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  349. package/dist/features/upload/client/plugin/index.js +5 -5
  350. package/dist/features/upload/client/plugin/index.js.map +1 -1
  351. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
  352. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  353. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  354. package/dist/features/upload/server/index.d.ts +1 -0
  355. package/dist/features/upload/server/index.d.ts.map +1 -1
  356. package/dist/features/upload/server/index.js +7 -6
  357. package/dist/features/upload/server/index.js.map +1 -1
  358. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  359. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  360. package/dist/features/upload/server/markdownTransformer.js +1 -1
  361. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  362. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
  363. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  364. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  365. package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
  366. package/dist/features/upload/server/nodes/conversions.js.map +1 -1
  367. package/dist/features/upload/server/schema.d.ts +52 -0
  368. package/dist/features/upload/server/schema.d.ts.map +1 -0
  369. package/dist/features/upload/server/schema.js +149 -0
  370. package/dist/features/upload/server/schema.js.map +1 -0
  371. package/dist/features/upload/server/validate.d.ts +1 -1
  372. package/dist/features/upload/server/validate.d.ts.map +1 -1
  373. package/dist/features/upload/server/validate.js.map +1 -1
  374. package/dist/field/Diff/converters/unknown/index.css +1 -1
  375. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  376. package/dist/field/Field.d.ts.map +1 -1
  377. package/dist/field/Field.js +18 -15
  378. package/dist/field/Field.js.map +1 -1
  379. package/dist/field/ViewSelector.css +1 -1
  380. package/dist/field/bundled.css +1 -1
  381. package/dist/field/index.css +15 -15
  382. package/dist/field/index.js +1 -1
  383. package/dist/field/index.js.map +1 -1
  384. package/dist/field/rscEntry.d.ts.map +1 -1
  385. package/dist/field/rscEntry.js +2 -0
  386. package/dist/field/rscEntry.js.map +1 -1
  387. package/dist/i18n.d.ts.map +1 -1
  388. package/dist/i18n.js +68 -0
  389. package/dist/i18n.js.map +1 -1
  390. package/dist/index.d.ts +11 -8
  391. package/dist/index.d.ts.map +1 -1
  392. package/dist/index.js +7 -7
  393. package/dist/index.js.map +1 -1
  394. package/dist/lexical/LexicalEditor.css +18 -18
  395. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  396. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  397. package/dist/lexical/config/client/loader.js +5 -1
  398. package/dist/lexical/config/client/loader.js.map +1 -1
  399. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  400. package/dist/lexical/config/server/loader.d.ts +1 -1
  401. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  402. package/dist/lexical/config/server/loader.js +2 -2
  403. package/dist/lexical/config/server/loader.js.map +1 -1
  404. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  405. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  406. package/dist/lexical/config/server/sanitize.js +11 -13
  407. package/dist/lexical/config/server/sanitize.js.map +1 -1
  408. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  409. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
  410. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  411. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  412. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  413. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  414. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  415. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  416. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  417. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  418. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  419. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  420. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  421. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -20
  422. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  423. package/dist/lexical/plugins/SlashMenu/index.css +1 -6
  424. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -1
  425. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  426. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +4 -3
  427. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
  428. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  429. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  430. package/dist/lexical/theme/EditorTheme.css +18 -19
  431. package/dist/lexical/ui/ContentEditable.css +22 -17
  432. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  433. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  434. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  435. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  436. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +88 -0
  437. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +1 -0
  438. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  439. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  440. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  441. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  442. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  443. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  444. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  445. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  446. package/dist/lexical/utils/point.d.ts.map +1 -1
  447. package/dist/lexical/utils/rect.d.ts.map +1 -1
  448. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  449. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  450. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  451. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  452. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  453. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  454. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  455. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  456. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  457. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  458. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  459. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  460. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  461. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  462. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  463. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  464. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  465. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  466. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  467. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  468. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  469. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  470. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  471. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  472. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  473. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  474. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  475. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  476. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  477. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  478. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  479. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  480. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  481. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  482. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  483. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  484. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  485. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  486. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  487. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  488. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  489. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  490. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  491. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  492. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  493. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  494. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  495. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  496. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  497. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  498. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  499. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  500. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  501. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  502. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  503. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  504. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  505. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  506. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  507. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  508. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  509. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  510. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  511. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  512. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  513. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  514. package/dist/types/builtInNodes.d.ts +14 -0
  515. package/dist/types/builtInNodes.d.ts.map +1 -0
  516. package/dist/types/builtInNodes.js +203 -0
  517. package/dist/types/builtInNodes.js.map +1 -0
  518. package/dist/types/index.d.ts +17 -18
  519. package/dist/types/index.d.ts.map +1 -1
  520. package/dist/types/index.js.map +1 -1
  521. package/dist/types/jsonSchemaHelpers.d.ts +30 -0
  522. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
  523. package/dist/types/jsonSchemaHelpers.js +58 -0
  524. package/dist/types/jsonSchemaHelpers.js.map +1 -0
  525. package/dist/types/nodeTypes.d.ts +115 -61
  526. package/dist/types/nodeTypes.d.ts.map +1 -1
  527. package/dist/types/nodeTypes.js +3 -2
  528. package/dist/types/nodeTypes.js.map +1 -1
  529. package/dist/types/schema.d.ts.map +1 -1
  530. package/dist/types/schema.js +74 -65
  531. package/dist/types/schema.js.map +1 -1
  532. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  533. package/dist/utilities/applyBaseFilterToFields.js +1 -2
  534. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  535. package/dist/utilities/buildEditorState.d.ts +17 -3
  536. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  537. package/dist/utilities/buildEditorState.js +8 -0
  538. package/dist/utilities/buildEditorState.js.map +1 -1
  539. package/dist/utilities/buildInitialState.d.ts +2 -1
  540. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  541. package/dist/utilities/buildInitialState.js.map +1 -1
  542. package/dist/utilities/createServerFeature.d.ts +1 -1
  543. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  544. package/dist/utilities/createServerFeature.js +2 -2
  545. package/dist/utilities/createServerFeature.js.map +1 -1
  546. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  547. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  548. package/dist/utilities/editorConfigFactory.js +9 -9
  549. package/dist/utilities/editorConfigFactory.js.map +1 -1
  550. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  551. package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
  552. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  553. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
  554. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  555. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
  556. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  557. package/dist/utilities/fieldsDrawer/index.css +12 -0
  558. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
  559. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
  560. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
  561. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
  562. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  563. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  564. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  565. package/dist/utilities/generateImportMap.d.ts +1 -1
  566. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  567. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  568. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  569. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  570. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  571. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  572. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  573. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  574. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  575. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
  576. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  577. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  578. package/dist/validate/index.d.ts.map +1 -1
  579. package/package.json +96 -27
  580. package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
  581. package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
  582. package/dist/exports/client/RelationshipComponent-RZL743CS.js.map +0 -7
  583. package/dist/exports/client/chunk-6QWQ7JV4.js +0 -2
  584. package/dist/exports/client/chunk-6QWQ7JV4.js.map +0 -7
  585. package/dist/exports/client/chunk-FEJXFRL7.js +0 -2
  586. package/dist/exports/client/chunk-FEJXFRL7.js.map +0 -7
  587. package/dist/exports/client/chunk-INBEEENE.js +0 -2
  588. package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
  589. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  590. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  591. package/dist/exports/client/component-CVM4OESA.js +0 -2
  592. package/dist/exports/client/component-CVM4OESA.js.map +0 -7
  593. package/dist/exports/client/componentInline-JJZ2NKW2.js +0 -2
  594. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  595. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  596. package/dist/features/blockquote/markdownTransformer.js +0 -33
  597. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  598. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  599. package/dist/features/experimental_table/client/index.js.map +0 -1
  600. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  601. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  602. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  603. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  604. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  605. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  606. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  607. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  608. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  609. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  610. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  611. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  612. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  613. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  614. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  615. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  616. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  617. package/dist/features/experimental_table/server/index.d.ts +0 -8
  618. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  619. package/dist/features/experimental_table/server/index.js.map +0 -1
  620. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  621. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  622. package/dist/features/format/bold/markdownTransformers.js +0 -23
  623. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  624. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  625. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  626. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  627. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  628. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  629. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  630. package/dist/features/format/italic/markdownTransformers.js +0 -12
  631. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  632. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  633. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  634. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  635. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  636. package/dist/features/link/nodes/types.d.ts +0 -27
  637. package/dist/features/link/nodes/types.d.ts.map +0 -1
  638. package/dist/features/link/nodes/types.js +0 -2
  639. package/dist/features/link/nodes/types.js.map +0 -1
  640. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  641. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  642. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  643. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  644. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  645. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  646. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  647. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  648. package/dist/features/lists/shared/markdown.d.ts +0 -6
  649. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  650. package/dist/features/lists/shared/markdown.js +0 -57
  651. package/dist/features/lists/shared/markdown.js.map +0 -1
  652. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  653. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  654. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  655. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  656. package/dist/lexical/utils/guard.d.ts +0 -5
  657. package/dist/lexical/utils/guard.d.ts.map +0 -1
  658. package/dist/lexical/utils/guard.js +0 -9
  659. package/dist/lexical/utils/guard.js.map +0 -1
  660. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  661. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  662. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  663. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  664. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  665. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  666. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  667. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  668. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  669. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  670. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  671. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  672. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  673. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  674. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  675. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  676. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  677. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  678. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  679. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  680. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  681. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  682. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  683. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  684. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  685. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  686. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  687. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  688. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  689. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  690. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  691. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  692. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  693. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  694. package/dist/packages/@lexical/markdown/index.js +0 -39
  695. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  696. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  697. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  698. package/dist/packages/@lexical/markdown/utils.js +0 -267
  699. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  700. /package/dist/exports/client/{componentInline-JJZ2NKW2.js.map → componentInline-H24N7GUG.js.map} +0 -0
  701. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  702. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
  703. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  704. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +0 -0
  705. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  706. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  707. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +0 -0
  708. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  709. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  710. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
  711. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  712. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  713. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  714. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  715. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  716. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  717. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  718. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  719. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;KAC/D,eAAe,IA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E,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAiCD,eAAO,MAAM,0BAA0B,UAC7B,SAAS,GAAG,kBAAkB,KAAG,YA0GxC,CAAA"}
@@ -0,0 +1,149 @@
1
+ import { createHash } from 'crypto';
2
+ import { fieldsToJSONSchema, flattenAllFields } from 'payload';
3
+ import { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js';
4
+ import { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js';
5
+ /** MUST stay byte-for-byte in sync with the runtime `SerializedUploadNode` declared above. */
6
+ const SERIALIZED_UPLOAD_NODE_TS = `export type SerializedUploadNode<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {
7
+ type: 'upload';
8
+ format: LexicalElementFormat;
9
+ id: string;
10
+ version: number;
11
+ fields: TFields;
12
+ } & {
13
+ [TSlug in TSlugs]: {
14
+ relationTo: TSlug;
15
+ value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];
16
+ };
17
+ }[TSlugs];`;
18
+ /** Input variant of `SerializedUploadNode`: `value` is ID-only (you only ever write an ID). */
19
+ const SERIALIZED_UPLOAD_NODE_INPUT_TS = `export type SerializedUploadNodeInput<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {
20
+ type: 'upload';
21
+ format: LexicalElementFormat;
22
+ id: string;
23
+ version: number;
24
+ fields: TFields;
25
+ } & {
26
+ [TSlug in TSlugs]: {
27
+ relationTo: TSlug;
28
+ value: Config['collections'][TSlug]['id'];
29
+ };
30
+ }[TSlugs];`;
31
+ const hashUploadFields = schema => createHash('sha256').update(JSON.stringify(schema)).digest('hex').slice(0, 8).toUpperCase();
32
+ export const createUploadNodeJSONSchema = props => ({
33
+ collectionIDFieldTypes,
34
+ config,
35
+ i18n,
36
+ interfaceNameDefinitions,
37
+ typeStringDefinitions,
38
+ variant
39
+ }) => {
40
+ const isInput = variant === 'input';
41
+ typeStringDefinitions.add(isInput ? SERIALIZED_UPLOAD_NODE_INPUT_TS : SERIALIZED_UPLOAD_NODE_TS);
42
+ const enabledCollections = config?.collections ? filterEnabledRelationshipCollections(config.collections, {
43
+ disabledCollections: props?.disabledCollections,
44
+ enabledCollections: props?.enabledCollections,
45
+ uploads: true
46
+ }) : [];
47
+ // Configured extra fields are registered as their own interface and referenced here, so the
48
+ // generated TypeScript keeps them - the node-level `tsType` would otherwise erase `fields` to
49
+ // `{ [k: string]: unknown }`. Mirrors how LinkFeature handles custom link fields.
50
+ //
51
+ // Each collection gets its own `SerializedUploadNode<'slug', Fields>` instantiation so the
52
+ // generated union correctly pairs each `relationTo` with its own fields type. A single
53
+ // `SerializedUploadNode<'a' | 'b', AFields | BFields>` would lose that pairing.
54
+ const perCollectionTsTypes = [];
55
+ const collectionVariants = enabledCollections.map(collection => {
56
+ const slug = collection.slug;
57
+ const idType = collectionIDFieldTypes[slug] ?? 'string';
58
+ const extraFields = props?.collections?.[slug]?.fields ?? [];
59
+ const flattenedExtra = flattenAllFields({
60
+ fields: extraFields
61
+ });
62
+ const extraFieldsSchema = flattenedExtra.length > 0 && config ? fieldsToJSONSchema({
63
+ collectionIDFieldTypes,
64
+ config,
65
+ fields: flattenedExtra,
66
+ i18n,
67
+ interfaceNameDefinitions,
68
+ typeStringDefinitions,
69
+ variant
70
+ }) : {
71
+ properties: {},
72
+ required: []
73
+ };
74
+ let fieldsSchema = {
75
+ type: 'object',
76
+ additionalProperties: false,
77
+ properties: extraFieldsSchema.properties,
78
+ required: extraFieldsSchema.required
79
+ };
80
+ let fieldsTypeName;
81
+ if (flattenedExtra.length > 0) {
82
+ fieldsTypeName = `LexicalUploadFields_${hashUploadFields(fieldsSchema)}`;
83
+ interfaceNameDefinitions.set(fieldsTypeName, fieldsSchema);
84
+ fieldsSchema = {
85
+ $ref: `#/$defs/${fieldsTypeName}`
86
+ };
87
+ }
88
+ const uploadTsName = isInput ? 'SerializedUploadNodeInput' : 'SerializedUploadNode';
89
+ perCollectionTsTypes.push(fieldsTypeName ? `${uploadTsName}<'${slug}', ${fieldsTypeName}>` : `${uploadTsName}<'${slug}'>`);
90
+ return {
91
+ type: 'object',
92
+ additionalProperties: false,
93
+ properties: {
94
+ id: {
95
+ type: 'string'
96
+ },
97
+ type: {
98
+ type: 'string',
99
+ const: 'upload'
100
+ },
101
+ fields: fieldsSchema,
102
+ format: formatSchema,
103
+ relationTo: {
104
+ type: 'string',
105
+ const: slug
106
+ },
107
+ value: isInput ? {
108
+ type: idType,
109
+ description: 'The uploaded file ID.'
110
+ } : {
111
+ description: 'The uploaded file by ID (string or number). Populated to the full upload document when read at depth > 0.',
112
+ oneOf: [{
113
+ type: idType
114
+ }, {
115
+ $ref: `#/$defs/${slug}`
116
+ }]
117
+ },
118
+ version: versionSchema
119
+ },
120
+ required: ['fields', 'format', 'id', 'relationTo', 'type', 'value', 'version']
121
+ };
122
+ });
123
+ let schema;
124
+ if (collectionVariants.length === 0) {
125
+ // Fallback when no enabled upload collections.
126
+ schema = {
127
+ type: 'object',
128
+ additionalProperties: true,
129
+ properties: {
130
+ type: {
131
+ type: 'string',
132
+ const: 'upload'
133
+ },
134
+ version: versionSchema
135
+ },
136
+ required: ['type', 'version']
137
+ };
138
+ } else {
139
+ const baseSchema = collectionVariants.length === 1 ? collectionVariants[0] : {
140
+ oneOf: collectionVariants
141
+ };
142
+ schema = {
143
+ ...baseSchema,
144
+ tsType: perCollectionTsTypes.join(' | ')
145
+ };
146
+ }
147
+ return schema;
148
+ };
149
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","names":["createHash","fieldsToJSONSchema","flattenAllFields","formatSchema","versionSchema","filterEnabledRelationshipCollections","SERIALIZED_UPLOAD_NODE_TS","SERIALIZED_UPLOAD_NODE_INPUT_TS","hashUploadFields","schema","update","JSON","stringify","digest","slice","toUpperCase","createUploadNodeJSONSchema","props","collectionIDFieldTypes","config","i18n","interfaceNameDefinitions","typeStringDefinitions","variant","isInput","add","enabledCollections","collections","disabledCollections","uploads","perCollectionTsTypes","collectionVariants","map","collection","slug","idType","extraFields","fields","flattenedExtra","extraFieldsSchema","length","properties","required","fieldsSchema","type","additionalProperties","fieldsTypeName","set","$ref","uploadTsName","push","id","const","format","relationTo","value","description","oneOf","version","baseSchema","tsType","join"],"sources":["../../../../src/features/upload/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type {\n DataFromCollectionSlug,\n IDTypeForCollectionSlug,\n JsonObject,\n TypedUploadCollection,\n UploadCollectionSlug,\n} from 'payload'\n\nimport { createHash } from 'crypto'\nimport { fieldsToJSONSchema, flattenAllFields } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { UploadFeatureProps } from './index.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\nimport { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js'\n\nexport type UploadData<TFields extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TFields\n /** ID of this upload node — NOT the linked document's ID. */\n id: string\n relationTo: TCollectionSlug\n /** Either the document ID or the full populated document. */\n value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>\n }\n}[UploadCollectionSlug]\n\n/** @internal Adds a pending state to `UploadData`. */\nexport type Internal_UploadData<TFields extends JsonObject = JsonObject> = {\n pending?: {\n /** Bulk upload form ID. */\n formID: string\n /** `src` of the image DOM element. */\n src: string\n }\n} & UploadData<TFields>\n\n/**\n * More precise variant of {@link UploadData}. Replaces `UploadData` in v4.\n * @internal\n * @todo Replace UploadData with UploadDataImproved in 4.0\n */\nexport type UploadDataImproved<TFields extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TFields\n id: string\n relationTo: TCollectionSlug\n value: IDTypeForCollectionSlug<TCollectionSlug> | TypedUploadCollection[TCollectionSlug]\n }\n}[UploadCollectionSlug]\n\nexport type SerializedUploadNode<\n TSlugs extends UploadCollectionSlug = UploadCollectionSlug,\n TFields = { [k: string]: unknown },\n> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>\n }\n}[TSlugs] & {\n fields: TFields\n format: LexicalElementFormat\n id: string\n type: 'upload'\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedUploadNode` declared above. */\nconst SERIALIZED_UPLOAD_NODE_TS = `export type SerializedUploadNode<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\n/** Input variant of `SerializedUploadNode`: `value` is ID-only (you only ever write an ID). */\nconst SERIALIZED_UPLOAD_NODE_INPUT_TS = `export type SerializedUploadNodeInput<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'];\n };\n}[TSlugs];`\n\nconst hashUploadFields = (schema: JSONSchema4): string =>\n createHash('sha256').update(JSON.stringify(schema)).digest('hex').slice(0, 8).toUpperCase()\n\nexport const createUploadNodeJSONSchema =\n (props: undefined | UploadFeatureProps): JSONSchemaFn =>\n ({\n collectionIDFieldTypes,\n config,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n }) => {\n const isInput = variant === 'input'\n typeStringDefinitions.add(isInput ? SERIALIZED_UPLOAD_NODE_INPUT_TS : SERIALIZED_UPLOAD_NODE_TS)\n const enabledCollections = config?.collections\n ? filterEnabledRelationshipCollections(config.collections, {\n disabledCollections: props?.disabledCollections,\n enabledCollections: props?.enabledCollections,\n uploads: true,\n })\n : []\n\n // Configured extra fields are registered as their own interface and referenced here, so the\n // generated TypeScript keeps them - the node-level `tsType` would otherwise erase `fields` to\n // `{ [k: string]: unknown }`. Mirrors how LinkFeature handles custom link fields.\n //\n // Each collection gets its own `SerializedUploadNode<'slug', Fields>` instantiation so the\n // generated union correctly pairs each `relationTo` with its own fields type. A single\n // `SerializedUploadNode<'a' | 'b', AFields | BFields>` would lose that pairing.\n const perCollectionTsTypes: string[] = []\n const collectionVariants: JSONSchema4[] = enabledCollections.map((collection) => {\n const slug = collection.slug\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n const extraFields = props?.collections?.[slug]?.fields ?? []\n const flattenedExtra = flattenAllFields({ fields: extraFields })\n const extraFieldsSchema =\n flattenedExtra.length > 0 && config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenedExtra,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n })\n : { properties: {}, required: [] }\n\n let fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: extraFieldsSchema.properties,\n required: extraFieldsSchema.required,\n }\n let fieldsTypeName: string | undefined\n if (flattenedExtra.length > 0) {\n fieldsTypeName = `LexicalUploadFields_${hashUploadFields(fieldsSchema)}`\n interfaceNameDefinitions.set(fieldsTypeName, fieldsSchema)\n fieldsSchema = { $ref: `#/$defs/${fieldsTypeName}` }\n }\n\n const uploadTsName = isInput ? 'SerializedUploadNodeInput' : 'SerializedUploadNode'\n perCollectionTsTypes.push(\n fieldsTypeName\n ? `${uploadTsName}<'${slug}', ${fieldsTypeName}>`\n : `${uploadTsName}<'${slug}'>`,\n )\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n id: { type: 'string' },\n type: { type: 'string', const: 'upload' },\n fields: fieldsSchema,\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: isInput\n ? { type: idType, description: 'The uploaded file ID.' }\n : {\n description:\n 'The uploaded file by ID (string or number). Populated to the full upload document when read at depth > 0.',\n oneOf: [{ type: idType }, { $ref: `#/$defs/${slug}` }],\n },\n version: versionSchema,\n },\n required: ['fields', 'format', 'id', 'relationTo', 'type', 'value', 'version'],\n }\n })\n\n let schema: JSONSchema4\n if (collectionVariants.length === 0) {\n // Fallback when no enabled upload collections.\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'upload' },\n version: versionSchema,\n },\n required: ['type', 'version'],\n }\n } else {\n const baseSchema: JSONSchema4 =\n collectionVariants.length === 1 ? collectionVariants[0]! : { oneOf: collectionVariants }\n schema = { ...baseSchema, tsType: perCollectionTsTypes.join(' | ') }\n }\n\n return schema\n }\n"],"mappings":"AASA,SAASA,UAAU,QAAQ;AAC3B,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ;AAMrD,SAASC,YAAY,EAAEC,aAAa,QAAQ;AAC5C,SAASC,oCAAoC,QAAQ;AAqDrD;AACA,MAAMC,yBAAA,GAA4B;;;;;;;;;;;WAWvB;AAEX;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;;;WAW7B;AAEX,MAAMC,gBAAA,GAAoBC,MAAA,IACxBT,UAAA,CAAW,UAAUU,MAAM,CAACC,IAAA,CAAKC,SAAS,CAACH,MAAA,GAASI,MAAM,CAAC,OAAOC,KAAK,CAAC,GAAG,GAAGC,WAAW;AAE3F,OAAO,MAAMC,0BAAA,GACVC,KAAA,IACD,CAAC;EACCC,sBAAsB;EACtBC,MAAM;EACNC,IAAI;EACJC,wBAAwB;EACxBC,qBAAqB;EACrBC;AAAO,CACR;EACC,MAAMC,OAAA,GAAUD,OAAA,KAAY;EAC5BD,qBAAA,CAAsBG,GAAG,CAACD,OAAA,GAAUjB,+BAAA,GAAkCD,yBAAA;EACtE,MAAMoB,kBAAA,GAAqBP,MAAA,EAAQQ,WAAA,GAC/BtB,oCAAA,CAAqC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AEC,MAAA,EAAQ9B,oBAAA,CAAqB+B,IAAI,CAAC;IAAO;EACrE;EAEA,OAAOpD,MAAA;AACT","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { NodeValidation } from '../../typesServer.js';
2
2
  import type { UploadFeatureProps } from './index.js';
3
- import type { SerializedUploadNode } from './nodes/UploadNode.js';
3
+ import type { SerializedUploadNode } from './schema.js';
4
4
  export declare const uploadValidation: (props: UploadFeatureProps) => NodeValidation<SerializedUploadNode>;
5
5
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,GAC3B,OAAO,kBAAkB,KACxB,cAAc,CAAC,oBAAoB,CAqErC,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,gBAAgB,UACpB,kBAAkB,KACxB,cAAc,CAAC,oBAAoB,CAqErC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","isValidID","uploadValidation","props","node","validation","options","id","data","operation","preferences","req","payload","t","idType","collections","relationTo","customIDType","db","defaultIDType","nodeID","value","Object","keys","length","collection","fields","result","collectionSlug","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","errorPath","add","Array","from","join"],"sources":["../../../../src/features/upload/server/validate.ts"],"sourcesContent":["import { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\nimport { isValidID } from 'payload'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { UploadFeatureProps } from './index.js'\nimport type { SerializedUploadNode } from './nodes/UploadNode.js'\n\nexport const uploadValidation = (\n props: UploadFeatureProps,\n): NodeValidation<SerializedUploadNode> => {\n return async ({\n node,\n validation: {\n options: {\n id,\n data,\n operation,\n preferences,\n req,\n req: { payload, t },\n },\n },\n }) => {\n const idType = payload.collections[node.relationTo]?.customIDType || payload.db.defaultIDType\n // @ts-expect-error - Fix in Payload v4\n const nodeID = node?.value?.id || node?.value // for backwards-compatibility\n\n if (!isValidID(nodeID, idType)) {\n return t('validation:validUploadID')\n }\n\n if (!props?.collections) {\n return true\n }\n\n if (Object.keys(props?.collections).length === 0) {\n return true\n }\n\n const collection = props?.collections[node.relationTo]\n\n if (!collection?.fields?.length) {\n return true\n }\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug: node.relationTo,\n data: node?.fields ?? {},\n documentData: data,\n fields: collection.fields,\n fieldSchemaMap: undefined,\n initialBlockData: node?.fields ?? {},\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,SAAS,QAAQ;AAM1B,OAAO,MAAMC,gBAAA,GACX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B,WAAA,EAAa,CAAC;MACdvB,WAAA;MACAwB,eAAA,EAAiB;MACjBvB,GAAA;MACAwB,UAAA,EAAY;IACd;IAEA,MAAMC,aAAA,GAAgB,IAAIC,GAAA;IAC1B,KAAK,MAAMC,QAAA,IAAYX,MAAA,EAAQ;MAC7B,MAAMY,UAAA,GAAaZ,MAAM,CAACW,QAAA,CAAS;MACnC,IAAIC,UAAA,EAAYC,UAAA,EAAYhB,MAAA,EAAQ;QAClC,KAAK,MAAMiB,SAAA,IAAaF,UAAA,CAAWC,UAAU,EAAE;UAC7CJ,aAAA,CAAcM,GAAG,CAACD,SAAA;QACpB;MACF;IACF;IACA,MAAMD,UAAA,GAAaG,KAAA,CAAMC,IAAI,CAACR,aAAA;IAE9B,IAAII,UAAA,CAAWhB,MAAM,EAAE;MACrB,OAAO,uCAAuCgB,UAAA,CAAWK,IAAI,CAAC;IAChE;IAEA,OAAO;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","isValidID","uploadValidation","props","node","validation","options","id","data","operation","preferences","req","payload","t","idType","collections","relationTo","customIDType","db","defaultIDType","nodeID","value","Object","keys","length","collection","fields","result","collectionSlug","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","errorPath","add","Array","from","join"],"sources":["../../../../src/features/upload/server/validate.ts"],"sourcesContent":["import { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\nimport { isValidID } from 'payload'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { UploadFeatureProps } from './index.js'\nimport type { SerializedUploadNode } from './schema.js'\n\nexport const uploadValidation = (\n props: UploadFeatureProps,\n): NodeValidation<SerializedUploadNode> => {\n return async ({\n node,\n validation: {\n options: {\n id,\n data,\n operation,\n preferences,\n req,\n req: { payload, t },\n },\n },\n }) => {\n const idType = payload.collections[node.relationTo]?.customIDType || payload.db.defaultIDType\n // @ts-expect-error - Fix in Payload v4\n const nodeID = node?.value?.id || node?.value // for backwards-compatibility\n\n if (!isValidID(nodeID, idType)) {\n return t('validation:validUploadID')\n }\n\n if (!props?.collections) {\n return true\n }\n\n if (Object.keys(props?.collections).length === 0) {\n return true\n }\n\n const collection = props?.collections[node.relationTo]\n\n if (!collection?.fields?.length) {\n return true\n }\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug: node.relationTo,\n data: node?.fields ?? {},\n documentData: data,\n fields: collection.fields,\n fieldSchemaMap: undefined,\n initialBlockData: node?.fields ?? {},\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,SAAS,QAAQ;AAM1B,OAAO,MAAMC,gBAAA,GACXC,KAAA;EAEA,OAAO,OAAO;IACZC,IAAI;IACJC,UAAA,EAAY;MACVC,OAAA,EAAS;QACPC,EAAE;QACFC,IAAI;QACJC,SAAS;QACTC,WAAW;QACXC,GAAG;QACHA,GAAA,EAAK;UAAEC,OAAO;UAAEC;QAAC;MAAE;IACpB;EACF,CACF;IACC,MAAMC,MAAA,GAASF,OAAA,CAAQG,WAAW,CAACX,IAAA,CAAKY,UAAU,CAAC,EAAEC,YAAA,IAAgBL,OAAA,CAAQM,EAAE,CAACC,aAAa;IAC7F;IACA,MAAMC,MAAA,GAAShB,IAAA,EAAMiB,KAAA,EAAOd,EAAA,IAAMH,IAAA,EAAMiB,KAAA,CAAM;AAAA;IAE9C,IAAI,CAACpB,SAAA,CAAU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IAAII,UAAA,CAAWhB,MAAM,EAAE;MACrB,OAAO,uCAAuCgB,UAAA,CAAWK,IAAI,CAAC;IAChE;IAEA,OAAO;EACT;AACF","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  @layer payload-default {
2
2
  .lexical-diff .lexical-unknown-diff {
3
- box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
3
+ box-shadow: var(--elevation-100-canvas);
4
4
  max-width: fit-content;
5
5
  display: flex;
6
6
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["File","createHash","formatFilesize","React","baseClass","UploadDiffHTMLConverterAsync","i18n","req","upload","node","populate","providedCSSString","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","thumbnailSRC","thumbnailURL","url","ReactDOMServer","default","nodeFieldsHash","update","JSON","stringify","digest","filename","t","JSX","_jsx","className","_jsxs","length","src","filesize","width","height","Fragment","mimeType","html","renderToStaticMarkup"],"sources":["../../../../../src/field/Diff/converters/upload/index.tsx"],"sourcesContent":["import type { FileData, PayloadRequest, TypeWithID } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { File } from '@payloadcms/ui/rsc'\nimport { createHash } from 'crypto'\n\nimport './index.css'\n\nimport { formatFilesize } from 'payload/shared'\nimport React from 'react'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { UploadDataImproved } from '../../../../features/upload/server/nodes/UploadNode.js'\nimport type { SerializedUploadNode } from '../../../../types/nodeTypes.js'\n\nconst baseClass = 'lexical-upload-diff'\n\nexport const UploadDiffHTMLConverterAsync: (args: {\n i18n: I18nClient\n req: PayloadRequest\n}) => HTMLConvertersAsync<SerializedUploadNode> = ({ i18n, req }) => {\n return {\n upload: async ({ node, populate, providedCSSString }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || ''\n\n const thumbnailSRC: string =\n ('thumbnailURL' in uploadDoc && (uploadDoc?.thumbnailURL as string)) || uploadDoc?.url || ''\n\n const ReactDOMServer = (await import('react-dom/server')).default\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n const filename =\n uploadDoc?.filename ||\n `${i18n.t('general:untitled')} - ID: ${typeof uploadNode.value === 'object' ? uploadNode.value : uploadNode.value}`\n\n const JSX = (\n <div\n className={`${baseClass}${providedCSSString}`}\n data-enable-match=\"true\"\n data-fields-hash={`${nodeFieldsHash}`}\n data-filename={uploadDoc?.filename}\n data-lexical-upload-id={uploadNode.value}\n data-lexical-upload-relation-to={uploadNode.relationTo}\n data-src={thumbnailSRC}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC?.length ? <img alt={alt} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__info`} data-enable-match=\"false\">\n <strong>{filename}</strong>\n <div className={`${baseClass}__meta`}>\n {formatFilesize(uploadDoc?.filesize)}\n {typeof uploadDoc?.width === 'number' && typeof uploadDoc?.height === 'number' && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.width}x{uploadDoc?.height}\n </React.Fragment>\n )}\n {uploadDoc?.mimeType && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.mimeType}\n </React.Fragment>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n\n // Render to HTML\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n return html\n },\n }\n}\n"],"mappings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List":[]}
1
+ {"version":3,"file":"index.js","names":["File","createHash","formatFilesize","React","baseClass","UploadDiffHTMLConverterAsync","i18n","req","upload","node","populate","providedCSSString","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","thumbnailSRC","thumbnailURL","url","ReactDOMServer","default","nodeFieldsHash","update","JSON","stringify","digest","filename","t","JSX","_jsx","className","_jsxs","length","src","filesize","width","height","Fragment","mimeType","html","renderToStaticMarkup"],"sources":["../../../../../src/field/Diff/converters/upload/index.tsx"],"sourcesContent":["import type { FileData, PayloadRequest, TypeWithID } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { File } from '@payloadcms/ui/rsc'\nimport { createHash } from 'crypto'\n\nimport './index.css'\n\nimport { formatFilesize } from 'payload/shared'\nimport React from 'react'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { UploadDataImproved } from '../../../../features/upload/server/schema.js'\nimport type { SerializedUploadNode } from '../../../../types/nodeTypes.js'\n\nconst baseClass = 'lexical-upload-diff'\n\nexport const UploadDiffHTMLConverterAsync: (args: {\n i18n: I18nClient\n req: PayloadRequest\n}) => HTMLConvertersAsync<SerializedUploadNode> = ({ i18n, req }) => {\n return {\n upload: async ({ node, populate, providedCSSString }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || ''\n\n const thumbnailSRC: string =\n ('thumbnailURL' in uploadDoc && (uploadDoc?.thumbnailURL as string)) || uploadDoc?.url || ''\n\n const ReactDOMServer = (await import('react-dom/server')).default\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n const filename =\n uploadDoc?.filename ||\n `${i18n.t('general:untitled')} - ID: ${typeof uploadNode.value === 'object' ? uploadNode.value : uploadNode.value}`\n\n const JSX = (\n <div\n className={`${baseClass}${providedCSSString}`}\n data-enable-match=\"true\"\n data-fields-hash={`${nodeFieldsHash}`}\n data-filename={uploadDoc?.filename}\n data-lexical-upload-id={uploadNode.value}\n data-lexical-upload-relation-to={uploadNode.relationTo}\n data-src={thumbnailSRC}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC?.length ? <img alt={alt} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__info`} data-enable-match=\"false\">\n <strong>{filename}</strong>\n <div className={`${baseClass}__meta`}>\n {formatFilesize(uploadDoc?.filesize)}\n {typeof uploadDoc?.width === 'number' && typeof uploadDoc?.height === 'number' && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.width}x{uploadDoc?.height}\n </React.Fragment>\n )}\n {uploadDoc?.mimeType && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.mimeType}\n </React.Fragment>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n\n // Render to HTML\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n return html\n },\n }\n}\n"],"mappings":";AAGA,SAASA,IAAI,QAAQ;AACrB,SAASC,UAAU,QAAQ;AAE3B,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAMlB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,4BAAA,GAGqCA,CAAC;EAAEC,IAAI;EAAEC;AAAG,CAAE;EAC9D,OAAO;IACLC,MAAA,EAAQ,MAAAA,CAAO;MAAEC,IAAI;MAAEC,QAAQ;MAAEC;IAAiB,CAAE;MAClD,MAA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CAAA;AASlE,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAuM9B,CAAA;AAWD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,kCAAkC,CAAA;AACzC,OAAO,eAAe,CAAA;AACtB,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AASlE,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAyM9B,CAAA;AAWD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
@@ -161,21 +161,24 @@ const RichTextComponent = props => {
161
161
  }), /*#__PURE__*/_jsxs(ErrorBoundary, {
162
162
  fallbackRender: fallbackRender,
163
163
  onReset: () => {},
164
- children: [BeforeInput, /*#__PURE__*/_jsx(BulkUploadProvider, {
165
- drawerSlugPrefix: `lexical-${path}`,
166
- children: /*#__PURE__*/_jsx(LexicalProvider, {
167
- composerKey: pathWithEditDepth,
168
- editorConfig: editorConfig,
169
- fieldProps: props,
170
- isSmallWidthViewport: isSmallWidthViewport,
171
- onChange: handleChange,
172
- readOnly: disabled,
173
- rtl: rtl,
174
- value: value_0
175
- }, JSON.stringify({
176
- path,
177
- rerenderProviderKey
178
- }))
164
+ children: [BeforeInput, /*#__PURE__*/_jsx("div", {
165
+ className: `${baseClass}__editor-content`,
166
+ children: /*#__PURE__*/_jsx(BulkUploadProvider, {
167
+ modalSlugPrefix: `lexical-${path}`,
168
+ children: /*#__PURE__*/_jsx(LexicalProvider, {
169
+ composerKey: pathWithEditDepth,
170
+ editorConfig: editorConfig,
171
+ fieldProps: props,
172
+ isSmallWidthViewport: isSmallWidthViewport,
173
+ onChange: handleChange,
174
+ readOnly: disabled,
175
+ rtl: rtl,
176
+ value: value_0
177
+ }, JSON.stringify({
178
+ path,
179
+ rerenderProviderKey
180
+ }))
181
+ })
179
182
  }), AfterInput]
180
183
  }), /*#__PURE__*/_jsx(RenderCustomComponent, {
181
184
  CustomComponent: Description,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["BulkUploadProvider","FieldDescription","FieldError","FieldLabel","isFieldRTL","RenderCustomComponent","useConfig","useEditDepth","useEffectEvent","useField","useLocale","mergeFieldStyles","dequal","React","useCallback","useEffect","useMemo","useState","ErrorBoundary","LexicalProvider","useRunDeprioritized","useRichTextView","ViewSelector","baseClass","RichTextComponent","props","editorConfig","field","admin","className","description","readOnly","readOnlyFromAdmin","label","localized","required","path","pathFromProps","readOnlyFromTopLevelProps","schemaPath","validate","readOnlyFromProps","locale","config","localization","localizationConfig","rtl","fieldLocalized","undefined","editDepth","isControlledByParent","memoizedValidate","value","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Error1","Label","disabled","disabledFromField","initialValue","setValue","showError","potentiallyStalePath","isSmallWidthViewport","setIsSmallWidthViewport","rerenderProviderKey","setRerenderProviderKey","prevInitialValueRef","useRef","prevValueRef","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","classes","hideGutter","filter","Boolean","join","pathWithEditDepth","runDeprioritized","handleChange","editorState","updateFieldValue","newState","toJSON","current","styles","handleInitialValueChange","JSON","parse","stringify","Date","Object","is","_jsxs","view","style","_jsx","CustomComponent","Fallback","fallbackRender","onReset","drawerSlugPrefix","composerKey","fieldProps","onChange","error","role","color","message","String","RichText"],"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\nimport type { FallbackProps } from 'react-error-boundary'\n\nimport {\n BulkUploadProvider,\n FieldDescription,\n FieldError,\n FieldLabel,\n isFieldRTL,\n RenderCustomComponent,\n useConfig,\n useEditDepth,\n useEffectEvent,\n useField,\n useLocale,\n} from '@payloadcms/ui'\nimport { mergeFieldStyles } from '@payloadcms/ui/shared'\nimport { dequal } from 'dequal/lite'\nimport { type Validate } from 'payload'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\n\nimport '../lexical/theme/EditorTheme.css'\nimport './bundled.css'\nimport './index.css'\n\nimport type { LexicalRichTextFieldProps } from '../types/index.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport { useRunDeprioritized } from '../utilities/useRunDeprioritized.js'\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport { ViewSelector } from './ViewSelector.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n editorConfig,\n field,\n field: {\n admin: { className, description, readOnly: readOnlyFromAdmin } = {},\n label,\n localized,\n required,\n },\n path: pathFromProps,\n readOnly: readOnlyFromTopLevelProps,\n schemaPath,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const locale = useLocale()\n const {\n config: { localization: localizationConfig },\n } = useConfig()\n\n const rtl = isFieldRTL({\n fieldLocalized: localized,\n locale,\n localizationConfig: localizationConfig || undefined,\n })\n\n const editDepth = useEditDepth()\n const { isControlledByParent } = useRichTextView()\n\n const memoizedValidate = useCallback<Validate>(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return validate(value, { ...validationOptions, required })\n }\n return true\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled: disabledFromField,\n initialValue,\n path,\n setValue,\n showError,\n value,\n } = useField<SerializedEditorState>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || disabledFromField\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n const [rerenderProviderKey, setRerenderProviderKey] = useState<Date>()\n\n const prevInitialValueRef = React.useRef<SerializedEditorState | undefined>(initialValue)\n const prevValueRef = React.useRef<SerializedEditorState | undefined>(value)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const classes = [\n 'field-type',\n baseClass,\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport\n ? `${baseClass}--show-gutter`\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n const pathWithEditDepth = `${path}.${editDepth}`\n\n const runDeprioritized = useRunDeprioritized() // defaults to 500 ms timeout\n\n const handleChange = useCallback(\n (editorState: EditorState) => {\n // Capture `editorState` in the closure so we can safely run later.\n const updateFieldValue = () => {\n const newState = editorState.toJSON()\n prevValueRef.current = newState\n setValue(newState)\n }\n\n // Queue the update for the browser’s idle time (or Safari shim)\n // and let the hook handle debouncing/cancellation.\n void runDeprioritized(updateFieldValue)\n },\n [setValue, runDeprioritized], // `runDeprioritized` is stable (useCallback inside hook)\n )\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n const handleInitialValueChange = useEffectEvent(\n (initialValue: SerializedEditorState | undefined) => {\n // Object deep equality check here, as re-mounting the editor if\n // the new value is the same as the old one is not necessary.\n // In postgres, the order of keys in JSON objects is not guaranteed to be preserved,\n // so we need to do a deep equality check here that does not care about key order => we use dequal.\n // If we used JSON.stringify, the editor would re-mount every time you save the document, as the order of keys changes => change detected => re-mount.\n if (\n prevValueRef.current !== value &&\n !dequal(\n prevValueRef.current != null\n ? JSON.parse(JSON.stringify(prevValueRef.current))\n : prevValueRef.current,\n value,\n )\n ) {\n prevInitialValueRef.current = initialValue\n prevValueRef.current = value\n setRerenderProviderKey(new Date())\n }\n },\n )\n\n useEffect(() => {\n // Needs to trigger for object reference changes - otherwise,\n // reacting to the same initial value change twice will cause\n // the second change to be ignored, even though the value has changed.\n // That's because initialValue is not kept up-to-date\n if (!Object.is(initialValue, prevInitialValueRef.current)) {\n handleInitialValueChange(initialValue)\n }\n }, [initialValue])\n\n return (\n <div\n className={classes}\n data-field-path={path}\n data-field-schemapath={schemaPath}\n data-lexical-view={editorConfig?.view}\n key={pathWithEditDepth}\n style={styles}\n >\n <div className={`${baseClass}__label-row`}>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n {!isControlledByParent && <ViewSelector />}\n </div>\n <div className={`${baseClass}__wrap`}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n {BeforeInput}\n {/* Lexical may be in a drawer. We need to define another BulkUploadProvider to ensure that the bulk upload drawer\n is rendered in the correct depth (not displayed *behind* the current drawer).\n The `lexical-` prefix prevents drawer-slug collisions with non-lexical `BulkUploadProvider`s up the tree. */}\n <BulkUploadProvider drawerSlugPrefix={`lexical-${path}`}>\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n isSmallWidthViewport={isSmallWidthViewport}\n key={JSON.stringify({ path, rerenderProviderKey })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n rtl={rtl}\n value={value}\n />\n </BulkUploadProvider>\n {AfterInput}\n </ErrorBoundary>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }: FallbackProps) {\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error instanceof Error ? error.message : String(error)}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = RichTextComponent\n"],"mappings":"AAAA;;;AAIA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,QAAQ,EACRC,SAAS,QACJ;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,QAAQ;AAEvB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAI9B,OAAO;AACP,OAAO;AACP,OAAO;AAIP,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAElB,MAAMC,iBAAA,GAIDC,KAAA;EACH,MAAM;IACJC,YAAY;IACZC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,SAAS;QAAEC,WAAW;QAAEC,QAAA,EAAUC;MAAiB,CAAE,GAAG,CAAC,CAAC;MACnEC,KAAK;MACLC,SAAS;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ldError","FieldLabel","isFieldRTL","RenderCustomComponent","useConfig","useEditDepth","useEffectEvent","useField","useLocale","mergeFieldStyles","dequal","React","useCallback","useEffect","useMemo","useState","ErrorBoundary","LexicalProvider","useRunDeprioritized","useRichTextView","ViewSelector","baseClass","RichTextComponent","props","editorConfig","field","admin","className","description","readOnly","readOnlyFromAdmin","label","localized","required","path","pathFromProps","readOnlyFromTopLevelProps","schemaPath","validate","readOnlyFromProps","locale","config","localization","localizationConfig","rtl","fieldLocalized","undefined","editDepth","isControlledByParent","memoizedValidate","value","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Error1","Label","disabled","disabledFromField","initialValue","setValue","showError","potentiallyStalePath","isSmallWidthViewport","setIsSmallWidthViewport","rerenderProviderKey","setRerenderProviderKey","prevInitialValueRef","useRef","prevValueRef","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","classes","hideGutter","filter","Boolean","join","pathWithEditDepth","runDeprioritized","handleChange","editorState","updateFieldValue","newState","toJSON","current","styles","handleInitialValueChange","JSON","parse","stringify","Date","Object","is","_jsxs","view","style","_jsx","CustomComponent","Fallback","fallbackRender","onReset","modalSlugPrefix","composerKey","fieldProps","onChange","error","role","color","message","String","RichText"],"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\nimport type { FallbackProps } from 'react-error-boundary'\n\nimport {\n BulkUploadProvider,\n FieldDescription,\n FieldError,\n FieldLabel,\n isFieldRTL,\n RenderCustomComponent,\n useConfig,\n useEditDepth,\n useEffectEvent,\n useField,\n useLocale,\n} from '@payloadcms/ui'\nimport { mergeFieldStyles } from '@payloadcms/ui/shared'\nimport { dequal } from 'dequal/lite'\nimport { type Validate } from 'payload'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\n\nimport '../lexical/theme/EditorTheme.css'\nimport './bundled.css'\nimport './index.css'\n\nimport type { LexicalRichTextFieldProps } from '../types/index.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport { useRunDeprioritized } from '../utilities/useRunDeprioritized.js'\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport { ViewSelector } from './ViewSelector.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n editorConfig,\n field,\n field: {\n admin: { className, description, readOnly: readOnlyFromAdmin } = {},\n label,\n localized,\n required,\n },\n path: pathFromProps,\n readOnly: readOnlyFromTopLevelProps,\n schemaPath,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const locale = useLocale()\n const {\n config: { localization: localizationConfig },\n } = useConfig()\n\n const rtl = isFieldRTL({\n fieldLocalized: localized,\n locale,\n localizationConfig: localizationConfig || undefined,\n })\n\n const editDepth = useEditDepth()\n const { isControlledByParent } = useRichTextView()\n\n const memoizedValidate = useCallback<Validate>(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return validate(value, { ...validationOptions, required })\n }\n return true\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled: disabledFromField,\n initialValue,\n path,\n setValue,\n showError,\n value,\n } = useField<SerializedEditorState>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || disabledFromField\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n const [rerenderProviderKey, setRerenderProviderKey] = useState<Date>()\n\n const prevInitialValueRef = React.useRef<SerializedEditorState | undefined>(initialValue)\n const prevValueRef = React.useRef<SerializedEditorState | undefined>(value)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const classes = [\n 'field-type',\n baseClass,\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport\n ? `${baseClass}--show-gutter`\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n const pathWithEditDepth = `${path}.${editDepth}`\n\n const runDeprioritized = useRunDeprioritized() // defaults to 500 ms timeout\n\n const handleChange = useCallback(\n (editorState: EditorState) => {\n // Capture `editorState` in the closure so we can safely run later.\n const updateFieldValue = () => {\n const newState = editorState.toJSON()\n prevValueRef.current = newState\n setValue(newState)\n }\n\n // Queue the update for the browser’s idle time (or Safari shim)\n // and let the hook handle debouncing/cancellation.\n void runDeprioritized(updateFieldValue)\n },\n [setValue, runDeprioritized], // `runDeprioritized` is stable (useCallback inside hook)\n )\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n const handleInitialValueChange = useEffectEvent(\n (initialValue: SerializedEditorState | undefined) => {\n // Object deep equality check here, as re-mounting the editor if\n // the new value is the same as the old one is not necessary.\n // In postgres, the order of keys in JSON objects is not guaranteed to be preserved,\n // so we need to do a deep equality check here that does not care about key order => we use dequal.\n // If we used JSON.stringify, the editor would re-mount every time you save the document, as the order of keys changes => change detected => re-mount.\n if (\n prevValueRef.current !== value &&\n !dequal(\n prevValueRef.current != null\n ? JSON.parse(JSON.stringify(prevValueRef.current))\n : prevValueRef.current,\n value,\n )\n ) {\n prevInitialValueRef.current = initialValue\n prevValueRef.current = value\n setRerenderProviderKey(new Date())\n }\n },\n )\n\n useEffect(() => {\n // Needs to trigger for object reference changes - otherwise,\n // reacting to the same initial value change twice will cause\n // the second change to be ignored, even though the value has changed.\n // That's because initialValue is not kept up-to-date\n if (!Object.is(initialValue, prevInitialValueRef.current)) {\n handleInitialValueChange(initialValue)\n }\n }, [initialValue])\n\n return (\n <div\n className={classes}\n data-field-path={path}\n data-field-schemapath={schemaPath}\n data-lexical-view={editorConfig?.view}\n key={pathWithEditDepth}\n style={styles}\n >\n <div className={`${baseClass}__label-row`}>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n {!isControlledByParent && <ViewSelector />}\n </div>\n <div className={`${baseClass}__wrap`}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n {BeforeInput}\n <div className={`${baseClass}__editor-content`}>\n {/* Lexical may be in a drawer. We need to define another BulkUploadProvider to ensure that the bulk upload drawer\n is rendered in the correct depth (not displayed *behind* the current drawer).\n The `lexical-` prefix prevents drawer-slug collisions with non-lexical `BulkUploadProvider`s up the tree. */}\n <BulkUploadProvider modalSlugPrefix={`lexical-${path}`}>\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n isSmallWidthViewport={isSmallWidthViewport}\n key={JSON.stringify({ path, rerenderProviderKey })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n rtl={rtl}\n value={value}\n />\n </BulkUploadProvider>\n </div>\n {AfterInput}\n </ErrorBoundary>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }: FallbackProps) {\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error instanceof Error ? error.message : String(error)}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = RichTextComponent\n"],"mappings":"AAAA;;;AAIA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,QAAQ,EACRC,SAAS,QACJ;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,QAAQ;AAEvB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAI9B,OAAO;AACP,OAAO;AACP,OAAO;AAIP,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAElB,MAAMC,iBAAA,GAIDC,KAAA;EACH,MAAM;IACJC,YAAY;IACZC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,SAAS;QAAEC,WAAW;QAAEC,QAAA,EAAUC;MAAiB,CAAE,GAAG,CAAC,CAAC;MACnEC,KAAK;MACLC,SAAS;MACTC;IAAQ,CACT;IACDC,IAAA,EAAMC,aAAa;IACnBN,QAAA,EAAUO,yBAAyB;IACnCC,UAAU;IACVC;EAAQ,CACT,GAAGf,KAAA;EAEJ,MAAMgB,iBAAA,GAAoBH,yBAAA,IAA6BN,iBAAA;EAEvD,MAAMU,MAAA,GAAShC,SAAA;EACf,MAAM;IACJiC,MAAA,EAAQ;MAAEC,YAAA,EAAcC;IAAkB;EAAE,CAC7C,GAAGvC,SAAA;EAEJ,MAAMwC,GAAA,GAAM1C,UAAA,CAAW;IACrB2C,cAAA,EAAgBb,SAAA;IAChBQ,MAAA;IACAG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E,IAAA,EAAM;sBACpD,aAAAqE,IAAA,CAACtF,eAAA;cACC4F,WAAA,EAAazB,iBAAA;cACb5D,YAAA,EAAcA,YAAA;cACdsF,UAAA,EAAYvF,KAAA;cACZ0C,oBAAA,EAAsBA,oBAAA;cAEtB8C,QAAA,EAAUzB,YAAA;cACVzD,QAAA,EAAU8B,QAAA;cACVf,GAAA,EAAKA,GAAA;cACLM,KAAA,EAAOA;eAJF4C,IAAA,CAAKE,SAAS,CAAC;cAAE9D,IAAA;cAAMiC;YAAoB;;YAQrDd,UAAA;uBAEHkD,IAAA,CAACpG,qBAAA;QACCqG,eAAA,EAAiBjD,WAAA;QACjBkD,QAAA,eAAUF,IAAA,CAACxG,gBAAA;UAAiB6B,WAAA,EAAaA,WAAA;UAAaM,IAAA,EAAMA;;;;KAtC3DkD,iBAAA;AA2CX;AAEA,SAASsB,eAAe;EAAEM;AAAK,CAAiB;EAC9C,oBACEZ,KAAA,CAAC;IAAIzE,SAAA,EAAU;IAAgBsF,IAAA,EAAK;4BAClCV,IAAA,CAAC;gBAAE;qBACHA,IAAA,CAAC;MAAID,KAAA,EAAO;QAAEY,KAAA,EAAO;MAAM;gBAAIF,KAAA,YAAiBxD,KAAA,GAAQwD,KAAA,CAAMG,OAAO,GAAGC,MAAA,CAAOJ,KAAA;;;AAGrF;AAEA,OAAO,MAAMK,QAAA,GAAqC/F,iBAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  .lexical-view-selector {
2
2
  display: inline-flex;
3
- margin-left: var(--spacing-xs);
3
+ margin-inline-start: var(--spacing-xs);
4
4
  vertical-align: middle;
5
5
  }
6
6