@lexical/selection
Advanced tools
Comparing version 0.5.1-next.0 to 0.5.1-next.1
@@ -993,3 +993,3 @@ /** | ||
} else { | ||
if (lexical.$isTextNode(firstNode)) { | ||
if (lexical.$isTextNode(firstNode) && startOffset < firstNode.getTextContentSize()) { | ||
if (startOffset !== 0) { | ||
@@ -996,0 +996,0 @@ // the entire first node isn't selected, so split it |
@@ -20,4 +20,4 @@ /** | ||
exports.$isAtNodeEnd=function(a){return"text"===a.type?a.offset===a.getNode().getTextContentSize():a.offset===a.getNode().getChildrenSize()};exports.$isParentElementRTL=F;exports.$moveCaretSelection=E;exports.$moveCharacter=function(a,b,c){let g=F(a);E(a,b,c?!g:g,"character")}; | ||
exports.$patchStyleText=function(a,b){var c=a.getNodes();let g=c.length-1,d=c[0],e=c[g];if(!a.isCollapsed()){var h=a.anchor,f=a.focus;a=d.getTextContent().length;var k=f.offset,m=h.offset;h=(f=h.isBefore(f))?m:k;f=f?k:m;if(h===d.getTextContentSize()){let p=d.getNextSibling();l.$isTextNode(p)&&(h=m=0,d=p)}if(d.is(e))l.$isTextNode(d)&&(h=m>k?k:m,f=m>k?m:k,h!==f&&(0===h&&f===a?(H(d,b),d.select(h,f)):(c=d.splitText(h,f),c=0===h?c[0]:c[1],H(c,b),c.select(0,f-h))));else for(l.$isTextNode(d)&&(0!==h&&(d= | ||
d.splitText(h)[1]),H(d,b)),l.$isTextNode(e)&&(a=e.getTextContent().length,f!==a&&([e]=e.splitText(f)),0!==f&&H(e,b)),a=1;a<g;a++)k=c[a],m=k.getKey(),l.$isTextNode(k)&&m!==d.getKey()&&m!==e.getKey()&&!k.isToken()&&H(k,b)}}; | ||
exports.$patchStyleText=function(a,b){var c=a.getNodes();let g=c.length-1,d=c[0],e=c[g];if(!a.isCollapsed()){var h=a.anchor,f=a.focus;a=d.getTextContent().length;var k=f.offset,m=h.offset;h=(f=h.isBefore(f))?m:k;f=f?k:m;if(h===d.getTextContentSize()){let p=d.getNextSibling();l.$isTextNode(p)&&(h=m=0,d=p)}if(d.is(e))l.$isTextNode(d)&&(h=m>k?k:m,f=m>k?m:k,h!==f&&(0===h&&f===a?(H(d,b),d.select(h,f)):(c=d.splitText(h,f),c=0===h?c[0]:c[1],H(c,b),c.select(0,f-h))));else for(l.$isTextNode(d)&&h<d.getTextContentSize()&& | ||
(0!==h&&(d=d.splitText(h)[1]),H(d,b)),l.$isTextNode(e)&&(a=e.getTextContent().length,f!==a&&([e]=e.splitText(f)),0!==f&&H(e,b)),a=1;a<g;a++)k=c[a],m=k.getKey(),l.$isTextNode(k)&&m!==d.getKey()&&m!==e.getKey()&&!k.isToken()&&H(k,b)}}; | ||
exports.$selectAll=function(a){let b=a.anchor;a=a.focus;var c=b.getNode().getTopLevelElementOrThrow().getParentOrThrow();let g=c.getFirstDescendant();c=c.getLastDescendant();let d="element",e="element",h=0;l.$isTextNode(g)?d="text":l.$isElementNode(g)||null===g||(g=g.getParentOrThrow());l.$isTextNode(c)?(e="text",h=c.getTextContentSize()):l.$isElementNode(c)||null===c||(c=c.getParentOrThrow());g&&c&&(b.set(g.getKey(),0,d),a.set(c.getKey(),h,e))}; | ||
@@ -24,0 +24,0 @@ exports.$shouldOverrideDefaultCharacterSelection=function(a,b){a=l.$getDecoratorNode(a.focus,b);return l.$isDecoratorNode(a)&&!a.isIsolated()}; |
@@ -12,6 +12,6 @@ { | ||
"license": "MIT", | ||
"version": "0.5.1-next.0", | ||
"version": "0.5.1-next.1", | ||
"main": "LexicalSelection.js", | ||
"peerDependencies": { | ||
"lexical": "0.5.1-next.0" | ||
"lexical": "0.5.1-next.1" | ||
}, | ||
@@ -18,0 +18,0 @@ "repository": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
55765
0