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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (793) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-W2ABOM7M.js +2 -0
  3. package/dist/exports/client/Field-W2ABOM7M.js.map +7 -0
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/chunk-3LRZDIIG.js.map +7 -0
  6. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  7. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  9. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  10. package/dist/exports/client/component-6DQLENIE.js +2 -0
  11. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  12. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -3
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +28 -29
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  18. package/dist/features/blockquote/client/index.js +2 -2
  19. package/dist/features/blockquote/client/index.js.map +1 -1
  20. package/dist/features/blockquote/server/index.js +2 -2
  21. package/dist/features/blockquote/server/index.js.map +1 -1
  22. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  23. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  24. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  25. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  26. package/dist/features/blocks/client/component/index.css +2 -2
  27. package/dist/features/blocks/client/component/index.d.ts +0 -6
  28. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  29. package/dist/features/blocks/client/component/index.js +169 -101
  30. package/dist/features/blocks/client/component/index.js.map +1 -1
  31. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  32. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  33. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  34. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  35. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  36. package/dist/features/blocks/client/componentInline/index.css +8 -9
  37. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  38. package/dist/features/blocks/client/componentInline/index.js +30 -22
  39. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  40. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  41. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  42. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  43. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  44. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  45. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  46. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  47. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  48. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  49. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  50. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  51. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  52. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  53. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  54. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  55. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  56. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  57. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  58. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  59. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  60. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  61. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  62. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  63. package/dist/features/blocks/server/index.js +2 -2
  64. package/dist/features/blocks/server/index.js.map +1 -1
  65. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  66. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  67. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  68. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  70. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  71. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  72. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  73. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  74. package/dist/features/blocks/server/schema.d.ts +2 -0
  75. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  76. package/dist/features/blocks/server/schema.js +10 -11
  77. package/dist/features/blocks/server/schema.js.map +1 -1
  78. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  79. package/dist/features/blocks/server/validate.js +1 -1
  80. package/dist/features/blocks/server/validate.js.map +1 -1
  81. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  83. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  84. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  86. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  87. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  88. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  89. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  90. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  92. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  93. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  94. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  95. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  97. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  98. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  99. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  100. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  101. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  102. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  103. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  104. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  105. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  106. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  107. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  108. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  109. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  110. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  111. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  112. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  113. package/dist/features/converters/markdownToLexical/index.js +5 -2
  114. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  115. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  116. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  117. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  118. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  119. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  120. package/dist/features/format/bold/feature.client.js +1 -1
  121. package/dist/features/format/bold/feature.client.js.map +1 -1
  122. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  123. package/dist/features/format/bold/feature.server.js +1 -1
  124. package/dist/features/format/bold/feature.server.js.map +1 -1
  125. package/dist/features/format/inlineCode/feature.client.js +1 -1
  126. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  127. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  128. package/dist/features/format/inlineCode/feature.server.js +1 -1
  129. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  130. package/dist/features/format/italic/feature.client.js +1 -1
  131. package/dist/features/format/italic/feature.client.js.map +1 -1
  132. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  133. package/dist/features/format/italic/feature.server.js +1 -1
  134. package/dist/features/format/italic/feature.server.js.map +1 -1
  135. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  136. package/dist/features/format/strikethrough/feature.client.js +1 -1
  137. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  138. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  139. package/dist/features/format/strikethrough/feature.server.js +1 -1
  140. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  141. package/dist/features/heading/client/index.js +2 -2
  142. package/dist/features/heading/client/index.js.map +1 -1
  143. package/dist/features/heading/constants.d.ts +2 -0
  144. package/dist/features/heading/constants.d.ts.map +1 -0
  145. package/dist/features/heading/constants.js +2 -0
  146. package/dist/features/heading/constants.js.map +1 -0
  147. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  148. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  149. package/dist/features/heading/markdownTransformer.js +6 -19
  150. package/dist/features/heading/markdownTransformer.js.map +1 -1
  151. package/dist/features/heading/server/index.d.ts.map +1 -1
  152. package/dist/features/heading/server/index.js +7 -3
  153. package/dist/features/heading/server/index.js.map +1 -1
  154. package/dist/features/heading/server/schema.d.ts.map +1 -1
  155. package/dist/features/heading/server/validate.d.ts +6 -0
  156. package/dist/features/heading/server/validate.d.ts.map +1 -0
  157. package/dist/features/heading/server/validate.js +15 -0
  158. package/dist/features/heading/server/validate.js.map +1 -0
  159. package/dist/features/horizontalRule/client/index.js +2 -2
  160. package/dist/features/horizontalRule/client/index.js.map +1 -1
  161. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  162. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  163. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  164. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  165. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  166. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  167. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  168. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  169. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  170. package/dist/features/horizontalRule/server/index.js +2 -2
  171. package/dist/features/horizontalRule/server/index.js.map +1 -1
  172. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  173. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  174. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  175. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  176. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  177. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  178. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  179. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  180. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  181. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  182. package/dist/features/horizontalRule/server/schema.js +6 -5
  183. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  184. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  185. package/dist/features/indent/client/IndentPlugin.js +122 -1
  186. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  187. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  188. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  189. package/dist/features/indent/server/i18n.js +74 -37
  190. package/dist/features/indent/server/i18n.js.map +1 -1
  191. package/dist/features/link/client/index.js +2 -2
  192. package/dist/features/link/client/index.js.map +1 -1
  193. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  194. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  195. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  196. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  197. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -13
  198. package/dist/features/link/markdownTransformer.d.ts +4 -4
  199. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  200. package/dist/features/link/markdownTransformer.js +2 -2
  201. package/dist/features/link/markdownTransformer.js.map +1 -1
  202. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  203. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  204. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  205. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  206. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  207. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  208. package/dist/features/link/nodes/LinkNode.js +2 -15
  209. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  210. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  211. package/dist/features/link/server/baseFields.js.map +1 -1
  212. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  213. package/dist/features/link/server/index.js +4 -4
  214. package/dist/features/link/server/index.js.map +1 -1
  215. package/dist/features/link/server/schema.d.ts.map +1 -1
  216. package/dist/features/link/server/schema.js +4 -2
  217. package/dist/features/link/server/schema.js.map +1 -1
  218. package/dist/features/link/server/validate.d.ts.map +1 -1
  219. package/dist/features/link/server/validate.js +1 -1
  220. package/dist/features/link/server/validate.js.map +1 -1
  221. package/dist/features/lists/checklist/client/index.js +1 -1
  222. package/dist/features/lists/checklist/client/index.js.map +1 -1
  223. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  224. package/dist/features/lists/checklist/server/index.js +6 -3
  225. package/dist/features/lists/checklist/server/index.js.map +1 -1
  226. package/dist/features/lists/orderedList/client/index.js +1 -1
  227. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  228. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  229. package/dist/features/lists/orderedList/server/index.js +6 -3
  230. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  231. package/dist/features/lists/shared/constants.d.ts +2 -0
  232. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  233. package/dist/features/lists/shared/constants.js +2 -0
  234. package/dist/features/lists/shared/constants.js.map +1 -0
  235. package/dist/features/lists/shared/validate.d.ts +5 -0
  236. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  237. package/dist/features/lists/shared/validate.js +15 -0
  238. package/dist/features/lists/shared/validate.js.map +1 -0
  239. package/dist/features/lists/unorderedList/client/index.js +1 -1
  240. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  241. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  242. package/dist/features/lists/unorderedList/server/index.js +6 -3
  243. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  244. package/dist/features/relationship/client/components/index.css +3 -6
  245. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  246. package/dist/features/relationship/client/index.d.ts +2 -2
  247. package/dist/features/relationship/client/index.d.ts.map +1 -1
  248. package/dist/features/relationship/client/index.js.map +1 -1
  249. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  250. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  251. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  252. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  253. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  254. package/dist/features/relationship/client/plugins/index.js +27 -31
  255. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  256. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  257. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  258. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  259. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  260. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  261. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  262. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  263. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  264. package/dist/features/relationship/server/index.d.ts +8 -1
  265. package/dist/features/relationship/server/index.d.ts.map +1 -1
  266. package/dist/features/relationship/server/index.js +28 -11
  267. package/dist/features/relationship/server/index.js.map +1 -1
  268. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  269. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  270. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  271. package/dist/features/relationship/server/schema.d.ts +6 -5
  272. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  273. package/dist/features/relationship/server/schema.js +31 -17
  274. package/dist/features/relationship/server/schema.js.map +1 -1
  275. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  276. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  277. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  278. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  279. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  280. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  281. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  282. package/dist/features/table/client/index.d.ts.map +1 -0
  283. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  284. package/dist/features/table/client/index.js.map +1 -0
  285. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  286. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  287. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  288. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  289. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  290. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  291. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  292. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  293. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  294. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  295. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  296. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  297. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  298. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  299. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  300. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  301. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  302. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  303. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  304. package/dist/features/table/client/utils/debounce.js.map +1 -0
  305. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  306. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  307. package/dist/features/table/markdownTransformer.d.ts +5 -0
  308. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  309. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  310. package/dist/features/table/markdownTransformer.js.map +1 -0
  311. package/dist/features/table/server/index.d.ts +3 -0
  312. package/dist/features/table/server/index.d.ts.map +1 -0
  313. package/dist/features/{experimental_table → table}/server/index.js +6 -6
  314. package/dist/features/table/server/index.js.map +1 -0
  315. package/dist/features/table/server/schema.d.ts.map +1 -0
  316. package/dist/features/table/server/schema.js.map +1 -0
  317. package/dist/features/textState/feature.client.js +1 -1
  318. package/dist/features/textState/feature.client.js.map +1 -1
  319. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  320. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  321. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  322. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  323. package/dist/features/toolbars/fixed/client/Toolbar/index.css +80 -8
  324. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  325. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  326. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  327. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  328. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  329. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  330. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  331. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  332. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  333. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  334. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  335. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  336. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  337. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +23 -25
  338. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  339. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  340. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  341. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  342. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  343. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  345. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  346. package/dist/features/typesClient.d.ts +1 -1
  347. package/dist/features/typesClient.d.ts.map +1 -1
  348. package/dist/features/typesClient.js.map +1 -1
  349. package/dist/features/typesServer.d.ts +19 -14
  350. package/dist/features/typesServer.d.ts.map +1 -1
  351. package/dist/features/typesServer.js.map +1 -1
  352. package/dist/features/upload/client/component/index.css +9 -11
  353. package/dist/features/upload/client/component/index.js +2 -1
  354. package/dist/features/upload/client/component/index.js.map +1 -1
  355. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  356. package/dist/features/upload/client/index.d.ts +3 -2
  357. package/dist/features/upload/client/index.d.ts.map +1 -1
  358. package/dist/features/upload/client/index.js.map +1 -1
  359. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  360. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  361. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  362. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  363. package/dist/features/upload/client/plugin/index.js +50 -53
  364. package/dist/features/upload/client/plugin/index.js.map +1 -1
  365. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  366. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  367. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  368. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  369. package/dist/features/upload/server/index.d.ts +7 -3
  370. package/dist/features/upload/server/index.d.ts.map +1 -1
  371. package/dist/features/upload/server/index.js +22 -18
  372. package/dist/features/upload/server/index.js.map +1 -1
  373. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  374. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  375. package/dist/features/upload/server/markdownTransformer.js +1 -1
  376. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  377. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  378. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  379. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  380. package/dist/features/upload/server/schema.d.ts +6 -18
  381. package/dist/features/upload/server/schema.d.ts.map +1 -1
  382. package/dist/features/upload/server/schema.js +34 -16
  383. package/dist/features/upload/server/schema.js.map +1 -1
  384. package/dist/features/upload/server/validate.d.ts +2 -2
  385. package/dist/features/upload/server/validate.d.ts.map +1 -1
  386. package/dist/features/upload/server/validate.js +4 -1
  387. package/dist/features/upload/server/validate.js.map +1 -1
  388. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  389. package/dist/field/Diff/converters/listitem/index.js +2 -1
  390. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  391. package/dist/field/Diff/converters/relationship/index.css +0 -1
  392. package/dist/field/Diff/converters/unknown/index.css +1 -2
  393. package/dist/field/Diff/converters/upload/index.css +0 -1
  394. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  395. package/dist/field/Diff/index.css +0 -2
  396. package/dist/field/Diff/index.d.ts +3 -2
  397. package/dist/field/Diff/index.d.ts.map +1 -1
  398. package/dist/field/Diff/index.js +3 -2
  399. package/dist/field/Diff/index.js.map +1 -1
  400. package/dist/field/Field.d.ts.map +1 -1
  401. package/dist/field/Field.js +26 -16
  402. package/dist/field/Field.js.map +1 -1
  403. package/dist/field/RenderLexical/index.d.ts +3 -1
  404. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  405. package/dist/field/RenderLexical/index.js +23 -23
  406. package/dist/field/RenderLexical/index.js.map +1 -1
  407. package/dist/field/ViewSelector.css +1 -1
  408. package/dist/field/ViewSelector.d.ts.map +1 -1
  409. package/dist/field/ViewSelector.js +1 -0
  410. package/dist/field/ViewSelector.js.map +1 -1
  411. package/dist/field/bundled.css +1 -1
  412. package/dist/field/index.css +4 -5
  413. package/dist/field/rscEntry.d.ts +2 -2
  414. package/dist/field/rscEntry.d.ts.map +1 -1
  415. package/dist/field/rscEntry.js.map +1 -1
  416. package/dist/i18n.d.ts.map +1 -1
  417. package/dist/i18n.js +68 -0
  418. package/dist/i18n.js.map +1 -1
  419. package/dist/index.d.ts +6 -6
  420. package/dist/index.d.ts.map +1 -1
  421. package/dist/index.js +33 -54
  422. package/dist/index.js.map +1 -1
  423. package/dist/lexical/LexicalEditor.css +30 -19
  424. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  425. package/dist/lexical/LexicalEditor.js +62 -99
  426. package/dist/lexical/LexicalEditor.js.map +1 -1
  427. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  428. package/dist/lexical/LexicalProvider.js +7 -22
  429. package/dist/lexical/LexicalProvider.js.map +1 -1
  430. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  431. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  432. package/dist/lexical/config/server/loader.d.ts +1 -1
  433. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  434. package/dist/lexical/config/server/loader.js +2 -2
  435. package/dist/lexical/config/server/loader.js.map +1 -1
  436. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  437. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  438. package/dist/lexical/config/server/sanitize.js +2 -2
  439. package/dist/lexical/config/server/sanitize.js.map +1 -1
  440. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  441. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  442. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  443. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  444. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  445. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  446. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  447. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  448. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  449. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  450. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  451. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  452. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  453. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  454. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  455. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  456. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  457. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  458. package/dist/lexical/plugins/SlashMenu/index.css +1 -7
  459. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +2 -1
  460. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  461. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  462. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  463. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +5 -3
  464. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  465. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +17 -3
  466. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  467. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  468. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  469. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  470. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  471. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  472. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  473. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  474. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  475. package/dist/lexical/theme/EditorTheme.css +18 -21
  476. package/dist/lexical/ui/ContentEditable.css +22 -17
  477. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  478. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  479. package/dist/lexical/ui/ContentEditable.js +32 -11
  480. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  481. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  482. package/dist/lexical/ui/icons/H3/index.js +13 -6
  483. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  484. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  485. package/dist/lexical/ui/icons/H4/index.js +13 -6
  486. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  487. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  488. package/dist/lexical/ui/icons/H5/index.js +13 -6
  489. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  490. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  491. package/dist/lexical/ui/icons/H6/index.js +13 -6
  492. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  493. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  494. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  495. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  496. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  497. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  498. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  499. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  500. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  501. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  502. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  503. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  504. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  505. package/dist/lexical/utils/point.d.ts.map +1 -1
  506. package/dist/lexical/utils/rect.d.ts.map +1 -1
  507. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  508. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  509. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  510. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  511. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  512. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  513. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  514. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  515. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  516. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  517. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  518. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  519. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  520. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  521. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  522. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  523. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  524. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  525. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  526. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  527. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  528. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  529. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  530. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  531. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  532. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  533. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  534. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  535. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  536. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  537. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  538. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  539. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  540. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  541. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  542. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  543. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  544. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  545. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  546. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  547. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  548. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  549. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  550. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  551. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  552. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  553. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  554. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  555. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  556. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  557. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  558. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  559. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  560. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  561. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  562. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  563. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  564. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  565. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  566. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  567. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  568. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  569. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  570. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  571. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  572. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  573. package/dist/presets/llmInstructions.d.ts +2 -0
  574. package/dist/presets/llmInstructions.d.ts.map +1 -0
  575. package/dist/presets/llmInstructions.js +13 -0
  576. package/dist/presets/llmInstructions.js.map +1 -0
  577. package/dist/types/builtInNodes.d.ts +1 -1
  578. package/dist/types/builtInNodes.d.ts.map +1 -1
  579. package/dist/types/builtInNodes.js +8 -3
  580. package/dist/types/builtInNodes.js.map +1 -1
  581. package/dist/types/index.d.ts +4 -7
  582. package/dist/types/index.d.ts.map +1 -1
  583. package/dist/types/index.js.map +1 -1
  584. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  585. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  586. package/dist/types/jsonSchemaHelpers.js +7 -2
  587. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  588. package/dist/types/nodeTypes.d.ts +6 -1
  589. package/dist/types/nodeTypes.d.ts.map +1 -1
  590. package/dist/types/nodeTypes.js.map +1 -1
  591. package/dist/types/schema.d.ts.map +1 -1
  592. package/dist/types/schema.js +12 -5
  593. package/dist/types/schema.js.map +1 -1
  594. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  595. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  596. package/dist/utilities/buildInitialState.d.ts +3 -2
  597. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  598. package/dist/utilities/buildInitialState.js +1 -0
  599. package/dist/utilities/buildInitialState.js.map +1 -1
  600. package/dist/utilities/createServerFeature.d.ts +1 -1
  601. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  602. package/dist/utilities/createServerFeature.js +2 -2
  603. package/dist/utilities/createServerFeature.js.map +1 -1
  604. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  605. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  606. package/dist/utilities/editorConfigFactory.js +9 -9
  607. package/dist/utilities/editorConfigFactory.js.map +1 -1
  608. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  609. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  610. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  611. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  612. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  613. package/dist/utilities/generateImportMap.d.ts +3 -3
  614. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  615. package/dist/utilities/generateImportMap.js +3 -7
  616. package/dist/utilities/generateImportMap.js.map +1 -1
  617. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  618. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  619. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  620. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  621. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  622. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  623. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  624. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  625. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  626. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  627. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  628. package/dist/validate/hasText.d.ts +2 -2
  629. package/dist/validate/hasText.d.ts.map +1 -1
  630. package/dist/validate/hasText.js.map +1 -1
  631. package/dist/validate/index.d.ts +1 -1
  632. package/dist/validate/index.d.ts.map +1 -1
  633. package/package.json +98 -30
  634. package/dist/@types/assets.d.js +0 -2
  635. package/dist/@types/assets.d.js.map +0 -1
  636. package/dist/dependencyChecker.spec.js +0 -16
  637. package/dist/dependencyChecker.spec.js.map +0 -1
  638. package/dist/exports/client/Field-JXXWHUE4.js +0 -2
  639. package/dist/exports/client/Field-JXXWHUE4.js.map +0 -7
  640. package/dist/exports/client/bundled.css +0 -1
  641. package/dist/exports/client/chunk-4EIYXZ6H.js +0 -12
  642. package/dist/exports/client/chunk-4EIYXZ6H.js.map +0 -7
  643. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  644. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  645. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  646. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  647. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  648. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  649. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  650. package/dist/exports/server/rsc.browser.d.ts +0 -11
  651. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  652. package/dist/exports/server/rsc.browser.js +0 -10
  653. package/dist/exports/server/rsc.browser.js.map +0 -1
  654. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  655. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  656. package/dist/features/blockquote/markdownTransformer.js +0 -33
  657. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  658. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  659. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  660. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  661. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  662. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  663. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  664. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  665. package/dist/features/experimental_table/client/index.js.map +0 -1
  666. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  667. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  668. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  669. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  670. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  671. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  672. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  673. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  674. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  675. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  676. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  677. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  678. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  679. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  680. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  681. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  682. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  683. package/dist/features/experimental_table/server/index.d.ts +0 -3
  684. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  685. package/dist/features/experimental_table/server/index.js.map +0 -1
  686. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  687. package/dist/features/experimental_table/server/schema.js.map +0 -1
  688. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  689. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  690. package/dist/features/format/bold/markdownTransformers.js +0 -23
  691. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  692. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  693. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  694. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  695. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  696. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  697. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  698. package/dist/features/format/italic/markdownTransformers.js +0 -12
  699. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  700. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  701. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  702. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  703. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  704. package/dist/features/link/markdownTransformer.spec.js +0 -195
  705. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  706. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  707. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  708. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  709. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  710. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  711. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  712. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  713. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  714. package/dist/features/lists/shared/markdown.d.ts +0 -6
  715. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  716. package/dist/features/lists/shared/markdown.js +0 -57
  717. package/dist/features/lists/shared/markdown.js.map +0 -1
  718. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  719. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  720. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  721. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  722. package/dist/field/clientEntry.d.ts +0 -29
  723. package/dist/field/clientEntry.d.ts.map +0 -1
  724. package/dist/field/clientEntry.js +0 -86
  725. package/dist/field/clientEntry.js.map +0 -1
  726. package/dist/lexical/utils/guard.d.ts +0 -5
  727. package/dist/lexical/utils/guard.d.ts.map +0 -1
  728. package/dist/lexical/utils/guard.js +0 -9
  729. package/dist/lexical/utils/guard.js.map +0 -1
  730. package/dist/lexical/utils/url.spec.js +0 -114
  731. package/dist/lexical/utils/url.spec.js.map +0 -1
  732. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  733. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  734. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  735. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  736. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js +0 -160
  737. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js.map +0 -1
  738. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  739. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  740. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -220
  741. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  742. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  743. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  744. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -199
  745. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  746. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  747. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  748. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  749. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  750. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -173
  751. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  752. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -352
  753. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  754. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  755. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  756. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  757. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  758. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  759. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  760. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  761. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  762. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  763. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  764. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  765. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  766. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  767. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  768. package/dist/packages/@lexical/markdown/index.js +0 -39
  769. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  770. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  771. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  772. package/dist/packages/@lexical/markdown/utils.js +0 -267
  773. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  774. package/dist/utilities/jsx/jsx.spec.js +0 -178
  775. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  776. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  777. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  778. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  779. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  780. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  781. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  782. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  783. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  784. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  785. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  786. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  787. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  788. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  789. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  790. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  791. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  792. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  793. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CheckIcon","ListItemDiffHTMLConverterAsync","listitem","node","nodesToHTML","parent","providedCSSString","hasSubLists","children","some","child","type","nodes","join","listType","ReactDOMServer","default","JSX","_jsx","checked","className","role","tabIndex","value","dangerouslySetInnerHTML","__html","_jsxs","html","renderToStaticMarkup","styleIndex","indexOf","classIndex","classEndIndex","substring","classNameWithStyle","htmlWithStyle","replace"],"sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"sourcesContent":["import { CheckIcon } from '@payloadcms/ui/rsc'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedListItemNode } from '../../../../types/nodeTypes.js'\n\nimport './index.css'\n\nexport const ListItemDiffHTMLConverterAsync: HTMLConvertersAsync<SerializedListItemNode> = {\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const ReactDOMServer = (await import('react-dom/server')).default\n\n const JSX = (\n <li\n aria-checked={node.checked ? true : false}\n className={`checkboxItem ${node.checked ? 'checkboxItem--checked' : 'checkboxItem--unchecked'}${\n hasSubLists ? ' checkboxItem--nested' : ''\n }`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n tabIndex={-1}\n value={node.value}\n >\n {hasSubLists ? (\n // When sublists exist, just render them safely as HTML\n <div dangerouslySetInnerHTML={{ __html: children }} />\n ) : (\n // Otherwise, show our custom styled checkbox\n <div className=\"checkboxItem__wrapper\">\n <div\n className=\"checkboxItem__icon\"\n data-checked={node.checked}\n data-enable-match=\"true\"\n >\n {node.checked && <CheckIcon />}\n </div>\n <span className=\"checkboxItem__label\">{children}</span>\n </div>\n )}\n </li>\n )\n\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n // Add style=\"list-style-type: none;${providedCSSString}\" to html\n const styleIndex = html.indexOf('class=\"list-item-checkbox')\n const classIndex = html.indexOf('class=\"list-item-checkbox', styleIndex)\n const classEndIndex = html.indexOf('\"', classIndex + 6)\n const className = html.substring(classIndex, classEndIndex)\n const classNameWithStyle = `${className} style=\"list-style-type: none;${providedCSSString}\"`\n const htmlWithStyle = html.replace(className, classNameWithStyle)\n\n return htmlWithStyle\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n data-enable-match=\"true\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":";AAAA,SAASA,SAAS,QAAQ;AAK1B,OAAO;AAEP,OAAO,MAAMC,8BAAA,GAA8E;EACzFC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcJ,IAAA,CAAKK,QAAQ,CAACC,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMH,QAAA,GAAW,CACf,MAAMJ,WAAA,CAAY;MAChBQ,KAAA,EAAOT,IAAA,CAAKK;IACd,EAAC,EACDK,IAAI,CAAC;IAEP,IAAI,cAAcR,MAAA,IAAUA,MAAA,EAAQS,QAAA,KAAa,SAAS;MACxD,MAAMC,cAAA,GAAiB,CAAC,MAAM,MAAM,CAAC,mBAAkB,EAAGC,OAAO;MAEjE,MAAMC,GAAA,gBACJC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,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["CheckIcon","escapeHTML","ListItemDiffHTMLConverterAsync","listitem","node","nodesToHTML","parent","providedCSSString","hasSubLists","children","some","child","type","nodes","join","listType","ReactDOMServer","default","JSX","_jsx","checked","className","role","tabIndex","value","dangerouslySetInnerHTML","__html","_jsxs","html","renderToStaticMarkup","styleIndex","indexOf","classIndex","classEndIndex","substring","classNameWithStyle","htmlWithStyle","replace","String"],"sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"sourcesContent":["import { CheckIcon } from '@payloadcms/ui/rsc'\nimport escapeHTML from 'escape-html'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedListItemNode } from '../../../../types/nodeTypes.js'\n\nimport './index.css'\n\nexport const ListItemDiffHTMLConverterAsync: HTMLConvertersAsync<SerializedListItemNode> = {\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const ReactDOMServer = (await import('react-dom/server')).default\n\n const JSX = (\n <li\n aria-checked={node.checked ? true : false}\n className={`checkboxItem ${node.checked ? 'checkboxItem--checked' : 'checkboxItem--unchecked'}${\n hasSubLists ? ' checkboxItem--nested' : ''\n }`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n tabIndex={-1}\n value={node.value}\n >\n {hasSubLists ? (\n // When sublists exist, just render them safely as HTML\n <div dangerouslySetInnerHTML={{ __html: children }} />\n ) : (\n // Otherwise, show our custom styled checkbox\n <div className=\"checkboxItem__wrapper\">\n <div\n className=\"checkboxItem__icon\"\n data-checked={node.checked}\n data-enable-match=\"true\"\n >\n {node.checked && <CheckIcon />}\n </div>\n <span className=\"checkboxItem__label\">{children}</span>\n </div>\n )}\n </li>\n )\n\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n // Add style=\"list-style-type: none;${providedCSSString}\" to html\n const styleIndex = html.indexOf('class=\"list-item-checkbox')\n const classIndex = html.indexOf('class=\"list-item-checkbox', styleIndex)\n const classEndIndex = html.indexOf('\"', classIndex + 6)\n const className = html.substring(classIndex, classEndIndex)\n const classNameWithStyle = `${className} style=\"list-style-type: none;${providedCSSString}\"`\n const htmlWithStyle = html.replace(className, classNameWithStyle)\n\n return htmlWithStyle\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${escapeHTML(String(node.value))}\"\n data-enable-match=\"true\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":";AAAA,SAASA,SAAS,QAAQ;AAC1B,OAAOC,UAAA,MAAgB;AAKvB,OAAO;AAEP,OAAO,MAAMC,8BAAA,GAA8E;EACzFC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcJ,IAAA,CAAKK,QAAQ,CAACC,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMH,QAAA,GAAW,CACf,MAAMJ,WAAA,CAAY;MAChBQ,KAAA,EAAOT,IAAA,CAAKK;IACd,EAAC,EACDK,IAAI,CAAC;IAEP,IAAI,cAAcR,MAAA,IAAUA,MAAA,EAAQS,QAAA,KAAa,SAAS;MACxD,MAAMC,cAAA,GAAiB,CAAC,MAAM,MAAM,CAAC,mBAAkB,EAAGC,OAAO;MAEjE,MAAMC,GAAA,gBACJC,IAAA,CAAC;QACC,gBAAcf,IAAA,CAAKgB,OAAO,GAAG,OAAO;QACpCC,SAAA,EAAW,gBAAgBjB,IAAA,CAAKgB,OAAO,GAAG,0BAA0B,4BAClEZ,WAAA,GAAc,0BAA0B,IACxC;QAC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-font-family);
13
12
  font-size: var(--text-body-medium-font-size);
14
13
  font-weight: var(--text-body-medium-font-weight);
15
14
  line-height: var(--text-body-medium-line-height);
@@ -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;
@@ -8,7 +8,6 @@
8
8
  border-radius: var(--radius-medium);
9
9
  border: var(--stroke-width-small) solid var(--color-border);
10
10
  position: relative;
11
- font-family: var(--font-body);
12
11
  margin-block: calc(var(--spacer-1) * 2.5);
13
12
  max-height: calc(var(--spacer-5) * 2.5);
14
13
  padding: calc(var(--spacer-1) * 1.25);
@@ -11,7 +11,6 @@
11
11
  outline-offset: calc(var(--stroke-width-small) * -1);
12
12
  position: relative;
13
13
  z-index: 2;
14
- font-family: var(--text-body-medium-font-family);
15
14
  padding: var(--spacer-2);
16
15
 
17
16
  &[data-match-type='create'] {
@@ -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/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,MAAMC,UAAA,GAAaH,IAAA;MAEnB,IAAII,SAAA,GAAiDC,SAAA;MAErD;MACA,IAAI,OAAOF,UAAA,CAAWG,KAAK,KAAK,UAAU;QACxC,IAAI,CAACL,QAAA,EAAU;UACb,OAAO;QACT;QACAG,SAAA,GAAY,MAAMH,QAAA,CAAgC;UAChDM,EAAA,EAAIJ,UAAA,CAAWG,KAAK;UACpBE,cAAA,EAAgBL,UAAA,CAAWM;QAC7B;MACF,OAAO;QACLL,SAAA,GAAYD,UAAA,CAAWG,KAAK;MAC9B;MAEA,IAAI,CAACF,SAAA,EAAW;QACd,OAAO;MACT;MAEA,MAAMM,GAAA,GAAMV,IAAC,CAAKW,MAAM,EAAED,GAAA,IAAmBN,SAAA,EAAgCM,GAAA,IAAO;MAEpF,MAAME,YAAA,GACJ,cAAC,IAAkBR,SAAA,IAAcA,SAAA,EAAWS,YAAA,IAA4BT,SAAA,EAAWU,GAAA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BACpEL,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW2B,KAAA,EAAM,KAAE3B,SAAA,EAAW4B,MAAA;kBAGlC5B,SAAA,EAAW8B,QAAA,iBACVP,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW8B,QAAA;;;;;;MAS1B;MACA,MAAMC,IAAA,GAAOpB,cAAA,CAAeqB,oBAAoB,CAACZ,GAAA;MAEjD,OAAOW,IAAA;IACT;EACF;AACF","ignoreList":[]}
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 { UploadData } 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 UploadData\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = (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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F","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  @layer payload-default {
2
2
  .lexical-diff .field-diff-content {
3
3
  .html-diff {
4
- font-family: var(--text-body-large-font-family);
5
4
  font-size: var(--text-body-large-font-size);
6
5
  font-weight: var(--text-body-large-font-weight);
7
6
  line-height: var(--text-body-large-line-height);
@@ -119,7 +118,6 @@
119
118
  }
120
119
 
121
120
  li {
122
- font-family: var(--text-body-large-font-family);
123
121
  font-size: var(--text-body-large-font-size);
124
122
  margin-block: 0 var(--spacer-1);
125
123
  margin-inline-start: var(--spacer-4);
@@ -1,5 +1,6 @@
1
- import type { RichTextFieldDiffServerComponent } from 'payload';
1
+ import type { RichTextFieldDiffServerProps } from 'payload';
2
2
  import './index.css';
3
3
  import '../bundled.css';
4
- export declare const LexicalDiffComponent: RichTextFieldDiffServerComponent;
4
+ import React from 'react';
5
+ export declare const LexicalDiffComponent: React.FC<RichTextFieldDiffServerProps>;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/Diff/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAA;AAI/D,OAAO,aAAa,CAAA;AACpB,OAAO,gBAAgB,CAAA;AAqBvB,eAAO,MAAM,oBAAoB,EAAE,gCAiGlC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/Diff/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAI3D,OAAO,aAAa,CAAA;AACpB,OAAO,gBAAgB,CAAA;AAGvB,OAAO,KAAK,MAAM,OAAO,CAAA;AAkBzB,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA0FvE,CAAA"}
@@ -14,13 +14,13 @@ import { UploadDiffHTMLConverterAsync } from './converters/upload/index.js';
14
14
  const baseClass = 'lexical-diff';
15
15
  export const LexicalDiffComponent = async args => {
16
16
  const {
17
- comparisonValue: valueFrom,
18
17
  field,
19
18
  i18n,
20
19
  locale,
21
20
  nestingLevel,
22
21
  req,
23
- versionValue: valueTo
22
+ valueFrom,
23
+ valueTo
24
24
  } = args;
25
25
  const internalDocToHref = async ({
26
26
  linkNode,
@@ -78,6 +78,7 @@ export const LexicalDiffComponent = async args => {
78
78
  const payloadPopulateFn = await getPayloadPopulateFn({
79
79
  currentDepth: 0,
80
80
  depth: 1,
81
+ overrideAccess: false,
81
82
  req
82
83
  });
83
84
  const fromHTML = await convertLexicalToHTMLAsync({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FieldDiffContainer","getHTMLDiffComponents","formatAdminURL","React","convertLexicalToHTMLAsync","getPayloadPopulateFn","LinkDiffHTMLConverterAsync","ListItemDiffHTMLConverterAsync","RelationshipDiffHTMLConverterAsync","UnknownDiffHTMLConverterAsync","UploadDiffHTMLConverterAsync","baseClass","LexicalDiffComponent","args","comparisonValue","valueFrom","field","i18n","locale","nestingLevel","req","versionValue","valueTo","internalDocToHref","linkNode","populate","fields","doc","relationTo","value","docId","id","collectionSlug","adminRoute","payload","config","routes","admin","path","serverURL","converters","defaultConverters","payloadPopulateFn","currentDepth","depth","fromHTML","data","disableContainer","toHTML","From","To","length","_jsx","className","label"],"sources":["../../../src/field/Diff/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextFieldDiffServerComponent } from 'payload'\n\nimport { FieldDiffContainer, getHTMLDiffComponents } from '@payloadcms/ui/rsc'\n\nimport './index.css'\nimport '../bundled.css'\n\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type {\n HTMLConvertersFunctionAsync,\n HTMLPopulateFn,\n} from '../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedLinkNode } from '../../types/nodeTypes.js'\n\nimport { convertLexicalToHTMLAsync } from '../../features/converters/lexicalToHtml/async/index.js'\nimport { getPayloadPopulateFn } from '../../features/converters/utilities/payloadPopulateFn.js'\nimport { LinkDiffHTMLConverterAsync } from './converters/link.js'\nimport { ListItemDiffHTMLConverterAsync } from './converters/listitem/index.js'\nimport { RelationshipDiffHTMLConverterAsync } from './converters/relationship/index.js'\nimport { UnknownDiffHTMLConverterAsync } from './converters/unknown/index.js'\nimport { UploadDiffHTMLConverterAsync } from './converters/upload/index.js'\n\nconst baseClass = 'lexical-diff'\n\nexport const LexicalDiffComponent: RichTextFieldDiffServerComponent = async (args) => {\n const {\n comparisonValue: valueFrom,\n field,\n i18n,\n locale,\n nestingLevel,\n req,\n versionValue: valueTo,\n } = args\n\n const internalDocToHref = async ({\n linkNode,\n populate,\n }: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => {\n if (!linkNode.fields.doc) {\n return '#'\n }\n\n const { relationTo, value } = linkNode.fields.doc\n\n let docId: number | string\n\n if (typeof value === 'object' && value !== null) {\n docId = value.id\n } else if (populate && typeof value !== 'object') {\n const doc = await populate({\n id: value,\n collectionSlug: relationTo,\n })\n\n if (!doc || !doc.id) {\n return '#'\n }\n\n docId = doc.id\n } else {\n docId = value\n }\n\n return formatAdminURL({\n adminRoute: req.payload.config.routes.admin,\n path: `/collections/${relationTo}/${docId}`,\n serverURL: req.payload.config.serverURL,\n })\n }\n\n const converters: HTMLConvertersFunctionAsync = ({ defaultConverters }) => ({\n ...defaultConverters,\n ...LinkDiffHTMLConverterAsync({ internalDocToHref }),\n ...ListItemDiffHTMLConverterAsync,\n ...UploadDiffHTMLConverterAsync({ i18n, req }),\n ...RelationshipDiffHTMLConverterAsync({ i18n, req }),\n ...UnknownDiffHTMLConverterAsync({ i18n, req }),\n })\n\n const payloadPopulateFn = await getPayloadPopulateFn({\n currentDepth: 0,\n depth: 1,\n req,\n })\n const fromHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueFrom as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const toHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueTo as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const { From, To } = getHTMLDiffComponents({\n // Ensure empty paragraph is displayed for empty rich text fields - otherwise, toHTML may be displayed in the wrong column\n fromHTML: fromHTML?.length ? fromHTML : '<p></p>',\n toHTML: toHTML?.length ? toHTML : '<p></p>',\n })\n\n return (\n <FieldDiffContainer\n className={baseClass}\n From={From}\n i18n={i18n}\n label={{\n label: field.label,\n locale,\n }}\n nestingLevel={nestingLevel}\n To={To}\n />\n )\n}\n"],"mappings":";AAGA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ;AAE1D,OAAO;AACP,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAQlB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,8BAA8B,QAAQ;AAC/C,SAASC,kCAAkC,QAAQ;AACnD,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,4BAA4B,QAAQ;AAE7C,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,oBAAA,GAAyD,MAAOC,IAAA;EAC3E,MAAM;IACJC,eAAA,EAAiBC,SAAS;IAC1BC,KAAK;IACLC,IAAI;IACJC,MAAM;IACNC,YAAY;IACZC,GAAG;IACHC,YAAA,EAAcC;EAAO,CACtB,GAAGT,IAAA;EAEJ,MAAMU,iBAAA,GAAoB,MAAAA,CAAO;IAC/BC,QAAQ;IACRC;EAAQ,CAIT;IACC,IAAI,CAACD,QAAA,CAASE,MAAM,CAACC,GAAG,EAAE;MACxB,OAAO;IACT;IAEA,MAAM;MAAEC,UAAU;MAAEC;IAAK,CAAE,GAAGL,QAAA,CAASE,MAAM,CAACC,GAAG;IAEjD,IAAIG,KAAA;IAEJ,IAAI,OAAOD,KAAA,KAAU,YAAYA,KAAA,KAAU,MAAM;MAC/CC,KAAA,GAAQD,KAA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ACNyB,gBAAA,EAAkB;IAClBtB,QAAA,EAAUiB;EACZ;EAEA,MAAM;IAAEO,IAAI;IAAEC;EAAE,CAAE,GAAGjD,qBAAA,CAAsB;IACzC;IACA4C,QAAA,EAAUA,QAAA,EAAUM,MAAA,GAASN,QAAA,GAAW;IACxCG,MAAA,EAAQA,MAAA,EAAQG,MAAA,GAASH,MAAA,GAAS;EACpC;EAEA,oBACEI,IAAA,CAACpD,kBAAA;IACCqD,SAAA,EAAW1C,SAAA;IACXsC,IAAA,EAAMA,IAAA;IACNhC,IAAA,EAAMA,IAAA;IACNqC,KAAA,EAAO;MACLA,KAAA,EAAOtC,KAAA,CAAMsC,KAAK;MAClBpC;IACF;IACAC,YAAA,EAAcA,YAAA;IACd+B,EAAA,EAAIA;;AAGV","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["FieldDiffContainer","getHTMLDiffComponents","formatAdminURL","React","convertLexicalToHTMLAsync","getPayloadPopulateFn","LinkDiffHTMLConverterAsync","ListItemDiffHTMLConverterAsync","RelationshipDiffHTMLConverterAsync","UnknownDiffHTMLConverterAsync","UploadDiffHTMLConverterAsync","baseClass","LexicalDiffComponent","args","field","i18n","locale","nestingLevel","req","valueFrom","valueTo","internalDocToHref","linkNode","populate","fields","doc","relationTo","value","docId","id","collectionSlug","adminRoute","payload","config","routes","admin","path","serverURL","converters","defaultConverters","payloadPopulateFn","currentDepth","depth","overrideAccess","fromHTML","data","disableContainer","toHTML","From","To","length","_jsx","className","label"],"sources":["../../../src/field/Diff/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextFieldDiffServerProps } from 'payload'\n\nimport { FieldDiffContainer, getHTMLDiffComponents } from '@payloadcms/ui/rsc'\n\nimport './index.css'\nimport '../bundled.css'\n\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type {\n HTMLConvertersFunctionAsync,\n HTMLPopulateFn,\n} from '../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedLinkNode } from '../../types/nodeTypes.js'\n\nimport { convertLexicalToHTMLAsync } from '../../features/converters/lexicalToHtml/async/index.js'\nimport { getPayloadPopulateFn } from '../../features/converters/utilities/payloadPopulateFn.js'\nimport { LinkDiffHTMLConverterAsync } from './converters/link.js'\nimport { ListItemDiffHTMLConverterAsync } from './converters/listitem/index.js'\nimport { RelationshipDiffHTMLConverterAsync } from './converters/relationship/index.js'\nimport { UnknownDiffHTMLConverterAsync } from './converters/unknown/index.js'\nimport { UploadDiffHTMLConverterAsync } from './converters/upload/index.js'\n\nconst baseClass = 'lexical-diff'\n\nexport const LexicalDiffComponent: React.FC<RichTextFieldDiffServerProps> = async (args) => {\n const { field, i18n, locale, nestingLevel, req, valueFrom, valueTo } = args\n\n const internalDocToHref = async ({\n linkNode,\n populate,\n }: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => {\n if (!linkNode.fields.doc) {\n return '#'\n }\n\n const { relationTo, value } = linkNode.fields.doc\n\n let docId: number | string\n\n if (typeof value === 'object' && value !== null) {\n docId = value.id\n } else if (populate && typeof value !== 'object') {\n const doc = await populate({\n id: value,\n collectionSlug: relationTo,\n })\n\n if (!doc || !doc.id) {\n return '#'\n }\n\n docId = doc.id\n } else {\n docId = value\n }\n\n return formatAdminURL({\n adminRoute: req.payload.config.routes.admin,\n path: `/collections/${relationTo}/${docId}`,\n serverURL: req.payload.config.serverURL,\n })\n }\n\n const converters: HTMLConvertersFunctionAsync = ({ defaultConverters }) => ({\n ...defaultConverters,\n ...LinkDiffHTMLConverterAsync({ internalDocToHref }),\n ...ListItemDiffHTMLConverterAsync,\n ...UploadDiffHTMLConverterAsync({ i18n, req }),\n ...RelationshipDiffHTMLConverterAsync({ i18n, req }),\n ...UnknownDiffHTMLConverterAsync({ i18n, req }),\n })\n\n const payloadPopulateFn = await getPayloadPopulateFn({\n currentDepth: 0,\n depth: 1,\n overrideAccess: false,\n req,\n })\n const fromHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueFrom as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const toHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueTo as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const { From, To } = getHTMLDiffComponents({\n // Ensure empty paragraph is displayed for empty rich text fields - otherwise, toHTML may be displayed in the wrong column\n fromHTML: fromHTML?.length ? fromHTML : '<p></p>',\n toHTML: toHTML?.length ? toHTML : '<p></p>',\n })\n\n return (\n <FieldDiffContainer\n className={baseClass}\n From={From}\n i18n={i18n}\n label={{\n label: field.label,\n locale,\n }}\n nestingLevel={nestingLevel}\n To={To}\n />\n )\n}\n"],"mappings":";AAGA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ;AAE1D,OAAO;AACP,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAQlB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,8BAA8B,QAAQ;AAC/C,SAASC,kCAAkC,QAAQ;AACnD,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,4BAA4B,QAAQ;AAE7C,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,oBAAA,GAA+D,MAAOC,IAAA;EACjF,MAAM;IAAEC,KAAK;IAAEC,IAAI;IAAEC,MAAM;IAAEC,YAAY;IAAEC,GAAG;IAAEC,SAAS;IAAEC;EAAO,CAAE,GAAGP,IAAA;EAEvE,MAAMQ,iBAAA,GAAoB,MAAAA,CAAO;IAC/BC,QAAQ;IACRC;EAAQ,CAIT;IACC,IAAI,CAACD,QAAA,CAASE,MAAM,CAACC,GAAG,EAAE;MACxB,OAAO;IACT;IAEA,MAAM;MAAEC,UAAU;MAAEC;IAAK,CAAE,GAAGL,QAAA,CAASE,MAAM,CAACC,GAAG;IAEjD,IAAIG,KAAA;IAEJ,IAAI,OAAOD,KAAA,KAAU,YAAYA,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C,yBAAA,CAA0B;IAC7CkC,UAAA;IACAO,IAAA,EAAMzB,OAAA;IACN0B,gBAAA,EAAkB;IAClBvB,QAAA,EAAUiB;EACZ;EAEA,MAAM;IAAEQ,IAAI;IAAEC;EAAE,CAAE,GAAGhD,qBAAA,CAAsB;IACzC;IACA2C,QAAA,EAAUA,QAAA,EAAUM,MAAA,GAASN,QAAA,GAAW;IACxCG,MAAA,EAAQA,MAAA,EAAQG,MAAA,GAASH,MAAA,GAAS;EACpC;EAEA,oBACEI,IAAA,CAACnD,kBAAA;IACCoD,SAAA,EAAWzC,SAAA;IACXqC,IAAA,EAAMA,IAAA;IACNjC,IAAA,EAAMA,IAAA;IACNsC,KAAA,EAAO;MACLA,KAAA,EAAOvC,KAAA,CAAMuC,KAAK;MAClBrC;IACF;IACAC,YAAA,EAAcA,YAAA;IACdgC,EAAA,EAAIA;;AAGV","ignoreList":[]}
@@ -1 +1 @@
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,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":"AAsBA,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,CAmN9B,CAAA;AAWD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, isFieldRTL, RenderCustomComponent, useConfig, useEditDepth, useEffectEvent, useField, useLocale } from '@payloadcms/ui';
4
+ import { getTranslation } from '@payloadcms/translations';
5
+ import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, isFieldRTL, RenderCustomComponent, useConfig, useEditDepth, useEffectEvent, useField, useLocale, useTranslation } from '@payloadcms/ui';
5
6
  import { mergeFieldStyles } from '@payloadcms/ui/shared';
6
7
  import { dequal } from 'dequal/lite';
7
8
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
@@ -33,6 +34,9 @@ const RichTextComponent = props => {
33
34
  schemaPath,
34
35
  validate
35
36
  } = props;
37
+ const {
38
+ i18n
39
+ } = useTranslation();
36
40
  const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin;
37
41
  const locale = useLocale();
38
42
  const {
@@ -137,14 +141,17 @@ const RichTextComponent = props => {
137
141
  }
138
142
  }, [initialValue]);
139
143
  return /*#__PURE__*/_jsxs("div", {
144
+ "aria-label": getTranslation(label || '', i18n),
140
145
  className: classes,
141
146
  "data-field-path": path,
142
147
  "data-field-schemapath": schemaPath,
143
148
  "data-lexical-view": editorConfig?.view,
149
+ role: "group",
144
150
  style: styles,
145
151
  children: [/*#__PURE__*/_jsxs("div", {
146
152
  className: `${baseClass}__label-row`,
147
153
  children: [Label || /*#__PURE__*/_jsx(FieldLabel, {
154
+ hasRequiredAccessibleState: true,
148
155
  label: label,
149
156
  localized: localized,
150
157
  path: path,
@@ -161,21 +168,24 @@ const RichTextComponent = props => {
161
168
  }), /*#__PURE__*/_jsxs(ErrorBoundary, {
162
169
  fallbackRender: fallbackRender,
163
170
  onReset: () => {},
164
- children: [BeforeInput, /*#__PURE__*/_jsx(BulkUploadProvider, {
165
- modalSlugPrefix: `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
- }))
171
+ children: [BeforeInput, /*#__PURE__*/_jsx("div", {
172
+ className: `${baseClass}__editor-content`,
173
+ children: /*#__PURE__*/_jsx(BulkUploadProvider, {
174
+ modalSlugPrefix: `lexical-${path}`,
175
+ children: /*#__PURE__*/_jsx(LexicalProvider, {
176
+ composerKey: pathWithEditDepth,
177
+ editorConfig: editorConfig,
178
+ fieldProps: props,
179
+ isSmallWidthViewport: isSmallWidthViewport,
180
+ onChange: handleChange,
181
+ readOnly: disabled,
182
+ rtl: rtl,
183
+ value: value_0
184
+ }, JSON.stringify({
185
+ path,
186
+ rerenderProviderKey
187
+ }))
188
+ })
179
189
  }), AfterInput]
180
190
  }), /*#__PURE__*/_jsx(RenderCustomComponent, {
181
191
  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","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 {/* 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 {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,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YACLM,KAAA,EAAOA;aAJF4C,IAAA,CAAKE,SAAS,CAAC;YAAE9D,IAAA;YAAMiC;UAAoB;YAOnDd,UAAA;uBAEHkD,IAAA,CAACpG,qBAAA;QACCqG,eAAA,EAAiBjD,WAAA;QACjBkD,QAAA,eAAUF,IAAA,CAACxG,gBAAA;UAAiB6B,WAAA,EAAaA,WAAA;UAAaM,IAAA,EAAMA;;;;KApC3DkD,iBAAA;AAyCX;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
+ {"version":3,"file":"Field.js","names":["getTranslation","BulkUploadProvider","FieldDescription","FieldError","FieldLabel","isFieldRTL","RenderCustomComponent","useConfig","useEditDepth","useEffectEvent","useField","useLocale","useTranslation","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","i18n","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","role","style","_jsx","hasRequiredAccessibleState","CustomComponent","Fallback","fallbackRender","onReset","modalSlugPrefix","composerKey","fieldProps","onChange","error","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 { getTranslation } from '@payloadcms/translations'\nimport {\n BulkUploadProvider,\n FieldDescription,\n FieldError,\n FieldLabel,\n isFieldRTL,\n RenderCustomComponent,\n useConfig,\n useEditDepth,\n useEffectEvent,\n useField,\n useLocale,\n useTranslation,\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 { i18n } = useTranslation()\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 aria-label={getTranslation(label || '', i18n)}\n className={classes}\n data-field-path={path}\n data-field-schemapath={schemaPath}\n data-lexical-view={editorConfig?.view}\n key={pathWithEditDepth}\n role=\"group\"\n style={styles}\n >\n <div className={`${baseClass}__label-row`}>\n {Label || (\n <FieldLabel\n hasRequiredAccessibleState\n label={label}\n localized={localized}\n path={path}\n required={required}\n />\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,SAASA,cAAc,QAAQ;AAC/B,SACEC,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,QAAQ,EACRC,SAAS,EACTC,cAAc,QACT;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAA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f,GAAA,EAAKA,GAAA;cACLM,KAAA,EAAOA;eAJF4C,IAAA,CAAKE,SAAS,CAAC;cAAE/D,IAAA;cAAMkC;YAAoB;;YAQrDd,UAAA;uBAEHmD,IAAA,CAACvG,qBAAA;QACCyG,eAAA,EAAiBnD,WAAA;QACjBoD,QAAA,eAAUH,IAAA,CAAC3G,gBAAA;UAAiB8B,WAAA,EAAaA,WAAA;UAAaM,IAAA,EAAMA;;;;KA7C3DmD,iBAAA;AAkDX;AAEA,SAASwB,eAAe;EAAEM;AAAK,CAAiB;EAC9C,oBACEd,KAAA,CAAC;IAAI1E,SAAA,EAAU;IAAgB4E,IAAA,EAAK;4BAClCE,IAAA,CAAC;gBAAE;qBACHA,IAAA,CAAC;MAAID,KAAA,EAAO;QAAEY,KAAA,EAAO;MAAM;gBAAID,KAAA,YAAiB1D,KAAA,GAAQ0D,KAAA,CAAME,OAAO,GAAGC,MAAA,CAAOH,KAAA;;;AAGrF;AAEA,OAAO,MAAMI,QAAA,GAAqCjG,iBAAA","ignoreList":[]}
@@ -14,11 +14,13 @@ export declare const RenderLexical: React.FC<
14
14
  * If neither is passed, it will rely on the parent form to manage the value.
15
15
  */
16
16
  {
17
+ /** @deprecated Use `name` and `label` instead. */
18
+ field?: Partial<LexicalRichTextField>;
17
19
  /**
18
20
  * Override the loading state while the field component is being fetched and rendered.
19
21
  */
20
22
  Loading?: React.ReactElement;
21
23
  setValue?: FieldType<DefaultTypedEditorState | undefined>['setValue'];
22
24
  value?: FieldType<DefaultTypedEditorState | undefined>['value'];
23
- } & RenderFieldServerFnArgs<LexicalRichTextField>>;
25
+ } & Omit<RenderFieldServerFnArgs, 'hidden'>>;
24
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/RenderLexical/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,uBAAuB,EAK7B,MAAM,gBAAgB,CAA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AAA;CAChE,GAAG,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CA0F5C,CAAA"}
@@ -11,10 +11,12 @@ import React, { useCallback, useEffect, useRef } from 'react';
11
11
  * @todo - replace this with a general utility that works for all fields. Maybe merge with packages/ui/src/forms/RenderFields/RenderField.tsx
12
12
  */
13
13
  export const RenderLexical = args => {
14
- const $ = _c(9);
14
+ const $ = _c(10);
15
15
  const {
16
+ name,
16
17
  field,
17
18
  initialValue,
19
+ label,
18
20
  Loading,
19
21
  path,
20
22
  schemaPath,
@@ -27,23 +29,20 @@ export const RenderLexical = args => {
27
29
  _internal_renderField
28
30
  } = serverFunctionContext;
29
31
  const [entityType, entitySlug] = schemaPath.split(".", 2);
30
- const fieldPath = path ?? (field && "name" in field ? field?.name : "") ?? "";
32
+ const fieldName = name !== undefined ? name : field?.name;
33
+ const fieldLabel = label !== undefined ? label : field?.label;
34
+ const fieldPath = path ?? fieldName ?? "";
31
35
  let t0;
32
- if ($[0] !== _internal_renderField || $[1] !== field || $[2] !== initialValue || $[3] !== path || $[4] !== schemaPath) {
36
+ if ($[0] !== _internal_renderField || $[1] !== fieldLabel || $[2] !== fieldName || $[3] !== initialValue || $[4] !== path || $[5] !== schemaPath) {
33
37
  t0 = () => {
34
38
  const render = async function render() {
35
39
  const {
36
40
  Field
37
41
  } = await _internal_renderField({
38
- field: {
39
- ...(field || {}),
40
- type: "richText",
41
- admin: {
42
- ...(field?.admin || {}),
43
- hidden: false
44
- }
45
- },
42
+ name: fieldName,
43
+ hidden: false,
46
44
  initialValue: initialValue ?? undefined,
45
+ label: typeof fieldLabel === "function" ? undefined : fieldLabel,
47
46
  path,
48
47
  schemaPath
49
48
  });
@@ -52,19 +51,20 @@ export const RenderLexical = args => {
52
51
  render();
53
52
  };
54
53
  $[0] = _internal_renderField;
55
- $[1] = field;
56
- $[2] = initialValue;
57
- $[3] = path;
58
- $[4] = schemaPath;
59
- $[5] = t0;
54
+ $[1] = fieldLabel;
55
+ $[2] = fieldName;
56
+ $[3] = initialValue;
57
+ $[4] = path;
58
+ $[5] = schemaPath;
59
+ $[6] = t0;
60
60
  } else {
61
- t0 = $[5];
61
+ t0 = $[6];
62
62
  }
63
63
  const renderLexical = t0;
64
64
  const mounted = useRef(false);
65
65
  let t1;
66
66
  let t2;
67
- if ($[6] !== renderLexical) {
67
+ if ($[7] !== renderLexical) {
68
68
  t1 = () => {
69
69
  if (mounted.current) {
70
70
  return;
@@ -73,12 +73,12 @@ export const RenderLexical = args => {
73
73
  renderLexical();
74
74
  };
75
75
  t2 = [renderLexical];
76
- $[6] = renderLexical;
77
- $[7] = t1;
78
- $[8] = t2;
76
+ $[7] = renderLexical;
77
+ $[8] = t1;
78
+ $[9] = t2;
79
79
  } else {
80
- t1 = $[7];
81
- t2 = $[8];
80
+ t1 = $[8];
81
+ t2 = $[9];
82
82
  }
83
83
  useEffect(t1, t2);
84
84
  if (!Component) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","FieldContext","FieldPathContext","ServerFunctionsContext","ShimmerEffect","useServerFunctions","React","useCallback","useEffect","useRef","RenderLexical","args","$","field","initialValue","Loading","path","schemaPath","setValue","value","Component","setComponent","useState","serverFunctionContext","_internal_renderField","entityType","entitySlug","split","fieldPath","name","t0","render","Field","type","admin","hidden","undefined","renderLexical","mounted","t1","t2","current","_jsx","adjustedServerFunctionContext","getFormState","getFormStateArgs","collectionSlug","globalSlug","children","fieldValue","disabled","formInitializing","formProcessing","formSubmitted","_temp","showError"],"sources":["../../../src/field/RenderLexical/index.tsx"],"sourcesContent":["'use client'\nimport type { RichTextField } from 'payload'\n\nimport {\n FieldContext,\n FieldPathContext,\n type FieldType,\n type RenderFieldServerFnArgs,\n ServerFunctionsContext,\n type ServerFunctionsContextType,\n ShimmerEffect,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useRef } from 'react'\n\nimport type { LexicalRichTextField } from '../../types/index.js'\nimport type { DefaultTypedEditorState } from '../../types/nodeTypes.js'\n\n/**\n * Utility to render a lexical editor on the client.\n *\n * @experimental - may break in minor releases\n * @todo - replace this with a general utility that works for all fields. Maybe merge with packages/ui/src/forms/RenderFields/RenderField.tsx\n */\nexport const RenderLexical: React.FC<\n /**\n * If value or setValue, or both, is provided, this component will manage its own value.\n * If neither is passed, it will rely on the parent form to manage the value.\n */\n {\n /**\n * Override the loading state while the field component is being fetched and rendered.\n */\n Loading?: React.ReactElement\n\n setValue?: FieldType<DefaultTypedEditorState | undefined>['setValue']\n value?: FieldType<DefaultTypedEditorState | undefined>['value']\n } & RenderFieldServerFnArgs<LexicalRichTextField>\n> = (args) => {\n const { field, initialValue, Loading, path, schemaPath, setValue, value } = args\n const [Component, setComponent] = React.useState<null | React.ReactNode>(null)\n const serverFunctionContext = useServerFunctions()\n const { _internal_renderField } = serverFunctionContext\n\n const [entityType, entitySlug] = schemaPath.split('.', 2)\n\n const fieldPath = path ?? (field && 'name' in field ? field?.name : '') ?? ''\n\n const renderLexical = useCallback(() => {\n async function render() {\n const { Field } = await _internal_renderField({\n field: {\n ...((field as RichTextField) || {}),\n type: 'richText',\n admin: {\n ...((field as RichTextField)?.admin || {}),\n // When using \"fake\" anchor fields, hidden is often set to true. We need to override that here to ensure the field is rendered.\n hidden: false,\n },\n },\n initialValue: initialValue ?? undefined,\n path,\n schemaPath,\n })\n\n setComponent(Field)\n }\n void render()\n }, [_internal_renderField, schemaPath, path, field, initialValue])\n\n const mounted = useRef(false)\n\n useEffect(() => {\n if (mounted.current) {\n return\n }\n mounted.current = true\n void renderLexical()\n }, [renderLexical])\n\n if (!Component) {\n return typeof Loading !== 'undefined' ? Loading : <ShimmerEffect />\n }\n\n /**\n * By default, the lexical will make form state requests (e.g. to get drawer fields), passing in the arguments\n * of the current field. However, we need to override those arguments to get it to make requests based on the\n * *target* field. The server only knows the schema map of the target field.\n */\n const adjustedServerFunctionContext: ServerFunctionsContextType = {\n ...serverFunctionContext,\n getFormState: async (getFormStateArgs) => {\n return serverFunctionContext.getFormState({\n ...getFormStateArgs,\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n })\n },\n }\n\n if (typeof value === 'undefined' && !setValue) {\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n {Component}\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n }\n\n const fieldValue: FieldType<DefaultTypedEditorState | undefined> = {\n disabled: false,\n formInitializing: false,\n formProcessing: false,\n formSubmitted: false,\n initialValue: value,\n path: fieldPath,\n setValue: setValue ?? (() => undefined),\n showError: false,\n value,\n }\n\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n <FieldContext value={fieldValue}>{Component}</FieldContext>\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SACEC,YAAY,EACZC,gBAAgB,EAGhBC,sBAAsB,EAEtBC,aAAa,EACbC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ;AAKtD;;;;;;AAMA,OAAO,MAAMC,aAAA,GAcTC,IAAA;EAAA,MAAAC,CAAA,GAAAZ,EAAA;EACF;IAAAa,KAAA;IAAAC,YAAA;IAAAC,OAAA;IAAAC,IAAA;IAAAC,UAAA;IAAAC,QAAA;IAAAC;EAAA,IAA4ER,IAAA;EAC5E,OAAAS,SAAA,EAAAC,YAAA,IAAkCf,KAAA,CAAAgB,QAAA,KAAuC;EACzE,MAAAC,qBAAA,GAA8BlB,kBAAA;EAC9B;IAAAmB;EAAA,IAAkCD,qBAAA;EAElC,OAAAE,UAAA,EAAAC,UAAA,IAAiCT,UAAA,CAAAU,KAAA,CAAiB,MAAK;EAEvD,MAAAC,SAAA,GAAkBZ,IAAA,KAASH,KAAA,IAAS,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merEffect","useServerFunctions","React","useCallback","useEffect","useRef","RenderLexical","args","$","name","field","initialValue","label","Loading","path","schemaPath","setValue","value","Component","setComponent","useState","serverFunctionContext","_internal_renderField","entityType","entitySlug","split","fieldName","undefined","fieldLabel","fieldPath","t0","render","Field","hidden","renderLexical","mounted","t1","t2","current","_jsx","adjustedServerFunctionContext","getFormState","getFormStateArgs","collectionSlug","globalSlug","children","fieldValue","disabled","formInitializing","formProcessing","formSubmitted","_temp","showError"],"sources":["../../../src/field/RenderLexical/index.tsx"],"sourcesContent":["'use client'\nimport {\n FieldContext,\n FieldPathContext,\n type FieldType,\n type RenderFieldServerFnArgs,\n ServerFunctionsContext,\n type ServerFunctionsContextType,\n ShimmerEffect,\n useServerFunctions,\n} from '@payloadcms/ui'\nimport React, { useCallback, useEffect, useRef } from 'react'\n\nimport type { LexicalRichTextField } from '../../types/index.js'\nimport type { DefaultTypedEditorState } from '../../types/nodeTypes.js'\n\n/**\n * Utility to render a lexical editor on the client.\n *\n * @experimental - may break in minor releases\n * @todo - replace this with a general utility that works for all fields. Maybe merge with packages/ui/src/forms/RenderFields/RenderField.tsx\n */\nexport const RenderLexical: React.FC<\n /**\n * If value or setValue, or both, is provided, this component will manage its own value.\n * If neither is passed, it will rely on the parent form to manage the value.\n */\n {\n /** @deprecated Use `name` and `label` instead. */\n field?: Partial<LexicalRichTextField>\n /**\n * Override the loading state while the field component is being fetched and rendered.\n */\n Loading?: React.ReactElement\n\n setValue?: FieldType<DefaultTypedEditorState | undefined>['setValue']\n value?: FieldType<DefaultTypedEditorState | undefined>['value']\n } & Omit<RenderFieldServerFnArgs, 'hidden'>\n> = (args) => {\n const { name, field, initialValue, label, Loading, path, schemaPath, setValue, value } = args\n const [Component, setComponent] = React.useState<null | React.ReactNode>(null)\n const serverFunctionContext = useServerFunctions()\n const { _internal_renderField } = serverFunctionContext\n\n const [entityType, entitySlug] = schemaPath.split('.', 2)\n\n const fieldName = name !== undefined ? name : field?.name\n const fieldLabel = label !== undefined ? label : field?.label\n const fieldPath = path ?? fieldName ?? ''\n\n const renderLexical = useCallback(() => {\n async function render() {\n const { Field } = await _internal_renderField({\n name: fieldName,\n // When using \"fake\" anchor fields, hidden is often set to true.\n // We need to override that here to ensure the field is rendered.\n hidden: false,\n initialValue: initialValue ?? undefined,\n label: typeof fieldLabel === 'function' ? undefined : fieldLabel,\n path,\n schemaPath,\n })\n\n setComponent(Field)\n }\n void render()\n }, [_internal_renderField, schemaPath, path, fieldName, fieldLabel, initialValue])\n\n const mounted = useRef(false)\n\n useEffect(() => {\n if (mounted.current) {\n return\n }\n mounted.current = true\n void renderLexical()\n }, [renderLexical])\n\n if (!Component) {\n return typeof Loading !== 'undefined' ? Loading : <ShimmerEffect />\n }\n\n /**\n * By default, the lexical will make form state requests (e.g. to get drawer fields), passing in the arguments\n * of the current field. However, we need to override those arguments to get it to make requests based on the\n * *target* field. The server only knows the schema map of the target field.\n */\n const adjustedServerFunctionContext: ServerFunctionsContextType = {\n ...serverFunctionContext,\n getFormState: async (getFormStateArgs) => {\n return serverFunctionContext.getFormState({\n ...getFormStateArgs,\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n })\n },\n }\n\n if (typeof value === 'undefined' && !setValue) {\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n {Component}\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n }\n\n const fieldValue: FieldType<DefaultTypedEditorState | undefined> = {\n disabled: false,\n formInitializing: false,\n formProcessing: false,\n formSubmitted: false,\n initialValue: value,\n path: fieldPath,\n setValue: setValue ?? (() => undefined),\n showError: false,\n value,\n }\n\n return (\n <ServerFunctionsContext value={{ ...adjustedServerFunctionContext }}>\n <FieldPathContext key={fieldPath} value={fieldPath}>\n <FieldContext value={fieldValue}>{Component}</FieldContext>\n </FieldPathContext>\n </ServerFunctionsContext>\n )\n}\n"],"mappings":"AAAA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;EAEJ,IAEI,OAAOV,KAAA,KAAU,gBAAgBD,QAAA;IAAA,OAEjCuB,IAAA,CAAAxC,sBAAA;MAAAkB,KAAA;QAAA,GAAoCuB;MAA6B;MAAAK,QAAA,EAC/DN,IAAA,CAAAzC,gBAAA;QAAAmB,KAAA,EAAyCY,SAAA;QAAAgB,QAAA,EACtC3B;MAAA,GADoBW,SAAA;IAAA,C;;EAO7B,MAAAiB,UAAA;IAAAC,QAAA;IAAAC,gBAAA;IAAAC,cAAA;IAAAC,aAAA;IAAAvC,YAAA,EAKgBM,KAAA;IAAAH,IAAA,EACRe,SAAA;IAAAb,QAAA,EACIA,QAAA,IAAAmC,KAA2B;IAAAC,SAAA;IAAAnC;EAAA;EAGvC,OAGEsB,IAAA,CAAAxC,sBAAA;IAAAkB,KAAA;MAAA,GAAoCuB;IAA6B;IAAAK,QAAA,EAC/DN,IAAA,CAAAzC,gBAAA;MAAAmB,KAAA,EAAyCY,SAAA;MAAAgB,QAAA,EACvCN,IAAA,CAAA1C,YAAA;QAAAoB,KAAA,EAAqB6B,UAAA;QAAAD,QAAA,EAAa3B;MAAA,C;OADbW,SAAA;EAAA,C;CAK7B;AAzFI,SAAAsB,MAAA","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
 
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSelector.d.ts","sourceRoot":"","sources":["../../src/field/ViewSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,oBAAoB,CAAA;AAE3B,wBAAgB,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CAyDxD"}
1
+ {"version":3,"file":"ViewSelector.d.ts","sourceRoot":"","sources":["../../src/field/ViewSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,oBAAoB,CAAA;AAE3B,wBAAgB,YAAY,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CA0DxD"}
@@ -44,6 +44,7 @@ export function ViewSelector() {
44
44
  }),
45
45
  buttonType: "custom",
46
46
  horizontalAlign: "left",
47
+ popupType: "menu",
47
48
  render: t2 => {
48
49
  const {
49
50
  close
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSelector.js","names":["c","_c","ChevronIcon","Popup","PopupList","React","useRichTextView","ViewSelector","$","currentView","setCurrentView","views","Object","keys","length","t0","t1","Symbol","for","bb0","viewKeys","hasNonDefaultViews","some","_temp","allViews","filter","_temp2","currentViewLabel","charAt","toUpperCase","slice","_jsx","className","children","button","_jsxs","type","horizontalAlign","render","t2","close","ButtonGroup","map","viewName","viewLabel","Button","active","disabled","onClick","key_0","key"],"sources":["../../src/field/ViewSelector.tsx"],"sourcesContent":["'use client'\nimport { ChevronIcon, Popup, PopupList } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport './ViewSelector.css'\n\nexport function ViewSelector(): null | React.ReactElement {\n const { currentView, setCurrentView, views } = useRichTextView()\n\n // Don't show if no views or only default exists\n if (!views || Object.keys(views).length === 0) {\n return null\n }\n\n const viewKeys = Object.keys(views)\n const hasNonDefaultViews = viewKeys.some((key) => key !== 'default')\n\n // If only 'default' exists, no need to show selector\n if (!hasNonDefaultViews) {\n return null\n }\n\n // Build list of available views\n const allViews = ['default', ...viewKeys.filter((key) => key !== 'default')]\n\n const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1)\n\n return (\n <div className=\"lexical-view-selector\">\n <Popup\n button={\n <button className=\"lexical-view-selector__button\" type=\"button\">\n <span className=\"lexical-view-selector__label\">{currentViewLabel}</span>\n <ChevronIcon className=\"lexical-view-selector__icon\" />\n </button>\n }\n buttonType=\"custom\"\n horizontalAlign=\"left\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {allViews.map((viewName) => {\n const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1)\n\n return (\n <PopupList.Button\n active={viewName === currentView}\n disabled={viewName === currentView}\n key={viewName}\n onClick={() => {\n setCurrentView?.(viewName)\n close()\n }}\n >\n {viewLabel}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ;AAC9C,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAChC,OAAO;AAEP,OAAO,SAAAC,aAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL;IAAAQ,WAAA;IAAAC,cAAA;IAAAC;EAAA,IAA+CL,eAAA;EAAA,IAG3C,CAACK,KAAA,IAASC,MAAA,CAAAC,IAAA,CAAYF,KAAA,EAAAG,MAAA,MAAkB;IAAA;EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,WAAA,IAAAD,CAAA,QAAAE,cAAA,IAAAF,CAAA,QAAAG,KAAA;IASnCK,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MALT,MAAAC,QAAA,GAAiBR,MAAA,CAAAC,IAAA,CAAYF,KAAA;MAC7B,MAAAU,kBAAA,GAA2BD,QAAA,CAAAE,IAAA,CAAAC,KAA+B;MAAA,KAGrDF,kBAAA;QACIL,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIT,MAAAK,QAAA,IAAkB,cAAcJ,QAAA,CAAAK,MAAA,CAAAC,MAAiC;MAEjE,MAAAC,gBAAA,GAAyBlB,WAAA,CAAAmB,MAAA,EAAmB,EAAAC,WAAA,CAAc,IAAKpB,WAAA,CAAAqB,KAAA,EAAkB;MAG/Ef,EAAA,GAAAgB,IAAA,CAAC;QAAAC,SAAA,EAAc;QAAAC,QAAA,EACbF,IAAA,CAAA5B,KAAA;UAAA+B,MAAA,EAEIC,KAAA,CAAC;YAAAH,SAAA,EAAiB;YAAAI,IAAA,EAAqC;YAAAH,QAAA,GACrDF,IAAA,CAAC;cAAAC,SAAA,EAAe;cAAAC,QAAA,EAAgCN;YAAA,C,GAChDI,IAAA,CAAA7B,WAAA;cAAA8B,SAAA,EAAuB;YAAA,C;;sBAGhB;UAAAK,eAAA,EACK;UAAAC,MAAA,EAAAC,EAAA;YACP;cAAAC;YAAA,IAAAD,EAAS;YAAA,OAChBR,IAAA,CAAA3B,SAAA,CAAAqC,WAAA;cAAAR,QAAA,EACGT,QAAA,CAAAkB,GAAA,CAAAC,QAAA;gBACC,MAAAC,SAAA,GAAkBD,QAAA,CAAAf,MAAA,EAAgB,EAAAC,WAAA,CAAc,IAAKc,QAAA,CAAAb,KAAA,EAAe;gBAAA,OAGlEC,IAAA,CAAA3B,SAAA,CAAAyC,MAAA;kBAAAC,MAAA,EACUH,QAAA,KAAalC,WAAA;kBAAAsC,QAAA,EACXJ,QAAA,KAAalC,WAAA;kBAAAuC,OAAA,EAAAA,CAAA;oBAGrBtC,cAAA,GAAiBiC,QAAA;oBACjBH,KAAA;kBAAA;kBAAAP,QAAA,EAGDW;gBAAA,GANID,QAAA;cAAA,CASX;YAAA,C;;gBAGC;QAAA,C;;;;;;;;;;;;;;;SA/BT5B,E;;AAtBG,SAAAW,OAAAuB,KAAA;EAAA,OAiBoDC,KAAA,KAAQ;AAAA;AAjB5D,SAAA3B,MAAA2B,GAAA;EAAA,OAS6CA,GAAA,KAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"ViewSelector.js","names":["c","_c","ChevronIcon","Popup","PopupList","React","useRichTextView","ViewSelector","$","currentView","setCurrentView","views","Object","keys","length","t0","t1","Symbol","for","bb0","viewKeys","hasNonDefaultViews","some","_temp","allViews","filter","_temp2","currentViewLabel","charAt","toUpperCase","slice","_jsx","className","children","button","_jsxs","type","horizontalAlign","popupType","render","t2","close","ButtonGroup","map","viewName","viewLabel","Button","active","disabled","onClick","key_0","key"],"sources":["../../src/field/ViewSelector.tsx"],"sourcesContent":["'use client'\nimport { ChevronIcon, Popup, PopupList } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport './ViewSelector.css'\n\nexport function ViewSelector(): null | React.ReactElement {\n const { currentView, setCurrentView, views } = useRichTextView()\n\n // Don't show if no views or only default exists\n if (!views || Object.keys(views).length === 0) {\n return null\n }\n\n const viewKeys = Object.keys(views)\n const hasNonDefaultViews = viewKeys.some((key) => key !== 'default')\n\n // If only 'default' exists, no need to show selector\n if (!hasNonDefaultViews) {\n return null\n }\n\n // Build list of available views\n const allViews = ['default', ...viewKeys.filter((key) => key !== 'default')]\n\n const currentViewLabel = currentView.charAt(0).toUpperCase() + currentView.slice(1)\n\n return (\n <div className=\"lexical-view-selector\">\n <Popup\n button={\n <button className=\"lexical-view-selector__button\" type=\"button\">\n <span className=\"lexical-view-selector__label\">{currentViewLabel}</span>\n <ChevronIcon className=\"lexical-view-selector__icon\" />\n </button>\n }\n buttonType=\"custom\"\n horizontalAlign=\"left\"\n popupType=\"menu\"\n render={({ close }) => (\n <PopupList.ButtonGroup>\n {allViews.map((viewName) => {\n const viewLabel = viewName.charAt(0).toUpperCase() + viewName.slice(1)\n\n return (\n <PopupList.Button\n active={viewName === currentView}\n disabled={viewName === currentView}\n key={viewName}\n onClick={() => {\n setCurrentView?.(viewName)\n close()\n }}\n >\n {viewLabel}\n </PopupList.Button>\n )\n })}\n </PopupList.ButtonGroup>\n )}\n size=\"large\"\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,WAAW,EAAEC,KAAK,EAAEC,SAAS,QAAQ;AAC9C,OAAOC,KAAA,MAAW;AAElB,SAASC,eAAe,QAAQ;AAChC,OAAO;AAEP,OAAO,SAAAC,aAAA;EAAA,MAAAC,CAAA,GAAA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