@payloadcms/richtext-lexical 4.0.0-internal.cea8867 → 4.0.0-internal.d21c039

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 (371) hide show
  1. package/dist/exports/client/Field-QKAL7KMC.js +2 -0
  2. package/dist/exports/client/Field-QKAL7KMC.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-43E5QYAA.js +2 -0
  5. package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
  6. package/dist/exports/client/chunk-LN6VX25I.js +2 -0
  7. package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
  8. package/dist/exports/client/component-D5QLYS7W.js +2 -0
  9. package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
  10. package/dist/exports/client/index.d.ts +1 -1
  11. package/dist/exports/client/index.d.ts.map +1 -1
  12. package/dist/exports/client/index.js +26 -26
  13. package/dist/exports/client/index.js.map +4 -4
  14. package/dist/features/blocks/server/index.js +2 -2
  15. package/dist/features/blocks/server/index.js.map +1 -1
  16. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  17. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  18. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  19. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  20. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  21. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  22. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  23. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  24. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  25. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  26. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  27. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  28. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  29. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  30. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  31. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  32. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  33. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  34. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  35. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  36. package/dist/features/heading/constants.d.ts +2 -0
  37. package/dist/features/heading/constants.d.ts.map +1 -0
  38. package/dist/features/heading/constants.js +2 -0
  39. package/dist/features/heading/constants.js.map +1 -0
  40. package/dist/features/heading/server/index.d.ts.map +1 -1
  41. package/dist/features/heading/server/index.js +5 -1
  42. package/dist/features/heading/server/index.js.map +1 -1
  43. package/dist/features/heading/server/validate.d.ts +6 -0
  44. package/dist/features/heading/server/validate.d.ts.map +1 -0
  45. package/dist/features/heading/server/validate.js +15 -0
  46. package/dist/features/heading/server/validate.js.map +1 -0
  47. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  48. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  49. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
  50. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  51. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  52. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  53. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  54. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  55. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  56. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  57. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  58. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  59. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  60. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  61. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  62. package/dist/features/link/server/index.js +2 -2
  63. package/dist/features/link/server/index.js.map +1 -1
  64. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  65. package/dist/features/lists/checklist/server/index.js +5 -2
  66. package/dist/features/lists/checklist/server/index.js.map +1 -1
  67. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  68. package/dist/features/lists/orderedList/server/index.js +5 -2
  69. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  70. package/dist/features/lists/shared/constants.d.ts +2 -0
  71. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  72. package/dist/features/lists/shared/constants.js +2 -0
  73. package/dist/features/lists/shared/constants.js.map +1 -0
  74. package/dist/features/lists/shared/validate.d.ts +5 -0
  75. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  76. package/dist/features/lists/shared/validate.js +15 -0
  77. package/dist/features/lists/shared/validate.js.map +1 -0
  78. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  79. package/dist/features/lists/unorderedList/server/index.js +5 -2
  80. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  81. package/dist/features/relationship/client/index.d.ts +2 -2
  82. package/dist/features/relationship/client/index.d.ts.map +1 -1
  83. package/dist/features/relationship/client/index.js.map +1 -1
  84. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  85. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  86. package/dist/features/relationship/client/plugins/index.js +27 -31
  87. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  88. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  89. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  90. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  91. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  92. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  93. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  94. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  95. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  96. package/dist/features/relationship/server/index.d.ts +8 -1
  97. package/dist/features/relationship/server/index.d.ts.map +1 -1
  98. package/dist/features/relationship/server/index.js +28 -11
  99. package/dist/features/relationship/server/index.js.map +1 -1
  100. package/dist/features/relationship/server/schema.d.ts +2 -2
  101. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  102. package/dist/features/relationship/server/schema.js +5 -10
  103. package/dist/features/relationship/server/schema.js.map +1 -1
  104. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  105. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  106. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  107. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  108. package/dist/features/table/client/index.d.ts.map +1 -0
  109. package/dist/features/table/client/index.js.map +1 -0
  110. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  111. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  112. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  113. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  114. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  115. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +16 -43
  116. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  117. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  118. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  119. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  120. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  121. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  122. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  123. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  124. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  125. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  126. package/dist/features/table/client/utils/debounce.js.map +1 -0
  127. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  128. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  129. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  130. package/dist/features/table/markdownTransformer.js.map +1 -0
  131. package/dist/features/table/server/index.d.ts +3 -0
  132. package/dist/features/table/server/index.d.ts.map +1 -0
  133. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  134. package/dist/features/table/server/index.js.map +1 -0
  135. package/dist/features/table/server/schema.d.ts.map +1 -0
  136. package/dist/features/table/server/schema.js.map +1 -0
  137. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  138. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  139. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  140. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  141. package/dist/features/toolbars/fixed/client/Toolbar/index.css +79 -7
  142. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  143. package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
  144. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  145. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  146. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +12 -13
  147. package/dist/features/typesServer.d.ts +1 -1
  148. package/dist/features/typesServer.d.ts.map +1 -1
  149. package/dist/features/typesServer.js.map +1 -1
  150. package/dist/features/upload/client/component/index.js +2 -1
  151. package/dist/features/upload/client/component/index.js.map +1 -1
  152. package/dist/features/upload/client/index.d.ts +3 -2
  153. package/dist/features/upload/client/index.d.ts.map +1 -1
  154. package/dist/features/upload/client/index.js.map +1 -1
  155. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  156. package/dist/features/upload/client/plugin/index.js +47 -52
  157. package/dist/features/upload/client/plugin/index.js.map +1 -1
  158. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  159. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  160. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  161. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  162. package/dist/features/upload/server/index.d.ts +6 -2
  163. package/dist/features/upload/server/index.d.ts.map +1 -1
  164. package/dist/features/upload/server/index.js +20 -16
  165. package/dist/features/upload/server/index.js.map +1 -1
  166. package/dist/features/upload/server/schema.d.ts +2 -2
  167. package/dist/features/upload/server/schema.d.ts.map +1 -1
  168. package/dist/features/upload/server/schema.js +4 -8
  169. package/dist/features/upload/server/schema.js.map +1 -1
  170. package/dist/features/upload/server/validate.d.ts +2 -2
  171. package/dist/features/upload/server/validate.d.ts.map +1 -1
  172. package/dist/features/upload/server/validate.js +3 -0
  173. package/dist/features/upload/server/validate.js.map +1 -1
  174. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  175. package/dist/field/Diff/converters/listitem/index.js +2 -1
  176. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  177. package/dist/field/Diff/index.css +19 -22
  178. package/dist/field/Diff/index.d.ts.map +1 -1
  179. package/dist/field/Diff/index.js +1 -0
  180. package/dist/field/Diff/index.js.map +1 -1
  181. package/dist/field/RenderLexical/index.d.ts +3 -1
  182. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  183. package/dist/field/RenderLexical/index.js +23 -23
  184. package/dist/field/RenderLexical/index.js.map +1 -1
  185. package/dist/field/bundled.css +1 -1
  186. package/dist/field/index.css +14 -10
  187. package/dist/i18n.d.ts.map +1 -1
  188. package/dist/i18n.js +68 -0
  189. package/dist/i18n.js.map +1 -1
  190. package/dist/index.d.ts +2 -2
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +5 -5
  193. package/dist/index.js.map +1 -1
  194. package/dist/lexical/LexicalEditor.css +19 -21
  195. package/dist/lexical/LexicalEditor.js.map +1 -1
  196. package/dist/lexical/config/server/loader.d.ts +1 -1
  197. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  198. package/dist/lexical/config/server/loader.js +2 -2
  199. package/dist/lexical/config/server/loader.js.map +1 -1
  200. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  201. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  202. package/dist/lexical/config/server/sanitize.js +2 -2
  203. package/dist/lexical/config/server/sanitize.js.map +1 -1
  204. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
  205. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  206. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  207. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  208. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  209. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  210. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -20
  211. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  212. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  213. package/dist/lexical/theme/EditorTheme.css +25 -37
  214. package/dist/lexical/ui/ContentEditable.css +17 -15
  215. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  216. package/dist/lexical/ui/icons/H3/index.js +13 -6
  217. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  218. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  219. package/dist/lexical/ui/icons/H4/index.js +13 -6
  220. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  221. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  222. package/dist/lexical/ui/icons/H5/index.js +13 -6
  223. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  224. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  225. package/dist/lexical/ui/icons/H6/index.js +13 -6
  226. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  227. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  228. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  229. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  230. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  231. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  232. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  233. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  234. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  235. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  236. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  237. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  238. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  239. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  240. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  241. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  242. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  243. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  244. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  245. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  246. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  247. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  248. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  249. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  250. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  251. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  252. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  253. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  254. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  255. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  256. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  257. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  258. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  259. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  260. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  261. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  262. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  263. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  264. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  265. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  266. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  267. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  268. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  269. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  270. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  271. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  272. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  273. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  274. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  275. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  276. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  277. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  278. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  279. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  280. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  281. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  282. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  283. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  284. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  285. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  286. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  287. package/dist/types/index.d.ts +1 -1
  288. package/dist/types/index.d.ts.map +1 -1
  289. package/dist/types/index.js.map +1 -1
  290. package/dist/types/nodeTypes.d.ts +1 -1
  291. package/dist/types/nodeTypes.d.ts.map +1 -1
  292. package/dist/types/nodeTypes.js.map +1 -1
  293. package/dist/utilities/createServerFeature.d.ts +1 -1
  294. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  295. package/dist/utilities/createServerFeature.js +2 -2
  296. package/dist/utilities/createServerFeature.js.map +1 -1
  297. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  298. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  299. package/dist/utilities/editorConfigFactory.js +9 -9
  300. package/dist/utilities/editorConfigFactory.js.map +1 -1
  301. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  302. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  303. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  304. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  305. package/package.json +96 -23
  306. package/dist/dependencyChecker.spec.js +0 -16
  307. package/dist/dependencyChecker.spec.js.map +0 -1
  308. package/dist/exports/client/Field-QGSHF22S.js +0 -2
  309. package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
  310. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  311. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  312. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  313. package/dist/exports/client/chunk-X3D4LZS7.js.map +0 -7
  314. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  315. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  316. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  317. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  318. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  319. package/dist/features/experimental_table/client/index.js.map +0 -1
  320. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  321. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  322. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  323. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  324. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  325. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  326. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  327. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  328. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  329. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  330. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  331. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  332. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  333. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  334. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  335. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  336. package/dist/features/experimental_table/server/index.d.ts +0 -3
  337. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  338. package/dist/features/experimental_table/server/index.js.map +0 -1
  339. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  340. package/dist/features/experimental_table/server/schema.js.map +0 -1
  341. package/dist/features/link/markdownTransformer.spec.js +0 -195
  342. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  343. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  344. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  345. package/dist/lexical/utils/url.spec.js +0 -114
  346. package/dist/lexical/utils/url.spec.js.map +0 -1
  347. package/dist/utilities/jsx/jsx.spec.js +0 -178
  348. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  349. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  350. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  351. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
  352. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  353. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  354. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  355. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +0 -0
  356. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  357. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  358. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
  359. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  360. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  361. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  362. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  363. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  364. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  365. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  366. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  367. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  368. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  369. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  370. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  371. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1,88 +0,0 @@
1
- import { createHeadlessEditor } from '@lexical/headless';
2
- import { LinkNode } from '@lexical/link';
3
- import { ListItemNode, ListNode } from '@lexical/list';
4
- import { $convertToMarkdownString } from '@lexical/markdown';
5
- import { HeadingNode, QuoteNode } from '@lexical/rich-text';
6
- import { $getRoot, $isElementNode, $isLineBreakNode } from 'lexical';
7
- import { describe, expect, it } from 'vitest';
8
- import { $convertFromMarkdownString } from './convertFromMarkdownString.js';
9
- function createEditor() {
10
- return createHeadlessEditor({
11
- nodes: [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode]
12
- });
13
- }
14
- // Payload's editor imports markdown with shouldMergeAdjacentLines = true, so the
15
- // specs exercise that path: hard line breaks must survive even when adjacent lines
16
- // are merged, while soft wraps collapse to a single space.
17
- function importMarkdown(markdown) {
18
- const editor = createEditor();
19
- editor.update(() => $convertFromMarkdownString(markdown, undefined, undefined, false, true), {
20
- discrete: true
21
- });
22
- let result = {
23
- hasLineBreak: false,
24
- textContent: ''
25
- };
26
- editor.getEditorState().read(() => {
27
- const firstChild = $getRoot().getFirstChild();
28
- if (!$isElementNode(firstChild)) {
29
- throw new Error('Expected an element block');
30
- }
31
- result = {
32
- hasLineBreak: firstChild.getChildren().some(child => $isLineBreakNode(child)),
33
- textContent: firstChild.getTextContent()
34
- };
35
- });
36
- return result;
37
- }
38
- function roundTrip(markdown) {
39
- const editor = createEditor();
40
- editor.update(() => $convertFromMarkdownString(markdown, undefined, undefined, false, true), {
41
- discrete: true
42
- });
43
- let output = '';
44
- editor.getEditorState().read(() => {
45
- output = $convertToMarkdownString();
46
- });
47
- return output;
48
- }
49
- describe('markdown hard line break import', () => {
50
- it('should import a trailing-space hard break as a line break node with the marker stripped', () => {
51
- const {
52
- hasLineBreak,
53
- textContent
54
- } = importMarkdown(['foo ', 'bar'].join('\n'));
55
- expect(hasLineBreak).toBe(true);
56
- expect(textContent).toBe('foo\nbar');
57
- });
58
- it('should import a backslash hard break as a line break node with the marker stripped', () => {
59
- const {
60
- hasLineBreak,
61
- textContent
62
- } = importMarkdown('foo\\\nbar');
63
- expect(hasLineBreak).toBe(true);
64
- expect(textContent).toBe('foo\nbar');
65
- });
66
- });
67
- describe('markdown hard line break round trip', () => {
68
- it('should round trip a trailing-space hard break', () => {
69
- const md = ['foo ', 'bar'].join('\n');
70
- expect(roundTrip(md)).toBe(md);
71
- });
72
- it('should round trip a backslash hard break', () => {
73
- const md = 'foo\\\nbar';
74
- expect(roundTrip(md)).toBe(md);
75
- });
76
- it('should not introduce a hard break for a soft wrap', () => {
77
- expect(roundTrip(['foo', 'bar'].join('\n'))).toBe('foo bar');
78
- });
79
- it('should round trip a hard break after formatted text', () => {
80
- const md = '**foo** \nbar';
81
- expect(roundTrip(md)).toBe(md);
82
- });
83
- it('should round trip a hard break after a link', () => {
84
- const md = '[foo](https://payloadcms.com) \nbar';
85
- expect(roundTrip(md)).toBe(md);
86
- });
87
- });
88
- //# sourceMappingURL=convertFromMarkdownString.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertFromMarkdownString.spec.js","names":["createHeadlessEditor","LinkNode","ListItemNode","ListNode","$convertToMarkdownString","HeadingNode","QuoteNode","$getRoot","$isElementNode","$isLineBreakNode","describe","expect","it","$convertFromMarkdownString","createEditor","nodes","importMarkdown","markdown","editor","update","undefined","discrete","result","hasLineBreak","textContent","getEditorState","read","firstChild","getFirstChild","Error","getChildren","some","child","getTextContent","roundTrip","output","join","toBe","md"],"sources":["../../../../src/lexical/utils/markdown/convertFromMarkdownString.spec.ts"],"sourcesContent":["import { createHeadlessEditor } from '@lexical/headless'\nimport { LinkNode } from '@lexical/link'\nimport { ListItemNode, ListNode } from '@lexical/list'\nimport { $convertToMarkdownString } from '@lexical/markdown'\nimport { HeadingNode, QuoteNode } from '@lexical/rich-text'\nimport { $getRoot, $isElementNode, $isLineBreakNode } from 'lexical'\nimport { describe, expect, it } from 'vitest'\n\nimport { $convertFromMarkdownString } from './convertFromMarkdownString.js'\n\nfunction createEditor() {\n return createHeadlessEditor({\n nodes: [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode],\n })\n}\n\n// Payload's editor imports markdown with shouldMergeAdjacentLines = true, so the\n// specs exercise that path: hard line breaks must survive even when adjacent lines\n// are merged, while soft wraps collapse to a single space.\nfunction importMarkdown(markdown: string): { hasLineBreak: boolean; textContent: string } {\n const editor = createEditor()\n editor.update(() => $convertFromMarkdownString(markdown, undefined, undefined, false, true), {\n discrete: true,\n })\n let result = { hasLineBreak: false, textContent: '' }\n editor.getEditorState().read(() => {\n const firstChild = $getRoot().getFirstChild()\n if (!$isElementNode(firstChild)) {\n throw new Error('Expected an element block')\n }\n result = {\n hasLineBreak: firstChild.getChildren().some((child) => $isLineBreakNode(child)),\n textContent: firstChild.getTextContent(),\n }\n })\n return result\n}\n\nfunction roundTrip(markdown: string): string {\n const editor = createEditor()\n editor.update(() => $convertFromMarkdownString(markdown, undefined, undefined, false, true), {\n discrete: true,\n })\n let output = ''\n editor.getEditorState().read(() => {\n output = $convertToMarkdownString()\n })\n return output\n}\n\ndescribe('markdown hard line break import', () => {\n it('should import a trailing-space hard break as a line break node with the marker stripped', () => {\n const { hasLineBreak, textContent } = importMarkdown(['foo ', 'bar'].join('\\n'))\n\n expect(hasLineBreak).toBe(true)\n expect(textContent).toBe('foo\\nbar')\n })\n\n it('should import a backslash hard break as a line break node with the marker stripped', () => {\n const { hasLineBreak, textContent } = importMarkdown('foo\\\\\\nbar')\n\n expect(hasLineBreak).toBe(true)\n expect(textContent).toBe('foo\\nbar')\n })\n})\n\ndescribe('markdown hard line break round trip', () => {\n it('should round trip a trailing-space hard break', () => {\n const md = ['foo ', 'bar'].join('\\n')\n expect(roundTrip(md)).toBe(md)\n })\n\n it('should round trip a backslash hard break', () => {\n const md = 'foo\\\\\\nbar'\n expect(roundTrip(md)).toBe(md)\n })\n\n it('should not introduce a hard break for a soft wrap', () => {\n expect(roundTrip(['foo', 'bar'].join('\\n'))).toBe('foo bar')\n })\n\n it('should round trip a hard break after formatted text', () => {\n const md = '**foo** \\nbar'\n expect(roundTrip(md)).toBe(md)\n })\n\n it('should round trip a hard break after a link', () => {\n const md = '[foo](https://payloadcms.com) \\nbar'\n expect(roundTrip(md)).toBe(md)\n })\n})\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,QAAQ,QAAQ;AACzB,SAASC,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,wBAAwB,QAAQ;AACzC,SAASC,WAAW,EAAEC,SAAS,QAAQ;AACvC,SAASC,QAAQ,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ;AAC3D,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ;AAErC,SAASC,0BAA0B,QAAQ;AAE3C,SAASC,aAAA;EACP,OAAOd,oBAAA,CAAqB;IAC1Be,KAAA,EAAO,CAACV,WAAA,EAAaC,SAAA,EAAWH,QAAA,EAAUD,YAAA,EAAcD,QAAA;EAC1D;AACF;AAEA;AACA;AACA;AACA,SAASe,eAAeC,QAAgB;EACtC,MAAMC,MAAA,GAASJ,YAAA;EACfI,MAAA,CAAOC,MAAM,CAAC,MAAMN,0BAAA,CAA2BI,QAAA,EAAUG,SAAA,EAAWA,SAAA,EAAW,OAAO,OAAO;IAC3FC,QAAA,EAAU;EACZ;EACA,IAAIC,MAAA,GAAS;IAAEC,YAAA,EAAc;IAAOC,WAAA,EAAa;EAAG;EACpDN,MAAA,CAAOO,cAAc,GAAGC,IAAI,CAAC;IAC3B,MAAMC,UAAA,GAAapB,QAAA,GAAWqB,aAAa;IAC3C,IAAI,CAACpB,cAAA,CAAemB,UAAA,GAAa;MAC/B,MAAM,IAAIE,KAAA,CAAM;IAClB;IACAP,MAAA,GAAS;MACPC,YAAA,EAAcI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IAAI,CAACC,EAAA;EAC7B;EAEA1B,EAAA,CAAG,qDAAqD;IACtDD,MAAA,CAAOuB,SAAA,CAAU,CAAC,OAAO,MAAM,CAACE,IAAI,CAAC,QAAQC,IAAI,CAAC;EACpD;EAEAzB,EAAA,CAAG,uDAAuD;IACxD,MAAM0B,EAAA,GAAK;IACX3B,MAAA,CAAOuB,SAAA,CAAUI,EAAA,GAAKD,IAAI,CAACC,EAAA;EAC7B;EAEA1B,EAAA,CAAG,+CAA+C;IAChD,MAAM0B,EAAA,GAAK;IACX3B,MAAA,CAAOuB,SAAA,CAAUI,EAAA,GAAKD,IAAI,CAACC,EAAA;EAC7B;AACF","ignoreList":[]}
@@ -1,114 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { absoluteRegExp, relativeOrAnchorRegExp, validateUrl } from './url.js';
3
- describe('Lexical URL Regex Matchers', () => {
4
- describe('relativeOrAnchorRegExp', () => {
5
- it('validation for links it should match', async () => {
6
- const shouldMatch = ['/path/to/resource', '/file-name.html', '/', '/dir/', '/path.with.dots/', '#anchor', '#section-title', '/path#fragment', '/page?id=123', '/page?id=123#section', '/search?q=test', '/?global=true'];
7
- shouldMatch.forEach(testCase => {
8
- expect(relativeOrAnchorRegExp.test(testCase)).toBe(true);
9
- });
10
- });
11
- it('validation for links it should not match', async () => {
12
- const shouldNotMatch = ['match', 'http://example.com', 'relative/path', 'file.html', 'some#fragment', '#', '/#', '/path/with spaces', '', 'ftp://example.com'];
13
- shouldNotMatch.forEach(testCase => {
14
- expect(relativeOrAnchorRegExp.test(testCase)).not.toBe(true);
15
- });
16
- });
17
- });
18
- describe('absoluteRegExp', () => {
19
- it('validation for links it should match', async () => {
20
- const shouldMatch = ['http://example.com', 'https://example.com', 'ftp://files.example.com', 'http://example.com/resource', 'https://example.com/resource?key=value', 'http://example.com/resource#anchor', 'http://www.example.com', 'https://sub.example.com/path/file', 'mailto:email@example.com', 'tel:+1234567890', 'http://user:pass@example.com', 'www.example.com', 'www.example.com/resource', 'www.example.com/resource?query=1', 'www.example.com#fragment'];
21
- shouldMatch.forEach(testCase => {
22
- expect(absoluteRegExp.test(testCase)).toBe(true);
23
- });
24
- });
25
- it('validation for links it should not match', async () => {
26
- const shouldNotMatch = ['/relative/path', '#anchor', 'example.com', '://missing.scheme', 'http://', 'http:/example.com', 'ftp://example .com', 'http://example', 'not-a-url', 'http//example.com', 'https://example.com/ spaces'];
27
- shouldNotMatch.forEach(testCase => {
28
- expect(absoluteRegExp.test(testCase)).not.toBe(true);
29
- });
30
- });
31
- });
32
- describe('validateUrl', () => {
33
- describe('absolute URLs', () => {
34
- it('should validate http and https URLs', () => {
35
- const validUrls = ['http://example.com', 'https://example.com', 'http://www.example.com', 'https://sub.example.com/path/file', 'http://example.com/resource', 'https://example.com/resource?key=value', 'http://example.com/resource#anchor'];
36
- validUrls.forEach(url => {
37
- expect(validateUrl(url)).toBe(true);
38
- });
39
- });
40
- it('should validate other protocol URLs', () => {
41
- const validUrls = ['ftp://files.example.com', 'mailto:email@example.com', 'tel:+1234567890'];
42
- validUrls.forEach(url => {
43
- expect(validateUrl(url)).toBe(true);
44
- });
45
- });
46
- it('should validate www URLs without protocol', () => {
47
- const validUrls = ['www.example.com', 'www.example.com/resource', 'www.example.com/resource?query=1', 'www.example.com#fragment'];
48
- validUrls.forEach(url => {
49
- expect(validateUrl(url)).toBe(true);
50
- });
51
- });
52
- });
53
- describe('relative URLs', () => {
54
- it('should validate relative paths', () => {
55
- const validUrls = ['/path/to/resource', '/file-name.html', '/', '/dir/', '/path.with.dots/', '/path#fragment'];
56
- validUrls.forEach(url => {
57
- expect(validateUrl(url)).toBe(true);
58
- });
59
- });
60
- });
61
- describe('anchor links', () => {
62
- it('should validate anchor links', () => {
63
- const validUrls = ['#anchor', '#section-title'];
64
- validUrls.forEach(url => {
65
- expect(validateUrl(url)).toBe(true);
66
- });
67
- });
68
- });
69
- describe('with query params', () => {
70
- it('should validate relative URLs with query parameters', () => {
71
- const validUrls = ['/page?id=123', '/search?q=test', '/products?category=electronics&sort=price', '/path?key=value&another=param', '/page?id=123&filter=active', '/?global=true'];
72
- validUrls.forEach(url => {
73
- expect(validateUrl(url)).toBe(true);
74
- });
75
- });
76
- it('should validate absolute URLs with query parameters', () => {
77
- const validUrls = ['https://example.com?id=123', 'http://example.com/page?key=value', 'www.example.com?search=query', 'https://example.com/path?a=1&b=2&c=3'];
78
- validUrls.forEach(url => {
79
- expect(validateUrl(url)).toBe(true);
80
- });
81
- });
82
- it('should validate URLs with query parameters and anchors', () => {
83
- const validUrls = ['/page?id=123#section', 'https://example.com?key=value#anchor', '/search?q=test#results'];
84
- validUrls.forEach(url => {
85
- expect(validateUrl(url)).toBe(true);
86
- });
87
- });
88
- });
89
- describe('edge cases', () => {
90
- it('should handle the default https:// case', () => {
91
- expect(validateUrl('https://')).toBe(true);
92
- });
93
- it('should return false for empty or invalid URLs', () => {
94
- const invalidUrls = ['', 'not-a-url', 'example.com', 'relative/path', 'file.html', 'some#fragment', 'http://', 'http:/example.com', 'http//example.com'];
95
- invalidUrls.forEach(url => {
96
- expect(validateUrl(url)).toBe(false);
97
- });
98
- });
99
- it('should return false for URLs with spaces', () => {
100
- const invalidUrls = ['/path/with spaces', 'http://example.com/ spaces', 'https://example.com/path with spaces'];
101
- invalidUrls.forEach(url => {
102
- expect(validateUrl(url)).toBe(false);
103
- });
104
- });
105
- it('should return false for malformed URLs', () => {
106
- const invalidUrls = ['://missing.scheme', 'ftp://example .com', 'http://example', '#', '/#'];
107
- invalidUrls.forEach(url => {
108
- expect(validateUrl(url)).toBe(false);
109
- });
110
- });
111
- });
112
- });
113
- });
114
- //# sourceMappingURL=url.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.spec.js","names":["describe","it","expect","absoluteRegExp","relativeOrAnchorRegExp","validateUrl","shouldMatch","forEach","testCase","test","toBe","shouldNotMatch","not","validUrls","url","invalidUrls"],"sources":["../../../src/lexical/utils/url.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { absoluteRegExp, relativeOrAnchorRegExp, validateUrl } from './url.js'\n\ndescribe('Lexical URL Regex Matchers', () => {\n describe('relativeOrAnchorRegExp', () => {\n it('validation for links it should match', async () => {\n const shouldMatch = [\n '/path/to/resource',\n '/file-name.html',\n '/',\n '/dir/',\n '/path.with.dots/',\n '#anchor',\n '#section-title',\n '/path#fragment',\n '/page?id=123',\n '/page?id=123#section',\n '/search?q=test',\n '/?global=true',\n ]\n\n shouldMatch.forEach((testCase) => {\n expect(relativeOrAnchorRegExp.test(testCase)).toBe(true)\n })\n })\n\n it('validation for links it should not match', async () => {\n const shouldNotMatch = [\n 'match',\n 'http://example.com',\n 'relative/path',\n 'file.html',\n 'some#fragment',\n '#',\n '/#',\n '/path/with spaces',\n '',\n 'ftp://example.com',\n ]\n\n shouldNotMatch.forEach((testCase) => {\n expect(relativeOrAnchorRegExp.test(testCase)).not.toBe(true)\n })\n })\n })\n\n describe('absoluteRegExp', () => {\n it('validation for links it should match', async () => {\n const shouldMatch = [\n 'http://example.com',\n 'https://example.com',\n 'ftp://files.example.com',\n 'http://example.com/resource',\n 'https://example.com/resource?key=value',\n 'http://example.com/resource#anchor',\n 'http://www.example.com',\n 'https://sub.example.com/path/file',\n 'mailto:email@example.com',\n 'tel:+1234567890',\n 'http://user:pass@example.com',\n 'www.example.com',\n 'www.example.com/resource',\n 'www.example.com/resource?query=1',\n 'www.example.com#fragment',\n ]\n\n shouldMatch.forEach((testCase) => {\n expect(absoluteRegExp.test(testCase)).toBe(true)\n })\n })\n\n it('validation for links it should not match', async () => {\n const shouldNotMatch = [\n '/relative/path',\n '#anchor',\n 'example.com',\n '://missing.scheme',\n 'http://',\n 'http:/example.com',\n 'ftp://example .com',\n 'http://example',\n 'not-a-url',\n 'http//example.com',\n 'https://example.com/ spaces',\n ]\n\n shouldNotMatch.forEach((testCase) => {\n expect(absoluteRegExp.test(testCase)).not.toBe(true)\n })\n })\n })\n\n describe('validateUrl', () => {\n describe('absolute URLs', () => {\n it('should validate http and https URLs', () => {\n const validUrls = [\n 'http://example.com',\n 'https://example.com',\n 'http://www.example.com',\n 'https://sub.example.com/path/file',\n 'http://example.com/resource',\n 'https://example.com/resource?key=value',\n 'http://example.com/resource#anchor',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n\n it('should validate other protocol URLs', () => {\n const validUrls = ['ftp://files.example.com', 'mailto:email@example.com', 'tel:+1234567890']\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n\n it('should validate www URLs without protocol', () => {\n const validUrls = [\n 'www.example.com',\n 'www.example.com/resource',\n 'www.example.com/resource?query=1',\n 'www.example.com#fragment',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n })\n\n describe('relative URLs', () => {\n it('should validate relative paths', () => {\n const validUrls = [\n '/path/to/resource',\n '/file-name.html',\n '/',\n '/dir/',\n '/path.with.dots/',\n '/path#fragment',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n })\n\n describe('anchor links', () => {\n it('should validate anchor links', () => {\n const validUrls = ['#anchor', '#section-title']\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n })\n\n describe('with query params', () => {\n it('should validate relative URLs with query parameters', () => {\n const validUrls = [\n '/page?id=123',\n '/search?q=test',\n '/products?category=electronics&sort=price',\n '/path?key=value&another=param',\n '/page?id=123&filter=active',\n '/?global=true',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n\n it('should validate absolute URLs with query parameters', () => {\n const validUrls = [\n 'https://example.com?id=123',\n 'http://example.com/page?key=value',\n 'www.example.com?search=query',\n 'https://example.com/path?a=1&b=2&c=3',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n\n it('should validate URLs with query parameters and anchors', () => {\n const validUrls = [\n '/page?id=123#section',\n 'https://example.com?key=value#anchor',\n '/search?q=test#results',\n ]\n\n validUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(true)\n })\n })\n })\n\n describe('edge cases', () => {\n it('should handle the default https:// case', () => {\n expect(validateUrl('https://')).toBe(true)\n })\n\n it('should return false for empty or invalid URLs', () => {\n const invalidUrls = [\n '',\n 'not-a-url',\n 'example.com',\n 'relative/path',\n 'file.html',\n 'some#fragment',\n 'http://',\n 'http:/example.com',\n 'http//example.com',\n ]\n\n invalidUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(false)\n })\n })\n\n it('should return false for URLs with spaces', () => {\n const invalidUrls = [\n '/path/with spaces',\n 'http://example.com/ spaces',\n 'https://example.com/path with spaces',\n ]\n\n invalidUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(false)\n })\n })\n\n it('should return false for malformed URLs', () => {\n const invalidUrls = ['://missing.scheme', 'ftp://example .com', 'http://example', '#', '/#']\n\n invalidUrls.forEach((url) => {\n expect(validateUrl(url)).toBe(false)\n })\n })\n })\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AACrC,SAASC,cAAc,EAAEC,sBAAsB,EAAEC,WAAW,QAAQ;AAEpEL,QAAA,CAAS,8BAA8B;EACrCA,QAAA,CAAS,0BAA0B;IACjCC,EAAA,CAAG,wCAAwC;MACzC,MAAMK,WAAA,GAAc,CAClB,qBACA,mBACA,KACA,SACA,oBACA,WACA,kBACA,kBACA,gBACA,wBACA,kBACA,gBACD;MAEDA,WAAA,CAAYC,OAAO,CAAEC,QAAA;QACnBN,MAAA,CAAOE,sBAAA,CAAuBK,IAAI,CAACD,QAAA,GAAWE,IAAI,CAAC;MACrD;IACF;IAEAT,EAAA,CAAG,4CAA4C;MAC7C,MAAMU,cAAA,GAAiB,CACrB,SACA,sBACA,iBACA,aACA,iBACA,KACA,MACA,qBACA,IACA,oBACD;MAEDA,cAAA,CAAeJ,OAAO,CAAEC,QAAA;QACtBN,MAAA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CAAOG,WAAA,CAAY,aAAaK,IAAI,CAAC;MACvC;MAEAT,EAAA,CAAG,iDAAiD;QAClD,MAAMc,WAAA,GAAc,CAClB,IACA,aACA,eACA,iBACA,aACA,iBACA,WACA,qBACA,oBACD;QAEDA,WAAA,CAAYR,OAAO,CAAEO,GAAA;UACnBZ,MAAA,CAAOG,WAAA,CAAYS,GAAA,GAAMJ,IAAI,CAAC;QAChC;MACF;MAEAT,EAAA,CAAG,4CAA4C;QAC7C,MAAMc,WAAA,GAAc,CAClB,qBACA,8BACA,uCACD;QAEDA,WAAA,CAAYR,OAAO,CAAEO,GAAA;UACnBZ,MAAA,CAAOG,WAAA,CAAYS,GAAA,GAAMJ,IAAI,CAAC;QAChC;MACF;MAEAT,EAAA,CAAG,0CAA0C;QAC3C,MAAMc,WAAA,GAAc,CAAC,qBAAqB,sBAAsB,kBAAkB,KAAK,KAAK;QAE5FA,WAAA,CAAYR,OAAO,CAAEO,GAAA;UACnBZ,MAAA,CAAOG,WAAA,CAAYS,GAAA,GAAMJ,IAAI,CAAC;QAChC;MACF;IACF;EACF;AACF","ignoreList":[]}
@@ -1,178 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { extractPropsFromJSXPropsString } from './extractPropsFromJSXPropsString.js';
3
- import { propsToJSXString } from './jsx.js';
4
- describe('jsx', () => {
5
- describe('prop string to object', () => {
6
- const INPUT_AND_OUTPUT = [{
7
- input: 'key="value"',
8
- output: {
9
- key: 'value'
10
- }
11
- }, {
12
- input: "key='value'",
13
- output: {
14
- key: 'value'
15
- },
16
- inputFromOutput: 'key="value"'
17
- }, {
18
- input: 'key={[1, 2, 3]}',
19
- output: {
20
- key: [1, 2, 3]
21
- }
22
- }, {
23
- input: 'key={[1, 2, 3, [1, 2]]}',
24
- output: {
25
- key: [1, 2, 3, [1, 2]]
26
- }
27
- }, {
28
- input: 'object={4}',
29
- output: {
30
- object: 4
31
- }
32
- }, {
33
- input: 'object={{"test": 1}}',
34
- output: {
35
- object: {
36
- test: 1
37
- }
38
- }
39
- }, {
40
- input: 'object={[1, 2, 3, [1, 2]]}',
41
- output: {
42
- object: [1, 2, 3, [1, 2]]
43
- }
44
- }, {
45
- input: 'object={[1, 2]}',
46
- output: {
47
- object: [1, 2]
48
- }
49
- }, {
50
- input: 'key="value" object={{key: "value"}}',
51
- inputFromOutput: 'key="value" object={{"key": "value"}}',
52
- output: {
53
- key: 'value',
54
- object: {
55
- key: 'value'
56
- }
57
- }
58
- }, {
59
- input: 'global packageId="myId" uniqueId="some unique id!" update',
60
- output: {
61
- global: true,
62
- packageId: 'myId',
63
- uniqueId: 'some unique id!',
64
- update: true
65
- }
66
- }, {
67
- input: 'global key="value" object={{key: "value", something: "test", hello: 1}} packageId="myId" uniqueId="some unique id!" update',
68
- inputFromOutput: 'global key="value" object={{"hello": 1, "key": "value", "something": "test"}} packageId="myId" uniqueId="some unique id!" update',
69
- output: {
70
- global: true,
71
- key: 'value',
72
- object: {
73
- hello: 1,
74
- key: 'value',
75
- something: 'test'
76
- },
77
- packageId: 'myId',
78
- uniqueId: 'some unique id!',
79
- update: true
80
- }
81
- }, {
82
- input: 'object={{hello: 1, key: "value", nested: { key: "value" }, something: "test", test: [1, 2, 3]}}',
83
- inputFromOutput: 'object={{"hello": 1, "key": "value", "nested": {"key": "value"}, "something": "test", "test": [1, 2, 3]}}',
84
- output: {
85
- object: {
86
- hello: 1,
87
- key: 'value',
88
- nested: {
89
- key: 'value'
90
- },
91
- something: 'test',
92
- test: [1, 2, 3]
93
- }
94
- }
95
- }, {
96
- input: 'global key="value" object={{hello: 1, key: "value", nested: { key: "value" }, something: "test", test: [1, 2, 3]}} packageId="myId" uniqueId="some unique id!" update',
97
- inputFromOutput: 'global key="value" object={{"hello": 1, "key": "value", "nested": { "key": "value" }, "something": "test", "test": [1, 2, 3]}} packageId="myId" uniqueId="some unique id!" update',
98
- output: {
99
- global: true,
100
- key: 'value',
101
- object: {
102
- hello: 1,
103
- key: 'value',
104
- nested: {
105
- key: 'value'
106
- },
107
- something: 'test',
108
- test: [1, 2, 3]
109
- },
110
- packageId: 'myId',
111
- uniqueId: 'some unique id!',
112
- update: true
113
- }
114
- }, {
115
- // Test if unquoted property keys in objects within arrays are supprted. This is
116
- // supported through the more lenient JSOX parser, instead of using JSON.parse()
117
- input: 'key={[1, 2, { hello: "there" }]}',
118
- inputFromOutput: 'key={[1, 2, { "hello": "there" }]}',
119
- output: {
120
- key: [1, 2, {
121
- hello: 'there'
122
- }]
123
- }
124
- }, {
125
- // Test if ` strings work
126
- input: `key={[1, 2, { hello: \`there\` }]}`,
127
- inputFromOutput: 'key={[1, 2, { "hello": "there" }]}',
128
- output: {
129
- key: [1, 2, {
130
- hello: 'there'
131
- }]
132
- }
133
- }, {
134
- // Test if multiline ` strings work
135
- input: `key={[1, 2, { hello: \`Hello
136
- there\` }]}`,
137
- inputFromOutput: 'key={[1, 2, { "hello": "Hello\\nthere" }]}',
138
- output: {
139
- key: [1, 2, {
140
- hello: 'Hello\nthere'
141
- }]
142
- }
143
- }];
144
- for (const {
145
- input,
146
- output
147
- } of INPUT_AND_OUTPUT) {
148
- it(`can correctly convert to object: "${input.replace(/\n/g, '\\n')}"`, () => {
149
- const propsObject = extractPropsFromJSXPropsString({
150
- propsString: input
151
- });
152
- console.log({
153
- output,
154
- propsObject
155
- });
156
- expect(propsObject).toStrictEqual(output);
157
- });
158
- }
159
- for (const {
160
- input: originalInput,
161
- inputFromOutput,
162
- output
163
- } of INPUT_AND_OUTPUT) {
164
- const input = inputFromOutput || originalInput;
165
- it(`can correctly convert from object: "${input.replace(/\n/g, '\\n')}"`, () => {
166
- const propsString = propsToJSXString({
167
- props: output
168
- });
169
- console.log({
170
- input,
171
- propsString
172
- });
173
- expect(propsString.replaceAll(' ', '')).toBe(input.replaceAll(' ', ''));
174
- });
175
- }
176
- });
177
- });
178
- //# sourceMappingURL=jsx.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx.spec.js","names":["describe","it","expect","extractPropsFromJSXPropsString","propsToJSXString","INPUT_AND_OUTPUT","input","output","key","inputFromOutput","object","test","global","packageId","uniqueId","update","hello","something","nested","replace","propsObject","propsString","console","log","toStrictEqual","originalInput","props","replaceAll","toBe"],"sources":["../../../src/utilities/jsx/jsx.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport { extractPropsFromJSXPropsString } from './extractPropsFromJSXPropsString.js'\nimport { propsToJSXString } from './jsx.js'\n\ndescribe('jsx', () => {\n describe('prop string to object', () => {\n const INPUT_AND_OUTPUT: {\n input: string\n inputFromOutput?: string\n output: Record<string, any>\n }[] = [\n {\n input: 'key=\"value\"',\n output: {\n key: 'value',\n },\n },\n {\n input: \"key='value'\",\n output: {\n key: 'value',\n },\n inputFromOutput: 'key=\"value\"',\n },\n {\n input: 'key={[1, 2, 3]}',\n output: {\n key: [1, 2, 3],\n },\n },\n {\n input: 'key={[1, 2, 3, [1, 2]]}',\n output: {\n key: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={4}',\n output: {\n object: 4,\n },\n },\n {\n input: 'object={{\"test\": 1}}',\n output: {\n object: { test: 1 },\n },\n },\n {\n input: 'object={[1, 2, 3, [1, 2]]}',\n output: {\n object: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={[1, 2]}',\n output: {\n object: [1, 2],\n },\n },\n {\n input: 'key=\"value\" object={{key: \"value\"}}',\n inputFromOutput: 'key=\"value\" object={{\"key\": \"value\"}}',\n output: {\n key: 'value',\n object: { key: 'value' },\n },\n },\n {\n input: 'global packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'global key=\"value\" object={{key: \"value\", something: \"test\", hello: 1}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"something\": \"test\"}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: { hello: 1, key: 'value', something: 'test' },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}}',\n inputFromOutput:\n 'object={{\"hello\": 1, \"key\": \"value\", \"nested\": {\"key\": \"value\"}, \"something\": \"test\", \"test\": [1, 2, 3]}}',\n output: {\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n },\n },\n {\n input:\n 'global key=\"value\" object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"nested\": { \"key\": \"value\" }, \"something\": \"test\", \"test\": [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n // Test if unquoted property keys in objects within arrays are supprted. This is\n // supported through the more lenient JSOX parser, instead of using JSON.parse()\n input: 'key={[1, 2, { hello: \"there\" }]}',\n inputFromOutput: 'key={[1, 2, { \"hello\": \"there\" }]}',\n output: {\n key: [1, 2, { hello: 'there' }],\n },\n },\n {\n // Test if ` strings work\n input: `key={[1, 2, { hello: \\`there\\` }]}`,\n inputFromOutput: 'key={[1, 2, { \"hello\": \"there\" }]}',\n output: {\n key: [1, 2, { hello: 'there' }],\n },\n },\n {\n // Test if multiline ` strings work\n input: `key={[1, 2, { hello: \\`Hello\nthere\\` }]}`,\n inputFromOutput: 'key={[1, 2, { \"hello\": \"Hello\\\\nthere\" }]}',\n output: {\n key: [1, 2, { hello: 'Hello\\nthere' }],\n },\n },\n ]\n\n for (const { input, output } of INPUT_AND_OUTPUT) {\n it(`can correctly convert to object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsObject = extractPropsFromJSXPropsString({ propsString: input })\n console.log({ output, propsObject })\n\n expect(propsObject).toStrictEqual(output)\n })\n }\n\n for (const { input: originalInput, inputFromOutput, output } of INPUT_AND_OUTPUT) {\n const input = inputFromOutput || originalInput\n it(`can correctly convert from object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsString = propsToJSXString({ props: output })\n console.log({ input, propsString })\n\n expect(propsString.replaceAll(' ', '')).toBe(input.replaceAll(' ', ''))\n })\n }\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AACrC,SAASC,8BAA8B,QAAQ;AAC/C,SAASC,gBAAgB,QAAQ;AAEjCJ,QAAA,CAAS,OAAO;EACdA,QAAA,CAAS,yBAAyB;IAChC,MAAMK,gBAAA,GAIA,CACJ;MACEC,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNC,GAAA,EAAK;MACP;IACF,GACA;MACEF,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNC,GAAA,EAAK;MACP;MACAC,eAAA,EAAiB;IACnB,GACA;MACEH,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNC,GAAA,EAAK,CAAC,GAAG,GAAG;MACd;IACF,GACA;MACEF,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNC,GAAA,EAAK,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE;MACvB;IACF,GACA;MACEF,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNG,MAAA,EAAQ;MACV;IACF,GACA;MACEJ,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNG,MAAA,EAAQ;UAAEC,IAAA,EAAM;QAAE;MACpB;IACF,GACA;MACEL,KAAA,EAAO;MACPC,MAAA,EAAQ;QACNG,MAAA,EAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE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