@payloadcms/richtext-lexical 3.0.0-alpha.60 → 3.0.0-beta.0

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 (298) hide show
  1. package/dist/cell/index.js.map +1 -1
  2. package/dist/exports/components.js.map +1 -1
  3. package/dist/field/Field.js.map +1 -1
  4. package/dist/field/features/align/feature.client.js.map +1 -1
  5. package/dist/field/features/align/feature.server.js.map +1 -1
  6. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +1 -1
  7. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  8. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  9. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  10. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  11. package/dist/field/features/blocks/component/FormSavePlugin.js.map +1 -1
  12. package/dist/field/features/blocks/component/index.js.map +1 -1
  13. package/dist/field/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
  14. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  15. package/dist/field/features/blocks/feature.client.js.map +1 -1
  16. package/dist/field/features/blocks/feature.server.js.map +1 -1
  17. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  18. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  19. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  20. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  21. package/dist/field/features/blocks/validate.js.map +1 -1
  22. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +1 -1
  23. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +1 -1
  24. package/dist/field/features/converters/html/converter/converters/linebreak.js.map +1 -1
  25. package/dist/field/features/converters/html/converter/converters/paragraph.js.map +1 -1
  26. package/dist/field/features/converters/html/converter/converters/text.js.map +1 -1
  27. package/dist/field/features/converters/html/converter/defaultConverters.js.map +1 -1
  28. package/dist/field/features/converters/html/converter/index.d.ts.map +1 -1
  29. package/dist/field/features/converters/html/converter/index.js +22 -17
  30. package/dist/field/features/converters/html/converter/index.js.map +1 -1
  31. package/dist/field/features/converters/html/converter/types.js.map +1 -1
  32. package/dist/field/features/converters/html/feature.server.js.map +1 -1
  33. package/dist/field/features/converters/html/field/index.js.map +1 -1
  34. package/dist/field/features/createClientComponent.js.map +1 -1
  35. package/dist/field/features/createFeaturePropComponent.js.map +1 -1
  36. package/dist/field/features/debug/testrecorder/feature.client.js.map +1 -1
  37. package/dist/field/features/debug/testrecorder/feature.server.js.map +1 -1
  38. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  39. package/dist/field/features/debug/treeview/feature.client.js.map +1 -1
  40. package/dist/field/features/debug/treeview/feature.server.js.map +1 -1
  41. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  42. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  43. package/dist/field/features/format/bold/feature.server.js.map +1 -1
  44. package/dist/field/features/format/bold/markdownTransformers.js.map +1 -1
  45. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +1 -1
  46. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  47. package/dist/field/features/format/inlinecode/feature.server.js.map +1 -1
  48. package/dist/field/features/format/inlinecode/markdownTransformers.js.map +1 -1
  49. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  50. package/dist/field/features/format/italic/feature.server.js.map +1 -1
  51. package/dist/field/features/format/italic/markdownTransformers.js.map +1 -1
  52. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  53. package/dist/field/features/format/strikethrough/feature.server.js.map +1 -1
  54. package/dist/field/features/format/strikethrough/markdownTransformers.js.map +1 -1
  55. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  56. package/dist/field/features/format/subscript/feature.server.js.map +1 -1
  57. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  58. package/dist/field/features/format/superscript/feature.server.js.map +1 -1
  59. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  60. package/dist/field/features/format/underline/feature.server.js.map +1 -1
  61. package/dist/field/features/heading/feature.client.js.map +1 -1
  62. package/dist/field/features/heading/feature.server.js.map +1 -1
  63. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  64. package/dist/field/features/indent/feature.client.js.map +1 -1
  65. package/dist/field/features/indent/feature.server.js.map +1 -1
  66. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +1 -1
  67. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  68. package/dist/field/features/link/drawer/baseFields.js +8 -19
  69. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  70. package/dist/field/features/link/drawer/index.js.map +1 -1
  71. package/dist/field/features/link/drawer/types.js.map +1 -1
  72. package/dist/field/features/link/feature.client.js.map +1 -1
  73. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  74. package/dist/field/features/link/feature.server.js +1 -8
  75. package/dist/field/features/link/feature.server.js.map +1 -1
  76. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  77. package/dist/field/features/link/nodes/LinkNode.js +2 -2
  78. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  79. package/dist/field/features/link/nodes/types.js.map +1 -1
  80. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  81. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  82. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  83. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  84. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +15 -6
  85. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  86. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  87. package/dist/field/features/link/plugins/floatingLinkEditor/types.d.ts +2 -0
  88. package/dist/field/features/link/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  89. package/dist/field/features/link/plugins/floatingLinkEditor/types.js.map +1 -1
  90. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  91. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +2 -1
  92. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  93. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  94. package/dist/field/features/link/populationPromise.js.map +1 -1
  95. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  96. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  97. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  98. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  99. package/dist/field/features/lists/common/markdown.js.map +1 -1
  100. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  101. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  102. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  103. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  104. package/dist/field/features/lists/plugin/index.js.map +1 -1
  105. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  106. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  107. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  108. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js.map +1 -1
  109. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
  110. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js.map +1 -1
  111. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js.map +1 -1
  112. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
  113. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js.map +1 -1
  114. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js.map +1 -1
  115. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
  116. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js.map +1 -1
  117. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js.map +1 -1
  118. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
  119. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js.map +1 -1
  120. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js.map +1 -1
  121. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
  122. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js.map +1 -1
  123. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js.map +1 -1
  124. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
  125. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js.map +1 -1
  126. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js.map +1 -1
  127. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  128. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js.map +1 -1
  129. package/dist/field/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
  130. package/dist/field/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  131. package/dist/field/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
  132. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
  133. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  134. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  135. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  136. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  137. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  138. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  139. package/dist/field/features/migrations/slateToLexical/converter/converters/heading/client.js.map +1 -1
  140. package/dist/field/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  141. package/dist/field/features/migrations/slateToLexical/converter/converters/heading/index.js.map +1 -1
  142. package/dist/field/features/migrations/slateToLexical/converter/converters/indent/client.js.map +1 -1
  143. package/dist/field/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
  144. package/dist/field/features/migrations/slateToLexical/converter/converters/indent/index.js.map +1 -1
  145. package/dist/field/features/migrations/slateToLexical/converter/converters/link/client.js.map +1 -1
  146. package/dist/field/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  147. package/dist/field/features/migrations/slateToLexical/converter/converters/link/index.js.map +1 -1
  148. package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/client.js.map +1 -1
  149. package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  150. package/dist/field/features/migrations/slateToLexical/converter/converters/listItem/index.js.map +1 -1
  151. package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/client.js.map +1 -1
  152. package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  153. package/dist/field/features/migrations/slateToLexical/converter/converters/orderedList/index.js.map +1 -1
  154. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/client.js.map +1 -1
  155. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  156. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/index.js.map +1 -1
  157. package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/client.js.map +1 -1
  158. package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  159. package/dist/field/features/migrations/slateToLexical/converter/converters/unknown/index.js.map +1 -1
  160. package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/client.js.map +1 -1
  161. package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  162. package/dist/field/features/migrations/slateToLexical/converter/converters/unorderedList/index.js.map +1 -1
  163. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/client.js.map +1 -1
  164. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  165. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/index.js.map +1 -1
  166. package/dist/field/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
  167. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  168. package/dist/field/features/migrations/slateToLexical/converter/types.js.map +1 -1
  169. package/dist/field/features/migrations/slateToLexical/feature.client.js.map +1 -1
  170. package/dist/field/features/migrations/slateToLexical/feature.server.js.map +1 -1
  171. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  172. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  173. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  174. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  175. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  176. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  177. package/dist/field/features/relationship/feature.client.js.map +1 -1
  178. package/dist/field/features/relationship/feature.server.js.map +1 -1
  179. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  180. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  181. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  182. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  183. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js +1 -1
  184. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
  185. package/dist/field/features/types.d.ts +6 -1
  186. package/dist/field/features/types.d.ts.map +1 -1
  187. package/dist/field/features/types.js.map +1 -1
  188. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  189. package/dist/field/features/upload/component/index.js.map +1 -1
  190. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  191. package/dist/field/features/upload/drawer/index.js.map +1 -1
  192. package/dist/field/features/upload/feature.client.js.map +1 -1
  193. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/upload/feature.server.js +11 -4
  195. package/dist/field/features/upload/feature.server.js.map +1 -1
  196. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  197. package/dist/field/features/upload/plugin/index.js.map +1 -1
  198. package/dist/field/features/upload/populationPromise.js.map +1 -1
  199. package/dist/field/features/upload/validate.js.map +1 -1
  200. package/dist/field/index.js.map +1 -1
  201. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  202. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  203. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  204. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  205. package/dist/field/lexical/config/client/default.js.map +1 -1
  206. package/dist/field/lexical/config/client/loader.js.map +1 -1
  207. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  208. package/dist/field/lexical/config/server/default.js.map +1 -1
  209. package/dist/field/lexical/config/server/loader.js.map +1 -1
  210. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  211. package/dist/field/lexical/config/types.js.map +1 -1
  212. package/dist/field/lexical/nodes/index.js.map +1 -1
  213. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  214. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  215. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +1 -1
  216. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  217. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +1 -1
  218. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  219. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  220. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  221. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  222. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  223. package/dist/field/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  224. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  225. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  226. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  227. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  228. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  229. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  230. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  231. package/dist/field/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
  232. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  233. package/dist/field/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
  234. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  235. package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
  236. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  237. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  238. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  239. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  240. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  241. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  242. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  243. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  244. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  245. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  246. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  247. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  248. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  249. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  250. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  251. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  252. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  253. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  254. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  255. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  256. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  257. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  258. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  259. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  260. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  261. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  262. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  263. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  264. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  265. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  266. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  267. package/dist/field/lexical/utils/canUseDOM.js.map +1 -1
  268. package/dist/field/lexical/utils/cloneDeep.js.map +1 -1
  269. package/dist/field/lexical/utils/environment.js.map +1 -1
  270. package/dist/field/lexical/utils/getDOMRangeRect.js.map +1 -1
  271. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  272. package/dist/field/lexical/utils/guard.js.map +1 -1
  273. package/dist/field/lexical/utils/invariant.js.map +1 -1
  274. package/dist/field/lexical/utils/joinClasses.js.map +1 -1
  275. package/dist/field/lexical/utils/markdown/createBlockNode.js.map +1 -1
  276. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  277. package/dist/field/lexical/utils/point.js.map +1 -1
  278. package/dist/field/lexical/utils/rect.js.map +1 -1
  279. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  280. package/dist/field/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
  281. package/dist/field/lexical/utils/swipe.js.map +1 -1
  282. package/dist/field/lexical/utils/url.js.map +1 -1
  283. package/dist/generateComponentMap.d.ts.map +1 -1
  284. package/dist/generateComponentMap.js +4 -1
  285. package/dist/generateComponentMap.js.map +1 -1
  286. package/dist/generateSchemaMap.d.ts.map +1 -1
  287. package/dist/generateSchemaMap.js +2 -1
  288. package/dist/generateSchemaMap.js.map +1 -1
  289. package/dist/index.js.map +1 -1
  290. package/dist/populate/defaultValue.js.map +1 -1
  291. package/dist/populate/populate.js.map +1 -1
  292. package/dist/populate/recurseNestedFields.js.map +1 -1
  293. package/dist/populate/richTextRelationshipPromise.js.map +1 -1
  294. package/dist/types.js.map +1 -1
  295. package/dist/useLexicalFeature.js.map +1 -1
  296. package/dist/validate/index.js.map +1 -1
  297. package/dist/validate/validateNodes.js.map +1 -1
  298. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/blocks/populationPromise.ts"],"sourcesContent":["import type { Block } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { PopulationPromise } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const blockPopulationPromiseHOC = (\n props: BlocksFeatureProps,\n): PopulationPromise<SerializedBlockNode> => {\n const blockPopulationPromise: PopulationPromise<SerializedBlockNode> = ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) => {\n const blocks: Block[] = props.blocks\n const blockFieldData = node.fields\n\n const promises: Promise<void>[] = []\n\n // Sanitize block's fields here. This is done here and not in the feature, because the payload config is available here\n const payloadConfig = req.payload.config\n const validRelationships = payloadConfig.collections.map((c) => c.slug) || []\n blocks.forEach((block) => {\n block.fields = sanitizeFields({\n config: payloadConfig,\n fields: block.fields,\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n })\n\n // find block used in this node\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n if (!block || !block?.fields?.length || !blockFieldData) {\n return promises\n }\n\n recurseNestedFields({\n context,\n currentDepth,\n data: blockFieldData,\n depth,\n editorPopulationPromises,\n fields: block.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n promises,\n req,\n showHiddenFields,\n // The afterReadPromise gets its data from looking for field.name inside the siblingDoc. Thus, here we cannot pass the whole document's siblingDoc, but only the siblingDoc (sibling fields) of the current field.\n siblingDoc: blockFieldData,\n })\n\n return promises\n }\n\n return blockPopulationPromise\n}\n"],"names":["sanitizeFields","recurseNestedFields","blockPopulationPromiseHOC","props","blockPopulationPromise","context","currentDepth","depth","editorPopulationPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","blocks","blockFieldData","fields","promises","payloadConfig","payload","config","validRelationships","collections","map","c","slug","forEach","block","requireFieldLevelRichTextEditor","find","blockType","length","data"],"mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAM/C,SAASC,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAMC,yBAAiE,CAAC,EACtEC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,wBAAwB,EACxBC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACX;QACC,MAAMC,SAAkBd,MAAMc,MAAM;QACpC,MAAMC,iBAAiBP,KAAKQ,MAAM;QAElC,MAAMC,WAA4B,EAAE;QAEpC,uHAAuH;QACvH,MAAMC,gBAAgBP,IAAIQ,OAAO,CAACC,MAAM;QACxC,MAAMC,qBAAqBH,cAAcI,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAC7EX,OAAOY,OAAO,CAAC,CAACC;YACdA,MAAMX,MAAM,GAAGnB,eAAe;gBAC5BuB,QAAQF;gBACRF,QAAQW,MAAMX,MAAM;gBACpBY,iCAAiC;gBACjCP;YACF;QACF;QAEA,+BAA+B;QAC/B,MAAMM,QAAQ3B,MAAMc,MAAM,CAACe,IAAI,CAAC,CAACF,QAAUA,MAAMF,IAAI,KAAKV,eAAee,SAAS;QAClF,IAAI,CAACH,SAAS,CAACA,OAAOX,QAAQe,UAAU,CAAChB,gBAAgB;YACvD,OAAOE;QACT;QAEAnB,oBAAoB;YAClBI;YACAC;YACA6B,MAAMjB;YACNX;YACAC;YACAW,QAAQW,MAAMX,MAAM;YACpBV;YACAC;YACAE;YACAC;YACAO;YACAN;YACAC;YACA,kNAAkN;YAClNC,YAAYE;QACd;QAEA,OAAOE;IACT;IAEA,OAAOhB;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/blocks/populationPromise.ts"],"sourcesContent":["import type { Block } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { PopulationPromise } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const blockPopulationPromiseHOC = (\n props: BlocksFeatureProps,\n): PopulationPromise<SerializedBlockNode> => {\n const blockPopulationPromise: PopulationPromise<SerializedBlockNode> = ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) => {\n const blocks: Block[] = props.blocks\n const blockFieldData = node.fields\n\n const promises: Promise<void>[] = []\n\n // Sanitize block's fields here. This is done here and not in the feature, because the payload config is available here\n const payloadConfig = req.payload.config\n const validRelationships = payloadConfig.collections.map((c) => c.slug) || []\n blocks.forEach((block) => {\n block.fields = sanitizeFields({\n config: payloadConfig,\n fields: block.fields,\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n })\n\n // find block used in this node\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n if (!block || !block?.fields?.length || !blockFieldData) {\n return promises\n }\n\n recurseNestedFields({\n context,\n currentDepth,\n data: blockFieldData,\n depth,\n editorPopulationPromises,\n fields: block.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n promises,\n req,\n showHiddenFields,\n // The afterReadPromise gets its data from looking for field.name inside the siblingDoc. Thus, here we cannot pass the whole document's siblingDoc, but only the siblingDoc (sibling fields) of the current field.\n siblingDoc: blockFieldData,\n })\n\n return promises\n }\n\n return blockPopulationPromise\n}\n"],"names":["sanitizeFields","recurseNestedFields","blockPopulationPromiseHOC","props","blockPopulationPromise","context","currentDepth","depth","editorPopulationPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","blocks","blockFieldData","fields","promises","payloadConfig","payload","config","validRelationships","collections","map","c","slug","forEach","block","requireFieldLevelRichTextEditor","find","blockType","length","data"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAM/C,SAASC,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAMC,yBAAiE,CAAC,EACtEC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,wBAAwB,EACxBC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACX;QACC,MAAMC,SAAkBd,MAAMc,MAAM;QACpC,MAAMC,iBAAiBP,KAAKQ,MAAM;QAElC,MAAMC,WAA4B,EAAE;QAEpC,uHAAuH;QACvH,MAAMC,gBAAgBP,IAAIQ,OAAO,CAACC,MAAM;QACxC,MAAMC,qBAAqBH,cAAcI,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAC7EX,OAAOY,OAAO,CAAC,CAACC;YACdA,MAAMX,MAAM,GAAGnB,eAAe;gBAC5BuB,QAAQF;gBACRF,QAAQW,MAAMX,MAAM;gBACpBY,iCAAiC;gBACjCP;YACF;QACF;QAEA,+BAA+B;QAC/B,MAAMM,QAAQ3B,MAAMc,MAAM,CAACe,IAAI,CAAC,CAACF,QAAUA,MAAMF,IAAI,KAAKV,eAAee,SAAS;QAClF,IAAI,CAACH,SAAS,CAACA,OAAOX,QAAQe,UAAU,CAAChB,gBAAgB;YACvD,OAAOE;QACT;QAEAnB,oBAAoB;YAClBI;YACAC;YACA6B,MAAMjB;YACNX;YACAC;YACAW,QAAQW,MAAMX,MAAM;YACpBV;YACAC;YACAE;YACAC;YACAO;YACAN;YACAC;YACA,kNAAkN;YAClNC,YAAYE;QACd;QAEA,OAAOE;IACT;IAEA,OAAOhB;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/blocks/validate.ts"],"sourcesContent":["import type { Block } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { NodeValidation } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nexport const blockValidationHOC = (\n props: BlocksFeatureProps,\n): NodeValidation<SerializedBlockNode> => {\n const blockValidation: NodeValidation<SerializedBlockNode> = async ({ node, validation }) => {\n const blockFieldData = node.fields\n const blocks: Block[] = props.blocks\n\n const {\n options: {\n req,\n req: {\n payload: { config },\n },\n },\n } = validation\n\n // Sanitize block's fields here. This is done here and not in the feature, because the payload config is available here\n const validRelationships = config.collections.map((c) => c.slug) || []\n blocks.forEach((block) => {\n block.fields = sanitizeFields({\n config,\n fields: block.fields,\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n })\n\n // find block\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n\n // validate block\n if (!block) {\n return 'Block not found'\n }\n\n for (const field of block.fields) {\n if ('validate' in field && typeof field.validate === 'function' && field.validate) {\n const fieldValue = 'name' in field ? node.fields[field.name] : null\n\n const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(fieldValue, node.fields, {\n user: req?.user,\n }),\n )\n : true\n if (!passesCondition) {\n continue // Fixes https://github.com/payloadcms/payload/issues/4000\n }\n\n const validationResult = await field.validate(fieldValue, {\n ...field,\n id: validation.options.id,\n data: fieldValue,\n operation: validation.options.operation,\n req,\n siblingData: validation.options.siblingData,\n })\n\n if (validationResult !== true) {\n return validationResult\n }\n }\n }\n\n return true\n }\n\n return blockValidation\n}\n"],"names":["sanitizeFields","blockValidationHOC","props","blockValidation","node","validation","blockFieldData","fields","blocks","options","req","payload","config","validRelationships","collections","map","c","slug","forEach","block","requireFieldLevelRichTextEditor","find","blockType","field","validate","fieldValue","name","passesCondition","admin","condition","Boolean","user","validationResult","id","data","operation","siblingData"],"mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAM/C,OAAO,MAAMC,qBAAqB,CAChCC;IAEA,MAAMC,kBAAuD,OAAO,EAAEC,IAAI,EAAEC,UAAU,EAAE;QACtF,MAAMC,iBAAiBF,KAAKG,MAAM;QAClC,MAAMC,SAAkBN,MAAMM,MAAM;QAEpC,MAAM,EACJC,SAAS,EACPC,GAAG,EACHA,KAAK,EACHC,SAAS,EAAE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version":3,"sources":["../../../../src/field/features/blocks/validate.ts"],"sourcesContent":["import type { Block } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { NodeValidation } from '../types.js'\nimport type { BlocksFeatureProps } from './feature.server.js'\nimport type { SerializedBlockNode } from './nodes/BlocksNode.js'\n\nexport const blockValidationHOC = (\n props: BlocksFeatureProps,\n): NodeValidation<SerializedBlockNode> => {\n const blockValidation: NodeValidation<SerializedBlockNode> = async ({ node, validation }) => {\n const blockFieldData = node.fields\n const blocks: Block[] = props.blocks\n\n const {\n options: {\n req,\n req: {\n payload: { config },\n },\n },\n } = validation\n\n // Sanitize block's fields here. This is done here and not in the feature, because the payload config is available here\n const validRelationships = config.collections.map((c) => c.slug) || []\n blocks.forEach((block) => {\n block.fields = sanitizeFields({\n config,\n fields: block.fields,\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n })\n\n // find block\n const block = props.blocks.find((block) => block.slug === blockFieldData.blockType)\n\n // validate block\n if (!block) {\n return 'Block not found'\n }\n\n for (const field of block.fields) {\n if ('validate' in field && typeof field.validate === 'function' && field.validate) {\n const fieldValue = 'name' in field ? node.fields[field.name] : null\n\n const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(fieldValue, node.fields, {\n user: req?.user,\n }),\n )\n : true\n if (!passesCondition) {\n continue // Fixes https://github.com/payloadcms/payload/issues/4000\n }\n\n const validationResult = await field.validate(fieldValue, {\n ...field,\n id: validation.options.id,\n data: fieldValue,\n operation: validation.options.operation,\n req,\n siblingData: validation.options.siblingData,\n })\n\n if (validationResult !== true) {\n return validationResult\n }\n }\n }\n\n return true\n }\n\n return blockValidation\n}\n"],"names":["sanitizeFields","blockValidationHOC","props","blockValidation","node","validation","blockFieldData","fields","blocks","options","req","payload","config","validRelationships","collections","map","c","slug","forEach","block","requireFieldLevelRichTextEditor","find","blockType","field","validate","fieldValue","name","passesCondition","admin","condition","Boolean","user","validationResult","id","data","operation","siblingData"],"rangeMappings":";;;;;;;;;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MC,QAAQ,CAACC,YAAY;oBACxD,GAAGF,KAAK;oBACRU,IAAI5B,WAAWI,OAAO,CAACwB,EAAE;oBACzBC,MAAMT;oBACNU,WAAW9B,WAAWI,OAAO,CAAC0B,SAAS;oBACvCzB;oBACA0B,aAAa/B,WAAWI,OAAO,CAAC2B,WAAW;gBAC7C;gBAEA,IAAIJ,qBAAqB,MAAM;oBAC7B,OAAOA;gBACT;YACF;QACF;QAEA,OAAO;IACT;IAEA,OAAO7B;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const FeaturesSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'features',\n order: 5,\n }\n}\n"],"names":["FeaturesSectionWithEntries","entries","type","key","order"],"mappings":"AAKA,OAAO,MAAMA,6BAA6B,CACxCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const FeaturesSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'features',\n order: 5,\n }\n}\n"],"names":["FeaturesSectionWithEntries","entries","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAKA,OAAO,MAAMA,6BAA6B,CACxCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/common/floatingSelectToolbarTextDropdownSection/index.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nimport { TextIcon } from '../../../lexical/ui/icons/Text/index.js'\n\nexport const TextDropdownSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'dropdown',\n ChildComponent: TextIcon,\n entries,\n key: 'dropdown-text',\n order: 1,\n }\n}\n"],"names":["TextIcon","TextDropdownSectionWithEntries","entries","type","ChildComponent","key","order"],"mappings":"AAKA,SAASA,QAAQ,QAAQ,0CAAyC;AAElE,OAAO,MAAMC,iCAAiC,CAC5CC;IAEA,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/common/floatingSelectToolbarTextDropdownSection/index.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nimport { TextIcon } from '../../../lexical/ui/icons/Text/index.js'\n\nexport const TextDropdownSectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'dropdown',\n ChildComponent: TextIcon,\n entries,\n key: 'dropdown-text',\n order: 1,\n }\n}\n"],"names":["TextIcon","TextDropdownSectionWithEntries","entries","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAKA,SAASA,QAAQ,QAAQ,0CAAyC;AAElE,OAAO,MAAMC,iCAAiC,CAC5CC;IAEA,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/linebreak.ts"],"sourcesContent":["import type { SerializedParagraphNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nexport const LinebreakHTMLConverter: HTMLConverter<SerializedParagraphNode> = {\n converter() {\n return `<br>`\n },\n nodeTypes: ['linebreak'],\n}\n"],"names":["LinebreakHTMLConverter","converter","nodeTypes"],"mappings":"AAIA,OAAO,MAAMA,yBAAiE;IAC5EC;QACE,OAAO,CAAC,IAAI,CAAC;IACf;IACAC,WAAW;QAAC;KAAY;AAC1B,EAAC"}
1
+ {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/linebreak.ts"],"sourcesContent":["import type { SerializedParagraphNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nexport const LinebreakHTMLConverter: HTMLConverter<SerializedParagraphNode> = {\n converter() {\n return `<br>`\n },\n nodeTypes: ['linebreak'],\n}\n"],"names":["LinebreakHTMLConverter","converter","nodeTypes"],"rangeMappings":";;;;;;;","mappings":"AAIA,OAAO,MAAMA,yBAAiE;IAC5EC;QACE,OAAO,CAAC,IAAI,CAAC;IACf;IACAC,WAAW;QAAC;KAAY;AAC1B,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/paragraph.ts"],"sourcesContent":["import type { SerializedParagraphNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../index.js'\n\nexport const ParagraphHTMLConverter: HTMLConverter<SerializedParagraphNode> = {\n async converter({ converters, node, parent, payload }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n return `<p>${childrenText}</p>`\n },\n nodeTypes: ['paragraph'],\n}\n"],"names":["convertLexicalNodesToHTML","ParagraphHTMLConverter","converter","converters","node","parent","payload","childrenText","lexicalNodes","children","nodeTypes"],"mappings":"AAIA,SAASA,yBAAyB,QAAQ,cAAa;AAEvD,OAAO,MAAMC,yBAAiE;IAC5E,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;QACnD,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QACA,OAAO,CAAC,GAAG,EAAEC,aAAa,IAAI,CAAC;IACjC;IACAG,WAAW;QAAC;KAAY;AAC1B,EAAC"}
1
+ {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/paragraph.ts"],"sourcesContent":["import type { SerializedParagraphNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../index.js'\n\nexport const ParagraphHTMLConverter: HTMLConverter<SerializedParagraphNode> = {\n async converter({ converters, node, parent, payload }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n return `<p>${childrenText}</p>`\n },\n nodeTypes: ['paragraph'],\n}\n"],"names":["convertLexicalNodesToHTML","ParagraphHTMLConverter","converter","converters","node","parent","payload","childrenText","lexicalNodes","children","nodeTypes"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,yBAAyB,QAAQ,cAAa;AAEvD,OAAO,MAAMC,yBAAiE;IAC5E,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;QACnD,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QACA,OAAO,CAAC,GAAG,EAAEC,aAAa,IAAI,CAAC;IACjC;IACAG,WAAW;QAAC;KAAY;AAC1B,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/text.ts"],"sourcesContent":["import type { SerializedTextNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextHTMLConverter: HTMLConverter<SerializedTextNode> = {\n converter({ node }) {\n let text = node.text\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n nodeTypes: ['text'],\n}\n"],"names":["NodeFormat","TextHTMLConverter","converter","node","text","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT","nodeTypes"],"mappings":"AAIA,SAASA,UAAU,QAAQ,6CAA4C;AAEvE,OAAO,MAAMC,oBAAuD;IAClEC,WAAU,EAAEC,IAAI,EAAE;QAChB,IAAIC,OAAOD,KAAKC,IAAI;QAEpB,IAAID,KAAKE,MAAM,GAAGL,WAAWM,OAAO,EAAE;YACpCF,OAAO,CAAC,QAAQ,EAAEA,KAAK,SAAS,CAAC;QACnC;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWO,SAAS,EAAE;YACtCH,OAAO,CAAC,IAAI,EAAEA,KAAK,KAAK,CAAC;QAC3B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWQ,gBAAgB,EAAE;YAC7CJ,OAAO,CAAC,4CAA4C,EAAEA,KAAK,OAAO,CAAC;QACrE;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWS,YAAY,EAAE;YACzCL,OAAO,CAAC,yCAAyC,EAAEA,KAAK,OAAO,CAAC;QAClE;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWU,OAAO,EAAE;YACpCN,OAAO,CAAC,MAAM,EAAEA,KAAK,OAAO,CAAC;QAC/B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWW,YAAY,EAAE;YACzCP,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWY,cAAc,EAAE;YAC3CR,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QAEA,OAAOA;IACT;IACAS,WAAW;QAAC;KAAO;AACrB,EAAC"}
1
+ {"version":3,"sources":["../../../../../../../src/field/features/converters/html/converter/converters/text.ts"],"sourcesContent":["import type { SerializedTextNode } from 'lexical'\n\nimport type { HTMLConverter } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextHTMLConverter: HTMLConverter<SerializedTextNode> = {\n converter({ node }) {\n let text = node.text\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n nodeTypes: ['text'],\n}\n"],"names":["NodeFormat","TextHTMLConverter","converter","node","text","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT","nodeTypes"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,UAAU,QAAQ,6CAA4C;AAEvE,OAAO,MAAMC,oBAAuD;IAClEC,WAAU,EAAEC,IAAI,EAAE;QAChB,IAAIC,OAAOD,KAAKC,IAAI;QAEpB,IAAID,KAAKE,MAAM,GAAGL,WAAWM,OAAO,EAAE;YACpCF,OAAO,CAAC,QAAQ,EAAEA,KAAK,SAAS,CAAC;QACnC;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWO,SAAS,EAAE;YACtCH,OAAO,CAAC,IAAI,EAAEA,KAAK,KAAK,CAAC;QAC3B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWQ,gBAAgB,EAAE;YAC7CJ,OAAO,CAAC,4CAA4C,EAAEA,KAAK,OAAO,CAAC;QACrE;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWS,YAAY,EAAE;YACzCL,OAAO,CAAC,yCAAyC,EAAEA,KAAK,OAAO,CAAC;QAClE;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWU,OAAO,EAAE;YACpCN,OAAO,CAAC,MAAM,EAAEA,KAAK,OAAO,CAAC;QAC/B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWW,YAAY,EAAE;YACzCP,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QACA,IAAID,KAAKE,MAAM,GAAGL,WAAWY,cAAc,EAAE;YAC3CR,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QAEA,OAAOA;IACT;IACAS,WAAW;QAAC;KAAO;AACrB,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/defaultConverters.ts"],"sourcesContent":["import type { HTMLConverter } from './types.js'\n\nimport { LinebreakHTMLConverter } from './converters/linebreak.js'\nimport { ParagraphHTMLConverter } from './converters/paragraph.js'\nimport { TextHTMLConverter } from './converters/text.js'\n\nexport const defaultHTMLConverters: HTMLConverter[] = [\n ParagraphHTMLConverter,\n TextHTMLConverter,\n LinebreakHTMLConverter,\n]\n"],"names":["LinebreakHTMLConverter","ParagraphHTMLConverter","TextHTMLConverter","defaultHTMLConverters"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,iBAAiB,QAAQ,uBAAsB;AAExD,OAAO,MAAMC,wBAAyC;IACpDF;IACAC;IACAF;CACD,CAAA"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/defaultConverters.ts"],"sourcesContent":["import type { HTMLConverter } from './types.js'\n\nimport { LinebreakHTMLConverter } from './converters/linebreak.js'\nimport { ParagraphHTMLConverter } from './converters/paragraph.js'\nimport { TextHTMLConverter } from './converters/text.js'\n\nexport const defaultHTMLConverters: HTMLConverter[] = [\n ParagraphHTMLConverter,\n TextHTMLConverter,\n LinebreakHTMLConverter,\n]\n"],"names":["LinebreakHTMLConverter","ParagraphHTMLConverter","TextHTMLConverter","defaultHTMLConverters"],"rangeMappings":";;;;;;;","mappings":"AAEA,SAASA,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,iBAAiB,QAAQ,uBAAsB;AAExD,OAAO,MAAMC,wBAAyC;IACpDF;IACAC;IACAF;CACD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/converters/html/converter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAEhF,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,IAAI,EACJ,OAAO,GACR,EAAE;IACD,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAUlB;AAED,wBAAsB,yBAAyB,CAAC,EAC9C,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,YAAY,EAAE,qBAAqB,EAAE,CAAA;IACrC,MAAM,EAAE,+BAA+B,CAAA;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/converters/html/converter/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAC3E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAEhF,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,IAAI,EACJ,OAAO,GACR,EAAE;IACD,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAUlB;AAED,wBAAsB,yBAAyB,CAAC,EAC9C,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,YAAY,EAAE,qBAAqB,EAAE,CAAA;IACrC,MAAM,EAAE,+BAA+B,CAAA;IACvC;;OAEG;IACH,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoClB"}
@@ -13,25 +13,30 @@ export async function convertLexicalNodesToHTML({ converters, lexicalNodes, pare
13
13
  const unknownConverter = converters.find((converter)=>converter.nodeTypes.includes('unknown'));
14
14
  const htmlArray = await Promise.all(lexicalNodes.map(async (node, i)=>{
15
15
  const converterForNode = converters.find((converter)=>converter.nodeTypes.includes(node.type));
16
- if (!converterForNode) {
17
- if (unknownConverter) {
18
- return unknownConverter.converter({
19
- childIndex: i,
20
- converters,
21
- node,
22
- parent,
23
- payload
24
- });
16
+ try {
17
+ if (!converterForNode) {
18
+ if (unknownConverter) {
19
+ return await unknownConverter.converter({
20
+ childIndex: i,
21
+ converters,
22
+ node,
23
+ parent,
24
+ payload
25
+ });
26
+ }
27
+ return '<span>unknown node</span>';
25
28
  }
26
- return '<span>unknown node</span>';
29
+ return await converterForNode.converter({
30
+ childIndex: i,
31
+ converters,
32
+ node,
33
+ parent,
34
+ payload
35
+ });
36
+ } catch (error) {
37
+ console.error('Error converting lexical node to HTML:', error, 'node:', node);
38
+ return '';
27
39
  }
28
- return converterForNode.converter({
29
- childIndex: i,
30
- converters,
31
- node,
32
- parent,
33
- payload
34
- });
35
40
  }));
36
41
  return htmlArray.join('') || '';
37
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/index.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { Payload } from 'payload'\n\nimport type { HTMLConverter, SerializedLexicalNodeWithParent } from './types.js'\n\nexport async function convertLexicalToHTML({\n converters,\n data,\n payload,\n}: {\n converters: HTMLConverter[]\n data: SerializedEditorState\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n}): Promise<string> {\n if (data?.root?.children?.length) {\n return await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: data?.root?.children,\n parent: data?.root,\n payload,\n })\n }\n return ''\n}\n\nexport async function convertLexicalNodesToHTML({\n converters,\n lexicalNodes,\n parent,\n payload,\n}: {\n converters: HTMLConverter[]\n lexicalNodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n}): Promise<string> {\n const unknownConverter = converters.find((converter) => converter.nodeTypes.includes('unknown'))\n\n const htmlArray = await Promise.all(\n lexicalNodes.map(async (node, i) => {\n const converterForNode = converters.find((converter) =>\n converter.nodeTypes.includes(node.type),\n )\n if (!converterForNode) {\n if (unknownConverter) {\n return unknownConverter.converter({ childIndex: i, converters, node, parent, payload })\n }\n return '<span>unknown node</span>'\n }\n return converterForNode.converter({\n childIndex: i,\n converters,\n node,\n parent,\n payload,\n })\n }),\n )\n\n return htmlArray.join('') || ''\n}\n"],"names":["convertLexicalToHTML","converters","data","payload","root","children","length","convertLexicalNodesToHTML","lexicalNodes","parent","unknownConverter","find","converter","nodeTypes","includes","htmlArray","Promise","all","map","node","i","converterForNode","type","childIndex","join"],"mappings":"AAKA,OAAO,eAAeA,qBAAqB,EACzCC,UAAU,EACVC,IAAI,EACJC,OAAO,EAQR;IACC,IAAID,MAAME,MAAMC,UAAUC,QAAQ;QAChC,OAAO,MAAMC,0BAA0B;YACrCN;YACAO,cAAcN,MAAME,MAAMC;YAC1BI,QAAQP,MAAME;YACdD;QACF;IACF;IACA,OAAO;AACT;AAEA,OAAO,eAAeI,0BAA0B,EAC9CN,UAAU,EACVO,YAAY,EACZC,MAAM,EACNN,OAAO,EASR;IACC,MAAMO,mBAAmBT,WAAWU,IAAI,CAAC,CAACC,YAAcA,UAAUC,SAAS,CAACC,QAAQ,CAAC;IAErF,MAAMC,YAAY,MAAMC,QAAQC,GAAG,CACjCT,aAAaU,GAAG,CAAC,OAAOC,MAAMC;QAC5B,MAAMC,mBAAmBpB,WAAWU,IAAI,CAAC,CAACC,YACxCA,UAAUC,SAAS,CAACC,QAAQ,CAACK,KAAKG,IAAI;QAExC,IAAI,CAACD,kBAAkB;YACrB,IAAIX,kBAAkB;gBACpB,OAAOA,iBAAiBE,SAAS,CAAC;oBAAEW,YAAYH;oBAAGnB;oBAAYkB;oBAAMV;oBAAQN;gBAAQ;YACvF;YACA,OAAO;QACT;QACA,OAAOkB,iBAAiBT,SAAS,CAAC;YAChCW,YAAYH;YACZnB;YACAkB;YACAV;YACAN;QACF;IACF;IAGF,OAAOY,UAAUS,IAAI,CAAC,OAAO;AAC/B"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/index.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\nimport type { Payload } from 'payload'\n\nimport type { HTMLConverter, SerializedLexicalNodeWithParent } from './types.js'\n\nexport async function convertLexicalToHTML({\n converters,\n data,\n payload,\n}: {\n converters: HTMLConverter[]\n data: SerializedEditorState\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n}): Promise<string> {\n if (data?.root?.children?.length) {\n return await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: data?.root?.children,\n parent: data?.root,\n payload,\n })\n }\n return ''\n}\n\nexport async function convertLexicalNodesToHTML({\n converters,\n lexicalNodes,\n parent,\n payload,\n}: {\n converters: HTMLConverter[]\n lexicalNodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n}): Promise<string> {\n const unknownConverter = converters.find((converter) => converter.nodeTypes.includes('unknown'))\n\n const htmlArray = await Promise.all(\n lexicalNodes.map(async (node, i) => {\n const converterForNode = converters.find((converter) =>\n converter.nodeTypes.includes(node.type),\n )\n try {\n if (!converterForNode) {\n if (unknownConverter) {\n return await unknownConverter.converter({\n childIndex: i,\n converters,\n node,\n parent,\n payload,\n })\n }\n return '<span>unknown node</span>'\n }\n return await converterForNode.converter({\n childIndex: i,\n converters,\n node,\n parent,\n payload,\n })\n } catch (error) {\n console.error('Error converting lexical node to HTML:', error, 'node:', node)\n return ''\n }\n }),\n )\n\n return htmlArray.join('') || ''\n}\n"],"names":["convertLexicalToHTML","converters","data","payload","root","children","length","convertLexicalNodesToHTML","lexicalNodes","parent","unknownConverter","find","converter","nodeTypes","includes","htmlArray","Promise","all","map","node","i","converterForNode","type","childIndex","error","console","join"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,OAAO,eAAeA,qBAAqB,EACzCC,UAAU,EACVC,IAAI,EACJC,OAAO,EAQR;IACC,IAAID,MAAME,MAAMC,UAAUC,QAAQ;QAChC,OAAO,MAAMC,0BAA0B;YACrCN;YACAO,cAAcN,MAAME,MAAMC;YAC1BI,QAAQP,MAAME;YACdD;QACF;IACF;IACA,OAAO;AACT;AAEA,OAAO,eAAeI,0BAA0B,EAC9CN,UAAU,EACVO,YAAY,EACZC,MAAM,EACNN,OAAO,EASR;IACC,MAAMO,mBAAmBT,WAAWU,IAAI,CAAC,CAACC,YAAcA,UAAUC,SAAS,CAACC,QAAQ,CAAC;IAErF,MAAMC,YAAY,MAAMC,QAAQC,GAAG,CACjCT,aAAaU,GAAG,CAAC,OAAOC,MAAMC;QAC5B,MAAMC,mBAAmBpB,WAAWU,IAAI,CAAC,CAACC,YACxCA,UAAUC,SAAS,CAACC,QAAQ,CAACK,KAAKG,IAAI;QAExC,IAAI;YACF,IAAI,CAACD,kBAAkB;gBACrB,IAAIX,kBAAkB;oBACpB,OAAO,MAAMA,iBAAiBE,SAAS,CAAC;wBACtCW,YAAYH;wBACZnB;wBACAkB;wBACAV;wBACAN;oBACF;gBACF;gBACA,OAAO;YACT;YACA,OAAO,MAAMkB,iBAAiBT,SAAS,CAAC;gBACtCW,YAAYH;gBACZnB;gBACAkB;gBACAV;gBACAN;YACF;QACF,EAAE,OAAOqB,OAAO;YACdC,QAAQD,KAAK,CAAC,0CAA0CA,OAAO,SAASL;YACxE,OAAO;QACT;IACF;IAGF,OAAOJ,UAAUW,IAAI,CAAC,OAAO;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type { Payload } from 'payload'\n\nexport type HTMLConverter<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n converter: ({\n childIndex,\n converters,\n node,\n parent,\n payload,\n }: {\n childIndex: number\n converters: HTMLConverter[]\n node: T\n parent: SerializedLexicalNodeWithParent\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n }) => Promise<string> | string\n nodeTypes: string[]\n}\n\nexport type SerializedLexicalNodeWithParent = SerializedLexicalNode & {\n parent?: SerializedLexicalNode\n}\n"],"names":[],"mappings":"AAuBA,WAEC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/converters/html/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type { Payload } from 'payload'\n\nexport type HTMLConverter<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n converter: ({\n childIndex,\n converters,\n node,\n parent,\n payload,\n }: {\n childIndex: number\n converters: HTMLConverter[]\n node: T\n parent: SerializedLexicalNodeWithParent\n /**\n * When the converter is called, payload CAN be passed in depending on where it's run.\n */\n payload: Payload | null\n }) => Promise<string> | string\n nodeTypes: string[]\n}\n\nexport type SerializedLexicalNodeWithParent = SerializedLexicalNode & {\n parent?: SerializedLexicalNode\n}\n"],"names":[],"rangeMappings":"","mappings":"AAuBA,WAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/converters/html/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\nimport type { HTMLConverter } from './converter/types.js'\n\nexport type HTMLConverterFeatureProps = {\n converters?:\n | (({ defaultConverters }: { defaultConverters: HTMLConverter[] }) => HTMLConverter[])\n | HTMLConverter[]\n}\n\nexport const HTMLConverterFeature: FeatureProviderProviderServer<\n HTMLConverterFeatureProps,\n undefined\n> = (props) => {\n return {\n feature: () => {\n return {\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'htmlConverter',\n serverFeatureProps: props,\n }\n}\n"],"names":["HTMLConverterFeature","props","feature","clientFeatureProps","serverFeatureProps","key"],"mappings":"AASA,OAAO,MAAMA,uBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,oBAAoB;gBACpBC,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/converters/html/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\nimport type { HTMLConverter } from './converter/types.js'\n\nexport type HTMLConverterFeatureProps = {\n converters?:\n | (({ defaultConverters }: { defaultConverters: HTMLConverter[] }) => HTMLConverter[])\n | HTMLConverter[]\n}\n\nexport const HTMLConverterFeature: FeatureProviderProviderServer<\n HTMLConverterFeatureProps,\n undefined\n> = (props) => {\n return {\n feature: () => {\n return {\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'htmlConverter',\n serverFeatureProps: props,\n }\n}\n"],"names":["HTMLConverterFeature","props","feature","clientFeatureProps","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;","mappings":"AASA,OAAO,MAAMA,uBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,oBAAoB;gBACpBC,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field, RichTextField, TextField } from 'payload/types'\n\nimport type { AdapterProps, LexicalRichTextAdapter } from '../../../../../types.js'\nimport type { SanitizedServerEditorConfig } from '../../../../lexical/config/types.js'\nimport type { HTMLConverter } from '../converter/types.js'\nimport type { HTMLConverterFeatureProps } from '../feature.server.js'\n\nimport { defaultHTMLConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToHTML } from '../converter/index.js'\n\ntype Props = {\n name: string\n}\n\n/**\n * Combines the default HTML converters with HTML converters found in the features, and with HTML converters configured in the htmlConverter feature.\n *\n * @param editorConfig\n */\nexport const consolidateHTMLConverters = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const htmlConverterFeature = editorConfig.resolvedFeatureMap.get('htmlConverter')\n const htmlConverterFeatureProps: HTMLConverterFeatureProps =\n htmlConverterFeature?.serverFeatureProps\n\n const defaultConvertersWithConvertersFromFeatures = defaultHTMLConverters\n\n for (const converter of editorConfig.features.converters.html) {\n defaultConvertersWithConvertersFromFeatures.push(converter)\n }\n\n const finalConverters =\n htmlConverterFeatureProps?.converters &&\n typeof htmlConverterFeatureProps?.converters === 'function'\n ? htmlConverterFeatureProps.converters({\n defaultConverters: defaultConvertersWithConvertersFromFeatures,\n })\n : (htmlConverterFeatureProps?.converters as HTMLConverter[]) ||\n defaultConvertersWithConvertersFromFeatures\n\n return finalConverters\n}\n\nexport const lexicalHTML: (\n /**\n * A string which matches the lexical field name you want to convert to HTML.\n *\n * This has to be a SIBLING field of this lexicalHTML field - otherwise, it won't be able to find the lexical field.\n **/\n lexicalFieldName: string,\n props: Props,\n) => TextField = (lexicalFieldName, props) => {\n const { name = 'lexicalHTML' } = props\n return {\n name,\n type: 'text',\n admin: {\n hidden: true,\n },\n hooks: {\n afterRead: [\n async ({ collection, field, global, req, siblingData }) => {\n const fields = collection ? collection.fields : global.fields\n\n // find the path of this field, as well as its sibling fields, by looking for this `field` in fields and traversing it recursively\n function findFieldPathAndSiblingFields(\n fields: Field[],\n path: string[],\n ): {\n path: string[]\n siblingFields: Field[]\n } {\n for (const curField of fields) {\n if (curField === field) {\n return {\n path: [...path, curField.name],\n siblingFields: fields,\n }\n }\n\n if ('fields' in curField) {\n const result = findFieldPathAndSiblingFields(\n curField.fields,\n 'name' in curField ? [...path, curField.name] : [...path],\n )\n if (result) {\n return result\n }\n } else if ('tabs' in curField) {\n for (const tab of curField.tabs) {\n const result = findFieldPathAndSiblingFields(\n tab.fields,\n 'name' in tab ? [...path, tab.name] : [...path],\n )\n if (result) {\n return result\n }\n }\n } else if ('blocks' in curField) {\n for (const block of curField.blocks) {\n if (block?.fields?.length) {\n const result = findFieldPathAndSiblingFields(block.fields, [\n ...path,\n curField.name,\n block.slug,\n ])\n if (result) {\n return result\n }\n }\n }\n }\n }\n\n return null\n }\n\n const foundSiblingFields = findFieldPathAndSiblingFields(fields, [])\n\n if (!foundSiblingFields)\n throw new Error(\n `Could not find sibling fields of current lexicalHTML field with name ${field?.name}`,\n )\n\n const { siblingFields } = foundSiblingFields\n const lexicalField: RichTextField<SerializedEditorState, AdapterProps> =\n siblingFields.find(\n (field) => 'name' in field && field.name === lexicalFieldName,\n ) as RichTextField<SerializedEditorState, AdapterProps>\n\n const lexicalFieldData: SerializedEditorState = siblingData[lexicalFieldName]\n\n if (!lexicalFieldData) {\n return ''\n }\n\n if (!lexicalField) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the referenced lexical field was not found',\n )\n }\n\n const config = (lexicalField?.editor as LexicalRichTextAdapter)?.editorConfig\n\n if (!config) {\n throw new Error(\n 'The linked lexical field does not have an editorConfig. This is needed for the lexicalHTML field.',\n )\n }\n\n if (!config?.resolvedFeatureMap?.has('htmlConverter')) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the linked lexical field does not have a HTMLConverterFeature',\n )\n }\n\n const finalConverters = consolidateHTMLConverters({\n editorConfig: config,\n })\n\n return await convertLexicalToHTML({\n converters: finalConverters,\n data: lexicalFieldData,\n payload: req.payload,\n })\n },\n ],\n },\n }\n}\n"],"names":["defaultHTMLConverters","convertLexicalToHTML","consolidateHTMLConverters","editorConfig","htmlConverterFeature","resolvedFeatureMap","get","htmlConverterFeatureProps","serverFeatureProps","defaultConvertersWithConvertersFromFeatures","converter","features","converters","html","push","finalConverters","defaultConverters","lexicalHTML","lexicalFieldName","props","name","type","admin","hidden","hooks","afterRead","collection","field","global","req","siblingData","fields","findFieldPathAndSiblingFields","path","curField","siblingFields","result","tab","tabs","block","blocks","length","slug","foundSiblingFields","Error","lexicalField","find","lexicalFieldData","config","editor","has","data","payload"],"mappings":"AAQA,SAASA,qBAAqB,QAAQ,oCAAmC;AACzE,SAASC,oBAAoB,QAAQ,wBAAuB;AAM5D;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B,CAAC,EACxCC,YAAY,EAGb;IACC,MAAMC,uBAAuBD,aAAaE,kBAAkB,CAACC,GAAG,CAAC;IACjE,MAAMC,4BACJH,sBAAsBI;IAExB,MAAMC,8CAA8CT;IAEpD,KAAK,MAAMU,aAAaP,aAAaQ,QAAQ,CAACC,UAAU,CAACC,IAAI,CAAE;QAC7DJ,4CAA4CK,IAAI,CAACJ;IACnD;IAEA,MAAMK,kBACJR,2BAA2BK,cAC3B,OAAOL,2BAA2BK,eAAe,aAC7CL,0BAA0BK,UAAU,CAAC;QACnCI,mBAAmBP;IACrB,KACA,AAACF,2BAA2BK,cAC5BH;IAEN,OAAOM;AACT,EAAC;AAED,OAAO,MAAME,cAQI,CAACC,kBAAkBC;IAClC,MAAM,EAAEC,OAAO,aAAa,EAAE,GAAGD;IACjC,OAAO;QACLC;QACAC,MAAM;QACNC,OAAO;YACLC,QAAQ;QACV;QACAC,OAAO;YACLC,WAAW;gBACT,OAAO,EAAEC,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,GAAG,EAAEC,WAAW,EAAE;oBACpD,MAAMC,SAASL,aAAaA,WAAWK,MAAM,GAAGH,OAAOG,MAAM;oBAE7D,kIAAkI;oBAClI,SAASC,8BACPD,MAAe,EACfE,IAAc;wBAKd,KAAK,MAAMC,YAAYH,OAAQ;4BAC7B,IAAIG,aAAaP,OAAO;gCACtB,OAAO;oCACLM,MAAM;2CAAIA;wCAAMC,SAASd,IAAI;qCAAC;oCAC9Be,eAAeJ;gCACj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X,MAAM,IAAIJ,MACR;oBAEJ;oBAEA,IAAI,CAACI,QAAQ3C,oBAAoB6C,IAAI,kBAAkB;wBACrD,MAAM,IAAIN,MACR;oBAEJ;oBAEA,MAAM7B,kBAAkBb,0BAA0B;wBAChDC,cAAc6C;oBAChB;oBAEA,OAAO,MAAM/C,qBAAqB;wBAChCW,YAAYG;wBACZoC,MAAMJ;wBACNK,SAASvB,IAAIuB,OAAO;oBACtB;gBACF;aACD;QACH;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/converters/html/field/index.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { Field, RichTextField, TextField } from 'payload/types'\n\nimport type { AdapterProps, LexicalRichTextAdapter } from '../../../../../types.js'\nimport type { SanitizedServerEditorConfig } from '../../../../lexical/config/types.js'\nimport type { HTMLConverter } from '../converter/types.js'\nimport type { HTMLConverterFeatureProps } from '../feature.server.js'\n\nimport { defaultHTMLConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToHTML } from '../converter/index.js'\n\ntype Props = {\n name: string\n}\n\n/**\n * Combines the default HTML converters with HTML converters found in the features, and with HTML converters configured in the htmlConverter feature.\n *\n * @param editorConfig\n */\nexport const consolidateHTMLConverters = ({\n editorConfig,\n}: {\n editorConfig: SanitizedServerEditorConfig\n}) => {\n const htmlConverterFeature = editorConfig.resolvedFeatureMap.get('htmlConverter')\n const htmlConverterFeatureProps: HTMLConverterFeatureProps =\n htmlConverterFeature?.serverFeatureProps\n\n const defaultConvertersWithConvertersFromFeatures = defaultHTMLConverters\n\n for (const converter of editorConfig.features.converters.html) {\n defaultConvertersWithConvertersFromFeatures.push(converter)\n }\n\n const finalConverters =\n htmlConverterFeatureProps?.converters &&\n typeof htmlConverterFeatureProps?.converters === 'function'\n ? htmlConverterFeatureProps.converters({\n defaultConverters: defaultConvertersWithConvertersFromFeatures,\n })\n : (htmlConverterFeatureProps?.converters as HTMLConverter[]) ||\n defaultConvertersWithConvertersFromFeatures\n\n return finalConverters\n}\n\nexport const lexicalHTML: (\n /**\n * A string which matches the lexical field name you want to convert to HTML.\n *\n * This has to be a SIBLING field of this lexicalHTML field - otherwise, it won't be able to find the lexical field.\n **/\n lexicalFieldName: string,\n props: Props,\n) => TextField = (lexicalFieldName, props) => {\n const { name = 'lexicalHTML' } = props\n return {\n name,\n type: 'text',\n admin: {\n hidden: true,\n },\n hooks: {\n afterRead: [\n async ({ collection, field, global, req, siblingData }) => {\n const fields = collection ? collection.fields : global.fields\n\n // find the path of this field, as well as its sibling fields, by looking for this `field` in fields and traversing it recursively\n function findFieldPathAndSiblingFields(\n fields: Field[],\n path: string[],\n ): {\n path: string[]\n siblingFields: Field[]\n } {\n for (const curField of fields) {\n if (curField === field) {\n return {\n path: [...path, curField.name],\n siblingFields: fields,\n }\n }\n\n if ('fields' in curField) {\n const result = findFieldPathAndSiblingFields(\n curField.fields,\n 'name' in curField ? [...path, curField.name] : [...path],\n )\n if (result) {\n return result\n }\n } else if ('tabs' in curField) {\n for (const tab of curField.tabs) {\n const result = findFieldPathAndSiblingFields(\n tab.fields,\n 'name' in tab ? [...path, tab.name] : [...path],\n )\n if (result) {\n return result\n }\n }\n } else if ('blocks' in curField) {\n for (const block of curField.blocks) {\n if (block?.fields?.length) {\n const result = findFieldPathAndSiblingFields(block.fields, [\n ...path,\n curField.name,\n block.slug,\n ])\n if (result) {\n return result\n }\n }\n }\n }\n }\n\n return null\n }\n\n const foundSiblingFields = findFieldPathAndSiblingFields(fields, [])\n\n if (!foundSiblingFields)\n throw new Error(\n `Could not find sibling fields of current lexicalHTML field with name ${field?.name}`,\n )\n\n const { siblingFields } = foundSiblingFields\n const lexicalField: RichTextField<SerializedEditorState, AdapterProps> =\n siblingFields.find(\n (field) => 'name' in field && field.name === lexicalFieldName,\n ) as RichTextField<SerializedEditorState, AdapterProps>\n\n const lexicalFieldData: SerializedEditorState = siblingData[lexicalFieldName]\n\n if (!lexicalFieldData) {\n return ''\n }\n\n if (!lexicalField) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the referenced lexical field was not found',\n )\n }\n\n const config = (lexicalField?.editor as LexicalRichTextAdapter)?.editorConfig\n\n if (!config) {\n throw new Error(\n 'The linked lexical field does not have an editorConfig. This is needed for the lexicalHTML field.',\n )\n }\n\n if (!config?.resolvedFeatureMap?.has('htmlConverter')) {\n throw new Error(\n 'You cannot use the lexicalHTML field because the linked lexical field does not have a HTMLConverterFeature',\n )\n }\n\n const finalConverters = consolidateHTMLConverters({\n editorConfig: config,\n })\n\n return await convertLexicalToHTML({\n converters: finalConverters,\n data: lexicalFieldData,\n payload: req.payload,\n })\n },\n ],\n },\n }\n}\n"],"names":["defaultHTMLConverters","convertLexicalToHTML","consolidateHTMLConverters","editorConfig","htmlConverterFeature","resolvedFeatureMap","get","htmlConverterFeatureProps","serverFeatureProps","defaultConvertersWithConvertersFromFeatures","converter","features","converters","html","push","finalConverters","defaultConverters","lexicalHTML","lexicalFieldName","props","name","type","admin","hidden","hooks","afterRead","collection","field","global","req","siblingData","fields","findFieldPathAndSiblingFields","path","curField","siblingFields","result","tab","tabs","block","blocks","length","slug","foundSiblingFields","Error","lexicalField","find","lexicalFieldData","config","editor","has","data","payload"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAQA,SAASA,qBAAqB,QAAQ,oCAAmC;AACzE,SAASC,oBAAoB,QAAQ,wBAAuB;AAM5D;;;;CAIC,GACD,OAAO,MAAMC,4BAA4B,CAAC,EACxCC,YAAY,EAGb;IACC,MAAMC,uBAAuBD,aAAaE,kBAAkB,CAACC,GAAG,CAAC;IACjE,MAAMC,4BACJH,sBAAsBI;IAExB,MAAMC,8CAA8CT;IAEpD,KAAK,MAAMU,aAAaP,aAAaQ,QAAQ,CAACC,UAAU,CAACC,IAAI,CAAE;QAC7DJ,4CA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,IAAID,OAAOR,QAAQU,QAAQ;wCACzB,MAAML,SAASJ,8BAA8BO,MAAMR,MAAM,EAAE;+CACtDE;4CACHC,SAASd,IAAI;4CACbmB,MAAMG,IAAI;yCACX;wCACD,IAAIN,QAAQ;4CACV,OAAOA;wCACT;oCACF;gCACF;4BACF;wBACF;wBAEA,OAAO;oBACT;oBAEA,MAAMO,qBAAqBX,8BAA8BD,QAAQ,EAAE;oBAEnE,IAAI,CAACY,oBACH,MAAM,IAAIC,MACR,CAAC,qEAAqE,EAAEjB,OAAOP,KAAK,CAAC;oBAGzF,MAAM,EAAEe,aAAa,EAAE,GAAGQ;oBAC1B,MAAME,eACJV,cAAcW,IAAI,CAChB,CAACnB,QAAU,UAAUA,SAASA,MAAMP,IAAI,KAAKF;oBAGjD,MAAM6B,mBAA0CjB,WAAW,CAACZ,iBAAiB;oBAE7E,IAAI,CAAC6B,kBAAkB;wBACrB,OAAO;oBACT;oBAEA,IAAI,CAACF,cAAc;wBACjB,MAAM,IAAID,MACR;oBAEJ;oBAEA,MAAMI,SAAUH,cAAcI,QAAmC9C;oBAEjE,IAAI,CAAC6C,QAAQ;wBACX,MAAM,IAAIJ,MACR;oBAEJ;oBAEA,IAAI,CAACI,QAAQ3C,oBAAoB6C,IAAI,kBAAkB;wBACrD,MAAM,IAAIN,MACR;oBAEJ;oBAEA,MAAM7B,kBAAkBb,0BAA0B;wBAChDC,cAAc6C;oBAChB;oBAEA,OAAO,MAAM/C,qBAAqB;wBAChCW,YAAYG;wBACZoC,MAAMJ;wBACNK,SAASvB,IAAIuB,OAAO;oBACtB;gBACF;aACD;QACH;IACF;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/features/createClientComponent.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient, ServerFeature } from './types.js'\n\nimport { useLexicalFeature } from '../../useLexicalFeature.js'\n\n/**\n * Utility function to create a client component for the client feature\n */\nexport const createClientComponent = <ClientFeatureProps,>(\n clientFeature: FeatureProviderProviderClient<ClientFeatureProps>,\n): ServerFeature<unknown, ClientFeatureProps>['ClientComponent'] => {\n return (props) => {\n useLexicalFeature(props.featureKey, clientFeature(props))\n return null\n }\n}\n"],"names":["useLexicalFeature","createClientComponent","clientFeature","props","featureKey"],"mappings":"AAAA;AAIA,SAASA,iBAAiB,QAAQ,6BAA4B;AAE9D;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CACnCC;IAEA,OAAO,CAACC;QACNH,kBAAkBG,MAAMC,UAAU,EAAEF,cAAcC;QAClD,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/field/features/createClientComponent.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient, ServerFeature } from './types.js'\n\nimport { useLexicalFeature } from '../../useLexicalFeature.js'\n\n/**\n * Utility function to create a client component for the client feature\n */\nexport const createClientComponent = <ClientFeatureProps,>(\n clientFeature: FeatureProviderProviderClient<ClientFeatureProps>,\n): ServerFeature<unknown, ClientFeatureProps>['ClientComponent'] => {\n return (props) => {\n useLexicalFeature(props.featureKey, clientFeature(props))\n return null\n }\n}\n"],"names":["useLexicalFeature","createClientComponent","clientFeature","props","featureKey"],"rangeMappings":";;;;;;;;;","mappings":"AAAA;AAIA,SAASA,iBAAiB,QAAQ,6BAA4B;AAE9D;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CACnCC;IAEA,OAAO,CAACC;QACNH,kBAAkBG,MAAMC,UAAU,EAAEF,cAAcC;QAClD,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/features/createFeaturePropComponent.tsx"],"sourcesContent":["'use client'\n\nimport type React from 'react'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useAddClientFunction } from '@payloadcms/ui/providers/ClientFunction'\n\nconst useLexicalFeatureProp = <T,>(featureKey: string, componentKey: string, prop: T) => {\n const { schemaPath } = useFieldProps()\n\n useAddClientFunction(\n `lexicalFeature.${schemaPath}.${featureKey}.components.${componentKey}`,\n prop,\n )\n}\n\nexport const createFeaturePropComponent = <T = unknown,>(\n prop: T,\n): React.FC<{ componentKey: string; featureKey: string }> => {\n return (props) => {\n useLexicalFeatureProp(props.featureKey, props.componentKey, prop)\n return null\n }\n}\n"],"names":["useFieldProps","useAddClientFunction","useLexicalFeatureProp","featureKey","componentKey","prop","schemaPath","createFeaturePropComponent","props"],"mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,SAASC,oBAAoB,QAAQ,0CAAyC;AAE9E,MAAMC,wBAAwB,CAAKC,YAAoBC,cAAsBC;IAC3E,MAAM,EAAEC,UAAU,EAAE,GAAGN;IAEvBC,qBACE,CAAC,eAAe,EAAEK,WAAW,CAAC,EAAEH,WAAW,YAAY,EAAEC,aAAa,CAAC,EACvEC;AAEJ;AAEA,OAAO,MAAME,6BAA6B,CACxCF;IAEA,OAAO,CAACG;QACNN,sBAAsBM,MAAML,UAAU,EAAEK,MAAMJ,YAAY,EAAEC;QAC5D,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/field/features/createFeaturePropComponent.tsx"],"sourcesContent":["'use client'\n\nimport type React from 'react'\n\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useAddClientFunction } from '@payloadcms/ui/providers/ClientFunction'\n\nconst useLexicalFeatureProp = <T,>(featureKey: string, componentKey: string, prop: T) => {\n const { schemaPath } = useFieldProps()\n\n useAddClientFunction(\n `lexicalFeature.${schemaPath}.${featureKey}.components.${componentKey}`,\n prop,\n )\n}\n\nexport const createFeaturePropComponent = <T = unknown,>(\n prop: T,\n): React.FC<{ componentKey: string; featureKey: string }> => {\n return (props) => {\n useLexicalFeatureProp(props.featureKey, props.componentKey, prop)\n return null\n }\n}\n"],"names":["useFieldProps","useAddClientFunction","useLexicalFeatureProp","featureKey","componentKey","prop","schemaPath","createFeaturePropComponent","props"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,aAAa,QAAQ,0CAAyC;AACvE,SAASC,oBAAoB,QAAQ,0CAAyC;AAE9E,MAAMC,wBAAwB,CAAKC,YAAoBC,cAAsBC;IAC3E,MAAM,EAAEC,UAAU,EAAE,GAAGN;IAEvBC,qBACE,CAAC,eAAe,EAAEK,WAAW,CAAC,EAAEH,WAAW,YAAY,EAAEC,aAAa,CAAC,EACvEC;AAEJ;AAEA,OAAO,MAAME,6BAA6B,CACxCF;IAEA,OAAO,CAACG;QACNN,sBAAsBM,MAAML,UAAU,EAAEK,MAAMJ,YAAY,EAAEC;QAC5D,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TestRecorderPlugin } from './plugin/index.js'\n\nconst TestRecorderFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TestRecorderPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TestRecorderFeatureClientComponent = createClientComponent(TestRecorderFeatureClient)\n"],"names":["createClientComponent","TestRecorderPlugin","TestRecorderFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TestRecorderFeatureClientComponent"],"mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,oBAAmB;AAEtD,MAAMC,4BAAsE,CAACC;IAC3E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,qCAAqCT,sBAAsBE,2BAA0B"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TestRecorderPlugin } from './plugin/index.js'\n\nconst TestRecorderFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TestRecorderPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TestRecorderFeatureClientComponent = createClientComponent(TestRecorderFeatureClient)\n"],"names":["createClientComponent","TestRecorderPlugin","TestRecorderFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TestRecorderFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,oBAAmB;AAEtD,MAAMC,4BAAsE,CAACC;IAC3E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,qCAAqCT,sBAAsBE,2BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TestRecorderFeatureClientComponent } from './feature.client.js'\n\nexport const TestRecorderFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TestRecorderFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'testrecorder',\n serverFeatureProps: props,\n }\n}\n"],"names":["TestRecorderFeatureClientComponent","TestRecorderFeature","props","feature","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,kCAAkC,QAAQ,sBAAqB;AAExE,OAAO,MAAMC,sBAA2E,CAACC;IACvF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TestRecorderFeatureClientComponent } from './feature.client.js'\n\nexport const TestRecorderFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TestRecorderFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'testrecorder',\n serverFeatureProps: props,\n }\n}\n"],"names":["TestRecorderFeatureClientComponent","TestRecorderFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,kCAAkC,QAAQ,sBAAqB;AAExE,OAAO,MAAMC,sBAA2E,CAACC;IACvF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/debug/testrecorder/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalImport from 'lexical'\nconst { $createParagraphNode, $createTextNode, $getRoot } = lexicalImport\nimport * as React from 'react'\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport { IS_APPLE } from '../../../../lexical/utils/environment.js'\nimport './index.scss'\n\nconst copy = (text: null | string) => {\n const textArea = document.createElement('textarea')\n textArea.value = text || ''\n textArea.style.position = 'absolute'\n textArea.style.opacity = '0'\n document.body?.appendChild(textArea)\n textArea.focus()\n textArea.select()\n try {\n const result = document.execCommand('copy')\n // eslint-disable-next-line no-console\n console.log(result)\n } catch (error) {\n console.error(error)\n }\n document.body?.removeChild(textArea)\n}\n\nconst download = (filename: string, text: null | string) => {\n const a = document.createElement('a')\n a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text || ''))\n a.setAttribute('download', filename)\n a.style.display = 'none'\n document.body?.appendChild(a)\n a.click()\n document.body?.removeChild(a)\n}\n\nconst formatStep = (step: Step) => {\n const formatOneStep = (name: string, value: Step['value']) => {\n switch (name) {\n case 'click': {\n return ` await page.mouse.click(${value.x}, ${value.y});`\n }\n case 'press': {\n return ` await page.keyboard.press('${value}');`\n }\n case 'keydown': {\n return ` await page.keyboard.keydown('${value}');`\n }\n case 'keyup': {\n return ` await page.keyboard.keyup('${value}');`\n }\n case 'type': {\n return ` await page.keyboard.type('${value}');`\n }\n case 'selectAll': {\n return ` await selectAll(page);`\n }\n case 'snapshot': {\n return ` await assertHTMLSnapshot(page);\n await assertSelection(page, {\n anchorPath: [${value.anchorPath.toString()}],\n anchorOffset: ${value.anchorOffset},\n focusPath: [${value.focusPath.toString()}],\n focusOffset: ${value.focusOffset},\n });\n`\n }\n default:\n return ``\n }\n }\n const formattedStep = formatOneStep(step.name, step.value)\n switch (step.count) {\n case 1:\n return formattedStep\n case 2:\n return [formattedStep, formattedStep].join(`\\n`)\n default:\n return ` await repeat(${step.count}, async () => {\n ${formattedStep}\n );`\n }\n}\n\nexport function isSelectAll(event: KeyboardEvent): boolean {\n return event.keyCode === 65 && (IS_APPLE ? event.metaKey : event.ctrlKey)\n}\n\n// stolen from LexicalSelection-test\nfunction sanitizeSelection(selection: Selection) {\n const { anchorNode, focusNode } = selection\n let { anchorOffset, focusOffset } = selection\n if (anchorOffset !== 0) {\n anchorOffset--\n }\n if (focusOffset !== 0) {\n focusOffset--\n }\n return { anchorNode, anchorOffset, focusNode, focusOffset }\n}\n\nfunction getPathFromNodeToEditor(node: Node, rootElement: HTMLElement | null) {\n let currentNode: Node | null | undefined = node\n const path = []\n while (currentNode !== rootElement) {\n if (currentNode !== null && currentNode !== undefined) {\n path.unshift(\n Array.from(currentNode?.parentNode?.childNodes ?? []).indexOf(currentNode as ChildNode),\n )\n }\n currentNode = currentNode?.parentNode\n }\n return path\n}\n\nconst keyPresses = new Set([\n 'Enter',\n 'Backspace',\n 'Delete',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n])\n\ntype Step = {\n count: number\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any\n}\n\ntype Steps = Step[]\n\nfunction useTestRecorder(editor: LexicalEditor): [JSX.Element, JSX.Element | null] {\n const [steps, setSteps] = useState<Steps>([])\n const [isRecording, setIsRecording] = useState(false)\n const [, setCurrentInnerHTML] = useState('')\n const [templatedTest, setTemplatedTest] = useState('')\n const previousSelectionRef = useRef<BaseSelection | null>(null)\n const skipNextSelectionChangeRef = useRef(false)\n const preRef = useRef<HTMLPreElement>(null)\n\n const getCurrentEditor = useCallback(() => {\n return editor\n }, [editor])\n\n const generateTestContent = useCallback(() => {\n const rootElement = editor.getRootElement()\n const browserSelection = window.getSelection()\n\n if (\n rootElement == null ||\n browserSelection == null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null ||\n !rootElement.contains(browserSelection.anchorNode) ||\n !rootElement.contains(browserSelection.focusNode)\n ) {\n return null\n }\n\n return `\nimport {\n initializeE2E,\n assertHTMLSnapshot,\n assertSelection,\n repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n initializeE2E((e2e) => {\n it('Should pass this test', async () => {\n const {page} = e2e;\n\n await page.focus('div[contenteditable=\"true\"]');\n${steps.map(formatStep).join(`\\n`)}\n });\n});\n `\n }, [editor, steps])\n\n // just a wrapper around inserting new actions so that we can\n // coalesce some actions like insertText/moveNativeSelection\n const pushStep = useCallback(\n (name: string, value: Step['value']) => {\n setSteps((currentSteps) => {\n // trying to group steps\n const currentIndex = steps.length - 1\n const lastStep = steps[currentIndex]\n if (lastStep) {\n if (lastStep.name === name) {\n if (name === 'type') {\n // for typing events we just append the text\n return [\n ...steps.slice(0, currentIndex),\n { ...lastStep, value: lastStep.value + value },\n ]\n } else {\n // for other events we bump the counter if their values are the same\n if (lastStep.value === value) {\n return [...steps.slice(0, currentIndex), { ...lastStep, count: lastStep.count + 1 }]\n }\n }\n }\n }\n // could not group, just append a new one\n return [...currentSteps, { name, count: 1, value }]\n })\n },\n [steps, setSteps],\n )\n\n useLayoutEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (isSelectAll(event)) {\n pushStep('selectAll', '')\n } else if (keyPresses.has(key)) {\n pushStep('press', event.key)\n } else if ([...key].length > 1) {\n pushStep('keydown', event.key)\n } else {\n pushStep('type', event.key)\n }\n }\n\n const onKeyUp = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (!keyPresses.has(key) && [...key].length > 1) {\n pushStep('keyup', event.key)\n }\n }\n\n return editor.registerRootListener(\n (rootElement: HTMLElement | null, prevRootElement: HTMLElement | null) => {\n if (prevRootElement !== null) {\n prevRootElement.removeEventListener('keydown', onKeyDown)\n prevRootElement.removeEventListener('keyup', onKeyUp)\n }\n if (rootElement !== null) {\n rootElement.addEventListener('keydown', onKeyDown)\n rootElement.addEventListener('keyup', onKeyUp)\n }\n },\n )\n }, [editor, isRecording, pushStep])\n\n useLayoutEffect(() => {\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }, [generateTestContent])\n\n useEffect(() => {\n if (steps) {\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }\n }, [generateTestContent, steps])\n\n useEffect(() => {\n const removeUpdateListener = editor.registerUpdateListener(\n ({ dirtyElements, dirtyLeaves, editorState }) => {\n if (!isRecording) {\n return\n }\n const currentSelection = editorState._selection\n const previousSelection = previousSelectionRef.current\n const skipNextSelectionChange = skipNextSelectionChangeRef.current\n if (previousSelection !== currentSelection) {\n if (dirtyLeaves.size === 0 && dirtyElements.size === 0 && !skipNextSelectionChange) {\n const browserSelection = window.getSelection()\n if (\n browserSelection &&\n (browserSelection.anchorNode == null || browserSelection.focusNode == null)\n ) {\n return\n }\n }\n previousSelectionRef.current = currentSelection\n }\n skipNextSelectionChangeRef.current = false\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n },\n )\n return removeUpdateListener\n }, [editor, generateTestContent, isRecording, pushStep])\n\n // save innerHTML\n useEffect(() => {\n if (!isRecording) {\n return\n }\n const removeUpdateListener = editor.registerUpdateListener(() => {\n const rootElement = editor.getRootElement()\n if (rootElement !== null) {\n setCurrentInnerHTML(rootElement?.innerHTML)\n }\n })\n return removeUpdateListener\n }, [editor, isRecording])\n\n // clear editor and start recording\n const toggleEditorSelection = useCallback(\n (currentEditor: LexicalEditor) => {\n if (!isRecording) {\n currentEditor.update(() => {\n const root = $getRoot()\n root.clear()\n const text = $createTextNode()\n root.append($createParagraphNode().append(text))\n text.select()\n })\n setSteps([])\n }\n setIsRecording((currentIsRecording) => !currentIsRecording)\n },\n [isRecording],\n )\n\n const onSnapshotClick = useCallback(() => {\n if (!isRecording) {\n return\n }\n const browserSelection = window.getSelection()\n if (\n browserSelection === null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null\n ) {\n return\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = sanitizeSelection(browserSelection)\n const rootElement = getCurrentEditor().getRootElement()\n let anchorPath\n if (anchorNode !== null) {\n anchorPath = getPathFromNodeToEditor(anchorNode, rootElement)\n }\n let focusPath\n if (focusNode !== null) {\n focusPath = getPathFromNodeToEditor(focusNode, rootElement)\n }\n pushStep('snapshot', {\n anchorNode,\n anchorOffset,\n anchorPath,\n focusNode,\n focusOffset,\n focusPath,\n })\n }, [pushStep, isRecording, getCurrentEditor])\n\n const onCopyClick = useCallback(() => {\n copy(generateTestContent())\n }, [generateTestContent])\n\n const onDownloadClick = useCallback(() => {\n download('test.js', generateTestContent())\n }, [generateTestContent])\n\n const button = (\n <button\n className={`editor-dev-button ${isRecording ? 'active' : ''}`}\n id=\"test-recorder-button\"\n onClick={(e) => {\n toggleEditorSelection(getCurrentEditor())\n e.preventDefault()\n }}\n title={isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n type=\"button\"\n >\n {isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n </button>\n )\n const output = isRecording ? (\n <div className=\"test-recorder-output\">\n <div className=\"test-recorder-toolbar\">\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-snapshot\"\n onClick={(e) => {\n onSnapshotClick()\n e.preventDefault()\n }}\n title=\"Insert snapshot\"\n type=\"button\"\n >\n Insert Snapshot\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-copy\"\n onClick={(e) => {\n onCopyClick()\n e.preventDefault()\n }}\n title=\"Copy to clipboard\"\n type=\"button\"\n >\n Copy\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-download\"\n onClick={(e) => {\n onDownloadClick()\n e.preventDefault()\n }}\n title=\"Download as a file\"\n type=\"button\"\n >\n Download\n </button>\n </div>\n <pre id=\"test-recorder\" ref={preRef}>\n {templatedTest}\n </pre>\n </div>\n ) : null\n\n return [button, output]\n}\nexport const TestRecorderPlugin: React.FC = () => {\n const [editor] = useLexicalComposerContext()\n const [testRecorderButton, testRecorderOutput] = useTestRecorder(editor)\n\n return (\n <React.Fragment>\n <p>HI</p>\n {testRecorderButton}\n {testRecorderOutput}\n <p>DONE</p>\n </React.Fragment>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalImport","$createParagraphNode","$createTextNode","$getRoot","React","useCallback","useEffect","useLayoutEffect","useRef","useState","IS_APPLE","copy","text","textArea","document","createElement","value","style","position","opacity","body","appendChild","focus","select","result","execCommand","console","log","error","removeChild","download","filename","a","setAttribute","encodeURIComponent","display","click","formatStep","step","formatOneStep","name","x","y","anchorPath","toString","anchorOffset","focusPath","focusOffset","formattedStep","count","join","isSelectAll","event","keyCode","metaKey","ctrlKey","sanitizeSelection","selection","anchorNode","focusNode","getPathFromNodeToEditor","node","rootElement","currentNode","path","undefined","unshift","Array","from","parentNode","childNodes","indexOf","keyPresses","Set","useTestRecorder","editor","steps","setSteps","isRecording","setIsRecording","setCurrentInnerHTML","templatedTest","setTemplatedTest","previousSelectionRef","skipNextSelectionChangeRef","preRef","getCurrentEditor","generateTestContent","getRootElement","browserSelection","window","getSelection","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","key","has","onKeyUp","registerRootListener","prevRootElement","removeEventListener","addEventListener","current","scrollTo","scrollHeight","testContent","removeUpdateListener","registerUpdateListener","dirtyElements","dirtyLeaves","editorState","currentSelection","_selection","previousSelection","skipNextSelectionChange","size","innerHTML","toggleEditorSelection","currentEditor","update","root","clear","append","currentIsRecording","onSnapshotClick","onCopyClick","onDownloadClick","button","className","id","onClick","e","preventDefault","title","type","output","div","pre","ref","TestRecorderPlugin","testRecorderButton","testRecorderOutput","Fragment","p"],"mappings":"AAAA;AAGA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAE,GAAGH;AAC5D,YAAYI,WAAW,QAAO;AAC9B,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAEjF,SAASC,QAAQ,QAAQ,2CAA0C;AACnE,OAAO,eAAc;AAErB,MAAMC,OAAO,CAACC;IACZ,MAAMC,WAAWC,SAASC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oBAAoBC,mBAAmB,GAAGzE,gBAAgBC;IAEjE,qBACE,oBAACvE,MAAMgJ,QAAQ,sBACb,oBAACC,WAAE,OACFH,oBACAC,kCACD,oBAACE,WAAE;AAGT,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/debug/testrecorder/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalImport from 'lexical'\nconst { $createParagraphNode, $createTextNode, $getRoot } = lexicalImport\nimport * as React from 'react'\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport { IS_APPLE } from '../../../../lexical/utils/environment.js'\nimport './index.scss'\n\nconst copy = (text: null | string) => {\n const textArea = document.createElement('textarea')\n textArea.value = text || ''\n textArea.style.position = 'absolute'\n textArea.style.opacity = '0'\n document.body?.appendChild(textArea)\n textArea.focus()\n textArea.select()\n try {\n const result = document.execCommand('copy')\n // eslint-disable-next-line no-console\n console.log(result)\n } catch (error) {\n console.error(error)\n }\n document.body?.removeChild(textArea)\n}\n\nconst download = (filename: string, text: null | string) => {\n const a = document.createElement('a')\n a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text || ''))\n a.setAttribute('download', filename)\n a.style.display = 'none'\n document.body?.appendChild(a)\n a.click()\n document.body?.removeChild(a)\n}\n\nconst formatStep = (step: Step) => {\n const formatOneStep = (name: string, value: Step['value']) => {\n switch (name) {\n case 'click': {\n return ` await page.mouse.click(${value.x}, ${value.y});`\n }\n case 'press': {\n return ` await page.keyboard.press('${value}');`\n }\n case 'keydown': {\n return ` await page.keyboard.keydown('${value}');`\n }\n case 'keyup': {\n return ` await page.keyboard.keyup('${value}');`\n }\n case 'type': {\n return ` await page.keyboard.type('${value}');`\n }\n case 'selectAll': {\n return ` await selectAll(page);`\n }\n case 'snapshot': {\n return ` await assertHTMLSnapshot(page);\n await assertSelection(page, {\n anchorPath: [${value.anchorPath.toString()}],\n anchorOffset: ${value.anchorOffset},\n focusPath: [${value.focusPath.toString()}],\n focusOffset: ${value.focusOffset},\n });\n`\n }\n default:\n return ``\n }\n }\n const formattedStep = formatOneStep(step.name, step.value)\n switch (step.count) {\n case 1:\n return formattedStep\n case 2:\n return [formattedStep, formattedStep].join(`\\n`)\n default:\n return ` await repeat(${step.count}, async () => {\n ${formattedStep}\n );`\n }\n}\n\nexport function isSelectAll(event: KeyboardEvent): boolean {\n return event.keyCode === 65 && (IS_APPLE ? event.metaKey : event.ctrlKey)\n}\n\n// stolen from LexicalSelection-test\nfunction sanitizeSelection(selection: Selection) {\n const { anchorNode, focusNode } = selection\n let { anchorOffset, focusOffset } = selection\n if (anchorOffset !== 0) {\n anchorOffset--\n }\n if (focusOffset !== 0) {\n focusOffset--\n }\n return { anchorNode, anchorOffset, focusNode, focusOffset }\n}\n\nfunction getPathFromNodeToEditor(node: Node, rootElement: HTMLElement | null) {\n let currentNode: Node | null | undefined = node\n const path = []\n while (currentNode !== rootElement) {\n if (currentNode !== null && currentNode !== undefined) {\n path.unshift(\n Array.from(currentNode?.parentNode?.childNodes ?? []).indexOf(currentNode as ChildNode),\n )\n }\n currentNode = currentNode?.parentNode\n }\n return path\n}\n\nconst keyPresses = new Set([\n 'Enter',\n 'Backspace',\n 'Delete',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n])\n\ntype Step = {\n count: number\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any\n}\n\ntype Steps = Step[]\n\nfunction useTestRecorder(editor: LexicalEditor): [JSX.Element, JSX.Element | null] {\n const [steps, setSteps] = useState<Steps>([])\n const [isRecording, setIsRecording] = useState(false)\n const [, setCurrentInnerHTML] = useState('')\n const [templatedTest, setTemplatedTest] = useState('')\n const previousSelectionRef = useRef<BaseSelection | null>(null)\n const skipNextSelectionChangeRef = useRef(false)\n const preRef = useRef<HTMLPreElement>(null)\n\n const getCurrentEditor = useCallback(() => {\n return editor\n }, [editor])\n\n const generateTestContent = useCallback(() => {\n const rootElement = editor.getRootElement()\n const browserSelection = window.getSelection()\n\n if (\n rootElement == null ||\n browserSelection == null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null ||\n !rootElement.contains(browserSelection.anchorNode) ||\n !rootElement.contains(browserSelection.focusNode)\n ) {\n return null\n }\n\n return `\nimport {\n initializeE2E,\n assertHTMLSnapshot,\n assertSelection,\n repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n initializeE2E((e2e) => {\n it('Should pass this test', async () => {\n const {page} = e2e;\n\n await page.focus('div[contenteditable=\"true\"]');\n${steps.map(formatStep).join(`\\n`)}\n });\n});\n `\n }, [editor, steps])\n\n // just a wrapper around inserting new actions so that we can\n // coalesce some actions like insertText/moveNativeSelection\n const pushStep = useCallback(\n (name: string, value: Step['value']) => {\n setSteps((currentSteps) => {\n // trying to group steps\n const currentIndex = steps.length - 1\n const lastStep = steps[currentIndex]\n if (lastStep) {\n if (lastStep.name === name) {\n if (name === 'type') {\n // for typing events we just append the text\n return [\n ...steps.slice(0, currentIndex),\n { ...lastStep, value: lastStep.value + value },\n ]\n } else {\n // for other events we bump the counter if their values are the same\n if (lastStep.value === value) {\n return [...steps.slice(0, currentIndex), { ...lastStep, count: lastStep.count + 1 }]\n }\n }\n }\n }\n // could not group, just append a new one\n return [...currentSteps, { name, count: 1, value }]\n })\n },\n [steps, setSteps],\n )\n\n useLayoutEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (isSelectAll(event)) {\n pushStep('selectAll', '')\n } else if (keyPresses.has(key)) {\n pushStep('press', event.key)\n } else if ([...key].length > 1) {\n pushStep('keydown', event.key)\n } else {\n pushStep('type', event.key)\n }\n }\n\n const onKeyUp = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (!keyPresses.has(key) && [...key].length > 1) {\n pushStep('keyup', event.key)\n }\n }\n\n return editor.registerRootListener(\n (rootElement: HTMLElement | null, prevRootElement: HTMLElement | null) => {\n if (prevRootElement !== null) {\n prevRootElement.removeEventListener('keydown', onKeyDown)\n prevRootElement.removeEventListener('keyup', onKeyUp)\n }\n if (rootElement !== null) {\n rootElement.addEventListener('keydown', onKeyDown)\n rootElement.addEventListener('keyup', onKeyUp)\n }\n },\n )\n }, [editor, isRecording, pushStep])\n\n useLayoutEffect(() => {\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }, [generateTestContent])\n\n useEffect(() => {\n if (steps) {\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }\n }, [generateTestContent, steps])\n\n useEffect(() => {\n const removeUpdateListener = editor.registerUpdateListener(\n ({ dirtyElements, dirtyLeaves, editorState }) => {\n if (!isRecording) {\n return\n }\n const currentSelection = editorState._selection\n const previousSelection = previousSelectionRef.current\n const skipNextSelectionChange = skipNextSelectionChangeRef.current\n if (previousSelection !== currentSelection) {\n if (dirtyLeaves.size === 0 && dirtyElements.size === 0 && !skipNextSelectionChange) {\n const browserSelection = window.getSelection()\n if (\n browserSelection &&\n (browserSelection.anchorNode == null || browserSelection.focusNode == null)\n ) {\n return\n }\n }\n previousSelectionRef.current = currentSelection\n }\n skipNextSelectionChangeRef.current = false\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n },\n )\n return removeUpdateListener\n }, [editor, generateTestContent, isRecording, pushStep])\n\n // save innerHTML\n useEffect(() => {\n if (!isRecording) {\n return\n }\n const removeUpdateListener = editor.registerUpdateListener(() => {\n const rootElement = editor.getRootElement()\n if (rootElement !== null) {\n setCurrentInnerHTML(rootElement?.innerHTML)\n }\n })\n return removeUpdateListener\n }, [editor, isRecording])\n\n // clear editor and start recording\n const toggleEditorSelection = useCallback(\n (currentEditor: LexicalEditor) => {\n if (!isRecording) {\n currentEditor.update(() => {\n const root = $getRoot()\n root.clear()\n const text = $createTextNode()\n root.append($createParagraphNode().append(text))\n text.select()\n })\n setSteps([])\n }\n setIsRecording((currentIsRecording) => !currentIsRecording)\n },\n [isRecording],\n )\n\n const onSnapshotClick = useCallback(() => {\n if (!isRecording) {\n return\n }\n const browserSelection = window.getSelection()\n if (\n browserSelection === null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null\n ) {\n return\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = sanitizeSelection(browserSelection)\n const rootElement = getCurrentEditor().getRootElement()\n let anchorPath\n if (anchorNode !== null) {\n anchorPath = getPathFromNodeToEditor(anchorNode, rootElement)\n }\n let focusPath\n if (focusNode !== null) {\n focusPath = getPathFromNodeToEditor(focusNode, rootElement)\n }\n pushStep('snapshot', {\n anchorNode,\n anchorOffset,\n anchorPath,\n focusNode,\n focusOffset,\n focusPath,\n })\n }, [pushStep, isRecording, getCurrentEditor])\n\n const onCopyClick = useCallback(() => {\n copy(generateTestContent())\n }, [generateTestContent])\n\n const onDownloadClick = useCallback(() => {\n download('test.js', generateTestContent())\n }, [generateTestContent])\n\n const button = (\n <button\n className={`editor-dev-button ${isRecording ? 'active' : ''}`}\n id=\"test-recorder-button\"\n onClick={(e) => {\n toggleEditorSelection(getCurrentEditor())\n e.preventDefault()\n }}\n title={isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n type=\"button\"\n >\n {isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n </button>\n )\n const output = isRecording ? (\n <div className=\"test-recorder-output\">\n <div className=\"test-recorder-toolbar\">\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-snapshot\"\n onClick={(e) => {\n onSnapshotClick()\n e.preventDefault()\n }}\n title=\"Insert snapshot\"\n type=\"button\"\n >\n Insert Snapshot\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-copy\"\n onClick={(e) => {\n onCopyClick()\n e.preventDefault()\n }}\n title=\"Copy to clipboard\"\n type=\"button\"\n >\n Copy\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-download\"\n onClick={(e) => {\n onDownloadClick()\n e.preventDefault()\n }}\n title=\"Download as a file\"\n type=\"button\"\n >\n Download\n </button>\n </div>\n <pre id=\"test-recorder\" ref={preRef}>\n {templatedTest}\n </pre>\n </div>\n ) : null\n\n return [button, output]\n}\nexport const TestRecorderPlugin: React.FC = () => {\n const [editor] = useLexicalComposerContext()\n const [testRecorderButton, testRecorderOutput] = useTestRecorder(editor)\n\n return (\n <React.Fragment>\n <p>HI</p>\n {testRecorderButton}\n {testRecorderOutput}\n <p>DONE</p>\n </React.Fragment>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalImport","$createParagraphNode","$createTextNode","$getRoot","React","useCallback","useEffect","useLayoutEffect","useRef","useState","IS_APPLE","copy","text","textArea","document","createElement","value","style","position","opacity","body","appendChild","focus","select","result","execCommand","console","log","error","removeChild","download","filename","a","setAttribute","encodeURIComponent","display","click","formatStep","step","formatOneStep","name","x","y","anchorPath","toString","anchorOffset","focusPath","focusOffset","formattedStep","count","join","isSelectAll","event","keyCode","metaKey","ctrlKey","sanitizeSelection","selection","anchorNode","focusNode","getPathFromNodeToEditor","node","rootElement","currentNode","path","undefined","unshift","Array","from","parentNode","childNodes","indexOf","keyPresses","Set","useTestRecorder","editor","steps","setSteps","isRecording","setIsRecording","setCurrentInnerHTML","templatedTest","setTemplatedTest","previousSelectionRef","skipNextSelectionChangeRef","preRef","getCurrentEditor","generateTestContent","getRootElement","browserSelection","window","getSelection","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","key","has","onKeyUp","registerRootListener","prevRootElement","removeEventListener","addEventListener","current","scrollTo","scrollHeight","testContent","removeUpdateListener","registerUpdateListener","dirtyElements","dirtyLeaves","editorState","currentSelection","_selection","previousSelection","skipNextSelectionChange","size","innerHTML","toggleEditorSelection","currentEditor","update","root","clear","append","currentIsRecording","onSnapshotClick","onCopyClick","onDownloadClick","button","className","id","onClick","e","preventDefault","title","type","output","div","pre","ref","TestRecorderPlugin","testRecorderButton","testRecorderOutput","Fragment","p"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAE,GAAGH;AAC5D,YAAYI,WAAW,QAAO;AAC9B,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAEjF,SAASC,QAAQ,QAAQ,2CAA0C;AACnE,OAAO,eAAc;AAErB,MAAMC,OAAO,CAACC;IACZ,MAAMC,WAAWC,SAASC,aAAa,CAAC;IACxCF,SAASG,KAAK,GAAGJ,QAAQ;IACzBC,SAASI,KAAK,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QAAQ,sBACb,oBAACC,WAAE,OACFH,oBACAC,kCACD,oBAACE,WAAE;AAGT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/treeview/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TreeViewPlugin } from './plugin/index.js'\n\nconst TreeViewFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TreeViewPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TreeViewFeatureClientComponent = createClientComponent(TreeViewFeatureClient)\n"],"names":["createClientComponent","TreeViewPlugin","TreeViewFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TreeViewFeatureClientComponent"],"mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,cAAc,QAAQ,oBAAmB;AAElD,MAAMC,wBAAkE,CAACC;IACvE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,iCAAiCT,sBAAsBE,uBAAsB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/treeview/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TreeViewPlugin } from './plugin/index.js'\n\nconst TreeViewFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TreeViewPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TreeViewFeatureClientComponent = createClientComponent(TreeViewFeatureClient)\n"],"names":["createClientComponent","TreeViewPlugin","TreeViewFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TreeViewFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,cAAc,QAAQ,oBAAmB;AAElD,MAAMC,wBAAkE,CAACC;IACvE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,iCAAiCT,sBAAsBE,uBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/treeview/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TreeViewFeatureClientComponent } from './feature.client.js'\n\nexport const TreeViewFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TreeViewFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'treeview',\n serverFeatureProps: props,\n }\n}\n"],"names":["TreeViewFeatureClientComponent","TreeViewFeature","props","feature","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,8BAA8B,QAAQ,sBAAqB;AAEpE,OAAO,MAAMC,kBAAuE,CAACC;IACnF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/treeview/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TreeViewFeatureClientComponent } from './feature.client.js'\n\nexport const TreeViewFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TreeViewFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'treeview',\n serverFeatureProps: props,\n }\n}\n"],"names":["TreeViewFeatureClientComponent","TreeViewFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,8BAA8B,QAAQ,sBAAqB;AAEpE,OAAO,MAAMC,kBAAuE,CAACC;IACnF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/debug/treeview/plugin/index.tsx"],"sourcesContent":["'use client'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalTreeViewImport from '@lexical/react/LexicalTreeView.js'\nconst { TreeView } = lexicalTreeViewImport\nimport * as React from 'react'\n\nimport './index.scss'\n\nexport function TreeViewPlugin(): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n return (\n <TreeView\n editor={editor}\n timeTravelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelButtonClassName=\"debug-timetravel-panel-button\"\n timeTravelPanelClassName=\"debug-timetravel-panel\"\n timeTravelPanelSliderClassName=\"debug-timetravel-panel-slider\"\n treeTypeButtonClassName=\"debug-treetype-button\"\n viewClassName=\"tree-view-output\"\n />\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalTreeViewImport","TreeView","React","TreeViewPlugin","editor","timeTravelButtonClassName","timeTravelPanelButtonClassName","timeTravelPanelClassName","timeTravelPanelSliderClassName","treeTypeButtonClassName","viewClassName"],"mappings":"AAAA;AACA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,2BAA2B,oCAAmC;AACrE,MAAM,EAAEC,QAAQ,EAAE,GAAGD;AACrB,YAAYE,WAAW,QAAO;AAE9B,OAAO,eAAc;AAErB,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGL;IACjB,qBACE,oBAACE;QACCG,QAAQA;QACRC,2BAA0B;QAC1BC,gCAA+B;QAC/BC,0BAAyB;QACzBC,gCAA+B;QAC/BC,yBAAwB;QACxBC,eAAc;;AAGpB"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/debug/treeview/plugin/index.tsx"],"sourcesContent":["'use client'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalTreeViewImport from '@lexical/react/LexicalTreeView.js'\nconst { TreeView } = lexicalTreeViewImport\nimport * as React from 'react'\n\nimport './index.scss'\n\nexport function TreeViewPlugin(): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n return (\n <TreeView\n editor={editor}\n timeTravelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelButtonClassName=\"debug-timetravel-panel-button\"\n timeTravelPanelClassName=\"debug-timetravel-panel\"\n timeTravelPanelSliderClassName=\"debug-timetravel-panel-slider\"\n treeTypeButtonClassName=\"debug-treetype-button\"\n viewClassName=\"tree-view-output\"\n />\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalTreeViewImport","TreeView","React","TreeViewPlugin","editor","timeTravelButtonClassName","timeTravelPanelButtonClassName","timeTravelPanelClassName","timeTravelPanelSliderClassName","treeTypeButtonClassName","viewClassName"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,2BAA2B,oCAAmC;AACrE,MAAM,EAAEC,QAAQ,EAAE,GAAGD;AACrB,YAAYE,WAAW,QAAO;AAE9B,OAAO,eAAc;AAErB,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGL;IACjB,qBACE,oBAACE;QACCG,QAAQA;QACRC,2BAA0B;QAC1BC,gCAA+B;QAC/BC,0BAAyB;QACzBC,gCAA+B;QAC/BC,yBAAwB;QACxBC,eAAc;;AAGpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"sourcesContent":["'use client'\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { BoldIcon } from '../../../lexical/ui/icons/Bold/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nconst BoldFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: BoldIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('bold')\n }\n return false\n },\n key: 'bold',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')\n },\n order: 1,\n },\n ]),\n ],\n },\n markdownTransformers,\n }\n },\n }\n}\n\nexport const BoldFeatureClientComponent = createClientComponent(BoldFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","BoldIcon","createClientComponent","SectionWithEntries","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","BoldFeatureClient","props","clientFeatureProps","feature","featureProviderMap","markdownTransformers","get","push","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","BoldFeatureClientComponent"],"mappings":"AAAA;AACA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,MAAMC,oBAA8D,CAACC;IACnE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACP;gBAAWC;aAAgB;YACzD,IAAIK,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACV,wBAAwBD;YACpD;YAEA,OAAO;gBACLM,oBAAoBD;gBACpBO,uBAAuB;oBACrBC,UAAU;wBACRd,mBAAmB;4BACjB;gCACEe,gBAAgBjB;gCAChBkB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIrB,kBAAkBqB,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,qBAAqB;gCAC9C;gCACA0B,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAb;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMc,6BAA6BzB,sBAAsBM,mBAAkB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.client.tsx"],"sourcesContent":["'use client'\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { BoldIcon } from '../../../lexical/ui/icons/Bold/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nconst BoldFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: BoldIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('bold')\n }\n return false\n },\n key: 'bold',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')\n },\n order: 1,\n },\n ]),\n ],\n },\n markdownTransformers,\n }\n },\n }\n}\n\nexport const BoldFeatureClientComponent = createClientComponent(BoldFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","BoldIcon","createClientComponent","SectionWithEntries","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","BoldFeatureClient","props","clientFeatureProps","feature","featureProviderMap","markdownTransformers","get","push","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","BoldFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,MAAMC,oBAA8D,CAACC;IACnE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACP;gBAAWC;aAAgB;YACzD,IAAIK,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACV,wBAAwBD;YACpD;YAEA,OAAO;gBACLM,oBAAoBD;gBACpBO,uBAAuB;oBACrBC,UAAU;wBACRd,mBAAmB;4BACjB;gCACEe,gBAAgBjB;gCAChBkB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIrB,kBAAkBqB,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,qBAAqB;gCAC9C;gCACA0B,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAb;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMc,6BAA6BzB,sBAAsBM,mBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { BoldFeatureClientComponent } from './feature.client.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nexport const BoldFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n dependenciesSoft: ['italic'],\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n ClientComponent: BoldFeatureClientComponent,\n markdownTransformers,\n serverFeatureProps: props,\n }\n },\n key: 'bold',\n serverFeatureProps: props,\n }\n}\n"],"names":["BoldFeatureClientComponent","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","BoldFeature","props","dependenciesSoft","feature","featureProviderMap","markdownTransformers","get","push","ClientComponent","serverFeatureProps","key"],"mappings":"AAEA,SAASA,0BAA0B,QAAQ,sBAAqB;AAChE,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,OAAO,MAAMC,cAAmE,CAACC;IAC/E,OAAO;QACLC,kBAAkB;YAAC;SAAS;QAC5BC,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACP;gBAAWC;aAAgB;YACzD,IAAIK,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACV,wBAAwBD;YACpD;YAEA,OAAO;gBACLY,iBAAiBb;gBACjBU;gBACAI,oBAAoBR;YACtB;QACF;QACAS,KAAK;QACLD,oBAAoBR;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/bold/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { BoldFeatureClientComponent } from './feature.client.js'\nimport {\n BOLD_ITALIC_STAR,\n BOLD_ITALIC_UNDERSCORE,\n BOLD_STAR,\n BOLD_UNDERSCORE,\n} from './markdownTransformers.js'\n\nexport const BoldFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n dependenciesSoft: ['italic'],\n feature: ({ featureProviderMap }) => {\n const markdownTransformers = [BOLD_STAR, BOLD_UNDERSCORE]\n if (featureProviderMap.get('italic')) {\n markdownTransformers.push(BOLD_ITALIC_UNDERSCORE, BOLD_ITALIC_STAR)\n }\n\n return {\n ClientComponent: BoldFeatureClientComponent,\n markdownTransformers,\n serverFeatureProps: props,\n }\n },\n key: 'bold',\n serverFeatureProps: props,\n }\n}\n"],"names":["BoldFeatureClientComponent","BOLD_ITALIC_STAR","BOLD_ITALIC_UNDERSCORE","BOLD_STAR","BOLD_UNDERSCORE","BoldFeature","props","dependenciesSoft","feature","featureProviderMap","markdownTransformers","get","push","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,0BAA0B,QAAQ,sBAAqB;AAChE,SACEC,gBAAgB,EAChBC,sBAAsB,EACtBC,SAAS,EACTC,eAAe,QACV,4BAA2B;AAElC,OAAO,MAAMC,cAAmE,CAACC;IAC/E,OAAO;QACLC,kBAAkB;YAAC;SAAS;QAC5BC,SAAS,CAAC,EAAEC,kBAAkB,EAAE;YAC9B,MAAMC,uBAAuB;gBAACP;gBAAWC;aAAgB;YACzD,IAAIK,mBAAmBE,GAAG,CAAC,WAAW;gBACpCD,qBAAqBE,IAAI,CAACV,wBAAwBD;YACpD;YAEA,OAAO;gBACLY,iBAAiBb;gBACjBU;gBACAI,oBAAoBR;YACtB;QACF;QACAS,KAAK;QACLD,oBAAoBR;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/bold/markdownTransformers.ts"],"sourcesContent":["import type { TextFormatTransformer } from '@lexical/markdown'\n\nexport const BOLD_ITALIC_STAR: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold', 'italic'],\n tag: '***',\n}\n\nexport const BOLD_ITALIC_UNDERSCORE: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold', 'italic'],\n intraword: false,\n tag: '___',\n}\n\nexport const BOLD_STAR: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold'],\n tag: '**',\n}\n\nexport const BOLD_UNDERSCORE: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold'],\n intraword: false,\n tag: '__',\n}\n"],"names":["BOLD_ITALIC_STAR","type","format","tag","BOLD_ITALIC_UNDERSCORE","intraword","BOLD_STAR","BOLD_UNDERSCORE"],"mappings":"AAEA,OAAO,MAAMA,mBAA0C;IACrDC,MAAM;IACNC,QAAQ;QAAC;QAAQ;KAAS;IAC1BC,KAAK;AACP,EAAC;AAED,OAAO,MAAMC,yBAAgD;IAC3DH,MAAM;IACNC,QAAQ;QAAC;QAAQ;KAAS;IAC1BG,WAAW;IACXF,KAAK;AACP,EAAC;AAED,OAAO,MAAMG,YAAmC;IAC9CL,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBC,KAAK;AACP,EAAC;AAED,OAAO,MAAMI,kBAAyC;IACpDN,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBG,WAAW;IACXF,KAAK;AACP,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/bold/markdownTransformers.ts"],"sourcesContent":["import type { TextFormatTransformer } from '@lexical/markdown'\n\nexport const BOLD_ITALIC_STAR: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold', 'italic'],\n tag: '***',\n}\n\nexport const BOLD_ITALIC_UNDERSCORE: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold', 'italic'],\n intraword: false,\n tag: '___',\n}\n\nexport const BOLD_STAR: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold'],\n tag: '**',\n}\n\nexport const BOLD_UNDERSCORE: TextFormatTransformer = {\n type: 'text-format',\n format: ['bold'],\n intraword: false,\n tag: '__',\n}\n"],"names":["BOLD_ITALIC_STAR","type","format","tag","BOLD_ITALIC_UNDERSCORE","intraword","BOLD_STAR","BOLD_UNDERSCORE"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,mBAA0C;IACrDC,MAAM;IACNC,QAAQ;QAAC;QAAQ;KAAS;IAC1BC,KAAK;AACP,EAAC;AAED,OAAO,MAAMC,yBAAgD;IAC3DH,MAAM;IACNC,QAAQ;QAAC;QAAQ;KAAS;IAC1BG,WAAW;IACXF,KAAK;AACP,EAAC;AAED,OAAO,MAAMG,YAAmC;IAC9CL,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBC,KAAK;AACP,EAAC;AAED,OAAO,MAAMI,kBAAyC;IACpDN,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBG,WAAW;IACXF,KAAK;AACP,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/common/floatingSelectToolbarSection.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const SectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'format',\n order: 4,\n }\n}\n"],"names":["SectionWithEntries","entries","type","key","order"],"mappings":"AAKA,OAAO,MAAMA,qBAAqB,CAChCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/common/floatingSelectToolbarSection.ts"],"sourcesContent":["import type {\n FloatingToolbarSection,\n FloatingToolbarSectionEntry,\n} from '../../../lexical/plugins/FloatingSelectToolbar/types.js'\n\nexport const SectionWithEntries = (\n entries: FloatingToolbarSectionEntry[],\n): FloatingToolbarSection => {\n return {\n type: 'buttons',\n entries,\n key: 'format',\n order: 4,\n }\n}\n"],"names":["SectionWithEntries","entries","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAKA,OAAO,MAAMA,qBAAqB,CAChCC;IAEA,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { CodeIcon } from '../../../lexical/ui/icons/Code/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nconst InlineCodeFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: CodeIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('code')\n }\n return false\n },\n key: 'code',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')\n },\n order: 7,\n },\n ]),\n ],\n },\n\n markdownTransformers: [INLINE_CODE],\n }\n },\n }\n}\n\nexport const InlineCodeFeatureClientComponent = createClientComponent(InlineCodeFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","CodeIcon","createClientComponent","SectionWithEntries","INLINE_CODE","InlineCodeFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","markdownTransformers","InlineCodeFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRP,mBAAmB;4BACjB;gCACEQ,gBAAgBV;gCAChBW,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAId,kBAAkBc,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAAClB,qBAAqB;gCAC9C;gCACAmB,OAAO;4BACT;yBACD;qBACF;gBACH;gBAEAC,sBAAsB;oBAAChB;iBAAY;YACrC;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,mCAAmCnB,sBAAsBG,yBAAwB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { CodeIcon } from '../../../lexical/ui/icons/Code/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nconst InlineCodeFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: CodeIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('code')\n }\n return false\n },\n key: 'code',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code')\n },\n order: 7,\n },\n ]),\n ],\n },\n\n markdownTransformers: [INLINE_CODE],\n }\n },\n }\n}\n\nexport const InlineCodeFeatureClientComponent = createClientComponent(InlineCodeFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","CodeIcon","createClientComponent","SectionWithEntries","INLINE_CODE","InlineCodeFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","markdownTransformers","InlineCodeFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,QAAQ,QAAQ,0CAAyC;AAClE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRP,mBAAmB;4BACjB;gCACEQ,gBAAgBV;gCAChBW,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAId,kBAAkBc,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAAClB,qBAAqB;gCAC9C;gCACAmB,OAAO;4BACT;yBACD;qBACF;gBACH;gBAEAC,sBAAsB;oBAAChB;iBAAY;YACrC;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,mCAAmCnB,sBAAsBG,yBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { InlineCodeFeatureClientComponent } from './feature.client.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nexport const InlineCodeFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: InlineCodeFeatureClientComponent,\n markdownTransformers: [INLINE_CODE],\n serverFeatureProps: props,\n }\n },\n key: 'inlinecode',\n serverFeatureProps: props,\n }\n}\n"],"names":["InlineCodeFeatureClientComponent","INLINE_CODE","InlineCodeFeature","props","feature","ClientComponent","markdownTransformers","serverFeatureProps","key"],"mappings":"AAEA,SAASA,gCAAgC,QAAQ,sBAAqB;AACtE,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,OAAO,MAAMC,oBAAyE,CAACC;IACrF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBL;gBACjBM,sBAAsB;oBAACL;iBAAY;gBACnCM,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { InlineCodeFeatureClientComponent } from './feature.client.js'\nimport { INLINE_CODE } from './markdownTransformers.js'\n\nexport const InlineCodeFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: InlineCodeFeatureClientComponent,\n markdownTransformers: [INLINE_CODE],\n serverFeatureProps: props,\n }\n },\n key: 'inlinecode',\n serverFeatureProps: props,\n }\n}\n"],"names":["InlineCodeFeatureClientComponent","INLINE_CODE","InlineCodeFeature","props","feature","ClientComponent","markdownTransformers","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,gCAAgC,QAAQ,sBAAqB;AACtE,SAASC,WAAW,QAAQ,4BAA2B;AAEvD,OAAO,MAAMC,oBAAyE,CAACC;IACrF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBL;gBACjBM,sBAAsB;oBAACL;iBAAY;gBACnCM,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/markdownTransformers.ts"],"sourcesContent":["import type { TextFormatTransformer } from '@lexical/markdown'\n\nexport const INLINE_CODE: TextFormatTransformer = {\n type: 'text-format',\n format: ['code'],\n tag: '`',\n}\n"],"names":["INLINE_CODE","type","format","tag"],"mappings":"AAEA,OAAO,MAAMA,cAAqC;IAChDC,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBC,KAAK;AACP,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/inlinecode/markdownTransformers.ts"],"sourcesContent":["import type { TextFormatTransformer } from '@lexical/markdown'\n\nexport const INLINE_CODE: TextFormatTransformer = {\n type: 'text-format',\n format: ['code'],\n tag: '`',\n}\n"],"names":["INLINE_CODE","type","format","tag"],"rangeMappings":";;;;;;","mappings":"AAEA,OAAO,MAAMA,cAAqC;IAChDC,MAAM;IACNC,QAAQ;QAAC;KAAO;IAChBC,KAAK;AACP,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { ItalicIcon } from '../../../lexical/ui/icons/Italic/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nconst ItalicFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: ItalicIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('italic')\n }\n return false\n },\n key: 'italic',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')\n },\n order: 2,\n },\n ]),\n ],\n },\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n }\n },\n }\n}\n\nexport const ItalicFeatureClientComponent = createClientComponent(ItalicFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","ItalicIcon","createClientComponent","SectionWithEntries","ITALIC_STAR","ITALIC_UNDERSCORE","ItalicFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","markdownTransformers","ItalicFeatureClientComponent"],"mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,UAAU,QAAQ,4CAA2C;AACtE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,uBAAuB;oBACrBC,UAAU;wBACRR,mBAAmB;4BACjB;gCACES,gBAAgBX;gCAChBY,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIf,kBAAkBe,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,qBAAqB;gCAC9C;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAACjB;oBAAaC;iBAAkB;YACxD;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,+BAA+BpB,sBAAsBI,qBAAoB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { $isRangeSelection, FORMAT_TEXT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { ItalicIcon } from '../../../lexical/ui/icons/Italic/index.js'\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { SectionWithEntries } from '../common/floatingSelectToolbarSection.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nconst ItalicFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n\n floatingSelectToolbar: {\n sections: [\n SectionWithEntries([\n {\n ChildComponent: ItalicIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n return selection.hasFormat('italic')\n }\n return false\n },\n key: 'italic',\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')\n },\n order: 2,\n },\n ]),\n ],\n },\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n }\n },\n }\n}\n\nexport const ItalicFeatureClientComponent = createClientComponent(ItalicFeatureClient)\n"],"names":["lexicalImport","$isRangeSelection","FORMAT_TEXT_COMMAND","ItalicIcon","createClientComponent","SectionWithEntries","ITALIC_STAR","ITALIC_UNDERSCORE","ItalicFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","hasFormat","key","onClick","editor","dispatchCommand","order","markdownTransformers","ItalicFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,iBAAiB,EAAEC,mBAAmB,EAAE,GAAGF;AAInD,SAASG,UAAU,QAAQ,4CAA2C;AACtE,SAASC,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,4CAA2C;AAC9E,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,OAAO;gBACLD,oBAAoBD;gBAEpBG,uBAAuB;oBACrBC,UAAU;wBACRR,mBAAmB;4BACjB;gCACES,gBAAgBX;gCAChBY,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAIf,kBAAkBe,YAAY;wCAChC,OAAOA,UAAUC,SAAS,CAAC;oCAC7B;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,qBAAqB;gCAC9C;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAACjB;oBAAaC;iBAAkB;YACxD;QACF;IACF;AACF;AAEA,OAAO,MAAMiB,+BAA+BpB,sBAAsBI,qBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { ItalicFeatureClientComponent } from './feature.client.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nexport const ItalicFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: ItalicFeatureClientComponent,\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n serverFeatureProps: props,\n }\n },\n key: 'italic',\n serverFeatureProps: props,\n }\n}\n"],"names":["ItalicFeatureClientComponent","ITALIC_STAR","ITALIC_UNDERSCORE","ItalicFeature","props","feature","ClientComponent","markdownTransformers","serverFeatureProps","key"],"mappings":"AAEA,SAASA,4BAA4B,QAAQ,sBAAqB;AAClE,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,OAAO,MAAMC,gBAAqE,CAACC;IACjF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN;oBAAaC;iBAAkB;gBACtDM,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/format/italic/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { ItalicFeatureClientComponent } from './feature.client.js'\nimport { ITALIC_STAR, ITALIC_UNDERSCORE } from './markdownTransformers.js'\n\nexport const ItalicFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: ItalicFeatureClientComponent,\n markdownTransformers: [ITALIC_STAR, ITALIC_UNDERSCORE],\n serverFeatureProps: props,\n }\n },\n key: 'italic',\n serverFeatureProps: props,\n }\n}\n"],"names":["ItalicFeatureClientComponent","ITALIC_STAR","ITALIC_UNDERSCORE","ItalicFeature","props","feature","ClientComponent","markdownTransformers","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,4BAA4B,QAAQ,sBAAqB;AAClE,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,4BAA2B;AAE1E,OAAO,MAAMC,gBAAqE,CAACC;IACjF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN;oBAAaC;iBAAkB;gBACtDM,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}