Comparing version 0.1.7 to 0.1.8
@@ -1,1 +0,9 @@ | ||
'use strict';var b=require("lexical/LinkNode"),c=require("lexical");class e extends b.LinkNode{static getType(){return"autolink"}static clone(a){return new e(a.__url,a.__key)}insertNewAfter(a){a=this.getParentOrThrow().insertNewAfter(a);if(c.$isElementNode(a)){const d=f(this.__url);a.append(d);return d}return null}canInsertTextAfter(){return!0}}function f(a){return new e(a)}exports.$createAutoLinkNode=f;exports.$isAutoLinkNode=function(a){return a instanceof e};exports.AutoLinkNode=e; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalAutoLinkNode = process.env.NODE_ENV === 'development' ? require('./LexicalAutoLinkNode.dev.js') : require('./LexicalAutoLinkNode.prod.js') | ||
module.exports = LexicalAutoLinkNode; |
@@ -1,3 +0,9 @@ | ||
'use strict';var d=require("lexical");function e(a,...b){b.forEach(c=>{null!=c&&"string"===typeof c&&a.classList.add(...c.split(" "))})}function f(a,...b){b.forEach(c=>{a.classList.remove(...c.split(" "))})} | ||
class g extends d.TextNode{constructor(a,b,c){super(a,c);this.__highlightType=b}static getType(){return"code-highlight"}static clone(a){return new g(a.__text,a.__highlightType||void 0,a.__key)}createDOM(a){const b=super.createDOM(a);a=h(a.theme,this.__highlightType);e(b,a);return b}updateDOM(a,b,c){const k=super.updateDOM(a,b,c);a=h(c.theme,a.__highlightType);c=h(c.theme,this.__highlightType);a!==c&&(a&&f(b,a),c&&e(b,c));return k}setFormat(){return this.getWritable()}} | ||
function h(a,b){return b&&a&&a.codeHighlight&&a.codeHighlight[b]}exports.$createCodeHighlightNode=function(a,b){return new g(a,b)};exports.$isCodeHighlightNode=function(a){return a instanceof g};exports.CodeHighlightNode=g; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalCodeHighlightNode = process.env.NODE_ENV === 'development' ? require('./LexicalCodeHighlightNode.dev.js') : require('./LexicalCodeHighlightNode.prod.js') | ||
module.exports = LexicalCodeHighlightNode; |
@@ -1,5 +0,9 @@ | ||
'use strict';var d=require("lexical"),f=require("lexical/CodeHighlightNode");function g(a,...c){c.forEach(b=>{null!=b&&"string"===typeof b&&a.classList.add(...b.split(" "))})} | ||
class h extends d.ElementNode{static getType(){return"code"}static clone(a){return new h(a.__language,a.__key)}constructor(a,c){super(c);this.__language=a}createDOM(a){const c=document.createElement("code");g(c,a.theme.code);c.setAttribute("spellcheck","false");return c}updateDOM(){return!1}insertNewAfter(a){var c=this.getChildren(),b=c.length;if(2<=b&&"\n"===c[b-1].getTextContent()&&"\n"===c[b-2].getTextContent()&&a.isCollapsed()&&a.anchor.key===this.__key&&a.anchor.offset===b)return c[b-1].remove(), | ||
c[b-2].remove(),a=d.$createParagraphNode(),this.insertAfter(a),a;c=a.anchor.getNode();var e=k(c);if(null!=e){b=0;for(e=e.getTextContent();b<e.length&&/[\t ]/.test(e[b]);)b+=1;if(0<b)return b=e.substring(0,b),b=f.$createCodeHighlightNode(b),c.insertAfter(b),a.insertNodes([d.$createLineBreakNode()]),b.select(),b}return null}canInsertTab(){return!0}collapseAtStart(){const a=d.$createParagraphNode();this.getChildren().forEach(c=>a.append(c));this.replace(a);return!0}setLanguage(a){this.getWritable().__language= | ||
a}getLanguage(){return this.getLatest().__language}}function k(a){let c=null;const b=a.getPreviousSiblings();for(b.push(a);0<b.length&&(a=b.pop(),f.$isCodeHighlightNode(a)&&(c=a),!d.$isLineBreakNode(a)););return c}exports.$createCodeNode=function(a){return new h(a)};exports.$isCodeNode=function(a){return a instanceof h};exports.CodeNode=h;exports.getFirstCodeHighlightNodeOfLine=k; | ||
exports.getLastCodeHighlightNodeOfLine=function(a){let c=null;const b=a.getNextSiblings();for(b.unshift(a);0<b.length&&(a=b.shift(),f.$isCodeHighlightNode(a)&&(c=a),!d.$isLineBreakNode(a)););return c}; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalCodeNode = process.env.NODE_ENV === 'development' ? require('./LexicalCodeNode.dev.js') : require('./LexicalCodeNode.prod.js') | ||
module.exports = LexicalCodeNode; |
@@ -1,3 +0,9 @@ | ||
'use strict';var c=require("lexical");function d(b,...a){a.forEach(f=>{null!=f&&"string"===typeof f&&b.classList.add(...f.split(" "))})} | ||
class e extends c.TextNode{static getType(){return"hashtag"}static clone(b){return new e(b.__text,b.__key)}constructor(b,a){super(b,a)}createDOM(b){const a=super.createDOM(b);d(a,b.theme.hashtag);return a}setTextContent(b){let a=super.setTextContent(b);return null===a.getParent()||a.isComposing()?this:(b=b.indexOf("#"),-1===b||"#"===a.getTextContent()?a=g(a):0<b&&([a]=a.splitText(b),a=g(a)),c.$isTextNode(a)&&a.isAttached()&&(b=a.getTextContent().slice(1).search(/[\s.,\\\/#!$%\^&\*;:{}=\-`~()@]/), | ||
0===b?a=g(a):0<b&&([a]=a.splitText(b+1),a=g(a))),a)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!0}}function g(b){var a=b.getTextContent();a=h(b)?c.$createTextNode(a):k(a);b.replace(a);return a}function k(b=""){return new e(b)}function h(b){return b instanceof e}exports.$createHashtagNode=k;exports.$isHashtagNode=h;exports.$toggleHashtag=g;exports.HashtagNode=e; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalHashtagNode = process.env.NODE_ENV === 'development' ? require('./LexicalHashtagNode.dev.js') : require('./LexicalHashtagNode.prod.js') | ||
module.exports = LexicalHashtagNode; |
@@ -1,3 +0,9 @@ | ||
'use strict';var d=require("lexical");function e(a,...b){b.forEach(c=>{null!=c&&"string"===typeof c&&a.classList.add(...c.split(" "))})} | ||
class f extends d.ElementNode{static getType(){return"heading"}static clone(a){return new f(a.__tag,a.__key)}constructor(a,b){super(b);this.__tag=a}getTag(){return this.__tag}createDOM(a){const b=this.__tag,c=document.createElement(b);a=a.theme.heading;void 0!==a&&e(c,a[b]);return c}updateDOM(){return!1}insertNewAfter(){const a=d.$createParagraphNode(),b=this.getDirection();a.setDirection(b);this.insertAfter(a);return a}collapseAtStart(){const a=d.$createParagraphNode();this.getChildren().forEach(b=> | ||
a.append(b));this.replace(a);return!0}}exports.$createHeadingNode=function(a){return new f(a)};exports.$isHeadingNode=function(a){return a instanceof f};exports.HeadingNode=f; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalHeadingNode = process.env.NODE_ENV === 'development' ? require('./LexicalHeadingNode.dev.js') : require('./LexicalHeadingNode.prod.js') | ||
module.exports = LexicalHeadingNode; |
@@ -1,2 +0,9 @@ | ||
'use strict';var a=require("lexical/QuoteNode"),b=require("lexical/CodeNode"),c=require("lexical/TableNode"),d=require("lexical/TableCellNode"),e=require("lexical/TableRowNode"),f=require("lexical/HashtagNode"),g=require("lexical/HeadingNode"),h=require("@lexical/list"),k=require("lexical/CodeHighlightNode"),l=require("lexical/AutoLinkNode"),m=require("lexical/OverflowNode"),n=require("lexical/LinkNode"); | ||
module.exports=[g.HeadingNode,h.ListNode,h.ListItemNode,a.QuoteNode,b.CodeNode,c.TableNode,d.TableCellNode,e.TableRowNode,f.HashtagNode,k.CodeHighlightNode,l.AutoLinkNode,n.LinkNode,m.OverflowNode]; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalExtendedNodes = process.env.NODE_ENV === 'development' ? require('./LexicalExtendedNodes.dev.js') : require('./LexicalExtendedNodes.prod.js') | ||
module.exports = LexicalExtendedNodes; |
@@ -1,2 +0,9 @@ | ||
'use strict';var b=require("lexical");class d extends b.ElementNode{static getType(){return"overflow"}static clone(a){return new d(a.__key)}constructor(a){super(a);this.__type="overflow"}createDOM(a){const c=document.createElement("div");a=a.theme.characterLimit;"string"===typeof a&&(c.className=a);return c}updateDOM(){return!1}insertNewAfter(a){return this.getParentOrThrow().insertNewAfter(a)}excludeFromCopy(){return!0}}exports.$createOverflowNode=function(){return new d}; | ||
exports.$isOverflowNode=function(a){return a instanceof d};exports.OverflowNode=d; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalOverflowNode = process.env.NODE_ENV === 'development' ? require('./LexicalOverflowNode.dev.js') : require('./LexicalOverflowNode.prod.js') | ||
module.exports = LexicalOverflowNode; |
@@ -1,3 +0,9 @@ | ||
'use strict';var d=require("lexical");function e(a,...b){b.forEach(c=>{null!=c&&"string"===typeof c&&a.classList.add(...c.split(" "))})} | ||
class f extends d.ElementNode{static getType(){return"link"}static clone(a){return new f(a.__url,a.__key)}constructor(a,b){super(b);this.__url=a}createDOM(a){const b=document.createElement("a");b.href=this.__url;e(b,a.theme.link);return b}updateDOM(a,b){const c=this.__url;c!==a.__url&&(b.href=c);return!1}getURL(){return this.getLatest().__url}setURL(a){this.getWritable().__url=a}insertNewAfter(a){a=this.getParentOrThrow().insertNewAfter(a);if(d.$isElementNode(a)){const b=g(this.__url);a.append(b); | ||
return b}return null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}}function g(a){return new f(a)}exports.$createLinkNode=g;exports.$isLinkNode=function(a){return a instanceof f};exports.LinkNode=f; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalLinkNode = process.env.NODE_ENV === 'development' ? require('./LexicalLinkNode.dev.js') : require('./LexicalLinkNode.prod.js') | ||
module.exports = LexicalLinkNode; |
@@ -16,3 +16,3 @@ { | ||
"license": "MIT", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"main": "Lexical.js", | ||
@@ -24,2 +24,2 @@ "repository": { | ||
} | ||
} | ||
} |
@@ -1,3 +0,9 @@ | ||
'use strict';var c=require("lexical");function d(a,...b){b.forEach(e=>{null!=e&&"string"===typeof e&&a.classList.add(...e.split(" "))})} | ||
class f extends c.ElementNode{static getType(){return"quote"}static clone(a){return new f(a.__key)}constructor(a){super(a)}createDOM(a){const b=document.createElement("blockquote");d(b,a.theme.quote);return b}updateDOM(){return!1}insertNewAfter(){const a=c.$createParagraphNode(),b=this.getDirection();a.setDirection(b);this.insertAfter(a);return a}collapseAtStart(){const a=c.$createParagraphNode();this.getChildren().forEach(b=>a.append(b));this.replace(a);return!0}}exports.$createQuoteNode=function(){return new f}; | ||
exports.$isQuoteNode=function(a){return a instanceof f};exports.QuoteNode=f; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalQuoteNode = process.env.NODE_ENV === 'development' ? require('./LexicalQuoteNode.dev.js') : require('./LexicalQuoteNode.prod.js') | ||
module.exports = LexicalQuoteNode; |
@@ -7,2 +7,3 @@ # `lexical` | ||
editor implementations to be built on top. Lexical's engine provides three main parts: | ||
- editor instances that each attach to a single content editable element. | ||
@@ -68,5 +69,5 @@ - a set of editor states that represent the current and pending states of the editor at any given time. | ||
- During an update they can be thought of as "mutable". See "Updating an editor" below to | ||
mutate an editor state. | ||
mutate an editor state. | ||
- After an update, the editor state is then locked and deemed immutable from there one. This | ||
editor state can therefore be thought of as a "snapshot". | ||
editor state can therefore be thought of as a "snapshot". | ||
@@ -82,5 +83,3 @@ Editor states contain two core things: | ||
```js | ||
const stringifiedEditorState = JSON.stringify( | ||
editor.getEditorState().toJSON(), | ||
); | ||
const stringifiedEditorState = JSON.stringify(editor.getEditorState().toJSON()); | ||
@@ -156,2 +155,2 @@ const newEditorState = editor.parseEditorState(stringifiedEditorState); | ||
}); | ||
``` | ||
``` |
@@ -1,3 +0,9 @@ | ||
'use strict';var c=require("lexical");function e(a,...b){b.forEach(d=>{null!=d&&"string"===typeof d&&a.classList.add(...d.split(" "))})} | ||
class f extends c.ElementNode{static getType(){return"table-cell"}static clone(a){return new f(!1,a.__key)}constructor(a=!1,b){super(b);this.__isHeader=a}getTag(){return this.__isHeader?"th":"td"}createDOM(a){const b=document.createElement(this.getTag());e(b,a.theme.tableCell,!0===this.__isHeader&&a.theme.tableCellHeader);return b}updateDOM(){return!1}collapseAtStart(){return!0}canSelectionRemove(){return!1}}exports.$createTableCellNode=function(a){return new f(a)}; | ||
exports.$isTableCellNode=function(a){return a instanceof f};exports.TableCellNode=f; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalTableCellNode = process.env.NODE_ENV === 'development' ? require('./LexicalTableCellNode.dev.js') : require('./LexicalTableCellNode.prod.js') | ||
module.exports = LexicalTableCellNode; |
@@ -1,15 +0,9 @@ | ||
'use strict';var n=require("lexical"),y=require("lexical/TableCellNode");function A(a,...g){g.forEach(d=>{null!=d&&"string"===typeof d&&a.classList.add(...d.split(" "))})}function B(a,g){for(;a!==n.$getRoot()&&null!=a;){if(g(a))return a;a=a.getParent()}return null}const C=document.createElement("style");C.appendChild(document.createTextNode("::selection{background-color: transparent}")); | ||
function D(a){for(;null!=a;){const g=a.nodeName;if("TD"===g||"TH"===g){a=a._cell;if(void 0===a)break;return a}a=a.parentNode}return null} | ||
function E(a,g,d){const k=[],l={rows:0,columns:0,cells:k};(new MutationObserver(t=>{d.update(()=>{var h=g.firstChild;let u=0,p=0;var e=!1;for(let q=0;q<t.length;q++){const w=t[q].target.nodeName;if("TABLE"===w||"TR"===w){e=!0;break}}if(e){for(k.length=0;null!=h;){e=h.nodeName;if("TD"===e||"TH"===e)e={elem:h,highlighted:!1,x:u,y:p},h._cell=e,void 0===k[p]&&(k[p]=[]),k[p][u]=e;else if(e=h.firstChild,null!=e){h=e;continue}e=h.nextSibling;if(null!=e)u++,h=e;else if(e=h.parentNode,null!=e){h=e.nextSibling; | ||
if(null==h)break;p++;u=0}}l.columns=u+1;l.rows=p+1;a.setGrid(l)}})})).observe(g,{childList:!0,subtree:!0});a.setGrid(l);return l} | ||
function F(a,g,d,k,l){const t=[];for(let h=0;h<l.length;h++){const u=l[h];for(let p=0;p<u.length;p++){const e=u[p],q=e.elem.style;p>=a&&p<=g&&h>=d&&h<=k?(e.highlighted||(e.highlighted=!0,q.setProperty("background-color","rgb(163, 187, 255)"),q.setProperty("caret-color","transparent")),t.push(e)):e.highlighted&&(e.highlighted=!1,q.removeProperty("background-color"),q.removeProperty("caret-color"))}}return t} | ||
function H(a,g,d){if(null!==d.getRootElement()){E(a,g,d);var k=a.getGrid(),l=!1,t=!1,h=-1,u=-1,p=-1,e=-1,q=[];if(null==k)throw Error("Table grid not found.");g.addEventListener("mousemove",c=>{if(l){var b=D(c.target);if(null!==b){const f=b.x;b=b.y;if(!t&&(h!==f||u!==b))c.preventDefault(),c=window.getSelection(),c.setBaseAndExtent(c.anchorNode,0,c.anchorNode,0),t=!0,document.body&&document.body.appendChild(C),null===x&&(x=d.addListener("command",(m,v)=>{if("deleteCharacter"===m){if(q.length===k.columns* | ||
k.rows)return a.selectPrevious(),a.remove(),w(),!0;q.forEach(({elem:r})=>{r=n.$getNearestNodeFromDOMNode(r);if(n.$isElementNode(r)){r.clear();const z=n.$createParagraphNode(),J=n.$createTextNode();z.append(J);r.append(z)}});a.setSelectionState(null);n.$setSelection(null);return!0}if("formatText"===m)return K(v),!0;"insertText"===m&&w();return!1},1));else if(f===p&&b===e)return;p=f;e=b;if(t){const m=Math.min(h,p),v=Math.max(h,p),r=Math.min(u,e),z=Math.max(u,e);d.update(()=>{q=a.setSelectionState({fromX:m, | ||
toX:v,fromY:r,toY:z})})}}}});var w=()=>{d.update(()=>{l=t=!1;e=p=u=h=-1;d.update(()=>{a.setSelectionState(null)});q=[];null!==x&&(x(),x=null);const c=C.parentNode;null!=c&&c.removeChild(C)})};g.addEventListener("mouseleave",()=>{});var K=c=>{let b=n.$getSelection();null===b&&(b=n.$createRangeSelection());const f=b,m=f.anchor,v=f.focus;q.forEach(r=>{r=n.$getNearestNodeFromDOMNode(r.elem);n.$isElementNode(r)&&(m.set(r.getKey(),0,"element"),v.set(r.getKey(),r.getChildrenSize(),"element"),f.formatText(c))}); | ||
b.anchor.set(b.anchor.key,b.anchor.offset,b.anchor.type);b.focus.set(b.anchor.key,b.anchor.offset,b.anchor.type);n.$setSelection(b)},x=null;g.addEventListener("mousedown",c=>{l?t&&w():setTimeout(()=>{t&&w();const b=D(c.target);null!==b&&(l=!0,h=b.x,u=b.y,document.addEventListener("mouseup",()=>{l=!1},{capture:!0,once:!0}))},0)});window.addEventListener("click",c=>{0<q.length&&!g.contains(c.target)&&d.update(()=>{a.setSelectionState(null)})});var G=(c,b,f)=>{let m;switch(f){case "backward":case "forward":f= | ||
"forward"===f;m=b!==(f?k.columns-1:0)?a.getCellNodeFromCords(c,b+(f?1:-1)):c!==(f?k.rows-1:0)?a.getCellNodeFromCords(c+(f?1:-1),f?0:k.columns-1):f?a.getNextSibling():a.getPreviousSibling();break;case "up":m=0!==c?a.getCellNodeFromCords(c-1,b):a.getPreviousSibling();break;case "down":m=c!==k.rows-1?a.getCellNodeFromCords(c+1,b):a.getNextSibling()}return n.$isElementNode(m)||n.$isTextNode(m)?(m.select(),!0):!1};d.addListener("command",(c,b)=>{var f=n.$getSelection();if(null==f)return!1;const m=B(f.anchor.getNode(), | ||
v=>y.$isTableCellNode(v));if(!y.$isTableCellNode(m))return!1;if("deleteCharacter"===c&&0===q.length&&f.isCollapsed()&&0===f.anchor.offset)return!0;if(("indentContent"===c||"outdentContent"===c)&&f.isCollapsed()&&0===q.length)return b=a.getCordsFromCellNode(m),G(b.x,b.y,"indentContent"===c?"forward":"backward"),!0;if(("keyArrowDown"===c||"keyArrowUp"===c)&&f.isCollapsed()&&0===q.length){const v=a.getCordsFromCellNode(m);f=B(f.anchor.getNode(),r=>n.$isElementNode(r));if("keyArrowUp"===c&&f===m.getFirstChild()|| | ||
"keyArrowDown"===c&&f===m.getLastChild())return b.preventDefault(),b.stopImmediatePropagation(),G(v.x,v.y,"keyArrowUp"===c?"up":"down"),!0}return!1},4)}} | ||
class I extends n.ElementNode{static getType(){return"table"}static clone(a){return new I(a.__key,a.__selectionShape,a.__grid)}constructor(a,g,d){super(a);this.__selectionShape=g;this.__grid=d}createDOM(a,g){const d=document.createElement("table");A(d,a.theme.table);H(this,d,g);return d}updateDOM(){return!1}canExtractContents(){return!1}canBeEmpty(){return!1}setSelectionState(a){this.getWritable().__selectionShape=a;return null==this.__grid?[]:a?F(a.fromX,a.toX,a.fromY,a.toY,this.__grid.cells):F(-1, | ||
-1,-1,-1,this.__grid.cells)}getSelectionState(){return this.__selectionShape}getCordsFromCellNode(a){if(!this.__grid)throw Error("Grid not found.");const {rows:g,cells:d}=this.__grid;for(let l=0;l<g;l++){var k=d[l];if(null==k)throw Error(`Row not found at x:${l}`);k=k.findIndex(({elem:t})=>n.$getNearestNodeFromDOMNode(t)===a);if(-1!==k)return{x:l,y:k}}throw Error("Cell not found in table.");}getCellNodeFromCords(a,g){if(!this.__grid)throw Error("Grid not found.");var {cells:d}=this.__grid;d=d[a]; | ||
if(null==d)throw Error(`Table row x:"${a}" not found.`);d=d[g];if(null==d)throw Error(`Table cell y:"${g}" in row x:"${a}" not found.`);a=n.$getNearestNodeFromDOMNode(d.elem);if(y.$isTableCellNode(a))return a;throw Error("Node at cords not TableCellNode.");}setGrid(a){this.getWritable().__grid=a}getGrid(){return this.__grid}}exports.$createTableNode=function(){return new I};exports.$isTableNode=function(a){return a instanceof I};exports.TableNode=I;exports.trackTableGrid=E; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalTableNode = process.env.NODE_ENV === 'development' ? require('./LexicalTableNode.dev.js') : require('./LexicalTableNode.prod.js') | ||
module.exports = LexicalTableNode; |
@@ -1,2 +0,9 @@ | ||
'use strict';var c=require("lexical");function e(a,...b){b.forEach(d=>{null!=d&&"string"===typeof d&&a.classList.add(...d.split(" "))})}class f extends c.ElementNode{static getType(){return"table-row"}static clone(a){return new f(a.__key)}constructor(a){super(a)}createDOM(a){const b=document.createElement("tr");e(b,a.theme.tableRow);return b}updateDOM(){return!1}canBeEmpty(){return!1}canSelectionRemove(){return!1}}exports.$createTableRowNode=function(){return new f}; | ||
exports.$isTableRowNode=function(a){return a instanceof f};exports.TableRowNode=f; | ||
/** | ||
* 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. | ||
*/ | ||
'use strict' | ||
const LexicalTableRowNode = process.env.NODE_ENV === 'development' ? require('./LexicalTableRowNode.dev.js') : require('./LexicalTableRowNode.prod.js') | ||
module.exports = LexicalTableRowNode; |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances 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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 4 instances in 1 package
357124
42
8040
11
13
1