@lexical/react 0.36.2-nightly.20250930.0 → 0.36.2

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 (87) hide show
  1. package/LexicalAutoEmbedPlugin.prod.js +1 -1
  2. package/LexicalAutoEmbedPlugin.prod.mjs +1 -1
  3. package/LexicalAutoFocusPlugin.prod.js +1 -1
  4. package/LexicalAutoFocusPlugin.prod.mjs +1 -1
  5. package/LexicalAutoLinkPlugin.prod.js +1 -1
  6. package/LexicalAutoLinkPlugin.prod.mjs +1 -1
  7. package/LexicalBlockWithAlignableContents.prod.js +1 -1
  8. package/LexicalBlockWithAlignableContents.prod.mjs +1 -1
  9. package/LexicalCharacterLimitPlugin.prod.js +1 -1
  10. package/LexicalCharacterLimitPlugin.prod.mjs +1 -1
  11. package/LexicalCheckListPlugin.prod.js +1 -1
  12. package/LexicalCheckListPlugin.prod.mjs +1 -1
  13. package/LexicalClearEditorPlugin.prod.js +1 -1
  14. package/LexicalClearEditorPlugin.prod.mjs +1 -1
  15. package/LexicalClickableLinkPlugin.prod.js +1 -1
  16. package/LexicalClickableLinkPlugin.prod.mjs +1 -1
  17. package/LexicalCollaborationContext.prod.js +1 -1
  18. package/LexicalCollaborationContext.prod.mjs +1 -1
  19. package/LexicalCollaborationPlugin.prod.js +1 -1
  20. package/LexicalCollaborationPlugin.prod.mjs +1 -1
  21. package/LexicalComposer.prod.js +1 -1
  22. package/LexicalComposer.prod.mjs +1 -1
  23. package/LexicalContentEditable.prod.js +1 -1
  24. package/LexicalContentEditable.prod.mjs +1 -1
  25. package/LexicalContextMenuPlugin.prod.js +1 -1
  26. package/LexicalContextMenuPlugin.prod.mjs +1 -1
  27. package/LexicalDraggableBlockPlugin.prod.js +1 -1
  28. package/LexicalDraggableBlockPlugin.prod.mjs +1 -1
  29. package/LexicalEditorRefPlugin.prod.js +1 -1
  30. package/LexicalEditorRefPlugin.prod.mjs +1 -1
  31. package/LexicalExtensionComposer.prod.js +1 -1
  32. package/LexicalExtensionComposer.prod.mjs +1 -1
  33. package/LexicalHashtagPlugin.prod.js +1 -1
  34. package/LexicalHashtagPlugin.prod.mjs +1 -1
  35. package/LexicalHistoryPlugin.prod.js +1 -1
  36. package/LexicalHistoryPlugin.prod.mjs +1 -1
  37. package/LexicalHorizontalRuleNode.prod.js +1 -1
  38. package/LexicalHorizontalRuleNode.prod.mjs +1 -1
  39. package/LexicalHorizontalRulePlugin.prod.js +1 -1
  40. package/LexicalHorizontalRulePlugin.prod.mjs +1 -1
  41. package/LexicalLinkPlugin.prod.js +1 -1
  42. package/LexicalLinkPlugin.prod.mjs +1 -1
  43. package/LexicalListPlugin.prod.js +1 -1
  44. package/LexicalListPlugin.prod.mjs +1 -1
  45. package/LexicalMarkdownShortcutPlugin.prod.js +1 -1
  46. package/LexicalMarkdownShortcutPlugin.prod.mjs +1 -1
  47. package/LexicalNestedComposer.prod.js +1 -1
  48. package/LexicalNestedComposer.prod.mjs +1 -1
  49. package/LexicalNodeContextMenuPlugin.prod.js +1 -1
  50. package/LexicalNodeContextMenuPlugin.prod.mjs +1 -1
  51. package/LexicalNodeEventPlugin.prod.js +1 -1
  52. package/LexicalNodeEventPlugin.prod.mjs +1 -1
  53. package/LexicalNodeMenuPlugin.prod.js +1 -1
  54. package/LexicalNodeMenuPlugin.prod.mjs +1 -1
  55. package/LexicalOnChangePlugin.prod.js +1 -1
  56. package/LexicalOnChangePlugin.prod.mjs +1 -1
  57. package/LexicalPlainTextPlugin.prod.js +1 -1
  58. package/LexicalPlainTextPlugin.prod.mjs +1 -1
  59. package/LexicalReactExtension.prod.js +1 -1
  60. package/LexicalReactExtension.prod.mjs +1 -1
  61. package/LexicalReactPluginHostExtension.prod.js +1 -1
  62. package/LexicalReactPluginHostExtension.prod.mjs +1 -1
  63. package/LexicalRichTextPlugin.prod.js +1 -1
  64. package/LexicalRichTextPlugin.prod.mjs +1 -1
  65. package/LexicalSelectionAlwaysOnDisplay.prod.js +1 -1
  66. package/LexicalSelectionAlwaysOnDisplay.prod.mjs +1 -1
  67. package/LexicalTabIndentationPlugin.prod.js +1 -1
  68. package/LexicalTabIndentationPlugin.prod.mjs +1 -1
  69. package/LexicalTableOfContentsPlugin.prod.js +1 -1
  70. package/LexicalTableOfContentsPlugin.prod.mjs +1 -1
  71. package/LexicalTablePlugin.prod.js +1 -1
  72. package/LexicalTablePlugin.prod.mjs +1 -1
  73. package/LexicalTreeView.prod.js +1 -1
  74. package/LexicalTreeView.prod.mjs +1 -1
  75. package/LexicalTypeaheadMenuPlugin.prod.js +1 -1
  76. package/LexicalTypeaheadMenuPlugin.prod.mjs +1 -1
  77. package/package.json +18 -18
  78. package/useLexicalEditable.prod.js +1 -1
  79. package/useLexicalEditable.prod.mjs +1 -1
  80. package/useLexicalIsTextContentEmpty.prod.js +1 -1
  81. package/useLexicalIsTextContentEmpty.prod.mjs +1 -1
  82. package/useLexicalNodeSelection.prod.js +1 -1
  83. package/useLexicalNodeSelection.prod.mjs +1 -1
  84. package/useLexicalSubscription.prod.js +1 -1
  85. package/useLexicalSubscription.prod.mjs +1 -1
  86. package/useLexicalTextEntity.prod.js +1 -1
  87. package/useLexicalTextEntity.prod.mjs +1 -1
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/history"),r=require("react");exports.createEmptyHistoryState=t.createEmptyHistoryState,exports.HistoryPlugin=function({delay:o,externalHistoryState:i}){const[s]=e.useLexicalComposerContext();return function(e,o,i=1e3){const s=r.useMemo((()=>o||t.createEmptyHistoryState()),[o]);r.useEffect((()=>t.registerHistory(e,s,i)),[i,e,s])}(s,i,o),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/history"),r=require("react");exports.createEmptyHistoryState=t.createEmptyHistoryState,exports.HistoryPlugin=function({delay:o,externalHistoryState:i}){const[s]=e.useLexicalComposerContext();return function(e,o,i=1e3){const s=r.useMemo(()=>o||t.createEmptyHistoryState(),[o]);r.useEffect(()=>t.registerHistory(e,s,i),[i,e,s])}(s,i,o),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createEmptyHistoryState as o,registerHistory as r}from"@lexical/history";export{createEmptyHistoryState}from"@lexical/history";import{useMemo as e,useEffect as i}from"react";function a({delay:a,externalHistoryState:c}){const[l]=t();return function(t,a,c=1e3){const l=e((()=>a||o()),[a]);i((()=>r(t,l,c)),[c,t,l])}(l,c,a),null}export{a as HistoryPlugin};
9
+ import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createEmptyHistoryState as o,registerHistory as r}from"@lexical/history";export{createEmptyHistoryState}from"@lexical/history";import{useMemo as e,useEffect as i}from"react";function a({delay:a,externalHistoryState:c}){const[l]=t();return function(t,a,c=1e3){const l=e(()=>a||o(),[a]);i(()=>r(t,l,c),[c,t,l])}(l,c,a),null}export{a as HistoryPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalNodeSelection"),o=require("@lexical/utils"),n=require("lexical"),i=require("react"),l=require("react/jsx-runtime");function s({nodeKey:e}){const[l]=t.useLexicalComposerContext(),[s,a,c]=r.useLexicalNodeSelection(e);return i.useEffect((()=>o.mergeRegister(l.registerCommand(n.CLICK_COMMAND,(t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||c(),a(!s),!0)}),n.COMMAND_PRIORITY_LOW))),[c,l,s,e,a]),i.useEffect((()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?o.addClassNamesToElement(t,r):o.removeClassNamesFromElement(t,r))}),[l,s,e]),null}class a extends e.HorizontalRuleNode{static getType(){return"horizontalrule"}static clone(e){return new a(e.__key)}static importJSON(e){return u().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:c,priority:0})}}decorate(){return l.jsx(s,{nodeKey:this.__key})}}function c(){return{node:u()}}function u(){return n.$applyNodeReplacement(new a)}exports.$isHorizontalRuleNode=e.$isHorizontalRuleNode,exports.INSERT_HORIZONTAL_RULE_COMMAND=e.INSERT_HORIZONTAL_RULE_COMMAND,exports.$createHorizontalRuleNode=u,exports.HorizontalRuleNode=a;
9
+ "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalNodeSelection"),o=require("@lexical/utils"),n=require("lexical"),i=require("react"),l=require("react/jsx-runtime");function s({nodeKey:e}){const[l]=t.useLexicalComposerContext(),[s,a,c]=r.useLexicalNodeSelection(e);return i.useEffect(()=>o.mergeRegister(l.registerCommand(n.CLICK_COMMAND,t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||c(),a(!s),!0)},n.COMMAND_PRIORITY_LOW)),[c,l,s,e,a]),i.useEffect(()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?o.addClassNamesToElement(t,r):o.removeClassNamesFromElement(t,r))},[l,s,e]),null}class a extends e.HorizontalRuleNode{static getType(){return"horizontalrule"}static clone(e){return new a(e.__key)}static importJSON(e){return u().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:c,priority:0})}}decorate(){return l.jsx(s,{nodeKey:this.__key})}}function c(){return{node:u()}}function u(){return n.$applyNodeReplacement(new a)}exports.$isHorizontalRuleNode=e.$isHorizontalRuleNode,exports.INSERT_HORIZONTAL_RULE_COMMAND=e.INSERT_HORIZONTAL_RULE_COMMAND,exports.$createHorizontalRuleNode=u,exports.HorizontalRuleNode=a;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{HorizontalRuleNode as e}from"@lexical/extension";export{$isHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as r}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as o,addClassNamesToElement as n,removeClassNamesFromElement as i}from"@lexical/utils";import{$applyNodeReplacement as l,CLICK_COMMAND as c,COMMAND_PRIORITY_LOW as a}from"lexical";import{useEffect as m}from"react";import{jsx as s}from"react/jsx-runtime";function u({nodeKey:e}){const[l]=t(),[s,u,p]=r(e);return m((()=>o(l.registerCommand(c,(t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||p(),u(!s),!0)}),a))),[p,l,s,e,u]),m((()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?n(t,r):i(t,r))}),[l,s,e]),null}class p extends e{static getType(){return"horizontalrule"}static clone(e){return new p(e.__key)}static importJSON(e){return f().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:x,priority:0})}}decorate(){return s(u,{nodeKey:this.__key})}}function x(){return{node:f()}}function f(){return l(new p)}export{f as $createHorizontalRuleNode,p as HorizontalRuleNode};
9
+ import{HorizontalRuleNode as e}from"@lexical/extension";export{$isHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as r}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as o,addClassNamesToElement as n,removeClassNamesFromElement as i}from"@lexical/utils";import{$applyNodeReplacement as l,CLICK_COMMAND as c,COMMAND_PRIORITY_LOW as a}from"lexical";import{useEffect as m}from"react";import{jsx as s}from"react/jsx-runtime";function u({nodeKey:e}){const[l]=t(),[s,u,p]=r(e);return m(()=>o(l.registerCommand(c,t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||p(),u(!s),!0)},a)),[p,l,s,e,u]),m(()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?n(t,r):i(t,r))},[l,s,e]),null}class p extends e{static getType(){return"horizontalrule"}static clone(e){return new p(e.__key)}static importJSON(e){return f().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:x,priority:0})}}decorate(){return s(u,{nodeKey:this.__key})}}function x(){return{node:f()}}function f(){return l(new p)}export{f as $createHorizontalRuleNode,p as HorizontalRuleNode};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/LexicalHorizontalRuleNode"),t=require("@lexical/utils"),o=require("lexical"),i=require("react");exports.HorizontalRulePlugin=function(){const[l]=e.useLexicalComposerContext();return i.useEffect((()=>l.registerCommand(r.INSERT_HORIZONTAL_RULE_COMMAND,(e=>{const i=o.$getSelection();if(!o.$isRangeSelection(i))return!1;if(null!==i.focus.getNode()){const e=r.$createHorizontalRuleNode();t.$insertNodeToNearestRoot(e)}return!0}),o.COMMAND_PRIORITY_EDITOR)),[l]),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/LexicalHorizontalRuleNode"),t=require("@lexical/utils"),o=require("lexical"),i=require("react");exports.HorizontalRulePlugin=function(){const[l]=e.useLexicalComposerContext();return i.useEffect(()=>l.registerCommand(r.INSERT_HORIZONTAL_RULE_COMMAND,e=>{const i=o.$getSelection();if(!o.$isRangeSelection(i))return!1;if(null!==i.focus.getNode()){const e=r.$createHorizontalRuleNode();t.$insertNodeToNearestRoot(e)}return!0},o.COMMAND_PRIORITY_EDITOR),[l]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{INSERT_HORIZONTAL_RULE_COMMAND as r,$createHorizontalRuleNode as t}from"@lexical/react/LexicalHorizontalRuleNode";import{$insertNodeToNearestRoot as e}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as l,COMMAND_PRIORITY_EDITOR as c}from"lexical";import{useEffect as m}from"react";function n(){const[n]=o();return m((()=>n.registerCommand(r,(o=>{const r=i();if(!l(r))return!1;if(null!==r.focus.getNode()){const o=t();e(o)}return!0}),c)),[n]),null}export{n as HorizontalRulePlugin};
9
+ import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{INSERT_HORIZONTAL_RULE_COMMAND as r,$createHorizontalRuleNode as t}from"@lexical/react/LexicalHorizontalRuleNode";import{$insertNodeToNearestRoot as e}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as l,COMMAND_PRIORITY_EDITOR as c}from"lexical";import{useEffect as m}from"react";function n(){const[n]=o();return m(()=>n.registerCommand(r,o=>{const r=i();if(!l(r))return!1;if(null!==r.focus.getNode()){const o=t();e(o)}return!0},c),[n]),null}export{n as HorizontalRulePlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),r=require("@lexical/link"),i=require("@lexical/react/LexicalComposerContext"),t=require("react");exports.LinkPlugin=function({validateUrl:n,attributes:l}){const[o]=i.useLexicalComposerContext();return t.useEffect((()=>{if(!o.hasNodes([r.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor")})),t.useEffect((()=>r.registerLink(o,e.namedSignals({attributes:l,validateUrl:n}))),[o,n,l]),null};
9
+ "use strict";var e=require("@lexical/extension"),r=require("@lexical/link"),i=require("@lexical/react/LexicalComposerContext"),t=require("react");exports.LinkPlugin=function({validateUrl:n,attributes:l}){const[o]=i.useLexicalComposerContext();return t.useEffect(()=>{if(!o.hasNodes([r.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),t.useEffect(()=>r.registerLink(o,e.namedSignals({attributes:l,validateUrl:n})),[o,n,l]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{namedSignals as r}from"@lexical/extension";import{LinkNode as t,registerLink as e}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{useEffect as i}from"react";function l({validateUrl:l,attributes:n}){const[a]=o();return i((()=>{if(!a.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor")})),i((()=>e(a,r({attributes:n,validateUrl:l}))),[a,l,n]),null}export{l as LinkPlugin};
9
+ import{namedSignals as r}from"@lexical/extension";import{LinkNode as t,registerLink as e}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{useEffect as i}from"react";function l({validateUrl:l,attributes:n}){const[a]=o();return i(()=>{if(!a.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),i(()=>e(a,r({attributes:n,validateUrl:l})),[a,l,n]),null}export{l as LinkPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/list"),t=require("@lexical/react/LexicalComposerContext"),r=require("react");exports.ListPlugin=function({hasStrictIndent:i=!1}){const[s]=t.useLexicalComposerContext();return r.useEffect((()=>{if(!s.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[s]),r.useEffect((()=>{if(i)return e.registerListStrictIndentTransform(s)}),[s,i]),function(t){r.useEffect((()=>e.registerList(t)),[t])}(s),null};
9
+ "use strict";var e=require("@lexical/list"),t=require("@lexical/react/LexicalComposerContext"),r=require("react");exports.ListPlugin=function({hasStrictIndent:i=!1}){const[s]=t.useLexicalComposerContext();return r.useEffect(()=>{if(!s.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[s]),r.useEffect(()=>{if(i)return e.registerListStrictIndentTransform(s)},[s,i]),function(t){r.useEffect(()=>e.registerList(t),[t])}(s),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{registerList as t,ListNode as r,ListItemNode as o,registerListStrictIndentTransform as e}from"@lexical/list";import{useLexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{useEffect as n}from"react";function s({hasStrictIndent:s=!1}){const[c]=i();return n((()=>{if(!c.hasNodes([r,o]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[c]),n((()=>{if(s)return e(c)}),[c,s]),function(r){n((()=>t(r)),[r])}(c),null}export{s as ListPlugin};
9
+ import{registerList as t,ListNode as r,ListItemNode as o,registerListStrictIndentTransform as e}from"@lexical/list";import{useLexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{useEffect as n}from"react";function s({hasStrictIndent:s=!1}){const[c]=i();return n(()=>{if(!c.hasNodes([r,o]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[c]),n(()=>{if(s)return e(c)},[c,s]),function(r){n(()=>t(r),[r])}(c),null}export{s as ListPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/markdown"),r=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/react/LexicalHorizontalRuleNode"),o=require("react");const l=[{dependencies:[t.HorizontalRuleNode],export:e=>t.$isHorizontalRuleNode(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,o,l)=>{const n=t.$createHorizontalRuleNode();l||null!=e.getNextSibling()?e.replace(n):e.insertBefore(n),n.selectNext()},type:"element"},...e.TRANSFORMERS];exports.DEFAULT_TRANSFORMERS=l,exports.MarkdownShortcutPlugin=function({transformers:t=l}){const[n]=r.useLexicalComposerContext();return o.useEffect((()=>e.registerMarkdownShortcuts(n,t)),[n,t]),null};
9
+ "use strict";var e=require("@lexical/markdown"),r=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/react/LexicalHorizontalRuleNode"),o=require("react");const l=[{dependencies:[t.HorizontalRuleNode],export:e=>t.$isHorizontalRuleNode(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,o,l)=>{const n=t.$createHorizontalRuleNode();l||null!=e.getNextSibling()?e.replace(n):e.insertBefore(n),n.selectNext()},type:"element"},...e.TRANSFORMERS];exports.DEFAULT_TRANSFORMERS=l,exports.MarkdownShortcutPlugin=function({transformers:t=l}){const[n]=r.useLexicalComposerContext();return o.useEffect(()=>e.registerMarkdownShortcuts(n,t),[n,t]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{TRANSFORMERS as e,registerMarkdownShortcuts as r}from"@lexical/markdown";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HorizontalRuleNode as o,$createHorizontalRuleNode as l,$isHorizontalRuleNode as n}from"@lexical/react/LexicalHorizontalRuleNode";import{useEffect as c}from"react";const i=[{dependencies:[o],export:e=>n(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,t,o)=>{const n=l();o||null!=e.getNextSibling()?e.replace(n):e.insertBefore(n),n.selectNext()},type:"element"},...e];function a({transformers:e=i}){const[o]=t();return c((()=>r(o,e)),[o,e]),null}export{i as DEFAULT_TRANSFORMERS,a as MarkdownShortcutPlugin};
9
+ import{TRANSFORMERS as e,registerMarkdownShortcuts as r}from"@lexical/markdown";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HorizontalRuleNode as o,$createHorizontalRuleNode as l,$isHorizontalRuleNode as n}from"@lexical/react/LexicalHorizontalRuleNode";import{useEffect as c}from"react";const i=[{dependencies:[o],export:e=>n(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,t,o)=>{const n=l();o||null!=e.getNextSibling()?e.replace(n):e.insertBefore(n),n.selectNext()},type:"element"},...e];function a({transformers:e=i}){const[o]=t();return c(()=>r(o,e),[o,e]),null}export{i as DEFAULT_TRANSFORMERS,a as MarkdownShortcutPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalCollaborationContext"),t=require("@lexical/react/LexicalComposerContext"),o=require("lexical"),r=require("react"),n=require("react/jsx-runtime");function s(e){const t=new Set,{ownNodeConfig:r}=o.getStaticNodeConfig(e),n=e.transform();if(r){const e=r.$transform;e&&t.add(e)}return n&&t.add(n),t}const a=()=>{},i=()=>{};exports.LexicalNestedComposer=function({initialEditor:c,children:l,initialNodes:d,initialTheme:f,skipCollabChecks:p,skipEditableListener:u}){const x=r.useRef(!1),m=r.useContext(t.LexicalComposerContext);null==m&&function(e,...t){const o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[h,{getTheme:g}]=m,C=r.useMemo((()=>{const e=f||g()||void 0,r=t.createLexicalComposerContext(m,e);void 0!==e&&(c._config.theme=e),c._parentEditor=c._parentEditor||h;const n=c._createEditorArgs,l=n&&n.namespace;if(d){a(),l||(i(),c._config.namespace=h._config.namespace);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 n=o.getRegisteredNode(c,e.getType());c._nodes.set(e.getType(),{exportDOM:n?n.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,sharedNodeState:o.createSharedNodeState(e),transforms:s(e)})}}else if(n&&n.nodes)l||(i(),c._config.namespace=h._config.namespace);else{const e=c._nodes=new Map(h._nodes);l||(c._config.namespace=h._config.namespace);for(const[t,r]of e)c._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:o.createSharedNodeState(r.klass),transforms:s(r.klass)})}return[c,r]}),[]),_=r.useContext(e.CollaborationContext),{isCollabActive:v,yjsDocMap:E}=_??{},L=p||x.current||E&&E.has(c.getKey());return r.useEffect((()=>{L&&(x.current=!0)}),[L]),r.useEffect((()=>{if(!u){const e=e=>c.setEditable(e);return e(h.isEditable()),h.registerEditableListener(e)}}),[c,h,u]),n.jsx(t.LexicalComposerContext.Provider,{value:C,children:!v||L?l:null})};
9
+ "use strict";var e=require("@lexical/react/LexicalCollaborationContext"),t=require("@lexical/react/LexicalComposerContext"),o=require("lexical"),r=require("react"),n=require("react/jsx-runtime");function s(e){const t=new Set,{ownNodeConfig:r}=o.getStaticNodeConfig(e),n=e.transform();if(r){const e=r.$transform;e&&t.add(e)}return n&&t.add(n),t}const a=()=>{},i=()=>{};exports.LexicalNestedComposer=function({initialEditor:c,children:l,initialNodes:d,initialTheme:f,skipCollabChecks:p,skipEditableListener:u}){const x=r.useRef(!1),m=r.useContext(t.LexicalComposerContext);null==m&&function(e,...t){const o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[h,{getTheme:g}]=m,C=r.useMemo(()=>{const e=f||g()||void 0,r=t.createLexicalComposerContext(m,e);void 0!==e&&(c._config.theme=e),c._parentEditor=c._parentEditor||h;const n=c._createEditorArgs,l=n&&n.namespace;if(d){a(),l||(i(),c._config.namespace=h._config.namespace);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 n=o.getRegisteredNode(c,e.getType());c._nodes.set(e.getType(),{exportDOM:n?n.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,sharedNodeState:o.createSharedNodeState(e),transforms:s(e)})}}else if(n&&n.nodes)l||(i(),c._config.namespace=h._config.namespace);else{const e=c._nodes=new Map(h._nodes);l||(c._config.namespace=h._config.namespace);for(const[t,r]of e)c._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:o.createSharedNodeState(r.klass),transforms:s(r.klass)})}return[c,r]},[]),_=r.useContext(e.CollaborationContext),{isCollabActive:v,yjsDocMap:E}=_??{},L=p||x.current||E&&E.has(c.getKey());return r.useEffect(()=>{L&&(x.current=!0)},[L]),r.useEffect(()=>{if(!u){const e=e=>c.setEditable(e);return e(h.isEditable()),h.registerEditableListener(e)}},[c,h,u]),n.jsx(t.LexicalComposerContext.Provider,{value:C,children:!v||L?l:null})};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{CollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{LexicalComposerContext as t,createLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{createSharedNodeState as r,getRegisteredNode as n,getStaticNodeConfig as i}from"lexical";import{useRef as s,useContext as a,useMemo as l,useEffect as c}from"react";import{jsx as d}from"react/jsx-runtime";function f(e){const t=new Set,{ownNodeConfig:o}=i(e),r=e.transform();if(o){const e=o.$transform;e&&t.add(e)}return r&&t.add(r),t}const p=()=>{},m=()=>{};function h({initialEditor:i,children:h,initialNodes:u,initialTheme:g,skipCollabChecks:x,skipEditableListener:_}){const v=s(!1),w=a(t);null==w&&function(e,...t){const o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[E,{getTheme:k}]=w,C=l((()=>{const e=g||k()||void 0,t=o(w,e);void 0!==e&&(i._config.theme=e),i._parentEditor=i._parentEditor||E;const s=i._createEditorArgs,a=s&&s.namespace;if(u){p(),a||(m(),i._config.namespace=E._config.namespace);for(let e of u){let t=null,o=null;if("function"!=typeof e){const r=e;e=r.replace,t=r.with,o=r.withKlass||null}const s=n(i,e.getType());i._nodes.set(e.getType(),{exportDOM:s?s.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:o,sharedNodeState:r(e),transforms:f(e)})}}else if(s&&s.nodes)a||(m(),i._config.namespace=E._config.namespace);else{const e=i._nodes=new Map(E._nodes);a||(i._config.namespace=E._config.namespace);for(const[t,o]of e)i._nodes.set(t,{exportDOM:o.exportDOM,klass:o.klass,replace:o.replace,replaceWithKlass:o.replaceWithKlass,sharedNodeState:r(o.klass),transforms:f(o.klass)})}return[i,t]}),[]),b=a(e),{isCollabActive:L,yjsDocMap:M}=b??{},S=x||v.current||M&&M.has(i.getKey());return c((()=>{S&&(v.current=!0)}),[S]),c((()=>{if(!_){const e=e=>i.setEditable(e);return e(E.isEditable()),E.registerEditableListener(e)}}),[i,E,_]),d(t.Provider,{value:C,children:!L||S?h:null})}export{h as LexicalNestedComposer};
9
+ import{CollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{LexicalComposerContext as t,createLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{createSharedNodeState as r,getRegisteredNode as n,getStaticNodeConfig as i}from"lexical";import{useRef as s,useContext as a,useMemo as l,useEffect as c}from"react";import{jsx as d}from"react/jsx-runtime";function f(e){const t=new Set,{ownNodeConfig:o}=i(e),r=e.transform();if(o){const e=o.$transform;e&&t.add(e)}return r&&t.add(r),t}const p=()=>{},m=()=>{};function h({initialEditor:i,children:h,initialNodes:u,initialTheme:g,skipCollabChecks:x,skipEditableListener:_}){const v=s(!1),w=a(t);null==w&&function(e,...t){const o=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw o.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[E,{getTheme:k}]=w,C=l(()=>{const e=g||k()||void 0,t=o(w,e);void 0!==e&&(i._config.theme=e),i._parentEditor=i._parentEditor||E;const s=i._createEditorArgs,a=s&&s.namespace;if(u){p(),a||(m(),i._config.namespace=E._config.namespace);for(let e of u){let t=null,o=null;if("function"!=typeof e){const r=e;e=r.replace,t=r.with,o=r.withKlass||null}const s=n(i,e.getType());i._nodes.set(e.getType(),{exportDOM:s?s.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:o,sharedNodeState:r(e),transforms:f(e)})}}else if(s&&s.nodes)a||(m(),i._config.namespace=E._config.namespace);else{const e=i._nodes=new Map(E._nodes);a||(i._config.namespace=E._config.namespace);for(const[t,o]of e)i._nodes.set(t,{exportDOM:o.exportDOM,klass:o.klass,replace:o.replace,replaceWithKlass:o.replaceWithKlass,sharedNodeState:r(o.klass),transforms:f(o.klass)})}return[i,t]},[]),b=a(e),{isCollabActive:L,yjsDocMap:M}=b??{},S=x||v.current||M&&M.has(i.getKey());return c(()=>{S&&(v.current=!0)},[S]),c(()=>{if(!_){const e=e=>i.setEditable(e);return e(E.isEditable()),E.registerEditableListener(e)}},[i,E,_]),d(t.Provider,{value:C,children:!L||S?h:null})}export{h as LexicalNestedComposer};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@floating-ui/react"),t=require("@lexical/react/LexicalComposerContext"),s=require("lexical"),n=require("react"),i=require("react/jsx-runtime");class a{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const l=n.forwardRef((({className:e,disabled:t,...s},n)=>i.jsx("hr",{className:e}))),o=n.forwardRef((({className:e,label:t,disabled:s,icon:n,...a},l)=>i.jsxs("button",{...a,className:e,ref:l,role:"menuitem",disabled:s,children:[n,t]}))),r=n.forwardRef((({items:a,className:r,itemClassName:c,separatorClassName:u},d)=>{const[m]=t.useLexicalComposerContext(),[p,h]=n.useState(null),[f,x]=n.useState(!1),y=n.useRef([]),g=n.useRef([]),{refs:N,floatingStyles:b,context:k}=e.useFloating({middleware:[e.offset({alignmentAxis:4,mainAxis:5}),e.flip({fallbackPlacements:["left-start"]}),e.shift({padding:10})],onOpenChange:x,open:f,placement:"right-start",strategy:"fixed",whileElementsMounted:e.autoUpdate}),w=e.useRole(k,{role:"menu"}),C=e.useDismiss(k),$=e.useListNavigation(k,{activeIndex:p,listRef:y,onNavigate:h}),O=e.useTypeahead(k,{activeIndex:p,enabled:f,listRef:g,onMatch:h}),{getFloatingProps:R,getItemProps:v}=e.useInteractions([w,C,$,O]),[S,E]=n.useState([]);return n.useEffect((()=>{function e(e){e.preventDefault(),N.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];a&&m.read((()=>{const n=s.$getNearestNodeFromDOMNode(e.target);n&&(t=a.filter((e=>!e.$showOn||e.$showOn(n))))}));const n=t.map(((e,t)=>"separator"===e.type?{className:u,key:e.key+"-"+t,type:e.type}:{className:c,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>m.update((()=>e.$onSelect())),title:e.title,type:e.type}));g.current=n.map((e=>e.key)),E(n),x(!0)}return m.registerRootListener(((t,s)=>{null!==s&&s.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)}))}),[a,c,u,N,m]),i.jsx(e.FloatingPortal,{children:f&&i.jsx(e.FloatingOverlay,{lockScroll:!0,children:i.jsx(e.FloatingFocusManager,{context:k,initialFocus:N.floating,children:i.jsx("div",{className:r,ref:N.setFloating,style:b,...R(),children:S.map(((e,t)=>"item"===e.type?n.createElement(o,{...v({...e,onClick(){e.onClick(),x(!1)},onMouseUp(){e.onClick(),x(!1)},ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):"separator"===e.type?n.createElement(l,{...v({...e,ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):void 0))})})})})}));exports.NodeContextMenuOption=class extends a{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}},exports.NodeContextMenuPlugin=r,exports.NodeContextMenuSeparator=class extends a{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}};
9
+ "use strict";var e=require("@floating-ui/react"),t=require("@lexical/react/LexicalComposerContext"),s=require("lexical"),n=require("react"),i=require("react/jsx-runtime");class a{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}const l=n.forwardRef(({className:e,disabled:t,...s},n)=>i.jsx("hr",{className:e})),o=n.forwardRef(({className:e,label:t,disabled:s,icon:n,...a},l)=>i.jsxs("button",{...a,className:e,ref:l,role:"menuitem",disabled:s,children:[n,t]})),r=n.forwardRef(({items:a,className:r,itemClassName:c,separatorClassName:u},d)=>{const[m]=t.useLexicalComposerContext(),[p,h]=n.useState(null),[f,x]=n.useState(!1),y=n.useRef([]),g=n.useRef([]),{refs:N,floatingStyles:b,context:k}=e.useFloating({middleware:[e.offset({alignmentAxis:4,mainAxis:5}),e.flip({fallbackPlacements:["left-start"]}),e.shift({padding:10})],onOpenChange:x,open:f,placement:"right-start",strategy:"fixed",whileElementsMounted:e.autoUpdate}),w=e.useRole(k,{role:"menu"}),C=e.useDismiss(k),$=e.useListNavigation(k,{activeIndex:p,listRef:y,onNavigate:h}),O=e.useTypeahead(k,{activeIndex:p,enabled:f,listRef:g,onMatch:h}),{getFloatingProps:R,getItemProps:v}=e.useInteractions([w,C,$,O]),[S,E]=n.useState([]);return n.useEffect(()=>{function e(e){e.preventDefault(),N.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];a&&m.read(()=>{const n=s.$getNearestNodeFromDOMNode(e.target);n&&(t=a.filter(e=>!e.$showOn||e.$showOn(n)))});const n=t.map((e,t)=>"separator"===e.type?{className:u,key:e.key+"-"+t,type:e.type}:{className:c,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>m.update(()=>e.$onSelect()),title:e.title,type:e.type});g.current=n.map(e=>e.key),E(n),x(!0)}return m.registerRootListener((t,s)=>{null!==s&&s.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)})},[a,c,u,N,m]),i.jsx(e.FloatingPortal,{children:f&&i.jsx(e.FloatingOverlay,{lockScroll:!0,children:i.jsx(e.FloatingFocusManager,{context:k,initialFocus:N.floating,children:i.jsx("div",{className:r,ref:N.setFloating,style:b,...R(),children:S.map((e,t)=>"item"===e.type?n.createElement(o,{...v({...e,onClick(){e.onClick(),x(!1)},onMouseUp(){e.onClick(),x(!1)},ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):"separator"===e.type?n.createElement(l,{...v({...e,ref(e){y.current[t]=e},tabIndex:p===t?0:-1}),key:e.key}):void 0)})})})})});exports.NodeContextMenuOption=class extends a{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}},exports.NodeContextMenuPlugin=r,exports.NodeContextMenuSeparator=class extends a{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useFloating as e,autoUpdate as t,offset as n,flip as s,shift as i,useRole as l,useDismiss as o,useListNavigation as r,useTypeahead as a,useInteractions as c,FloatingPortal as m,FloatingOverlay as d,FloatingFocusManager as h}from"@floating-ui/react";import{useLexicalComposerContext as p}from"@lexical/react/LexicalComposerContext";import{$getNearestNodeFromDOMNode as u}from"lexical";import{forwardRef as f,useState as y,useRef as x,useEffect as g,createElement as b}from"react";import{jsx as k,jsxs as $}from"react/jsx-runtime";class w{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}class N extends w{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}}class O extends w{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}}const C=f((({className:e,disabled:t,...n},s)=>k("hr",{className:e}))),v=f((({className:e,label:t,disabled:n,icon:s,...i},l)=>$("button",{...i,className:e,ref:l,role:"menuitem",disabled:n,children:[s,t]}))),R=f((({items:f,className:$,itemClassName:w,separatorClassName:N},O)=>{const[R]=p(),[E,S]=y(null),[I,L]=y(!1),P=x([]),F=x([]),{refs:M,floatingStyles:X,context:Y}=e({middleware:[n({alignmentAxis:4,mainAxis:5}),s({fallbackPlacements:["left-start"]}),i({padding:10})],onOpenChange:L,open:I,placement:"right-start",strategy:"fixed",whileElementsMounted:t}),A=l(Y,{role:"menu"}),j=o(Y),B=r(Y,{activeIndex:E,listRef:P,onNavigate:S}),D=a(Y,{activeIndex:E,enabled:I,listRef:F,onMatch:S}),{getFloatingProps:U,getItemProps:_}=c([A,j,B,D]),[q,z]=y([]);return g((()=>{function e(e){e.preventDefault(),M.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];f&&R.read((()=>{const n=u(e.target);n&&(t=f.filter((e=>!e.$showOn||e.$showOn(n))))}));const n=t.map(((e,t)=>"separator"===e.type?{className:N,key:e.key+"-"+t,type:e.type}:{className:w,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>R.update((()=>e.$onSelect())),title:e.title,type:e.type}));F.current=n.map((e=>e.key)),z(n),L(!0)}return R.registerRootListener(((t,n)=>{null!==n&&n.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)}))}),[f,w,N,M,R]),k(m,{children:I&&k(d,{lockScroll:!0,children:k(h,{context:Y,initialFocus:M.floating,children:k("div",{className:$,ref:M.setFloating,style:X,...U(),children:q.map(((e,t)=>"item"===e.type?b(v,{..._({...e,onClick(){e.onClick(),L(!1)},onMouseUp(){e.onClick(),L(!1)},ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):"separator"===e.type?b(C,{..._({...e,ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):void 0))})})})})}));export{N as NodeContextMenuOption,R as NodeContextMenuPlugin,O as NodeContextMenuSeparator};
9
+ import{useFloating as e,autoUpdate as t,offset as n,flip as s,shift as i,useRole as l,useDismiss as o,useListNavigation as r,useTypeahead as a,useInteractions as c,FloatingPortal as m,FloatingOverlay as d,FloatingFocusManager as h}from"@floating-ui/react";import{useLexicalComposerContext as p}from"@lexical/react/LexicalComposerContext";import{$getNearestNodeFromDOMNode as u}from"lexical";import{forwardRef as f,useState as y,useRef as x,useEffect as g,createElement as b}from"react";import{jsx as k,jsxs as $}from"react/jsx-runtime";class w{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}}class N extends w{type;title;icon;disabled;$onSelect;$showOn;constructor(e,t){super(e),this.type="item",this.title=e,this.disabled=t.disabled??!1,this.icon=t.icon??null,this.$onSelect=t.$onSelect,t.$showOn&&(this.$showOn=t.$showOn)}}class O extends w{type;$showOn;constructor(e){super("_separator"),this.type="separator",e&&e.$showOn&&(this.$showOn=e.$showOn)}}const C=f(({className:e,disabled:t,...n},s)=>k("hr",{className:e})),v=f(({className:e,label:t,disabled:n,icon:s,...i},l)=>$("button",{...i,className:e,ref:l,role:"menuitem",disabled:n,children:[s,t]})),R=f(({items:f,className:$,itemClassName:w,separatorClassName:N},O)=>{const[R]=p(),[E,S]=y(null),[I,L]=y(!1),P=x([]),F=x([]),{refs:M,floatingStyles:X,context:Y}=e({middleware:[n({alignmentAxis:4,mainAxis:5}),s({fallbackPlacements:["left-start"]}),i({padding:10})],onOpenChange:L,open:I,placement:"right-start",strategy:"fixed",whileElementsMounted:t}),A=l(Y,{role:"menu"}),j=o(Y),B=r(Y,{activeIndex:E,listRef:P,onNavigate:S}),D=a(Y,{activeIndex:E,enabled:I,listRef:F,onMatch:S}),{getFloatingProps:U,getItemProps:_}=c([A,j,B,D]),[q,z]=y([]);return g(()=>{function e(e){e.preventDefault(),M.setPositionReference({getBoundingClientRect:()=>({bottom:e.clientY,height:0,left:e.clientX,right:e.clientX,top:e.clientY,width:0,x:e.clientX,y:e.clientY})});let t=[];f&&R.read(()=>{const n=u(e.target);n&&(t=f.filter(e=>!e.$showOn||e.$showOn(n)))});const n=t.map((e,t)=>"separator"===e.type?{className:N,key:e.key+"-"+t,type:e.type}:{className:w,disabled:e.disabled,icon:e.icon,key:e.key,label:e.title,onClick:()=>R.update(()=>e.$onSelect()),title:e.title,type:e.type});F.current=n.map(e=>e.key),z(n),L(!0)}return R.registerRootListener((t,n)=>{null!==n&&n.removeEventListener("contextmenu",e),null!==t&&t.addEventListener("contextmenu",e)})},[f,w,N,M,R]),k(m,{children:I&&k(d,{lockScroll:!0,children:k(h,{context:Y,initialFocus:M.floating,children:k("div",{className:$,ref:M.setFloating,style:X,...U(),children:q.map((e,t)=>"item"===e.type?b(v,{..._({...e,onClick(){e.onClick(),L(!1)},onMouseUp(){e.onClick(),L(!1)},ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):"separator"===e.type?b(C,{..._({...e,ref(e){P.current[t]=e},tabIndex:E===t?0:-1}),key:e.key}):void 0)})})})})});export{N as NodeContextMenuOption,R as NodeContextMenuPlugin,O as NodeContextMenuSeparator};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/utils"),n=require("lexical"),r=require("react");const o=new Set(["mouseenter","mouseleave"]);exports.NodeEventPlugin=function({nodeType:i,eventType:s,eventListener:u}){const[c]=e.useLexicalComposerContext(),l=r.useRef(u);return l.current=u,r.useEffect((()=>{const e=o.has(s),r=r=>{c.update((()=>{const o=n.$getNearestNodeFromDOMNode(r.target);if(null!==o){const n=e?o instanceof i?o:null:t.$findMatchingParent(o,(e=>e instanceof i));if(null!==n)return void l.current(r,c,n.getKey())}}))};return c.registerRootListener(((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)}))}),[c,i]),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/utils"),n=require("lexical"),r=require("react");const o=new Set(["mouseenter","mouseleave"]);exports.NodeEventPlugin=function({nodeType:i,eventType:s,eventListener:u}){const[c]=e.useLexicalComposerContext(),l=r.useRef(u);return l.current=u,r.useEffect(()=>{const e=o.has(s),r=r=>{c.update(()=>{const o=n.$getNearestNodeFromDOMNode(r.target);if(null!==o){const n=e?o instanceof i?o:null:t.$findMatchingParent(o,e=>e instanceof i);if(null!==n)return void l.current(r,c,n.getKey())}})};return c.registerRootListener((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)})},[c,i]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as t}from"@lexical/utils";import{$getNearestNodeFromDOMNode as n}from"lexical";import{useRef as r,useEffect as o}from"react";const i=new Set(["mouseenter","mouseleave"]);function l({nodeType:l,eventType:s,eventListener:c}){const[u]=e(),a=r(c);return a.current=c,o((()=>{const e=i.has(s),r=r=>{u.update((()=>{const o=n(r.target);if(null!==o){const n=e?o instanceof l?o:null:t(o,(e=>e instanceof l));if(null!==n)return void a.current(r,u,n.getKey())}}))};return u.registerRootListener(((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)}))}),[u,l]),null}export{l as NodeEventPlugin};
9
+ import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as t}from"@lexical/utils";import{$getNearestNodeFromDOMNode as n}from"lexical";import{useRef as r,useEffect as o}from"react";const i=new Set(["mouseenter","mouseleave"]);function l({nodeType:l,eventType:s,eventListener:c}){const[u]=e(),a=r(c);return a.current=c,o(()=>{const e=i.has(s),r=r=>{u.update(()=>{const o=n(r.target);if(null!==o){const n=e?o instanceof l?o:null:t(o,e=>e instanceof l);if(null!==n)return void a.current(r,u,n.getKey())}})};return u.registerRootListener((t,n)=>{t&&t.addEventListener(s,r,e),n&&n.removeEventListener(s,r,e)})},[u,l]),null}export{l as NodeEventPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),n=require("react"),l=require("@lexical/utils"),o=require("react/jsx-runtime");const r="startTransition";const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=i?n.useLayoutEffect:n.useEffect;const s=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function c(e,t){const n=e.getBoundingClientRect(),l=t.getBoundingClientRect();return n.top>=l.top-6&&n.top<=l.bottom+6}function a(t,l,o,r){const[i]=e.useLexicalComposerContext();n.useEffect((()=>{if(null!=l&&null!=t){const e=i.getRootElement(),t=null!=e?function(e,t){let n=getComputedStyle(e);const l="absolute"===n.position,o=/(auto|scroll)/;if("fixed"===n.position)return document.body;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!l||"static"!==n.position)&&o.test(n.overflow+n.overflowY+n.overflowX))return t;return document.body}(e):document.body;let n=!1,u=c(l,t);const s=function(){n||(window.requestAnimationFrame((function(){o(),n=!1})),n=!0);const e=c(l,t);e!==u&&(u=e,null!=r&&r(e))},a=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",s,{capture:!0,passive:!0}),a.observe(l),()=>{a.unobserve(l),window.removeEventListener("resize",o),document.removeEventListener("scroll",s,!0)}}}),[l,i,r,o,t])}const d=t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function m({close:e,editor:o,anchorElementRef:r,resolution:i,options:c,menuRenderFn:a,onSelectOption:m,shouldSplitNodeWithQuery:f=!1,commandPriority:p=t.COMMAND_PRIORITY_LOW,preselectFirstItem:g=!0}){const[h,C]=n.useState(null),E=i.match&&i.match.matchingString;n.useEffect((()=>{g&&C(0)}),[E,g]);const y=n.useCallback((n=>{o.update((()=>{const l=null!=i.match&&f?function(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!n.isCollapsed())return null;const l=n.anchor;if("text"!==l.type)return null;const o=l.getNode();if(!o.isSimpleText())return null;const r=l.offset,i=o.getTextContent().slice(0,r),u=e.replaceableString.length,s=r-function(e,t,n){let l=n;for(let n=l;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(l=n);return l}(i,e.matchingString,u);if(s<0)return null;let c;return 0===s?[c]=o.splitText(r):[,c]=o.splitText(s,r),c}(i.match):null;m(n,l,e,i.match?i.match.matchingString:"")}))}),[o,f,i.match,m,e]),b=n.useCallback((e=>{const t=o.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),C(e))}),[o]);n.useEffect((()=>()=>{const e=o.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[o]),u((()=>{null===c?C(null):null===h&&g&&b(0)}),[c,h,b,g]),n.useEffect((()=>l.mergeRegister(o.registerCommand(d,(({option:e})=>!(!e.ref||null==e.ref.current)&&(s(e.ref.current),!0)),p))),[o,b,p]),n.useEffect((()=>l.mergeRegister(o.registerCommand(t.KEY_ARROW_DOWN_COMMAND,(e=>{const t=e;if(null!==c&&c.length){const e=null===h?0:h!==c.length-1?h+1:0;b(e);const n=c[e];null!=n.ref&&n.ref.current&&o.dispatchCommand(d,{index:e,option:n}),t.preventDefault(),t.stopImmediatePropagation()}return!0}),p),o.registerCommand(t.KEY_ARROW_UP_COMMAND,(e=>{const t=e;if(null!==c&&c.length){const e=null===h?c.length-1:0!==h?h-1:c.length-1;b(e);const n=c[e];null!=n.ref&&n.ref.current&&s(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),p),o.registerCommand(t.KEY_ESCAPE_COMMAND,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),p),o.registerCommand(t.KEY_TAB_COMMAND,(e=>{const t=e;return null!==c&&null!==h&&null!=c[h]&&(t.preventDefault(),t.stopImmediatePropagation(),y(c[h]),!0)}),p),o.registerCommand(t.KEY_ENTER_COMMAND,(e=>null!==c&&null!==h&&null!=c[h]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),y(c[h]),!0)),p))),[y,e,o,c,h,b,p]);return a(r,n.useMemo((()=>({options:c,selectOptionAndCleanUp:y,selectedIndex:h,setHighlightedIndex:C})),[y,h,c]),i.match?i.match.matchingString:"")}function f(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}exports.LexicalNodeMenuPlugin=function({options:l,nodeKey:u,onClose:s,onOpen:c,onSelectOption:d,menuRenderFn:p,anchorClassName:g,commandPriority:h=t.COMMAND_PRIORITY_LOW,parent:C}){const[E]=e.useLexicalComposerContext(),[y,b]=n.useState(null),R=function(t,l,o,r=(i?document.body:void 0),u=!0){const[s]=e.useLexicalComposerContext(),c=i?document.createElement("div"):null,d=n.useRef(c),m=n.useCallback((()=>{if(null===d.current||void 0===r)return;d.current.style.top=d.current.style.bottom;const e=s.getRootElement(),n=d.current,l=n.firstChild;if(null!==e&&null!==t){const{left:i,top:s,width:c,height:a}=t.getRect(),m=d.current.offsetHeight;if(n.style.top=`${s+m+3+(u?window.pageYOffset:0)}px`,n.style.left=`${i+window.pageXOffset}px`,n.style.height=`${a}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),o=t.height,r=t.width,c=e.getBoundingClientRect();i+r>c.right&&(n.style.left=`${c.right-r+window.pageXOffset}px`),(s+o>window.innerHeight||s+o>c.bottom)&&s-c.top>o+a&&(n.style.top=`${s-o-a+(u?window.pageYOffset:0)}px`)}n.isConnected||(f(n,o),r.append(n)),n.setAttribute("id","typeahead-menu"),e.setAttribute("aria-controls","typeahead-menu")}}),[s,t,u,o,r]);n.useEffect((()=>{const e=s.getRootElement();return null!==t&&m(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=d.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}}),[s,m,t]);const p=n.useCallback((e=>{null!==t&&(e||l(null))}),[t,l]);return a(t,d.current,m,p),null!=c&&c===d.current&&(f(c,o),null!=r&&r.append(c)),d}(y,b,g,C),w=n.useCallback((()=>{b(null),null!=s&&null!==y&&s()}),[s,y]),x=n.useCallback((e=>{b(e),null!=c&&null===y&&c(e)}),[c,y]),v=n.useCallback((()=>{u?E.update((()=>{const e=t.$getNodeByKey(u),l=E.getElementByKey(u);var o;null!=e&&null!=l&&null==y&&(o=()=>x({getRect:()=>l.getBoundingClientRect()}),r in n?n[r](o):o())})):null==u&&null!=y&&w()}),[w,E,u,x,y]);return n.useEffect((()=>{v()}),[v,u]),n.useEffect((()=>{if(null!=u)return E.registerUpdateListener((({dirtyElements:e})=>{e.get(u)&&v()}))}),[E,v,u]),null===R.current||null===y||null===E?null:o.jsx(m,{close:w,resolution:y,editor:E,anchorElementRef:R,options:l,menuRenderFn:p,onSelectOption:d,commandPriority:h})},exports.MenuOption=class{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),n=require("react"),l=require("@lexical/utils"),o=require("react/jsx-runtime");const r="startTransition";const i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,u=i?n.useLayoutEffect:n.useEffect;const s=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function c(e,t){const n=e.getBoundingClientRect(),l=t.getBoundingClientRect();return n.top>=l.top-6&&n.top<=l.bottom+6}function a(t,l,o,r){const[i]=e.useLexicalComposerContext();n.useEffect(()=>{if(null!=l&&null!=t){const e=i.getRootElement(),t=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,l=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&l.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let n=!1,u=c(l,t);const s=function(){n||(window.requestAnimationFrame(function(){o(),n=!1}),n=!0);const e=c(l,t);e!==u&&(u=e,null!=r&&r(e))},a=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",s,{capture:!0,passive:!0}),a.observe(l),()=>{a.unobserve(l),window.removeEventListener("resize",o),document.removeEventListener("scroll",s,!0)}}},[l,i,r,o,t])}const d=t.createCommand("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function m({close:e,editor:o,anchorElementRef:r,resolution:i,options:c,menuRenderFn:a,onSelectOption:m,shouldSplitNodeWithQuery:f=!1,commandPriority:p=t.COMMAND_PRIORITY_LOW,preselectFirstItem:g=!0}){const[h,C]=n.useState(null),E=i.match&&i.match.matchingString;n.useEffect(()=>{g&&C(0)},[E,g]);const y=n.useCallback(n=>{o.update(()=>{const l=null!=i.match&&f?function(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!n.isCollapsed())return null;const l=n.anchor;if("text"!==l.type)return null;const o=l.getNode();if(!o.isSimpleText())return null;const r=l.offset,i=o.getTextContent().slice(0,r),u=e.replaceableString.length,s=r-function(e,t,n){let l=n;for(let n=l;n<=t.length;n++)e.slice(-n)===t.substring(0,n)&&(l=n);return l}(i,e.matchingString,u);if(s<0)return null;let c;return 0===s?[c]=o.splitText(r):[,c]=o.splitText(s,r),c}(i.match):null;m(n,l,e,i.match?i.match.matchingString:"")})},[o,f,i.match,m,e]),b=n.useCallback(e=>{const t=o.getRootElement();null!==t&&(t.setAttribute("aria-activedescendant","typeahead-item-"+e),C(e))},[o]);n.useEffect(()=>()=>{const e=o.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")},[o]),u(()=>{null===c?C(null):null===h&&g&&b(0)},[c,h,b,g]),n.useEffect(()=>l.mergeRegister(o.registerCommand(d,({option:e})=>!(!e.ref||null==e.ref.current)&&(s(e.ref.current),!0),p)),[o,b,p]),n.useEffect(()=>l.mergeRegister(o.registerCommand(t.KEY_ARROW_DOWN_COMMAND,e=>{const t=e;if(null!==c&&c.length){const e=null===h?0:h!==c.length-1?h+1:0;b(e);const n=c[e];null!=n.ref&&n.ref.current&&o.dispatchCommand(d,{index:e,option:n}),t.preventDefault(),t.stopImmediatePropagation()}return!0},p),o.registerCommand(t.KEY_ARROW_UP_COMMAND,e=>{const t=e;if(null!==c&&c.length){const e=null===h?c.length-1:0!==h?h-1:c.length-1;b(e);const n=c[e];null!=n.ref&&n.ref.current&&s(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0},p),o.registerCommand(t.KEY_ESCAPE_COMMAND,t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0},p),o.registerCommand(t.KEY_TAB_COMMAND,e=>{const t=e;return null!==c&&null!==h&&null!=c[h]&&(t.preventDefault(),t.stopImmediatePropagation(),y(c[h]),!0)},p),o.registerCommand(t.KEY_ENTER_COMMAND,e=>null!==c&&null!==h&&null!=c[h]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),y(c[h]),!0),p)),[y,e,o,c,h,b,p]);return a(r,n.useMemo(()=>({options:c,selectOptionAndCleanUp:y,selectedIndex:h,setHighlightedIndex:C}),[y,h,c]),i.match?i.match.matchingString:"")}function f(e,t){null!=t&&(e.className=t),e.setAttribute("aria-label","Typeahead menu"),e.setAttribute("role","listbox"),e.style.display="block",e.style.position="absolute"}exports.LexicalNodeMenuPlugin=function({options:l,nodeKey:u,onClose:s,onOpen:c,onSelectOption:d,menuRenderFn:p,anchorClassName:g,commandPriority:h=t.COMMAND_PRIORITY_LOW,parent:C}){const[E]=e.useLexicalComposerContext(),[y,b]=n.useState(null),R=function(t,l,o,r=(i?document.body:void 0),u=!0){const[s]=e.useLexicalComposerContext(),c=i?document.createElement("div"):null,d=n.useRef(c),m=n.useCallback(()=>{if(null===d.current||void 0===r)return;d.current.style.top=d.current.style.bottom;const e=s.getRootElement(),n=d.current,l=n.firstChild;if(null!==e&&null!==t){const{left:i,top:s,width:c,height:a}=t.getRect(),m=d.current.offsetHeight;if(n.style.top=`${s+m+3+(u?window.pageYOffset:0)}px`,n.style.left=`${i+window.pageXOffset}px`,n.style.height=`${a}px`,n.style.width=`${c}px`,null!==l){l.style.top=`${s}`;const t=l.getBoundingClientRect(),o=t.height,r=t.width,c=e.getBoundingClientRect();i+r>c.right&&(n.style.left=`${c.right-r+window.pageXOffset}px`),(s+o>window.innerHeight||s+o>c.bottom)&&s-c.top>o+a&&(n.style.top=`${s-o-a+(u?window.pageYOffset:0)}px`)}n.isConnected||(f(n,o),r.append(n)),n.setAttribute("id","typeahead-menu"),e.setAttribute("aria-controls","typeahead-menu")}},[s,t,u,o,r]);n.useEffect(()=>{const e=s.getRootElement();return null!==t&&m(),()=>{null!==e&&e.removeAttribute("aria-controls");const t=d.current;null!==t&&t.isConnected&&(t.remove(),t.removeAttribute("id"))}},[s,m,t]);const p=n.useCallback(e=>{null!==t&&(e||l(null))},[t,l]);return a(t,d.current,m,p),null!=c&&c===d.current&&(f(c,o),null!=r&&r.append(c)),d}(y,b,g,C),w=n.useCallback(()=>{b(null),null!=s&&null!==y&&s()},[s,y]),x=n.useCallback(e=>{b(e),null!=c&&null===y&&c(e)},[c,y]),v=n.useCallback(()=>{u?E.update(()=>{const e=t.$getNodeByKey(u),l=E.getElementByKey(u);var o;null!=e&&null!=l&&null==y&&(o=()=>x({getRect:()=>l.getBoundingClientRect()}),r in n?n[r](o):o())}):null==u&&null!=y&&w()},[w,E,u,x,y]);return n.useEffect(()=>{v()},[v,u]),n.useEffect(()=>{if(null!=u)return E.registerUpdateListener(({dirtyElements:e})=>{e.get(u)&&v()})},[E,v,u]),null===R.current||null===y||null===E?null:o.jsx(m,{close:w,resolution:y,editor:E,anchorElementRef:R,options:l,menuRenderFn:p,onSelectOption:d,commandPriority:h})},exports.MenuOption=class{key;ref;constructor(e){this.key=e,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(e){this.ref={current:e}}};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createCommand as e,COMMAND_PRIORITY_LOW as n,KEY_ARROW_DOWN_COMMAND as o,KEY_ARROW_UP_COMMAND as l,KEY_ESCAPE_COMMAND as r,KEY_TAB_COMMAND as i,KEY_ENTER_COMMAND as u,$getSelection as s,$isRangeSelection as c,$getNodeByKey as a}from"lexical";import m,{useLayoutEffect as d,useEffect as p,useRef as f,useCallback as g,useState as h,useMemo as y}from"react";import{mergeRegister as w}from"@lexical/utils";import{jsx as v}from"react/jsx-runtime";const b="startTransition";const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,x=C?d:p;class E{key;ref;constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}const R=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function I(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return n.top>=o.top-6&&n.top<=o.bottom+6}function O(e,n,o,l){const[r]=t();p((()=>{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=/(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):document.body;let i=!1,u=I(n,e);const s=function(){i||(window.requestAnimationFrame((function(){o(),i=!1})),i=!0);const t=I(n,e);t!==u&&(u=t,null!=l&&l(t))},c=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",s,!0)}}}),[n,r,l,o,e])}const A=e("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function S({close:t,editor:e,anchorElementRef:a,resolution:m,options:d,menuRenderFn:f,onSelectOption:v,shouldSplitNodeWithQuery:b=!1,commandPriority:C=n,preselectFirstItem:E=!0}){const[I,O]=h(null),S=m.match&&m.match.matchingString;p((()=>{E&&O(0)}),[S,E]);const P=g((n=>{e.update((()=>{const e=null!=m.match&&b?function(t){const e=s();if(!c(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.slice(-n)===e.substring(0,n)&&(o=n);return o}(r,t.matchingString,i);if(u<0)return null;let a;return 0===u?[a]=o.splitText(l):[,a]=o.splitText(u,l),a}(m.match):null;v(n,e,t,m.match?m.match.matchingString:"")}))}),[e,b,m.match,v,t]),T=g((t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),O(t))}),[e]);p((()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")}),[e]),x((()=>{null===d?O(null):null===I&&E&&T(0)}),[d,I,T,E]),p((()=>w(e.registerCommand(A,(({option:t})=>!(!t.ref||null==t.ref.current)&&(R(t.ref.current),!0)),C))),[e,T,C]),p((()=>w(e.registerCommand(o,(t=>{const n=t;if(null!==d&&d.length){const t=null===I?0:I!==d.length-1?I+1:0;T(t);const o=d[t];null!=o.ref&&o.ref.current&&e.dispatchCommand(A,{index:t,option:o}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),C),e.registerCommand(l,(t=>{const e=t;if(null!==d&&d.length){const t=null===I?d.length-1:0!==I?I-1:d.length-1;T(t);const n=d[t];null!=n.ref&&n.ref.current&&R(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0}),C),e.registerCommand(r,(e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0}),C),e.registerCommand(i,(t=>{const e=t;return null!==d&&null!==I&&null!=d[I]&&(e.preventDefault(),e.stopImmediatePropagation(),P(d[I]),!0)}),C),e.registerCommand(u,(t=>null!==d&&null!==I&&null!=d[I]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),P(d[I]),!0)),C))),[P,t,e,d,I,T,C]);return f(a,y((()=>({options:d,selectOptionAndCleanUp:P,selectedIndex:I,setHighlightedIndex:O})),[P,I,d]),m.match?m.match.matchingString:"")}function P(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}function T({options:e,nodeKey:o,onClose:l,onOpen:r,onSelectOption:i,menuRenderFn:u,anchorClassName:s,commandPriority:c=n,parent:d}){const[y]=t(),[w,x]=h(null),E=function(e,n,o,l=(C?document.body:void 0),r=!0){const[i]=t(),u=C?document.createElement("div"):null,s=f(u),c=g((()=>{if(null===s.current||void 0===l)return;s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),n=s.current,u=n.firstChild;if(null!==t&&null!==e){const{left:i,top:c,width:a,height:m}=e.getRect(),d=s.current.offsetHeight;if(n.style.top=`${c+d+3+(r?window.pageYOffset:0)}px`,n.style.left=`${i+window.pageXOffset}px`,n.style.height=`${m}px`,n.style.width=`${a}px`,null!==u){u.style.top=`${c}`;const e=u.getBoundingClientRect(),o=e.height,l=e.width,s=t.getBoundingClientRect();i+l>s.right&&(n.style.left=`${s.right-l+window.pageXOffset}px`),(c+o>window.innerHeight||c+o>s.bottom)&&c-s.top>o+m&&(n.style.top=`${c-o-m+(r?window.pageYOffset:0)}px`)}n.isConnected||(P(n,o),l.append(n)),n.setAttribute("id","typeahead-menu"),t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,r,o,l]);p((()=>{const t=i.getRootElement();return null!==e&&c(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&(e.remove(),e.removeAttribute("id"))}}),[i,c,e]);const a=g((t=>{null!==e&&(t||n(null))}),[e,n]);return O(e,s.current,c,a),null!=u&&u===s.current&&(P(u,o),null!=l&&l.append(u)),s}(w,x,s,d),R=g((()=>{x(null),null!=l&&null!==w&&l()}),[l,w]),I=g((t=>{x(t),null!=r&&null===w&&r(t)}),[r,w]),A=g((()=>{o?y.update((()=>{const t=a(o),e=y.getElementByKey(o);var n;null!=t&&null!=e&&null==w&&(n=()=>I({getRect:()=>e.getBoundingClientRect()}),b in m?m[b](n):n())})):null==o&&null!=w&&R()}),[R,y,o,I,w]);return p((()=>{A()}),[A,o]),p((()=>{if(null!=o)return y.registerUpdateListener((({dirtyElements:t})=>{t.get(o)&&A()}))}),[y,A,o]),null===E.current||null===w||null===y?null:v(S,{close:R,resolution:w,editor:y,anchorElementRef:E,options:e,menuRenderFn:u,onSelectOption:i,commandPriority:c})}export{T as LexicalNodeMenuPlugin,E as MenuOption};
9
+ import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createCommand as e,COMMAND_PRIORITY_LOW as n,KEY_ARROW_DOWN_COMMAND as o,KEY_ARROW_UP_COMMAND as l,KEY_ESCAPE_COMMAND as r,KEY_TAB_COMMAND as i,KEY_ENTER_COMMAND as u,$getSelection as s,$isRangeSelection as c,$getNodeByKey as a}from"lexical";import m,{useLayoutEffect as d,useEffect as p,useRef as f,useCallback as g,useState as h,useMemo as y}from"react";import{mergeRegister as w}from"@lexical/utils";import{jsx as v}from"react/jsx-runtime";const b="startTransition";const C="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,x=C?d:p;class E{key;ref;constructor(t){this.key=t,this.ref={current:null},this.setRefElement=this.setRefElement.bind(this)}setRefElement(t){this.ref={current:t}}}const R=t=>{const e=document.getElementById("typeahead-menu");if(!e)return;const n=e.getBoundingClientRect();n.top+n.height>window.innerHeight&&e.scrollIntoView({block:"center"}),n.top<0&&e.scrollIntoView({block:"center"}),t.scrollIntoView({block:"nearest"})};function I(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect();return n.top>=o.top-6&&n.top<=o.bottom+6}function O(e,n,o,l){const[r]=t();p(()=>{if(null!=n&&null!=e){const t=r.getRootElement(),e=null!=t?function(t){let e=getComputedStyle(t);const n="absolute"===e.position,o=/(auto|scroll)/;if("fixed"===e.position)return document.body;for(let l=t;l=l.parentElement;)if(e=getComputedStyle(l),(!n||"static"!==e.position)&&o.test(e.overflow+e.overflowY+e.overflowX))return l;return document.body}(t):document.body;let i=!1,u=I(n,e);const s=function(){i||(window.requestAnimationFrame(function(){o(),i=!1}),i=!0);const t=I(n,e);t!==u&&(u=t,null!=l&&l(t))},c=new ResizeObserver(o);return window.addEventListener("resize",o),document.addEventListener("scroll",s,{capture:!0,passive:!0}),c.observe(n),()=>{c.unobserve(n),window.removeEventListener("resize",o),document.removeEventListener("scroll",s,!0)}}},[n,r,l,o,e])}const A=e("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function S({close:t,editor:e,anchorElementRef:a,resolution:m,options:d,menuRenderFn:f,onSelectOption:v,shouldSplitNodeWithQuery:b=!1,commandPriority:C=n,preselectFirstItem:E=!0}){const[I,O]=h(null),S=m.match&&m.match.matchingString;p(()=>{E&&O(0)},[S,E]);const P=g(n=>{e.update(()=>{const e=null!=m.match&&b?function(t){const e=s();if(!c(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.slice(-n)===e.substring(0,n)&&(o=n);return o}(r,t.matchingString,i);if(u<0)return null;let a;return 0===u?[a]=o.splitText(l):[,a]=o.splitText(u,l),a}(m.match):null;v(n,e,t,m.match?m.match.matchingString:"")})},[e,b,m.match,v,t]),T=g(t=>{const n=e.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+t),O(t))},[e]);p(()=>()=>{const t=e.getRootElement();null!==t&&t.removeAttribute("aria-activedescendant")},[e]),x(()=>{null===d?O(null):null===I&&E&&T(0)},[d,I,T,E]),p(()=>w(e.registerCommand(A,({option:t})=>!(!t.ref||null==t.ref.current)&&(R(t.ref.current),!0),C)),[e,T,C]),p(()=>w(e.registerCommand(o,t=>{const n=t;if(null!==d&&d.length){const t=null===I?0:I!==d.length-1?I+1:0;T(t);const o=d[t];null!=o.ref&&o.ref.current&&e.dispatchCommand(A,{index:t,option:o}),n.preventDefault(),n.stopImmediatePropagation()}return!0},C),e.registerCommand(l,t=>{const e=t;if(null!==d&&d.length){const t=null===I?d.length-1:0!==I?I-1:d.length-1;T(t);const n=d[t];null!=n.ref&&n.ref.current&&R(n.ref.current),e.preventDefault(),e.stopImmediatePropagation()}return!0},C),e.registerCommand(r,e=>{const n=e;return n.preventDefault(),n.stopImmediatePropagation(),t(),!0},C),e.registerCommand(i,t=>{const e=t;return null!==d&&null!==I&&null!=d[I]&&(e.preventDefault(),e.stopImmediatePropagation(),P(d[I]),!0)},C),e.registerCommand(u,t=>null!==d&&null!==I&&null!=d[I]&&(null!==t&&(t.preventDefault(),t.stopImmediatePropagation()),P(d[I]),!0),C)),[P,t,e,d,I,T,C]);return f(a,y(()=>({options:d,selectOptionAndCleanUp:P,selectedIndex:I,setHighlightedIndex:O}),[P,I,d]),m.match?m.match.matchingString:"")}function P(t,e){null!=e&&(t.className=e),t.setAttribute("aria-label","Typeahead menu"),t.setAttribute("role","listbox"),t.style.display="block",t.style.position="absolute"}function T({options:e,nodeKey:o,onClose:l,onOpen:r,onSelectOption:i,menuRenderFn:u,anchorClassName:s,commandPriority:c=n,parent:d}){const[y]=t(),[w,x]=h(null),E=function(e,n,o,l=(C?document.body:void 0),r=!0){const[i]=t(),u=C?document.createElement("div"):null,s=f(u),c=g(()=>{if(null===s.current||void 0===l)return;s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),n=s.current,u=n.firstChild;if(null!==t&&null!==e){const{left:i,top:c,width:a,height:m}=e.getRect(),d=s.current.offsetHeight;if(n.style.top=`${c+d+3+(r?window.pageYOffset:0)}px`,n.style.left=`${i+window.pageXOffset}px`,n.style.height=`${m}px`,n.style.width=`${a}px`,null!==u){u.style.top=`${c}`;const e=u.getBoundingClientRect(),o=e.height,l=e.width,s=t.getBoundingClientRect();i+l>s.right&&(n.style.left=`${s.right-l+window.pageXOffset}px`),(c+o>window.innerHeight||c+o>s.bottom)&&c-s.top>o+m&&(n.style.top=`${c-o-m+(r?window.pageYOffset:0)}px`)}n.isConnected||(P(n,o),l.append(n)),n.setAttribute("id","typeahead-menu"),t.setAttribute("aria-controls","typeahead-menu")}},[i,e,r,o,l]);p(()=>{const t=i.getRootElement();return null!==e&&c(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&(e.remove(),e.removeAttribute("id"))}},[i,c,e]);const a=g(t=>{null!==e&&(t||n(null))},[e,n]);return O(e,s.current,c,a),null!=u&&u===s.current&&(P(u,o),null!=l&&l.append(u)),s}(w,x,s,d),R=g(()=>{x(null),null!=l&&null!==w&&l()},[l,w]),I=g(t=>{x(t),null!=r&&null===w&&r(t)},[r,w]),A=g(()=>{o?y.update(()=>{const t=a(o),e=y.getElementByKey(o);var n;null!=t&&null!=e&&null==w&&(n=()=>I({getRect:()=>e.getBoundingClientRect()}),b in m?m[b](n):n())}):null==o&&null!=w&&R()},[R,y,o,I,w]);return p(()=>{A()},[A,o]),p(()=>{if(null!=o)return y.registerUpdateListener(({dirtyElements:t})=>{t.get(o)&&A()})},[y,A,o]),null===E.current||null===w||null===y?null:v(S,{close:R,resolution:w,editor:y,anchorElementRef:E,options:e,menuRenderFn:u,onSelectOption:i,commandPriority:c})}export{T as LexicalNodeMenuPlugin,E as MenuOption};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),i=require("react");const r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;exports.OnChangePlugin=function({ignoreHistoryMergeTagChange:i=!0,ignoreSelectionChange:n=!1,onChange:o}){const[a]=e.useLexicalComposerContext();return r((()=>{if(o)return a.registerUpdateListener((({editorState:e,dirtyElements:r,dirtyLeaves:s,prevEditorState:c,tags:u})=>{n&&0===r.size&&0===s.size||i&&u.has(t.HISTORY_MERGE_TAG)||c.isEmpty()||o(e,a,u)}))}),[a,i,n,o]),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("lexical"),i=require("react");const r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;exports.OnChangePlugin=function({ignoreHistoryMergeTagChange:i=!0,ignoreSelectionChange:n=!1,onChange:o}){const[a]=e.useLexicalComposerContext();return r(()=>{if(o)return a.registerUpdateListener(({editorState:e,dirtyElements:r,dirtyLeaves:s,prevEditorState:c,tags:u})=>{n&&0===r.size&&0===s.size||i&&u.has(t.HISTORY_MERGE_TAG)||c.isEmpty()||o(e,a,u)})},[a,i,n,o]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{HISTORY_MERGE_TAG as t}from"lexical";import{useLayoutEffect as o,useEffect as i}from"react";const r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o:i;function n({ignoreHistoryMergeTagChange:o=!0,ignoreSelectionChange:i=!1,onChange:n}){const[a]=e();return r((()=>{if(n)return a.registerUpdateListener((({editorState:e,dirtyElements:r,dirtyLeaves:d,prevEditorState:s,tags:c})=>{i&&0===r.size&&0===d.size||o&&c.has(t)||s.isEmpty()||n(e,a,c)}))}),[a,o,i,n]),null}export{n as OnChangePlugin};
9
+ import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{HISTORY_MERGE_TAG as t}from"lexical";import{useLayoutEffect as o,useEffect as i}from"react";const r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o:i;function n({ignoreHistoryMergeTagChange:o=!0,ignoreSelectionChange:i=!1,onChange:n}){const[a]=e();return r(()=>{if(n)return a.registerUpdateListener(({editorState:e,dirtyElements:r,dirtyLeaves:d,prevEditorState:s,tags:c})=>{i&&0===r.size&&0===d.size||o&&c.has(t)||s.isEmpty()||n(e,a,c)})},[a,o,i,n]),null}export{n as OnChangePlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),c=require("react/jsx-runtime"),a=require("@lexical/text"),s=require("@lexical/utils"),l=require("@lexical/dragon"),u=require("@lexical/plain-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function f({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState((()=>e.getDecorators()));return x((()=>e.registerDecoratorListener((e=>{i.flushSync((()=>{n(e)}))}))),[e]),o.useEffect((()=>{n(e.getDecorators())}),[e]),o.useMemo((()=>{const n=[],a=Object.keys(t);for(let s=0;s<a.length;s++){const l=a[s],u=c.jsx(r,{onError:r=>e._onError(r),children:c.jsx(o.Suspense,{fallback:null,children:t[l]})}),d=e.getElementByKey(l);null!==d&&n.push(i.createPortal(u,d,l))}return n}),[r,t,e])}(e,r)}function g({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:c.jsx(f,{editor:e,ErrorBoundary:r})}function m(e){return e.getEditorState().read(a.$canShowPlaceholderCurry(e.isComposing()))}function E({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState((()=>m(e)));return x((()=>{function r(){const r=m(e);t(r)}return r(),s.mergeRegister(e.registerUpdateListener((()=>{r()})),e.registerEditableListener((()=>{r()})))}),[e]),r}(n),c=r.useLexicalEditable();return i?"function"==typeof t?t(c):t:null}exports.PlainTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){x((()=>s.mergeRegister(u.registerPlainText(e),l.registerDragonSupport(e))),[e])}(o),c.jsxs(c.Fragment,{children:[r,c.jsx(E,{content:t}),c.jsx(g,{editor:o,ErrorBoundary:n})]})};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),c=require("react/jsx-runtime"),a=require("@lexical/text"),s=require("@lexical/utils"),l=require("@lexical/dragon"),u=require("@lexical/plain-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function f({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState(()=>e.getDecorators());return x(()=>e.registerDecoratorListener(e=>{i.flushSync(()=>{n(e)})}),[e]),o.useEffect(()=>{n(e.getDecorators())},[e]),o.useMemo(()=>{const n=[],a=Object.keys(t);for(let s=0;s<a.length;s++){const l=a[s],u=c.jsx(r,{onError:r=>e._onError(r),children:c.jsx(o.Suspense,{fallback:null,children:t[l]})}),d=e.getElementByKey(l);null!==d&&n.push(i.createPortal(u,d,l))}return n},[r,t,e])}(e,r)}function g({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:c.jsx(f,{editor:e,ErrorBoundary:r})}function m(e){return e.getEditorState().read(a.$canShowPlaceholderCurry(e.isComposing()))}function E({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState(()=>m(e));return x(()=>{function r(){const r=m(e);t(r)}return r(),s.mergeRegister(e.registerUpdateListener(()=>{r()}),e.registerEditableListener(()=>{r()}))},[e]),r}(n),c=r.useLexicalEditable();return i?"function"==typeof t?t(c):t:null}exports.PlainTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){x(()=>s.mergeRegister(u.registerPlainText(e),l.registerDragonSupport(e)),[e])}(o),c.jsxs(c.Fragment,{children:[r,c.jsx(E,{content:t}),c.jsx(g,{editor:o,ErrorBoundary:n})]})};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as a,Suspense as l}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{jsx as d,jsxs as f,Fragment as m}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{mergeRegister as x}from"@lexical/utils";import{registerDragonSupport as E}from"@lexical/dragon";import{registerPlainText as h}from"@lexical/plain-text";function g(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function w({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c((()=>r.getDecorators()));return y((()=>r.registerDecoratorListener((r=>{s((()=>{o(r)}))}))),[r]),i((()=>{o(r.getDecorators())}),[r]),a((()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],a=d(e,{onError:e=>r._onError(e),children:d(l,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(a,s,c))}return o}),[e,t,r])}(r,e)}function v({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&g(320,r);return!0}return!1}(r)?null:d(w,{editor:r,ErrorBoundary:e})}function B(r){return r.getEditorState().read(p(r.isComposing()))}function L({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){y((()=>x(h(r),E(r))),[r])}(n),f(m,{children:[e,d(b,{content:t}),d(v,{editor:n,ErrorBoundary:o})]})}function b({content:t}){const[o]=r(),n=function(r){const[e,t]=c((()=>B(r)));return y((()=>{function e(){const e=B(r);t(e)}return e(),x(r.registerUpdateListener((()=>{e()})),r.registerEditableListener((()=>{e()})))}),[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{L as PlainTextPlugin};
9
+ import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as a,Suspense as l}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{jsx as d,jsxs as f,Fragment as m}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{mergeRegister as x}from"@lexical/utils";import{registerDragonSupport as E}from"@lexical/dragon";import{registerPlainText as h}from"@lexical/plain-text";function g(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function w({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c(()=>r.getDecorators());return y(()=>r.registerDecoratorListener(r=>{s(()=>{o(r)})}),[r]),i(()=>{o(r.getDecorators())},[r]),a(()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],a=d(e,{onError:e=>r._onError(e),children:d(l,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(a,s,c))}return o},[e,t,r])}(r,e)}function v({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&g(320,r);return!0}return!1}(r)?null:d(w,{editor:r,ErrorBoundary:e})}function B(r){return r.getEditorState().read(p(r.isComposing()))}function L({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){y(()=>x(h(r),E(r)),[r])}(n),f(m,{children:[e,d(b,{content:t}),d(v,{editor:n,ErrorBoundary:o})]})}function b({content:t}){const[o]=r(),n=function(r){const[e,t]=c(()=>B(r));return y(()=>{function e(){const e=B(r);t(e)}return e(),x(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{L as PlainTextPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalContentEditable"),r=require("@lexical/react/LexicalErrorBoundary"),n=require("@lexical/react/ReactProviderExtension"),t=require("lexical"),o=require("@lexical/react/LexicalComposerContext"),i=require("react"),c=require("react-dom"),a=require("react/jsx-runtime");function s(e,r){const[n]=r,t=e.decorators.map((e=>"function"==typeof e?a.jsx(e,{context:r}):e));return function(s){const{EditorChildrenComponent:l=e.EditorChildrenComponent,ErrorBoundary:d=e.ErrorBoundary,contentEditable:u=e.contentEditable,children:x}=s,E=function(e,r){const[n,t]=i.useMemo((()=>[r=>e.registerDecoratorListener(r),()=>e.getDecorators()]),[e]),o=i.useSyncExternalStore(n,t);return i.useMemo((()=>{const n=[];for(const t in o){const s=e.getElementByKey(t);if(null!==s){const l=a.jsx(r,{onError:r=>{e._onError(r)},children:a.jsx(i.Suspense,{fallback:null,children:o[t]})});n.push(c.createPortal(l,s,t))}}return n}),[r,o,e])}(n,d),m=i.useMemo((()=>t.map(((e,r)=>a.jsx(d,{onError:e=>{n._onError(e)},children:a.jsx(i.Suspense,{fallback:null,children:e})},r)))),[d]);return a.jsx(o.LexicalComposerContext.Provider,{value:r,children:a.jsxs(l,{context:r,contentEditable:u,children:[x,m,E]})})}}function l({contentEditable:e,children:r}){return a.jsxs(a.Fragment,{children:[e,r]})}const d={EditorChildrenComponent:l,ErrorBoundary:r.LexicalErrorBoundary,contentEditable:a.jsx(e.ContentEditable,{}),decorators:[]},u=t.defineExtension({build(e,r,t){t.getPeer(n.ReactProviderExtension.name)||function(e,...r){const n=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",e);for(const e of r)t.append("v",e);throw n.search=t.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...t.getDirectDependentNames()].join(" "));const o=[e,{getTheme:()=>e._config.theme}];return{Component:s(r,o),context:o}},config:d,mergeConfig(e,r){const n=t.shallowMergeConfig(e,r);return r.decorators&&(n.decorators=r.decorators.length>0?[...e.decorators,...r.decorators]:e.decorators),n},name:"@lexical/react/React",peerDependencies:[t.declarePeerDependency(n.ReactProviderExtension.name)]});exports.DefaultEditorChildrenComponent=l,exports.ReactExtension=u;
9
+ "use strict";var e=require("@lexical/react/LexicalContentEditable"),r=require("@lexical/react/LexicalErrorBoundary"),n=require("@lexical/react/ReactProviderExtension"),t=require("lexical"),o=require("@lexical/react/LexicalComposerContext"),i=require("react"),c=require("react-dom"),a=require("react/jsx-runtime");function s(e,r){const[n]=r,t=e.decorators.map(e=>"function"==typeof e?a.jsx(e,{context:r}):e);return function(s){const{EditorChildrenComponent:l=e.EditorChildrenComponent,ErrorBoundary:d=e.ErrorBoundary,contentEditable:u=e.contentEditable,children:x}=s,E=function(e,r){const[n,t]=i.useMemo(()=>[r=>e.registerDecoratorListener(r),()=>e.getDecorators()],[e]),o=i.useSyncExternalStore(n,t);return i.useMemo(()=>{const n=[];for(const t in o){const s=e.getElementByKey(t);if(null!==s){const l=a.jsx(r,{onError:r=>{e._onError(r)},children:a.jsx(i.Suspense,{fallback:null,children:o[t]})});n.push(c.createPortal(l,s,t))}}return n},[r,o,e])}(n,d),m=i.useMemo(()=>t.map((e,r)=>a.jsx(d,{onError:e=>{n._onError(e)},children:a.jsx(i.Suspense,{fallback:null,children:e})},r)),[d]);return a.jsx(o.LexicalComposerContext.Provider,{value:r,children:a.jsxs(l,{context:r,contentEditable:u,children:[x,m,E]})})}}function l({contentEditable:e,children:r}){return a.jsxs(a.Fragment,{children:[e,r]})}const d={EditorChildrenComponent:l,ErrorBoundary:r.LexicalErrorBoundary,contentEditable:a.jsx(e.ContentEditable,{}),decorators:[]},u=t.defineExtension({build(e,r,t){t.getPeer(n.ReactProviderExtension.name)||function(e,...r){const n=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",e);for(const e of r)t.append("v",e);throw n.search=t.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...t.getDirectDependentNames()].join(" "));const o=[e,{getTheme:()=>e._config.theme}];return{Component:s(r,o),context:o}},config:d,mergeConfig(e,r){const n=t.shallowMergeConfig(e,r);return r.decorators&&(n.decorators=r.decorators.length>0?[...e.decorators,...r.decorators]:e.decorators),n},name:"@lexical/react/React",peerDependencies:[t.declarePeerDependency(n.ReactProviderExtension.name)]});exports.DefaultEditorChildrenComponent=l,exports.ReactExtension=u;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{ContentEditable as r}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as e}from"@lexical/react/LexicalErrorBoundary";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{defineExtension as t,declarePeerDependency as n,shallowMergeConfig as c}from"lexical";import{LexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{useMemo as a,useSyncExternalStore as l,Suspense as d}from"react";import{createPortal as s}from"react-dom";import{jsx as m,jsxs as f,Fragment as u}from"react/jsx-runtime";function p(r,e){const[o]=e,t=r.decorators.map((r=>"function"==typeof r?m(r,{context:e}):r));return function(n){const{EditorChildrenComponent:c=r.EditorChildrenComponent,ErrorBoundary:u=r.ErrorBoundary,contentEditable:p=r.contentEditable,children:h}=n,E=function(r,e){const[o,t]=a((()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()]),[r]),n=l(o,t);return a((()=>{const o=[];for(const t in n){const c=r.getElementByKey(t);if(null!==c){const i=m(e,{onError:e=>{r._onError(e)},children:m(d,{fallback:null,children:n[t]})});o.push(s(i,c,t))}}return o}),[e,n,r])}(o,u),x=a((()=>t.map(((r,e)=>m(u,{onError:r=>{o._onError(r)},children:m(d,{fallback:null,children:r})},e)))),[u]);return m(i.Provider,{value:e,children:f(c,{context:e,contentEditable:p,children:[h,x,E]})})}}function h({contentEditable:r,children:e}){return f(u,{children:[r,e]})}const E={EditorChildrenComponent:h,ErrorBoundary:e,contentEditable:m(r,{}),decorators:[]},x=t({build(r,e,t){t.getPeer(o.name)||function(r,...e){const o=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",r);for(const r of e)t.append("v",r);throw o.search=t.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...t.getDirectDependentNames()].join(" "));const n=[r,{getTheme:()=>r._config.theme}];return{Component:p(e,n),context:n}},config:E,mergeConfig(r,e){const o=c(r,e);return e.decorators&&(o.decorators=e.decorators.length>0?[...r.decorators,...e.decorators]:r.decorators),o},name:"@lexical/react/React",peerDependencies:[n(o.name)]});export{h as DefaultEditorChildrenComponent,x as ReactExtension};
9
+ import{ContentEditable as r}from"@lexical/react/LexicalContentEditable";import{LexicalErrorBoundary as e}from"@lexical/react/LexicalErrorBoundary";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{defineExtension as t,declarePeerDependency as n,shallowMergeConfig as c}from"lexical";import{LexicalComposerContext as i}from"@lexical/react/LexicalComposerContext";import{useMemo as a,useSyncExternalStore as l,Suspense as d}from"react";import{createPortal as s}from"react-dom";import{jsx as m,jsxs as f,Fragment as u}from"react/jsx-runtime";function p(r,e){const[o]=e,t=r.decorators.map(r=>"function"==typeof r?m(r,{context:e}):r);return function(n){const{EditorChildrenComponent:c=r.EditorChildrenComponent,ErrorBoundary:u=r.ErrorBoundary,contentEditable:p=r.contentEditable,children:h}=n,E=function(r,e){const[o,t]=a(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),n=l(o,t);return a(()=>{const o=[];for(const t in n){const c=r.getElementByKey(t);if(null!==c){const i=m(e,{onError:e=>{r._onError(e)},children:m(d,{fallback:null,children:n[t]})});o.push(s(i,c,t))}}return o},[e,n,r])}(o,u),x=a(()=>t.map((r,e)=>m(u,{onError:r=>{o._onError(r)},children:m(d,{fallback:null,children:r})},e)),[u]);return m(i.Provider,{value:e,children:f(c,{context:e,contentEditable:p,children:[h,x,E]})})}}function h({contentEditable:r,children:e}){return f(u,{children:[r,e]})}const E={EditorChildrenComponent:h,ErrorBoundary:e,contentEditable:m(r,{}),decorators:[]},x=t({build(r,e,t){t.getPeer(o.name)||function(r,...e){const o=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",r);for(const r of e)t.append("v",r);throw o.search=t.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...t.getDirectDependentNames()].join(" "));const n=[r,{getTheme:()=>r._config.theme}];return{Component:p(e,n),context:n}},config:E,mergeConfig(r,e){const o=c(r,e);return e.decorators&&(o.decorators=e.decorators.length>0?[...r.decorators,...e.decorators]:r.decorators),o},name:"@lexical/react/React",peerDependencies:[n(o.name)]});export{h as DefaultEditorChildrenComponent,x as ReactExtension};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),n=require("@lexical/react/ReactExtension"),t=require("@lexical/react/ReactProviderExtension"),o=require("@lexical/utils"),r=require("lexical"),i=require("react"),s=require("react-dom"),u=require("react-dom/client"),c=require("react/jsx-runtime");function a(n,t){e.getExtensionDependencyFromEditor(n,m).output.mountReactPlugin(t)}const l=r.createCommand("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),d=r.createCommand("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND");const m=r.defineExtension({build:(n,t,o)=>({mountReactPlugin:e=>{n.dispatchCommand(d,e)},mountReactPluginHost:e=>n.dispatchCommand(l,{root:u.createRoot(e)}),mountedPluginsStore:e.signal({plugins:new Map})}),dependencies:[t.ReactProviderExtension,r.configExtension(n.ReactExtension,{decorators:[function({context:[t]}){const{mountedPluginsStore:o}=e.getExtensionDependencyFromEditor(t,m).output,{ErrorBoundary:r}=e.getExtensionDependencyFromEditor(t,n.ReactExtension).config,u=t._onError.bind(t),[{plugins:a},l]=i.useState((()=>o.peek()));i.useEffect((()=>e.effect((()=>l(o.value)))),[o]);const d=[];for(const{key:e,element:n,domNode:t}of a.values()){if(!n)continue;const o=c.jsx(r,{onError:u,children:c.jsx(i.Suspense,{fallback:null,children:n})},e);d.push(t?s.createPortal(o,t,e):o)}return d.length>0?c.jsx(c.Fragment,{children:d}):null}]})],name:"@lexical/react/ReactPluginHost",register(t,i,s){let u;const{mountedPluginsStore:a}=s.getOutput(),{Component:m}=s.getDependency(n.ReactExtension).output;return o.mergeRegister((()=>{u&&u.unmount(),e.untracked((()=>{a.value.plugins.clear()}))}),t.registerCommand(d,(n=>(e.untracked((()=>{const{plugins:e}=a.value;e.set(n.key,n),a.value={plugins:e}})),!1)),r.COMMAND_PRIORITY_CRITICAL),t.registerCommand(l,(e=>(void 0!==u&&function(e,...n){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of n)o.append("v",e);throw t.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(322),u=e.root,u.render(c.jsx(m,{contentEditable:null})),!0)),r.COMMAND_PRIORITY_EDITOR))}});exports.REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND=d,exports.REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND=l,exports.ReactPluginHostExtension=m,exports.mountReactExtensionComponent=function(n,t){const{props:o,extension:r,...i}=t,{Component:s}=e.getExtensionDependencyFromEditor(n,r).output;a(n,{...i,element:o?c.jsx(s,{...o}):null})},exports.mountReactPluginComponent=function(e,n){const{Component:t,props:o,...r}=n;a(e,{...r,element:o?c.jsx(t,{...o}):null})},exports.mountReactPluginElement=a,exports.mountReactPluginHost=function(n,t){e.getExtensionDependencyFromEditor(n,m).output.mountReactPluginHost(t)};
9
+ "use strict";var e=require("@lexical/extension"),n=require("@lexical/react/ReactExtension"),t=require("@lexical/react/ReactProviderExtension"),o=require("@lexical/utils"),r=require("lexical"),i=require("react"),s=require("react-dom"),u=require("react-dom/client"),c=require("react/jsx-runtime");function a(n,t){e.getExtensionDependencyFromEditor(n,m).output.mountReactPlugin(t)}const l=r.createCommand("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),d=r.createCommand("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND");const m=r.defineExtension({build:(n,t,o)=>({mountReactPlugin:e=>{n.dispatchCommand(d,e)},mountReactPluginHost:e=>n.dispatchCommand(l,{root:u.createRoot(e)}),mountedPluginsStore:e.signal({plugins:new Map})}),dependencies:[t.ReactProviderExtension,r.configExtension(n.ReactExtension,{decorators:[function({context:[t]}){const{mountedPluginsStore:o}=e.getExtensionDependencyFromEditor(t,m).output,{ErrorBoundary:r}=e.getExtensionDependencyFromEditor(t,n.ReactExtension).config,u=t._onError.bind(t),[{plugins:a},l]=i.useState(()=>o.peek());i.useEffect(()=>e.effect(()=>l(o.value)),[o]);const d=[];for(const{key:e,element:n,domNode:t}of a.values()){if(!n)continue;const o=c.jsx(r,{onError:u,children:c.jsx(i.Suspense,{fallback:null,children:n})},e);d.push(t?s.createPortal(o,t,e):o)}return d.length>0?c.jsx(c.Fragment,{children:d}):null}]})],name:"@lexical/react/ReactPluginHost",register(t,i,s){let u;const{mountedPluginsStore:a}=s.getOutput(),{Component:m}=s.getDependency(n.ReactExtension).output;return o.mergeRegister(()=>{u&&u.unmount(),e.untracked(()=>{a.value.plugins.clear()})},t.registerCommand(d,n=>(e.untracked(()=>{const{plugins:e}=a.value;e.set(n.key,n),a.value={plugins:e}}),!1),r.COMMAND_PRIORITY_CRITICAL),t.registerCommand(l,e=>(void 0!==u&&function(e,...n){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of n)o.append("v",e);throw t.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(322),u=e.root,u.render(c.jsx(m,{contentEditable:null})),!0),r.COMMAND_PRIORITY_EDITOR))}});exports.REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND=d,exports.REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND=l,exports.ReactPluginHostExtension=m,exports.mountReactExtensionComponent=function(n,t){const{props:o,extension:r,...i}=t,{Component:s}=e.getExtensionDependencyFromEditor(n,r).output;a(n,{...i,element:o?c.jsx(s,{...o}):null})},exports.mountReactPluginComponent=function(e,n){const{Component:t,props:o,...r}=n;a(e,{...r,element:o?c.jsx(t,{...o}):null})},exports.mountReactPluginElement=a,exports.mountReactPluginHost=function(n,t){e.getExtensionDependencyFromEditor(n,m).output.mountReactPluginHost(t)};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{untracked as e,signal as n,getExtensionDependencyFromEditor as t,effect as o}from"@lexical/extension";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{ReactProviderExtension as i}from"@lexical/react/ReactProviderExtension";import{mergeRegister as l}from"@lexical/utils";import{createCommand as u,defineExtension as c,configExtension as a,COMMAND_PRIORITY_CRITICAL as s,COMMAND_PRIORITY_EDITOR as m}from"lexical";import{useState as p,useEffect as d,Suspense as f}from"react";import{createPortal as g}from"react-dom";import{createRoot as x}from"react-dom/client";import{jsx as h,Fragment as P}from"react/jsx-runtime";function v(e,n){const{props:o,extension:r,...i}=n,{Component:l}=t(e,r).output;C(e,{...i,element:o?h(l,{...o}):null})}function R(e,n){const{Component:t,props:o,...r}=n;C(e,{...r,element:o?h(t,{...o}):null})}function C(e,n){t(e,M).output.mountReactPlugin(n)}function _(e,n){t(e,M).output.mountReactPluginHost(n)}const E=u("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),O=u("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND");const M=c({build:(e,t,o)=>({mountReactPlugin:n=>{e.dispatchCommand(O,n)},mountReactPluginHost:n=>e.dispatchCommand(E,{root:x(n)}),mountedPluginsStore:n({plugins:new Map})}),dependencies:[i,a(r,{decorators:[function({context:[e]}){const{mountedPluginsStore:n}=t(e,M).output,{ErrorBoundary:i}=t(e,r).config,l=e._onError.bind(e),[{plugins:u},c]=p((()=>n.peek()));d((()=>o((()=>c(n.value)))),[n]);const a=[];for(const{key:e,element:n,domNode:t}of u.values()){if(!n)continue;const o=h(i,{onError:l,children:h(f,{fallback:null,children:n})},e);a.push(t?g(o,t,e):o)}return a.length>0?h(P,{children:a}):null}]})],name:"@lexical/react/ReactPluginHost",register(n,t,o){let i;const{mountedPluginsStore:u}=o.getOutput(),{Component:c}=o.getDependency(r).output;return l((()=>{i&&i.unmount(),e((()=>{u.value.plugins.clear()}))}),n.registerCommand(O,(n=>(e((()=>{const{plugins:e}=u.value;e.set(n.key,n),u.value={plugins:e}})),!1)),s),n.registerCommand(E,(e=>(void 0!==i&&function(e,...n){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of n)o.append("v",e);throw t.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(322),i=e.root,i.render(h(c,{contentEditable:null})),!0)),m))}});export{O as REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND,E as REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND,M as ReactPluginHostExtension,v as mountReactExtensionComponent,R as mountReactPluginComponent,C as mountReactPluginElement,_ as mountReactPluginHost};
9
+ import{untracked as e,signal as n,getExtensionDependencyFromEditor as t,effect as o}from"@lexical/extension";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{ReactProviderExtension as i}from"@lexical/react/ReactProviderExtension";import{mergeRegister as l}from"@lexical/utils";import{createCommand as u,defineExtension as c,configExtension as a,COMMAND_PRIORITY_CRITICAL as s,COMMAND_PRIORITY_EDITOR as m}from"lexical";import{useState as p,useEffect as d,Suspense as f}from"react";import{createPortal as g}from"react-dom";import{createRoot as x}from"react-dom/client";import{jsx as h,Fragment as P}from"react/jsx-runtime";function v(e,n){const{props:o,extension:r,...i}=n,{Component:l}=t(e,r).output;C(e,{...i,element:o?h(l,{...o}):null})}function R(e,n){const{Component:t,props:o,...r}=n;C(e,{...r,element:o?h(t,{...o}):null})}function C(e,n){t(e,M).output.mountReactPlugin(n)}function _(e,n){t(e,M).output.mountReactPluginHost(n)}const E=u("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),O=u("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND");const M=c({build:(e,t,o)=>({mountReactPlugin:n=>{e.dispatchCommand(O,n)},mountReactPluginHost:n=>e.dispatchCommand(E,{root:x(n)}),mountedPluginsStore:n({plugins:new Map})}),dependencies:[i,a(r,{decorators:[function({context:[e]}){const{mountedPluginsStore:n}=t(e,M).output,{ErrorBoundary:i}=t(e,r).config,l=e._onError.bind(e),[{plugins:u},c]=p(()=>n.peek());d(()=>o(()=>c(n.value)),[n]);const a=[];for(const{key:e,element:n,domNode:t}of u.values()){if(!n)continue;const o=h(i,{onError:l,children:h(f,{fallback:null,children:n})},e);a.push(t?g(o,t,e):o)}return a.length>0?h(P,{children:a}):null}]})],name:"@lexical/react/ReactPluginHost",register(n,t,o){let i;const{mountedPluginsStore:u}=o.getOutput(),{Component:c}=o.getDependency(r).output;return l(()=>{i&&i.unmount(),e(()=>{u.value.plugins.clear()})},n.registerCommand(O,n=>(e(()=>{const{plugins:e}=u.value;e.set(n.key,n),u.value={plugins:e}}),!1),s),n.registerCommand(E,e=>(void 0!==i&&function(e,...n){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of n)o.append("v",e);throw t.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(322),i=e.root,i.render(h(c,{contentEditable:null})),!0),m))}});export{O as REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND,E as REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND,M as ReactPluginHostExtension,v as mountReactExtensionComponent,R as mountReactPluginComponent,C as mountReactPluginElement,_ as mountReactPluginHost};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),c=require("react/jsx-runtime"),a=require("@lexical/text"),s=require("@lexical/utils"),u=require("@lexical/dragon"),l=require("@lexical/rich-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function f({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState((()=>e.getDecorators()));return x((()=>e.registerDecoratorListener((e=>{i.flushSync((()=>{n(e)}))}))),[e]),o.useEffect((()=>{n(e.getDecorators())}),[e]),o.useMemo((()=>{const n=[],a=Object.keys(t);for(let s=0;s<a.length;s++){const u=a[s],l=c.jsx(r,{onError:r=>e._onError(r),children:c.jsx(o.Suspense,{fallback:null,children:t[u]})}),d=e.getElementByKey(u);null!==d&&n.push(i.createPortal(l,d,u))}return n}),[r,t,e])}(e,r)}function g({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:c.jsx(f,{editor:e,ErrorBoundary:r})}function m(e){return e.getEditorState().read(a.$canShowPlaceholderCurry(e.isComposing()))}function E({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState((()=>m(e)));return x((()=>{function r(){const r=m(e);t(r)}return r(),s.mergeRegister(e.registerUpdateListener((()=>{r()})),e.registerEditableListener((()=>{r()})))}),[e]),r}(n),c=r.useLexicalEditable();return i?"function"==typeof t?t(c):t:null}exports.RichTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){x((()=>s.mergeRegister(l.registerRichText(e),u.registerDragonSupport(e))),[e])}(o),c.jsxs(c.Fragment,{children:[r,c.jsx(E,{content:t}),c.jsx(g,{editor:o,ErrorBoundary:n})]})};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalEditable"),t=require("@lexical/extension"),n=require("@lexical/react/ReactProviderExtension"),o=require("react"),i=require("react-dom"),c=require("react/jsx-runtime"),a=require("@lexical/text"),s=require("@lexical/utils"),u=require("@lexical/dragon"),l=require("@lexical/rich-text");function d(e,...r){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",e);for(const e of r)n.append("v",e);throw t.search=n.toString(),Error(`Minified Lexical error #${e}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const x="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function f({editor:e,ErrorBoundary:r}){return function(e,r){const[t,n]=o.useState(()=>e.getDecorators());return x(()=>e.registerDecoratorListener(e=>{i.flushSync(()=>{n(e)})}),[e]),o.useEffect(()=>{n(e.getDecorators())},[e]),o.useMemo(()=>{const n=[],a=Object.keys(t);for(let s=0;s<a.length;s++){const u=a[s],l=c.jsx(r,{onError:r=>e._onError(r),children:c.jsx(o.Suspense,{fallback:null,children:t[u]})}),d=e.getElementByKey(u);null!==d&&n.push(i.createPortal(l,d,u))}return n},[r,t,e])}(e,r)}function g({editor:e,ErrorBoundary:r}){return function(e){const r=t.LexicalBuilder.maybeFromEditor(e);if(r&&r.hasExtensionByName(n.ReactProviderExtension.name)){for(const e of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(e)&&d(320,e);return!0}return!1}(e)?null:c.jsx(f,{editor:e,ErrorBoundary:r})}function m(e){return e.getEditorState().read(a.$canShowPlaceholderCurry(e.isComposing()))}function E({content:t}){const[n]=e.useLexicalComposerContext(),i=function(e){const[r,t]=o.useState(()=>m(e));return x(()=>{function r(){const r=m(e);t(r)}return r(),s.mergeRegister(e.registerUpdateListener(()=>{r()}),e.registerEditableListener(()=>{r()}))},[e]),r}(n),c=r.useLexicalEditable();return i?"function"==typeof t?t(c):t:null}exports.RichTextPlugin=function({contentEditable:r,placeholder:t=null,ErrorBoundary:n}){const[o]=e.useLexicalComposerContext();return function(e){x(()=>s.mergeRegister(l.registerRichText(e),u.registerDragonSupport(e)),[e])}(o),c.jsxs(c.Fragment,{children:[r,c.jsx(E,{content:t}),c.jsx(g,{editor:o,ErrorBoundary:n})]})};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as a,Suspense as l}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{jsx as d,jsxs as f,Fragment as m}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{mergeRegister as x}from"@lexical/utils";import{registerDragonSupport as E}from"@lexical/dragon";import{registerRichText as h}from"@lexical/rich-text";function g(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function w({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c((()=>r.getDecorators()));return y((()=>r.registerDecoratorListener((r=>{s((()=>{o(r)}))}))),[r]),i((()=>{o(r.getDecorators())}),[r]),a((()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],a=d(e,{onError:e=>r._onError(e),children:d(l,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(a,s,c))}return o}),[e,t,r])}(r,e)}function v({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&g(320,r);return!0}return!1}(r)?null:d(w,{editor:r,ErrorBoundary:e})}function B(r){return r.getEditorState().read(p(r.isComposing()))}function L({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){y((()=>x(h(r),E(r))),[r])}(n),f(m,{children:[e,d(b,{content:t}),d(v,{editor:n,ErrorBoundary:o})]})}function b({content:t}){const[o]=r(),n=function(r){const[e,t]=c((()=>B(r)));return y((()=>{function e(){const e=B(r);t(e)}return e(),x(r.registerUpdateListener((()=>{e()})),r.registerEditableListener((()=>{e()})))}),[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{L as RichTextPlugin};
9
+ import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as e}from"@lexical/react/useLexicalEditable";import{LexicalBuilder as t}from"@lexical/extension";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useLayoutEffect as n,useEffect as i,useState as c,useMemo as a,Suspense as l}from"react";import{flushSync as s,createPortal as u}from"react-dom";import{jsx as d,jsxs as f,Fragment as m}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{mergeRegister as x}from"@lexical/utils";import{registerDragonSupport as E}from"@lexical/dragon";import{registerRichText as h}from"@lexical/rich-text";function g(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:i;function w({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=c(()=>r.getDecorators());return y(()=>r.registerDecoratorListener(r=>{s(()=>{o(r)})}),[r]),i(()=>{o(r.getDecorators())},[r]),a(()=>{const o=[],n=Object.keys(t);for(let i=0;i<n.length;i++){const c=n[i],a=d(e,{onError:e=>r._onError(e),children:d(l,{fallback:null,children:t[c]})}),s=r.getElementByKey(c);null!==s&&o.push(u(a,s,c))}return o},[e,t,r])}(r,e)}function v({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&g(320,r);return!0}return!1}(r)?null:d(w,{editor:r,ErrorBoundary:e})}function B(r){return r.getEditorState().read(p(r.isComposing()))}function L({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){y(()=>x(h(r),E(r)),[r])}(n),f(m,{children:[e,d(b,{content:t}),d(v,{editor:n,ErrorBoundary:o})]})}function b({content:t}){const[o]=r(),n=function(r){const[e,t]=c(()=>B(r));return y(()=>{function e(){const e=B(r);t(e)}return e(),x(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{L as RichTextPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/utils"),l=require("react");exports.SelectionAlwaysOnDisplay=function(){const[r]=e.useLexicalComposerContext();return l.useEffect((()=>t.selectionAlwaysOnDisplay(r)),[r]),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/utils"),l=require("react");exports.SelectionAlwaysOnDisplay=function(){const[r]=e.useLexicalComposerContext();return l.useEffect(()=>t.selectionAlwaysOnDisplay(r),[r]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{selectionAlwaysOnDisplay as r}from"@lexical/utils";import{useEffect as t}from"react";function e(){const[e]=o();return t((()=>r(e)),[e]),null}export{e as SelectionAlwaysOnDisplay};
9
+ import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{selectionAlwaysOnDisplay as r}from"@lexical/utils";import{useEffect as t}from"react";function e(){const[e]=o();return t(()=>r(e),[e]),null}export{e as SelectionAlwaysOnDisplay};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),n=require("react");exports.registerTabIndentation=e.registerTabIndentation,exports.TabIndentationPlugin=function({maxIndent:r}){const[i]=t.useLexicalComposerContext();return n.useEffect((()=>e.registerTabIndentation(i,r)),[i,r]),null};
9
+ "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),n=require("react");exports.registerTabIndentation=e.registerTabIndentation,exports.TabIndentationPlugin=function({maxIndent:r}){const[i]=t.useLexicalComposerContext();return n.useEffect(()=>e.registerTabIndentation(i,r),[i,r]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{registerTabIndentation as e}from"@lexical/extension";export{registerTabIndentation}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useEffect as o}from"react";function r({maxIndent:r}){const[n]=t();return o((()=>e(n,r)),[n,r]),null}export{r as TabIndentationPlugin};
9
+ import{registerTabIndentation as e}from"@lexical/extension";export{registerTabIndentation}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useEffect as o}from"react";function r({maxIndent:r}){const[n]=t();return o(()=>e(n,r),[n,r]),null}export{r as TabIndentationPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/rich-text"),n=require("@lexical/utils"),o=require("lexical"),r=require("react");function i(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function s(e,t,n){if(null===t)return n;const o=i(t);let r=[];if(null===e){if(n.length>0&&n[0][0]===t.__key)return n;r=[o,...n]}else for(let i=0;i<n.length;i++){const s=n[i][0];if(r.push(n[i]),s===e.getKey()&&s!==t.getKey()){if(i+1<n.length&&n[i+1][0]===t.__key)return n;r.push(o)}}return r}function u(e,t){const n=[];for(const o of t)o[0]!==e&&n.push(o);return n}function l(e,t){const n=[];for(const o of t)o[0]===e.getKey()?n.push(i(e)):n.push(o);return n}function c(e,t,n){const o=[],r=i(t);e||o.push(r);for(const i of n)i[0]!==t.getKey()&&(o.push(i),e&&i[0]===e.getKey()&&o.push(r));return o}function d(e){let o=n.$getNextRightPreorderNode(e);for(;null!==o&&!t.$isHeadingNode(o);)o=n.$getNextRightPreorderNode(o);return o}exports.TableOfContentsPlugin=function({children:n}){const[i,g]=r.useState([]),[f]=e.useLexicalComposerContext();return r.useEffect((()=>{let e=[];f.getEditorState().read((()=>{const n=r=>{for(const i of r.getChildren())t.$isHeadingNode(i)?e.push([i.getKey(),i.getTextContent(),i.getTag()]):o.$isElementNode(i)&&n(i)};n(o.$getRoot()),g(e)}));const n=f.registerUpdateListener((({editorState:n,dirtyElements:r})=>{n.read((()=>{const n=r=>{for(const i of r.getChildren())if(t.$isHeadingNode(i)){const t=d(i);e=c(t,i,e),g(e)}else o.$isElementNode(i)&&n(i)};o.$getRoot().getChildren().forEach((e=>{o.$isElementNode(e)&&r.get(e.__key)&&n(e)}))}))})),r=f.registerMutationListener(t.HeadingNode,(t=>{f.getEditorState().read((()=>{for(const[n,r]of t)if("created"===r){const t=o.$getNodeByKey(n);if(null!==t){const n=d(t);e=s(n,t,e)}}else if("destroyed"===r)e=u(n,e);else if("updated"===r){const t=o.$getNodeByKey(n);if(null!==t){const n=d(t);e=c(n,t,e)}}g(e)}))}),{skipInitialization:!0}),i=f.registerMutationListener(o.TextNode,(n=>{f.getEditorState().read((()=>{for(const[r,i]of n)if("updated"===i){const n=o.$getNodeByKey(r);if(null!==n){const o=n.getParentOrThrow();t.$isHeadingNode(o)&&(e=l(o,e),g(e))}}}))}),{skipInitialization:!0});return()=>{r(),i(),n()}}),[f]),n(i,f)};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/rich-text"),n=require("@lexical/utils"),o=require("lexical"),r=require("react");function i(e){return[e.getKey(),e.getTextContent(),e.getTag()]}function s(e,t,n){if(null===t)return n;const o=i(t);let r=[];if(null===e){if(n.length>0&&n[0][0]===t.__key)return n;r=[o,...n]}else for(let i=0;i<n.length;i++){const s=n[i][0];if(r.push(n[i]),s===e.getKey()&&s!==t.getKey()){if(i+1<n.length&&n[i+1][0]===t.__key)return n;r.push(o)}}return r}function u(e,t){const n=[];for(const o of t)o[0]!==e&&n.push(o);return n}function l(e,t){const n=[];for(const o of t)o[0]===e.getKey()?n.push(i(e)):n.push(o);return n}function c(e,t,n){const o=[],r=i(t);e||o.push(r);for(const i of n)i[0]!==t.getKey()&&(o.push(i),e&&i[0]===e.getKey()&&o.push(r));return o}function d(e){let o=n.$getNextRightPreorderNode(e);for(;null!==o&&!t.$isHeadingNode(o);)o=n.$getNextRightPreorderNode(o);return o}exports.TableOfContentsPlugin=function({children:n}){const[i,g]=r.useState([]),[f]=e.useLexicalComposerContext();return r.useEffect(()=>{let e=[];f.getEditorState().read(()=>{const n=r=>{for(const i of r.getChildren())t.$isHeadingNode(i)?e.push([i.getKey(),i.getTextContent(),i.getTag()]):o.$isElementNode(i)&&n(i)};n(o.$getRoot()),g(e)});const n=f.registerUpdateListener(({editorState:n,dirtyElements:r})=>{n.read(()=>{const n=r=>{for(const i of r.getChildren())if(t.$isHeadingNode(i)){const t=d(i);e=c(t,i,e),g(e)}else o.$isElementNode(i)&&n(i)};o.$getRoot().getChildren().forEach(e=>{o.$isElementNode(e)&&r.get(e.__key)&&n(e)})})}),r=f.registerMutationListener(t.HeadingNode,t=>{f.getEditorState().read(()=>{for(const[n,r]of t)if("created"===r){const t=o.$getNodeByKey(n);if(null!==t){const n=d(t);e=s(n,t,e)}}else if("destroyed"===r)e=u(n,e);else if("updated"===r){const t=o.$getNodeByKey(n);if(null!==t){const n=d(t);e=c(n,t,e)}}g(e)})},{skipInitialization:!0}),i=f.registerMutationListener(o.TextNode,n=>{f.getEditorState().read(()=>{for(const[r,i]of n)if("updated"===i){const n=o.$getNodeByKey(r);if(null!==n){const o=n.getParentOrThrow();t.$isHeadingNode(o)&&(e=l(o,e),g(e))}}})},{skipInitialization:!0});return()=>{r(),i(),n()}},[f]),n(i,f)};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HeadingNode as e,$isHeadingNode as n}from"@lexical/rich-text";import{$getNextRightPreorderNode as r}from"@lexical/utils";import{$getRoot as o,$isElementNode as i,$getNodeByKey as s,TextNode as f}from"lexical";import{useState as c,useEffect as l}from"react";function u(t){return[t.getKey(),t.getTextContent(),t.getTag()]}function a(t,e,n){if(null===e)return n;const r=u(e);let o=[];if(null===t){if(n.length>0&&n[0][0]===e.__key)return n;o=[r,...n]}else for(let i=0;i<n.length;i++){const s=n[i][0];if(o.push(n[i]),s===t.getKey()&&s!==e.getKey()){if(i+1<n.length&&n[i+1][0]===e.__key)return n;o.push(r)}}return o}function g(t,e){const n=[];for(const r of e)r[0]!==t&&n.push(r);return n}function d(t,e){const n=[];for(const r of e)r[0]===t.getKey()?n.push(u(t)):n.push(r);return n}function p(t,e,n){const r=[],o=u(e);t||r.push(o);for(const i of n)i[0]!==e.getKey()&&(r.push(i),t&&i[0]===t.getKey()&&r.push(o));return r}function h(t){let e=r(t);for(;null!==e&&!n(e);)e=r(e);return e}function m({children:r}){const[u,m]=c([]),[y]=t();return l((()=>{let t=[];y.getEditorState().read((()=>{const e=r=>{for(const o of r.getChildren())n(o)?t.push([o.getKey(),o.getTextContent(),o.getTag()]):i(o)&&e(o)};e(o()),m(t)}));const r=y.registerUpdateListener((({editorState:e,dirtyElements:r})=>{e.read((()=>{const e=r=>{for(const o of r.getChildren())if(n(o)){const e=h(o);t=p(e,o,t),m(t)}else i(o)&&e(o)};o().getChildren().forEach((t=>{i(t)&&r.get(t.__key)&&e(t)}))}))})),c=y.registerMutationListener(e,(e=>{y.getEditorState().read((()=>{for(const[n,r]of e)if("created"===r){const e=s(n);if(null!==e){const n=h(e);t=a(n,e,t)}}else if("destroyed"===r)t=g(n,t);else if("updated"===r){const e=s(n);if(null!==e){const n=h(e);t=p(n,e,t)}}m(t)}))}),{skipInitialization:!0}),l=y.registerMutationListener(f,(e=>{y.getEditorState().read((()=>{for(const[r,o]of e)if("updated"===o){const e=s(r);if(null!==e){const r=e.getParentOrThrow();n(r)&&(t=d(r,t),m(t))}}}))}),{skipInitialization:!0});return()=>{c(),l(),r()}}),[y]),r(u,y)}export{m as TableOfContentsPlugin};
9
+ import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HeadingNode as e,$isHeadingNode as n}from"@lexical/rich-text";import{$getNextRightPreorderNode as r}from"@lexical/utils";import{$getRoot as o,$isElementNode as i,$getNodeByKey as s,TextNode as f}from"lexical";import{useState as c,useEffect as l}from"react";function u(t){return[t.getKey(),t.getTextContent(),t.getTag()]}function a(t,e,n){if(null===e)return n;const r=u(e);let o=[];if(null===t){if(n.length>0&&n[0][0]===e.__key)return n;o=[r,...n]}else for(let i=0;i<n.length;i++){const s=n[i][0];if(o.push(n[i]),s===t.getKey()&&s!==e.getKey()){if(i+1<n.length&&n[i+1][0]===e.__key)return n;o.push(r)}}return o}function g(t,e){const n=[];for(const r of e)r[0]!==t&&n.push(r);return n}function d(t,e){const n=[];for(const r of e)r[0]===t.getKey()?n.push(u(t)):n.push(r);return n}function p(t,e,n){const r=[],o=u(e);t||r.push(o);for(const i of n)i[0]!==e.getKey()&&(r.push(i),t&&i[0]===t.getKey()&&r.push(o));return r}function h(t){let e=r(t);for(;null!==e&&!n(e);)e=r(e);return e}function m({children:r}){const[u,m]=c([]),[y]=t();return l(()=>{let t=[];y.getEditorState().read(()=>{const e=r=>{for(const o of r.getChildren())n(o)?t.push([o.getKey(),o.getTextContent(),o.getTag()]):i(o)&&e(o)};e(o()),m(t)});const r=y.registerUpdateListener(({editorState:e,dirtyElements:r})=>{e.read(()=>{const e=r=>{for(const o of r.getChildren())if(n(o)){const e=h(o);t=p(e,o,t),m(t)}else i(o)&&e(o)};o().getChildren().forEach(t=>{i(t)&&r.get(t.__key)&&e(t)})})}),c=y.registerMutationListener(e,e=>{y.getEditorState().read(()=>{for(const[n,r]of e)if("created"===r){const e=s(n);if(null!==e){const n=h(e);t=a(n,e,t)}}else if("destroyed"===r)t=g(n,t);else if("updated"===r){const e=s(n);if(null!==e){const n=h(e);t=p(n,e,t)}}m(t)})},{skipInitialization:!0}),l=y.registerMutationListener(f,e=>{y.getEditorState().read(()=>{for(const[r,o]of e)if("updated"===o){const e=s(r);if(null!==e){const r=e.getParentOrThrow();n(r)&&(t=d(r,t),m(t))}}})},{skipInitialization:!0});return()=>{c(),l(),r()}},[y]),r(u,y)}export{m as TableOfContentsPlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/table"),l=require("react");exports.TablePlugin=function({hasCellMerge:t=!0,hasCellBackgroundColor:a=!0,hasTabHandler:o=!0,hasHorizontalScroll:s=!1}){const[c]=e.useLexicalComposerContext();return l.useEffect((()=>{r.$isScrollableTablesActive(c)!==s&&(r.setScrollableTablesActive(c,s),c.registerNodeTransform(r.TableNode,(()=>{}))())}),[c,s]),l.useEffect((()=>r.registerTablePlugin(c)),[c]),l.useEffect((()=>r.registerTableSelectionObserver(c,o)),[c,o]),l.useEffect((()=>{if(!t)return r.registerTableCellUnmergeTransform(c)}),[c,t]),l.useEffect((()=>{if(!a)return c.registerNodeTransform(r.TableCellNode,(e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)}))}),[c,a,t]),null};
9
+ "use strict";var e=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/table"),l=require("react");exports.TablePlugin=function({hasCellMerge:t=!0,hasCellBackgroundColor:a=!0,hasTabHandler:o=!0,hasHorizontalScroll:s=!1}){const[c]=e.useLexicalComposerContext();return l.useEffect(()=>{r.$isScrollableTablesActive(c)!==s&&(r.setScrollableTablesActive(c,s),c.registerNodeTransform(r.TableNode,()=>{})())},[c,s]),l.useEffect(()=>r.registerTablePlugin(c),[c]),l.useEffect(()=>r.registerTableSelectionObserver(c,o),[c,o]),l.useEffect(()=>{if(!t)return r.registerTableCellUnmergeTransform(c)},[c,t]),l.useEffect(()=>{if(!a)return c.registerNodeTransform(r.TableCellNode,e=>{null!==e.getBackgroundColor()&&e.setBackgroundColor(null)})},[c,a,t]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{$isScrollableTablesActive as o,setScrollableTablesActive as e,TableNode as l,registerTablePlugin as t,registerTableSelectionObserver as a,registerTableCellUnmergeTransform as n,TableCellNode as i}from"@lexical/table";import{useEffect as c}from"react";function s({hasCellMerge:s=!0,hasCellBackgroundColor:u=!0,hasTabHandler:m=!0,hasHorizontalScroll:f=!1}){const[g]=r();return c((()=>{o(g)!==f&&(e(g,f),g.registerNodeTransform(l,(()=>{}))())}),[g,f]),c((()=>t(g)),[g]),c((()=>a(g,m)),[g,m]),c((()=>{if(!s)return n(g)}),[g,s]),c((()=>{if(!u)return g.registerNodeTransform(i,(r=>{null!==r.getBackgroundColor()&&r.setBackgroundColor(null)}))}),[g,u,s]),null}export{s as TablePlugin};
9
+ import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{$isScrollableTablesActive as o,setScrollableTablesActive as e,TableNode as l,registerTablePlugin as t,registerTableSelectionObserver as a,registerTableCellUnmergeTransform as n,TableCellNode as i}from"@lexical/table";import{useEffect as c}from"react";function s({hasCellMerge:s=!0,hasCellBackgroundColor:u=!0,hasTabHandler:m=!0,hasHorizontalScroll:f=!1}){const[g]=r();return c(()=>{o(g)!==f&&(e(g,f),g.registerNodeTransform(l,()=>{})())},[g,f]),c(()=>t(g),[g]),c(()=>a(g,m),[g,m]),c(()=>{if(!s)return n(g)},[g,s]),c(()=>{if(!u)return g.registerNodeTransform(i,r=>{null!==r.getBackgroundColor()&&r.setBackgroundColor(null)})},[g,u,s]),null}export{s as TablePlugin};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/devtools-core"),t=require("@lexical/utils"),a=require("react"),r=require("react/jsx-runtime");function l(e){var t=Object.create(null);if(e)for(var a in e)t[a]=e[a];return t.default=e,t}var s=l(a);exports.TreeView=function({treeTypeButtonClassName:l,timeTravelButtonClassName:i,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:o,timeTravelPanelClassName:u,viewClassName:m,editor:c,customPrintNode:d}){const v=s.createRef(),[C,f]=a.useState(c.getEditorState()),N=e.useLexicalCommandsLog(c);return a.useEffect((()=>t.mergeRegister(c.registerUpdateListener((({editorState:e})=>{f(e)})),c.registerEditableListener((()=>{f(c.getEditorState())})))),[c]),a.useEffect((()=>{const e=v.current;if(null!==e)return e.__lexicalEditor=c,()=>{e.__lexicalEditor=null}}),[c,v]),r.jsx(e.TreeView,{treeTypeButtonClassName:l,timeTravelButtonClassName:i,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:o,viewClassName:m,timeTravelPanelClassName:u,setEditorReadOnly:e=>{const t=c.getRootElement();null!=t&&(t.contentEditable=e?"false":"true")},editorState:C,setEditorState:e=>c.setEditorState(e),generateContent:async function(t){return e.generateContent(c,N,t,d)},ref:v,commandsLog:N})};
9
+ "use strict";var e=require("@lexical/devtools-core"),t=require("@lexical/utils"),a=require("react"),r=require("react/jsx-runtime");function l(e){var t=Object.create(null);if(e)for(var a in e)t[a]=e[a];return t.default=e,t}var s=l(a);exports.TreeView=function({treeTypeButtonClassName:l,timeTravelButtonClassName:i,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:o,timeTravelPanelClassName:u,viewClassName:m,editor:c,customPrintNode:d}){const v=s.createRef(),[C,f]=a.useState(c.getEditorState()),N=e.useLexicalCommandsLog(c);return a.useEffect(()=>t.mergeRegister(c.registerUpdateListener(({editorState:e})=>{f(e)}),c.registerEditableListener(()=>{f(c.getEditorState())})),[c]),a.useEffect(()=>{const e=v.current;if(null!==e)return e.__lexicalEditor=c,()=>{e.__lexicalEditor=null}},[c,v]),r.jsx(e.TreeView,{treeTypeButtonClassName:l,timeTravelButtonClassName:i,timeTravelPanelSliderClassName:n,timeTravelPanelButtonClassName:o,viewClassName:m,timeTravelPanelClassName:u,setEditorReadOnly:e=>{const t=c.getRootElement();null!=t&&(t.contentEditable=e?"false":"true")},editorState:C,setEditorState:e=>c.setEditorState(e),generateContent:async function(t){return e.generateContent(c,N,t,d)},ref:v,commandsLog:N})};