@lexical/table
Advanced tools
Comparing version 0.21.1-nightly.20241213.0 to 0.21.1-nightly.20241216.0
@@ -12,8 +12,8 @@ /** | ||
x.NO_STATUS,b=1,c,d){super(d);this.__colSpan=b;this.__rowSpan=1;this.__headerState=a;this.__width=c;this.__backgroundColor=null}createDOM(a){let b=document.createElement(this.getTag());this.__width&&(b.style.width=`${this.__width}px`);1<this.__colSpan&&(b.colSpan=this.__colSpan);1<this.__rowSpan&&(b.rowSpan=this.__rowSpan);null!==this.__backgroundColor&&(b.style.backgroundColor=this.__backgroundColor);h.addClassNamesToElement(b,a.theme.tableCell,this.hasHeader()&&a.theme.tableCellHeader);return b}exportDOM(a){a= | ||
super.exportDOM(a);if(a.element&&v.isHTMLElement(a.element)){let b=a.element;b.setAttribute("data-temporary-table-cell-lexical-key",this.getKey());b.style.border="1px solid black";1<this.__colSpan&&(b.colSpan=this.__colSpan);1<this.__rowSpan&&(b.rowSpan=this.__rowSpan);b.style.width=`${this.getWidth()||75}px`;b.style.verticalAlign="top";b.style.textAlign="start";null===this.__backgroundColor&&this.hasHeader()&&(b.style.backgroundColor="#f2f3f5")}return a}exportJSON(){return{...super.exportJSON(), | ||
backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(a){let b=this.getWritable();b.__colSpan=a;return b}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(a){let b=this.getWritable();b.__rowSpan=a;return b}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(a,b=x.BOTH){let c=this.getWritable();c.__headerState=a&b|c.__headerState& | ||
~b;return c}getHeaderStyles(){return this.getLatest().__headerState}setWidth(a){let b=this.getWritable();b.__width=a;return b}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(a){let b=this.getWritable();b.__backgroundColor=a;return b}toggleHeaderStyle(a){let b=this.getWritable();b.__headerState=(b.__headerState&a)===a?b.__headerState-a:b.__headerState+a;return b}hasHeaderState(a){return(this.getHeaderStyles()&a)===a}hasHeader(){return this.getLatest().__headerState!== | ||
x.NO_STATUS}updateDOM(a){return a.__headerState!==this.__headerState||a.__width!==this.__width||a.__colSpan!==this.__colSpan||a.__rowSpan!==this.__rowSpan||a.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}} | ||
function da(a){var b=a.nodeName.toLowerCase(),c=void 0;ba.test(a.style.width)&&(c=parseFloat(a.style.width));b=B("th"===b?x.ROW:x.NO_STATUS,a.colSpan,c);b.__rowSpan=a.rowSpan;c=a.style.backgroundColor;""!==c&&(b.__backgroundColor=c);a=a.style;c=(a&&a.textDecoration||"").split(" ");let d="700"===a.fontWeight||"bold"===a.fontWeight,e=c.includes("line-through"),f="italic"===a.fontStyle,g=c.includes("underline");return{after:m=>{0===m.length&&m.push(v.$createParagraphNode());return m},forChild:(m,p)=> | ||
{if(C(p)&&!v.$isElementNode(m)){p=v.$createParagraphNode();if(v.$isLineBreakNode(m)&&"\n"===m.getTextContent())return null;v.$isTextNode(m)&&(d&&m.toggleFormat("bold"),e&&m.toggleFormat("strikethrough"),f&&m.toggleFormat("italic"),g&&m.toggleFormat("underline"));p.append(m);return p}return m},node:b}}function B(a=x.NO_STATUS,b=1,c){return v.$applyNodeReplacement(new y(a,b,c))}function C(a){return a instanceof y}let ea=v.createCommand("INSERT_TABLE_COMMAND");var E; | ||
super.exportDOM(a);if(v.isHTMLElement(a.element)){let b=a.element;b.setAttribute("data-temporary-table-cell-lexical-key",this.getKey());b.style.border="1px solid black";1<this.__colSpan&&(b.colSpan=this.__colSpan);1<this.__rowSpan&&(b.rowSpan=this.__rowSpan);b.style.width=`${this.getWidth()||75}px`;b.style.verticalAlign="top";b.style.textAlign="start";null===this.__backgroundColor&&this.hasHeader()&&(b.style.backgroundColor="#f2f3f5")}return a}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(), | ||
colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(a){let b=this.getWritable();b.__colSpan=a;return b}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(a){let b=this.getWritable();b.__rowSpan=a;return b}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(a,b=x.BOTH){let c=this.getWritable();c.__headerState=a&b|c.__headerState&~b;return c}getHeaderStyles(){return this.getLatest().__headerState}setWidth(a){let b= | ||
this.getWritable();b.__width=a;return b}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(a){let b=this.getWritable();b.__backgroundColor=a;return b}toggleHeaderStyle(a){let b=this.getWritable();b.__headerState=(b.__headerState&a)===a?b.__headerState-a:b.__headerState+a;return b}hasHeaderState(a){return(this.getHeaderStyles()&a)===a}hasHeader(){return this.getLatest().__headerState!==x.NO_STATUS}updateDOM(a){return a.__headerState!== | ||
this.__headerState||a.__width!==this.__width||a.__colSpan!==this.__colSpan||a.__rowSpan!==this.__rowSpan||a.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}} | ||
function da(a){var b=a.nodeName.toLowerCase(),c=void 0;ba.test(a.style.width)&&(c=parseFloat(a.style.width));b=B("th"===b?x.ROW:x.NO_STATUS,a.colSpan,c);b.__rowSpan=a.rowSpan;c=a.style.backgroundColor;""!==c&&(b.__backgroundColor=c);a=a.style;c=(a&&a.textDecoration||"").split(" ");let d="700"===a.fontWeight||"bold"===a.fontWeight,f=c.includes("line-through"),e="italic"===a.fontStyle,g=c.includes("underline");return{after:n=>{0===n.length&&n.push(v.$createParagraphNode());return n},forChild:(n,r)=> | ||
{if(C(r)&&!v.$isElementNode(n)){r=v.$createParagraphNode();if(v.$isLineBreakNode(n)&&"\n"===n.getTextContent())return null;v.$isTextNode(n)&&(d&&n.toggleFormat("bold"),f&&n.toggleFormat("strikethrough"),e&&n.toggleFormat("italic"),g&&n.toggleFormat("underline"));r.append(n);return r}return n},node:b}}function B(a=x.NO_STATUS,b=1,c){return v.$applyNodeReplacement(new y(a,b,c))}function C(a){return a instanceof y}let ea=v.createCommand("INSERT_TABLE_COMMAND");var E; | ||
function F(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;c<arguments.length;c++)b.append("v",arguments[c]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${b} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}E=F&&F.__esModule&&Object.prototype.hasOwnProperty.call(F,"default")?F["default"]:F; | ||
@@ -23,72 +23,72 @@ class I extends v.ElementNode{static getType(){return"tablerow"}static clone(a){return new I(a.__height,a.__key)}static importDOM(){return{tr:()=>({conversion:fa,priority:0})}}static importJSON(a){return J(a.height)}constructor(a,b){super(b);this.__height=a}exportJSON(){return{...super.exportJSON(),...(this.getHeight()&&{height:this.getHeight()}),type:"tablerow",version:1}}createDOM(a){let b=document.createElement("tr");this.__height&&(b.style.height=`${this.__height}px`);h.addClassNamesToElement(b, | ||
function K(a){return a instanceof I}let ha="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,ia=ha&&"documentMode"in document?document.documentMode:null,ja=ha&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);ha&&"InputEvent"in window&&!ia?"getTargetRanges"in new window.InputEvent("input"):!1; | ||
function ka(a,b,c=!0){let d=la();for(let f=0;f<a;f++){let g=J();for(let m=0;m<b;m++){var e=x.NO_STATUS;"object"===typeof c?(0===f&&c.rows&&(e|=x.ROW),0===m&&c.columns&&(e|=x.COLUMN)):c&&(0===f&&(e|=x.ROW),0===m&&(e|=x.COLUMN));e=B(e);let p=v.$createParagraphNode();p.append(v.$createTextNode());e.append(p);g.append(e)}d.append(g)}return d}function ma(a){a=h.$findMatchingParent(a,b=>K(b));if(K(a))return a;throw Error("Expected table cell to be inside of table row.");} | ||
function na(a){a=h.$findMatchingParent(a,b=>L(b));if(L(a))return a;throw Error("Expected table cell to be inside of table.");}function oa(a,b){let c=na(a),{x:d,y:e}=c.getCordsFromCellNode(a,b);return{above:c.getCellNodeFromCords(d,e-1,b),below:c.getCellNodeFromCords(d,e+1,b),left:c.getCellNodeFromCords(d-1,e,b),right:c.getCellNodeFromCords(d+1,e,b)}}let pa=(a,b)=>a===x.BOTH||a===b?b:x.NO_STATUS;function M(a){let b=a.getFirstDescendant();null==b?a.selectStart():b.getParentOrThrow().selectStart()} | ||
function qa(a,b){let c=a.getFirstChild();null!==c?c.insertBefore(b):a.append(b)}function O(a,b,c){let [d,e,f]=ra(a,b,c);null===e&&E(207);null===f&&E(208);return[d,e,f]} | ||
function ra(a,b,c){function d(p){let r=e[p];void 0===r&&(e[p]=r=[]);return r}let e=[],f=null,g=null;a=a.getChildren();for(let p=0;p<a.length;p++){var m=a[p];K(m)||E(209);for(let r=m.getFirstChild(),k=0;null!=r;r=r.getNextSibling()){C(r)||E(147);for(m=d(p);void 0!==m[k];)k++;m={cell:r,startColumn:k,startRow:p};let {__rowSpan:l,__colSpan:n}=r;for(let q=0;q<l&&!(p+q>=a.length);q++){let u=d(p+q);for(let t=0;t<n;t++)u[k+t]=m}null!==b&&null===f&&b.is(r)&&(f=m);null!==c&&null===g&&c.is(r)&&(g=m)}}return[e, | ||
f,g]}function Q(a){a instanceof y||("__type"in a?(a=h.$findMatchingParent(a,C),C(a)||E(148)):(a=h.$findMatchingParent(a.getNode(),C),C(a)||E(148)));let b=a.getParent();K(b)||E(149);let c=b.getParent();L(c)||E(210);return[a,b,c]} | ||
function sa(a,b,c){function d(n){let {cell:q,startColumn:u,startRow:t}=n;e=Math.min(e,u);f=Math.min(f,t);g=Math.max(g,u+q.__colSpan-1);m=Math.max(m,t+q.__rowSpan-1)}let e=Math.min(b.startColumn,c.startColumn),f=Math.min(b.startRow,c.startRow),g=Math.max(b.startColumn+b.cell.__colSpan-1,c.startColumn+c.cell.__colSpan-1),m=Math.max(b.startRow+b.cell.__rowSpan-1,c.startRow+c.cell.__rowSpan-1);b=e;c=f;for(var p=e,r=f;e<b||f<c||g>p||m>r;){if(e<b){var k=r-c;--b;for(var l=0;l<=k;l++)d(a[c+l][b])}if(f<c)for(k= | ||
p-b,--c,l=0;l<=k;l++)d(a[c][b+l]);if(g>p)for(k=r-c,p+=1,l=0;l<=k;l++)d(a[c+l][p]);if(m>r)for(k=p-b,r+=1,l=0;l<=k;l++)d(a[r][b+l])}return{maxColumn:g,maxRow:m,minColumn:e,minRow:f}} | ||
function ta(a){let [b,,c]=Q(a);a=c.getChildren();let d=a.length;var e=a[0].getChildren().length;let f=Array(d);for(var g=0;g<d;g++)f[g]=Array(e);for(e=0;e<d;e++){g=a[e].getChildren();let m=0;for(let p=0;p<g.length;p++){for(;f[e][m];)m++;let r=g[p],k=r.__rowSpan||1,l=r.__colSpan||1;for(let n=0;n<k;n++)for(let q=0;q<l;q++)f[e+n][m+q]=r;if(b===r)return{colSpan:l,columnIndex:m,rowIndex:e,rowSpan:k};m+=l}}return null} | ||
function ua(a){let [[b,c,d,e],[f,g,m,p]]=["anchor","focus"].map(r=>{const k=a[r].getNode(),l=h.$findMatchingParent(k,C);C(l)||E(238,r,k.getKey(),k.getType());const n=l.getParent();K(n)||E(239,r);const q=n.getParent();L(q)||E(240,r);return[k,l,n,q]});e.is(p)||E(241);return{anchorCell:c,anchorNode:b,anchorRow:d,anchorTable:e,focusCell:g,focusNode:f,focusRow:m,focusTable:p}} | ||
function ka(a,b,c=!0){let d=la();for(let e=0;e<a;e++){let g=J();for(let n=0;n<b;n++){var f=x.NO_STATUS;"object"===typeof c?(0===e&&c.rows&&(f|=x.ROW),0===n&&c.columns&&(f|=x.COLUMN)):c&&(0===e&&(f|=x.ROW),0===n&&(f|=x.COLUMN));f=B(f);let r=v.$createParagraphNode();r.append(v.$createTextNode());f.append(r);g.append(f)}d.append(g)}return d}function ma(a){a=h.$findMatchingParent(a,b=>K(b));if(K(a))return a;throw Error("Expected table cell to be inside of table row.");} | ||
function na(a){a=h.$findMatchingParent(a,b=>L(b));if(L(a))return a;throw Error("Expected table cell to be inside of table.");}function oa(a,b){let c=na(a),{x:d,y:f}=c.getCordsFromCellNode(a,b);return{above:c.getCellNodeFromCords(d,f-1,b),below:c.getCellNodeFromCords(d,f+1,b),left:c.getCellNodeFromCords(d-1,f,b),right:c.getCellNodeFromCords(d+1,f,b)}}let pa=(a,b)=>a===x.BOTH||a===b?b:x.NO_STATUS;function M(a){let b=a.getFirstDescendant();null==b?a.selectStart():b.getParentOrThrow().selectStart()} | ||
function qa(a,b){let c=a.getFirstChild();null!==c?c.insertBefore(b):a.append(b)}function O(a,b,c){let [d,f,e]=ra(a,b,c);null===f&&E(207);null===e&&E(208);return[d,f,e]} | ||
function ra(a,b,c){function d(r){let p=f[r];void 0===p&&(f[r]=p=[]);return p}let f=[],e=null,g=null;a=a.getChildren();for(let r=0;r<a.length;r++){var n=a[r];K(n)||E(209);for(let p=n.getFirstChild(),l=0;null!=p;p=p.getNextSibling()){C(p)||E(147);for(n=d(r);void 0!==n[l];)l++;n={cell:p,startColumn:l,startRow:r};let {__rowSpan:k,__colSpan:m}=p;for(let q=0;q<k&&!(r+q>=a.length);q++){let u=d(r+q);for(let t=0;t<m;t++)u[l+t]=n}null!==b&&null===e&&b.is(p)&&(e=n);null!==c&&null===g&&c.is(p)&&(g=n)}}return[f, | ||
e,g]}function Q(a){a instanceof y||("__type"in a?(a=h.$findMatchingParent(a,C),C(a)||E(148)):(a=h.$findMatchingParent(a.getNode(),C),C(a)||E(148)));let b=a.getParent();K(b)||E(149);let c=b.getParent();L(c)||E(210);return[a,b,c]} | ||
function sa(a,b,c){function d(m){let {cell:q,startColumn:u,startRow:t}=m;f=Math.min(f,u);e=Math.min(e,t);g=Math.max(g,u+q.__colSpan-1);n=Math.max(n,t+q.__rowSpan-1)}let f=Math.min(b.startColumn,c.startColumn),e=Math.min(b.startRow,c.startRow),g=Math.max(b.startColumn+b.cell.__colSpan-1,c.startColumn+c.cell.__colSpan-1),n=Math.max(b.startRow+b.cell.__rowSpan-1,c.startRow+c.cell.__rowSpan-1);b=f;c=e;for(var r=f,p=e;f<b||e<c||g>r||n>p;){if(f<b){var l=p-c;--b;for(var k=0;k<=l;k++)d(a[c+k][b])}if(e<c)for(l= | ||
r-b,--c,k=0;k<=l;k++)d(a[c][b+k]);if(g>r)for(l=p-c,r+=1,k=0;k<=l;k++)d(a[c+k][r]);if(n>p)for(l=r-b,p+=1,k=0;k<=l;k++)d(a[p][b+k])}return{maxColumn:g,maxRow:n,minColumn:f,minRow:e}} | ||
function ta(a){let [b,,c]=Q(a);a=c.getChildren();let d=a.length;var f=a[0].getChildren().length;let e=Array(d);for(var g=0;g<d;g++)e[g]=Array(f);for(f=0;f<d;f++){g=a[f].getChildren();let n=0;for(let r=0;r<g.length;r++){for(;e[f][n];)n++;let p=g[r],l=p.__rowSpan||1,k=p.__colSpan||1;for(let m=0;m<l;m++)for(let q=0;q<k;q++)e[f+m][n+q]=p;if(b===p)return{colSpan:k,columnIndex:n,rowIndex:f,rowSpan:l};n+=k}}return null} | ||
function ua(a){let [[b,c,d,f],[e,g,n,r]]=["anchor","focus"].map(p=>{const l=a[p].getNode(),k=h.$findMatchingParent(l,C);C(k)||E(238,p,l.getKey(),l.getType());const m=k.getParent();K(m)||E(239,p);const q=m.getParent();L(q)||E(240,p);return[l,k,m,q]});f.is(r)||E(241);return{anchorCell:c,anchorNode:b,anchorRow:d,anchorTable:f,focusCell:g,focusNode:e,focusRow:n,focusTable:r}} | ||
class va{constructor(a,b,c){this.anchor=b;this.focus=c;b._selection=this;c._selection=this;this._cachedNodes=null;this.dirty=!1;this.tableKey=a}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){return"root"!==this.tableKey&&"root"!==this.anchor.key&&"element"===this.anchor.type&&"root"!==this.focus.key&&"element"===this.focus.type}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(a){this._cachedNodes=a}is(a){return R(a)&&this.tableKey=== | ||
a.tableKey&&this.anchor.is(a.anchor)&&this.focus.is(a.focus)}set(a,b,c){this.dirty=this.dirty||a!==this.tableKey||b!==this.anchor.key||c!==this.focus.key;this.tableKey=a;this.anchor.key=b;this.focus.key=c;this._cachedNodes=null}clone(){return new va(this.tableKey,v.$createPoint(this.anchor.key,this.anchor.offset,this.anchor.type),v.$createPoint(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}hasFormat(a){let b= | ||
0;this.getNodes().filter(C).forEach(c=>{c=c.getFirstChild();v.$isParagraphNode(c)&&(b|=c.getTextFormat())});return 0!==(b&v.TEXT_TYPE_TO_FORMAT[a])}insertNodes(a){let b=this.focus.getNode();v.$isElementNode(b)||E(151);v.$normalizeSelection__EXPERIMENTAL(b.select(0,b.getChildrenSize())).insertNodes(a)}getShape(){let {anchorCell:a,focusCell:b}=ua(this);var c=ta(a);null===c&&E(153);let d=ta(b);null===d&&E(155);let e=Math.min(c.columnIndex,d.columnIndex),f=Math.max(c.columnIndex+c.colSpan-1,d.columnIndex+ | ||
d.colSpan-1),g=Math.min(c.rowIndex,d.rowIndex);c=Math.max(c.rowIndex+c.rowSpan-1,d.rowIndex+d.rowSpan-1);return{fromX:Math.min(e,f),fromY:Math.min(g,c),toX:Math.max(e,f),toY:Math.max(g,c)}}getNodes(){if(!this.isValid())return[];var a=this._cachedNodes;if(null!==a)return a;let {anchorTable:b,anchorCell:c,focusCell:d}=ua(this);a=d.getParents()[1];if(a!==b)return b.isParentOf(d)?(a=a.getParent(),null==a&&E(159),this.set(this.tableKey,d.getKey(),a.getKey())):(a=b.getParent(),null==a&&E(158),this.set(this.tableKey, | ||
a.getKey(),d.getKey())),this.getNodes();let [e,f,g]=O(b,c,d),{minColumn:m,maxColumn:p,minRow:r,maxRow:k}=sa(e,f,g),l=new Map([[b.getKey(),b]]);a=null;for(let n=r;n<=k;n++)for(let q=m;q<=p;q++){let {cell:u}=e[n][q],t=u.getParent();K(t)||E(160);t!==a&&(l.set(t.getKey(),t),a=t);l.has(u.getKey())||wa(u,w=>{l.set(w.getKey(),w)})}a=Array.from(l.values());v.isCurrentlyReadOnlyMode()||(this._cachedNodes=a);return a}getTextContent(){let a=this.getNodes().filter(c=>C(c)),b="";for(let c=0;c<a.length;c++){let d= | ||
a[c],e=d.__parent,f=(a[c+1]||{}).__parent;b+=d.getTextContent()+(f!==e?"\n":"\t")}return b}}function R(a){return a instanceof va}function xa(){let a=v.$createPoint("root",0,"element"),b=v.$createPoint("root",0,"element");return new va("root",a,b)}function wa(a,b){a=[[a]];for(var c=a.at(-1);void 0!==c&&0<a.length;c=a.at(-1))c=c.pop(),void 0===c?a.pop():!1!==b(c)&&v.$isElementNode(c)&&a.push(c.getChildren())} | ||
0;this.getNodes().filter(C).forEach(c=>{c=c.getFirstChild();v.$isParagraphNode(c)&&(b|=c.getTextFormat())});return 0!==(b&v.TEXT_TYPE_TO_FORMAT[a])}insertNodes(a){let b=this.focus.getNode();v.$isElementNode(b)||E(151);v.$normalizeSelection__EXPERIMENTAL(b.select(0,b.getChildrenSize())).insertNodes(a)}getShape(){let {anchorCell:a,focusCell:b}=ua(this);var c=ta(a);null===c&&E(153);let d=ta(b);null===d&&E(155);let f=Math.min(c.columnIndex,d.columnIndex),e=Math.max(c.columnIndex+c.colSpan-1,d.columnIndex+ | ||
d.colSpan-1),g=Math.min(c.rowIndex,d.rowIndex);c=Math.max(c.rowIndex+c.rowSpan-1,d.rowIndex+d.rowSpan-1);return{fromX:Math.min(f,e),fromY:Math.min(g,c),toX:Math.max(f,e),toY:Math.max(g,c)}}getNodes(){if(!this.isValid())return[];var a=this._cachedNodes;if(null!==a)return a;let {anchorTable:b,anchorCell:c,focusCell:d}=ua(this);a=d.getParents()[1];if(a!==b)return b.isParentOf(d)?(a=a.getParent(),null==a&&E(159),this.set(this.tableKey,d.getKey(),a.getKey())):(a=b.getParent(),null==a&&E(158),this.set(this.tableKey, | ||
a.getKey(),d.getKey())),this.getNodes();let [f,e,g]=O(b,c,d),{minColumn:n,maxColumn:r,minRow:p,maxRow:l}=sa(f,e,g),k=new Map([[b.getKey(),b]]);a=null;for(let m=p;m<=l;m++)for(let q=n;q<=r;q++){let {cell:u}=f[m][q],t=u.getParent();K(t)||E(160);t!==a&&(k.set(t.getKey(),t),a=t);k.has(u.getKey())||wa(u,w=>{k.set(w.getKey(),w)})}a=Array.from(k.values());v.isCurrentlyReadOnlyMode()||(this._cachedNodes=a);return a}getTextContent(){let a=this.getNodes().filter(c=>C(c)),b="";for(let c=0;c<a.length;c++){let d= | ||
a[c],f=d.__parent,e=(a[c+1]||{}).__parent;b+=d.getTextContent()+(e!==f?"\n":"\t")}return b}}function R(a){return a instanceof va}function xa(){let a=v.$createPoint("root",0,"element"),b=v.$createPoint("root",0,"element");return new va("root",a,b)}function wa(a,b){a=[[a]];for(var c=a.at(-1);void 0!==c&&0<a.length;c=a.at(-1))c=c.pop(),void 0===c?a.pop():!1!==b(c)&&v.$isElementNode(c)&&a.push(c.getChildren())} | ||
function ya(a,b=v.$getEditor()){let c=v.$getNodeByKey(a);L(c)||E(231,a);b=S(c,b.getElementByKey(a));null===b&&E(232,a);return{tableElement:b,tableNode:c}} | ||
class za{constructor(a,b){this.isHighlightingCells=!1;this.focusY=this.focusX=this.anchorY=this.anchorX=-1;this.listenersToRemove=new Set;this.tableNodeKey=b;this.editor=a;this.table={columns:0,domRows:[],rows:0};this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.tableSelection=null;this.shouldCheckSelection=this.isSelecting=this.hasHijackedSelectionStyles=!1;this.abortController=new AbortController;this.listenerOptions={signal:this.abortController.signal};this.nextFocus= | ||
null;this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners");Array.from(this.listenersToRemove).forEach(a=>a());this.listenersToRemove.clear()}$lookup(){return ya(this.tableNodeKey,this.editor)}trackTable(){let a=new MutationObserver(b=>{this.editor.getEditorState().read(()=>{let c=!1;for(let f=0;f<b.length;f++){const g=b[f].target.nodeName;if("TABLE"===g||"TBODY"===g||"THEAD"===g||"TR"===g){c=!0;break}}if(c){var {tableNode:d,tableElement:e}= | ||
this.$lookup();this.table=T(d,e)}},{editor:this.editor})});this.editor.getEditorState().read(()=>{let {tableNode:b,tableElement:c}=this.$lookup();this.table=T(b,c);a.observe(c,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){let a=this.editor;this.isHighlightingCells=!1;this.focusY=this.focusX=this.anchorY=this.anchorX=-1;this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.tableSelection=null;this.hasHijackedSelectionStyles=!1;this.$enableHighlightStyle(); | ||
null;this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners");Array.from(this.listenersToRemove).forEach(a=>a());this.listenersToRemove.clear()}$lookup(){return ya(this.tableNodeKey,this.editor)}trackTable(){let a=new MutationObserver(b=>{this.editor.getEditorState().read(()=>{let c=!1;for(let e=0;e<b.length;e++){const g=b[e].target.nodeName;if("TABLE"===g||"TBODY"===g||"THEAD"===g||"TR"===g){c=!0;break}}if(c){var {tableNode:d,tableElement:f}= | ||
this.$lookup();this.table=T(d,f)}},{editor:this.editor})});this.editor.getEditorState().read(()=>{let {tableNode:b,tableElement:c}=this.$lookup();this.table=T(b,c);a.observe(c,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){let a=this.editor;this.isHighlightingCells=!1;this.focusY=this.focusX=this.anchorY=this.anchorX=-1;this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.tableSelection=null;this.hasHijackedSelectionStyles=!1;this.$enableHighlightStyle(); | ||
let {tableNode:b,tableElement:c}=this.$lookup(),d=T(b,c);Aa(a,d,null);null!==v.$getSelection()&&(v.$setSelection(null),a.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0))}$enableHighlightStyle(){let a=this.editor,{tableElement:b}=this.$lookup();h.removeClassNamesFromElement(b,a._config.theme.tableSelection);b.classList.remove("disable-selection");this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let {tableElement:a}=this.$lookup();h.addClassNamesToElement(a,this.editor._config.theme.tableSelection); | ||
this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(a){if(null!==a){a.tableKey!==this.tableNodeKey&&E(233,a.tableKey,this.tableNodeKey);let b=this.editor;this.tableSelection=a;this.isHighlightingCells=!0;this.$disableHighlightStyle();this.updateDOMSelection();Aa(b,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return this.shouldCheckSelection?(this.shouldCheckSelection=!1,!0):!1}setNextFocus(a){this.nextFocus= | ||
a}getAndClearNextFocus(){let {nextFocus:a}=this;null!==a&&(this.nextFocus=null);return a}updateDOMSelection(){if(null!==this.anchorCell&&null!==this.focusCell){let a=v.getDOMSelection(this.editor._window);a&&0<a.rangeCount&&a.removeAllRanges()}}$setFocusCellForSelection(a,b=!1){let c=this.editor,{tableNode:d}=this.$lookup();var e=a.x;let f=a.y;this.focusCell=a;if(!this.isHighlightingCells&&(this.anchorX!==e||this.anchorY!==f||b))this.isHighlightingCells=!0,this.$disableHighlightStyle();else if(e=== | ||
this.focusX&&f===this.focusY)return!1;this.focusX=e;this.focusY=f;return this.isHighlightingCells&&(b=U(d,v.$getNearestNodeFromDOMNode(a.elem,void 0)),null!=this.tableSelection&&null!=this.anchorCellNodeKey&&null!==b)?(this.focusCellNodeKey=b.getKey(),a=this.$getAnchorTableCellOrThrow(),d.getKey(),a.getKey(),b.getKey(),e=v.$getSelection(),e=R(e)?e.clone():xa(),e.set(d.getKey(),a.getKey(),b.getKey()),this.tableSelection=e,v.$setSelection(this.tableSelection),c.dispatchCommand(v.SELECTION_CHANGE_COMMAND, | ||
a}getAndClearNextFocus(){let {nextFocus:a}=this;null!==a&&(this.nextFocus=null);return a}updateDOMSelection(){if(null!==this.anchorCell&&null!==this.focusCell){let a=v.getDOMSelection(this.editor._window);a&&0<a.rangeCount&&a.removeAllRanges()}}$setFocusCellForSelection(a,b=!1){let c=this.editor,{tableNode:d}=this.$lookup();var f=a.x;let e=a.y;this.focusCell=a;if(!this.isHighlightingCells&&(this.anchorX!==f||this.anchorY!==e||b))this.isHighlightingCells=!0,this.$disableHighlightStyle();else if(f=== | ||
this.focusX&&e===this.focusY)return!1;this.focusX=f;this.focusY=e;return this.isHighlightingCells&&(b=U(d,v.$getNearestNodeFromDOMNode(a.elem,void 0)),null!=this.tableSelection&&null!=this.anchorCellNodeKey&&null!==b)?(this.focusCellNodeKey=b.getKey(),a=this.$getAnchorTableCellOrThrow(),d.getKey(),a.getKey(),b.getKey(),f=v.$getSelection(),f=R(f)?f.clone():xa(),f.set(d.getKey(),a.getKey(),b.getKey()),this.tableSelection=f,v.$setSelection(this.tableSelection),c.dispatchCommand(v.SELECTION_CHANGE_COMMAND, | ||
void 0),Aa(c,this.table,this.tableSelection),!0):!1}$getAnchorTableCell(){return this.anchorCellNodeKey?v.$getNodeByKey(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){let a=this.$getAnchorTableCell();null===a&&E(234);return a}$getFocusTableCell(){return this.focusCellNodeKey?v.$getNodeByKey(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){let a=this.$getFocusTableCell();null===a&&E(235);return a}$setAnchorCellForSelection(a){this.isHighlightingCells=!1;this.anchorCell=a;this.anchorX= | ||
a.x;this.anchorY=a.y;let {tableNode:b}=this.$lookup();a=U(b,v.$getNearestNodeFromDOMNode(a.elem,void 0));null!==a&&(a=a.getKey(),this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():xa(),this.anchorCellNodeKey=a)}$formatCells(a){let b=v.$getSelection();R(b)||E(236);let c=v.$createRangeSelection(),d=c.anchor,e=c.focus,f=b.getNodes().filter(C);0<f.length||E(237);let g=f[0].getFirstChild(),m=v.$isParagraphNode(g)?g.getFormatFlags(a,null):null;f.forEach(p=>{d.set(p.getKey(),0,"element"); | ||
e.set(p.getKey(),p.getChildrenSize(),"element");c.formatText(a,m)});v.$setSelection(b);this.editor.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0)}$clearText(){let {editor:a}=this,b=v.$getNodeByKey(this.tableNodeKey);if(!L(b))throw Error("Expected TableNode.");var c=v.$getSelection();R(c)||E(11);c=c.getNodes().filter(C);c.length===this.table.columns*this.table.rows?(b.selectPrevious(),b.remove(),v.$getRoot().selectStart()):(c.forEach(d=>{if(v.$isElementNode(d)){let e=v.$createParagraphNode(),f= | ||
v.$createTextNode();e.append(f);d.append(e);d.getChildren().forEach(g=>{g!==e&&g.remove()})}}),Aa(a,this.table,null),v.$setSelection(null),a.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0))}}function S(a,b){if(!b)return b;a="TABLE"===b.nodeName?b:a.getDOMSlot(b).element;"TABLE"!==a.nodeName&&E(245,b.nodeName);return a}function U(a,b){for(let c=b,d=null;null!==c;c=c.getParent()){if(a.is(c))return d;C(c)&&(d=c)}return null} | ||
a.x;this.anchorY=a.y;let {tableNode:b}=this.$lookup();a=U(b,v.$getNearestNodeFromDOMNode(a.elem,void 0));null!==a&&(a=a.getKey(),this.tableSelection=null!=this.tableSelection?this.tableSelection.clone():xa(),this.anchorCellNodeKey=a)}$formatCells(a){let b=v.$getSelection();R(b)||E(236);let c=v.$createRangeSelection(),d=c.anchor,f=c.focus,e=b.getNodes().filter(C);0<e.length||E(237);let g=e[0].getFirstChild(),n=v.$isParagraphNode(g)?g.getFormatFlags(a,null):null;e.forEach(r=>{d.set(r.getKey(),0,"element"); | ||
f.set(r.getKey(),r.getChildrenSize(),"element");c.formatText(a,n)});v.$setSelection(b);this.editor.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0)}$clearText(){let {editor:a}=this,b=v.$getNodeByKey(this.tableNodeKey);if(!L(b))throw Error("Expected TableNode.");var c=v.$getSelection();R(c)||E(253);c=c.getNodes().filter(C);c.length===this.table.columns*this.table.rows?(b.selectPrevious(),b.remove(),v.$getRoot().selectStart()):(c.forEach(d=>{if(v.$isElementNode(d)){let f=v.$createParagraphNode(), | ||
e=v.$createTextNode();f.append(e);d.append(f);d.getChildren().forEach(g=>{g!==f&&g.remove()})}}),Aa(a,this.table,null),v.$setSelection(null),a.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0))}}function S(a,b){if(!b)return b;a="TABLE"===b.nodeName?b:a.getDOMSlot(b).element;"TABLE"!==a.nodeName&&E(245,b.nodeName);return a}function U(a,b){for(let c=b,d=null;null!==c;c=c.getParent()){if(a.is(c))return d;C(c)&&(d=c)}return null} | ||
let Ba=[[v.KEY_ARROW_DOWN_COMMAND,"down"],[v.KEY_ARROW_UP_COMMAND,"up"],[v.KEY_ARROW_LEFT_COMMAND,"backward"],[v.KEY_ARROW_RIGHT_COMMAND,"forward"]],Ca=[v.DELETE_WORD_COMMAND,v.DELETE_LINE_COMMAND,v.DELETE_CHARACTER_COMMAND],Da=[v.KEY_BACKSPACE_COMMAND,v.KEY_DELETE_COMMAND]; | ||
function Ea(a,b,c,d){let e=c.getRootElement(),f=c._window;null!==e&&null!==f||E(246);let g=new za(c,a.getKey()),m=S(a,b);Fa(m,g);g.listenersToRemove.add(()=>{Ga(m)===g&&delete m.__lexicalTableSelection});let p=()=>{if(!g.isSelecting){var k=()=>{g.isSelecting=!1;f.removeEventListener("mouseup",k);f.removeEventListener("mousemove",l)},l=n=>{if(1!==(n.buttons&1)&&g.isSelecting)g.isSelecting=!1,f.removeEventListener("mouseup",k),f.removeEventListener("mousemove",l);else{var q=!m.contains(n.target),u= | ||
null;if(q)for(const t of document.elementsFromPoint(n.clientX,n.clientY)){if(u=m.contains(t)?Ha(t):null)break}else u=Ha(n.target);!u||null!==g.focusCell&&u.elem===g.focusCell.elem||(g.setNextFocus({focusCell:u,override:q}),c.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0))}};g.isSelecting=!0;f.addEventListener("mouseup",k,g.listenerOptions);f.addEventListener("mousemove",l,g.listenerOptions)}};m.addEventListener("mousedown",k=>{if(0===k.button&&f){var l=Ha(k.target);null!==l&&c.update(()=>{const n= | ||
v.$getPreviousSelection();if(ja&&k.shiftKey&&V(n,a)&&(v.$isRangeSelection(n)||R(n))){const q=n.anchor.getNode(),u=U(a,n.anchor.getNode());u?(g.$setAnchorCellForSelection(W(g,u)),g.$setFocusCellForSelection(l),X(k)):(a.isBefore(q)?a.selectStart():a.selectEnd()).anchor.set(n.anchor.key,n.anchor.offset,n.anchor.type)}else g.$setAnchorCellForSelection(l)});p()}},g.listenerOptions);f.addEventListener("mousedown",k=>{0===k.button&&c.update(()=>{const l=v.$getSelection(),n=k.target;R(l)&&l.tableKey===g.tableNodeKey&& | ||
e.contains(n)&&g.$clearHighlight()})},g.listenerOptions);for(let [k,l]of Ba)g.listenersToRemove.add(c.registerCommand(k,n=>Ia(c,n,l,a,g),v.COMMAND_PRIORITY_HIGH));g.listenersToRemove.add(c.registerCommand(v.KEY_ESCAPE_COMMAND,k=>{var l=v.$getSelection();return R(l)&&(l=U(a,l.focus.getNode()),null!==l)?(X(k),l.selectEnd(),!0):!1},v.COMMAND_PRIORITY_HIGH));b=k=>()=>{var l=v.$getSelection();if(!V(l,a))return!1;if(R(l))return g.$clearText(),!0;if(v.$isRangeSelection(l)){var n=U(a,l.anchor.getNode()); | ||
if(!C(n))return!1;var q=l.anchor.getNode();n=l.focus.getNode();q=a.isParentOf(q);n=a.isParentOf(n);if(q&&!n||n&&!q)return g.$clearText(),!0;n=(l=h.$findMatchingParent(l.anchor.getNode(),u=>v.$isElementNode(u)))&&h.$findMatchingParent(l,u=>v.$isElementNode(u)&&C(u.getParent()));if(!v.$isElementNode(n)||!v.$isElementNode(l))return!1;if(k===v.DELETE_LINE_COMMAND&&null===n.getPreviousSibling())return!0}return!1};for(let k of Ca)g.listenersToRemove.add(c.registerCommand(k,b(k),v.COMMAND_PRIORITY_CRITICAL)); | ||
let r=k=>{const l=v.$getSelection();if(!R(l)&&!v.$isRangeSelection(l))return!1;const n=a.isParentOf(l.anchor.getNode()),q=a.isParentOf(l.focus.getNode());if(n!==q){k=n?"focus":"anchor";const {key:u,offset:t,type:w}=l[k];a[l[n?"anchor":"focus"].isBefore(l[k])?"selectPrevious":"selectNext"]()[k].set(u,t,w);return!1}return R(l)?(k&&(k.preventDefault(),k.stopPropagation()),g.$clearText(),!0):!1};for(let k of Da)g.listenersToRemove.add(c.registerCommand(k,r,v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.CUT_COMMAND, | ||
k=>{let l=v.$getSelection();if(l){if(!R(l)&&!v.$isRangeSelection(l))return!1;void aa.copyToClipboard(c,h.objectKlassEquals(k,ClipboardEvent)?k:null,aa.$getClipboardDataFromSelection(l));k=r(k);return v.$isRangeSelection(l)?(l.removeText(),!0):k}return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FORMAT_TEXT_COMMAND,k=>{let l=v.$getSelection();if(!V(l,a))return!1;if(R(l))return g.$formatCells(k),!0;v.$isRangeSelection(l)&&(k=h.$findMatchingParent(l.anchor.getNode(), | ||
n=>C(n)),C(k));return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FORMAT_ELEMENT_COMMAND,k=>{var l=v.$getSelection();if(!R(l)||!V(l,a))return!1;var n=l.anchor.getNode();l=l.focus.getNode();if(!C(n)||!C(l))return!1;let [q,u,t]=O(a,n,l);n=Math.max(u.startRow+u.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);l=Math.max(u.startColumn+u.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1);var w=Math.min(u.startRow,t.startRow);let D=Math.min(u.startColumn,t.startColumn),z= | ||
new Set;for(;w<=n;w++)for(let G=D;G<=l;G++){var A=q[w][G].cell;if(!z.has(A)){z.add(A);A.setFormat(k);A=A.getChildren();for(let H=0;H<A.length;H++){let N=A[H];v.$isElementNode(N)&&!N.isInline()&&N.setFormat(k)}}}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.CONTROLLED_TEXT_INSERTION_COMMAND,k=>{var l=v.$getSelection();if(!V(l,a))return!1;if(R(l))g.$clearHighlight();else if(v.$isRangeSelection(l)){let n=h.$findMatchingParent(l.anchor.getNode(),q=>C(q));if(!C(n))return!1; | ||
if("string"===typeof k&&(l=Ja(c,l,a)))return La(l,a,[v.$createTextNode(k)]),!0}return!1},v.COMMAND_PRIORITY_CRITICAL));d&&g.listenersToRemove.add(c.registerCommand(v.KEY_TAB_COMMAND,k=>{var l=v.$getSelection();if(!v.$isRangeSelection(l)||!l.isCollapsed()||!V(l,a))return!1;var n=Ma(l.anchor.getNode());if(null===n||!a.is(Na(n)))return!1;X(k);a:{k=k.shiftKey?"previous":"next";l="next"===k?"getNextSibling":"getPreviousSibling";let u="next"===k?"getFirstChild":"getLastChild";var q=n[l]();if(v.$isElementNode(q))q.selectEnd(); | ||
else{n=h.$findMatchingParent(n,K);null===n&&E(247);for(q=n[l]();K(q);q=q[l]()){let t=q[u]();if(v.$isElementNode(t)){t.selectEnd();break a}}l=h.$findMatchingParent(n,L);null===l&&E(248);"next"===k?l.selectNext():l.selectPrevious()}}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FOCUS_COMMAND,()=>a.isSelected(),v.COMMAND_PRIORITY_HIGH));g.listenersToRemove.add(c.registerCommand(v.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,k=>{let {nodes:l,selection:n}=k;k=n.getStartEndPoints(); | ||
var q=R(n);q=v.$isRangeSelection(n)&&null!==h.$findMatchingParent(n.anchor.getNode(),H=>C(H))&&null!==h.$findMatchingParent(n.focus.getNode(),H=>C(H))||q;if(1!==l.length||!L(l[0])||!q||null===k)return!1;var [u]=k,t=l[0];k=t.getChildren();q=t.getFirstChildOrThrow().getChildrenSize();t=t.getChildrenSize();var w=h.$findMatchingParent(u.getNode(),H=>C(H)),D=w&&h.$findMatchingParent(w,H=>K(H)),z=D&&h.$findMatchingParent(D,H=>L(H));if(!C(w)||!K(D)||!L(z))return!1;u=D.getIndexWithinParent();var A=Math.min(z.getChildrenSize()- | ||
1,u+t-1);t=w.getIndexWithinParent();w=Math.min(D.getChildrenSize()-1,t+q-1);q=Math.min(t,w);D=Math.min(u,A);t=Math.max(t,w);u=Math.max(u,A);z=z.getChildren();for(A=0;D<=u;D++){w=z[D];if(!K(w))return!1;var G=k[A];if(!K(G))return!1;w=w.getChildren();G=G.getChildren();let H=0;for(let N=q;N<=t;N++){let P=w[N];if(!C(P))return!1;let Ka=G[H];if(!C(Ka))return!1;let Ya=P.getChildren();Ka.getChildren().forEach(ca=>{v.$isTextNode(ca)&&v.$createParagraphNode().append(ca);P.append(ca)});Ya.forEach(ca=>ca.remove()); | ||
H++}A++}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.SELECTION_CHANGE_COMMAND,()=>{let k=v.$getSelection(),l=v.$getPreviousSelection();var n=g.getAndClearNextFocus();if(null!==n){({focusCell:n}=n);if(R(k)&&k.tableKey===g.tableNodeKey){if(n.x===g.focusX&&n.y===g.focusY)return!1;g.$setFocusCellForSelection(n);return!0}if(n!==g.anchorCell&&V(k,a))return g.$setFocusCellForSelection(n),!0}if(g.getAndClearShouldCheckSelection()&&v.$isRangeSelection(l)&&v.$isRangeSelection(k)&& | ||
k.isCollapsed()){var q=k.anchor.getNode();n=a.getFirstChild();q=Ma(q);if(null!==q&&K(n)){let w=n.getFirstChild();if(C(w)&&a.is(h.$findMatchingParent(q,D=>D.is(a)||D.is(w))))return w.selectStart(),!0}}if(v.$isRangeSelection(k)){let {anchor:w,focus:D}=k;q=w.getNode();n=D.getNode();var u=Ma(q),t=Ma(n);let z=!(!u||!a.is(Na(u))),A=!(!t||!a.is(Na(t)));q=z!==A;let G=z&&A;n=k.isBackward();q?(q=k.clone(),A?([t]=O(a,t,t),u=t[0][0].cell,t=t[t.length-1].at(-1).cell,q.focus.set(n?u.getKey():t.getKey(),n?u.getChildrenSize(): | ||
t.getChildrenSize(),"element")):z&&([t]=O(a,u,u),u=t[0][0].cell,t=t[t.length-1].at(-1).cell,q.anchor.set(n?t.getKey():u.getKey(),n?t.getChildrenSize():0,"element")),v.$setSelection(q),Oa(c,g)):G&&!u.is(t)&&(g.$setAnchorCellForSelection(W(g,u)),g.$setFocusCellForSelection(W(g,t),!0))}else k&&R(k)&&k.is(l)&&k.tableKey===a.getKey()&&(n=v.getDOMSelection(f))&&n.anchorNode&&n.focusNode&&(q=(q=v.$getNearestNodeFromDOMNode(n.focusNode))&&!a.isParentOf(q),u=(u=v.$getNearestNodeFromDOMNode(n.anchorNode))&& | ||
a.isParentOf(u),q&&u&&0<n.rangeCount&&(q=v.$createRangeSelectionFromDom(n,c)))&&(q.anchor.set(a.getKey(),k.isBackward()?a.getChildrenSize():0,"element"),n.removeAllRanges(),v.$setSelection(q));if(k&&!k.is(l)&&(R(k)||R(l))&&g.tableSelection&&!g.tableSelection.is(l))return R(k)&&k.tableKey===g.tableNodeKey?g.$updateTableTableSelection(k):!R(k)&&R(l)&&l.tableKey===g.tableNodeKey&&g.$updateTableTableSelection(null),!1;g.hasHijackedSelectionStyles&&!a.isSelected()?Pa(c,g):!g.hasHijackedSelectionStyles&& | ||
a.isSelected()&&Oa(c,g);return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.INSERT_PARAGRAPH_COMMAND,()=>{var k=v.$getSelection();return v.$isRangeSelection(k)&&k.isCollapsed()&&V(k,a)?(k=Ja(c,k,a))?(La(k,a),!0):!1:!1},v.COMMAND_PRIORITY_CRITICAL));return g}function Fa(a,b){null!==Ga(a)&&E(205);a.__lexicalTableSelection=b}function Ga(a){return a.__lexicalTableSelection||null} | ||
function Ea(a,b,c,d){let f=c.getRootElement(),e=c._window;null!==f&&null!==e||E(246);let g=new za(c,a.getKey()),n=S(a,b);Fa(n,g);g.listenersToRemove.add(()=>{Ga(n)===g&&delete n.__lexicalTableSelection});let r=()=>{if(!g.isSelecting){var l=()=>{g.isSelecting=!1;e.removeEventListener("mouseup",l);e.removeEventListener("mousemove",k)},k=m=>{if(v.isDOMNode(m.target))if(1!==(m.buttons&1)&&g.isSelecting)g.isSelecting=!1,e.removeEventListener("mouseup",l),e.removeEventListener("mousemove",k);else{var q= | ||
!n.contains(m.target),u=null;if(q)for(const t of document.elementsFromPoint(m.clientX,m.clientY)){if(u=n.contains(t)?Ha(t):null)break}else u=Ha(m.target);!u||null!==g.focusCell&&u.elem===g.focusCell.elem||(g.setNextFocus({focusCell:u,override:q}),c.dispatchCommand(v.SELECTION_CHANGE_COMMAND,void 0))}};g.isSelecting=!0;e.addEventListener("mouseup",l,g.listenerOptions);e.addEventListener("mousemove",k,g.listenerOptions)}};n.addEventListener("mousedown",l=>{if(0===l.button&&v.isDOMNode(l.target)&&e){var k= | ||
Ha(l.target);null!==k&&c.update(()=>{const m=v.$getPreviousSelection();if(ja&&l.shiftKey&&V(m,a)&&(v.$isRangeSelection(m)||R(m))){const q=m.anchor.getNode(),u=U(a,m.anchor.getNode());u?(g.$setAnchorCellForSelection(W(g,u)),g.$setFocusCellForSelection(k),X(l)):(a.isBefore(q)?a.selectStart():a.selectEnd()).anchor.set(m.anchor.key,m.anchor.offset,m.anchor.type)}else g.$setAnchorCellForSelection(k)});r()}},g.listenerOptions);e.addEventListener("mousedown",l=>{const k=l.target;0===l.button&&v.isDOMNode(k)&& | ||
c.update(()=>{const m=v.$getSelection();R(m)&&m.tableKey===g.tableNodeKey&&f.contains(k)&&g.$clearHighlight()})},g.listenerOptions);for(let [l,k]of Ba)g.listenersToRemove.add(c.registerCommand(l,m=>Ia(c,m,k,a,g),v.COMMAND_PRIORITY_HIGH));g.listenersToRemove.add(c.registerCommand(v.KEY_ESCAPE_COMMAND,l=>{var k=v.$getSelection();return R(k)&&(k=U(a,k.focus.getNode()),null!==k)?(X(l),k.selectEnd(),!0):!1},v.COMMAND_PRIORITY_HIGH));b=l=>()=>{var k=v.$getSelection();if(!V(k,a))return!1;if(R(k))return g.$clearText(), | ||
!0;if(v.$isRangeSelection(k)){var m=U(a,k.anchor.getNode());if(!C(m))return!1;var q=k.anchor.getNode();m=k.focus.getNode();q=a.isParentOf(q);m=a.isParentOf(m);if(q&&!m||m&&!q)return g.$clearText(),!0;m=(k=h.$findMatchingParent(k.anchor.getNode(),u=>v.$isElementNode(u)))&&h.$findMatchingParent(k,u=>v.$isElementNode(u)&&C(u.getParent()));if(!v.$isElementNode(m)||!v.$isElementNode(k))return!1;if(l===v.DELETE_LINE_COMMAND&&null===m.getPreviousSibling())return!0}return!1};for(let l of Ca)g.listenersToRemove.add(c.registerCommand(l, | ||
b(l),v.COMMAND_PRIORITY_CRITICAL));let p=l=>{const k=v.$getSelection();if(!R(k)&&!v.$isRangeSelection(k))return!1;const m=a.isParentOf(k.anchor.getNode()),q=a.isParentOf(k.focus.getNode());if(m!==q){l=m?"focus":"anchor";const {key:u,offset:t,type:w}=k[l];a[k[m?"anchor":"focus"].isBefore(k[l])?"selectPrevious":"selectNext"]()[l].set(u,t,w);return!1}return R(k)?(l&&(l.preventDefault(),l.stopPropagation()),g.$clearText(),!0):!1};for(let l of Da)g.listenersToRemove.add(c.registerCommand(l,p,v.COMMAND_PRIORITY_CRITICAL)); | ||
g.listenersToRemove.add(c.registerCommand(v.CUT_COMMAND,l=>{let k=v.$getSelection();if(k){if(!R(k)&&!v.$isRangeSelection(k))return!1;void aa.copyToClipboard(c,h.objectKlassEquals(l,ClipboardEvent)?l:null,aa.$getClipboardDataFromSelection(k));l=p(l);return v.$isRangeSelection(k)?(k.removeText(),!0):l}return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FORMAT_TEXT_COMMAND,l=>{let k=v.$getSelection();if(!V(k,a))return!1;if(R(k))return g.$formatCells(l),!0;v.$isRangeSelection(k)&& | ||
(l=h.$findMatchingParent(k.anchor.getNode(),m=>C(m)),C(l));return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FORMAT_ELEMENT_COMMAND,l=>{var k=v.$getSelection();if(!R(k)||!V(k,a))return!1;var m=k.anchor.getNode();k=k.focus.getNode();if(!C(m)||!C(k))return!1;let [q,u,t]=O(a,m,k);m=Math.max(u.startRow+u.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);k=Math.max(u.startColumn+u.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1);var w=Math.min(u.startRow,t.startRow);let D= | ||
Math.min(u.startColumn,t.startColumn),z=new Set;for(;w<=m;w++)for(let G=D;G<=k;G++){var A=q[w][G].cell;if(!z.has(A)){z.add(A);A.setFormat(l);A=A.getChildren();for(let H=0;H<A.length;H++){let N=A[H];v.$isElementNode(N)&&!N.isInline()&&N.setFormat(l)}}}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.CONTROLLED_TEXT_INSERTION_COMMAND,l=>{var k=v.$getSelection();if(!V(k,a))return!1;if(R(k))g.$clearHighlight();else if(v.$isRangeSelection(k)){let m=h.$findMatchingParent(k.anchor.getNode(), | ||
q=>C(q));if(!C(m))return!1;if("string"===typeof l&&(k=Ja(c,k,a)))return La(k,a,[v.$createTextNode(l)]),!0}return!1},v.COMMAND_PRIORITY_CRITICAL));d&&g.listenersToRemove.add(c.registerCommand(v.KEY_TAB_COMMAND,l=>{var k=v.$getSelection();if(!v.$isRangeSelection(k)||!k.isCollapsed()||!V(k,a))return!1;var m=Ma(k.anchor.getNode());if(null===m||!a.is(Na(m)))return!1;X(l);a:{l=l.shiftKey?"previous":"next";k="next"===l?"getNextSibling":"getPreviousSibling";let u="next"===l?"getFirstChild":"getLastChild"; | ||
var q=m[k]();if(v.$isElementNode(q))q.selectEnd();else{m=h.$findMatchingParent(m,K);null===m&&E(247);for(q=m[k]();K(q);q=q[k]()){let t=q[u]();if(v.$isElementNode(t)){t.selectEnd();break a}}k=h.$findMatchingParent(m,L);null===k&&E(248);"next"===l?k.selectNext():k.selectPrevious()}}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.FOCUS_COMMAND,()=>a.isSelected(),v.COMMAND_PRIORITY_HIGH));g.listenersToRemove.add(c.registerCommand(v.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, | ||
l=>{let {nodes:k,selection:m}=l;l=m.getStartEndPoints();var q=R(m);q=v.$isRangeSelection(m)&&null!==h.$findMatchingParent(m.anchor.getNode(),H=>C(H))&&null!==h.$findMatchingParent(m.focus.getNode(),H=>C(H))||q;if(1!==k.length||!L(k[0])||!q||null===l)return!1;var [u]=l,t=k[0];l=t.getChildren();q=t.getFirstChildOrThrow().getChildrenSize();t=t.getChildrenSize();var w=h.$findMatchingParent(u.getNode(),H=>C(H)),D=w&&h.$findMatchingParent(w,H=>K(H)),z=D&&h.$findMatchingParent(D,H=>L(H));if(!C(w)||!K(D)|| | ||
!L(z))return!1;u=D.getIndexWithinParent();var A=Math.min(z.getChildrenSize()-1,u+t-1);t=w.getIndexWithinParent();w=Math.min(D.getChildrenSize()-1,t+q-1);q=Math.min(t,w);D=Math.min(u,A);t=Math.max(t,w);u=Math.max(u,A);z=z.getChildren();for(A=0;D<=u;D++){w=z[D];if(!K(w))return!1;var G=l[A];if(!K(G))return!1;w=w.getChildren();G=G.getChildren();let H=0;for(let N=q;N<=t;N++){let P=w[N];if(!C(P))return!1;let Ka=G[H];if(!C(Ka))return!1;let Ya=P.getChildren();Ka.getChildren().forEach(ca=>{v.$isTextNode(ca)&& | ||
v.$createParagraphNode().append(ca);P.append(ca)});Ya.forEach(ca=>ca.remove());H++}A++}return!0},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.SELECTION_CHANGE_COMMAND,()=>{let l=v.$getSelection(),k=v.$getPreviousSelection();var m=g.getAndClearNextFocus();if(null!==m){({focusCell:m}=m);if(R(l)&&l.tableKey===g.tableNodeKey){if(m.x===g.focusX&&m.y===g.focusY)return!1;g.$setFocusCellForSelection(m);return!0}if(m!==g.anchorCell&&V(l,a))return g.$setFocusCellForSelection(m), | ||
!0}if(g.getAndClearShouldCheckSelection()&&v.$isRangeSelection(k)&&v.$isRangeSelection(l)&&l.isCollapsed()){var q=l.anchor.getNode();m=a.getFirstChild();q=Ma(q);if(null!==q&&K(m)){let w=m.getFirstChild();if(C(w)&&a.is(h.$findMatchingParent(q,D=>D.is(a)||D.is(w))))return w.selectStart(),!0}}if(v.$isRangeSelection(l)){let {anchor:w,focus:D}=l;q=w.getNode();m=D.getNode();var u=Ma(q),t=Ma(m);let z=!(!u||!a.is(Na(u))),A=!(!t||!a.is(Na(t)));q=z!==A;let G=z&&A;m=l.isBackward();q?(q=l.clone(),A?([t]=O(a, | ||
t,t),u=t[0][0].cell,t=t[t.length-1].at(-1).cell,q.focus.set(m?u.getKey():t.getKey(),m?u.getChildrenSize():t.getChildrenSize(),"element")):z&&([t]=O(a,u,u),u=t[0][0].cell,t=t[t.length-1].at(-1).cell,q.anchor.set(m?t.getKey():u.getKey(),m?t.getChildrenSize():0,"element")),v.$setSelection(q),Oa(c,g)):G&&!u.is(t)&&(g.$setAnchorCellForSelection(W(g,u)),g.$setFocusCellForSelection(W(g,t),!0))}else l&&R(l)&&l.is(k)&&l.tableKey===a.getKey()&&(m=v.getDOMSelection(e))&&m.anchorNode&&m.focusNode&&(q=(q=v.$getNearestNodeFromDOMNode(m.focusNode))&& | ||
!a.isParentOf(q),u=(u=v.$getNearestNodeFromDOMNode(m.anchorNode))&&a.isParentOf(u),q&&u&&0<m.rangeCount&&(q=v.$createRangeSelectionFromDom(m,c)))&&(q.anchor.set(a.getKey(),l.isBackward()?a.getChildrenSize():0,"element"),m.removeAllRanges(),v.$setSelection(q));if(l&&!l.is(k)&&(R(l)||R(k))&&g.tableSelection&&!g.tableSelection.is(k))return R(l)&&l.tableKey===g.tableNodeKey?g.$updateTableTableSelection(l):!R(l)&&R(k)&&k.tableKey===g.tableNodeKey&&g.$updateTableTableSelection(null),!1;g.hasHijackedSelectionStyles&& | ||
!a.isSelected()?Pa(c,g):!g.hasHijackedSelectionStyles&&a.isSelected()&&Oa(c,g);return!1},v.COMMAND_PRIORITY_CRITICAL));g.listenersToRemove.add(c.registerCommand(v.INSERT_PARAGRAPH_COMMAND,()=>{var l=v.$getSelection();return v.$isRangeSelection(l)&&l.isCollapsed()&&V(l,a)?(l=Ja(c,l,a))?(La(l,a),!0):!1:!1},v.COMMAND_PRIORITY_CRITICAL));return g}function Fa(a,b){null!==Ga(a)&&E(205);a.__lexicalTableSelection=b}function Ga(a){return a.__lexicalTableSelection||null} | ||
function Ha(a){for(;null!=a;){let b=a.nodeName;if("TD"===b||"TH"===b){a=a._cell;if(void 0===a)break;return a}a=a.parentNode}return null} | ||
function T(a,b){var c=S(a,b);a=[];b={columns:0,domRows:a,rows:0};var d=c.querySelector("tr");let e=c=0;for(a.length=0;null!=d;){var f=d.nodeName;if("TD"===f||"TH"===f){f=d;f={elem:f,hasBackgroundColor:""!==f.style.backgroundColor,highlighted:!1,x:c,y:e};d._cell=f;let g=a[e];void 0===g&&(g=a[e]=[]);g[c]=f}else if(f=d.firstChild,null!=f){d=f;continue}f=d.nextSibling;if(null!=f)c++,d=f;else if(f=d.parentNode,null!=f){d=f.nextSibling;if(null==d)break;e++;c=0}}b.columns=c+1;b.rows=e+1;return b} | ||
function Aa(a,b,c){let d=new Set(c?c.getNodes():[]);Qa(b,(e,f)=>{let g=e.elem;d.has(f)?(e.highlighted=!0,Ra(a,e)):(e.highlighted=!1,Sa(a,e),g.getAttribute("style")||g.removeAttribute("style"))})}function Qa(a,b){({domRows:a}=a);for(let c=0;c<a.length;c++){let d=a[c];if(d)for(let e=0;e<d.length;e++){let f=d[e];if(!f)continue;let g=v.$getNearestNodeFromDOMNode(f.elem);null!==g&&b(f,g,{x:e,y:c})}}}function Oa(a,b){b.$disableHighlightStyle();Qa(b.table,c=>{c.highlighted=!0;Ra(a,c)})} | ||
function T(a,b){var c=S(a,b);a=[];b={columns:0,domRows:a,rows:0};var d=c.querySelector("tr");let f=c=0;for(a.length=0;null!=d;){var e=d.nodeName;if("TD"===e||"TH"===e){e=d;e={elem:e,hasBackgroundColor:""!==e.style.backgroundColor,highlighted:!1,x:c,y:f};d._cell=e;let g=a[f];void 0===g&&(g=a[f]=[]);g[c]=e}else if(e=d.firstChild,null!=e){d=e;continue}e=d.nextSibling;if(null!=e)c++,d=e;else if(e=d.parentNode,null!=e){d=e.nextSibling;if(null==d)break;f++;c=0}}b.columns=c+1;b.rows=f+1;return b} | ||
function Aa(a,b,c){let d=new Set(c?c.getNodes():[]);Qa(b,(f,e)=>{let g=f.elem;d.has(e)?(f.highlighted=!0,Ra(a,f)):(f.highlighted=!1,Sa(a,f),g.getAttribute("style")||g.removeAttribute("style"))})}function Qa(a,b){({domRows:a}=a);for(let c=0;c<a.length;c++){let d=a[c];if(d)for(let f=0;f<d.length;f++){let e=d[f];if(!e)continue;let g=v.$getNearestNodeFromDOMNode(e.elem);null!==g&&b(e,g,{x:f,y:c})}}}function Oa(a,b){b.$disableHighlightStyle();Qa(b.table,c=>{c.highlighted=!0;Ra(a,c)})} | ||
function Pa(a,b){b.$enableHighlightStyle();Qa(b.table,c=>{let d=c.elem;c.highlighted=!1;Sa(a,c);d.getAttribute("style")||d.removeAttribute("style")})} | ||
let Ta=(a,b,c,d,e)=>{const f="forward"===e;switch(e){case "backward":case "forward":return c!==(f?a.table.columns-1:0)?(a=b.getCellNodeFromCordsOrThrow(c+(f?1:-1),d,a.table),f?a.selectStart():a.selectEnd()):d!==(f?a.table.rows-1:0)?(a=b.getCellNodeFromCordsOrThrow(f?0:a.table.columns-1,d+(f?1:-1),a.table),f?a.selectStart():a.selectEnd()):f?b.selectNext():b.selectPrevious(),!0;case "up":return 0!==d?b.getCellNodeFromCordsOrThrow(c,d-1,a.table).selectEnd():b.selectPrevious(),!0;case "down":return d!== | ||
let Ta=(a,b,c,d,f)=>{const e="forward"===f;switch(f){case "backward":case "forward":return c!==(e?a.table.columns-1:0)?(a=b.getCellNodeFromCordsOrThrow(c+(e?1:-1),d,a.table),e?a.selectStart():a.selectEnd()):d!==(e?a.table.rows-1:0)?(a=b.getCellNodeFromCordsOrThrow(e?0:a.table.columns-1,d+(e?1:-1),a.table),e?a.selectStart():a.selectEnd()):e?b.selectNext():b.selectPrevious(),!0;case "up":return 0!==d?b.getCellNodeFromCordsOrThrow(c,d-1,a.table).selectEnd():b.selectPrevious(),!0;case "down":return d!== | ||
a.table.rows-1?b.getCellNodeFromCordsOrThrow(c,d+1,a.table).selectStart():b.selectNext(),!0;default:return!1}};function Ua(a,b){let c;if(b.startColumn===a.minColumn)c="minColumn";else if(b.startColumn+b.cell.__colSpan-1===a.maxColumn)c="maxColumn";else return null;if(b.startRow===a.minRow)a="minRow";else if(b.startRow+b.cell.__rowSpan-1===a.maxRow)a="maxRow";else return null;return[c,a]}function Va([a,b]){return["minColumn"===a?"maxColumn":"minColumn","minRow"===b?"maxRow":"minRow"]} | ||
function Y(a,b,[c,d]){let e=b[d];a=a[e];void 0===a&&E(250,d,String(e));b=b[c];d=a[b];void 0===d&&E(250,c,String(b));return d} | ||
function Wa(a,b,c,d,e){d=sa(b,c,d);let {minColumn:f,maxColumn:g,minRow:m,maxRow:p}=d;var r=1;let k=1,l=1,n=1;var q=b[m];let u=b[p];for(let P=f;P<=g;P++)r=Math.max(r,q[P].cell.__rowSpan),n=Math.max(n,u[P].cell.__rowSpan);for(q=m;q<=p;q++)k=Math.max(k,b[q][f].cell.__colSpan),l=Math.max(l,b[q][g].cell.__colSpan);let {topSpan:t,leftSpan:w,bottomSpan:D,rightSpan:z}={bottomSpan:n,leftSpan:k,rightSpan:l,topSpan:r};r=Ua(d,c);null===r&&E(249,c.cell.getKey());let [A,G]=Va(r);r=d[A];d=d[G];"forward"===e?r+= | ||
"maxColumn"===A?1:w:"backward"===e?r-="minColumn"===A?1:z:"down"===e?d+="maxRow"===G?1:t:"up"===e&&(d-="minRow"===G?1:D);e=b[d];if(void 0===e)return!1;d=e[r];if(void 0===d)return!1;e=sa(b,c,d);(c=Ua(e,c))?b=[Y(b,e,c),Y(b,e,Va(c))]:(c=Ua(e,d))?b=[Y(b,e,Va(c)),Y(b,e,c)]:(c=["minColumn","minRow"],b=[Y(b,e,c),Y(b,e,Va(c))]);let [H,N]=b;b=W(a,H.cell);c=W(a,N.cell);a.$setAnchorCellForSelection(b);a.$setFocusCellForSelection(c,!0);return!0} | ||
function Y(a,b,[c,d]){let f=b[d];a=a[f];void 0===a&&E(250,d,String(f));b=b[c];d=a[b];void 0===d&&E(250,c,String(b));return d} | ||
function Wa(a,b,c,d,f){d=sa(b,c,d);let {minColumn:e,maxColumn:g,minRow:n,maxRow:r}=d;var p=1;let l=1,k=1,m=1;var q=b[n];let u=b[r];for(let P=e;P<=g;P++)p=Math.max(p,q[P].cell.__rowSpan),m=Math.max(m,u[P].cell.__rowSpan);for(q=n;q<=r;q++)l=Math.max(l,b[q][e].cell.__colSpan),k=Math.max(k,b[q][g].cell.__colSpan);let {topSpan:t,leftSpan:w,bottomSpan:D,rightSpan:z}={bottomSpan:m,leftSpan:l,rightSpan:k,topSpan:p};p=Ua(d,c);null===p&&E(249,c.cell.getKey());let [A,G]=Va(p);p=d[A];d=d[G];"forward"===f?p+= | ||
"maxColumn"===A?1:w:"backward"===f?p-="minColumn"===A?1:z:"down"===f?d+="maxRow"===G?1:t:"up"===f&&(d-="minRow"===G?1:D);f=b[d];if(void 0===f)return!1;d=f[p];if(void 0===d)return!1;f=sa(b,c,d);(c=Ua(f,c))?b=[Y(b,f,c),Y(b,f,Va(c))]:(c=Ua(f,d))?b=[Y(b,f,Va(c)),Y(b,f,c)]:(c=["minColumn","minRow"],b=[Y(b,f,c),Y(b,f,Va(c))]);let [H,N]=b;b=W(a,H.cell);c=W(a,N.cell);a.$setAnchorCellForSelection(b);a.$setFocusCellForSelection(c,!0);return!0} | ||
function V(a,b){if(v.$isRangeSelection(a)||R(a)){let c=b.isParentOf(a.anchor.getNode());a=b.isParentOf(a.focus.getNode());return c&&a}return!1}function Ra(a,b){b=b.elem;a=a._config.theme;let c=v.$getNearestNodeFromDOMNode(b);C(c)||E(131);h.addClassNamesToElement(b,a.tableCellSelected)}function Sa(a,b){b=b.elem;let c=v.$getNearestNodeFromDOMNode(b);C(c)||E(131);h.removeClassNamesFromElement(b,a._config.theme.tableCellSelected)}function Ma(a){a=h.$findMatchingParent(a,C);return C(a)?a:null} | ||
function Na(a){a=h.$findMatchingParent(a,L);return L(a)?a:null}function Xa(a){for(let b=a,c=a;null!==c;b=c,c=c.getParent())if(v.$isElementNode(c))if(c!==b&&c.getFirstChild()!==b)break;else if(!c.isInline())return c;return null} | ||
function Ia(a,b,c,d,e){if(("up"===c||"down"===c)&&Za(a))return!1;var f=v.$getSelection();if(!V(f,d)){if(v.$isRangeSelection(f)){if("backward"===c){if(0<f.focus.offset)return!1;c=Xa(f.focus.getNode());if(!c)return!1;c=c.getPreviousSibling();if(!L(c))return!1;X(b);b.shiftKey?f.focus.set(c.getParentOrThrow().getKey(),c.getIndexWithinParent(),"element"):c.selectEnd();return!0}if(b.shiftKey&&("up"===c||"down"===c)){var g=f.focus.getNode();if(!f.isCollapsed()&&("up"===c&&!f.isBackward()||"down"===c&&f.isBackward())){e= | ||
h.$findMatchingParent(g,r=>L(r));C(e)&&(e=h.$findMatchingParent(e,L));if(e!==d||!e)return!1;d="down"===c?e.getNextSibling():e.getPreviousSibling();if(!d)return!1;e=0;"up"===c&&v.$isElementNode(d)&&(e=d.getChildrenSize());a=d;"up"===c&&v.$isElementNode(d)&&(a=(c=d.getLastChild())?c:d,e=v.$isTextNode(a)?a.getTextContentSize():0);c=f.clone();c.focus.set(a.getKey(),e,v.$isTextNode(a)?"text":"element");v.$setSelection(c);X(b);return!0}if(v.$isRootOrShadowRoot(g)){if((b="up"===c?f.getNodes()[f.getNodes().length- | ||
1]:f.getNodes()[0])&&null!==U(d,b)){c=d.getFirstDescendant();b=d.getLastDescendant();if(!c||!b)return!1;[c]=Q(c);[b]=Q(b);c=d.getCordsFromCellNode(c,e.table);b=d.getCordsFromCellNode(b,e.table);c=d.getDOMCellFromCordsOrThrow(c.x,c.y,e.table);b=d.getDOMCellFromCordsOrThrow(b.x,b.y,e.table);e.$setAnchorCellForSelection(c);e.$setFocusCellForSelection(b,!0);return!0}return!1}d=h.$findMatchingParent(g,r=>v.$isElementNode(r)&&!r.isInline());C(d)&&(d=h.$findMatchingParent(d,L));if(!d)return!1;d="down"=== | ||
c?d.getNextSibling():d.getPreviousSibling();if(L(d)&&e.tableNodeKey===d.getKey()){e=d.getFirstDescendant();a=d.getLastDescendant();if(!e||!a)return!1;[d]=Q(e);[e]=Q(a);f=f.clone();f.focus.set(("up"===c?d:e).getKey(),"up"===c?0:e.getChildrenSize(),"element");X(b);v.$setSelection(f);return!0}}}"down"===c&&$a(a)&&e.setShouldCheckSelection();return!1}if(v.$isRangeSelection(f)&&f.isCollapsed()){let {anchor:r,focus:k}=f;g=h.$findMatchingParent(r.getNode(),C);var m=h.$findMatchingParent(k.getNode(),C);if(!C(g)|| | ||
!g.is(m))return!1;m=Na(g);if(m!==d&&null!=m){var p=S(m,a.getElementByKey(m.getKey()));if(null!=p)return e.table=T(m,p),Ia(a,b,c,m,e)}if("backward"===c||"forward"===c){e=r.type;a=r.offset;m=r.getNode();if(!m)return!1;f=f.getNodes();return 1===f.length&&v.$isDecoratorNode(f[0])?!1:ab(e,a,m,c)?bb(b,m,g,d,c):!1}f=a.getElementByKey(g.__key);m=a.getElementByKey(r.key);if(null==m||null==f)return!1;if("element"===r.type)f=m.getBoundingClientRect();else{f=v.getDOMSelection(a._window);if(null===f||0===f.rangeCount)return!1; | ||
f=f.getRangeAt(0).getBoundingClientRect()}m="up"===c?g.getFirstChild():g.getLastChild();if(null==m)return!1;a=a.getElementByKey(m.__key);if(null==a)return!1;a=a.getBoundingClientRect();if("up"===c?a.top>f.top-f.height:f.bottom+f.height>a.bottom){X(b);f=d.getCordsFromCellNode(g,e.table);if(b.shiftKey)b=d.getDOMCellFromCordsOrThrow(f.x,f.y,e.table),e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(b,!0);else return Ta(e,d,f.x,f.y,c);return!0}}else if(R(f)){let {anchor:r,focus:k}=f;g=h.$findMatchingParent(r.getNode(), | ||
C);m=h.$findMatchingParent(k.getNode(),C);[p]=f.getNodes();L(p)||E(251);a=S(p,a.getElementByKey(p.getKey()));if(!C(g)||!C(m)||!L(p)||null==a)return!1;e.$updateTableTableSelection(f);f=T(p,a);a=d.getCordsFromCellNode(g,f);f=d.getDOMCellFromCordsOrThrow(a.x,a.y,f);e.$setAnchorCellForSelection(f);X(b);if(b.shiftKey){let [l,n,q]=O(d,g,m);return Wa(e,l,n,q,c)}m.selectEnd();return!0}return!1}function X(a){a.preventDefault();a.stopImmediatePropagation();a.stopPropagation()} | ||
function Ia(a,b,c,d,f){if(("up"===c||"down"===c)&&Za(a))return!1;var e=v.$getSelection();if(!V(e,d)){if(v.$isRangeSelection(e)){if("backward"===c){if(0<e.focus.offset)return!1;c=Xa(e.focus.getNode());if(!c)return!1;c=c.getPreviousSibling();if(!L(c))return!1;X(b);b.shiftKey?e.focus.set(c.getParentOrThrow().getKey(),c.getIndexWithinParent(),"element"):c.selectEnd();return!0}if(b.shiftKey&&("up"===c||"down"===c)){var g=e.focus.getNode();if(!e.isCollapsed()&&("up"===c&&!e.isBackward()||"down"===c&&e.isBackward())){f= | ||
h.$findMatchingParent(g,p=>L(p));C(f)&&(f=h.$findMatchingParent(f,L));if(f!==d||!f)return!1;d="down"===c?f.getNextSibling():f.getPreviousSibling();if(!d)return!1;f=0;"up"===c&&v.$isElementNode(d)&&(f=d.getChildrenSize());a=d;"up"===c&&v.$isElementNode(d)&&(a=(c=d.getLastChild())?c:d,f=v.$isTextNode(a)?a.getTextContentSize():0);c=e.clone();c.focus.set(a.getKey(),f,v.$isTextNode(a)?"text":"element");v.$setSelection(c);X(b);return!0}if(v.$isRootOrShadowRoot(g)){if((b="up"===c?e.getNodes()[e.getNodes().length- | ||
1]:e.getNodes()[0])&&null!==U(d,b)){c=d.getFirstDescendant();b=d.getLastDescendant();if(!c||!b)return!1;[c]=Q(c);[b]=Q(b);c=d.getCordsFromCellNode(c,f.table);b=d.getCordsFromCellNode(b,f.table);c=d.getDOMCellFromCordsOrThrow(c.x,c.y,f.table);b=d.getDOMCellFromCordsOrThrow(b.x,b.y,f.table);f.$setAnchorCellForSelection(c);f.$setFocusCellForSelection(b,!0);return!0}return!1}d=h.$findMatchingParent(g,p=>v.$isElementNode(p)&&!p.isInline());C(d)&&(d=h.$findMatchingParent(d,L));if(!d)return!1;d="down"=== | ||
c?d.getNextSibling():d.getPreviousSibling();if(L(d)&&f.tableNodeKey===d.getKey()){f=d.getFirstDescendant();a=d.getLastDescendant();if(!f||!a)return!1;[d]=Q(f);[f]=Q(a);e=e.clone();e.focus.set(("up"===c?d:f).getKey(),"up"===c?0:f.getChildrenSize(),"element");X(b);v.$setSelection(e);return!0}}}"down"===c&&$a(a)&&f.setShouldCheckSelection();return!1}if(v.$isRangeSelection(e)&&e.isCollapsed()){let {anchor:p,focus:l}=e;g=h.$findMatchingParent(p.getNode(),C);var n=h.$findMatchingParent(l.getNode(),C);if(!C(g)|| | ||
!g.is(n))return!1;n=Na(g);if(n!==d&&null!=n){var r=S(n,a.getElementByKey(n.getKey()));if(null!=r)return f.table=T(n,r),Ia(a,b,c,n,f)}if("backward"===c||"forward"===c){f=p.type;a=p.offset;n=p.getNode();if(!n)return!1;e=e.getNodes();return 1===e.length&&v.$isDecoratorNode(e[0])?!1:ab(f,a,n,c)?bb(b,n,g,d,c):!1}e=a.getElementByKey(g.__key);n=a.getElementByKey(p.key);if(null==n||null==e)return!1;if("element"===p.type)e=n.getBoundingClientRect();else{e=v.getDOMSelection(a._window);if(null===e||0===e.rangeCount)return!1; | ||
e=e.getRangeAt(0).getBoundingClientRect()}n="up"===c?g.getFirstChild():g.getLastChild();if(null==n)return!1;a=a.getElementByKey(n.__key);if(null==a)return!1;a=a.getBoundingClientRect();if("up"===c?a.top>e.top-e.height:e.bottom+e.height>a.bottom){X(b);e=d.getCordsFromCellNode(g,f.table);if(b.shiftKey)b=d.getDOMCellFromCordsOrThrow(e.x,e.y,f.table),f.$setAnchorCellForSelection(b),f.$setFocusCellForSelection(b,!0);else return Ta(f,d,e.x,e.y,c);return!0}}else if(R(e)){let {anchor:p,focus:l}=e;g=h.$findMatchingParent(p.getNode(), | ||
C);n=h.$findMatchingParent(l.getNode(),C);[r]=e.getNodes();L(r)||E(251);a=S(r,a.getElementByKey(r.getKey()));if(!C(g)||!C(n)||!L(r)||null==a)return!1;f.$updateTableTableSelection(e);e=T(r,a);a=d.getCordsFromCellNode(g,e);e=d.getDOMCellFromCordsOrThrow(a.x,a.y,e);f.$setAnchorCellForSelection(e);X(b);if(b.shiftKey){let [k,m,q]=O(d,g,n);return Wa(f,k,m,q,c)}n.selectEnd();return!0}return!1}function X(a){a.preventDefault();a.stopImmediatePropagation();a.stopPropagation()} | ||
function Za(a){return(a=a.getRootElement())?a.hasAttribute("aria-controls")&&"typeahead-menu"===a.getAttribute("aria-controls"):!1}function ab(a,b,c,d){return"element"===a&&("backward"===d?null===c.getPreviousSibling():null===c.getNextSibling())||cb(a,b,c,d)} | ||
function cb(a,b,c,d){let e=h.$findMatchingParent(c,f=>v.$isElementNode(f)&&!f.isInline());if(!e)return!1;b="backward"===d?0===b:b===c.getTextContentSize();return"text"===a&&b&&("backward"===d?null===e.getPreviousSibling():null===e.getNextSibling())} | ||
function bb(a,b,c,d,e){let [f,g]=O(d,c,c);c=f[0][0];let m=f[f.length-1][f[0].length-1],{startColumn:p,startRow:r}=g;if("backward"===e?p!==c.startColumn||r!==c.startRow:p!==m.startColumn||r!==m.startRow)return!1;b=db(b,e,d);if(!b||L(b))return!1;X(a);"backward"===e?b.selectEnd():b.selectStart();return!0} | ||
function cb(a,b,c,d){let f=h.$findMatchingParent(c,e=>v.$isElementNode(e)&&!e.isInline());if(!f)return!1;b="backward"===d?0===b:b===c.getTextContentSize();return"text"===a&&b&&("backward"===d?null===f.getPreviousSibling():null===f.getNextSibling())} | ||
function bb(a,b,c,d,f){let [e,g]=O(d,c,c);c=e[0][0];let n=e[e.length-1][e[0].length-1],{startColumn:r,startRow:p}=g;if("backward"===f?r!==c.startColumn||p!==c.startRow:r!==n.startColumn||p!==n.startRow)return!1;b=db(b,f,d);if(!b||L(b))return!1;X(a);"backward"===f?b.selectEnd():b.selectStart();return!0} | ||
function db(a,b,c){if(a=h.$findMatchingParent(a,d=>v.$isElementNode(d)&&!d.isInline()))return(a="backward"===b?a.getPreviousSibling():a.getNextSibling())&&L(a)?a:"backward"===b?c.getPreviousSibling():c.getNextSibling()}function La(a,b,c){let d=v.$createParagraphNode();"first"===a?b.insertBefore(d):b.insertAfter(d);d.append(...(c||[]));d.selectEnd()} | ||
function Ja(a,b,c){var d=c.getParent();if(d){var e=v.getDOMSelection(a._window);if(e&&(e=e.anchorNode,d=a.getElementByKey(d.getKey()),a=S(c,a.getElementByKey(c.getKey())),e&&d&&a&&d.contains(e)&&!a.contains(e)&&(b=h.$findMatchingParent(b.anchor.getNode(),r=>C(r))))&&(a=h.$findMatchingParent(b,r=>L(r)),L(a)&&a.is(c))){var [f,g]=O(c,b,b);c=f[0][0];b=f[f.length-1][f[0].length-1];var {startRow:m,startColumn:p}=g;if(m===c.startRow&&p===c.startColumn)return"first";if(m===b.startRow&&p===b.startColumn)return"last"}}} | ||
function W(a,b){let {tableNode:c}=a.$lookup();b=c.getCordsFromCellNode(b,a.table);return c.getDOMCellFromCordsOrThrow(b.x,b.y,a.table)}function eb(a,b,c,d){if(a=a.querySelector("colgroup")){b=[];for(let e=0;e<c;e++){let f=document.createElement("col"),g=d&&d[e];g&&(f.style.width=`${g}px`);b.push(f)}a.replaceChildren(...b)}} | ||
function Ja(a,b,c){var d=c.getParent();if(d){var f=v.getDOMSelection(a._window);if(f&&(f=f.anchorNode,d=a.getElementByKey(d.getKey()),a=S(c,a.getElementByKey(c.getKey())),f&&d&&a&&d.contains(f)&&!a.contains(f)&&(b=h.$findMatchingParent(b.anchor.getNode(),p=>C(p))))&&(a=h.$findMatchingParent(b,p=>L(p)),L(a)&&a.is(c))){var [e,g]=O(c,b,b);c=e[0][0];b=e[e.length-1][e[0].length-1];var {startRow:n,startColumn:r}=g;if(n===c.startRow&&r===c.startColumn)return"first";if(n===b.startRow&&r===b.startColumn)return"last"}}} | ||
function W(a,b){let {tableNode:c}=a.$lookup();b=c.getCordsFromCellNode(b,a.table);return c.getDOMCellFromCordsOrThrow(b.x,b.y,a.table)}function eb(a,b,c,d){if(a=a.querySelector("colgroup")){b=[];for(let f=0;f<c;f++){let e=document.createElement("col"),g=d&&d[f];g&&(e.style.width=`${g}px`);b.push(e)}a.replaceChildren(...b)}} | ||
function fb(a,b,c){c?(h.addClassNamesToElement(a,b.theme.tableRowStriping),a.setAttribute("data-lexical-row-striping","true")):(h.removeClassNamesFromElement(a,b.theme.tableRowStriping),a.removeAttribute("data-lexical-row-striping"))}let gb=new WeakSet;function $a(a=v.$getEditor()){return gb.has(a)} | ||
@@ -98,31 +98,31 @@ class Z extends v.ElementNode{static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(a){let b=this.getWritable();b.__colWidths=a;return b}static clone(a){return new Z(a.__key)}afterCloneFrom(a){super.afterCloneFrom(a);this.__colWidths=a.__colWidths;this.__rowStriping=a.__rowStriping}static importDOM(){return{table:()=>({conversion:hb,priority:1})}}static importJSON(a){let b=la();b.__rowStriping=a.rowStriping||!1;b.__colWidths=a.colWidths;return b}constructor(a){super(a); | ||
this.getColWidths());v.setDOMUnmanaged(d);h.addClassNamesToElement(c,a.theme.table);this.__rowStriping&&fb(c,a,!0);return $a(b)?(b=document.createElement("div"),(a=a.theme.tableScrollableWrapper)?h.addClassNamesToElement(b,a):b.style.cssText="overflow-x: auto;",b.appendChild(c),b):c}updateDOM(a,b,c){a.__rowStriping!==this.__rowStriping&&fb(b,c,this.__rowStriping);eb(b,c,this.getColumnCount(),this.getColWidths());return!1}exportDOM(a){let b=super.exportDOM(a);({element:a}=b);return{after:c=>{b.after&& | ||
(c=b.after(c));c&&h.isHTMLElement(c)&&"TABLE"!==c.nodeName&&(c=c.querySelector("table"));if(!c||!h.isHTMLElement(c))return null;var [d]=ra(this,null,null),e=new Map;for(var f of d)for(var g of f)d=g.cell.getKey(),e.has(d)||e.set(d,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn});let m=new Set;for(var p of c.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]"))if(g=p.getAttribute("data-temporary-table-cell-lexical-key"))if(f=e.get(g),p.removeAttribute("data-temporary-table-cell-lexical-key"), | ||
f)for(e.delete(g),g=0;g<f.colSpan;g++)m.add(g+f.startColumn);if(e=c.querySelector(":scope > colgroup"))p=Array.from(c.querySelectorAll(":scope > colgroup > col")).filter((r,k)=>m.has(k)),e.replaceChildren(...p);e=c.querySelectorAll(":scope > tr");if(0<e.length){p=document.createElement("tbody");for(let r of e)p.appendChild(r);c.append(p)}return c},element:a&&h.isHTMLElement(a)&&"TABLE"!==a.nodeName?a.querySelector("table"):a}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(a,b){let {rows:c, | ||
domRows:d}=b;for(b=0;b<c;b++){let f=d[b];if(null!=f)for(let g=0;g<f.length;g++){var e=f[g];if(null!=e&&({elem:e}=e,e=U(this,v.$getNearestNodeFromDOMNode(e,void 0)),null!==e&&a.is(e)))return{x:g,y:b}}}throw Error("Cell not found in table.");}getDOMCellFromCords(a,b,c){({domRows:c}=c);b=c[b];if(null==b)return null;a=b[a<b.length?a:b.length-1];return null==a?null:a}getDOMCellFromCordsOrThrow(a,b,c){a=this.getDOMCellFromCords(a,b,c);if(!a)throw Error("Cell not found at cords.");return a}getCellNodeFromCords(a, | ||
(c=b.after(c));h.isHTMLElement(c)&&"TABLE"!==c.nodeName&&(c=c.querySelector("table"));if(!h.isHTMLElement(c))return null;var [d]=ra(this,null,null),f=new Map;for(var e of d)for(var g of e)d=g.cell.getKey(),f.has(d)||f.set(d,{colSpan:g.cell.getColSpan(),startColumn:g.startColumn});let n=new Set;for(var r of c.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]"))if(g=r.getAttribute("data-temporary-table-cell-lexical-key"))if(e=f.get(g),r.removeAttribute("data-temporary-table-cell-lexical-key"), | ||
e)for(f.delete(g),g=0;g<e.colSpan;g++)n.add(g+e.startColumn);if(f=c.querySelector(":scope > colgroup"))r=Array.from(c.querySelectorAll(":scope > colgroup > col")).filter((p,l)=>n.has(l)),f.replaceChildren(...r);f=c.querySelectorAll(":scope > tr");if(0<f.length){r=document.createElement("tbody");for(let p of f)r.appendChild(p);c.append(r)}return c},element:h.isHTMLElement(a)&&"TABLE"!==a.nodeName?a.querySelector("table"):a}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(a,b){let {rows:c, | ||
domRows:d}=b;for(b=0;b<c;b++){let e=d[b];if(null!=e)for(let g=0;g<e.length;g++){var f=e[g];if(null!=f&&({elem:f}=f,f=U(this,v.$getNearestNodeFromDOMNode(f,void 0)),null!==f&&a.is(f)))return{x:g,y:b}}}throw Error("Cell not found in table.");}getDOMCellFromCords(a,b,c){({domRows:c}=c);b=c[b];if(null==b)return null;a=b[a<b.length?a:b.length-1];return null==a?null:a}getDOMCellFromCordsOrThrow(a,b,c){a=this.getDOMCellFromCords(a,b,c);if(!a)throw Error("Cell not found at cords.");return a}getCellNodeFromCords(a, | ||
b,c){a=this.getDOMCellFromCords(a,b,c);if(null==a)return null;a=v.$getNearestNodeFromDOMNode(a.elem);return C(a)?a:null}getCellNodeFromCordsOrThrow(a,b,c){a=this.getCellNodeFromCords(a,b,c);if(!a)throw Error("Node at cords not TableCellNode.");return a}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(a){this.getWritable().__rowStriping=a}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let a=this.getFirstChild();if(!a)return 0;let b=0;a.getChildren().forEach(c=> | ||
{C(c)&&(b+=c.getColSpan())});return b}}function hb(a){let b=la();a.hasAttribute("data-lexical-row-striping")&&b.setRowStriping(!0);var c=a.querySelector(":scope > colgroup");if(c){a=[];for(let d of c.querySelectorAll(":scope > col")){c=d.style.width;if(!c||!ba.test(c)){a=void 0;break}a.push(parseFloat(c))}a&&b.setColWidths(a)}return{after:d=>h.$descendantsMatching(d,K),node:b}}function la(){return v.$applyNodeReplacement(new Z)}function L(a){return a instanceof Z} | ||
function ib({rows:a,columns:b,includeHeaders:c}){a=ka(Number(a),Number(b),c);h.$insertNodeToNearestRoot(a);a=a.getFirstDescendant();v.$isTextNode(a)&&a.select();return!0}function jb(a){K(a.getParent())?a.isEmpty()&&a.append(v.$createParagraphNode()):a.remove()}function kb(a){L(a.getParent())?h.$unwrapAndFilterDescendants(a,C):a.remove()} | ||
function lb(a){h.$unwrapAndFilterDescendants(a,K);let [b]=ra(a,null,null),c=b.reduce((e,f)=>Math.max(e,f.length),0);a=a.getChildren();for(let e=0;e<b.length;++e){let f=a[e];if(f){K(f)||E(253,f.constructor.name,f.getType());var d=b[e].reduce((g,m)=>m?1+g:g,0);if(d!==c)for(;d<c;++d){let g=B();g.append(v.$createParagraphNode());f.append(g)}}}}exports.$computeTableMap=O;exports.$computeTableMapSkipCellCheck=ra;exports.$createTableCellNode=B;exports.$createTableNode=la; | ||
exports.$createTableNodeWithDimensions=ka;exports.$createTableRowNode=J;exports.$createTableSelection=xa;exports.$deleteTableColumn=function(a,b){let c=a.getChildren();for(let e=0;e<c.length;e++){var d=c[e];if(K(d)){d=d.getChildren();if(b>=d.length||0>b)throw Error("Table column target index out of range");d[b].remove()}}return a}; | ||
exports.$deleteTableColumn__EXPERIMENTAL=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);var b=a.anchor.getNode();a=a.focus.getNode();let [c,,d]=Q(b);var [e]=Q(a);let [f,g,m]=O(d,c,e);var {startColumn:p}=g;let {startRow:r,startColumn:k}=m;b=Math.min(p,k);var l=Math.max(p+c.__colSpan-1,k+e.__colSpan-1);a=l-b+1;if(f[0].length===l-b+1)d.selectPrevious(),d.remove();else{var n=f.length;for(let q=0;q<n;q++)for(let u=b;u<=l;u++){let {cell:t,startColumn:w}=f[q][u];w<b?u===b&&t.setColSpan(t.__colSpan- | ||
Math.min(a,t.__colSpan-(b-w))):w+t.__colSpan-1>l?u===l&&t.setColSpan(t.__colSpan-(l-w+1)):t.remove()}l=f[r];e=p>k?l[p+c.__colSpan]:l[k+e.__colSpan];void 0!==e?({cell:p}=e,M(p)):({cell:p}=k<p?l[k-1]:l[p-1],M(p));if(p=d.getColWidths())p=[...p],p.splice(b,a),d.setColWidths(p)}}; | ||
exports.$deleteTableRow__EXPERIMENTAL=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);let [b,c]=a.isBackward()?[a.focus.getNode(),a.anchor.getNode()]:[a.anchor.getNode(),a.focus.getNode()],[d,,e]=Q(b);var [f]=Q(c);let [g,m,p]=O(e,d,f);({startRow:a}=m);var {startRow:r}=p;f=r+f.__rowSpan-1;if(g.length===f-a+1)e.remove();else{r=g[0].length;var k=d.__rowSpan,l=g[f+1],n=e.getChildAtIndex(f+1);for(let u=f;u>=a;u--){for(var q=r-1;0<=q;q--){let {cell:t,startRow:w,startColumn:D}=g[u][q]; | ||
if(D===q&&(u===a&&w<a&&t.setRowSpan(t.__rowSpan-Math.min(k,t.__rowSpan-(a-w))),w>=a&&w+t.__rowSpan-1>f)){t.setRowSpan(t.__rowSpan-(f-w+1));null===n&&E(122);let z=null;for(let A=0;A<q;A++){let G=l[A],H=G.cell;G.startRow===u+1&&(z=H);1<H.__colSpan&&(A+=H.__colSpan-1)}null===z?qa(n,t):z.insertAfter(t)}}q=e.getChildAtIndex(u);K(q)||E(206,String(u));q.remove()}void 0!==l?({cell:a}=l[0],M(a)):({cell:a}=g[a-1][0],M(a))}};exports.$findCellNode=Ma;exports.$findTableNode=Na; | ||
function lb(a){h.$unwrapAndFilterDescendants(a,K);let [b]=ra(a,null,null),c=b.reduce((f,e)=>Math.max(f,e.length),0);a=a.getChildren();for(let f=0;f<b.length;++f){let e=a[f];if(e){K(e)||E(254,e.constructor.name,e.getType());var d=b[f].reduce((g,n)=>n?1+g:g,0);if(d!==c)for(;d<c;++d){let g=B();g.append(v.$createParagraphNode());e.append(g)}}}}exports.$computeTableMap=O;exports.$computeTableMapSkipCellCheck=ra;exports.$createTableCellNode=B;exports.$createTableNode=la; | ||
exports.$createTableNodeWithDimensions=ka;exports.$createTableRowNode=J;exports.$createTableSelection=xa;exports.$deleteTableColumn=function(a,b){let c=a.getChildren();for(let f=0;f<c.length;f++){var d=c[f];if(K(d)){d=d.getChildren();if(b>=d.length||0>b)throw Error("Table column target index out of range");d[b].remove()}}return a}; | ||
exports.$deleteTableColumn__EXPERIMENTAL=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);var b=a.anchor.getNode();a=a.focus.getNode();let [c,,d]=Q(b);var [f]=Q(a);let [e,g,n]=O(d,c,f);var {startColumn:r}=g;let {startRow:p,startColumn:l}=n;b=Math.min(r,l);var k=Math.max(r+c.__colSpan-1,l+f.__colSpan-1);a=k-b+1;if(e[0].length===k-b+1)d.selectPrevious(),d.remove();else{var m=e.length;for(let q=0;q<m;q++)for(let u=b;u<=k;u++){let {cell:t,startColumn:w}=e[q][u];w<b?u===b&&t.setColSpan(t.__colSpan- | ||
Math.min(a,t.__colSpan-(b-w))):w+t.__colSpan-1>k?u===k&&t.setColSpan(t.__colSpan-(k-w+1)):t.remove()}k=e[p];f=r>l?k[r+c.__colSpan]:k[l+f.__colSpan];void 0!==f?({cell:r}=f,M(r)):({cell:r}=l<r?k[l-1]:k[r-1],M(r));if(r=d.getColWidths())r=[...r],r.splice(b,a),d.setColWidths(r)}}; | ||
exports.$deleteTableRow__EXPERIMENTAL=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);let [b,c]=a.isBackward()?[a.focus.getNode(),a.anchor.getNode()]:[a.anchor.getNode(),a.focus.getNode()],[d,,f]=Q(b);var [e]=Q(c);let [g,n,r]=O(f,d,e);({startRow:a}=n);var {startRow:p}=r;e=p+e.__rowSpan-1;if(g.length===e-a+1)f.remove();else{p=g[0].length;var l=d.__rowSpan,k=g[e+1],m=f.getChildAtIndex(e+1);for(let u=e;u>=a;u--){for(var q=p-1;0<=q;q--){let {cell:t,startRow:w,startColumn:D}=g[u][q]; | ||
if(D===q&&(u===a&&w<a&&t.setRowSpan(t.__rowSpan-Math.min(l,t.__rowSpan-(a-w))),w>=a&&w+t.__rowSpan-1>e)){t.setRowSpan(t.__rowSpan-(e-w+1));null===m&&E(122);let z=null;for(let A=0;A<q;A++){let G=k[A],H=G.cell;G.startRow===u+1&&(z=H);1<H.__colSpan&&(A+=H.__colSpan-1)}null===z?qa(m,t):z.insertAfter(t)}}q=f.getChildAtIndex(u);K(q)||E(206,String(u));q.remove()}void 0!==k?({cell:a}=k[0],M(a)):({cell:a}=g[a-1][0],M(a))}};exports.$findCellNode=Ma;exports.$findTableNode=Na; | ||
exports.$getElementForTableNode=function(a,b){a=a.getElementByKey(b.getKey());null===a&&E(230);return T(b,a)};exports.$getNodeTriplet=Q;exports.$getTableAndElementByKey=ya;exports.$getTableCellNodeFromLexicalNode=function(a){a=h.$findMatchingParent(a,b=>C(b));return C(a)?a:null};exports.$getTableCellNodeRect=ta;exports.$getTableColumnIndexFromTableCellNode=function(a){return ma(a).getChildren().findIndex(b=>b.is(a))};exports.$getTableNodeFromLexicalNodeOrThrow=na; | ||
exports.$getTableRowIndexFromTableCellNode=function(a){let b=ma(a);return na(b).getChildren().findIndex(c=>c.is(b))};exports.$getTableRowNodeFromTableCellNodeOrThrow=ma; | ||
exports.$insertTableColumn=function(a,b,c=!0,d,e){let f=a.getChildren(),g=[];for(let r=0;r<f.length;r++){let k=f[r];if(K(k))for(let l=0;l<d;l++){var m=k.getChildren();if(b>=m.length||0>b)throw Error("Table column target index out of range");m=m[b];C(m)||E(12);let {left:n,right:q}=oa(m,e);var p=x.NO_STATUS;if(n&&n.hasHeaderState(x.ROW)||q&&q.hasHeaderState(x.ROW))p|=x.ROW;p=B(p);p.append(v.$createParagraphNode());g.push({newTableCell:p,targetCell:m})}}g.forEach(({newTableCell:r,targetCell:k})=>{c? | ||
k.insertAfter(r):k.insertBefore(r)});return a}; | ||
exports.$insertTableColumn__EXPERIMENTAL=function(a=!0){function b(l=x.NO_STATUS){l=B(l).append(v.$createParagraphNode());null===r&&(r=l);return l}var c=v.$getSelection();v.$isRangeSelection(c)||R(c)||E(188);var d=c.anchor.getNode();c=c.focus.getNode();[d]=Q(d);let [e,,f]=Q(c),[g,m,p]=O(f,e,d);d=g.length;c=a?Math.max(m.startColumn,p.startColumn):Math.min(m.startColumn,p.startColumn);a=a?c+e.__colSpan-1:c-1;c=f.getFirstChild();K(c)||E(120);let r=null;var k=c;a:for(c=0;c<d;c++){0!==c&&(k=k.getNextSibling(), | ||
K(k)||E(121));let l=g[c],n=pa(l[0>a?0:a].cell.__headerState,x.ROW);if(0>a){qa(k,b(n));continue}let {cell:q,startColumn:u,startRow:t}=l[a];if(u+q.__colSpan-1<=a){let w=q,D=t,z=a;for(;D!==c&&1<w.__rowSpan;)if(z-=q.__colSpan,0<=z){let {cell:A,startRow:G}=l[z];w=A;D=G}else{k.append(b(n));continue a}w.insertAfter(b(n))}else q.setColSpan(q.__colSpan+1)}null!==r&&M(r);if(d=f.getColWidths())d=[...d],a=0>a?0:a,d.splice(a,0,d[a]),f.setColWidths(d);return r}; | ||
exports.$insertTableRow=function(a,b,c=!0,d,e){var f=a.getChildren();if(b>=f.length||0>b)throw Error("Table row target index out of range");b=f[b];if(K(b))for(f=0;f<d;f++){let m=b.getChildren(),p=m.length,r=J();for(let k=0;k<p;k++){var g=m[k];C(g)||E(12);let {above:l,below:n}=oa(g,e);g=x.NO_STATUS;let q=l&&l.getWidth()||n&&n.getWidth()||void 0;if(l&&l.hasHeaderState(x.COLUMN)||n&&n.hasHeaderState(x.COLUMN))g|=x.COLUMN;g=B(g,1,q);g.append(v.$createParagraphNode());r.append(g)}c?b.insertAfter(r):b.insertBefore(r)}else throw Error("Row before insertion index does not exist."); | ||
exports.$insertTableColumn=function(a,b,c=!0,d,f){let e=a.getChildren(),g=[];for(let p=0;p<e.length;p++){let l=e[p];if(K(l))for(let k=0;k<d;k++){var n=l.getChildren();if(b>=n.length||0>b)throw Error("Table column target index out of range");n=n[b];C(n)||E(12);let {left:m,right:q}=oa(n,f);var r=x.NO_STATUS;if(m&&m.hasHeaderState(x.ROW)||q&&q.hasHeaderState(x.ROW))r|=x.ROW;r=B(r);r.append(v.$createParagraphNode());g.push({newTableCell:r,targetCell:n})}}g.forEach(({newTableCell:p,targetCell:l})=>{c? | ||
l.insertAfter(p):l.insertBefore(p)});return a}; | ||
exports.$insertTableColumn__EXPERIMENTAL=function(a=!0){function b(k=x.NO_STATUS){k=B(k).append(v.$createParagraphNode());null===p&&(p=k);return k}var c=v.$getSelection();v.$isRangeSelection(c)||R(c)||E(188);var d=c.anchor.getNode();c=c.focus.getNode();[d]=Q(d);let [f,,e]=Q(c),[g,n,r]=O(e,f,d);d=g.length;c=a?Math.max(n.startColumn,r.startColumn):Math.min(n.startColumn,r.startColumn);a=a?c+f.__colSpan-1:c-1;c=e.getFirstChild();K(c)||E(120);let p=null;var l=c;a:for(c=0;c<d;c++){0!==c&&(l=l.getNextSibling(), | ||
K(l)||E(121));let k=g[c],m=pa(k[0>a?0:a].cell.__headerState,x.ROW);if(0>a){qa(l,b(m));continue}let {cell:q,startColumn:u,startRow:t}=k[a];if(u+q.__colSpan-1<=a){let w=q,D=t,z=a;for(;D!==c&&1<w.__rowSpan;)if(z-=q.__colSpan,0<=z){let {cell:A,startRow:G}=k[z];w=A;D=G}else{l.append(b(m));continue a}w.insertAfter(b(m))}else q.setColSpan(q.__colSpan+1)}null!==p&&M(p);if(d=e.getColWidths())d=[...d],a=0>a?0:a,d.splice(a,0,d[a]),e.setColWidths(d);return p}; | ||
exports.$insertTableRow=function(a,b,c=!0,d,f){var e=a.getChildren();if(b>=e.length||0>b)throw Error("Table row target index out of range");b=e[b];if(K(b))for(e=0;e<d;e++){let n=b.getChildren(),r=n.length,p=J();for(let l=0;l<r;l++){var g=n[l];C(g)||E(12);let {above:k,below:m}=oa(g,f);g=x.NO_STATUS;let q=k&&k.getWidth()||m&&m.getWidth()||void 0;if(k&&k.hasHeaderState(x.COLUMN)||m&&m.hasHeaderState(x.COLUMN))g|=x.COLUMN;g=B(g,1,q);g.append(v.$createParagraphNode());p.append(g)}c?b.insertAfter(p):b.insertBefore(p)}else throw Error("Row before insertion index does not exist."); | ||
return a}; | ||
exports.$insertTableRow__EXPERIMENTAL=function(a=!0){var b=v.$getSelection();v.$isRangeSelection(b)||R(b)||E(188);b=b.focus.getNode();let [c,,d]=Q(b),[e,f]=O(d,c,c);b=e[0].length;var {startRow:g}=f;if(a){a=g+c.__rowSpan-1;var m=e[a];g=J();for(var p=0;p<b;p++){let {cell:k,startRow:l}=m[p];if(l+k.__rowSpan-1<=a){var r=pa(m[p].cell.__headerState,x.COLUMN);g.append(B(r).append(v.$createParagraphNode()))}else k.setRowSpan(k.__rowSpan+1)}b=d.getChildAtIndex(a);K(b)||E(145);b.insertAfter(g);b=g}else{m=e[g]; | ||
a=J();for(p=0;p<b;p++){let {cell:k,startRow:l}=m[p];l===g?(r=pa(m[p].cell.__headerState,x.COLUMN),a.append(B(r).append(v.$createParagraphNode()))):k.setRowSpan(k.__rowSpan+1)}b=d.getChildAtIndex(g);K(b)||E(145);b.insertBefore(a);b=a}return b};exports.$isScrollableTablesActive=$a;exports.$isTableCellNode=C;exports.$isTableNode=L;exports.$isTableRowNode=K;exports.$isTableSelection=R; | ||
exports.$insertTableRow__EXPERIMENTAL=function(a=!0){var b=v.$getSelection();v.$isRangeSelection(b)||R(b)||E(188);var c=b.anchor.getNode(),d=b.focus.getNode();[b]=Q(c);let [f,,e]=Q(d),[g,n,r]=O(e,f,b);c=g[0].length;({startRow:d}=r);var {startRow:p}=n;if(a){b=Math.max(p+f.__rowSpan,d+b.__rowSpan)-1;d=g[b];a=J();for(p=0;p<c;p++){let {cell:k,startRow:m}=d[p];if(m+k.__rowSpan-1<=b){var l=pa(d[p].cell.__headerState,x.COLUMN);a.append(B(l).append(v.$createParagraphNode()))}else k.setRowSpan(k.__rowSpan+1)}c= | ||
e.getChildAtIndex(b);K(c)||E(256);c.insertAfter(a);c=a}else{b=Math.min(p,d);d=g[b];a=J();for(p=0;p<c;p++){let {cell:k,startRow:m}=d[p];m===b?(l=pa(d[p].cell.__headerState,x.COLUMN),a.append(B(l).append(v.$createParagraphNode()))):k.setRowSpan(k.__rowSpan+1)}c=e.getChildAtIndex(b);K(c)||E(257);c.insertBefore(a);c=a}return c};exports.$isScrollableTablesActive=$a;exports.$isTableCellNode=C;exports.$isTableNode=L;exports.$isTableRowNode=K;exports.$isTableSelection=R; | ||
exports.$removeTableRowAtIndex=function(a,b){let c=a.getChildren();if(b>=c.length||0>b)throw Error("Expected table cell to be inside of table row.");c[b].remove();return a}; | ||
exports.$unmergeCell=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);a=a.anchor.getNode();let [b,c,d]=Q(a);a=b.__colSpan;let e=b.__rowSpan;if(1!==a||1!==e){var [f,g]=O(d,b,b),{startColumn:m,startRow:p}=g,r=b.__headerState&x.COLUMN,k=Array.from({length:a},(w,D)=>{w=r;for(let z=0;0!==w&&z<f.length;z++)w&=f[z][D+m].cell.__headerState;return w}),l=b.__headerState&x.ROW,n=Array.from({length:e},(w,D)=>{w=l;for(let z=0;0!==w&&z<f[0].length;z++)w&=f[D+p][z].cell.__headerState;return w}); | ||
if(1<a){for(var q=1;q<a;q++)b.insertAfter(B(k[q]|n[0]).append(v.$createParagraphNode()));b.setColSpan(1)}if(1<e){let w;for(q=1;q<e;q++){var u=p+q;let D=f[u];w=(w||c).getNextSibling();K(w)||E(125);var t=null;for(let z=0;z<m;z++){let A=D[z],G=A.cell;A.startRow===u&&(t=G);1<G.__colSpan&&(z+=G.__colSpan-1)}if(null===t)for(t=a-1;0<=t;t--)qa(w,B(k[t]|n[q]).append(v.$createParagraphNode()));else for(u=a-1;0<=u;u--)t.insertAfter(B(k[u]|n[q]).append(v.$createParagraphNode()))}b.setRowSpan(1)}}}; | ||
exports.$unmergeCell=function(){var a=v.$getSelection();v.$isRangeSelection(a)||R(a)||E(188);a=a.anchor.getNode();let [b,c,d]=Q(a);a=b.__colSpan;let f=b.__rowSpan;if(1!==a||1!==f){var [e,g]=O(d,b,b),{startColumn:n,startRow:r}=g,p=b.__headerState&x.COLUMN,l=Array.from({length:a},(w,D)=>{w=p;for(let z=0;0!==w&&z<e.length;z++)w&=e[z][D+n].cell.__headerState;return w}),k=b.__headerState&x.ROW,m=Array.from({length:f},(w,D)=>{w=k;for(let z=0;0!==w&&z<e[0].length;z++)w&=e[D+r][z].cell.__headerState;return w}); | ||
if(1<a){for(var q=1;q<a;q++)b.insertAfter(B(l[q]|m[0]).append(v.$createParagraphNode()));b.setColSpan(1)}if(1<f){let w;for(q=1;q<f;q++){var u=r+q;let D=e[u];w=(w||c).getNextSibling();K(w)||E(125);var t=null;for(let z=0;z<n;z++){let A=D[z],G=A.cell;A.startRow===u&&(t=G);1<G.__colSpan&&(z+=G.__colSpan-1)}if(null===t)for(t=a-1;0<=t;t--)qa(w,B(l[t]|m[q]).append(v.$createParagraphNode()));else for(u=a-1;0<=u;u--)t.insertAfter(B(l[u]|m[q]).append(v.$createParagraphNode()))}b.setRowSpan(1)}}}; | ||
exports.INSERT_TABLE_COMMAND=ea;exports.TableCellHeaderStates=x;exports.TableCellNode=y;exports.TableNode=Z;exports.TableObserver=za;exports.TableRowNode=I;exports.applyTableHandlers=Ea;exports.getDOMCellFromTarget=Ha;exports.getTableElement=S;exports.getTableObserverFromTableElement=Ga; | ||
exports.registerTableCellUnmergeTransform=function(a){return a.registerNodeTransform(y,b=>{if(1<b.getColSpan()||1<b.getRowSpan()){var [,,c]=Q(b);[b]=O(c,b,b);let e=b.length,f=b[0].length;c=c.getFirstChild();K(c)||E(175);let g=[];for(let m=0;m<e;m++){0!==m&&(c=c.getNextSibling(),K(c)||E(175));let p=null;for(let r=0;r<f;r++){var d=b[m][r];let k=d.cell;if(d.startRow===m&&d.startColumn===r)p=k,g.push(k);else if(1<k.getColSpan()||1<k.getRowSpan())C(k)||E(176),d=B(k.__headerState),null!==p?p.insertAfter(d): | ||
h.$insertFirst(c,d)}}for(let m of g)m.setColSpan(1),m.setRowSpan(1)}})};exports.registerTablePlugin=function(a){a.hasNodes([Z])||E(254);return h.mergeRegister(a.registerCommand(ea,ib,v.COMMAND_PRIORITY_EDITOR),a.registerNodeTransform(Z,lb),a.registerNodeTransform(I,kb),a.registerNodeTransform(y,jb))}; | ||
exports.registerTableSelectionObserver=function(a,b=!0){let c=new Map,d=(f,g,m)=>{m=S(f,m);f=Ea(f,m,a,b);c.set(g,[f,m])},e=a.registerMutationListener(Z,f=>{a.getEditorState().read(()=>{for(const [g,m]of f){const p=c.get(g);if("created"===m||"updated"===m){const {tableNode:r,tableElement:k}=ya(g);void 0===p?d(r,g,k):k!==p[1]&&(p[0].removeListeners(),c.delete(g),d(r,g,k))}else"destroyed"===m&&void 0!==p&&(p[0].removeListeners(),c.delete(g))}},{editor:a})},{skipInitialization:!1});return()=>{e();for(let [, | ||
[f]]of c)f.removeListeners()}};exports.setScrollableTablesActive=function(a,b){b?gb.add(a):gb.delete(a)} | ||
exports.registerTableCellUnmergeTransform=function(a){return a.registerNodeTransform(y,b=>{if(1<b.getColSpan()||1<b.getRowSpan()){var [,,c]=Q(b);[b]=O(c,b,b);let f=b.length,e=b[0].length;c=c.getFirstChild();K(c)||E(175);let g=[];for(let n=0;n<f;n++){0!==n&&(c=c.getNextSibling(),K(c)||E(175));let r=null;for(let p=0;p<e;p++){var d=b[n][p];let l=d.cell;if(d.startRow===n&&d.startColumn===p)r=l,g.push(l);else if(1<l.getColSpan()||1<l.getRowSpan())C(l)||E(176),d=B(l.__headerState),null!==r?r.insertAfter(d): | ||
h.$insertFirst(c,d)}}for(let n of g)n.setColSpan(1),n.setRowSpan(1)}})};exports.registerTablePlugin=function(a){a.hasNodes([Z])||E(255);return h.mergeRegister(a.registerCommand(ea,ib,v.COMMAND_PRIORITY_EDITOR),a.registerNodeTransform(Z,lb),a.registerNodeTransform(I,kb),a.registerNodeTransform(y,jb))}; | ||
exports.registerTableSelectionObserver=function(a,b=!0){let c=new Map,d=(e,g,n)=>{n=S(e,n);e=Ea(e,n,a,b);c.set(g,[e,n])},f=a.registerMutationListener(Z,e=>{a.getEditorState().read(()=>{for(const [g,n]of e){const r=c.get(g);if("created"===n||"updated"===n){const {tableNode:p,tableElement:l}=ya(g);void 0===r?d(p,g,l):l!==r[1]&&(r[0].removeListeners(),c.delete(g),d(p,g,l))}else"destroyed"===n&&void 0!==r&&(r[0].removeListeners(),c.delete(g))}},{editor:a})},{skipInitialization:!1});return()=>{f();for(let [, | ||
[e]]of c)e.removeListeners()}};exports.setScrollableTablesActive=function(a,b){b?gb.add(a):gb.delete(a)} |
@@ -59,3 +59,3 @@ /** | ||
hasHeader(): boolean; | ||
updateDOM(prevNode: TableCellNode): boolean; | ||
updateDOM(prevNode: this): boolean; | ||
isShadowRoot(): boolean; | ||
@@ -62,0 +62,0 @@ collapseAtStart(): true; |
@@ -34,3 +34,3 @@ /** | ||
createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement; | ||
updateDOM(prevNode: TableNode, dom: HTMLElement, config: EditorConfig): boolean; | ||
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean; | ||
exportDOM(editor: LexicalEditor): DOMExportOutput; | ||
@@ -37,0 +37,0 @@ canBeEmpty(): false; |
@@ -28,3 +28,3 @@ /** | ||
getHeight(): number | undefined; | ||
updateDOM(prevNode: TableRowNode): boolean; | ||
updateDOM(prevNode: this): boolean; | ||
canBeEmpty(): false; | ||
@@ -31,0 +31,0 @@ canIndent(): false; |
@@ -11,9 +11,9 @@ { | ||
"license": "MIT", | ||
"version": "0.21.1-nightly.20241213.0", | ||
"version": "0.21.1-nightly.20241216.0", | ||
"main": "LexicalTable.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"@lexical/clipboard": "0.21.1-nightly.20241213.0", | ||
"@lexical/utils": "0.21.1-nightly.20241213.0", | ||
"lexical": "0.21.1-nightly.20241213.0" | ||
"@lexical/clipboard": "0.21.1-nightly.20241216.0", | ||
"@lexical/utils": "0.21.1-nightly.20241216.0", | ||
"lexical": "0.21.1-nightly.20241216.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
423676
8369
+ Added@lexical/clipboard@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/html@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/list@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/selection@0.21.1-nightly.20241216.0(transitive)
+ Added@lexical/utils@0.21.1-nightly.20241216.0(transitive)
+ Addedlexical@0.21.1-nightly.20241216.0(transitive)
- Removed@lexical/clipboard@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/html@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/list@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/selection@0.21.1-nightly.20241213.0(transitive)
- Removed@lexical/utils@0.21.1-nightly.20241213.0(transitive)
- Removedlexical@0.21.1-nightly.20241213.0(transitive)