@lexical/react 0.2.0 → 0.2.1
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.
|
@@ -238,7 +238,7 @@ function clearEditorSkipCollab(editor, binding) {
|
|
|
238
238
|
*
|
|
239
239
|
*/
|
|
240
240
|
const entries = [['Cat', '255,165,0'], ['Dog', '0,200,55'], ['Rabbit', '160,0,200'], ['Frog', '0,172,200'], ['Fox', '197,200,0'], ['Hedgehog', '31,200,0'], ['Pigeon', '200,0,0'], ['Squirrel', '200,0,148'], ['Bear', '255,235,0'], ['Tiger', '86,255,0'], ['Leopard', '0,255,208'], ['Zebra', '0,243,255'], ['Wolf', '0,102,255'], ['Owl', '147,0,255'], ['Gull', '255,0,153'], ['Squid', '0,220,255']];
|
|
241
|
-
const randomEntry = entries[Math.floor(Math.random() *
|
|
241
|
+
const randomEntry = entries[Math.floor(Math.random() * entries.length)];
|
|
242
242
|
function CollaborationPlugin({
|
|
243
243
|
id,
|
|
244
244
|
providerFactory,
|
|
@@ -12,5 +12,5 @@ function K(b,c,a,d){g.useEffect(()=>m.mergeRegister(b.registerCommand(F.FOCUS_CO
|
|
|
12
12
|
function L(b,c){const a=g.useMemo(()=>x.createUndoManager(c,c.root.getSharedType()),[c]);g.useEffect(()=>m.mergeRegister(b.registerCommand(F.UNDO_COMMAND,()=>{a.undo();return!0},0),b.registerCommand(F.REDO_COMMAND,()=>{a.redo();return!0},0)));return g.useCallback(()=>{a.clear()},[a])}
|
|
13
13
|
function I(b){b.update(()=>{var c=F.$getRoot();if(null===c.getFirstChild()){const a=F.$createParagraphNode();c.append(a);c=document.activeElement;(null!==F.$getSelection()||null!==c&&c===b.getRootElement())&&a.select()}},{tag:"history-merge"})}
|
|
14
14
|
function J(b,c){b.update(()=>{const d=F.$getRoot();d.clear();d.select()},{tag:"skip-collab"});if(null!=c.cursors&&(b=c.cursorsContainer,null!=b)){c=Array.from(c.cursors.values());for(let d=0;d<c.length;d++){var a=c[d].selection;if(a&&null!=a.selections){a=a.selections;for(let k=0;k<a.length;k++)b.removeChild(a[d])}}}}
|
|
15
|
-
const M=[["Cat","255,165,0"],["Dog","0,200,55"],["Rabbit","160,0,200"],["Frog","0,172,200"],["Fox","197,200,0"],["Hedgehog","31,200,0"],["Pigeon","200,0,0"],["Squirrel","200,0,148"],["Bear","255,235,0"],["Tiger","86,255,0"],["Leopard","0,255,208"],["Zebra","0,243,255"],["Wolf","0,102,255"],["Owl","147,0,255"],["Gull","255,0,153"],["Squid","0,220,255"]],N=M[Math.floor(Math.random()*
|
|
15
|
+
const M=[["Cat","255,165,0"],["Dog","0,200,55"],["Rabbit","160,0,200"],["Frog","0,172,200"],["Fox","197,200,0"],["Hedgehog","31,200,0"],["Pigeon","200,0,0"],["Squirrel","200,0,148"],["Bear","255,235,0"],["Tiger","86,255,0"],["Leopard","0,255,208"],["Zebra","0,243,255"],["Wolf","0,102,255"],["Owl","147,0,255"],["Gull","255,0,153"],["Squid","0,220,255"]],N=M[Math.floor(Math.random()*M.length)],T=g.createContext({clientID:0,color:N[1],name:N[0],yjsDocMap:new Map});
|
|
16
16
|
function U(b){const c=g.useContext(T);null!=b&&(c.name=b);return c}exports.CollaborationContext=T;exports.CollaborationPlugin=function({id:b,providerFactory:c,shouldBootstrap:a,username:d}){d=U(d);const {yjsDocMap:k,name:p,color:q}=d,[n]=e.useLexicalComposerContext(),r=g.useMemo(()=>c(b,k),[b,c,k]),[v,f]=H(n,b,r,k,p,q,a);d.clientID=f.clientID;L(n,f);K(n,r,p,q);return v};exports.useCollaborationContext=U;
|
package/LexicalComposer.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ type Props = {
|
|
|
17
17
|
theme?: EditorThemeClasses;
|
|
18
18
|
onError: (error: Error, editor: LexicalEditor) => void;
|
|
19
19
|
};
|
|
20
|
-
children: JSX.Element | null;
|
|
20
|
+
children: JSX.Element | JSX.Element[] | null;
|
|
21
21
|
};
|
|
22
22
|
export default function LexicalComposer(arg0: Props): JSX.Element | null;
|
|
@@ -11,5 +11,5 @@ import type {LexicalEditor, EditorThemeClasses} from 'lexical';
|
|
|
11
11
|
export default function LexicalNestedComposer(arg0: {
|
|
12
12
|
initialEditor: LexicalEditor;
|
|
13
13
|
initialTheme?: EditorThemeClasses;
|
|
14
|
-
children: JSX.Element | null;
|
|
14
|
+
children: JSX.Element | JSX.Element[] | null;
|
|
15
15
|
}): JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
"rich-text"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.1",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@lexical/clipboard": "0.2.
|
|
14
|
-
"@lexical/list": "0.2.
|
|
15
|
-
"@lexical/table": "0.2.
|
|
16
|
-
"@lexical/yjs": "0.2.
|
|
17
|
-
"@lexical/hashtag": "0.2.
|
|
18
|
-
"@lexical/selection": "0.2.
|
|
19
|
-
"@lexical/utils": "0.2.
|
|
20
|
-
"@lexical/dragon": "0.2.
|
|
21
|
-
"@lexical/plain-text": "0.2.
|
|
22
|
-
"@lexical/rich-text": "0.2.
|
|
23
|
-
"@lexical/code": "0.2.
|
|
24
|
-
"@lexical/text": "0.2.
|
|
25
|
-
"@lexical/link": "0.2.
|
|
26
|
-
"@lexical/overflow": "0.2.
|
|
27
|
-
"@lexical/history": "0.2.
|
|
28
|
-
"@lexical/markdown": "0.2.
|
|
13
|
+
"@lexical/clipboard": "0.2.1",
|
|
14
|
+
"@lexical/list": "0.2.1",
|
|
15
|
+
"@lexical/table": "0.2.1",
|
|
16
|
+
"@lexical/yjs": "0.2.1",
|
|
17
|
+
"@lexical/hashtag": "0.2.1",
|
|
18
|
+
"@lexical/selection": "0.2.1",
|
|
19
|
+
"@lexical/utils": "0.2.1",
|
|
20
|
+
"@lexical/dragon": "0.2.1",
|
|
21
|
+
"@lexical/plain-text": "0.2.1",
|
|
22
|
+
"@lexical/rich-text": "0.2.1",
|
|
23
|
+
"@lexical/code": "0.2.1",
|
|
24
|
+
"@lexical/text": "0.2.1",
|
|
25
|
+
"@lexical/link": "0.2.1",
|
|
26
|
+
"@lexical/overflow": "0.2.1",
|
|
27
|
+
"@lexical/history": "0.2.1",
|
|
28
|
+
"@lexical/markdown": "0.2.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"lexical": "0.2.
|
|
31
|
+
"lexical": "0.2.1",
|
|
32
32
|
"react": ">=17.x",
|
|
33
33
|
"react-dom": ">=17.x"
|
|
34
34
|
},
|