@lexical/table
Advanced tools
Comparing version 0.21.1-nightly.20241223.0 to 0.22.0
@@ -13,3 +13,3 @@ /** | ||
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= | ||
colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,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!== | ||
@@ -20,5 +20,5 @@ 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 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; | ||
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, | ||
a.theme.tableRow);return b}extractWithChild(a,b,c){return"html"===c}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 fa(a){let b=void 0;ba.test(a.style.height)&&(b=parseFloat(a.style.height));return{after:c=>h.$descendantsMatching(c,C),node:J(b)}}function J(a){return v.$applyNodeReplacement(new I(a))} | ||
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; | ||
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()})}}createDOM(a){let b=document.createElement("tr");this.__height&&(b.style.height=`${this.__height}px`);h.addClassNamesToElement(b,a.theme.tableRow);return b}extractWithChild(a, | ||
b,c){return"html"===c}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 fa(a){let b=void 0;ba.test(a.style.height)&&(b=parseFloat(a.style.height));return{after:c=>h.$descendantsMatching(c,C),node:J(b)}}function J(a){return v.$applyNodeReplacement(new I(a))}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 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.");} | ||
@@ -49,3 +49,3 @@ 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()} | ||
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(255);c=c.getNodes().filter(C);c.length===this.table.columns*this.table.rows?(b.selectPrevious(),b.remove()):(c.forEach(d=>{if(v.$isElementNode(d)){let f=v.$createParagraphNode(),e=v.$createTextNode();f.append(e); | ||
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()):(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} | ||
@@ -97,11 +97,11 @@ 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]; | ||
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.__rowStriping=!1}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),rowStriping:this.__rowStriping?this.__rowStriping:void 0,type:"table",version:1}}extractWithChild(a,b,c){return"html"===c}getDOMSlot(a){a="TABLE"!==a.nodeName&&a.querySelector("table")||a;"TABLE"!==a.nodeName&&E(229);return super.getDOMSlot(a).withAfter(a.querySelector("colgroup"))}createDOM(a,b){let c=document.createElement("table"),d=document.createElement("colgroup");c.appendChild(d);eb(c,a,this.getColumnCount(), | ||
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));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=> | ||
this.__rowStriping=!1}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(a,b,c){return"html"===c}getDOMSlot(a){a="TABLE"!==a.nodeName&&a.querySelector("table")||a;"TABLE"!==a.nodeName&&E(229);return super.getDOMSlot(a).withAfter(a.querySelector("colgroup"))}createDOM(a,b){let c=document.createElement("table"),d=document.createElement("colgroup");c.appendChild(d);eb(c,a,this.getColumnCount(),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));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(!ba.test(c)&&(c=d.getAttribute("width")||"",!/^\d+$/.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((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(253,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; | ||
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}; | ||
@@ -127,4 +127,4 @@ 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- | ||
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(254);return h.mergeRegister(a.registerCommand(ea,ib,v.COMMAND_PRIORITY_EDITOR),a.registerNodeTransform(Z,lb),a.registerNodeTransform(I,kb),a.registerNodeTransform(y,jb))}; | ||
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)} |
@@ -11,9 +11,9 @@ { | ||
"license": "MIT", | ||
"version": "0.21.1-nightly.20241223.0", | ||
"version": "0.22.0", | ||
"main": "LexicalTable.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
"@lexical/clipboard": "0.21.1-nightly.20241223.0", | ||
"@lexical/utils": "0.21.1-nightly.20241223.0", | ||
"lexical": "0.21.1-nightly.20241223.0" | ||
"@lexical/clipboard": "0.22.0", | ||
"@lexical/utils": "0.22.0", | ||
"lexical": "0.22.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
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
423653
8368
+ Added@lexical/clipboard@0.22.0(transitive)
+ Added@lexical/html@0.22.0(transitive)
+ Added@lexical/list@0.22.0(transitive)
+ Added@lexical/selection@0.22.0(transitive)
+ Added@lexical/utils@0.22.0(transitive)
+ Addedlexical@0.22.0(transitive)
- Removed@lexical/clipboard@0.21.1-nightly.20241223.0(transitive)
- Removed@lexical/html@0.21.1-nightly.20241223.0(transitive)
- Removed@lexical/list@0.21.1-nightly.20241223.0(transitive)
- Removed@lexical/selection@0.21.1-nightly.20241223.0(transitive)
- Removed@lexical/utils@0.21.1-nightly.20241223.0(transitive)
- Removedlexical@0.21.1-nightly.20241223.0(transitive)
Updated@lexical/clipboard@0.22.0
Updated@lexical/utils@0.22.0
Updatedlexical@0.22.0