Socket
Socket
Sign inDemoInstall

@lexical/link

Package Overview
Dependencies
Maintainers
6
Versions
152
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.5.0 to 0.5.1-next.0

2

LexicalLink.dev.js

@@ -267,3 +267,3 @@ /**

}
const TOGGLE_LINK_COMMAND = lexical.createCommand();
const TOGGLE_LINK_COMMAND = lexical.createCommand('TOGGLE_LINK_COMMAND');
function toggleLink(url, attributes = {}) {

@@ -270,0 +270,0 @@ const {

@@ -13,4 +13,4 @@ /**

class u extends n{static getType(){return"autolink"}static clone(a){return new u(a.__url,{rel:a.__rel,target:a.__target},a.__key)}static importJSON(a){let b=v(a.url,{rel:a.rel,target:a.target});b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(a){a=this.getParentOrThrow().insertNewAfter(a);if(m.$isElementNode(a)){let b=v(this.__url,{rel:this._rel,target:this.__target});
a.append(b);return b}return null}}function v(a,b){return new u(a,b)}let w=m.createCommand();function x(a){return y(a,b=>r(b))}function y(a,b){for(;null!==a&&null!==(a=a.getParent())&&!b(a););return a}exports.$createAutoLinkNode=v;exports.$createLinkNode=q;exports.$isAutoLinkNode=function(a){return a instanceof u};exports.$isLinkNode=r;exports.AutoLinkNode=u;exports.LinkNode=n;exports.TOGGLE_LINK_COMMAND=w;
a.append(b);return b}return null}}function v(a,b){return new u(a,b)}let w=m.createCommand("TOGGLE_LINK_COMMAND");function x(a){return y(a,b=>r(b))}function y(a,b){for(;null!==a&&null!==(a=a.getParent())&&!b(a););return a}exports.$createAutoLinkNode=v;exports.$createLinkNode=q;exports.$isAutoLinkNode=function(a){return a instanceof u};exports.$isLinkNode=r;exports.AutoLinkNode=u;exports.LinkNode=n;exports.TOGGLE_LINK_COMMAND=w;
exports.toggleLink=function(a,b={}){let {target:g,rel:h}=b;b=m.$getSelection();if(m.$isRangeSelection(b))if(b=b.extract(),null===a)b.forEach(k=>{k=k.getParent();if(r(k)){let e=k.getChildren();for(let f=0;f<e.length;f++)k.insertBefore(e[f]);k.remove()}});else{if(1===b.length){var d=b[0];d=r(d)?d:x(d);if(null!==d){d.setURL(a);void 0!==g&&d.setTarget(g);void 0!==h&&d.setRel(h);return}}let k=null,e=null;b.forEach(f=>{var c=f.getParent();if(c!==e&&null!==c&&(!m.$isElementNode(f)||f.isInline()))if(r(c))e=
c,c.setURL(a),void 0!==g&&c.setTarget(g),void 0!==h&&c.setRel(h);else if(c.is(k)||(k=c,e=q(a,{rel:h,target:g}),r(c)?null===f.getPreviousSibling()?c.insertBefore(e):c.insertAfter(e):f.insertBefore(e)),r(f)){if(!f.is(e)){if(null!==e){c=f.getChildren();for(let t=0;t<c.length;t++)e.append(c[t])}f.remove()}}else null!==e&&e.append(f)})}}

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

"license": "MIT",
"version": "0.5.0",
"version": "0.5.1-next.0",
"main": "LexicalLink.js",
"peerDependencies": {
"lexical": "0.5.0"
"lexical": "0.5.1-next.0"
},
"dependencies": {
"@lexical/utils": "0.5.0"
"@lexical/utils": "0.5.1-next.0"
},

@@ -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