@lexical/table 0.1.21 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LexicalTable.dev.js +96 -36
- package/LexicalTable.prod.js +48 -47
- package/package.json +3 -3
package/LexicalTable.dev.js
CHANGED
@@ -313,6 +313,7 @@ class TableSelection {
|
|
313
313
|
this.focusCellNodeKey = null;
|
314
314
|
this.anchorCell = null;
|
315
315
|
this.focusCell = null;
|
316
|
+
this.hasHijackedSelectionStyles = false;
|
316
317
|
this.trackTableGrid();
|
317
318
|
}
|
318
319
|
|
@@ -393,6 +394,7 @@ class TableSelection {
|
|
393
394
|
this.focusCellNodeKey = null;
|
394
395
|
this.anchorCell = null;
|
395
396
|
this.focusCell = null;
|
397
|
+
this.hasHijackedSelectionStyles = false;
|
396
398
|
$updateDOMForSelection(grid, null);
|
397
399
|
lexical.$setSelection(null);
|
398
400
|
this.editor.dispatchCommand(lexical.SELECTION_CHANGE_COMMAND);
|
@@ -409,6 +411,7 @@ class TableSelection {
|
|
409
411
|
}
|
410
412
|
|
411
413
|
tableElement.classList.remove('disable-selection');
|
414
|
+
this.hasHijackedSelectionStyles = false;
|
412
415
|
});
|
413
416
|
}
|
414
417
|
|
@@ -421,6 +424,7 @@ class TableSelection {
|
|
421
424
|
}
|
422
425
|
|
423
426
|
tableElement.classList.add('disable-selection');
|
427
|
+
this.hasHijackedSelectionStyles = true;
|
424
428
|
});
|
425
429
|
}
|
426
430
|
|
@@ -573,7 +577,6 @@ class TableSelection {
|
|
573
577
|
*
|
574
578
|
*
|
575
579
|
*/
|
576
|
-
const CriticalPriority = 4;
|
577
580
|
const LEXICAL_ELEMENT_KEY = '__lexicalTableSelection';
|
578
581
|
function applyTableHandlers(tableNode, tableElement, editor) {
|
579
582
|
const rootElement = editor.getRootElement();
|
@@ -683,6 +686,11 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
683
686
|
tableSelection.listenersToRemove.add(() => window.removeEventListener('mouseup', mouseUpCallback));
|
684
687
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_DOWN_COMMAND, payload => {
|
685
688
|
const selection = lexical.$getSelection();
|
689
|
+
|
690
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
691
|
+
return false;
|
692
|
+
}
|
693
|
+
|
686
694
|
const event = payload;
|
687
695
|
const direction = 'down';
|
688
696
|
|
@@ -732,9 +740,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
732
740
|
}
|
733
741
|
|
734
742
|
return false;
|
735
|
-
},
|
743
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
736
744
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_UP_COMMAND, payload => {
|
737
745
|
const selection = lexical.$getSelection();
|
746
|
+
|
747
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
748
|
+
return false;
|
749
|
+
}
|
750
|
+
|
738
751
|
const event = payload;
|
739
752
|
const direction = 'up';
|
740
753
|
|
@@ -784,9 +797,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
784
797
|
}
|
785
798
|
|
786
799
|
return false;
|
787
|
-
},
|
800
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
788
801
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_LEFT_COMMAND, payload => {
|
789
802
|
const selection = lexical.$getSelection();
|
803
|
+
|
804
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
805
|
+
return false;
|
806
|
+
}
|
807
|
+
|
790
808
|
const event = payload;
|
791
809
|
const direction = 'backward';
|
792
810
|
|
@@ -833,9 +851,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
833
851
|
}
|
834
852
|
|
835
853
|
return false;
|
836
|
-
},
|
854
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
837
855
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_ARROW_RIGHT_COMMAND, payload => {
|
838
856
|
const selection = lexical.$getSelection();
|
857
|
+
|
858
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
859
|
+
return false;
|
860
|
+
}
|
861
|
+
|
839
862
|
const event = payload;
|
840
863
|
const direction = 'forward';
|
841
864
|
|
@@ -882,10 +905,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
882
905
|
}
|
883
906
|
|
884
907
|
return false;
|
885
|
-
},
|
908
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
886
909
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.DELETE_CHARACTER_COMMAND, () => {
|
887
910
|
const selection = lexical.$getSelection();
|
888
911
|
|
912
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
913
|
+
return false;
|
914
|
+
}
|
915
|
+
|
889
916
|
if (lexical.$isGridSelection(selection)) {
|
890
917
|
tableSelection.clearText();
|
891
918
|
return true;
|
@@ -902,10 +929,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
902
929
|
}
|
903
930
|
|
904
931
|
return false;
|
905
|
-
},
|
932
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
906
933
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_BACKSPACE_COMMAND, payload => {
|
907
934
|
const selection = lexical.$getSelection();
|
908
935
|
|
936
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
937
|
+
return false;
|
938
|
+
}
|
939
|
+
|
909
940
|
if (lexical.$isGridSelection(selection)) {
|
910
941
|
const event = payload;
|
911
942
|
event.preventDefault();
|
@@ -921,10 +952,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
921
952
|
}
|
922
953
|
|
923
954
|
return false;
|
924
|
-
},
|
955
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
925
956
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.FORMAT_TEXT_COMMAND, payload => {
|
926
957
|
const selection = lexical.$getSelection();
|
927
958
|
|
959
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
960
|
+
return false;
|
961
|
+
}
|
962
|
+
|
928
963
|
if (lexical.$isGridSelection(selection)) {
|
929
964
|
tableSelection.formatCells(payload);
|
930
965
|
return true;
|
@@ -937,10 +972,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
937
972
|
}
|
938
973
|
|
939
974
|
return false;
|
940
|
-
},
|
975
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
941
976
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.INSERT_TEXT_COMMAND, payload => {
|
942
977
|
const selection = lexical.$getSelection();
|
943
978
|
|
979
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
980
|
+
return false;
|
981
|
+
}
|
982
|
+
|
944
983
|
if (lexical.$isGridSelection(selection)) {
|
945
984
|
tableSelection.clearHighlight();
|
946
985
|
return false;
|
@@ -953,10 +992,14 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
953
992
|
}
|
954
993
|
|
955
994
|
return false;
|
956
|
-
},
|
995
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
957
996
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.KEY_TAB_COMMAND, payload => {
|
958
997
|
const selection = lexical.$getSelection();
|
959
998
|
|
999
|
+
if (!$isSelectionInTable(selection, tableNode)) {
|
1000
|
+
return false;
|
1001
|
+
}
|
1002
|
+
|
960
1003
|
if (lexical.$isRangeSelection(selection)) {
|
961
1004
|
const tableCellNode = utils.$findMatchingParent(selection.anchor.getNode(), n => $isTableCellNode(n));
|
962
1005
|
|
@@ -975,7 +1018,10 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
975
1018
|
}
|
976
1019
|
|
977
1020
|
return false;
|
978
|
-
},
|
1021
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
1022
|
+
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.FOCUS_COMMAND, payload => {
|
1023
|
+
return tableNode.isSelected();
|
1024
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
979
1025
|
tableSelection.listenersToRemove.add(editor.registerCommand(lexical.SELECTION_CHANGE_COMMAND, payload => {
|
980
1026
|
const selection = lexical.$getSelection();
|
981
1027
|
|
@@ -988,43 +1034,28 @@ function applyTableHandlers(tableNode, tableElement, editor) {
|
|
988
1034
|
|
989
1035
|
if (containsPartialTable) {
|
990
1036
|
const isBackward = selection.isBackward();
|
991
|
-
const startNode = isBackward ? focusNode : anchorNode;
|
992
1037
|
const modifiedSelection = lexical.$createRangeSelection();
|
993
1038
|
const tableIndex = tableNode.getIndexWithinParent();
|
994
1039
|
const parentKey = tableNode.getParentOrThrow().getKey();
|
1040
|
+
modifiedSelection.anchor.set(selection.anchor.key, selection.anchor.offset, selection.anchor.type); // Set selection to before or after table on the root node.
|
1041
|
+
|
1042
|
+
modifiedSelection.focus.set(parentKey, isBackward ? tableIndex - 1 : tableIndex + 1, 'element');
|
995
1043
|
isRangeSelectionHijacked = true;
|
996
|
-
tableSelection.disableHighlightStyle();
|
997
|
-
(isBackward ? modifiedSelection.focus : modifiedSelection.anchor).set(startNode.getKey(), (isBackward ? selection.focus : selection.anchor).offset, lexical.$isTextNode(startNode) ? 'text' : 'element');
|
998
|
-
(isBackward ? modifiedSelection.anchor : modifiedSelection.focus).set(parentKey, isBackward ? tableIndex - 1 : tableIndex + 1, 'element');
|
999
1044
|
lexical.$setSelection(modifiedSelection);
|
1000
|
-
$
|
1001
|
-
const elem = cell.elem;
|
1002
|
-
cell.highlighted = true;
|
1003
|
-
elem.style.setProperty('background-color', 'rgb(172, 206, 247)');
|
1004
|
-
elem.style.setProperty('caret-color', 'transparent');
|
1005
|
-
});
|
1045
|
+
$addHighlightStyleToTable(tableSelection);
|
1006
1046
|
return true;
|
1007
1047
|
}
|
1008
1048
|
}
|
1009
1049
|
|
1010
|
-
if (
|
1011
|
-
tableSelection
|
1012
|
-
$forEachGridCell(tableSelection.grid, cell => {
|
1013
|
-
const elem = cell.elem;
|
1014
|
-
cell.highlighted = false;
|
1015
|
-
elem.style.removeProperty('background-color');
|
1016
|
-
elem.style.removeProperty('caret-color');
|
1017
|
-
|
1018
|
-
if (!elem.getAttribute('style')) {
|
1019
|
-
elem.removeAttribute('style');
|
1020
|
-
}
|
1021
|
-
});
|
1050
|
+
if (tableSelection.hasHijackedSelectionStyles && !tableNode.isSelected()) {
|
1051
|
+
$removeHighlightStyleToTable(tableSelection);
|
1022
1052
|
isRangeSelectionHijacked = false;
|
1023
|
-
|
1053
|
+
} else if (!tableSelection.hasHijackedSelectionStyles && tableNode.isSelected()) {
|
1054
|
+
$addHighlightStyleToTable(tableSelection);
|
1024
1055
|
}
|
1025
1056
|
|
1026
1057
|
return false;
|
1027
|
-
},
|
1058
|
+
}, lexical.COMMAND_PRIORITY_CRITICAL));
|
1028
1059
|
return tableSelection;
|
1029
1060
|
}
|
1030
1061
|
function attachTableSelectionToTableElement(tableElement, tableSelection) {
|
@@ -1149,7 +1180,6 @@ function $updateDOMForSelection(grid, selection) {
|
|
1149
1180
|
return highlightedCells;
|
1150
1181
|
}
|
1151
1182
|
function $forEachGridCell(grid, cb) {
|
1152
|
-
const highlightedCells = [];
|
1153
1183
|
const {
|
1154
1184
|
cells
|
1155
1185
|
} = grid;
|
@@ -1169,8 +1199,28 @@ function $forEachGridCell(grid, cb) {
|
|
1169
1199
|
}
|
1170
1200
|
}
|
1171
1201
|
}
|
1202
|
+
}
|
1203
|
+
function $addHighlightStyleToTable(tableSelection) {
|
1204
|
+
tableSelection.disableHighlightStyle();
|
1205
|
+
$forEachGridCell(tableSelection.grid, cell => {
|
1206
|
+
const elem = cell.elem;
|
1207
|
+
cell.highlighted = true;
|
1208
|
+
elem.style.setProperty('background-color', 'rgb(172, 206, 247)');
|
1209
|
+
elem.style.setProperty('caret-color', 'transparent');
|
1210
|
+
});
|
1211
|
+
}
|
1212
|
+
function $removeHighlightStyleToTable(tableSelection) {
|
1213
|
+
tableSelection.enableHighlightStyle();
|
1214
|
+
$forEachGridCell(tableSelection.grid, cell => {
|
1215
|
+
const elem = cell.elem;
|
1216
|
+
cell.highlighted = false;
|
1217
|
+
elem.style.removeProperty('background-color');
|
1218
|
+
elem.style.removeProperty('caret-color');
|
1172
1219
|
|
1173
|
-
|
1220
|
+
if (!elem.getAttribute('style')) {
|
1221
|
+
elem.removeAttribute('style');
|
1222
|
+
}
|
1223
|
+
});
|
1174
1224
|
}
|
1175
1225
|
|
1176
1226
|
const selectGridNodeInDirection = (tableSelection, tableNode, x, y, direction) => {
|
@@ -1259,6 +1309,16 @@ const adjustFocusNodeInDirection = (tableSelection, tableNode, x, y, direction)
|
|
1259
1309
|
return false;
|
1260
1310
|
};
|
1261
1311
|
|
1312
|
+
function $isSelectionInTable(selection, tableNode) {
|
1313
|
+
if (lexical.$isRangeSelection(selection) || lexical.$isGridSelection(selection)) {
|
1314
|
+
const isAnchorInside = tableNode.isParentOf(selection.anchor.getNode());
|
1315
|
+
const isFocusInside = tableNode.isParentOf(selection.focus.getNode());
|
1316
|
+
return isAnchorInside && isFocusInside;
|
1317
|
+
}
|
1318
|
+
|
1319
|
+
return false;
|
1320
|
+
}
|
1321
|
+
|
1262
1322
|
function selectTableCellNode(tableCell) {
|
1263
1323
|
const possibleParagraph = tableCell.getChildren().find(n => lexical.$isParagraphNode(n));
|
1264
1324
|
|
package/LexicalTable.prod.js
CHANGED
@@ -4,54 +4,55 @@
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
var
|
8
|
-
class
|
7
|
+
var f=require("lexical"),p=require("@lexical/utils");const q={NO_STATUS:0,ROW:1,COLUMN:2,BOTH:3};
|
8
|
+
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);
|
9
9
|
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=
|
10
10
|
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}}
|
11
|
-
function
|
12
|
-
function
|
13
|
-
class
|
14
|
-
this.__height}canBeEmpty(){return!1}}function
|
11
|
+
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}
|
12
|
+
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.");}
|
13
|
+
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!==
|
14
|
+
this.__height}canBeEmpty(){return!1}}function B(){return{node:C()}}function C(a){return new A(a)}function D(a){return a instanceof A}
|
15
15
|
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&&
|
16
16
|
document.body.append(a)}
|
17
|
-
class
|
18
|
-
{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=
|
19
|
-
if(!
|
20
|
-
{const a=this.editor.getElementByKey(this.tableNodeKey);if(!a)throw Error("Expected to find TableElement in DOM");a.classList.remove("disable-selection")})}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")})}adjustFocusCellForSelection(a,b=!1){this.editor.update(()=>{var d=
|
21
|
-
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&&
|
22
|
-
null!=this.gridSelection&&null!=this.anchorCellNodeKey&&
|
23
|
-
0,a.elem,0);var b=
|
24
|
-
{const a=
|
25
|
-
function
|
26
|
-
function
|
27
|
-
function
|
28
|
-
function
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
b
|
35
|
-
|
36
|
-
|
37
|
-
exports.$
|
38
|
-
exports.$
|
39
|
-
exports.$
|
40
|
-
exports.$
|
41
|
-
|
42
|
-
|
43
|
-
exports
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
()=>
|
55
|
-
c.listenersToRemove.add(d.registerCommand(
|
56
|
-
|
57
|
-
|
17
|
+
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=>
|
18
|
+
{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=
|
19
|
+
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(()=>
|
20
|
+
{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})}adjustFocusCellForSelection(a,b=!1){this.editor.update(()=>{var d=f.$getNodeByKey(this.tableNodeKey);
|
21
|
+
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&&
|
22
|
+
(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;
|
23
|
+
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(79);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);
|
24
|
+
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(79);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=>
|
25
|
+
{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}
|
26
|
+
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}
|
27
|
+
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}
|
28
|
+
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 N(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")})}
|
29
|
+
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")})}
|
30
|
+
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},
|
31
|
+
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};
|
32
|
+
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()}
|
33
|
+
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();
|
34
|
+
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(55);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,
|
35
|
+
b,d){d||z(55);({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}}
|
36
|
+
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;
|
37
|
+
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;
|
38
|
+
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};
|
39
|
+
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;
|
40
|
+
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};
|
41
|
+
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(73);var r=c;const m=X(n),{x:u,y:K}=m.getCordsFromCellNode(n,r);n={above:m.getCellNodeFromCords(u,K-1,r),below:m.getCellNodeFromCords(u,K+1,r),left:m.getCellNodeFromCords(u-1,K,r),right:m.getCellNodeFromCords(u+1,K,r)};const {above:L,below:M}=n;n=q.NO_STATUS;
|
42
|
+
r=L&&L.getWidth()||M&&M.getWidth()||null;if(L&&L.hasHeaderState(q.COLUMN)||M&&M.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;
|
43
|
+
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;
|
44
|
+
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),
|
45
|
+
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();
|
46
|
+
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=
|
47
|
+
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)&&
|
48
|
+
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(),
|
49
|
+
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,"up")):Q(c,a,m.x,m.y,"up")}}else if(f.$isGridSelection(e)&&g.shiftKey){m=e.focus.getNode();if(!y(m))return!1;m=a.getCordsFromCellNode(m,c.grid);g.preventDefault();g.stopImmediatePropagation();g.stopPropagation();
|
50
|
+
return R(c,a,m.x,m.y,"up")}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_ARROW_LEFT_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(),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(0===e.anchor.offset||g.shiftKey)return g.preventDefault(),
|
51
|
+
g.stopImmediatePropagation(),g.stopPropagation(),g.shiftKey?(c.setAnchorCellForSelection(a.getCellFromCordsOrThrow(l.x,l.y,c.grid)),R(c,a,l.x,l.y,"backward")):Q(c,a,l.x,l.y,"backward")}}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,"backward")}return!1},f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.KEY_ARROW_RIGHT_COMMAND,
|
52
|
+
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,
|
53
|
+
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)){const e=
|
54
|
+
p.$findMatchingParent(g.anchor.getNode(),l=>y(l));if(!y(e))return!1;if(g.isCollapsed()&&0===g.anchor.offset&&0===g.anchor.getNode().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},
|
55
|
+
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(),
|
56
|
+
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(),
|
57
|
+
f.COMMAND_PRIORITY_CRITICAL));c.listenersToRemove.add(d.registerCommand(f.SELECTION_CHANGE_COMMAND,()=>{const g=f.$getSelection();if(g&&f.$isRangeSelection(g)&&!g.isCollapsed()){var e=g.anchor.getNode(),l=g.focus.getNode();e=a.isParentOf(e);l=a.isParentOf(l);if(e&&!l||l&&!e){l=g.isBackward();e=f.$createRangeSelection();const m=a.getIndexWithinParent(),u=a.getParentOrThrow().getKey();e.anchor.set(g.anchor.key,g.anchor.offset,g.anchor.type);e.focus.set(u,l?m-1:m+1,"element");n=!0;f.$setSelection(e);
|
58
|
+
N(c);return!0}}c.hasHijackedSelectionStyles&&!a.isSelected()?(O(c),n=!1):!c.hasHijackedSelectionStyles&&a.isSelected()&&N(c);return!1},f.COMMAND_PRIORITY_CRITICAL));return c};exports.getCellFromTarget=I;exports.getTableSelectionFromTableElement=function(a){return a.__lexicalTableSelection};
|
package/package.json
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
"table"
|
9
9
|
],
|
10
10
|
"license": "MIT",
|
11
|
-
"version": "0.
|
11
|
+
"version": "0.2.2",
|
12
12
|
"main": "LexicalTable.js",
|
13
13
|
"peerDependencies": {
|
14
|
-
"lexical": "0.
|
14
|
+
"lexical": "0.2.2"
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
|
-
"@lexical/utils": "0.
|
17
|
+
"@lexical/utils": "0.2.2"
|
18
18
|
},
|
19
19
|
"repository": {
|
20
20
|
"type": "git",
|