Socket
Socket
Sign inDemoInstall

@lexical/table

Package Overview
Dependencies
Maintainers
6
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/table - npm Package Compare versions

Comparing version 0.6.1-next.0 to 0.6.2

6

LexicalTable.dev.js

@@ -192,3 +192,3 @@ /**

function $createTableCellNode(headerState, colSpan = 1, width) {
return new TableCellNode(headerState, colSpan, width);
return lexical.$applyNodeReplacement(new TableCellNode(headerState, colSpan, width));
}

@@ -287,3 +287,3 @@ function $isTableCellNode(node) {

function $createTableRowNode(height) {
return new TableRowNode(height);
return lexical.$applyNodeReplacement(new TableRowNode(height));
}

@@ -1641,3 +1641,3 @@ function $isTableRowNode(node) {

function $createTableNode() {
return new TableNode();
return lexical.$applyNodeReplacement(new TableNode());
}

@@ -1644,0 +1644,0 @@ function $isTableNode(node) {

@@ -12,5 +12,5 @@ /**

a)===a}hasHeader(){return this.getLatest().__headerState!==q.NO_STATUS}updateDOM(a){return a.__headerState!==this.__headerState||a.__width!==this.__width}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}
function x(a){a=a.nodeName.toLowerCase();return{forChild:(b,e)=>{if(B(e)&&!d.$isElementNode(b)){e=d.$createParagraphNode();if(d.$isLineBreakNode(b)&&"\n"===b.getTextContent())return null;e.append(b);return e}return b},node:z("th"===a?q.ROW:q.NO_STATUS)}}function z(a,b=1,e){return new t(a,b,e)}function B(a){return a instanceof t}
function x(a){a=a.nodeName.toLowerCase();return{forChild:(b,e)=>{if(B(e)&&!d.$isElementNode(b)){e=d.$createParagraphNode();if(d.$isLineBreakNode(b)&&"\n"===b.getTextContent())return null;e.append(b);return e}return b},node:z("th"===a?q.ROW:q.NO_STATUS)}}function z(a,b=1,e){return d.$applyNodeReplacement(new t(a,b,e))}function B(a){return a instanceof t}
class C extends d.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(a){return new C(a.__height,a.__key)}static importDOM(){return{tr:()=>({conversion:D,priority:0})}}static importJSON(a){return E(a.height)}constructor(a,b){super(b);this.__height=a}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(a){let b=document.createElement("tr");this.__height&&(b.style.height=`${this.__height}px`);n.addClassNamesToElement(b,a.theme.tableRow);return b}isShadowRoot(){return!0}setHeight(a){this.getWritable().__height=
a;return this.__height}getHeight(){return this.getLatest().__height}updateDOM(a){return a.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function D(){return{node:E()}}function E(a){return new C(a)}function F(a){return a instanceof C}function G(a){throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?code=${a} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
a;return this.__height}getHeight(){return this.getLatest().__height}updateDOM(a){return a.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function D(){return{node:E()}}function E(a){return d.$applyNodeReplacement(new C(a))}function F(a){return a instanceof C}function G(a){throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?code=${a} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
let H="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;

@@ -38,3 +38,3 @@ if(H){let a=document.createElement("style");a.innerHTML="\n table.disable-selection {\n -webkit-touch-callout: none;\n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none; \n user-select: none;\n }\n \n .disable-selection span::selection{\n background-color: transparent;\n }\n .disable-selection br::selection{\n background-color: transparent;\n }\n ";document.body&&document.body.append(a)}

a);if(-1!==c)return{x:c,y:b}}throw Error("Cell not found in table.");}getCellFromCords(a,b,e){({cells:e}=e);b=e[b];if(null==b)return null;a=b[a];return null==a?null:a}getCellFromCordsOrThrow(a,b,e){a=this.getCellFromCords(a,b,e);if(!a)throw Error("Cell not found at cords.");return a}getCellNodeFromCords(a,b,e){a=this.getCellFromCords(a,b,e);if(null==a)return null;a=d.$getNearestNodeFromDOMNode(a.elem);return B(a)?a:null}getCellNodeFromCordsOrThrow(a,b,e){a=this.getCellNodeFromCords(a,b,e);if(!a)throw Error("Node at cords not TableCellNode.");
return a}canSelectBefore(){return!0}canIndent(){return!1}}function V(){return{node:W()}}function W(){return new U}function K(a){return a instanceof U}function X(a){a=n.$findMatchingParent(a,b=>F(b));if(F(a))return a;throw Error("Expected table cell to be inside of table row.");}function Y(a){a=n.$findMatchingParent(a,b=>K(b));if(K(a))return a;throw Error("Expected table cell to be inside of table.");}
return a}canSelectBefore(){return!0}canIndent(){return!1}}function V(){return{node:W()}}function W(){return d.$applyNodeReplacement(new U)}function K(a){return a instanceof U}function X(a){a=n.$findMatchingParent(a,b=>F(b));if(F(a))return a;throw Error("Expected table cell to be inside of table row.");}function Y(a){a=n.$findMatchingParent(a,b=>K(b));if(K(a))return a;throw Error("Expected table cell to be inside of table.");}
function Z(a,b){let e=Y(a),{x:h,y:c}=e.getCordsFromCellNode(a,b);return{above:e.getCellNodeFromCords(h,c-1,b),below:e.getCellNodeFromCords(h,c+1,b),left:e.getCellNodeFromCords(h-1,c,b),right:e.getCellNodeFromCords(h+1,c,b)}}let aa=d.createCommand("INSERT_TABLE_COMMAND");exports.$createTableCellNode=z;exports.$createTableNode=W;

@@ -41,0 +41,0 @@ exports.$createTableNodeWithDimensions=function(a,b,e=!0){let h=W();for(let l=0;l<a;l++){let p=E();for(let u=0;u<b;u++){var c=q.NO_STATUS;e&&(0===l&&(c|=q.ROW),0===u&&(c|=q.COLUMN));c=z(c);let v=d.$createParagraphNode();v.append(d.$createTextNode());c.append(v);p.append(c)}h.append(p)}return h};exports.$createTableRowNode=E;

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

"license": "MIT",
"version": "0.6.1-next.0",
"version": "0.6.2",
"main": "LexicalTable.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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc