@lexical/react 0.14.2 → 0.14.4

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 (196) hide show
  1. package/LexicalAutoEmbedPlugin.dev.js +2 -2
  2. package/{LexicalAutoEmbedPlugin.dev.esm.js → LexicalAutoEmbedPlugin.dev.mjs} +2 -2
  3. package/{LexicalAutoEmbedPlugin.esm.js → LexicalAutoEmbedPlugin.mjs} +2 -2
  4. package/LexicalAutoEmbedPlugin.node.mjs +11 -0
  5. package/LexicalAutoEmbedPlugin.prod.js +2 -2
  6. package/{LexicalAutoEmbedPlugin.prod.esm.js → LexicalAutoEmbedPlugin.prod.mjs} +1 -1
  7. package/{LexicalHashtagPlugin.esm.js → LexicalAutoFocusPlugin.mjs} +3 -3
  8. package/LexicalAutoFocusPlugin.node.mjs +8 -0
  9. package/{LexicalAutoLinkPlugin.esm.js → LexicalAutoLinkPlugin.mjs} +2 -2
  10. package/LexicalAutoLinkPlugin.node.mjs +9 -0
  11. package/{LexicalBlockWithAlignableContents.esm.js → LexicalBlockWithAlignableContents.mjs} +2 -2
  12. package/LexicalBlockWithAlignableContents.node.mjs +8 -0
  13. package/{LexicalClearEditorPlugin.esm.js → LexicalCharacterLimitPlugin.mjs} +3 -3
  14. package/LexicalCharacterLimitPlugin.node.mjs +8 -0
  15. package/LexicalCheckListPlugin.dev.js +1 -1
  16. package/{LexicalCheckListPlugin.dev.esm.js → LexicalCheckListPlugin.dev.mjs} +2 -2
  17. package/LexicalCheckListPlugin.mjs +10 -0
  18. package/LexicalCheckListPlugin.node.mjs +8 -0
  19. package/LexicalCheckListPlugin.prod.js +1 -1
  20. package/LexicalCheckListPlugin.prod.mjs +7 -0
  21. package/LexicalClearEditorPlugin.dev.js +3 -0
  22. package/{LexicalClearEditorPlugin.dev.esm.js → LexicalClearEditorPlugin.dev.mjs} +4 -1
  23. package/{LexicalCheckListPlugin.esm.js → LexicalClearEditorPlugin.mjs} +3 -3
  24. package/LexicalClearEditorPlugin.node.mjs +8 -0
  25. package/LexicalClearEditorPlugin.prod.js +2 -2
  26. package/LexicalClearEditorPlugin.prod.mjs +7 -0
  27. package/LexicalClickableLinkPlugin.d.ts +2 -1
  28. package/LexicalClickableLinkPlugin.dev.js +8 -3
  29. package/{LexicalClickableLinkPlugin.dev.esm.js → LexicalClickableLinkPlugin.dev.mjs} +8 -3
  30. package/LexicalClickableLinkPlugin.mjs +10 -0
  31. package/LexicalClickableLinkPlugin.node.mjs +8 -0
  32. package/LexicalClickableLinkPlugin.prod.js +4 -3
  33. package/LexicalClickableLinkPlugin.prod.mjs +7 -0
  34. package/{LexicalCollaborationContext.esm.js → LexicalCollaborationContext.mjs} +2 -2
  35. package/LexicalCollaborationContext.node.mjs +9 -0
  36. package/LexicalCollaborationPlugin.mjs +10 -0
  37. package/LexicalCollaborationPlugin.node.mjs +8 -0
  38. package/{LexicalListPlugin.esm.js → LexicalComposer.mjs} +3 -3
  39. package/LexicalComposer.node.mjs +8 -0
  40. package/{LexicalComposerContext.esm.js → LexicalComposerContext.mjs} +2 -2
  41. package/LexicalComposerContext.node.mjs +10 -0
  42. package/LexicalContentEditable.mjs +10 -0
  43. package/LexicalContentEditable.node.mjs +8 -0
  44. package/LexicalContextMenuPlugin.d.ts +2 -1
  45. package/LexicalContextMenuPlugin.dev.js +8 -3
  46. package/{LexicalContextMenuPlugin.dev.esm.js → LexicalContextMenuPlugin.dev.mjs} +8 -3
  47. package/{LexicalContextMenuPlugin.esm.js → LexicalContextMenuPlugin.mjs} +2 -2
  48. package/LexicalContextMenuPlugin.node.mjs +9 -0
  49. package/LexicalContextMenuPlugin.prod.js +16 -16
  50. package/LexicalContextMenuPlugin.prod.mjs +7 -0
  51. package/{LexicalDecoratorBlockNode.esm.js → LexicalDecoratorBlockNode.mjs} +2 -2
  52. package/LexicalDecoratorBlockNode.node.mjs +9 -0
  53. package/LexicalEditorRefPlugin.mjs +10 -0
  54. package/LexicalEditorRefPlugin.node.mjs +8 -0
  55. package/{useLexicalEditable.esm.js → LexicalErrorBoundary.mjs} +2 -2
  56. package/LexicalErrorBoundary.node.mjs +8 -0
  57. package/{LexicalClickableLinkPlugin.esm.js → LexicalHashtagPlugin.mjs} +3 -3
  58. package/LexicalHashtagPlugin.node.mjs +8 -0
  59. package/{LexicalHistoryPlugin.esm.js → LexicalHistoryPlugin.mjs} +2 -2
  60. package/LexicalHistoryPlugin.node.mjs +9 -0
  61. package/{LexicalHorizontalRuleNode.esm.js → LexicalHorizontalRuleNode.mjs} +2 -2
  62. package/LexicalHorizontalRuleNode.node.mjs +11 -0
  63. package/{LexicalCollaborationPlugin.esm.js → LexicalHorizontalRulePlugin.mjs} +3 -3
  64. package/LexicalHorizontalRulePlugin.node.mjs +8 -0
  65. package/{LexicalTableOfContents.esm.js → LexicalLinkPlugin.mjs} +3 -3
  66. package/LexicalLinkPlugin.node.mjs +8 -0
  67. package/LexicalListPlugin.mjs +10 -0
  68. package/LexicalListPlugin.node.mjs +8 -0
  69. package/{LexicalMarkdownShortcutPlugin.esm.js → LexicalMarkdownShortcutPlugin.mjs} +2 -2
  70. package/LexicalMarkdownShortcutPlugin.node.mjs +9 -0
  71. package/LexicalNestedComposer.dev.js +6 -2
  72. package/{LexicalNestedComposer.dev.esm.js → LexicalNestedComposer.dev.mjs} +6 -2
  73. package/LexicalNestedComposer.mjs +10 -0
  74. package/LexicalNestedComposer.node.mjs +8 -0
  75. package/LexicalNestedComposer.prod.js +5 -4
  76. package/LexicalNestedComposer.prod.mjs +7 -0
  77. package/LexicalNodeEventPlugin.mjs +10 -0
  78. package/LexicalNodeEventPlugin.node.mjs +8 -0
  79. package/{LexicalNodeMenuPlugin.esm.js → LexicalNodeMenuPlugin.mjs} +2 -2
  80. package/LexicalNodeMenuPlugin.node.mjs +9 -0
  81. package/{LexicalComposer.esm.js → LexicalOnChangePlugin.mjs} +3 -3
  82. package/LexicalOnChangePlugin.node.mjs +8 -0
  83. package/LexicalPlainTextPlugin.mjs +10 -0
  84. package/LexicalPlainTextPlugin.node.mjs +8 -0
  85. package/{LexicalLinkPlugin.esm.js → LexicalRichTextPlugin.mjs} +3 -3
  86. package/LexicalRichTextPlugin.node.mjs +8 -0
  87. package/{LexicalTabIndentationPlugin.esm.js → LexicalTabIndentationPlugin.mjs} +2 -2
  88. package/LexicalTabIndentationPlugin.node.mjs +9 -0
  89. package/{LexicalErrorBoundary.esm.js → LexicalTableOfContents.mjs} +2 -2
  90. package/LexicalTableOfContents.node.mjs +8 -0
  91. package/LexicalTablePlugin.mjs +10 -0
  92. package/LexicalTablePlugin.node.mjs +8 -0
  93. package/LexicalTreeView.dev.js +26 -434
  94. package/LexicalTreeView.dev.mjs +75 -0
  95. package/{LexicalTreeView.esm.js → LexicalTreeView.mjs} +2 -2
  96. package/LexicalTreeView.node.mjs +8 -0
  97. package/LexicalTreeView.prod.js +3 -17
  98. package/LexicalTreeView.prod.mjs +7 -0
  99. package/{LexicalTypeaheadMenuPlugin.esm.js → LexicalTypeaheadMenuPlugin.mjs} +2 -2
  100. package/LexicalTypeaheadMenuPlugin.node.mjs +14 -0
  101. package/package.json +819 -179
  102. package/useLexicalEditable.mjs +10 -0
  103. package/useLexicalEditable.node.mjs +8 -0
  104. package/{useLexicalIsTextContentEmpty.esm.js → useLexicalIsTextContentEmpty.mjs} +2 -2
  105. package/useLexicalIsTextContentEmpty.node.mjs +8 -0
  106. package/{useLexicalNodeSelection.esm.js → useLexicalNodeSelection.mjs} +2 -2
  107. package/useLexicalNodeSelection.node.mjs +8 -0
  108. package/useLexicalSubscription.mjs +10 -0
  109. package/useLexicalSubscription.node.mjs +8 -0
  110. package/{LexicalAutoFocusPlugin.esm.js → useLexicalTextEntity.mjs} +3 -3
  111. package/useLexicalTextEntity.node.mjs +8 -0
  112. package/LexicalCharacterLimitPlugin.esm.js +0 -10
  113. package/LexicalCheckListPlugin.prod.esm.js +0 -7
  114. package/LexicalClearEditorPlugin.prod.esm.js +0 -7
  115. package/LexicalClickableLinkPlugin.prod.esm.js +0 -7
  116. package/LexicalContentEditable.esm.js +0 -10
  117. package/LexicalContextMenuPlugin.prod.esm.js +0 -7
  118. package/LexicalEditorRefPlugin.esm.js +0 -10
  119. package/LexicalHorizontalRulePlugin.esm.js +0 -10
  120. package/LexicalNestedComposer.esm.js +0 -10
  121. package/LexicalNestedComposer.prod.esm.js +0 -7
  122. package/LexicalNodeEventPlugin.esm.js +0 -10
  123. package/LexicalOnChangePlugin.esm.js +0 -10
  124. package/LexicalPlainTextPlugin.esm.js +0 -10
  125. package/LexicalRichTextPlugin.esm.js +0 -10
  126. package/LexicalTablePlugin.esm.js +0 -10
  127. package/LexicalTreeView.dev.esm.js +0 -483
  128. package/LexicalTreeView.prod.esm.js +0 -7
  129. package/useLexicalSubscription.esm.js +0 -10
  130. package/useLexicalTextEntity.esm.js +0 -10
  131. /package/{LexicalAutoFocusPlugin.dev.esm.js → LexicalAutoFocusPlugin.dev.mjs} +0 -0
  132. /package/{LexicalAutoFocusPlugin.prod.esm.js → LexicalAutoFocusPlugin.prod.mjs} +0 -0
  133. /package/{LexicalAutoLinkPlugin.dev.esm.js → LexicalAutoLinkPlugin.dev.mjs} +0 -0
  134. /package/{LexicalAutoLinkPlugin.prod.esm.js → LexicalAutoLinkPlugin.prod.mjs} +0 -0
  135. /package/{LexicalBlockWithAlignableContents.dev.esm.js → LexicalBlockWithAlignableContents.dev.mjs} +0 -0
  136. /package/{LexicalBlockWithAlignableContents.prod.esm.js → LexicalBlockWithAlignableContents.prod.mjs} +0 -0
  137. /package/{LexicalCharacterLimitPlugin.dev.esm.js → LexicalCharacterLimitPlugin.dev.mjs} +0 -0
  138. /package/{LexicalCharacterLimitPlugin.prod.esm.js → LexicalCharacterLimitPlugin.prod.mjs} +0 -0
  139. /package/{LexicalCollaborationContext.dev.esm.js → LexicalCollaborationContext.dev.mjs} +0 -0
  140. /package/{LexicalCollaborationContext.prod.esm.js → LexicalCollaborationContext.prod.mjs} +0 -0
  141. /package/{LexicalCollaborationPlugin.dev.esm.js → LexicalCollaborationPlugin.dev.mjs} +0 -0
  142. /package/{LexicalCollaborationPlugin.prod.esm.js → LexicalCollaborationPlugin.prod.mjs} +0 -0
  143. /package/{LexicalComposer.dev.esm.js → LexicalComposer.dev.mjs} +0 -0
  144. /package/{LexicalComposer.prod.esm.js → LexicalComposer.prod.mjs} +0 -0
  145. /package/{LexicalComposerContext.dev.esm.js → LexicalComposerContext.dev.mjs} +0 -0
  146. /package/{LexicalComposerContext.prod.esm.js → LexicalComposerContext.prod.mjs} +0 -0
  147. /package/{LexicalContentEditable.dev.esm.js → LexicalContentEditable.dev.mjs} +0 -0
  148. /package/{LexicalContentEditable.prod.esm.js → LexicalContentEditable.prod.mjs} +0 -0
  149. /package/{LexicalDecoratorBlockNode.dev.esm.js → LexicalDecoratorBlockNode.dev.mjs} +0 -0
  150. /package/{LexicalDecoratorBlockNode.prod.esm.js → LexicalDecoratorBlockNode.prod.mjs} +0 -0
  151. /package/{LexicalEditorRefPlugin.dev.esm.js → LexicalEditorRefPlugin.dev.mjs} +0 -0
  152. /package/{LexicalEditorRefPlugin.prod.esm.js → LexicalEditorRefPlugin.prod.mjs} +0 -0
  153. /package/{LexicalErrorBoundary.dev.esm.js → LexicalErrorBoundary.dev.mjs} +0 -0
  154. /package/{LexicalErrorBoundary.prod.esm.js → LexicalErrorBoundary.prod.mjs} +0 -0
  155. /package/{LexicalHashtagPlugin.dev.esm.js → LexicalHashtagPlugin.dev.mjs} +0 -0
  156. /package/{LexicalHashtagPlugin.prod.esm.js → LexicalHashtagPlugin.prod.mjs} +0 -0
  157. /package/{LexicalHistoryPlugin.dev.esm.js → LexicalHistoryPlugin.dev.mjs} +0 -0
  158. /package/{LexicalHistoryPlugin.prod.esm.js → LexicalHistoryPlugin.prod.mjs} +0 -0
  159. /package/{LexicalHorizontalRuleNode.dev.esm.js → LexicalHorizontalRuleNode.dev.mjs} +0 -0
  160. /package/{LexicalHorizontalRuleNode.prod.esm.js → LexicalHorizontalRuleNode.prod.mjs} +0 -0
  161. /package/{LexicalHorizontalRulePlugin.dev.esm.js → LexicalHorizontalRulePlugin.dev.mjs} +0 -0
  162. /package/{LexicalHorizontalRulePlugin.prod.esm.js → LexicalHorizontalRulePlugin.prod.mjs} +0 -0
  163. /package/{LexicalLinkPlugin.dev.esm.js → LexicalLinkPlugin.dev.mjs} +0 -0
  164. /package/{LexicalLinkPlugin.prod.esm.js → LexicalLinkPlugin.prod.mjs} +0 -0
  165. /package/{LexicalListPlugin.dev.esm.js → LexicalListPlugin.dev.mjs} +0 -0
  166. /package/{LexicalListPlugin.prod.esm.js → LexicalListPlugin.prod.mjs} +0 -0
  167. /package/{LexicalMarkdownShortcutPlugin.dev.esm.js → LexicalMarkdownShortcutPlugin.dev.mjs} +0 -0
  168. /package/{LexicalMarkdownShortcutPlugin.prod.esm.js → LexicalMarkdownShortcutPlugin.prod.mjs} +0 -0
  169. /package/{LexicalNodeEventPlugin.dev.esm.js → LexicalNodeEventPlugin.dev.mjs} +0 -0
  170. /package/{LexicalNodeEventPlugin.prod.esm.js → LexicalNodeEventPlugin.prod.mjs} +0 -0
  171. /package/{LexicalNodeMenuPlugin.dev.esm.js → LexicalNodeMenuPlugin.dev.mjs} +0 -0
  172. /package/{LexicalNodeMenuPlugin.prod.esm.js → LexicalNodeMenuPlugin.prod.mjs} +0 -0
  173. /package/{LexicalOnChangePlugin.dev.esm.js → LexicalOnChangePlugin.dev.mjs} +0 -0
  174. /package/{LexicalOnChangePlugin.prod.esm.js → LexicalOnChangePlugin.prod.mjs} +0 -0
  175. /package/{LexicalPlainTextPlugin.dev.esm.js → LexicalPlainTextPlugin.dev.mjs} +0 -0
  176. /package/{LexicalPlainTextPlugin.prod.esm.js → LexicalPlainTextPlugin.prod.mjs} +0 -0
  177. /package/{LexicalRichTextPlugin.dev.esm.js → LexicalRichTextPlugin.dev.mjs} +0 -0
  178. /package/{LexicalRichTextPlugin.prod.esm.js → LexicalRichTextPlugin.prod.mjs} +0 -0
  179. /package/{LexicalTabIndentationPlugin.dev.esm.js → LexicalTabIndentationPlugin.dev.mjs} +0 -0
  180. /package/{LexicalTabIndentationPlugin.prod.esm.js → LexicalTabIndentationPlugin.prod.mjs} +0 -0
  181. /package/{LexicalTableOfContents.dev.esm.js → LexicalTableOfContents.dev.mjs} +0 -0
  182. /package/{LexicalTableOfContents.prod.esm.js → LexicalTableOfContents.prod.mjs} +0 -0
  183. /package/{LexicalTablePlugin.dev.esm.js → LexicalTablePlugin.dev.mjs} +0 -0
  184. /package/{LexicalTablePlugin.prod.esm.js → LexicalTablePlugin.prod.mjs} +0 -0
  185. /package/{LexicalTypeaheadMenuPlugin.dev.esm.js → LexicalTypeaheadMenuPlugin.dev.mjs} +0 -0
  186. /package/{LexicalTypeaheadMenuPlugin.prod.esm.js → LexicalTypeaheadMenuPlugin.prod.mjs} +0 -0
  187. /package/{useLexicalEditable.dev.esm.js → useLexicalEditable.dev.mjs} +0 -0
  188. /package/{useLexicalEditable.prod.esm.js → useLexicalEditable.prod.mjs} +0 -0
  189. /package/{useLexicalIsTextContentEmpty.dev.esm.js → useLexicalIsTextContentEmpty.dev.mjs} +0 -0
  190. /package/{useLexicalIsTextContentEmpty.prod.esm.js → useLexicalIsTextContentEmpty.prod.mjs} +0 -0
  191. /package/{useLexicalNodeSelection.dev.esm.js → useLexicalNodeSelection.dev.mjs} +0 -0
  192. /package/{useLexicalNodeSelection.prod.esm.js → useLexicalNodeSelection.prod.mjs} +0 -0
  193. /package/{useLexicalSubscription.dev.esm.js → useLexicalSubscription.dev.mjs} +0 -0
  194. /package/{useLexicalSubscription.prod.esm.js → useLexicalSubscription.prod.mjs} +0 -0
  195. /package/{useLexicalTextEntity.dev.esm.js → useLexicalTextEntity.dev.mjs} +0 -0
  196. /package/{useLexicalTextEntity.prod.esm.js → useLexicalTextEntity.prod.mjs} +0 -0
@@ -7,9 +7,9 @@
7
7
  'use strict';
8
8
 
9
9
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
10
+ var utils = require('@lexical/utils');
10
11
  var lexical = require('lexical');
11
12
  var React = require('react');
12
- var utils = require('@lexical/utils');
13
13
 
14
14
  /**
15
15
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -391,6 +391,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
391
391
  const PRE_PORTAL_DIV_SIZE = 1;
392
392
  function LexicalContextMenuPlugin({
393
393
  options,
394
+ onWillOpen,
394
395
  onClose,
395
396
  onOpen,
396
397
  onSelectOption,
@@ -417,10 +418,14 @@ function LexicalContextMenuPlugin({
417
418
  }, [onOpen, resolution]);
418
419
  const handleContextMenu = React.useCallback(event => {
419
420
  event.preventDefault();
421
+ if (onWillOpen != null) {
422
+ onWillOpen(event);
423
+ }
424
+ const zoom = utils.calculateZoomLevel(event.target);
420
425
  openNodeMenu({
421
- getRect: () => new DOMRect(event.clientX, event.clientY, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
426
+ getRect: () => new DOMRect(event.clientX / zoom, event.clientY / zoom, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
422
427
  });
423
- }, [openNodeMenu]);
428
+ }, [openNodeMenu, onWillOpen]);
424
429
  const handleClick = React.useCallback(event => {
425
430
  if (resolution !== null && menuRef.current != null && event.target != null && !menuRef.current.contains(event.target)) {
426
431
  closeNodeMenu();
@@ -5,10 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
8
+ import { mergeRegister, calculateZoomLevel } from '@lexical/utils';
8
9
  import { createCommand, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $getSelection, $isRangeSelection } from 'lexical';
9
10
  import * as React from 'react';
10
11
  import { useLayoutEffect as useLayoutEffect$1, useEffect, useState, useCallback, useMemo, useRef } from 'react';
11
- import { mergeRegister } from '@lexical/utils';
12
12
 
13
13
  /**
14
14
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -390,6 +390,7 @@ function useMenuAnchorRef(resolution, setResolution, className, parent = documen
390
390
  const PRE_PORTAL_DIV_SIZE = 1;
391
391
  function LexicalContextMenuPlugin({
392
392
  options,
393
+ onWillOpen,
393
394
  onClose,
394
395
  onOpen,
395
396
  onSelectOption,
@@ -416,10 +417,14 @@ function LexicalContextMenuPlugin({
416
417
  }, [onOpen, resolution]);
417
418
  const handleContextMenu = useCallback(event => {
418
419
  event.preventDefault();
420
+ if (onWillOpen != null) {
421
+ onWillOpen(event);
422
+ }
423
+ const zoom = calculateZoomLevel(event.target);
419
424
  openNodeMenu({
420
- getRect: () => new DOMRect(event.clientX, event.clientY, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
425
+ getRect: () => new DOMRect(event.clientX / zoom, event.clientY / zoom, PRE_PORTAL_DIV_SIZE, PRE_PORTAL_DIV_SIZE)
421
426
  });
422
- }, [openNodeMenu]);
427
+ }, [openNodeMenu, onWillOpen]);
423
428
  const handleClick = useCallback(event => {
424
429
  if (resolution !== null && menuRef.current != null && event.target != null && !menuRef.current.contains(event.target)) {
425
430
  closeNodeMenu();
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalContextMenuPlugin.dev.esm.js';
8
- import * as modProd from './LexicalContextMenuPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalContextMenuPlugin.dev.mjs';
8
+ import * as modProd from './LexicalContextMenuPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
11
11
  export const MenuOption = mod.MenuOption;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalContextMenuPlugin.dev.mjs') : import('./LexicalContextMenuPlugin.prod.mjs'));
8
+ export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
9
+ export const MenuOption = mod.MenuOption;
@@ -4,19 +4,19 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- 'use strict';var h=require("@lexical/react/LexicalComposerContext"),v=require("lexical"),x=require("react"),y=require("@lexical/utils"),z="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?x.useLayoutEffect:x.useEffect;class A{constructor(c){this.key=c;this.ref={current:null};this.setRefElement=this.setRefElement.bind(this)}setRefElement(c){this.ref={current:c}}}
8
- let B=c=>{const a=document.getElementById("typeahead-menu");if(a){var d=a.getBoundingClientRect();d.top+d.height>window.innerHeight&&a.scrollIntoView({block:"center"});0>d.top&&a.scrollIntoView({block:"center"});c.scrollIntoView({block:"nearest"})}};
9
- function C(c){var a=v.$getSelection();if(!v.$isRangeSelection(a)||!a.isCollapsed())return null;var d=a.anchor;if("text"!==d.type)return null;a=d.getNode();if(!a.isSimpleText())return null;d=d.offset;let l=a.getTextContent().slice(0,d);var f=c.matchingString;c=c.replaceableString.length;for(let r=c;r<=f.length;r++)l.substr(-r)===f.substr(0,r)&&(c=r);c=d-c;if(0>c)return null;let n;0===c?[n]=a.splitText(d):[,n]=a.splitText(c,d);return n}
10
- function D(c,a){let d=getComputedStyle(c),l="absolute"===d.position;a=a?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===d.position)return document.body;for(;c=c.parentElement;)if(d=getComputedStyle(c),(!l||"static"!==d.position)&&a.test(d.overflow+d.overflowY+d.overflowX))return c;return document.body}function E(c,a){c=c.getBoundingClientRect();a=a.getBoundingClientRect();return c.top>a.top&&c.top<a.bottom}
11
- function F(c,a,d,l){let [f]=h.useLexicalComposerContext();x.useEffect(()=>{if(null!=a&&null!=c){let n=f.getRootElement(),r=null!=n?D(n,!1):document.body,w=!1,g=E(a,r),b=function(){w||(window.requestAnimationFrame(function(){d();w=!1}),w=!0);const q=E(a,r);q!==g&&(g=q,null!=l&&l(q))},p=new ResizeObserver(d);window.addEventListener("resize",d);document.addEventListener("scroll",b,{capture:!0,passive:!0});p.observe(a);return()=>{p.unobserve(a);window.removeEventListener("resize",d);document.removeEventListener("scroll",
12
- b,!0)}}},[a,f,l,d,c])}let G=v.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");
13
- function H({close:c,editor:a,anchorElementRef:d,resolution:l,options:f,menuRenderFn:n,onSelectOption:r,shouldSplitNodeWithQuery:w=!1,commandPriority:g=v.COMMAND_PRIORITY_LOW}){let [b,p]=x.useState(null);x.useEffect(()=>{p(0)},[l.match&&l.match.matchingString]);let q=x.useCallback(e=>{a.update(()=>{const m=null!=l.match&&w?C(l.match):null;r(e,m,c,l.match?l.match.matchingString:"")})},[a,w,l.match,r,c]),t=x.useCallback(e=>{const m=a.getRootElement();null!==m&&(m.setAttribute("aria-activedescendant",
14
- "typeahead-item-"+e),p(e))},[a]);x.useEffect(()=>()=>{let e=a.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[a]);z(()=>{null===f?p(null):null===b&&t(0)},[f,b,t]);x.useEffect(()=>y.mergeRegister(a.registerCommand(G,({option:e})=>e.ref&&null!=e.ref.current?(B(e.ref.current),!0):!1,g)),[a,t,g]);x.useEffect(()=>y.mergeRegister(a.registerCommand(v.KEY_ARROW_DOWN_COMMAND,e=>{if(null!==f&&f.length&&null!==b){let m=b!==f.length-1?b+1:0;t(m);let k=f[m];null!=k.ref&&k.ref.current&&
15
- a.dispatchCommand(G,{index:m,option:k});e.preventDefault();e.stopImmediatePropagation()}return!0},g),a.registerCommand(v.KEY_ARROW_UP_COMMAND,e=>{if(null!==f&&f.length&&null!==b){var m=0!==b?b-1:f.length-1;t(m);m=f[m];null!=m.ref&&m.ref.current&&B(m.ref.current);e.preventDefault();e.stopImmediatePropagation()}return!0},g),a.registerCommand(v.KEY_ESCAPE_COMMAND,e=>{e.preventDefault();e.stopImmediatePropagation();c();return!0},g),a.registerCommand(v.KEY_TAB_COMMAND,e=>{if(null===f||null===b||null==
16
- f[b])return!1;e.preventDefault();e.stopImmediatePropagation();q(f[b]);return!0},g),a.registerCommand(v.KEY_ENTER_COMMAND,e=>{if(null===f||null===b||null==f[b])return!1;null!==e&&(e.preventDefault(),e.stopImmediatePropagation());q(f[b]);return!0},g)),[q,c,a,f,b,t,g]);let u=x.useMemo(()=>({options:f,selectOptionAndCleanUp:q,selectedIndex:b,setHighlightedIndex:p}),[q,b,f]);return n(d,u,l.match?l.match.matchingString:"")}
17
- function I(c,a,d,l=document.body){let [f]=h.useLexicalComposerContext(),n=x.useRef(document.createElement("div")),r=x.useCallback(()=>{n.current.style.top=n.current.style.bottom;const g=f.getRootElement(),b=n.current;var p=b.firstChild;if(null!==g&&null!==c){const {left:t,top:u,width:e,height:m}=c.getRect();b.style.top=`${u+window.pageYOffset+n.current.offsetHeight+3}px`;b.style.left=`${t+window.pageXOffset}px`;b.style.height=`${m}px`;b.style.width=`${e}px`;if(null!==p){p.style.top=`${u}`;var q=p.getBoundingClientRect();
18
- p=q.height;q=q.width;const k=g.getBoundingClientRect();t+q>k.right&&(b.style.left=`${k.right-q+window.pageXOffset}px`);(u+p>window.innerHeight||u+p>k.bottom)&&u-k.top>p&&(b.style.top=`${u-p+window.pageYOffset-m}px`)}b.isConnected||(null!=d&&(b.className=d),b.setAttribute("aria-label","Typeahead menu"),b.setAttribute("id","typeahead-menu"),b.setAttribute("role","listbox"),b.style.display="block",b.style.position="absolute",l.append(b));n.current=b;g.setAttribute("aria-controls","typeahead-menu")}},
19
- [f,c,d,l]);x.useEffect(()=>{let g=f.getRootElement();if(null!==c)return r(),()=>{null!==g&&g.removeAttribute("aria-controls");let b=n.current;null!==b&&b.isConnected&&b.remove()}},[f,r,c]);let w=x.useCallback(g=>{null!==c&&(g||a(null))},[c,a]);F(c,n.current,r,w);return n}
20
- exports.LexicalContextMenuPlugin=function({options:c,onClose:a,onOpen:d,onSelectOption:l,menuRenderFn:f,anchorClassName:n,commandPriority:r=v.COMMAND_PRIORITY_LOW,parent:w}){let [g]=h.useLexicalComposerContext(),[b,p]=x.useState(null),q=x.useRef(null);n=I(b,p,n,w);let t=x.useCallback(()=>{p(null);null!=a&&null!==b&&a()},[a,b]),u=x.useCallback(k=>{p(k);null!=d&&null===b&&d(k)},[d,b]),e=x.useCallback(k=>{k.preventDefault();u({getRect:()=>new DOMRect(k.clientX,k.clientY,1,1)})},[u]),m=x.useCallback(k=>
21
- {null===b||null==q.current||null==k.target||q.current.contains(k.target)||t()},[t,b]);x.useEffect(()=>{let k=g.getRootElement();if(k)return k.addEventListener("contextmenu",e),()=>k.removeEventListener("contextmenu",e)},[g,e]);x.useEffect(()=>{document.addEventListener("click",m);return()=>document.removeEventListener("click",m)},[g,m]);return null===b||null===g?null:x.createElement(H,{close:t,resolution:b,editor:g,anchorElementRef:n,options:c,menuRenderFn:(k,J)=>f(k,J,{setMenuRef:K=>{q.current=K}}),
22
- onSelectOption:l,commandPriority:r})};exports.MenuOption=A
7
+ 'use strict';var h=require("@lexical/react/LexicalComposerContext"),w=require("@lexical/utils"),z=require("lexical"),A=require("react"),B="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?A.useLayoutEffect:A.useEffect;class C{constructor(c){this.key=c;this.ref={current:null};this.setRefElement=this.setRefElement.bind(this)}setRefElement(c){this.ref={current:c}}}
8
+ let D=c=>{const a=document.getElementById("typeahead-menu");if(a){var d=a.getBoundingClientRect();d.top+d.height>window.innerHeight&&a.scrollIntoView({block:"center"});0>d.top&&a.scrollIntoView({block:"center"});c.scrollIntoView({block:"nearest"})}};
9
+ function E(c){var a=z.$getSelection();if(!z.$isRangeSelection(a)||!a.isCollapsed())return null;var d=a.anchor;if("text"!==d.type)return null;a=d.getNode();if(!a.isSimpleText())return null;d=d.offset;let k=a.getTextContent().slice(0,d);var e=c.matchingString;c=c.replaceableString.length;for(let n=c;n<=e.length;n++)k.substr(-n)===e.substr(0,n)&&(c=n);c=d-c;if(0>c)return null;let p;0===c?[p]=a.splitText(d):[,p]=a.splitText(c,d);return p}
10
+ function F(c,a){let d=getComputedStyle(c),k="absolute"===d.position;a=a?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===d.position)return document.body;for(;c=c.parentElement;)if(d=getComputedStyle(c),(!k||"static"!==d.position)&&a.test(d.overflow+d.overflowY+d.overflowX))return c;return document.body}function G(c,a){c=c.getBoundingClientRect();a=a.getBoundingClientRect();return c.top>a.top&&c.top<a.bottom}
11
+ function H(c,a,d,k){let [e]=h.useLexicalComposerContext();A.useEffect(()=>{if(null!=a&&null!=c){let p=e.getRootElement(),n=null!=p?F(p,!1):document.body,x=!1,l=G(a,n),b=function(){x||(window.requestAnimationFrame(function(){d();x=!1}),x=!0);const q=G(a,n);q!==l&&(l=q,null!=k&&k(q))},g=new ResizeObserver(d);window.addEventListener("resize",d);document.addEventListener("scroll",b,{capture:!0,passive:!0});g.observe(a);return()=>{g.unobserve(a);window.removeEventListener("resize",d);document.removeEventListener("scroll",
12
+ b,!0)}}},[a,e,k,d,c])}let I=z.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");
13
+ function J({close:c,editor:a,anchorElementRef:d,resolution:k,options:e,menuRenderFn:p,onSelectOption:n,shouldSplitNodeWithQuery:x=!1,commandPriority:l=z.COMMAND_PRIORITY_LOW}){let [b,g]=A.useState(null);A.useEffect(()=>{g(0)},[k.match&&k.match.matchingString]);let q=A.useCallback(f=>{a.update(()=>{const m=null!=k.match&&x?E(k.match):null;n(f,m,c,k.match?k.match.matchingString:"")})},[a,x,k.match,n,c]),t=A.useCallback(f=>{const m=a.getRootElement();null!==m&&(m.setAttribute("aria-activedescendant",
14
+ "typeahead-item-"+f),g(f))},[a]);A.useEffect(()=>()=>{let f=a.getRootElement();null!==f&&f.removeAttribute("aria-activedescendant")},[a]);B(()=>{null===e?g(null):null===b&&t(0)},[e,b,t]);A.useEffect(()=>w.mergeRegister(a.registerCommand(I,({option:f})=>f.ref&&null!=f.ref.current?(D(f.ref.current),!0):!1,l)),[a,t,l]);A.useEffect(()=>w.mergeRegister(a.registerCommand(z.KEY_ARROW_DOWN_COMMAND,f=>{if(null!==e&&e.length&&null!==b){let m=b!==e.length-1?b+1:0;t(m);let u=e[m];null!=u.ref&&u.ref.current&&
15
+ a.dispatchCommand(I,{index:m,option:u});f.preventDefault();f.stopImmediatePropagation()}return!0},l),a.registerCommand(z.KEY_ARROW_UP_COMMAND,f=>{if(null!==e&&e.length&&null!==b){var m=0!==b?b-1:e.length-1;t(m);m=e[m];null!=m.ref&&m.ref.current&&D(m.ref.current);f.preventDefault();f.stopImmediatePropagation()}return!0},l),a.registerCommand(z.KEY_ESCAPE_COMMAND,f=>{f.preventDefault();f.stopImmediatePropagation();c();return!0},l),a.registerCommand(z.KEY_TAB_COMMAND,f=>{if(null===e||null===b||null==
16
+ e[b])return!1;f.preventDefault();f.stopImmediatePropagation();q(e[b]);return!0},l),a.registerCommand(z.KEY_ENTER_COMMAND,f=>{if(null===e||null===b||null==e[b])return!1;null!==f&&(f.preventDefault(),f.stopImmediatePropagation());q(e[b]);return!0},l)),[q,c,a,e,b,t,l]);let v=A.useMemo(()=>({options:e,selectOptionAndCleanUp:q,selectedIndex:b,setHighlightedIndex:g}),[q,b,e]);return p(d,v,k.match?k.match.matchingString:"")}
17
+ function K(c,a,d,k=document.body){let [e]=h.useLexicalComposerContext(),p=A.useRef(document.createElement("div")),n=A.useCallback(()=>{p.current.style.top=p.current.style.bottom;const l=e.getRootElement(),b=p.current;var g=b.firstChild;if(null!==l&&null!==c){const {left:t,top:v,width:f,height:m}=c.getRect();b.style.top=`${v+window.pageYOffset+p.current.offsetHeight+3}px`;b.style.left=`${t+window.pageXOffset}px`;b.style.height=`${m}px`;b.style.width=`${f}px`;if(null!==g){g.style.top=`${v}`;var q=g.getBoundingClientRect();
18
+ g=q.height;q=q.width;const u=l.getBoundingClientRect();t+q>u.right&&(b.style.left=`${u.right-q+window.pageXOffset}px`);(v+g>window.innerHeight||v+g>u.bottom)&&v-u.top>g&&(b.style.top=`${v-g+window.pageYOffset-m}px`)}b.isConnected||(null!=d&&(b.className=d),b.setAttribute("aria-label","Typeahead menu"),b.setAttribute("id","typeahead-menu"),b.setAttribute("role","listbox"),b.style.display="block",b.style.position="absolute",k.append(b));p.current=b;l.setAttribute("aria-controls","typeahead-menu")}},
19
+ [e,c,d,k]);A.useEffect(()=>{let l=e.getRootElement();if(null!==c)return n(),()=>{null!==l&&l.removeAttribute("aria-controls");let b=p.current;null!==b&&b.isConnected&&b.remove()}},[e,n,c]);let x=A.useCallback(l=>{null!==c&&(l||a(null))},[c,a]);H(c,p.current,n,x);return p}
20
+ exports.LexicalContextMenuPlugin=function({options:c,onWillOpen:a,onClose:d,onOpen:k,onSelectOption:e,menuRenderFn:p,anchorClassName:n,commandPriority:x=z.COMMAND_PRIORITY_LOW,parent:l}){let [b]=h.useLexicalComposerContext(),[g,q]=A.useState(null),t=A.useRef(null);n=K(g,q,n,l);let v=A.useCallback(()=>{q(null);null!=d&&null!==g&&d()},[d,g]),f=A.useCallback(r=>{q(r);null!=k&&null===g&&k(r)},[k,g]),m=A.useCallback(r=>{r.preventDefault();null!=a&&a(r);const y=w.calculateZoomLevel(r.target);f({getRect:()=>
21
+ new DOMRect(r.clientX/y,r.clientY/y,1,1)})},[f,a]),u=A.useCallback(r=>{null===g||null==t.current||null==r.target||t.current.contains(r.target)||v()},[v,g]);A.useEffect(()=>{let r=b.getRootElement();if(r)return r.addEventListener("contextmenu",m),()=>r.removeEventListener("contextmenu",m)},[b,m]);A.useEffect(()=>{document.addEventListener("click",u);return()=>document.removeEventListener("click",u)},[b,u]);return null===g||null===b?null:A.createElement(J,{close:v,resolution:g,editor:b,anchorElementRef:n,
22
+ options:c,menuRenderFn:(r,y)=>p(r,y,{setMenuRef:L=>{t.current=L}}),onSelectOption:e,commandPriority:x})};exports.MenuOption=C
@@ -0,0 +1,7 @@
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
+ import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{mergeRegister as e,calculateZoomLevel as n}from"@lexical/utils";import{createCommand as o,KEY_ARROW_DOWN_COMMAND as l,KEY_ARROW_UP_COMMAND as r,KEY_ESCAPE_COMMAND as i,KEY_TAB_COMMAND as u,KEY_ENTER_COMMAND as c,COMMAND_PRIORITY_LOW as s,$getSelection as a,$isRangeSelection as m}from"lexical";import*as d from"react";import{useLayoutEffect as p,useEffect as f,useState as g,useCallback as h,useMemo as w,useRef as v}from"react";var y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?p:f;class b{constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}const E=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 C(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return n.top>o.top&&n.top<o.bottom}function R(e,n,o,l){const[r]=t();f((()=>{if(null!=n&&null!=e){const t=r.getRootElement(),e=null!=t?function(t,e){let n=getComputedStyle(t);const o="absolute"===n.position,l=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)&&l.test(n.overflow+n.overflowY+n.overflowX))return e;return document.body}(t,!1):document.body;let i=!1,u=C(n,e);const c=function(){i||(window.requestAnimationFrame((function(){o(),i=!1})),i=!0);const t=C(n,e);t!==u&&(u=t,null!=l&&l(t))},s=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",c,{capture:!0,passive:!0}),s.observe(n),()=>{s.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",c,!0)}}}),[n,r,l,o,e])}const x=o("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function O({close:t,editor:n,anchorElementRef:o,resolution:d,options:p,menuRenderFn:v,onSelectOption:b,shouldSplitNodeWithQuery:C=!1,commandPriority:R=s}){const[O,I]=g(null),S=d.match&&d.match.matchingString;f((()=>{I(0)}),[S]);const A=h((e=>{n.update((()=>{const n=null!=d.match&&C?function(t){const e=a();if(!m(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 l=n.offset,r=o.getTextContent().slice(0,l),i=t.replaceableString.length,u=l-function(t,e,n){let o=n;for(let n=o;n<=e.length;n++)t.substr(-n)===e.substr(0,n)&&(o=n);return o}(r,t.matchingString,i);if(u<0)return null;let c;return 0===u?[c]=o.splitText(l):[,c]=o.splitText(u,l),c}(d.match):null;b(e,n,t,d.match?d.match.matchingString:"")}))}),[n,C,d.match,b,t]),L=h((t=>{const e=n.getRootElement();null!==e&&(e.setAttribute("aria-activedescendant","typeahead-item-"+t),I(t))}),[n]);f((()=>()=>{const t=n.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")}),[n]),y((()=>{null===p?I(null):null===O&&L(0)}),[p,O,L]),f((()=>e(n.registerCommand(x,(({option:t})=>!(!t.ref||null==t.ref.current)&&(E(t.ref.current),!0)),R))),[n,L,R]),f((()=>e(n.registerCommand(l,(t=>{const e=t;if(null!==p&&p.length&&null!==O){const t=O!==p.length-1?O+1:0;L(t);const o=p[t];null!=o.ref&&o.ref.current&&n.dispatchCommand(x,{index:t,option:o}),e.preventDefault(),e.stopImmediatePropagation()}return!0}),R),n.registerCommand(r,(t=>{const e=t;if(null!==p&&p.length&&null!==O){const t=0!==O?O-1:p.length-1;L(t);const n=p[t];null!=n.ref&&n.ref.current&&E(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0}),R),n.registerCommand(i,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),R),n.registerCommand(u,(t=>{const e=t;return null!==p&&null!==O&&null!=p[O]&&(e.preventDefault(),e.stopImmediatePropagation(),A(p[O]),!0)}),R),n.registerCommand(c,(t=>null!==p&&null!==O&&null!=p[O]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),A(p[O]),!0)),R))),[A,t,n,p,O,L,R]);return v(o,w((()=>({options:p,selectOptionAndCleanUp:A,selectedIndex:O,setHighlightedIndex:I})),[A,O,p]),d.match?d.match.matchingString:"")}function I({options:e,onWillOpen:o,onClose:l,onOpen:r,onSelectOption:i,menuRenderFn:u,anchorClassName:c,commandPriority:a=s,parent:m}){const[p]=t(),[w,y]=g(null),b=d.useRef(null),E=function(e,n,o,l=document.body){const[r]=t(),i=v(document.createElement("div")),u=h((()=>{i.current.style.top=i.current.style.bottom;const t=r.getRootElement(),n=i.current,u=n.firstChild;if(null!==t&&null!==e){const{left:r,top:c,width:s,height:a}=e.getRect(),m=i.current.offsetHeight;if(n.style.top=`${c+window.pageYOffset+m+3}px`,n.style.left=`${r+window.pageXOffset}px`,n.style.height=`${a}px`,n.style.width=`${s}px`,null!==u){u.style.top=`${c}`;const e=u.getBoundingClientRect(),o=e.height,l=e.width,i=t.getBoundingClientRect();r+l>i.right&&(n.style.left=`${i.right-l+window.pageXOffset}px`),(c+o>window.innerHeight||c+o>i.bottom)&&c-i.top>o&&(n.style.top=c-o+window.pageYOffset-a+"px")}n.isConnected||(null!=o&&(n.className=o),n.setAttribute("aria-label","Typeahead menu"),n.setAttribute("id","typeahead-menu"),n.setAttribute("role","listbox"),n.style.display="block",n.style.position="absolute",l.append(n)),i.current=n,t.setAttribute("aria-controls","typeahead-menu")}}),[r,e,o,l]);f((()=>{const t=r.getRootElement();if(null!==e)return u(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=i.current;null!==e&&e.isConnected&&e.remove()}}),[r,u,e]);const c=h((t=>{null!==e&&(t||n(null))}),[e,n]);return R(e,i.current,u,c),i}(w,y,c,m),C=h((()=>{y(null),null!=l&&null!==w&&l()}),[l,w]),x=h((t=>{y(t),null!=r&&null===w&&r(t)}),[r,w]),I=h((t=>{t.preventDefault(),null!=o&&o(t);const e=n(t.target);x({getRect:()=>new DOMRect(t.clientX/e,t.clientY/e,1,1)})}),[x,o]),S=h((t=>{null===w||null==b.current||null==t.target||b.current.contains(t.target)||C()}),[C,w]);return f((()=>{const t=p.getRootElement();if(t)return t.addEventListener("contextmenu",I),()=>t.removeEventListener("contextmenu",I)}),[p,I]),f((()=>(document.addEventListener("click",S),()=>document.removeEventListener("click",S))),[p,S]),null===w||null===p?null:d.createElement(O,{close:C,resolution:w,editor:p,anchorElementRef:E,options:e,menuRenderFn:(t,e)=>u(t,e,{setMenuRef:t=>{b.current=t}}),onSelectOption:i,commandPriority:a})}export{I as LexicalContextMenuPlugin,b as MenuOption};
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalDecoratorBlockNode.dev.esm.js';
8
- import * as modProd from './LexicalDecoratorBlockNode.prod.esm.js';
7
+ import * as modDev from './LexicalDecoratorBlockNode.dev.mjs';
8
+ import * as modProd from './LexicalDecoratorBlockNode.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const $isDecoratorBlockNode = mod.$isDecoratorBlockNode;
11
11
  export const DecoratorBlockNode = mod.DecoratorBlockNode;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalDecoratorBlockNode.dev.mjs') : import('./LexicalDecoratorBlockNode.prod.mjs'));
8
+ export const $isDecoratorBlockNode = mod.$isDecoratorBlockNode;
9
+ export const DecoratorBlockNode = mod.DecoratorBlockNode;
@@ -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
+ import * as modDev from './LexicalEditorRefPlugin.dev.mjs';
8
+ import * as modProd from './LexicalEditorRefPlugin.prod.mjs';
9
+ const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
+ export const EditorRefPlugin = mod.EditorRefPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalEditorRefPlugin.dev.mjs') : import('./LexicalEditorRefPlugin.prod.mjs'));
8
+ export const EditorRefPlugin = mod.EditorRefPlugin;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './useLexicalEditable.dev.esm.js';
8
- import * as modProd from './useLexicalEditable.prod.esm.js';
7
+ import * as modDev from './LexicalErrorBoundary.dev.mjs';
8
+ import * as modProd from './LexicalErrorBoundary.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export default mod.default;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalErrorBoundary.dev.mjs') : import('./LexicalErrorBoundary.prod.mjs'));
8
+ export default mod.default;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalClickableLinkPlugin.dev.esm.js';
8
- import * as modProd from './LexicalClickableLinkPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalHashtagPlugin.dev.mjs';
8
+ import * as modProd from './LexicalHashtagPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
- export default mod.default;
10
+ export const HashtagPlugin = mod.HashtagPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHashtagPlugin.dev.mjs') : import('./LexicalHashtagPlugin.prod.mjs'));
8
+ export const HashtagPlugin = mod.HashtagPlugin;
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalHistoryPlugin.dev.esm.js';
8
- import * as modProd from './LexicalHistoryPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalHistoryPlugin.dev.mjs';
8
+ import * as modProd from './LexicalHistoryPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const HistoryPlugin = mod.HistoryPlugin;
11
11
  export const createEmptyHistoryState = mod.createEmptyHistoryState;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHistoryPlugin.dev.mjs') : import('./LexicalHistoryPlugin.prod.mjs'));
8
+ export const HistoryPlugin = mod.HistoryPlugin;
9
+ export const createEmptyHistoryState = mod.createEmptyHistoryState;
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalHorizontalRuleNode.dev.esm.js';
8
- import * as modProd from './LexicalHorizontalRuleNode.prod.esm.js';
7
+ import * as modDev from './LexicalHorizontalRuleNode.dev.mjs';
8
+ import * as modProd from './LexicalHorizontalRuleNode.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const $createHorizontalRuleNode = mod.$createHorizontalRuleNode;
11
11
  export const $isHorizontalRuleNode = mod.$isHorizontalRuleNode;
@@ -0,0 +1,11 @@
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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHorizontalRuleNode.dev.mjs') : import('./LexicalHorizontalRuleNode.prod.mjs'));
8
+ export const $createHorizontalRuleNode = mod.$createHorizontalRuleNode;
9
+ export const $isHorizontalRuleNode = mod.$isHorizontalRuleNode;
10
+ export const HorizontalRuleNode = mod.HorizontalRuleNode;
11
+ export const INSERT_HORIZONTAL_RULE_COMMAND = mod.INSERT_HORIZONTAL_RULE_COMMAND;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalCollaborationPlugin.dev.esm.js';
8
- import * as modProd from './LexicalCollaborationPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalHorizontalRulePlugin.dev.mjs';
8
+ import * as modProd from './LexicalHorizontalRulePlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
- export const CollaborationPlugin = mod.CollaborationPlugin;
10
+ export const HorizontalRulePlugin = mod.HorizontalRulePlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHorizontalRulePlugin.dev.mjs') : import('./LexicalHorizontalRulePlugin.prod.mjs'));
8
+ export const HorizontalRulePlugin = mod.HorizontalRulePlugin;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalTableOfContents.dev.esm.js';
8
- import * as modProd from './LexicalTableOfContents.prod.esm.js';
7
+ import * as modDev from './LexicalLinkPlugin.dev.mjs';
8
+ import * as modProd from './LexicalLinkPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
- export default mod.default;
10
+ export const LinkPlugin = mod.LinkPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalLinkPlugin.dev.mjs') : import('./LexicalLinkPlugin.prod.mjs'));
8
+ export const LinkPlugin = mod.LinkPlugin;
@@ -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
+ import * as modDev from './LexicalListPlugin.dev.mjs';
8
+ import * as modProd from './LexicalListPlugin.prod.mjs';
9
+ const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
+ export const ListPlugin = mod.ListPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalListPlugin.dev.mjs') : import('./LexicalListPlugin.prod.mjs'));
8
+ export const ListPlugin = mod.ListPlugin;
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalMarkdownShortcutPlugin.dev.esm.js';
8
- import * as modProd from './LexicalMarkdownShortcutPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalMarkdownShortcutPlugin.dev.mjs';
8
+ import * as modProd from './LexicalMarkdownShortcutPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const DEFAULT_TRANSFORMERS = mod.DEFAULT_TRANSFORMERS;
11
11
  export const MarkdownShortcutPlugin = mod.MarkdownShortcutPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalMarkdownShortcutPlugin.dev.mjs') : import('./LexicalMarkdownShortcutPlugin.prod.mjs'));
8
+ export const DEFAULT_TRANSFORMERS = mod.DEFAULT_TRANSFORMERS;
9
+ export const MarkdownShortcutPlugin = mod.MarkdownShortcutPlugin;
@@ -17,6 +17,10 @@ var React = require('react');
17
17
  * LICENSE file in the root directory of this source tree.
18
18
  *
19
19
  */
20
+ function getTransformSetFromKlass(klass) {
21
+ const transform = klass.transform();
22
+ return transform !== null ? new Set([transform]) : new Set();
23
+ }
20
24
  function LexicalNestedComposer({
21
25
  initialEditor,
22
26
  children,
@@ -49,7 +53,7 @@ function LexicalNestedComposer({
49
53
  klass: entry.klass,
50
54
  replace: entry.replace,
51
55
  replaceWithKlass: entry.replaceWithKlass,
52
- transforms: new Set()
56
+ transforms: getTransformSetFromKlass(entry.klass)
53
57
  });
54
58
  }
55
59
  } else {
@@ -68,7 +72,7 @@ function LexicalNestedComposer({
68
72
  klass,
69
73
  replace,
70
74
  replaceWithKlass,
71
- transforms: new Set()
75
+ transforms: getTransformSetFromKlass(klass)
72
76
  });
73
77
  }
74
78
  }
@@ -16,6 +16,10 @@ import { useRef, useContext, useMemo, useEffect } from 'react';
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  *
18
18
  */
19
+ function getTransformSetFromKlass(klass) {
20
+ const transform = klass.transform();
21
+ return transform !== null ? new Set([transform]) : new Set();
22
+ }
19
23
  function LexicalNestedComposer({
20
24
  initialEditor,
21
25
  children,
@@ -48,7 +52,7 @@ function LexicalNestedComposer({
48
52
  klass: entry.klass,
49
53
  replace: entry.replace,
50
54
  replaceWithKlass: entry.replaceWithKlass,
51
- transforms: new Set()
55
+ transforms: getTransformSetFromKlass(entry.klass)
52
56
  });
53
57
  }
54
58
  } else {
@@ -67,7 +71,7 @@ function LexicalNestedComposer({
67
71
  klass,
68
72
  replace,
69
73
  replaceWithKlass,
70
- transforms: new Set()
74
+ transforms: getTransformSetFromKlass(klass)
71
75
  });
72
76
  }
73
77
  }
@@ -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
+ import * as modDev from './LexicalNestedComposer.dev.mjs';
8
+ import * as modProd from './LexicalNestedComposer.prod.mjs';
9
+ const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
+ export const LexicalNestedComposer = mod.LexicalNestedComposer;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalNestedComposer.dev.mjs') : import('./LexicalNestedComposer.prod.mjs'));
8
+ export const LexicalNestedComposer = mod.LexicalNestedComposer;
@@ -4,7 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- 'use strict';var d=require("@lexical/react/LexicalCollaborationContext"),m=require("@lexical/react/LexicalComposerContext"),r=require("react");function t(a){let h=new URLSearchParams;h.append("code",a);for(let e=1;e<arguments.length;e++)h.append("v",arguments[e]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${h} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
8
- exports.LexicalNestedComposer=function({initialEditor:a,children:h,initialNodes:e,initialTheme:u,skipCollabChecks:v}){let q=r.useRef(!1),n=r.useContext(m.LexicalComposerContext);null==n&&t(9);let [f,{getTheme:w}]=n,y=r.useMemo(()=>{var b=u||w()||void 0;const x=m.createLexicalComposerContext(n,b);void 0!==b&&(a._config.theme=b);a._parentEditor=f;if(e)for(var c of e){var g=b=null;"function"!==typeof c&&(g=c,c=g.replace,b=g.with,g=g.withKlass||null);const k=a._nodes.get(c.getType());a._nodes.set(c.getType(),
9
- {exportDOM:k?k.exportDOM:void 0,klass:c,replace:b,replaceWithKlass:g,transforms:new Set})}else{c=a._nodes=new Map(f._nodes);for(const [k,l]of c)a._nodes.set(k,{exportDOM:l.exportDOM,klass:l.klass,replace:l.replace,replaceWithKlass:l.replaceWithKlass,transforms:new Set})}a._config.namespace=f._config.namespace;a._editable=f._editable;return[a,x]},[]),{isCollabActive:z,yjsDocMap:A}=d.useCollaborationContext(),p=v||q.current||A.has(a.getKey());r.useEffect(()=>{p&&(q.current=!0)},[p]);r.useEffect(()=>
10
- f.registerEditableListener(b=>{a.setEditable(b)}),[a,f]);return r.createElement(m.LexicalComposerContext.Provider,{value:y},!z||p?h:null)}
7
+ 'use strict';var d=require("@lexical/react/LexicalCollaborationContext"),m=require("@lexical/react/LexicalComposerContext"),q=require("react");function t(a){let h=new URLSearchParams;h.append("code",a);for(let e=1;e<arguments.length;e++)h.append("v",arguments[e]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${h} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
8
+ function u(a){a=a.transform();return null!==a?new Set([a]):new Set}
9
+ exports.LexicalNestedComposer=function({initialEditor:a,children:h,initialNodes:e,initialTheme:v,skipCollabChecks:w}){let r=q.useRef(!1),n=q.useContext(m.LexicalComposerContext);null==n&&t(9);let [f,{getTheme:x}]=n,z=q.useMemo(()=>{var c=v||x()||void 0;const y=m.createLexicalComposerContext(n,c);void 0!==c&&(a._config.theme=c);a._parentEditor=f;if(e)for(var b of e){var g=c=null;"function"!==typeof b&&(g=b,b=g.replace,c=g.with,g=g.withKlass||null);const l=a._nodes.get(b.getType());a._nodes.set(b.getType(),
10
+ {exportDOM:l?l.exportDOM:void 0,klass:b,replace:c,replaceWithKlass:g,transforms:u(b)})}else{b=a._nodes=new Map(f._nodes);for(const [l,k]of b)a._nodes.set(l,{exportDOM:k.exportDOM,klass:k.klass,replace:k.replace,replaceWithKlass:k.replaceWithKlass,transforms:u(k.klass)})}a._config.namespace=f._config.namespace;a._editable=f._editable;return[a,y]},[]),{isCollabActive:A,yjsDocMap:B}=d.useCollaborationContext(),p=w||r.current||B.has(a.getKey());q.useEffect(()=>{p&&(r.current=!0)},[p]);q.useEffect(()=>
11
+ f.registerEditableListener(c=>{a.setEditable(c)}),[a,f]);return q.createElement(m.LexicalComposerContext.Provider,{value:z},!A||p?h:null)}
@@ -0,0 +1,7 @@
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
+ import{useCollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{LexicalComposerContext as t,createLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import*as o from"react";import{useRef as n,useContext as l,useMemo as i,useEffect as a}from"react";var s=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};function c(e){const t=e.transform();return null!==t?new Set([t]):new Set}function p({initialEditor:p,children:f,initialNodes:d,initialTheme:m,skipCollabChecks:u}){const h=n(!1),x=l(t);null==x&&s(9);const[g,{getTheme:v}]=x,_=i((()=>{const e=m||v()||void 0,t=r(x,e);if(void 0!==e&&(p._config.theme=e),p._parentEditor=g,d)for(let e of d){let t=null,r=null;if("function"!=typeof e){const o=e;e=o.replace,t=o.with,r=o.withKlass||null}const o=p._nodes.get(e.getType());p._nodes.set(e.getType(),{exportDOM:o?o.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,transforms:c(e)})}else{const e=p._nodes=new Map(g._nodes);for(const[t,r]of e)p._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,transforms:c(r.klass)})}return p._config.namespace=g._config.namespace,p._editable=g._editable,[p,t]}),[]),{isCollabActive:w,yjsDocMap:b}=e(),C=u||h.current||b.has(p.getKey());return a((()=>{C&&(h.current=!0)}),[C]),a((()=>g.registerEditableListener((e=>{p.setEditable(e)}))),[p,g]),o.createElement(t.Provider,{value:_},!w||C?f:null)}export{p as LexicalNestedComposer};
@@ -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
+ import * as modDev from './LexicalNodeEventPlugin.dev.mjs';
8
+ import * as modProd from './LexicalNodeEventPlugin.prod.mjs';
9
+ const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
+ export const NodeEventPlugin = mod.NodeEventPlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalNodeEventPlugin.dev.mjs') : import('./LexicalNodeEventPlugin.prod.mjs'));
8
+ export const NodeEventPlugin = mod.NodeEventPlugin;
@@ -4,8 +4,8 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalNodeMenuPlugin.dev.esm.js';
8
- import * as modProd from './LexicalNodeMenuPlugin.prod.esm.js';
7
+ import * as modDev from './LexicalNodeMenuPlugin.dev.mjs';
8
+ import * as modProd from './LexicalNodeMenuPlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
10
  export const LexicalNodeMenuPlugin = mod.LexicalNodeMenuPlugin;
11
11
  export const MenuOption = mod.MenuOption;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalNodeMenuPlugin.dev.mjs') : import('./LexicalNodeMenuPlugin.prod.mjs'));
8
+ export const LexicalNodeMenuPlugin = mod.LexicalNodeMenuPlugin;
9
+ export const MenuOption = mod.MenuOption;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as modDev from './LexicalComposer.dev.esm.js';
8
- import * as modProd from './LexicalComposer.prod.esm.js';
7
+ import * as modDev from './LexicalOnChangePlugin.dev.mjs';
8
+ import * as modProd from './LexicalOnChangePlugin.prod.mjs';
9
9
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
- export const LexicalComposer = mod.LexicalComposer;
10
+ export const OnChangePlugin = mod.OnChangePlugin;
@@ -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
+ const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalOnChangePlugin.dev.mjs') : import('./LexicalOnChangePlugin.prod.mjs'));
8
+ export const OnChangePlugin = mod.OnChangePlugin;
@@ -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
+ import * as modDev from './LexicalPlainTextPlugin.dev.mjs';
8
+ import * as modProd from './LexicalPlainTextPlugin.prod.mjs';
9
+ const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
10
+ export const PlainTextPlugin = mod.PlainTextPlugin;