Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/yjs

Package Overview
Dependencies
Maintainers
6
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/yjs - npm Package Compare versions

Comparing version 0.3.5 to 0.3.6

5

LexicalYjs.dev.js

@@ -1632,3 +1632,6 @@ /**

const [collabNode, text] = mergedNodes[i];
collabNode._text = text;
if (collabNode instanceof CollabTextNode && typeof text === 'string') {
collabNode._text = text;
}
}

@@ -1635,0 +1638,0 @@ }

4

LexicalYjs.prod.js

@@ -42,6 +42,6 @@ /**

exports.initLocalState=function(a,b,c,d){a.awareness.setLocalState({anchorPos:null,color:c,focusPos:null,focusing:d,name:b})};exports.setLocalStateFocus=function(a,b,c,d){({awareness:a}=a);let e=a.getLocalState();null===e&&(e={anchorPos:null,color:c,focusPos:null,focusing:d,name:b});e.focusing=d;a.setLocalState(e)};exports.syncCursorPositions=X;
exports.syncLexicalUpdateToYjs=function(a,b,c,d,e,f,h,g){ea(a,()=>{d.read(()=>{if(g.has("collaboration")){if(0<h.size){var k=Array.from(h),l=a.collabNodeMap,n=[];for(let p=0;p<k.length;p++){var q=k[p],t=r.$getNodeByKey(q),m=l.get(q);if(m instanceof D)if(r.$isTextNode(t))n.push([m,t.__text]);else{t=m.getOffset();if(-1===t)continue;let u=m._parent;m._normalized=!0;u._xmlText.delete(t,1);l.delete(q);q=u._children;m=q.indexOf(m);q.splice(m,1)}}for(k=0;k<n.length;k++){let [p,u]=n[k];p._text=u}}}else e.has("root")&&
(n=c._nodeMap,k=r.$getRoot(),l=a.root,l.syncPropertiesFromLexical(a,k,n),l.syncChildrenFromLexical(a,k,n,e,f)),n=r.$getSelection(),fa(a,b,c._selection,n)})})};
exports.syncLexicalUpdateToYjs=function(a,b,c,d,e,f,h,g){ea(a,()=>{d.read(()=>{if(g.has("collaboration")){if(0<h.size){var k=Array.from(h),l=a.collabNodeMap,n=[];for(let p=0;p<k.length;p++){var q=k[p],t=r.$getNodeByKey(q),m=l.get(q);if(m instanceof D)if(r.$isTextNode(t))n.push([m,t.__text]);else{t=m.getOffset();if(-1===t)continue;let u=m._parent;m._normalized=!0;u._xmlText.delete(t,1);l.delete(q);q=u._children;m=q.indexOf(m);q.splice(m,1)}}for(k=0;k<n.length;k++){let [p,u]=n[k];p instanceof D&&"string"===
typeof u&&(p._text=u)}}}else e.has("root")&&(n=c._nodeMap,k=r.$getRoot(),l=a.root,l.syncPropertiesFromLexical(a,k,n),l.syncChildrenFromLexical(a,k,n,e,f)),n=r.$getSelection(),fa(a,b,c._selection,n)})})};
exports.syncYjsChangesToLexical=function(a,b,c){let d=a.editor,e=d._editorState;d.update(()=>{var f=d._pendingEditorState;for(var h=0;h<c.length;h++){var g=a,k=c[h],{target:l}=k;l=M(g,l);if(l instanceof N&&k instanceof v.YTextEvent){let {keysChanged:n,childListChanged:q,delta:t}=k;0<n.size&&l.syncPropertiesFromYjs(g,n);q&&(l.applyChildrenYjsDelta(g,t),l.syncChildrenFromYjs(g))}else if(l instanceof D&&k instanceof v.YMapEvent)({keysChanged:k}=k),0<k.size&&l.syncPropertiesAndTextFromYjs(g,k);else if(l instanceof
Q&&k instanceof v.YXmlEvent)({attributesChanged:k}=k),0<k.size&&l.syncPropertiesFromYjs(g,k);else throw Error("Should never happen");}h=r.$getSelection();if(r.$isRangeSelection(h))if(P(h)){g=e._selection;if(r.$isRangeSelection(g)){l=A.$createOffsetView(d,0,e);f=A.$createOffsetView(d,0,f);let [n,q]=l.getOffsetsFromSelection(g);f=f.createSelectionFromOffsets(n,q,l);null!==f?r.$setSelection(f):(V(a,b),P(h)&&(f=r.$getRoot(),0===f.getChildrenSize()&&f.append(r.$createParagraphNode()),r.$getRoot().selectEnd()))}fa(a,
b,g,r.$getSelection())}else V(a,b)},{onUpdate:()=>{X(a,b)},skipTransforms:!0,tag:"collaboration"})}

@@ -14,9 +14,9 @@ {

"license": "MIT",
"version": "0.3.5",
"version": "0.3.6",
"main": "LexicalYjs.js",
"dependencies": {
"@lexical/offset": "0.3.5"
"@lexical/offset": "0.3.6"
},
"peerDependencies": {
"lexical": "0.3.5",
"lexical": "0.3.6",
"yjs": ">=13.5.22"

@@ -23,0 +23,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc