@lexical/yjs
Advanced tools
Comparing version 0.5.0 to 0.5.1-next.0
@@ -1681,4 +1681,4 @@ /** | ||
/** @module @lexical/yjs */ | ||
const CONNECTED_COMMAND = lexical.createCommand(); | ||
const TOGGLE_CONNECT_COMMAND = lexical.createCommand(); | ||
const CONNECTED_COMMAND = lexical.createCommand('CONNECTED_COMMAND'); | ||
const TOGGLE_CONNECT_COMMAND = lexical.createCommand('TOGGLE_CONNECT_COMMAND'); | ||
function createUndoManager(binding, root) { | ||
@@ -1685,0 +1685,0 @@ return new yjs.UndoManager(root, { |
@@ -37,5 +37,5 @@ /** | ||
A&&null!=p&&(l=y.createDOMRange(t,A,u.offset,p,l.offset),null!==l)){p=m.length;l=y.createRectsFromDOMRange(t,l);t=l.length;for(u=0;u<t;u++)A=l[u],w=m[u],void 0===w&&(w=document.createElement("span"),m[u]=w,k.appendChild(w)),w.style.cssText=`position:absolute;top:${A.top-f.top}px;left:${A.left-f.left}px;height:${A.height}px;width:${A.width}px;background-color:rgba(${r}, 0.3);pointer-events:none;z-index:5;`,u===t-1&&n.parentNode!==w&&w.appendChild(n);for(f=p-1;f>=t;f--)k.removeChild(m[f]),m.pop()}}}}c= | ||
Array.from(b.keys());for(d=0;d<c.length;d++)e=c[d],g.has(e)||(h=b.get(e),void 0!==h&&(h=h.selection,null!==h&&V(a,h),b.delete(e)))}function ha(a,b,c,d){b=b.awareness;var e=b.getLocalState();if(null!==e){var {anchorPos:g,focusPos:h,name:f,color:k,focusing:m}=e,n=e=null;if(null!==d&&(null===g||d.is(c))||null!==c)q.$isRangeSelection(d)&&(e=T(d.anchor,a),n=T(d.focus,a)),(U(g,e)||U(h,n))&&b.setLocalState({anchorPos:e,color:k,focusPos:n,focusing:m,name:f})}}let ma=q.createCommand(),na=q.createCommand(); | ||
exports.CONNECTED_COMMAND=ma;exports.TOGGLE_CONNECT_COMMAND=na;exports.createBinding=function(a,b,c,d,e){void 0!==d&&null!==d||B(81);b=d.get("root",v.XmlText);b=L(b,null,"root");b._key="root";return{clientID:d.clientID,collabNodeMap:new Map,cursors:new Map,cursorsContainer:null,doc:d,docMap:e,editor:a,id:c,nodeProperties:new Map,root:b}};exports.createUndoManager=function(a,b){return new v.UndoManager(b,{trackedOrigins:new Set([a,null])})}; | ||
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=Y; | ||
Array.from(b.keys());for(d=0;d<c.length;d++)e=c[d],g.has(e)||(h=b.get(e),void 0!==h&&(h=h.selection,null!==h&&V(a,h),b.delete(e)))}function ha(a,b,c,d){b=b.awareness;var e=b.getLocalState();if(null!==e){var {anchorPos:g,focusPos:h,name:f,color:k,focusing:m}=e,n=e=null;if(null!==d&&(null===g||d.is(c))||null!==c)q.$isRangeSelection(d)&&(e=T(d.anchor,a),n=T(d.focus,a)),(U(g,e)||U(h,n))&&b.setLocalState({anchorPos:e,color:k,focusPos:n,focusing:m,name:f})}} | ||
let ma=q.createCommand("CONNECTED_COMMAND"),na=q.createCommand("TOGGLE_CONNECT_COMMAND");exports.CONNECTED_COMMAND=ma;exports.TOGGLE_CONNECT_COMMAND=na;exports.createBinding=function(a,b,c,d,e){void 0!==d&&null!==d||B(81);b=d.get("root",v.XmlText);b=L(b,null,"root");b._key="root";return{clientID:d.clientID,collabNodeMap:new Map,cursors:new Map,cursorsContainer:null,doc:d,docMap:e,editor:a,id:c,nodeProperties:new Map,root:b}}; | ||
exports.createUndoManager=function(a,b){return new v.UndoManager(b,{trackedOrigins:new Set([a,null])})};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=Y; | ||
exports.syncLexicalUpdateToYjs=function(a,b,c,d,e,g,h,f){fa(a,()=>{d.read(()=>{if(f.has("collaboration")){if(0<h.size){var k=Array.from(h),m=a.collabNodeMap,n=[];for(let l=0;l<k.length;l++){var r=k[l],t=q.$getNodeByKey(r),p=m.get(r);if(p instanceof E)if(q.$isTextNode(t))n.push([p,t.__text]);else{t=p.getOffset();if(-1===t)continue;let u=p._parent;p._normalized=!0;u._xmlText.delete(t,1);m.delete(r);r=u._children;p=r.indexOf(p);r.splice(p,1)}}for(k=0;k<n.length;k++){let [l,u]=n[k];l instanceof E&&"string"=== | ||
@@ -42,0 +42,0 @@ typeof u&&(l._text=u)}}}else e.has("root")&&(n=c._nodeMap,k=q.$getRoot(),m=a.root,m.syncPropertiesFromLexical(a,k,n),m.syncChildrenFromLexical(a,k,n,e,g)),n=q.$getSelection(),ha(a,b,c._selection,n)})})}; |
@@ -14,9 +14,9 @@ { | ||
"license": "MIT", | ||
"version": "0.5.0", | ||
"version": "0.5.1-next.0", | ||
"main": "LexicalYjs.js", | ||
"dependencies": { | ||
"@lexical/offset": "0.5.0" | ||
"@lexical/offset": "0.5.1-next.0" | ||
}, | ||
"peerDependencies": { | ||
"lexical": "0.5.0", | ||
"lexical": "0.5.1-next.0", | ||
"yjs": ">=13.5.22" | ||
@@ -23,0 +23,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93652
+ Added@lexical/offset@0.5.1-next.0(transitive)
+ Addedlexical@0.5.1-next.0(transitive)
- Removed@lexical/offset@0.5.0(transitive)
- Removedlexical@0.5.0(transitive)
Updated@lexical/offset@0.5.1-next.0