Socket
Book a DemoInstallSign in
Socket

@lexical/rich-text

Package Overview
Dependencies
Maintainers
5
Versions
417
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/rich-text - npm Package Compare versions

Comparing version

to
0.16.2-nightly.20240725.0

4

LexicalRichText.dev.js

@@ -301,3 +301,5 @@ /**

const anchorOffet = selection ? selection.anchor.offset : 0;
const newElement = anchorOffet === this.getTextContentSize() || !selection ? lexical.$createParagraphNode() : $createHeadingNode(this.getTag());
const lastDesc = this.getLastDescendant();
const isAtEnd = !lastDesc || selection && selection.anchor.key === lastDesc.getKey() && anchorOffet === lastDesc.getTextContentSize();
const newElement = isAtEnd || !selection ? lexical.$createParagraphNode() : $createHeadingNode(this.getTag());
const direction = this.getDirection();

@@ -304,0 +306,0 @@ newElement.setDirection(direction);

@@ -16,5 +16,6 @@ /**

priority:0}),h6:()=>({conversion:D,priority:0}),p:b=>{b=b.firstChild;return null!==b&&E(b)?{conversion:()=>({node:null}),priority:3}:null},span:b=>E(b)?{conversion:()=>({node:F("h1")}),priority:3}:null}}exportDOM(b){({element:b}=super.exportDOM(b));if(b&&h.isHTMLElement(b)){this.isEmpty()&&b.append(document.createElement("br"));var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir=a}return{element:b}}static importJSON(b){let a=F(b.tag);a.setFormat(b.format);a.setIndent(b.indent);
a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(b,a=!0){let d=b?b.anchor.offset:0,e=d!==this.getTextContentSize()&&b?F(this.getTag()):k.$createParagraphNode(),f=this.getDirection();e.setDirection(f);this.insertAfter(e,a);0===d&&!this.isEmpty()&&b&&(b=k.$createParagraphNode(),b.select(),this.replace(b,!0));return e}collapseAtStart(){let b=this.isEmpty()?k.$createParagraphNode():F(this.getTag());this.getChildren().forEach(a=>
b.append(a));this.replace(b);return!0}extractWithChild(){return!0}}function E(b){return"span"===b.nodeName.toLowerCase()?"26pt"===b.style.fontSize:!1}function D(b){let a=b.nodeName.toLowerCase(),d=null;if("h1"===a||"h2"===a||"h3"===a||"h4"===a||"h5"===a||"h6"===a)d=F(a),null!==b.style&&d.setFormat(b.style.textAlign);return{node:d}}function z(b){let a=A();null!==b.style&&a.setFormat(b.style.textAlign);return{node:a}}function F(b){return k.$applyNodeReplacement(new C(b))}
function G(b,a){b.preventDefault();a.update(()=>{let d=k.$getSelection(),e=h.objectKlassEquals(b,InputEvent)||h.objectKlassEquals(b,KeyboardEvent)?null:b.clipboardData;null!=e&&null!==d&&c.$insertDataTransferForRichText(e,d,a)},{tag:"paste"})}async function H(b,a){await c.copyToClipboard(a,h.objectKlassEquals(b,ClipboardEvent)?b:null);a.update(()=>{let d=k.$getSelection();k.$isRangeSelection(d)?d.removeText():k.$isNodeSelection(d)&&d.getNodes().forEach(e=>e.remove())})}
a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(b,a=!0){let d=b?b.anchor.offset:0;var e=this.getLastDescendant();e=!e||b&&b.anchor.key===e.getKey()&&d===e.getTextContentSize()||!b?k.$createParagraphNode():F(this.getTag());let f=this.getDirection();e.setDirection(f);this.insertAfter(e,a);0===d&&!this.isEmpty()&&b&&(b=k.$createParagraphNode(),b.select(),this.replace(b,!0));return e}collapseAtStart(){let b=this.isEmpty()?
k.$createParagraphNode():F(this.getTag());this.getChildren().forEach(a=>b.append(a));this.replace(b);return!0}extractWithChild(){return!0}}function E(b){return"span"===b.nodeName.toLowerCase()?"26pt"===b.style.fontSize:!1}function D(b){let a=b.nodeName.toLowerCase(),d=null;if("h1"===a||"h2"===a||"h3"===a||"h4"===a||"h5"===a||"h6"===a)d=F(a),null!==b.style&&d.setFormat(b.style.textAlign);return{node:d}}function z(b){let a=A();null!==b.style&&a.setFormat(b.style.textAlign);return{node:a}}
function F(b){return k.$applyNodeReplacement(new C(b))}function G(b,a){b.preventDefault();a.update(()=>{let d=k.$getSelection(),e=h.objectKlassEquals(b,InputEvent)||h.objectKlassEquals(b,KeyboardEvent)?null:b.clipboardData;null!=e&&null!==d&&c.$insertDataTransferForRichText(e,d,a)},{tag:"paste"})}
async function H(b,a){await c.copyToClipboard(a,h.objectKlassEquals(b,ClipboardEvent)?b:null);a.update(()=>{let d=k.$getSelection();k.$isRangeSelection(d)?d.removeText():k.$isNodeSelection(d)&&d.getNodes().forEach(e=>e.remove())})}
function I(b){let a=null;h.objectKlassEquals(b,DragEvent)?a=b.dataTransfer:h.objectKlassEquals(b,ClipboardEvent)&&(a=b.clipboardData);if(null===a)return[!1,[],!1];var d=a.types;b=d.includes("Files");d=d.includes("text/html")||d.includes("text/plain");return[b,Array.from(a.files),d]}

@@ -21,0 +22,0 @@ function J(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m<a.length;m++){var e=a[m],f=e.getKey();d.has(f)||(e=h.$findMatchingParent(e,u=>k.$isElementNode(u)&&!u.isInline()),null!==e&&(f=e.getKey(),e.canIndent()&&!d.has(f)&&(d.add(f),b(e))))}return 0<d.size}function K(b){b=k.$getNearestNodeFromDOMNode(b);return k.$isDecoratorNode(b)}exports.$createHeadingNode=F;exports.$createQuoteNode=A;

@@ -10,3 +10,3 @@ {

"license": "MIT",
"version": "0.16.2-nightly.20240724.0",
"version": "0.16.2-nightly.20240725.0",
"main": "LexicalRichText.js",

@@ -39,7 +39,7 @@ "types": "index.d.ts",

"dependencies": {
"@lexical/clipboard": "0.16.2-nightly.20240724.0",
"@lexical/selection": "0.16.2-nightly.20240724.0",
"@lexical/utils": "0.16.2-nightly.20240724.0",
"lexical": "0.16.2-nightly.20240724.0"
"@lexical/clipboard": "0.16.2-nightly.20240725.0",
"@lexical/selection": "0.16.2-nightly.20240725.0",
"@lexical/utils": "0.16.2-nightly.20240725.0",
"lexical": "0.16.2-nightly.20240725.0"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.