@lexical/react 0.51.1-nightly.20260925.0 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{AutoLinkNode as e,registerAutoLink as r}from"@lexical/link";export{createLinkMatcherWithRegExp}from"@lexical/link";import{useLexicalComposerContext as n}from"@lexical/react/LexicalComposerContext";import{useEffect as o}from"react";function t({matchers:t,onChange:i,excludeParents:a}){const[c]=n();return function(n,t,i,a){o(()=>{n.hasNodes([e])||function(e,...r){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of r)o.append("v",e);throw n.search=o.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.`)}(77)}),o(()=>r(n,{changeHandlers:i?[i]:[],excludeParents:a??[],matchers:t}),[n,t,i,a])}(c,t,i,a),null}export{t as AutoLinkPlugin};
9
+ import{AutoLinkNode as e,registerAutoLink as r}from"@lexical/link";export{createLinkMatcherWithRegExp}from"@lexical/link";import{useLexicalComposerContext as n}from"@lexical/react/LexicalComposerContext";import{useEffect as o}from"react";function t({matchers:t,onChange:i,excludeParents:a}){const[c]=n();return function(n,t,i,a){o(()=>{n.hasNodes([e])||function(e,...r){throw function(e,...r){const n=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of r)o.append("v",e);return n.search=o.toString(),new 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.`)}(e,...r)}(77)}),o(()=>r(n,{changeHandlers:i?[i]:[],excludeParents:a??[],matchers:t}),[n,t,i,a])}(c,t,i,a),null}export{t as AutoLinkPlugin};
@@ -6,5 +6,5 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useEffect as t,useState as n,useMemo as r}from"react";import{OverflowNode as o,$isOverflowNode as i,$createOverflowNode as s}from"@lexical/overflow";import{$rootTextContent as l}from"@lexical/text";import{$dfsWithSlots as c,$unwrapNode as a}from"@lexical/utils";import{mergeRegister as f,DELETE_CHARACTER_COMMAND as g,$getSelection as m,$isRangeSelection as u,$isElementNode as d,COMMAND_PRIORITY_LOW as h,HISTORY_MERGE_TAG as p,$isLeafNode as x,$getSlotHost as C,$findMatchingParent as S,$isTextNode as v,$setSelection as w}from"lexical";import{jsx as T}from"react/jsx-runtime";function b(e){const t=s();return e.replace(t),t.append(e),t}function y(e){const t=e.getPreviousSibling();if(!i(t))return;const n=e.getFirstChild(),r=t.getChildren(),o=r.length;if(null===n)e.append(...r);else for(let e=0;e<o;e++)n.insertBefore(r[e]);const s=m();if(u(s)){const n=s.anchor,r=n.getNode(),i=s.focus,l=i.getNode();r.is(t)?n.set(e.getKey(),n.offset,"element"):r.is(e)&&n.set(e.getKey(),o+n.offset,"element"),l.is(t)?i.set(e.getKey(),i.offset,"element"):l.is(e)&&i.set(e.getKey(),o+i.offset,"element")}t.remove()}let N=null;function z({remainingCharacters:e}){
10
- return T("span",{className:"characters-limit "+(e<0?"characters-limit-exceeded":""),children:e})}function L({charset:s="UTF-16",maxLength:T=5,renderer:L=z}){const[P]=e(),[U,E]=n(T);return function(e,n,r=Object.freeze({})){const{strlen:s=e=>e.length,remainingCharacters:T=()=>{}}=r;t(()=>{e.hasNodes([o])||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.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.`)}(57)},[e]),t(()=>{let t=e.read("latest",l),r=null;function o(){const o=s(t),l=o>n||null!==r&&r>n;if(T(n-o),null===r||l){const r=function(e,t,n){let r=0,o=0;if("function"==typeof Intl.Segmenter){const i=(new Intl.Segmenter).segment(e);for(const{segment:e}of i){const i=o+n(e);if(i>t)break;o=i,r+=e.length}}else{const i=Array.from(e),s=i.length;for(let e=0;e<s;e++){const s=i[e],l=o+n(s);if(l>t)break;o=l,r+=s.length}}return r}(t,n,s);e.update(()=>{!function(e){const t=c(),n=t.length;let r=0;for(let o=0;o<n;o+=1){const{node:n}=t[o],s=n.getPreviousSibling();d(s)&&!s.isInline()&&(r+=2);const l=x(n)&&null!==C(n),c=x(n)&&!l&&!S(n,i);if(i(n)){const t=r;if(r+n.getTextContentSize()<=e){const e=n.getParent(),t=n.getPreviousSibling(),r=n.getNextSibling();a(n);const o=m();!u(o)||o.anchor.getNode().isAttached()&&o.focus.getNode().isAttached()||(v(t)?t.select():v(r)?r.select():null!==e&&e.select())}else if(t<e){const r=n.getFirstDescendant(),o=t+(null!==r?r.getTextContentSize():0);(v(r)&&r.isSimpleText()||o<=e)&&a(n)}}else if(l)r+=n.getTextContentSize();else if(c){const t=r;if(r+=n.getTextContentSize(),r>e&&!i(n.getParent())){const r=m();let o;if(t<e&&v(n)&&n.isSimpleText()){const[,r]=n.splitText(e-t);o=b(r)}else o=b(n);null!==r&&w(r),y(o);const s=o.getNextSibling();i(s)&&y(s)}}}}(r)},{tag:p})}r=o}return o(),f(e.registerTextContentListener(e=>{t=e}),e.registerUpdateListener(({dirtyLeaves:t,dirtyElements:n})=>{const r=e.isComposing(),i=t.size>0||n.size>0;!r&&i&&o()}),e.registerCommand(g,e=>{const t=m();if(!u(t))return!1;const n=t.anchor.getNode().getParent(),r=n?n.getParent():null,o=r?r.getNextSibling():null;return t.deleteCharacter(e),r&&r.isEmpty()?r.remove():d(o)&&o.isEmpty()&&o.remove(),!0},h))},[e,n,T,s])}(P,T,r(()=>({remainingCharacters:E,strlen:e=>{if("UTF-8"===s)return function(e){const t=void 0===window.TextEncoder?null:(null===N&&(N=new window.TextEncoder),N);if(null===t){const t=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(t?t.length:0)}return t.encode(e).length}(e);if("UTF-16"===s)return e.length;throw new Error("Unrecognized charset")}}),[s])),L({remainingCharacters:U})}export{L as CharacterLimitPlugin};
9
+ import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useEffect as t,useState as n,useMemo as r}from"react";import{OverflowNode as o,$isOverflowNode as i,$createOverflowNode as s}from"@lexical/overflow";import{$rootTextContent as l}from"@lexical/text";import{$dfsWithSlots as c,$unwrapNode as a}from"@lexical/utils";import{mergeRegister as f,DELETE_CHARACTER_COMMAND as g,$getSelection as u,$isRangeSelection as m,$isElementNode as d,COMMAND_PRIORITY_LOW as h,HISTORY_MERGE_TAG as p,$isLeafNode as x,$getSlotHost as C,$findMatchingParent as S,$isTextNode as v,$setSelection as w}from"lexical";import{jsx as T}from"react/jsx-runtime";function b(e,n,r=Object.freeze({})){const{strlen:s=e=>e.length,remainingCharacters:T=()=>{}}=r;t(()=>{e.hasNodes([o])||function(e,...t){throw function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);return n.search=r.toString(),new 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.`)}(e,...t)}(57)},[e]),t(()=>{let t=e.read("latest",l),r=null;function o(){const o=s(t),l=o>n||null!==r&&r>n;if(T(n-o),null===r||l){const r=function(e,t,n){let r=0,o=0;if("function"==typeof Intl.Segmenter){const i=(new Intl.Segmenter).segment(e);for(const{segment:e}of i){const i=o+n(e);if(i>t)break;o=i,r+=e.length}}else{const i=Array.from(e),s=i.length;for(let e=0;e<s;e++){const s=i[e],l=o+n(s);if(l>t)break;o=l,r+=s.length}}return r}(t,n,s);e.update(()=>{!function(e){const t=c(),n=t.length;let r=0;for(let o=0;o<n;o+=1){const{node:n}=t[o],s=n.getPreviousSibling();d(s)&&!s.isInline()&&(r+=2);const l=x(n)&&null!==C(n),c=x(n)&&!l&&!S(n,i);if(i(n)){const t=r;if(r+n.getTextContentSize()<=e){const e=n.getParent(),t=n.getPreviousSibling(),r=n.getNextSibling();a(n);const o=u();!m(o)||o.anchor.getNode().isAttached()&&o.focus.getNode().isAttached()||(v(t)?t.select():v(r)?r.select():null!==e&&e.select())}else if(t<e){const r=n.getFirstDescendant(),o=t+(null!==r?r.getTextContentSize():0);(v(r)&&r.isSimpleText()||o<=e)&&a(n)}}else if(l)r+=n.getTextContentSize();else if(c){const t=r;if(r+=n.getTextContentSize(),r>e&&!i(n.getParent())){const r=u();let o;if(t<e&&v(n)&&n.isSimpleText()){const[,r]=n.splitText(e-t);o=y(r)}else o=y(n);null!==r&&w(r),N(o);const s=o.getNextSibling();i(s)&&N(s)}}}}(r)},{tag:p})}r=o}return o(),f(e.registerTextContentListener(e=>{t=e}),e.registerUpdateListener(({dirtyLeaves:t,dirtyElements:n})=>{const r=e.isComposing(),i=t.size>0||n.size>0;!r&&i&&o()}),e.registerCommand(g,e=>{const t=u();if(!m(t))return!1;const n=t.anchor.getNode().getParent(),r=n?n.getParent():null,o=r?r.getNextSibling():null;return t.deleteCharacter(e),r&&r.isEmpty()?r.remove():d(o)&&o.isEmpty()&&o.remove(),!0},h))},[e,n,T,s])}function y(e){const t=s();return e.replace(t),t.append(e),t}function N(e){const t=e.getPreviousSibling();if(!i(t))return;const n=e.getFirstChild(),r=t.getChildren(),o=r.length;if(null===n)e.append(...r);else for(let e=0;e<o;e++)n.insertBefore(r[e]);const s=u();if(m(s)){const n=s.anchor,r=n.getNode(),i=s.focus,l=i.getNode();r.is(t)?n.set(e.getKey(),n.offset,"element"):r.is(e)&&n.set(e.getKey(),o+n.offset,"element"),l.is(t)?i.set(e.getKey(),i.offset,"element"):l.is(e)&&i.set(e.getKey(),o+i.offset,"element")}t.remove()}let z=null;function L({remainingCharacters:e}){
10
+ return T("span",{className:"characters-limit "+(e<0?"characters-limit-exceeded":""),children:e})}function P({charset:t="UTF-16",maxLength:o=5,renderer:i=L}){const[s]=e(),[l,c]=n(o);return b(s,o,r(()=>({remainingCharacters:c,strlen:e=>{if("UTF-8"===t)return function(e){const t=void 0===window.TextEncoder?null:(null===z&&(z=new window.TextEncoder),z);if(null===t){const t=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(t?t.length:0)}return t.encode(e).length}(e);if("UTF-16"===t)return e.length;throw new Error("Unrecognized charset")}}),[t])),i({remainingCharacters:l})}export{P as CharacterLimitPlugin};
@@ -8,4 +8,4 @@
8
8
 
9
9
  import{createContext as n,useContext as e}from"react";const r=
10
10
  /* @__PURE__ */
11
- n(null);function t(n,e){let r=null;return null!=n&&(r=n[1]),{getTheme:function(){return null!=e?e:null!=r?r.getTheme():null}}}function o(){const n=e(r);return null==n&&function(n,...e){const r=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",n);for(const n of e)t.append("v",n);throw r.search=t.toString(),Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),n}export{r as LexicalComposerContext,t as createLexicalComposerContext,o as useLexicalComposerContext};
11
+ n(null);function t(n,e){let r=null;return null!=n&&(r=n[1]),{getTheme:function(){return null!=e?e:null!=r?r.getTheme():null}}}function o(){const n=e(r);return null==n&&function(n,...e){throw function(n,...e){const r=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",n);for(const n of e)t.append("v",n);return r.search=t.toString(),new Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(n,...e)}(8),n}export{r as LexicalComposerContext,t as createLexicalComposerContext,o as useLexicalComposerContext};
@@ -8,4 +8,4 @@
8
8
 
9
9
  import{CollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{LexicalComposerContext as t,createLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{getTransformSetFromKlass as o,createSharedNodeState as n,getRegisteredNode as i}from"lexical";import{useRef as s,useContext as a,useMemo as l,useEffect as c}from"react";import{jsx as p}from"react/jsx-runtime";
10
10
  /*@__INLINE__*/
11
- function f(e){return()=>{}}const d=/* @__PURE__ */f(),m=/* @__PURE__ */f();function h({initialEditor:f,children:h,initialNodes:u,initialTheme:g,skipCollabChecks:x,skipEditableListener:_}){const v=s(!1),E=a(t);null==E&&function(e,...t){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of t)o.append("v",e);throw r.search=o.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[k,{getTheme:b}]=E,w=l(()=>{const e=g||b()||void 0,t=r(E,e);void 0!==e&&(f._config.theme=e),f._parentEditor=f._parentEditor||k;const s=f._createEditorArgs,a=s&&s.namespace;if(u){d(),a||(m(),f._config.namespace=k._config.namespace);for(let e of u){let t=null,r=null;if("function"!=typeof e){const o=e;e=o.replace,t=o.with,r=o.withKlass||null}const s=i(f,e.getType());f._nodes.set(e.getType(),{exportDOM:s?s.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,sharedNodeState:n(e),transforms:o(e)})}}else if(s&&s.nodes)a||(m(),f._config.namespace=k._config.namespace);else{const e=f._nodes=new Map(k._nodes);a||(f._config.namespace=k._config.namespace);for(const[t,r]of e)f._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:n(r.klass),transforms:o(r.klass)})}return[f,t]},[]),C=a(e),{isCollabActive:L,yjsDocMap:M}=C??{},y=x||v.current||M&&M.has(f.getKey());return c(()=>{y&&(v.current=!0)},[y]),c(()=>{if(!_){const e=e=>f.setEditable(e);return e(k.isEditable()),k.registerEditableListener(e)}},[f,k,_]),/*#__PURE__*/p(t.Provider,{value:w,children:!L||y?h:null})}export{h as LexicalNestedComposer};
11
+ function f(e){return()=>{}}const d=/* @__PURE__ */f(),m=/* @__PURE__ */f();function u({initialEditor:f,children:u,initialNodes:h,initialTheme:g,skipCollabChecks:x,skipEditableListener:_}){const v=s(!1),E=a(t);null==E&&function(e,...t){throw function(e,...t){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",e);for(const e of t)o.append("v",e);return r.search=o.toString(),new Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(9);const[k,{getTheme:w}]=E,b=l(()=>{const e=g||w()||void 0,t=r(E,e);void 0!==e&&(f._config.theme=e),f._parentEditor=f._parentEditor||k;const s=f._createEditorArgs,a=s&&s.namespace;if(h){d(),a||(m(),f._config.namespace=k._config.namespace);for(let e of h){let t=null,r=null;if("function"!=typeof e){const o=e;e=o.replace,t=o.with,r=o.withKlass||null}const s=i(f,e.getType());f._nodes.set(e.getType(),{exportDOM:s?s.exportDOM:void 0,klass:e,replace:t,replaceWithKlass:r,sharedNodeState:n(e),transforms:o(e)})}}else if(s&&s.nodes)a||(m(),f._config.namespace=k._config.namespace);else{const e=f._nodes=new Map(k._nodes);a||(f._config.namespace=k._config.namespace);for(const[t,r]of e)f._nodes.set(t,{exportDOM:r.exportDOM,klass:r.klass,replace:r.replace,replaceWithKlass:r.replaceWithKlass,sharedNodeState:n(r.klass),transforms:o(r.klass)})}return[f,t]},[]),C=a(e),{isCollabActive:L,yjsDocMap:M}=C??{},y=x||v.current||M&&M.has(f.getKey());return c(()=>{y&&(v.current=!0)},[y]),c(()=>{if(!_){const e=e=>f.setEditable(e);return e(k.isEditable()),k.registerEditableListener(e)}},[f,k,_]),/*#__PURE__*/p(t.Provider,{value:b,children:!L||y?u:null})}export{u as LexicalNestedComposer};
@@ -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/LexicalBuilder";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useMemo as n,useSyncExternalStore as i,Suspense as c,useLayoutEffect as l,useEffect as a,useState as s}from"react";import{createPortal as u}from"react-dom";import{jsx as f,jsxs as m,Fragment as d}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{CAN_USE_DOM as x,mergeRegister as E}from"lexical";import{registerDragonSupport as h}from"@lexical/dragon";import{registerPlainText as g}from"@lexical/plain-text";function y(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=n(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),l=i(t,o,o),a=function(r){const[e,t]=n(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return i(e,t,t)}(r);return n(()=>{const t=e=>r._onError(e),o=[];for(const n in l){const i=r.getElementByKey(n);if(null!==i){const r=/*#__PURE__*/f(e,{onError:t,children:/*#__PURE__*/f(c,{fallback:null,children:l[n]})});o.push(/*#__PURE__*/u(r,i,n))}}return o},[e,l,r,a])}(r,e)}function B({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:/*#__PURE__*/f(L,{editor:r,ErrorBoundary:e})}const b=x?l:a;function v(r){return r.read("latest",p(r.isComposing()))}function R({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){b(()=>E(g(r),h(r)),[r])}(n),/*#__PURE__*/m(d,{children:[e,/*#__PURE__*/f(w,{content:t}),/*#__PURE__*/f(B,{editor:n,ErrorBoundary:o})]})}function w({content:t}){const[o]=r(),n=function(r){const[e,t]=s(()=>v(r));return b(()=>{function e(){const e=v(r);t(e)}return e(),E(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{R 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/LexicalBuilder";import{ReactProviderExtension as n}from"@lexical/react/ReactProviderExtension";import{useMemo as o,useSyncExternalStore as i,Suspense as c,useLayoutEffect as l,useEffect as a,useState as s}from"react";import{createPortal as u}from"react-dom";import{jsx as f,jsxs as m,Fragment as d}from"react/jsx-runtime";import{$canShowPlaceholderCurry as p}from"@lexical/text";import{CAN_USE_DOM as x,mergeRegister as E}from"lexical";import{registerDragonSupport as h}from"@lexical/dragon";import{registerPlainText as g}from"@lexical/plain-text";function y(r,...e){throw function(r,...e){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",r);for(const r of e)n.append("v",r);return t.search=n.toString(),new 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.`)}(r,...e)}function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,n]=o(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),l=i(t,n,n),a=function(r){const[e,t]=o(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return i(e,t,t)}(r);return o(()=>{const t=e=>r._onError(e),n=[];for(const o in l){const i=r.getElementByKey(o);if(null!==i){const r=/*#__PURE__*/f(e,{onError:t,children:/*#__PURE__*/f(c,{fallback:null,children:l[o]})});n.push(/*#__PURE__*/u(r,i,o))}}return n},[e,l,r,a])}(r,e)}function B({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(n.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:/*#__PURE__*/f(L,{editor:r,ErrorBoundary:e})}const b=x?l:a;function v(r){return r.read("latest",p(r.isComposing()))}function w({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[o]=r();return function(r){b(()=>E(g(r),h(r)),[r])}(o),/*#__PURE__*/m(d,{children:[e,/*#__PURE__*/f(R,{content:t}),/*#__PURE__*/f(B,{editor:o,ErrorBoundary:n})]})}function R({content:t}){const[n]=r(),o=function(r){const[e,t]=s(()=>v(r));return b(()=>{function e(){const e=v(r);t(e)}return e(),E(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(n),i=e();return o?"function"==typeof t?t(i):t:null}export{w as PlainTextPlugin};
@@ -7,5 +7,5 @@
7
7
  */
8
8
 
9
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{shallowMergeConfig as t}from"lexical";import{LexicalComposerContext as n}from"@lexical/react/LexicalComposerContext";import{useMemo as i,useSyncExternalStore as c,Suspense as a}from"react";import{createPortal as l}from"react-dom";import{jsx as d,jsxs as s,Fragment as m}from"react/jsx-runtime";function f({contentEditable:r,children:e}){
10
- return s(m,{children:[r,e]})}const u={EditorChildrenComponent:f,ErrorBoundary:e,contentEditable:/*#__PURE__*/d(r,{}),decorators:[]},p={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 m=[r,{getTheme:()=>r._config.theme}],f=function(r,e){const[o]=e,t=r.decorators.map(r=>"function"==typeof r?/*#__PURE__*/d(r,{context:e}):r);return function(m){const{EditorChildrenComponent:f=r.EditorChildrenComponent,ErrorBoundary:u=r.ErrorBoundary,contentEditable:p=r.contentEditable,children:h}=m,E=function(r,e){const[o,t]=i(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),n=c(o,t,t),s=function(r){const[e,o]=i(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return c(e,o,o)}(r);return i(()=>{const o=e=>r._onError(e),t=[];for(const i in n){const c=r.getElementByKey(i);if(null!==c){const r=/*#__PURE__*/d(e,{onError:o,children:/*#__PURE__*/d(a,{fallback:null,children:n[i]})});t.push(/*#__PURE__*/l(r,c,i))}}return t},[e,n,r,s])}(o,u),x=i(()=>t.map((r,e)=>/*#__PURE__*/d(u,{onError:r=>{o._onError(r)},children:/*#__PURE__*/d(a,{fallback:null,children:r})},e)),[u]);
10
+ return s(m,{children:[r,e]})}const u={EditorChildrenComponent:f,ErrorBoundary:e,contentEditable:/*#__PURE__*/d(r,{}),decorators:[]},p={build(r,e,t){t.getPeer(o.name)||function(r,...e){throw 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);return o.search=t.toString(),new 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.`)}(r,...e)}(321,[...t.getDirectDependentNames()].join(" "));const m=[r,{getTheme:()=>r._config.theme}],f=function(r,e){const[o]=e,t=r.decorators.map(r=>"function"==typeof r?/*#__PURE__*/d(r,{context:e}):r);return function(m){const{EditorChildrenComponent:f=r.EditorChildrenComponent,ErrorBoundary:u=r.ErrorBoundary,contentEditable:p=r.contentEditable,children:h}=m,E=function(r,e){const[o,t]=i(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),n=c(o,t,t),s=function(r){const[e,o]=i(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return c(e,o,o)}(r);return i(()=>{const o=e=>r._onError(e),t=[];for(const i in n){const c=r.getElementByKey(i);if(null!==c){const r=/*#__PURE__*/d(e,{onError:o,children:/*#__PURE__*/d(a,{fallback:null,children:n[i]})});t.push(/*#__PURE__*/l(r,c,i))}}return t},[e,n,r,s])}(o,u),x=i(()=>t.map((r,e)=>/*#__PURE__*/d(u,{onError:r=>{o._onError(r)},children:/*#__PURE__*/d(a,{fallback:null,children:r})},e)),[u]);
11
11
  return d(n.Provider,{value:e,children:/*#__PURE__*/s(f,{context:e,contentEditable:p,children:[h,x,E]})})}}(e,m);return{Component:f,context:m}},config:u,mergeConfig(r,e){const o=t(r,e);return e.decorators&&(o.decorators=e.decorators.length>0?[...r.decorators,...e.decorators]:r.decorators),o},name:"@lexical/react/React",peerDependencies:[["@lexical/react/ReactProvider"]]};export{f as DefaultEditorChildrenComponent,p as ReactExtension};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{effect as e,untracked as n,signal as o}from"@lexical/extension/signals";import{getExtensionDependencyFromEditor as t}from"@lexical/extension/getExtensionDependencyFromEditor";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{ReactProviderExtension as i}from"@lexical/react/ReactProviderExtension";import{createCommand as l,mergeRegister as u,COMMAND_PRIORITY_CRITICAL as c,COMMAND_PRIORITY_EDITOR as a}from"lexical";import{useState as s,useEffect as m,Suspense as p}from"react";import{createPortal as d}from"react-dom";import{createRoot as f}from"react-dom/client";import{jsx as g,Fragment as x}from"react/jsx-runtime";function h(e,n){const{props:o,extension:r,...i}=n,{Component:l}=t(e,r).output;v(e,{...i,element:o?/*#__PURE__*/g(l,{...o}):null})}function P(e,n){const{Component:o,props:t,...r}=n;v(e,{...r,element:t?/*#__PURE__*/g(o,{...t}):null})}function v(e,n){t(e,_).output.mountReactPlugin(n)}function R(e,n){t(e,_).output.mountReactPluginHost(n)}const C=/* @__PURE__ */l("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),E=/* @__PURE__ */l("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND"),_={build:(e,n,t)=>({mountReactPlugin:n=>{e.dispatchCommand(E,n)},mountReactPluginHost:n=>e.dispatchCommand(C,{root:f(n)}),mountedPluginsStore:o({plugins:new Map})}),dependencies:[i,[r,{decorators:[function({context:[n]}){const{mountedPluginsStore:o}=t(n,_).output,{ErrorBoundary:i}=t(n,r).config,l=n._onError.bind(n),[{plugins:u},c]=s(()=>o.peek());m(()=>e(()=>c(o.value)),[o]);const a=[];for(const{key:e,element:n,domNode:o}of u.values()){if(!n)continue;const t=/*#__PURE__*/g(i,{onError:l,children:/*#__PURE__*/g(p,{fallback:null,children:n})},e);a.push(o?/*#__PURE__*/d(t,o,e):t)}return a.length>0?/*#__PURE__*/g(x,{children:a}):null}]}]],name:"@lexical/react/ReactPluginHost",register(e,o,t){let i;const{mountedPluginsStore:l}=t.getOutput(),{Component:s}=t.getDependency(r).output;return u(()=>{i&&i.unmount(),n(()=>{l.value.plugins.clear()})},e.registerCommand(E,e=>(n(()=>{const{plugins:n}=l.value;n.set(e.key,e),l.value={plugins:n}}),!1),c),e.registerCommand(C,e=>(void 0!==i&&function(e,...n){const o=new URL("https://lexical.dev/docs/error"),t=new URLSearchParams;t.append("code",e);for(const e of n)t.append("v",e);throw o.search=t.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.`)}(322),i=e.root,i.render(/*#__PURE__*/g(s,{contentEditable:null})),!0),a))}};export{E as REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND,C as REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND,_ as ReactPluginHostExtension,h as mountReactExtensionComponent,P as mountReactPluginComponent,v as mountReactPluginElement,R as mountReactPluginHost};
9
+ import{effect as e,untracked as n,signal as t}from"@lexical/extension/signals";import{getExtensionDependencyFromEditor as o}from"@lexical/extension/getExtensionDependencyFromEditor";import{ReactExtension as r}from"@lexical/react/ReactExtension";import{ReactProviderExtension as i}from"@lexical/react/ReactProviderExtension";import{createCommand as l,mergeRegister as u,COMMAND_PRIORITY_CRITICAL as c,COMMAND_PRIORITY_EDITOR as a}from"lexical";import{useState as s,useEffect as m,Suspense as p}from"react";import{createPortal as d}from"react-dom";import{createRoot as f}from"react-dom/client";import{jsx as g,Fragment as x}from"react/jsx-runtime";function h(e,n){const{props:t,extension:r,...i}=n,{Component:l}=o(e,r).output;v(e,{...i,element:t?/*#__PURE__*/g(l,{...t}):null})}function P(e,n){const{Component:t,props:o,...r}=n;v(e,{...r,element:o?/*#__PURE__*/g(t,{...o}):null})}function v(e,n){o(e,_).output.mountReactPlugin(n)}function R(e,n){o(e,_).output.mountReactPluginHost(n)}const C=/* @__PURE__ */l("REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND"),E=/* @__PURE__ */l("REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND"),_={build:(e,n,o)=>({mountReactPlugin:n=>{e.dispatchCommand(E,n)},mountReactPluginHost:n=>e.dispatchCommand(C,{root:f(n)}),mountedPluginsStore:t({plugins:new Map})}),dependencies:[i,[r,{decorators:[function({context:[n]}){const{mountedPluginsStore:t}=o(n,_).output,{ErrorBoundary:i}=o(n,r).config,l=n._onError.bind(n),[{plugins:u},c]=s(()=>t.peek());m(()=>e(()=>c(t.value)),[t]);const a=[];for(const{key:e,element:n,domNode:t}of u.values()){if(!n)continue;const o=/*#__PURE__*/g(i,{onError:l,children:/*#__PURE__*/g(p,{fallback:null,children:n})},e);a.push(t?/*#__PURE__*/d(o,t,e):o)}return a.length>0?/*#__PURE__*/g(x,{children:a}):null}]}]],name:"@lexical/react/ReactPluginHost",register(e,t,o){let i;const{mountedPluginsStore:l}=o.getOutput(),{Component:s}=o.getDependency(r).output;return u(()=>{i&&i.unmount(),n(()=>{l.value.plugins.clear()})},e.registerCommand(E,e=>(n(()=>{const{plugins:n}=l.value;n.set(e.key,e),l.value={plugins:n}}),!1),c),e.registerCommand(C,e=>(void 0!==i&&function(e,...n){throw 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);return t.search=o.toString(),new 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.`)}(e,...n)}(322),i=e.root,i.render(/*#__PURE__*/g(s,{contentEditable:null})),!0),a))}};export{E as REACT_PLUGIN_HOST_MOUNT_PLUGIN_COMMAND,C as REACT_PLUGIN_HOST_MOUNT_ROOT_COMMAND,_ as ReactPluginHostExtension,h as mountReactExtensionComponent,P as mountReactPluginComponent,v as mountReactPluginElement,R as mountReactPluginHost};
@@ -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/LexicalBuilder";import{ReactProviderExtension as o}from"@lexical/react/ReactProviderExtension";import{useMemo as n,useSyncExternalStore as i,Suspense as c,useLayoutEffect as l,useEffect as a,useState as s}from"react";import{createPortal as u}from"react-dom";import{jsx as f,jsxs as m,Fragment as d}from"react/jsx-runtime";import{$canShowPlaceholderCurry as x}from"@lexical/text";import{CAN_USE_DOM as p,mergeRegister as E}from"lexical";import{registerDragonSupport as h}from"@lexical/dragon";import{registerRichText as g}from"@lexical/rich-text";function y(r,...e){const t=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const r of e)o.append("v",r);throw t.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,o]=n(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),l=i(t,o,o),a=function(r){const[e,t]=n(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return i(e,t,t)}(r);return n(()=>{const t=e=>r._onError(e),o=[];for(const n in l){const i=r.getElementByKey(n);if(null!==i){const r=/*#__PURE__*/f(e,{onError:t,children:/*#__PURE__*/f(c,{fallback:null,children:l[n]})});o.push(/*#__PURE__*/u(r,i,n))}}return o},[e,l,r,a])}(r,e)}function B({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(o.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:/*#__PURE__*/f(L,{editor:r,ErrorBoundary:e})}const b=p?l:a;function v(r){return r.read("latest",x(r.isComposing()))}function R({contentEditable:e,placeholder:t=null,ErrorBoundary:o}){const[n]=r();return function(r){b(()=>E(g(r),h(r)),[r])}(n),/*#__PURE__*/m(d,{children:[e,/*#__PURE__*/f(w,{content:t}),/*#__PURE__*/f(B,{editor:n,ErrorBoundary:o})]})}function w({content:t}){const[o]=r(),n=function(r){const[e,t]=s(()=>v(r));return b(()=>{function e(){const e=v(r);t(e)}return e(),E(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(o),i=e();return n?"function"==typeof t?t(i):t:null}export{R 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/LexicalBuilder";import{ReactProviderExtension as n}from"@lexical/react/ReactProviderExtension";import{useMemo as o,useSyncExternalStore as i,Suspense as c,useLayoutEffect as l,useEffect as a,useState as s}from"react";import{createPortal as u}from"react-dom";import{jsx as f,jsxs as m,Fragment as d}from"react/jsx-runtime";import{$canShowPlaceholderCurry as x}from"@lexical/text";import{CAN_USE_DOM as p,mergeRegister as E}from"lexical";import{registerDragonSupport as h}from"@lexical/dragon";import{registerRichText as g}from"@lexical/rich-text";function y(r,...e){throw function(r,...e){const t=new URL("https://lexical.dev/docs/error"),n=new URLSearchParams;n.append("code",r);for(const r of e)n.append("v",r);return t.search=n.toString(),new 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.`)}(r,...e)}function L({editor:r,ErrorBoundary:e}){return function(r,e){const[t,n]=o(()=>[e=>r.registerDecoratorListener(e),()=>r.getDecorators()],[r]),l=i(t,n,n),a=function(r){const[e,t]=o(()=>[r.registerRootListener.bind(r),r.getRootElement.bind(r)],[r]);return i(e,t,t)}(r);return o(()=>{const t=e=>r._onError(e),n=[];for(const o in l){const i=r.getElementByKey(o);if(null!==i){const r=/*#__PURE__*/f(e,{onError:t,children:/*#__PURE__*/f(c,{fallback:null,children:l[o]})});n.push(/*#__PURE__*/u(r,i,o))}}return n},[e,l,r,a])}(r,e)}function B({editor:r,ErrorBoundary:e}){return function(r){const e=t.maybeFromEditor(r);if(e&&e.hasExtensionByName(n.name)){for(const r of["@lexical/plain-text","@lexical/rich-text"])e.hasExtensionByName(r)&&y(320,r);return!0}return!1}(r)?null:/*#__PURE__*/f(L,{editor:r,ErrorBoundary:e})}const b=p?l:a;function v(r){return r.read("latest",x(r.isComposing()))}function w({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[o]=r();return function(r){b(()=>E(g(r),h(r)),[r])}(o),/*#__PURE__*/m(d,{children:[e,/*#__PURE__*/f(R,{content:t}),/*#__PURE__*/f(B,{editor:o,ErrorBoundary:n})]})}function R({content:t}){const[n]=r(),o=function(r){const[e,t]=s(()=>v(r));return b(()=>{function e(){const e=v(r);t(e)}return e(),E(r.registerUpdateListener(()=>{e()}),r.registerEditableListener(()=>{e()}))},[r]),e}(n),i=e();return o?"function"==typeof t?t(i):t:null}export{w as RichTextPlugin};
package/package.json CHANGED
@@ -8,28 +8,28 @@
8
8
  "rich-text"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.51.1-nightly.20260925.0",
11
+ "version": "0.52.0",
12
12
  "dependencies": {
13
13
  "@floating-ui/react": "^0.27.19",
14
- "@lexical/a11y": "0.51.1-nightly.20260925.0",
15
- "@lexical/devtools-core": "0.51.1-nightly.20260925.0",
16
- "@lexical/dragon": "0.51.1-nightly.20260925.0",
17
- "@lexical/extension": "0.51.1-nightly.20260925.0",
18
- "@lexical/hashtag": "0.51.1-nightly.20260925.0",
19
- "@lexical/history": "0.51.1-nightly.20260925.0",
20
- "@lexical/internal": "0.51.1-nightly.20260925.0",
21
- "@lexical/link": "0.51.1-nightly.20260925.0",
22
- "@lexical/list": "0.51.1-nightly.20260925.0",
23
- "@lexical/mark": "0.51.1-nightly.20260925.0",
24
- "@lexical/markdown": "0.51.1-nightly.20260925.0",
25
- "@lexical/overflow": "0.51.1-nightly.20260925.0",
26
- "@lexical/plain-text": "0.51.1-nightly.20260925.0",
27
- "@lexical/rich-text": "0.51.1-nightly.20260925.0",
28
- "@lexical/table": "0.51.1-nightly.20260925.0",
29
- "@lexical/text": "0.51.1-nightly.20260925.0",
30
- "@lexical/utils": "0.51.1-nightly.20260925.0",
31
- "@lexical/yjs": "0.51.1-nightly.20260925.0",
32
- "lexical": "0.51.1-nightly.20260925.0"
14
+ "@lexical/a11y": "0.52.0",
15
+ "@lexical/devtools-core": "0.52.0",
16
+ "@lexical/dragon": "0.52.0",
17
+ "@lexical/extension": "0.52.0",
18
+ "@lexical/hashtag": "0.52.0",
19
+ "@lexical/history": "0.52.0",
20
+ "@lexical/internal": "0.52.0",
21
+ "@lexical/link": "0.52.0",
22
+ "@lexical/list": "0.52.0",
23
+ "@lexical/mark": "0.52.0",
24
+ "@lexical/markdown": "0.52.0",
25
+ "@lexical/overflow": "0.52.0",
26
+ "@lexical/plain-text": "0.52.0",
27
+ "@lexical/rich-text": "0.52.0",
28
+ "@lexical/table": "0.52.0",
29
+ "@lexical/text": "0.52.0",
30
+ "@lexical/utils": "0.52.0",
31
+ "@lexical/yjs": "0.52.0",
32
+ "lexical": "0.52.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=18.x",