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

@lexical/text

Package Overview
Dependencies
Maintainers
7
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/text - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

4

LexicalText.dev.js

@@ -98,2 +98,6 @@ /**

if (lexical.$isDecoratorNode(topBlock)) {
return false;
}
if (lexical.$isElementNode(topBlock)) {

@@ -100,0 +104,0 @@ if (!lexical.$isParagraphNode(topBlock)) {

12

LexicalText.prod.js

@@ -7,7 +7,7 @@ /**

*/
'use strict';var h=require("lexical");function r(c,g=!0){if(c)return!1;c=t();g&&(c=c.trim());return""===c}function t(){return h.$getRoot().getTextContent()}function u(c){if(!r(c,!1))return!1;c=h.$getRoot().getChildren();let g=c.length;if(1<g)return!1;for(let e=0;e<g;e++){var b=c[e];if(h.$isElementNode(b)){if(!h.$isParagraphNode(b)||0!==b.__indent)return!1;b=b.getChildren();let n=b.length;for(let p=0;p<n;p++)if(!h.$isTextNode(b[e]))return!1}}return!0}exports.$canShowPlaceholder=u;
exports.$canShowPlaceholderCurry=function(c){return()=>u(c)};exports.$findTextIntersectionFromCharacters=function(c,g){var b=c.getFirstChild();c=0;a:for(;null!==b;){if(h.$isElementNode(b)){var e=b.getFirstChild();if(null!==e){b=e;continue}}else if(h.$isTextNode(b)){e=b.getTextContentSize();if(c+e>g)return{node:b,offset:g-c};c+=e}e=b.getNextSibling();if(null!==e)b=e;else{for(b=b.getParent();null!==b;){e=b.getNextSibling();if(null!==e){b=e;continue a}b=b.getParent()}break}}return null};
exports.$isRootTextContentEmpty=r;exports.$isRootTextContentEmptyCurry=function(c,g){return()=>r(c,g)};exports.$rootTextContent=t;
exports.registerLexicalTextEntity=function(c,g,b,e){let n=a=>{const d=h.$createTextNode(a.getTextContent());d.setFormat(a.getFormat());a.replace(d)},p=c.registerNodeTransform(h.TextNode,a=>{if(a.isSimpleText()){var d=a.getPreviousSibling(),l=a.getTextContent(),m=a;if(h.$isTextNode(d)){var k=d.getTextContent(),f=g(k+l);if(d instanceof b){if(null===f||0!==d.getLatest().__mode){n(d);return}f=f.end-k.length;if(0<f){m=l.slice(0,f);m=k+m;d.select();d.setTextContent(m);f===l.length?a.remove():(d=l.slice(f),
a.setTextContent(d));return}}else if(null===f||f.start<k.length)return}for(;;){a=g(l);l=f=null===a?"":l.slice(a.end);if(""===f){if(k=m.getNextSibling(),h.$isTextNode(k))if(f=m.getTextContent()+k.getTextContent(),f=g(f),null===f){k instanceof b?n(k):k.markDirty();break}else if(0!==f.start)break}else if(k=g(f),null!==k&&0===k.start)break;if(null===a)break;if(0===a.start&&h.$isTextNode(d)&&d.isTextEntity())continue;let q;0===a.start?[q,m]=m.splitText(a.end):[,q,m]=m.splitText(a.start,a.end);a=e(q);q.replace(a);
if(null==m)break}}});c=c.registerNodeTransform(b,a=>{var d=a.getTextContent();const l=g(d);null===l||0!==l.start?n(a):d.length>l.end?a.splitText(l.end):(d=a.getPreviousSibling(),h.$isTextNode(d)&&d.isTextEntity()&&(n(d),n(a)),d=a.getNextSibling(),h.$isTextNode(d)&&d.isTextEntity()&&(n(d),a instanceof b&&n(a)))});return[p,c]}
'use strict';var g=require("lexical");function r(c,h=!0){if(c)return!1;c=t();h&&(c=c.trim());return""===c}function t(){return g.$getRoot().getTextContent()}function u(c){if(!r(c,!1))return!1;c=g.$getRoot().getChildren();let h=c.length;if(1<h)return!1;for(let e=0;e<h;e++){var a=c[e];if(g.$isDecoratorNode(a))return!1;if(g.$isElementNode(a)){if(!g.$isParagraphNode(a)||0!==a.__indent)return!1;a=a.getChildren();let n=a.length;for(let p=0;p<n;p++)if(!g.$isTextNode(a[e]))return!1}}return!0}
exports.$canShowPlaceholder=u;exports.$canShowPlaceholderCurry=function(c){return()=>u(c)};exports.$findTextIntersectionFromCharacters=function(c,h){var a=c.getFirstChild();c=0;a:for(;null!==a;){if(g.$isElementNode(a)){var e=a.getFirstChild();if(null!==e){a=e;continue}}else if(g.$isTextNode(a)){e=a.getTextContentSize();if(c+e>h)return{node:a,offset:h-c};c+=e}e=a.getNextSibling();if(null!==e)a=e;else{for(a=a.getParent();null!==a;){e=a.getNextSibling();if(null!==e){a=e;continue a}a=a.getParent()}break}}return null};
exports.$isRootTextContentEmpty=r;exports.$isRootTextContentEmptyCurry=function(c,h){return()=>r(c,h)};exports.$rootTextContent=t;
exports.registerLexicalTextEntity=function(c,h,a,e){let n=b=>{const d=g.$createTextNode(b.getTextContent());d.setFormat(b.getFormat());b.replace(d)},p=c.registerNodeTransform(g.TextNode,b=>{if(b.isSimpleText()){var d=b.getPreviousSibling(),l=b.getTextContent(),m=b;if(g.$isTextNode(d)){var k=d.getTextContent(),f=h(k+l);if(d instanceof a){if(null===f||0!==d.getLatest().__mode){n(d);return}f=f.end-k.length;if(0<f){m=l.slice(0,f);m=k+m;d.select();d.setTextContent(m);f===l.length?b.remove():(d=l.slice(f),
b.setTextContent(d));return}}else if(null===f||f.start<k.length)return}for(;;){b=h(l);l=f=null===b?"":l.slice(b.end);if(""===f){if(k=m.getNextSibling(),g.$isTextNode(k))if(f=m.getTextContent()+k.getTextContent(),f=h(f),null===f){k instanceof a?n(k):k.markDirty();break}else if(0!==f.start)break}else if(k=h(f),null!==k&&0===k.start)break;if(null===b)break;if(0===b.start&&g.$isTextNode(d)&&d.isTextEntity())continue;let q;0===b.start?[q,m]=m.splitText(b.end):[,q,m]=m.splitText(b.start,b.end);b=e(q);q.replace(b);
if(null==m)break}}});c=c.registerNodeTransform(a,b=>{var d=b.getTextContent();const l=h(d);null===l||0!==l.start?n(b):d.length>l.end?b.splitText(l.end):(d=b.getPreviousSibling(),g.$isTextNode(d)&&d.isTextEntity()&&(n(d),n(b)),d=b.getNextSibling(),g.$isTextNode(d)&&d.isTextEntity()&&(n(d),b instanceof a&&n(b)))});return[p,c]}

@@ -12,6 +12,6 @@ {

"license": "MIT",
"version": "0.9.0",
"version": "0.9.1",
"main": "LexicalText.js",
"peerDependencies": {
"lexical": "0.9.0"
"lexical": "0.9.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