New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/mark

Package Overview
Dependencies
Maintainers
5
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/mark - npm Package Compare versions

Comparing version 0.23.2-nightly.20250130.0 to 0.23.2-nightly.20250131.0

6

LexicalMark.dev.js

@@ -206,5 +206,5 @@ /**

continue;
} else if (lexical.$isElementNode(node) && node.isInline()) {
// Case 3: inline element nodes can be added in their entirety to the new
// mark
} else if ((lexical.$isElementNode(node) || lexical.$isDecoratorNode(node)) && node.isInline()) {
// Case 3: inline element/decorator nodes can be added in their entirety
// to the new mark
targetNode = node;

@@ -211,0 +211,0 @@ }

@@ -9,2 +9,2 @@ /**

"use strict";var e=require("lexical"),t=require("@lexical/utils");const n=[];class r extends e.ElementNode{static getType(){return"mark"}static clone(e){return new r(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return s().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=n,t){super(t),this.__ids=e}createDOM(e){const n=document.createElement("mark");return t.addClassNamesToElement(n,e.theme.mark),this.__ids.length>1&&t.addClassNamesToElement(n,e.theme.markOverlap),n}updateDOM(e,n,r){const s=e.__ids,i=this.__ids,o=s.length,l=i.length,a=r.theme.markOverlap;return o!==l&&(1===o?2===l&&t.addClassNamesToElement(n,a):1===l&&t.removeClassNamesFromElement(n,a)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){const t=this.getWritable();return t.__ids=e,t}addID(e){const t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){const t=this.getWritable(),n=t.__ids.indexOf(e);if(-1===n)return t;const r=Array.from(t.__ids);return r.splice(n,1),t.setIDs(r)}insertNewAfter(e,t=!0){const n=s(this.__ids);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!e.$isRangeSelection(n)||"html"===r)return!1;const s=n.anchor,i=n.focus,o=s.getNode(),l=i.getNode(),a=n.isBackward()?s.offset-i.offset:i.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(l)&&this.getTextContent().length===a}excludeFromCopy(e){return"clone"!==e}}function s(t=n){return e.$applyNodeReplacement(new r(t))}function i(e){return e instanceof r}exports.$createMarkNode=s,exports.$getMarkIDs=function(t,n){let r=t;for(;null!==r;){if(i(r))return r.getIDs();if(e.$isTextNode(r)&&n===r.getTextContentSize()){const e=r.getNextSibling();if(i(e))return e.getIDs()}r=r.getParent()}return null},exports.$isMarkNode=i,exports.$unwrapMarkNode=function(e){const t=e.getChildren();let n=null;for(let r=0;r<t.length;r++){const s=t[r];null===n?e.insertBefore(s):n.insertAfter(s),n=s}e.remove()},exports.$wrapSelectionInMarkNode=function(t,n,r,o){const l=t.getNodes(),a=t.anchor.offset,u=t.focus.offset,c=l.length,d=n?u:a,f=n?a:u;let m,h;for(let t=0;t<c;t++){const n=l[t];if(e.$isElementNode(h)&&h.isParentOf(n))continue;const a=0===t,u=t===c-1;let g=null;if(e.$isTextNode(n)){const e=n.getTextContentSize(),t=a?d:0,r=u?f:e;if(0===t&&0===r)continue;const s=n.splitText(t,r);g=s.length>1&&(3===s.length||a&&!u||r===e)?s[1]:s[0]}else{if(i(n))continue;e.$isElementNode(n)&&n.isInline()&&(g=n)}if(null!==g){if(g&&g.is(m))continue;const e=g.getParent();if(null!=e&&e.is(m)||(h=void 0),m=e,void 0===h){h=(o||s)([r]),g.insertBefore(h)}h.append(g)}else m=void 0,h=void 0}e.$isElementNode(h)&&(n?h.selectStart():h.selectEnd())},exports.MarkNode=r;
"use strict";var e=require("lexical"),t=require("@lexical/utils");const r=[];class n extends e.ElementNode{static getType(){return"mark"}static clone(e){return new n(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return s().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=r,t){super(t),this.__ids=e}createDOM(e){const r=document.createElement("mark");return t.addClassNamesToElement(r,e.theme.mark),this.__ids.length>1&&t.addClassNamesToElement(r,e.theme.markOverlap),r}updateDOM(e,r,n){const s=e.__ids,i=this.__ids,o=s.length,l=i.length,a=n.theme.markOverlap;return o!==l&&(1===o?2===l&&t.addClassNamesToElement(r,a):1===l&&t.removeClassNamesFromElement(r,a)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){const t=this.getWritable();return t.__ids=e,t}addID(e){const t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){const t=this.getWritable(),r=t.__ids.indexOf(e);if(-1===r)return t;const n=Array.from(t.__ids);return n.splice(r,1),t.setIDs(n)}insertNewAfter(e,t=!0){const r=s(this.__ids);return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,r,n){if(!e.$isRangeSelection(r)||"html"===n)return!1;const s=r.anchor,i=r.focus,o=s.getNode(),l=i.getNode(),a=r.isBackward()?s.offset-i.offset:i.offset-s.offset;return this.isParentOf(o)&&this.isParentOf(l)&&this.getTextContent().length===a}excludeFromCopy(e){return"clone"!==e}}function s(t=r){return e.$applyNodeReplacement(new n(t))}function i(e){return e instanceof n}exports.$createMarkNode=s,exports.$getMarkIDs=function(t,r){let n=t;for(;null!==n;){if(i(n))return n.getIDs();if(e.$isTextNode(n)&&r===n.getTextContentSize()){const e=n.getNextSibling();if(i(e))return e.getIDs()}n=n.getParent()}return null},exports.$isMarkNode=i,exports.$unwrapMarkNode=function(e){const t=e.getChildren();let r=null;for(let n=0;n<t.length;n++){const s=t[n];null===r?e.insertBefore(s):r.insertAfter(s),r=s}e.remove()},exports.$wrapSelectionInMarkNode=function(t,r,n,o){const l=t.getNodes(),a=t.anchor.offset,c=t.focus.offset,u=l.length,d=r?c:a,f=r?a:c;let m,h;for(let t=0;t<u;t++){const r=l[t];if(e.$isElementNode(h)&&h.isParentOf(r))continue;const a=0===t,c=t===u-1;let g=null;if(e.$isTextNode(r)){const e=r.getTextContentSize(),t=a?d:0,n=c?f:e;if(0===t&&0===n)continue;const s=r.splitText(t,n);g=s.length>1&&(3===s.length||a&&!c||n===e)?s[1]:s[0]}else{if(i(r))continue;(e.$isElementNode(r)||e.$isDecoratorNode(r))&&r.isInline()&&(g=r)}if(null!==g){if(g&&g.is(m))continue;const e=g.getParent();if(null!=e&&e.is(m)||(h=void 0),m=e,void 0===h){h=(o||s)([n]),g.insertBefore(h)}h.append(g)}else m=void 0,h=void 0}e.$isElementNode(h)&&(r?h.selectStart():h.selectEnd())},exports.MarkNode=n;

@@ -11,8 +11,8 @@ {

"license": "MIT",
"version": "0.23.2-nightly.20250130.0",
"version": "0.23.2-nightly.20250131.0",
"main": "LexicalMark.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/utils": "0.23.2-nightly.20250130.0",
"lexical": "0.23.2-nightly.20250130.0"
"@lexical/utils": "0.23.2-nightly.20250131.0",
"lexical": "0.23.2-nightly.20250131.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

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