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

@lexical/selection

Package Overview
Dependencies
Maintainers
6
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/selection - npm Package Compare versions

Comparing version 0.5.1-next.0 to 0.5.1-next.1

2

LexicalSelection.dev.js

@@ -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": {

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