@lexical/selection
Advanced tools
Comparing version 0.14.3 to 0.14.4
@@ -1,2 +0,1 @@ | ||
/** @module @lexical/selection */ | ||
/** | ||
@@ -3,0 +2,0 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. |
@@ -213,2 +213,6 @@ /** | ||
} | ||
function $updateParagraphNodeProperties(target, source) { | ||
target.__textFormat = source.__textFormat; | ||
return target; | ||
} | ||
@@ -233,2 +237,5 @@ /** | ||
} | ||
if (lexical.$isParagraphNode(node) && lexical.$isParagraphNode(clone)) { | ||
return $updateParagraphNodeProperties(clone, node); | ||
} | ||
return clone; | ||
@@ -235,0 +242,0 @@ } |
@@ -14,4 +14,4 @@ /** | ||
function G(a){if(k.$isDecoratorNode(a)||!k.$isElementNode(a)||k.$isRootOrShadowRoot(a))return!1;var b=a.getFirstChild();b=null===b||k.$isLineBreakNode(b)||k.$isTextNode(b)||b.isInline();return!a.isInline()&&!1!==a.canBeEmpty()&&b}exports.$addNodeStyle=function(a){a=a.getStyle();let b=y(a);v.set(a,b)}; | ||
exports.$cloneWithProperties=function(a){let b=a.constructor.clone(a);b.__parent=a.__parent;b.__next=a.__next;b.__prev=a.__prev;if(k.$isElementNode(a)&&k.$isElementNode(b))return b.__first=a.__first,b.__last=a.__last,b.__size=a.__size,b.__format=a.__format,b.__indent=a.__indent,b.__dir=a.__dir,b;k.$isTextNode(a)&&k.$isTextNode(b)&&(b.__format=a.__format,b.__style=a.__style,b.__mode=a.__mode,b.__detail=a.__detail);return b}; | ||
exports.$getSelectionStyleValueForProperty=function(a,b,c=""){let e=null,d=a.getNodes();var g=a.anchor,h=a.focus,f=a.isBackward();let l=f?h.offset:g.offset;g=f?h.getNode():g.getNode();if(a.isCollapsed()&&""!==a.style&&(a=z(a.style),null!==a&&b in a))return a[b];for(a=0;a<d.length;a++){var m=d[a];if((0===a||0!==l||!m.is(g))&&k.$isTextNode(m))if(h=b,f=c,m=m.getStyle(),m=z(m),h=null!==m?m[h]||f:f,null===e)e=h;else if(e!==h){e="";break}}return null===e?c:e}; | ||
exports.$cloneWithProperties=function(a){let b=a.constructor.clone(a);b.__parent=a.__parent;b.__next=a.__next;b.__prev=a.__prev;if(k.$isElementNode(a)&&k.$isElementNode(b))return b.__first=a.__first,b.__last=a.__last,b.__size=a.__size,b.__format=a.__format,b.__indent=a.__indent,b.__dir=a.__dir,b;if(k.$isTextNode(a)&&k.$isTextNode(b))return b.__format=a.__format,b.__style=a.__style,b.__mode=a.__mode,b.__detail=a.__detail,b;k.$isParagraphNode(a)&&k.$isParagraphNode(b)&&(b.__textFormat=a.__textFormat); | ||
return b};exports.$getSelectionStyleValueForProperty=function(a,b,c=""){let e=null,d=a.getNodes();var g=a.anchor,h=a.focus,f=a.isBackward();let l=f?h.offset:g.offset;g=f?h.getNode():g.getNode();if(a.isCollapsed()&&""!==a.style&&(a=z(a.style),null!==a&&b in a))return a[b];for(a=0;a<d.length;a++){var m=d[a];if((0===a||0!==l||!m.is(g))&&k.$isTextNode(m))if(h=b,f=c,m=m.getStyle(),m=z(m),h=null!==m?m[h]||f:f,null===e)e=h;else if(e!==h){e="";break}}return null===e?c:e}; | ||
exports.$isAtNodeEnd=function(a){if("text"===a.type)return a.offset===a.getNode().getTextContentSize();let b=a.getNode();if(!k.$isElementNode(b))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return a.offset===b.getChildrenSize()};exports.$isParentElementRTL=F;exports.$moveCaretSelection=E;exports.$moveCharacter=function(a,b,c){let e=F(a);E(a,b,c?!e:e,"character")}; | ||
@@ -18,0 +18,0 @@ exports.$patchStyleText=function(a,b){var c=a.getNodes(),e=c.length,d=a.getStartEndPoints();if(null!==d){var [g,h]=d;--e;d=c[0];var f=c[e];if(a.isCollapsed()&&k.$isRangeSelection(a))B(a,b);else{var l=d.getTextContent().length,m=h.offset,p=g.offset,q=g.isBefore(h),n=q?p:m;a=q?m:p;var r=q?g.type:h.type,t=q?h.type:g.type;q=q?h.key:g.key;if(k.$isTextNode(d)&&n===l){let u=d.getNextSibling();k.$isTextNode(u)&&(n=p=0,d=u)}if(1===c.length)k.$isTextNode(d)&&d.canHaveFormat()&&(n="element"===r?0:p>m?m:p,a= |
@@ -12,3 +12,3 @@ { | ||
"license": "MIT", | ||
"version": "0.14.3", | ||
"version": "0.14.4", | ||
"main": "LexicalSelection.js", | ||
@@ -27,2 +27,4 @@ "types": "index.d.ts", | ||
"types": "./index.d.ts", | ||
"development": "./LexicalSelection.dev.mjs", | ||
"production": "./LexicalSelection.prod.mjs", | ||
"node": "./LexicalSelection.node.mjs", | ||
@@ -33,2 +35,4 @@ "default": "./LexicalSelection.mjs" | ||
"types": "./index.d.ts", | ||
"development": "./LexicalSelection.dev.js", | ||
"production": "./LexicalSelection.prod.js", | ||
"default": "./LexicalSelection.js" | ||
@@ -39,4 +43,4 @@ } | ||
"dependencies": { | ||
"lexical": "0.14.3" | ||
"lexical": "0.14.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
112743
2245
+ Addedlexical@0.14.4(transitive)
- Removedlexical@0.14.3(transitive)
Updatedlexical@0.14.4