@lexical/link
Advanced tools
Comparing version 0.21.1-nightly.20241213.0 to 0.21.1-nightly.20241216.0
@@ -36,3 +36,3 @@ /** | ||
createDOM(config: EditorConfig): LinkHTMLElementType; | ||
updateDOM(prevNode: LinkNode, anchor: LinkHTMLElementType, config: EditorConfig): boolean; | ||
updateDOM(prevNode: this, anchor: LinkHTMLElementType, config: EditorConfig): boolean; | ||
static importDOM(): DOMConversionMap | null; | ||
@@ -85,3 +85,3 @@ static importJSON(serializedNode: SerializedLinkNode | SerializedAutoLinkNode): LinkNode; | ||
createDOM(config: EditorConfig): LinkHTMLElementType; | ||
updateDOM(prevNode: AutoLinkNode, anchor: LinkHTMLElementType, config: EditorConfig): boolean; | ||
updateDOM(prevNode: this, anchor: LinkHTMLElementType, config: EditorConfig): boolean; | ||
static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode; | ||
@@ -88,0 +88,0 @@ static importDOM(): null; |
@@ -72,3 +72,3 @@ /** | ||
updateDOM(prevNode, anchor, config) { | ||
if (anchor instanceof HTMLAnchorElement) { | ||
if (utils.isHTMLAnchorElement(anchor)) { | ||
const url = this.__url; | ||
@@ -75,0 +75,0 @@ const target = this.__target; |
@@ -12,3 +12,3 @@ /** | ||
class r extends m.ElementNode{static getType(){return"link"}static clone(a){return new r(a.__url,{rel:a.__rel,target:a.__target,title:a.__title},a.__key)}constructor(a,b={},c){super(c);let {target:g=null,rel:h=null,title:k=null}=b;this.__url=a;this.__target=g;this.__rel=h;this.__title=k}createDOM(a){let b=document.createElement("a");b.href=this.sanitizeUrl(this.__url);null!==this.__target&&(b.target=this.__target);null!==this.__rel&&(b.rel=this.__rel);null!==this.__title&&(b.title=this.__title);f.addClassNamesToElement(b, | ||
a.theme.link);return b}updateDOM(a,b){if(b instanceof HTMLAnchorElement){let c=this.__url,g=this.__target,h=this.__rel,k=this.__title;c!==a.__url&&(b.href=c);g!==a.__target&&(g?b.target=g:b.removeAttribute("target"));h!==a.__rel&&(h?b.rel=h:b.removeAttribute("rel"));k!==a.__title&&(k?b.title=k:b.removeAttribute("title"))}return!1}static importDOM(){return{a:()=>({conversion:t,priority:1})}}static importJSON(a){let b=u(a.url,{rel:a.rel,target:a.target,title:a.title});b.setFormat(a.format);b.setIndent(a.indent); | ||
a.theme.link);return b}updateDOM(a,b){if(f.isHTMLAnchorElement(b)){let c=this.__url,g=this.__target,h=this.__rel,k=this.__title;c!==a.__url&&(b.href=c);g!==a.__target&&(g?b.target=g:b.removeAttribute("target"));h!==a.__rel&&(h?b.rel=h:b.removeAttribute("rel"));k!==a.__title&&(k?b.title=k:b.removeAttribute("title"))}return!1}static importDOM(){return{a:()=>({conversion:t,priority:1})}}static importJSON(a){let b=u(a.url,{rel:a.rel,target:a.target,title:a.title});b.setFormat(a.format);b.setIndent(a.indent); | ||
b.setDirection(a.direction);return b}sanitizeUrl(a){try{let b=new URL(a);if(!q.has(b.protocol))return"about:blank"}catch(b){}return a}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(a){this.getWritable().__url=a}getTarget(){return this.getLatest().__target}setTarget(a){this.getWritable().__target=a}getRel(){return this.getLatest().__rel}setRel(a){this.getWritable().__rel= | ||
@@ -15,0 +15,0 @@ a}getTitle(){return this.getLatest().__title}setTitle(a){this.getWritable().__title=a}insertNewAfter(a,b=!0){a=u(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});this.insertAfter(a,b);return a}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(a,b){if(!m.$isRangeSelection(b))return!1;a=b.anchor.getNode();let c=b.focus.getNode();return this.isParentOf(a)&&this.isParentOf(c)&&0<b.getTextContent().length}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")|| |
@@ -11,8 +11,8 @@ { | ||
"license": "MIT", | ||
"version": "0.21.1-nightly.20241213.0", | ||
"version": "0.21.1-nightly.20241216.0", | ||
"main": "LexicalLink.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"@lexical/utils": "0.21.1-nightly.20241213.0", | ||
"lexical": "0.21.1-nightly.20241213.0" | ||
"@lexical/utils": "0.21.1-nightly.20241216.0", | ||
"lexical": "0.21.1-nightly.20241216.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
54472
+ Added@lexical/clipboard@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/html@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/list@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/selection@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/table@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/utils@0.21.1-nightly.20241216.0(transitive)
+ Addedlexical@0.21.1-nightly.20241216.0(transitive)
- Removed@lexical/clipboard@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/html@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/list@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/selection@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/table@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/utils@0.21.1-nightly.20241213.0(transitive)
- Removedlexical@0.21.1-nightly.20241213.0(transitive)