@payloadcms/richtext-lexical 3.0.0-beta.34 → 3.0.0-beta.36

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 (251) 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/blocks/component/BlockContent.js +62 -45
  9. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  10. package/dist/field/features/blocks/component/index.js +38 -28
  11. package/dist/field/features/blocks/component/index.js.map +1 -1
  12. package/dist/field/features/blocks/component/index.scss +0 -4
  13. package/dist/field/features/blocks/drawer/index.js +2 -1
  14. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  15. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -1
  16. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  17. package/dist/field/features/blocks/nodes/BlocksNode.js +2 -1
  18. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  19. package/dist/field/features/blocks/plugin/index.js +2 -1
  20. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  21. package/dist/field/features/blocks/validate.js +1 -1
  22. package/dist/field/features/blocks/validate.js.map +1 -1
  23. package/dist/field/features/debug/testRecorder/plugin/index.js +65 -39
  24. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  25. package/dist/field/features/debug/treeView/plugin/index.js +2 -1
  26. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  27. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +2 -1
  28. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  29. package/dist/field/features/link/drawer/index.js +30 -22
  30. package/dist/field/features/link/drawer/index.js.map +1 -1
  31. package/dist/field/features/link/plugins/clickableLink/index.js +2 -1
  32. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  33. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  34. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +88 -70
  35. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  36. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  37. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  38. package/dist/field/features/link/validate.js +1 -1
  39. package/dist/field/features/link/validate.js.map +1 -1
  40. package/dist/field/features/lists/checklist/plugin/index.js +2 -1
  41. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  42. package/dist/field/features/lists/plugin/index.js +2 -1
  43. package/dist/field/features/lists/plugin/index.js.map +1 -1
  44. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  45. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  46. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  47. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  48. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -1
  49. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  50. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  51. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  52. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  53. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  54. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -1
  55. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  56. package/dist/field/features/relationship/drawer/index.js +10 -2
  57. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  58. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +1 -1
  59. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  60. package/dist/field/features/relationship/nodes/RelationshipNode.js +2 -1
  61. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  62. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +64 -44
  63. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  64. package/dist/field/features/relationship/plugins/index.js +2 -1
  65. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  66. package/dist/field/features/toolbars/fixed/Toolbar/index.js +60 -55
  67. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  68. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +16 -2
  69. package/dist/field/features/toolbars/inline/Toolbar/index.js +57 -49
  70. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
  71. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  72. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  73. package/dist/field/features/toolbars/shared/ToolbarButton/index.js +5 -3
  74. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  75. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  76. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +54 -35
  77. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  78. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  79. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  80. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +25 -22
  81. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  82. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +30 -22
  83. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  84. package/dist/field/features/upload/component/index.js +104 -71
  85. package/dist/field/features/upload/component/index.js.map +1 -1
  86. package/dist/field/features/upload/drawer/index.js +8 -4
  87. package/dist/field/features/upload/drawer/index.js.map +1 -1
  88. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -1
  89. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  90. package/dist/field/features/upload/nodes/UploadNode.js +2 -1
  91. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  92. package/dist/field/features/upload/plugin/index.js +2 -1
  93. package/dist/field/features/upload/plugin/index.js.map +1 -1
  94. package/dist/field/features/upload/validate.js +1 -1
  95. package/dist/field/features/upload/validate.js.map +1 -1
  96. package/dist/field/index.d.ts +2 -0
  97. package/dist/field/index.d.ts.map +1 -1
  98. package/dist/field/index.js +29 -21
  99. package/dist/field/index.js.map +1 -1
  100. package/dist/field/index.scss +0 -21
  101. package/dist/field/lexical/EditorFocusProvider.d.ts +1 -2
  102. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -1
  103. package/dist/field/lexical/EditorFocusProvider.js +5 -3
  104. package/dist/field/lexical/EditorFocusProvider.js.map +1 -1
  105. package/dist/field/lexical/EditorPlugin.js +3 -2
  106. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  107. package/dist/field/lexical/LexicalEditor.js +113 -81
  108. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  109. package/dist/field/lexical/LexicalEditor.scss +10 -1
  110. package/dist/field/lexical/LexicalProvider.js +16 -10
  111. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  112. package/dist/field/lexical/config/client/EditorConfigProvider.js +5 -3
  113. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  114. package/dist/field/lexical/config/client/sanitize.d.ts +2 -1
  115. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  116. package/dist/field/lexical/config/client/sanitize.js +2 -1
  117. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  118. package/dist/field/lexical/config/types.d.ts +2 -0
  119. package/dist/field/lexical/config/types.d.ts.map +1 -1
  120. package/dist/field/lexical/config/types.js.map +1 -1
  121. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +2 -1
  122. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  123. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +1 -1
  124. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  125. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  126. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +1 -1
  127. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  128. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -1
  129. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  130. package/dist/field/lexical/plugins/SlashMenu/index.js +51 -40
  131. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  132. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  133. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  134. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +38 -119
  135. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  136. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  137. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  138. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  139. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  140. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  141. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  142. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +102 -58
  143. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  144. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +12 -3
  145. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  146. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  147. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +73 -25
  148. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  149. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  150. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  151. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  152. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  153. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +4 -0
  154. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  155. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +2 -14
  156. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  157. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  158. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  159. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  160. package/dist/field/lexical/theme/EditorTheme.scss +5 -0
  161. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  162. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  163. package/dist/field/lexical/ui/ContentEditable.js +2 -1
  164. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  165. package/dist/field/lexical/ui/ContentEditable.scss +50 -2
  166. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  167. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  168. package/dist/field/lexical/ui/icons/Add/index.js +14 -9
  169. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -1
  170. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  171. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  172. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  173. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  174. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  175. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  176. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  177. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  178. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  179. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  180. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  181. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  182. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  183. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  184. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  185. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  186. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  187. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  188. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  189. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  190. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  191. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  192. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  193. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  194. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  195. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  196. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  197. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  198. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  199. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  200. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  201. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  202. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  203. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  204. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  205. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  206. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  207. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  208. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  209. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  210. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  211. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  212. package/dist/field/lexical/ui/icons/Link/index.js +26 -17
  213. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  214. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  215. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  216. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  217. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  218. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  219. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  220. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  221. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  222. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  223. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  224. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  225. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  226. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  227. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  228. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  229. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  230. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  231. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  232. package/dist/generateComponentMap.js +8 -8
  233. package/dist/generateComponentMap.js.map +1 -1
  234. package/dist/index.d.ts.map +1 -1
  235. package/dist/index.js +2 -0
  236. package/dist/index.js.map +1 -1
  237. package/dist/populate/defaultValue.d.ts +0 -1
  238. package/dist/populate/defaultValue.d.ts.map +1 -1
  239. package/dist/populate/defaultValue.js +0 -19
  240. package/dist/populate/defaultValue.js.map +1 -1
  241. package/dist/types.d.ts +7 -0
  242. package/dist/types.d.ts.map +1 -1
  243. package/dist/types.js.map +1 -1
  244. package/dist/validate/index.d.ts.map +1 -1
  245. package/dist/validate/index.js +3 -2
  246. package/dist/validate/index.js.map +1 -1
  247. package/dist/validate/validateNodes.js +1 -1
  248. package/dist/validate/validateNodes.js.map +1 -1
  249. package/package.json +18 -14
  250. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  251. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
@@ -28,24 +28,5 @@ export const defaultRichTextValue = {
28
28
  version: 1
29
29
  }
30
30
  };
31
- export const defaultRichTextValueV2 = {
32
- root: {
33
- type: 'root',
34
- children: [
35
- {
36
- type: 'paragraph',
37
- children: [],
38
- direction: null,
39
- format: '',
40
- indent: 0,
41
- version: 1
42
- }
43
- ],
44
- direction: null,
45
- format: '',
46
- indent: 0,
47
- version: 1
48
- }
49
- };
50
31
 
51
32
  //# sourceMappingURL=defaultValue.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/populate/defaultValue.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\nexport const defaultRichTextValue: SerializedEditorState = {\n root: {\n type: 'root',\n children: [\n {\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n } as SerializedTextNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n } as SerializedParagraphNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n },\n}\n\nexport const defaultRichTextValueV2: SerializedEditorState = {\n root: {\n type: 'root',\n children: [\n {\n type: 'paragraph',\n children: [],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n } as SerializedParagraphNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n },\n}\n"],"names":["defaultRichTextValue","root","type","children","detail","format","mode","style","text","version","direction","indent","textFormat","defaultRichTextValueV2"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,uBAA8C;IACzDC,MAAM;QACJC,MAAM;QACNC,UAAU;YACR;gBACED,MAAM;gBACNC,UAAU;oBACR;wBACED,MAAM;wBACNE,QAAQ;wBACRC,QAAQ;wBACRC,MAAM;wBACNC,OAAO;wBACPC,MAAM;wBACNC,SAAS;oBACX;iBACD;gBACDC,WAAW;gBACXL,QAAQ;gBACRM,QAAQ;gBACRC,YAAY;gBACZH,SAAS;YACX;SACD;QACDC,WAAW;QACXL,QAAQ;QACRM,QAAQ;QACRF,SAAS;IACX;AACF,EAAC;AAED,OAAO,MAAMI,yBAAgD;IAC3DZ,MAAM;QACJC,MAAM;QACNC,UAAU;YACR;gBACED,MAAM;gBACNC,UAAU,EAAE;gBACZO,WAAW;gBACXL,QAAQ;gBACRM,QAAQ;gBACRF,SAAS;YACX;SACD;QACDC,WAAW;QACXL,QAAQ;QACRM,QAAQ;QACRF,SAAS;IACX;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/populate/defaultValue.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\nexport const defaultRichTextValue: SerializedEditorState = {\n root: {\n type: 'root',\n children: [\n {\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n } as SerializedTextNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n } as SerializedParagraphNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n },\n}\n"],"names":["defaultRichTextValue","root","type","children","detail","format","mode","style","text","version","direction","indent","textFormat"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,uBAA8C;IACzDC,MAAM;QACJC,MAAM;QACNC,UAAU;YACR;gBACED,MAAM;gBACNC,UAAU;oBACR;wBACED,MAAM;wBACNE,QAAQ;wBACRC,QAAQ;wBACRC,MAAM;wBACNC,OAAO;wBACPC,MAAM;wBACNC,SAAS;oBACX;iBACD;gBACDC,WAAW;gBACXL,QAAQ;gBACRM,QAAQ;gBACRC,YAAY;gBACZH,SAAS;YACX;SACD;QACDC,WAAW;QACXL,QAAQ;QACRM,QAAQ;QACRF,SAAS;IACX;AACF,EAAC"}
package/dist/types.d.ts CHANGED
@@ -5,7 +5,14 @@ import type { RichTextAdapter, RichTextFieldProps } from 'payload/types';
5
5
  import type React from 'react';
6
6
  import type { FeatureProviderServer } from './field/features/types.js';
7
7
  import type { SanitizedServerEditorConfig } from './field/lexical/config/types.js';
8
+ export type LexicalFieldAdminProps = {
9
+ /**
10
+ * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false
11
+ */
12
+ hideGutter?: boolean;
13
+ };
8
14
  export type LexicalEditorProps = {
15
+ admin?: LexicalFieldAdminProps;
9
16
  features?: (({ defaultFeatures, rootFeatures, }: {
10
17
  /**
11
18
  * This opinionated array contains all "recommended" default features.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAA;AAElF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EACL,CAAC,CAAC,EACA,eAAe,EACf,YAAY,GACb,EAAE;QACD;;;;;;;;;;WAUG;QACH,eAAe,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;QAClD;;;;;;;;;;;WAWG;QACH,YAAY,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;KAChD,KAAK,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GACxC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;IACrC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GAAG;IAC/F,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,2BAA2B,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,eAAe,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type { FieldPermissions } from 'payload/auth'\nimport type { FieldTypes, SanitizedConfig } from 'payload/config'\nimport type { RichTextAdapter, RichTextFieldProps } from 'payload/types'\nimport type React from 'react'\n\nimport type { FeatureProviderServer } from './field/features/types.js'\nimport type { SanitizedServerEditorConfig } from './field/lexical/config/types.js'\n\nexport type LexicalEditorProps = {\n features?:\n | (({\n defaultFeatures,\n rootFeatures,\n }: {\n /**\n * This opinionated array contains all \"recommended\" default features.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n defaultFeatures: FeatureProviderServer<any, any>[]\n /**\n * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).\n * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n rootFeatures: FeatureProviderServer<any, any>[]\n }) => FeatureProviderServer<any, any>[])\n | FeatureProviderServer<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type LexicalRichTextAdapter = RichTextAdapter<SerializedEditorState, AdapterProps, any> & {\n editorConfig: SanitizedServerEditorConfig\n features: FeatureProviderServer<any, any>[]\n}\n\nexport type LexicalRichTextAdapterProvider =\n /**\n * This is being called during the payload sanitization process\n */\n ({\n config,\n isRoot,\n }: {\n config: SanitizedConfig\n isRoot?: boolean\n }) => Promise<LexicalRichTextAdapter>\n\nexport type FieldProps = RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps> & {\n fieldTypes: FieldTypes\n indexPath: string\n path?: string\n permissions: FieldPermissions\n}\n\nexport type AdapterProps = {\n editorConfig: SanitizedServerEditorConfig\n}\n\nexport type GeneratedFeatureProviderComponent = {\n ClientComponent: React.ReactNode\n key: string\n order: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAyEA,WAIC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type { FieldPermissions } from 'payload/auth'\nimport type { FieldTypes, SanitizedConfig } from 'payload/config'\nimport type { RichTextAdapter, RichTextFieldProps } from 'payload/types'\nimport type React from 'react'\n\nimport type { FeatureProviderServer } from './field/features/types.js'\nimport type { SanitizedServerEditorConfig } from './field/lexical/config/types.js'\n\nexport type LexicalFieldAdminProps = {\n /**\n * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false\n */\n hideGutter?: boolean\n}\n\nexport type LexicalEditorProps = {\n admin?: LexicalFieldAdminProps\n features?:\n | (({\n defaultFeatures,\n rootFeatures,\n }: {\n /**\n * This opinionated array contains all \"recommended\" default features.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n defaultFeatures: FeatureProviderServer<any, any>[]\n /**\n * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).\n * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n rootFeatures: FeatureProviderServer<any, any>[]\n }) => FeatureProviderServer<any, any>[])\n | FeatureProviderServer<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type LexicalRichTextAdapter = RichTextAdapter<SerializedEditorState, AdapterProps, any> & {\n editorConfig: SanitizedServerEditorConfig\n features: FeatureProviderServer<any, any>[]\n}\n\nexport type LexicalRichTextAdapterProvider =\n /**\n * This is being called during the payload sanitization process\n */\n ({\n config,\n isRoot,\n }: {\n config: SanitizedConfig\n isRoot?: boolean\n }) => Promise<LexicalRichTextAdapter>\n\nexport type FieldProps = RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps> & {\n fieldTypes: FieldTypes\n indexPath: string\n path?: string\n permissions: FieldPermissions\n}\n\nexport type AdapterProps = {\n editorConfig: SanitizedServerEditorConfig\n}\n\nexport type GeneratedFeatureProviderComponent = {\n ClientComponent: React.ReactNode\n key: string\n order: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAiFA,WAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,8GAyCA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA2B,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE5D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAInF,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,8GA6CA,CAAA"}
@@ -1,10 +1,11 @@
1
- import { defaultRichTextValue, defaultRichTextValueV2 } from '../populate/defaultValue.js';
2
1
  import { validateNodes } from './validateNodes.js';
3
2
  export const richTextValidateHOC = ({ editorConfig })=>{
4
3
  const richTextValidate = async (value, options)=>{
5
4
  const { req: { t }, required } = options;
6
5
  if (required) {
7
- if (!value || !value?.root?.children || !value?.root?.children?.length || JSON.stringify(value) === JSON.stringify(defaultRichTextValue) || JSON.stringify(value) === JSON.stringify(defaultRichTextValueV2)) {
6
+ const hasChildren = value?.root?.children?.length;
7
+ const hasOnlyEmptyParagraph = value?.root?.children?.length === 1 && value?.root?.children[0]?.type === 'paragraph' && value?.root?.children[0]?.children?.length === 0 || value?.root?.children[0]?.children?.length === 1 && value?.root?.children[0]?.children[0]?.type === 'text' && value?.root?.children[0]?.children[0]?.['text'] === '';
8
+ if (!hasChildren || hasOnlyEmptyParagraph) {
8
9
  return t('validation:required');
9
10
  }
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/validate/index.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextField, Validate } from 'payload/types'\n\nimport type { SanitizedServerEditorConfig } from '../field/lexical/config/types.js'\n\nimport { defaultRichTextValue, defaultRichTextValueV2 } from '../populate/defaultValue.js'\nimport { validateNodes } from './validateNodes.js'\n\nexport const richTextValidateHOC = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const richTextValidate: Validate<SerializedEditorState, unknown, unknown, RichTextField> = async (\n value,\n options,\n ) => {\n const {\n req: { t },\n required,\n } = options\n\n if (required) {\n if (\n !value ||\n !value?.root?.children ||\n !value?.root?.children?.length ||\n JSON.stringify(value) === JSON.stringify(defaultRichTextValue) ||\n JSON.stringify(value) === JSON.stringify(defaultRichTextValueV2)\n ) {\n return t('validation:required')\n }\n }\n\n // Traverse through nodes and validate them. Just like a node can hook into the population process (e.g. link or relationship nodes),\n // they can also hook into the validation process. E.g. a block node probably has fields with validation rules.\n\n const rootNodes = value?.root?.children\n if (rootNodes && Array.isArray(rootNodes) && rootNodes?.length) {\n return await validateNodes({\n nodeValidations: editorConfig.features.validations,\n nodes: rootNodes,\n validation: {\n options,\n value,\n },\n })\n }\n\n return true\n }\n\n return richTextValidate\n}\n"],"names":["defaultRichTextValue","defaultRichTextValueV2","validateNodes","richTextValidateHOC","editorConfig","richTextValidate","value","options","req","t","required","root","children","length","JSON","stringify","rootNodes","Array","isArray","nodeValidations","features","validations","nodes","validation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,oBAAoB,EAAEC,sBAAsB,QAAQ,8BAA6B;AAC1F,SAASC,aAAa,QAAQ,qBAAoB;AAElD,OAAO,MAAMC,sBAAsB,CAAC,EAClCC,YAAY,EAGb;IACC,MAAMC,mBAAqF,OACzFC,OACAC;QAEA,MAAM,EACJC,KAAK,EAAEC,CAAC,EAAE,EACVC,QAAQ,EACT,GAAGH;QAEJ,IAAIG,UAAU;YACZ,IACE,CAACJ,SACD,CAACA,OAAOK,MAAMC,YACd,CAACN,OAAOK,MAAMC,UAAUC,UACxBC,KAAKC,SAAS,CAACT,WAAWQ,KAAKC,SAAS,CAACf,yBACzCc,KAAKC,SAAS,CAACT,WAAWQ,KAAKC,SAAS,CAACd,yBACzC;gBACA,OAAOQ,EAAE;YACX;QACF;QAEA,qIAAqI;QACrI,+GAA+G;QAE/G,MAAMO,YAAYV,OAAOK,MAAMC;QAC/B,IAAII,aAAaC,MAAMC,OAAO,CAACF,cAAcA,WAAWH,QAAQ;YAC9D,OAAO,MAAMX,cAAc;gBACzBiB,iBAAiBf,aAAagB,QAAQ,CAACC,WAAW;gBAClDC,OAAON;gBACPO,YAAY;oBACVhB;oBACAD;gBACF;YACF;QACF;QAEA,OAAO;IACT;IAEA,OAAOD;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/validate/index.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode } from 'lexical'\nimport type { RichTextField, Validate } from 'payload/types'\n\nimport type { SanitizedServerEditorConfig } from '../field/lexical/config/types.js'\n\nimport { validateNodes } from './validateNodes.js'\n\nexport const richTextValidateHOC = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const richTextValidate: Validate<SerializedEditorState, unknown, unknown, RichTextField> = async (\n value,\n options,\n ) => {\n const {\n req: { t },\n required,\n } = options\n\n if (required) {\n const hasChildren = value?.root?.children?.length\n\n const hasOnlyEmptyParagraph =\n (value?.root?.children?.length === 1 &&\n value?.root?.children[0]?.type === 'paragraph' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 0) ||\n ((value?.root?.children[0] as SerializedParagraphNode)?.children?.length === 1 &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.type === 'text' &&\n (value?.root?.children[0] as SerializedParagraphNode)?.children[0]?.['text'] === '')\n\n if (!hasChildren || hasOnlyEmptyParagraph) {\n return t('validation:required')\n }\n }\n\n // Traverse through nodes and validate them. Just like a node can hook into the population process (e.g. link or relationship nodes),\n // they can also hook into the validation process. E.g. a block node probably has fields with validation rules.\n\n const rootNodes = value?.root?.children\n if (rootNodes && Array.isArray(rootNodes) && rootNodes?.length) {\n return await validateNodes({\n nodeValidations: editorConfig.features.validations,\n nodes: rootNodes,\n validation: {\n options,\n value,\n },\n })\n }\n\n return true\n }\n\n return richTextValidate\n}\n"],"names":["validateNodes","richTextValidateHOC","editorConfig","richTextValidate","value","options","req","t","required","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","rootNodes","Array","isArray","nodeValidations","features","validations","nodes","validation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,aAAa,QAAQ,qBAAoB;AAElD,OAAO,MAAMC,sBAAsB,CAAC,EAClCC,YAAY,EAGb;IACC,MAAMC,mBAAqF,OACzFC,OACAC;QAEA,MAAM,EACJC,KAAK,EAAEC,CAAC,EAAE,EACVC,QAAQ,EACT,GAAGH;QAEJ,IAAIG,UAAU;YACZ,MAAMC,cAAcL,OAAOM,MAAMC,UAAUC;YAE3C,MAAMC,wBACJ,AAACT,OAAOM,MAAMC,UAAUC,WAAW,KACjCR,OAAOM,MAAMC,QAAQ,CAAC,EAAE,EAAEG,SAAS,eACnC,AAACV,OAAOM,MAAMC,QAAQ,CAAC,EAAE,EAA8BA,UAAUC,WAAW,KAC7E,AAACR,OAAOM,MAAMC,QAAQ,CAAC,EAAE,EAA8BA,UAAUC,WAAW,KAC3E,AAACR,OAAOM,MAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAQ,CAAC,EAAE,EAAEG,SAAS,UAC7E,AAACV,OAAOM,MAAMC,QAAQ,CAAC,EAAE,EAA8BA,QAAQ,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK;YAErF,IAAI,CAACF,eAAeI,uBAAuB;gBACzC,OAAON,EAAE;YACX;QACF;QAEA,qIAAqI;QACrI,+GAA+G;QAE/G,MAAMQ,YAAYX,OAAOM,MAAMC;QAC/B,IAAII,aAAaC,MAAMC,OAAO,CAACF,cAAcA,WAAWH,QAAQ;YAC9D,OAAO,MAAMZ,cAAc;gBACzBkB,iBAAiBhB,aAAaiB,QAAQ,CAACC,WAAW;gBAClDC,OAAON;gBACPO,YAAY;oBACVjB;oBACAD;gBACF;YACF;QACF;QAEA,OAAO;IACT;IAEA,OAAOD;AACT,EAAC"}
@@ -10,7 +10,7 @@ export async function validateNodes({ nodeValidations, nodes, validation: valida
10
10
  validation: validationFromProps
11
11
  });
12
12
  if (validationResult !== true) {
13
- return validationResult;
13
+ return `${node.type} node failed to validate: ${validationResult}`;
14
14
  }
15
15
  }
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/validate/validateNodes.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { RichTextField, ValidateOptions } from 'payload/types'\n\nimport type { NodeValidation } from '../field/features/types.js'\n\nexport async function validateNodes({\n nodeValidations,\n nodes,\n validation: validationFromProps,\n}: {\n nodeValidations: Map<string, Array<NodeValidation>>\n nodes: SerializedLexicalNode[]\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField>\n value: SerializedEditorState\n }\n}): Promise<string | true> {\n for (const node of nodes) {\n // Validate node\n if (\n nodeValidations &&\n typeof nodeValidations?.has === 'function' &&\n nodeValidations?.has(node.type)\n ) {\n const validations = nodeValidations.get(node.type)\n for (const validation of validations) {\n const validationResult = await validation({\n node,\n nodeValidations,\n validation: validationFromProps,\n })\n if (validationResult !== true) {\n return validationResult\n }\n }\n }\n\n // Validate node's children\n if ('children' in node && node?.children) {\n const childrenValidationResult = await validateNodes({\n nodeValidations,\n nodes: node.children as SerializedLexicalNode[],\n validation: validationFromProps,\n })\n if (childrenValidationResult !== true) {\n return childrenValidationResult\n }\n }\n }\n\n return true\n}\n"],"names":["validateNodes","nodeValidations","nodes","validation","validationFromProps","node","has","type","validations","get","validationResult","children","childrenValidationResult"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAO,eAAeA,cAAc,EAClCC,eAAe,EACfC,KAAK,EACLC,YAAYC,mBAAmB,EAQhC;IACC,KAAK,MAAMC,QAAQH,MAAO;QACxB,gBAAgB;QAChB,IACED,mBACA,OAAOA,iBAAiBK,QAAQ,cAChCL,iBAAiBK,IAAID,KAAKE,IAAI,GAC9B;YACA,MAAMC,cAAcP,gBAAgBQ,GAAG,CAACJ,KAAKE,IAAI;YACjD,KAAK,MAAMJ,cAAcK,YAAa;gBACpC,MAAME,mBAAmB,MAAMP,WAAW;oBACxCE;oBACAJ;oBACAE,YAAYC;gBACd;gBACA,IAAIM,qBAAqB,MAAM;oBAC7B,OAAOA;gBACT;YACF;QACF;QAEA,2BAA2B;QAC3B,IAAI,cAAcL,QAAQA,MAAMM,UAAU;YACxC,MAAMC,2BAA2B,MAAMZ,cAAc;gBACnDC;gBACAC,OAAOG,KAAKM,QAAQ;gBACpBR,YAAYC;YACd;YACA,IAAIQ,6BAA6B,MAAM;gBACrC,OAAOA;YACT;QACF;IACF;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../src/validate/validateNodes.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { RichTextField, ValidateOptions } from 'payload/types'\n\nimport type { NodeValidation } from '../field/features/types.js'\n\nexport async function validateNodes({\n nodeValidations,\n nodes,\n validation: validationFromProps,\n}: {\n nodeValidations: Map<string, Array<NodeValidation>>\n nodes: SerializedLexicalNode[]\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField>\n value: SerializedEditorState\n }\n}): Promise<string | true> {\n for (const node of nodes) {\n // Validate node\n if (\n nodeValidations &&\n typeof nodeValidations?.has === 'function' &&\n nodeValidations?.has(node.type)\n ) {\n const validations = nodeValidations.get(node.type)\n for (const validation of validations) {\n const validationResult = await validation({\n node,\n nodeValidations,\n validation: validationFromProps,\n })\n if (validationResult !== true) {\n return `${node.type} node failed to validate: ${validationResult}`\n }\n }\n }\n\n // Validate node's children\n if ('children' in node && node?.children) {\n const childrenValidationResult = await validateNodes({\n nodeValidations,\n nodes: node.children as SerializedLexicalNode[],\n validation: validationFromProps,\n })\n if (childrenValidationResult !== true) {\n return childrenValidationResult\n }\n }\n }\n\n return true\n}\n"],"names":["validateNodes","nodeValidations","nodes","validation","validationFromProps","node","has","type","validations","get","validationResult","children","childrenValidationResult"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAO,eAAeA,cAAc,EAClCC,eAAe,EACfC,KAAK,EACLC,YAAYC,mBAAmB,EAQhC;IACC,KAAK,MAAMC,QAAQH,MAAO;QACxB,gBAAgB;QAChB,IACED,mBACA,OAAOA,iBAAiBK,QAAQ,cAChCL,iBAAiBK,IAAID,KAAKE,IAAI,GAC9B;YACA,MAAMC,cAAcP,gBAAgBQ,GAAG,CAACJ,KAAKE,IAAI;YACjD,KAAK,MAAMJ,cAAcK,YAAa;gBACpC,MAAME,mBAAmB,MAAMP,WAAW;oBACxCE;oBACAJ;oBACAE,YAAYC;gBACd;gBACA,IAAIM,qBAAqB,MAAM;oBAC7B,OAAO,CAAC,EAAEL,KAAKE,IAAI,CAAC,0BAA0B,EAAEG,iBAAiB,CAAC;gBACpE;YACF;QACF;QAEA,2BAA2B;QAC3B,IAAI,cAAcL,QAAQA,MAAMM,UAAU;YACxC,MAAMC,2BAA2B,MAAMZ,cAAc;gBACnDC;gBACAC,OAAOG,KAAKM,QAAQ;gBACpBR,YAAYC;YACd;YACA,IAAIQ,6BAA6B,MAAM;gBACrC,OAAOA;YACT;QACF;IACF;IAEA,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "3.0.0-beta.34",
3
+ "version": "3.0.0-beta.36",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
6
  "repository": {
@@ -55,13 +55,13 @@
55
55
  "@lexical/eslint-plugin": "0.15.0",
56
56
  "@types/json-schema": "7.0.15",
57
57
  "@types/node": "20.12.5",
58
- "@types/react": "18.3.2",
59
- "@types/react-dom": "18.3.0",
60
- "@payloadcms/eslint-config": "1.1.1",
61
- "@payloadcms/translations": "3.0.0-beta.34",
62
- "@payloadcms/next": "3.0.0-beta.34",
63
- "payload": "3.0.0-beta.34",
64
- "@payloadcms/ui": "3.0.0-beta.34"
58
+ "@types/react": "npm:types-react@19.0.0-beta.2",
59
+ "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
60
+ "@payloadcms/next": "3.0.0-beta.36",
61
+ "@payloadcms/translations": "3.0.0-beta.36",
62
+ "@payloadcms/ui": "3.0.0-beta.36",
63
+ "payload": "3.0.0-beta.36",
64
+ "@payloadcms/eslint-config": "1.1.1"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "@faceless-ui/modal": "2.0.2",
@@ -75,12 +75,12 @@
75
75
  "@lexical/selection": "0.15.0",
76
76
  "@lexical/utils": "0.15.0",
77
77
  "lexical": "0.15.0",
78
- "react": "^18.2.0 || ^19.0.0",
79
- "react-dom": "^18.2.0 || ^19.0.0",
80
- "@payloadcms/translations": "3.0.0-beta.34",
81
- "@payloadcms/ui": "3.0.0-beta.34",
82
- "@payloadcms/next": "3.0.0-beta.34",
83
- "payload": "3.0.0-beta.34"
78
+ "react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
79
+ "react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
80
+ "@payloadcms/next": "3.0.0-beta.36",
81
+ "@payloadcms/ui": "3.0.0-beta.36",
82
+ "@payloadcms/translations": "3.0.0-beta.36",
83
+ "payload": "3.0.0-beta.36"
84
84
  },
85
85
  "engines": {
86
86
  "node": ">=18.20.2"
@@ -88,6 +88,10 @@
88
88
  "publishConfig": {
89
89
  "registry": "https://registry.npmjs.org/"
90
90
  },
91
+ "overrides": {
92
+ "@types/react": "npm:types-react@19.0.0-beta.2",
93
+ "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
94
+ },
91
95
  "scripts": {
92
96
  "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
93
97
  "build:clean": "find . \\( -type d \\( -name build -o -name dist -o -name .cache \\) -o -type f -name tsconfig.tsbuildinfo \\) -exec rm -rf {} + && pnpm build",
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNodeCloseToPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIzD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAW/C,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,WAAW,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,aAAa,CAAA;IACrB,gHAAgH;IAChH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,EAAE,KAAK,CAAA;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAA;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,yBAAyB,EAAE,OAAO,CAAA;CACnC,CAAA;AAaD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAkLxD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.ts"],"sourcesContent":["import type { LexicalEditor, LexicalNode } from 'lexical'\n\nimport { $getNodeByKey } from 'lexical'\n\nimport { Point } from '../../../utils/point.js'\nimport { Rect } from '../../../utils/rect.js'\nimport { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\n\n// Directions\nconst Downward = 1\nconst Upward = -1\nconst Indeterminate = 0\n\ntype Props = {\n anchorElem: HTMLElement\n cache_threshold?: number\n editor: LexicalEditor\n /** fuzzy makes the search not exact. If no exact match found, find the closes node instead of returning null */\n fuzzy?: boolean\n horizontalOffset?: number\n point: Point\n /**\n * The index to start searching from. It can be a considerable performance optimization to start searching from the index of the\n * previously found node, as the node is likely to be close to the next node.\n */\n startIndex?: number\n useEdgeAsDefault?: boolean\n verbose?: boolean\n}\n\ntype Output = {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n}\n\nconst cache = {\n props: null as Props | null,\n result: null as Output | null,\n}\n\nfunction isPointClose(previous: Point, current: Point, threshold: number = 20): boolean {\n const dx = previous.x - current.x\n const dy = previous.y - current.y\n return dx * dx + dy * dy <= threshold * threshold\n}\n\nexport function getNodeCloseToPoint(props: Props): Output {\n const {\n anchorElem,\n cache_threshold = 20,\n editor,\n fuzzy = false,\n horizontalOffset = 0,\n point: { x, y },\n startIndex = 0,\n useEdgeAsDefault = false,\n verbose = false,\n } = props\n\n // Use cache\n if (\n cache_threshold > 0 &&\n cache.props &&\n cache.result &&\n cache.props.fuzzy === props.fuzzy &&\n cache.props.horizontalOffset === props.horizontalOffset &&\n cache.props.useEdgeAsDefault === props.useEdgeAsDefault &&\n isPointClose(cache.props.point, props.point, cache_threshold)\n ) {\n if (verbose) {\n //console.log('Returning cached result')\n }\n return cache.result\n }\n\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const closestBlockElem: {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n distance: number\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n } = {\n blockElem: null,\n blockNode: null,\n distance: Infinity,\n foundAtIndex: -1,\n isFoundNodeEmptyParagraph: false,\n }\n\n // Return null if matching block element is the first or last node\n editor.getEditorState().read(() => {\n if (useEdgeAsDefault) {\n const [firstNode, lastNode] = [\n editor.getElementByKey(topLevelNodeKeys[0]),\n editor.getElementByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1]),\n ]\n\n const [firstNodeRect, lastNodeRect] = [\n getBoundingClientRectWithoutTransform(firstNode),\n getBoundingClientRectWithoutTransform(lastNode),\n ]\n\n if (firstNodeRect && lastNodeRect) {\n if (y < firstNodeRect.top) {\n closestBlockElem.blockElem = firstNode\n closestBlockElem.distance = firstNodeRect.top - y\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[0])\n closestBlockElem.foundAtIndex = 0\n } else if (y > lastNodeRect.bottom) {\n closestBlockElem.distance = y - lastNodeRect.bottom\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1])\n closestBlockElem.blockElem = lastNode\n closestBlockElem.foundAtIndex = topLevelNodeKeys.length - 1\n }\n\n if (closestBlockElem?.blockElem) {\n if (verbose) {\n //console.log('useEdgeAsDefault', useEdgeAsDefault)\n }\n\n return {\n blockElem: null,\n isFoundNodeEmptyParagraph: false,\n } as Output\n }\n }\n }\n\n // Find matching block element\n let index = startIndex\n let direction = Indeterminate\n\n if (verbose) {\n //console.log('start index', startIndex)\n }\n\n while (index >= 0 && index < topLevelNodeKeys.length) {\n const key = topLevelNodeKeys[index]\n const elem = editor.getElementByKey(key)\n if (elem === null) {\n break\n }\n const point = new Point(x + horizontalOffset, y)\n //const domRect = Rect.fromDOM(elem)\n // Do not consider transform of blocks when calculating distance\n const domRect = Rect.fromDOMRect(getBoundingClientRectWithoutTransform(elem))\n\n const { marginBottom, marginTop } = getCollapsedMargins(elem)\n\n const rect = domRect.generateNewRect({\n bottom: domRect.bottom + marginBottom,\n left: anchorElementRect.left,\n right: anchorElementRect.right,\n top: domRect.top - marginTop,\n })\n\n const { distance, isOnBottomSide, isOnTopSide } = rect.distanceFromPoint(point)\n\n if (verbose) {\n //console.log('distance', distance)\n }\n\n if (distance === 0) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.foundAtIndex = index\n closestBlockElem.distance = distance\n\n // Check if blockNode is an empty text node\n if (\n closestBlockElem.blockNode &&\n closestBlockElem.blockNode.getType() === 'paragraph' &&\n closestBlockElem.blockNode.getTextContent() === ''\n ) {\n if (!fuzzy) {\n closestBlockElem.blockElem = null\n closestBlockElem.blockNode = null\n }\n\n closestBlockElem.isFoundNodeEmptyParagraph = true\n }\n break\n } else if (fuzzy) {\n if (distance < closestBlockElem.distance) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.distance = distance\n closestBlockElem.foundAtIndex = index\n }\n }\n\n if (direction === Indeterminate) {\n if (isOnTopSide) {\n direction = Upward\n } else if (isOnBottomSide) {\n direction = Downward\n } else {\n // stop search block element\n direction = Infinity\n }\n }\n\n index += direction\n }\n })\n\n // Store in cache before returning\n cache.props = props\n cache.result = {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n\n return {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n}\n"],"names":["$getNodeByKey","Point","Rect","getCollapsedMargins","getTopLevelNodeKeys","getBoundingClientRectWithoutTransform","Downward","Upward","Indeterminate","cache","props","result","isPointClose","previous","current","threshold","dx","x","dy","y","getNodeCloseToPoint","anchorElem","cache_threshold","editor","fuzzy","horizontalOffset","point","startIndex","useEdgeAsDefault","verbose","anchorElementRect","getBoundingClientRect","topLevelNodeKeys","closestBlockElem","blockElem","blockNode","distance","Infinity","foundAtIndex","isFoundNodeEmptyParagraph","getEditorState","read","firstNode","lastNode","getElementByKey","length","firstNodeRect","lastNodeRect","top","bottom","index","direction","key","elem","domRect","fromDOMRect","marginBottom","marginTop","rect","generateNewRect","left","right","isOnBottomSide","isOnTopSide","distanceFromPoint","getType","getTextContent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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