chore: upgrade lexical
This commit is contained in:
Binary file not shown.
BIN
.yarn/cache/@lexical-clipboard-npm-0.13.1-b4788bb0a9-65aeeadda2.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-clipboard-npm-0.13.1-b4788bb0a9-65aeeadda2.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lexical-clipboard-patch-10d63f17bb-c346f43e62.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-clipboard-patch-10d63f17bb-c346f43e62.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-code-npm-0.13.1-f173e18e50-ae9017aea3.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-code-npm-0.13.1-f173e18e50-ae9017aea3.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-html-npm-0.13.1-83780a1867-997a04efa8.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-html-npm-0.13.1-83780a1867-997a04efa8.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-list-npm-0.13.1-788c53f078-a823127efe.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-list-npm-0.13.1-788c53f078-a823127efe.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-mark-npm-0.13.1-767a6e078b-26eb8deb49.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-mark-npm-0.13.1-767a6e078b-26eb8deb49.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-markdown-npm-0.13.1-145f66b44d-42b8465866.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-markdown-npm-0.13.1-145f66b44d-42b8465866.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-rich-text-npm-0.13.1-df610fad54-2ccd2fa467.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-rich-text-npm-0.13.1-df610fad54-2ccd2fa467.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-rich-text-patch-7942156c26-defa6abc74.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-rich-text-patch-7942156c26-defa6abc74.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-selection-npm-0.13.1-28d4ad9916-1e061f25c5.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-selection-npm-0.13.1-28d4ad9916-1e061f25c5.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@lexical-table-npm-0.13.1-d927a25958-506dc2c127.zip
vendored
Normal file
BIN
.yarn/cache/@lexical-table-npm-0.13.1-d927a25958-506dc2c127.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/lexical-npm-0.13.1-ac06219fd6-044b0d7bef.zip
vendored
Normal file
BIN
.yarn/cache/lexical-npm-0.13.1-ac06219fd6-044b0d7bef.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/lexical-patch-6208d7196a-ada7927c74.zip
vendored
BIN
.yarn/cache/lexical-patch-6208d7196a-ada7927c74.zip
vendored
Binary file not shown.
BIN
.yarn/cache/lexical-patch-a99b27123e-85d0ec97e0.zip
vendored
Normal file
BIN
.yarn/cache/lexical-patch-a99b27123e-85d0ec97e0.zip
vendored
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
diff --git a/LexicalClipboard.dev.js b/LexicalClipboard.dev.js
|
||||
index 08c80def0bffdd5011948bc73733af51a2f95b3f..b8d5a467b6964b88002d1f0c2ce5d5974755ec75 100644
|
||||
index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..512433f1dac08f8b8bd261315827924020035f85 100644
|
||||
--- a/LexicalClipboard.dev.js
|
||||
+++ b/LexicalClipboard.dev.js
|
||||
@@ -102,7 +102,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
|
||||
@@ -40,17 +40,17 @@ index 08c80def0bffdd5011948bc73733af51a2f95b3f..b8d5a467b6964b88002d1f0c2ce5d597
|
||||
}
|
||||
|
||||
diff --git a/LexicalClipboard.prod.js b/LexicalClipboard.prod.js
|
||||
index 217fed14ce25e926fafe748de74a9cc2597854ea..0489348de734c563e7befc0af50aaefec74ccd98 100644
|
||||
index 494ab7597d14cfa0386f7bad294c567a8f0110c1..f60bbdf361d44ed078cf9cb403251f8976d665f9 100644
|
||||
--- a/LexicalClipboard.prod.js
|
||||
+++ b/LexicalClipboard.prod.js
|
||||
@@ -7,11 +7,11 @@
|
||||
'use strict';var f=require("@lexical/html"),m=require("@lexical/selection"),q=require("@lexical/utils"),r=require("lexical");function t(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;c<arguments.length;c++)b.append("v",arguments[c]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${b} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
|
||||
let u="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function v(a){let b=r.$getSelection();if(null==b)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?"":f.$generateHtmlFromNodes(a,b)}
|
||||
function w(a){let b=r.$getSelection();if(null==b)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?null:JSON.stringify(x(a,b))}function y(a,b,c){a.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:b,selection:c})||c.insertNodes(b)}
|
||||
-function z(a,b,c,d=[]){let e=null!=b?c.isSelected(b):!0,h=r.$isElementNode(c)&&c.excludeFromCopy("html");var g=c;if(null!==b){var k=m.$cloneWithProperties(c);g=k=r.$isTextNode(k)&&null!=b?m.$sliceSelectedTextNodeContent(b,k):k}let n=r.$isElementNode(g)?g.getChildren():[];var l=g;k=l.exportJSON();var p=l.constructor;k.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(k.children)||t(59,p.name));r.$isTextNode(g)&&(g=g.__text,0<g.length?k.text=g:e=!1);for(g=0;g<n.length;g++)l=n[g],
|
||||
-function z(a,b,c,d=[]){let e=null!==b?c.isSelected(b):!0,h=r.$isElementNode(c)&&c.excludeFromCopy("html");var g=c;if(null!==b){var k=m.$cloneWithProperties(c);g=k=r.$isTextNode(k)&&null!==b?m.$sliceSelectedTextNodeContent(b,k):k}let n=r.$isElementNode(g)?g.getChildren():[];var l=g;k=l.exportJSON();var p=l.constructor;k.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(k.children)||t(59,p.name));r.$isTextNode(g)&&(g=g.__text,0<g.length?k.text=g:e=!1);for(g=0;g<n.length;g++)l=n[g],
|
||||
-p=z(a,b,l,k.children),!e&&r.$isElementNode(c)&&p&&c.extractWithChild(l,b,"clone")&&(e=!0);if(e&&!h)d.push(k);else if(Array.isArray(k.children))for(a=0;a<k.children.length;a++)d.push(k.children[a]);return e}function x(a,b){let c=[],d=r.$getRoot().getChildren();for(let e=0;e<d.length;e++)z(a,b,d[e],c);return{namespace:a._config.namespace,nodes:c}}function A(a){let b=[];for(let c=0;c<a.length;c++){let d=r.$parseSerializedNode(a[c]);r.$isTextNode(d)&&m.$addNodeStyle(d);b.push(d)}return b}let B=null;
|
||||
-function C(a,b){var c=u?(a._window||window).getSelection():null;if(!c)return!1;var d=c.anchorNode;c=c.focusNode;if(null!==d&&null!==c&&!r.isSelectionWithinEditor(a,d,c))return!1;b.preventDefault();b=b.clipboardData;d=r.$getSelection();if(null===b||null===d)return!1;c=v(a);a=w(a);let e="";null!==d&&(e=d.getTextContent());null!==c&&b.setData("text/html",c);null!==a&&b.setData("application/x-lexical-editor",a);b.setData("text/plain",e);return!0}exports.$generateJSONFromSelectedNodes=x;
|
||||
+function z(a,b,c,e=[]){let g=null!=b?c.isSelected(b):!0,k=r.$isElementNode(c)&&c.excludeFromCopy("html");var d=c;if(null!==b){var h=m.$cloneWithProperties(c);d=h=r.$isTextNode(h)&&null!=b?m.$sliceSelectedTextNodeContent(b,h):h}let n=r.$isElementNode(d)?d.getChildren():[];var l=d;h=l.exportJSON();var p=l.constructor;h.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(h.children)||t(59,p.name));r.$isTextNode(d)&&(d=d.__text,0<d.length?h.text=d:g=!1);for(d=0;d<n.length;d++)l=n[d],
|
||||
+function z(a,b,c,e=[]){let g=null!==b?c.isSelected(b):!0,k=r.$isElementNode(c)&&c.excludeFromCopy("html");var d=c;if(null!==b){var h=m.$cloneWithProperties(c);d=h=r.$isTextNode(h)&&null!==b?m.$sliceSelectedTextNodeContent(b,h):h}let n=r.$isElementNode(d)?d.getChildren():[];var l=d;h=l.exportJSON();var p=l.constructor;h.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(h.children)||t(59,p.name));r.$isTextNode(d)&&(d=d.__text,0<d.length?h.text=d:g=!1);for(d=0;d<n.length;d++)l=n[d],
|
||||
+p=z(a,b,l,h.children),!g&&r.$isElementNode(c)&&p&&c.extractWithChild(l,b,"clone")&&(g=!0);if(g&&!k)e.push(h);else if(Array.isArray(h.children))for(a=0;a<h.children.length;a++)e.push(h.children[a]);return g}function x(a,b){let c=[],e=r.$getRoot().getChildren();for(let g=0;g<e.length;g++)z(a,b,e[g],c);return{namespace:a._config.namespace,nodes:c}}function A(a){let b=[];for(let c=0;c<a.length;c++){let e=r.$parseSerializedNode(a[c]);r.$isTextNode(e)&&m.$addNodeStyle(e);b.push(e)}return b}let B=null;
|
||||
+function C(a,b){var c=u?(a._window||window).getSelection():null;if(!c)return!1;var e=c.anchorNode;c=c.focusNode;if(null!==e&&null!==c&&!r.isSelectionWithinEditor(a,e,c))return!1;b.preventDefault();b=b.clipboardData;e=r.$getSelection();if(null===b||null===e)return!1;c=v(a);a=w(a);let g="";null!==e&&(g=e.getTextContent());null!==c&&b.setData("text/html",c);null!==a&&b.setData("application/x-lexical-editor",a);b.setData("text/plain",g);return!0}exports.$generateJSONFromSelectedNodes=x;
|
||||
exports.$generateNodesFromSerializedNodes=A;exports.$getHtmlContent=v;exports.$getLexicalContent=w;exports.$insertDataTransferForPlainText=function(a,b){a=a.getData("text/plain")||a.getData("text/uri-list");null!=a&&b.insertRawText(a)};
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/LexicalRichText.dev.js b/LexicalRichText.dev.js
|
||||
index 235657f94e5563d9be091677ec30a2814bc9fdcf..778c7a77da5d5ab04c3cc5d13a1d6c1f4e781864 100644
|
||||
index cdd0f239f13391bdbb6e1c2f39113d879d458ec2..5f069efb0015438ecdffcfc1e031e40ce290a9b7 100644
|
||||
--- a/LexicalRichText.dev.js
|
||||
+++ b/LexicalRichText.dev.js
|
||||
@@ -458,7 +458,7 @@ function registerRichText(editor) {
|
||||
@@ -12,15 +12,15 @@ index 235657f94e5563d9be091677ec30a2814bc9fdcf..778c7a77da5d5ab04c3cc5d13a1d6c1f
|
||||
const data = eventOrText.data;
|
||||
if (data) {
|
||||
diff --git a/LexicalRichText.prod.js b/LexicalRichText.prod.js
|
||||
index 796f509fe353577592040c0bcd31e4d0155eb661..a91ec007ab7fd4f50e21dda262151b95441a5212 100644
|
||||
index 2912dd466be878fd794d971d31d919afce0dcb62..cd35bcf41edc5b15f435464aa155519449d6e797 100644
|
||||
--- a/LexicalRichText.prod.js
|
||||
+++ b/LexicalRichText.prod.js
|
||||
@@ -18,7 +18,7 @@ function H(b){let a=null;b instanceof DragEvent?a=b.dataTransfer:b instanceof Cl
|
||||
function I(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m<a.length;m++){var e=a[m],f=e.getKey();d.has(f)||(e=h.$getNearestBlockElementAncestorOrThrow(e),f=e.getKey(),e.canIndent()&&!d.has(f)&&(d.add(f),b(e)))}return 0<d.size}function J(b){b=k.$getNearestNodeFromDOMNode(b);return k.$isDecoratorNode(b)}exports.$createHeadingNode=E;exports.$createQuoteNode=z;exports.$isHeadingNode=function(b){return b instanceof B};
|
||||
exports.$isQuoteNode=function(b){return b instanceof x};exports.DRAG_DROP_PASTE=w;exports.HeadingNode=B;exports.QuoteNode=x;exports.eventFiles=H;
|
||||
exports.registerRichText=function(b){return h.mergeRegister(b.registerCommand(k.CLICK_COMMAND,()=>{const a=k.$getSelection();return k.$isNodeSelection(a)?(a.clear(),!0):!1},0),b.registerCommand(k.DELETE_CHARACTER_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteCharacter(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DELETE_WORD_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteWord(a);return!0},k.COMMAND_PRIORITY_EDITOR),
|
||||
-b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)k.$INTERNAL_isPointSelection(d)&&d.insertText(a);else{if(!k.$INTERNAL_isPointSelection(d))return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),
|
||||
+b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)k.$INTERNAL_isPointSelection(d)&&d.insertText(a);else{if(!k.$INTERNAL_isPointSelection(d))return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b,a):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),
|
||||
b.registerCommand(k.REMOVE_TEXT_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.removeText();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_TEXT_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.formatText(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_ELEMENT_COMMAND,a=>{var d=k.$getSelection();if(!k.$isRangeSelection(d)&&!k.$isNodeSelection(d))return!1;d=d.getNodes();for(const e of d)d=h.$findMatchingParent(e,
|
||||
f=>k.$isElementNode(f)&&!f.isInline()),null!==d&&d.setFormat(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_LINE_BREAK_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.insertLineBreak(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_PARAGRAPH_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.insertParagraph();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_TAB_COMMAND,()=>{k.$insertNodes([k.$createTabNode()]);
|
||||
return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();0<d&&a.setIndent(d-1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_UP_COMMAND,a=>{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!J(a.target)){if(a=d.getNodes(),0<a.length)return a[0].selectPrevious(),!0}else if(k.$isRangeSelection(d)&&(d=k.$getAdjacentNode(d.focus,
|
||||
-b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)null!==d&&d.insertText(a);else{if(null===d)return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.REMOVE_TEXT_COMMAND,
|
||||
+b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)null!==d&&d.insertText(a);else{if(null===d)return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b,a):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.REMOVE_TEXT_COMMAND,
|
||||
()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.removeText();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_TEXT_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.formatText(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_ELEMENT_COMMAND,a=>{var d=k.$getSelection();if(!k.$isRangeSelection(d)&&!k.$isNodeSelection(d))return!1;d=d.getNodes();for(const e of d)d=h.$findMatchingParent(e,f=>k.$isElementNode(f)&&!f.isInline()),
|
||||
null!==d&&d.setFormat(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_LINE_BREAK_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.insertLineBreak(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_PARAGRAPH_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.insertParagraph();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_TAB_COMMAND,()=>{k.$insertNodes([k.$createTabNode()]);return!0},k.COMMAND_PRIORITY_EDITOR),
|
||||
b.registerCommand(k.INDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();0<d&&a.setIndent(d-1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_UP_COMMAND,a=>{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!J(a.target)){if(a=d.getNodes(),0<a.length)return a[0].selectPrevious(),!0}else if(k.$isRangeSelection(d)&&(d=k.$getAdjacentNode(d.focus,!0),!a.shiftKey&&k.$isDecoratorNode(d)&&
|
||||
@@ -1,319 +0,0 @@
|
||||
diff --git a/Lexical.dev.js b/Lexical.dev.js
|
||||
index 9de98c64cf4aab8b575d25d9b4b998cd29e7eb54..eae21f07cfc917ca316719b27dc54ae0635afc7c 100644
|
||||
--- a/Lexical.dev.js
|
||||
+++ b/Lexical.dev.js
|
||||
@@ -2517,8 +2517,10 @@ function onBeforeInput(event, editor) {
|
||||
}
|
||||
selection.style = anchorNode.getStyle();
|
||||
}
|
||||
- const selectedText = selection.anchor.getNode().getTextContent();
|
||||
- if (selectedText.length <= 1) {
|
||||
+ const selectedNodeText = selection.anchor.getNode().getTextContent();
|
||||
+ const isSelectedNodeTextOneOrLessCharacters = selectedNodeText.length <= 1;
|
||||
+ const hasSelectedAllTextInNode = selection.anchor.offset === 0 && selection.focus.offset === selectedNodeText.length;
|
||||
+ if (isSelectedNodeTextOneOrLessCharacters || hasSelectedAllTextInNode) {
|
||||
event.preventDefault();
|
||||
dispatchCommand(editor, DELETE_CHARACTER_COMMAND, true);
|
||||
}
|
||||
@@ -4123,11 +4125,7 @@ class LineBreakNode extends LexicalNode {
|
||||
static importDOM() {
|
||||
return {
|
||||
br: node => {
|
||||
- const parentElement = node.parentElement;
|
||||
- // If the <br> is the only child, then skip including it
|
||||
- let firstChild;
|
||||
- let lastChild;
|
||||
- if (parentElement !== null && ((firstChild = parentElement.firstChild) === node || firstChild.nextSibling === node && firstChild.nodeType === DOM_TEXT_TYPE && (firstChild.textContent || '').match(/^( |\t|\r?\n)+$/) !== null) && ((lastChild = parentElement.lastChild) === node || lastChild.previousSibling === node && lastChild.nodeType === DOM_TEXT_TYPE && (lastChild.textContent || '').match(/^( |\t|\r?\n)+$/) !== null)) {
|
||||
+ if (isOnlyChild(node)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
@@ -4158,6 +4156,22 @@ function $createLineBreakNode() {
|
||||
function $isLineBreakNode(node) {
|
||||
return node instanceof LineBreakNode;
|
||||
}
|
||||
+function isOnlyChild(node) {
|
||||
+ const parentElement = node.parentElement;
|
||||
+ if (parentElement !== null) {
|
||||
+ const firstChild = parentElement.firstChild;
|
||||
+ if (firstChild === node || firstChild.nextSibling === node && isWhitespaceDomTextNode(firstChild)) {
|
||||
+ const lastChild = parentElement.lastChild;
|
||||
+ if (lastChild === node || lastChild.previousSibling === node && isWhitespaceDomTextNode(lastChild)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+function isWhitespaceDomTextNode(node) {
|
||||
+ return node.nodeType === DOM_TEXT_TYPE && /^( |\t|\r?\n)+$/.test(node.textContent || '');
|
||||
+}
|
||||
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
@@ -6251,7 +6265,8 @@ class RangeSelection extends INTERNAL_PointSelection {
|
||||
}
|
||||
return selection.insertNodes(nodes);
|
||||
}
|
||||
- const firstBlock = $getAncestor(this.anchor.getNode(), INTERNAL_$isBlock);
|
||||
+ const firstPoint = this.isBackward() ? this.focus : this.anchor;
|
||||
+ const firstBlock = $getAncestor(firstPoint.getNode(), INTERNAL_$isBlock);
|
||||
const last = nodes[nodes.length - 1];
|
||||
|
||||
// CASE 1: insert inside a code block
|
||||
diff --git a/Lexical.prod.js b/Lexical.prod.js
|
||||
index 6e381d4f241e25f09a347718c83c72cb1672505d..dbed04f260ac47fd0ea20c919ac26cb5ce98cc9d 100644
|
||||
--- a/Lexical.prod.js
|
||||
+++ b/Lexical.prod.js
|
||||
@@ -52,11 +52,11 @@ function Pd(a,b,c){let {anchorNode:d,anchorOffset:e,focusNode:f,focusOffset:g}=a
|
||||
h.format=m.getFormat();h.style=m.getStyle()}else"element"!==k.type||p||(h.format=0,h.style="")}else{k=255;m=!1;n=h.getNodes();p=n.length;for(let l=0;l<p;l++){let r=n[l];if(B(r)&&(m=!0,k&=r.getFormat(),0===k))break}h.format=m?k:0}}R(b,aa,void 0)}})}
|
||||
function Ad(a,b){v(b,()=>{let c=u();var d=xb(b._window);let e=nc();if(d)if(C(c)){let g=c.anchor;var f=g.getNode();"element"===g.type&&0===g.offset&&c.isCollapsed()&&!L(f)&&1===J().getChildrenSize()&&f.getTopLevelElementOrThrow().isEmpty()&&null!==e&&c.is(e)?(d.removeAllRanges(),c.dirty=!0):3!==a.detail||c.isCollapsed()||(d=c.focus.getNode(),f!==d&&(E(f)?f.select(0):f.getParentOrThrow().select(0)))}else"touch"===a.pointerType&&(f=d.anchorNode,null!==f&&(f=f.nodeType,1===f||3===f))&&(d=Qd(e,d,b,a),
|
||||
Ab(d));R(b,ba,a)})}function wd(a,b){let c=a.target;a=a.pointerType;c instanceof Node&&"touch"!==a&&v(b,()=>{x(wb(c))||(Jd=!0)})}function Rd(a){if(!a.getTargetRanges)return null;a=a.getTargetRanges();return 0===a.length?null:a[0]}function Sd(a,b){return a!==b||E(a)||E(b)||!a.isToken()||!b.isToken()}
|
||||
-function Cd(a,b){let c=a.inputType,d=Rd(a);"deleteCompositionText"===c||Xa&&Bb(b)||"insertCompositionText"!==c&&v(b,()=>{let e=u();if("deleteContentBackward"===c){if(null===e){var f=nc();if(!C(f))return;Ab(f.clone())}if(C(e)){ab&&H(e.anchor.key);if(229===Ed&&a.timeStamp<Dd+30&&b.isComposing()&&e.anchor.key===e.focus.key){H(null);Dd=0;setTimeout(()=>{v(b,()=>{H(null)})},30);if(C(e)){f=e.anchor.getNode();f.markDirty();e.format=f.getFormat();if(!B(f))throw Error("Anchor node must be a TextNode");e.style=
|
||||
-f.getStyle()}1>=e.anchor.getNode().getTextContent().length&&(a.preventDefault(),R(b,da,!0))}else H(null),a.preventDefault(),R(b,da,!0);return}}if(C(e)){f=a.data;null!==Gd&&mc(!1,b,Gd);e.dirty&&null===Gd||!e.isCollapsed()||L(e.anchor.getNode())||null===d||e.applyDOMRange(d);Gd=null;var g=e.focus,h=e.anchor.getNode();g=g.getNode();if("insertText"===c||"insertTranspose"===c)"\n"===f?(a.preventDefault(),R(b,ea,!1)):"\n\n"===f?(a.preventDefault(),R(b,ja,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),
|
||||
-a.preventDefault(),e.insertRawText(f)):null!=f&&Nd(e,d,f,a.timeStamp,!0)?(a.preventDefault(),R(b,ka,f)):Gd=f,Fd=a.timeStamp;else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":R(b,ka,a);break;case "insertFromComposition":H(null);R(b,ka,a);break;case "insertLineBreak":H(null);R(b,ea,!1);break;case "insertParagraph":H(null);Kd&&!$a?(Kd=!1,R(b,ea,!1)):R(b,ja,void 0);break;case "insertFromPaste":case "insertFromPasteAsQuotation":R(b,la,a);break;case "deleteByComposition":Sd(h,
|
||||
-g)&&R(b,na,a);break;case "deleteByDrag":case "deleteByCut":R(b,na,a);break;case "deleteContent":R(b,da,!1);break;case "deleteWordBackward":R(b,oa,!0);break;case "deleteWordForward":R(b,oa,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":R(b,pa,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":R(b,pa,!1);break;case "formatStrikeThrough":R(b,qa,"strikethrough");break;case "formatBold":R(b,qa,"bold");break;case "formatItalic":R(b,qa,
|
||||
-"italic");break;case "formatUnderline":R(b,qa,"underline");break;case "historyUndo":R(b,ra,void 0);break;case "historyRedo":R(b,sa,void 0)}}})}
|
||||
+function Cd(a,b){let c=a.inputType,d=Rd(a);"deleteCompositionText"===c||Xa&&Bb(b)||"insertCompositionText"!==c&&v(b,()=>{var e=u();if("deleteContentBackward"===c){if(null===e){var f=nc();if(!C(f))return;Ab(f.clone())}if(C(e)){ab&&H(e.anchor.key);if(229===Ed&&a.timeStamp<Dd+30&&b.isComposing()&&e.anchor.key===e.focus.key){H(null);Dd=0;setTimeout(()=>{v(b,()=>{H(null)})},30);if(C(e)){f=e.anchor.getNode();f.markDirty();e.format=f.getFormat();if(!B(f))throw Error("Anchor node must be a TextNode");e.style=
|
||||
+f.getStyle()}f=e.anchor.getNode().getTextContent();e=0===e.anchor.offset&&e.focus.offset===f.length;if(1>=f.length||e)a.preventDefault(),R(b,da,!0)}else H(null),a.preventDefault(),R(b,da,!0);return}}if(C(e)){f=a.data;null!==Gd&&mc(!1,b,Gd);e.dirty&&null===Gd||!e.isCollapsed()||L(e.anchor.getNode())||null===d||e.applyDOMRange(d);Gd=null;var g=e.focus,h=e.anchor.getNode();g=g.getNode();if("insertText"===c||"insertTranspose"===c)"\n"===f?(a.preventDefault(),R(b,ea,!1)):"\n\n"===f?(a.preventDefault(),
|
||||
+R(b,ja,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),a.preventDefault(),e.insertRawText(f)):null!=f&&Nd(e,d,f,a.timeStamp,!0)?(a.preventDefault(),R(b,ka,f)):Gd=f,Fd=a.timeStamp;else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":R(b,ka,a);break;case "insertFromComposition":H(null);R(b,ka,a);break;case "insertLineBreak":H(null);R(b,ea,!1);break;case "insertParagraph":H(null);Kd&&!$a?(Kd=!1,R(b,ea,!1)):R(b,ja,void 0);
|
||||
+break;case "insertFromPaste":case "insertFromPasteAsQuotation":R(b,la,a);break;case "deleteByComposition":Sd(h,g)&&R(b,na,a);break;case "deleteByDrag":case "deleteByCut":R(b,na,a);break;case "deleteContent":R(b,da,!1);break;case "deleteWordBackward":R(b,oa,!0);break;case "deleteWordForward":R(b,oa,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":R(b,pa,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":R(b,pa,!1);break;case "formatStrikeThrough":R(b,
|
||||
+qa,"strikethrough");break;case "formatBold":R(b,qa,"bold");break;case "formatItalic":R(b,qa,"italic");break;case "formatUnderline":R(b,qa,"underline");break;case "historyUndo":R(b,ra,void 0);break;case "historyRedo":R(b,sa,void 0)}}})}
|
||||
function zd(a,b){a.stopPropagation();v(b,()=>{var c=u(),d=a.data,e=Rd(a);if(null!=d&&C(c)&&Nd(c,e,d,a.timeStamp,!1)){Ld&&(Td(b,d),Ld=!1);var f=c.anchor,g=f.getNode();e=xb(b._window);if(null===e)return;let h=f.offset;if(f=Ya&&!c.isCollapsed()&&B(g)&&null!==e.anchorNode)g=g.getTextContent().slice(0,h)+d+g.getTextContent().slice(h+c.focus.offset),e=e.anchorNode,f=g===(3===e.nodeType?e.nodeValue:null);f||R(b,ka,d);d=d.length;Xa&&1<d&&"insertCompositionText"===a.inputType&&!b.isComposing()&&(c.anchor.offset-=
|
||||
d);Za||$a||cb||!b.isComposing()||(Dd=0,H(null))}else mc(!1,b,null!==d?d:void 0),Ld&&(Td(b,d||void 0),Ld=!1);G();c=F();Cb(c)});Gd=null}function xd(a,b){v(b,()=>{let c=u();if(C(c)&&!b.isComposing()){let d=c.anchor,e=c.anchor.getNode();H(d.key);(a.timeStamp<Dd+30||"element"===d.type||!c.isCollapsed()||e.getFormat()!==c.format||B(e)&&e.getStyle()!==c.style)&&R(b,ka,eb)}})}
|
||||
function Td(a,b){var c=a._compositionKey;H(null);if(null!==c&&null!=b){if(""===b){b=I(c);a=Xb(a.getElementByKey(c));null!==a&&null!==a.nodeValue&&B(b)&&yb(b,a.nodeValue,null,null,!0);return}if("\n"===b[b.length-1]&&(c=u(),C(c))){b=c.focus;c.anchor.set(b.key,b.offset,b.type);R(a,Ba,null);return}}mc(!0,a,b)}function yd(a,b){Xa?Ld=!0:v(b,()=>{Td(b,a.data)})}
|
||||
@@ -82,134 +82,134 @@ null!==c&&(c=c.clone());Ac(this,a);let d=this.getLatest(),e=this.__key,f=a.__key
|
||||
n=c.__next;null===e?k.__last=m:e.getWritable().__prev=m;k.__size++;c.__next=m;d.__next=n;d.__prev=c.__key;d.__parent=c.__parent;b&&C(f)&&(b=this.getIndexWithinParent(),ae(f,k,b+1),c=k.__key,g&&f.anchor.set(c,b+2,"element"),h&&f.focus.set(c,b+2,"element"));return a}insertBefore(a,b=!0){G();Ac(this,a);var c=this.getWritable();let d=a.getWritable(),e=d.__key;bc(d);let f=this.getPreviousSibling(),g=this.getParentOrThrow().getWritable(),h=c.__prev,k=this.getIndexWithinParent();null===f?g.__first=e:f.getWritable().__next=
|
||||
e;g.__size++;c.__prev=e;d.__prev=h;d.__next=c.__key;d.__parent=c.__parent;c=u();b&&C(c)&&(b=this.getParentOrThrow(),ae(c,b,k));return a}isParentRequired(){return!1}createParentElementNode(){return ee()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(a,b){G();let c=this.getPreviousSibling(),d=this.getParentOrThrow();return null===c?d.select(0,0):E(c)?c.select():B(c)?c.select(a,b):(a=c.getIndexWithinParent()+1,d.select(a,a))}selectNext(a,b){G();let c=
|
||||
this.getNextSibling(),d=this.getParentOrThrow();return null===c?d.select():E(c)?c.select(0,0):B(c)?c.select(a,b):(a=c.getIndexWithinParent(),d.select(a,a))}markDirty(){this.getWritable()}}function fe(a,b,c){c=c||b.getParentOrThrow().getLastChild();let d=b;for(b=[b];d!==c;){if(!d.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");d=d.getNextSibling();b.push(d)}for(let e of b)a=a.insertAfter(e)}
|
||||
-class ge extends be{static getType(){return"linebreak"}static clone(a){return new ge(a.__key)}constructor(a){super(a)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:a=>{let b=a.parentElement,c,d;return null!==b&&((c=b.firstChild)===a||c.nextSibling===a&&3===c.nodeType&&null!==(c.textContent||"").match(/^( |\t|\r?\n)+$/))&&((d=b.lastChild)===a||d.previousSibling===a&&3===d.nodeType&&null!==(d.textContent||"").match(/^( |\t|\r?\n)+$/))?
|
||||
-null:{conversion:he,priority:0}}}}static importJSON(){return ie()}exportJSON(){return{type:"linebreak",version:1}}}function he(){return{node:ie()}}function ie(){return zc(new ge)}function Gc(a){return a instanceof ge}function je(a,b){return b&16?"code":b&128?"mark":b&32?"sub":b&64?"sup":null}function ke(a,b){return b&1?"strong":b&2?"em":"span"}
|
||||
-function le(a,b,c,d,e){a=d.classList;d=pc(e,"base");void 0!==d&&a.add(...d);d=pc(e,"underlineStrikethrough");let f=!1,g=b&8&&b&4;var h=c&8&&c&4;void 0!==d&&(h?(f=!0,g||a.add(...d)):g&&a.remove(...d));for(let k in hb)h=hb[k],d=pc(e,k),void 0!==d&&(c&h?!f||"underline"!==k&&"strikethrough"!==k?(0===(b&h)||g&&"underline"===k||"strikethrough"===k)&&a.add(...d):b&h&&a.remove(...d):b&h&&a.remove(...d))}
|
||||
-function me(a,b,c){let d=b.firstChild;c=c.isComposing();a+=c?db:"";if(null==d)b.textContent=a;else if(b=d.nodeValue,b!==a)if(c||Xa){c=b.length;let e=a.length,f=0,g=0;for(;f<c&&f<e&&b[f]===a[f];)f++;for(;g+f<c&&g+f<e&&b[c-g-1]===a[e-g-1];)g++;a=[f,c-f-g,a.slice(f,e-g)];let [h,k,m]=a;0!==k&&d.deleteData(h,k);d.insertData(h,m)}else d.nodeValue=a}function ne(a,b){b=document.createElement(b);b.appendChild(a);return b}
|
||||
-class oe extends be{static getType(){return"text"}static clone(a){return new oe(a.__text,a.__key)}constructor(a,b){super(b);this.__text=a;this.__format=0;this.__style="";this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let a=this.getLatest();return pb[a.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===dc()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return 0!==
|
||||
-(this.getLatest().__detail&1)}isUnmergeable(){return 0!==(this.getLatest().__detail&2)}hasFormat(a){a=hb[a];return 0!==(this.getFormat()&a)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(a,b){let c=this.getLatest().__format;return Yb(c,a,b)}createDOM(a){var b=this.__format,c=je(this,b);let d=ke(this,b),e=document.createElement(null===c?d:c),f=e;this.hasFormat("code")&&e.setAttribute("spellcheck","false");null!==c&&(f=document.createElement(d),
|
||||
-e.appendChild(f));c=f;me(this.__text,c,this);a=a.theme.text;void 0!==a&&le(d,0,b,c,a);b=this.__style;""!==b&&(e.style.cssText=b);return e}updateDOM(a,b,c){let d=this.__text;var e=a.__format,f=this.__format,g=je(this,e);let h=je(this,f);var k=ke(this,e);let m=ke(this,f);if((null===g?k:g)!==(null===h?m:h))return!0;if(g===h&&k!==m)return e=b.firstChild,null==e&&q(48),a=g=document.createElement(m),me(d,a,this),c=c.theme.text,void 0!==c&&le(m,0,f,a,c),b.replaceChild(g,e),!1;k=b;null!==h&&null!==g&&(k=
|
||||
-b.firstChild,null==k&&q(49));me(d,k,this);c=c.theme.text;void 0!==c&&e!==f&&le(m,e,f,k,c);f=this.__style;a.__style!==f&&(b.style.cssText=f);return!1}static importDOM(){return{"#text":()=>({conversion:pe,priority:0}),b:()=>({conversion:qe,priority:0}),code:()=>({conversion:re,priority:0}),em:()=>({conversion:re,priority:0}),i:()=>({conversion:re,priority:0}),s:()=>({conversion:re,priority:0}),span:()=>({conversion:se,priority:0}),strong:()=>({conversion:re,priority:0}),sub:()=>({conversion:re,priority:0}),
|
||||
-sup:()=>({conversion:re,priority:0}),u:()=>({conversion:re,priority:0})}}static importJSON(a){let b=K(a.text);b.setFormat(a.format);b.setDetail(a.detail);b.setMode(a.mode);b.setStyle(a.style);return b}exportDOM(a){({element:a}=super.exportDOM(a));null!==a&&Ec(a)||q(132);a.style.whiteSpace="pre-wrap";this.hasFormat("bold")&&(a=ne(a,"b"));this.hasFormat("italic")&&(a=ne(a,"i"));this.hasFormat("strikethrough")&&(a=ne(a,"s"));this.hasFormat("underline")&&(a=ne(a,"u"));return{element:a}}exportJSON(){return{detail:this.getDetail(),
|
||||
+class ge extends be{static getType(){return"linebreak"}static clone(a){return new ge(a.__key)}constructor(a){super(a)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:a=>{a:{var b=a.parentElement;if(null!==b){let c=b.firstChild;if(c===a||c.nextSibling===a&&he(c))if(b=b.lastChild,b===a||b.previousSibling===a&&he(b)){a=!0;break a}}a=!1}return a?null:{conversion:ie,priority:0}}}}static importJSON(){return je()}exportJSON(){return{type:"linebreak",
|
||||
+version:1}}}function ie(){return{node:je()}}function je(){return zc(new ge)}function Gc(a){return a instanceof ge}function he(a){return 3===a.nodeType&&/^( |\t|\r?\n)+$/.test(a.textContent||"")}function ke(a,b){return b&16?"code":b&128?"mark":b&32?"sub":b&64?"sup":null}function le(a,b){return b&1?"strong":b&2?"em":"span"}
|
||||
+function me(a,b,c,d,e){a=d.classList;d=pc(e,"base");void 0!==d&&a.add(...d);d=pc(e,"underlineStrikethrough");let f=!1,g=b&8&&b&4;var h=c&8&&c&4;void 0!==d&&(h?(f=!0,g||a.add(...d)):g&&a.remove(...d));for(let k in hb)h=hb[k],d=pc(e,k),void 0!==d&&(c&h?!f||"underline"!==k&&"strikethrough"!==k?(0===(b&h)||g&&"underline"===k||"strikethrough"===k)&&a.add(...d):b&h&&a.remove(...d):b&h&&a.remove(...d))}
|
||||
+function ne(a,b,c){let d=b.firstChild;c=c.isComposing();a+=c?db:"";if(null==d)b.textContent=a;else if(b=d.nodeValue,b!==a)if(c||Xa){c=b.length;let e=a.length,f=0,g=0;for(;f<c&&f<e&&b[f]===a[f];)f++;for(;g+f<c&&g+f<e&&b[c-g-1]===a[e-g-1];)g++;a=[f,c-f-g,a.slice(f,e-g)];let [h,k,m]=a;0!==k&&d.deleteData(h,k);d.insertData(h,m)}else d.nodeValue=a}function oe(a,b){b=document.createElement(b);b.appendChild(a);return b}
|
||||
+class pe extends be{static getType(){return"text"}static clone(a){return new pe(a.__text,a.__key)}constructor(a,b){super(b);this.__text=a;this.__format=0;this.__style="";this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let a=this.getLatest();return pb[a.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===dc()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return 0!==
|
||||
+(this.getLatest().__detail&1)}isUnmergeable(){return 0!==(this.getLatest().__detail&2)}hasFormat(a){a=hb[a];return 0!==(this.getFormat()&a)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(a,b){let c=this.getLatest().__format;return Yb(c,a,b)}createDOM(a){var b=this.__format,c=ke(this,b);let d=le(this,b),e=document.createElement(null===c?d:c),f=e;this.hasFormat("code")&&e.setAttribute("spellcheck","false");null!==c&&(f=document.createElement(d),
|
||||
+e.appendChild(f));c=f;ne(this.__text,c,this);a=a.theme.text;void 0!==a&&me(d,0,b,c,a);b=this.__style;""!==b&&(e.style.cssText=b);return e}updateDOM(a,b,c){let d=this.__text;var e=a.__format,f=this.__format,g=ke(this,e);let h=ke(this,f);var k=le(this,e);let m=le(this,f);if((null===g?k:g)!==(null===h?m:h))return!0;if(g===h&&k!==m)return e=b.firstChild,null==e&&q(48),a=g=document.createElement(m),ne(d,a,this),c=c.theme.text,void 0!==c&&me(m,0,f,a,c),b.replaceChild(g,e),!1;k=b;null!==h&&null!==g&&(k=
|
||||
+b.firstChild,null==k&&q(49));ne(d,k,this);c=c.theme.text;void 0!==c&&e!==f&&me(m,e,f,k,c);f=this.__style;a.__style!==f&&(b.style.cssText=f);return!1}static importDOM(){return{"#text":()=>({conversion:qe,priority:0}),b:()=>({conversion:re,priority:0}),code:()=>({conversion:se,priority:0}),em:()=>({conversion:se,priority:0}),i:()=>({conversion:se,priority:0}),s:()=>({conversion:se,priority:0}),span:()=>({conversion:te,priority:0}),strong:()=>({conversion:se,priority:0}),sub:()=>({conversion:se,priority:0}),
|
||||
+sup:()=>({conversion:se,priority:0}),u:()=>({conversion:se,priority:0})}}static importJSON(a){let b=K(a.text);b.setFormat(a.format);b.setDetail(a.detail);b.setMode(a.mode);b.setStyle(a.style);return b}exportDOM(a){({element:a}=super.exportDOM(a));null!==a&&Ec(a)||q(132);a.style.whiteSpace="pre-wrap";this.hasFormat("bold")&&(a=oe(a,"b"));this.hasFormat("italic")&&(a=oe(a,"i"));this.hasFormat("strikethrough")&&(a=oe(a,"s"));this.hasFormat("underline")&&(a=oe(a,"u"));return{element:a}}exportJSON(){return{detail:this.getDetail(),
|
||||
format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(a){let b=this.getWritable();b.__format="string"===typeof a?hb[a]:a;return b}setDetail(a){let b=this.getWritable();b.__detail="string"===typeof a?ib[a]:a;return b}setStyle(a){let b=this.getWritable();b.__style=a;return b}toggleFormat(a){let b=this.getFormat();a=Yb(b,a,null);return this.setFormat(a)}toggleDirectionless(){let a=this.getWritable();a.__detail^=
|
||||
1;return a}toggleUnmergeable(){let a=this.getWritable();a.__detail^=2;return a}setMode(a){a=ob[a];if(this.__mode===a)return this;let b=this.getWritable();b.__mode=a;return b}setTextContent(a){if(this.__text===a)return this;let b=this.getWritable();b.__text=a;return b}select(a,b){G();let c=u();var d=this.getTextContent();let e=this.__key;"string"===typeof d?(d=d.length,void 0===a&&(a=d),void 0===b&&(b=d)):b=a=0;if(C(c))d=dc(),d!==c.anchor.key&&d!==c.focus.key||H(e),c.setTextNodeRange(this,a,this,b);
|
||||
-else return te(e,a,e,b,"text","text");return c}selectStart(){return this.select(0,0)}selectEnd(){let a=this.getTextContentSize();return this.select(a,a)}spliceText(a,b,c,d){let e=this.getWritable(),f=e.__text,g=c.length,h=a;0>h&&(h=g+h,0>h&&(h=0));let k=u();d&&C(k)&&(a+=g,k.setTextNodeRange(e,a,e,a));b=f.slice(0,h)+c+f.slice(h+b);e.__text=b;return e}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...a){G();var b=this.getLatest(),c=b.getTextContent(),d=b.__key,e=dc(),f=new Set(a);
|
||||
+else return ue(e,a,e,b,"text","text");return c}selectStart(){return this.select(0,0)}selectEnd(){let a=this.getTextContentSize();return this.select(a,a)}spliceText(a,b,c,d){let e=this.getWritable(),f=e.__text,g=c.length,h=a;0>h&&(h=g+h,0>h&&(h=0));let k=u();d&&C(k)&&(a+=g,k.setTextNodeRange(e,a,e,a));b=f.slice(0,h)+c+f.slice(h+b);e.__text=b;return e}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...a){G();var b=this.getLatest(),c=b.getTextContent(),d=b.__key,e=dc(),f=new Set(a);
|
||||
a=[];var g=c.length,h="";for(var k=0;k<g;k++)""!==h&&f.has(k)&&(a.push(h),h=""),h+=c[k];""!==h&&a.push(h);f=a.length;if(0===f)return[];if(a[0]===c)return[b];var m=a[0];c=b.getParentOrThrow();k=b.getFormat();let n=b.getStyle(),p=b.__detail;g=!1;b.isSegmented()?(h=K(m),h.__format=k,h.__style=n,h.__detail=p,g=!0):(h=b.getWritable(),h.__text=m);b=u();h=[h];m=m.length;for(let w=1;w<f;w++){var l=a[w],r=l.length;l=K(l).getWritable();l.__format=k;l.__style=n;l.__detail=p;let y=l.__key;r=m+r;if(C(b)){let z=
|
||||
b.anchor,A=b.focus;z.key===d&&"text"===z.type&&z.offset>m&&z.offset<=r&&(z.key=y,z.offset-=m,b.dirty=!0);A.key===d&&"text"===A.type&&A.offset>m&&A.offset<=r&&(A.key=y,A.offset-=m,b.dirty=!0)}e===d&&H(y);m=r;h.push(l)}d=this.getPreviousSibling();e=this.getNextSibling();null!==d&&cc(d);null!==e&&cc(e);d=c.getWritable();e=this.getIndexWithinParent();g?(d.splice(e,0,h),this.remove()):d.splice(e,1,h);C(b)&&ae(b,c,e,f-1);return h}mergeWithSibling(a){var b=a===this.getPreviousSibling();b||a===this.getNextSibling()||
|
||||
-q(50);var c=this.__key;let d=a.__key,e=this.__text,f=e.length;dc()===d&&H(c);let g=u();if(C(g)){let h=g.anchor,k=g.focus;null!==h&&h.key===d&&(ue(h,b,c,a,f),g.dirty=!0);null!==k&&k.key===d&&(ue(k,b,c,a,f),g.dirty=!0)}c=a.__text;this.setTextContent(b?c+e:e+c);b=this.getWritable();a.remove();return b}isTextEntity(){return!1}}
|
||||
-function se(a){let b="700"===a.style.fontWeight,c="line-through"===a.style.textDecoration,d="italic"===a.style.fontStyle,e="underline"===a.style.textDecoration,f=a.style.verticalAlign;return{forChild:g=>{if(!B(g))return g;b&&g.toggleFormat("bold");c&&g.toggleFormat("strikethrough");d&&g.toggleFormat("italic");e&&g.toggleFormat("underline");"sub"===f&&g.toggleFormat("subscript");"super"===f&&g.toggleFormat("superscript");return g},node:null}}
|
||||
-function qe(a){let b="normal"===a.style.fontWeight;return{forChild:c=>{B(c)&&!b&&c.toggleFormat("bold");return c},node:null}}let ve=new WeakMap;
|
||||
-function pe(a){null===a.parentElement&&q(129);for(var b=a.textContent||"",c,d=a.parentNode,e=[a];null!==d&&void 0===(c=ve.get(d))&&!("PRE"===d.nodeName||1===d.nodeType&&void 0!==d.style&&void 0!==d.style.whiteSpace&&d.style.whiteSpace.startsWith("pre"));)e.push(d),d=d.parentNode;c=void 0===c?d:c;for(d=0;d<e.length;d++)ve.set(e[d],c);if(null!==c){b=b.split(/(\r?\n|\t)/);a=[];e=b.length;for(c=0;c<e;c++)d=b[c],"\n"===d||"\r\n"===d?a.push(ie()):"\t"===d?a.push(we()):""!==d&&a.push(K(d));return{node:a}}b=
|
||||
-b.replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(""===b)return{node:null};if(" "===b[0]){e=a;for(c=!0;null!==e&&null!==(e=xe(e,!1));)if(d=e.textContent||"",0<d.length){/[ \t\n]$/.test(d)&&(b=b.slice(1));c=!1;break}c&&(b=b.slice(1))}if(" "===b[b.length-1]){for(e=!0;null!==a&&null!==(a=xe(a,!0));)if(0<(a.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){e=!1;break}e&&(b=b.slice(0,b.length-1))}return""===b?{node:null}:{node:K(b)}}
|
||||
-let ye=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/,"i");function xe(a,b){for(;;){for(var c=void 0;null===(c=b?a.nextSibling:a.previousSibling);)if(a=a.parentElement,null===a)return null;a=c;if(1===a.nodeType&&(c=a.style.display,""===c&&null===a.nodeName.match(ye)||""!==c&&!c.startsWith("inline")))return null;for(;null!==(c=b?a.firstChild:a.lastChild);)a=c;if(3===a.nodeType)return a;if("BR"===a.nodeName)return null}}
|
||||
-let ze={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function re(a){let b=ze[a.nodeName.toLowerCase()];return void 0===b?{node:null}:{forChild:c=>{B(c)&&!c.hasFormat(b)&&c.toggleFormat(b);return c},node:null}}function K(a=""){return zc(new oe(a))}function B(a){return a instanceof oe}
|
||||
-class Ae extends oe{static getType(){return"tab"}static clone(a){let b=new Ae(a.__key);b.__text=a.__text;b.__format=a.__format;b.__style=a.__style;return b}constructor(a){super("\t",a);this.__detail=2}static importDOM(){return null}static importJSON(a){let b=we();b.setFormat(a.format);b.setStyle(a.style);return b}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){q(126)}setDetail(){q(127)}setMode(){q(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}
|
||||
-function we(){return zc(new Ae)}function Be(a){return a instanceof Ae}
|
||||
-class Ce{constructor(a,b,c){this._selection=null;this.key=a;this.offset=b;this.type=c}is(a){return this.key===a.key&&this.offset===a.offset&&this.type===a.type}isBefore(a){let b=this.getNode(),c=a.getNode(),d=this.offset;a=a.offset;if(E(b)){var e=b.getDescendantByIndex(d);b=null!=e?e:b}E(c)&&(e=c.getDescendantByIndex(a),c=null!=e?e:c);return b===c?d<a:b.isBefore(c)}getNode(){let a=I(this.key);null===a&&q(20);return a}set(a,b,c){let d=this._selection,e=this.key;this.key=a;this.offset=b;this.type=c;
|
||||
-ec()||(dc()===e&&H(a),null!==d&&(d.setCachedNodes(null),d.dirty=!0))}}function S(a,b,c){return new Ce(a,b,c)}function Me(a,b){let c=b.__key,d=a.offset,e="element";if(B(b))e="text",b=b.getTextContentSize(),d>b&&(d=b);else if(!E(b)){var f=b.getNextSibling();if(B(f))c=f.__key,d=0,e="text";else if(f=b.getParent())c=f.__key,d=b.getIndexWithinParent()+1}a.set(c,d,e)}function de(a,b){if(E(b)){let c=b.getLastDescendant();E(c)||B(c)?Me(a,c):Me(a,b)}else Me(a,b)}
|
||||
-function Ne(a,b,c,d){let e=a.getNode(),f=e.getChildAtIndex(a.offset),g=K(),h=L(e)?ee().append(g):g;g.setFormat(c);g.setStyle(d);null===f?e.append(h):f.insertBefore(h);a.is(b)&&b.set(g.__key,0,"text");a.set(g.__key,0,"text")}function Oe(a,b,c,d){a.key=b;a.offset=c;a.type=d}
|
||||
-class Pe{constructor(a,b){this.anchor=a;this.focus=b;a._selection=this;b._selection=this;this._cachedNodes=null;this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(a){this._cachedNodes=a}is(a){return ce(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return Qe(this)}}
|
||||
-class Re{constructor(a){this.dirty=!1;this._nodes=a;this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(a){this._cachedNodes=a}is(a){if(!Ud(a))return!1;let b=this._nodes,c=a._nodes;return b.size===c.size&&Array.from(b).every(d=>c.has(d))}add(a){this.dirty=!0;this._nodes.add(a);this._cachedNodes=null}delete(a){this.dirty=!0;this._nodes.delete(a);this._cachedNodes=null}clear(){this.dirty=!0;this._nodes.clear();this._cachedNodes=null}has(a){return this._nodes.has(a)}clone(){return new Re(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(a){let b=
|
||||
-this.getNodes(),c=b.length;var d=b[c-1];if(B(d))d=d.select();else{let e=d.getIndexWithinParent()+1;d=d.getParentOrThrow().select(e,e)}d.insertNodes(a);for(a=0;a<c;a++)b[a].remove()}getNodes(){var a=this._cachedNodes;if(null!==a)return a;var b=this._nodes;a=[];for(let c of b)b=I(c),null!==b&&a.push(b);ec()||(this._cachedNodes=a);return a}getTextContent(){let a=this.getNodes(),b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function C(a){return a instanceof Se}
|
||||
-function ce(a){return a instanceof Pe}
|
||||
-class Se extends Pe{constructor(a,b,c,d){super(a,b);this.format=c;this.style=d}is(a){return C(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus)&&this.format===a.format&&this.style===a.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var a=this._cachedNodes;if(null!==a)return a;a=this.anchor;var b=this.focus,c=a.isBefore(b),d=c?a:b;c=c?b:a;a=d.getNode();b=c.getNode();let e=d.offset;d=c.offset;E(a)&&(c=a.getDescendantByIndex(e),a=null!=c?c:a);E(b)&&(c=b.getDescendantByIndex(d),
|
||||
-null!==c&&c!==a&&b.getChildAtIndex(d)===c&&(c=c.getPreviousSibling()),b=null!=c?c:b);a=a.is(b)?E(a)&&0<a.getChildrenSize()?[]:[a]:a.getNodesBetween(b);ec()||(this._cachedNodes=a);return a}setTextNodeRange(a,b,c,d){Oe(this.anchor,a.__key,b,"text");Oe(this.focus,c.__key,d,"text");this._cachedNodes=null;this.dirty=!0}getTextContent(){let a=this.getNodes();if(0===a.length)return"";let b=a[0],c=a[a.length-1],d=this.anchor,e=this.focus,f=d.isBefore(e),[g,h]=Qe(this),k="",m=!0;for(let n=0;n<a.length;n++){let p=
|
||||
-a[n];if(E(p)&&!p.isInline())m||(k+="\n"),m=p.isEmpty()?!1:!0;else if(m=!1,B(p)){let l=p.getTextContent();if(p===b)if(p===c){if("element"!==d.type||"element"!==e.type||e.offset===d.offset)l=g<h?l.slice(g,h):l.slice(h,g)}else l=f?l.slice(g):l.slice(h);else p===c&&(l=f?l.slice(0,h):l.slice(0,g));k+=l}else!x(p)&&!Gc(p)||p===c&&this.isCollapsed()||(k+=p.getTextContent())}return k}applyDOMRange(a){let b=F(),c=b.getEditorState()._selection;a=Te(a.startContainer,a.startOffset,a.endContainer,a.endOffset,b,
|
||||
-c);if(null!==a){var [d,e]=a;Oe(this.anchor,d.key,d.offset,d.type);Oe(this.focus,e.key,e.offset,e.type);this._cachedNodes=null}}clone(){let a=this.anchor,b=this.focus;return new Se(S(a.key,a.offset,a.type),S(b.key,b.offset,b.type),this.format,this.style)}toggleFormat(a){this.format=Yb(this.format,a,null);this.dirty=!0}setStyle(a){this.style=a;this.dirty=!0}hasFormat(a){return 0!==(this.format&hb[a])}insertRawText(a){a=a.split(/(\r?\n|\t)/);let b=[],c=a.length;for(let d=0;d<c;d++){let e=a[d];"\n"===
|
||||
-e||"\r\n"===e?b.push(ie()):"\t"===e?b.push(we()):b.push(K(e))}this.insertNodes(b)}insertText(a){var b=this.anchor,c=this.focus,d=this.isCollapsed()||b.isBefore(c),e=this.format,f=this.style;d&&"element"===b.type?Ne(b,c,e,f):d||"element"!==c.type||Ne(c,b,e,f);var g=this.getNodes(),h=g.length,k=d?c:b;c=(d?b:c).offset;var m=k.offset;b=g[0];B(b)||q(26);d=b.getTextContent().length;var n=b.getParentOrThrow(),p=g[h-1];if(this.isCollapsed()&&c===d&&(b.isSegmented()||b.isToken()||!b.canInsertTextAfter()||
|
||||
+q(50);var c=this.__key;let d=a.__key,e=this.__text,f=e.length;dc()===d&&H(c);let g=u();if(C(g)){let h=g.anchor,k=g.focus;null!==h&&h.key===d&&(ve(h,b,c,a,f),g.dirty=!0);null!==k&&k.key===d&&(ve(k,b,c,a,f),g.dirty=!0)}c=a.__text;this.setTextContent(b?c+e:e+c);b=this.getWritable();a.remove();return b}isTextEntity(){return!1}}
|
||||
+function te(a){let b="700"===a.style.fontWeight,c="line-through"===a.style.textDecoration,d="italic"===a.style.fontStyle,e="underline"===a.style.textDecoration,f=a.style.verticalAlign;return{forChild:g=>{if(!B(g))return g;b&&g.toggleFormat("bold");c&&g.toggleFormat("strikethrough");d&&g.toggleFormat("italic");e&&g.toggleFormat("underline");"sub"===f&&g.toggleFormat("subscript");"super"===f&&g.toggleFormat("superscript");return g},node:null}}
|
||||
+function re(a){let b="normal"===a.style.fontWeight;return{forChild:c=>{B(c)&&!b&&c.toggleFormat("bold");return c},node:null}}let we=new WeakMap;
|
||||
+function qe(a){null===a.parentElement&&q(129);for(var b=a.textContent||"",c,d=a.parentNode,e=[a];null!==d&&void 0===(c=we.get(d))&&!("PRE"===d.nodeName||1===d.nodeType&&void 0!==d.style&&void 0!==d.style.whiteSpace&&d.style.whiteSpace.startsWith("pre"));)e.push(d),d=d.parentNode;c=void 0===c?d:c;for(d=0;d<e.length;d++)we.set(e[d],c);if(null!==c){b=b.split(/(\r?\n|\t)/);a=[];e=b.length;for(c=0;c<e;c++)d=b[c],"\n"===d||"\r\n"===d?a.push(je()):"\t"===d?a.push(xe()):""!==d&&a.push(K(d));return{node:a}}b=
|
||||
+b.replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(""===b)return{node:null};if(" "===b[0]){e=a;for(c=!0;null!==e&&null!==(e=ye(e,!1));)if(d=e.textContent||"",0<d.length){/[ \t\n]$/.test(d)&&(b=b.slice(1));c=!1;break}c&&(b=b.slice(1))}if(" "===b[b.length-1]){for(e=!0;null!==a&&null!==(a=ye(a,!0));)if(0<(a.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){e=!1;break}e&&(b=b.slice(0,b.length-1))}return""===b?{node:null}:{node:K(b)}}
|
||||
+let ze=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/,"i");function ye(a,b){for(;;){for(var c=void 0;null===(c=b?a.nextSibling:a.previousSibling);)if(a=a.parentElement,null===a)return null;a=c;if(1===a.nodeType&&(c=a.style.display,""===c&&null===a.nodeName.match(ze)||""!==c&&!c.startsWith("inline")))return null;for(;null!==(c=b?a.firstChild:a.lastChild);)a=c;if(3===a.nodeType)return a;if("BR"===a.nodeName)return null}}
|
||||
+let Ae={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function se(a){let b=Ae[a.nodeName.toLowerCase()];return void 0===b?{node:null}:{forChild:c=>{B(c)&&!c.hasFormat(b)&&c.toggleFormat(b);return c},node:null}}function K(a=""){return zc(new pe(a))}function B(a){return a instanceof pe}
|
||||
+class Be extends pe{static getType(){return"tab"}static clone(a){let b=new Be(a.__key);b.__text=a.__text;b.__format=a.__format;b.__style=a.__style;return b}constructor(a){super("\t",a);this.__detail=2}static importDOM(){return null}static importJSON(a){let b=xe();b.setFormat(a.format);b.setStyle(a.style);return b}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){q(126)}setDetail(){q(127)}setMode(){q(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}
|
||||
+function xe(){return zc(new Be)}function Ce(a){return a instanceof Be}
|
||||
+class De{constructor(a,b,c){this._selection=null;this.key=a;this.offset=b;this.type=c}is(a){return this.key===a.key&&this.offset===a.offset&&this.type===a.type}isBefore(a){let b=this.getNode(),c=a.getNode(),d=this.offset;a=a.offset;if(E(b)){var e=b.getDescendantByIndex(d);b=null!=e?e:b}E(c)&&(e=c.getDescendantByIndex(a),c=null!=e?e:c);return b===c?d<a:b.isBefore(c)}getNode(){let a=I(this.key);null===a&&q(20);return a}set(a,b,c){let d=this._selection,e=this.key;this.key=a;this.offset=b;this.type=c;
|
||||
+ec()||(dc()===e&&H(a),null!==d&&(d.setCachedNodes(null),d.dirty=!0))}}function S(a,b,c){return new De(a,b,c)}function Ne(a,b){let c=b.__key,d=a.offset,e="element";if(B(b))e="text",b=b.getTextContentSize(),d>b&&(d=b);else if(!E(b)){var f=b.getNextSibling();if(B(f))c=f.__key,d=0,e="text";else if(f=b.getParent())c=f.__key,d=b.getIndexWithinParent()+1}a.set(c,d,e)}function de(a,b){if(E(b)){let c=b.getLastDescendant();E(c)||B(c)?Ne(a,c):Ne(a,b)}else Ne(a,b)}
|
||||
+function Oe(a,b,c,d){let e=a.getNode(),f=e.getChildAtIndex(a.offset),g=K(),h=L(e)?ee().append(g):g;g.setFormat(c);g.setStyle(d);null===f?e.append(h):f.insertBefore(h);a.is(b)&&b.set(g.__key,0,"text");a.set(g.__key,0,"text")}function Pe(a,b,c,d){a.key=b;a.offset=c;a.type=d}
|
||||
+class Qe{constructor(a,b){this.anchor=a;this.focus=b;a._selection=this;b._selection=this;this._cachedNodes=null;this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(a){this._cachedNodes=a}is(a){return ce(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return Re(this)}}
|
||||
+class Se{constructor(a){this.dirty=!1;this._nodes=a;this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(a){this._cachedNodes=a}is(a){if(!Ud(a))return!1;let b=this._nodes,c=a._nodes;return b.size===c.size&&Array.from(b).every(d=>c.has(d))}add(a){this.dirty=!0;this._nodes.add(a);this._cachedNodes=null}delete(a){this.dirty=!0;this._nodes.delete(a);this._cachedNodes=null}clear(){this.dirty=!0;this._nodes.clear();this._cachedNodes=null}has(a){return this._nodes.has(a)}clone(){return new Se(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(a){let b=
|
||||
+this.getNodes(),c=b.length;var d=b[c-1];if(B(d))d=d.select();else{let e=d.getIndexWithinParent()+1;d=d.getParentOrThrow().select(e,e)}d.insertNodes(a);for(a=0;a<c;a++)b[a].remove()}getNodes(){var a=this._cachedNodes;if(null!==a)return a;var b=this._nodes;a=[];for(let c of b)b=I(c),null!==b&&a.push(b);ec()||(this._cachedNodes=a);return a}getTextContent(){let a=this.getNodes(),b="";for(let c=0;c<a.length;c++)b+=a[c].getTextContent();return b}}function C(a){return a instanceof Te}
|
||||
+function ce(a){return a instanceof Qe}
|
||||
+class Te extends Qe{constructor(a,b,c,d){super(a,b);this.format=c;this.style=d}is(a){return C(a)?this.anchor.is(a.anchor)&&this.focus.is(a.focus)&&this.format===a.format&&this.style===a.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var a=this._cachedNodes;if(null!==a)return a;a=this.anchor;var b=this.focus,c=a.isBefore(b),d=c?a:b;c=c?b:a;a=d.getNode();b=c.getNode();let e=d.offset;d=c.offset;E(a)&&(c=a.getDescendantByIndex(e),a=null!=c?c:a);E(b)&&(c=b.getDescendantByIndex(d),
|
||||
+null!==c&&c!==a&&b.getChildAtIndex(d)===c&&(c=c.getPreviousSibling()),b=null!=c?c:b);a=a.is(b)?E(a)&&0<a.getChildrenSize()?[]:[a]:a.getNodesBetween(b);ec()||(this._cachedNodes=a);return a}setTextNodeRange(a,b,c,d){Pe(this.anchor,a.__key,b,"text");Pe(this.focus,c.__key,d,"text");this._cachedNodes=null;this.dirty=!0}getTextContent(){let a=this.getNodes();if(0===a.length)return"";let b=a[0],c=a[a.length-1],d=this.anchor,e=this.focus,f=d.isBefore(e),[g,h]=Re(this),k="",m=!0;for(let n=0;n<a.length;n++){let p=
|
||||
+a[n];if(E(p)&&!p.isInline())m||(k+="\n"),m=p.isEmpty()?!1:!0;else if(m=!1,B(p)){let l=p.getTextContent();if(p===b)if(p===c){if("element"!==d.type||"element"!==e.type||e.offset===d.offset)l=g<h?l.slice(g,h):l.slice(h,g)}else l=f?l.slice(g):l.slice(h);else p===c&&(l=f?l.slice(0,h):l.slice(0,g));k+=l}else!x(p)&&!Gc(p)||p===c&&this.isCollapsed()||(k+=p.getTextContent())}return k}applyDOMRange(a){let b=F(),c=b.getEditorState()._selection;a=Ue(a.startContainer,a.startOffset,a.endContainer,a.endOffset,b,
|
||||
+c);if(null!==a){var [d,e]=a;Pe(this.anchor,d.key,d.offset,d.type);Pe(this.focus,e.key,e.offset,e.type);this._cachedNodes=null}}clone(){let a=this.anchor,b=this.focus;return new Te(S(a.key,a.offset,a.type),S(b.key,b.offset,b.type),this.format,this.style)}toggleFormat(a){this.format=Yb(this.format,a,null);this.dirty=!0}setStyle(a){this.style=a;this.dirty=!0}hasFormat(a){return 0!==(this.format&hb[a])}insertRawText(a){a=a.split(/(\r?\n|\t)/);let b=[],c=a.length;for(let d=0;d<c;d++){let e=a[d];"\n"===
|
||||
+e||"\r\n"===e?b.push(je()):"\t"===e?b.push(xe()):b.push(K(e))}this.insertNodes(b)}insertText(a){var b=this.anchor,c=this.focus,d=this.isCollapsed()||b.isBefore(c),e=this.format,f=this.style;d&&"element"===b.type?Oe(b,c,e,f):d||"element"!==c.type||Oe(c,b,e,f);var g=this.getNodes(),h=g.length,k=d?c:b;c=(d?b:c).offset;var m=k.offset;b=g[0];B(b)||q(26);d=b.getTextContent().length;var n=b.getParentOrThrow(),p=g[h-1];if(this.isCollapsed()&&c===d&&(b.isSegmented()||b.isToken()||!b.canInsertTextAfter()||
|
||||
!n.canInsertTextAfter()&&null===b.getNextSibling())){var l=b.getNextSibling();B(l)&&l.canInsertTextBefore()&&!Wb(l)||(l=K(),l.setFormat(e),n.canInsertTextAfter()?b.insertAfter(l):n.insertAfter(l));l.select(0,0);b=l;if(""!==a){this.insertText(a);return}}else if(this.isCollapsed()&&0===c&&(b.isSegmented()||b.isToken()||!b.canInsertTextBefore()||!n.canInsertTextBefore()&&null===b.getPreviousSibling())){l=b.getPreviousSibling();if(!B(l)||Wb(l))l=K(),l.setFormat(e),n.canInsertTextBefore()?b.insertBefore(l):
|
||||
-n.insertBefore(l);l.select();b=l;if(""!==a){this.insertText(a);return}}else if(b.isSegmented()&&c!==d)n=K(b.getTextContent()),n.setFormat(e),b.replace(n),b=n;else if(!(this.isCollapsed()||""===a||(l=p.getParent(),n.canInsertTextBefore()&&n.canInsertTextAfter()&&(!E(l)||l.canInsertTextBefore()&&l.canInsertTextAfter())))){this.insertText("");Ue(this.anchor,this.focus,null);this.insertText(a);return}if(1===h)if(b.isToken())a=K(a),a.select(),b.replace(a);else{g=b.getFormat();h=b.getStyle();if(c===m&&
|
||||
-(g!==e||h!==f))if(""===b.getTextContent())b.setFormat(e),b.setStyle(f);else{g=K(a);g.setFormat(e);g.setStyle(f);g.select();0===c?b.insertBefore(g,!1):([h]=b.splitText(c),h.insertAfter(g,!1));g.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length);return}else if(Be(b)){a=K(a);a.setFormat(e);a.setStyle(f);a.select();b.replace(a);return}b=b.spliceText(c,m-c,a,!0);""===b.getTextContent()?b.remove():"text"===this.anchor.type&&(b.isComposing()?this.anchor.offset-=a.length:(this.format=
|
||||
+n.insertBefore(l);l.select();b=l;if(""!==a){this.insertText(a);return}}else if(b.isSegmented()&&c!==d)n=K(b.getTextContent()),n.setFormat(e),b.replace(n),b=n;else if(!(this.isCollapsed()||""===a||(l=p.getParent(),n.canInsertTextBefore()&&n.canInsertTextAfter()&&(!E(l)||l.canInsertTextBefore()&&l.canInsertTextAfter())))){this.insertText("");Ve(this.anchor,this.focus,null);this.insertText(a);return}if(1===h)if(b.isToken())a=K(a),a.select(),b.replace(a);else{g=b.getFormat();h=b.getStyle();if(c===m&&
|
||||
+(g!==e||h!==f))if(""===b.getTextContent())b.setFormat(e),b.setStyle(f);else{g=K(a);g.setFormat(e);g.setStyle(f);g.select();0===c?b.insertBefore(g,!1):([h]=b.splitText(c),h.insertAfter(g,!1));g.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length);return}else if(Ce(b)){a=K(a);a.setFormat(e);a.setStyle(f);a.select();b.replace(a);return}b=b.spliceText(c,m-c,a,!0);""===b.getTextContent()?b.remove():"text"===this.anchor.type&&(b.isComposing()?this.anchor.offset-=a.length:(this.format=
|
||||
g,this.style=h))}else{e=new Set([...b.getParentKeys(),...p.getParentKeys()]);l=E(b)?b:b.getParentOrThrow();f=E(p)?p:p.getParentOrThrow();n=p;if(!l.is(f)&&f.isInline()){do n=f,f=f.getParentOrThrow();while(f.isInline())}if("text"===k.type&&(0!==m||""===p.getTextContent())||"element"===k.type&&p.getIndexWithinParent()<m)if(B(p)&&!p.isToken()&&m!==p.getTextContentSize()){if(p.isSegmented()){var r=K(p.getTextContent());p.replace(r);p=r}L(k.getNode())||"text"!==k.type||(p=p.spliceText(0,m,""));e.add(p.__key)}else k=
|
||||
p.getParentOrThrow(),k.canBeEmpty()||1!==k.getChildrenSize()?p.remove():k.remove();else e.add(p.__key);k=f.getChildren();m=new Set(g);p=l.is(f);l=l.isInline()&&null===b.getNextSibling()?l:b;for(r=k.length-1;0<=r;r--){let w=k[r];if(w.is(b)||E(w)&&w.isParentOf(b))break;w.isAttached()&&(!m.has(w)||w.is(n)?p||l.insertAfter(w,!1):w.remove())}if(!p)for(k=f,f=null;null!==k;){m=k.getChildren();p=m.length;if(0===p||m[p-1].is(f))e.delete(k.__key),f=k;k=k.getParent()}b.isToken()?c===d?b.select():(a=K(a),a.select(),
|
||||
b.replace(a)):(b=b.spliceText(c,d-c,a,!0),""===b.getTextContent()?b.remove():b.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=a.length));for(a=1;a<h;a++)b=g[a],e.has(b.__key)||b.remove()}}removeText(){this.insertText("")}formatText(a){if(this.isCollapsed())this.toggleFormat(a),H(null);else{var b=this.getNodes(),c=[];for(var d of b)B(d)&&c.push(d);var e=c.length;if(0===e)this.toggleFormat(a),H(null);else{d=this.anchor;var f=this.focus,g=this.isBackward();b=g?f:d;d=g?d:f;var h=0,k=c[0];
|
||||
f="element"===b.type?0:b.offset;"text"===b.type&&f===k.getTextContentSize()&&(h=1,k=c[1],f=0);if(null!=k){g=k.getFormatFlags(a,null);var m=e-1,n=c[m];e="text"===d.type?d.offset:n.getTextContentSize();if(k.is(n))f!==e&&(0===f&&e===k.getTextContentSize()?k.setFormat(g):(a=k.splitText(f,e),a=0===f?a[0]:a[1],a.setFormat(g),"text"===b.type&&b.set(a.__key,0,"text"),"text"===d.type&&d.set(a.__key,e-f,"text")),this.format=g);else{0!==f&&([,k]=k.splitText(f),f=0);k.setFormat(g);var p=n.getFormatFlags(a,g);
|
||||
-0<e&&(e!==n.getTextContentSize()&&([n]=n.splitText(e)),n.setFormat(p));for(h+=1;h<m;h++){let l=c[h];if(!l.isToken()){let r=l.getFormatFlags(a,p);l.setFormat(r)}}"text"===b.type&&b.set(k.__key,f,"text");"text"===d.type&&d.set(n.__key,e,"text");this.format=g|p}}}}}insertNodes(a){if(0!==a.length){if("root"===this.anchor.key){this.insertParagraph();var b=u();if(!C(b))throw Error("Expected RangeSelection after insertParagraph");return b.insertNodes(a)}var c=Hc(this.anchor.getNode(),Fc);b=a[a.length-1];
|
||||
-if("__language"in c&&E(c))if("__language"in a[0])this.insertText(a[0].getTextContent());else{var d=Ve(this);c.splice(d,0,a);b.selectEnd()}else if(a.some(g=>(E(g)||x(g))&&!g.isInline())){b=We(a);a=b.getLastDescendant();var e=b.getChildren();b=E(c)&&c.isEmpty()?null:this.insertParagraph();d=e[e.length-1];var f=e[0];if((g=>E(g)&&Fc(g)&&!g.isEmpty()&&E(c)&&(!c.isEmpty()||"__value"in c&&"__checked"in c))(f)){if(!E(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...f.getChildren());
|
||||
-f=e[1]}f&&fe(c,f);e=Hc(a,Fc);b&&E(e)&&("__value"in b&&"__checked"in b||Fc(d))&&(e.append(...b.getChildren()),b.remove());E(c)&&c.isEmpty()&&c.remove();a.selectEnd();a=E(c)?c.getLastChild():null;Gc(a)&&e!==c&&a.remove()}else{if(!E(c))throw Error("Expected 'firstBlock' to be an ElementNode");d=Ve(this);c.splice(d,0,a);b.selectEnd()}}}insertParagraph(){if("root"===this.anchor.key){var a=ee();J().splice(this.anchor.offset,0,[a]);a.select();return a}var b=Ve(this);a=Hc(this.anchor.getNode(),Fc);if(!E(a))throw Error("Expected ancestor to be an ElementNode");
|
||||
-b=(b=a.getChildAtIndex(b))?[b,...b.getNextSiblings()]:[];return(a=a.insertNewAfter(this,!1))?(a.append(...b),a.selectStart(),a):null}insertLineBreak(a){var b=ie();this.insertNodes([b]);a&&(a=b.getParentOrThrow(),b=b.getIndexWithinParent(),a.select(b,b))}extract(){var a=this.getNodes(),b=a.length,c=b-1,d=this.anchor;let e=this.focus;var f=a[0];let g=a[c],[h,k]=Qe(this);if(0===b)return[];if(1===b)return B(f)&&!this.isCollapsed()?(a=h>k?k:h,c=f.splitText(a,h>k?h:k),a=0===a?c[0]:c[1],null!=a?[a]:[]):
|
||||
-[f];b=d.isBefore(e);B(f)&&(d=b?h:k,d===f.getTextContentSize()?a.shift():0!==d&&([,f]=f.splitText(d),a[0]=f));B(g)&&(f=g.getTextContent().length,b=b?k:h,0===b?a.pop():b!==f&&([g]=g.splitText(b),a[c]=g));return a}modify(a,b,c){var d=this.focus,e=this.anchor,f="move"===a,g=sc(d,b);if(x(g)&&!g.isIsolated())f&&g.isKeyboardSelectable()?(b=Xe(),b.add(g.__key),Ab(b)):(a=b?g.getPreviousSibling():g.getNextSibling(),B(a)?(g=a.__key,b=b?a.getTextContent().length:0,d.set(g,b,"text"),f&&e.set(g,b,"text")):(c=g.getParentOrThrow(),
|
||||
+0<e&&(e!==n.getTextContentSize()&&([n]=n.splitText(e)),n.setFormat(p));for(h+=1;h<m;h++){let l=c[h];if(!l.isToken()){let r=l.getFormatFlags(a,p);l.setFormat(r)}}"text"===b.type&&b.set(k.__key,f,"text");"text"===d.type&&d.set(n.__key,e,"text");this.format=g|p}}}}}insertNodes(a){if(0!==a.length){if("root"===this.anchor.key){this.insertParagraph();var b=u();if(!C(b))throw Error("Expected RangeSelection after insertParagraph");return b.insertNodes(a)}b=this.isBackward()?this.focus:this.anchor;var c=Hc(b.getNode(),
|
||||
+Fc);b=a[a.length-1];if("__language"in c&&E(c))if("__language"in a[0])this.insertText(a[0].getTextContent());else{var d=We(this);c.splice(d,0,a);b.selectEnd()}else if(a.some(g=>(E(g)||x(g))&&!g.isInline())){b=Xe(a);a=b.getLastDescendant();var e=b.getChildren();b=E(c)&&c.isEmpty()?null:this.insertParagraph();d=e[e.length-1];var f=e[0];if((g=>E(g)&&Fc(g)&&!g.isEmpty()&&E(c)&&(!c.isEmpty()||"__value"in c&&"__checked"in c))(f)){if(!E(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...f.getChildren());
|
||||
+f=e[1]}f&&fe(c,f);e=Hc(a,Fc);b&&E(e)&&("__value"in b&&"__checked"in b||Fc(d))&&(e.append(...b.getChildren()),b.remove());E(c)&&c.isEmpty()&&c.remove();a.selectEnd();a=E(c)?c.getLastChild():null;Gc(a)&&e!==c&&a.remove()}else{if(!E(c))throw Error("Expected 'firstBlock' to be an ElementNode");d=We(this);c.splice(d,0,a);b.selectEnd()}}}insertParagraph(){if("root"===this.anchor.key){var a=ee();J().splice(this.anchor.offset,0,[a]);a.select();return a}var b=We(this);a=Hc(this.anchor.getNode(),Fc);if(!E(a))throw Error("Expected ancestor to be an ElementNode");
|
||||
+b=(b=a.getChildAtIndex(b))?[b,...b.getNextSiblings()]:[];return(a=a.insertNewAfter(this,!1))?(a.append(...b),a.selectStart(),a):null}insertLineBreak(a){var b=je();this.insertNodes([b]);a&&(a=b.getParentOrThrow(),b=b.getIndexWithinParent(),a.select(b,b))}extract(){var a=this.getNodes(),b=a.length,c=b-1,d=this.anchor;let e=this.focus;var f=a[0];let g=a[c],[h,k]=Re(this);if(0===b)return[];if(1===b)return B(f)&&!this.isCollapsed()?(a=h>k?k:h,c=f.splitText(a,h>k?h:k),a=0===a?c[0]:c[1],null!=a?[a]:[]):
|
||||
+[f];b=d.isBefore(e);B(f)&&(d=b?h:k,d===f.getTextContentSize()?a.shift():0!==d&&([,f]=f.splitText(d),a[0]=f));B(g)&&(f=g.getTextContent().length,b=b?k:h,0===b?a.pop():b!==f&&([g]=g.splitText(b),a[c]=g));return a}modify(a,b,c){var d=this.focus,e=this.anchor,f="move"===a,g=sc(d,b);if(x(g)&&!g.isIsolated())f&&g.isKeyboardSelectable()?(b=Ye(),b.add(g.__key),Ab(b)):(a=b?g.getPreviousSibling():g.getNextSibling(),B(a)?(g=a.__key,b=b?a.getTextContent().length:0,d.set(g,b,"text"),f&&e.set(g,b,"text")):(c=g.getParentOrThrow(),
|
||||
E(a)?(c=a.__key,g=b?a.getChildrenSize():0):(g=g.getIndexWithinParent(),c=c.__key,b||g++),d.set(c,g,"element"),f&&e.set(c,g,"element")));else if(e=F(),d=xb(e._window)){var h=e._blockCursorElement,k=e._rootElement;null===k||null===h||!E(g)||g.isInline()||g.canBeEmpty()||Cc(h,e,k);d.modify(a,b?"backward":"forward",c);if(0<d.rangeCount&&(g=d.getRangeAt(0),e=this.anchor.getNode(),e=L(e)?e:wc(e),this.applyDOMRange(g),this.dirty=!0,!f)){f=this.getNodes();a=[];c=!1;for(h=0;h<f.length;h++)k=f[h],vc(k,e)?a.push(k):
|
||||
-c=!0;c&&0<a.length&&(b?(b=a[0],E(b)?b.selectStart():b.getParentOrThrow().selectStart()):(b=a[a.length-1],E(b)?b.selectEnd():b.getParentOrThrow().selectEnd()));if(d.anchorNode!==g.startContainer||d.anchorOffset!==g.startOffset)b=this.focus,f=this.anchor,d=f.key,g=f.offset,e=f.type,Oe(f,b.key,b.offset,b.type),Oe(b,d,g,e),this._cachedNodes=null}}}deleteCharacter(a){let b=this.isCollapsed();if(this.isCollapsed()){var c=this.anchor,d=this.focus,e=c.getNode();if(!a&&("element"===c.type&&E(e)&&c.offset===
|
||||
-e.getChildrenSize()||"text"===c.type&&c.offset===e.getTextContentSize())){var f=e.getParent();f=e.getNextSibling()||(null===f?null:f.getNextSibling());if(E(f)&&f.isShadowRoot())return}f=sc(d,a);if(x(f)&&!f.isIsolated()){f.isKeyboardSelectable()&&E(e)&&0===e.getChildrenSize()?(e.remove(),a=Xe(),a.add(f.__key),Ab(a)):(f.remove(),F().dispatchCommand(aa,void 0));return}if(!a&&E(f)&&E(e)&&e.isEmpty()){e.remove();f.selectStart();return}this.modify("extend",a,"character");if(!this.isCollapsed()){f="text"===
|
||||
-d.type?d.getNode():null;e="text"===c.type?c.getNode():null;if(null!==f&&f.isSegmented()){if(c=d.offset,d=f.getTextContentSize(),f.is(e)||a&&c!==d||!a&&0!==c){Ye(f,a,c);return}}else if(null!==e&&e.isSegmented()&&(c=c.offset,d=e.getTextContentSize(),e.is(f)||a&&0!==c||!a&&c!==d)){Ye(e,a,c);return}e=this.anchor;f=this.focus;c=e.getNode();d=f.getNode();if(c===d&&"text"===e.type&&"text"===f.type){var g=e.offset,h=f.offset;let k=g<h;d=k?g:h;h=k?h:g;g=h-1;d!==g&&(c=c.getTextContent().slice(d,h),jc(c)||(a?
|
||||
+c=!0;c&&0<a.length&&(b?(b=a[0],E(b)?b.selectStart():b.getParentOrThrow().selectStart()):(b=a[a.length-1],E(b)?b.selectEnd():b.getParentOrThrow().selectEnd()));if(d.anchorNode!==g.startContainer||d.anchorOffset!==g.startOffset)b=this.focus,f=this.anchor,d=f.key,g=f.offset,e=f.type,Pe(f,b.key,b.offset,b.type),Pe(b,d,g,e),this._cachedNodes=null}}}deleteCharacter(a){let b=this.isCollapsed();if(this.isCollapsed()){var c=this.anchor,d=this.focus,e=c.getNode();if(!a&&("element"===c.type&&E(e)&&c.offset===
|
||||
+e.getChildrenSize()||"text"===c.type&&c.offset===e.getTextContentSize())){var f=e.getParent();f=e.getNextSibling()||(null===f?null:f.getNextSibling());if(E(f)&&f.isShadowRoot())return}f=sc(d,a);if(x(f)&&!f.isIsolated()){f.isKeyboardSelectable()&&E(e)&&0===e.getChildrenSize()?(e.remove(),a=Ye(),a.add(f.__key),Ab(a)):(f.remove(),F().dispatchCommand(aa,void 0));return}if(!a&&E(f)&&E(e)&&e.isEmpty()){e.remove();f.selectStart();return}this.modify("extend",a,"character");if(!this.isCollapsed()){f="text"===
|
||||
+d.type?d.getNode():null;e="text"===c.type?c.getNode():null;if(null!==f&&f.isSegmented()){if(c=d.offset,d=f.getTextContentSize(),f.is(e)||a&&c!==d||!a&&0!==c){Ze(f,a,c);return}}else if(null!==e&&e.isSegmented()&&(c=c.offset,d=e.getTextContentSize(),e.is(f)||a&&0!==c||!a&&c!==d)){Ze(e,a,c);return}e=this.anchor;f=this.focus;c=e.getNode();d=f.getNode();if(c===d&&"text"===e.type&&"text"===f.type){var g=e.offset,h=f.offset;let k=g<h;d=k?g:h;h=k?h:g;g=h-1;d!==g&&(c=c.getTextContent().slice(d,h),jc(c)||(a?
|
||||
f.offset=g:e.offset=g))}}else if(a&&0===c.offset&&("element"===c.type?c.getNode():c.getNode().getParentOrThrow()).collapseAtStart(this))return}this.removeText();a&&!b&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset&&(a=this.anchor.getNode(),a.isEmpty()&&L(a.getParent())&&0===a.getIndexWithinParent()&&a.collapseAtStart(this))}deleteLine(a){this.isCollapsed()&&("text"===this.anchor.type&&this.modify("extend",a,"lineboundary"),0===(a?this.focus:this.anchor).offset&&this.modify("extend",
|
||||
-a,"character"));this.removeText()}deleteWord(a){this.isCollapsed()&&this.modify("extend",a,"word");this.removeText()}}function Ud(a){return a instanceof Re}function Ze(a){let b=a.offset;if("text"===a.type)return b;a=a.getNode();return b===a.getChildrenSize()?a.getTextContent().length:0}function Qe(a){let b=a.anchor;a=a.focus;return"element"===b.type&&"element"===a.type&&b.key===a.key&&b.offset===a.offset?[0,0]:[Ze(b),Ze(a)]}
|
||||
-function Ye(a,b,c){let d=a.getTextContent().split(/(?=\s)/g),e=d.length,f=0,g=0;for(let h=0;h<e;h++){let k=d[h],m=h===e-1;g=f;f+=k.length;if(b&&f===c||f>c||m){d.splice(h,1);m&&(g=void 0);break}}b=d.join("").trim();""===b?a.remove():(a.setTextContent(b),a.select(g,g))}
|
||||
-function $e(a,b,c,d){var e=b;if(1===a.nodeType){let h=!1;var f=a.childNodes,g=f.length;e===g&&(h=!0,e=g-1);let k=f[e];g=!1;k===d._blockCursorElement?(k=f[e+1],g=!0):null!==d._blockCursorElement&&e--;d=ic(k);if(B(d))e=h?d.getTextContentSize():0;else{f=ic(a);if(null===f)return null;if(E(f)){a=f.getChildAtIndex(e);if(b=E(a))b=a.getParent(),b=null===c||null===b||!b.canBeEmpty()||b!==c.getNode();b&&(c=h?a.getLastDescendant():a.getFirstDescendant(),null===c?(f=a,e=0):(a=c,f=E(a)?a:a.getParentOrThrow()));
|
||||
+a,"character"));this.removeText()}deleteWord(a){this.isCollapsed()&&this.modify("extend",a,"word");this.removeText()}}function Ud(a){return a instanceof Se}function $e(a){let b=a.offset;if("text"===a.type)return b;a=a.getNode();return b===a.getChildrenSize()?a.getTextContent().length:0}function Re(a){let b=a.anchor;a=a.focus;return"element"===b.type&&"element"===a.type&&b.key===a.key&&b.offset===a.offset?[0,0]:[$e(b),$e(a)]}
|
||||
+function Ze(a,b,c){let d=a.getTextContent().split(/(?=\s)/g),e=d.length,f=0,g=0;for(let h=0;h<e;h++){let k=d[h],m=h===e-1;g=f;f+=k.length;if(b&&f===c||f>c||m){d.splice(h,1);m&&(g=void 0);break}}b=d.join("").trim();""===b?a.remove():(a.setTextContent(b),a.select(g,g))}
|
||||
+function af(a,b,c,d){var e=b;if(1===a.nodeType){let h=!1;var f=a.childNodes,g=f.length;e===g&&(h=!0,e=g-1);let k=f[e];g=!1;k===d._blockCursorElement?(k=f[e+1],g=!0):null!==d._blockCursorElement&&e--;d=ic(k);if(B(d))e=h?d.getTextContentSize():0;else{f=ic(a);if(null===f)return null;if(E(f)){a=f.getChildAtIndex(e);if(b=E(a))b=a.getParent(),b=null===c||null===b||!b.canBeEmpty()||b!==c.getNode();b&&(c=h?a.getLastDescendant():a.getFirstDescendant(),null===c?(f=a,e=0):(a=c,f=E(a)?a:a.getParentOrThrow()));
|
||||
B(a)?(d=a,f=null,e=h?a.getTextContentSize():0):a!==f&&h&&!g&&e++}else e=f.getIndexWithinParent(),e=0===b&&x(f)&&ic(a)===f?e:e+1,f=f.getParentOrThrow();if(E(f))return S(f.__key,e,"element")}}else d=ic(a);return B(d)?S(d.__key,e,"text"):null}
|
||||
-function af(a,b,c){var d=a.offset,e=a.getNode();0===d?(d=e.getPreviousSibling(),e=e.getParent(),b)?(c||!b)&&null===d&&E(e)&&e.isInline()&&(b=e.getPreviousSibling(),B(b)&&(a.key=b.__key,a.offset=b.getTextContent().length)):E(d)&&!c&&d.isInline()?(a.key=d.__key,a.offset=d.getChildrenSize(),a.type="element"):B(d)&&(a.key=d.__key,a.offset=d.getTextContent().length):d===e.getTextContent().length&&(d=e.getNextSibling(),e=e.getParent(),b&&E(d)&&d.isInline()?(a.key=d.__key,a.offset=0,a.type="element"):(c||
|
||||
-b)&&null===d&&E(e)&&e.isInline()&&!e.canInsertTextAfter()&&(b=e.getNextSibling(),B(b)&&(a.key=b.__key,a.offset=0)))}function Ue(a,b,c){if("text"===a.type&&"text"===b.type){var d=a.isBefore(b);let e=a.is(b);af(a,d,e);af(b,!d,e);e&&(b.key=a.key,b.offset=a.offset,b.type=a.type);d=F();d.isComposing()&&d._compositionKey!==a.key&&C(c)&&(d=c.anchor,c=c.focus,Oe(a,d.key,d.offset,d.type),Oe(b,c.key,c.offset,c.type))}}
|
||||
-function Te(a,b,c,d,e,f){if(null===a||null===c||!Tb(e,a,c))return null;b=$e(a,b,C(f)?f.anchor:null,e);if(null===b)return null;d=$e(c,d,C(f)?f.focus:null,e);if(null===d||"element"===b.type&&"element"===d.type&&(a=ic(a),c=ic(c),x(a)&&x(c)))return null;Ue(b,d,f);return[b,d]}function te(a,b,c,d,e,f){let g=ac();a=new Se(S(a,b,e),S(c,d,f),0,"");a.dirty=!0;return g._selection=a}function Xe(){return new Re(new Set)}
|
||||
-function bf(a){let b=a.getEditorState()._selection,c=xb(a._window);return C(b)||null==b?Qd(b,c,a,null):b.clone()}
|
||||
-function Qd(a,b,c,d){var e=c._window;if(null===e)return null;var f=(e=d||e.event)?e.type:void 0;d="selectionchange"===f;e=!qb&&(d||"beforeinput"===f||"compositionstart"===f||"compositionend"===f||"click"===f&&e&&3===e.detail||"drop"===f||void 0===f);let g;if(!C(a)||e){if(null===b)return null;e=b.anchorNode;f=b.focusNode;g=b.anchorOffset;b=b.focusOffset;if(d&&C(a)&&!Tb(c,e,f))return a.clone()}else return a.clone();c=Te(e,g,f,b,c,a);if(null===c)return null;let [h,k]=c;return new Se(h,k,C(a)?a.format:
|
||||
+function bf(a,b,c){var d=a.offset,e=a.getNode();0===d?(d=e.getPreviousSibling(),e=e.getParent(),b)?(c||!b)&&null===d&&E(e)&&e.isInline()&&(b=e.getPreviousSibling(),B(b)&&(a.key=b.__key,a.offset=b.getTextContent().length)):E(d)&&!c&&d.isInline()?(a.key=d.__key,a.offset=d.getChildrenSize(),a.type="element"):B(d)&&(a.key=d.__key,a.offset=d.getTextContent().length):d===e.getTextContent().length&&(d=e.getNextSibling(),e=e.getParent(),b&&E(d)&&d.isInline()?(a.key=d.__key,a.offset=0,a.type="element"):(c||
|
||||
+b)&&null===d&&E(e)&&e.isInline()&&!e.canInsertTextAfter()&&(b=e.getNextSibling(),B(b)&&(a.key=b.__key,a.offset=0)))}function Ve(a,b,c){if("text"===a.type&&"text"===b.type){var d=a.isBefore(b);let e=a.is(b);bf(a,d,e);bf(b,!d,e);e&&(b.key=a.key,b.offset=a.offset,b.type=a.type);d=F();d.isComposing()&&d._compositionKey!==a.key&&C(c)&&(d=c.anchor,c=c.focus,Pe(a,d.key,d.offset,d.type),Pe(b,c.key,c.offset,c.type))}}
|
||||
+function Ue(a,b,c,d,e,f){if(null===a||null===c||!Tb(e,a,c))return null;b=af(a,b,C(f)?f.anchor:null,e);if(null===b)return null;d=af(c,d,C(f)?f.focus:null,e);if(null===d||"element"===b.type&&"element"===d.type&&(a=ic(a),c=ic(c),x(a)&&x(c)))return null;Ve(b,d,f);return[b,d]}function ue(a,b,c,d,e,f){let g=ac();a=new Te(S(a,b,e),S(c,d,f),0,"");a.dirty=!0;return g._selection=a}function Ye(){return new Se(new Set)}
|
||||
+function cf(a){let b=a.getEditorState()._selection,c=xb(a._window);return C(b)||null==b?Qd(b,c,a,null):b.clone()}
|
||||
+function Qd(a,b,c,d){var e=c._window;if(null===e)return null;var f=(e=d||e.event)?e.type:void 0;d="selectionchange"===f;e=!qb&&(d||"beforeinput"===f||"compositionstart"===f||"compositionend"===f||"click"===f&&e&&3===e.detail||"drop"===f||void 0===f);let g;if(!C(a)||e){if(null===b)return null;e=b.anchorNode;f=b.focusNode;g=b.anchorOffset;b=b.focusOffset;if(d&&C(a)&&!Tb(c,e,f))return a.clone()}else return a.clone();c=Ue(e,g,f,b,c,a);if(null===c)return null;let [h,k]=c;return new Te(h,k,C(a)?a.format:
|
||||
0,C(a)?a.style:"")}function u(){return ac()._selection}function nc(){return F()._editorState._selection}
|
||||
-function ae(a,b,c,d=1){var e=a.anchor,f=a.focus,g=e.getNode(),h=f.getNode();if(b.is(g)||b.is(h)){g=b.__key;if(a.isCollapsed()){if(b=e.offset,c<=b&&0<d||c<b&&0>d)c=Math.max(0,b+d),e.set(g,c,"element"),f.set(g,c,"element"),cf(a)}else{let m=a.isBackward();h=m?f:e;var k=h.getNode();e=m?e:f;f=e.getNode();b.is(k)&&(k=h.offset,(c<=k&&0<d||c<k&&0>d)&&h.set(g,Math.max(0,k+d),"element"));b.is(f)&&(b=e.offset,(c<=b&&0<d||c<b&&0>d)&&e.set(g,Math.max(0,b+d),"element"))}cf(a)}}
|
||||
-function cf(a){var b=a.anchor,c=b.offset;let d=a.focus;var e=d.offset,f=b.getNode(),g=d.getNode();if(a.isCollapsed())E(f)&&(g=f.getChildrenSize(),g=(e=c>=g)?f.getChildAtIndex(g-1):f.getChildAtIndex(c),B(g)&&(c=0,e&&(c=g.getTextContentSize()),b.set(g.__key,c,"text"),d.set(g.__key,c,"text")));else{if(E(f)){let h=f.getChildrenSize();c=(a=c>=h)?f.getChildAtIndex(h-1):f.getChildAtIndex(c);B(c)&&(f=0,a&&(f=c.getTextContentSize()),b.set(c.__key,f,"text"))}E(g)&&(c=g.getChildrenSize(),e=(b=e>=c)?g.getChildAtIndex(c-
|
||||
-1):g.getChildAtIndex(e),B(e)&&(g=0,b&&(g=e.getTextContentSize()),d.set(e.__key,g,"text")))}}function df(a,b){b=b.getEditorState()._selection;a=a._selection;if(C(a)){var c=a.anchor;let d=a.focus,e;"text"===c.type&&(e=c.getNode(),e.selectionTransform(b,a));"text"===d.type&&(c=d.getNode(),e!==c&&c.selectionTransform(b,a))}}
|
||||
-function $d(a,b,c,d,e){let f=null,g=0,h=null;null!==d?(f=d.__key,B(d)?(g=d.getTextContentSize(),h="text"):E(d)&&(g=d.getChildrenSize(),h="element")):null!==e&&(f=e.__key,B(e)?h="text":E(e)&&(h="element"));null!==f&&null!==h?a.set(f,g,h):(g=b.getIndexWithinParent(),-1===g&&(g=c.getChildrenSize()),a.set(c.__key,g,"element"))}function ue(a,b,c,d,e){"text"===a.type?(a.key=c,b||(a.offset+=e)):a.offset>d.getIndexWithinParent()&&--a.offset}
|
||||
-function ef(a){a instanceof ff||(a instanceof be?(a=Dc(a,gf),gf(a)||q(114)):(a=Dc(a.getNode(),gf),gf(a)||q(114)));let b=a.getParent();hf(b)||q(115);let c=b.getParent();jf(c)||q(116);return[a,b,c]}function Ve(a){a.isCollapsed()||a.removeText();var b=a.anchor;a=b.getNode();for(b=b.offset;!Fc(a);)[a,b]=kf(a,b);return b}
|
||||
-function kf(a,b){var c=a.getParent();if(!c)return c=ee(),J().append(c),c.select(),[J(),0];if(B(a)){var d=a.splitText(b);if(0===d.length)return[c,a.getIndexWithinParent()];a=0===b?0:1;a=d[0].getIndexWithinParent()+a;return[c,a]}if(!E(a)||0===b)return[c,a.getIndexWithinParent()];if(d=a.getChildAtIndex(b))b=new Se(S(a.__key,b,"element"),S(a.__key,b,"element"),0,""),(b=a.insertNewAfter(b))&&b.append(d,...d.getNextSiblings());return[c,a.getIndexWithinParent()+1]}
|
||||
-function We(a){let b=ee(),c=null;for(let d=0;d<a.length;d++){let e=a[d],f=Gc(e);if(f||x(e)&&e.isInline()||E(e)&&e.isInline()||B(e)||e.isParentRequired()){if(null===c&&(c=e.createParentElementNode(),b.append(c),f))continue;null!==c&&c.append(e)}else b.append(e),c=null}return b}let T=null,U=null,Z=!1,lf=!1,$b=0,mf={characterData:!0,childList:!0,subtree:!0};function ec(){return Z||null!==T&&T._readOnly}function G(){Z&&q(13)}function ac(){null===T&&q(15);return T}
|
||||
-function F(){null===U&&q(16);return U}function nf(a,b,c){var d=b.__type;let e=a._nodes.get(d);void 0===e&&q(30,d);a=c.get(d);void 0===a&&(a=Array.from(e.transforms),c.set(d,a));c=a.length;for(d=0;d<c&&(a[d](b),b.isAttached());d++);}function of(a,b){b=b._dirtyLeaves;a=a._nodeMap;for(let c of b)b=a.get(c),B(b)&&b.isAttached()&&b.isSimpleText()&&!b.isUnmergeable()&&Hb(b)}
|
||||
-function pf(a,b){let c=b._dirtyLeaves,d=b._dirtyElements;a=a._nodeMap;let e=dc(),f=new Map;var g=c;let h=g.size;for(var k=d,m=k.size;0<h||0<m;){if(0<h){b._dirtyLeaves=new Set;for(let n of g)g=a.get(n),B(g)&&g.isAttached()&&g.isSimpleText()&&!g.isUnmergeable()&&Hb(g),void 0!==g&&void 0!==g&&g.__key!==e&&g.isAttached()&&nf(b,g,f),c.add(n);g=b._dirtyLeaves;h=g.size;if(0<h){$b++;continue}}b._dirtyLeaves=new Set;b._dirtyElements=new Map;for(let n of k)if(k=n[0],m=n[1],"root"===k||m)g=a.get(k),void 0!==
|
||||
-g&&void 0!==g&&g.__key!==e&&g.isAttached()&&nf(b,g,f),d.set(k,m);g=b._dirtyLeaves;h=g.size;k=b._dirtyElements;m=k.size;$b++}b._dirtyLeaves=c;b._dirtyElements=d}function qf(a,b){var c=a.type,d=b.get(c);void 0===d&&q(17,c);c=d.klass;a.type!==c.getType()&&q(18,c.name);c=c.importJSON(a);a=a.children;if(E(c)&&Array.isArray(a))for(d=0;d<a.length;d++){let e=qf(a[d],b);c.append(e)}return c}function rf(a,b){let c=T,d=Z,e=U;T=a;Z=!0;U=null;try{return b()}finally{T=c,Z=d,U=e}}
|
||||
-function sf(a,b){let c=a._pendingEditorState,d=a._rootElement,e=a._headless||null===d;if(null!==c){var f=a._editorState,g=f._selection,h=c._selection,k=0!==a._dirtyType,m=T,n=Z,p=U,l=a._updating,r=a._observer,w=null;a._pendingEditorState=null;a._editorState=c;if(!e&&k&&null!==r){U=a;T=c;Z=!1;a._updating=!0;try{let D=a._dirtyType,P=a._dirtyElements,Q=a._dirtyLeaves;r.disconnect();var y=D,z=P,A=Q;N=Kc=M="";Nc=2===y;Qc=null;O=a;Lc=a._config;Mc=a._nodes;Pc=O._listeners.mutation;Rc=z;Sc=A;Tc=f._nodeMap;
|
||||
-Uc=c._nodeMap;Oc=c._readOnly;dd=new Map(a._keyToDOMMap);let fa=new Map;ed=fa;sd("root",null);ed=dd=Lc=Uc=Tc=Sc=Rc=Mc=O=void 0;w=fa}catch(D){D instanceof Error&&a._onError(D);if(lf)throw D;tf(a,null,d,c);Db(a);a._dirtyType=2;lf=!0;sf(a,f);lf=!1;return}finally{r.observe(d,mf),a._updating=l,T=m,Z=n,U=p}}c._readOnly||(c._readOnly=!0);var Ia=a._dirtyLeaves,ca=a._dirtyElements,Wa=a._normalizedNodes,ia=a._updateTags,Vc=a._deferred;k&&(a._dirtyType=0,a._cloneNotNeeded.clear(),a._dirtyLeaves=new Set,a._dirtyElements=
|
||||
-new Map,a._normalizedNodes=new Set,a._updateTags=new Set);var De=a._decorators,Nb=a._pendingDecorators||De,Hf=c._nodeMap,Wc;for(Wc in Nb)Hf.has(Wc)||(Nb===De&&(Nb=fc(a)),delete Nb[Wc]);var ha=e?null:xb(a._window);if(a._editable&&null!==ha&&(k||null===h||h.dirty)){U=a;T=c;try{null!==r&&r.disconnect();if(k||null===h||h.dirty){let D=a._blockCursorElement;null!==D&&Cc(D,a,d);a:{let P=ha.anchorNode,Q=ha.focusNode,fa=ha.anchorOffset,lb=ha.focusOffset,W=document.activeElement;if(!(ia.has("collaboration")&&
|
||||
-W!==d||null!==W&&Mb(W)))if(C(h)){var mb=h.anchor,Xc=h.focus,Ee=mb.key,If=Xc.key,Fe=uc(a,Ee),Ge=uc(a,If),Ob=mb.offset,He=Xc.offset,Yc=h.format,Zc=h.style,Ie=h.isCollapsed(),nb=Fe,Pb=Ge,$c=!1;if("text"===mb.type){nb=Xb(Fe);let X=mb.getNode();$c=X.getFormat()!==Yc||X.getStyle()!==Zc}else C(g)&&"text"===g.anchor.type&&($c=!0);"text"===Xc.type&&(Pb=Xb(Ge));if(null!==nb&&null!==Pb){if(Ie&&(null===g||$c||C(g)&&(g.format!==Yc||g.style!==Zc))){var Jf=performance.now();Md=[Yc,Zc,Ob,Ee,Jf]}if(fa===Ob&&lb===
|
||||
-He&&P===nb&&Q===Pb&&("Range"!==ha.type||!Ie)&&(null!==W&&d.contains(W)||d.focus({preventScroll:!0}),"element"!==mb.type))break a;try{ha.setBaseAndExtent(nb,Ob,Pb,He)}catch(X){}if(!ia.has("skip-scroll-into-view")&&h.isCollapsed()&&null!==d&&d===document.activeElement){let X=h instanceof Se&&"element"===h.anchor.type?nb.childNodes[Ob]||null:0<ha.rangeCount?ha.getRangeAt(0):null;if(null!==X){let Y;if(X instanceof Text){let V=document.createRange();V.selectNode(X);Y=V.getBoundingClientRect()}else Y=X.getBoundingClientRect();
|
||||
-let wa=d.ownerDocument,Da=wa.defaultView;if(null!==Da)for(var {top:ad,bottom:bd}=Y,Qb,Rb,ma=d;null!==ma;){let V=ma===wa.body;if(V)Qb=0,Rb=Eb(a).innerHeight;else{let Sb=ma.getBoundingClientRect();Qb=Sb.top;Rb=Sb.bottom}let Ea=0;ad<Qb?Ea=-(Qb-ad):bd>Rb&&(Ea=bd-Rb);if(0!==Ea)if(V)Da.scrollBy(0,Ea);else{let Sb=ma.scrollTop;ma.scrollTop+=Ea;let Je=ma.scrollTop-Sb;ad-=Je;bd-=Je}if(V)break;ma=Vb(ma)}}}Id=!0}}else null!==g&&Tb(a,P,Q)&&ha.removeAllRanges()}}a:{let D=a._blockCursorElement;if(C(h)&&h.isCollapsed()&&
|
||||
+function ae(a,b,c,d=1){var e=a.anchor,f=a.focus,g=e.getNode(),h=f.getNode();if(b.is(g)||b.is(h)){g=b.__key;if(a.isCollapsed()){if(b=e.offset,c<=b&&0<d||c<b&&0>d)c=Math.max(0,b+d),e.set(g,c,"element"),f.set(g,c,"element"),df(a)}else{let m=a.isBackward();h=m?f:e;var k=h.getNode();e=m?e:f;f=e.getNode();b.is(k)&&(k=h.offset,(c<=k&&0<d||c<k&&0>d)&&h.set(g,Math.max(0,k+d),"element"));b.is(f)&&(b=e.offset,(c<=b&&0<d||c<b&&0>d)&&e.set(g,Math.max(0,b+d),"element"))}df(a)}}
|
||||
+function df(a){var b=a.anchor,c=b.offset;let d=a.focus;var e=d.offset,f=b.getNode(),g=d.getNode();if(a.isCollapsed())E(f)&&(g=f.getChildrenSize(),g=(e=c>=g)?f.getChildAtIndex(g-1):f.getChildAtIndex(c),B(g)&&(c=0,e&&(c=g.getTextContentSize()),b.set(g.__key,c,"text"),d.set(g.__key,c,"text")));else{if(E(f)){let h=f.getChildrenSize();c=(a=c>=h)?f.getChildAtIndex(h-1):f.getChildAtIndex(c);B(c)&&(f=0,a&&(f=c.getTextContentSize()),b.set(c.__key,f,"text"))}E(g)&&(c=g.getChildrenSize(),e=(b=e>=c)?g.getChildAtIndex(c-
|
||||
+1):g.getChildAtIndex(e),B(e)&&(g=0,b&&(g=e.getTextContentSize()),d.set(e.__key,g,"text")))}}function ef(a,b){b=b.getEditorState()._selection;a=a._selection;if(C(a)){var c=a.anchor;let d=a.focus,e;"text"===c.type&&(e=c.getNode(),e.selectionTransform(b,a));"text"===d.type&&(c=d.getNode(),e!==c&&c.selectionTransform(b,a))}}
|
||||
+function $d(a,b,c,d,e){let f=null,g=0,h=null;null!==d?(f=d.__key,B(d)?(g=d.getTextContentSize(),h="text"):E(d)&&(g=d.getChildrenSize(),h="element")):null!==e&&(f=e.__key,B(e)?h="text":E(e)&&(h="element"));null!==f&&null!==h?a.set(f,g,h):(g=b.getIndexWithinParent(),-1===g&&(g=c.getChildrenSize()),a.set(c.__key,g,"element"))}function ve(a,b,c,d,e){"text"===a.type?(a.key=c,b||(a.offset+=e)):a.offset>d.getIndexWithinParent()&&--a.offset}
|
||||
+function ff(a){a instanceof gf||(a instanceof be?(a=Dc(a,hf),hf(a)||q(114)):(a=Dc(a.getNode(),hf),hf(a)||q(114)));let b=a.getParent();jf(b)||q(115);let c=b.getParent();kf(c)||q(116);return[a,b,c]}function We(a){a.isCollapsed()||a.removeText();var b=a.anchor;a=b.getNode();for(b=b.offset;!Fc(a);)[a,b]=lf(a,b);return b}
|
||||
+function lf(a,b){var c=a.getParent();if(!c)return c=ee(),J().append(c),c.select(),[J(),0];if(B(a)){var d=a.splitText(b);if(0===d.length)return[c,a.getIndexWithinParent()];a=0===b?0:1;a=d[0].getIndexWithinParent()+a;return[c,a]}if(!E(a)||0===b)return[c,a.getIndexWithinParent()];if(d=a.getChildAtIndex(b))b=new Te(S(a.__key,b,"element"),S(a.__key,b,"element"),0,""),(b=a.insertNewAfter(b))&&b.append(d,...d.getNextSiblings());return[c,a.getIndexWithinParent()+1]}
|
||||
+function Xe(a){let b=ee(),c=null;for(let d=0;d<a.length;d++){let e=a[d],f=Gc(e);if(f||x(e)&&e.isInline()||E(e)&&e.isInline()||B(e)||e.isParentRequired()){if(null===c&&(c=e.createParentElementNode(),b.append(c),f))continue;null!==c&&c.append(e)}else b.append(e),c=null}return b}let T=null,U=null,Z=!1,mf=!1,$b=0,nf={characterData:!0,childList:!0,subtree:!0};function ec(){return Z||null!==T&&T._readOnly}function G(){Z&&q(13)}function ac(){null===T&&q(15);return T}
|
||||
+function F(){null===U&&q(16);return U}function of(a,b,c){var d=b.__type;let e=a._nodes.get(d);void 0===e&&q(30,d);a=c.get(d);void 0===a&&(a=Array.from(e.transforms),c.set(d,a));c=a.length;for(d=0;d<c&&(a[d](b),b.isAttached());d++);}function pf(a,b){b=b._dirtyLeaves;a=a._nodeMap;for(let c of b)b=a.get(c),B(b)&&b.isAttached()&&b.isSimpleText()&&!b.isUnmergeable()&&Hb(b)}
|
||||
+function qf(a,b){let c=b._dirtyLeaves,d=b._dirtyElements;a=a._nodeMap;let e=dc(),f=new Map;var g=c;let h=g.size;for(var k=d,m=k.size;0<h||0<m;){if(0<h){b._dirtyLeaves=new Set;for(let n of g)g=a.get(n),B(g)&&g.isAttached()&&g.isSimpleText()&&!g.isUnmergeable()&&Hb(g),void 0!==g&&void 0!==g&&g.__key!==e&&g.isAttached()&&of(b,g,f),c.add(n);g=b._dirtyLeaves;h=g.size;if(0<h){$b++;continue}}b._dirtyLeaves=new Set;b._dirtyElements=new Map;for(let n of k)if(k=n[0],m=n[1],"root"===k||m)g=a.get(k),void 0!==
|
||||
+g&&void 0!==g&&g.__key!==e&&g.isAttached()&&of(b,g,f),d.set(k,m);g=b._dirtyLeaves;h=g.size;k=b._dirtyElements;m=k.size;$b++}b._dirtyLeaves=c;b._dirtyElements=d}function rf(a,b){var c=a.type,d=b.get(c);void 0===d&&q(17,c);c=d.klass;a.type!==c.getType()&&q(18,c.name);c=c.importJSON(a);a=a.children;if(E(c)&&Array.isArray(a))for(d=0;d<a.length;d++){let e=rf(a[d],b);c.append(e)}return c}function sf(a,b){let c=T,d=Z,e=U;T=a;Z=!0;U=null;try{return b()}finally{T=c,Z=d,U=e}}
|
||||
+function tf(a,b){let c=a._pendingEditorState,d=a._rootElement,e=a._headless||null===d;if(null!==c){var f=a._editorState,g=f._selection,h=c._selection,k=0!==a._dirtyType,m=T,n=Z,p=U,l=a._updating,r=a._observer,w=null;a._pendingEditorState=null;a._editorState=c;if(!e&&k&&null!==r){U=a;T=c;Z=!1;a._updating=!0;try{let D=a._dirtyType,P=a._dirtyElements,Q=a._dirtyLeaves;r.disconnect();var y=D,z=P,A=Q;N=Kc=M="";Nc=2===y;Qc=null;O=a;Lc=a._config;Mc=a._nodes;Pc=O._listeners.mutation;Rc=z;Sc=A;Tc=f._nodeMap;
|
||||
+Uc=c._nodeMap;Oc=c._readOnly;dd=new Map(a._keyToDOMMap);let fa=new Map;ed=fa;sd("root",null);ed=dd=Lc=Uc=Tc=Sc=Rc=Mc=O=void 0;w=fa}catch(D){D instanceof Error&&a._onError(D);if(mf)throw D;uf(a,null,d,c);Db(a);a._dirtyType=2;mf=!0;tf(a,f);mf=!1;return}finally{r.observe(d,nf),a._updating=l,T=m,Z=n,U=p}}c._readOnly||(c._readOnly=!0);var Ia=a._dirtyLeaves,ca=a._dirtyElements,Wa=a._normalizedNodes,ia=a._updateTags,Vc=a._deferred;k&&(a._dirtyType=0,a._cloneNotNeeded.clear(),a._dirtyLeaves=new Set,a._dirtyElements=
|
||||
+new Map,a._normalizedNodes=new Set,a._updateTags=new Set);var Ee=a._decorators,Nb=a._pendingDecorators||Ee,If=c._nodeMap,Wc;for(Wc in Nb)If.has(Wc)||(Nb===Ee&&(Nb=fc(a)),delete Nb[Wc]);var ha=e?null:xb(a._window);if(a._editable&&null!==ha&&(k||null===h||h.dirty)){U=a;T=c;try{null!==r&&r.disconnect();if(k||null===h||h.dirty){let D=a._blockCursorElement;null!==D&&Cc(D,a,d);a:{let P=ha.anchorNode,Q=ha.focusNode,fa=ha.anchorOffset,lb=ha.focusOffset,W=document.activeElement;if(!(ia.has("collaboration")&&
|
||||
+W!==d||null!==W&&Mb(W)))if(C(h)){var mb=h.anchor,Xc=h.focus,Fe=mb.key,Jf=Xc.key,Ge=uc(a,Fe),He=uc(a,Jf),Ob=mb.offset,Ie=Xc.offset,Yc=h.format,Zc=h.style,Je=h.isCollapsed(),nb=Ge,Pb=He,$c=!1;if("text"===mb.type){nb=Xb(Ge);let X=mb.getNode();$c=X.getFormat()!==Yc||X.getStyle()!==Zc}else C(g)&&"text"===g.anchor.type&&($c=!0);"text"===Xc.type&&(Pb=Xb(He));if(null!==nb&&null!==Pb){if(Je&&(null===g||$c||C(g)&&(g.format!==Yc||g.style!==Zc))){var Kf=performance.now();Md=[Yc,Zc,Ob,Fe,Kf]}if(fa===Ob&&lb===
|
||||
+Ie&&P===nb&&Q===Pb&&("Range"!==ha.type||!Je)&&(null!==W&&d.contains(W)||d.focus({preventScroll:!0}),"element"!==mb.type))break a;try{ha.setBaseAndExtent(nb,Ob,Pb,Ie)}catch(X){}if(!ia.has("skip-scroll-into-view")&&h.isCollapsed()&&null!==d&&d===document.activeElement){let X=h instanceof Te&&"element"===h.anchor.type?nb.childNodes[Ob]||null:0<ha.rangeCount?ha.getRangeAt(0):null;if(null!==X){let Y;if(X instanceof Text){let V=document.createRange();V.selectNode(X);Y=V.getBoundingClientRect()}else Y=X.getBoundingClientRect();
|
||||
+let wa=d.ownerDocument,Da=wa.defaultView;if(null!==Da)for(var {top:ad,bottom:bd}=Y,Qb,Rb,ma=d;null!==ma;){let V=ma===wa.body;if(V)Qb=0,Rb=Eb(a).innerHeight;else{let Sb=ma.getBoundingClientRect();Qb=Sb.top;Rb=Sb.bottom}let Ea=0;ad<Qb?Ea=-(Qb-ad):bd>Rb&&(Ea=bd-Rb);if(0!==Ea)if(V)Da.scrollBy(0,Ea);else{let Sb=ma.scrollTop;ma.scrollTop+=Ea;let Ke=ma.scrollTop-Sb;ad-=Ke;bd-=Ke}if(V)break;ma=Vb(ma)}}}Id=!0}}else null!==g&&Tb(a,P,Q)&&ha.removeAllRanges()}}a:{let D=a._blockCursorElement;if(C(h)&&h.isCollapsed()&&
|
||||
"element"===h.anchor.type&&d.contains(document.activeElement)){let P=h.anchor,Q=P.getNode(),fa=P.offset,lb=Q.getChildrenSize(),W=!1,X=null;if(fa===lb){let Y=Q.getChildAtIndex(fa-1);Bc(Y)&&(W=!0)}else{let Y=Q.getChildAtIndex(fa);if(Bc(Y)){let wa=Y.getPreviousSibling();if(null===wa||Bc(wa))W=!0,X=a.getElementByKey(Y.__key)}}if(W){let Y=a.getElementByKey(Q.__key);if(null===D){let wa=a._config.theme,Da=document.createElement("div");Da.contentEditable="false";Da.setAttribute("data-lexical-cursor","true");
|
||||
-let V=wa.blockCursor;if(void 0!==V){if("string"===typeof V){let Ea=V.split(" ");V=wa.blockCursor=Ea}void 0!==V&&Da.classList.add(...V)}a._blockCursorElement=D=Da}d.style.caretColor="transparent";null===X?Y.appendChild(D):Y.insertBefore(D,X);break a}}null!==D&&Cc(D,a,d)}null!==r&&r.observe(d,mf)}finally{U=p,T=m}}if(null!==w){var Kf=w;let D=Array.from(a._listeners.mutation),P=D.length;for(let Q=0;Q<P;Q++){let [fa,lb]=D[Q],W=Kf.get(lb);void 0!==W&&fa(W,{dirtyLeaves:Ia,prevEditorState:f,updateTags:ia})}}C(h)||
|
||||
-null===h||null!==g&&g.is(h)||a.dispatchCommand(aa,void 0);var cd=a._pendingDecorators;null!==cd&&(a._decorators=cd,a._pendingDecorators=null,uf("decorator",a,!0,cd));var Lf=gc(b||f),Ke=gc(c);Lf!==Ke&&uf("textcontent",a,!0,Ke);uf("update",a,!0,{dirtyElements:ca,dirtyLeaves:Ia,editorState:c,normalizedNodes:Wa,prevEditorState:b||f,tags:ia});a._deferred=[];if(0!==Vc.length){let D=a._updating;a._updating=!0;try{for(let P=0;P<Vc.length;P++)Vc[P]()}finally{a._updating=D}}var Le=a._updates;if(0!==Le.length){let D=
|
||||
-Le.shift();if(D){let [P,Q]=D;vf(a,P,Q)}}}}function uf(a,b,c,...d){let e=b._updating;b._updating=c;try{let f=Array.from(b._listeners[a]);for(a=0;a<f.length;a++)f[a].apply(null,d)}finally{b._updating=e}}
|
||||
+let V=wa.blockCursor;if(void 0!==V){if("string"===typeof V){let Ea=V.split(" ");V=wa.blockCursor=Ea}void 0!==V&&Da.classList.add(...V)}a._blockCursorElement=D=Da}d.style.caretColor="transparent";null===X?Y.appendChild(D):Y.insertBefore(D,X);break a}}null!==D&&Cc(D,a,d)}null!==r&&r.observe(d,nf)}finally{U=p,T=m}}if(null!==w){var Lf=w;let D=Array.from(a._listeners.mutation),P=D.length;for(let Q=0;Q<P;Q++){let [fa,lb]=D[Q],W=Lf.get(lb);void 0!==W&&fa(W,{dirtyLeaves:Ia,prevEditorState:f,updateTags:ia})}}C(h)||
|
||||
+null===h||null!==g&&g.is(h)||a.dispatchCommand(aa,void 0);var cd=a._pendingDecorators;null!==cd&&(a._decorators=cd,a._pendingDecorators=null,vf("decorator",a,!0,cd));var Mf=gc(b||f),Le=gc(c);Mf!==Le&&vf("textcontent",a,!0,Le);vf("update",a,!0,{dirtyElements:ca,dirtyLeaves:Ia,editorState:c,normalizedNodes:Wa,prevEditorState:b||f,tags:ia});a._deferred=[];if(0!==Vc.length){let D=a._updating;a._updating=!0;try{for(let P=0;P<Vc.length;P++)Vc[P]()}finally{a._updating=D}}var Me=a._updates;if(0!==Me.length){let D=
|
||||
+Me.shift();if(D){let [P,Q]=D;wf(a,P,Q)}}}}function vf(a,b,c,...d){let e=b._updating;b._updating=c;try{let f=Array.from(b._listeners[a]);for(a=0;a<f.length;a++)f[a].apply(null,d)}finally{b._updating=e}}
|
||||
function R(a,b,c){if(!1===a._updating||U!==a){let f=!1;a.update(()=>{f=R(a,b,c)});return f}let d=kc(a);for(let f=4;0<=f;f--)for(let g=0;g<d.length;g++){var e=d[g]._commands.get(b);if(void 0!==e&&(e=e[f],void 0!==e)){e=Array.from(e);let h=e.length;for(let k=0;k<h;k++)if(!0===e[k](c,a))return!0}}return!1}
|
||||
-function wf(a,b){let c=a._updates;for(b=b||!1;0!==c.length;){var d=c.shift();if(d){let [e,f]=d,g;void 0!==f&&(d=f.onUpdate,g=f.tag,f.skipTransforms&&(b=!0),d&&a._deferred.push(d),g&&a._updateTags.add(g));e()}}return b}
|
||||
-function vf(a,b,c){let d=a._updateTags;var e,f=e=!1;if(void 0!==c){var g=c.onUpdate;e=c.tag;null!=e&&d.add(e);e=c.skipTransforms||!1;f=c.discrete||!1}g&&a._deferred.push(g);c=a._editorState;g=a._pendingEditorState;let h=!1;if(null===g||g._readOnly)g=a._pendingEditorState=new xf(new Map((g||c)._nodeMap)),h=!0;g._flushSync=f;f=T;let k=Z,m=U,n=a._updating;T=g;Z=!1;a._updating=!0;U=a;try{h&&(a._headless?null!=c._selection&&(g._selection=c._selection.clone()):g._selection=bf(a));let p=a._compositionKey;
|
||||
-b();e=wf(a,e);df(g,a);0!==a._dirtyType&&(e?of(g,a):pf(g,a),wf(a),Jc(c,g,a._dirtyLeaves,a._dirtyElements));p!==a._compositionKey&&(g._flushSync=!0);let l=g._selection;if(C(l)){let r=g._nodeMap,w=l.focus.key;void 0!==r.get(l.anchor.key)&&void 0!==r.get(w)||q(19)}else Ud(l)&&0===l._nodes.size&&(g._selection=null)}catch(p){p instanceof Error&&a._onError(p);a._pendingEditorState=c;a._dirtyType=2;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();sf(a);return}finally{T=f,Z=k,U=m,
|
||||
-a._updating=n,$b=0}0!==a._dirtyType||yf(g,a)?g._flushSync?(g._flushSync=!1,sf(a)):h&&Lb(()=>{sf(a)}):(g._flushSync=!1,h&&(d.clear(),a._deferred=[],a._pendingEditorState=null))}function v(a,b,c){a._updating?a._updates.push([b,c]):vf(a,b,c)}class zf extends be{constructor(a){super(a)}decorate(){q(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function x(a){return a instanceof zf}
|
||||
-class Af extends be{constructor(a){super(a);this.__last=this.__first=null;this.__indent=this.__format=this.__size=0;this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let a=this.getFormat();return kb[a]||""}getIndent(){return this.getLatest().__indent}getChildren(){let a=[],b=this.getFirstChild();for(;null!==b;)a.push(b),b=b.getNextSibling();return a}getChildrenKeys(){let a=[],b=this.getFirstChild();for(;null!==b;)a.push(b.__key),b=b.getNextSibling();return a}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===
|
||||
+function xf(a,b){let c=a._updates;for(b=b||!1;0!==c.length;){var d=c.shift();if(d){let [e,f]=d,g;void 0!==f&&(d=f.onUpdate,g=f.tag,f.skipTransforms&&(b=!0),d&&a._deferred.push(d),g&&a._updateTags.add(g));e()}}return b}
|
||||
+function wf(a,b,c){let d=a._updateTags;var e,f=e=!1;if(void 0!==c){var g=c.onUpdate;e=c.tag;null!=e&&d.add(e);e=c.skipTransforms||!1;f=c.discrete||!1}g&&a._deferred.push(g);c=a._editorState;g=a._pendingEditorState;let h=!1;if(null===g||g._readOnly)g=a._pendingEditorState=new yf(new Map((g||c)._nodeMap)),h=!0;g._flushSync=f;f=T;let k=Z,m=U,n=a._updating;T=g;Z=!1;a._updating=!0;U=a;try{h&&(a._headless?null!=c._selection&&(g._selection=c._selection.clone()):g._selection=cf(a));let p=a._compositionKey;
|
||||
+b();e=xf(a,e);ef(g,a);0!==a._dirtyType&&(e?pf(g,a):qf(g,a),xf(a),Jc(c,g,a._dirtyLeaves,a._dirtyElements));p!==a._compositionKey&&(g._flushSync=!0);let l=g._selection;if(C(l)){let r=g._nodeMap,w=l.focus.key;void 0!==r.get(l.anchor.key)&&void 0!==r.get(w)||q(19)}else Ud(l)&&0===l._nodes.size&&(g._selection=null)}catch(p){p instanceof Error&&a._onError(p);a._pendingEditorState=c;a._dirtyType=2;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();tf(a);return}finally{T=f,Z=k,U=m,
|
||||
+a._updating=n,$b=0}0!==a._dirtyType||zf(g,a)?g._flushSync?(g._flushSync=!1,tf(a)):h&&Lb(()=>{tf(a)}):(g._flushSync=!1,h&&(d.clear(),a._deferred=[],a._pendingEditorState=null))}function v(a,b,c){a._updating?a._updates.push([b,c]):wf(a,b,c)}class Af extends be{constructor(a){super(a)}decorate(){q(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function x(a){return a instanceof Af}
|
||||
+class Bf extends be{constructor(a){super(a);this.__last=this.__first=null;this.__indent=this.__format=this.__size=0;this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let a=this.getFormat();return kb[a]||""}getIndent(){return this.getLatest().__indent}getChildren(){let a=[],b=this.getFirstChild();for(;null!==b;)a.push(b),b=b.getNextSibling();return a}getChildrenKeys(){let a=[],b=this.getFirstChild();for(;null!==b;)a.push(b.__key),b=b.getNextSibling();return a}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===
|
||||
this.getChildrenSize()}isDirty(){let a=F()._dirtyElements;return null!==a&&a.has(this.__key)}isLastChild(){let a=this.getLatest(),b=this.getParentOrThrow().getLastChild();return null!==b&&b.is(a)}getAllTextNodes(){let a=[],b=this.getFirstChild();for(;null!==b;){B(b)&&a.push(b);if(E(b)){let c=b.getAllTextNodes();a.push(...c)}b=b.getNextSibling()}return a}getFirstDescendant(){let a=this.getFirstChild();for(;null!==a;){if(E(a)){let b=a.getFirstChild();if(null!==b){a=b;continue}}break}return a}getLastDescendant(){let a=
|
||||
this.getLastChild();for(;null!==a;){if(E(a)){let b=a.getLastChild();if(null!==b){a=b;continue}}break}return a}getDescendantByIndex(a){let b=this.getChildren(),c=b.length;if(a>=c)return a=b[c-1],E(a)&&a.getLastDescendant()||a||null;a=b[a];return E(a)&&a.getFirstDescendant()||a||null}getFirstChild(){let a=this.getLatest().__first;return null===a?null:I(a)}getFirstChildOrThrow(){let a=this.getFirstChild();null===a&&q(45,this.__key);return a}getLastChild(){let a=this.getLatest().__last;return null===
|
||||
a?null:I(a)}getLastChildOrThrow(){let a=this.getLastChild();null===a&&q(96,this.__key);return a}getChildAtIndex(a){var b=this.getChildrenSize();let c;if(a<b/2){c=this.getFirstChild();for(b=0;null!==c&&b<=a;){if(b===a)return c;c=c.getNextSibling();b++}return null}c=this.getLastChild();for(--b;null!==c&&b>=a;){if(b===a)return c;c=c.getPreviousSibling();b--}return null}getTextContent(){let a="",b=this.getChildren(),c=b.length;for(let d=0;d<c;d++){let e=b[d];a+=e.getTextContent();E(e)&&d!==c-1&&!e.isInline()&&
|
||||
(a+="\n\n")}return a}getTextContentSize(){let a=0,b=this.getChildren(),c=b.length;for(let d=0;d<c;d++){let e=b[d];a+=e.getTextContentSize();E(e)&&d!==c-1&&!e.isInline()&&(a+=2)}return a}getDirection(){return this.getLatest().__dir}hasFormat(a){return""!==a?(a=jb[a],0!==(this.getFormat()&a)):!1}select(a,b){G();let c=u(),d=a,e=b;var f=this.getChildrenSize();if(!this.canBeEmpty())if(0===a&&0===b){if(a=this.getFirstChild(),B(a)||E(a))return a.select(0,0)}else if(!(void 0!==a&&a!==f||void 0!==b&&b!==f)&&
|
||||
-(a=this.getLastChild(),B(a)||E(a)))return a.select();void 0===d&&(d=f);void 0===e&&(e=f);f=this.__key;if(C(c))c.anchor.set(f,d,"element"),c.focus.set(f,e,"element"),c.dirty=!0;else return te(f,d,f,e,"element","element");return c}selectStart(){let a=this.getFirstDescendant();return a?a.selectStart():this.select()}selectEnd(){let a=this.getLastDescendant();return a?a.selectEnd():this.select()}clear(){let a=this.getWritable();this.getChildren().forEach(b=>b.remove());return a}append(...a){return this.splice(this.getChildrenSize(),
|
||||
+(a=this.getLastChild(),B(a)||E(a)))return a.select();void 0===d&&(d=f);void 0===e&&(e=f);f=this.__key;if(C(c))c.anchor.set(f,d,"element"),c.focus.set(f,e,"element"),c.dirty=!0;else return ue(f,d,f,e,"element","element");return c}selectStart(){let a=this.getFirstDescendant();return a?a.selectStart():this.select()}selectEnd(){let a=this.getLastDescendant();return a?a.selectEnd():this.select()}clear(){let a=this.getWritable();this.getChildren().forEach(b=>b.remove());return a}append(...a){return this.splice(this.getChildrenSize(),
|
||||
0,a)}setDirection(a){let b=this.getWritable();b.__dir=a;return b}setFormat(a){this.getWritable().__format=""!==a?jb[a]:0;return this}setIndent(a){this.getWritable().__indent=a;return this}splice(a,b,c){let d=c.length,e=this.getChildrenSize(),f=this.getWritable(),g=f.__key;var h=[],k=[];let m=this.getChildAtIndex(a+b),n=null,p=e-b+d;if(0!==a)if(a===e)n=this.getLastChild();else{var l=this.getChildAtIndex(a);null!==l&&(n=l.getPreviousSibling())}if(0<b){var r=null===n?this.getFirstChild():n.getNextSibling();
|
||||
for(l=0;l<b;l++){null===r&&q(100);var w=r.getNextSibling(),y=r.__key;r=r.getWritable();bc(r);k.push(y);r=w}}l=n;for(w=0;w<d;w++){y=c[w];null!==l&&y.is(l)&&(n=l=l.getPreviousSibling());r=y.getWritable();r.__parent===g&&p--;bc(r);let z=y.__key;null===l?(f.__first=z,r.__prev=null):(l=l.getWritable(),l.__next=z,r.__prev=l.__key);y.__key===g&&q(76);r.__parent=g;h.push(z);l=y}a+b===e?null!==l&&(l.getWritable().__next=null,f.__last=l.__key):null!==m&&(a=m.getWritable(),null!==l?(b=l.getWritable(),a.__prev=
|
||||
-l.__key,b.__next=m.__key):a.__prev=null);f.__size=p;if(k.length&&(a=u(),C(a))){k=new Set(k);h=new Set(h);let {anchor:z,focus:A}=a;Bf(z,k,h)&&$d(z,z.getNode(),this,n,m);Bf(A,k,h)&&$d(A,A.getNode(),this,n,m);0!==p||this.canBeEmpty()||xc(this)||this.remove()}return f}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}
|
||||
-function E(a){return a instanceof Af}function Bf(a,b,c){for(a=a.getNode();a;){let d=a.__key;if(b.has(d)&&!c.has(d))return!0;a=a.getParent()}return!1}
|
||||
-class Cf extends Af{static getType(){return"root"}static clone(){return new Cf}constructor(){super("root");this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){let a=this.__cachedText;return!ec()&&0!==F()._dirtyType||null===a?super.getTextContent():a}remove(){q(52)}replace(){q(53)}insertBefore(){q(54)}insertAfter(){q(55)}updateDOM(){return!1}append(...a){for(let b=0;b<a.length;b++){let c=a[b];E(c)||x(c)||q(56)}return super.append(...a)}static importJSON(a){let b=J();b.setFormat(a.format);
|
||||
-b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function L(a){return a instanceof Cf}function yf(a,b){b=b.getEditorState()._selection;a=a._selection;if(null!==a){if(a.dirty||!a.is(b))return!0}else if(null!==b)return!0;return!1}function Df(){return new xf(new Map([["root",new Cf]]))}
|
||||
-function Ef(a){let b=a.exportJSON();var c=a.constructor;b.type!==c.getType()&&q(130,c.name);if(E(a)){let d=b.children;Array.isArray(d)||q(59,c.name);a=a.getChildren();for(c=0;c<a.length;c++){let e=Ef(a[c]);d.push(e)}}return b}
|
||||
-class xf{constructor(a,b){this._nodeMap=a;this._selection=b||null;this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(a){return rf(this,a)}clone(a){a=new xf(this._nodeMap,void 0===a?this._selection:a);a._readOnly=!0;return a}toJSON(){return rf(this,()=>({root:Ef(J())}))}}
|
||||
-class Ff extends Af{static getType(){return"paragraph"}static clone(a){return new Ff(a.__key)}createDOM(a){let b=document.createElement("p");a=pc(a.theme,"paragraph");void 0!==a&&b.classList.add(...a);return b}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Gf,priority:0})}}exportDOM(a){({element:a}=super.exportDOM(a));if(a&&Ec(a)){this.isEmpty()&&a.append(document.createElement("br"));var b=this.getFormatType();a.style.textAlign=b;if(b=this.getDirection())a.dir=b;b=this.getIndent();
|
||||
+l.__key,b.__next=m.__key):a.__prev=null);f.__size=p;if(k.length&&(a=u(),C(a))){k=new Set(k);h=new Set(h);let {anchor:z,focus:A}=a;Cf(z,k,h)&&$d(z,z.getNode(),this,n,m);Cf(A,k,h)&&$d(A,A.getNode(),this,n,m);0!==p||this.canBeEmpty()||xc(this)||this.remove()}return f}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}
|
||||
+function E(a){return a instanceof Bf}function Cf(a,b,c){for(a=a.getNode();a;){let d=a.__key;if(b.has(d)&&!c.has(d))return!0;a=a.getParent()}return!1}
|
||||
+class Df extends Bf{static getType(){return"root"}static clone(){return new Df}constructor(){super("root");this.__cachedText=null}getTopLevelElementOrThrow(){q(51)}getTextContent(){let a=this.__cachedText;return!ec()&&0!==F()._dirtyType||null===a?super.getTextContent():a}remove(){q(52)}replace(){q(53)}insertBefore(){q(54)}insertAfter(){q(55)}updateDOM(){return!1}append(...a){for(let b=0;b<a.length;b++){let c=a[b];E(c)||x(c)||q(56)}return super.append(...a)}static importJSON(a){let b=J();b.setFormat(a.format);
|
||||
+b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function L(a){return a instanceof Df}function zf(a,b){b=b.getEditorState()._selection;a=a._selection;if(null!==a){if(a.dirty||!a.is(b))return!0}else if(null!==b)return!0;return!1}function Ef(){return new yf(new Map([["root",new Df]]))}
|
||||
+function Ff(a){let b=a.exportJSON();var c=a.constructor;b.type!==c.getType()&&q(130,c.name);if(E(a)){let d=b.children;Array.isArray(d)||q(59,c.name);a=a.getChildren();for(c=0;c<a.length;c++){let e=Ff(a[c]);d.push(e)}}return b}
|
||||
+class yf{constructor(a,b){this._nodeMap=a;this._selection=b||null;this._readOnly=this._flushSync=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(a){return sf(this,a)}clone(a){a=new yf(this._nodeMap,void 0===a?this._selection:a);a._readOnly=!0;return a}toJSON(){return sf(this,()=>({root:Ff(J())}))}}
|
||||
+class Gf extends Bf{static getType(){return"paragraph"}static clone(a){return new Gf(a.__key)}createDOM(a){let b=document.createElement("p");a=pc(a.theme,"paragraph");void 0!==a&&b.classList.add(...a);return b}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Hf,priority:0})}}exportDOM(a){({element:a}=super.exportDOM(a));if(a&&Ec(a)){this.isEmpty()&&a.append(document.createElement("br"));var b=this.getFormatType();a.style.textAlign=b;if(b=this.getDirection())a.dir=b;b=this.getIndent();
|
||||
0<b&&(a.style.textIndent=`${20*b}px`)}return{element:a}}static importJSON(a){let b=ee();b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(a,b){a=ee();let c=this.getDirection();a.setDirection(c);this.insertAfter(a,b);return a}collapseAtStart(){let a=this.getChildren();if(0===a.length||B(a[0])&&""===a[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),
|
||||
-this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Gf(a){let b=ee();a.style&&(b.setFormat(a.style.textAlign),a=parseInt(a.style.textIndent,10)/20,0<a&&b.setIndent(a));return{node:b}}function ee(){return zc(new Ff)}
|
||||
-function tf(a,b,c,d){let e=a._keyToDOMMap;e.clear();a._editorState=Df();a._pendingEditorState=d;a._compositionKey=null;a._dirtyType=0;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();a._normalizedNodes=new Set;a._updateTags=new Set;a._updates=[];a._blockCursorElement=null;d=a._observer;null!==d&&(d.disconnect(),a._observer=null);null!==b&&(b.textContent="");null!==c&&(c.textContent="",e.set("root",c))}
|
||||
-function Mf(a,b){let c=new Map,d=new Set,e=f=>{Object.keys(f).forEach(g=>{let h=c.get(g);void 0===h&&(h=[],c.set(g,h));h.push(f[g])})};a.forEach(f=>{f=null!=f.klass.importDOM?f.klass.importDOM.bind(f.klass):null;null==f||d.has(f)||(d.add(f),f=f(),null!==f&&e(f))});b&&e(b);return c}
|
||||
-class Nf{constructor(a,b,c,d,e,f,g){this._parentEditor=b;this._rootElement=null;this._editorState=a;this._compositionKey=this._pendingEditorState=null;this._deferred=[];this._keyToDOMMap=new Map;this._updates=[];this._updating=!1;this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set};this._commands=new Map;this._config=d;this._nodes=c;this._decorators={};this._pendingDecorators=null;this._dirtyType=0;this._cloneNotNeeded=new Set;this._dirtyLeaves=
|
||||
+this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Hf(a){let b=ee();a.style&&(b.setFormat(a.style.textAlign),a=parseInt(a.style.textIndent,10)/20,0<a&&b.setIndent(a));return{node:b}}function ee(){return zc(new Gf)}
|
||||
+function uf(a,b,c,d){let e=a._keyToDOMMap;e.clear();a._editorState=Ef();a._pendingEditorState=d;a._compositionKey=null;a._dirtyType=0;a._cloneNotNeeded.clear();a._dirtyLeaves=new Set;a._dirtyElements.clear();a._normalizedNodes=new Set;a._updateTags=new Set;a._updates=[];a._blockCursorElement=null;d=a._observer;null!==d&&(d.disconnect(),a._observer=null);null!==b&&(b.textContent="");null!==c&&(c.textContent="",e.set("root",c))}
|
||||
+function Nf(a,b){let c=new Map,d=new Set,e=f=>{Object.keys(f).forEach(g=>{let h=c.get(g);void 0===h&&(h=[],c.set(g,h));h.push(f[g])})};a.forEach(f=>{f=null!=f.klass.importDOM?f.klass.importDOM.bind(f.klass):null;null==f||d.has(f)||(d.add(f),f=f(),null!==f&&e(f))});b&&e(b);return c}
|
||||
+class Of{constructor(a,b,c,d,e,f,g){this._parentEditor=b;this._rootElement=null;this._editorState=a;this._compositionKey=this._pendingEditorState=null;this._deferred=[];this._keyToDOMMap=new Map;this._updates=[];this._updating=!1;this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set};this._commands=new Map;this._config=d;this._nodes=c;this._decorators={};this._pendingDecorators=null;this._dirtyType=0;this._cloneNotNeeded=new Set;this._dirtyLeaves=
|
||||
new Set;this._dirtyElements=new Map;this._normalizedNodes=new Set;this._updateTags=new Set;this._observer=null;this._key=lc();this._onError=e;this._htmlConversions=f;this._editable=g;this._headless=null!==b&&b._headless;this._blockCursorElement=this._window=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(a){let b=this._listeners.update;b.add(a);return()=>{b.delete(a)}}registerEditableListener(a){let b=this._listeners.editable;b.add(a);return()=>{b.delete(a)}}registerDecoratorListener(a){let b=
|
||||
this._listeners.decorator;b.add(a);return()=>{b.delete(a)}}registerTextContentListener(a){let b=this._listeners.textcontent;b.add(a);return()=>{b.delete(a)}}registerRootListener(a){let b=this._listeners.root;a(this._rootElement,null);b.add(a);return()=>{a(null,this._rootElement);b.delete(a)}}registerCommand(a,b,c){void 0===c&&q(35);let d=this._commands;d.has(a)||d.set(a,[new Set,new Set,new Set,new Set,new Set]);let e=d.get(a);void 0===e&&q(36,String(a));let f=e[c];f.add(b);return()=>{f.delete(b);
|
||||
e.every(g=>0===g.size)&&d.delete(a)}}registerMutationListener(a,b){void 0===this._nodes.get(a.getType())&&q(37,a.name);let c=this._listeners.mutation;c.set(b,a);return()=>{c.delete(b)}}registerNodeTransformToKlass(a,b){var c=a.getType();c=this._nodes.get(c);void 0===c&&q(37,a.name);c.transforms.add(b);return c}registerNodeTransform(a,b){var c=this.registerNodeTransformToKlass(a,b);let d=[c];c=c.replaceWithKlass;null!=c&&(c=this.registerNodeTransformToKlass(c,b),d.push(c));hc(this,a.getType());return()=>
|
||||
-{d.forEach(e=>e.transforms.delete(b))}}hasNode(a){return this._nodes.has(a.getType())}hasNodes(a){return a.every(this.hasNode.bind(this))}dispatchCommand(a,b){return R(this,a,b)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(a){let b=this._rootElement;if(a!==b){let f=pc(this._config.theme,"root");var c=this._pendingEditorState||this._editorState;this._rootElement=a;tf(this,b,a,c);if(null!==b){if(!this._config.disableEvents){0!==
|
||||
+{d.forEach(e=>e.transforms.delete(b))}}hasNode(a){return this._nodes.has(a.getType())}hasNodes(a){return a.every(this.hasNode.bind(this))}dispatchCommand(a,b){return R(this,a,b)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(a){let b=this._rootElement;if(a!==b){let f=pc(this._config.theme,"root");var c=this._pendingEditorState||this._editorState;this._rootElement=a;uf(this,b,a,c);if(null!==b){if(!this._config.disableEvents){0!==
|
||||
Hd&&(Hd--,0===Hd&&b.ownerDocument.removeEventListener("selectionchange",Xd));var d=b.__lexicalEditor;if(null!==d&&void 0!==d){if(null!==d._parentEditor){var e=kc(d);e=e[e.length-1]._key;Wd.get(e)===d&&Wd.delete(e)}else Wd.delete(d._key);b.__lexicalEditor=null}d=Vd(b);for(e=0;e<d.length;e++)d[e]();b.__lexicalEventHandles=[]}null!=f&&b.classList.remove(...f)}null!==a?(c=(c=a.ownerDocument)&&c.defaultView||null,d=a.style,d.userSelect="text",d.whiteSpace="pre-wrap",d.wordBreak="break-word",a.setAttribute("data-lexical-editor",
|
||||
-"true"),this._window=c,this._dirtyType=2,Db(this),this._updateTags.add("history-merge"),sf(this),this._config.disableEvents||Yd(a,this),null!=f&&a.classList.add(...f)):(this._editorState=c,this._window=this._pendingEditorState=null);uf("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(38);Cb(this);let c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||
|
||||
-(null!=b&&d.add(b),sf(this));this._pendingEditorState=a;this._dirtyType=2;this._dirtyElements.set("root",!1);this._compositionKey=null;null!=b&&d.add(b);sf(this)}parseEditorState(a,b){a="string"===typeof a?JSON.parse(a):a;let c=Df(),d=T,e=Z,f=U,g=this._dirtyElements,h=this._dirtyLeaves,k=this._cloneNotNeeded,m=this._dirtyType;this._dirtyElements=new Map;this._dirtyLeaves=new Set;this._cloneNotNeeded=new Set;this._dirtyType=0;T=c;Z=!1;U=this;try{qf(a.root,this._nodes),b&&b(),c._readOnly=!0}catch(n){n instanceof
|
||||
+"true"),this._window=c,this._dirtyType=2,Db(this),this._updateTags.add("history-merge"),tf(this),this._config.disableEvents||Yd(a,this),null!=f&&a.classList.add(...f)):(this._editorState=c,this._window=this._pendingEditorState=null);vf("root",this,!1,a,b)}}getElementByKey(a){return this._keyToDOMMap.get(a)||null}getEditorState(){return this._editorState}setEditorState(a,b){a.isEmpty()&&q(38);Cb(this);let c=this._pendingEditorState,d=this._updateTags;b=void 0!==b?b.tag:null;null===c||c.isEmpty()||
|
||||
+(null!=b&&d.add(b),tf(this));this._pendingEditorState=a;this._dirtyType=2;this._dirtyElements.set("root",!1);this._compositionKey=null;null!=b&&d.add(b);tf(this)}parseEditorState(a,b){a="string"===typeof a?JSON.parse(a):a;let c=Ef(),d=T,e=Z,f=U,g=this._dirtyElements,h=this._dirtyLeaves,k=this._cloneNotNeeded,m=this._dirtyType;this._dirtyElements=new Map;this._dirtyLeaves=new Set;this._cloneNotNeeded=new Set;this._dirtyType=0;T=c;Z=!1;U=this;try{rf(a.root,this._nodes),b&&b(),c._readOnly=!0}catch(n){n instanceof
|
||||
Error&&this._onError(n)}finally{this._dirtyElements=g,this._dirtyLeaves=h,this._cloneNotNeeded=k,this._dirtyType=m,T=d,Z=e,U=f}return c}update(a,b){v(this,a,b)}focus(a,b={}){let c=this._rootElement;null!==c&&(c.setAttribute("autocapitalize","off"),v(this,()=>{let d=u(),e=J();null!==d?d.dirty=!0:0!==e.getChildrenSize()&&("rootStart"===b.defaultSelection?e.selectStart():e.selectEnd())},{onUpdate:()=>{c.removeAttribute("autocapitalize");a&&a()},tag:"focus"}),null===this._pendingEditorState&&c.removeAttribute("autocapitalize"))}blur(){var a=
|
||||
-this._rootElement;null!==a&&a.blur();a=xb(this._window);null!==a&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(a){this._editable!==a&&(this._editable=a,uf("editable",this,!0,a))}toJSON(){return{editorState:this._editorState.toJSON()}}}
|
||||
-class ff extends Af{constructor(a,b){super(b);this.__colSpan=a;this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(a){this.getWritable().__colSpan=a;return this}getRowSpan(){return this.__rowSpan}setRowSpan(a){this.getWritable().__rowSpan=a;return this}}function gf(a){return a instanceof ff}class Of extends Af{}function jf(a){return a instanceof Of}class Pf extends Af{}
|
||||
-function hf(a){return a instanceof Pf}exports.$INTERNAL_isPointSelection=ce;exports.$addUpdateTag=function(a){G();F()._updateTags.add(a)};exports.$applyNodeReplacement=zc;exports.$copyNode=yc;exports.$createLineBreakNode=ie;exports.$createNodeSelection=Xe;exports.$createParagraphNode=ee;exports.$createPoint=S;exports.$createRangeSelection=function(){let a=S("root",0,"element"),b=S("root",0,"element");return new Se(a,b,0,"")};exports.$createTabNode=we;exports.$createTextNode=K;
|
||||
+this._rootElement;null!==a&&a.blur();a=xb(this._window);null!==a&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(a){this._editable!==a&&(this._editable=a,vf("editable",this,!0,a))}toJSON(){return{editorState:this._editorState.toJSON()}}}
|
||||
+class gf extends Bf{constructor(a,b){super(b);this.__colSpan=a;this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(a){this.getWritable().__colSpan=a;return this}getRowSpan(){return this.__rowSpan}setRowSpan(a){this.getWritable().__rowSpan=a;return this}}function hf(a){return a instanceof gf}class Pf extends Bf{}function kf(a){return a instanceof Pf}class Qf extends Bf{}
|
||||
+function jf(a){return a instanceof Qf}exports.$INTERNAL_isPointSelection=ce;exports.$addUpdateTag=function(a){G();F()._updateTags.add(a)};exports.$applyNodeReplacement=zc;exports.$copyNode=yc;exports.$createLineBreakNode=je;exports.$createNodeSelection=Ye;exports.$createParagraphNode=ee;exports.$createPoint=S;exports.$createRangeSelection=function(){let a=S("root",0,"element"),b=S("root",0,"element");return new Te(a,b,0,"")};exports.$createTabNode=xe;exports.$createTextNode=K;
|
||||
exports.$getAdjacentNode=sc;exports.$getNearestNodeFromDOMNode=wb;exports.$getNearestRootOrShadowRoot=wc;exports.$getNodeByKey=I;exports.$getPreviousSelection=nc;exports.$getRoot=J;exports.$getSelection=u;exports.$getTextContent=function(){let a=u();return null===a?"":a.getTextContent()};exports.$hasAncestor=vc;exports.$hasUpdateTag=function(a){return F()._updateTags.has(a)};exports.$insertNodes=function(a){let b=u()||nc();null===b&&(b=J().selectEnd());b.insertNodes(a)};
|
||||
-exports.$isBlockElementNode=function(a){return E(a)&&!a.isInline()};exports.$isDecoratorNode=x;exports.$isElementNode=E;exports.$isInlineElementOrDecoratorNode=function(a){return E(a)&&a.isInline()||x(a)&&a.isInline()};exports.$isLeafNode=function(a){return B(a)||Gc(a)||x(a)};exports.$isLineBreakNode=Gc;exports.$isNodeSelection=Ud;exports.$isParagraphNode=function(a){return a instanceof Ff};exports.$isRangeSelection=C;exports.$isRootNode=L;exports.$isRootOrShadowRoot=xc;exports.$isTabNode=Be;
|
||||
-exports.$isTextNode=B;exports.$nodesOfType=function(a){var b=ac();let c=b._readOnly,d=a.getType();b=b._nodeMap;let e=[];for(let [,f]of b)f instanceof a&&f.__type===d&&(c||f.isAttached())&&e.push(f);return e};exports.$normalizeSelection__EXPERIMENTAL=Ib;exports.$parseSerializedNode=function(a){return qf(a,F()._nodes)};exports.$selectAll=function(){var a=J();a=a.select(0,a.getChildrenSize());Ab(Ib(a))};exports.$setCompositionKey=H;exports.$setSelection=Ab;
|
||||
+exports.$isBlockElementNode=function(a){return E(a)&&!a.isInline()};exports.$isDecoratorNode=x;exports.$isElementNode=E;exports.$isInlineElementOrDecoratorNode=function(a){return E(a)&&a.isInline()||x(a)&&a.isInline()};exports.$isLeafNode=function(a){return B(a)||Gc(a)||x(a)};exports.$isLineBreakNode=Gc;exports.$isNodeSelection=Ud;exports.$isParagraphNode=function(a){return a instanceof Gf};exports.$isRangeSelection=C;exports.$isRootNode=L;exports.$isRootOrShadowRoot=xc;exports.$isTabNode=Ce;
|
||||
+exports.$isTextNode=B;exports.$nodesOfType=function(a){var b=ac();let c=b._readOnly,d=a.getType();b=b._nodeMap;let e=[];for(let [,f]of b)f instanceof a&&f.__type===d&&(c||f.isAttached())&&e.push(f);return e};exports.$normalizeSelection__EXPERIMENTAL=Ib;exports.$parseSerializedNode=function(a){return rf(a,F()._nodes)};exports.$selectAll=function(){var a=J();a=a.select(0,a.getChildrenSize());Ab(Ib(a))};exports.$setCompositionKey=H;exports.$setSelection=Ab;
|
||||
exports.$splitNode=function(a,b){let c=a.getChildAtIndex(b);null==c&&(c=a);xc(a)&&q(102);let d=g=>{const h=g.getParentOrThrow(),k=xc(h),m=g!==c||k?yc(g):g;if(k){if(!E(g)||!E(m))throw Error("Children of a root must be ElementNode");g.insertAfter(m);return[g,m,m]}const [n,p,l]=d(h);g=g.getNextSiblings();l.append(m,...g);return[n,p,m]},[e,f]=d(c);return[e,f]};exports.BLUR_COMMAND=Sa;exports.CAN_REDO_COMMAND={};exports.CAN_UNDO_COMMAND={};exports.CLEAR_EDITOR_COMMAND={};
|
||||
exports.CLEAR_HISTORY_COMMAND={};exports.CLICK_COMMAND=ba;exports.COMMAND_PRIORITY_CRITICAL=4;exports.COMMAND_PRIORITY_EDITOR=0;exports.COMMAND_PRIORITY_HIGH=3;exports.COMMAND_PRIORITY_LOW=1;exports.COMMAND_PRIORITY_NORMAL=2;exports.CONTROLLED_TEXT_INSERTION_COMMAND=ka;exports.COPY_COMMAND=Oa;exports.CUT_COMMAND=Pa;exports.DELETE_CHARACTER_COMMAND=da;exports.DELETE_LINE_COMMAND=pa;exports.DELETE_WORD_COMMAND=oa;
|
||||
-exports.DEPRECATED_$computeGridMap=function(a,b,c){let d=[],e=null,f=null;a=a.getChildren();for(let n=0;n<a.length;n++){var g=a[n];hf(g)||q(108);var h=g.getChildren();g=0;for(let p of h){for(gf(p)||q(109);void 0!==d[n]&&void 0!==d[n][g];)g++;h=n;var k=g,m=p;let l={cell:m,startColumn:k,startRow:h},r=m.__rowSpan,w=m.__colSpan;for(let y=0;y<r;y++){void 0===d[h+y]&&(d[h+y]=[]);for(let z=0;z<w;z++)d[h+y][k+z]=l}b.is(m)&&(e=l);c.is(m)&&(f=l);g+=p.__colSpan}}null===e&&q(110);null===f&&q(111);return[d,e,
|
||||
-f]};exports.DEPRECATED_$getGridCellNodeRect=function(a){let [b,,c]=ef(a);a=c.getChildren();let d=a.length;var e=a[0].getChildren().length;let f=Array(d);for(var g=0;g<d;g++)f[g]=Array(e);for(e=0;e<d;e++){g=a[e].getChildren();let h=0;for(let k=0;k<g.length;k++){for(;f[e][h];)h++;let m=g[k],n=m.__rowSpan||1,p=m.__colSpan||1;for(let l=0;l<n;l++)for(let r=0;r<p;r++)f[e+l][h+r]=m;if(b===m)return{colSpan:p,columnIndex:h,rowIndex:e,rowSpan:n};h+=p}}return null};exports.DEPRECATED_$getNodeTriplet=ef;
|
||||
-exports.DEPRECATED_$isGridCellNode=gf;exports.DEPRECATED_$isGridNode=jf;exports.DEPRECATED_$isGridRowNode=hf;exports.DEPRECATED_GridCellNode=ff;exports.DEPRECATED_GridNode=Of;exports.DEPRECATED_GridRowNode=Pf;exports.DRAGEND_COMMAND=Na;exports.DRAGOVER_COMMAND=Ma;exports.DRAGSTART_COMMAND=La;exports.DROP_COMMAND=Ka;exports.DecoratorNode=zf;exports.ElementNode=Af;exports.FOCUS_COMMAND=Ra;exports.FORMAT_ELEMENT_COMMAND={};exports.FORMAT_TEXT_COMMAND=qa;exports.INDENT_CONTENT_COMMAND={};
|
||||
-exports.INSERT_LINE_BREAK_COMMAND=ea;exports.INSERT_PARAGRAPH_COMMAND=ja;exports.INSERT_TAB_COMMAND={};exports.INTERNAL_PointSelection=Pe;exports.KEY_ARROW_DOWN_COMMAND=Aa;exports.KEY_ARROW_LEFT_COMMAND=xa;exports.KEY_ARROW_RIGHT_COMMAND=ua;exports.KEY_ARROW_UP_COMMAND=za;exports.KEY_BACKSPACE_COMMAND=Fa;exports.KEY_DELETE_COMMAND=Ha;exports.KEY_DOWN_COMMAND=ta;exports.KEY_ENTER_COMMAND=Ba;exports.KEY_ESCAPE_COMMAND=Ga;exports.KEY_MODIFIER_COMMAND=Ta;exports.KEY_SPACE_COMMAND=Ca;
|
||||
-exports.KEY_TAB_COMMAND=Ja;exports.LineBreakNode=ge;exports.MOVE_TO_END=va;exports.MOVE_TO_START=ya;exports.OUTDENT_CONTENT_COMMAND={};exports.PASTE_COMMAND=la;exports.ParagraphNode=Ff;exports.REDO_COMMAND=sa;exports.REMOVE_TEXT_COMMAND=na;exports.RootNode=Cf;exports.SELECTION_CHANGE_COMMAND=aa;exports.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={};exports.SELECT_ALL_COMMAND=Qa;exports.TabNode=Ae;exports.TextNode=oe;exports.UNDO_COMMAND=ra;exports.createCommand=function(){return{}};
|
||||
-exports.createEditor=function(a){var b=a||{},c=U,d=b.theme||{};let e=void 0===a?c:b.parentEditor||null,f=b.disableEvents||!1,g=Df(),h=b.namespace||(null!==e?e._config.namespace:lc()),k=b.editorState,m=[Cf,oe,ge,Ae,Ff,...(b.nodes||[])],{onError:n,html:p}=b;b=void 0!==b.editable?b.editable:!0;if(void 0===a&&null!==c)a=c._nodes;else for(a=new Map,c=0;c<m.length;c++){let r=m[c],w=null;var l=null;"function"!==typeof r&&(l=r,r=l.replace,w=l.with,l=l.withKlass||null);let y=r.getType(),z=r.transform(),A=
|
||||
-new Set;null!==z&&A.add(z);a.set(y,{exportDOM:p&&p.export?p.export.get(r):void 0,klass:r,replace:w,replaceWithKlass:l,transforms:A})}d=new Nf(g,e,a,{disableEvents:f,namespace:h,theme:d},n?n:console.error,Mf(a,p?p.import:void 0),b);void 0!==k&&(d._pendingEditorState=k,d._dirtyType=2);return d};exports.getNearestEditorFromDOMNode=Ub;exports.isCurrentlyReadOnlyMode=ec;exports.isHTMLAnchorElement=function(a){return Ec(a)&&"A"===a.tagName};exports.isHTMLElement=Ec;
|
||||
+exports.DEPRECATED_$computeGridMap=function(a,b,c){let d=[],e=null,f=null;a=a.getChildren();for(let n=0;n<a.length;n++){var g=a[n];jf(g)||q(108);var h=g.getChildren();g=0;for(let p of h){for(hf(p)||q(109);void 0!==d[n]&&void 0!==d[n][g];)g++;h=n;var k=g,m=p;let l={cell:m,startColumn:k,startRow:h},r=m.__rowSpan,w=m.__colSpan;for(let y=0;y<r;y++){void 0===d[h+y]&&(d[h+y]=[]);for(let z=0;z<w;z++)d[h+y][k+z]=l}b.is(m)&&(e=l);c.is(m)&&(f=l);g+=p.__colSpan}}null===e&&q(110);null===f&&q(111);return[d,e,
|
||||
+f]};exports.DEPRECATED_$getGridCellNodeRect=function(a){let [b,,c]=ff(a);a=c.getChildren();let d=a.length;var e=a[0].getChildren().length;let f=Array(d);for(var g=0;g<d;g++)f[g]=Array(e);for(e=0;e<d;e++){g=a[e].getChildren();let h=0;for(let k=0;k<g.length;k++){for(;f[e][h];)h++;let m=g[k],n=m.__rowSpan||1,p=m.__colSpan||1;for(let l=0;l<n;l++)for(let r=0;r<p;r++)f[e+l][h+r]=m;if(b===m)return{colSpan:p,columnIndex:h,rowIndex:e,rowSpan:n};h+=p}}return null};exports.DEPRECATED_$getNodeTriplet=ff;
|
||||
+exports.DEPRECATED_$isGridCellNode=hf;exports.DEPRECATED_$isGridNode=kf;exports.DEPRECATED_$isGridRowNode=jf;exports.DEPRECATED_GridCellNode=gf;exports.DEPRECATED_GridNode=Pf;exports.DEPRECATED_GridRowNode=Qf;exports.DRAGEND_COMMAND=Na;exports.DRAGOVER_COMMAND=Ma;exports.DRAGSTART_COMMAND=La;exports.DROP_COMMAND=Ka;exports.DecoratorNode=Af;exports.ElementNode=Bf;exports.FOCUS_COMMAND=Ra;exports.FORMAT_ELEMENT_COMMAND={};exports.FORMAT_TEXT_COMMAND=qa;exports.INDENT_CONTENT_COMMAND={};
|
||||
+exports.INSERT_LINE_BREAK_COMMAND=ea;exports.INSERT_PARAGRAPH_COMMAND=ja;exports.INSERT_TAB_COMMAND={};exports.INTERNAL_PointSelection=Qe;exports.KEY_ARROW_DOWN_COMMAND=Aa;exports.KEY_ARROW_LEFT_COMMAND=xa;exports.KEY_ARROW_RIGHT_COMMAND=ua;exports.KEY_ARROW_UP_COMMAND=za;exports.KEY_BACKSPACE_COMMAND=Fa;exports.KEY_DELETE_COMMAND=Ha;exports.KEY_DOWN_COMMAND=ta;exports.KEY_ENTER_COMMAND=Ba;exports.KEY_ESCAPE_COMMAND=Ga;exports.KEY_MODIFIER_COMMAND=Ta;exports.KEY_SPACE_COMMAND=Ca;
|
||||
+exports.KEY_TAB_COMMAND=Ja;exports.LineBreakNode=ge;exports.MOVE_TO_END=va;exports.MOVE_TO_START=ya;exports.OUTDENT_CONTENT_COMMAND={};exports.PASTE_COMMAND=la;exports.ParagraphNode=Gf;exports.REDO_COMMAND=sa;exports.REMOVE_TEXT_COMMAND=na;exports.RootNode=Df;exports.SELECTION_CHANGE_COMMAND=aa;exports.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={};exports.SELECT_ALL_COMMAND=Qa;exports.TabNode=Be;exports.TextNode=pe;exports.UNDO_COMMAND=ra;exports.createCommand=function(){return{}};
|
||||
+exports.createEditor=function(a){var b=a||{},c=U,d=b.theme||{};let e=void 0===a?c:b.parentEditor||null,f=b.disableEvents||!1,g=Ef(),h=b.namespace||(null!==e?e._config.namespace:lc()),k=b.editorState,m=[Df,pe,ge,Be,Gf,...(b.nodes||[])],{onError:n,html:p}=b;b=void 0!==b.editable?b.editable:!0;if(void 0===a&&null!==c)a=c._nodes;else for(a=new Map,c=0;c<m.length;c++){let r=m[c],w=null;var l=null;"function"!==typeof r&&(l=r,r=l.replace,w=l.with,l=l.withKlass||null);let y=r.getType(),z=r.transform(),A=
|
||||
+new Set;null!==z&&A.add(z);a.set(y,{exportDOM:p&&p.export?p.export.get(r):void 0,klass:r,replace:w,replaceWithKlass:l,transforms:A})}d=new Of(g,e,a,{disableEvents:f,namespace:h,theme:d},n?n:console.error,Nf(a,p?p.import:void 0),b);void 0!==k&&(d._pendingEditorState=k,d._dirtyType=2);return d};exports.getNearestEditorFromDOMNode=Ub;exports.isCurrentlyReadOnlyMode=ec;exports.isHTMLAnchorElement=function(a){return Ec(a)&&"A"===a.tagName};exports.isHTMLElement=Ec;
|
||||
exports.isSelectionCapturedInDecoratorInput=Mb;exports.isSelectionWithinEditor=Tb
|
||||
38
.yarn/patches/lexical-npm-0.13.1-ac06219fd6.patch
Normal file
38
.yarn/patches/lexical-npm-0.13.1-ac06219fd6.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
diff --git a/Lexical.dev.js b/Lexical.dev.js
|
||||
index a21fdea722a3b77d94be5850e9effe5f1745348c..650389a13316b56de831affc8cda69077bd9a786 100644
|
||||
--- a/Lexical.dev.js
|
||||
+++ b/Lexical.dev.js
|
||||
@@ -2526,8 +2526,10 @@ function onBeforeInput(event, editor) {
|
||||
}
|
||||
selection.style = anchorNode.getStyle();
|
||||
}
|
||||
- const selectedText = selection.anchor.getNode().getTextContent();
|
||||
- if (selectedText.length <= 1) {
|
||||
+ const selectedNodeText = selection.anchor.getNode().getTextContent();
|
||||
+ const isSelectedNodeTextOneOrLessCharacters = selectedNodeText.length <= 1;
|
||||
+ const hasSelectedAllTextInNode = selection.anchor.offset === 0 && selection.focus.offset === selectedNodeText.length;
|
||||
+ if (isSelectedNodeTextOneOrLessCharacters || hasSelectedAllTextInNode) {
|
||||
event.preventDefault();
|
||||
dispatchCommand(editor, DELETE_CHARACTER_COMMAND, true);
|
||||
}
|
||||
diff --git a/Lexical.prod.js b/Lexical.prod.js
|
||||
index 387fa75af19a8d926e3c1b2d38848387de041ec3..64483e93330c58ed17aefd452b654099e2e83547 100644
|
||||
--- a/Lexical.prod.js
|
||||
+++ b/Lexical.prod.js
|
||||
@@ -52,11 +52,11 @@ function Nd(a,b,c){let {anchorNode:d,anchorOffset:e,focusNode:f,focusOffset:g}=a
|
||||
h.format=m.getFormat(),h.style=m.getStyle()):"element"!==k.type||p||(h.format=0,h.style="")}else{var l=k.key,r=h.focus.key;k=h.getNodes();m=k.length;var w=h.isBackward();q=w?g:e;p=w?e:g;let A=w?r:l;l=w?l:r;r=255;w=!1;for(let x=0;x<m;x++){let z=k[x],aa=z.getTextContentSize();if(B(z)&&0!==aa&&!(0===x&&z.__key===A&&q===aa||x===m-1&&z.__key===l&&0===p)&&(w=!0,r&=z.getFormat(),0===r))break}h.format=w?r:0}}R(b,ba,void 0)}})}
|
||||
function yd(a,b){v(b,()=>{let c=u();var d=wb(b._window);let e=mc();if(d)if(C(c)){let g=c.anchor;var f=g.getNode();"element"===g.type&&0===g.offset&&c.isCollapsed()&&!L(f)&&1===J().getChildrenSize()&&f.getTopLevelElementOrThrow().isEmpty()&&null!==e&&c.is(e)?(d.removeAllRanges(),c.dirty=!0):3!==a.detail||c.isCollapsed()||(d=c.focus.getNode(),f!==d&&(E(f)?f.select(0):f.getParentOrThrow().select(0)))}else"touch"===a.pointerType&&(f=d.anchorNode,null!==f&&(f=f.nodeType,1===f||3===f))&&(d=Od(e,d,b,a),
|
||||
zb(d));R(b,ca,a)})}function ud(a,b){let c=a.target;a=a.pointerType;c instanceof Node&&"touch"!==a&&v(b,()=>{y(vb(c))||(Hd=!0)})}function Pd(a){if(!a.getTargetRanges)return null;a=a.getTargetRanges();return 0===a.length?null:a[0]}function Qd(a,b){return a!==b||E(a)||E(b)||!a.isToken()||!b.isToken()}
|
||||
-function Ad(a,b){let c=a.inputType,d=Pd(a);"deleteCompositionText"===c||Wa&&Ab(b)||"insertCompositionText"!==c&&v(b,()=>{let e=u();if("deleteContentBackward"===c){if(null===e){var f=mc();if(!C(f))return;zb(f.clone())}if(C(e)){$a&&H(e.anchor.key);229===Cd&&a.timeStamp<Bd+30&&b.isComposing()&&e.anchor.key===e.focus.key?(H(null),Bd=0,setTimeout(()=>{v(b,()=>{H(null)})},30),C(e)&&(f=e.anchor.getNode(),f.markDirty(),e.format=f.getFormat(),B(f)||n(142),e.style=f.getStyle()),1>=e.anchor.getNode().getTextContent().length&&
|
||||
-(a.preventDefault(),R(b,da,!0))):(H(null),a.preventDefault(),R(b,da,!0));return}}if(C(e)){f=a.data;null!==Ed&&lc(!1,b,Ed);e.dirty&&null===Ed||!e.isCollapsed()||L(e.anchor.getNode())||null===d||e.applyDOMRange(d);Ed=null;var g=e.focus,h=e.anchor.getNode();g=g.getNode();if("insertText"===c||"insertTranspose"===c)"\n"===f?(a.preventDefault(),R(b,ea,!1)):"\n\n"===f?(a.preventDefault(),R(b,fa,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),a.preventDefault(),e.insertRawText(f)):
|
||||
-null!=f&&Ld(e,d,f,a.timeStamp,!0)?(a.preventDefault(),R(b,ka,f)):Ed=f,Dd=a.timeStamp;else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":R(b,ka,a);break;case "insertFromComposition":H(null);R(b,ka,a);break;case "insertLineBreak":H(null);R(b,ea,!1);break;case "insertParagraph":H(null);Id&&!Za?(Id=!1,R(b,ea,!1)):R(b,fa,void 0);break;case "insertFromPaste":case "insertFromPasteAsQuotation":R(b,la,a);break;case "deleteByComposition":Qd(h,g)&&R(b,
|
||||
-ma,a);break;case "deleteByDrag":case "deleteByCut":R(b,ma,a);break;case "deleteContent":R(b,da,!1);break;case "deleteWordBackward":R(b,oa,!0);break;case "deleteWordForward":R(b,oa,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":R(b,pa,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":R(b,pa,!1);break;case "formatStrikeThrough":R(b,qa,"strikethrough");break;case "formatBold":R(b,qa,"bold");break;case "formatItalic":R(b,qa,"italic");
|
||||
-break;case "formatUnderline":R(b,qa,"underline");break;case "historyUndo":R(b,ra,void 0);break;case "historyRedo":R(b,sa,void 0)}}})}
|
||||
+function Ad(a,b){let c=a.inputType,d=Pd(a);"deleteCompositionText"===c||Wa&&Ab(b)||"insertCompositionText"!==c&&v(b,()=>{var e=u();if("deleteContentBackward"===c){if(null===e){var f=mc();if(!C(f))return;zb(f.clone())}if(C(e)){$a&&H(e.anchor.key);if(229===Cd&&a.timeStamp<Bd+30&&b.isComposing()&&e.anchor.key===e.focus.key){if(H(null),Bd=0,setTimeout(()=>{v(b,()=>{H(null)})},30),C(e)&&(f=e.anchor.getNode(),f.markDirty(),e.format=f.getFormat(),B(f)||n(142),e.style=f.getStyle()),f=e.anchor.getNode().getTextContent(),
|
||||
+e=0===e.anchor.offset&&e.focus.offset===f.length,1>=f.length||e)a.preventDefault(),R(b,da,!0)}else H(null),a.preventDefault(),R(b,da,!0);return}}if(C(e)){f=a.data;null!==Ed&&lc(!1,b,Ed);e.dirty&&null===Ed||!e.isCollapsed()||L(e.anchor.getNode())||null===d||e.applyDOMRange(d);Ed=null;var g=e.focus,h=e.anchor.getNode();g=g.getNode();if("insertText"===c||"insertTranspose"===c)"\n"===f?(a.preventDefault(),R(b,ea,!1)):"\n\n"===f?(a.preventDefault(),R(b,fa,void 0)):null==f&&a.dataTransfer?(f=a.dataTransfer.getData("text/plain"),
|
||||
+a.preventDefault(),e.insertRawText(f)):null!=f&&Ld(e,d,f,a.timeStamp,!0)?(a.preventDefault(),R(b,ka,f)):Ed=f,Dd=a.timeStamp;else switch(a.preventDefault(),c){case "insertFromYank":case "insertFromDrop":case "insertReplacementText":R(b,ka,a);break;case "insertFromComposition":H(null);R(b,ka,a);break;case "insertLineBreak":H(null);R(b,ea,!1);break;case "insertParagraph":H(null);Id&&!Za?(Id=!1,R(b,ea,!1)):R(b,fa,void 0);break;case "insertFromPaste":case "insertFromPasteAsQuotation":R(b,la,a);break;case "deleteByComposition":Qd(h,
|
||||
+g)&&R(b,ma,a);break;case "deleteByDrag":case "deleteByCut":R(b,ma,a);break;case "deleteContent":R(b,da,!1);break;case "deleteWordBackward":R(b,oa,!0);break;case "deleteWordForward":R(b,oa,!1);break;case "deleteHardLineBackward":case "deleteSoftLineBackward":R(b,pa,!0);break;case "deleteContentForward":case "deleteHardLineForward":case "deleteSoftLineForward":R(b,pa,!1);break;case "formatStrikeThrough":R(b,qa,"strikethrough");break;case "formatBold":R(b,qa,"bold");break;case "formatItalic":R(b,qa,
|
||||
+"italic");break;case "formatUnderline":R(b,qa,"underline");break;case "historyUndo":R(b,ra,void 0);break;case "historyRedo":R(b,sa,void 0)}}})}
|
||||
function xd(a,b){a.stopPropagation();v(b,()=>{var c=u(),d=a.data,e=Pd(a);if(null!=d&&C(c)&&Ld(c,e,d,a.timeStamp,!1)){Jd&&(Rd(b,d),Jd=!1);var f=c.anchor,g=f.getNode();e=wb(b._window);if(null===e)return;let h=f.offset;if(f=Xa&&!c.isCollapsed()&&B(g)&&null!==e.anchorNode)g=g.getTextContent().slice(0,h)+d+g.getTextContent().slice(h+c.focus.offset),e=e.anchorNode,f=g===(3===e.nodeType?e.nodeValue:null);f||R(b,ka,d);d=d.length;Wa&&1<d&&"insertCompositionText"===a.inputType&&!b.isComposing()&&(c.anchor.offset-=
|
||||
d);Ya||Za||bb||!b.isComposing()||(Bd=0,H(null))}else lc(!1,b,null!==d?d:void 0),Jd&&(Rd(b,d||void 0),Jd=!1);G();c=F();Bb(c)});Ed=null}function vd(a,b){v(b,()=>{let c=u();if(C(c)&&!b.isComposing()){let d=c.anchor,e=c.anchor.getNode();H(d.key);(a.timeStamp<Bd+30||"element"===d.type||!c.isCollapsed()||e.getFormat()!==c.format||B(e)&&e.getStyle()!==c.style)&&R(b,ka,db)}})}
|
||||
function Rd(a,b){var c=a._compositionKey;H(null);if(null!==c&&null!=b){if(""===b){b=I(c);a=Wb(a.getElementByKey(c));null!==a&&null!==a.nodeValue&&B(b)&&xb(b,a.nodeValue,null,null,!0);return}if("\n"===b[b.length-1]&&(c=u(),C(c))){b=c.focus;c.anchor.set(b.key,b.offset,b.type);R(a,Ba,null);return}}lc(!0,a,b)}function wd(a,b){Wa?Jd=!0:v(b,()=>{Rd(b,a.data)})}
|
||||
@@ -44,9 +44,9 @@
|
||||
"@types/react-native-vector-icons/@types/react": "17.0.2",
|
||||
"@types/react-native/@types/react": "17.0.2",
|
||||
"@types/hoist-non-react-statics/@types/react": "17.0.2",
|
||||
"@lexical/clipboard@0.12.6": "patch:@lexical/clipboard@npm:0.12.6#.yarn/patches/@lexical-clipboard-npm-0.12.6-4163a238a6.patch",
|
||||
"@lexical/rich-text@0.12.6": "patch:@lexical/rich-text@npm:0.12.6#.yarn/patches/@lexical-rich-text-npm-0.12.6-1692a2faf1.patch",
|
||||
"lexical@0.12.6": "patch:lexical@npm:0.12.6#.yarn/patches/lexical-npm-0.12.6-d9d90fc300.patch"
|
||||
"lexical@0.13.1": "patch:lexical@npm:0.13.1#.yarn/patches/lexical-npm-0.13.1-ac06219fd6.patch",
|
||||
"@lexical/clipboard@0.13.1": "patch:@lexical/clipboard@npm:0.13.1#.yarn/patches/@lexical-clipboard-npm-0.13.1-b4788bb0a9.patch",
|
||||
"@lexical/rich-text@0.13.1": "patch:@lexical/rich-text@npm:0.13.1#.yarn/patches/@lexical-rich-text-npm-0.13.1-df610fad54.patch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@standardnotes/snjs": "workspace:*"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"@babel/plugin-transform-react-jsx": "^7.19.0",
|
||||
"@babel/preset-env": "*",
|
||||
"@babel/preset-typescript": "^7.21.5",
|
||||
"@lexical/react": "0.12.6",
|
||||
"@lexical/react": "0.13.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
||||
"@simplewebauthn/browser": "^8.0.2",
|
||||
"@standardnotes/authenticator": "^2.4.0",
|
||||
@@ -76,7 +76,7 @@
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "^29.3.1",
|
||||
"jest-environment-jsdom": "^29.3.1",
|
||||
"lexical": "0.12.6",
|
||||
"lexical": "0.13.1",
|
||||
"lint-staged": ">=13",
|
||||
"mini-css-extract-plugin": "^2.7.2",
|
||||
"minimatch": "^5.1.1",
|
||||
@@ -109,7 +109,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ariakit/react": "^0.3.9",
|
||||
"@lexical/headless": "0.12.6",
|
||||
"@lexical/headless": "0.13.1",
|
||||
"@radix-ui/react-slot": "^1.0.1",
|
||||
"@react-pdf/renderer": "^3.3.2",
|
||||
"comlink": "^4.4.1",
|
||||
|
||||
@@ -27,7 +27,7 @@ import { RemoveBrokenTablesPlugin } from './Plugins/TablePlugin'
|
||||
import TableActionMenuPlugin from './Plugins/TableCellActionMenuPlugin'
|
||||
import ToolbarPlugin from './Plugins/ToolbarPlugin/ToolbarPlugin'
|
||||
import { useMediaQuery, MutuallyExclusiveMediaQueryBreakpoints } from '@/Hooks/useMediaQuery'
|
||||
import { CheckListPlugin } from './Plugins/List/CheckListPlugin'
|
||||
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin'
|
||||
import RemoteImagePlugin from './Plugins/RemoteImagePlugin/RemoteImagePlugin'
|
||||
import CodeOptionsPlugin from './Plugins/CodeOptionsPlugin/CodeOptions'
|
||||
import { SuperSearchContextProvider } from './Plugins/SearchPlugin/Context'
|
||||
|
||||
@@ -17,7 +17,6 @@ import { BubbleNode } from '../../Plugins/ItemBubblePlugin/Nodes/BubbleNode'
|
||||
import { RemoteImageNode } from '../../Plugins/RemoteImagePlugin/RemoteImageNode'
|
||||
import { InlineFileNode } from '../../Plugins/InlineFilePlugin/InlineFileNode'
|
||||
import { CreateEditorArgs } from 'lexical'
|
||||
import { ListHTMLExportNode } from '../../Plugins/List/ListHTMLExportNode'
|
||||
import { FileExportNode } from './FileExportNode'
|
||||
|
||||
const CommonNodes = [
|
||||
@@ -44,18 +43,9 @@ const CommonNodes = [
|
||||
BubbleNode,
|
||||
RemoteImageNode,
|
||||
InlineFileNode,
|
||||
ListNode,
|
||||
]
|
||||
|
||||
export const BlockEditorNodes = [...CommonNodes, ListNode]
|
||||
export const BlockEditorNodes = CommonNodes
|
||||
|
||||
export const SuperExportNodes: CreateEditorArgs['nodes'] = [
|
||||
...CommonNodes,
|
||||
FileExportNode,
|
||||
ListHTMLExportNode,
|
||||
{
|
||||
replace: ListNode,
|
||||
with(node) {
|
||||
return new ListHTMLExportNode(node.getListType(), node.getStart())
|
||||
},
|
||||
},
|
||||
]
|
||||
export const SuperExportNodes: CreateEditorArgs['nodes'] = [...CommonNodes, FileExportNode]
|
||||
|
||||
@@ -60,6 +60,7 @@ const BlocksEditorTheme: EditorThemeClasses = {
|
||||
},
|
||||
olDepth: ['Lexical__ol1', 'Lexical__ol2', 'Lexical__ol3', 'Lexical__ol4', 'Lexical__ol5'],
|
||||
ul: 'Lexical__ul',
|
||||
checklist: 'Lexical__checkList',
|
||||
},
|
||||
ltr: 'Lexical__ltr',
|
||||
mark: 'Lexical__mark',
|
||||
|
||||
@@ -3,13 +3,6 @@
|
||||
min-height: 18px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.Lexical__listItemUnchecked:before,
|
||||
.Lexical__listItemChecked:before {
|
||||
top: 0px;
|
||||
}
|
||||
.Lexical__listItemChecked:after {
|
||||
top: 1px;
|
||||
}
|
||||
.Lexical__table {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
@@ -35,13 +35,6 @@
|
||||
margin-left: 16px;
|
||||
list-style-position: outside;
|
||||
|
||||
// Fix indentation for checklists
|
||||
// Lexical doesn't support setting a class specifically for checklists at the moment
|
||||
// so we use the has selector to see if the items are check list items
|
||||
&:has(> [aria-checked]) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
&.Lexical__rtl {
|
||||
margin-left: 0;
|
||||
margin-right: 16px;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { CheckListPlugin as LexicalCheckListPlugin } from '@lexical/react/LexicalCheckListPlugin'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { ListNode } from '@lexical/list'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export function CheckListPlugin() {
|
||||
const [editor] = useLexicalComposerContext()
|
||||
|
||||
useEffect(() => {
|
||||
return editor.registerNodeTransform(ListNode, (node) => {
|
||||
if (node.getListType() !== 'check') {
|
||||
return
|
||||
}
|
||||
editor.getEditorState().read(() => {
|
||||
const element = editor.getElementByKey(node.getKey())
|
||||
if (!element) {
|
||||
return
|
||||
}
|
||||
element.classList.add('Lexical__checkList')
|
||||
})
|
||||
})
|
||||
}, [editor])
|
||||
|
||||
return <LexicalCheckListPlugin />
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import { ListNode, SerializedListNode } from '@lexical/list'
|
||||
import { DOMExportOutput, LexicalEditor, Spread } from 'lexical'
|
||||
|
||||
export type SerializedListHTMLExportNode = Spread<
|
||||
{
|
||||
type: 'list-html-export'
|
||||
},
|
||||
SerializedListNode
|
||||
>
|
||||
|
||||
export class ListHTMLExportNode extends ListNode {
|
||||
static getType(): string {
|
||||
return 'list-html-export'
|
||||
}
|
||||
|
||||
static clone(node: ListNode): ListHTMLExportNode {
|
||||
return new ListHTMLExportNode(node.getListType(), node.getStart(), node.getKey())
|
||||
}
|
||||
|
||||
static importJSON(serializedNode: SerializedListNode): ListNode {
|
||||
return super.importJSON(serializedNode)
|
||||
}
|
||||
|
||||
exportDOM(editor: LexicalEditor): DOMExportOutput {
|
||||
const { element } = super.exportDOM(editor)
|
||||
if (this.getListType() === 'check' && element instanceof HTMLElement) {
|
||||
element.classList.add('Lexical__checkList')
|
||||
}
|
||||
return { element }
|
||||
}
|
||||
|
||||
exportJSON(): SerializedListHTMLExportNode {
|
||||
return {
|
||||
...super.exportJSON(),
|
||||
type: 'list-html-export',
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
DEPRECATED_GridCellNode,
|
||||
ElementNode,
|
||||
$createParagraphNode,
|
||||
$getRoot,
|
||||
@@ -16,8 +15,6 @@ import {
|
||||
$isParagraphNode,
|
||||
$isRangeSelection,
|
||||
$isTextNode,
|
||||
DEPRECATED_$getNodeTriplet,
|
||||
DEPRECATED_$isGridCellNode,
|
||||
} from 'lexical'
|
||||
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
@@ -25,6 +22,7 @@ import useLexicalEditable from '@lexical/react/useLexicalEditable'
|
||||
import {
|
||||
$deleteTableColumn__EXPERIMENTAL,
|
||||
$deleteTableRow__EXPERIMENTAL,
|
||||
$getNodeTriplet,
|
||||
$getTableCellNodeFromLexicalNode,
|
||||
$getTableColumnIndexFromTableCellNode,
|
||||
$getTableNodeFromLexicalNodeOrThrow,
|
||||
@@ -33,13 +31,13 @@ import {
|
||||
$insertTableRow__EXPERIMENTAL,
|
||||
$isTableCellNode,
|
||||
$isTableRowNode,
|
||||
$isTableSelection,
|
||||
$unmergeCell,
|
||||
getTableSelectionFromTableElement,
|
||||
getTableObserverFromTableElement,
|
||||
HTMLTableElementWithWithTableSelectionState,
|
||||
TableCellHeaderStates,
|
||||
TableCellNode,
|
||||
GridSelection,
|
||||
$isGridSelection,
|
||||
TableSelection,
|
||||
} from '@lexical/table'
|
||||
import { ReactPortal, useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
@@ -50,7 +48,7 @@ import Menu from '@/Components/Menu/Menu'
|
||||
import MenuItem from '@/Components/Menu/MenuItem'
|
||||
import MenuItemSeparator from '@/Components/Menu/MenuItemSeparator'
|
||||
|
||||
function computeSelectionCount(selection: GridSelection): {
|
||||
function computeSelectionCount(selection: TableSelection): {
|
||||
columns: number
|
||||
rows: number
|
||||
} {
|
||||
@@ -63,7 +61,7 @@ function computeSelectionCount(selection: GridSelection): {
|
||||
|
||||
// This is important when merging cells as there is no good way to re-merge weird shapes (a result
|
||||
// of selecting merged cells and non-merged)
|
||||
function isGridSelectionRectangular(selection: GridSelection): boolean {
|
||||
function isGridSelectionRectangular(selection: TableSelection): boolean {
|
||||
const nodes = selection.getNodes()
|
||||
const currentRows: Array<number> = []
|
||||
let currentRow = null
|
||||
@@ -103,16 +101,16 @@ function $canUnmerge(): boolean {
|
||||
const selection = $getSelection()
|
||||
if (
|
||||
($isRangeSelection(selection) && !selection.isCollapsed()) ||
|
||||
($isGridSelection(selection) && !selection.anchor.is(selection.focus)) ||
|
||||
(!$isRangeSelection(selection) && !$isGridSelection(selection))
|
||||
($isTableSelection(selection) && !selection.anchor.is(selection.focus)) ||
|
||||
(!$isRangeSelection(selection) && !$isTableSelection(selection))
|
||||
) {
|
||||
return false
|
||||
}
|
||||
const [cell] = DEPRECATED_$getNodeTriplet(selection.anchor)
|
||||
const [cell] = $getNodeTriplet(selection.anchor)
|
||||
return cell.__colSpan > 1 || cell.__rowSpan > 1
|
||||
}
|
||||
|
||||
function $cellContainsEmptyParagraph(cell: DEPRECATED_GridCellNode): boolean {
|
||||
function $cellContainsEmptyParagraph(cell: TableCellNode): boolean {
|
||||
if (cell.getChildrenSize() !== 1) {
|
||||
return false
|
||||
}
|
||||
@@ -167,7 +165,7 @@ function TableActionMenu({ onClose, tableCellNode: _tableCellNode, cellMerge }:
|
||||
editor.getEditorState().read(() => {
|
||||
const selection = $getSelection()
|
||||
// Merge cells
|
||||
if ($isGridSelection(selection)) {
|
||||
if ($isTableSelection(selection)) {
|
||||
const currentSelectionCounts = computeSelectionCount(selection)
|
||||
updateSelectionCounts(computeSelectionCount(selection))
|
||||
setCanMergeCells(
|
||||
@@ -190,7 +188,7 @@ function TableActionMenu({ onClose, tableCellNode: _tableCellNode, cellMerge }:
|
||||
throw new Error('Expected to find tableElement in DOM')
|
||||
}
|
||||
|
||||
const tableSelection = getTableSelectionFromTableElement(tableElement)
|
||||
const tableSelection = getTableObserverFromTableElement(tableElement)
|
||||
if (tableSelection !== null) {
|
||||
tableSelection.clearHighlight()
|
||||
}
|
||||
@@ -207,13 +205,13 @@ function TableActionMenu({ onClose, tableCellNode: _tableCellNode, cellMerge }:
|
||||
const mergeTableCellsAtSelection = () => {
|
||||
editor.update(() => {
|
||||
const selection = $getSelection()
|
||||
if ($isGridSelection(selection)) {
|
||||
if ($isTableSelection(selection)) {
|
||||
const { columns, rows } = computeSelectionCount(selection)
|
||||
const nodes = selection.getNodes()
|
||||
let firstCell: null | DEPRECATED_GridCellNode = null
|
||||
let firstCell: null | TableCellNode = null
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
const node = nodes[i]
|
||||
if (DEPRECATED_$isGridCellNode(node)) {
|
||||
if ($isTableCellNode(node)) {
|
||||
if (firstCell === null) {
|
||||
node.setColSpan(columns).setRowSpan(rows)
|
||||
firstCell = node
|
||||
@@ -222,7 +220,7 @@ function TableActionMenu({ onClose, tableCellNode: _tableCellNode, cellMerge }:
|
||||
if (isEmpty && $isParagraphNode((firstChild = node.getFirstChild()))) {
|
||||
firstChild.remove()
|
||||
}
|
||||
} else if (DEPRECATED_$isGridCellNode(firstCell)) {
|
||||
} else if ($isTableCellNode(firstCell)) {
|
||||
const isEmpty = $cellContainsEmptyParagraph(node)
|
||||
if (!isEmpty) {
|
||||
firstCell.append(...node.getChildren())
|
||||
|
||||
@@ -44,7 +44,7 @@ ${superEditorCSS.toString()}
|
||||
${exportOverridesCSS.toString()}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body style="--font-size: 1rem; --line-height: 1.5; font-size: var(--font-size); line-height: var(--line-height);">
|
||||
${content}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
358
yarn.lock
358
yarn.lock
@@ -3774,282 +3774,282 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/clipboard@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/clipboard@npm:0.12.6"
|
||||
"@lexical/clipboard@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/clipboard@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/html": 0.12.6
|
||||
"@lexical/list": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/html": 0.13.1
|
||||
"@lexical/list": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 1b543ee4985e8685094b29ae03a298f22052bbf12e3dd17c9fe3c6003a58bd567300c8f5f449fe0ab59a60dc87d3580024e38cb901b9aed73c096c0b5ee95b62
|
||||
lexical: 0.13.1
|
||||
checksum: 65aeeadda2bde5ffa501a4ff512750beff4afdd2a33bfac2feedd3782abc124b09cf3f6b6c543ec0baaa000cda11f6cbc132fcda64675ce945e369ae44a89328
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/clipboard@patch:@lexical/clipboard@npm:0.12.6#.yarn/patches/@lexical-clipboard-npm-0.12.6-4163a238a6.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/clipboard@patch:@lexical/clipboard@npm%3A0.12.6#.yarn/patches/@lexical-clipboard-npm-0.12.6-4163a238a6.patch::version=0.12.6&hash=0011f4&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
"@lexical/clipboard@patch:@lexical/clipboard@npm:0.13.1#.yarn/patches/@lexical-clipboard-npm-0.13.1-b4788bb0a9.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/clipboard@patch:@lexical/clipboard@npm%3A0.13.1#.yarn/patches/@lexical-clipboard-npm-0.13.1-b4788bb0a9.patch::version=0.13.1&hash=150760&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
dependencies:
|
||||
"@lexical/html": 0.12.6
|
||||
"@lexical/list": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/html": 0.13.1
|
||||
"@lexical/list": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 338dfa2def24d7a1a89ef259d06e284938ac57efd11440718c25dccb74aa5c23a2950a0670ad669e276a12384b5720802525cddc97a88d315514b20dd38b6149
|
||||
lexical: 0.13.1
|
||||
checksum: c346f43e6262f68a29af587996bd33853c47127f54a61fa8342de09f62835133eb64ded98b6d6c374e41a2dd09e7201645c8b3933c1e805c64710edbc3c97c93
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/code@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/code@npm:0.12.6"
|
||||
"@lexical/code@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/code@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
prismjs: ^1.27.0
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 051e97ea6c2953558b0523a53b55071f397f3761f299da255a4192ec247102716421942d1c29ea03edaf6458caa0973fab7aeaf8fdeb7af80f1eb2898caeab16
|
||||
lexical: 0.13.1
|
||||
checksum: ae9017aea3929c748278324c2bec7b89e0c60a8f58b305c1994f4c3ecddee42ca41e603eb85054bf0d48e7bd1216a4f3ce9df8eb56adc49094e118b014a0e449
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/dragon@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/dragon@npm:0.12.6"
|
||||
"@lexical/dragon@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/dragon@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: e9e616bfe0e334492e7fbceae78fbc07c8c92938ac6a985ece87c921d118f9453dd46bba034562aaff9bf30a8a8134353bcf7b425004a7768caf456367c8be41
|
||||
lexical: 0.13.1
|
||||
checksum: 9670be4e004ec96807d721224db16ea8fabf2f8770041ea4f06fcfe9a9faa37fbc2479e912780f00e9ccef2474cebb41165746f8075ef56a0f44b9684c07bf03
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/hashtag@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/hashtag@npm:0.12.6"
|
||||
"@lexical/hashtag@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/hashtag@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 63c12a7cc603468a7abd8fccde3ff31c128bbb339e26d60719097ad5c7dc55124fb8fecdfac514ffb3fa592a3d505fa1c1b012c190a40bd18b1b62fe52671f89
|
||||
lexical: 0.13.1
|
||||
checksum: a66d1402d68239955f3a961efbbf8213c8f33de5a37b700915a8081f1245eb9a2f0bb41195b442fc41df2180436c9c301e4fe1836305a1433a54f10fa17a5b4a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/headless@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/headless@npm:0.12.6"
|
||||
"@lexical/headless@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/headless@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: ed2a00811b1b7fe9663050f5072f4da9ec51a727f4ac85cb0acb6919c756d90ff076d734e652f027aba81a920b42a9063b3fef77fa00df8818f7b3d23d17c911
|
||||
lexical: 0.13.1
|
||||
checksum: ff295beac73a007f10d03d2e210d2823d0443fe6dbbb122c2901a85429490cdfe0fd15ea713086ba08e8d30eaaaa181333b051faf7a3ac92bdcaf8e960b84875
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/history@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/history@npm:0.12.6"
|
||||
"@lexical/history@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/history@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 16c1304e4f568b2efc721cc3518d2a6d7e70dde2b5cbf353d04fa18615d19cfc3f0b64a10c93ca26048894dae69d367a0ff3616d3a8b893fd483f0bee19e4f0f
|
||||
lexical: 0.13.1
|
||||
checksum: 13bfa92b476cc1bded5599d1e323afc56941a463f32618d0b6674acd10dc5959d7c8ba6b481da933e72954336b8de0072f1d37c8404e8e49f8e4b92004091618
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/html@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/html@npm:0.12.6"
|
||||
"@lexical/html@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/html@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 42c9c8dfd444e7b1eaa7c17696836fad4c494a1e673363ce78d74e004566fdab1acc132059978b07cc0ebe09459b28f7855cea1c8f82776cf04cc9f68d26dafa
|
||||
lexical: 0.13.1
|
||||
checksum: 997a04efa8f5e0d9b5bf77a91d923f1ba3e22556ad1befda9529efc0b76349746b05ea5a689e5519cbc2bd150730fa1bc5a3694b7f5c2feb0fc6fe32ede76e3d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/link@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/link@npm:0.12.6"
|
||||
"@lexical/link@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/link@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: c7aea26c2203eca0095eeb9b4b1719c820d3e97c090ab236e3e6d18f6d4f24f0850e0f52007eb20a9f1ee30f6f372bae5af2bb8b81d733caa71c53d3af11cadf
|
||||
lexical: 0.13.1
|
||||
checksum: eb246508ea7240f0b784f07a6f8f7132f165e1c8f344233daffb9353eebf7ddfd22596568b7a484fc2e531aca052db06e5d347e1a8a9ef9ef6702c3daaff43f6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/list@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/list@npm:0.12.6"
|
||||
"@lexical/list@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/list@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: a43b4393bdcf98a1e0f77cdd30356ea159989040a3fb3230d70566b41db77b1b50f1585c6dc108629960c292720e88c294f0aa3d56387d0397259f93e077dc2d
|
||||
lexical: 0.13.1
|
||||
checksum: a823127efec69c45718a64f5c81dbe0c042493cd3e9389fc8abb6607c367aad0934f3cf719bc98e0147580de97fe78144c7b6f937863e9e83f22e9db50df5283
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/mark@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/mark@npm:0.12.6"
|
||||
"@lexical/mark@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/mark@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: ea51fb87d72eb3808e7f2773a209caa2dcfef91c3412a5a09a63450f8d9411a84190248b30ac65788305255da8d610572e1aa228ac69add1ff9a93ce47670d73
|
||||
lexical: 0.13.1
|
||||
checksum: 26eb8deb494ef7779ab5891c12a2f4524d990be9891e7bb007e50003331818beed015e7a046b6838b27234792afbcff549ef8c3a8267dbf8c438b6a5eb2643dc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/markdown@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/markdown@npm:0.12.6"
|
||||
"@lexical/markdown@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/markdown@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/code": 0.12.6
|
||||
"@lexical/link": 0.12.6
|
||||
"@lexical/list": 0.12.6
|
||||
"@lexical/rich-text": 0.12.6
|
||||
"@lexical/text": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/code": 0.13.1
|
||||
"@lexical/link": 0.13.1
|
||||
"@lexical/list": 0.13.1
|
||||
"@lexical/rich-text": 0.13.1
|
||||
"@lexical/text": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: e14a8226e775c70074ed0e0962b18a8ab9fadcb3e9dc08b941ff882dc7b11ee5f0fd7d61b4f1cf6c1f247ffdab94a8404d6543b2a6cff2ec8de456d5172efed4
|
||||
lexical: 0.13.1
|
||||
checksum: 42b8465866a8c8dc5bb46fdd8ddd5827fa9db45f93428920628051430a136c497038555bbf9141ae36de7a1cd4d1467bd408e007063f2e977cb0dbd206f98da4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/offset@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/offset@npm:0.12.6"
|
||||
"@lexical/offset@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/offset@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: cfc5a42752678e21b953f81debab20d6fa331718a24131d2fa4025c2b124dc2cedc912bfb03d3eff95f5a55c7e9f8499b15c283a81d2569ccd65eff07746c28b
|
||||
lexical: 0.13.1
|
||||
checksum: 9b324a7124e39200ad30fcccace600af7077931aae111d3ff2b92b2581ace1b605fae490c9638fb52f5f35a7b7c8d999710e8a03fe69562f54f29e435e3a5ce3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/overflow@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/overflow@npm:0.12.6"
|
||||
"@lexical/overflow@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/overflow@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: bccd68543e786f7a9fa7130ab713b6d54d06edd3a936a9421258b103b852419f31b009054a2c350daf43533f1225201d44f5598ded0baf2db5d3c3bfbb164498
|
||||
lexical: 0.13.1
|
||||
checksum: 71a07ca65253f16c0c761baaf9d083d4ed5e67d8a68aad48e3340d45928386914805d95c1607293d332d7fcc1d44bfc519bc8fb980489cf2e74013eae2e9de76
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/plain-text@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/plain-text@npm:0.12.6"
|
||||
"@lexical/plain-text@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/plain-text@npm:0.13.1"
|
||||
peerDependencies:
|
||||
"@lexical/clipboard": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
lexical: 0.12.6
|
||||
checksum: f03ab1880a7033ecc0e75b75a033b3d3293506fac93f14a70c2511aabf742e57c09b03f70fbd1712b69e6c73123540f680401b332b19683e221d21702ed090d7
|
||||
"@lexical/clipboard": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
lexical: 0.13.1
|
||||
checksum: 920ef8fe4e0c7d0ef2f25300f2e327dd488fab51be598787b73f5bc773b1436a9e65a6930616d93514555b8dfdf9f5beeec2f0b305b14e43c5caa5ffc16e73d4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/react@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/react@npm:0.12.6"
|
||||
"@lexical/react@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/react@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/clipboard": 0.12.6
|
||||
"@lexical/code": 0.12.6
|
||||
"@lexical/dragon": 0.12.6
|
||||
"@lexical/hashtag": 0.12.6
|
||||
"@lexical/history": 0.12.6
|
||||
"@lexical/link": 0.12.6
|
||||
"@lexical/list": 0.12.6
|
||||
"@lexical/mark": 0.12.6
|
||||
"@lexical/markdown": 0.12.6
|
||||
"@lexical/overflow": 0.12.6
|
||||
"@lexical/plain-text": 0.12.6
|
||||
"@lexical/rich-text": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/table": 0.12.6
|
||||
"@lexical/text": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/yjs": 0.12.6
|
||||
"@lexical/clipboard": 0.13.1
|
||||
"@lexical/code": 0.13.1
|
||||
"@lexical/dragon": 0.13.1
|
||||
"@lexical/hashtag": 0.13.1
|
||||
"@lexical/history": 0.13.1
|
||||
"@lexical/link": 0.13.1
|
||||
"@lexical/list": 0.13.1
|
||||
"@lexical/mark": 0.13.1
|
||||
"@lexical/markdown": 0.13.1
|
||||
"@lexical/overflow": 0.13.1
|
||||
"@lexical/plain-text": 0.13.1
|
||||
"@lexical/rich-text": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/table": 0.13.1
|
||||
"@lexical/text": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
"@lexical/yjs": 0.13.1
|
||||
react-error-boundary: ^3.1.4
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
lexical: 0.13.1
|
||||
react: ">=17.x"
|
||||
react-dom: ">=17.x"
|
||||
checksum: 942f6edd0fec6b726284eb18dca4391a5094319933085f25dc004d22e1dea11c6805755b265bfd1fc868039b392f37b5a0ca379c5d52e9e38503d5a02c7fb55c
|
||||
checksum: 095e698c95d075d6a9b8e74abe3d5656a5b0c6f1a3caa80e0ff798eda548afa0dea41452c6d3cd84f7bb7a03c213a3fc0eec6bfe987bf2084198e89ad4b459ce
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/rich-text@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/rich-text@npm:0.12.6"
|
||||
"@lexical/rich-text@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/rich-text@npm:0.13.1"
|
||||
peerDependencies:
|
||||
"@lexical/clipboard": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
lexical: 0.12.6
|
||||
checksum: fa61b28a79f20be8be3a485733f8ca6bbe5124268f9eca95486df51388ec411a0967aac7c3d40a2c2dcb1c87fa40404df48e9c66f1d86a76311305598ca2262e
|
||||
"@lexical/clipboard": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
lexical: 0.13.1
|
||||
checksum: 2ccd2fa46782ef07001eef69e34847623d8baf0c348d359baae67930693bebae99b4b387ddd7bc1a6845b87b3b20cf8309c6afa2cb890433428b6e73a5387952
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/rich-text@patch:@lexical/rich-text@npm:0.12.6#.yarn/patches/@lexical-rich-text-npm-0.12.6-1692a2faf1.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/rich-text@patch:@lexical/rich-text@npm%3A0.12.6#.yarn/patches/@lexical-rich-text-npm-0.12.6-1692a2faf1.patch::version=0.12.6&hash=92d887&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
"@lexical/rich-text@patch:@lexical/rich-text@npm:0.13.1#.yarn/patches/@lexical-rich-text-npm-0.13.1-df610fad54.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/rich-text@patch:@lexical/rich-text@npm%3A0.13.1#.yarn/patches/@lexical-rich-text-npm-0.13.1-df610fad54.patch::version=0.13.1&hash=045627&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
peerDependencies:
|
||||
"@lexical/clipboard": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/utils": 0.12.6
|
||||
lexical: 0.12.6
|
||||
checksum: 84d2609fa16192b77d47a191c2e625e5e97eb99cc61a591a112d68e7ee08b873217ff93207357348da02a06793d9d385d517f0a05fa731b39c21c2f5a7cc1d75
|
||||
"@lexical/clipboard": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/utils": 0.13.1
|
||||
lexical: 0.13.1
|
||||
checksum: defa6abc742e1712cf392881efe9f10b1105ec98a38edab8fc66f0ff1a5b54a6b36c8ab56f577444d92cf477e401875977ae63abd4ac01bc1a308f1d80bc5ed7
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/selection@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/selection@npm:0.12.6"
|
||||
"@lexical/selection@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/selection@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 9d91945aebd6b54e1328a37a1310f9cc0c978220ad3d624609f2d6ba505bd728bc881e12d9692ba1d66246b13b3ce5f5917054722bcdbf8b1ee749c7a30c7563
|
||||
lexical: 0.13.1
|
||||
checksum: 1e061f25c515f6e87c74884f071c5d9248dcd9ea82caaac4067a2841292c2dfd516eb85d003f6bea3ae46a8bd61e0f7c7351328c82055ea34fd8c3b0ae7f190f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/table@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/table@npm:0.12.6"
|
||||
"@lexical/table@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/table@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/utils": 0.12.6
|
||||
"@lexical/utils": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: 601fe1841773e704cbac6710dbdbfbe71a1a78ffda4ab993d7d6a482f25fa8dcbfa5f743af79c9c626afcbf776239e23d64a1ec8ec483160d571b93c9b08da51
|
||||
lexical: 0.13.1
|
||||
checksum: 506dc2c12711b0c762e2f95063401ca9c61a8807274952f4113a453dfce7edbace4b9b2eb808aac40606d125c929395d370b73ce1cf9a56f54119e82ecd86c62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/text@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/text@npm:0.12.6"
|
||||
"@lexical/text@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/text@npm:0.13.1"
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: b0157a5c64162f57248940f07153de522c62542dba694466ca8fff757b5af9886f9edbde7b9daaf9614e90fb7771f693a43698340d9138143253d8584d8af82d
|
||||
lexical: 0.13.1
|
||||
checksum: d4db29501da434e2f7953da8c140b6e32fcb36bd0267d0a8c8644c606e0536c6ca547bebdc0c42541e2b00162b896292206ec6092c510cd43c7a97eb9283da6e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/utils@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/utils@npm:0.12.6"
|
||||
"@lexical/utils@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/utils@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/list": 0.12.6
|
||||
"@lexical/selection": 0.12.6
|
||||
"@lexical/table": 0.12.6
|
||||
"@lexical/list": 0.13.1
|
||||
"@lexical/selection": 0.13.1
|
||||
"@lexical/table": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
checksum: d95889be86480a5ee4f02d3ea599ce9d94cea28174e71af4552c8be498789eb924e2fb6187561a50278fa3003a2e711be8f3b52ca8a01a4647ce2640d7d20930
|
||||
lexical: 0.13.1
|
||||
checksum: 1bdba9d329ae39eedf0af86daa96857821da17029baf06aed17d4c041753dbef080043b974654a2884764e57ea757942b75ad4984c8b9787e1b5a10c91fb86df
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@lexical/yjs@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "@lexical/yjs@npm:0.12.6"
|
||||
"@lexical/yjs@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "@lexical/yjs@npm:0.13.1"
|
||||
dependencies:
|
||||
"@lexical/offset": 0.12.6
|
||||
"@lexical/offset": 0.13.1
|
||||
peerDependencies:
|
||||
lexical: 0.12.6
|
||||
lexical: 0.13.1
|
||||
yjs: ">=13.5.22"
|
||||
checksum: 913efe4f096008f2db05a30d847ee97f1fbd166d492d464122998084fdd69d3df9be1b38cf2cbd07b45c4f9145077484e12862b0c57d3d7b8f19b5157f2fe98b
|
||||
checksum: 8a0cb3370fcf6d054b94c41c086a05e0ddb396e8f8f7818006cf6f5c42e18d6cf6e94c17194e5fbc409b03202db65f72754bd1af586a384952f0bb93f9c33105
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7666,8 +7666,8 @@ __metadata:
|
||||
"@babel/plugin-transform-react-jsx": ^7.19.0
|
||||
"@babel/preset-env": "*"
|
||||
"@babel/preset-typescript": ^7.21.5
|
||||
"@lexical/headless": 0.12.6
|
||||
"@lexical/react": 0.12.6
|
||||
"@lexical/headless": 0.13.1
|
||||
"@lexical/react": 0.13.1
|
||||
"@pmmmwh/react-refresh-webpack-plugin": ^0.5.10
|
||||
"@radix-ui/react-slot": ^1.0.1
|
||||
"@react-pdf/renderer": ^3.3.2
|
||||
@@ -7719,7 +7719,7 @@ __metadata:
|
||||
identity-obj-proxy: ^3.0.0
|
||||
jest: ^29.3.1
|
||||
jest-environment-jsdom: ^29.3.1
|
||||
lexical: 0.12.6
|
||||
lexical: 0.13.1
|
||||
lint-staged: ">=13"
|
||||
mini-css-extract-plugin: ^2.7.2
|
||||
minimatch: ^5.1.1
|
||||
@@ -18724,17 +18724,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lexical@npm:0.12.6":
|
||||
version: 0.12.6
|
||||
resolution: "lexical@npm:0.12.6"
|
||||
checksum: 4f58d67914ae94e136830fec33b9b05b80d3419136e40767332172232f01015b0b1b38d977e63079e6ed267e5de1508a47bb1412e005dd7144895c5e20978a9c
|
||||
"lexical@npm:0.13.1":
|
||||
version: 0.13.1
|
||||
resolution: "lexical@npm:0.13.1"
|
||||
checksum: 044b0d7bef2b9ffc6e46c924e9c3c3744c6d063fd7ce7a68c6a66e0094784074f549440bbbf8a9a115a3f0be9d69d7825498cdd0fa1a3f953f9371aa3d28f9b6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lexical@patch:lexical@npm:0.12.6#.yarn/patches/lexical-npm-0.12.6-d9d90fc300.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.12.6
|
||||
resolution: "lexical@patch:lexical@npm%3A0.12.6#.yarn/patches/lexical-npm-0.12.6-d9d90fc300.patch::version=0.12.6&hash=4941cb&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
checksum: ada7927c742a6ac2d6e9181c4924457ce35db08890390bac09533ae1f05693f8567a4a1a075bf0708ee08badf2763e0bbbaaf531e913154eb2a75ab5b82d9f17
|
||||
"lexical@patch:lexical@npm:0.13.1#.yarn/patches/lexical-npm-0.13.1-ac06219fd6.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
|
||||
version: 0.13.1
|
||||
resolution: "lexical@patch:lexical@npm%3A0.13.1#.yarn/patches/lexical-npm-0.13.1-ac06219fd6.patch::version=0.13.1&hash=f8f788&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
|
||||
checksum: 85d0ec97e022c00f5b982adc9eac96e9be2251555a81b7368d9e23a9d297d8a798a9201562c39063e184a7b496bdb70695ac36a39c40b4787195be4493b8415e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user