You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@lexical/mark

Package Overview
Dependencies
Maintainers
6
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.1-next.0 to 0.6.2

2

LexicalMark.dev.js

@@ -184,3 +184,3 @@ /**

function $createMarkNode(ids) {
return new MarkNode(ids);
return lexical.$applyNodeReplacement(new MarkNode(ids));
}

@@ -187,0 +187,0 @@ function $isMarkNode(node) {

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

*/
'use strict';var m=require("lexical"),n=require("@lexical/utils");
class p extends m.ElementNode{static getType(){return"mark"}static clone(a){return new p(Array.from(a.__ids),a.__key)}static importDOM(){return null}static importJSON(a){let b=q(a.ids);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(a,b){super(b);this.__ids=a||[]}createDOM(a){let b=document.createElement("mark");n.addClassNamesToElement(b,a.theme.mark);1<this.__ids.length&&
'use strict';var k=require("lexical"),n=require("@lexical/utils");
class p extends k.ElementNode{static getType(){return"mark"}static clone(a){return new p(Array.from(a.__ids),a.__key)}static importDOM(){return null}static importJSON(a){let b=q(a.ids);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(a,b){super(b);this.__ids=a||[]}createDOM(a){let b=document.createElement("mark");n.addClassNamesToElement(b,a.theme.mark);1<this.__ids.length&&
n.addClassNamesToElement(b,a.theme.markOverlap);return b}updateDOM(a,b,c){a=a.__ids.length;let d=this.__ids.length;c=c.theme.markOverlap;a!==d&&(1===a?2===d&&n.addClassNamesToElement(b,c):1===d&&n.removeClassNamesFromElement(b,c));return!1}hasID(a){let b=this.getIDs();for(let c=0;c<b.length;c++)if(a===b[c])return!0;return!1}getIDs(){let a=this.getLatest();return r(a)?a.__ids:[]}addID(a){var b=this.getWritable();if(r(b)){let c=b.__ids;b.__ids=c;for(b=0;b<c.length;b++)if(a===c[b])return;c.push(a)}}deleteID(a){var b=
this.getWritable();if(r(b)){let c=b.__ids;b.__ids=c;for(b=0;b<c.length;b++)if(a===c[b]){c.splice(b,1);break}}}insertNewAfter(a){a=this.getParentOrThrow().insertNewAfter(a);if(m.$isElementNode(a)){let b=q(this.__ids);a.append(b);return b}return null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(a,b,c){if(!m.$isRangeSelection(b)||"html"===c)return!1;let d=b.anchor,g=b.focus;a=d.getNode();c=g.getNode();b=b.isBackward()?d.offset-
g.offset:g.offset-d.offset;return this.isParentOf(a)&&this.isParentOf(c)&&this.getTextContent().length===b}excludeFromCopy(a){return"clone"!==a}}function q(a){return new p(a)}function r(a){return a instanceof p}exports.$createMarkNode=q;exports.$getMarkIDs=function(a,b){for(;null!==a;){if(r(a))return a.getIDs();if(m.$isTextNode(a)&&b===a.getTextContentSize()){let c=a.getNextSibling();if(r(c))return c.getIDs()}a=a.getParent()}return null};exports.$isMarkNode=r;
this.getWritable();if(r(b)){let c=b.__ids;b.__ids=c;for(b=0;b<c.length;b++)if(a===c[b]){c.splice(b,1);break}}}insertNewAfter(a){a=this.getParentOrThrow().insertNewAfter(a);if(k.$isElementNode(a)){let b=q(this.__ids);a.append(b);return b}return null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(a,b,c){if(!k.$isRangeSelection(b)||"html"===c)return!1;let d=b.anchor,g=b.focus;a=d.getNode();c=g.getNode();b=b.isBackward()?d.offset-
g.offset:g.offset-d.offset;return this.isParentOf(a)&&this.isParentOf(c)&&this.getTextContent().length===b}excludeFromCopy(a){return"clone"!==a}}function q(a){return k.$applyNodeReplacement(new p(a))}function r(a){return a instanceof p}exports.$createMarkNode=q;exports.$getMarkIDs=function(a,b){for(;null!==a;){if(r(a))return a.getIDs();if(k.$isTextNode(a)&&b===a.getTextContentSize()){let c=a.getNextSibling();if(r(c))return c.getIDs()}a=a.getParent()}return null};exports.$isMarkNode=r;
exports.$unwrapMarkNode=function(a){let b=a.getChildren(),c=null;for(let d=0;d<b.length;d++){let g=b[d];null===c?a.insertBefore(g):c.insertAfter(g);c=g}a.remove()};
exports.$wrapSelectionInMarkNode=function(a,b,c,d){let g=a.getNodes();var k=a.anchor.offset,h=a.focus.offset;a=g.length;let x=b?h:k;b=b?k:h;let t,l;for(k=0;k<a;k++){var e=g[k];if(m.$isElementNode(l)&&l.isParentOf(e))continue;h=0===k;let v=k===a-1;var f=null;if(m.$isTextNode(e)){f=e.getTextContentSize();let w=h?x:0,u=v?b:f;if(0===w&&0===u)continue;e=e.splitText(w,u);f=1<e.length&&(3===e.length||h&&!v||u===f)?e[1]:e[0]}else if(r(e))continue;else m.$isElementNode(e)&&e.isInline()&&(f=e);null!==f?f&&
f.is(t)||(h=f.getParent(),null!=h&&h.is(t)||(l=void 0),t=h,void 0===l&&(l=(d||q)([c]),f.insertBefore(l)),l.append(f)):l=t=void 0}};exports.MarkNode=p
exports.$wrapSelectionInMarkNode=function(a,b,c,d){let g=a.getNodes();var l=a.anchor.offset,h=a.focus.offset;a=g.length;let x=b?h:l;b=b?l:h;let t,m;for(l=0;l<a;l++){var e=g[l];if(k.$isElementNode(m)&&m.isParentOf(e))continue;h=0===l;let v=l===a-1;var f=null;if(k.$isTextNode(e)){f=e.getTextContentSize();let w=h?x:0,u=v?b:f;if(0===w&&0===u)continue;e=e.splitText(w,u);f=1<e.length&&(3===e.length||h&&!v||u===f)?e[1]:e[0]}else if(r(e))continue;else k.$isElementNode(e)&&e.isInline()&&(f=e);null!==f?f&&
f.is(t)||(h=f.getParent(),null!=h&&h.is(t)||(m=void 0),t=h,void 0===m&&(m=(d||q)([c]),f.insertBefore(m)),m.append(f)):m=t=void 0}};exports.MarkNode=p

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

"license": "MIT",
"version": "0.6.1-next.0",
"version": "0.6.2",
"main": "LexicalMark.js",
"peerDependencies": {
"lexical": "0.6.1-next.0"
"lexical": "0.6.2"
},
"dependencies": {
"@lexical/utils": "0.6.1-next.0"
"@lexical/utils": "0.6.2"
},

@@ -20,0 +20,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc