@payloadcms/richtext-lexical 4.0.0-internal.a0ef1b8 → 4.0.0-internal.a2d053c

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 (870) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-334JNLRF.js +2 -0
  3. package/dist/exports/client/Field-334JNLRF.js.map +7 -0
  4. package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js → RelationshipComponent-TVK6I4W4.js} +2 -2
  5. package/dist/exports/client/chunk-BEKGION5.js +2 -0
  6. package/dist/exports/client/chunk-BEKGION5.js.map +7 -0
  7. package/dist/exports/client/{chunk-WSAPGI3Z.js → chunk-EA5BHQ2T.js} +1 -1
  8. package/dist/exports/client/{chunk-WSAPGI3Z.js.map → chunk-EA5BHQ2T.js.map} +1 -1
  9. package/dist/exports/client/chunk-FAJJXXCW.js +2 -0
  10. package/dist/exports/client/chunk-FAJJXXCW.js.map +7 -0
  11. package/dist/exports/client/{chunk-5VIL27GI.js → chunk-IYBYNEKX.js} +1 -1
  12. package/dist/exports/client/{chunk-5VIL27GI.js.map → chunk-IYBYNEKX.js.map} +1 -1
  13. package/dist/exports/client/chunk-SE5IITBK.js +2 -0
  14. package/dist/exports/client/chunk-SE5IITBK.js.map +7 -0
  15. package/dist/exports/client/component-QENB4QTS.js +2 -0
  16. package/dist/exports/client/component-QENB4QTS.js.map +7 -0
  17. package/dist/exports/client/componentInline-AU7IBNY7.js +2 -0
  18. package/dist/exports/client/index.d.ts +1 -3
  19. package/dist/exports/client/index.d.ts.map +1 -1
  20. package/dist/exports/client/index.js +23 -24
  21. package/dist/exports/client/index.js.map +4 -4
  22. package/dist/features/align/client/index.js.map +1 -1
  23. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  24. package/dist/features/blockquote/client/index.js +2 -2
  25. package/dist/features/blockquote/client/index.js.map +1 -1
  26. package/dist/features/blockquote/server/index.js +2 -2
  27. package/dist/features/blockquote/server/index.js.map +1 -1
  28. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  29. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  30. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  31. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  32. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  33. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  34. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  35. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  36. package/dist/features/blocks/client/component/index.css +2 -2
  37. package/dist/features/blocks/client/component/index.d.ts +0 -6
  38. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  39. package/dist/features/blocks/client/component/index.js +199 -108
  40. package/dist/features/blocks/client/component/index.js.map +1 -1
  41. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  42. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  43. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  44. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  45. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  46. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  47. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  48. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  49. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  50. package/dist/features/blocks/client/componentInline/index.css +8 -9
  51. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  52. package/dist/features/blocks/client/componentInline/index.js +34 -31
  53. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  54. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  55. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  56. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  57. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  58. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  59. package/dist/features/blocks/client/index.d.ts.map +1 -1
  60. package/dist/features/blocks/client/index.js +4 -2
  61. package/dist/features/blocks/client/index.js.map +1 -1
  62. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  63. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  64. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  65. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  66. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  67. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  68. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  69. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  70. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  71. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  72. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  73. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  74. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  75. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  76. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  77. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  78. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +121 -78
  79. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  80. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +142 -87
  81. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  82. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +1 -1
  83. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  84. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  85. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  86. package/dist/features/blocks/server/index.d.ts.map +1 -1
  87. package/dist/features/blocks/server/index.js +6 -8
  88. package/dist/features/blocks/server/index.js.map +1 -1
  89. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  90. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  91. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  92. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  93. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  94. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  95. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  96. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  97. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  98. package/dist/features/blocks/server/schema.d.ts +2 -0
  99. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  100. package/dist/features/blocks/server/schema.js +10 -11
  101. package/dist/features/blocks/server/schema.js.map +1 -1
  102. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  103. package/dist/features/blocks/server/validate.js +1 -1
  104. package/dist/features/blocks/server/validate.js.map +1 -1
  105. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  107. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  108. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  109. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  110. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  111. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  112. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  113. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  114. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  115. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  116. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  117. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  118. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  119. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  120. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  121. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  122. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  123. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  124. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  125. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  126. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  127. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  128. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  129. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  130. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  131. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  132. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  133. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  134. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  135. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  136. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  137. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  138. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  139. package/dist/features/converters/markdownToLexical/index.js +5 -2
  140. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  141. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  142. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  143. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  144. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  145. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  146. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  147. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  148. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  149. package/dist/features/format/bold/feature.client.js +1 -1
  150. package/dist/features/format/bold/feature.client.js.map +1 -1
  151. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  152. package/dist/features/format/bold/feature.server.js +1 -1
  153. package/dist/features/format/bold/feature.server.js.map +1 -1
  154. package/dist/features/format/inlineCode/feature.client.js +1 -1
  155. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  156. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  157. package/dist/features/format/inlineCode/feature.server.js +1 -1
  158. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  159. package/dist/features/format/italic/feature.client.js +1 -1
  160. package/dist/features/format/italic/feature.client.js.map +1 -1
  161. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  162. package/dist/features/format/italic/feature.server.js +1 -1
  163. package/dist/features/format/italic/feature.server.js.map +1 -1
  164. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  165. package/dist/features/format/strikethrough/feature.client.js +1 -1
  166. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  167. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  168. package/dist/features/format/strikethrough/feature.server.js +1 -1
  169. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  170. package/dist/features/heading/client/index.js +2 -2
  171. package/dist/features/heading/client/index.js.map +1 -1
  172. package/dist/features/heading/constants.d.ts +2 -0
  173. package/dist/features/heading/constants.d.ts.map +1 -0
  174. package/dist/features/heading/constants.js +2 -0
  175. package/dist/features/heading/constants.js.map +1 -0
  176. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  177. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  178. package/dist/features/heading/markdownTransformer.js +6 -19
  179. package/dist/features/heading/markdownTransformer.js.map +1 -1
  180. package/dist/features/heading/server/index.d.ts.map +1 -1
  181. package/dist/features/heading/server/index.js +7 -3
  182. package/dist/features/heading/server/index.js.map +1 -1
  183. package/dist/features/heading/server/schema.d.ts.map +1 -1
  184. package/dist/features/heading/server/validate.d.ts +6 -0
  185. package/dist/features/heading/server/validate.d.ts.map +1 -0
  186. package/dist/features/heading/server/validate.js +15 -0
  187. package/dist/features/heading/server/validate.js.map +1 -0
  188. package/dist/features/horizontalRule/client/index.js +2 -2
  189. package/dist/features/horizontalRule/client/index.js.map +1 -1
  190. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  191. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  192. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  193. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  194. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  195. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  196. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  197. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  198. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  199. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  200. package/dist/features/horizontalRule/server/index.js +2 -2
  201. package/dist/features/horizontalRule/server/index.js.map +1 -1
  202. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  203. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  204. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  205. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  206. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  207. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  208. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  209. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  210. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  211. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  212. package/dist/features/horizontalRule/server/schema.js +6 -5
  213. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  214. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  215. package/dist/features/indent/client/IndentPlugin.js +122 -1
  216. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  217. package/dist/features/indent/client/index.d.ts.map +1 -1
  218. package/dist/features/indent/client/index.js +0 -2
  219. package/dist/features/indent/client/index.js.map +1 -1
  220. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  221. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  222. package/dist/features/indent/server/i18n.js +74 -37
  223. package/dist/features/indent/server/i18n.js.map +1 -1
  224. package/dist/features/link/client/index.js +2 -2
  225. package/dist/features/link/client/index.js.map +1 -1
  226. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  227. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  228. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  229. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +20 -9
  230. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  231. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -13
  232. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  233. package/dist/features/link/markdownTransformer.d.ts +4 -4
  234. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  235. package/dist/features/link/markdownTransformer.js +4 -4
  236. package/dist/features/link/markdownTransformer.js.map +1 -1
  237. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  238. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  239. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  240. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  241. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  242. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  243. package/dist/features/link/nodes/LinkNode.js +2 -15
  244. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  245. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  246. package/dist/features/link/server/baseFields.js.map +1 -1
  247. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  248. package/dist/features/link/server/index.js +4 -4
  249. package/dist/features/link/server/index.js.map +1 -1
  250. package/dist/features/link/server/schema.d.ts.map +1 -1
  251. package/dist/features/link/server/schema.js +4 -2
  252. package/dist/features/link/server/schema.js.map +1 -1
  253. package/dist/features/link/server/validate.d.ts.map +1 -1
  254. package/dist/features/link/server/validate.js +1 -1
  255. package/dist/features/link/server/validate.js.map +1 -1
  256. package/dist/features/lists/checklist/client/index.js +1 -1
  257. package/dist/features/lists/checklist/client/index.js.map +1 -1
  258. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  259. package/dist/features/lists/checklist/server/index.js +6 -3
  260. package/dist/features/lists/checklist/server/index.js.map +1 -1
  261. package/dist/features/lists/orderedList/client/index.js +1 -1
  262. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  263. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  264. package/dist/features/lists/orderedList/server/index.js +6 -3
  265. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  266. package/dist/features/lists/shared/constants.d.ts +2 -0
  267. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  268. package/dist/features/lists/shared/constants.js +2 -0
  269. package/dist/features/lists/shared/constants.js.map +1 -0
  270. package/dist/features/lists/shared/schema.d.ts.map +1 -1
  271. package/dist/features/lists/shared/schema.js.map +1 -1
  272. package/dist/features/lists/shared/validate.d.ts +5 -0
  273. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  274. package/dist/features/lists/shared/validate.js +15 -0
  275. package/dist/features/lists/shared/validate.js.map +1 -0
  276. package/dist/features/lists/unorderedList/client/index.js +1 -1
  277. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  278. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  279. package/dist/features/lists/unorderedList/server/index.js +6 -3
  280. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  281. package/dist/features/relationship/client/components/index.css +3 -6
  282. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  283. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  284. package/dist/features/relationship/client/index.d.ts +2 -2
  285. package/dist/features/relationship/client/index.d.ts.map +1 -1
  286. package/dist/features/relationship/client/index.js.map +1 -1
  287. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  288. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  289. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  290. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  291. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  292. package/dist/features/relationship/client/plugins/index.js +27 -31
  293. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  294. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  295. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  296. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  297. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  298. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  299. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  300. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  301. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  302. package/dist/features/relationship/server/index.d.ts +8 -1
  303. package/dist/features/relationship/server/index.d.ts.map +1 -1
  304. package/dist/features/relationship/server/index.js +28 -11
  305. package/dist/features/relationship/server/index.js.map +1 -1
  306. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  307. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  308. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  309. package/dist/features/relationship/server/schema.d.ts +6 -5
  310. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  311. package/dist/features/relationship/server/schema.js +31 -17
  312. package/dist/features/relationship/server/schema.js.map +1 -1
  313. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  314. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  315. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  316. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  317. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  318. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  319. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  320. package/dist/features/table/client/index.d.ts.map +1 -0
  321. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  322. package/dist/features/table/client/index.js.map +1 -0
  323. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  324. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  325. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  326. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  327. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +1 -2
  328. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  329. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  330. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  331. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  332. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +47 -24
  333. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  334. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  335. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  336. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  337. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  338. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  339. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  340. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +54 -18
  341. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  342. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  343. package/dist/features/table/client/utils/debounce.js.map +1 -0
  344. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  345. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  346. package/dist/features/table/markdownTransformer.d.ts +5 -0
  347. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  348. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  349. package/dist/features/table/markdownTransformer.js.map +1 -0
  350. package/dist/features/table/server/index.d.ts +3 -0
  351. package/dist/features/table/server/index.d.ts.map +1 -0
  352. package/dist/features/{experimental_table → table}/server/index.js +6 -6
  353. package/dist/features/table/server/index.js.map +1 -0
  354. package/dist/features/table/server/schema.d.ts.map +1 -0
  355. package/dist/features/table/server/schema.js.map +1 -0
  356. package/dist/features/textState/defaultColors.js +1 -1
  357. package/dist/features/textState/defaultColors.js.map +1 -1
  358. package/dist/features/textState/feature.client.js +1 -1
  359. package/dist/features/textState/feature.client.js.map +1 -1
  360. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  361. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  362. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  363. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  364. package/dist/features/toolbars/fixed/client/Toolbar/index.css +80 -8
  365. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  366. package/dist/features/toolbars/fixed/client/Toolbar/index.js +145 -71
  367. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  368. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  369. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  370. package/dist/features/toolbars/inline/client/Toolbar/index.js +84 -37
  371. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  372. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  373. package/dist/features/toolbars/shared/ToolbarButton/index.js +27 -2
  374. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  375. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  376. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +199 -81
  377. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  378. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +23 -25
  379. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  380. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +22 -6
  381. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  382. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  383. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  384. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +109 -0
  385. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  386. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  387. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  388. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  389. package/dist/features/typesClient.d.ts +1 -1
  390. package/dist/features/typesClient.d.ts.map +1 -1
  391. package/dist/features/typesClient.js.map +1 -1
  392. package/dist/features/typesServer.d.ts +19 -14
  393. package/dist/features/typesServer.d.ts.map +1 -1
  394. package/dist/features/typesServer.js.map +1 -1
  395. package/dist/features/upload/client/component/index.css +9 -11
  396. package/dist/features/upload/client/component/index.js +2 -1
  397. package/dist/features/upload/client/component/index.js.map +1 -1
  398. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  399. package/dist/features/upload/client/drawer/index.js.map +1 -1
  400. package/dist/features/upload/client/index.d.ts +3 -2
  401. package/dist/features/upload/client/index.d.ts.map +1 -1
  402. package/dist/features/upload/client/index.js.map +1 -1
  403. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  404. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  405. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  406. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  407. package/dist/features/upload/client/plugin/index.js +53 -56
  408. package/dist/features/upload/client/plugin/index.js.map +1 -1
  409. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  410. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  411. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  412. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  413. package/dist/features/upload/server/index.d.ts +7 -3
  414. package/dist/features/upload/server/index.d.ts.map +1 -1
  415. package/dist/features/upload/server/index.js +22 -18
  416. package/dist/features/upload/server/index.js.map +1 -1
  417. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  418. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  419. package/dist/features/upload/server/markdownTransformer.js +1 -1
  420. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  421. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  422. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  423. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  424. package/dist/features/upload/server/schema.d.ts +6 -18
  425. package/dist/features/upload/server/schema.d.ts.map +1 -1
  426. package/dist/features/upload/server/schema.js +34 -16
  427. package/dist/features/upload/server/schema.js.map +1 -1
  428. package/dist/features/upload/server/validate.d.ts +2 -2
  429. package/dist/features/upload/server/validate.d.ts.map +1 -1
  430. package/dist/features/upload/server/validate.js +4 -1
  431. package/dist/features/upload/server/validate.js.map +1 -1
  432. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  433. package/dist/field/Diff/converters/listitem/index.js +2 -1
  434. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  435. package/dist/field/Diff/converters/relationship/index.css +0 -1
  436. package/dist/field/Diff/converters/unknown/index.css +1 -2
  437. package/dist/field/Diff/converters/upload/index.css +0 -1
  438. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  439. package/dist/field/Diff/index.css +0 -2
  440. package/dist/field/Diff/index.d.ts +3 -2
  441. package/dist/field/Diff/index.d.ts.map +1 -1
  442. package/dist/field/Diff/index.js +3 -2
  443. package/dist/field/Diff/index.js.map +1 -1
  444. package/dist/field/Field.d.ts.map +1 -1
  445. package/dist/field/Field.js +26 -16
  446. package/dist/field/Field.js.map +1 -1
  447. package/dist/field/RenderLexical/index.d.ts +3 -1
  448. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  449. package/dist/field/RenderLexical/index.js +23 -23
  450. package/dist/field/RenderLexical/index.js.map +1 -1
  451. package/dist/field/ViewSelector.css +1 -1
  452. package/dist/field/ViewSelector.d.ts.map +1 -1
  453. package/dist/field/ViewSelector.js +13 -4
  454. package/dist/field/ViewSelector.js.map +1 -1
  455. package/dist/field/bundled.css +1 -1
  456. package/dist/field/index.css +7 -5
  457. package/dist/field/index.js.map +1 -1
  458. package/dist/field/rscEntry.d.ts +2 -2
  459. package/dist/field/rscEntry.d.ts.map +1 -1
  460. package/dist/field/rscEntry.js.map +1 -1
  461. package/dist/i18n.d.ts.map +1 -1
  462. package/dist/i18n.js +112 -0
  463. package/dist/i18n.js.map +1 -1
  464. package/dist/index.d.ts +6 -6
  465. package/dist/index.d.ts.map +1 -1
  466. package/dist/index.js +33 -54
  467. package/dist/index.js.map +1 -1
  468. package/dist/lexical/LexicalEditor.css +30 -19
  469. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  470. package/dist/lexical/LexicalEditor.js +62 -99
  471. package/dist/lexical/LexicalEditor.js.map +1 -1
  472. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  473. package/dist/lexical/LexicalProvider.js +7 -22
  474. package/dist/lexical/LexicalProvider.js.map +1 -1
  475. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  476. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  477. package/dist/lexical/config/server/loader.d.ts +1 -1
  478. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  479. package/dist/lexical/config/server/loader.js +2 -2
  480. package/dist/lexical/config/server/loader.js.map +1 -1
  481. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  482. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  483. package/dist/lexical/config/server/sanitize.js +2 -2
  484. package/dist/lexical/config/server/sanitize.js.map +1 -1
  485. package/dist/lexical/plugins/ClipboardPlugin/index.js.map +1 -1
  486. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  487. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  488. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  489. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  490. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  491. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  492. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  493. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  494. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  495. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  496. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  497. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  498. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  499. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  500. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  501. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  502. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +236 -108
  503. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  504. package/dist/lexical/plugins/SlashMenu/index.css +1 -7
  505. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  506. package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
  507. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +2 -1
  508. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  509. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  510. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  511. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +21 -3
  512. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  513. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +140 -38
  514. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  515. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts +7 -0
  516. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts.map +1 -0
  517. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js +15 -0
  518. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js.map +1 -0
  519. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  520. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  521. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +62 -0
  522. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  523. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  524. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  525. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  526. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  527. package/dist/lexical/theme/EditorTheme.css +18 -21
  528. package/dist/lexical/ui/ContentEditable.css +22 -17
  529. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  530. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  531. package/dist/lexical/ui/ContentEditable.js +32 -11
  532. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  533. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  534. package/dist/lexical/ui/icons/H3/index.js +13 -6
  535. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  536. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  537. package/dist/lexical/ui/icons/H4/index.js +13 -6
  538. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  539. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  540. package/dist/lexical/ui/icons/H5/index.js +13 -6
  541. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  542. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  543. package/dist/lexical/ui/icons/H6/index.js +13 -6
  544. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  545. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  546. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  547. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  548. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  549. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  550. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  551. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  552. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  553. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  554. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  555. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  556. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  557. package/dist/lexical/utils/nodeFormat.js +0 -2
  558. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  559. package/dist/lexical/utils/point.d.ts.map +1 -1
  560. package/dist/lexical/utils/rect.d.ts.map +1 -1
  561. package/dist/lexical/utils/url.d.ts.map +1 -1
  562. package/dist/lexical/utils/url.js +1 -1
  563. package/dist/lexical/utils/url.js.map +1 -1
  564. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  565. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  566. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  567. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  568. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  569. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  570. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  571. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  572. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  573. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  574. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  575. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  576. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  577. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  578. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  579. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  580. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  581. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  582. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  583. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  584. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  585. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  586. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  587. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  588. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  589. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  590. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  591. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  592. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  593. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  594. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  595. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  596. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  597. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  598. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  599. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  600. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  601. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  602. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  603. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  604. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  605. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  606. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  607. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  608. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  609. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  610. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  611. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  612. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  613. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  614. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  615. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  616. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  617. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  618. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  619. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  620. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  621. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  622. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  623. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  624. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  625. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  626. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  627. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  628. package/dist/populateGraphQL/populate.js.map +1 -1
  629. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  630. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  631. package/dist/presets/llmInstructions.d.ts +2 -0
  632. package/dist/presets/llmInstructions.d.ts.map +1 -0
  633. package/dist/presets/llmInstructions.js +13 -0
  634. package/dist/presets/llmInstructions.js.map +1 -0
  635. package/dist/types/builtInNodes.d.ts +1 -1
  636. package/dist/types/builtInNodes.d.ts.map +1 -1
  637. package/dist/types/builtInNodes.js +8 -3
  638. package/dist/types/builtInNodes.js.map +1 -1
  639. package/dist/types/index.d.ts +4 -7
  640. package/dist/types/index.d.ts.map +1 -1
  641. package/dist/types/index.js.map +1 -1
  642. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  643. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  644. package/dist/types/jsonSchemaHelpers.js +7 -2
  645. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  646. package/dist/types/nodeTypes.d.ts +6 -1
  647. package/dist/types/nodeTypes.d.ts.map +1 -1
  648. package/dist/types/nodeTypes.js.map +1 -1
  649. package/dist/types/schema.d.ts.map +1 -1
  650. package/dist/types/schema.js +12 -5
  651. package/dist/types/schema.js.map +1 -1
  652. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  653. package/dist/utilities/applyBaseFilterToFields.js +1 -2
  654. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  655. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  656. package/dist/utilities/buildEditorState.js.map +1 -1
  657. package/dist/utilities/buildInitialState.d.ts +3 -2
  658. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  659. package/dist/utilities/buildInitialState.js +1 -0
  660. package/dist/utilities/buildInitialState.js.map +1 -1
  661. package/dist/utilities/createServerFeature.d.ts +1 -1
  662. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  663. package/dist/utilities/createServerFeature.js +2 -2
  664. package/dist/utilities/createServerFeature.js.map +1 -1
  665. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  666. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  667. package/dist/utilities/editorConfigFactory.js +9 -9
  668. package/dist/utilities/editorConfigFactory.js.map +1 -1
  669. package/dist/utilities/fieldsDrawer/Drawer.js +36 -36
  670. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  671. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  672. package/dist/utilities/fieldsDrawer/DrawerContent.js +6 -9
  673. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  674. package/dist/utilities/fieldsDrawer/index.css +4 -4
  675. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  676. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  677. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -1
  678. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  679. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  680. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  681. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
  682. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  683. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  684. package/dist/utilities/generateImportMap.d.ts +3 -3
  685. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  686. package/dist/utilities/generateImportMap.js +3 -7
  687. package/dist/utilities/generateImportMap.js.map +1 -1
  688. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  689. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  690. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  691. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  692. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  693. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  694. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  695. package/dist/utilities/initLexicalFeatures.js +38 -4
  696. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  697. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  698. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  699. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  700. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  701. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
  702. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  703. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  704. package/dist/utilities/useLexicalFeature.js +15 -6
  705. package/dist/utilities/useLexicalFeature.js.map +1 -1
  706. package/dist/utilities/useRunDeprioritized.js.map +1 -1
  707. package/dist/validate/hasText.d.ts +2 -2
  708. package/dist/validate/hasText.d.ts.map +1 -1
  709. package/dist/validate/hasText.js.map +1 -1
  710. package/dist/validate/index.d.ts +1 -1
  711. package/dist/validate/index.d.ts.map +1 -1
  712. package/package.json +124 -59
  713. package/dist/@types/assets.d.js +0 -2
  714. package/dist/@types/assets.d.js.map +0 -1
  715. package/dist/dependencyChecker.spec.js +0 -16
  716. package/dist/dependencyChecker.spec.js.map +0 -1
  717. package/dist/exports/client/Field-VYBSMSRY.js +0 -2
  718. package/dist/exports/client/Field-VYBSMSRY.js.map +0 -7
  719. package/dist/exports/client/bundled.css +0 -1
  720. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  721. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  722. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  723. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  724. package/dist/exports/client/chunk-ZYXHC5CY.js +0 -2
  725. package/dist/exports/client/chunk-ZYXHC5CY.js.map +0 -7
  726. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  727. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  728. package/dist/exports/client/componentInline-R3EPNYWF.js +0 -2
  729. package/dist/exports/server/rsc.browser.d.ts +0 -11
  730. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  731. package/dist/exports/server/rsc.browser.js +0 -10
  732. package/dist/exports/server/rsc.browser.js.map +0 -1
  733. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  734. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  735. package/dist/features/blockquote/markdownTransformer.js +0 -33
  736. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  737. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  738. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  739. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  740. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  741. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  742. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  743. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  744. package/dist/features/experimental_table/client/index.js.map +0 -1
  745. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  746. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  747. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  748. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  749. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  750. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  751. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  752. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  753. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  754. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  755. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  756. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  757. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  758. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  759. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  760. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  761. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  762. package/dist/features/experimental_table/server/index.d.ts +0 -3
  763. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  764. package/dist/features/experimental_table/server/index.js.map +0 -1
  765. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  766. package/dist/features/experimental_table/server/schema.js.map +0 -1
  767. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  768. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  769. package/dist/features/format/bold/markdownTransformers.js +0 -23
  770. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  771. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  772. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  773. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  774. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  775. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  776. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  777. package/dist/features/format/italic/markdownTransformers.js +0 -12
  778. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  779. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  780. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  781. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  782. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  783. package/dist/features/link/markdownTransformer.spec.js +0 -195
  784. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  785. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  786. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  787. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  788. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  789. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  790. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  791. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  792. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  793. package/dist/features/lists/shared/markdown.d.ts +0 -6
  794. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  795. package/dist/features/lists/shared/markdown.js +0 -57
  796. package/dist/features/lists/shared/markdown.js.map +0 -1
  797. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  798. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  799. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  800. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  801. package/dist/field/clientEntry.d.ts +0 -29
  802. package/dist/field/clientEntry.d.ts.map +0 -1
  803. package/dist/field/clientEntry.js +0 -86
  804. package/dist/field/clientEntry.js.map +0 -1
  805. package/dist/lexical/utils/guard.d.ts +0 -5
  806. package/dist/lexical/utils/guard.d.ts.map +0 -1
  807. package/dist/lexical/utils/guard.js +0 -9
  808. package/dist/lexical/utils/guard.js.map +0 -1
  809. package/dist/lexical/utils/url.spec.js +0 -114
  810. package/dist/lexical/utils/url.spec.js.map +0 -1
  811. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  812. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  813. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  814. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  815. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  816. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  817. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  818. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  819. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  820. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  821. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  822. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  823. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  824. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  825. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  826. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  827. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  828. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  829. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  830. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  831. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  832. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  833. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  834. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  835. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  836. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  837. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  838. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  839. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  840. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  841. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  842. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  843. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  844. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  845. package/dist/packages/@lexical/markdown/index.js +0 -39
  846. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  847. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  848. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  849. package/dist/packages/@lexical/markdown/utils.js +0 -267
  850. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  851. package/dist/utilities/jsx/jsx.spec.js +0 -178
  852. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  853. /package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js.map → RelationshipComponent-TVK6I4W4.js.map} +0 -0
  854. /package/dist/exports/client/{componentInline-R3EPNYWF.js.map → componentInline-AU7IBNY7.js.map} +0 -0
  855. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  856. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  857. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  858. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  859. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  860. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  861. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  862. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  863. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  864. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  865. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  866. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  867. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  868. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  869. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  870. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","TEXT_TYPE_TO_FORMAT","TextNode","useEffect","TextPlugin","t0","$","features","editor","t1","enabledFormats","disabledFormats","getDisabledFormats","length","registerNodeTransform","textNode","forEach","disabledFormat","hasFormat","toggleFormat","t2","allFormats","Object","keys","enabledSet","Set","filter","format","has"],"sources":["../../../../src/lexical/plugins/TextPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { TextFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TEXT_TYPE_TO_FORMAT, TextNode } from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { SanitizedClientFeatures } from '../../../features/typesClient.js'\n\nexport function TextPlugin({ features }: { features: SanitizedClientFeatures }) {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n const disabledFormats = getDisabledFormats(features.enabledFormats)\n if (disabledFormats.length === 0) {\n return\n }\n // Ideally override the TextNode with our own TextNode (changing its setFormat or toggleFormat methods),\n // would be more performant. If we find a noticeable perf regression we can switch to that option.\n // Overriding the FORMAT_TEXT_COMMAND and PASTE_COMMAND commands is not an option I considered because\n // there might be other forms of mutation that we might not be considering. For example:\n // browser extensions or Payload/Lexical plugins that have their own commands.\n return editor.registerNodeTransform(TextNode, (textNode) => {\n disabledFormats.forEach((disabledFormat) => {\n if (textNode.hasFormat(disabledFormat)) {\n textNode.toggleFormat(disabledFormat)\n }\n })\n })\n }, [editor, features])\n\n return null\n}\n\nfunction getDisabledFormats(enabledFormats: TextFormatType[]): TextFormatType[] {\n const allFormats = Object.keys(TEXT_TYPE_TO_FORMAT) as TextFormatType[]\n const enabledSet = new Set(enabledFormats)\n\n return allFormats.filter((format) => !enabledSet.has(format))\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,mBAAmB,EAAEC,QAAQ,QAAQ;AAC9C,SAASC,SAAS,QAAQ;AAI1B,OAAO,SAAAC,WAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAoB;IAAAQ;EAAA,IAAAF,EAAmD;EAC5E,OAAAG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Effect","TextPlugin","t0","$","features","editor","t1","enabledFormats","disabledFormats","getDisabledFormats","length","registerNodeTransform","textNode","forEach","disabledFormat","hasFormat","toggleFormat","t2","allFormats","Object","keys","enabledSet","Set","filter","format","has"],"sources":["../../../../src/lexical/plugins/TextPlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { TextFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TEXT_TYPE_TO_FORMAT, TextNode } from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { SanitizedClientFeatures } from '../../../features/typesClient.js'\n\nexport function TextPlugin({ features }: { features: SanitizedClientFeatures }) {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n const disabledFormats = getDisabledFormats(features.enabledFormats)\n if (disabledFormats.length === 0) {\n return\n }\n // Ideally override the TextNode with our own TextNode (changing its setFormat or toggleFormat methods),\n // would be more performant. If we find a noticeable perf regression we can switch to that option.\n // Overriding the FORMAT_TEXT_COMMAND and PASTE_COMMAND commands is not an option I considered because\n // there might be other forms of mutation that we might not be considering. For example:\n // browser extensions or Payload/Lexical plugins that have their own commands.\n return editor.registerNodeTransform(TextNode, (textNode) => {\n disabledFormats.forEach((disabledFormat) => {\n if (textNode.hasFormat(disabledFormat)) {\n textNode.toggleFormat(disabledFormat)\n }\n })\n })\n }, [editor, features])\n\n return null\n}\n\nfunction getDisabledFormats(enabledFormats: TextFormatType[]): TextFormatType[] {\n const allFormats = Object.keys(TEXT_TYPE_TO_FORMAT) as TextFormatType[]\n const enabledSet = new Set(enabledFormats)\n\n return allFormats.filter((format) => !enabledSet.has(format))\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,mBAAmB,EAAEC,QAAQ,QAAQ;AAC9C,SAASC,SAAS,QAAQ;AAI1B,OAAO,SAAAC,WAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EAAoB;I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
5
5
  padding: 0;
6
6
  cursor: pointer;
7
7
  opacity: 0;
8
+ visibility: hidden;
8
9
  position: absolute;
9
- left: 0;
10
+ inset-inline-start: 0;
10
11
  top: 0;
11
12
  will-change: transform;
12
13
 
@@ -83,8 +83,8 @@ function useAddBlockHandle(editor, anchorElem, isEditable) {
83
83
  };
84
84
  }, [scrollerElem, anchorElem, editor, hoveredElement]);
85
85
  useEffect(() => {
86
- if (menuRef.current && hoveredElement?.node) {
87
- setHandlePosition(hoveredElement?.elem, menuRef.current, anchorElem, blockHandleHorizontalOffset);
86
+ if (menuRef.current) {
87
+ setHandlePosition(hoveredElement?.elem ?? null, menuRef.current, anchorElem, blockHandleHorizontalOffset);
88
88
  }
89
89
  }, [anchorElem, hoveredElement, blockHandleHorizontalOffset]);
90
90
  const handleAddClick = useCallback(event_0 => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","$createParagraphNode","isHTMLElement","React","useCallback","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","ENABLE_SLASH_MENU_COMMAND","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","ADD_BLOCK_MENU_CLASSNAME","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","useAddBlockHandle","editor","anchorElem","isEditable","scrollerElem","parentElement","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","menuRef","hoveredElement","setHoveredElement","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_emptyBlockElem","blockNode","foundAtIndex","cache_threshold","horizontalOffset","point","x","y","returnEmptyParagraphs","startIndex","length","useEdgeAsDefault","node","elem","document","addEventListener","removeEventListener","current","handleAddClick","hoveredElementToUse","update","isEmptyParagraph","getType","getTextContent","newParagraph","insertAfter","setTimeout","getElementByKey","getKey","focus","select","dispatchCommand","stopPropagation","preventDefault","_jsx","Fragment","className","onClick","ref","type","AddBlockHandlePlugin","t0","t1","undefined","body","_editable"],"sources":["../../../../../src/lexical/plugins/handles/AddBlockHandlePlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor, LexicalNode, ParagraphNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { ENABLE_SLASH_MENU_COMMAND } from '../../SlashMenu/LexicalTypeaheadMenuPlugin/index.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport './index.css'\n\nconst ADD_BLOCK_MENU_CLASSNAME = 'add-block-menu'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction useAddBlockHandle(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const { editorConfig } = useEditorConfigContext()\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -24 : 12\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const [hoveredElement, setHoveredElement] = useState<{\n elem: HTMLElement\n node: LexicalNode\n } | null>(null)\n\n useEffect(() => {\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n\n if (distanceFromScrollerElem === -1) {\n setHoveredElement(null)\n return\n }\n\n if (isOnHandleElement(target, ADD_BLOCK_MENU_CLASSNAME)) {\n return\n }\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _emptyBlockElem,\n blockNode,\n foundAtIndex,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n returnEmptyParagraphs: true,\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n })\n\n prevIndex = foundAtIndex\n\n if (!_emptyBlockElem) {\n return\n }\n if (\n blockNode &&\n (hoveredElement?.node !== blockNode || hoveredElement?.elem !== _emptyBlockElem)\n ) {\n setHoveredElement({\n elem: _emptyBlockElem,\n node: blockNode,\n })\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, hoveredElement])\n\n useEffect(() => {\n if (menuRef.current && hoveredElement?.node) {\n setHandlePosition(\n hoveredElement?.elem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, hoveredElement, blockHandleHorizontalOffset])\n\n const handleAddClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n let hoveredElementToUse = hoveredElement\n if (!hoveredElementToUse?.node) {\n return\n }\n\n // 1. Update hoveredElement.node to a new paragraph node if the hoveredElement.node is not a paragraph node\n editor.update(() => {\n // Check if blockNode is an empty text node\n let isEmptyParagraph = true\n if (\n hoveredElementToUse?.node.getType() !== 'paragraph' ||\n hoveredElementToUse.node.getTextContent() !== ''\n ) {\n isEmptyParagraph = false\n }\n\n if (!isEmptyParagraph) {\n const newParagraph = $createParagraphNode()\n hoveredElementToUse?.node.insertAfter(newParagraph)\n\n setTimeout(() => {\n hoveredElementToUse = {\n elem: editor.getElementByKey(newParagraph.getKey())!,\n node: newParagraph,\n }\n setHoveredElement(hoveredElementToUse)\n }, 0)\n }\n })\n\n // 2. Focus on the new paragraph node\n setTimeout(() => {\n editor.update(() => {\n editor.focus()\n\n if (\n hoveredElementToUse?.node &&\n 'select' in hoveredElementToUse.node &&\n typeof hoveredElementToUse.node.select === 'function'\n ) {\n hoveredElementToUse.node.select()\n }\n })\n }, 1)\n\n // Make sure this is called AFTER the focusing has been processed by the browser\n // Otherwise, this won't work\n setTimeout(() => {\n editor.dispatchCommand(ENABLE_SLASH_MENU_COMMAND, {\n node: hoveredElementToUse?.node as ParagraphNode,\n })\n }, 2)\n\n event.stopPropagation()\n event.preventDefault()\n },\n [editor, hoveredElement],\n )\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Add block\"\n className=\"icon add-block-menu\"\n onClick={(event) => {\n handleAddClick(event)\n }}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function AddBlockHandlePlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useAddBlockHandle(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,EAAEC,aAAa,QAAQ;AACpD,YAAYC,KAAA,MAAW;AACvB,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,iCAAiC,Q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,OAAA;MACLkD,IAAA,EAAK;gBAEL,aAAAL,IAAA,CAAC;QAAIE,SAAA,EAAWtD,UAAA,GAAa,SAAS;;;MAG1CD,UAAA;AAEJ;AAEA,OAAO,SAAA2D,qBAAAC,EAAA;EAA8B;IAAA5D,UAAA,EAAA6D;EAAA,IAAAD,EAIpC;EAHC,MAAA5D,UAAA,GAAA6D,EAA0B,KAAAC,SAAA,GAAA7B,QAAA,CAAA8B,IAAA,GAA1BF,EAA0B;EAI1B,OAAA9D,MAAA,IAAiBzB,yBAAA;EAAA,OACVwB,iBAAA,CAAkBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAAiE,SAAgB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useLexicalComposerContext","$createParagraphNode","isHTMLElement","React","useCallback","useEffect","useRef","useState","createPortal","useEditorConfigContext","Point","ENABLE_SLASH_MENU_COMMAND","calculateDistanceFromScrollerElem","getNodeCloseToPoint","getTopLevelNodeKeys","isOnHandleElement","setHandlePosition","ADD_BLOCK_MENU_CLASSNAME","prevIndex","Infinity","getCurrentIndex","keysLength","Math","floor","useAddBlockHandle","editor","anchorElem","isEditable","scrollerElem","parentElement","editorConfig","blockHandleHorizontalOffset","admin","hideGutter","menuRef","hoveredElement","setHoveredElement","onDocumentMouseMove","event","target","distanceFromScrollerElem","pageX","pageY","topLevelNodeKeys","blockElem","_emptyBlockElem","blockNode","foundAtIndex","cache_threshold","horizontalOffset","point","x","y","returnEmptyParagraphs","startIndex","length","useEdgeAsDefault","node","elem","document","addEventListener","removeEventListener","current","handleAddClick","hoveredElementToUse","update","isEmptyParagraph","getType","getTextContent","newParagraph","insertAfter","setTimeout","getElementByKey","getKey","focus","select","dispatchCommand","stopPropagation","preventDefault","_jsx","Fragment","className","onClick","ref","type","AddBlockHandlePlugin","t0","t1","undefined","body","_editable"],"sources":["../../../../../src/lexical/plugins/handles/AddBlockHandlePlugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor, LexicalNode, ParagraphNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, isHTMLElement } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { Point } from '../../../utils/point.js'\nimport { ENABLE_SLASH_MENU_COMMAND } from '../../SlashMenu/LexicalTypeaheadMenuPlugin/index.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport './index.css'\n\nconst ADD_BLOCK_MENU_CLASSNAME = 'add-block-menu'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction useAddBlockHandle(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const { editorConfig } = useEditorConfigContext()\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -24 : 12\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const [hoveredElement, setHoveredElement] = useState<{\n elem: HTMLElement\n node: LexicalNode\n } | null>(null)\n\n useEffect(() => {\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n\n if (distanceFromScrollerElem === -1) {\n setHoveredElement(null)\n return\n }\n\n if (isOnHandleElement(target, ADD_BLOCK_MENU_CLASSNAME)) {\n return\n }\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _emptyBlockElem,\n blockNode,\n foundAtIndex,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n returnEmptyParagraphs: true,\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n })\n\n prevIndex = foundAtIndex\n\n if (!_emptyBlockElem) {\n return\n }\n if (\n blockNode &&\n (hoveredElement?.node !== blockNode || hoveredElement?.elem !== _emptyBlockElem)\n ) {\n setHoveredElement({\n elem: _emptyBlockElem,\n node: blockNode,\n })\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, hoveredElement])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n hoveredElement?.elem ?? null,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, hoveredElement, blockHandleHorizontalOffset])\n\n const handleAddClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n let hoveredElementToUse = hoveredElement\n if (!hoveredElementToUse?.node) {\n return\n }\n\n // 1. Update hoveredElement.node to a new paragraph node if the hoveredElement.node is not a paragraph node\n editor.update(() => {\n // Check if blockNode is an empty text node\n let isEmptyParagraph = true\n if (\n hoveredElementToUse?.node.getType() !== 'paragraph' ||\n hoveredElementToUse.node.getTextContent() !== ''\n ) {\n isEmptyParagraph = false\n }\n\n if (!isEmptyParagraph) {\n const newParagraph = $createParagraphNode()\n hoveredElementToUse?.node.insertAfter(newParagraph)\n\n setTimeout(() => {\n hoveredElementToUse = {\n elem: editor.getElementByKey(newParagraph.getKey())!,\n node: newParagraph,\n }\n setHoveredElement(hoveredElementToUse)\n }, 0)\n }\n })\n\n // 2. Focus on the new paragraph node\n setTimeout(() => {\n editor.update(() => {\n editor.focus()\n\n if (\n hoveredElementToUse?.node &&\n 'select' in hoveredElementToUse.node &&\n typeof hoveredElementToUse.node.select === 'function'\n ) {\n hoveredElementToUse.node.select()\n }\n })\n }, 1)\n\n // Make sure this is called AFTER the focusing has been processed by the browser\n // Otherwise, this won't work\n setTimeout(() => {\n editor.dispatchCommand(ENABLE_SLASH_MENU_COMMAND, {\n node: hoveredElementToUse?.node as ParagraphNode,\n })\n }, 2)\n\n event.stopPropagation()\n event.preventDefault()\n },\n [editor, hoveredElement],\n )\n\n return createPortal(\n <React.Fragment>\n <button\n aria-label=\"Add block\"\n className=\"icon add-block-menu\"\n onClick={(event) => {\n handleAddClick(event)\n }}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function AddBlockHandlePlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useAddBlockHandle(editor, anchorElem, editor._editable)\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,EAAEC,aAAa,QAAQ;AACpD,YAAYC,KAAA,MAAW;AACvB,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACzD,SAASC,YAAY,QAAQ;AAE7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,KAAK,QAAQ;AACtB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,iCAAiC,QAAQ;AAClD,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,iBAAiB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A2D,qBAAAC,EAAA;EAA8B;IAAA5D,UAAA,EAAA6D;EAAA,IAAAD,EAIpC;EAHC,MAAA5D,UAAA,GAAA6D,EAA0B,KAA1BC,SAA0B,GAAb7B,QAAA,CAAA8B,IAAa,GAA1BF,EAA0B;EAI1B,OAAA9D,MAAA,IAAiBzB,yBAAA;EAAA,OACVwB,iBAAA,CAAkBC,MAAA,EAAQC,UAAA,EAAYD,MAAA,CAAAiE,SAAgB;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,IAExD,GAAG,MAAM,SAAS,EAAE,UAUtC"}
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/debounce.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,MAAM,aAE/C,SAAS,EAAE,UAUtC"}
@@ -1,12 +1,29 @@
1
1
  @layer payload-default {
2
+ .draggable-block-menu__button {
3
+ border: 0;
4
+ padding: 0;
5
+ background: transparent;
6
+ cursor: grab;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ width: var(--spacer-4);
11
+ height: var(--spacer-4);
12
+
13
+ &:focus-visible {
14
+ outline: var(--accessibility-outline);
15
+ }
16
+ }
17
+
2
18
  .draggable-block-menu {
3
19
  border: none;
4
20
  border-radius: var(--radius-medium);
5
21
  padding: 0;
6
22
  cursor: grab;
7
23
  opacity: 0;
24
+ visibility: hidden;
8
25
  position: absolute;
9
- left: 0;
26
+ inset-inline-start: 0;
10
27
  top: 0;
11
28
  will-change: transform;
12
29
  background-color: var(--color-bg);
@@ -46,11 +63,12 @@
46
63
 
47
64
  .rich-text-lexical--show-gutter
48
65
  > .rich-text-lexical__wrap
66
+ > .rich-text-lexical__editor-content
49
67
  > .editor-container
50
68
  > .editor-scroller
51
69
  > .editor {
52
70
  > .draggable-block-target-line {
53
- left: var(--spacer-5);
71
+ inset-inline-start: var(--spacer-5);
54
72
  }
55
73
  }
56
74
 
@@ -60,7 +78,7 @@
60
78
  border-radius: var(--radius-small);
61
79
  height: var(--spacer-1);
62
80
  position: absolute;
63
- left: 0;
81
+ inset-inline-start: 0;
64
82
  top: 0;
65
83
  opacity: 0;
66
84
  will-change: transform;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,OAAO,aAAa,CAAA;AA6apB,wBAAgB,oBAAoB,CAAC,EACnC,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB,GAAG,KAAK,CAAC,YAAY,CAGrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,OAAO,aAAa,CAAA;AA+hBpB,wBAAgB,oBAAoB,CAAC,EACnC,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAA;CACzB,GAAG,KAAK,CAAC,YAAY,CAGrB"}
@@ -3,9 +3,10 @@
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
5
  import { eventFiles } from '@lexical/rich-text';
6
+ import { Popup, PopupList, useTranslation } from '@payloadcms/ui';
6
7
  import { $getNearestNodeFromDOMNode, $getNodeByKey, isHTMLElement } from 'lexical';
7
8
  import * as React from 'react';
8
- import { useEffect, useRef, useState } from 'react';
9
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
9
10
  import { createPortal } from 'react-dom';
10
11
  import { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js';
11
12
  import { Point } from '../../../utils/point.js';
@@ -16,7 +17,9 @@ import { isOnHandleElement } from '../utils/isOnHandleElement.js';
16
17
  import { setHandlePosition } from '../utils/setHandlePosition.js';
17
18
  import { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js';
18
19
  import './index.css';
20
+ import { $moveBlock } from './moveBlock.js';
19
21
  import { setTargetLine } from './setTargetLine.js';
22
+ import { useKeyboardReordering } from './useKeyboardReordering.js';
20
23
  const DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu';
21
24
  const DRAG_DATA_FORMAT = 'application/x-lexical-drag-block';
22
25
  let prevIndex = Infinity;
@@ -53,7 +56,16 @@ function hideTargetLine(targetLineElem, lastTargetBlockElem) {
53
56
  }
54
57
  function useDraggableBlockMenu(editor, anchorElem, isEditable) {
55
58
  const scrollerElem = anchorElem.parentElement;
59
+ const instructionsID = useId();
60
+ const {
61
+ t
62
+ } = useTranslation();
63
+ useKeyboardReordering({
64
+ editor,
65
+ instructionsID
66
+ });
56
67
  const menuRef = useRef(null);
68
+ const isMenuOpenRef = useRef(false);
57
69
  const targetLineRef = useRef(null);
58
70
  const debugHighlightRef = useRef(null);
59
71
  const isDraggingBlockRef = useRef(false);
@@ -70,7 +82,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
70
82
  */
71
83
  function onDocumentMouseMove(event) {
72
84
  const target = event.target;
73
- if (!isHTMLElement(target)) {
85
+ if (isMenuOpenRef.current || !isHTMLElement(target)) {
74
86
  return;
75
87
  }
76
88
  const distanceFromScrollerElem = calculateDistanceFromScrollerElem(scrollerElem, event.pageX, event.pageY, target);
@@ -111,9 +123,16 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
111
123
  // Since the draggableBlockElem is outside the actual editor, we need to listen to the document
112
124
  // to be able to detect when the mouse is outside the editor and respect a buffer around
113
125
  // the scrollerElem to avoid the draggableBlockElem disappearing too early.
126
+ const onDocumentPointerDown = event_0 => {
127
+ if (event_0.pointerType === 'touch' || event_0.pointerType === 'pen') {
128
+ onDocumentMouseMove(event_0);
129
+ }
130
+ };
114
131
  document?.addEventListener('mousemove', onDocumentMouseMove);
132
+ document?.addEventListener('pointerdown', onDocumentPointerDown);
115
133
  return () => {
116
134
  document?.removeEventListener('mousemove', onDocumentMouseMove);
135
+ document?.removeEventListener('pointerdown', onDocumentPointerDown);
117
136
  };
118
137
  }, [scrollerElem, anchorElem, editor, draggableBlockElem]);
119
138
  useEffect(() => {
@@ -122,22 +141,22 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
122
141
  }
123
142
  }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset]);
124
143
  useEffect(() => {
125
- function onDragover(event_0) {
144
+ function onDragover(event_1) {
126
145
  if (!isDraggingBlockRef.current) {
127
146
  return false;
128
147
  }
129
- const [isFileTransfer] = eventFiles(event_0);
148
+ const [isFileTransfer] = eventFiles(event_1);
130
149
  if (isFileTransfer) {
131
150
  return false;
132
151
  }
133
152
  const {
134
153
  pageY,
135
154
  target: target_0
136
- } = event_0;
155
+ } = event_1;
137
156
  if (!isHTMLElement(target_0)) {
138
157
  return false;
139
158
  }
140
- const distanceFromScrollerElem_0 = calculateDistanceFromScrollerElem(scrollerElem, event_0.pageX, event_0.pageY, target_0, 100, 50);
159
+ const distanceFromScrollerElem_0 = calculateDistanceFromScrollerElem(scrollerElem, event_1.pageX, event_1.pageY, target_0, 100, 50);
141
160
  const topLevelNodeKeys_0 = getTopLevelNodeKeys(editor);
142
161
  const {
143
162
  blockElem: targetBlockElem,
@@ -148,7 +167,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
148
167
  editor,
149
168
  fuzzy: true,
150
169
  horizontalOffset: -distanceFromScrollerElem_0,
151
- point: new Point(event_0.x, event_0.y),
170
+ point: new Point(event_1.x, event_1.y),
152
171
  startIndex: getCurrentIndex(topLevelNodeKeys_0.length),
153
172
  useEdgeAsDefault: true,
154
173
  verbose: true
@@ -160,13 +179,13 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
160
179
  return false;
161
180
  }
162
181
  // Always prevent default and set dropEffect during drag to maintain the move cursor
163
- event_0.preventDefault();
164
- event_0.dataTransfer.dropEffect = 'move';
182
+ event_1.preventDefault();
183
+ event_1.dataTransfer.dropEffect = 'move';
165
184
  if (draggableBlockElem !== targetBlockElem) {
166
185
  const {
167
186
  isBelow,
168
187
  willStayInSamePosition
169
- } = setTargetLine(editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)', blockHandleHorizontalOffset + (editorConfig?.admin?.hideGutter ? menuRef?.current?.getBoundingClientRect()?.width ?? 0 : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)), targetLineElem, targetBlockElem, lastTargetBlock, pageY, anchorElem, event_0, debugHighlightRef, isFoundNodeEmptyParagraph_0);
188
+ } = setTargetLine(editorConfig?.admin?.hideGutter ? '0px' : 'var(--spacer-5)', blockHandleHorizontalOffset + (editorConfig?.admin?.hideGutter ? menuRef?.current?.getBoundingClientRect()?.width ?? 0 : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)), targetLineElem, targetBlockElem, lastTargetBlock, pageY, anchorElem, event_1, debugHighlightRef, isFoundNodeEmptyParagraph_0);
170
189
  if (!willStayInSamePosition) {
171
190
  setLastTargetBlock({
172
191
  boundingBox: targetBlockElem.getBoundingClientRect(),
@@ -184,11 +203,11 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
184
203
  }
185
204
  return true;
186
205
  }
187
- function onDrop(event_1) {
206
+ function onDrop(event_2) {
188
207
  if (!isDraggingBlockRef.current) {
189
208
  return false;
190
209
  }
191
- const [isFileTransfer_0] = eventFiles(event_1);
210
+ const [isFileTransfer_0] = eventFiles(event_2);
192
211
  if (isFileTransfer_0) {
193
212
  return false;
194
213
  }
@@ -196,7 +215,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
196
215
  dataTransfer,
197
216
  pageY: pageY_0,
198
217
  target: target_1
199
- } = event_1;
218
+ } = event_2;
200
219
  const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || '';
201
220
  editor.update(() => {
202
221
  const draggedNode = $getNodeByKey(dragData);
@@ -206,7 +225,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
206
225
  if (!isHTMLElement(target_1)) {
207
226
  return false;
208
227
  }
209
- const distanceFromScrollerElem_1 = calculateDistanceFromScrollerElem(scrollerElem, event_1.pageX, event_1.pageY, target_1, 100, 50);
228
+ const distanceFromScrollerElem_1 = calculateDistanceFromScrollerElem(scrollerElem, event_2.pageX, event_2.pageY, target_1, 100, 50);
210
229
  const {
211
230
  blockElem: targetBlockElem_0,
212
231
  isFoundNodeEmptyParagraph: isFoundNodeEmptyParagraph_1
@@ -215,7 +234,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
215
234
  editor,
216
235
  fuzzy: true,
217
236
  horizontalOffset: -distanceFromScrollerElem_1,
218
- point: new Point(event_1.x, event_1.y),
237
+ point: new Point(event_2.x, event_2.y),
219
238
  useEdgeAsDefault: true
220
239
  });
221
240
  if (!targetBlockElem_0) {
@@ -271,7 +290,7 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
271
290
  }
272
291
  const highlightElem = document.createElement('div');
273
292
  highlightElem.className = 'lexical-block-highlighter';
274
- highlightElem.style.backgroundColor = 'var(--theme-elevation-1000';
293
+ highlightElem.style.backgroundColor = 'var(--color-bg-inverse)';
275
294
  highlightElem.style.transition = 'opacity 0.5s ease-in-out';
276
295
  highlightElem.style.zIndex = '1';
277
296
  highlightElem.style.pointerEvents = 'none';
@@ -308,40 +327,123 @@ function useDraggableBlockMenu(editor, anchorElem, isEditable) {
308
327
  highlightTimersRef.current = [];
309
328
  };
310
329
  }, [scrollerElem, blockHandleHorizontalOffset, anchorElem, editor, lastTargetBlock, draggableBlockElem, editorConfig?.admin?.hideGutter]);
311
- function onDragStart(event_2) {
312
- const dataTransfer_0 = event_2.dataTransfer;
313
- if (!dataTransfer_0 || !draggableBlockElem) {
330
+ const startDrag = useCallback(({
331
+ blockElem,
332
+ dataTransfer: dataTransfer_0
333
+ }) => {
334
+ if (!editor.isEditable() || !dataTransfer_0 || !blockElem) {
314
335
  return;
315
336
  }
316
- setDragImage(dataTransfer_0, draggableBlockElem);
337
+ setDragImage(dataTransfer_0, blockElem);
317
338
  dataTransfer_0.effectAllowed = 'move';
318
- let nodeKey = '';
319
- editor.update(() => {
320
- const node = $getNearestNodeFromDOMNode(draggableBlockElem);
339
+ editor.read(() => {
340
+ const node = $getNearestNodeFromDOMNode(blockElem)?.getTopLevelElement();
321
341
  if (node) {
322
- nodeKey = node.getKey();
342
+ isDraggingBlockRef.current = true;
343
+ dataTransfer_0.setData(DRAG_DATA_FORMAT, node.getKey());
323
344
  }
324
345
  });
325
- isDraggingBlockRef.current = true;
326
- dataTransfer_0.setData(DRAG_DATA_FORMAT, nodeKey);
327
- }
328
- function onDragEnd() {
346
+ }, [editor]);
347
+ const onDragEnd = useCallback(() => {
329
348
  isDraggingBlockRef.current = false;
330
349
  if (lastTargetBlock?.elem) {
331
- hideTargetLine(targetLineRef.current, lastTargetBlock?.elem);
350
+ hideTargetLine(targetLineRef.current, lastTargetBlock.elem);
332
351
  }
352
+ }, [lastTargetBlock]);
353
+ useEffect(() => {
354
+ const onHeaderDragStart = event_3 => {
355
+ const handle = event_3.target instanceof HTMLElement ? event_3.target.closest('.collapsible__drag[draggable="true"]') : null;
356
+ if (!handle || !editor.getRootElement()?.contains(handle)) {
357
+ return;
358
+ }
359
+ const blockElem_0 = editor.getElementByKey(handle.dataset.sortableId ?? '');
360
+ if (blockElem_0) {
361
+ setDraggableBlockElem(blockElem_0);
362
+ startDrag({
363
+ blockElem: blockElem_0,
364
+ dataTransfer: event_3.dataTransfer
365
+ });
366
+ }
367
+ };
368
+ document.addEventListener('dragstart', onHeaderDragStart);
369
+ document.addEventListener('dragend', onDragEnd);
370
+ return () => {
371
+ document.removeEventListener('dragstart', onHeaderDragStart);
372
+ document.removeEventListener('dragend', onDragEnd);
373
+ };
374
+ }, [editor, startDrag, onDragEnd]);
375
+ function moveBlock({
376
+ direction
377
+ }) {
378
+ if (!editor.isEditable() || !draggableBlockElem) {
379
+ return;
380
+ }
381
+ editor.update(() => {
382
+ const node_0 = $getNearestNodeFromDOMNode(draggableBlockElem)?.getTopLevelElement();
383
+ if (node_0) {
384
+ $moveBlock({
385
+ direction,
386
+ node: node_0
387
+ });
388
+ }
389
+ }, {
390
+ onUpdate: () => {
391
+ if (menuRef.current) {
392
+ setHandlePosition(draggableBlockElem, menuRef.current, anchorElem, blockHandleHorizontalOffset);
393
+ }
394
+ }
395
+ });
333
396
  }
334
397
  return /*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(React.Fragment, {
335
- children: [/*#__PURE__*/_jsx("button", {
336
- "aria-label": "Drag to move",
337
- className: "icon draggable-block-menu",
338
- draggable: true,
339
- onDragEnd: onDragEnd,
340
- onDragStart: onDragStart,
398
+ children: [/*#__PURE__*/_jsxs("span", {
399
+ className: "sr-only",
400
+ id: instructionsID,
401
+ children: [t('general:moveUp'), ": Alt + Shift + ↑. ", t('general:moveDown'), ": Alt + Shift + ↓."]
402
+ }), /*#__PURE__*/_jsx("div", {
403
+ className: "draggable-block-menu",
341
404
  ref: menuRef,
342
- type: "button",
343
- children: /*#__PURE__*/_jsx("div", {
344
- className: isEditable ? 'icon' : ''
405
+ children: /*#__PURE__*/_jsx(Popup, {
406
+ caret: false,
407
+ disabled: !isEditable,
408
+ onToggleClose: () => {
409
+ isMenuOpenRef.current = false;
410
+ },
411
+ onToggleOpen: () => {
412
+ isMenuOpenRef.current = true;
413
+ },
414
+ popupType: "menu",
415
+ render: ({
416
+ close
417
+ }) => /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
418
+ children: [-1, 1].map(direction_0 => /*#__PURE__*/_jsx(PopupList.Button, {
419
+ onClick: () => {
420
+ moveBlock({
421
+ direction: direction_0
422
+ });
423
+ close();
424
+ },
425
+ children: t(direction_0 === -1 ? 'general:moveUp' : 'general:moveDown')
426
+ }, direction_0))
427
+ }),
428
+ renderButton: ({
429
+ active: _active,
430
+ ...buttonProps
431
+ }) => /*#__PURE__*/_jsx("button", {
432
+ ...buttonProps,
433
+ "aria-label": t('general:dragToMove'),
434
+ className: "draggable-block-menu__button",
435
+ disabled: !isEditable,
436
+ draggable: isEditable,
437
+ onDragEnd: onDragEnd,
438
+ onDragStart: event_4 => startDrag({
439
+ blockElem: draggableBlockElem,
440
+ dataTransfer: event_4.dataTransfer
441
+ }),
442
+ type: "button",
443
+ children: /*#__PURE__*/_jsx("div", {
444
+ className: isEditable ? 'icon' : ''
445
+ })
446
+ })
345
447
  })
346
448
  }), /*#__PURE__*/_jsx("div", {
347
449
  className: "draggable-block-target-line",