@depup/lexical__react 0.41.0-depup.0 → 0.43.0-depup.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 (108) hide show
  1. package/LexicalAutoEmbedPlugin.d.ts +2 -2
  2. package/LexicalAutoEmbedPlugin.js.flow +4 -4
  3. package/LexicalAutoFocusPlugin.js.flow +1 -1
  4. package/LexicalBlockWithAlignableContents.js.flow +2 -2
  5. package/LexicalClearEditorPlugin.js.flow +1 -1
  6. package/LexicalComposer.js.flow +2 -2
  7. package/LexicalContentEditable.js.flow +6 -6
  8. package/LexicalDecoratorBlockNode.d.ts +2 -0
  9. package/LexicalDecoratorBlockNode.dev.js +7 -0
  10. package/LexicalDecoratorBlockNode.dev.mjs +7 -0
  11. package/LexicalDecoratorBlockNode.prod.js +1 -1
  12. package/LexicalDecoratorBlockNode.prod.mjs +1 -1
  13. package/LexicalDraggableBlockPlugin.dev.js +2 -4
  14. package/LexicalDraggableBlockPlugin.dev.mjs +2 -4
  15. package/LexicalDraggableBlockPlugin.js.flow +1 -1
  16. package/LexicalDraggableBlockPlugin.prod.js +1 -1
  17. package/LexicalDraggableBlockPlugin.prod.mjs +1 -1
  18. package/LexicalEditorRefPlugin.d.ts +1 -1
  19. package/LexicalEditorRefPlugin.dev.js +0 -1
  20. package/LexicalEditorRefPlugin.dev.mjs +0 -1
  21. package/LexicalEditorRefPlugin.js.flow +1 -1
  22. package/LexicalErrorBoundary.js.flow +1 -1
  23. package/LexicalExtensionComposer.d.ts +1 -1
  24. package/LexicalExtensionEditorComposer.d.ts +20 -0
  25. package/LexicalExtensionEditorComposer.dev.js +55 -0
  26. package/LexicalExtensionEditorComposer.dev.mjs +53 -0
  27. package/LexicalExtensionEditorComposer.js +11 -0
  28. package/LexicalExtensionEditorComposer.js.flow +27 -0
  29. package/{LexicalContextMenuPlugin.mjs → LexicalExtensionEditorComposer.mjs} +3 -4
  30. package/{LexicalContextMenuPlugin.node.mjs → LexicalExtensionEditorComposer.node.mjs} +2 -3
  31. package/LexicalExtensionEditorComposer.prod.js +9 -0
  32. package/LexicalExtensionEditorComposer.prod.mjs +9 -0
  33. package/LexicalHorizontalRulePlugin.d.ts +3 -0
  34. package/LexicalHorizontalRulePlugin.dev.js +4 -0
  35. package/LexicalHorizontalRulePlugin.dev.mjs +4 -0
  36. package/LexicalHorizontalRulePlugin.js.flow +1 -1
  37. package/LexicalLinkPlugin.js.flow +1 -1
  38. package/LexicalMarkdownShortcutPlugin.dev.js +4 -4
  39. package/LexicalMarkdownShortcutPlugin.dev.mjs +1 -1
  40. package/LexicalMarkdownShortcutPlugin.prod.js +1 -1
  41. package/LexicalMarkdownShortcutPlugin.prod.mjs +1 -1
  42. package/LexicalNestedComposer.js.flow +1 -1
  43. package/LexicalNodeContextMenuPlugin.dev.js +2 -4
  44. package/LexicalNodeContextMenuPlugin.dev.mjs +2 -4
  45. package/LexicalNodeContextMenuPlugin.prod.js +1 -1
  46. package/LexicalNodeContextMenuPlugin.prod.mjs +1 -1
  47. package/LexicalNodeEventPlugin.dev.js +2 -4
  48. package/LexicalNodeEventPlugin.dev.mjs +2 -4
  49. package/LexicalNodeEventPlugin.prod.js +1 -1
  50. package/LexicalNodeEventPlugin.prod.mjs +1 -1
  51. package/LexicalNodeMenuPlugin.d.ts +1 -1
  52. package/LexicalNodeMenuPlugin.dev.js +53 -2
  53. package/LexicalNodeMenuPlugin.dev.mjs +54 -3
  54. package/LexicalNodeMenuPlugin.js.flow +3 -2
  55. package/LexicalNodeMenuPlugin.prod.js +1 -1
  56. package/LexicalNodeMenuPlugin.prod.mjs +1 -1
  57. package/LexicalPlainTextPlugin.dev.js +0 -3
  58. package/LexicalPlainTextPlugin.dev.mjs +0 -3
  59. package/LexicalReactExtension.dev.js +1 -3
  60. package/LexicalReactExtension.dev.mjs +1 -3
  61. package/LexicalReactExtension.js.flow +1 -1
  62. package/LexicalReactPluginHostExtension.dev.mjs +1 -1
  63. package/LexicalReactPluginHostExtension.js.flow +3 -3
  64. package/LexicalReactPluginHostExtension.prod.mjs +1 -1
  65. package/LexicalRichTextPlugin.dev.js +0 -3
  66. package/LexicalRichTextPlugin.dev.mjs +0 -3
  67. package/LexicalSelectionAlwaysOnDisplay.d.ts +1 -1
  68. package/LexicalTabIndentationPlugin.js.flow +1 -1
  69. package/LexicalTablePlugin.d.ts +1 -7
  70. package/LexicalTablePlugin.dev.js +2 -5
  71. package/LexicalTablePlugin.dev.mjs +2 -5
  72. package/LexicalTablePlugin.js.flow +1 -1
  73. package/LexicalTablePlugin.prod.js +1 -1
  74. package/LexicalTablePlugin.prod.mjs +1 -1
  75. package/LexicalTypeaheadMenuPlugin.d.ts +1 -1
  76. package/LexicalTypeaheadMenuPlugin.dev.js +53 -2
  77. package/LexicalTypeaheadMenuPlugin.dev.mjs +54 -3
  78. package/LexicalTypeaheadMenuPlugin.js.flow +8 -7
  79. package/LexicalTypeaheadMenuPlugin.prod.js +1 -1
  80. package/LexicalTypeaheadMenuPlugin.prod.mjs +1 -1
  81. package/README.md +2 -2
  82. package/changes.json +1 -1
  83. package/package.json +80 -50
  84. package/shared/LexicalMenu.d.ts +5 -4
  85. package/useExtensionComponent.d.ts +2 -0
  86. package/useExtensionSignalValue.d.ts +61 -0
  87. package/useLexicalExtensionComponent.dev.js +8 -0
  88. package/useLexicalExtensionComponent.dev.mjs +8 -2
  89. package/useLexicalExtensionComponent.mjs +3 -1
  90. package/useLexicalExtensionComponent.node.mjs +3 -1
  91. package/useLexicalExtensionComponent.prod.js +1 -1
  92. package/useLexicalExtensionComponent.prod.mjs +1 -1
  93. package/useLexicalExtensionSignalValue.dev.js +84 -0
  94. package/useLexicalExtensionSignalValue.dev.mjs +81 -0
  95. package/useLexicalExtensionSignalValue.js +11 -0
  96. package/useLexicalExtensionSignalValue.js.flow +18 -0
  97. package/useLexicalExtensionSignalValue.mjs +13 -0
  98. package/useLexicalExtensionSignalValue.node.mjs +11 -0
  99. package/useLexicalExtensionSignalValue.prod.js +9 -0
  100. package/useLexicalExtensionSignalValue.prod.mjs +9 -0
  101. package/useLexicalTextEntity.js.flow +1 -1
  102. package/LexicalContextMenuPlugin.d.ts +0 -42
  103. package/LexicalContextMenuPlugin.dev.js +0 -526
  104. package/LexicalContextMenuPlugin.dev.mjs +0 -511
  105. package/LexicalContextMenuPlugin.js +0 -11
  106. package/LexicalContextMenuPlugin.js.flow +0 -13
  107. package/LexicalContextMenuPlugin.prod.js +0 -9
  108. package/LexicalContextMenuPlugin.prod.mjs +0 -9
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import type { CommandListenerPriority, LexicalNode } from 'lexical';
9
9
  import type { JSX } from 'react';
10
- import { MenuOption, MenuRenderFn } from '@lexical/react/LexicalNodeMenuPlugin';
10
+ import { MenuOption, type MenuRenderFn } from '@lexical/react/LexicalNodeMenuPlugin';
11
11
  import { LexicalCommand, LexicalEditor } from 'lexical';
12
12
  export type EmbedMatchResult<TEmbedMatchResult = unknown> = {
13
13
  url: string;
@@ -32,7 +32,7 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig extends EmbedConfig> = {
32
32
  embedConfigs: Array<TEmbedConfig>;
33
33
  onOpenEmbedModalForConfig: (embedConfig: TEmbedConfig) => void;
34
34
  getMenuOptions: (activeEmbedConfig: TEmbedConfig, embedFn: () => void, dismissFn: () => void) => Array<AutoEmbedOption>;
35
- menuRenderFn: MenuRenderFn<AutoEmbedOption>;
35
+ menuRenderFn?: MenuRenderFn<AutoEmbedOption>;
36
36
  menuCommandPriority?: CommandListenerPriority;
37
37
  };
38
38
  export declare function LexicalAutoEmbedPlugin<TEmbedConfig extends EmbedConfig>({ embedConfigs, onOpenEmbedModalForConfig, getMenuOptions, menuRenderFn, menuCommandPriority, }: LexicalAutoEmbedPluginProps<TEmbedConfig>): JSX.Element | null;
@@ -10,10 +10,10 @@
10
10
  import type {LexicalNode, MutationListener} from 'lexical';
11
11
 
12
12
  import {MenuOption} from '@lexical/react/LexicalTypeaheadMenuPlugin';
13
+ import type {MenuRenderFn} from '@lexical/react/LexicalTypeaheadMenuPlugin';
13
14
  import type {LexicalCommand, LexicalEditor, NodeKey, TextNode} from 'lexical';
14
15
  import * as React from 'react';
15
16
  import {createCommand} from 'lexical';
16
- import type {MenuRenderFn} from './LexicalTypeaheadMenuPlugin';
17
17
 
18
18
  export type EmbedMatchResult = {
19
19
  url: string,
@@ -43,17 +43,17 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig> = {
43
43
  embedFn: () => void,
44
44
  dismissFn: () => void,
45
45
  ) => Array<AutoEmbedOption>,
46
- menuRenderFn: MenuRenderFn<AutoEmbedOption>,
46
+ menuRenderFn?: MenuRenderFn<AutoEmbedOption>,
47
47
  };
48
48
 
49
49
  declare export class AutoEmbedOption extends MenuOption {
50
50
  title: string;
51
- icon: React.MixedElement;
51
+ icon?: React.MixedElement;
52
52
  onSelect: (targetNode: LexicalNode | null) => void;
53
53
  constructor(
54
54
  title: string,
55
55
  options: {
56
- icon: React.MixedElement,
56
+ icon?: React.MixedElement,
57
57
  onSelect: (targetNode: LexicalNode | null) => void,
58
58
  },
59
59
  ): void;
@@ -7,7 +7,7 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- type Props = $ReadOnly<{
10
+ type Props = Readonly<{
11
11
  defaultSelection?: 'rootStart' | 'rootEnd',
12
12
  }>;
13
13
 
@@ -15,11 +15,11 @@ import type {
15
15
  NodeKey,
16
16
  } from 'lexical';
17
17
 
18
- type Props = $ReadOnly<{
18
+ type Props = Readonly<{
19
19
  children: React.Node,
20
20
  format: ?ElementFormatType,
21
21
  nodeKey: NodeKey,
22
- className: $ReadOnly<{
22
+ className: Readonly<{
23
23
  base: string,
24
24
  focus: string,
25
25
  }>,
@@ -7,7 +7,7 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- type Props = $ReadOnly<{
10
+ type Props = Readonly<{
11
11
  onClear?: () => void,
12
12
  }>;
13
13
 
@@ -22,10 +22,10 @@ export type InitialEditorStateType =
22
22
  | EditorState
23
23
  | ((editor: LexicalEditor) => void);
24
24
 
25
- export type InitialConfigType = $ReadOnly<{
25
+ export type InitialConfigType = Readonly<{
26
26
  editable?: boolean,
27
27
  namespace: string,
28
- nodes?: $ReadOnlyArray<Class<LexicalNode> | LexicalNodeReplacement>,
28
+ nodes?: ReadonlyArray<Class<LexicalNode> | LexicalNodeReplacement>,
29
29
  theme?: EditorThemeClasses,
30
30
  editorState?: InitialEditorStateType,
31
31
  onError: (error: Error, editor: LexicalEditor) => void,
@@ -14,11 +14,11 @@ import type {TRefFor} from 'CoreTypes.flow';
14
14
  import * as React from 'react';
15
15
 
16
16
  type InlineStyle = {
17
- [key: string]: mixed,
17
+ [key: string]: unknown,
18
18
  };
19
19
 
20
20
  // Due to Flow limitations, we prefer fixed types over the built-in inexact HTMLElement
21
- type HTMLDivElementDOMProps = $ReadOnly<{
21
+ type HTMLDivElementDOMProps = Readonly<{
22
22
  'aria-label'?: void | string,
23
23
  'aria-labeledby'?: void | string,
24
24
  'aria-activedescendant'?: void | string,
@@ -28,7 +28,7 @@ type HTMLDivElementDOMProps = $ReadOnly<{
28
28
  'aria-invalid'?: void | boolean,
29
29
  'aria-owns'?: void | string,
30
30
  'title'?: void | string,
31
- onClick?: void | ((e: SyntheticEvent<HTMLDivElement>) => mixed),
31
+ onClick?: void | ((e: SyntheticEvent<HTMLDivElement>) => unknown),
32
32
  autoCapitalize?: void | boolean,
33
33
  autoComplete?: void | boolean,
34
34
  autoCorrect?: void | boolean,
@@ -44,11 +44,11 @@ type HTMLDivElementDOMProps = $ReadOnly<{
44
44
  }>;
45
45
 
46
46
  export type PlaceholderProps =
47
- | $ReadOnly<{
47
+ | Readonly<{
48
48
  'aria-placeholder'?: void,
49
49
  placeholder?: null,
50
50
  }>
51
- | $ReadOnly<{
51
+ | Readonly<{
52
52
  'aria-placeholder': string,
53
53
  placeholder:
54
54
  | ((isEditable: boolean) => null | React.Node)
@@ -56,7 +56,7 @@ export type PlaceholderProps =
56
56
  | React.Node,
57
57
  }>;
58
58
 
59
- export type Props = $ReadOnly<{
59
+ export type Props = Readonly<{
60
60
  ...HTMLDivElementDOMProps,
61
61
  ariaActiveDescendant?: string,
62
62
  ariaAutoComplete?: string,
@@ -14,12 +14,14 @@ export type SerializedDecoratorBlockNode = Spread<{
14
14
  export declare class DecoratorBlockNode extends DecoratorNode<JSX.Element> {
15
15
  __format: ElementFormatType;
16
16
  constructor(format?: ElementFormatType, key?: NodeKey);
17
+ afterCloneFrom(prevNode: this): void;
17
18
  exportJSON(): SerializedDecoratorBlockNode;
18
19
  updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedDecoratorBlockNode>): this;
19
20
  canIndent(): false;
20
21
  createDOM(): HTMLElement;
21
22
  updateDOM(): false;
22
23
  setFormat(format: ElementFormatType): this;
24
+ getFormat(): ElementFormatType;
23
25
  isInline(): false;
24
26
  }
25
27
  export declare function $isDecoratorBlockNode(node: LexicalNode | null | undefined): node is DecoratorBlockNode;
@@ -24,6 +24,10 @@ class DecoratorBlockNode extends lexical.DecoratorNode {
24
24
  super(key);
25
25
  this.__format = format || '';
26
26
  }
27
+ afterCloneFrom(prevNode) {
28
+ super.afterCloneFrom(prevNode);
29
+ this.__format = prevNode.__format;
30
+ }
27
31
  exportJSON() {
28
32
  return {
29
33
  ...super.exportJSON(),
@@ -47,6 +51,9 @@ class DecoratorBlockNode extends lexical.DecoratorNode {
47
51
  self.__format = format;
48
52
  return self;
49
53
  }
54
+ getFormat() {
55
+ return this.getLatest().__format;
56
+ }
50
57
  isInline() {
51
58
  return false;
52
59
  }
@@ -22,6 +22,10 @@ class DecoratorBlockNode extends DecoratorNode {
22
22
  super(key);
23
23
  this.__format = format || '';
24
24
  }
25
+ afterCloneFrom(prevNode) {
26
+ super.afterCloneFrom(prevNode);
27
+ this.__format = prevNode.__format;
28
+ }
25
29
  exportJSON() {
26
30
  return {
27
31
  ...super.exportJSON(),
@@ -45,6 +49,9 @@ class DecoratorBlockNode extends DecoratorNode {
45
49
  self.__format = format;
46
50
  return self;
47
51
  }
52
+ getFormat() {
53
+ return this.getLatest().__format;
54
+ }
48
55
  isInline() {
49
56
  return false;
50
57
  }
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var r=require("lexical");class t extends r.DecoratorNode{__format;constructor(r,t){super(t),this.__format=r||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(r){return super.updateFromJSON(r).setFormat(r.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(r){const t=this.getWritable();return t.__format=r,t}isInline(){return!1}}exports.$isDecoratorBlockNode=function(r){return r instanceof t},exports.DecoratorBlockNode=t;
9
+ "use strict";var r=require("lexical");class t extends r.DecoratorNode{__format;constructor(r,t){super(t),this.__format=r||""}afterCloneFrom(r){super.afterCloneFrom(r),this.__format=r.__format}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(r){return super.updateFromJSON(r).setFormat(r.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(r){const t=this.getWritable();return t.__format=r,t}getFormat(){return this.getLatest().__format}isInline(){return!1}}exports.$isDecoratorBlockNode=function(r){return r instanceof t},exports.DecoratorBlockNode=t;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{DecoratorNode as t}from"lexical";class r extends t{__format;constructor(t,r){super(r),this.__format=t||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(t){const r=this.getWritable();return r.__format=t,r}isInline(){return!1}}function e(t){return t instanceof r}export{e as $isDecoratorBlockNode,r as DecoratorBlockNode};
9
+ import{DecoratorNode as t}from"lexical";class r extends t{__format;constructor(t,r){super(r),this.__format=t||""}afterCloneFrom(t){super.afterCloneFrom(t),this.__format=t.__format}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(t){const r=this.getWritable();return r.__format=t,r}getFormat(){return this.getLatest().__format}isInline(){return!1}}function e(t){return t instanceof r}export{e as $isDecoratorBlockNode,r as DecoratorBlockNode};
@@ -533,7 +533,7 @@ function useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, isEdi
533
533
  if (!IS_FIREFOX || !isEditable) {
534
534
  return;
535
535
  }
536
- return utils.mergeRegister(editor.registerRootListener((rootElement, prevRootElement) => {
536
+ return utils.mergeRegister(editor.registerRootListener(rootElement => {
537
537
  function onBlur(event) {
538
538
  const relatedTarget = event.relatedTarget;
539
539
  if (relatedTarget && relatedTarget instanceof HTMLElement && isOnMenu(relatedTarget)) {
@@ -557,9 +557,7 @@ function useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, isEdi
557
557
  }
558
558
  if (rootElement) {
559
559
  rootElement.addEventListener('blur', onBlur, true);
560
- }
561
- if (prevRootElement) {
562
- prevRootElement.removeEventListener('blur', onBlur, true);
560
+ return () => rootElement.removeEventListener('blur', onBlur, true);
563
561
  }
564
562
  }),
565
563
  // Intercept BLUR_COMMAND if focus is on the menu (fallback in case event propagation wasn't stopped)
@@ -531,7 +531,7 @@ function useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, isEdi
531
531
  if (!IS_FIREFOX || !isEditable) {
532
532
  return;
533
533
  }
534
- return mergeRegister(editor.registerRootListener((rootElement, prevRootElement) => {
534
+ return mergeRegister(editor.registerRootListener(rootElement => {
535
535
  function onBlur(event) {
536
536
  const relatedTarget = event.relatedTarget;
537
537
  if (relatedTarget && relatedTarget instanceof HTMLElement && isOnMenu(relatedTarget)) {
@@ -555,9 +555,7 @@ function useDraggableBlockMenu(editor, anchorElem, menuRef, targetLineRef, isEdi
555
555
  }
556
556
  if (rootElement) {
557
557
  rootElement.addEventListener('blur', onBlur, true);
558
- }
559
- if (prevRootElement) {
560
- prevRootElement.removeEventListener('blur', onBlur, true);
558
+ return () => rootElement.removeEventListener('blur', onBlur, true);
561
559
  }
562
560
  }),
563
561
  // Intercept BLUR_COMMAND if focus is on the menu (fallback in case event propagation wasn't stopped)
@@ -9,7 +9,7 @@
9
9
 
10
10
  import * as React from 'react';
11
11
 
12
- type Props = $ReadOnly<{
12
+ type Props = Readonly<{
13
13
  anchorElem?: ?HTMLElement,
14
14
  menuRef: React.RefObject<?HTMLElement>,
15
15
  targetLineRef: React.RefObject<?HTMLElement>,
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var t=require("@lexical/react/LexicalComposerContext"),e=require("@lexical/rich-text"),n=require("@lexical/utils"),o=require("lexical"),r=require("react"),i=require("react-dom"),s=require("react/jsx-runtime");const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a=l&&"documentMode"in document?document.documentMode:null,c=l&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);l&&"InputEvent"in window&&!a&&new window.InputEvent("input");class u{_x;_y;constructor(t,e){this._x=t,this._y=e}get x(){return this._x}get y(){return this._y}equals({x:t,y:e}){return this.x===t&&this.y===e}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}}class m{_left;_top;_right;_bottom;constructor(t,e,n,o){const[r,i]=e<=o?[e,o]:[o,e],[s,l]=t<=n?[t,n]:[n,t];this._top=r,this._right=l,this._left=s,this._bottom=i}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals({top:t,left:e,bottom:n,right:o}){return t===this._top&&n===this._bottom&&e===this._left&&o===this._right}contains(t){if(t instanceof u){const{x:e,y:n}=t,o=n<this._top,r=n>this._bottom,i=e<this._left,s=e>this._right;return{reason:{isOnBottomSide:r,isOnLeftSide:i,isOnRightSide:s,isOnTopSide:o},result:!(o||r||i||s)}}{const{top:e,left:n,bottom:o,right:r}=t;return e>=this._top&&e<=this._bottom&&o>=this._top&&o<=this._bottom&&n>=this._left&&n<=this._right&&r>=this._left&&r<=this._right}}intersectsWith(t){const{left:e,top:n,width:o,height:r}=t,{left:i,top:s,width:l,height:a}=this;return(e+o>=i+l?e+o:i+l)-(e<=i?e:i)<=o+l&&(n+r>=s+a?n+r:s+a)-(n<=s?n:s)<=r+a}generateNewRect({left:t=this.left,top:e=this.top,right:n=this.right,bottom:o=this.bottom}){return new m(t,e,n,o)}static fromLTRB(t,e,n,o){return new m(t,e,n,o)}static fromLWTH(t,e,n,o){return new m(t,n,t+e,n+o)}static fromPoints(t,e){const{y:n,x:o}=t,{y:r,x:i}=e;return m.fromLTRB(o,n,i,r)}static fromDOM(t){const{top:e,width:n,left:o,height:r}=t.getBoundingClientRect();return m.fromLWTH(o,n,e,r)}}const g="application/x-lexical-drag-block";let d=1/0;function f(t){const e=(t,e)=>t?parseFloat(window.getComputedStyle(t)[e]):0,{marginTop:n,marginBottom:o}=window.getComputedStyle(t),r=e(t.previousElementSibling,"marginBottom"),i=e(t.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),i),marginTop:s}}function h(t,e,r,i=!1){const s=t.getBoundingClientRect(),l=function(t){return t.getEditorState().read(()=>o.$getRoot().getChildrenKeys())}(e);let a=null;return e.getEditorState().read(()=>{if(i){const[t,o]=[e.getElementByKey(l[0]),e.getElementByKey(l[l.length-1])],[i,s]=[null!=t?t.getBoundingClientRect():void 0,null!=o?o.getBoundingClientRect():void 0];if(i&&s){const e=n.calculateZoomLevel(t),l=n.calculateZoomLevel(o);if(r.y/e<i.top?a=t:r.y/l>s.bottom&&(a=o),a)return}}let t=0===(o=l.length)?1/0:d>=0&&d<o?d:Math.floor(o/2);var o;let c=0;for(;t>=0&&t<l.length;){const o=l[t],i=e.getElementByKey(o);if(null===i)break;const g=n.calculateZoomLevel(i),h=new u(r.x/g,r.y/g),p=m.fromDOM(i),{marginTop:y,marginBottom:_}=f(i),v=p.generateNewRect({bottom:p.bottom+_,left:s.left,right:s.right,top:p.top-y}),{result:x,reason:{isOnTopSide:E,isOnBottomSide:M}}=v.contains(h);if(x){a=i,d=t;break}0===c&&(c=E?-1:M?1:1/0),t+=c}}),a}function p(t,l,a,u,m,d,p,y,_){const v=l.parentElement,x=r.useRef(!1),[E,M]=r.useState(null),R=r.useCallback(t=>{M(t),_&&_(t)},[_]);return r.useEffect(()=>{function e(e){const o=e.target;if(!n.isHTMLElement(o))return void R(null);if(y(o))return;const r=h(l,t,e);R(r)}function o(){R(null)}return null!=v&&(v.addEventListener("mousemove",e),v.addEventListener("mouseleave",o)),()=>{null!=v&&(v.removeEventListener("mousemove",e),v.removeEventListener("mouseleave",o))}},[v,l,t,y,R]),r.useEffect(()=>{const t=n.calculateZoomLevel(document.getElementsByClassName("ContentEditable__root")[0],!0);a.current&&function(t,e,n,o){if(!t)return void(e.style.display="none");const r=t.getBoundingClientRect(),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),l=n.getBoundingClientRect();let a=parseInt(i.lineHeight,10);isNaN(a)&&(a=r.bottom-r.top);const c=(r.top+(a-(s.height||a))/2-l.top+n.scrollTop)/o;e.style.display="flex",e.style.opacity="1",e.style.transform=`translate(4px, ${c}px)`}(E,a.current,l,t)},[l,E,a]),r.useEffect(()=>{function r(o){if(!x.current)return!1;const[r]=e.eventFiles(o);if(r)return!1;const{pageY:i,target:s}=o;if(!n.isHTMLElement(s))return!1;const a=h(l,t,o,!0),c=u.current;return null!==a&&null!==c&&(function(t,e,n,o){const{top:r,height:i}=e.getBoundingClientRect(),{top:s,width:l}=o.getBoundingClientRect(),{marginTop:a,marginBottom:c}=f(e);let u=r;n>=r?u+=i+c/2:u-=a/2;const m=u-s-2+o.scrollTop;t.style.transform=`translate(24px, ${m}px)`,t.style.width=l-48+"px",t.style.opacity=".4"}(c,a,i/n.calculateZoomLevel(s),l),o.preventDefault(),!0)}return n.mergeRegister(t.registerCommand(o.DRAGOVER_COMMAND,t=>r(t),o.COMMAND_PRIORITY_LOW),t.registerCommand(o.DROP_COMMAND,r=>function(r){if(!x.current)return!1;const[i]=e.eventFiles(r);if(i)return!1;const{target:s,dataTransfer:a,pageY:u}=r,m=null!=a?a.getData(g):"",d=o.$getNodeByKey(m);if(!d)return!1;if(!n.isHTMLElement(s))return!1;const f=h(l,t,r,!0);if(!f)return!1;const p=o.$getNearestNodeFromDOMNode(f);if(!p)return!1;if(p===d)return c&&t.focus(),!0;const y=f.getBoundingClientRect().top;return u/n.calculateZoomLevel(s)>=y?p.insertAfter(d):p.insertBefore(d),R(null),c&&o.$onUpdate(()=>{t.focus()}),!0}(r),o.COMMAND_PRIORITY_HIGH))},[l,t,u,R]),r.useEffect(()=>{if(c&&m)return n.mergeRegister(t.registerRootListener((e,n)=>{function r(n){const r=n.relatedTarget;r&&r instanceof HTMLElement&&y(r)&&(e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)})),n.stopImmediatePropagation())}e&&e.addEventListener("blur",r,!0),n&&n.removeEventListener("blur",r,!0)}),t.registerCommand(o.BLUR_COMMAND,()=>{const e=t.getRootElement(),n=document.activeElement;return!!(e&&n&&n instanceof HTMLElement&&y(n))&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)}),!0)},o.COMMAND_PRIORITY_HIGH))},[t,m,y]),i.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{draggable:!0,onDragStart:function(e){const n=e.dataTransfer;if(!n||!E)return;!function(t,e){const{transform:n}=e.style;e.style.transform="translateZ(0)",t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=n})}(n,E);let r="";if(t.update(()=>{const t=o.$getNearestNodeFromDOMNode(E);t&&(r=t.getKey())}),x.current=!0,n.setData(g,r),c){const e=t.getRootElement();null!==e&&document.activeElement!==e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)}))}},onDragEnd:function(){var e;x.current=!1,(e=u.current)&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"),c&&t.focus()},children:m&&d}),p]}),l)}exports.DraggableBlockPlugin_EXPERIMENTAL=function({anchorElem:e=document.body,menuRef:n,targetLineRef:o,menuComponent:r,targetLineComponent:i,isOnMenu:s,onElementChanged:l}){const[a]=t.useLexicalComposerContext();return p(a,e,n,o,a._editable,r,i,s,l)};
9
+ "use strict";var t=require("@lexical/react/LexicalComposerContext"),e=require("@lexical/rich-text"),n=require("@lexical/utils"),o=require("lexical"),r=require("react"),i=require("react-dom"),s=require("react/jsx-runtime");const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,a=l&&"documentMode"in document?document.documentMode:null,c=l&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);l&&"InputEvent"in window&&!a&&new window.InputEvent("input");class u{_x;_y;constructor(t,e){this._x=t,this._y=e}get x(){return this._x}get y(){return this._y}equals({x:t,y:e}){return this.x===t&&this.y===e}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}}class m{_left;_top;_right;_bottom;constructor(t,e,n,o){const[r,i]=e<=o?[e,o]:[o,e],[s,l]=t<=n?[t,n]:[n,t];this._top=r,this._right=l,this._left=s,this._bottom=i}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals({top:t,left:e,bottom:n,right:o}){return t===this._top&&n===this._bottom&&e===this._left&&o===this._right}contains(t){if(t instanceof u){const{x:e,y:n}=t,o=n<this._top,r=n>this._bottom,i=e<this._left,s=e>this._right;return{reason:{isOnBottomSide:r,isOnLeftSide:i,isOnRightSide:s,isOnTopSide:o},result:!(o||r||i||s)}}{const{top:e,left:n,bottom:o,right:r}=t;return e>=this._top&&e<=this._bottom&&o>=this._top&&o<=this._bottom&&n>=this._left&&n<=this._right&&r>=this._left&&r<=this._right}}intersectsWith(t){const{left:e,top:n,width:o,height:r}=t,{left:i,top:s,width:l,height:a}=this;return(e+o>=i+l?e+o:i+l)-(e<=i?e:i)<=o+l&&(n+r>=s+a?n+r:s+a)-(n<=s?n:s)<=r+a}generateNewRect({left:t=this.left,top:e=this.top,right:n=this.right,bottom:o=this.bottom}){return new m(t,e,n,o)}static fromLTRB(t,e,n,o){return new m(t,e,n,o)}static fromLWTH(t,e,n,o){return new m(t,n,t+e,n+o)}static fromPoints(t,e){const{y:n,x:o}=t,{y:r,x:i}=e;return m.fromLTRB(o,n,i,r)}static fromDOM(t){const{top:e,width:n,left:o,height:r}=t.getBoundingClientRect();return m.fromLWTH(o,n,e,r)}}const g="application/x-lexical-drag-block";let f=1/0;function d(t){const e=(t,e)=>t?parseFloat(window.getComputedStyle(t)[e]):0,{marginTop:n,marginBottom:o}=window.getComputedStyle(t),r=e(t.previousElementSibling,"marginBottom"),i=e(t.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),i),marginTop:s}}function h(t,e,r,i=!1){const s=t.getBoundingClientRect(),l=function(t){return t.getEditorState().read(()=>o.$getRoot().getChildrenKeys())}(e);let a=null;return e.getEditorState().read(()=>{if(i){const[t,o]=[e.getElementByKey(l[0]),e.getElementByKey(l[l.length-1])],[i,s]=[null!=t?t.getBoundingClientRect():void 0,null!=o?o.getBoundingClientRect():void 0];if(i&&s){const e=n.calculateZoomLevel(t),l=n.calculateZoomLevel(o);if(r.y/e<i.top?a=t:r.y/l>s.bottom&&(a=o),a)return}}let t=0===(o=l.length)?1/0:f>=0&&f<o?f:Math.floor(o/2);var o;let c=0;for(;t>=0&&t<l.length;){const o=l[t],i=e.getElementByKey(o);if(null===i)break;const g=n.calculateZoomLevel(i),h=new u(r.x/g,r.y/g),p=m.fromDOM(i),{marginTop:y,marginBottom:_}=d(i),v=p.generateNewRect({bottom:p.bottom+_,left:s.left,right:s.right,top:p.top-y}),{result:x,reason:{isOnTopSide:E,isOnBottomSide:M}}=v.contains(h);if(x){a=i,f=t;break}0===c&&(c=E?-1:M?1:1/0),t+=c}}),a}function p(t,l,a,u,m,f,p,y,_){const v=l.parentElement,x=r.useRef(!1),[E,M]=r.useState(null),R=r.useCallback(t=>{M(t),_&&_(t)},[_]);return r.useEffect(()=>{function e(e){const o=e.target;if(!n.isHTMLElement(o))return void R(null);if(y(o))return;const r=h(l,t,e);R(r)}function o(){R(null)}return null!=v&&(v.addEventListener("mousemove",e),v.addEventListener("mouseleave",o)),()=>{null!=v&&(v.removeEventListener("mousemove",e),v.removeEventListener("mouseleave",o))}},[v,l,t,y,R]),r.useEffect(()=>{const t=n.calculateZoomLevel(document.getElementsByClassName("ContentEditable__root")[0],!0);a.current&&function(t,e,n,o){if(!t)return void(e.style.display="none");const r=t.getBoundingClientRect(),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),l=n.getBoundingClientRect();let a=parseInt(i.lineHeight,10);isNaN(a)&&(a=r.bottom-r.top);const c=(r.top+(a-(s.height||a))/2-l.top+n.scrollTop)/o;e.style.display="flex",e.style.opacity="1",e.style.transform=`translate(4px, ${c}px)`}(E,a.current,l,t)},[l,E,a]),r.useEffect(()=>{function r(o){if(!x.current)return!1;const[r]=e.eventFiles(o);if(r)return!1;const{pageY:i,target:s}=o;if(!n.isHTMLElement(s))return!1;const a=h(l,t,o,!0),c=u.current;return null!==a&&null!==c&&(function(t,e,n,o){const{top:r,height:i}=e.getBoundingClientRect(),{top:s,width:l}=o.getBoundingClientRect(),{marginTop:a,marginBottom:c}=d(e);let u=r;n>=r?u+=i+c/2:u-=a/2;const m=u-s-2+o.scrollTop;t.style.transform=`translate(24px, ${m}px)`,t.style.width=l-48+"px",t.style.opacity=".4"}(c,a,i/n.calculateZoomLevel(s),l),o.preventDefault(),!0)}return n.mergeRegister(t.registerCommand(o.DRAGOVER_COMMAND,t=>r(t),o.COMMAND_PRIORITY_LOW),t.registerCommand(o.DROP_COMMAND,r=>function(r){if(!x.current)return!1;const[i]=e.eventFiles(r);if(i)return!1;const{target:s,dataTransfer:a,pageY:u}=r,m=null!=a?a.getData(g):"",f=o.$getNodeByKey(m);if(!f)return!1;if(!n.isHTMLElement(s))return!1;const d=h(l,t,r,!0);if(!d)return!1;const p=o.$getNearestNodeFromDOMNode(d);if(!p)return!1;if(p===f)return c&&t.focus(),!0;const y=d.getBoundingClientRect().top;return u/n.calculateZoomLevel(s)>=y?p.insertAfter(f):p.insertBefore(f),R(null),c&&o.$onUpdate(()=>{t.focus()}),!0}(r),o.COMMAND_PRIORITY_HIGH))},[l,t,u,R]),r.useEffect(()=>{if(c&&m)return n.mergeRegister(t.registerRootListener(e=>{function n(n){const r=n.relatedTarget;r&&r instanceof HTMLElement&&y(r)&&(e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)})),n.stopImmediatePropagation())}if(e)return e.addEventListener("blur",n,!0),()=>e.removeEventListener("blur",n,!0)}),t.registerCommand(o.BLUR_COMMAND,()=>{const e=t.getRootElement(),n=document.activeElement;return!!(e&&n&&n instanceof HTMLElement&&y(n))&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)}),!0)},o.COMMAND_PRIORITY_HIGH))},[t,m,y]),i.createPortal(s.jsxs(s.Fragment,{children:[s.jsx("div",{draggable:!0,onDragStart:function(e){const n=e.dataTransfer;if(!n||!E)return;!function(t,e){const{transform:n}=e.style;e.style.transform="translateZ(0)",t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=n})}(n,E);let r="";if(t.update(()=>{const t=o.$getNearestNodeFromDOMNode(E);t&&(r=t.getKey())}),x.current=!0,n.setData(g,r),c){const e=t.getRootElement();null!==e&&document.activeElement!==e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=o.$getSelection();null===t||t.dirty||(t.dirty=!0)}))}},onDragEnd:function(){var e;x.current=!1,(e=u.current)&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"),c&&t.focus()},children:m&&f}),p]}),l)}exports.DraggableBlockPlugin_EXPERIMENTAL=function({anchorElem:e=document.body,menuRef:n,targetLineRef:o,menuComponent:r,targetLineComponent:i,isOnMenu:s,onElementChanged:l}){const[a]=t.useLexicalComposerContext();return p(a,e,n,o,a._editable,r,i,s,l)};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{eventFiles as e}from"@lexical/rich-text";import{calculateZoomLevel as n,mergeRegister as o,isHTMLElement as r}from"@lexical/utils";import{DRAGOVER_COMMAND as i,COMMAND_PRIORITY_LOW as s,DROP_COMMAND as l,COMMAND_PRIORITY_HIGH as a,BLUR_COMMAND as c,$getSelection as u,$getNodeByKey as m,$getNearestNodeFromDOMNode as g,$onUpdate as h,$getRoot as f}from"lexical";import{useRef as d,useState as p,useCallback as y,useEffect as _}from"react";import{createPortal as x}from"react-dom";import{jsxs as b,Fragment as v,jsx as w}from"react/jsx-runtime";const E="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,T=E&&"documentMode"in document?document.documentMode:null,B=E&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);E&&"InputEvent"in window&&!T&&new window.InputEvent("input");class C{_x;_y;constructor(t,e){this._x=t,this._y=e}get x(){return this._x}get y(){return this._y}equals({x:t,y:e}){return this.x===t&&this.y===e}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}}class R{_left;_top;_right;_bottom;constructor(t,e,n,o){const[r,i]=e<=o?[e,o]:[o,e],[s,l]=t<=n?[t,n]:[n,t];this._top=r,this._right=l,this._left=s,this._bottom=i}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals({top:t,left:e,bottom:n,right:o}){return t===this._top&&n===this._bottom&&e===this._left&&o===this._right}contains(t){if(t instanceof C){const{x:e,y:n}=t,o=n<this._top,r=n>this._bottom,i=e<this._left,s=e>this._right;return{reason:{isOnBottomSide:r,isOnLeftSide:i,isOnRightSide:s,isOnTopSide:o},result:!(o||r||i||s)}}{const{top:e,left:n,bottom:o,right:r}=t;return e>=this._top&&e<=this._bottom&&o>=this._top&&o<=this._bottom&&n>=this._left&&n<=this._right&&r>=this._left&&r<=this._right}}intersectsWith(t){const{left:e,top:n,width:o,height:r}=t,{left:i,top:s,width:l,height:a}=this;return(e+o>=i+l?e+o:i+l)-(e<=i?e:i)<=o+l&&(n+r>=s+a?n+r:s+a)-(n<=s?n:s)<=r+a}generateNewRect({left:t=this.left,top:e=this.top,right:n=this.right,bottom:o=this.bottom}){return new R(t,e,n,o)}static fromLTRB(t,e,n,o){return new R(t,e,n,o)}static fromLWTH(t,e,n,o){return new R(t,n,t+e,n+o)}static fromPoints(t,e){const{y:n,x:o}=t,{y:r,x:i}=e;return R.fromLTRB(o,n,i,r)}static fromDOM(t){const{top:e,width:n,left:o,height:r}=t.getBoundingClientRect();return R.fromLWTH(o,n,e,r)}}const S="application/x-lexical-drag-block";let D=1/0;function L(t){const e=(t,e)=>t?parseFloat(window.getComputedStyle(t)[e]):0,{marginTop:n,marginBottom:o}=window.getComputedStyle(t),r=e(t.previousElementSibling,"marginBottom"),i=e(t.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),i),marginTop:s}}function M(t,e,o,r=!1){const i=t.getBoundingClientRect(),s=function(t){return t.getEditorState().read(()=>f().getChildrenKeys())}(e);let l=null;return e.getEditorState().read(()=>{if(r){const[t,r]=[e.getElementByKey(s[0]),e.getElementByKey(s[s.length-1])],[i,a]=[null!=t?t.getBoundingClientRect():void 0,null!=r?r.getBoundingClientRect():void 0];if(i&&a){const e=n(t),s=n(r);if(o.y/e<i.top?l=t:o.y/s>a.bottom&&(l=r),l)return}}let t=0===(a=s.length)?1/0:D>=0&&D<a?D:Math.floor(a/2);var a;let c=0;for(;t>=0&&t<s.length;){const r=s[t],a=e.getElementByKey(r);if(null===a)break;const u=n(a),m=new C(o.x/u,o.y/u),g=R.fromDOM(a),{marginTop:h,marginBottom:f}=L(a),d=g.generateNewRect({bottom:g.bottom+f,left:i.left,right:i.right,top:g.top-h}),{result:p,reason:{isOnTopSide:y,isOnBottomSide:_}}=d.contains(m);if(p){l=a,D=t;break}0===c&&(c=y?-1:_?1:1/0),t+=c}}),l}function O(t,f,E,T,C,R,D,O,H){const I=f.parentElement,K=d(!1),[N,Y]=p(null),k=y(t=>{Y(t),H&&H(t)},[H]);return _(()=>{function e(e){const n=e.target;if(!r(n))return void k(null);if(O(n))return;const o=M(f,t,e);k(o)}function n(){k(null)}return null!=I&&(I.addEventListener("mousemove",e),I.addEventListener("mouseleave",n)),()=>{null!=I&&(I.removeEventListener("mousemove",e),I.removeEventListener("mouseleave",n))}},[I,f,t,O,k]),_(()=>{const t=n(document.getElementsByClassName("ContentEditable__root")[0],!0);E.current&&function(t,e,n,o){if(!t)return void(e.style.display="none");const r=t.getBoundingClientRect(),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),l=n.getBoundingClientRect();let a=parseInt(i.lineHeight,10);isNaN(a)&&(a=r.bottom-r.top);const c=(r.top+(a-(s.height||a))/2-l.top+n.scrollTop)/o;e.style.display="flex",e.style.opacity="1",e.style.transform=`translate(4px, ${c}px)`}(N,E.current,f,t)},[f,N,E]),_(()=>{function c(o){if(!K.current)return!1;const[i]=e(o);if(i)return!1;const{pageY:s,target:l}=o;if(!r(l))return!1;const a=M(f,t,o,!0),c=T.current;return null!==a&&null!==c&&(function(t,e,n,o){const{top:r,height:i}=e.getBoundingClientRect(),{top:s,width:l}=o.getBoundingClientRect(),{marginTop:a,marginBottom:c}=L(e);let u=r;n>=r?u+=i+c/2:u-=a/2;const m=u-s-2+o.scrollTop;t.style.transform=`translate(24px, ${m}px)`,t.style.width=l-48+"px",t.style.opacity=".4"}(c,a,s/n(l),f),o.preventDefault(),!0)}return o(t.registerCommand(i,t=>c(t),s),t.registerCommand(l,o=>function(o){if(!K.current)return!1;const[i]=e(o);if(i)return!1;const{target:s,dataTransfer:l,pageY:a}=o,c=null!=l?l.getData(S):"",u=m(c);if(!u)return!1;if(!r(s))return!1;const d=M(f,t,o,!0);if(!d)return!1;const p=g(d);if(!p)return!1;if(p===u)return B&&t.focus(),!0;const y=d.getBoundingClientRect().top;return a/n(s)>=y?p.insertAfter(u):p.insertBefore(u),k(null),B&&h(()=>{t.focus()}),!0}(o),a))},[f,t,T,k]),_(()=>{if(B&&C)return o(t.registerRootListener((e,n)=>{function o(n){const o=n.relatedTarget;o&&o instanceof HTMLElement&&O(o)&&(e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)})),n.stopImmediatePropagation())}e&&e.addEventListener("blur",o,!0),n&&n.removeEventListener("blur",o,!0)}),t.registerCommand(c,()=>{const e=t.getRootElement(),n=document.activeElement;return!!(e&&n&&n instanceof HTMLElement&&O(n))&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)}),!0)},a))},[t,C,O]),x(b(v,{children:[w("div",{draggable:!0,onDragStart:function(e){const n=e.dataTransfer;if(!n||!N)return;!function(t,e){const{transform:n}=e.style;e.style.transform="translateZ(0)",t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=n})}(n,N);let o="";if(t.update(()=>{const t=g(N);t&&(o=t.getKey())}),K.current=!0,n.setData(S,o),B){const e=t.getRootElement();null!==e&&document.activeElement!==e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)}))}},onDragEnd:function(){var e;K.current=!1,(e=T.current)&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"),B&&t.focus()},children:C&&R}),D]}),f)}function H({anchorElem:e=document.body,menuRef:n,targetLineRef:o,menuComponent:r,targetLineComponent:i,isOnMenu:s,onElementChanged:l}){const[a]=t();return O(a,e,n,o,a._editable,r,i,s,l)}export{H as DraggableBlockPlugin_EXPERIMENTAL};
9
+ import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{eventFiles as e}from"@lexical/rich-text";import{calculateZoomLevel as n,mergeRegister as o,isHTMLElement as r}from"@lexical/utils";import{DRAGOVER_COMMAND as i,COMMAND_PRIORITY_LOW as s,DROP_COMMAND as l,COMMAND_PRIORITY_HIGH as a,BLUR_COMMAND as c,$getSelection as u,$getNodeByKey as m,$getNearestNodeFromDOMNode as g,$onUpdate as h,$getRoot as f}from"lexical";import{useRef as d,useState as p,useCallback as y,useEffect as _}from"react";import{createPortal as x}from"react-dom";import{jsxs as b,Fragment as v,jsx as w}from"react/jsx-runtime";const E="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,T=E&&"documentMode"in document?document.documentMode:null,B=E&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);E&&"InputEvent"in window&&!T&&new window.InputEvent("input");class C{_x;_y;constructor(t,e){this._x=t,this._y=e}get x(){return this._x}get y(){return this._y}equals({x:t,y:e}){return this.x===t&&this.y===e}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}}class R{_left;_top;_right;_bottom;constructor(t,e,n,o){const[r,i]=e<=o?[e,o]:[o,e],[s,l]=t<=n?[t,n]:[n,t];this._top=r,this._right=l,this._left=s,this._bottom=i}get top(){return this._top}get right(){return this._right}get bottom(){return this._bottom}get left(){return this._left}get width(){return Math.abs(this._left-this._right)}get height(){return Math.abs(this._bottom-this._top)}equals({top:t,left:e,bottom:n,right:o}){return t===this._top&&n===this._bottom&&e===this._left&&o===this._right}contains(t){if(t instanceof C){const{x:e,y:n}=t,o=n<this._top,r=n>this._bottom,i=e<this._left,s=e>this._right;return{reason:{isOnBottomSide:r,isOnLeftSide:i,isOnRightSide:s,isOnTopSide:o},result:!(o||r||i||s)}}{const{top:e,left:n,bottom:o,right:r}=t;return e>=this._top&&e<=this._bottom&&o>=this._top&&o<=this._bottom&&n>=this._left&&n<=this._right&&r>=this._left&&r<=this._right}}intersectsWith(t){const{left:e,top:n,width:o,height:r}=t,{left:i,top:s,width:l,height:a}=this;return(e+o>=i+l?e+o:i+l)-(e<=i?e:i)<=o+l&&(n+r>=s+a?n+r:s+a)-(n<=s?n:s)<=r+a}generateNewRect({left:t=this.left,top:e=this.top,right:n=this.right,bottom:o=this.bottom}){return new R(t,e,n,o)}static fromLTRB(t,e,n,o){return new R(t,e,n,o)}static fromLWTH(t,e,n,o){return new R(t,n,t+e,n+o)}static fromPoints(t,e){const{y:n,x:o}=t,{y:r,x:i}=e;return R.fromLTRB(o,n,i,r)}static fromDOM(t){const{top:e,width:n,left:o,height:r}=t.getBoundingClientRect();return R.fromLWTH(o,n,e,r)}}const S="application/x-lexical-drag-block";let D=1/0;function L(t){const e=(t,e)=>t?parseFloat(window.getComputedStyle(t)[e]):0,{marginTop:n,marginBottom:o}=window.getComputedStyle(t),r=e(t.previousElementSibling,"marginBottom"),i=e(t.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),i),marginTop:s}}function M(t,e,o,r=!1){const i=t.getBoundingClientRect(),s=function(t){return t.getEditorState().read(()=>f().getChildrenKeys())}(e);let l=null;return e.getEditorState().read(()=>{if(r){const[t,r]=[e.getElementByKey(s[0]),e.getElementByKey(s[s.length-1])],[i,a]=[null!=t?t.getBoundingClientRect():void 0,null!=r?r.getBoundingClientRect():void 0];if(i&&a){const e=n(t),s=n(r);if(o.y/e<i.top?l=t:o.y/s>a.bottom&&(l=r),l)return}}let t=0===(a=s.length)?1/0:D>=0&&D<a?D:Math.floor(a/2);var a;let c=0;for(;t>=0&&t<s.length;){const r=s[t],a=e.getElementByKey(r);if(null===a)break;const u=n(a),m=new C(o.x/u,o.y/u),g=R.fromDOM(a),{marginTop:h,marginBottom:f}=L(a),d=g.generateNewRect({bottom:g.bottom+f,left:i.left,right:i.right,top:g.top-h}),{result:p,reason:{isOnTopSide:y,isOnBottomSide:_}}=d.contains(m);if(p){l=a,D=t;break}0===c&&(c=y?-1:_?1:1/0),t+=c}}),l}function O(t,f,E,T,C,R,D,O,H){const I=f.parentElement,K=d(!1),[N,Y]=p(null),k=y(t=>{Y(t),H&&H(t)},[H]);return _(()=>{function e(e){const n=e.target;if(!r(n))return void k(null);if(O(n))return;const o=M(f,t,e);k(o)}function n(){k(null)}return null!=I&&(I.addEventListener("mousemove",e),I.addEventListener("mouseleave",n)),()=>{null!=I&&(I.removeEventListener("mousemove",e),I.removeEventListener("mouseleave",n))}},[I,f,t,O,k]),_(()=>{const t=n(document.getElementsByClassName("ContentEditable__root")[0],!0);E.current&&function(t,e,n,o){if(!t)return void(e.style.display="none");const r=t.getBoundingClientRect(),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),l=n.getBoundingClientRect();let a=parseInt(i.lineHeight,10);isNaN(a)&&(a=r.bottom-r.top);const c=(r.top+(a-(s.height||a))/2-l.top+n.scrollTop)/o;e.style.display="flex",e.style.opacity="1",e.style.transform=`translate(4px, ${c}px)`}(N,E.current,f,t)},[f,N,E]),_(()=>{function c(o){if(!K.current)return!1;const[i]=e(o);if(i)return!1;const{pageY:s,target:l}=o;if(!r(l))return!1;const a=M(f,t,o,!0),c=T.current;return null!==a&&null!==c&&(function(t,e,n,o){const{top:r,height:i}=e.getBoundingClientRect(),{top:s,width:l}=o.getBoundingClientRect(),{marginTop:a,marginBottom:c}=L(e);let u=r;n>=r?u+=i+c/2:u-=a/2;const m=u-s-2+o.scrollTop;t.style.transform=`translate(24px, ${m}px)`,t.style.width=l-48+"px",t.style.opacity=".4"}(c,a,s/n(l),f),o.preventDefault(),!0)}return o(t.registerCommand(i,t=>c(t),s),t.registerCommand(l,o=>function(o){if(!K.current)return!1;const[i]=e(o);if(i)return!1;const{target:s,dataTransfer:l,pageY:a}=o,c=null!=l?l.getData(S):"",u=m(c);if(!u)return!1;if(!r(s))return!1;const d=M(f,t,o,!0);if(!d)return!1;const p=g(d);if(!p)return!1;if(p===u)return B&&t.focus(),!0;const y=d.getBoundingClientRect().top;return a/n(s)>=y?p.insertAfter(u):p.insertBefore(u),k(null),B&&h(()=>{t.focus()}),!0}(o),a))},[f,t,T,k]),_(()=>{if(B&&C)return o(t.registerRootListener(e=>{function n(n){const o=n.relatedTarget;o&&o instanceof HTMLElement&&O(o)&&(e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)})),n.stopImmediatePropagation())}if(e)return e.addEventListener("blur",n,!0),()=>e.removeEventListener("blur",n,!0)}),t.registerCommand(c,()=>{const e=t.getRootElement(),n=document.activeElement;return!!(e&&n&&n instanceof HTMLElement&&O(n))&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)}),!0)},a))},[t,C,O]),x(b(v,{children:[w("div",{draggable:!0,onDragStart:function(e){const n=e.dataTransfer;if(!n||!N)return;!function(t,e){const{transform:n}=e.style;e.style.transform="translateZ(0)",t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=n})}(n,N);let o="";if(t.update(()=>{const t=g(N);t&&(o=t.getKey())}),K.current=!0,n.setData(S,o),B){const e=t.getRootElement();null!==e&&document.activeElement!==e&&(e.focus({preventScroll:!0}),t.update(()=>{const t=u();null===t||t.dirty||(t.dirty=!0)}))}},onDragEnd:function(){var e;K.current=!1,(e=T.current)&&(e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)"),B&&t.focus()},children:C&&R}),D]}),f)}function H({anchorElem:e=document.body,menuRef:n,targetLineRef:o,menuComponent:r,targetLineComponent:i,isOnMenu:s,onElementChanged:l}){const[a]=t();return O(a,e,n,o,a._editable,r,i,s,l)}export{H as DraggableBlockPlugin_EXPERIMENTAL};
@@ -6,8 +6,8 @@
6
6
  *
7
7
  */
8
8
  import { LexicalEditor } from 'lexical';
9
- import { RefObject } from 'react';
10
9
  import * as React from 'react';
10
+ import { RefObject } from 'react';
11
11
  /**
12
12
  *
13
13
  * Use this plugin to access the editor instance outside of the
@@ -32,7 +32,6 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
32
32
  *
33
33
  */
34
34
 
35
-
36
35
  /**
37
36
  *
38
37
  * Use this plugin to access the editor instance outside of the
@@ -17,7 +17,6 @@ import * as React from 'react';
17
17
  *
18
18
  */
19
19
 
20
-
21
20
  /**
22
21
  *
23
22
  * Use this plugin to access the editor instance outside of the
@@ -12,7 +12,7 @@ import type {LexicalEditor} from 'lexical';
12
12
  import type {TRefFor} from 'CoreTypes.flow';
13
13
 
14
14
 
15
- type Props = $ReadOnly<{
15
+ type Props = Readonly<{
16
16
  editorRef: TRefFor<LexicalEditor>,
17
17
  }>;
18
18
 
@@ -7,7 +7,7 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- export type LexicalErrorBoundaryProps = $ReadOnly<{
10
+ export type LexicalErrorBoundaryProps = Readonly<{
11
11
  children: React.Node,
12
12
  onError: (error: Error) => void,
13
13
  }>;
@@ -8,7 +8,7 @@ export interface LexicalExtensionComposerProps {
8
8
  /**
9
9
  * Any children will have access to useLexicalComposerContext (e.g. for React plug-ins or UX)
10
10
  */
11
- children: React.ReactNode;
11
+ children?: React.ReactNode;
12
12
  /**
13
13
  * Override the default ContentEditable that is rendered as the first child of the
14
14
  * composer. If this is null, then it is your responsibility to render a ContentEditable
@@ -0,0 +1,20 @@
1
+ import { LexicalEditorWithDispose } from 'lexical';
2
+ export interface LexicalExtensionEditorComposerProps {
3
+ /**
4
+ * Your root extension, typically defined with {@link defineExtension}
5
+ */
6
+ initialEditor: LexicalEditorWithDispose;
7
+ /**
8
+ * Any children will have access to useLexicalComposerContext (e.g. for React plug-ins or UX)
9
+ */
10
+ children?: React.ReactNode;
11
+ }
12
+ /**
13
+ * The equivalent of LexicalComposer for an editor that was already built for
14
+ * extensions, typically used with nested editors.
15
+ *
16
+ * Make sure that your initialEditor argument is stable (e.g. using module scope or useMemo) so
17
+ * that you are not re-creating the editor on every render! The editor should be built with
18
+ * ReactProviderExtension and ReactExtension dependencies.
19
+ */
20
+ export declare function LexicalExtensionEditorComposer({ initialEditor: editor, children, }: LexicalExtensionEditorComposerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
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';
10
+
11
+ var extension = require('@lexical/extension');
12
+ var ReactExtension = require('@lexical/react/ReactExtension');
13
+ var react = require('react');
14
+ var jsxRuntime = require('react/jsx-runtime');
15
+
16
+ /**
17
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
18
+ *
19
+ * This source code is licensed under the MIT license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ *
22
+ */
23
+ /**
24
+ * The equivalent of LexicalComposer for an editor that was already built for
25
+ * extensions, typically used with nested editors.
26
+ *
27
+ * Make sure that your initialEditor argument is stable (e.g. using module scope or useMemo) so
28
+ * that you are not re-creating the editor on every render! The editor should be built with
29
+ * ReactProviderExtension and ReactExtension dependencies.
30
+ */
31
+ function LexicalExtensionEditorComposer({
32
+ initialEditor: editor,
33
+ children
34
+ }) {
35
+ react.useEffect(() => {
36
+ // Strict mode workaround
37
+ let didMount = false;
38
+ queueMicrotask(() => {
39
+ didMount = true;
40
+ });
41
+ return () => {
42
+ if (didMount) {
43
+ editor.dispose();
44
+ }
45
+ };
46
+ }, [editor]);
47
+ const {
48
+ Component
49
+ } = extension.getExtensionDependencyFromEditor(editor, ReactExtension.ReactExtension).output;
50
+ return /*#__PURE__*/jsxRuntime.jsx(Component, {
51
+ children: children
52
+ });
53
+ }
54
+
55
+ exports.LexicalExtensionEditorComposer = LexicalExtensionEditorComposer;
@@ -0,0 +1,53 @@
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 { getExtensionDependencyFromEditor } from '@lexical/extension';
10
+ import { ReactExtension } from '@lexical/react/ReactExtension';
11
+ import { useEffect } from 'react';
12
+ import { jsx } from 'react/jsx-runtime';
13
+
14
+ /**
15
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ *
20
+ */
21
+ /**
22
+ * The equivalent of LexicalComposer for an editor that was already built for
23
+ * extensions, typically used with nested editors.
24
+ *
25
+ * Make sure that your initialEditor argument is stable (e.g. using module scope or useMemo) so
26
+ * that you are not re-creating the editor on every render! The editor should be built with
27
+ * ReactProviderExtension and ReactExtension dependencies.
28
+ */
29
+ function LexicalExtensionEditorComposer({
30
+ initialEditor: editor,
31
+ children
32
+ }) {
33
+ useEffect(() => {
34
+ // Strict mode workaround
35
+ let didMount = false;
36
+ queueMicrotask(() => {
37
+ didMount = true;
38
+ });
39
+ return () => {
40
+ if (didMount) {
41
+ editor.dispose();
42
+ }
43
+ };
44
+ }, [editor]);
45
+ const {
46
+ Component
47
+ } = getExtensionDependencyFromEditor(editor, ReactExtension).output;
48
+ return /*#__PURE__*/jsx(Component, {
49
+ children: children
50
+ });
51
+ }
52
+
53
+ export { LexicalExtensionEditorComposer };
@@ -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
+ */
8
+
9
+ 'use strict'
10
+ const LexicalExtensionEditorComposer = process.env.NODE_ENV !== 'production' ? require('./LexicalExtensionEditorComposer.dev.js') : require('./LexicalExtensionEditorComposer.prod.js');
11
+ module.exports = LexicalExtensionEditorComposer;
@@ -0,0 +1,27 @@
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
+ * @flow strict
8
+ */
9
+
10
+ /**
11
+ * LexicalExtensionEditorComposer
12
+ */
13
+
14
+
15
+ import type {
16
+ LexicalEditorWithDispose,
17
+ EditorThemeClasses,
18
+ LexicalNode,
19
+ LexicalNodeReplacement,
20
+ } from 'lexical';
21
+
22
+ export type LexicalNestedComposerProps = {
23
+ children?: React.Node;
24
+ initialEditor: LexicalEditorWithDispose;
25
+ };
26
+
27
+ declare export function LexicalExtensionEditorComposer(props: LexicalNestedComposerProps): React.Node;
@@ -6,8 +6,7 @@
6
6
  *
7
7
  */
8
8
 
9
- import * as modDev from './LexicalContextMenuPlugin.dev.mjs';
10
- import * as modProd from './LexicalContextMenuPlugin.prod.mjs';
9
+ import * as modDev from './LexicalExtensionEditorComposer.dev.mjs';
10
+ import * as modProd from './LexicalExtensionEditorComposer.prod.mjs';
11
11
  const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
12
- export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
13
- export const MenuOption = mod.MenuOption;
12
+ export const LexicalExtensionEditorComposer = mod.LexicalExtensionEditorComposer;
@@ -6,6 +6,5 @@
6
6
  *
7
7
  */
8
8
 
9
- const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalContextMenuPlugin.dev.mjs') : import('./LexicalContextMenuPlugin.prod.mjs'));
10
- export const LexicalContextMenuPlugin = mod.LexicalContextMenuPlugin;
11
- export const MenuOption = mod.MenuOption;
9
+ const mod = await (process.env.NODE_ENV !== 'production' ? import('./LexicalExtensionEditorComposer.dev.mjs') : import('./LexicalExtensionEditorComposer.prod.mjs'));
10
+ export const LexicalExtensionEditorComposer = mod.LexicalExtensionEditorComposer;
@@ -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"),t=require("@lexical/react/ReactExtension"),r=require("react"),i=require("react/jsx-runtime");exports.LexicalExtensionEditorComposer=function({initialEditor:n,children:o}){r.useEffect(()=>{let e=!1;return queueMicrotask(()=>{e=!0}),()=>{e&&n.dispose()}},[n]);const{Component:c}=e.getExtensionDependencyFromEditor(n,t.ReactExtension).output;return i.jsx(c,{children:o})};
@@ -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{getExtensionDependencyFromEditor as t}from"@lexical/extension";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{useEffect as e}from"react";import{jsx as o}from"react/jsx-runtime";function i({initialEditor:i,children:n}){e(()=>{let t=!1;return queueMicrotask(()=>{t=!0}),()=>{t&&i.dispose()}},[i]);const{Component:c}=t(i,r).output;return o(c,{children:n})}export{i as LexicalExtensionEditorComposer};