@lexical/react 0.44.1-nightly.20260518.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/README.md +1 -1
  2. package/{LexicalClearEditorPlugin.dev.js → dist/LexicalClearEditorPlugin.dev.js} +2 -11
  3. package/{LexicalClearEditorPlugin.dev.mjs → dist/LexicalClearEditorPlugin.dev.mjs} +1 -10
  4. package/dist/LexicalClearEditorPlugin.prod.js +9 -0
  5. package/dist/LexicalClearEditorPlugin.prod.mjs +9 -0
  6. package/{LexicalComposer.dev.js → dist/LexicalComposer.dev.js} +2 -12
  7. package/{LexicalComposer.dev.mjs → dist/LexicalComposer.dev.mjs} +1 -11
  8. package/dist/LexicalComposer.prod.js +9 -0
  9. package/dist/LexicalComposer.prod.mjs +9 -0
  10. package/{LexicalContentEditable.dev.js → dist/LexicalContentEditable.dev.js} +13 -22
  11. package/{LexicalContentEditable.dev.mjs → dist/LexicalContentEditable.dev.mjs} +12 -21
  12. package/dist/LexicalContentEditable.prod.js +9 -0
  13. package/dist/LexicalContentEditable.prod.mjs +9 -0
  14. package/{LexicalDraggableBlockPlugin.dev.js → dist/LexicalDraggableBlockPlugin.dev.js} +5 -27
  15. package/{LexicalDraggableBlockPlugin.dev.mjs → dist/LexicalDraggableBlockPlugin.dev.mjs} +1 -23
  16. package/dist/LexicalDraggableBlockPlugin.prod.js +9 -0
  17. package/dist/LexicalDraggableBlockPlugin.prod.mjs +9 -0
  18. package/{LexicalNestedComposer.dev.js → dist/LexicalNestedComposer.dev.js} +1 -0
  19. package/{LexicalNestedComposer.dev.mjs → dist/LexicalNestedComposer.dev.mjs} +1 -0
  20. package/{LexicalNodeMenuPlugin.dev.js → dist/LexicalNodeMenuPlugin.dev.js} +24 -34
  21. package/{LexicalNodeMenuPlugin.dev.mjs → dist/LexicalNodeMenuPlugin.dev.mjs} +22 -32
  22. package/dist/LexicalNodeMenuPlugin.prod.js +9 -0
  23. package/dist/LexicalNodeMenuPlugin.prod.mjs +9 -0
  24. package/{LexicalOnChangePlugin.dev.js → dist/LexicalOnChangePlugin.dev.js} +1 -11
  25. package/{LexicalOnChangePlugin.dev.mjs → dist/LexicalOnChangePlugin.dev.mjs} +1 -11
  26. package/dist/LexicalOnChangePlugin.prod.js +9 -0
  27. package/dist/LexicalOnChangePlugin.prod.mjs +9 -0
  28. package/{LexicalPlainTextPlugin.dev.js → dist/LexicalPlainTextPlugin.dev.js} +2 -11
  29. package/{LexicalPlainTextPlugin.dev.mjs → dist/LexicalPlainTextPlugin.dev.mjs} +1 -10
  30. package/dist/LexicalPlainTextPlugin.prod.js +9 -0
  31. package/dist/LexicalPlainTextPlugin.prod.mjs +9 -0
  32. package/{LexicalRichTextPlugin.dev.js → dist/LexicalRichTextPlugin.dev.js} +2 -11
  33. package/{LexicalRichTextPlugin.dev.mjs → dist/LexicalRichTextPlugin.dev.mjs} +1 -10
  34. package/dist/LexicalRichTextPlugin.prod.js +9 -0
  35. package/dist/LexicalRichTextPlugin.prod.mjs +9 -0
  36. package/{LexicalTablePlugin.dev.js → dist/LexicalTablePlugin.dev.js} +6 -3
  37. package/{LexicalTablePlugin.dev.mjs → dist/LexicalTablePlugin.dev.mjs} +7 -4
  38. package/dist/LexicalTablePlugin.prod.js +9 -0
  39. package/dist/LexicalTablePlugin.prod.mjs +9 -0
  40. package/{LexicalTypeaheadMenuPlugin.dev.js → dist/LexicalTypeaheadMenuPlugin.dev.js} +24 -34
  41. package/{LexicalTypeaheadMenuPlugin.dev.mjs → dist/LexicalTypeaheadMenuPlugin.dev.mjs} +22 -32
  42. package/dist/LexicalTypeaheadMenuPlugin.prod.js +9 -0
  43. package/dist/LexicalTypeaheadMenuPlugin.prod.mjs +9 -0
  44. package/dist/shared/reactPatches.d.ts +8 -0
  45. package/dist/shared/useLayoutEffect.d.ts +10 -0
  46. package/{useLexicalEditable.dev.js → dist/useLexicalEditable.dev.js} +2 -11
  47. package/{useLexicalEditable.dev.mjs → dist/useLexicalEditable.dev.mjs} +1 -10
  48. package/dist/useLexicalEditable.prod.js +9 -0
  49. package/dist/useLexicalEditable.prod.mjs +9 -0
  50. package/{useLexicalIsTextContentEmpty.dev.js → dist/useLexicalIsTextContentEmpty.dev.js} +2 -11
  51. package/{useLexicalIsTextContentEmpty.dev.mjs → dist/useLexicalIsTextContentEmpty.dev.mjs} +1 -10
  52. package/dist/useLexicalIsTextContentEmpty.prod.js +9 -0
  53. package/dist/useLexicalIsTextContentEmpty.prod.mjs +9 -0
  54. package/{useLexicalSubscription.dev.js → dist/useLexicalSubscription.dev.js} +2 -11
  55. package/{useLexicalSubscription.dev.mjs → dist/useLexicalSubscription.dev.mjs} +1 -10
  56. package/dist/useLexicalSubscription.prod.js +9 -0
  57. package/dist/useLexicalSubscription.prod.mjs +9 -0
  58. package/package.json +1054 -938
  59. package/src/ExtensionComponent.tsx +59 -0
  60. package/src/LexicalAutoEmbedPlugin.tsx +300 -0
  61. package/src/LexicalAutoFocusPlugin.ts +41 -0
  62. package/src/LexicalAutoLinkPlugin.ts +61 -0
  63. package/src/LexicalBlockWithAlignableContents.tsx +119 -0
  64. package/src/LexicalCharacterLimitPlugin.tsx +91 -0
  65. package/src/LexicalCheckListPlugin.tsx +24 -0
  66. package/src/LexicalClearEditorPlugin.ts +27 -0
  67. package/src/LexicalClickableLinkPlugin.tsx +28 -0
  68. package/src/LexicalCollaborationContext.tsx +91 -0
  69. package/src/LexicalCollaborationPlugin.tsx +266 -0
  70. package/src/LexicalComposer.tsx +185 -0
  71. package/src/LexicalComposerContext.ts +63 -0
  72. package/src/LexicalContentEditable.tsx +98 -0
  73. package/src/LexicalDecoratorBlockNode.ts +87 -0
  74. package/src/LexicalDraggableBlockPlugin.tsx +601 -0
  75. package/src/LexicalEditorRefPlugin.tsx +41 -0
  76. package/src/LexicalErrorBoundary.tsx +46 -0
  77. package/src/LexicalExtensionComposer.tsx +117 -0
  78. package/src/LexicalExtensionEditorComposer.tsx +46 -0
  79. package/src/LexicalHashtagPlugin.ts +26 -0
  80. package/src/LexicalHistoryPlugin.ts +31 -0
  81. package/src/LexicalHorizontalRuleNode.tsx +123 -0
  82. package/src/LexicalHorizontalRulePlugin.ts +52 -0
  83. package/src/LexicalLinkPlugin.ts +32 -0
  84. package/src/LexicalListPlugin.ts +60 -0
  85. package/src/LexicalMarkdownShortcutPlugin.tsx +56 -0
  86. package/src/LexicalNestedComposer.tsx +221 -0
  87. package/src/LexicalNodeContextMenuPlugin.tsx +316 -0
  88. package/src/LexicalNodeEventPlugin.ts +71 -0
  89. package/src/LexicalNodeMenuPlugin.tsx +131 -0
  90. package/src/LexicalOnChangePlugin.ts +52 -0
  91. package/src/LexicalPlainTextPlugin.tsx +65 -0
  92. package/src/LexicalRichTextPlugin.tsx +65 -0
  93. package/src/LexicalSelectionAlwaysOnDisplay.tsx +24 -0
  94. package/src/LexicalTabIndentationPlugin.tsx +40 -0
  95. package/src/LexicalTableOfContentsPlugin.tsx +277 -0
  96. package/src/LexicalTablePlugin.ts +118 -0
  97. package/src/LexicalTreeView.tsx +128 -0
  98. package/src/LexicalTypeaheadMenuPlugin.tsx +365 -0
  99. package/src/ReactExtension.tsx +113 -0
  100. package/src/ReactPluginHostExtension.tsx +228 -0
  101. package/src/ReactProviderExtension.tsx +20 -0
  102. package/src/TreeViewExtension.tsx +48 -0
  103. package/src/shared/LegacyDecorators.tsx +62 -0
  104. package/src/shared/LexicalContentEditableElement.tsx +126 -0
  105. package/src/shared/LexicalMenu.tsx +738 -0
  106. package/src/shared/buildEditorComponent.tsx +60 -0
  107. package/src/shared/mergeRefs.ts +20 -0
  108. package/src/shared/point.ts +55 -0
  109. package/src/shared/reactPatches.ts +22 -0
  110. package/src/shared/rect.ts +158 -0
  111. package/src/shared/types.ts +106 -0
  112. package/src/shared/useCanShowPlaceholder.ts +50 -0
  113. package/src/shared/useCharacterLimit.ts +314 -0
  114. package/src/shared/useDecorators.tsx +73 -0
  115. package/src/shared/useHistory.ts +28 -0
  116. package/src/shared/useLayoutEffect.ts +19 -0
  117. package/src/shared/useList.ts +18 -0
  118. package/src/shared/usePlainTextSetup.ts +24 -0
  119. package/src/shared/useReactDecorators.tsx +53 -0
  120. package/src/shared/useRichTextSetup.ts +24 -0
  121. package/src/shared/useYjsCollaboration.tsx +694 -0
  122. package/src/useExtensionComponent.tsx +57 -0
  123. package/src/useExtensionSignalValue.ts +85 -0
  124. package/src/useLexicalEditable.ts +33 -0
  125. package/src/useLexicalIsTextContentEmpty.ts +37 -0
  126. package/src/useLexicalNodeSelection.ts +114 -0
  127. package/src/useLexicalSubscription.tsx +52 -0
  128. package/src/useLexicalTextEntity.ts +29 -0
  129. package/LexicalClearEditorPlugin.prod.js +0 -9
  130. package/LexicalClearEditorPlugin.prod.mjs +0 -9
  131. package/LexicalComposer.prod.js +0 -9
  132. package/LexicalComposer.prod.mjs +0 -9
  133. package/LexicalContentEditable.prod.js +0 -9
  134. package/LexicalContentEditable.prod.mjs +0 -9
  135. package/LexicalDraggableBlockPlugin.prod.js +0 -9
  136. package/LexicalDraggableBlockPlugin.prod.mjs +0 -9
  137. package/LexicalNodeMenuPlugin.prod.js +0 -9
  138. package/LexicalNodeMenuPlugin.prod.mjs +0 -9
  139. package/LexicalOnChangePlugin.prod.js +0 -9
  140. package/LexicalOnChangePlugin.prod.mjs +0 -9
  141. package/LexicalPlainTextPlugin.prod.js +0 -9
  142. package/LexicalPlainTextPlugin.prod.mjs +0 -9
  143. package/LexicalRichTextPlugin.prod.js +0 -9
  144. package/LexicalRichTextPlugin.prod.mjs +0 -9
  145. package/LexicalTablePlugin.prod.js +0 -9
  146. package/LexicalTablePlugin.prod.mjs +0 -9
  147. package/LexicalTypeaheadMenuPlugin.prod.js +0 -9
  148. package/LexicalTypeaheadMenuPlugin.prod.mjs +0 -9
  149. package/useLexicalEditable.prod.js +0 -9
  150. package/useLexicalEditable.prod.mjs +0 -9
  151. package/useLexicalIsTextContentEmpty.prod.js +0 -9
  152. package/useLexicalIsTextContentEmpty.prod.mjs +0 -9
  153. package/useLexicalSubscription.prod.js +0 -9
  154. package/useLexicalSubscription.prod.mjs +0 -9
  155. /package/{ExtensionComponent.d.ts → dist/ExtensionComponent.d.ts} +0 -0
  156. /package/{LexicalAutoEmbedPlugin.d.ts → dist/LexicalAutoEmbedPlugin.d.ts} +0 -0
  157. /package/{LexicalAutoEmbedPlugin.dev.js → dist/LexicalAutoEmbedPlugin.dev.js} +0 -0
  158. /package/{LexicalAutoEmbedPlugin.dev.mjs → dist/LexicalAutoEmbedPlugin.dev.mjs} +0 -0
  159. /package/{LexicalAutoEmbedPlugin.js → dist/LexicalAutoEmbedPlugin.js} +0 -0
  160. /package/{LexicalAutoEmbedPlugin.js.flow → dist/LexicalAutoEmbedPlugin.js.flow} +0 -0
  161. /package/{LexicalAutoEmbedPlugin.mjs → dist/LexicalAutoEmbedPlugin.mjs} +0 -0
  162. /package/{LexicalAutoEmbedPlugin.node.mjs → dist/LexicalAutoEmbedPlugin.node.mjs} +0 -0
  163. /package/{LexicalAutoEmbedPlugin.prod.js → dist/LexicalAutoEmbedPlugin.prod.js} +0 -0
  164. /package/{LexicalAutoEmbedPlugin.prod.mjs → dist/LexicalAutoEmbedPlugin.prod.mjs} +0 -0
  165. /package/{LexicalAutoFocusPlugin.d.ts → dist/LexicalAutoFocusPlugin.d.ts} +0 -0
  166. /package/{LexicalAutoFocusPlugin.dev.js → dist/LexicalAutoFocusPlugin.dev.js} +0 -0
  167. /package/{LexicalAutoFocusPlugin.dev.mjs → dist/LexicalAutoFocusPlugin.dev.mjs} +0 -0
  168. /package/{LexicalAutoFocusPlugin.js → dist/LexicalAutoFocusPlugin.js} +0 -0
  169. /package/{LexicalAutoFocusPlugin.js.flow → dist/LexicalAutoFocusPlugin.js.flow} +0 -0
  170. /package/{LexicalAutoFocusPlugin.mjs → dist/LexicalAutoFocusPlugin.mjs} +0 -0
  171. /package/{LexicalAutoFocusPlugin.node.mjs → dist/LexicalAutoFocusPlugin.node.mjs} +0 -0
  172. /package/{LexicalAutoFocusPlugin.prod.js → dist/LexicalAutoFocusPlugin.prod.js} +0 -0
  173. /package/{LexicalAutoFocusPlugin.prod.mjs → dist/LexicalAutoFocusPlugin.prod.mjs} +0 -0
  174. /package/{LexicalAutoLinkPlugin.d.ts → dist/LexicalAutoLinkPlugin.d.ts} +0 -0
  175. /package/{LexicalAutoLinkPlugin.dev.js → dist/LexicalAutoLinkPlugin.dev.js} +0 -0
  176. /package/{LexicalAutoLinkPlugin.dev.mjs → dist/LexicalAutoLinkPlugin.dev.mjs} +0 -0
  177. /package/{LexicalAutoLinkPlugin.js → dist/LexicalAutoLinkPlugin.js} +0 -0
  178. /package/{LexicalAutoLinkPlugin.js.flow → dist/LexicalAutoLinkPlugin.js.flow} +0 -0
  179. /package/{LexicalAutoLinkPlugin.mjs → dist/LexicalAutoLinkPlugin.mjs} +0 -0
  180. /package/{LexicalAutoLinkPlugin.node.mjs → dist/LexicalAutoLinkPlugin.node.mjs} +0 -0
  181. /package/{LexicalAutoLinkPlugin.prod.js → dist/LexicalAutoLinkPlugin.prod.js} +0 -0
  182. /package/{LexicalAutoLinkPlugin.prod.mjs → dist/LexicalAutoLinkPlugin.prod.mjs} +0 -0
  183. /package/{LexicalBlockWithAlignableContents.d.ts → dist/LexicalBlockWithAlignableContents.d.ts} +0 -0
  184. /package/{LexicalBlockWithAlignableContents.dev.js → dist/LexicalBlockWithAlignableContents.dev.js} +0 -0
  185. /package/{LexicalBlockWithAlignableContents.dev.mjs → dist/LexicalBlockWithAlignableContents.dev.mjs} +0 -0
  186. /package/{LexicalBlockWithAlignableContents.js → dist/LexicalBlockWithAlignableContents.js} +0 -0
  187. /package/{LexicalBlockWithAlignableContents.js.flow → dist/LexicalBlockWithAlignableContents.js.flow} +0 -0
  188. /package/{LexicalBlockWithAlignableContents.mjs → dist/LexicalBlockWithAlignableContents.mjs} +0 -0
  189. /package/{LexicalBlockWithAlignableContents.node.mjs → dist/LexicalBlockWithAlignableContents.node.mjs} +0 -0
  190. /package/{LexicalBlockWithAlignableContents.prod.js → dist/LexicalBlockWithAlignableContents.prod.js} +0 -0
  191. /package/{LexicalBlockWithAlignableContents.prod.mjs → dist/LexicalBlockWithAlignableContents.prod.mjs} +0 -0
  192. /package/{LexicalCharacterLimitPlugin.d.ts → dist/LexicalCharacterLimitPlugin.d.ts} +0 -0
  193. /package/{LexicalCharacterLimitPlugin.dev.js → dist/LexicalCharacterLimitPlugin.dev.js} +0 -0
  194. /package/{LexicalCharacterLimitPlugin.dev.mjs → dist/LexicalCharacterLimitPlugin.dev.mjs} +0 -0
  195. /package/{LexicalCharacterLimitPlugin.js → dist/LexicalCharacterLimitPlugin.js} +0 -0
  196. /package/{LexicalCharacterLimitPlugin.js.flow → dist/LexicalCharacterLimitPlugin.js.flow} +0 -0
  197. /package/{LexicalCharacterLimitPlugin.mjs → dist/LexicalCharacterLimitPlugin.mjs} +0 -0
  198. /package/{LexicalCharacterLimitPlugin.node.mjs → dist/LexicalCharacterLimitPlugin.node.mjs} +0 -0
  199. /package/{LexicalCharacterLimitPlugin.prod.js → dist/LexicalCharacterLimitPlugin.prod.js} +0 -0
  200. /package/{LexicalCharacterLimitPlugin.prod.mjs → dist/LexicalCharacterLimitPlugin.prod.mjs} +0 -0
  201. /package/{LexicalCheckListPlugin.d.ts → dist/LexicalCheckListPlugin.d.ts} +0 -0
  202. /package/{LexicalCheckListPlugin.dev.js → dist/LexicalCheckListPlugin.dev.js} +0 -0
  203. /package/{LexicalCheckListPlugin.dev.mjs → dist/LexicalCheckListPlugin.dev.mjs} +0 -0
  204. /package/{LexicalCheckListPlugin.js → dist/LexicalCheckListPlugin.js} +0 -0
  205. /package/{LexicalCheckListPlugin.js.flow → dist/LexicalCheckListPlugin.js.flow} +0 -0
  206. /package/{LexicalCheckListPlugin.mjs → dist/LexicalCheckListPlugin.mjs} +0 -0
  207. /package/{LexicalCheckListPlugin.node.mjs → dist/LexicalCheckListPlugin.node.mjs} +0 -0
  208. /package/{LexicalCheckListPlugin.prod.js → dist/LexicalCheckListPlugin.prod.js} +0 -0
  209. /package/{LexicalCheckListPlugin.prod.mjs → dist/LexicalCheckListPlugin.prod.mjs} +0 -0
  210. /package/{LexicalClearEditorPlugin.d.ts → dist/LexicalClearEditorPlugin.d.ts} +0 -0
  211. /package/{LexicalClearEditorPlugin.js → dist/LexicalClearEditorPlugin.js} +0 -0
  212. /package/{LexicalClearEditorPlugin.js.flow → dist/LexicalClearEditorPlugin.js.flow} +0 -0
  213. /package/{LexicalClearEditorPlugin.mjs → dist/LexicalClearEditorPlugin.mjs} +0 -0
  214. /package/{LexicalClearEditorPlugin.node.mjs → dist/LexicalClearEditorPlugin.node.mjs} +0 -0
  215. /package/{LexicalClickableLinkPlugin.d.ts → dist/LexicalClickableLinkPlugin.d.ts} +0 -0
  216. /package/{LexicalClickableLinkPlugin.dev.js → dist/LexicalClickableLinkPlugin.dev.js} +0 -0
  217. /package/{LexicalClickableLinkPlugin.dev.mjs → dist/LexicalClickableLinkPlugin.dev.mjs} +0 -0
  218. /package/{LexicalClickableLinkPlugin.js → dist/LexicalClickableLinkPlugin.js} +0 -0
  219. /package/{LexicalClickableLinkPlugin.js.flow → dist/LexicalClickableLinkPlugin.js.flow} +0 -0
  220. /package/{LexicalClickableLinkPlugin.mjs → dist/LexicalClickableLinkPlugin.mjs} +0 -0
  221. /package/{LexicalClickableLinkPlugin.node.mjs → dist/LexicalClickableLinkPlugin.node.mjs} +0 -0
  222. /package/{LexicalClickableLinkPlugin.prod.js → dist/LexicalClickableLinkPlugin.prod.js} +0 -0
  223. /package/{LexicalClickableLinkPlugin.prod.mjs → dist/LexicalClickableLinkPlugin.prod.mjs} +0 -0
  224. /package/{LexicalCollaborationContext.d.ts → dist/LexicalCollaborationContext.d.ts} +0 -0
  225. /package/{LexicalCollaborationContext.dev.js → dist/LexicalCollaborationContext.dev.js} +0 -0
  226. /package/{LexicalCollaborationContext.dev.mjs → dist/LexicalCollaborationContext.dev.mjs} +0 -0
  227. /package/{LexicalCollaborationContext.js → dist/LexicalCollaborationContext.js} +0 -0
  228. /package/{LexicalCollaborationContext.js.flow → dist/LexicalCollaborationContext.js.flow} +0 -0
  229. /package/{LexicalCollaborationContext.mjs → dist/LexicalCollaborationContext.mjs} +0 -0
  230. /package/{LexicalCollaborationContext.node.mjs → dist/LexicalCollaborationContext.node.mjs} +0 -0
  231. /package/{LexicalCollaborationContext.prod.js → dist/LexicalCollaborationContext.prod.js} +0 -0
  232. /package/{LexicalCollaborationContext.prod.mjs → dist/LexicalCollaborationContext.prod.mjs} +0 -0
  233. /package/{LexicalCollaborationPlugin.d.ts → dist/LexicalCollaborationPlugin.d.ts} +0 -0
  234. /package/{LexicalCollaborationPlugin.dev.js → dist/LexicalCollaborationPlugin.dev.js} +0 -0
  235. /package/{LexicalCollaborationPlugin.dev.mjs → dist/LexicalCollaborationPlugin.dev.mjs} +0 -0
  236. /package/{LexicalCollaborationPlugin.js → dist/LexicalCollaborationPlugin.js} +0 -0
  237. /package/{LexicalCollaborationPlugin.js.flow → dist/LexicalCollaborationPlugin.js.flow} +0 -0
  238. /package/{LexicalCollaborationPlugin.mjs → dist/LexicalCollaborationPlugin.mjs} +0 -0
  239. /package/{LexicalCollaborationPlugin.node.mjs → dist/LexicalCollaborationPlugin.node.mjs} +0 -0
  240. /package/{LexicalCollaborationPlugin.prod.js → dist/LexicalCollaborationPlugin.prod.js} +0 -0
  241. /package/{LexicalCollaborationPlugin.prod.mjs → dist/LexicalCollaborationPlugin.prod.mjs} +0 -0
  242. /package/{LexicalComposer.d.ts → dist/LexicalComposer.d.ts} +0 -0
  243. /package/{LexicalComposer.js → dist/LexicalComposer.js} +0 -0
  244. /package/{LexicalComposer.js.flow → dist/LexicalComposer.js.flow} +0 -0
  245. /package/{LexicalComposer.mjs → dist/LexicalComposer.mjs} +0 -0
  246. /package/{LexicalComposer.node.mjs → dist/LexicalComposer.node.mjs} +0 -0
  247. /package/{LexicalComposerContext.d.ts → dist/LexicalComposerContext.d.ts} +0 -0
  248. /package/{LexicalComposerContext.dev.js → dist/LexicalComposerContext.dev.js} +0 -0
  249. /package/{LexicalComposerContext.dev.mjs → dist/LexicalComposerContext.dev.mjs} +0 -0
  250. /package/{LexicalComposerContext.js → dist/LexicalComposerContext.js} +0 -0
  251. /package/{LexicalComposerContext.js.flow → dist/LexicalComposerContext.js.flow} +0 -0
  252. /package/{LexicalComposerContext.mjs → dist/LexicalComposerContext.mjs} +0 -0
  253. /package/{LexicalComposerContext.node.mjs → dist/LexicalComposerContext.node.mjs} +0 -0
  254. /package/{LexicalComposerContext.prod.js → dist/LexicalComposerContext.prod.js} +0 -0
  255. /package/{LexicalComposerContext.prod.mjs → dist/LexicalComposerContext.prod.mjs} +0 -0
  256. /package/{LexicalContentEditable.d.ts → dist/LexicalContentEditable.d.ts} +0 -0
  257. /package/{LexicalContentEditable.js → dist/LexicalContentEditable.js} +0 -0
  258. /package/{LexicalContentEditable.js.flow → dist/LexicalContentEditable.js.flow} +0 -0
  259. /package/{LexicalContentEditable.mjs → dist/LexicalContentEditable.mjs} +0 -0
  260. /package/{LexicalContentEditable.node.mjs → dist/LexicalContentEditable.node.mjs} +0 -0
  261. /package/{LexicalDecoratorBlockNode.d.ts → dist/LexicalDecoratorBlockNode.d.ts} +0 -0
  262. /package/{LexicalDecoratorBlockNode.dev.js → dist/LexicalDecoratorBlockNode.dev.js} +0 -0
  263. /package/{LexicalDecoratorBlockNode.dev.mjs → dist/LexicalDecoratorBlockNode.dev.mjs} +0 -0
  264. /package/{LexicalDecoratorBlockNode.js → dist/LexicalDecoratorBlockNode.js} +0 -0
  265. /package/{LexicalDecoratorBlockNode.js.flow → dist/LexicalDecoratorBlockNode.js.flow} +0 -0
  266. /package/{LexicalDecoratorBlockNode.mjs → dist/LexicalDecoratorBlockNode.mjs} +0 -0
  267. /package/{LexicalDecoratorBlockNode.node.mjs → dist/LexicalDecoratorBlockNode.node.mjs} +0 -0
  268. /package/{LexicalDecoratorBlockNode.prod.js → dist/LexicalDecoratorBlockNode.prod.js} +0 -0
  269. /package/{LexicalDecoratorBlockNode.prod.mjs → dist/LexicalDecoratorBlockNode.prod.mjs} +0 -0
  270. /package/{LexicalDraggableBlockPlugin.d.ts → dist/LexicalDraggableBlockPlugin.d.ts} +0 -0
  271. /package/{LexicalDraggableBlockPlugin.js → dist/LexicalDraggableBlockPlugin.js} +0 -0
  272. /package/{LexicalDraggableBlockPlugin.js.flow → dist/LexicalDraggableBlockPlugin.js.flow} +0 -0
  273. /package/{LexicalDraggableBlockPlugin.mjs → dist/LexicalDraggableBlockPlugin.mjs} +0 -0
  274. /package/{LexicalDraggableBlockPlugin.node.mjs → dist/LexicalDraggableBlockPlugin.node.mjs} +0 -0
  275. /package/{LexicalEditorRefPlugin.d.ts → dist/LexicalEditorRefPlugin.d.ts} +0 -0
  276. /package/{LexicalEditorRefPlugin.dev.js → dist/LexicalEditorRefPlugin.dev.js} +0 -0
  277. /package/{LexicalEditorRefPlugin.dev.mjs → dist/LexicalEditorRefPlugin.dev.mjs} +0 -0
  278. /package/{LexicalEditorRefPlugin.js → dist/LexicalEditorRefPlugin.js} +0 -0
  279. /package/{LexicalEditorRefPlugin.js.flow → dist/LexicalEditorRefPlugin.js.flow} +0 -0
  280. /package/{LexicalEditorRefPlugin.mjs → dist/LexicalEditorRefPlugin.mjs} +0 -0
  281. /package/{LexicalEditorRefPlugin.node.mjs → dist/LexicalEditorRefPlugin.node.mjs} +0 -0
  282. /package/{LexicalEditorRefPlugin.prod.js → dist/LexicalEditorRefPlugin.prod.js} +0 -0
  283. /package/{LexicalEditorRefPlugin.prod.mjs → dist/LexicalEditorRefPlugin.prod.mjs} +0 -0
  284. /package/{LexicalErrorBoundary.d.ts → dist/LexicalErrorBoundary.d.ts} +0 -0
  285. /package/{LexicalErrorBoundary.dev.js → dist/LexicalErrorBoundary.dev.js} +0 -0
  286. /package/{LexicalErrorBoundary.dev.mjs → dist/LexicalErrorBoundary.dev.mjs} +0 -0
  287. /package/{LexicalErrorBoundary.js → dist/LexicalErrorBoundary.js} +0 -0
  288. /package/{LexicalErrorBoundary.js.flow → dist/LexicalErrorBoundary.js.flow} +0 -0
  289. /package/{LexicalErrorBoundary.mjs → dist/LexicalErrorBoundary.mjs} +0 -0
  290. /package/{LexicalErrorBoundary.node.mjs → dist/LexicalErrorBoundary.node.mjs} +0 -0
  291. /package/{LexicalErrorBoundary.prod.js → dist/LexicalErrorBoundary.prod.js} +0 -0
  292. /package/{LexicalErrorBoundary.prod.mjs → dist/LexicalErrorBoundary.prod.mjs} +0 -0
  293. /package/{LexicalExtensionComponent.dev.js → dist/LexicalExtensionComponent.dev.js} +0 -0
  294. /package/{LexicalExtensionComponent.dev.mjs → dist/LexicalExtensionComponent.dev.mjs} +0 -0
  295. /package/{LexicalExtensionComponent.js → dist/LexicalExtensionComponent.js} +0 -0
  296. /package/{LexicalExtensionComponent.js.flow → dist/LexicalExtensionComponent.js.flow} +0 -0
  297. /package/{LexicalExtensionComponent.mjs → dist/LexicalExtensionComponent.mjs} +0 -0
  298. /package/{LexicalExtensionComponent.node.mjs → dist/LexicalExtensionComponent.node.mjs} +0 -0
  299. /package/{LexicalExtensionComponent.prod.js → dist/LexicalExtensionComponent.prod.js} +0 -0
  300. /package/{LexicalExtensionComponent.prod.mjs → dist/LexicalExtensionComponent.prod.mjs} +0 -0
  301. /package/{LexicalExtensionComposer.d.ts → dist/LexicalExtensionComposer.d.ts} +0 -0
  302. /package/{LexicalExtensionComposer.dev.js → dist/LexicalExtensionComposer.dev.js} +0 -0
  303. /package/{LexicalExtensionComposer.dev.mjs → dist/LexicalExtensionComposer.dev.mjs} +0 -0
  304. /package/{LexicalExtensionComposer.js → dist/LexicalExtensionComposer.js} +0 -0
  305. /package/{LexicalExtensionComposer.js.flow → dist/LexicalExtensionComposer.js.flow} +0 -0
  306. /package/{LexicalExtensionComposer.mjs → dist/LexicalExtensionComposer.mjs} +0 -0
  307. /package/{LexicalExtensionComposer.node.mjs → dist/LexicalExtensionComposer.node.mjs} +0 -0
  308. /package/{LexicalExtensionComposer.prod.js → dist/LexicalExtensionComposer.prod.js} +0 -0
  309. /package/{LexicalExtensionComposer.prod.mjs → dist/LexicalExtensionComposer.prod.mjs} +0 -0
  310. /package/{LexicalExtensionEditorComposer.d.ts → dist/LexicalExtensionEditorComposer.d.ts} +0 -0
  311. /package/{LexicalExtensionEditorComposer.dev.js → dist/LexicalExtensionEditorComposer.dev.js} +0 -0
  312. /package/{LexicalExtensionEditorComposer.dev.mjs → dist/LexicalExtensionEditorComposer.dev.mjs} +0 -0
  313. /package/{LexicalExtensionEditorComposer.js → dist/LexicalExtensionEditorComposer.js} +0 -0
  314. /package/{LexicalExtensionEditorComposer.js.flow → dist/LexicalExtensionEditorComposer.js.flow} +0 -0
  315. /package/{LexicalExtensionEditorComposer.mjs → dist/LexicalExtensionEditorComposer.mjs} +0 -0
  316. /package/{LexicalExtensionEditorComposer.node.mjs → dist/LexicalExtensionEditorComposer.node.mjs} +0 -0
  317. /package/{LexicalExtensionEditorComposer.prod.js → dist/LexicalExtensionEditorComposer.prod.js} +0 -0
  318. /package/{LexicalExtensionEditorComposer.prod.mjs → dist/LexicalExtensionEditorComposer.prod.mjs} +0 -0
  319. /package/{LexicalHashtagPlugin.d.ts → dist/LexicalHashtagPlugin.d.ts} +0 -0
  320. /package/{LexicalHashtagPlugin.dev.js → dist/LexicalHashtagPlugin.dev.js} +0 -0
  321. /package/{LexicalHashtagPlugin.dev.mjs → dist/LexicalHashtagPlugin.dev.mjs} +0 -0
  322. /package/{LexicalHashtagPlugin.js → dist/LexicalHashtagPlugin.js} +0 -0
  323. /package/{LexicalHashtagPlugin.js.flow → dist/LexicalHashtagPlugin.js.flow} +0 -0
  324. /package/{LexicalHashtagPlugin.mjs → dist/LexicalHashtagPlugin.mjs} +0 -0
  325. /package/{LexicalHashtagPlugin.node.mjs → dist/LexicalHashtagPlugin.node.mjs} +0 -0
  326. /package/{LexicalHashtagPlugin.prod.js → dist/LexicalHashtagPlugin.prod.js} +0 -0
  327. /package/{LexicalHashtagPlugin.prod.mjs → dist/LexicalHashtagPlugin.prod.mjs} +0 -0
  328. /package/{LexicalHistoryPlugin.d.ts → dist/LexicalHistoryPlugin.d.ts} +0 -0
  329. /package/{LexicalHistoryPlugin.dev.js → dist/LexicalHistoryPlugin.dev.js} +0 -0
  330. /package/{LexicalHistoryPlugin.dev.mjs → dist/LexicalHistoryPlugin.dev.mjs} +0 -0
  331. /package/{LexicalHistoryPlugin.js → dist/LexicalHistoryPlugin.js} +0 -0
  332. /package/{LexicalHistoryPlugin.js.flow → dist/LexicalHistoryPlugin.js.flow} +0 -0
  333. /package/{LexicalHistoryPlugin.mjs → dist/LexicalHistoryPlugin.mjs} +0 -0
  334. /package/{LexicalHistoryPlugin.node.mjs → dist/LexicalHistoryPlugin.node.mjs} +0 -0
  335. /package/{LexicalHistoryPlugin.prod.js → dist/LexicalHistoryPlugin.prod.js} +0 -0
  336. /package/{LexicalHistoryPlugin.prod.mjs → dist/LexicalHistoryPlugin.prod.mjs} +0 -0
  337. /package/{LexicalHorizontalRuleNode.d.ts → dist/LexicalHorizontalRuleNode.d.ts} +0 -0
  338. /package/{LexicalHorizontalRuleNode.dev.js → dist/LexicalHorizontalRuleNode.dev.js} +0 -0
  339. /package/{LexicalHorizontalRuleNode.dev.mjs → dist/LexicalHorizontalRuleNode.dev.mjs} +0 -0
  340. /package/{LexicalHorizontalRuleNode.js → dist/LexicalHorizontalRuleNode.js} +0 -0
  341. /package/{LexicalHorizontalRuleNode.js.flow → dist/LexicalHorizontalRuleNode.js.flow} +0 -0
  342. /package/{LexicalHorizontalRuleNode.mjs → dist/LexicalHorizontalRuleNode.mjs} +0 -0
  343. /package/{LexicalHorizontalRuleNode.node.mjs → dist/LexicalHorizontalRuleNode.node.mjs} +0 -0
  344. /package/{LexicalHorizontalRuleNode.prod.js → dist/LexicalHorizontalRuleNode.prod.js} +0 -0
  345. /package/{LexicalHorizontalRuleNode.prod.mjs → dist/LexicalHorizontalRuleNode.prod.mjs} +0 -0
  346. /package/{LexicalHorizontalRulePlugin.d.ts → dist/LexicalHorizontalRulePlugin.d.ts} +0 -0
  347. /package/{LexicalHorizontalRulePlugin.dev.js → dist/LexicalHorizontalRulePlugin.dev.js} +0 -0
  348. /package/{LexicalHorizontalRulePlugin.dev.mjs → dist/LexicalHorizontalRulePlugin.dev.mjs} +0 -0
  349. /package/{LexicalHorizontalRulePlugin.js → dist/LexicalHorizontalRulePlugin.js} +0 -0
  350. /package/{LexicalHorizontalRulePlugin.js.flow → dist/LexicalHorizontalRulePlugin.js.flow} +0 -0
  351. /package/{LexicalHorizontalRulePlugin.mjs → dist/LexicalHorizontalRulePlugin.mjs} +0 -0
  352. /package/{LexicalHorizontalRulePlugin.node.mjs → dist/LexicalHorizontalRulePlugin.node.mjs} +0 -0
  353. /package/{LexicalHorizontalRulePlugin.prod.js → dist/LexicalHorizontalRulePlugin.prod.js} +0 -0
  354. /package/{LexicalHorizontalRulePlugin.prod.mjs → dist/LexicalHorizontalRulePlugin.prod.mjs} +0 -0
  355. /package/{LexicalLinkPlugin.d.ts → dist/LexicalLinkPlugin.d.ts} +0 -0
  356. /package/{LexicalLinkPlugin.dev.js → dist/LexicalLinkPlugin.dev.js} +0 -0
  357. /package/{LexicalLinkPlugin.dev.mjs → dist/LexicalLinkPlugin.dev.mjs} +0 -0
  358. /package/{LexicalLinkPlugin.js → dist/LexicalLinkPlugin.js} +0 -0
  359. /package/{LexicalLinkPlugin.js.flow → dist/LexicalLinkPlugin.js.flow} +0 -0
  360. /package/{LexicalLinkPlugin.mjs → dist/LexicalLinkPlugin.mjs} +0 -0
  361. /package/{LexicalLinkPlugin.node.mjs → dist/LexicalLinkPlugin.node.mjs} +0 -0
  362. /package/{LexicalLinkPlugin.prod.js → dist/LexicalLinkPlugin.prod.js} +0 -0
  363. /package/{LexicalLinkPlugin.prod.mjs → dist/LexicalLinkPlugin.prod.mjs} +0 -0
  364. /package/{LexicalListPlugin.d.ts → dist/LexicalListPlugin.d.ts} +0 -0
  365. /package/{LexicalListPlugin.dev.js → dist/LexicalListPlugin.dev.js} +0 -0
  366. /package/{LexicalListPlugin.dev.mjs → dist/LexicalListPlugin.dev.mjs} +0 -0
  367. /package/{LexicalListPlugin.js → dist/LexicalListPlugin.js} +0 -0
  368. /package/{LexicalListPlugin.js.flow → dist/LexicalListPlugin.js.flow} +0 -0
  369. /package/{LexicalListPlugin.mjs → dist/LexicalListPlugin.mjs} +0 -0
  370. /package/{LexicalListPlugin.node.mjs → dist/LexicalListPlugin.node.mjs} +0 -0
  371. /package/{LexicalListPlugin.prod.js → dist/LexicalListPlugin.prod.js} +0 -0
  372. /package/{LexicalListPlugin.prod.mjs → dist/LexicalListPlugin.prod.mjs} +0 -0
  373. /package/{LexicalMarkdownShortcutPlugin.d.ts → dist/LexicalMarkdownShortcutPlugin.d.ts} +0 -0
  374. /package/{LexicalMarkdownShortcutPlugin.dev.js → dist/LexicalMarkdownShortcutPlugin.dev.js} +0 -0
  375. /package/{LexicalMarkdownShortcutPlugin.dev.mjs → dist/LexicalMarkdownShortcutPlugin.dev.mjs} +0 -0
  376. /package/{LexicalMarkdownShortcutPlugin.js → dist/LexicalMarkdownShortcutPlugin.js} +0 -0
  377. /package/{LexicalMarkdownShortcutPlugin.js.flow → dist/LexicalMarkdownShortcutPlugin.js.flow} +0 -0
  378. /package/{LexicalMarkdownShortcutPlugin.mjs → dist/LexicalMarkdownShortcutPlugin.mjs} +0 -0
  379. /package/{LexicalMarkdownShortcutPlugin.node.mjs → dist/LexicalMarkdownShortcutPlugin.node.mjs} +0 -0
  380. /package/{LexicalMarkdownShortcutPlugin.prod.js → dist/LexicalMarkdownShortcutPlugin.prod.js} +0 -0
  381. /package/{LexicalMarkdownShortcutPlugin.prod.mjs → dist/LexicalMarkdownShortcutPlugin.prod.mjs} +0 -0
  382. /package/{LexicalNestedComposer.d.ts → dist/LexicalNestedComposer.d.ts} +0 -0
  383. /package/{LexicalNestedComposer.js → dist/LexicalNestedComposer.js} +0 -0
  384. /package/{LexicalNestedComposer.js.flow → dist/LexicalNestedComposer.js.flow} +0 -0
  385. /package/{LexicalNestedComposer.mjs → dist/LexicalNestedComposer.mjs} +0 -0
  386. /package/{LexicalNestedComposer.node.mjs → dist/LexicalNestedComposer.node.mjs} +0 -0
  387. /package/{LexicalNestedComposer.prod.js → dist/LexicalNestedComposer.prod.js} +0 -0
  388. /package/{LexicalNestedComposer.prod.mjs → dist/LexicalNestedComposer.prod.mjs} +0 -0
  389. /package/{LexicalNodeContextMenuPlugin.d.ts → dist/LexicalNodeContextMenuPlugin.d.ts} +0 -0
  390. /package/{LexicalNodeContextMenuPlugin.dev.js → dist/LexicalNodeContextMenuPlugin.dev.js} +0 -0
  391. /package/{LexicalNodeContextMenuPlugin.dev.mjs → dist/LexicalNodeContextMenuPlugin.dev.mjs} +0 -0
  392. /package/{LexicalNodeContextMenuPlugin.js → dist/LexicalNodeContextMenuPlugin.js} +0 -0
  393. /package/{LexicalNodeContextMenuPlugin.js.flow → dist/LexicalNodeContextMenuPlugin.js.flow} +0 -0
  394. /package/{LexicalNodeContextMenuPlugin.mjs → dist/LexicalNodeContextMenuPlugin.mjs} +0 -0
  395. /package/{LexicalNodeContextMenuPlugin.node.mjs → dist/LexicalNodeContextMenuPlugin.node.mjs} +0 -0
  396. /package/{LexicalNodeContextMenuPlugin.prod.js → dist/LexicalNodeContextMenuPlugin.prod.js} +0 -0
  397. /package/{LexicalNodeContextMenuPlugin.prod.mjs → dist/LexicalNodeContextMenuPlugin.prod.mjs} +0 -0
  398. /package/{LexicalNodeEventPlugin.d.ts → dist/LexicalNodeEventPlugin.d.ts} +0 -0
  399. /package/{LexicalNodeEventPlugin.dev.js → dist/LexicalNodeEventPlugin.dev.js} +0 -0
  400. /package/{LexicalNodeEventPlugin.dev.mjs → dist/LexicalNodeEventPlugin.dev.mjs} +0 -0
  401. /package/{LexicalNodeEventPlugin.js → dist/LexicalNodeEventPlugin.js} +0 -0
  402. /package/{LexicalNodeEventPlugin.js.flow → dist/LexicalNodeEventPlugin.js.flow} +0 -0
  403. /package/{LexicalNodeEventPlugin.mjs → dist/LexicalNodeEventPlugin.mjs} +0 -0
  404. /package/{LexicalNodeEventPlugin.node.mjs → dist/LexicalNodeEventPlugin.node.mjs} +0 -0
  405. /package/{LexicalNodeEventPlugin.prod.js → dist/LexicalNodeEventPlugin.prod.js} +0 -0
  406. /package/{LexicalNodeEventPlugin.prod.mjs → dist/LexicalNodeEventPlugin.prod.mjs} +0 -0
  407. /package/{LexicalNodeMenuPlugin.d.ts → dist/LexicalNodeMenuPlugin.d.ts} +0 -0
  408. /package/{LexicalNodeMenuPlugin.js → dist/LexicalNodeMenuPlugin.js} +0 -0
  409. /package/{LexicalNodeMenuPlugin.js.flow → dist/LexicalNodeMenuPlugin.js.flow} +0 -0
  410. /package/{LexicalNodeMenuPlugin.mjs → dist/LexicalNodeMenuPlugin.mjs} +0 -0
  411. /package/{LexicalNodeMenuPlugin.node.mjs → dist/LexicalNodeMenuPlugin.node.mjs} +0 -0
  412. /package/{LexicalOnChangePlugin.d.ts → dist/LexicalOnChangePlugin.d.ts} +0 -0
  413. /package/{LexicalOnChangePlugin.js → dist/LexicalOnChangePlugin.js} +0 -0
  414. /package/{LexicalOnChangePlugin.js.flow → dist/LexicalOnChangePlugin.js.flow} +0 -0
  415. /package/{LexicalOnChangePlugin.mjs → dist/LexicalOnChangePlugin.mjs} +0 -0
  416. /package/{LexicalOnChangePlugin.node.mjs → dist/LexicalOnChangePlugin.node.mjs} +0 -0
  417. /package/{LexicalPlainTextPlugin.d.ts → dist/LexicalPlainTextPlugin.d.ts} +0 -0
  418. /package/{LexicalPlainTextPlugin.js → dist/LexicalPlainTextPlugin.js} +0 -0
  419. /package/{LexicalPlainTextPlugin.js.flow → dist/LexicalPlainTextPlugin.js.flow} +0 -0
  420. /package/{LexicalPlainTextPlugin.mjs → dist/LexicalPlainTextPlugin.mjs} +0 -0
  421. /package/{LexicalPlainTextPlugin.node.mjs → dist/LexicalPlainTextPlugin.node.mjs} +0 -0
  422. /package/{LexicalReactExtension.dev.js → dist/LexicalReactExtension.dev.js} +0 -0
  423. /package/{LexicalReactExtension.dev.mjs → dist/LexicalReactExtension.dev.mjs} +0 -0
  424. /package/{LexicalReactExtension.js → dist/LexicalReactExtension.js} +0 -0
  425. /package/{LexicalReactExtension.js.flow → dist/LexicalReactExtension.js.flow} +0 -0
  426. /package/{LexicalReactExtension.mjs → dist/LexicalReactExtension.mjs} +0 -0
  427. /package/{LexicalReactExtension.node.mjs → dist/LexicalReactExtension.node.mjs} +0 -0
  428. /package/{LexicalReactExtension.prod.js → dist/LexicalReactExtension.prod.js} +0 -0
  429. /package/{LexicalReactExtension.prod.mjs → dist/LexicalReactExtension.prod.mjs} +0 -0
  430. /package/{LexicalReactPluginHostExtension.dev.js → dist/LexicalReactPluginHostExtension.dev.js} +0 -0
  431. /package/{LexicalReactPluginHostExtension.dev.mjs → dist/LexicalReactPluginHostExtension.dev.mjs} +0 -0
  432. /package/{LexicalReactPluginHostExtension.js → dist/LexicalReactPluginHostExtension.js} +0 -0
  433. /package/{LexicalReactPluginHostExtension.js.flow → dist/LexicalReactPluginHostExtension.js.flow} +0 -0
  434. /package/{LexicalReactPluginHostExtension.mjs → dist/LexicalReactPluginHostExtension.mjs} +0 -0
  435. /package/{LexicalReactPluginHostExtension.node.mjs → dist/LexicalReactPluginHostExtension.node.mjs} +0 -0
  436. /package/{LexicalReactPluginHostExtension.prod.js → dist/LexicalReactPluginHostExtension.prod.js} +0 -0
  437. /package/{LexicalReactPluginHostExtension.prod.mjs → dist/LexicalReactPluginHostExtension.prod.mjs} +0 -0
  438. /package/{LexicalReactProviderExtension.dev.js → dist/LexicalReactProviderExtension.dev.js} +0 -0
  439. /package/{LexicalReactProviderExtension.dev.mjs → dist/LexicalReactProviderExtension.dev.mjs} +0 -0
  440. /package/{LexicalReactProviderExtension.js → dist/LexicalReactProviderExtension.js} +0 -0
  441. /package/{LexicalReactProviderExtension.js.flow → dist/LexicalReactProviderExtension.js.flow} +0 -0
  442. /package/{LexicalReactProviderExtension.mjs → dist/LexicalReactProviderExtension.mjs} +0 -0
  443. /package/{LexicalReactProviderExtension.node.mjs → dist/LexicalReactProviderExtension.node.mjs} +0 -0
  444. /package/{LexicalReactProviderExtension.prod.js → dist/LexicalReactProviderExtension.prod.js} +0 -0
  445. /package/{LexicalReactProviderExtension.prod.mjs → dist/LexicalReactProviderExtension.prod.mjs} +0 -0
  446. /package/{LexicalRichTextPlugin.d.ts → dist/LexicalRichTextPlugin.d.ts} +0 -0
  447. /package/{LexicalRichTextPlugin.js → dist/LexicalRichTextPlugin.js} +0 -0
  448. /package/{LexicalRichTextPlugin.js.flow → dist/LexicalRichTextPlugin.js.flow} +0 -0
  449. /package/{LexicalRichTextPlugin.mjs → dist/LexicalRichTextPlugin.mjs} +0 -0
  450. /package/{LexicalRichTextPlugin.node.mjs → dist/LexicalRichTextPlugin.node.mjs} +0 -0
  451. /package/{LexicalSelectionAlwaysOnDisplay.d.ts → dist/LexicalSelectionAlwaysOnDisplay.d.ts} +0 -0
  452. /package/{LexicalSelectionAlwaysOnDisplay.dev.js → dist/LexicalSelectionAlwaysOnDisplay.dev.js} +0 -0
  453. /package/{LexicalSelectionAlwaysOnDisplay.dev.mjs → dist/LexicalSelectionAlwaysOnDisplay.dev.mjs} +0 -0
  454. /package/{LexicalSelectionAlwaysOnDisplay.js → dist/LexicalSelectionAlwaysOnDisplay.js} +0 -0
  455. /package/{LexicalSelectionAlwaysOnDisplay.js.flow → dist/LexicalSelectionAlwaysOnDisplay.js.flow} +0 -0
  456. /package/{LexicalSelectionAlwaysOnDisplay.mjs → dist/LexicalSelectionAlwaysOnDisplay.mjs} +0 -0
  457. /package/{LexicalSelectionAlwaysOnDisplay.node.mjs → dist/LexicalSelectionAlwaysOnDisplay.node.mjs} +0 -0
  458. /package/{LexicalSelectionAlwaysOnDisplay.prod.js → dist/LexicalSelectionAlwaysOnDisplay.prod.js} +0 -0
  459. /package/{LexicalSelectionAlwaysOnDisplay.prod.mjs → dist/LexicalSelectionAlwaysOnDisplay.prod.mjs} +0 -0
  460. /package/{LexicalTabIndentationPlugin.d.ts → dist/LexicalTabIndentationPlugin.d.ts} +0 -0
  461. /package/{LexicalTabIndentationPlugin.dev.js → dist/LexicalTabIndentationPlugin.dev.js} +0 -0
  462. /package/{LexicalTabIndentationPlugin.dev.mjs → dist/LexicalTabIndentationPlugin.dev.mjs} +0 -0
  463. /package/{LexicalTabIndentationPlugin.js → dist/LexicalTabIndentationPlugin.js} +0 -0
  464. /package/{LexicalTabIndentationPlugin.js.flow → dist/LexicalTabIndentationPlugin.js.flow} +0 -0
  465. /package/{LexicalTabIndentationPlugin.mjs → dist/LexicalTabIndentationPlugin.mjs} +0 -0
  466. /package/{LexicalTabIndentationPlugin.node.mjs → dist/LexicalTabIndentationPlugin.node.mjs} +0 -0
  467. /package/{LexicalTabIndentationPlugin.prod.js → dist/LexicalTabIndentationPlugin.prod.js} +0 -0
  468. /package/{LexicalTabIndentationPlugin.prod.mjs → dist/LexicalTabIndentationPlugin.prod.mjs} +0 -0
  469. /package/{LexicalTableOfContentsPlugin.d.ts → dist/LexicalTableOfContentsPlugin.d.ts} +0 -0
  470. /package/{LexicalTableOfContentsPlugin.dev.js → dist/LexicalTableOfContentsPlugin.dev.js} +0 -0
  471. /package/{LexicalTableOfContentsPlugin.dev.mjs → dist/LexicalTableOfContentsPlugin.dev.mjs} +0 -0
  472. /package/{LexicalTableOfContentsPlugin.js → dist/LexicalTableOfContentsPlugin.js} +0 -0
  473. /package/{LexicalTableOfContentsPlugin.js.flow → dist/LexicalTableOfContentsPlugin.js.flow} +0 -0
  474. /package/{LexicalTableOfContentsPlugin.mjs → dist/LexicalTableOfContentsPlugin.mjs} +0 -0
  475. /package/{LexicalTableOfContentsPlugin.node.mjs → dist/LexicalTableOfContentsPlugin.node.mjs} +0 -0
  476. /package/{LexicalTableOfContentsPlugin.prod.js → dist/LexicalTableOfContentsPlugin.prod.js} +0 -0
  477. /package/{LexicalTableOfContentsPlugin.prod.mjs → dist/LexicalTableOfContentsPlugin.prod.mjs} +0 -0
  478. /package/{LexicalTablePlugin.d.ts → dist/LexicalTablePlugin.d.ts} +0 -0
  479. /package/{LexicalTablePlugin.js → dist/LexicalTablePlugin.js} +0 -0
  480. /package/{LexicalTablePlugin.js.flow → dist/LexicalTablePlugin.js.flow} +0 -0
  481. /package/{LexicalTablePlugin.mjs → dist/LexicalTablePlugin.mjs} +0 -0
  482. /package/{LexicalTablePlugin.node.mjs → dist/LexicalTablePlugin.node.mjs} +0 -0
  483. /package/{LexicalTreeView.d.ts → dist/LexicalTreeView.d.ts} +0 -0
  484. /package/{LexicalTreeView.dev.js → dist/LexicalTreeView.dev.js} +0 -0
  485. /package/{LexicalTreeView.dev.mjs → dist/LexicalTreeView.dev.mjs} +0 -0
  486. /package/{LexicalTreeView.js → dist/LexicalTreeView.js} +0 -0
  487. /package/{LexicalTreeView.js.flow → dist/LexicalTreeView.js.flow} +0 -0
  488. /package/{LexicalTreeView.mjs → dist/LexicalTreeView.mjs} +0 -0
  489. /package/{LexicalTreeView.node.mjs → dist/LexicalTreeView.node.mjs} +0 -0
  490. /package/{LexicalTreeView.prod.js → dist/LexicalTreeView.prod.js} +0 -0
  491. /package/{LexicalTreeView.prod.mjs → dist/LexicalTreeView.prod.mjs} +0 -0
  492. /package/{LexicalTreeViewExtension.dev.js → dist/LexicalTreeViewExtension.dev.js} +0 -0
  493. /package/{LexicalTreeViewExtension.dev.mjs → dist/LexicalTreeViewExtension.dev.mjs} +0 -0
  494. /package/{LexicalTreeViewExtension.js → dist/LexicalTreeViewExtension.js} +0 -0
  495. /package/{LexicalTreeViewExtension.js.flow → dist/LexicalTreeViewExtension.js.flow} +0 -0
  496. /package/{LexicalTreeViewExtension.mjs → dist/LexicalTreeViewExtension.mjs} +0 -0
  497. /package/{LexicalTreeViewExtension.node.mjs → dist/LexicalTreeViewExtension.node.mjs} +0 -0
  498. /package/{LexicalTreeViewExtension.prod.js → dist/LexicalTreeViewExtension.prod.js} +0 -0
  499. /package/{LexicalTreeViewExtension.prod.mjs → dist/LexicalTreeViewExtension.prod.mjs} +0 -0
  500. /package/{LexicalTypeaheadMenuPlugin.d.ts → dist/LexicalTypeaheadMenuPlugin.d.ts} +0 -0
  501. /package/{LexicalTypeaheadMenuPlugin.js → dist/LexicalTypeaheadMenuPlugin.js} +0 -0
  502. /package/{LexicalTypeaheadMenuPlugin.js.flow → dist/LexicalTypeaheadMenuPlugin.js.flow} +0 -0
  503. /package/{LexicalTypeaheadMenuPlugin.mjs → dist/LexicalTypeaheadMenuPlugin.mjs} +0 -0
  504. /package/{LexicalTypeaheadMenuPlugin.node.mjs → dist/LexicalTypeaheadMenuPlugin.node.mjs} +0 -0
  505. /package/{ReactExtension.d.ts → dist/ReactExtension.d.ts} +0 -0
  506. /package/{ReactPluginHostExtension.d.ts → dist/ReactPluginHostExtension.d.ts} +0 -0
  507. /package/{ReactProviderExtension.d.ts → dist/ReactProviderExtension.d.ts} +0 -0
  508. /package/{TreeViewExtension.d.ts → dist/TreeViewExtension.d.ts} +0 -0
  509. /package/{shared → dist/shared}/LegacyDecorators.d.ts +0 -0
  510. /package/{shared → dist/shared}/LexicalContentEditableElement.d.ts +0 -0
  511. /package/{shared → dist/shared}/LexicalMenu.d.ts +0 -0
  512. /package/{shared → dist/shared}/buildEditorComponent.d.ts +0 -0
  513. /package/{shared → dist/shared}/mergeRefs.d.ts +0 -0
  514. /package/{shared → dist/shared}/point.d.ts +0 -0
  515. /package/{shared → dist/shared}/rect.d.ts +0 -0
  516. /package/{shared → dist/shared}/types.d.ts +0 -0
  517. /package/{shared → dist/shared}/useCanShowPlaceholder.d.ts +0 -0
  518. /package/{shared → dist/shared}/useCharacterLimit.d.ts +0 -0
  519. /package/{shared → dist/shared}/useDecorators.d.ts +0 -0
  520. /package/{shared → dist/shared}/useHistory.d.ts +0 -0
  521. /package/{shared → dist/shared}/useList.d.ts +0 -0
  522. /package/{shared → dist/shared}/usePlainTextSetup.d.ts +0 -0
  523. /package/{shared → dist/shared}/useReactDecorators.d.ts +0 -0
  524. /package/{shared → dist/shared}/useRichTextSetup.d.ts +0 -0
  525. /package/{shared → dist/shared}/useYjsCollaboration.d.ts +0 -0
  526. /package/{useExtensionComponent.d.ts → dist/useExtensionComponent.d.ts} +0 -0
  527. /package/{useExtensionSignalValue.d.ts → dist/useExtensionSignalValue.d.ts} +0 -0
  528. /package/{useLexicalEditable.d.ts → dist/useLexicalEditable.d.ts} +0 -0
  529. /package/{useLexicalEditable.js → dist/useLexicalEditable.js} +0 -0
  530. /package/{useLexicalEditable.js.flow → dist/useLexicalEditable.js.flow} +0 -0
  531. /package/{useLexicalEditable.mjs → dist/useLexicalEditable.mjs} +0 -0
  532. /package/{useLexicalEditable.node.mjs → dist/useLexicalEditable.node.mjs} +0 -0
  533. /package/{useLexicalExtensionComponent.dev.js → dist/useLexicalExtensionComponent.dev.js} +0 -0
  534. /package/{useLexicalExtensionComponent.dev.mjs → dist/useLexicalExtensionComponent.dev.mjs} +0 -0
  535. /package/{useLexicalExtensionComponent.js → dist/useLexicalExtensionComponent.js} +0 -0
  536. /package/{useLexicalExtensionComponent.js.flow → dist/useLexicalExtensionComponent.js.flow} +0 -0
  537. /package/{useLexicalExtensionComponent.mjs → dist/useLexicalExtensionComponent.mjs} +0 -0
  538. /package/{useLexicalExtensionComponent.node.mjs → dist/useLexicalExtensionComponent.node.mjs} +0 -0
  539. /package/{useLexicalExtensionComponent.prod.js → dist/useLexicalExtensionComponent.prod.js} +0 -0
  540. /package/{useLexicalExtensionComponent.prod.mjs → dist/useLexicalExtensionComponent.prod.mjs} +0 -0
  541. /package/{useLexicalExtensionSignalValue.dev.js → dist/useLexicalExtensionSignalValue.dev.js} +0 -0
  542. /package/{useLexicalExtensionSignalValue.dev.mjs → dist/useLexicalExtensionSignalValue.dev.mjs} +0 -0
  543. /package/{useLexicalExtensionSignalValue.js → dist/useLexicalExtensionSignalValue.js} +0 -0
  544. /package/{useLexicalExtensionSignalValue.js.flow → dist/useLexicalExtensionSignalValue.js.flow} +0 -0
  545. /package/{useLexicalExtensionSignalValue.mjs → dist/useLexicalExtensionSignalValue.mjs} +0 -0
  546. /package/{useLexicalExtensionSignalValue.node.mjs → dist/useLexicalExtensionSignalValue.node.mjs} +0 -0
  547. /package/{useLexicalExtensionSignalValue.prod.js → dist/useLexicalExtensionSignalValue.prod.js} +0 -0
  548. /package/{useLexicalExtensionSignalValue.prod.mjs → dist/useLexicalExtensionSignalValue.prod.mjs} +0 -0
  549. /package/{useLexicalIsTextContentEmpty.d.ts → dist/useLexicalIsTextContentEmpty.d.ts} +0 -0
  550. /package/{useLexicalIsTextContentEmpty.js → dist/useLexicalIsTextContentEmpty.js} +0 -0
  551. /package/{useLexicalIsTextContentEmpty.js.flow → dist/useLexicalIsTextContentEmpty.js.flow} +0 -0
  552. /package/{useLexicalIsTextContentEmpty.mjs → dist/useLexicalIsTextContentEmpty.mjs} +0 -0
  553. /package/{useLexicalIsTextContentEmpty.node.mjs → dist/useLexicalIsTextContentEmpty.node.mjs} +0 -0
  554. /package/{useLexicalNodeSelection.d.ts → dist/useLexicalNodeSelection.d.ts} +0 -0
  555. /package/{useLexicalNodeSelection.dev.js → dist/useLexicalNodeSelection.dev.js} +0 -0
  556. /package/{useLexicalNodeSelection.dev.mjs → dist/useLexicalNodeSelection.dev.mjs} +0 -0
  557. /package/{useLexicalNodeSelection.js → dist/useLexicalNodeSelection.js} +0 -0
  558. /package/{useLexicalNodeSelection.js.flow → dist/useLexicalNodeSelection.js.flow} +0 -0
  559. /package/{useLexicalNodeSelection.mjs → dist/useLexicalNodeSelection.mjs} +0 -0
  560. /package/{useLexicalNodeSelection.node.mjs → dist/useLexicalNodeSelection.node.mjs} +0 -0
  561. /package/{useLexicalNodeSelection.prod.js → dist/useLexicalNodeSelection.prod.js} +0 -0
  562. /package/{useLexicalNodeSelection.prod.mjs → dist/useLexicalNodeSelection.prod.mjs} +0 -0
  563. /package/{useLexicalSubscription.d.ts → dist/useLexicalSubscription.d.ts} +0 -0
  564. /package/{useLexicalSubscription.js → dist/useLexicalSubscription.js} +0 -0
  565. /package/{useLexicalSubscription.js.flow → dist/useLexicalSubscription.js.flow} +0 -0
  566. /package/{useLexicalSubscription.mjs → dist/useLexicalSubscription.mjs} +0 -0
  567. /package/{useLexicalSubscription.node.mjs → dist/useLexicalSubscription.node.mjs} +0 -0
  568. /package/{useLexicalTextEntity.d.ts → dist/useLexicalTextEntity.d.ts} +0 -0
  569. /package/{useLexicalTextEntity.dev.js → dist/useLexicalTextEntity.dev.js} +0 -0
  570. /package/{useLexicalTextEntity.dev.mjs → dist/useLexicalTextEntity.dev.mjs} +0 -0
  571. /package/{useLexicalTextEntity.js → dist/useLexicalTextEntity.js} +0 -0
  572. /package/{useLexicalTextEntity.js.flow → dist/useLexicalTextEntity.js.flow} +0 -0
  573. /package/{useLexicalTextEntity.mjs → dist/useLexicalTextEntity.mjs} +0 -0
  574. /package/{useLexicalTextEntity.node.mjs → dist/useLexicalTextEntity.node.mjs} +0 -0
  575. /package/{useLexicalTextEntity.prod.js → dist/useLexicalTextEntity.prod.js} +0 -0
  576. /package/{useLexicalTextEntity.prod.mjs → dist/useLexicalTextEntity.prod.mjs} +0 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type {ComponentProps} from 'react';
9
+
10
+ import {useExtensionComponent} from '@lexical/react/useExtensionComponent';
11
+ import {type AnyLexicalExtension, type LexicalExtensionOutput} from 'lexical';
12
+
13
+ /**
14
+ * The lexical:extension prop combined with the props of the given Extension's
15
+ * output Component.
16
+ */
17
+ export type ExtensionComponentProps<Extension extends AnyLexicalExtension> = {
18
+ /** The Extension */ 'lexical:extension': Extension;
19
+ } & ([LexicalExtensionOutput<Extension>] extends [
20
+ {
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- contravariant in props
22
+ Component: infer OutputComponentType extends React.ComponentType<any>;
23
+ },
24
+ ]
25
+ ? /** The Props from the Extension output Component */ Omit<
26
+ ComponentProps<OutputComponentType>,
27
+ 'lexical:extension'
28
+ >
29
+ : never);
30
+
31
+ /**
32
+ * A convenient way to get an Extension's output Component with {@link useExtensionComponent}
33
+ * and construct it in one step.
34
+ *
35
+ * @example
36
+ * Usage
37
+ * ```tsx
38
+ * return (
39
+ * <ExtensionComponent
40
+ * lexical:extension={TreeViewExtension}
41
+ * viewClassName="tree-view-output" />
42
+ * );
43
+ * ```
44
+ *
45
+ * @example
46
+ * Alternative without ExtensionComponent
47
+ * ```tsx
48
+ * const TreeViewComponent = useExtensionComponent(TreeViewExtension);
49
+ * return (<TreeViewComponent viewClassName="tree-view-output" />);
50
+ * ```
51
+ */
52
+ export function ExtensionComponent<Extension extends AnyLexicalExtension>({
53
+ 'lexical:extension': extension,
54
+ ...props
55
+ }: ExtensionComponentProps<Extension>) {
56
+ const Component = useExtensionComponent(extension);
57
+ // eslint-disable-next-line react-hooks/static-components
58
+ return <Component {...props} />;
59
+ }
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import type {
9
+ CommandListenerPriority,
10
+ LexicalNode,
11
+ MutationListener,
12
+ } from 'lexical';
13
+ import type {JSX} from 'react';
14
+
15
+ import {$isLinkNode, AutoLinkNode, LinkNode} from '@lexical/link';
16
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
17
+ import {
18
+ LexicalNodeMenuPlugin,
19
+ MenuOption,
20
+ type MenuRenderFn,
21
+ } from '@lexical/react/LexicalNodeMenuPlugin';
22
+ import {mergeRegister} from '@lexical/utils';
23
+ import {
24
+ $getNodeByKey,
25
+ $getSelection,
26
+ COMMAND_PRIORITY_EDITOR,
27
+ COMMAND_PRIORITY_LOW,
28
+ createCommand,
29
+ LexicalCommand,
30
+ LexicalEditor,
31
+ NodeKey,
32
+ PASTE_TAG,
33
+ TextNode,
34
+ } from 'lexical';
35
+ import {useCallback, useEffect, useMemo, useState} from 'react';
36
+
37
+ export type EmbedMatchResult<TEmbedMatchResult = unknown> = {
38
+ url: string;
39
+ id: string;
40
+ data?: TEmbedMatchResult;
41
+ };
42
+
43
+ export interface EmbedConfig<
44
+ TEmbedMatchResultData = unknown,
45
+ TEmbedMatchResult = EmbedMatchResult<TEmbedMatchResultData>,
46
+ > {
47
+ // Used to identify this config e.g. youtube, tweet, google-maps.
48
+ type: string;
49
+ // Determine if a given URL is a match and return url data.
50
+ parseUrl: (
51
+ text: string,
52
+ ) => Promise<TEmbedMatchResult | null> | TEmbedMatchResult | null;
53
+ // Create the Lexical embed node from the url data.
54
+ insertNode: (editor: LexicalEditor, result: TEmbedMatchResult) => void;
55
+ }
56
+
57
+ export const URL_MATCHER =
58
+ /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/;
59
+
60
+ export const INSERT_EMBED_COMMAND: LexicalCommand<EmbedConfig['type']> =
61
+ createCommand('INSERT_EMBED_COMMAND');
62
+
63
+ export class AutoEmbedOption extends MenuOption {
64
+ title: string;
65
+ onSelect: (targetNode: LexicalNode | null) => void;
66
+ constructor(
67
+ title: string,
68
+ options: {
69
+ onSelect: (targetNode: LexicalNode | null) => void;
70
+ },
71
+ ) {
72
+ super(title);
73
+ this.title = title;
74
+ this.onSelect = options.onSelect.bind(this);
75
+ }
76
+ }
77
+
78
+ type LexicalAutoEmbedPluginProps<TEmbedConfig extends EmbedConfig> = {
79
+ /**
80
+ * An array of configurations used to insert Embed elements
81
+ */
82
+ embedConfigs: TEmbedConfig[];
83
+ /**
84
+ * Callback for handling the {@link INSERT_EMBED_COMMAND} command.
85
+ * If no function is passed, the command is not registered
86
+ * @param embedConfig - the config corresponding to the {@link EmbedConfig.type} of the inserted Embed
87
+ * @returns
88
+ */
89
+ onOpenEmbedModalForConfig?: (embedConfig: TEmbedConfig) => void;
90
+ /**
91
+ * A function that links a specific configuration to a set of options.
92
+ * Each option can be handling by click or press the Enter or Tab key
93
+ * when the cursor hovers over it.
94
+ * Pass the necessary callbacks to {@link AutoEmbedOption.onSelect}
95
+ * @param activeEmbedConfig - the current active config is determined by a match
96
+ * from the {@link EmbedConfig.parseUrl} of the inserted AutoLinkNode
97
+ * @param embedFn - callback for handling option selection.
98
+ * Calling the callback will invoke the {@link EmbedConfig.insertNode} method
99
+ * and remove the inserted AutoLinkNode
100
+ * @param dismissFn - сallback to deselect. Calling the callback will hide the options menu
101
+ * @returns array of options from {@link AutoEmbedOption} instances
102
+ */
103
+ getMenuOptions: (
104
+ activeEmbedConfig: TEmbedConfig,
105
+ embedFn: () => void,
106
+ dismissFn: () => void,
107
+ ) => AutoEmbedOption[];
108
+ /**
109
+ * A function for rendering button menu.
110
+ * By default, it displays a plain list with the option titles
111
+ */
112
+ menuRenderFn?: MenuRenderFn<AutoEmbedOption>;
113
+ /**
114
+ * Priority for key handling in the menu. The default is `COMMAND_PRIORITY_LOW`
115
+ */
116
+ menuCommandPriority?: CommandListenerPriority;
117
+ };
118
+
119
+ /**
120
+ * Watches for pasted AutoLink nodes that match any of the provided embed configurations (e.g., YouTube, Twitter URLs).
121
+ * When a match is found, it shows a menu offering to replace the link with an embedded node.
122
+ *
123
+ * You can pass a generic type to the plugin to extend {@link EmbedConfig}
124
+ * with additional data in {@link EmbedMatchResult} that will be passed to the callbacks
125
+ *
126
+ * @example
127
+ * Usage
128
+ * ```tsx
129
+ * interface CustomEmbedConfig extends EmbedConfig<{
130
+ * domain: string;
131
+ * oid?: string;
132
+ * }> {
133
+ * // Icon for display.
134
+ * icon?: JSX.Element;
135
+ * // Embed a Figma Project.
136
+ * description?: string;
137
+ * };
138
+ *
139
+ * return (
140
+ * <LexicalAutoEmbedPlugin<CustomEmbedConfig>
141
+ * embedConfigs={EmbedConfigs}
142
+ * getMenuOptions={getMenuOptions}
143
+ * />
144
+ * );
145
+ * ```
146
+ */
147
+ export function LexicalAutoEmbedPlugin<TEmbedConfig extends EmbedConfig>({
148
+ embedConfigs,
149
+ onOpenEmbedModalForConfig,
150
+ getMenuOptions,
151
+ menuRenderFn,
152
+ menuCommandPriority = COMMAND_PRIORITY_LOW,
153
+ }: LexicalAutoEmbedPluginProps<TEmbedConfig>): JSX.Element | null {
154
+ const [editor] = useLexicalComposerContext();
155
+
156
+ const [nodeKey, setNodeKey] = useState<NodeKey | null>(null);
157
+ const [activeEmbedConfig, setActiveEmbedConfig] =
158
+ useState<TEmbedConfig | null>(null);
159
+
160
+ const reset = useCallback(() => {
161
+ setNodeKey(null);
162
+ setActiveEmbedConfig(null);
163
+ }, []);
164
+
165
+ const checkIfLinkNodeIsEmbeddable = useCallback(
166
+ async (key: NodeKey) => {
167
+ const url = editor.getEditorState().read(function () {
168
+ const linkNode = $getNodeByKey(key);
169
+ if ($isLinkNode(linkNode)) {
170
+ return linkNode.getURL();
171
+ }
172
+ });
173
+ if (url === undefined) {
174
+ return;
175
+ }
176
+ for (const embedConfig of embedConfigs) {
177
+ const urlMatch = await Promise.resolve(embedConfig.parseUrl(url));
178
+ if (urlMatch != null) {
179
+ setActiveEmbedConfig(embedConfig);
180
+ setNodeKey(key);
181
+ }
182
+ }
183
+ },
184
+ [editor, embedConfigs],
185
+ );
186
+
187
+ useEffect(() => {
188
+ const listener: MutationListener = (
189
+ nodeMutations,
190
+ {updateTags, dirtyLeaves},
191
+ ) => {
192
+ for (const [key, mutation] of nodeMutations) {
193
+ if (
194
+ mutation === 'created' &&
195
+ updateTags.has(PASTE_TAG) &&
196
+ dirtyLeaves.size <= 3
197
+ ) {
198
+ checkIfLinkNodeIsEmbeddable(key);
199
+ } else if (key === nodeKey) {
200
+ reset();
201
+ }
202
+ }
203
+ };
204
+ return mergeRegister(
205
+ ...[LinkNode, AutoLinkNode].map(Klass =>
206
+ editor.registerMutationListener(Klass, (...args) => listener(...args), {
207
+ skipInitialization: true,
208
+ }),
209
+ ),
210
+ );
211
+ }, [checkIfLinkNodeIsEmbeddable, editor, nodeKey, reset]);
212
+
213
+ useEffect(() => {
214
+ if (!onOpenEmbedModalForConfig) return;
215
+
216
+ return editor.registerCommand(
217
+ INSERT_EMBED_COMMAND,
218
+ (embedConfigType: TEmbedConfig['type']) => {
219
+ const embedConfig = embedConfigs.find(
220
+ ({type}) => type === embedConfigType,
221
+ );
222
+ if (embedConfig) {
223
+ onOpenEmbedModalForConfig(embedConfig);
224
+ return true;
225
+ }
226
+ return false;
227
+ },
228
+ COMMAND_PRIORITY_EDITOR,
229
+ );
230
+ }, [editor, embedConfigs, onOpenEmbedModalForConfig]);
231
+
232
+ const embedLinkViaActiveEmbedConfig = useCallback(
233
+ async function () {
234
+ if (activeEmbedConfig != null && nodeKey != null) {
235
+ const linkNode = editor.getEditorState().read(() => {
236
+ const node = $getNodeByKey(nodeKey);
237
+ if ($isLinkNode(node)) {
238
+ return node;
239
+ }
240
+ return null;
241
+ });
242
+
243
+ if ($isLinkNode(linkNode)) {
244
+ const result = await Promise.resolve(
245
+ activeEmbedConfig.parseUrl(linkNode.__url),
246
+ );
247
+ if (result != null) {
248
+ editor.update(() => {
249
+ if (!$getSelection()) {
250
+ linkNode.selectEnd();
251
+ }
252
+ activeEmbedConfig.insertNode(editor, result);
253
+ if (linkNode.isAttached()) {
254
+ linkNode.remove();
255
+ }
256
+ });
257
+ }
258
+ }
259
+ }
260
+ },
261
+ [activeEmbedConfig, editor, nodeKey],
262
+ );
263
+
264
+ const options = useMemo(() => {
265
+ return activeEmbedConfig != null && nodeKey != null
266
+ ? getMenuOptions(activeEmbedConfig, embedLinkViaActiveEmbedConfig, reset)
267
+ : [];
268
+ }, [
269
+ activeEmbedConfig,
270
+ embedLinkViaActiveEmbedConfig,
271
+ getMenuOptions,
272
+ nodeKey,
273
+ reset,
274
+ ]);
275
+
276
+ const onSelectOption = useCallback(
277
+ (
278
+ selectedOption: AutoEmbedOption,
279
+ targetNode: TextNode | null,
280
+ closeMenu: () => void,
281
+ ) => {
282
+ editor.update(() => {
283
+ selectedOption.onSelect(targetNode);
284
+ closeMenu();
285
+ });
286
+ },
287
+ [editor],
288
+ );
289
+
290
+ return nodeKey != null ? (
291
+ <LexicalNodeMenuPlugin<AutoEmbedOption>
292
+ nodeKey={nodeKey}
293
+ onClose={reset}
294
+ onSelectOption={onSelectOption}
295
+ options={options}
296
+ menuRenderFn={menuRenderFn}
297
+ commandPriority={menuCommandPriority}
298
+ />
299
+ ) : null;
300
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
10
+ import {useEffect} from 'react';
11
+
12
+ type Props = {
13
+ defaultSelection?: 'rootStart' | 'rootEnd';
14
+ };
15
+
16
+ export function AutoFocusPlugin({defaultSelection}: Props): null {
17
+ const [editor] = useLexicalComposerContext();
18
+
19
+ useEffect(() => {
20
+ editor.focus(
21
+ () => {
22
+ // If we try and move selection to the same point with setBaseAndExtent, it won't
23
+ // trigger a re-focus on the element. So in the case this occurs, we'll need to correct it.
24
+ // Normally this is fine, Selection API !== Focus API, but fore the intents of the naming
25
+ // of this plugin, which should preserve focus too.
26
+ const activeElement = document.activeElement;
27
+ const rootElement = editor.getRootElement() as HTMLDivElement;
28
+ if (
29
+ rootElement !== null &&
30
+ (activeElement === null || !rootElement.contains(activeElement))
31
+ ) {
32
+ // Note: preventScroll won't work in Webkit.
33
+ rootElement.focus({preventScroll: true});
34
+ }
35
+ },
36
+ {defaultSelection},
37
+ );
38
+ }, [defaultSelection, editor]);
39
+
40
+ return null;
41
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {ChangeHandler, LinkMatcher} from '@lexical/link';
10
+ import type {ElementNode, LexicalEditor} from 'lexical';
11
+ import type {JSX} from 'react';
12
+
13
+ import invariant from '@lexical/internal/invariant';
14
+ import {AutoLinkNode, registerAutoLink} from '@lexical/link';
15
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
16
+ import {useEffect} from 'react';
17
+
18
+ export {
19
+ type ChangeHandler,
20
+ createLinkMatcherWithRegExp,
21
+ type LinkMatcher,
22
+ } from '@lexical/link';
23
+
24
+ function useAutoLink(
25
+ editor: LexicalEditor,
26
+ matchers: Array<LinkMatcher>,
27
+ onChange?: ChangeHandler,
28
+ excludeParents?: Array<(parent: ElementNode) => boolean>,
29
+ ): void {
30
+ useEffect(() => {
31
+ if (!editor.hasNodes([AutoLinkNode])) {
32
+ invariant(
33
+ false,
34
+ 'LexicalAutoLinkPlugin: AutoLinkNode not registered on editor',
35
+ );
36
+ }
37
+ });
38
+ useEffect(() => {
39
+ return registerAutoLink(editor, {
40
+ changeHandlers: onChange ? [onChange] : [],
41
+ excludeParents: excludeParents ?? [],
42
+ matchers,
43
+ });
44
+ }, [editor, matchers, onChange, excludeParents]);
45
+ }
46
+
47
+ export function AutoLinkPlugin({
48
+ matchers,
49
+ onChange,
50
+ excludeParents,
51
+ }: {
52
+ matchers: Array<LinkMatcher>;
53
+ onChange?: ChangeHandler;
54
+ excludeParents?: Array<(parent: ElementNode) => boolean>;
55
+ }): JSX.Element | null {
56
+ const [editor] = useLexicalComposerContext();
57
+
58
+ useAutoLink(editor, matchers, onChange, excludeParents);
59
+
60
+ return null;
61
+ }
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {ElementFormatType, NodeKey} from 'lexical';
10
+ import type {JSX} from 'react';
11
+
12
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
13
+ import {$isDecoratorBlockNode} from '@lexical/react/LexicalDecoratorBlockNode';
14
+ import {useLexicalNodeSelection} from '@lexical/react/useLexicalNodeSelection';
15
+ import {
16
+ $getNearestBlockElementAncestorOrThrow,
17
+ mergeRegister,
18
+ } from '@lexical/utils';
19
+ import {
20
+ $getNodeByKey,
21
+ $getSelection,
22
+ $isNodeSelection,
23
+ $isRangeSelection,
24
+ CLICK_COMMAND,
25
+ COMMAND_PRIORITY_LOW,
26
+ FORMAT_ELEMENT_COMMAND,
27
+ } from 'lexical';
28
+ import * as React from 'react';
29
+ import {ReactNode, useEffect, useRef} from 'react';
30
+
31
+ type Props = Readonly<{
32
+ children: ReactNode;
33
+ format?: ElementFormatType | null;
34
+ nodeKey: NodeKey;
35
+ className: Readonly<{
36
+ base: string;
37
+ focus: string;
38
+ }>;
39
+ }>;
40
+
41
+ export function BlockWithAlignableContents({
42
+ children,
43
+ format,
44
+ nodeKey,
45
+ className,
46
+ }: Props): JSX.Element {
47
+ const [editor] = useLexicalComposerContext();
48
+
49
+ const [isSelected, setSelected, clearSelection] =
50
+ useLexicalNodeSelection(nodeKey);
51
+ const ref = useRef(null);
52
+
53
+ useEffect(() => {
54
+ return mergeRegister(
55
+ editor.registerCommand<ElementFormatType>(
56
+ FORMAT_ELEMENT_COMMAND,
57
+ formatType => {
58
+ if (isSelected) {
59
+ const selection = $getSelection();
60
+
61
+ if ($isNodeSelection(selection)) {
62
+ const node = $getNodeByKey(nodeKey);
63
+
64
+ if ($isDecoratorBlockNode(node)) {
65
+ node.setFormat(formatType);
66
+ }
67
+ } else if ($isRangeSelection(selection)) {
68
+ const nodes = selection.getNodes();
69
+
70
+ for (const node of nodes) {
71
+ if ($isDecoratorBlockNode(node)) {
72
+ node.setFormat(formatType);
73
+ } else {
74
+ const element = $getNearestBlockElementAncestorOrThrow(node);
75
+ element.setFormat(formatType);
76
+ }
77
+ }
78
+ }
79
+
80
+ return true;
81
+ }
82
+
83
+ return false;
84
+ },
85
+ COMMAND_PRIORITY_LOW,
86
+ ),
87
+ editor.registerCommand<MouseEvent>(
88
+ CLICK_COMMAND,
89
+ event => {
90
+ if (event.target === ref.current) {
91
+ event.preventDefault();
92
+ if (!event.shiftKey) {
93
+ clearSelection();
94
+ }
95
+
96
+ setSelected(!isSelected);
97
+ return true;
98
+ }
99
+
100
+ return false;
101
+ },
102
+ COMMAND_PRIORITY_LOW,
103
+ ),
104
+ );
105
+ }, [clearSelection, editor, isSelected, nodeKey, setSelected]);
106
+
107
+ return (
108
+ <div
109
+ className={[className.base, isSelected ? className.focus : null]
110
+ .filter(Boolean)
111
+ .join(' ')}
112
+ ref={ref}
113
+ style={{
114
+ textAlign: format ? format : undefined,
115
+ }}>
116
+ {children}
117
+ </div>
118
+ );
119
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import type {JSX} from 'react';
10
+
11
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
12
+ import * as React from 'react';
13
+ import {useMemo, useState} from 'react';
14
+
15
+ import {useCharacterLimit} from './shared/useCharacterLimit';
16
+
17
+ const CHARACTER_LIMIT = 5;
18
+ let textEncoderInstance: null | TextEncoder = null;
19
+
20
+ function textEncoder(): null | TextEncoder {
21
+ if (window.TextEncoder === undefined) {
22
+ return null;
23
+ }
24
+
25
+ if (textEncoderInstance === null) {
26
+ textEncoderInstance = new window.TextEncoder();
27
+ }
28
+
29
+ return textEncoderInstance;
30
+ }
31
+
32
+ function utf8Length(text: string) {
33
+ const currentTextEncoder = textEncoder();
34
+
35
+ if (currentTextEncoder === null) {
36
+ // http://stackoverflow.com/a/5515960/210370
37
+ const m = encodeURIComponent(text).match(/%[89ABab]/g);
38
+ return text.length + (m ? m.length : 0);
39
+ }
40
+
41
+ return currentTextEncoder.encode(text).length;
42
+ }
43
+
44
+ function DefaultRenderer({remainingCharacters}: {remainingCharacters: number}) {
45
+ return (
46
+ <span
47
+ className={`characters-limit ${
48
+ remainingCharacters < 0 ? 'characters-limit-exceeded' : ''
49
+ }`}>
50
+ {remainingCharacters}
51
+ </span>
52
+ );
53
+ }
54
+
55
+ export function CharacterLimitPlugin({
56
+ charset = 'UTF-16',
57
+ maxLength = CHARACTER_LIMIT,
58
+ renderer = DefaultRenderer,
59
+ }: {
60
+ charset: 'UTF-8' | 'UTF-16';
61
+ maxLength: number;
62
+ renderer?: ({
63
+ remainingCharacters,
64
+ }: {
65
+ remainingCharacters: number;
66
+ }) => JSX.Element;
67
+ }): JSX.Element {
68
+ const [editor] = useLexicalComposerContext();
69
+
70
+ const [remainingCharacters, setRemainingCharacters] = useState(maxLength);
71
+
72
+ const characterLimitProps = useMemo(
73
+ () => ({
74
+ remainingCharacters: setRemainingCharacters,
75
+ strlen: (text: string) => {
76
+ if (charset === 'UTF-8') {
77
+ return utf8Length(text);
78
+ } else if (charset === 'UTF-16') {
79
+ return text.length;
80
+ } else {
81
+ throw new Error('Unrecognized charset');
82
+ }
83
+ },
84
+ }),
85
+ [charset],
86
+ );
87
+
88
+ useCharacterLimit(editor, maxLength, characterLimitProps);
89
+
90
+ return renderer({remainingCharacters});
91
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import {registerCheckList} from '@lexical/list';
10
+ import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
11
+ import {useEffect} from 'react';
12
+
13
+ export function CheckListPlugin({
14
+ disableTakeFocusOnClick = false,
15
+ }: {
16
+ disableTakeFocusOnClick?: boolean;
17
+ }): null {
18
+ const [editor] = useLexicalComposerContext();
19
+
20
+ useEffect(() => {
21
+ return registerCheckList(editor, {disableTakeFocusOnClick});
22
+ }, [editor, disableTakeFocusOnClick]);
23
+ return null;
24
+ }