@payloadcms/richtext-lexical 3.0.0-beta.35 → 3.0.0-beta.37

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 (406) hide show
  1. package/dist/cell/index.d.ts +2 -0
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +24 -15
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/Field.d.ts.map +1 -1
  6. package/dist/field/Field.js +66 -47
  7. package/dist/field/Field.js.map +1 -1
  8. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/align/feature.client.js +12 -4
  10. package/dist/field/features/align/feature.client.js.map +1 -1
  11. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/align/feature.server.js +2 -0
  13. package/dist/field/features/align/feature.server.js.map +1 -1
  14. package/dist/field/features/align/i18n.d.ts +3 -0
  15. package/dist/field/features/align/i18n.d.ts.map +1 -0
  16. package/dist/field/features/align/i18n.js +196 -0
  17. package/dist/field/features/align/i18n.js.map +1 -0
  18. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  19. package/dist/field/features/blockquote/feature.client.js +22 -21
  20. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  21. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  22. package/dist/field/features/blockquote/feature.server.js +2 -0
  23. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  24. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  25. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  26. package/dist/field/features/blockquote/i18n.js +100 -0
  27. package/dist/field/features/blockquote/i18n.js.map +1 -0
  28. package/dist/field/features/blocks/component/BlockContent.js +62 -45
  29. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  30. package/dist/field/features/blocks/component/index.js +38 -28
  31. package/dist/field/features/blocks/component/index.js.map +1 -1
  32. package/dist/field/features/blocks/drawer/index.js +2 -1
  33. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  34. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  35. package/dist/field/features/blocks/feature.client.js +3 -1
  36. package/dist/field/features/blocks/feature.client.js.map +1 -1
  37. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  38. package/dist/field/features/blocks/feature.server.js +2 -0
  39. package/dist/field/features/blocks/feature.server.js.map +1 -1
  40. package/dist/field/features/blocks/i18n.d.ts +3 -0
  41. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  42. package/dist/field/features/blocks/i18n.js +100 -0
  43. package/dist/field/features/blocks/i18n.js.map +1 -0
  44. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -1
  45. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  46. package/dist/field/features/blocks/nodes/BlocksNode.js +2 -1
  47. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  48. package/dist/field/features/blocks/plugin/index.js +2 -1
  49. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  50. package/dist/field/features/blocks/populationPromise.js +1 -1
  51. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  52. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  53. package/dist/field/features/converters/html/field/index.js +30 -2
  54. package/dist/field/features/converters/html/field/index.js.map +1 -1
  55. package/dist/field/features/debug/testRecorder/plugin/index.js +65 -39
  56. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  57. package/dist/field/features/debug/treeView/plugin/index.js +2 -1
  58. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  59. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  60. package/dist/field/features/heading/feature.client.js +26 -21
  61. package/dist/field/features/heading/feature.client.js.map +1 -1
  62. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  63. package/dist/field/features/heading/feature.server.js +2 -0
  64. package/dist/field/features/heading/feature.server.js.map +1 -1
  65. package/dist/field/features/heading/i18n.d.ts +3 -0
  66. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  67. package/dist/field/features/heading/i18n.js +100 -0
  68. package/dist/field/features/heading/i18n.js.map +1 -0
  69. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/horizontalRule/feature.client.js +21 -20
  71. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  72. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -1
  73. package/dist/field/features/horizontalRule/feature.server.js +2 -0
  74. package/dist/field/features/horizontalRule/feature.server.js.map +1 -1
  75. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  76. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  77. package/dist/field/features/horizontalRule/i18n.js +100 -0
  78. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  79. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +2 -1
  80. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  81. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  82. package/dist/field/features/indent/feature.client.js +6 -2
  83. package/dist/field/features/indent/feature.client.js.map +1 -1
  84. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  85. package/dist/field/features/indent/feature.server.js +2 -0
  86. package/dist/field/features/indent/feature.server.js.map +1 -1
  87. package/dist/field/features/indent/i18n.d.ts +3 -0
  88. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  89. package/dist/field/features/indent/i18n.js +132 -0
  90. package/dist/field/features/indent/i18n.js.map +1 -0
  91. package/dist/field/features/link/drawer/index.js +30 -22
  92. package/dist/field/features/link/drawer/index.js.map +1 -1
  93. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  94. package/dist/field/features/link/feature.client.js +7 -1
  95. package/dist/field/features/link/feature.client.js.map +1 -1
  96. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  97. package/dist/field/features/link/feature.server.js +10 -2
  98. package/dist/field/features/link/feature.server.js.map +1 -1
  99. package/dist/field/features/link/i18n.d.ts +3 -0
  100. package/dist/field/features/link/i18n.d.ts.map +1 -0
  101. package/dist/field/features/link/i18n.js +100 -0
  102. package/dist/field/features/link/i18n.js.map +1 -0
  103. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  104. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  105. package/dist/field/features/link/markdownTransformer.js +50 -0
  106. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  107. package/dist/field/features/link/plugins/clickableLink/index.js +2 -1
  108. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  109. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  110. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +88 -70
  111. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  112. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  113. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  114. package/dist/field/features/link/populationPromise.js +1 -1
  115. package/dist/field/features/link/populationPromise.js.map +1 -1
  116. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  117. package/dist/field/features/lists/checklist/feature.client.js +21 -20
  118. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  119. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  120. package/dist/field/features/lists/checklist/feature.server.js +2 -0
  121. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  122. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  123. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  124. package/dist/field/features/lists/checklist/i18n.js +100 -0
  125. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  126. package/dist/field/features/lists/checklist/plugin/index.js +2 -1
  127. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  128. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  129. package/dist/field/features/lists/orderedList/feature.client.js +19 -18
  130. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  131. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -1
  132. package/dist/field/features/lists/orderedList/feature.server.js +3 -1
  133. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -1
  134. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  135. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  136. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  137. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  138. package/dist/field/features/lists/plugin/index.js +2 -1
  139. package/dist/field/features/lists/plugin/index.js.map +1 -1
  140. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  141. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  142. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  143. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  144. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  145. package/dist/field/features/lists/unorderedList/feature.client.js +19 -18
  146. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  147. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -1
  148. package/dist/field/features/lists/unorderedList/feature.server.js +2 -0
  149. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -1
  150. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  151. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  152. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  153. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  154. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  155. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  156. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  157. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  158. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -1
  159. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  160. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  161. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  162. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  163. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  164. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -1
  165. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  166. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  167. package/dist/field/features/paragraph/feature.client.js +24 -23
  168. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  169. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  170. package/dist/field/features/paragraph/feature.server.js +2 -0
  171. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  172. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  173. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  174. package/dist/field/features/paragraph/i18n.js +132 -0
  175. package/dist/field/features/paragraph/i18n.js.map +1 -0
  176. package/dist/field/features/relationship/drawer/index.js +10 -2
  177. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  178. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/relationship/feature.client.js +23 -22
  180. package/dist/field/features/relationship/feature.client.js.map +1 -1
  181. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/relationship/feature.server.js +2 -0
  183. package/dist/field/features/relationship/feature.server.js.map +1 -1
  184. package/dist/field/features/relationship/i18n.d.ts +3 -0
  185. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  186. package/dist/field/features/relationship/i18n.js +100 -0
  187. package/dist/field/features/relationship/i18n.js.map +1 -0
  188. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +1 -1
  189. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  190. package/dist/field/features/relationship/nodes/RelationshipNode.js +2 -1
  191. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  192. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +64 -44
  193. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  194. package/dist/field/features/relationship/plugins/index.js +2 -1
  195. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  196. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  197. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  198. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  199. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  200. package/dist/field/features/toolbars/fixed/Toolbar/index.js +60 -55
  201. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  202. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +16 -2
  203. package/dist/field/features/toolbars/inline/Toolbar/index.js +57 -49
  204. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
  205. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  206. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  207. package/dist/field/features/toolbars/shared/ToolbarButton/index.js +5 -3
  208. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  209. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  210. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +54 -35
  211. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  212. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  213. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  214. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +25 -22
  215. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  216. package/dist/field/features/toolbars/types.d.ts +1 -1
  217. package/dist/field/features/toolbars/types.d.ts.map +1 -1
  218. package/dist/field/features/toolbars/types.js.map +1 -1
  219. package/dist/field/features/types.d.ts +21 -2
  220. package/dist/field/features/types.d.ts.map +1 -1
  221. package/dist/field/features/types.js.map +1 -1
  222. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +30 -22
  223. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  224. package/dist/field/features/upload/component/index.js +104 -71
  225. package/dist/field/features/upload/component/index.js.map +1 -1
  226. package/dist/field/features/upload/drawer/index.js +8 -4
  227. package/dist/field/features/upload/drawer/index.js.map +1 -1
  228. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  229. package/dist/field/features/upload/feature.client.js +26 -25
  230. package/dist/field/features/upload/feature.client.js.map +1 -1
  231. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  232. package/dist/field/features/upload/feature.server.js +2 -0
  233. package/dist/field/features/upload/feature.server.js.map +1 -1
  234. package/dist/field/features/upload/i18n.d.ts +3 -0
  235. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  236. package/dist/field/features/upload/i18n.js +100 -0
  237. package/dist/field/features/upload/i18n.js.map +1 -0
  238. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -1
  239. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  240. package/dist/field/features/upload/nodes/UploadNode.js +2 -1
  241. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  242. package/dist/field/features/upload/plugin/index.js +2 -1
  243. package/dist/field/features/upload/plugin/index.js.map +1 -1
  244. package/dist/field/features/upload/populationPromise.js +1 -1
  245. package/dist/field/features/upload/populationPromise.js.map +1 -1
  246. package/dist/field/index.d.ts +2 -0
  247. package/dist/field/index.d.ts.map +1 -1
  248. package/dist/field/index.js +29 -21
  249. package/dist/field/index.js.map +1 -1
  250. package/dist/field/index.scss +0 -19
  251. package/dist/field/lexical/EditorFocusProvider.d.ts +1 -2
  252. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -1
  253. package/dist/field/lexical/EditorFocusProvider.js +5 -3
  254. package/dist/field/lexical/EditorFocusProvider.js.map +1 -1
  255. package/dist/field/lexical/EditorPlugin.js +3 -2
  256. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  257. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  258. package/dist/field/lexical/LexicalEditor.js +115 -81
  259. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  260. package/dist/field/lexical/LexicalEditor.scss +10 -1
  261. package/dist/field/lexical/LexicalProvider.js +16 -10
  262. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  263. package/dist/field/lexical/config/client/EditorConfigProvider.js +5 -3
  264. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  265. package/dist/field/lexical/config/client/sanitize.d.ts +2 -1
  266. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  267. package/dist/field/lexical/config/client/sanitize.js +2 -1
  268. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  269. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  270. package/dist/field/lexical/config/server/sanitize.js +11 -0
  271. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  272. package/dist/field/lexical/config/types.d.ts +2 -0
  273. package/dist/field/lexical/config/types.d.ts.map +1 -1
  274. package/dist/field/lexical/config/types.js.map +1 -1
  275. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +2 -1
  276. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  277. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +1 -1
  278. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  279. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  282. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -1
  283. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  284. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +2 -2
  285. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  286. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  287. package/dist/field/lexical/plugins/SlashMenu/index.js +51 -40
  288. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  289. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  290. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  291. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +38 -119
  292. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  293. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  294. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  295. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  297. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  298. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +102 -58
  300. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  301. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +12 -3
  302. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  303. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  304. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +73 -25
  305. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  306. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  307. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  308. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  309. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  310. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +4 -0
  311. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  312. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +2 -14
  313. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  314. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  315. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  316. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  317. package/dist/field/lexical/theme/EditorTheme.scss +5 -0
  318. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  319. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  320. package/dist/field/lexical/ui/ContentEditable.js +2 -1
  321. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  322. package/dist/field/lexical/ui/ContentEditable.scss +50 -2
  323. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  324. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  325. package/dist/field/lexical/ui/icons/Add/index.js +14 -9
  326. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -1
  327. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  328. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  329. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  330. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  331. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  332. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  333. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  334. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  335. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  336. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  337. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  338. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  339. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  340. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  341. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  342. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  343. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  344. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  345. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  346. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  347. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  348. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  349. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  350. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  351. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  352. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  353. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  354. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  356. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  357. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  358. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  359. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  360. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  361. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  362. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  363. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  364. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  365. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  366. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  367. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  368. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  369. package/dist/field/lexical/ui/icons/Link/index.js +26 -17
  370. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  371. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  372. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  373. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  374. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  375. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  376. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  377. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  378. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  379. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  380. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  381. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  382. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  383. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  384. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  385. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  386. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  387. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  388. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  389. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  390. package/dist/field/lexical/utils/url.js +10 -2
  391. package/dist/field/lexical/utils/url.js.map +1 -1
  392. package/dist/generateComponentMap.js +8 -8
  393. package/dist/generateComponentMap.js.map +1 -1
  394. package/dist/i18n.d.ts +3 -0
  395. package/dist/i18n.d.ts.map +1 -0
  396. package/dist/i18n.js +164 -0
  397. package/dist/i18n.js.map +1 -0
  398. package/dist/index.d.ts.map +1 -1
  399. package/dist/index.js +13 -0
  400. package/dist/index.js.map +1 -1
  401. package/dist/types.d.ts +7 -0
  402. package/dist/types.d.ts.map +1 -1
  403. package/dist/types.js.map +1 -1
  404. package/package.json +20 -15
  405. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  406. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
@@ -1,6 +1,8 @@
1
1
  import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import React from 'react';
3
+ import type { LexicalFieldAdminProps } from '../types.js';
3
4
  export declare const RichTextCell: React.FC<{
5
+ admin?: LexicalFieldAdminProps;
4
6
  lexicalEditorConfig: LexicalEditorConfig;
5
7
  }>;
6
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAOlE,OAAO,KAA8B,MAAM,OAAO,CAAA;AAWlD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,CA0JA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAOlE,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD,OAAO,KAAK,EAAqC,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAO5F,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,KAAK,CAAC,EAAE,sBAAsB,CAAA;IAC9B,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,CA4JA,CAAA"}
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createHeadlessEditor } from '@lexical/headless';
3
4
  import { useTableCell } from '@payloadcms/ui/elements/Table';
4
5
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
@@ -10,7 +11,7 @@ import { loadClientFeatures } from '../field/lexical/config/client/loader.js';
10
11
  import { sanitizeClientEditorConfig } from '../field/lexical/config/client/sanitize.js';
11
12
  import { getEnabledNodes } from '../field/lexical/nodes/index.js';
12
13
  export const RichTextCell = (props)=>{
13
- const { lexicalEditorConfig } = props;
14
+ const { admin, lexicalEditorConfig } = props;
14
15
  const [preview, setPreview] = React.useState('Loading...');
15
16
  const { schemaPath } = useFieldProps();
16
17
  const { cellData, richTextComponentMap } = useTableCell();
@@ -48,10 +49,11 @@ export const RichTextCell = (props)=>{
48
49
  lexical: lexicalEditorConfig
49
50
  }
50
51
  });
51
- setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures));
52
+ setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures, admin));
52
53
  }
53
54
  }
54
55
  }, [
56
+ admin,
55
57
  hasLoadedFeatures,
56
58
  clientFunctions,
57
59
  schemaPath,
@@ -110,20 +112,27 @@ export const RichTextCell = (props)=>{
110
112
  finalSanitizedEditorConfig
111
113
  ]);
112
114
  if (!hasLoadedFeatures) {
113
- return /*#__PURE__*/ React.createElement(React.Fragment, null, Array.isArray(featureProviderComponents) && featureProviderComponents.map((featureProvider)=>{
114
- // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
115
- const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`feature.${featureProvider.key}.components.`));
116
- const featureComponents = featureComponentKeys.map((key)=>{
117
- return richTextComponentMap.get(key);
118
- });
119
- return /*#__PURE__*/ React.createElement(React.Fragment, {
120
- key: featureProvider.key
121
- }, featureComponents?.length ? featureComponents.map((FeatureComponent)=>{
122
- return FeatureComponent;
123
- }) : null, featureProvider.ClientComponent);
124
- }));
115
+ return /*#__PURE__*/ _jsx(React.Fragment, {
116
+ children: Array.isArray(featureProviderComponents) && featureProviderComponents.map((featureProvider)=>{
117
+ // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
118
+ const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`feature.${featureProvider.key}.components.`));
119
+ const featureComponents = featureComponentKeys.map((key)=>{
120
+ return richTextComponentMap.get(key);
121
+ });
122
+ return /*#__PURE__*/ _jsxs(React.Fragment, {
123
+ children: [
124
+ featureComponents?.length ? featureComponents.map((FeatureComponent)=>{
125
+ return FeatureComponent;
126
+ }) : null,
127
+ featureProvider.ClientComponent
128
+ ]
129
+ }, featureProvider.key);
130
+ })
131
+ });
125
132
  }
126
- return /*#__PURE__*/ React.createElement("span", null, preview);
133
+ return /*#__PURE__*/ _jsx("span", {
134
+ children: preview
135
+ });
127
136
  };
128
137
 
129
138
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { useTableCell } from '@payloadcms/ui/elements/Table'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport { $getRoot } from 'lexical'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../field/features/types.js'\nimport type { SanitizedClientEditorConfig } from '../field/lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nimport { loadClientFeatures } from '../field/lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../field/lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../field/lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<{\n lexicalEditorConfig: LexicalEditorConfig\n}> = (props) => {\n const { lexicalEditorConfig } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n const { schemaPath } = useFieldProps()\n\n const { cellData, richTextComponentMap } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n ),\n )\n }\n }\n }, [\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n useEffect(() => {\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n })\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"names":["createHeadlessEditor","useTableCell","useFieldProps","useClientFunctions","$getRoot","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","lexicalEditorConfig","preview","setPreview","schemaPath","cellData","richTextComponentMap","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","Fragment","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,oBAAoB,QAAQ,oBAAmB;AACxD,SAASC,YAAY,QAAQ,gCAA+B;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,kBAAkB,QAAQ,0CAAyC;AAC5E,SAASC,QAAQ,QAAQ,UAAS;AAClC,OAAOC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAMlD,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,0BAA0B,QAAQ,6CAA4C;AACvF,SAASC,eAAe,QAAQ,kCAAiC;AAEjE,OAAO,MAAMC,eAER,CAACC;IACJ,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;IAEhC,MAAM,CAACE,SAASC,WAAW,GAAGX,MAAME,QAAQ,CAAC;IAC7C,MAAM,EAAEU,UAAU,EAAE,GAAGf;IAEvB,MAAM,EAAEgB,QAAQ,EAAEC,oBAAoB,EAAE,GAAGlB;IAE3C,MAAMmB,kBAAkBjB;IACxB,MAAM,CAACkB,mBAAmBC,qBAAqB,GAAGf,SAAS;IAE3D,MAAM,CAACgB,kBAAkBC,oBAAoB,GAAGjB,SAA2C,EAAE;IAE7F,MAAM,CAACkB,4BAA4BC,8BAA8B,GAC/DnB,SAAsC;IAExC,IAAIoB,4BAAiER,qBAAqBS,GAAG,CAC3F,WACuC,oBAAoB;;IAC7D,iBAAiB;IACjBD,4BAA4BA,0BA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BiC,kBAAkBH,GAAG,CAAC,CAACI;gBACrB,OAAOA;YACT,KACA,MACHH,gBAAgBI,eAAe;QAGtC;IAGR;IAEA,qBAAO,oBAACC,cAAM9D;AAChB,EAAC"}
1
+ {"version":3,"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { useTableCell } from '@payloadcms/ui/elements/Table'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport { $getRoot } from 'lexical'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../field/features/types.js'\nimport type { SanitizedClientEditorConfig } from '../field/lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent, LexicalFieldAdminProps } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nimport { loadClientFeatures } from '../field/lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../field/lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../field/lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<{\n admin?: LexicalFieldAdminProps\n lexicalEditorConfig: LexicalEditorConfig\n}> = (props) => {\n const { admin, lexicalEditorConfig } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n const { schemaPath } = useFieldProps()\n\n const { cellData, richTextComponentMap } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n admin,\n ),\n )\n }\n }\n }, [\n admin,\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n useEffect(() => {\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n })\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"names":["createHeadlessEditor","useTableCell","useFieldProps","useClientFunctions","$getRoot","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","admin","lexicalEditorConfig","preview","setPreview","schemaPath","cellData","richTextComponentMap","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","Fragment","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,oBAAoB,QAAQ,oBAAmB;AACxD,SAASC,YAAY,QAAQ,gCAA+B;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,kBAAkB,QAAQ,0CAAyC;AAC5E,SAASC,QAAQ,QAAQ,UAAS;AAClC,OAAOC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAMlD,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,0BAA0B,QAAQ,6CAA4C;AACvF,SAASC,eAAe,QAAQ,kCAAiC;AAEjE,OAAO,MAAMC,eAGR,CAACC;IACJ,MAAM,EAAEC,KAAK,EAAEC,mBAAmB,EAAE,GAAGF;IAEvC,MAAM,CAACG,SAASC,WAAW,GAAGZ,MAAME,QAAQ,CAAC;IAC7C,MAAM,EAAEW,UAAU,EAAE,GAAGhB;IAEvB,MAAM,EAAEiB,QAAQ,EAAEC,oBAAoB,EAAE,GAAGnB;IAE3C,MAAMoB,kBAAkBlB;IACxB,MAAM,CAACmB,mBAAmBC,qBAAqB,GAAGhB,SAAS;IAE3D,MAAM,CAACiB,kBAAkBC,oBAAoB,GAAGlB,SAA2C,EAAE;IAE7F,MAAM,CAACmB,4BAA4BC,8BAA8B,GAC/DpB,SAAsC;IAExC,IAAIqB,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U;gBAClC;gBAEA,qBACE,MAAClC,MAAMkE,QAAQ;;wBACZI,mBAAmBjC,SAChBiC,kBAAkBH,GAAG,CAAC,CAACI;4BACrB,OAAOA;wBACT,KACA;wBACHH,gBAAgBI,eAAe;;mBANbJ,gBAAgBlC,GAAG;YAS5C;;IAGR;IAEA,qBAAO,KAACuC;kBAAM9D;;AAChB,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AASjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAE5E,OAAO,cAAc,CAAA;AA0HrB,eAAO,MAAM,QAAQ;kBAnHH,2BAA2B;UACnC,MAAM;0BACU,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;YAC1C,MAAM;EAgH8B,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AASjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAE5E,OAAO,cAAc,CAAA;AA2HrB,eAAO,MAAM,QAAQ;kBApHH,2BAA2B;UACnC,MAAM;0BACU,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;YAC1C,MAAM;EAiH8B,CAAA"}
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { FieldDescription } from '@payloadcms/ui/forms/FieldDescription';
3
4
  import { FieldError } from '@payloadcms/ui/forms/FieldError';
4
5
  import { FieldLabel } from '@payloadcms/ui/forms/FieldLabel';
@@ -38,63 +39,81 @@ const _RichText = (props)=>{
38
39
  'field-type',
39
40
  className,
40
41
  showError && 'error',
41
- readOnly && `${baseClass}--read-only`
42
+ readOnly && `${baseClass}--read-only`,
43
+ editorConfig?.admin?.hideGutter !== true ? `${baseClass}--show-gutter` : null
42
44
  ].filter(Boolean).join(' ');
43
- return /*#__PURE__*/ React.createElement("div", {
45
+ return /*#__PURE__*/ _jsxs("div", {
44
46
  className: classes,
45
- key: path,
46
47
  style: {
47
48
  ...style,
48
49
  width
49
- }
50
- }, /*#__PURE__*/ React.createElement(FieldLabel, {
51
- CustomLabel: CustomLabel,
52
- label: label,
53
- required: required,
54
- ...labelProps || {}
55
- }), /*#__PURE__*/ React.createElement("div", {
56
- className: `${baseClass}__wrap`
57
- }, /*#__PURE__*/ React.createElement(FieldError, {
58
- CustomError: CustomError,
59
- path: path,
60
- ...errorProps || {}
61
- }), /*#__PURE__*/ React.createElement(ErrorBoundary, {
62
- fallbackRender: fallbackRender,
63
- onReset: ()=>{}
64
- }, /*#__PURE__*/ React.createElement(LexicalProvider, {
65
- editorConfig: editorConfig,
66
- fieldProps: props,
67
- key: JSON.stringify({
68
- initialValue,
69
- path
70
- }),
71
- onChange: (editorState)=>{
72
- let serializedEditorState = editorState.toJSON();
73
- // Transform state through save hooks
74
- if (editorConfig?.features?.hooks?.save?.length) {
75
- editorConfig.features.hooks.save.forEach((hook)=>{
76
- serializedEditorState = hook({
77
- incomingEditorState: serializedEditorState
78
- });
79
- });
80
- }
81
- setValue(serializedEditorState);
82
50
  },
83
- path: path,
84
- readOnly: readOnly,
85
- value: value
86
- })), CustomDescription !== undefined ? CustomDescription : /*#__PURE__*/ React.createElement(FieldDescription, descriptionProps || {})));
51
+ children: [
52
+ /*#__PURE__*/ _jsx(FieldLabel, {
53
+ CustomLabel: CustomLabel,
54
+ label: label,
55
+ required: required,
56
+ ...labelProps || {}
57
+ }),
58
+ /*#__PURE__*/ _jsxs("div", {
59
+ className: `${baseClass}__wrap`,
60
+ children: [
61
+ /*#__PURE__*/ _jsx(FieldError, {
62
+ CustomError: CustomError,
63
+ path: path,
64
+ ...errorProps || {}
65
+ }),
66
+ /*#__PURE__*/ _jsx(ErrorBoundary, {
67
+ fallbackRender: fallbackRender,
68
+ onReset: ()=>{},
69
+ children: /*#__PURE__*/ _jsx(LexicalProvider, {
70
+ editorConfig: editorConfig,
71
+ fieldProps: props,
72
+ onChange: (editorState)=>{
73
+ let serializedEditorState = editorState.toJSON();
74
+ // Transform state through save hooks
75
+ if (editorConfig?.features?.hooks?.save?.length) {
76
+ editorConfig.features.hooks.save.forEach((hook)=>{
77
+ serializedEditorState = hook({
78
+ incomingEditorState: serializedEditorState
79
+ });
80
+ });
81
+ }
82
+ setValue(serializedEditorState);
83
+ },
84
+ path: path,
85
+ readOnly: readOnly,
86
+ value: value
87
+ }, JSON.stringify({
88
+ initialValue,
89
+ path
90
+ }))
91
+ }),
92
+ CustomDescription !== undefined ? CustomDescription : /*#__PURE__*/ _jsx(FieldDescription, {
93
+ ...descriptionProps || {}
94
+ })
95
+ ]
96
+ })
97
+ ]
98
+ }, path);
87
99
  };
88
100
  function fallbackRender({ error }) {
89
101
  // Call resetErrorBoundary() to reset the error boundary and retry the render.
90
- return /*#__PURE__*/ React.createElement("div", {
102
+ return /*#__PURE__*/ _jsxs("div", {
91
103
  className: "errorBoundary",
92
- role: "alert"
93
- }, /*#__PURE__*/ React.createElement("p", null, "Something went wrong:"), /*#__PURE__*/ React.createElement("pre", {
94
- style: {
95
- color: 'red'
96
- }
97
- }, error.message));
104
+ role: "alert",
105
+ children: [
106
+ /*#__PURE__*/ _jsx("p", {
107
+ children: "Something went wrong:"
108
+ }),
109
+ /*#__PURE__*/ _jsx("pre", {
110
+ style: {
111
+ color: 'red'
112
+ },
113
+ children: error.message
114
+ })
115
+ ]
116
+ });
98
117
  }
99
118
  export const RichText = withCondition(_RichText);
100
119
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { SerializedEditorState } from 'lexical'\n\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { withCondition } from '@payloadcms/ui/forms/withCondition'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport './index.scss'\nimport { LexicalProvider } from './lexical/LexicalProvider.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst _RichText: React.FC<\n FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n width?: string\n }\n> = (props) => {\n const {\n name,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorConfig,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n readOnly,\n required,\n style,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n width,\n } = props\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, props, required })\n }\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 const { path: pathFromContext } = useFieldProps()\n\n const fieldType = useField<SerializedEditorState>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const { errorMessage, initialValue, path, schemaPath, setValue, showError, value } = fieldType\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n className={classes}\n key={path}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${baseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n <LexicalProvider\n editorConfig={editorConfig}\n fieldProps={props}\n key={JSON.stringify({ initialValue, path })} // 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={(editorState) => {\n let serializedEditorState = editorState.toJSON()\n\n // Transform state through save hooks\n if (editorConfig?.features?.hooks?.save?.length) {\n editorConfig.features.hooks.save.forEach((hook) => {\n serializedEditorState = hook({ incomingEditorState: serializedEditorState })\n })\n }\n\n setValue(serializedEditorState)\n }}\n path={path}\n readOnly={readOnly}\n value={value}\n />\n </ErrorBoundary>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText = withCondition(_RichText)\n"],"names":["FieldDescription","FieldError","FieldLabel","useFieldProps","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","_RichText","props","name","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorConfig","errorProps","label","labelProps","path","pathFromProps","readOnly","required","style","validate","width","memoizedValidate","value","validationOptions","pathFromContext","fieldType","errorMessage","initialValue","schemaPath","setValue","showError","classes","filter","Boolean","join","div","key","fallbackRender","onReset","fieldProps","JSON","stringify","onChange","editorState","serializedEditorState","toJSON","features","hooks","save","length","forEach","hook","incomingEditorState","undefined","error","role","p","pre","color","message","RichText"],"range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WhE,cAAcM,WAAU"}
1
+ {"version":3,"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { SerializedEditorState } from 'lexical'\n\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { withCondition } from '@payloadcms/ui/forms/withCondition'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport './index.scss'\nimport { LexicalProvider } from './lexical/LexicalProvider.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst _RichText: React.FC<\n FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n width?: string\n }\n> = (props) => {\n const {\n name,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorConfig,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n readOnly,\n required,\n style,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n width,\n } = props\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, props, required })\n }\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 const { path: pathFromContext } = useFieldProps()\n\n const fieldType = useField<SerializedEditorState>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const { errorMessage, initialValue, path, schemaPath, setValue, showError, value } = fieldType\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true ? `${baseClass}--show-gutter` : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n className={classes}\n key={path}\n style={{\n ...style,\n width,\n }}\n >\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${baseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n <LexicalProvider\n editorConfig={editorConfig}\n fieldProps={props}\n key={JSON.stringify({ initialValue, path })} // 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={(editorState) => {\n let serializedEditorState = editorState.toJSON()\n\n // Transform state through save hooks\n if (editorConfig?.features?.hooks?.save?.length) {\n editorConfig.features.hooks.save.forEach((hook) => {\n serializedEditorState = hook({ incomingEditorState: serializedEditorState })\n })\n }\n\n setValue(serializedEditorState)\n }}\n path={path}\n readOnly={readOnly}\n value={value}\n />\n </ErrorBoundary>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText = withCondition(_RichText)\n"],"names":["FieldDescription","FieldError","FieldLabel","useFieldProps","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","_RichText","props","name","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorConfig","errorProps","label","labelProps","path","pathFromProps","readOnly","required","style","validate","width","memoizedValidate","value","validationOptions","pathFromContext","fieldType","errorMessage","initialValue","schemaPath","setValue","showError","classes","admin","hideGutter","filter","Boolean","join","div","fallbackRender","onReset","fieldProps","onChange","editorState","serializedEditorState","toJSON","features","hooks","save","length","forEach","hook","incomingEditorState","JSON","stringify","undefined","error","role","p","pre","color","message","RichText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,gBAAgB,QAAQ,wCAAuC;AACxE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAC1C,SAASC,aAAa,QAAQ,uBAAsB;AAIpD,OAAO,eAAc;AACrB,SAASC,eAAe,QAAQ,+BAA8B;AAE9D,MAAMC,YAAY;AAElB,MAAMC,YAOF,CAACC;IACH,MAAM,EACJC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGjB;IAEJ,MAAMkB,mBAAmBvB,YACvB,CAACwB,OAAOC;QACN,IAAI,OAAOJ,aAAa,YAAY;YAClC,OAAOA,SAASG,OAAO;gBAAE,GAAGC,iBAAiB;gBAAEpB;gBAAOc;YAAS;QACjE;IACF,GACA,yDAAyD;IACzD,8DAA8D;IAC9D,iHAAiH;IACjH;QAACE;QAAUF;KAAS;IAEtB,MAAM,EAAEH,MAAMU,eAAe,EAAE,GAAG9B;IAElC,MAAM+B,YAAY9B,SAAgC;QAChDmB,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AkB,GAAIkB,oBAAoB,CAAC,CAAC;;;;;OAvC5CK;AA4CX;AAEA,SAASwB,eAAe,EAAEiB,KAAK,EAAE;IAC/B,8EAA8E;IAE9E,qBACE,MAAClB;QAAI7B,WAAU;QAAgBgD,MAAK;;0BAClC,KAACC;0BAAE;;0BACH,KAACC;gBAAIxC,OAAO;oBAAEyC,OAAO;gBAAM;0BAAIJ,MAAMK,OAAO;;;;AAGlD;AAEA,OAAO,MAAMC,WAAWjE,cAAcM,WAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AA8JA,eAAO,MAAM,2BAA2B;;;EAA4C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AAsKA,eAAO,MAAM,2BAA2B;;;EAA4C,CAAA"}
@@ -31,7 +31,9 @@ const toolbarGroups = [
31
31
  return true;
32
32
  },
33
33
  key: 'alignLeft',
34
- label: `Align Left`,
34
+ label: ({ i18n })=>{
35
+ return i18n.t('lexical:align:alignLeftLabel');
36
+ },
35
37
  onSelect: ({ editor })=>{
36
38
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left');
37
39
  },
@@ -60,7 +62,9 @@ const toolbarGroups = [
60
62
  return true;
61
63
  },
62
64
  key: 'alignCenter',
63
- label: `Align Center`,
65
+ label: ({ i18n })=>{
66
+ return i18n.t('lexical:align:alignCenterLabel');
67
+ },
64
68
  onSelect: ({ editor })=>{
65
69
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center');
66
70
  },
@@ -89,7 +93,9 @@ const toolbarGroups = [
89
93
  return true;
90
94
  },
91
95
  key: 'alignRight',
92
- label: `Align Right`,
96
+ label: ({ i18n })=>{
97
+ return i18n.t('lexical:align:alignRightLabel');
98
+ },
93
99
  onSelect: ({ editor })=>{
94
100
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right');
95
101
  },
@@ -118,7 +124,9 @@ const toolbarGroups = [
118
124
  return true;
119
125
  },
120
126
  key: 'alignJustify',
121
- label: `Align Justify`,
127
+ label: ({ i18n })=>{
128
+ return i18n.t('lexical:align:alignJustifyLabel');
129
+ },
122
130
  onSelect: ({ editor })=>{
123
131
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify');
124
132
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isElementNode, $isRangeSelection, FORMAT_ELEMENT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAlignGroupWithItems } from './toolbarAlignGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarAlignGroupWithItems([\n {\n ChildComponent: AlignLeftIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'left') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'left') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignLeft',\n label: `Align Left`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n {\n ChildComponent: AlignCenterIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'center') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'center') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignCenter',\n label: `Align Center`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n {\n ChildComponent: AlignRightIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'right') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'right') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignRight',\n label: `Align Right`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n {\n ChildComponent: AlignJustifyIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'justify') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'justify') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignJustify',\n label: `Align Justify`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n]\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["$isElementNode","$isRangeSelection","FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","toolbarAlignGroupWithItems","toolbarGroups","ChildComponent","isActive","selection","node","getNodes","getFormatType","parent","getParent","key","label","onSelect","editor","dispatchCommand","order","AlignFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","AlignFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,sBAAsB,QAAQ,UAAS;AAKnF,SAASC,eAAe,QAAQ,8CAA6C;AAC7E,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,aAAa,QAAQ,4CAA2C;AACzE,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,0BAA0B,QAAQ,yBAAwB;AAEnE,MAAMC,gBAAgC;IACpCD,2BAA2B;QACzB;YACEE,gBAAgBL;YAChBM,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAI,CAACX,kBAAkBW,YAAY;oBACjC,OAAO;gBACT;gBACA,KAAK,MAAMC,QAAQD,UAAUE,QAAQ,GAAI;oBACvC,IAAId,eAAea,OAAO;wBACxB,IAAIA,KAAKE,aAAa,OAAO,QAAQ;4BACnC;wBACF;oBACF;oBAEA,MAAMC,SAASH,KAAKI,SAAS;oBAC7B,IAAIjB,eAAegB,SAAS;wBAC1B,IAAIA,OAAOD,aAAa,OAAO,QAAQ;4BACrC;wBACF;oBACF;oBAEA,OAAO;gBACT;gBACA,OAAO;YACT;YACAG,KAAK;YACLC,OAAO,CAAC,UAAU,CAAC;YACnBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACpB,wBAAwB;YACjD;YAC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AK,MAAMC,QAAQD,UAAUE,QAAQ,GAAI;oBACvC,IAAId,eAAea,OAAO;wBACxB,IAAIA,KAAKE,aAAa,OAAO,WAAW;4BACtC;wBACF;oBACF;oBAEA,MAAMC,SAASH,KAAKI,SAAS;oBAC7B,IAAIjB,eAAegB,SAAS;wBAC1B,IAAIA,OAAOD,aAAa,OAAO,WAAW;4BACxC;wBACF;oBACF;oBAEA,OAAO;gBACT;gBACA,OAAO;YACT;YACAG,KAAK;YACLC,OAAO,CAAC,aAAa,CAAC;YACtBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACpB,wBAAwB;YACjD;YACAqB,OAAO;QACT;KACD;CACF;AAED,MAAMC,qBAA+D,CAACC;IACpE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQpB;gBACV;gBACAqB,eAAe;oBACbD,QAAQpB;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMsB,8BAA8BxB,sBAAsBiB,oBAAmB"}
1
+ {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isElementNode, $isRangeSelection, FORMAT_ELEMENT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAlignGroupWithItems } from './toolbarAlignGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarAlignGroupWithItems([\n {\n ChildComponent: AlignLeftIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'left') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'left') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignLeft',\n label: ({ i18n }) => {\n return i18n.t('lexical:align:alignLeftLabel')\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n {\n ChildComponent: AlignCenterIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'center') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'center') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignCenter',\n label: ({ i18n }) => {\n return i18n.t('lexical:align:alignCenterLabel')\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n {\n ChildComponent: AlignRightIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'right') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'right') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignRight',\n label: ({ i18n }) => {\n return i18n.t('lexical:align:alignRightLabel')\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n {\n ChildComponent: AlignJustifyIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'justify') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'justify') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignJustify',\n label: ({ i18n }) => {\n return i18n.t('lexical:align:alignJustifyLabel')\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n]\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["$isElementNode","$isRangeSelection","FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","toolbarAlignGroupWithItems","toolbarGroups","ChildComponent","isActive","selection","node","getNodes","getFormatType","parent","getParent","key","label","i18n","t","onSelect","editor","dispatchCommand","order","AlignFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","AlignFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,sBAAsB,QAAQ,UAAS;AAKnF,SAASC,eAAe,QAAQ,8CAA6C;AAC7E,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,aAAa,QAAQ,4CAA2C;AACzE,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,0BAA0B,QAAQ,yBAAwB;AAEnE,MAAMC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,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQtB;gBACV;gBACAuB,eAAe;oBACbD,QAAQtB;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMwB,8BAA8B1B,sBAAsBmB,oBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAIhE,eAAO,MAAM,YAAY,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CAY5E,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAKhE,eAAO,MAAM,YAAY,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CAa5E,CAAA"}
@@ -1,10 +1,12 @@
1
1
  import { AlignFeatureClientComponent } from './feature.client.js';
2
+ import { i18n } from './i18n.js';
2
3
  export const AlignFeature = (props)=>{
3
4
  return {
4
5
  feature: ()=>{
5
6
  return {
6
7
  ClientComponent: AlignFeatureClientComponent,
7
8
  clientFeatureProps: null,
9
+ i18n,
8
10
  serverFeatureProps: props
9
11
  };
10
12
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/align/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { AlignFeatureClientComponent } from './feature.client.js'\n\nexport const AlignFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: AlignFeatureClientComponent,\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'align',\n serverFeatureProps: props,\n }\n}\n"],"names":["AlignFeatureClientComponent","AlignFeature","props","feature","ClientComponent","clientFeatureProps","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAEA,SAASA,2BAA2B,QAAQ,sBAAqB;AAEjE,OAAO,MAAMC,eAAoE,CAACC;IAChF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoB;gBACpBC,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/align/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { AlignFeatureClientComponent } from './feature.client.js'\nimport { i18n } from './i18n.js'\n\nexport const AlignFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: AlignFeatureClientComponent,\n clientFeatureProps: null,\n i18n,\n serverFeatureProps: props,\n }\n },\n key: 'align',\n serverFeatureProps: props,\n }\n}\n"],"names":["AlignFeatureClientComponent","i18n","AlignFeature","props","feature","ClientComponent","clientFeatureProps","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,2BAA2B,QAAQ,sBAAqB;AACjE,SAASC,IAAI,QAAQ,YAAW;AAEhC,OAAO,MAAMC,eAAoE,CAACC;IAChF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBL;gBACjBM,oBAAoB;gBACpBL;gBACAM,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GenericLanguages } from '@payloadcms/translations';
2
+ export declare const i18n: Partial<GenericLanguages>;
3
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAiM1C,CAAA"}