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.5 to 0.7.0

4

LexicalMark.dev.js

@@ -136,4 +136,4 @@ /**

insertNewAfter(selection) {
const element = this.getParentOrThrow().insertNewAfter(selection);
insertNewAfter(selection, restoreSelection = true) {
const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection);

@@ -140,0 +140,0 @@ if (lexical.$isElementNode(element)) {

@@ -10,6 +10,6 @@ /**

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(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;
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,b=!0){a=this.getParentOrThrow().insertNewAfter(a,b);return k.$isElementNode(a)?(b=q(this.__ids),a.append(b),b):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 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

@@ -31,3 +31,3 @@ /**

deleteID(id: string): void;
insertNewAfter(selection: RangeSelection): null | ElementNode;
insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | ElementNode;
canInsertTextBefore(): false;

@@ -34,0 +34,0 @@ canInsertTextAfter(): false;

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

"license": "MIT",
"version": "0.6.5",
"version": "0.7.0",
"main": "LexicalMark.js",
"peerDependencies": {
"lexical": "0.6.5"
"lexical": "0.7.0"
},
"dependencies": {
"@lexical/utils": "0.6.5"
"@lexical/utils": "0.7.0"
},

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