@payloadcms/richtext-lexical 4.0.0-internal.43ccea7 → 4.0.0-internal.44ac9c8

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 (472) hide show
  1. package/dist/exports/client/Field-BPLEYPXV.js +2 -0
  2. package/dist/exports/client/Field-BPLEYPXV.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-43E5QYAA.js +2 -0
  5. package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
  6. package/dist/exports/client/chunk-LN6VX25I.js +2 -0
  7. package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
  8. package/dist/exports/client/component-D5QLYS7W.js +2 -0
  9. package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
  10. package/dist/exports/client/index.d.ts +1 -1
  11. package/dist/exports/client/index.d.ts.map +1 -1
  12. package/dist/exports/client/index.js +27 -27
  13. package/dist/exports/client/index.js.map +4 -4
  14. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  15. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  16. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  17. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  18. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  19. package/dist/features/blocks/client/component/index.d.ts +0 -6
  20. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  21. package/dist/features/blocks/client/component/index.js +126 -69
  22. package/dist/features/blocks/client/component/index.js.map +1 -1
  23. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  24. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  25. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  26. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  27. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  28. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  29. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  30. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  32. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  33. package/dist/features/blocks/server/index.js +2 -2
  34. package/dist/features/blocks/server/index.js.map +1 -1
  35. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  36. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  37. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  38. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  39. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  40. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  41. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  42. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  43. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  44. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  45. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  46. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  47. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  48. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  49. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  50. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  51. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  52. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  53. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  54. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  55. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  56. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  57. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  58. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  59. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  60. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  61. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  62. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  63. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  64. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  65. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  66. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  67. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  68. package/dist/features/heading/constants.d.ts +2 -0
  69. package/dist/features/heading/constants.d.ts.map +1 -0
  70. package/dist/features/heading/constants.js +2 -0
  71. package/dist/features/heading/constants.js.map +1 -0
  72. package/dist/features/heading/server/index.d.ts.map +1 -1
  73. package/dist/features/heading/server/index.js +5 -1
  74. package/dist/features/heading/server/index.js.map +1 -1
  75. package/dist/features/heading/server/schema.d.ts.map +1 -1
  76. package/dist/features/heading/server/validate.d.ts +6 -0
  77. package/dist/features/heading/server/validate.d.ts.map +1 -0
  78. package/dist/features/heading/server/validate.js +15 -0
  79. package/dist/features/heading/server/validate.js.map +1 -0
  80. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  81. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  82. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
  83. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  84. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  85. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  86. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  87. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  88. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  89. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  90. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +1 -0
  91. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  92. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  93. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  94. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  95. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  96. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  97. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  98. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  99. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  100. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  101. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  102. package/dist/features/link/server/index.js +2 -2
  103. package/dist/features/link/server/index.js.map +1 -1
  104. package/dist/features/link/server/schema.d.ts.map +1 -1
  105. package/dist/features/link/server/validate.d.ts.map +1 -1
  106. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  107. package/dist/features/lists/checklist/server/index.js +5 -2
  108. package/dist/features/lists/checklist/server/index.js.map +1 -1
  109. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  110. package/dist/features/lists/orderedList/server/index.js +5 -2
  111. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  112. package/dist/features/lists/shared/constants.d.ts +2 -0
  113. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  114. package/dist/features/lists/shared/constants.js +2 -0
  115. package/dist/features/lists/shared/constants.js.map +1 -0
  116. package/dist/features/lists/shared/validate.d.ts +5 -0
  117. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  118. package/dist/features/lists/shared/validate.js +15 -0
  119. package/dist/features/lists/shared/validate.js.map +1 -0
  120. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  121. package/dist/features/lists/unorderedList/server/index.js +5 -2
  122. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  123. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  124. package/dist/features/relationship/client/index.d.ts +2 -2
  125. package/dist/features/relationship/client/index.d.ts.map +1 -1
  126. package/dist/features/relationship/client/index.js.map +1 -1
  127. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  128. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  129. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  130. package/dist/features/relationship/client/plugins/index.js +27 -31
  131. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  132. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  133. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  134. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  135. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  136. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  137. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  138. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  139. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  140. package/dist/features/relationship/server/index.d.ts +8 -1
  141. package/dist/features/relationship/server/index.d.ts.map +1 -1
  142. package/dist/features/relationship/server/index.js +28 -11
  143. package/dist/features/relationship/server/index.js.map +1 -1
  144. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  145. package/dist/features/relationship/server/schema.d.ts +2 -2
  146. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  147. package/dist/features/relationship/server/schema.js +5 -10
  148. package/dist/features/relationship/server/schema.js.map +1 -1
  149. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  150. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  151. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  152. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  153. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  154. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  155. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  156. package/dist/features/table/client/index.d.ts.map +1 -0
  157. package/dist/features/table/client/index.js.map +1 -0
  158. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  159. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  160. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  161. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  162. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  163. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  164. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  165. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  166. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  167. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  168. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  169. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  170. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  171. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  172. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  173. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  174. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  175. package/dist/features/table/client/utils/debounce.js.map +1 -0
  176. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  177. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  178. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  179. package/dist/features/table/markdownTransformer.js.map +1 -0
  180. package/dist/features/table/server/index.d.ts +3 -0
  181. package/dist/features/table/server/index.d.ts.map +1 -0
  182. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  183. package/dist/features/table/server/index.js.map +1 -0
  184. package/dist/features/table/server/schema.d.ts.map +1 -0
  185. package/dist/features/table/server/schema.js.map +1 -0
  186. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  187. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  188. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  189. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  190. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  191. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  192. package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
  193. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  194. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  195. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  196. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  197. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  198. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  199. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  200. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  201. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -13
  202. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  203. package/dist/features/typesServer.d.ts +1 -1
  204. package/dist/features/typesServer.d.ts.map +1 -1
  205. package/dist/features/typesServer.js.map +1 -1
  206. package/dist/features/upload/client/component/index.js +2 -1
  207. package/dist/features/upload/client/component/index.js.map +1 -1
  208. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  209. package/dist/features/upload/client/index.d.ts +3 -2
  210. package/dist/features/upload/client/index.d.ts.map +1 -1
  211. package/dist/features/upload/client/index.js.map +1 -1
  212. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  213. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  214. package/dist/features/upload/client/plugin/index.js +47 -52
  215. package/dist/features/upload/client/plugin/index.js.map +1 -1
  216. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  217. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  218. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  219. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  220. package/dist/features/upload/server/index.d.ts +6 -2
  221. package/dist/features/upload/server/index.d.ts.map +1 -1
  222. package/dist/features/upload/server/index.js +20 -16
  223. package/dist/features/upload/server/index.js.map +1 -1
  224. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  225. package/dist/features/upload/server/schema.d.ts +2 -2
  226. package/dist/features/upload/server/schema.d.ts.map +1 -1
  227. package/dist/features/upload/server/schema.js +4 -8
  228. package/dist/features/upload/server/schema.js.map +1 -1
  229. package/dist/features/upload/server/validate.d.ts +2 -2
  230. package/dist/features/upload/server/validate.d.ts.map +1 -1
  231. package/dist/features/upload/server/validate.js +3 -0
  232. package/dist/features/upload/server/validate.js.map +1 -1
  233. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  234. package/dist/field/Diff/converters/listitem/index.js +2 -1
  235. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  236. package/dist/field/Diff/index.d.ts +3 -2
  237. package/dist/field/Diff/index.d.ts.map +1 -1
  238. package/dist/field/Diff/index.js +1 -0
  239. package/dist/field/Diff/index.js.map +1 -1
  240. package/dist/field/Field.d.ts.map +1 -1
  241. package/dist/field/Field.js +18 -15
  242. package/dist/field/Field.js.map +1 -1
  243. package/dist/field/RenderLexical/index.d.ts +3 -1
  244. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  245. package/dist/field/RenderLexical/index.js +23 -23
  246. package/dist/field/RenderLexical/index.js.map +1 -1
  247. package/dist/field/ViewSelector.d.ts.map +1 -1
  248. package/dist/field/ViewSelector.js +1 -0
  249. package/dist/field/ViewSelector.js.map +1 -1
  250. package/dist/field/bundled.css +1 -1
  251. package/dist/field/index.css +10 -10
  252. package/dist/i18n.d.ts.map +1 -1
  253. package/dist/i18n.js +68 -0
  254. package/dist/i18n.js.map +1 -1
  255. package/dist/index.d.ts +2 -2
  256. package/dist/index.d.ts.map +1 -1
  257. package/dist/index.js +5 -5
  258. package/dist/index.js.map +1 -1
  259. package/dist/lexical/LexicalEditor.css +18 -18
  260. package/dist/lexical/LexicalEditor.js.map +1 -1
  261. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  262. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  263. package/dist/lexical/config/server/loader.d.ts +1 -1
  264. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  265. package/dist/lexical/config/server/loader.js +2 -2
  266. package/dist/lexical/config/server/loader.js.map +1 -1
  267. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  268. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  269. package/dist/lexical/config/server/sanitize.js +2 -2
  270. package/dist/lexical/config/server/sanitize.js.map +1 -1
  271. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
  272. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  273. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  274. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  275. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  276. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  277. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  278. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  279. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  280. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -20
  281. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  282. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  283. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  284. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
  285. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  286. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  287. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  288. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  289. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  290. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  291. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  292. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  293. package/dist/lexical/ui/ContentEditable.css +19 -14
  294. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  295. package/dist/lexical/ui/icons/H3/index.js +13 -6
  296. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  297. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  298. package/dist/lexical/ui/icons/H4/index.js +13 -6
  299. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  300. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  301. package/dist/lexical/ui/icons/H5/index.js +13 -6
  302. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  303. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  304. package/dist/lexical/ui/icons/H6/index.js +13 -6
  305. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  306. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  307. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  308. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  309. package/dist/lexical/utils/point.d.ts.map +1 -1
  310. package/dist/lexical/utils/rect.d.ts.map +1 -1
  311. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  312. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  313. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  314. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  315. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  316. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  317. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  318. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  319. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  320. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  321. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  322. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  323. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  324. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  325. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  326. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  327. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  328. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  329. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  330. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  331. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  332. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  333. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  334. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  335. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  336. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  337. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  338. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  339. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  340. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  341. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  342. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  343. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  344. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  345. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  346. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  347. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  348. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  349. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  350. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  351. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  352. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  353. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  354. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  355. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  356. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  357. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  358. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  359. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  360. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  361. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  362. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  363. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  364. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  365. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  366. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  367. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  368. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  369. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  370. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  371. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  372. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  373. package/dist/types/index.d.ts +1 -1
  374. package/dist/types/index.d.ts.map +1 -1
  375. package/dist/types/index.js.map +1 -1
  376. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  377. package/dist/types/nodeTypes.d.ts +1 -1
  378. package/dist/types/nodeTypes.d.ts.map +1 -1
  379. package/dist/types/nodeTypes.js.map +1 -1
  380. package/dist/utilities/createServerFeature.d.ts +1 -1
  381. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  382. package/dist/utilities/createServerFeature.js +2 -2
  383. package/dist/utilities/createServerFeature.js.map +1 -1
  384. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  385. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  386. package/dist/utilities/editorConfigFactory.js +9 -9
  387. package/dist/utilities/editorConfigFactory.js.map +1 -1
  388. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  389. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  390. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  391. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  392. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  393. package/dist/utilities/generateImportMap.d.ts +1 -1
  394. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  395. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  396. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  397. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  398. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  399. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  400. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  401. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  402. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  403. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  404. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  405. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  406. package/dist/validate/index.d.ts.map +1 -1
  407. package/package.json +96 -23
  408. package/dist/dependencyChecker.spec.js +0 -16
  409. package/dist/dependencyChecker.spec.js.map +0 -1
  410. package/dist/exports/client/Field-XH5C4HFU.js +0 -2
  411. package/dist/exports/client/Field-XH5C4HFU.js.map +0 -7
  412. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  413. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  414. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  415. package/dist/exports/client/chunk-X3D4LZS7.js.map +0 -7
  416. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  417. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  418. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  419. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  420. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  421. package/dist/features/experimental_table/client/index.js.map +0 -1
  422. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  423. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  424. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  425. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  426. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  427. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  428. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  429. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  430. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  431. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  432. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  433. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  434. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  435. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  436. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  437. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  438. package/dist/features/experimental_table/server/index.d.ts +0 -3
  439. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  440. package/dist/features/experimental_table/server/index.js.map +0 -1
  441. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  442. package/dist/features/experimental_table/server/schema.js.map +0 -1
  443. package/dist/features/link/markdownTransformer.spec.js +0 -195
  444. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  445. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  446. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  447. package/dist/lexical/utils/url.spec.js +0 -114
  448. package/dist/lexical/utils/url.spec.js.map +0 -1
  449. package/dist/utilities/jsx/jsx.spec.js +0 -178
  450. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  451. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  452. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  453. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
  454. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  455. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  456. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  457. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  458. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  459. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
  460. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  461. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  462. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  463. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  464. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  465. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  466. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  467. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  468. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  469. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  470. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  471. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  472. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -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,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,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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":["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 <div className={`${baseClass}__editor-content`}>\n {/* Lexical may be in a drawer. We need to define another BulkUploadProvider to ensure that the bulk upload drawer\n is rendered in the correct depth (not displayed *behind* the current drawer).\n The `lexical-` prefix prevents drawer-slug collisions with non-lexical `BulkUploadProvider`s up the tree. */}\n <BulkUploadProvider modalSlugPrefix={`lexical-${path}`}>\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n isSmallWidthViewport={isSmallWidthViewport}\n key={JSON.stringify({ path, rerenderProviderKey })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n rtl={rtl}\n value={value}\n />\n </BulkUploadProvider>\n </div>\n {AfterInput}\n </ErrorBoundary>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }: FallbackProps) {\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error instanceof Error ? error.message : String(error)}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = RichTextComponent\n"],"mappings":"AAAA;;;AAIA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,QAAQ,EACRC,SAAS,QACJ;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,QAAQ;AAEvB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAI9B,OAAO;AACP,OAAO;AACP,OAAO;AAIP,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,MA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,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":[]}
@@ -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,CAAA;AACvB,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE;AAClC;;;GAGG;AACH;IACE;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAE5B,QAAQ,CAAC,EAAE,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAA;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA;CAChE,GAAG,uBAAuB,CAAC,oBAAoB,CAAC,CA4FlD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/RenderLexical/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,uBAAuB,EAK7B,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE;AAClC;;;GAGG;AACH;IACE,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAE5B,QAAQ,CAAC,EAAE,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAA;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAA;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,UAAUA,KAAA,GAAQA,KAAA,EAAAgB,IAAA,GAAc,EAAC,KAAM;EAAA,IAAAC,EAAA;EAAA,IAAAlB,CAAA,QAAAY,qBAAA,IAAAZ,CAAA,QAAAC,KAAA,IAAAD,CAAA,QAAAE,YAAA,IAAAF,CAAA,QAAAI,IAAA,IAAAJ,CAAA,QAAAK,UAAA;IAEzCa,EAAA,GAAAA,CAAA;MAChC,MAAAC,MAAA,kBAAAA,OAAA;QACE;UAAAC;QAAA,UAAwBR,qBAAA;UAAAX,KAAA;YAAA,IAEhBA,KAAC,MAA6B;YAAAoB,IAAA,EAC5B;YAAAC,KAAA;cAAA,I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rD;EAAA;EAEJ,IAEI,OAAOjB,KAAA,KAAU,gBAAgBD,QAAA;IAAA,OAEjCwB,IAAA,CAAAvC,sBAAA;MAAAgB,KAAA;QAAA,GAAoCwB;MAA6B;MAAAK,QAAA,EAC/DN,IAAA,CAAAxC,gBAAA;QAAAiB,KAAA,EAAyCS,SAAA;QAAAoB,QAAA,EACtC5B;MAAA,GADoBQ,SAAA;IAAA,C;;EAO7B,MAAAqB,UAAA;IAAAC,QAAA;IAAAC,gBAAA;IAAAC,cAAA;IAAAC,aAAA;IAAAvC,YAAA,EAKgBK,KAAA;IAAAH,IAAA,EACRY,SAAA;IAAAV,QAAA,EACIA,QAAA,IAAAoC,KAA2B;IAAAC,SAAA;IAAApC;EAAA;EAGvC,OAGEuB,IAAA,CAAAvC,sBAAA;IAAAgB,KAAA;MAAA,GAAoCwB;IAA6B;IAAAK,QAAA,EAC/DN,IAAA,CAAAxC,gBAAA;MAAAiB,KAAA,EAAyCS,SAAA;MAAAoB,QAAA,EACvCN,IAAA,CAAAzC,YAAA;QAAAkB,KAAA,EAAqB8B,UAAA;QAAAD,QAAA,EAAa5B;MAAA,C;OADbQ,SAAA;EAAA,C;CAK7B;AA3FI,SAAA0B,MAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","FieldContext","FieldPathContext","ServerFunctionsContext","ShimmerEffect","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;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,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,GAgBTC,IAAA;EAAA,MAAAC,CAAA,GAAAZ,EAAA;EACF;IAAAa,IAAA;IAAAC,KAAA;IAAAC,YAAA;IAAAC,KAAA;IAAAC,OAAA;IAAAC,IAAA;IAAAC,UAAA;IAAAC,QAAA;IAAAC;EAAA,IAAyFV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AA,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 +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,IA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BAAA,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,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,QA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