@lexical/react 0.44.1-nightly.20260519.0 → 0.45.1-dev.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,9 @@
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
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),n=require("react"),l=require("@lexical/utils"),o=require("react-dom"),r=require("react/jsx-runtime");const i=t.CAN_USE_DOM?n.useLayoutEffect:n.useEffect;const s=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function u(e,t){const n=e.getBoundingClientRect(),l=t.getBoundingClientRect();return n.top>=l.top-6&&n.top<=l.bottom+6}function c(t,l,o,r){const[i]=e.useLexicalComposerContext();n.useEffect(()=>{if(null!=l&&null!=t){const e=i.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,l=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&l.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let n=!1,s=u(l,t);const c=function(){n||(window.requestAnimationFrame(function(){o(),n=!1}),n=!0);const e=u(l,t);e!==s&&(s=e,null!=r&&r(e))},a=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",c,{capture:!0,passive:!0}),a.observe(l),()=>{a.unobserve(l),window.removeEventListener("resize",o),document.removeEventListener("scroll",c,!0)}}},[l,i,r,o,t])}const a=t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function d({index:e,isSelected:t,onClick:n,onMouseEnter:l,option:o}){let i="item";return t&&(i+=" selected"),r.jsxs("li",{tabIndex:-1,className:i,ref:o.setRefElement,role:"option","aria-selected":t,id:"typeahead-item-"+e,onMouseEnter:l,onClick:n,children:[o.icon,r.jsx("span",{className:"text",children:o.title})]},o.key)}function m({close:e,editor:u,anchorElementRef:c,resolution:m,options:p,menuRenderFn:f,onSelectOption:g,shouldSplitNodeWithQuery:h=!1,commandPriority:C=t.COMMAND_PRIORITY_LOW,preselectFirstItem:E=!0}){const[y,x]=n.useState(null),b=null!==y?Math.min(p.length-1,y):null,R=m.match&&m.match.matchingString;n.useEffect(()=>{E&&x(0)},[R,E]);const v=n.useCallback(n=>{u.update(()=>{const l=null!=m.match&&h?function(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!n.isCollapsed())return null;const l=n.anchor;if("text"!==l.type)return null;const o=l.getNode();if(!o.isSimpleText())return null;const r=l.offset,i=o.getTextContent().slice(0,r),s=e.replaceableString.length,u=r-function(e,t,n){let l=n;for(let n=l;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(l=n);return l}(i,e.matchingString,s);if(u<0)return null;let c;return 0===u?[c]=o.splitText(r):[,c]=o.splitText(u,r),c}(m.match):null;g(n,l,e,m.match?m.match.matchingString:"")})},[u,h,m.match,g,e]),O=n.useCallback(e=>{const t=u.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),x(e))},[u]),w=n.useCallback(()=>c.current&&p.length?o.createPortal(r.jsx("div",{className:"typeahead-popover mentions-menu",children:r.jsx("ul",{children:p.map((e,t)=>r.jsx(d,{index:t,isSelected:b===t,onClick:()=>{x(t),v(e)},onMouseEnter:()=>{x(t)},option:e},e.key))})}),c.current):null,[c,p,b,v,x]);n.useEffect(()=>()=>{const e=u.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[u]),i(()=>{null===p?x(null):null===b&&E&&O(0)},[p,b,O,E]),n.useEffect(()=>l.mergeRegister(u.registerCommand(a,({option:e})=>!(!e.ref||null==e.ref.current)&&(s(e.ref.current),!0),C)),[u,O,C]),n.useEffect(()=>l.mergeRegister(u.registerCommand(t.KEY_ARROW_DOWN_COMMAND,e=>{const t=e;if(null!==p&&p.length){const e=null===b?0:b!==p.length-1?b+1:0;O(e);const n=p[e];if(!n)return O(-1),t.preventDefault(),t.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&u.dispatchCommand(a,{index:e,option:n}),t.preventDefault(),t.stopImmediatePropagation()}return!0},C),u.registerCommand(t.KEY_ARROW_UP_COMMAND,e=>{const t=e;if(null!==p&&p.length){const e=null===b?p.length-1:0!==b?b-1:p.length-1;O(e);const n=p[e];if(!n)return O(-1),t.preventDefault(),t.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&s(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0},C),u.registerCommand(t.KEY_ESCAPE_COMMAND,t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0},C),u.registerCommand(t.KEY_TAB_COMMAND,e=>{const t=e;return null!==p&&null!==b&&null!=p[b]&&(t.preventDefault(),t.stopImmediatePropagation(),v(p[b]),!0)},C),u.registerCommand(t.KEY_ENTER_COMMAND,e=>!(null===p||null===b||null==p[b]||e&&e.shiftKey)&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),v(p[b]),!0),C)),[v,e,u,p,b,O,C]);const A=n.useMemo(()=>({options:p,selectOptionAndCleanUp:v,selectedIndex:b,setHighlightedIndex:x}),[v,b,p]);return null!=f?f(c,A,m.match?m.match.matchingString:""):w()}function p(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}const f="startTransition";exports.LexicalNodeMenuPlugin=function({options:l,nodeKey:o,onClose:i,onOpen:s,onSelectOption:u,menuRenderFn:a,anchorClassName:d,commandPriority:g=t.COMMAND_PRIORITY_LOW,parent:h}){const[C]=e.useLexicalComposerContext(),[E,y]=n.useState(null),x=function(l,o,r,i=(t.CAN_USE_DOM?document.body:void 0),s=!0){const[u]=e.useLexicalComposerContext(),a=t.CAN_USE_DOM?document.createElement("div"):null,d=n.useRef(a),m=n.useCallback(()=>{if(null===d.current||void 0===i)return;d.current.style.top=d.current.style.bottom;const e=u.getRootElement(),t=d.current,n=t.firstChild;if(null!==e&&null!==l){const{left:o,top:u,width:c,height:a}=l.getRect(),m=d.current.offsetHeight;if(t.style.top=`${u+m+3+(s?window.pageYOffset:0)}px`,t.style.left=`${o+window.pageXOffset}px`,t.style.height=`${a}px`,t.style.width=`${c}px`,null!==n){n.style.top=`${u}`;const l=n.getBoundingClientRect(),r=l.height,i=l.width,c=e.getBoundingClientRect();o+i>c.right&&(t.style.left=`${c.right-i+window.pageXOffset}px`),(u+r>window.innerHeight||u+r>c.bottom)&&u-c.top>r+a&&(t.style.top=`${u-r-a+(s?window.pageYOffset:0)}px`)}t.isConnected||(p(t,r),i.append(t)),t.setAttribute("id","typeahead-menu"),e.setAttribute("aria-controls","typeahead-menu")}},[u,l,s,r,i]);n.useEffect(()=>{const e=u.getRootElement();return null!==l&&m(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=d.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[u,m,l]);const f=n.useCallback(e=>{null!==l&&(e||o(null))},[l,o]);return c(l,d.current,m,f),null!=a&&a===d.current&&(p(a,r),null!=i&&i.append(a)),d}(E,y,d,h),b=n.useCallback(()=>{y(null),null!=i&&null!==E&&i()},[i,E]),R=n.useCallback(e=>{y(e),null!=s&&null===E&&s(e)},[s,E]),v=n.useCallback(()=>{o?C.update(()=>{const e=t.$getNodeByKey(o),l=C.getElementByKey(o);var r;null!=e&&null!=l&&null==E&&(r=()=>R({getRect:()=>l.getBoundingClientRect()}),f in n?n[f](r):r())}):null==o&&null!=E&&b()},[b,C,o,R,E]);return n.useEffect(()=>{v()},[v,o]),n.useEffect(()=>{if(null!=o)return C.registerUpdateListener(({dirtyElements:e})=>{e.get(o)&&v()})},[C,v,o]),null===x.current||null===E||null===C?null:r.jsx(m,{close:b,resolution:E,editor:C,anchorElementRef:x,options:l,menuRenderFn:a,onSelectOption:u,commandPriority:g})},exports.MenuOption=class{key;ref;icon;title;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}};
@@ -0,0 +1,9 @@
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 as e}from"@lexical/react/LexicalComposerContext";import{CAN_USE_DOM as t,createCommand as n,COMMAND_PRIORITY_LOW as o,KEY_ARROW_DOWN_COMMAND as l,KEY_ARROW_UP_COMMAND as r,KEY_ESCAPE_COMMAND as i,KEY_TAB_COMMAND as s,KEY_ENTER_COMMAND as u,$getSelection as c,$isRangeSelection as a,$getNodeByKey as m}from"lexical";import d,{useLayoutEffect as p,useEffect as f,useRef as g,useCallback as h,useState as y,useMemo as v}from"react";import{mergeRegister as b}from"@lexical/utils";import C from"react-dom";import{jsx as w,jsxs as x}from"react/jsx-runtime";const E=t?p:f;class R{key;ref;icon;title;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const I=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function O(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return n.top>=o.top-6&&n.top<=o.bottom+6}function S(t,n,o,l){const[r]=e();f(()=>{if(null!=n&&null!=t){const e=r.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,o=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let l=e;l=l.parentElement;)if(t=getComputedStyle(l),(!n||"static"!==t.position)&&o.test(t.overflow+t.overflowY+t.overflowX))return l;return document.body}(e):document.body;let i=!1,s=O(n,t);const u=function(){i||(window.requestAnimationFrame(function(){o(),i=!1}),i=!0);const e=O(n,t);e!==s&&(s=e,null!=l&&l(e))},c=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",u,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",u,!0)}}},[n,r,l,o,t])}const A=n("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function P({index:e,isSelected:t,onClick:n,onMouseEnter:o,option:l}){let r="item";return t&&(r+=" selected"),x("li",{tabIndex:-1,className:r,ref:l.setRefElement,role:"option","aria-selected":t,id:"typeahead-item-"+e,onMouseEnter:o,onClick:n,children:[l.icon,w("span",{className:"text",children:l.title})]},l.key)}function k({close:e,editor:t,anchorElementRef:n,resolution:m,options:d,menuRenderFn:p,onSelectOption:g,shouldSplitNodeWithQuery:x=!1,commandPriority:R=o,preselectFirstItem:O=!0}){const[S,k]=y(null),N=null!==S?Math.min(d.length-1,S):null,D=m.match&&m.match.matchingString;f(()=>{O&&k(0)},[D,O]);const T=h(n=>{t.update(()=>{const t=null!=m.match&&x?function(e){const t=c();if(!a(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const o=n.getNode();if(!o.isSimpleText())return null;const l=n.offset,r=o.getTextContent().slice(0,l),i=e.replaceableString.length,s=l-function(e,t,n){let o=n;for(let n=o;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(o=n);return o}(r,e.matchingString,i);if(s<0)return null;let u;return 0===s?[u]=o.splitText(l):[,u]=o.splitText(s,l),u}(m.match):null;g(n,t,e,m.match?m.match.matchingString:"")})},[t,x,m.match,g,e]),B=h(e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),k(e))},[t]),L=h(()=>n.current&&d.length?C.createPortal(w("div",{className:"typeahead-popover mentions-menu",children:w("ul",{children:d.map((e,t)=>w(P,{index:t,isSelected:N===t,onClick:()=>{k(t),T(e)},onMouseEnter:()=>{k(t)},option:e},e.key))})}),n.current):null,[n,d,N,T,k]);f(()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[t]),E(()=>{null===d?k(null):null===N&&O&&B(0)},[d,N,B,O]),f(()=>b(t.registerCommand(A,({option:e})=>!(!e.ref||null==e.ref.current)&&(I(e.ref.current),!0),R)),[t,B,R]),f(()=>b(t.registerCommand(l,e=>{const n=e;if(null!==d&&d.length){const e=null===N?0:N!==d.length-1?N+1:0;B(e);const o=d[e];if(!o)return B(-1),n.preventDefault(),n.stopImmediatePropagation(),!0;o.ref&&o.ref.current&&t.dispatchCommand(A,{index:e,option:o}),n.preventDefault(),n.stopImmediatePropagation()}return!0},R),t.registerCommand(r,e=>{const t=e;if(null!==d&&d.length){const e=null===N?d.length-1:0!==N?N-1:d.length-1;B(e);const n=d[e];if(!n)return B(-1),t.preventDefault(),t.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&I(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0},R),t.registerCommand(i,t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0},R),t.registerCommand(s,e=>{const t=e;return null!==d&&null!==N&&null!=d[N]&&(t.preventDefault(),t.stopImmediatePropagation(),T(d[N]),!0)},R),t.registerCommand(u,e=>!(null===d||null===N||null==d[N]||e&&e.shiftKey)&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),T(d[N]),!0),R)),[T,e,t,d,N,B,R]);const $=v(()=>({options:d,selectOptionAndCleanUp:T,selectedIndex:N,setHighlightedIndex:k}),[T,N,d]);return null!=p?p(n,$,m.match?m.match.matchingString:""):L()}function N(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}const D="startTransition";function T({options:n,nodeKey:l,onClose:r,onOpen:i,onSelectOption:s,menuRenderFn:u,anchorClassName:c,commandPriority:a=o,parent:p}){const[v]=e(),[b,C]=y(null),x=function(n,o,l,r=(t?document.body:void 0),i=!0){const[s]=e(),u=t?document.createElement("div"):null,c=g(u),a=h(()=>{if(null===c.current||void 0===r)return;c.current.style.top=c.current.style.bottom;const e=s.getRootElement(),t=c.current,o=t.firstChild;if(null!==e&&null!==n){const{left:s,top:u,width:a,height:m}=n.getRect(),d=c.current.offsetHeight;if(t.style.top=`${u+d+3+(i?window.pageYOffset:0)}px`,t.style.left=`${s+window.pageXOffset}px`,t.style.height=`${m}px`,t.style.width=`${a}px`,null!==o){o.style.top=`${u}`;const n=o.getBoundingClientRect(),l=n.height,r=n.width,c=e.getBoundingClientRect();s+r>c.right&&(t.style.left=`${c.right-r+window.pageXOffset}px`),(u+l>window.innerHeight||u+l>c.bottom)&&u-c.top>l+m&&(t.style.top=`${u-l-m+(i?window.pageYOffset:0)}px`)}t.isConnected||(N(t,l),r.append(t)),t.setAttribute("id","typeahead-menu"),e.setAttribute("aria-controls","typeahead-menu")}},[s,n,i,l,r]);f(()=>{const e=s.getRootElement();return null!==n&&a(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=c.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[s,a,n]);const m=h(e=>{null!==n&&(e||o(null))},[n,o]);return S(n,c.current,a,m),null!=u&&u===c.current&&(N(u,l),null!=r&&r.append(u)),c}(b,C,c,p),E=h(()=>{C(null),null!=r&&null!==b&&r()},[r,b]),R=h(e=>{C(e),null!=i&&null===b&&i(e)},[i,b]),I=h(()=>{l?v.update(()=>{const e=m(l),t=v.getElementByKey(l);var n;null!=e&&null!=t&&null==b&&(n=()=>R({getRect:()=>t.getBoundingClientRect()}),D in d?d[D](n):n())}):null==l&&null!=b&&E()},[E,v,l,R,b]);return f(()=>{I()},[I,l]),f(()=>{if(null!=l)return v.registerUpdateListener(({dirtyElements:e})=>{e.get(l)&&I()})},[v,I,l]),null===x.current||null===b||null===v?null:w(k,{close:E,resolution:b,editor:v,anchorElementRef:x,options:n,menuRenderFn:u,onSelectOption:s,commandPriority:a})}export{T as LexicalNodeMenuPlugin,R as MenuOption};
@@ -12,16 +12,6 @@ var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
12
12
  var lexical = require('lexical');
13
13
  var react = require('react');
14
14
 
15
- /**
16
- * Copyright (c) Meta Platforms, Inc. and affiliates.
17
- *
18
- * This source code is licensed under the MIT license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- *
21
- */
22
-
23
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
24
-
25
15
  /**
26
16
  * Copyright (c) Meta Platforms, Inc. and affiliates.
27
17
  *
@@ -34,7 +24,7 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
34
24
  // This workaround is no longer necessary in React 19,
35
25
  // but we currently support React >=17.x
36
26
  // https://github.com/facebook/react/pull/26395
37
- const useLayoutEffectImpl = CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
27
+ const useLayoutEffectImpl = lexical.CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
38
28
 
39
29
  /**
40
30
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -7,19 +7,9 @@
7
7
  */
8
8
 
9
9
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
10
- import { HISTORY_MERGE_TAG } from 'lexical';
10
+ import { CAN_USE_DOM, HISTORY_MERGE_TAG } from 'lexical';
11
11
  import { useLayoutEffect, useEffect } from 'react';
12
12
 
13
- /**
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- *
19
- */
20
-
21
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
22
-
23
13
  /**
24
14
  * Copyright (c) Meta Platforms, Inc. and affiliates.
25
15
  *
@@ -0,0 +1,9 @@
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
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),r=require("react");const i=t.CAN_USE_DOM?r.useLayoutEffect:r.useEffect;exports.OnChangePlugin=function({ignoreHistoryMergeTagChange:r=!0,ignoreSelectionChange:n=!1,onChange:s}){const[a]=e.useLexicalComposerContext();return i(()=>{if(s)return a.registerUpdateListener(({editorState:e,dirtyElements:i,dirtyLeaves:o,prevEditorState:c,tags:u})=>{n&&0===i.size&&0===o.size||r&&u.has(t.HISTORY_MERGE_TAG)||c.isEmpty()||s(e,a,u)})},[a,r,n,s]),null};
@@ -0,0 +1,9 @@
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 as e}from"@lexical/react/LexicalComposerContext";import{CAN_USE_DOM as t,HISTORY_MERGE_TAG as r}from"lexical";import{useLayoutEffect as i,useEffect as o}from"react";const n=t?i:o;function a({ignoreHistoryMergeTagChange:t=!0,ignoreSelectionChange:i=!1,onChange:o}){const[a]=e();return n(()=>{if(o)return a.registerUpdateListener(({editorState:e,dirtyElements:n,dirtyLeaves:s,prevEditorState:c,tags:g})=>{i&&0===n.size&&0===s.size||t&&g.has(r)||c.isEmpty()||o(e,a,g)})},[a,t,i,o]),null}export{a as OnChangePlugin};
@@ -14,6 +14,7 @@ var extension = require('@lexical/extension');
14
14
  var ReactProviderExtension = require('@lexical/react/ReactProviderExtension');
15
15
  var react = require('react');
16
16
  var reactDom = require('react-dom');
17
+ var lexical = require('lexical');
17
18
  var jsxRuntime = require('react/jsx-runtime');
18
19
  var text = require('@lexical/text');
19
20
  var utils = require('@lexical/utils');
@@ -34,16 +35,6 @@ function formatDevErrorMessage(message) {
34
35
  throw new Error(message);
35
36
  }
36
37
 
37
- /**
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- *
43
- */
44
-
45
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
46
-
47
38
  /**
48
39
  * Copyright (c) Meta Platforms, Inc. and affiliates.
49
40
  *
@@ -56,7 +47,7 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
56
47
  // This workaround is no longer necessary in React 19,
57
48
  // but we currently support React >=17.x
58
49
  // https://github.com/facebook/react/pull/26395
59
- const useLayoutEffectImpl = CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
50
+ const useLayoutEffectImpl = lexical.CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
60
51
 
61
52
  /**
62
53
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -12,6 +12,7 @@ import { LexicalBuilder } from '@lexical/extension';
12
12
  import { ReactProviderExtension } from '@lexical/react/ReactProviderExtension';
13
13
  import { useLayoutEffect, useEffect, useState, useMemo, Suspense } from 'react';
14
14
  import { flushSync, createPortal } from 'react-dom';
15
+ import { CAN_USE_DOM } from 'lexical';
15
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
17
  import { $canShowPlaceholderCurry } from '@lexical/text';
17
18
  import { mergeRegister } from '@lexical/utils';
@@ -32,16 +33,6 @@ function formatDevErrorMessage(message) {
32
33
  throw new Error(message);
33
34
  }
34
35
 
35
- /**
36
- * Copyright (c) Meta Platforms, Inc. and affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- *
41
- */
42
-
43
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
44
-
45
36
  /**
46
37
  * Copyright (c) Meta Platforms, Inc. and affiliates.
47
38
  *
@@ -0,0 +1,9 @@
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
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),a=require("lexical"),c=require("react/jsx-runtime"),l=require("@lexical/text"),s=require("@lexical/utils"),u=require("@lexical/dragon"),x=require("@lexical/plain-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const f=a.CAN_USE_DOM?o.useLayoutEffect:o.useEffect;function g({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState(()=>e.getDecorators());return f(()=>e.registerDecoratorListener(e=>{i.flushSync(()=>{n(e)})}),[e]),o.useEffect(()=>{n(e.getDecorators())},[e]),o.useMemo(()=>{const n=[],a=Object.keys(t);for(let l=0;l<a.length;l++){const s=a[l],u=c.jsx(r,{onError:r=>e._onError(r),children:c.jsx(o.Suspense,{fallback:null,children:t[s]})}),x=e.getElementByKey(s);null!==x&&n.push(i.createPortal(u,x,s))}return n},[r,t,e])}(e,r)}function E({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:c.jsx(g,{editor:e,ErrorBoundary:r})}function m(e){return e.getEditorState().read(l.$canShowPlaceholderCurry(e.isComposing()))}function p({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState(()=>m(e));return f(()=>{function r(){const r=m(e);t(r)}return r(),s.mergeRegister(e.registerUpdateListener(()=>{r()}),e.registerEditableListener(()=>{r()}))},[e]),r}(n),a=r.useLexicalEditable();return i?"function"==typeof t?t(a):t:null}exports.PlainTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){f(()=>s.mergeRegister(x.registerPlainText(e),u.registerDragonSupport(e)),[e])}(o),c.jsxs(c.Fragment,{children:[r,c.jsx(p,{content:t}),c.jsx(E,{editor:o,ErrorBoundary:n})]})};
@@ -0,0 +1,9 @@
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 as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as l,Suspense as a}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{CAN_USE_DOM as f}from"lexical";import{jsx as m,jsxs as d,Fragment as p}from"react/jsx-runtime";import{$canShowPlaceholderCurry as x}from"@lexical/text";import{mergeRegister as E}from"@lexical/utils";import{registerDragonSupport as h}from"@lexical/dragon";import{registerPlainText as g}from"@lexical/plain-text";function y(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const B=f?n:i;function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c(()=>r.getDecorators());return B(()=>r.registerDecoratorListener(r=>{s(()=>{o(r)})}),[r]),i(()=>{o(r.getDecorators())},[r]),l(()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],l=m(e,{onError:e=>r._onError(e),children:m(a,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(l,s,c))}return o},[e,t,r])}(r,e)}function b({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:m(L,{editor:r,ErrorBoundary:e})}function v(r){return r.getEditorState().read(x(r.isComposing()))}function w({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){B(()=>E(g(r),h(r)),[r])}(n),d(p,{children:[e,m(S,{content:t}),m(b,{editor:n,ErrorBoundary:o})]})}function S({content:t}){const[o]=r(),n=function(r){const[e,t]=c(()=>v(r));return B(()=>{function e(){const e=v(r);t(e)}return e(),E(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{w as PlainTextPlugin};
@@ -14,6 +14,7 @@ var extension = require('@lexical/extension');
14
14
  var ReactProviderExtension = require('@lexical/react/ReactProviderExtension');
15
15
  var react = require('react');
16
16
  var reactDom = require('react-dom');
17
+ var lexical = require('lexical');
17
18
  var jsxRuntime = require('react/jsx-runtime');
18
19
  var text = require('@lexical/text');
19
20
  var utils = require('@lexical/utils');
@@ -34,16 +35,6 @@ function formatDevErrorMessage(message) {
34
35
  throw new Error(message);
35
36
  }
36
37
 
37
- /**
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- *
43
- */
44
-
45
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
46
-
47
38
  /**
48
39
  * Copyright (c) Meta Platforms, Inc. and affiliates.
49
40
  *
@@ -56,7 +47,7 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
56
47
  // This workaround is no longer necessary in React 19,
57
48
  // but we currently support React >=17.x
58
49
  // https://github.com/facebook/react/pull/26395
59
- const useLayoutEffectImpl = CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
50
+ const useLayoutEffectImpl = lexical.CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
60
51
 
61
52
  /**
62
53
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -12,6 +12,7 @@ import { LexicalBuilder } from '@lexical/extension';
12
12
  import { ReactProviderExtension } from '@lexical/react/ReactProviderExtension';
13
13
  import { useLayoutEffect, useEffect, useState, useMemo, Suspense } from 'react';
14
14
  import { flushSync, createPortal } from 'react-dom';
15
+ import { CAN_USE_DOM } from 'lexical';
15
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
16
17
  import { $canShowPlaceholderCurry } from '@lexical/text';
17
18
  import { mergeRegister } from '@lexical/utils';
@@ -32,16 +33,6 @@ function formatDevErrorMessage(message) {
32
33
  throw new Error(message);
33
34
  }
34
35
 
35
- /**
36
- * Copyright (c) Meta Platforms, Inc. and affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- *
41
- */
42
-
43
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
44
-
45
36
  /**
46
37
  * Copyright (c) Meta Platforms, Inc. and affiliates.
47
38
  *
@@ -0,0 +1,9 @@
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
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),c=require("lexical"),a=require("react/jsx-runtime"),s=require("@lexical/text"),l=require("@lexical/utils"),u=require("@lexical/dragon"),x=require("@lexical/rich-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const f=c.CAN_USE_DOM?o.useLayoutEffect:o.useEffect;function g({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState(()=>e.getDecorators());return f(()=>e.registerDecoratorListener(e=>{i.flushSync(()=>{n(e)})}),[e]),o.useEffect(()=>{n(e.getDecorators())},[e]),o.useMemo(()=>{const n=[],c=Object.keys(t);for(let s=0;s<c.length;s++){const l=c[s],u=a.jsx(r,{onError:r=>e._onError(r),children:a.jsx(o.Suspense,{fallback:null,children:t[l]})}),x=e.getElementByKey(l);null!==x&&n.push(i.createPortal(u,x,l))}return n},[r,t,e])}(e,r)}function E({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:a.jsx(g,{editor:e,ErrorBoundary:r})}function h(e){return e.getEditorState().read(s.$canShowPlaceholderCurry(e.isComposing()))}function m({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState(()=>h(e));return f(()=>{function r(){const r=h(e);t(r)}return r(),l.mergeRegister(e.registerUpdateListener(()=>{r()}),e.registerEditableListener(()=>{r()}))},[e]),r}(n),c=r.useLexicalEditable();return i?"function"==typeof t?t(c):t:null}exports.RichTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){f(()=>l.mergeRegister(x.registerRichText(e),u.registerDragonSupport(e)),[e])}(o),a.jsxs(a.Fragment,{children:[r,a.jsx(m,{content:t}),a.jsx(E,{editor:o,ErrorBoundary:n})]})};
@@ -0,0 +1,9 @@
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 as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as l,Suspense as a}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{CAN_USE_DOM as f}from"lexical";import{jsx as m,jsxs as d,Fragment as p}from"react/jsx-runtime";import{$canShowPlaceholderCurry as x}from"@lexical/text";import{mergeRegister as h}from"@lexical/utils";import{registerDragonSupport as E}from"@lexical/dragon";import{registerRichText as g}from"@lexical/rich-text";function y(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const B=f?n:i;function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c(()=>r.getDecorators());return B(()=>r.registerDecoratorListener(r=>{s(()=>{o(r)})}),[r]),i(()=>{o(r.getDecorators())},[r]),l(()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],l=m(e,{onError:e=>r._onError(e),children:m(a,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(l,s,c))}return o},[e,t,r])}(r,e)}function b({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:m(L,{editor:r,ErrorBoundary:e})}function v(r){return r.getEditorState().read(x(r.isComposing()))}function w({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){B(()=>h(g(r),E(r)),[r])}(n),d(p,{children:[e,m(S,{content:t}),m(b,{editor:n,ErrorBoundary:o})]})}function S({content:t}){const[o]=r(),n=function(r){const[e,t]=c(()=>v(r));return B(()=>{function e(){const e=v(r);t(e)}return e(),h(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{w as RichTextPlugin};
@@ -11,6 +11,7 @@
11
11
  var extension = require('@lexical/extension');
12
12
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
13
13
  var table = require('@lexical/table');
14
+ var lexical = require('lexical');
14
15
  var react = require('react');
15
16
 
16
17
  /**
@@ -39,9 +40,11 @@ function TablePlugin({
39
40
  const hadHorizontalScroll = table.$isScrollableTablesActive(editor);
40
41
  if (hadHorizontalScroll !== hasHorizontalScroll) {
41
42
  table.setScrollableTablesActive(editor, hasHorizontalScroll);
42
- // Registering the transform has the side-effect of marking all existing
43
- // TableNodes as dirty. The handler is immediately unregistered.
44
- editor.registerNodeTransform(table.TableNode, () => {})();
43
+ // Re-render existing tables through the new scroll-wrapper config without
44
+ // cloning every TableNode the way marking them dirty would. A full
45
+ // reconcile marks no nodes dirty, so it's deferred (no synchronous render
46
+ // from this effect) and produces no history entry.
47
+ editor.update(lexical.$fullReconcile);
45
48
  }
46
49
  }, [editor, hasHorizontalScroll]);
47
50
  const hasNestedTablesSignal = usePropSignal(hasNestedTables);
@@ -8,7 +8,8 @@
8
8
 
9
9
  import { signal } from '@lexical/extension';
10
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
11
- import { $isScrollableTablesActive, setScrollableTablesActive, TableNode, registerTablePlugin, registerTableSelectionObserver, registerTableCellUnmergeTransform, TableCellNode } from '@lexical/table';
11
+ import { $isScrollableTablesActive, setScrollableTablesActive, registerTablePlugin, registerTableSelectionObserver, registerTableCellUnmergeTransform, TableCellNode } from '@lexical/table';
12
+ import { $fullReconcile } from 'lexical';
12
13
  import { useEffect, useState } from 'react';
13
14
 
14
15
  /**
@@ -37,9 +38,11 @@ function TablePlugin({
37
38
  const hadHorizontalScroll = $isScrollableTablesActive(editor);
38
39
  if (hadHorizontalScroll !== hasHorizontalScroll) {
39
40
  setScrollableTablesActive(editor, hasHorizontalScroll);
40
- // Registering the transform has the side-effect of marking all existing
41
- // TableNodes as dirty. The handler is immediately unregistered.
42
- editor.registerNodeTransform(TableNode, () => {})();
41
+ // Re-render existing tables through the new scroll-wrapper config without
42
+ // cloning every TableNode the way marking them dirty would. A full
43
+ // reconcile marks no nodes dirty, so it's deferred (no synchronous render
44
+ // from this effect) and produces no history entry.
45
+ editor.update($fullReconcile);
43
46
  }
44
47
  }, [editor, hasHorizontalScroll]);
45
48
  const hasNestedTablesSignal = usePropSignal(hasNestedTables);
@@ -0,0 +1,9 @@
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
+ "use strict";var e=require("@lexical/extension"),l=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/table"),t=require("lexical"),a=require("react");exports.TablePlugin=function({hasCellMerge:s=!0,hasCellBackgroundColor:o=!0,hasTabHandler:n=!0,hasHorizontalScroll:c=!1,hasNestedTables:i=!1}){const[u]=l.useLexicalComposerContext();a.useEffect(()=>{r.$isScrollableTablesActive(u)!==c&&(r.setScrollableTablesActive(u,c),u.update(t.$fullReconcile))},[u,c]);const f=function(l){const[r]=a.useState(()=>e.signal(l));r.peek()!==l&&(r.value=l);return r}(i);return a.useEffect(()=>r.registerTablePlugin(u,{hasNestedTables:f}),[u,f]),a.useEffect(()=>r.registerTableSelectionObserver(u,n),[u,n]),a.useEffect(()=>{if(!s)return r.registerTableCellUnmergeTransform(u)},[u,s]),a.useEffect(()=>{if(!o)return u.registerNodeTransform(r.TableCellNode,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})},[u,o,s]),null};
@@ -0,0 +1,9 @@
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{signal as e}from"@lexical/extension";import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{$isScrollableTablesActive as o,setScrollableTablesActive as l,registerTablePlugin as t,registerTableSelectionObserver as a,registerTableCellUnmergeTransform as n,TableCellNode as s}from"@lexical/table";import{$fullReconcile as i}from"lexical";import{useEffect as c,useState as u}from"react";function m({hasCellMerge:m=!0,hasCellBackgroundColor:f=!0,hasTabHandler:p=!0,hasHorizontalScroll:d=!1,hasNestedTables:x=!1}){const[C]=r();c(()=>{o(C)!==d&&(l(C,d),C.update(i))},[C,d]);const g=function(r){const[o]=u(()=>e(r));o.peek()!==r&&(o.value=r);return o}(x);return c(()=>t(C,{hasNestedTables:g}),[C,g]),c(()=>a(C,p),[C,p]),c(()=>{if(!m)return n(C)},[C,m]),c(()=>{if(!f)return C.registerNodeTransform(s,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})},[C,f,m]),null}export{m as TablePlugin};
@@ -24,41 +24,10 @@ var jsxRuntime = require('react/jsx-runtime');
24
24
  */
25
25
 
26
26
 
27
- // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
28
- // `React["startTransition"]` even if it's behind a feature detection of
29
- // `"startTransition" in React`. Moving this to a constant avoids the issue :/
30
- const START_TRANSITION = 'startTransition';
31
- function startTransition(callback) {
32
- if (START_TRANSITION in React) {
33
- React[START_TRANSITION](callback);
34
- } else {
35
- callback();
36
- }
37
- }
38
-
39
- /**
40
- * Copyright (c) Meta Platforms, Inc. and affiliates.
41
- *
42
- * This source code is licensed under the MIT license found in the
43
- * LICENSE file in the root directory of this source tree.
44
- *
45
- */
46
-
47
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
48
-
49
- /**
50
- * Copyright (c) Meta Platforms, Inc. and affiliates.
51
- *
52
- * This source code is licensed under the MIT license found in the
53
- * LICENSE file in the root directory of this source tree.
54
- *
55
- */
56
-
57
-
58
27
  // This workaround is no longer necessary in React 19,
59
28
  // but we currently support React >=17.x
60
29
  // https://github.com/facebook/react/pull/26395
61
- const useLayoutEffectImpl = CAN_USE_DOM ? React.useLayoutEffect : React.useEffect;
30
+ const useLayoutEffectImpl = lexical.CAN_USE_DOM ? React.useLayoutEffect : React.useEffect;
62
31
 
63
32
  /**
64
33
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -419,9 +388,9 @@ function setContainerDivAttributes(containerDiv, className) {
419
388
  containerDiv.style.display = 'block';
420
389
  containerDiv.style.position = 'absolute';
421
390
  }
422
- function useMenuAnchorRef(resolution, setResolution, className, parent = CAN_USE_DOM ? document.body : undefined, shouldIncludePageYOffset__EXPERIMENTAL = true) {
391
+ function useMenuAnchorRef(resolution, setResolution, className, parent = lexical.CAN_USE_DOM ? document.body : undefined, shouldIncludePageYOffset__EXPERIMENTAL = true) {
423
392
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
424
- const initialAnchorElement = CAN_USE_DOM ? document.createElement('div') : null;
393
+ const initialAnchorElement = lexical.CAN_USE_DOM ? document.createElement('div') : null;
425
394
  const anchorElementRef = React.useRef(initialAnchorElement);
426
395
  const positionMenu = React.useCallback(() => {
427
396
  if (anchorElementRef.current === null || parent === undefined) {
@@ -500,6 +469,27 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = CAN_USE
500
469
  return anchorElementRef;
501
470
  }
502
471
 
472
+ /**
473
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
474
+ *
475
+ * This source code is licensed under the MIT license found in the
476
+ * LICENSE file in the root directory of this source tree.
477
+ *
478
+ */
479
+
480
+
481
+ // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
482
+ // `React["startTransition"]` even if it's behind a feature detection of
483
+ // `"startTransition" in React`. Moving this to a constant avoids the issue :/
484
+ const START_TRANSITION = 'startTransition';
485
+ function startTransition(callback) {
486
+ if (START_TRANSITION in React) {
487
+ React[START_TRANSITION](callback);
488
+ } else {
489
+ callback();
490
+ }
491
+ }
492
+
503
493
  /**
504
494
  * Copyright (c) Meta Platforms, Inc. and affiliates.
505
495
  *
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
10
- import { createCommand, COMMAND_PRIORITY_LOW, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, $getSelection, $isRangeSelection, $isTextNode, getDOMSelection } from 'lexical';
10
+ import { CAN_USE_DOM, createCommand, COMMAND_PRIORITY_LOW, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, $getSelection, $isRangeSelection, $isTextNode, getDOMSelection } from 'lexical';
11
11
  import React, { useLayoutEffect, useEffect, useRef, useCallback, useState, useMemo } from 'react';
12
12
  import { mergeRegister } from '@lexical/utils';
13
13
  import ReactDOM from 'react-dom';
@@ -22,37 +22,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
22
22
  */
23
23
 
24
24
 
25
- // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
26
- // `React["startTransition"]` even if it's behind a feature detection of
27
- // `"startTransition" in React`. Moving this to a constant avoids the issue :/
28
- const START_TRANSITION = 'startTransition';
29
- function startTransition(callback) {
30
- if (START_TRANSITION in React) {
31
- React[START_TRANSITION](callback);
32
- } else {
33
- callback();
34
- }
35
- }
36
-
37
- /**
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- *
43
- */
44
-
45
- const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';
46
-
47
- /**
48
- * Copyright (c) Meta Platforms, Inc. and affiliates.
49
- *
50
- * This source code is licensed under the MIT license found in the
51
- * LICENSE file in the root directory of this source tree.
52
- *
53
- */
54
-
55
-
56
25
  // This workaround is no longer necessary in React 19,
57
26
  // but we currently support React >=17.x
58
27
  // https://github.com/facebook/react/pull/26395
@@ -498,6 +467,27 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = CAN_USE
498
467
  return anchorElementRef;
499
468
  }
500
469
 
470
+ /**
471
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
472
+ *
473
+ * This source code is licensed under the MIT license found in the
474
+ * LICENSE file in the root directory of this source tree.
475
+ *
476
+ */
477
+
478
+
479
+ // Webpack + React 17 fails to compile on the usage of `React.startTransition` or
480
+ // `React["startTransition"]` even if it's behind a feature detection of
481
+ // `"startTransition" in React`. Moving this to a constant avoids the issue :/
482
+ const START_TRANSITION = 'startTransition';
483
+ function startTransition(callback) {
484
+ if (START_TRANSITION in React) {
485
+ React[START_TRANSITION](callback);
486
+ } else {
487
+ callback();
488
+ }
489
+ }
490
+
501
491
  /**
502
492
  * Copyright (c) Meta Platforms, Inc. and affiliates.
503
493
  *
@@ -0,0 +1,9 @@
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
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),n=require("react"),o=require("@lexical/utils"),r=require("react-dom"),l=require("react/jsx-runtime");const i=t.CAN_USE_DOM?n.useLayoutEffect:n.useEffect;const s=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function u(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return n.top>=o.top-6&&n.top<=o.bottom+6}function c(t,o,r,l){const[i]=e.useLexicalComposerContext();n.useEffect(()=>{if(null!=o&&null!=t){const e=i.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,o=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let r=e;r=r.parentElement;)if(t=getComputedStyle(r),(!n||"static"!==t.position)&&o.test(t.overflow+t.overflowY+t.overflowX))return r;return document.body}(e):document.body;let n=!1,s=u(o,t);const c=function(){n||(window.requestAnimationFrame(function(){r(),n=!1}),n=!0);const e=u(o,t);e!==s&&(s=e,null!=l&&l(e))},a=new ResizeObserver(r);return window.addEventListener("resize",r),document.addEventListener("scroll",c,{capture:!0,passive:!0}),a.observe(o),()=>{a.unobserve(o),window.removeEventListener("resize",r),document.removeEventListener("scroll",c,!0)}}},[o,i,l,r,t])}const a=t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function d({index:e,isSelected:t,onClick:n,onMouseEnter:o,option:r}){let i="item";return t&&(i+=" selected"),l.jsxs("li",{tabIndex:-1,className:i,ref:r.setRefElement,role:"option","aria-selected":t,id:"typeahead-item-"+e,onMouseEnter:o,onClick:n,children:[r.icon,l.jsx("span",{className:"text",children:r.title})]},r.key)}function f({close:e,editor:u,anchorElementRef:c,resolution:f,options:m,menuRenderFn:p,onSelectOption:g,shouldSplitNodeWithQuery:h=!1,commandPriority:C=t.COMMAND_PRIORITY_LOW,preselectFirstItem:E=!0}){const[x,y]=n.useState(null),O=null!==x?Math.min(m.length-1,x):null,b=f.match&&f.match.matchingString;n.useEffect(()=>{E&&y(0)},[b,E]);const S=n.useCallback(n=>{u.update(()=>{const o=null!=f.match&&h?function(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!n.isCollapsed())return null;const o=n.anchor;if("text"!==o.type)return null;const r=o.getNode();if(!r.isSimpleText())return null;const l=o.offset,i=r.getTextContent().slice(0,l),s=e.replaceableString.length,u=l-function(e,t,n){let o=n;for(let n=o;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(o=n);return o}(i,e.matchingString,s);if(u<0)return null;let c;return 0===u?[c]=r.splitText(l):[,c]=r.splitText(u,l),c}(f.match):null;g(n,o,e,f.match?f.match.matchingString:"")})},[u,h,f.match,g,e]),R=n.useCallback(e=>{const t=u.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),y(e))},[u]),v=n.useCallback(()=>c.current&&m.length?r.createPortal(l.jsx("div",{className:"typeahead-popover mentions-menu",children:l.jsx("ul",{children:m.map((e,t)=>l.jsx(d,{index:t,isSelected:O===t,onClick:()=>{y(t),S(e)},onMouseEnter:()=>{y(t)},option:e},e.key))})}),c.current):null,[c,m,O,S,y]);n.useEffect(()=>()=>{const e=u.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[u]),i(()=>{null===m?y(null):null===O&&E&&R(0)},[m,O,R,E]),n.useEffect(()=>o.mergeRegister(u.registerCommand(a,({option:e})=>!(!e.ref||null==e.ref.current)&&(s(e.ref.current),!0),C)),[u,R,C]),n.useEffect(()=>o.mergeRegister(u.registerCommand(t.KEY_ARROW_DOWN_COMMAND,e=>{const t=e;if(null!==m&&m.length){const e=null===O?0:O!==m.length-1?O+1:0;R(e);const n=m[e];if(!n)return R(-1),t.preventDefault(),t.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&u.dispatchCommand(a,{index:e,option:n}),t.preventDefault(),t.stopImmediatePropagation()}return!0},C),u.registerCommand(t.KEY_ARROW_UP_COMMAND,e=>{const t=e;if(null!==m&&m.length){const e=null===O?m.length-1:0!==O?O-1:m.length-1;R(e);const n=m[e];if(!n)return R(-1),t.preventDefault(),t.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&s(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0},C),u.registerCommand(t.KEY_ESCAPE_COMMAND,t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0},C),u.registerCommand(t.KEY_TAB_COMMAND,e=>{const t=e;return null!==m&&null!==O&&null!=m[O]&&(t.preventDefault(),t.stopImmediatePropagation(),S(m[O]),!0)},C),u.registerCommand(t.KEY_ENTER_COMMAND,e=>!(null===m||null===O||null==m[O]||e&&e.shiftKey)&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),S(m[O]),!0),C)),[S,e,u,m,O,R,C]);const _=n.useMemo(()=>({options:m,selectOptionAndCleanUp:S,selectedIndex:O,setHighlightedIndex:y}),[S,O,m]);return null!=p?p(c,_,f.match?f.match.matchingString:""):v()}function m(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}const p="startTransition";const g="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";const h=t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");exports.LexicalTypeaheadMenuPlugin=function({options:o,onQueryChange:r,onSelectOption:i,onOpen:s,onClose:u,menuRenderFn:a,triggerFn:d,anchorClassName:g,commandPriority:h=t.COMMAND_PRIORITY_LOW,parent:C,preselectFirstItem:E=!0,ignoreEntityBoundary:x=!1}){const[y]=e.useLexicalComposerContext(),[O,b]=n.useState(null),S=function(o,r,l,i=(t.CAN_USE_DOM?document.body:void 0),s=!0){const[u]=e.useLexicalComposerContext(),a=t.CAN_USE_DOM?document.createElement("div"):null,d=n.useRef(a),f=n.useCallback(()=>{if(null===d.current||void 0===i)return;d.current.style.top=d.current.style.bottom;const e=u.getRootElement(),t=d.current,n=t.firstChild;if(null!==e&&null!==o){const{left:r,top:u,width:c,height:a}=o.getRect(),f=d.current.offsetHeight;if(t.style.top=`${u+f+3+(s?window.pageYOffset:0)}px`,t.style.left=`${r+window.pageXOffset}px`,t.style.height=`${a}px`,t.style.width=`${c}px`,null!==n){n.style.top=`${u}`;const o=n.getBoundingClientRect(),l=o.height,i=o.width,c=e.getBoundingClientRect();r+i>c.right&&(t.style.left=`${c.right-i+window.pageXOffset}px`),(u+l>window.innerHeight||u+l>c.bottom)&&u-c.top>l+a&&(t.style.top=`${u-l-a+(s?window.pageYOffset:0)}px`)}t.isConnected||(m(t,l),i.append(t)),t.setAttribute("id","typeahead-menu"),e.setAttribute("aria-controls","typeahead-menu")}},[u,o,s,l,i]);n.useEffect(()=>{const e=u.getRootElement();return null!==o&&f(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=d.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[u,f,o]);const p=n.useCallback(e=>{null!==o&&(e||r(null))},[o,r]);return c(o,d.current,f,p),null!=a&&a===d.current&&(m(a,l),null!=i&&i.append(a)),d}(O,b,g,C),R=n.useCallback(()=>{if(null===O)return;const e=()=>{b(null)};let t;try{t=u&&u()}finally{t?t.then(e,e):e()}},[u,O]),v=n.useCallback(e=>{b(e),null!=s&&null===O&&s(e)},[s,O]);return n.useEffect(()=>{const e=y.registerUpdateListener(()=>{y.getEditorState().read(()=>{if(!y.isEditable())return void R();if(y.isComposing())return;const e=y._window||window,o=e.document.createRange(),l=t.$getSelection(),i=function(e){let n=null;return e.getEditorState().read(()=>{const e=t.$getSelection();t.$isRangeSelection(e)&&(n=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const o=t.offset;return n.getTextContent().slice(0,o)}(e))}),n}(y);if(!t.$isRangeSelection(l)||!l.isCollapsed()||null===i||null===o)return void R();const s=d(i,y);if(r(s?s.matchingString:null),null!==s&&(x||!function(e,n){return 0===n&&e.getEditorState().read(()=>{const e=t.$getSelection();if(t.$isRangeSelection(e)){const n=e.anchor.getNode().getPreviousSibling();return t.$isTextNode(n)&&n.isTextEntity()}return!1})}(y,s.leadOffset))){const r=function(e,n,o){const r=t.getDOMSelection(o);if(null===r||!r.isCollapsed)return!1;const l=r.anchorNode,i=e,s=r.anchorOffset;if(null==l||null==s)return!1;try{n.setStart(l,i),n.setEnd(l,s)}catch(e){return!1}return!0}(s.leadOffset,o,e);if(null!==r)return u=()=>v({getRect:()=>o.getBoundingClientRect(),match:s}),void(p in n?n[p](u):u())}var u;R()})});return()=>{e()}},[y,d,r,O,R,v,x]),n.useEffect(()=>y.registerEditableListener(e=>{e||R()}),[y,R]),null===O||null===y||null===S.current?null:l.jsx(f,{close:R,resolution:O,editor:y,anchorElementRef:S,options:o,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:i,commandPriority:h,preselectFirstItem:E})},exports.MenuOption=class{key;ref;icon;title;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}},exports.PUNCTUATION=g,exports.SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND=h,exports.getScrollParent=function(e,t){let n=getComputedStyle(e);const o="absolute"===n.position,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!o||"static"!==n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body},exports.useBasicTypeaheadTriggerMatch=function(e,{minLength:t=1,maxLength:o=75,punctuation:r=g,allowWhitespace:l=!1}){return n.useCallback(n=>{const i=new RegExp("(^|\\s|\\()(["+e+"]((?:"+("[^"+e+r+(l?"":"\\s")+"]")+"){0,"+o+"}))$").exec(n);if(null!==i){const e=i[1],n=i[3];if(n.length>=t)return{leadOffset:i.index+e.length,matchingString:n,replaceableString:i[2]}}return null},[l,e,r,o,t])},exports.useDynamicPositioning=c;
@@ -0,0 +1,9 @@
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 as t}from"@lexical/react/LexicalComposerContext";import{CAN_USE_DOM as e,createCommand as n,COMMAND_PRIORITY_LOW as o,KEY_ARROW_DOWN_COMMAND as r,KEY_ARROW_UP_COMMAND as l,KEY_ESCAPE_COMMAND as i,KEY_TAB_COMMAND as s,KEY_ENTER_COMMAND as u,$getSelection as c,$isRangeSelection as a,$isTextNode as d,getDOMSelection as m}from"lexical";import p,{useLayoutEffect as f,useEffect as g,useRef as h,useCallback as y,useState as v,useMemo as C}from"react";import{mergeRegister as b}from"@lexical/utils";import w from"react-dom";import{jsx as E,jsxs as x}from"react/jsx-runtime";const S=e?f:g;class R{key;ref;icon;title;constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}const O=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function I(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return n.top>=o.top-6&&n.top<=o.bottom+6}function N(e,n,o,r){const[l]=t();g(()=>{if(null!=n&&null!=e){const t=l.getRootElement(),e=null!=t?function(t){let e=getComputedStyle(t);const n="absolute"===e.position,o=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(let r=t;r=r.parentElement;)if(e=getComputedStyle(r),(!n||"static"!==e.position)&&o.test(e.overflow+e.overflowY+e.overflowX))return r;return document.body}(t):document.body;let i=!1,s=I(n,e);const u=function(){i||(window.requestAnimationFrame(function(){o(),i=!1}),i=!0);const t=I(n,e);t!==s&&(s=t,null!=r&&r(t))},c=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",u,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",u,!0)}}},[n,l,r,o,e])}const A=n("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function P({index:t,isSelected:e,onClick:n,onMouseEnter:o,option:r}){let l="item";return e&&(l+=" selected"),x("li",{tabIndex:-1,className:l,ref:r.setRefElement,role:"option","aria-selected":e,id:"typeahead-item-"+t,onMouseEnter:o,onClick:n,children:[r.icon,E("span",{className:"text",children:r.title})]},r.key)}function T({close:t,editor:e,anchorElementRef:n,resolution:d,options:m,menuRenderFn:p,onSelectOption:f,shouldSplitNodeWithQuery:h=!1,commandPriority:x=o,preselectFirstItem:R=!0}){const[I,N]=v(null),T=null!==I?Math.min(m.length-1,I):null,L=d.match&&d.match.matchingString;g(()=>{R&&N(0)},[L,R]);const _=y(n=>{e.update(()=>{const e=null!=d.match&&h?function(t){const e=c();if(!a(e)||!e.isCollapsed())return null;const n=e.anchor;if("text"!==n.type)return null;const o=n.getNode();if(!o.isSimpleText())return null;const r=n.offset,l=o.getTextContent().slice(0,r),i=t.replaceableString.length,s=r-function(t,e,n){let o=n;for(let n=o;n<=e.length;n++)t.slice(-n)===e.substring(0,n)&&(o=n);return o}(l,t.matchingString,i);if(s<0)return null;let u;return 0===s?[u]=o.splitText(r):[,u]=o.splitText(s,r),u}(d.match):null;f(n,e,t,d.match?d.match.matchingString:"")})},[e,h,d.match,f,t]),k=y(t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),N(t))},[e]),D=y(()=>n.current&&m.length?w.createPortal(E("div",{className:"typeahead-popover mentions-menu",children:E("ul",{children:m.map((t,e)=>E(P,{index:e,isSelected:T===e,onClick:()=>{N(e),_(t)},onMouseEnter:()=>{N(e)},option:t},t.key))})}),n.current):null,[n,m,T,_,N]);g(()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")},[e]),S(()=>{null===m?N(null):null===T&&R&&k(0)},[m,T,k,R]),g(()=>b(e.registerCommand(A,({option:t})=>!(!t.ref||null==t.ref.current)&&(O(t.ref.current),!0),x)),[e,k,x]),g(()=>b(e.registerCommand(r,t=>{const n=t;if(null!==m&&m.length){const t=null===T?0:T!==m.length-1?T+1:0;k(t);const o=m[t];if(!o)return k(-1),n.preventDefault(),n.stopImmediatePropagation(),!0;o.ref&&o.ref.current&&e.dispatchCommand(A,{index:t,option:o}),n.preventDefault(),n.stopImmediatePropagation()}return!0},x),e.registerCommand(l,t=>{const e=t;if(null!==m&&m.length){const t=null===T?m.length-1:0!==T?T-1:m.length-1;k(t);const n=m[t];if(!n)return k(-1),e.preventDefault(),e.stopImmediatePropagation(),!0;n.ref&&n.ref.current&&O(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},x),e.registerCommand(i,e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0},x),e.registerCommand(s,t=>{const e=t;return null!==m&&null!==T&&null!=m[T]&&(e.preventDefault(),e.stopImmediatePropagation(),_(m[T]),!0)},x),e.registerCommand(u,t=>!(null===m||null===T||null==m[T]||t&&t.shiftKey)&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),_(m[T]),!0),x)),[_,t,e,m,T,k,x]);const $=C(()=>({options:m,selectOptionAndCleanUp:_,selectedIndex:T,setHighlightedIndex:N}),[_,T,m]);return null!=p?p(n,$,d.match?d.match.matchingString:""):D()}function L(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}const _="startTransition";const k="\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";function D(t,e){let n=getComputedStyle(t);const o="absolute"===n.position,r=e?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let e=t;e=e.parentElement;)if(n=getComputedStyle(e),(!o||"static"!==n.position)&&r.test(n.overflow+n.overflowY+n.overflowX))return e;return document.body}const $=n("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function B(t,{minLength:e=1,maxLength:n=75,punctuation:o=k,allowWhitespace:r=!1}){return y(l=>{const i=new RegExp("(^|\\s|\\()(["+t+"]((?:"+("[^"+t+o+(r?"":"\\s")+"]")+"){0,"+n+"}))$").exec(l);if(null!==i){const t=i[1],n=i[3];if(n.length>=e)return{leadOffset:i.index+t.length,matchingString:n,replaceableString:i[2]}}return null},[r,t,o,n,e])}function F({options:n,onQueryChange:r,onSelectOption:l,onOpen:i,onClose:s,menuRenderFn:u,triggerFn:f,anchorClassName:C,commandPriority:b=o,parent:w,preselectFirstItem:x=!0,ignoreEntityBoundary:S=!1}){const[R]=t(),[O,I]=v(null),A=function(n,o,r,l=(e?document.body:void 0),i=!0){const[s]=t(),u=e?document.createElement("div"):null,c=h(u),a=y(()=>{if(null===c.current||void 0===l)return;c.current.style.top=c.current.style.bottom;const t=s.getRootElement(),e=c.current,o=e.firstChild;if(null!==t&&null!==n){const{left:s,top:u,width:a,height:d}=n.getRect(),m=c.current.offsetHeight;if(e.style.top=`${u+m+3+(i?window.pageYOffset:0)}px`,e.style.left=`${s+window.pageXOffset}px`,e.style.height=`${d}px`,e.style.width=`${a}px`,null!==o){o.style.top=`${u}`;const n=o.getBoundingClientRect(),r=n.height,l=n.width,c=t.getBoundingClientRect();s+l>c.right&&(e.style.left=`${c.right-l+window.pageXOffset}px`),(u+r>window.innerHeight||u+r>c.bottom)&&u-c.top>r+d&&(e.style.top=`${u-r-d+(i?window.pageYOffset:0)}px`)}e.isConnected||(L(e,r),l.append(e)),e.setAttribute("id","typeahead-menu"),t.setAttribute("aria-controls","typeahead-menu")}},[s,n,i,r,l]);g(()=>{const t=s.getRootElement();return null!==n&&a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=c.current;null!==e&&e.isConnected&&(e.remove(),e.removeAttribute("id"))}},[s,a,n]);const d=y(t=>{null!==n&&(t||o(null))},[n,o]);return N(n,c.current,a,d),null!=u&&u===c.current&&(L(u,r),null!=l&&l.append(u)),c}(O,I,C,w),P=y(()=>{if(null===O)return;const t=()=>{I(null)};let e;try{e=s&&s()}finally{e?e.then(t,t):t()}},[s,O]),k=y(t=>{I(t),null!=i&&null===O&&i(t)},[i,O]);return g(()=>{const t=R.registerUpdateListener(()=>{R.getEditorState().read(()=>{if(!R.isEditable())return void P();if(R.isComposing())return;const t=R._window||window,e=t.document.createRange(),n=c(),o=function(t){let e=null;return t.getEditorState().read(()=>{const t=c();a(t)&&(e=function(t){const e=t.anchor;if("text"!==e.type)return null;const n=e.getNode();if(!n.isSimpleText())return null;const o=e.offset;return n.getTextContent().slice(0,o)}(t))}),e}(R);if(!a(n)||!n.isCollapsed()||null===o||null===e)return void P();const l=f(o,R);if(r(l?l.matchingString:null),null!==l&&(S||!function(t,e){return 0===e&&t.getEditorState().read(()=>{const t=c();if(a(t)){const e=t.anchor.getNode().getPreviousSibling();return d(e)&&e.isTextEntity()}return!1})}(R,l.leadOffset))){const n=function(t,e,n){const o=m(n);if(null===o||!o.isCollapsed)return!1;const r=o.anchorNode,l=t,i=o.anchorOffset;if(null==r||null==i)return!1;try{e.setStart(r,l),e.setEnd(r,i)}catch(t){return!1}return!0}(l.leadOffset,e,t);if(null!==n)return i=()=>k({getRect:()=>e.getBoundingClientRect(),match:l}),void(_ in p?p[_](i):i())}var i;P()})});return()=>{t()}},[R,f,r,O,P,k,S]),g(()=>R.registerEditableListener(t=>{t||P()}),[R,P]),null===O||null===R||null===A.current?null:E(T,{close:P,resolution:O,editor:R,anchorElementRef:A,options:n,menuRenderFn:u,shouldSplitNodeWithQuery:!0,onSelectOption:l,commandPriority:b,preselectFirstItem:x})}export{F as LexicalTypeaheadMenuPlugin,R as MenuOption,k as PUNCTUATION,$ as SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND,D as getScrollParent,B as useBasicTypeaheadTriggerMatch,N as useDynamicPositioning};
@@ -0,0 +1,8 @@
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
+ export declare function startTransition(callback: () => void): void;
@@ -0,0 +1,10 @@
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 { useLayoutEffect } from 'react';
9
+ declare const useLayoutEffectImpl: typeof useLayoutEffect;
10
+ export default useLayoutEffectImpl;