@lexical/react 0.34.1-nightly.20250813.0 → 0.34.1-nightly.20250815.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.
|
@@ -50,8 +50,21 @@ function warnOnlyOnce(message) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function getTransformSetFromKlass(klass) {
|
|
53
|
+
const transforms = new Set();
|
|
54
|
+
const {
|
|
55
|
+
ownNodeConfig
|
|
56
|
+
} = lexical.getStaticNodeConfig(klass);
|
|
53
57
|
const transform = klass.transform();
|
|
54
|
-
|
|
58
|
+
if (ownNodeConfig) {
|
|
59
|
+
const $transform = ownNodeConfig.$transform;
|
|
60
|
+
if ($transform) {
|
|
61
|
+
transforms.add($transform);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (transform) {
|
|
65
|
+
transforms.add(transform);
|
|
66
|
+
}
|
|
67
|
+
return transforms;
|
|
55
68
|
}
|
|
56
69
|
const initialNodesWarning = warnOnlyOnce(`LexicalNestedComposer initialNodes is deprecated and will be removed in v0.32.0, it has never worked correctly.\nYou can configure your editor's nodes with createEditor({nodes: [], parentEditor: $getEditor()})`);
|
|
57
70
|
const explicitNamespaceWarning = warnOnlyOnce(`LexicalNestedComposer initialEditor should explicitly initialize its namespace when the node configuration differs from the parentEditor. For backwards compatibility, the namespace will be initialized from parentEditor until v0.32.0, but this has always had incorrect copy/paste behavior when the configuration differed.\nYou can configure your editor's namespace with createEditor({namespace: 'nested-editor-namespace', nodes: [], parentEditor: $getEditor()}).`);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';
|
|
10
10
|
import { LexicalComposerContext, createLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
11
|
-
import { createSharedNodeState, getRegisteredNode } from 'lexical';
|
|
11
|
+
import { createSharedNodeState, getRegisteredNode, getStaticNodeConfig } from 'lexical';
|
|
12
12
|
import { useRef, useContext, useMemo, useEffect } from 'react';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
@@ -48,8 +48,21 @@ function warnOnlyOnce(message) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function getTransformSetFromKlass(klass) {
|
|
51
|
+
const transforms = new Set();
|
|
52
|
+
const {
|
|
53
|
+
ownNodeConfig
|
|
54
|
+
} = getStaticNodeConfig(klass);
|
|
51
55
|
const transform = klass.transform();
|
|
52
|
-
|
|
56
|
+
if (ownNodeConfig) {
|
|
57
|
+
const $transform = ownNodeConfig.$transform;
|
|
58
|
+
if ($transform) {
|
|
59
|
+
transforms.add($transform);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (transform) {
|
|
63
|
+
transforms.add(transform);
|
|
64
|
+
}
|
|
65
|
+
return transforms;
|
|
53
66
|
}
|
|
54
67
|
const initialNodesWarning = warnOnlyOnce(`LexicalNestedComposer initialNodes is deprecated and will be removed in v0.32.0, it has never worked correctly.\nYou can configure your editor's nodes with createEditor({nodes: [], parentEditor: $getEditor()})`);
|
|
55
68
|
const explicitNamespaceWarning = warnOnlyOnce(`LexicalNestedComposer initialEditor should explicitly initialize its namespace when the node configuration differs from the parentEditor. For backwards compatibility, the namespace will be initialized from parentEditor until v0.32.0, but this has always had incorrect copy/paste behavior when the configuration differed.\nYou can configure your editor's namespace with createEditor({namespace: 'nested-editor-namespace', nodes: [], parentEditor: $getEditor()}).`);
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
"use strict";var e=require("@lexical/react/LexicalCollaborationContext"),t=require("@lexical/react/LexicalComposerContext"),
|
|
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 m=r.useRef(!1),x=r.useContext(t.LexicalComposerContext);null==x&&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}]=x,C=r.useMemo((()=>{const e=f||g()||void 0,r=t.createLexicalComposerContext(x,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]}),[]),{isCollabActive:_,yjsDocMap:v}=e.useCollaborationContext(),E=p||m.current||v.has(c.getKey());return r.useEffect((()=>{E&&(m.current=!0)}),[E]),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:!_||E?l:null})};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import{useCollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{LexicalComposerContext as t,createLexicalComposerContext as
|
|
9
|
+
import{useCollaborationContext 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]}),[]),{isCollabActive:b,yjsDocMap:L}=e(),M=x||v.current||L.has(i.getKey());return c((()=>{M&&(v.current=!0)}),[M]),c((()=>{if(!_){const e=e=>i.setEditable(e);return e(E.isEditable()),E.registerEditableListener(e)}}),[i,E,_]),d(t.Provider,{value:C,children:!b||M?h:null})}export{h as LexicalNestedComposer};
|
package/package.json
CHANGED
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.34.1-nightly.
|
|
11
|
+
"version": "0.34.1-nightly.20250815.0",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@floating-ui/react": "^0.27.8",
|
|
14
|
-
"@lexical/devtools-core": "0.34.1-nightly.
|
|
15
|
-
"@lexical/dragon": "0.34.1-nightly.
|
|
16
|
-
"@lexical/hashtag": "0.34.1-nightly.
|
|
17
|
-
"@lexical/history": "0.34.1-nightly.
|
|
18
|
-
"@lexical/link": "0.34.1-nightly.
|
|
19
|
-
"@lexical/list": "0.34.1-nightly.
|
|
20
|
-
"@lexical/mark": "0.34.1-nightly.
|
|
21
|
-
"@lexical/markdown": "0.34.1-nightly.
|
|
22
|
-
"@lexical/overflow": "0.34.1-nightly.
|
|
23
|
-
"@lexical/plain-text": "0.34.1-nightly.
|
|
24
|
-
"@lexical/rich-text": "0.34.1-nightly.
|
|
25
|
-
"@lexical/table": "0.34.1-nightly.
|
|
26
|
-
"@lexical/text": "0.34.1-nightly.
|
|
27
|
-
"@lexical/utils": "0.34.1-nightly.
|
|
28
|
-
"@lexical/yjs": "0.34.1-nightly.
|
|
29
|
-
"lexical": "0.34.1-nightly.
|
|
14
|
+
"@lexical/devtools-core": "0.34.1-nightly.20250815.0",
|
|
15
|
+
"@lexical/dragon": "0.34.1-nightly.20250815.0",
|
|
16
|
+
"@lexical/hashtag": "0.34.1-nightly.20250815.0",
|
|
17
|
+
"@lexical/history": "0.34.1-nightly.20250815.0",
|
|
18
|
+
"@lexical/link": "0.34.1-nightly.20250815.0",
|
|
19
|
+
"@lexical/list": "0.34.1-nightly.20250815.0",
|
|
20
|
+
"@lexical/mark": "0.34.1-nightly.20250815.0",
|
|
21
|
+
"@lexical/markdown": "0.34.1-nightly.20250815.0",
|
|
22
|
+
"@lexical/overflow": "0.34.1-nightly.20250815.0",
|
|
23
|
+
"@lexical/plain-text": "0.34.1-nightly.20250815.0",
|
|
24
|
+
"@lexical/rich-text": "0.34.1-nightly.20250815.0",
|
|
25
|
+
"@lexical/table": "0.34.1-nightly.20250815.0",
|
|
26
|
+
"@lexical/text": "0.34.1-nightly.20250815.0",
|
|
27
|
+
"@lexical/utils": "0.34.1-nightly.20250815.0",
|
|
28
|
+
"@lexical/yjs": "0.34.1-nightly.20250815.0",
|
|
29
|
+
"lexical": "0.34.1-nightly.20250815.0",
|
|
30
30
|
"react-error-boundary": "^3.1.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|