@lexical/react 0.37.1-nightly.20251020.0 → 0.37.1-nightly.20251021.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.
@@ -42,7 +42,7 @@ function formatDevErrorMessage(message) {
42
42
  /** @internal */
43
43
  function useReactDecorators(editor, ErrorBoundary) {
44
44
  const [subscribe, getSnapshot] = react.useMemo(() => [cb => editor.registerDecoratorListener(cb), () => editor.getDecorators()], [editor]);
45
- const decorators = react.useSyncExternalStore(subscribe, getSnapshot);
45
+ const decorators = react.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
46
46
 
47
47
  // Return decorators defined as React Portals
48
48
  return react.useMemo(() => {
@@ -40,7 +40,7 @@ function formatDevErrorMessage(message) {
40
40
  /** @internal */
41
41
  function useReactDecorators(editor, ErrorBoundary) {
42
42
  const [subscribe, getSnapshot] = useMemo(() => [cb => editor.registerDecoratorListener(cb), () => editor.getDecorators()], [editor]);
43
- const decorators = useSyncExternalStore(subscribe, getSnapshot);
43
+ const decorators = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
44
44
 
45
45
  // Return decorators defined as React Portals
46
46
  return useMemo(() => {
@@ -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,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,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};
package/package.json CHANGED
@@ -8,26 +8,26 @@
8
8
  "rich-text"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.37.1-nightly.20251020.0",
11
+ "version": "0.37.1-nightly.20251021.0",
12
12
  "dependencies": {
13
13
  "@floating-ui/react": "^0.27.16",
14
- "@lexical/devtools-core": "0.37.1-nightly.20251020.0",
15
- "@lexical/dragon": "0.37.1-nightly.20251020.0",
16
- "@lexical/extension": "0.37.1-nightly.20251020.0",
17
- "@lexical/hashtag": "0.37.1-nightly.20251020.0",
18
- "@lexical/history": "0.37.1-nightly.20251020.0",
19
- "@lexical/link": "0.37.1-nightly.20251020.0",
20
- "@lexical/list": "0.37.1-nightly.20251020.0",
21
- "@lexical/mark": "0.37.1-nightly.20251020.0",
22
- "@lexical/markdown": "0.37.1-nightly.20251020.0",
23
- "@lexical/overflow": "0.37.1-nightly.20251020.0",
24
- "@lexical/plain-text": "0.37.1-nightly.20251020.0",
25
- "@lexical/rich-text": "0.37.1-nightly.20251020.0",
26
- "@lexical/table": "0.37.1-nightly.20251020.0",
27
- "@lexical/text": "0.37.1-nightly.20251020.0",
28
- "@lexical/utils": "0.37.1-nightly.20251020.0",
29
- "@lexical/yjs": "0.37.1-nightly.20251020.0",
30
- "lexical": "0.37.1-nightly.20251020.0",
14
+ "@lexical/devtools-core": "0.37.1-nightly.20251021.0",
15
+ "@lexical/dragon": "0.37.1-nightly.20251021.0",
16
+ "@lexical/extension": "0.37.1-nightly.20251021.0",
17
+ "@lexical/hashtag": "0.37.1-nightly.20251021.0",
18
+ "@lexical/history": "0.37.1-nightly.20251021.0",
19
+ "@lexical/link": "0.37.1-nightly.20251021.0",
20
+ "@lexical/list": "0.37.1-nightly.20251021.0",
21
+ "@lexical/mark": "0.37.1-nightly.20251021.0",
22
+ "@lexical/markdown": "0.37.1-nightly.20251021.0",
23
+ "@lexical/overflow": "0.37.1-nightly.20251021.0",
24
+ "@lexical/plain-text": "0.37.1-nightly.20251021.0",
25
+ "@lexical/rich-text": "0.37.1-nightly.20251021.0",
26
+ "@lexical/table": "0.37.1-nightly.20251021.0",
27
+ "@lexical/text": "0.37.1-nightly.20251021.0",
28
+ "@lexical/utils": "0.37.1-nightly.20251021.0",
29
+ "@lexical/yjs": "0.37.1-nightly.20251021.0",
30
+ "lexical": "0.37.1-nightly.20251021.0",
31
31
  "react-error-boundary": "^6.0.0"
32
32
  },
33
33
  "peerDependencies": {