@lexical/table
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -7,3 +7,2 @@ /** | ||
* | ||
* | ||
*/ | ||
@@ -22,3 +21,2 @@ | ||
} from 'lexical'; | ||
import {$Values} from 'utility-types'; | ||
@@ -35,3 +33,2 @@ export enum TableCellHeaderStates { | ||
*/ | ||
export declare class TableCellNode extends ElementNode { | ||
@@ -77,3 +74,2 @@ static getType(): string; | ||
*/ | ||
export declare class TableNode extends ElementNode { | ||
@@ -122,3 +118,2 @@ static getType(): string; | ||
*/ | ||
export type Cell = { | ||
@@ -130,5 +125,3 @@ elem: HTMLElement; | ||
}; | ||
export type Cells = Array<Array<Cell>>; | ||
export type Grid = { | ||
@@ -237,6 +230,7 @@ cells: Cells; | ||
} | ||
export var INSERT_TABLE_COMMAND: LexicalCommand<{ | ||
export type InsertTableCommandPayload = Readonly<{ | ||
columns: string; | ||
rows: string; | ||
columns: string; | ||
includeHeaders?: boolean; | ||
}>; | ||
export const INSERT_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload>; |
@@ -12,8 +12,14 @@ /** | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
const TableCellHeaderStates = { | ||
BOTH: 3, | ||
COLUMN: 2, | ||
NO_STATUS: 0, | ||
ROW: 1, | ||
COLUMN: 2, | ||
BOTH: 3 | ||
ROW: 1 | ||
}; | ||
@@ -42,2 +48,6 @@ class TableCellNode extends lexical.GridCellNode { | ||
static importJSON(serializedNode) { | ||
return $createTableCellNode(serializedNode.headerState, serializedNode.colSpan, serializedNode.width); | ||
} | ||
constructor(headerState = TableCellHeaderStates.NO_STATUS, colSpan = 1, width, key) { | ||
@@ -83,2 +93,11 @@ super(colSpan, key); | ||
exportJSON() { | ||
return { ...super.exportJSON(), | ||
colSpan: super.__colSpan, | ||
headerState: this.__headerState, | ||
type: 'tablecell', | ||
width: this.getWidth() | ||
}; | ||
} | ||
getTag() { | ||
@@ -117,3 +136,2 @@ return this.hasHeader() ? 'th' : 'td'; | ||
self.__headerState = self.__headerState; | ||
return self; | ||
@@ -151,3 +169,2 @@ } | ||
return { | ||
node: tableCellNode, | ||
forChild: (lexicalNode, parentLexicalNode) => { | ||
@@ -166,3 +183,4 @@ if ($isTableCellNode(parentLexicalNode) && !lexical.$isElementNode(lexicalNode)) { | ||
return lexicalNode; | ||
} | ||
}, | ||
node: tableCellNode | ||
}; | ||
@@ -183,3 +201,2 @@ } | ||
* | ||
* | ||
*/ | ||
@@ -204,2 +221,6 @@ class TableRowNode extends lexical.GridRowNode { | ||
static importJSON(serializedNode) { | ||
return $createTableRowNode(serializedNode.height); | ||
} | ||
constructor(height, key) { | ||
@@ -210,2 +231,9 @@ super(key); | ||
exportJSON() { | ||
return { ...super.exportJSON(), | ||
type: 'tablerow', | ||
version: 1 | ||
}; | ||
} | ||
createDOM(config) { | ||
@@ -263,3 +291,2 @@ const element = document.createElement('tr'); | ||
* | ||
* | ||
*/ | ||
@@ -274,3 +301,2 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'; | ||
* | ||
* | ||
*/ | ||
@@ -287,3 +313,2 @@ const getSelection = () => window.getSelection(); | ||
* | ||
* | ||
*/ | ||
@@ -420,3 +445,3 @@ | ||
lexical.$setSelection(null); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND, undefined); | ||
this.enableHighlightStyle(); | ||
@@ -512,6 +537,5 @@ }); | ||
this.focusCellNodeKey = focusNodeKey; | ||
this.gridSelection.set(this.tableNodeKey, // $FlowFixMe This is not null, as you can see in the statement above. | ||
this.anchorCellNodeKey, this.focusCellNodeKey); | ||
this.gridSelection.set(this.tableNodeKey, this.anchorCellNodeKey, this.focusCellNodeKey); | ||
lexical.$setSelection(this.gridSelection); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND, undefined); | ||
$updateDOMForSelection(this.grid, this.gridSelection); | ||
@@ -548,5 +572,4 @@ } | ||
} | ||
} // This is to make Flow play ball. | ||
} | ||
const formatSelection = lexical.$createRangeSelection(); | ||
@@ -563,3 +586,3 @@ const anchor = formatSelection.anchor; | ||
lexical.$setSelection(selection); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND, undefined); | ||
}); | ||
@@ -609,3 +632,3 @@ } | ||
lexical.$setSelection(null); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND); | ||
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND, undefined); | ||
}); | ||
@@ -622,3 +645,2 @@ } | ||
* | ||
* | ||
*/ | ||
@@ -638,3 +660,2 @@ const LEXICAL_ELEMENT_KEY = '__lexicalTableSelection'; | ||
tableElement.addEventListener('dblclick', event => { | ||
// $FlowFixMe: event.target is always a Node on the DOM | ||
const cell = getCellFromTarget(event.target); | ||
@@ -656,5 +677,4 @@ | ||
return; | ||
} // $FlowFixMe: event.target is always a Node on the DOM | ||
} | ||
const cell = getCellFromTarget(event.target); | ||
@@ -682,3 +702,2 @@ | ||
if (isMouseDown) { | ||
// $FlowFixMe: event.target is always a Node on the DOM | ||
const cell = getCellFromTarget(event.target); | ||
@@ -698,3 +717,3 @@ | ||
}); | ||
tableElement.addEventListener('mouseup', event => { | ||
tableElement.addEventListener('mouseup', () => { | ||
if (isMouseDown) { | ||
@@ -705,3 +724,3 @@ isMouseDown = false; | ||
tableElement.addEventListener('mouseleave', event => { | ||
tableElement.addEventListener('mouseleave', () => { | ||
if (isMouseDown) { | ||
@@ -731,3 +750,3 @@ return; | ||
const mouseUpCallback = event => { | ||
const mouseUpCallback = () => { | ||
isMouseDown = false; | ||
@@ -738,3 +757,3 @@ }; | ||
tableSelection.listenersToRemove.add(() => window.removeEventListener('mouseup', mouseUpCallback)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_DOWN_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_DOWN_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -746,3 +765,2 @@ | ||
const event = payload; | ||
const direction = 'down'; | ||
@@ -797,3 +815,3 @@ | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_UP_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_UP_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -805,3 +823,2 @@ | ||
const event = payload; | ||
const direction = 'up'; | ||
@@ -856,3 +873,3 @@ | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_LEFT_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_LEFT_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -864,3 +881,2 @@ | ||
const event = payload; | ||
const direction = 'backward'; | ||
@@ -912,3 +928,3 @@ | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_RIGHT_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_RIGHT_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -920,3 +936,2 @@ | ||
const event = payload; | ||
const direction = 'forward'; | ||
@@ -998,3 +1013,3 @@ | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_BACKSPACE_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_BACKSPACE_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -1007,3 +1022,2 @@ | ||
if (lexical.$isGridSelection(selection)) { | ||
const event = payload; | ||
event.preventDefault(); | ||
@@ -1043,3 +1057,3 @@ event.stopPropagation(); | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.INSERT_TEXT_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.CONTROLLED_TEXT_INSERTION_COMMAND, payload => { | ||
const selection = lexical.$getSelection(); | ||
@@ -1064,3 +1078,3 @@ | ||
}, lexical.COMMAND_PRIORITY_CRITICAL)); | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_TAB_COMMAND, payload => { | ||
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_TAB_COMMAND, event => { | ||
const selection = lexical.$getSelection(); | ||
@@ -1079,4 +1093,2 @@ | ||
const event = payload; | ||
if (selection.isCollapsed()) { | ||
@@ -1138,7 +1150,5 @@ const currentCords = tableNode.getCordsFromCellNode(tableCellNode, tableSelection.grid); | ||
function attachTableSelectionToTableElement(tableElement, tableSelection) { | ||
// $FlowFixMe | ||
tableElement[LEXICAL_ELEMENT_KEY] = tableSelection; | ||
} | ||
function getTableSelectionFromTableElement(tableElement) { | ||
// $FlowFixMe | ||
return tableElement[LEXICAL_ELEMENT_KEY]; | ||
@@ -1153,3 +1163,3 @@ } | ||
if (nodeName === 'TD' || nodeName === 'TH') { | ||
// $FlowFixMe: internal field | ||
// @ts-expect-error: internal field | ||
const cell = currentNode._cell; | ||
@@ -1185,3 +1195,2 @@ | ||
if (nodeMame === 'TD' || nodeMame === 'TH') { | ||
// $FlowFixMe: TD is always an HTMLElement | ||
const elem = currentNode; | ||
@@ -1193,3 +1202,3 @@ const cell = { | ||
y | ||
}; // $FlowFixMe: internal field | ||
}; // @ts-expect-error: internal field | ||
@@ -1307,85 +1316,75 @@ currentNode._cell = cell; | ||
const selectGridNodeInDirection = (tableSelection, tableNode, x, y, direction) => { | ||
const isForward = direction === 'forward'; | ||
switch (direction) { | ||
case 'backward': | ||
case 'forward': | ||
{ | ||
const isForward = direction === 'forward'; | ||
if (x !== (isForward ? tableSelection.grid.columns - 1 : 0)) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x + (isForward ? 1 : -1), y, tableSelection.grid)); | ||
if (x !== (isForward ? tableSelection.grid.columns - 1 : 0)) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x + (isForward ? 1 : -1), y, tableSelection.grid)); | ||
} else { | ||
if (y !== (isForward ? tableSelection.grid.rows - 1 : 0)) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(isForward ? 0 : tableSelection.grid.columns - 1, y + (isForward ? 1 : -1), tableSelection.grid)); | ||
} else if (!isForward) { | ||
tableNode.selectPrevious(); | ||
} else { | ||
if (y !== (isForward ? tableSelection.grid.rows - 1 : 0)) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(isForward ? 0 : tableSelection.grid.columns - 1, y + (isForward ? 1 : -1), tableSelection.grid)); | ||
} else if (!isForward) { | ||
tableNode.selectPrevious(); | ||
} else { | ||
tableNode.selectNext(); | ||
} | ||
tableNode.selectNext(); | ||
} | ||
return true; | ||
} | ||
return true; | ||
case 'up': | ||
{ | ||
if (y !== 0) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y - 1, tableSelection.grid)); | ||
} else { | ||
tableNode.selectPrevious(); | ||
} | ||
return true; | ||
if (y !== 0) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y - 1, tableSelection.grid)); | ||
} else { | ||
tableNode.selectPrevious(); | ||
} | ||
return true; | ||
case 'down': | ||
{ | ||
if (y !== tableSelection.grid.rows - 1) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y + 1, tableSelection.grid)); | ||
} else { | ||
tableNode.selectNext(); | ||
} | ||
if (y !== tableSelection.grid.rows - 1) { | ||
selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y + 1, tableSelection.grid)); | ||
} else { | ||
tableNode.selectNext(); | ||
} | ||
return true; | ||
} | ||
return true; | ||
default: | ||
return false; | ||
} | ||
return false; | ||
}; | ||
const adjustFocusNodeInDirection = (tableSelection, tableNode, x, y, direction) => { | ||
const isForward = direction === 'forward'; | ||
switch (direction) { | ||
case 'backward': | ||
case 'forward': | ||
{ | ||
const isForward = direction === 'forward'; | ||
if (x !== (isForward ? tableSelection.grid.columns - 1 : 0)) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x + (isForward ? 1 : -1), y, tableSelection.grid)); | ||
} | ||
if (x !== (isForward ? tableSelection.grid.columns - 1 : 0)) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x + (isForward ? 1 : -1), y, tableSelection.grid)); | ||
} | ||
return true; | ||
case 'up': | ||
if (y !== 0) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x, y - 1, tableSelection.grid)); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
case 'up': | ||
{ | ||
if (y !== 0) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x, y - 1, tableSelection.grid)); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
case 'down': | ||
if (y !== tableSelection.grid.rows - 1) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x, y + 1, tableSelection.grid)); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
case 'down': | ||
{ | ||
if (y !== tableSelection.grid.rows - 1) { | ||
tableSelection.adjustFocusCellForSelection(tableNode.getCellFromCordsOrThrow(x, y + 1, tableSelection.grid)); | ||
return true; | ||
} else { | ||
return false; | ||
} | ||
} | ||
default: | ||
return false; | ||
} | ||
return false; | ||
}; | ||
@@ -1419,3 +1418,2 @@ | ||
* | ||
* | ||
*/ | ||
@@ -1440,2 +1438,6 @@ class TableNode extends lexical.GridNode { | ||
static importJSON(serializedNode) { | ||
return $createTableNode(); | ||
} | ||
constructor(key) { | ||
@@ -1445,2 +1447,9 @@ super(key); | ||
exportJSON() { | ||
return { ...super.exportJSON(), | ||
type: 'table', | ||
version: 1 | ||
}; | ||
} | ||
createDOM(config, editor) { | ||
@@ -1475,5 +1484,4 @@ const tableElement = document.createElement('table'); | ||
colGroup.append(col); | ||
} //$FlowFixMe This function does exist and is supported by major browsers. | ||
} | ||
newElement.replaceChildren(colGroup, tBody); | ||
@@ -1495,6 +1503,2 @@ return newElement; | ||
getCordsFromCellNode(tableCellNode, grid) { | ||
if (!grid) { | ||
throw Error(`Grid not found.`); | ||
} | ||
const { | ||
@@ -1531,6 +1535,2 @@ rows, | ||
getCellFromCords(x, y, grid) { | ||
if (!grid) { | ||
throw Error(`Grid not found.`); | ||
} | ||
const { | ||
@@ -1626,3 +1626,2 @@ cells | ||
* | ||
* | ||
*/ | ||
@@ -1826,3 +1825,2 @@ function $createTableNodeWithDimensions(rowCount, columnCount, includeHeaders = true) { | ||
* | ||
* | ||
*/ | ||
@@ -1829,0 +1827,0 @@ const INSERT_TABLE_COMMAND = lexical.createCommand(); |
@@ -7,43 +7,42 @@ /** | ||
*/ | ||
var f=require("lexical"),p=require("@lexical/utils");const q={NO_STATUS:0,ROW:1,COLUMN:2,BOTH:3}; | ||
class t extends f.GridCellNode{static getType(){return"tablecell"}static clone(a){return new t(a.__headerState,a.__colSpan,a.__width,a.__key)}static importDOM(){return{td:()=>({conversion:w,priority:0}),th:()=>({conversion:w,priority:0})}}constructor(a=q.NO_STATUS,b=1,d,h){super(b,h);this.__headerState=a;this.__width=d}createDOM(a){const b=document.createElement(this.getTag());this.__width&&(b.style.width=`${this.__width}px`);p.addClassNamesToElement(b,a.theme.tableCell,this.hasHeader()&&a.theme.tableCellHeader); | ||
return b}exportDOM(a){({element:a}=super.exportDOM(a));if(a){const b=this.getParentOrThrow().getChildrenSize();a.style.border="1px solid black";a.style.width=`${this.getWidth()||Math.max(90,700/b)}px`;a.style.verticalAlign="top";a.style.textAlign="start";this.hasHeader()&&(a.style.backgroundColor="#f2f3f5")}return{element:a}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(a){this.getWritable().__headerState=a;return this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(a){this.getWritable().__width= | ||
a;return this.__width}getWidth(){return this.getLatest().__width}toggleHeaderStyle(a){const b=this.getWritable();b.__headerState=(b.__headerState&a)===a?b.__headerState-a:b.__headerState+a;b.__headerState=b.__headerState;return b}hasHeaderState(a){return(this.getHeaderStyles()&a)===a}hasHeader(){return this.getLatest().__headerState!==q.NO_STATUS}updateDOM(a){return a.__headerState!==this.__headerState||a.__width!==this.__width}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}} | ||
function w(a){a=a.nodeName.toLowerCase();return{node:x("th"===a?q.ROW:q.NO_STATUS),forChild:(b,d)=>{if(y(d)&&!f.$isElementNode(b)){d=f.$createParagraphNode();if(f.$isLineBreakNode(b)&&"\n"===b.getTextContent())return null;d.append(b);return d}return b}}}function x(a,b=1,d){return new t(a,b,d)}function y(a){return a instanceof t} | ||
function z(a){throw Error(`Minified Lexical error #${a}; see codes.json for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");} | ||
class A extends f.GridRowNode{static getType(){return"tablerow"}static clone(a){return new A(a.__height,a.__key)}static importDOM(){return{tr:()=>({conversion:B,priority:0})}}constructor(a,b){super(b);this.__height=a}createDOM(a){const b=document.createElement("tr");this.__height&&(b.style.height=`${this.__height}px`);p.addClassNamesToElement(b,a.theme.tableRow);return b}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 B(){return{node:C()}}function C(a){return new A(a)}function D(a){return a instanceof A} | ||
if("undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement){const a=document.createElement("style");a.innerHTML="\n table.disable-selection {\n -webkit-touch-callout: none;\n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none; \n user-select: none;\n }\n \n .disable-selection span::selection{\n background-color: transparent;\n }\n .disable-selection br::selection{\n background-color: transparent;\n }\n ";document.body&& | ||
document.body.append(a)} | ||
class E{constructor(a,b){this.isHighlightingCells=!1;this.currentY=this.currentX=this.startY=this.startX=-1;this.listenersToRemove=new Set;this.tableNodeKey=b;this.editor=a;this.grid={cells:[],columns:0,rows:0};this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null;this.hasHijackedSelectionStyles=!1;this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(a=>a())}trackTableGrid(){const a=new MutationObserver(b=> | ||
{this.editor.update(()=>{var d=!1;for(let h=0;h<b.length;h++){const c=b[h].target.nodeName;if("TABLE"===c||"TR"===c){d=!0;break}}if(d){d=this.editor.getElementByKey(this.tableNodeKey);if(!d)throw Error("Expected to find TableElement in DOM");this.grid=F(d)}})});this.editor.update(()=>{const b=this.editor.getElementByKey(this.tableNodeKey);if(!b)throw Error("Expected to find TableElement in DOM");this.grid=F(b);a.observe(b,{childList:!0,subtree:!0})})}clearHighlight(){this.editor.update(()=>{var a= | ||
f.$getNodeByKey(this.tableNodeKey);if(!G(a))throw Error("Expected TableNode.");a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a=F(a);this.isHighlightingCells=!1;this.currentY=this.currentX=this.startY=this.startX=-1;this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null;this.hasHijackedSelectionStyles=!1;H(a,null);f.$setSelection(null);this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND);this.enableHighlightStyle()})}enableHighlightStyle(){this.editor.update(()=> | ||
{const a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a.classList.remove("disable-selection");this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{const a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a.classList.add("disable-selection");this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(a){if(null!=a){this.gridSelection=a;this.isHighlightingCells= | ||
!0;this.disableHighlightStyle();const b=this.editor.getElementByKey(a.anchor.key);a=this.editor.getElementByKey(a.focus.key);b&&a&&window.getSelection().setBaseAndExtent(b,0,a,0);H(this.grid,this.gridSelection)}else this.clearHighlight()}adjustFocusCellForSelection(a,b=!1){this.editor.update(()=>{var d=f.$getNodeByKey(this.tableNodeKey);if(!G(d))throw Error("Expected TableNode.");if(!this.editor.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");d=a.x;const h=a.y; | ||
this.focusCell=a;const c=window.getSelection();null!==this.anchorCell&&c.setBaseAndExtent(this.anchorCell.elem,0,a.elem,0);if(!this.isHighlightingCells&&(this.startX!==d||this.startY!==h||b))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(d===this.currentX&&h===this.currentY)return;this.currentX=d;this.currentY=h;this.isHighlightingCells&&(d=f.$getNearestNodeFromDOMNode(a.elem),null!=this.gridSelection&&null!=this.anchorCellNodeKey&&y(d)&&(d=d.getKey(),this.gridSelection=f.$createGridSelection(), | ||
this.focusCellNodeKey=d,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),f.$setSelection(this.gridSelection),this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND),H(this.grid,this.gridSelection)))})}setAnchorCellForSelection(a){this.editor.update(()=>{this.anchorCell=a;this.startX=a.x;this.startY=a.y;window.getSelection().setBaseAndExtent(a.elem,0,a.elem,0);var b=f.$getNearestNodeFromDOMNode(a.elem);y(b)&&(b=b.getKey(),this.gridSelection=f.$createGridSelection(), | ||
this.anchorCellNodeKey=b)})}formatCells(a){this.editor.update(()=>{const b=f.$getSelection();f.$isGridSelection(b)||z(14);const d=f.$createRangeSelection(),h=d.anchor,c=d.focus;b.getNodes().forEach(k=>{y(k)&&0!==k.getTextContentSize()&&(h.set(k.getKey(),0,"element"),c.set(k.getKey(),k.getChildrenSize(),"element"),d.formatText(a))});f.$setSelection(b);this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND)})}clearText(){this.editor.update(()=>{const a=f.$getNodeByKey(this.tableNodeKey);if(!G(a))throw Error("Expected TableNode."); | ||
var b=f.$getSelection();f.$isGridSelection(b)||z(14);b=b.getNodes().filter(y);b.length===this.grid.columns*this.grid.rows?(a.selectPrevious(),a.remove(),this.clearHighlight()):(b.forEach(d=>{if(f.$isElementNode(d)){const h=f.$createParagraphNode(),c=f.$createTextNode();h.append(c);d.append(h);d.getChildren().forEach(k=>{k!==h&&k.remove()})}}),H(this.grid,null),f.$setSelection(null),this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND))})}} | ||
function I(a){for(;null!=a;){const b=a.nodeName;if("TD"===b||"TH"===b){a=a._cell;if(void 0===a)break;return a}a=a.parentNode}return null} | ||
function F(a){const b=[],d={cells:b,columns:0,rows:0};var h=a.firstChild;let c=a=0;for(b.length=0;null!=h;){var k=h.nodeName;if("TD"===k||"TH"===k)k={elem:h,highlighted:!1,x:a,y:c},h._cell=k,void 0===b[c]&&(b[c]=[]),b[c][a]=k;else if(k=h.firstChild,null!=k){h=k;continue}k=h.nextSibling;if(null!=k)a++,h=k;else if(k=h.parentNode,null!=k){h=k.nextSibling;if(null==h)break;c++;a=0}}d.columns=a+1;d.rows=c+1;return d} | ||
function H(a,b){const d=[],h=new Set(b?b.getNodes():[]);J(a,(c,k)=>{const n=c.elem;h.has(k)?(c.highlighted=!0,n.style.setProperty("background-color","rgb(172, 206, 247)"),n.style.setProperty("caret-color","transparent"),d.push(c)):(c.highlighted=!1,n.style.removeProperty("background-color"),n.style.removeProperty("caret-color"),n.getAttribute("style")||n.removeAttribute("style"))});return d} | ||
function J(a,b){({cells:a}=a);for(let d=0;d<a.length;d++){const h=a[d];for(let c=0;c<h.length;c++){const k=h[c],n=f.$getNearestNodeFromDOMNode(k.elem);null!==n&&b(k,n,{x:c,y:d})}}}function K(a){a.disableHighlightStyle();J(a.grid,b=>{const d=b.elem;b.highlighted=!0;d.style.setProperty("background-color","rgb(172, 206, 247)");d.style.setProperty("caret-color","transparent")})} | ||
function O(a){a.enableHighlightStyle();J(a.grid,b=>{const d=b.elem;b.highlighted=!1;d.style.removeProperty("background-color");d.style.removeProperty("caret-color");d.getAttribute("style")||d.removeAttribute("style")})} | ||
const Q=(a,b,d,h,c)=>{switch(c){case "backward":case "forward":return c="forward"===c,d!==(c?a.grid.columns-1:0)?P(b.getCellNodeFromCordsOrThrow(d+(c?1:-1),h,a.grid)):h!==(c?a.grid.rows-1:0)?P(b.getCellNodeFromCordsOrThrow(c?0:a.grid.columns-1,h+(c?1:-1),a.grid)):c?b.selectNext():b.selectPrevious(),!0;case "up":return 0!==h?P(b.getCellNodeFromCordsOrThrow(d,h-1,a.grid)):b.selectPrevious(),!0;case "down":return h!==a.grid.rows-1?P(b.getCellNodeFromCordsOrThrow(d,h+1,a.grid)):b.selectNext(),!0}return!1}, | ||
R=(a,b,d,h,c)=>{switch(c){case "backward":case "forward":return c="forward"===c,d!==(c?a.grid.columns-1:0)&&a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d+(c?1:-1),h,a.grid)),!0;case "up":if(0!==h)return a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d,h-1,a.grid)),!0;break;case "down":if(h!==a.grid.rows-1)return a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d,h+1,a.grid)),!0}return!1}; | ||
function S(a,b){if(f.$isRangeSelection(a)||f.$isGridSelection(a)){const d=b.isParentOf(a.anchor.getNode());a=b.isParentOf(a.focus.getNode());return d&&a}return!1}function P(a){const b=a.getChildren().find(d=>f.$isParagraphNode(d));f.$isParagraphNode(b)?b.selectEnd():a.selectEnd()} | ||
class T extends f.GridNode{static getType(){return"table"}static clone(a){return new T(a.__key)}static importDOM(){return{table:()=>({conversion:U,priority:0})}}constructor(a){super(a)}createDOM(a){const b=document.createElement("table");p.addClassNamesToElement(b,a.theme.table);return b}updateDOM(){return!1}exportDOM(a){return{...super.exportDOM(a),after:b=>{if(b){const d=b.cloneNode(),h=document.createElement("colgroup"),c=document.createElement("tbody");c.append(...b.children);b=this.getFirstChildOrThrow(); | ||
if(!D(b))throw Error("Expected to find row node.");b=b.getChildrenSize();for(let k=0;k<b;k++){const n=document.createElement("col");h.append(n)}d.replaceChildren(h,c);return d}}}}canExtractContents(){return!1}canBeEmpty(){return!1}getCordsFromCellNode(a,b){b||z(13);const {rows:d,cells:h}=b;for(b=0;b<d;b++){var c=h[b];if(null==c)throw Error(`Row not found at y:${b}`);c=c.findIndex(({elem:k})=>f.$getNearestNodeFromDOMNode(k)===a);if(-1!==c)return{x:c,y:b}}throw Error("Cell not found in table.");}getCellFromCords(a, | ||
b,d){d||z(13);({cells:d}=d);b=d[b];if(null==b)return null;a=b[a];return null==a?null:a}getCellFromCordsOrThrow(a,b,d){a=this.getCellFromCords(a,b,d);if(!a)throw Error("Cell not found at cords.");return a}getCellNodeFromCords(a,b,d){a=this.getCellFromCords(a,b,d);if(null==a)return null;a=f.$getNearestNodeFromDOMNode(a.elem);return y(a)?a:null}getCellNodeFromCordsOrThrow(a,b,d){a=this.getCellNodeFromCords(a,b,d);if(!a)throw Error("Node at cords not TableCellNode.");return a}canSelectBefore(){return!0}canIndent(){return!1}} | ||
function U(){return{node:V()}}function V(){return new T}function G(a){return a instanceof T}function W(a){a=p.$findMatchingParent(a,b=>D(b));if(D(a))return a;throw Error("Expected table cell to be inside of table row.");}function X(a){a=p.$findMatchingParent(a,b=>G(b));if(G(a))return a;throw Error("Expected table cell to be inside of table.");}const Y=f.createCommand();exports.$createTableCellNode=x;exports.$createTableNode=V; | ||
exports.$createTableNodeWithDimensions=function(a,b,d=!0){const h=V();for(let k=0;k<a;k++){const n=C();for(let r=0;r<b;r++){var c=q.NO_STATUS;d&&(0===k&&(c|=q.ROW),0===r&&(c|=q.COLUMN));c=x(c);const v=f.$createParagraphNode();v.append(f.$createTextNode());c.append(v);n.append(c)}h.append(n)}return h};exports.$createTableRowNode=C; | ||
exports.$deleteTableColumn=function(a,b){const d=a.getChildren();for(let c=0;c<d.length;c++){var h=d[c];if(D(h)){h=h.getChildren();if(b>=h.length||0>b)throw Error("Table column target index out of range");h[b].remove()}}return a};exports.$getElementGridForTableNode=function(a,b){a=a.getElementByKey(b.getKey());if(null==a)throw Error("Table Element Not Found");return F(a)};exports.$getTableCellNodeFromLexicalNode=function(a){a=p.$findMatchingParent(a,b=>y(b));return y(a)?a:null}; | ||
exports.$getTableColumnIndexFromTableCellNode=function(a){return W(a).getChildren().findIndex(b=>b.is(a))};exports.$getTableNodeFromLexicalNodeOrThrow=X;exports.$getTableRowIndexFromTableCellNode=function(a){const b=W(a);return X(b).getChildren().findIndex(d=>d.is(b))};exports.$getTableRowNodeFromTableCellNodeOrThrow=W; | ||
exports.$insertTableColumn=function(a,b,d=!0,h){const c=a.getChildren();for(let r=0;r<c.length;r++){const v=c[r];if(D(v))for(let g=0;g<h;g++){var k=q.NO_STATUS;0===r&&(k|=q.ROW);k=x(k);k.append(f.$createParagraphNode());var n=v.getChildren();if(b>=n.length||0>b)throw Error("Table column target index out of range");n=n[b];d?n.insertAfter(k):n.insertBefore(k)}}return a}; | ||
exports.$insertTableRow=function(a,b,d=!0,h,c){var k=a.getChildren();if(b>=k.length||0>b)throw Error("Table row target index out of range");b=k[b];if(D(b))for(k=0;k<h;k++){const v=b.getChildren(),g=v.length,e=C();for(let l=0;l<g;l++){var n=v[l];y(n)||z(12);var r=c;const m=X(n),{x:u,y:L}=m.getCordsFromCellNode(n,r);n={above:m.getCellNodeFromCords(u,L-1,r),below:m.getCellNodeFromCords(u,L+1,r),left:m.getCellNodeFromCords(u-1,L,r),right:m.getCellNodeFromCords(u+1,L,r)};const {above:M,below:N}=n;n=q.NO_STATUS; | ||
r=M&&M.getWidth()||N&&N.getWidth()||null;if(M&&M.hasHeaderState(q.COLUMN)||N&&N.hasHeaderState(q.COLUMN))n|=q.COLUMN;n=x(n,1,r);n.append(f.$createParagraphNode());e.append(n)}d?b.insertAfter(e):b.insertBefore(e)}else throw Error("Row before insertion index does not exist.");return a};exports.$isTableCellNode=y;exports.$isTableNode=G;exports.$isTableRowNode=D; | ||
exports.$removeTableRowAtIndex=function(a,b){const d=a.getChildren();if(b>=d.length||0>b)throw Error("Expected table cell to be inside of table row.");d[b].remove();return a};exports.INSERT_TABLE_COMMAND=Y;exports.TableCellHeaderStates=q;exports.TableCellNode=t;exports.TableNode=T;exports.TableRowNode=A;exports.TableSelection=E; | ||
exports.applyTableHandlers=function(a,b,d){const h=d.getRootElement();if(null===h)throw Error("No root element.");const c=new E(d,a.getKey());b.__lexicalTableSelection=c;let k=!1,n=!1;b.addEventListener("dblclick",g=>{const e=I(g.target);null!==e&&(g.preventDefault(),g.stopImmediatePropagation(),g.stopPropagation(),c.setAnchorCellForSelection(e),c.adjustFocusCellForSelection(e,!0),k=!1)});b.addEventListener("mousedown",g=>{setTimeout(()=>{if(0===g.button){var e=I(g.target);null!==e&&(c.setAnchorCellForSelection(e), | ||
document.addEventListener("mouseup",()=>{k=!1},{capture:!0,once:!0}))}},0)});b.addEventListener("mousemove",g=>{n&&(g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation());if(k){const e=I(g.target);if(null!==e){const l=e.x,m=e.y;k&&(c.startX!==l||c.startY!==m||c.isHighlightingCells)&&(g.preventDefault(),k=!0,c.adjustFocusCellForSelection(e))}}});b.addEventListener("mouseup",()=>{k&&(k=!1)});b.addEventListener("mouseleave",()=>{});const r=g=>{k=!0;0===g.button&&d.update(()=>{const e=f.$getSelection(); | ||
if(f.$isGridSelection(e)&&e.gridKey===c.tableNodeKey&&h.contains(g.target))return c.clearHighlight()})};window.addEventListener("mousedown",r);c.listenersToRemove.add(()=>window.removeEventListener("mousedown",r));const v=()=>{k=!1};window.addEventListener("mouseup",v);c.listenersToRemove.add(()=>window.removeEventListener("mouseup",v));c.listenersToRemove.add(d.registerCommand(f.KEY_ARROW_DOWN_COMMAND,g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){if(e.isCollapsed()){var l= | ||
'use strict';var f=require("lexical"),p=require("@lexical/utils");let q={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1}; | ||
class t extends f.GridCellNode{static getType(){return"tablecell"}static clone(a){return new t(a.__headerState,a.__colSpan,a.__width,a.__key)}static importDOM(){return{td:()=>({conversion:w,priority:0}),th:()=>({conversion:w,priority:0})}}static importJSON(a){return x(a.headerState,a.colSpan,a.width)}constructor(a=q.NO_STATUS,b=1,d,k){super(b,k);this.__headerState=a;this.__width=d}createDOM(a){let b=document.createElement(this.getTag());this.__width&&(b.style.width=`${this.__width}px`);p.addClassNamesToElement(b, | ||
a.theme.tableCell,this.hasHeader()&&a.theme.tableCellHeader);return b}exportDOM(a){({element:a}=super.exportDOM(a));if(a){let b=this.getParentOrThrow().getChildrenSize();a.style.border="1px solid black";a.style.width=`${this.getWidth()||Math.max(90,700/b)}px`;a.style.verticalAlign="top";a.style.textAlign="start";this.hasHeader()&&(a.style.backgroundColor="#f2f3f5")}return{element:a}}exportJSON(){return{...super.exportJSON(),colSpan:super.__colSpan,headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()? | ||
"th":"td"}setHeaderStyles(a){this.getWritable().__headerState=a;return this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(a){this.getWritable().__width=a;return this.__width}getWidth(){return this.getLatest().__width}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!==q.NO_STATUS}updateDOM(a){return a.__headerState!== | ||
this.__headerState||a.__width!==this.__width}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function w(a){a=a.nodeName.toLowerCase();return{forChild:(b,d)=>{if(y(d)&&!f.$isElementNode(b)){d=f.$createParagraphNode();if(f.$isLineBreakNode(b)&&"\n"===b.getTextContent())return null;d.append(b);return d}return b},node:x("th"===a?q.ROW:q.NO_STATUS)}}function x(a,b=1,d){return new t(a,b,d)}function y(a){return a instanceof t} | ||
class z extends f.GridRowNode{static getType(){return"tablerow"}static clone(a){return new z(a.__height,a.__key)}static importDOM(){return{tr:()=>({conversion:A,priority:0})}}static importJSON(a){return B(a.height)}constructor(a,b){super(b);this.__height=a}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(a){let b=document.createElement("tr");this.__height&&(b.style.height=`${this.__height}px`);p.addClassNamesToElement(b,a.theme.tableRow);return b}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 A(){return{node:B()}}function B(a){return new z(a)}function C(a){return a instanceof z}function D(a){throw Error(`Minified Lexical error #${a}; see codes.json for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");} | ||
if("undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement){let a=document.createElement("style");a.innerHTML="\n table.disable-selection {\n -webkit-touch-callout: none;\n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -ms-user-select: none; \n user-select: none;\n }\n \n .disable-selection span::selection{\n background-color: transparent;\n }\n .disable-selection br::selection{\n background-color: transparent;\n }\n "; | ||
document.body&&document.body.append(a)} | ||
class E{constructor(a,b){this.isHighlightingCells=!1;this.currentY=this.currentX=this.startY=this.startX=-1;this.listenersToRemove=new Set;this.tableNodeKey=b;this.editor=a;this.grid={cells:[],columns:0,rows:0};this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null;this.hasHijackedSelectionStyles=!1;this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(a=>a())}trackTableGrid(){let a=new MutationObserver(b=> | ||
{this.editor.update(()=>{var d=!1;for(let k=0;k<b.length;k++){const c=b[k].target.nodeName;if("TABLE"===c||"TR"===c){d=!0;break}}if(d){d=this.editor.getElementByKey(this.tableNodeKey);if(!d)throw Error("Expected to find TableElement in DOM");this.grid=F(d)}})});this.editor.update(()=>{let b=this.editor.getElementByKey(this.tableNodeKey);if(!b)throw Error("Expected to find TableElement in DOM");this.grid=F(b);a.observe(b,{childList:!0,subtree:!0})})}clearHighlight(){this.editor.update(()=>{var a=f.$getNodeByKey(this.tableNodeKey); | ||
if(!G(a))throw Error("Expected TableNode.");a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a=F(a);this.isHighlightingCells=!1;this.currentY=this.currentX=this.startY=this.startX=-1;this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null;this.hasHijackedSelectionStyles=!1;H(a,null);f.$setSelection(null);this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND,void 0);this.enableHighlightStyle()})}enableHighlightStyle(){this.editor.update(()=> | ||
{let a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a.classList.remove("disable-selection");this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){this.editor.update(()=>{let a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a.classList.add("disable-selection");this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(a){if(null!=a){this.gridSelection=a;this.isHighlightingCells= | ||
!0;this.disableHighlightStyle();let b=this.editor.getElementByKey(a.anchor.key);a=this.editor.getElementByKey(a.focus.key);b&&a&&window.getSelection().setBaseAndExtent(b,0,a,0);H(this.grid,this.gridSelection)}else this.clearHighlight()}adjustFocusCellForSelection(a,b=!1){this.editor.update(()=>{var d=f.$getNodeByKey(this.tableNodeKey);if(!G(d))throw Error("Expected TableNode.");if(!this.editor.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");d=a.x;let k=a.y;this.focusCell= | ||
a;let c=window.getSelection();null!==this.anchorCell&&c.setBaseAndExtent(this.anchorCell.elem,0,a.elem,0);if(!this.isHighlightingCells&&(this.startX!==d||this.startY!==k||b))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(d===this.currentX&&k===this.currentY)return;this.currentX=d;this.currentY=k;this.isHighlightingCells&&(d=f.$getNearestNodeFromDOMNode(a.elem),null!=this.gridSelection&&null!=this.anchorCellNodeKey&&y(d)&&(d=d.getKey(),this.gridSelection=f.$createGridSelection(), | ||
this.focusCellNodeKey=d,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),f.$setSelection(this.gridSelection),this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND,void 0),H(this.grid,this.gridSelection)))})}setAnchorCellForSelection(a){this.editor.update(()=>{this.anchorCell=a;this.startX=a.x;this.startY=a.y;window.getSelection().setBaseAndExtent(a.elem,0,a.elem,0);var b=f.$getNearestNodeFromDOMNode(a.elem);y(b)&&(b=b.getKey(),this.gridSelection=f.$createGridSelection(), | ||
this.anchorCellNodeKey=b)})}formatCells(a){this.editor.update(()=>{let b=f.$getSelection();f.$isGridSelection(b)||D(11);let d=f.$createRangeSelection(),k=d.anchor,c=d.focus;b.getNodes().forEach(h=>{y(h)&&0!==h.getTextContentSize()&&(k.set(h.getKey(),0,"element"),c.set(h.getKey(),h.getChildrenSize(),"element"),d.formatText(a))});f.$setSelection(b);this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){this.editor.update(()=>{let a=f.$getNodeByKey(this.tableNodeKey);if(!G(a))throw Error("Expected TableNode."); | ||
var b=f.$getSelection();f.$isGridSelection(b)||D(11);b=b.getNodes().filter(y);b.length===this.grid.columns*this.grid.rows?(a.selectPrevious(),a.remove(),this.clearHighlight()):(b.forEach(d=>{if(f.$isElementNode(d)){let k=f.$createParagraphNode(),c=f.$createTextNode();k.append(c);d.append(k);d.getChildren().forEach(h=>{h!==k&&h.remove()})}}),H(this.grid,null),f.$setSelection(null),this.editor.dispatchCommand(f.SELECTION_CHANGE_COMMAND,void 0))})}} | ||
function I(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 F(a){let b=[],d={cells:b,columns:0,rows:0};var k=a.firstChild;let c=a=0;for(b.length=0;null!=k;){var h=k.nodeName;if("TD"===h||"TH"===h)h={elem:k,highlighted:!1,x:a,y:c},k._cell=h,void 0===b[c]&&(b[c]=[]),b[c][a]=h;else if(h=k.firstChild,null!=h){k=h;continue}h=k.nextSibling;if(null!=h)a++,k=h;else if(h=k.parentNode,null!=h){k=h.nextSibling;if(null==k)break;c++;a=0}}d.columns=a+1;d.rows=c+1;return d} | ||
function H(a,b){let d=[],k=new Set(b?b.getNodes():[]);J(a,(c,h)=>{let n=c.elem;k.has(h)?(c.highlighted=!0,n.style.setProperty("background-color","rgb(172, 206, 247)"),n.style.setProperty("caret-color","transparent"),d.push(c)):(c.highlighted=!1,n.style.removeProperty("background-color"),n.style.removeProperty("caret-color"),n.getAttribute("style")||n.removeAttribute("style"))});return d} | ||
function J(a,b){({cells:a}=a);for(let d=0;d<a.length;d++){let k=a[d];for(let c=0;c<k.length;c++){let h=k[c],n=f.$getNearestNodeFromDOMNode(h.elem);null!==n&&b(h,n,{x:c,y:d})}}}function K(a){a.disableHighlightStyle();J(a.grid,b=>{let d=b.elem;b.highlighted=!0;d.style.setProperty("background-color","rgb(172, 206, 247)");d.style.setProperty("caret-color","transparent")})} | ||
function O(a){a.enableHighlightStyle();J(a.grid,b=>{let d=b.elem;b.highlighted=!1;d.style.removeProperty("background-color");d.style.removeProperty("caret-color");d.getAttribute("style")||d.removeAttribute("style")})} | ||
let Q=(a,b,d,k,c)=>{const h="forward"===c;switch(c){case "backward":case "forward":return d!==(h?a.grid.columns-1:0)?P(b.getCellNodeFromCordsOrThrow(d+(h?1:-1),k,a.grid)):k!==(h?a.grid.rows-1:0)?P(b.getCellNodeFromCordsOrThrow(h?0:a.grid.columns-1,k+(h?1:-1),a.grid)):h?b.selectNext():b.selectPrevious(),!0;case "up":return 0!==k?P(b.getCellNodeFromCordsOrThrow(d,k-1,a.grid)):b.selectPrevious(),!0;case "down":return k!==a.grid.rows-1?P(b.getCellNodeFromCordsOrThrow(d,k+1,a.grid)):b.selectNext(),!0; | ||
default:return!1}},R=(a,b,d,k,c)=>{const h="forward"===c;switch(c){case "backward":case "forward":return d!==(h?a.grid.columns-1:0)&&a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d+(h?1:-1),k,a.grid)),!0;case "up":return 0!==k?(a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d,k-1,a.grid)),!0):!1;case "down":return k!==a.grid.rows-1?(a.adjustFocusCellForSelection(b.getCellFromCordsOrThrow(d,k+1,a.grid)),!0):!1;default:return!1}}; | ||
function S(a,b){if(f.$isRangeSelection(a)||f.$isGridSelection(a)){let d=b.isParentOf(a.anchor.getNode());a=b.isParentOf(a.focus.getNode());return d&&a}return!1}function P(a){let b=a.getChildren().find(d=>f.$isParagraphNode(d));f.$isParagraphNode(b)?b.selectEnd():a.selectEnd()} | ||
class T extends f.GridNode{static getType(){return"table"}static clone(a){return new T(a.__key)}static importDOM(){return{table:()=>({conversion:U,priority:0})}}static importJSON(){return V()}constructor(a){super(a)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(a){let b=document.createElement("table");p.addClassNamesToElement(b,a.theme.table);return b}updateDOM(){return!1}exportDOM(a){return{...super.exportDOM(a),after:b=>{if(b){let d=b.cloneNode(),k=document.createElement("colgroup"), | ||
c=document.createElement("tbody");c.append(...b.children);b=this.getFirstChildOrThrow();if(!C(b))throw Error("Expected to find row node.");b=b.getChildrenSize();for(let h=0;h<b;h++){let n=document.createElement("col");k.append(n)}d.replaceChildren(k,c);return d}}}}canExtractContents(){return!1}canBeEmpty(){return!1}getCordsFromCellNode(a,b){let {rows:d,cells:k}=b;for(b=0;b<d;b++){var c=k[b];if(null==c)throw Error(`Row not found at y:${b}`);c=c.findIndex(({elem:h})=>f.$getNearestNodeFromDOMNode(h)=== | ||
a);if(-1!==c)return{x:c,y:b}}throw Error("Cell not found in table.");}getCellFromCords(a,b,d){({cells:d}=d);b=d[b];if(null==b)return null;a=b[a];return null==a?null:a}getCellFromCordsOrThrow(a,b,d){a=this.getCellFromCords(a,b,d);if(!a)throw Error("Cell not found at cords.");return a}getCellNodeFromCords(a,b,d){a=this.getCellFromCords(a,b,d);if(null==a)return null;a=f.$getNearestNodeFromDOMNode(a.elem);return y(a)?a:null}getCellNodeFromCordsOrThrow(a,b,d){a=this.getCellNodeFromCords(a,b,d);if(!a)throw Error("Node at cords not TableCellNode."); | ||
return a}canSelectBefore(){return!0}canIndent(){return!1}}function U(){return{node:V()}}function V(){return new T}function G(a){return a instanceof T}function W(a){a=p.$findMatchingParent(a,b=>C(b));if(C(a))return a;throw Error("Expected table cell to be inside of table row.");}function X(a){a=p.$findMatchingParent(a,b=>G(b));if(G(a))return a;throw Error("Expected table cell to be inside of table.");}let Y=f.createCommand();exports.$createTableCellNode=x;exports.$createTableNode=V; | ||
exports.$createTableNodeWithDimensions=function(a,b,d=!0){let k=V();for(let h=0;h<a;h++){let n=B();for(let r=0;r<b;r++){var c=q.NO_STATUS;d&&(0===h&&(c|=q.ROW),0===r&&(c|=q.COLUMN));c=x(c);let v=f.$createParagraphNode();v.append(f.$createTextNode());c.append(v);n.append(c)}k.append(n)}return k};exports.$createTableRowNode=B; | ||
exports.$deleteTableColumn=function(a,b){let d=a.getChildren();for(let c=0;c<d.length;c++){var k=d[c];if(C(k)){k=k.getChildren();if(b>=k.length||0>b)throw Error("Table column target index out of range");k[b].remove()}}return a};exports.$getElementGridForTableNode=function(a,b){a=a.getElementByKey(b.getKey());if(null==a)throw Error("Table Element Not Found");return F(a)};exports.$getTableCellNodeFromLexicalNode=function(a){a=p.$findMatchingParent(a,b=>y(b));return y(a)?a:null}; | ||
exports.$getTableColumnIndexFromTableCellNode=function(a){return W(a).getChildren().findIndex(b=>b.is(a))};exports.$getTableNodeFromLexicalNodeOrThrow=X;exports.$getTableRowIndexFromTableCellNode=function(a){let b=W(a);return X(b).getChildren().findIndex(d=>d.is(b))};exports.$getTableRowNodeFromTableCellNodeOrThrow=W; | ||
exports.$insertTableColumn=function(a,b,d=!0,k){let c=a.getChildren();for(let r=0;r<c.length;r++){let v=c[r];if(C(v))for(let g=0;g<k;g++){var h=q.NO_STATUS;0===r&&(h|=q.ROW);h=x(h);h.append(f.$createParagraphNode());var n=v.getChildren();if(b>=n.length||0>b)throw Error("Table column target index out of range");n=n[b];d?n.insertAfter(h):n.insertBefore(h)}}return a}; | ||
exports.$insertTableRow=function(a,b,d=!0,k,c){var h=a.getChildren();if(b>=h.length||0>b)throw Error("Table row target index out of range");b=h[b];if(C(b))for(h=0;h<k;h++){let v=b.getChildren(),g=v.length,e=B();for(let l=0;l<g;l++){var n=v[l];y(n)||D(12);var r=c;let m=X(n),{x:u,y:L}=m.getCordsFromCellNode(n,r);n={above:m.getCellNodeFromCords(u,L-1,r),below:m.getCellNodeFromCords(u,L+1,r),left:m.getCellNodeFromCords(u-1,L,r),right:m.getCellNodeFromCords(u+1,L,r)};let {above:M,below:N}=n;n=q.NO_STATUS; | ||
r=M&&M.getWidth()||N&&N.getWidth()||null;if(M&&M.hasHeaderState(q.COLUMN)||N&&N.hasHeaderState(q.COLUMN))n|=q.COLUMN;n=x(n,1,r);n.append(f.$createParagraphNode());e.append(n)}d?b.insertAfter(e):b.insertBefore(e)}else throw Error("Row before insertion index does not exist.");return a};exports.$isTableCellNode=y;exports.$isTableNode=G;exports.$isTableRowNode=C; | ||
exports.$removeTableRowAtIndex=function(a,b){let d=a.getChildren();if(b>=d.length||0>b)throw Error("Expected table cell to be inside of table row.");d[b].remove();return a};exports.INSERT_TABLE_COMMAND=Y;exports.TableCellHeaderStates=q;exports.TableCellNode=t;exports.TableNode=T;exports.TableRowNode=z;exports.TableSelection=E; | ||
exports.applyTableHandlers=function(a,b,d){let k=d.getRootElement();if(null===k)throw Error("No root element.");let c=new E(d,a.getKey());b.__lexicalTableSelection=c;let h=!1,n=!1;b.addEventListener("dblclick",g=>{let e=I(g.target);null!==e&&(g.preventDefault(),g.stopImmediatePropagation(),g.stopPropagation(),c.setAnchorCellForSelection(e),c.adjustFocusCellForSelection(e,!0),h=!1)});b.addEventListener("mousedown",g=>{setTimeout(()=>{if(0===g.button){var e=I(g.target);null!==e&&(c.setAnchorCellForSelection(e), | ||
document.addEventListener("mouseup",()=>{h=!1},{capture:!0,once:!0}))}},0)});b.addEventListener("mousemove",g=>{n&&(g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation());if(h){let e=I(g.target);if(null!==e){let l=e.x,m=e.y;h&&(c.startX!==l||c.startY!==m||c.isHighlightingCells)&&(g.preventDefault(),h=!0,c.adjustFocusCellForSelection(e))}}});b.addEventListener("mouseup",()=>{h&&(h=!1)});b.addEventListener("mouseleave",()=>{});let r=g=>{h=!0;0===g.button&&d.update(()=>{const e=f.$getSelection(); | ||
if(f.$isGridSelection(e)&&e.gridKey===c.tableNodeKey&&k.contains(g.target))return c.clearHighlight()})};window.addEventListener("mousedown",r);c.listenersToRemove.add(()=>window.removeEventListener("mousedown",r));let v=()=>{h=!1};window.addEventListener("mouseup",v);c.listenersToRemove.add(()=>window.removeEventListener("mouseup",v));c.listenersToRemove.add(d.registerCommand(f.KEY_ARROW_DOWN_COMMAND,g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){if(e.isCollapsed()){var l= | ||
p.$findMatchingParent(e.anchor.getNode(),u=>y(u));if(!y(l))return!1;var m=a.getCordsFromCellNode(l,c.grid);e=p.$findMatchingParent(e.anchor.getNode(),u=>f.$isElementNode(u));if(null==e)throw Error("Expected BlockNode Parent");if((l=l.getLastChild())&&e.isParentOf(l)||e===l||g.shiftKey)return g.preventDefault(),g.stopImmediatePropagation(),g.stopPropagation(),g.shiftKey?(c.setAnchorCellForSelection(a.getCellFromCordsOrThrow(m.x,m.y,c.grid)),R(c,a,m.x,m.y,"down")):Q(c,a,m.x,m.y,"down")}}else if(f.$isGridSelection(e)&& | ||
@@ -55,8 +54,8 @@ g.shiftKey){m=e.focus.getNode();if(!y(m))return!1;m=a.getCordsFromCellNode(m,c.grid);g.preventDefault();g.stopImmediatePropagation();g.stopPropagation();return R(c,a,m.x,m.y,"down")}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_ARROW_UP_COMMAND,g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){if(e.isCollapsed()){var l=p.$findMatchingParent(e.anchor.getNode(),u=>y(u));if(!y(l))return!1;var m=a.getCordsFromCellNode(l,c.grid);e=p.$findMatchingParent(e.anchor.getNode(), | ||
g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){if(e.isCollapsed()){var l=p.$findMatchingParent(e.anchor.getNode(),m=>y(m));if(!y(l))return!1;l=a.getCordsFromCellNode(l,c.grid);if(null==p.$findMatchingParent(e.anchor.getNode(),m=>f.$isElementNode(m)))throw Error("Expected BlockNode Parent");if(e.anchor.offset===e.anchor.getNode().getTextContentSize()||g.shiftKey)return g.preventDefault(),g.stopImmediatePropagation(),g.stopPropagation(),g.shiftKey?(c.setAnchorCellForSelection(a.getCellFromCordsOrThrow(l.x, | ||
l.y,c.grid)),R(c,a,l.x,l.y,"forward")):Q(c,a,l.x,l.y,"forward")}}else if(f.$isGridSelection(e)&&g.shiftKey){e=e.focus.getNode();if(!y(e))return!1;e=a.getCordsFromCellNode(e,c.grid);g.preventDefault();g.stopImmediatePropagation();g.stopPropagation();return R(c,a,e.x,e.y,"forward")}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.DELETE_CHARACTER_COMMAND,()=>{const g=f.$getSelection();if(!S(g,a))return!1;if(f.$isGridSelection(g))return c.clearText(),!0;if(f.$isRangeSelection(g)){var e= | ||
p.$findMatchingParent(g.anchor.getNode(),l=>y(l));if(!y(e))return!1;e=p.$findMatchingParent(g.anchor.getNode(),l=>f.$isParagraphNode(l));if(!f.$isParagraphNode(e))return!1;if(g.isCollapsed()&&0===g.anchor.offset&&0===e.getPreviousSiblings().length)return!0}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_BACKSPACE_COMMAND,g=>{const e=f.$getSelection();if(!S(e,a))return!1;if(f.$isGridSelection(e))return g.preventDefault(),g.stopPropagation(),c.clearText(),!0; | ||
f.$isRangeSelection(e)&&(g=p.$findMatchingParent(e.anchor.getNode(),l=>y(l)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.FORMAT_TEXT_COMMAND,g=>{const e=f.$getSelection();if(!S(e,a))return!1;if(f.$isGridSelection(e))return c.formatCells(g),!0;f.$isRangeSelection(e)&&(g=p.$findMatchingParent(e.anchor.getNode(),l=>y(l)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.INSERT_TEXT_COMMAND,()=>{var g=f.$getSelection(); | ||
if(!S(g,a))return!1;f.$isGridSelection(g)?c.clearHighlight():f.$isRangeSelection(g)&&(g=p.$findMatchingParent(g.anchor.getNode(),e=>y(e)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_TAB_COMMAND,g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){const l=p.$findMatchingParent(e.anchor.getNode(),m=>y(m));if(!y(l))return!1;if(e.isCollapsed())return e=a.getCordsFromCellNode(l,c.grid),g.preventDefault(),Q(c,a,e.x,e.y,g.shiftKey?"backward": | ||
"forward"),!0}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.FOCUS_COMMAND,()=>a.isSelected(),f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.SELECTION_CHANGE_COMMAND,()=>{const g=f.$getSelection();var e=f.$getPreviousSelection();if(g!==e&&(f.$isGridSelection(g)||f.$isGridSelection(e))&&c.gridSelection!==g)return c.updateTableGridSelection(f.$isGridSelection(g)&&a.isSelected()?g:null),!1;if(g&&f.$isRangeSelection(g)&&!g.isCollapsed()){var l= | ||
g.anchor.getNode();e=g.focus.getNode();l=a.isParentOf(l);e=a.isParentOf(e);if(l&&!e||e&&!l){e=g.isBackward();l=f.$createRangeSelection();const m=a.getIndexWithinParent(),u=a.getParentOrThrow().getKey();l.anchor.set(g.anchor.key,g.anchor.offset,g.anchor.type);l.focus.set(u,e?m-1:m+1,"element");n=!0;f.$setSelection(l);K(c);return!0}}c.hasHijackedSelectionStyles&&!a.isSelected()?(O(c),n=!1):!c.hasHijackedSelectionStyles&&a.isSelected()&&K(c);return!1},f.COMMAND_PRIORITY_CRITICAL));return c}; | ||
exports.getCellFromTarget=I;exports.getTableSelectionFromTableElement=function(a){return a.__lexicalTableSelection}; | ||
l.y,c.grid)),R(c,a,l.x,l.y,"forward")):Q(c,a,l.x,l.y,"forward")}}else if(f.$isGridSelection(e)&&g.shiftKey){e=e.focus.getNode();if(!y(e))return!1;e=a.getCordsFromCellNode(e,c.grid);g.preventDefault();g.stopImmediatePropagation();g.stopPropagation();return R(c,a,e.x,e.y,"forward")}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.DELETE_CHARACTER_COMMAND,()=>{let g=f.$getSelection();if(!S(g,a))return!1;if(f.$isGridSelection(g))return c.clearText(),!0;if(f.$isRangeSelection(g)){var e= | ||
p.$findMatchingParent(g.anchor.getNode(),l=>y(l));if(!y(e))return!1;e=p.$findMatchingParent(g.anchor.getNode(),l=>f.$isParagraphNode(l));if(!f.$isParagraphNode(e))return!1;if(g.isCollapsed()&&0===g.anchor.offset&&0===e.getPreviousSiblings().length)return!0}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_BACKSPACE_COMMAND,g=>{let e=f.$getSelection();if(!S(e,a))return!1;if(f.$isGridSelection(e))return g.preventDefault(),g.stopPropagation(),c.clearText(),!0;f.$isRangeSelection(e)&& | ||
(g=p.$findMatchingParent(e.anchor.getNode(),l=>y(l)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.FORMAT_TEXT_COMMAND,g=>{let e=f.$getSelection();if(!S(e,a))return!1;if(f.$isGridSelection(e))return c.formatCells(g),!0;f.$isRangeSelection(e)&&(g=p.$findMatchingParent(e.anchor.getNode(),l=>y(l)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var g=f.$getSelection();if(!S(g, | ||
a))return!1;f.$isGridSelection(g)?c.clearHighlight():f.$isRangeSelection(g)&&(g=p.$findMatchingParent(g.anchor.getNode(),e=>y(e)),y(g));return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_TAB_COMMAND,g=>{var e=f.$getSelection();if(!S(e,a))return!1;if(f.$isRangeSelection(e)){let l=p.$findMatchingParent(e.anchor.getNode(),m=>y(m));if(!y(l))return!1;if(e.isCollapsed())return e=a.getCordsFromCellNode(l,c.grid),g.preventDefault(),Q(c,a,e.x,e.y,g.shiftKey?"backward": | ||
"forward"),!0}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.FOCUS_COMMAND,()=>a.isSelected(),f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.SELECTION_CHANGE_COMMAND,()=>{let g=f.$getSelection();var e=f.$getPreviousSelection();if(g!==e&&(f.$isGridSelection(g)||f.$isGridSelection(e))&&c.gridSelection!==g)return c.updateTableGridSelection(f.$isGridSelection(g)&&a.isSelected()?g:null),!1;if(g&&f.$isRangeSelection(g)&&!g.isCollapsed()){var l= | ||
g.anchor.getNode();e=g.focus.getNode();l=a.isParentOf(l);e=a.isParentOf(e);if(l&&!e||e&&!l){e=g.isBackward();l=f.$createRangeSelection();let m=a.getIndexWithinParent(),u=a.getParentOrThrow().getKey();l.anchor.set(g.anchor.key,g.anchor.offset,g.anchor.type);l.focus.set(u,e?m-1:m+1,"element");n=!0;f.$setSelection(l);K(c);return!0}}c.hasHijackedSelectionStyles&&!a.isSelected()?(O(c),n=!1):!c.hasHijackedSelectionStyles&&a.isSelected()&&K(c);return!1},f.COMMAND_PRIORITY_CRITICAL));return c}; | ||
exports.getCellFromTarget=I;exports.getTableSelectionFromTableElement=function(a){return a.__lexicalTableSelection} |
@@ -11,9 +11,9 @@ { | ||
"license": "MIT", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"main": "LexicalTable.js", | ||
"peerDependencies": { | ||
"lexical": "0.2.9" | ||
"lexical": "0.3.0" | ||
}, | ||
"dependencies": { | ||
"@lexical/utils": "0.2.9" | ||
"@lexical/utils": "0.3.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "repository": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
91700
0
+ Added@lexical/list@0.3.0(transitive)
+ Added@lexical/utils@0.3.0(transitive)
+ Addedlexical@0.3.0(transitive)
- Removed@lexical/list@0.2.9(transitive)
- Removed@lexical/utils@0.2.9(transitive)
- Removedlexical@0.2.9(transitive)
Updated@lexical/utils@0.3.0