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

@lexical/link

Package Overview
Dependencies
Maintainers
7
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/link - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

6

index.d.ts

@@ -11,3 +11,3 @@ /** @module @lexical/link */

import { ElementNode, Spread } from 'lexical';
export declare type LinkAttributes = {
export type LinkAttributes = {
rel?: null | string;

@@ -17,3 +17,3 @@ target?: null | string;

};
export declare type SerializedLinkNode = Spread<{
export type SerializedLinkNode = Spread<{
url: string;

@@ -68,3 +68,3 @@ }, Spread<LinkAttributes, SerializedElementNode>>;

export declare function $isLinkNode(node: LexicalNode | null | undefined): node is LinkNode;
export declare type SerializedAutoLinkNode = SerializedLinkNode;
export type SerializedAutoLinkNode = SerializedLinkNode;
export declare class AutoLinkNode extends LinkNode {

@@ -71,0 +71,0 @@ static getType(): string;

@@ -360,3 +360,3 @@ /**

} = attributes;
const rel = attributes.rel === undefined ? 'noopener' : attributes.rel;
const rel = attributes.rel === undefined ? 'noreferrer' : attributes.rel;
const selection = lexical.$getSelection();

@@ -363,0 +363,0 @@

@@ -15,3 +15,3 @@ /**

(b=x(this.__url,{rel:this._rel,target:this.__target,title:this.__title}),a.append(b),b):null}}function x(a,b){return n.$applyNodeReplacement(new w(a,b))}let y=n.createCommand("TOGGLE_LINK_COMMAND");function z(a,b){for(;null!==a&&null!==(a=a.getParent())&&!b(a););return a}exports.$createAutoLinkNode=x;exports.$createLinkNode=t;exports.$isAutoLinkNode=function(a){return a instanceof w};exports.$isLinkNode=v;exports.AutoLinkNode=w;exports.LinkNode=q;exports.TOGGLE_LINK_COMMAND=y;
exports.toggleLink=function(a,b={}){let {target:d,title:l}=b,h=void 0===b.rel?"noopener":b.rel;b=n.$getSelection();if(n.$isRangeSelection(b))if(b=b.extract(),null===a)b.forEach(m=>{m=m.getParent();if(v(m)){let c=m.getChildren();for(let f=0;f<c.length;f++)m.insertBefore(c[f]);m.remove()}});else{if(1===b.length){var e=b[0];e=v(e)?e:z(e,v);if(null!==e){e.setURL(a);void 0!==d&&e.setTarget(d);null!==h&&e.setRel(h);void 0!==l&&e.setTitle(l);return}}let m=null,c=null;b.forEach(f=>{var g=f.getParent();if(g!==
c&&null!==g&&(!n.$isElementNode(f)||f.isInline()))if(v(g))c=g,g.setURL(a),void 0!==d&&g.setTarget(d),null!==h&&c.setRel(h),void 0!==l&&c.setTitle(l);else if(g.is(m)||(m=g,c=t(a,{rel:h,target:d}),v(g)?null===f.getPreviousSibling()?g.insertBefore(c):g.insertAfter(c):f.insertBefore(c)),v(f)){if(!f.is(c)){if(null!==c){g=f.getChildren();for(let u=0;u<g.length;u++)c.append(g[u])}f.remove()}}else null!==c&&c.append(f)})}}
exports.toggleLink=function(a,b={}){let {target:d,title:l}=b,h=void 0===b.rel?"noreferrer":b.rel;b=n.$getSelection();if(n.$isRangeSelection(b))if(b=b.extract(),null===a)b.forEach(m=>{m=m.getParent();if(v(m)){let c=m.getChildren();for(let f=0;f<c.length;f++)m.insertBefore(c[f]);m.remove()}});else{if(1===b.length){var e=b[0];e=v(e)?e:z(e,v);if(null!==e){e.setURL(a);void 0!==d&&e.setTarget(d);null!==h&&e.setRel(h);void 0!==l&&e.setTitle(l);return}}let m=null,c=null;b.forEach(f=>{var g=f.getParent();
if(g!==c&&null!==g&&(!n.$isElementNode(f)||f.isInline()))if(v(g))c=g,g.setURL(a),void 0!==d&&g.setTarget(d),null!==h&&c.setRel(h),void 0!==l&&c.setTitle(l);else if(g.is(m)||(m=g,c=t(a,{rel:h,target:d}),v(g)?null===f.getPreviousSibling()?g.insertBefore(c):g.insertAfter(c):f.insertBefore(c)),v(f)){if(!f.is(c)){if(null!==c){g=f.getChildren();for(let u=0;u<g.length;u++)c.append(g[u])}f.remove()}}else null!==c&&c.append(f)})}}

@@ -11,9 +11,9 @@ {

"license": "MIT",
"version": "0.11.1",
"version": "0.11.2",
"main": "LexicalLink.js",
"peerDependencies": {
"lexical": "0.11.1"
"lexical": "0.11.2"
},
"dependencies": {
"@lexical/utils": "0.11.1"
"@lexical/utils": "0.11.2"
},

@@ -20,0 +20,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