chore: upgrade lexical and patches [skip e2e]

This commit is contained in:
Aman Harwara
2024-06-05 13:47:11 +05:30
parent abc43900f9
commit 1f6d582ad6
58 changed files with 646 additions and 720 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,248 +0,0 @@
diff --git a/LexicalClipboard.dev.js b/LexicalClipboard.dev.js
index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..78aa3bc5048bb4354339efc558031ec0185163dd 100644
--- a/LexicalClipboard.dev.js
+++ b/LexicalClipboard.dev.js
@@ -3,7 +3,9 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
'use strict';
var html = require('@lexical/html');
@@ -102,7 +104,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-function $insertDataTransferForRichText(dataTransfer, selection, editor) {
+function $insertDataTransferForRichText(dataTransfer, selection, editor, event) {
const lexicalString = dataTransfer.getData('application/x-lexical-editor');
if (lexicalString) {
try {
@@ -115,15 +117,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
// Fail silently.
}
}
- const htmlString = dataTransfer.getData('text/html');
- if (htmlString) {
- try {
- const parser = new DOMParser();
- const dom = parser.parseFromString(htmlString, 'text/html');
- const nodes = html.$generateNodesFromDOM(editor, dom);
- return $insertGeneratedNodes(editor, nodes, selection);
- } catch (_unused2) {
- // Fail silently.
+ const shouldIgnoreHTML = event && event.inputType === 'insertReplacementText' && dataTransfer.types.includes('text/plain');
+ if (!shouldIgnoreHTML) {
+ const htmlString = dataTransfer.getData('text/html');
+ if (htmlString) {
+ try {
+ const parser = new DOMParser();
+ const dom = parser.parseFromString(htmlString, 'text/html');
+ const nodes = html.$generateNodesFromDOM(editor, dom);
+ return $insertGeneratedNodes(editor, nodes, selection);
+ } catch (_unused2) {
+ // Fail silently.
+ }
}
}
@@ -138,13 +143,16 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
parts.pop();
}
for (let i = 0; i < parts.length; i++) {
- const part = parts[i];
- if (part === '\n' || part === '\r\n') {
- selection.insertParagraph();
- } else if (part === '\t') {
- selection.insertNodes([lexical.$createTabNode()]);
- } else {
- selection.insertText(part);
+ const currentSelection = lexical.$getSelection();
+ if (lexical.$isRangeSelection(currentSelection)) {
+ const part = parts[i];
+ if (part === '\n' || part === '\r\n') {
+ currentSelection.insertParagraph();
+ } else if (part === '\t') {
+ currentSelection.insertNodes([lexical.$createTabNode()]);
+ } else {
+ currentSelection.insertText(part);
+ }
}
}
} else {
diff --git a/LexicalClipboard.dev.mjs b/LexicalClipboard.dev.mjs
index e5b580537bc7b3ce1bd9546f6858988b4f58003f..ef944d097da9cc4383c38c874a6d1e7c20ab22d0 100644
--- a/LexicalClipboard.dev.mjs
+++ b/LexicalClipboard.dev.mjs
@@ -3,7 +3,9 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
import { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';
import { $addNodeStyle, $cloneWithProperties, $sliceSelectedTextNodeContent } from '@lexical/selection';
import { objectKlassEquals } from '@lexical/utils';
@@ -100,7 +102,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-function $insertDataTransferForRichText(dataTransfer, selection, editor) {
+function $insertDataTransferForRichText(dataTransfer, selection, editor, event) {
const lexicalString = dataTransfer.getData('application/x-lexical-editor');
if (lexicalString) {
try {
@@ -113,15 +115,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
// Fail silently.
}
}
- const htmlString = dataTransfer.getData('text/html');
- if (htmlString) {
- try {
- const parser = new DOMParser();
- const dom = parser.parseFromString(htmlString, 'text/html');
- const nodes = $generateNodesFromDOM(editor, dom);
- return $insertGeneratedNodes(editor, nodes, selection);
- } catch (_unused2) {
- // Fail silently.
+ const shouldIgnoreHTML = event && event.inputType === 'insertReplacementText' && dataTransfer.types.includes('text/plain');
+ if (!shouldIgnoreHTML) {
+ const htmlString = dataTransfer.getData('text/html');
+ if (htmlString) {
+ try {
+ const parser = new DOMParser();
+ const dom = parser.parseFromString(htmlString, 'text/html');
+ const nodes = $generateNodesFromDOM(editor, dom);
+ return $insertGeneratedNodes(editor, nodes, selection);
+ } catch (_unused2) {
+ // Fail silently.
+ }
}
}
@@ -136,13 +141,16 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
parts.pop();
}
for (let i = 0; i < parts.length; i++) {
- const part = parts[i];
- if (part === '\n' || part === '\r\n') {
- selection.insertParagraph();
- } else if (part === '\t') {
- selection.insertNodes([$createTabNode()]);
- } else {
- selection.insertText(part);
+ const currentSelection = $getSelection();
+ if ($isRangeSelection(currentSelection)) {
+ const part = parts[i];
+ if (part === '\n' || part === '\r\n') {
+ currentSelection.insertParagraph();
+ } else if (part === '\t') {
+ currentSelection.insertNodes([$createTabNode()]);
+ } else {
+ currentSelection.insertText(part);
+ }
}
}
} else {
diff --git a/LexicalClipboard.js b/LexicalClipboard.js
index ab45df643f3d23d7c917a4961db63d49045831f4..b7a8117bf55550d7b25c5385f164922b48fa6e17 100644
--- a/LexicalClipboard.js
+++ b/LexicalClipboard.js
@@ -3,7 +3,9 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
'use strict'
const LexicalClipboard = process.env.NODE_ENV === 'development' ? require('./LexicalClipboard.dev.js') : require('./LexicalClipboard.prod.js');
module.exports = LexicalClipboard;
\ No newline at end of file
diff --git a/LexicalClipboard.mjs b/LexicalClipboard.mjs
index 92cf644354b39f5011db1c739c29bfc14cec689a..b0a924f9cc33893ef74d5fb574a280602d859f9d 100644
--- a/LexicalClipboard.mjs
+++ b/LexicalClipboard.mjs
@@ -3,7 +3,9 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
import * as modDev from './LexicalClipboard.dev.mjs';
import * as modProd from './LexicalClipboard.prod.mjs';
const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
diff --git a/LexicalClipboard.node.mjs b/LexicalClipboard.node.mjs
index d6561d32c2e79f9070851f7352e43ea4bcb5bd86..2112c40f0b771340e778d9026049df85f405228e 100644
--- a/LexicalClipboard.node.mjs
+++ b/LexicalClipboard.node.mjs
@@ -3,7 +3,9 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalClipboard.dev.mjs') : import('./LexicalClipboard.prod.mjs'));
export const $generateJSONFromSelectedNodes = mod.$generateJSONFromSelectedNodes;
export const $generateNodesFromSerializedNodes = mod.$generateNodesFromSerializedNodes;
diff --git a/LexicalClipboard.prod.js b/LexicalClipboard.prod.js
index 494ab7597d14cfa0386f7bad294c567a8f0110c1..8b3d21203d28eb2be142ad3d7061f2e0cffbdd23 100644
--- a/LexicalClipboard.prod.js
+++ b/LexicalClipboard.prod.js
@@ -3,15 +3,17 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
+
'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],
-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],
+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)};
-exports.$insertDataTransferForRichText=function(a,b,c){var d=a.getData("application/x-lexical-editor");if(d)try{let h=JSON.parse(d);if(h.namespace===c._config.namespace&&Array.isArray(h.nodes)){let g=A(h.nodes);return y(c,g,b)}}catch(h){}if(d=a.getData("text/html"))try{var e=(new DOMParser).parseFromString(d,"text/html");let h=f.$generateNodesFromDOM(c,e);return y(c,h,b)}catch(h){}a=a.getData("text/plain")||a.getData("text/uri-list");if(null!=a)if(r.$isRangeSelection(b))for(a=a.split(/(\r?\n|\t)/),
-""===a[a.length-1]&&a.pop(),c=0;c<a.length;c++)e=a[c],"\n"===e||"\r\n"===e?b.insertParagraph():"\t"===e?b.insertNodes([r.$createTabNode()]):b.insertText(e);else b.insertRawText(a)};exports.$insertGeneratedNodes=y;
-exports.copyToClipboard=async function(a,b){if(null!==B)return!1;if(null!==b)return new Promise(g=>{a.update(()=>{g(C(a,b))})});var c=a.getRootElement();let d=null==a._window?window.document:a._window.document,e=u?(a._window||window).getSelection():null;if(null===c||null===e)return!1;let h=d.createElement("span");h.style.cssText="position: fixed; top: -1000px;";h.append(d.createTextNode("#"));c.append(h);c=new Range;c.setStart(h,0);c.setEnd(h,1);e.removeAllRanges();e.addRange(c);return new Promise(g=>
-{let k=a.registerCommand(r.COPY_COMMAND,n=>{q.objectKlassEquals(n,ClipboardEvent)&&(k(),null!==B&&(window.clearTimeout(B),B=null),g(C(a,n)));return!0},r.COMMAND_PRIORITY_CRITICAL);B=window.setTimeout(()=>{k();B=null;g(!1)},50);d.execCommand("copy");h.remove()})}
+exports.$insertDataTransferForRichText=function(a,b,c,e){let g=a.getData("application/x-lexical-editor");if(g)try{let d=JSON.parse(g);if(d.namespace===c._config.namespace&&Array.isArray(d.nodes)){let h=A(d.nodes);return y(c,h,b)}}catch(d){}if(!e||"insertReplacementText"!==e.inputType||!a.types.includes("text/plain"))if(e=a.getData("text/html"))try{var k=(new DOMParser).parseFromString(e,"text/html");let d=f.$generateNodesFromDOM(c,k);return y(c,d,b)}catch(d){}a=a.getData("text/plain")||a.getData("text/uri-list");
+if(null!=a)if(r.$isRangeSelection(b))for(b=a.split(/(\r?\n|\t)/),""===b[b.length-1]&&b.pop(),a=0;a<b.length;a++)c=r.$getSelection(),r.$isRangeSelection(c)&&(k=b[a],"\n"===k||"\r\n"===k?c.insertParagraph():"\t"===k?c.insertNodes([r.$createTabNode()]):c.insertText(k));else b.insertRawText(a)};exports.$insertGeneratedNodes=y;
+exports.copyToClipboard=async function(a,b){if(null!==B)return!1;if(null!==b)return new Promise(d=>{a.update(()=>{d(C(a,b))})});var c=a.getRootElement();let e=null==a._window?window.document:a._window.document,g=u?(a._window||window).getSelection():null;if(null===c||null===g)return!1;let k=e.createElement("span");k.style.cssText="position: fixed; top: -1000px;";k.append(e.createTextNode("#"));c.append(k);c=new Range;c.setStart(k,0);c.setEnd(k,1);g.removeAllRanges();g.addRange(c);return new Promise(d=>
+{let h=a.registerCommand(r.COPY_COMMAND,n=>{q.objectKlassEquals(n,ClipboardEvent)&&(h(),null!==B&&(window.clearTimeout(B),B=null),d(C(a,n)));return!0},r.COMMAND_PRIORITY_CRITICAL);B=window.setTimeout(()=>{h();B=null;d(!1)},50);e.execCommand("copy");k.remove()})}
diff --git a/LexicalClipboard.prod.mjs b/LexicalClipboard.prod.mjs
index e975808a82c8e8bd1b7dc80867ba65bec9a96fa9..48e6331eaa95219007cb3066fbe4a9c73551912e 100644
--- a/LexicalClipboard.prod.mjs
+++ b/LexicalClipboard.prod.mjs
@@ -3,5 +3,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
+ *
*/
-import{$generateHtmlFromNodes as e,$generateNodesFromDOM as t}from"@lexical/html";import{$addNodeStyle as n,$cloneWithProperties as o,$sliceSelectedTextNodeContent as l}from"@lexical/selection";import{objectKlassEquals as r}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as a,$createTabNode as c,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND as s,$getRoot as u,$parseSerializedNode as d,$isTextNode as f,COPY_COMMAND as p,COMMAND_PRIORITY_CRITICAL as m,isSelectionWithinEditor as h,$isElementNode as x}from"lexical";var g=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,y=e=>w?(e||window).getSelection():null;function v(t){const n=i();if(null==n)throw Error("Expected valid LexicalSelection");return a(n)&&n.isCollapsed()||0===n.getNodes().length?"":e(t,n)}function D(e){const t=i();if(null==t)throw Error("Expected valid LexicalSelection");return a(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(T(e,t))}function C(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)}function E(e,n,o){const l=e.getData("application/x-lexical-editor");if(l)try{const e=JSON.parse(l);if(e.namespace===o._config.namespace&&Array.isArray(e.nodes)){return N(o,_(e.nodes),n)}}catch(e){}const r=e.getData("text/html");if(r)try{const e=(new DOMParser).parseFromString(r,"text/html");return N(o,t(o,e),n)}catch(e){}const i=e.getData("text/plain")||e.getData("text/uri-list");if(null!=i)if(a(n)){const e=i.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const o=e[t];"\n"===o||"\r\n"===o?n.insertParagraph():"\t"===o?n.insertNodes([c()]):n.insertText(o)}}else n.insertRawText(i)}function N(e,t,n){e.dispatchCommand(s,{nodes:t,selection:n})||n.insertNodes(t)}function S(e,t,n,r=[]){let i=null===t||n.isSelected(t);const a=x(n)&&n.excludeFromCopy("html");let c=n;if(null!==t){let e=o(n);e=f(e)&&null!==t?l(t,e):e,c=e}const s=x(c)?c.getChildren():[],u=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&g(58,n.name),x(e)){const e=t.children;Array.isArray(e)||g(59,n.name)}return t}(c);if(f(c)){const e=c.__text;e.length>0?u.text=e:i=!1}for(let o=0;o<s.length;o++){const l=s[o],r=S(e,t,l,u.children);!i&&x(n)&&r&&n.extractWithChild(l,t,"clone")&&(i=!0)}if(i&&!a)r.push(u);else if(Array.isArray(u.children))for(let e=0;e<u.children.length;e++){const t=u.children[e];r.push(t)}return i}function T(e,t){const n=[],o=u().getChildren();for(let l=0;l<o.length;l++){S(e,t,o[l],n)}return{namespace:e._config.namespace,nodes:n}}function _(e){const t=[];for(let o=0;o<e.length;o++){const l=e[o],r=d(l);f(r)&&n(r),t.push(r)}return t}let A=null;async function R(e,t){if(null!==A)return!1;if(null!==t)return new Promise(((n,o)=>{e.update((()=>{n(P(e,t))}))}));const n=e.getRootElement(),o=null==e._window?window.document:e._window.document,l=y(e._window);if(null===n||null===l)return!1;const i=o.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(o.createTextNode("#")),n.append(i);const a=new Range;return a.setStart(i,0),a.setEnd(i,1),l.removeAllRanges(),l.addRange(a),new Promise(((t,n)=>{const l=e.registerCommand(p,(n=>(r(n,ClipboardEvent)&&(l(),null!==A&&(window.clearTimeout(A),A=null),t(P(e,n))),!0)),m);A=window.setTimeout((()=>{l(),A=null,t(!1)}),50),o.execCommand("copy"),i.remove()}))}function P(e,t){const n=y(e._window);if(!n)return!1;const o=n.anchorNode,l=n.focusNode;if(null!==o&&null!==l&&!h(e,o,l))return!1;t.preventDefault();const r=t.clipboardData,a=i();if(null===r||null===a)return!1;const c=v(e),s=D(e);let u="";return null!==a&&(u=a.getTextContent()),null!==c&&r.setData("text/html",c),null!==s&&r.setData("application/x-lexical-editor",s),r.setData("text/plain",u),!0}export{T as $generateJSONFromSelectedNodes,_ as $generateNodesFromSerializedNodes,v as $getHtmlContent,D as $getLexicalContent,C as $insertDataTransferForPlainText,E as $insertDataTransferForRichText,N as $insertGeneratedNodes,R as copyToClipboard};
+
+import{$generateHtmlFromNodes as e,$generateNodesFromDOM as t}from"@lexical/html";import{$addNodeStyle as n,$cloneWithProperties as l,$sliceSelectedTextNodeContent as o}from"@lexical/selection";import{objectKlassEquals as r}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as c,$createTabNode as a,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND as s,$getRoot as u,$parseSerializedNode as d,$isTextNode as p,COPY_COMMAND as f,COMMAND_PRIORITY_CRITICAL as m,isSelectionWithinEditor as h,$isElementNode as x}from"lexical";var g=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,y=e=>w?(e||window).getSelection():null;function v(t){const n=i();if(null==n)throw Error("Expected valid LexicalSelection");return c(n)&&n.isCollapsed()||0===n.getNodes().length?"":e(t,n)}function D(e){const t=i();if(null==t)throw Error("Expected valid LexicalSelection");return c(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(S(e,t))}function C(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)}function T(e,n,l,o){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===l._config.namespace&&Array.isArray(e.nodes)){return E(l,R(e.nodes),n)}}catch(e){}if(!(o&&"insertReplacementText"===o.inputType&&e.types.includes("text/plain"))){const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return E(l,t(l,e),n)}catch(e){}}const s=e.getData("text/plain")||e.getData("text/uri-list");if(null!=s)if(c(n)){const e=s.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=i();if(c(n)){const l=e[t];"\n"===l||"\r\n"===l?n.insertParagraph():"\t"===l?n.insertNodes([a()]):n.insertText(l)}}}else n.insertRawText(s)}function E(e,t,n){e.dispatchCommand(s,{nodes:t,selection:n})||n.insertNodes(t)}function N(e,t,n,r=[]){let i=null===t||n.isSelected(t);const c=x(n)&&n.excludeFromCopy("html");let a=n;if(null!==t){let e=l(n);e=p(e)&&null!==t?o(t,e):e,a=e}const s=x(a)?a.getChildren():[],u=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&g(58,n.name),x(e)){const e=t.children;Array.isArray(e)||g(59,n.name)}return t}(a);if(p(a)){const e=a.__text;e.length>0?u.text=e:i=!1}for(let l=0;l<s.length;l++){const o=s[l],r=N(e,t,o,u.children);!i&&x(n)&&r&&n.extractWithChild(o,t,"clone")&&(i=!0)}if(i&&!c)r.push(u);else if(Array.isArray(u.children))for(let e=0;e<u.children.length;e++){const t=u.children[e];r.push(t)}return i}function S(e,t){const n=[],l=u().getChildren();for(let o=0;o<l.length;o++){N(e,t,l[o],n)}return{namespace:e._config.namespace,nodes:n}}function R(e){const t=[];for(let l=0;l<e.length;l++){const o=e[l],r=d(o);p(r)&&n(r),t.push(r)}return t}let _=null;async function A(e,t){if(null!==_)return!1;if(null!==t)return new Promise(((n,l)=>{e.update((()=>{n(P(e,t))}))}));const n=e.getRootElement(),l=null==e._window?window.document:e._window.document,o=y(e._window);if(null===n||null===o)return!1;const i=l.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(l.createTextNode("#")),n.append(i);const c=new Range;return c.setStart(i,0),c.setEnd(i,1),o.removeAllRanges(),o.addRange(c),new Promise(((t,n)=>{const o=e.registerCommand(f,(n=>(r(n,ClipboardEvent)&&(o(),null!==_&&(window.clearTimeout(_),_=null),t(P(e,n))),!0)),m);_=window.setTimeout((()=>{o(),_=null,t(!1)}),50),l.execCommand("copy"),i.remove()}))}function P(e,t){const n=y(e._window);if(!n)return!1;const l=n.anchorNode,o=n.focusNode;if(null!==l&&null!==o&&!h(e,l,o))return!1;t.preventDefault();const r=t.clipboardData,c=i();if(null===r||null===c)return!1;const a=v(e),s=D(e);let u="";return null!==c&&(u=c.getTextContent()),null!==a&&r.setData("text/html",a),null!==s&&r.setData("application/x-lexical-editor",s),r.setData("text/plain",u),!0}export{S as $generateJSONFromSelectedNodes,R as $generateNodesFromSerializedNodes,v as $getHtmlContent,D as $getLexicalContent,C as $insertDataTransferForPlainText,T as $insertDataTransferForRichText,E as $insertGeneratedNodes,A as copyToClipboard};
diff --git a/clipboard.d.ts b/clipboard.d.ts
index 99e2138389b64d298a1330d7b354ba87d2e6f24e..83250a4c2049f94e08bfdfc757e03e8a85a08dd4 100644
--- a/clipboard.d.ts
+++ b/clipboard.d.ts
@@ -44,7 +44,7 @@ export declare function $insertDataTransferForPlainText(dataTransfer: DataTransf
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor): void;
+export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor, event?: InputEvent): void;
/**
* Inserts Lexical nodes into the editor using different strategies depending on
* some simple selection-based heuristics. If you're looking for a generic way to

View File

@@ -0,0 +1,151 @@
diff --git a/LexicalClipboard.dev.js b/LexicalClipboard.dev.js
index 3fad3811aa254c5b1b02e039c0d1f21c2a28562f..78aa3bc5048bb4354339efc558031ec0185163dd 100644
--- a/LexicalClipboard.dev.js
+++ b/LexicalClipboard.dev.js
@@ -30,7 +30,6 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
* LICENSE file in the root directory of this source tree.
*
*/
-
const getDOMSelection = targetWindow => CAN_USE_DOM ? (targetWindow || window).getSelection() : null;
/**
@@ -105,7 +104,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-function $insertDataTransferForRichText(dataTransfer, selection, editor) {
+function $insertDataTransferForRichText(dataTransfer, selection, editor, event) {
const lexicalString = dataTransfer.getData('application/x-lexical-editor');
if (lexicalString) {
try {
@@ -118,15 +117,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
// Fail silently.
}
}
- const htmlString = dataTransfer.getData('text/html');
- if (htmlString) {
- try {
- const parser = new DOMParser();
- const dom = parser.parseFromString(htmlString, 'text/html');
- const nodes = html.$generateNodesFromDOM(editor, dom);
- return $insertGeneratedNodes(editor, nodes, selection);
- } catch (_unused2) {
- // Fail silently.
+ const shouldIgnoreHTML = event && event.inputType === 'insertReplacementText' && dataTransfer.types.includes('text/plain');
+ if (!shouldIgnoreHTML) {
+ const htmlString = dataTransfer.getData('text/html');
+ if (htmlString) {
+ try {
+ const parser = new DOMParser();
+ const dom = parser.parseFromString(htmlString, 'text/html');
+ const nodes = html.$generateNodesFromDOM(editor, dom);
+ return $insertGeneratedNodes(editor, nodes, selection);
+ } catch (_unused2) {
+ // Fail silently.
+ }
}
}
diff --git a/LexicalClipboard.dev.mjs b/LexicalClipboard.dev.mjs
index 9d1054125804bec18b6d2fc3b09386defa7c8be2..ef944d097da9cc4383c38c874a6d1e7c20ab22d0 100644
--- a/LexicalClipboard.dev.mjs
+++ b/LexicalClipboard.dev.mjs
@@ -28,7 +28,6 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
* LICENSE file in the root directory of this source tree.
*
*/
-
const getDOMSelection = targetWindow => CAN_USE_DOM ? (targetWindow || window).getSelection() : null;
/**
@@ -103,7 +102,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-function $insertDataTransferForRichText(dataTransfer, selection, editor) {
+function $insertDataTransferForRichText(dataTransfer, selection, editor, event) {
const lexicalString = dataTransfer.getData('application/x-lexical-editor');
if (lexicalString) {
try {
@@ -116,15 +115,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
// Fail silently.
}
}
- const htmlString = dataTransfer.getData('text/html');
- if (htmlString) {
- try {
- const parser = new DOMParser();
- const dom = parser.parseFromString(htmlString, 'text/html');
- const nodes = $generateNodesFromDOM(editor, dom);
- return $insertGeneratedNodes(editor, nodes, selection);
- } catch (_unused2) {
- // Fail silently.
+ const shouldIgnoreHTML = event && event.inputType === 'insertReplacementText' && dataTransfer.types.includes('text/plain');
+ if (!shouldIgnoreHTML) {
+ const htmlString = dataTransfer.getData('text/html');
+ if (htmlString) {
+ try {
+ const parser = new DOMParser();
+ const dom = parser.parseFromString(htmlString, 'text/html');
+ const nodes = $generateNodesFromDOM(editor, dom);
+ return $insertGeneratedNodes(editor, nodes, selection);
+ } catch (_unused2) {
+ // Fail silently.
+ }
}
}
diff --git a/LexicalClipboard.prod.js b/LexicalClipboard.prod.js
index 38848b4d69dcae7d54a5ab99b8f3cdd9324e413f..7ddc6b87dd2c9c32973f4dc7ae552c8fdb80eeb0 100644
--- a/LexicalClipboard.prod.js
+++ b/LexicalClipboard.prod.js
@@ -6,14 +6,14 @@
*
*/
-'use strict';var f=require("@lexical/html"),m=require("@lexical/selection"),n=require("@lexical/utils"),p=require("lexical"),t;function u(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.");}
-t=u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u["default"]:u;let v="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function w(a){let b=p.$getSelection();null==b&&t(166);return p.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?"":f.$generateHtmlFromNodes(a,b)}
-function x(a){let b=p.$getSelection();null==b&&t(166);return p.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?null:JSON.stringify(y(a,b))}function z(a,b,c){a.dispatchCommand(p.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:b,selection:c})||c.insertNodes(b)}
-function A(a,b,c,d=[]){let e=null!==b?c.isSelected(b):!0,h=p.$isElementNode(c)&&c.excludeFromCopy("html");var g=c;if(null!==b){var k=m.$cloneWithProperties(c);g=k=p.$isTextNode(k)&&null!==b?m.$sliceSelectedTextNodeContent(b,k):k}let q=p.$isElementNode(g)?g.getChildren():[];var l=g;k=l.exportJSON();var r=l.constructor;k.type!==r.getType()&&t(58,r.name);p.$isElementNode(l)&&(Array.isArray(k.children)||t(59,r.name));p.$isTextNode(g)&&(g=g.__text,0<g.length?k.text=g:e=!1);for(g=0;g<q.length;g++)l=q[g],
-r=A(a,b,l,k.children),!e&&p.$isElementNode(c)&&r&&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 y(a,b){let c=[],d=p.$getRoot().getChildren();for(let e=0;e<d.length;e++)A(a,b,d[e],c);return{namespace:a._config.namespace,nodes:c}}function B(a){let b=[];for(let c=0;c<a.length;c++){let d=p.$parseSerializedNode(a[c]);p.$isTextNode(d)&&m.$addNodeStyle(d);b.push(d)}return b}let C=null;
-function D(a,b){var c=v?(a._window||window).getSelection():null;if(!c)return!1;var d=c.anchorNode;c=c.focusNode;if(null!==d&&null!==c&&!p.isSelectionWithinEditor(a,d,c))return!1;b.preventDefault();b=b.clipboardData;d=p.$getSelection();if(null===b||null===d)return!1;c=w(a);a=x(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=y;
-exports.$generateNodesFromSerializedNodes=B;exports.$getHtmlContent=w;exports.$getLexicalContent=x;exports.$insertDataTransferForPlainText=function(a,b){a=a.getData("text/plain")||a.getData("text/uri-list");null!=a&&b.insertRawText(a)};
-exports.$insertDataTransferForRichText=function(a,b,c){var d=a.getData("application/x-lexical-editor");if(d)try{let h=JSON.parse(d);if(h.namespace===c._config.namespace&&Array.isArray(h.nodes)){let g=B(h.nodes);return z(c,g,b)}}catch(h){}if(d=a.getData("text/html"))try{var e=(new DOMParser).parseFromString(d,"text/html");let h=f.$generateNodesFromDOM(c,e);return z(c,h,b)}catch(h){}a=a.getData("text/plain")||a.getData("text/uri-list");if(null!=a)if(p.$isRangeSelection(b))for(b=a.split(/(\r?\n|\t)/),
-""===b[b.length-1]&&b.pop(),a=0;a<b.length;a++)c=p.$getSelection(),p.$isRangeSelection(c)&&(e=b[a],"\n"===e||"\r\n"===e?c.insertParagraph():"\t"===e?c.insertNodes([p.$createTabNode()]):c.insertText(e));else b.insertRawText(a)};exports.$insertGeneratedNodes=z;
-exports.copyToClipboard=async function(a,b){if(null!==C)return!1;if(null!==b)return new Promise(g=>{a.update(()=>{g(D(a,b))})});var c=a.getRootElement();let d=null==a._window?window.document:a._window.document,e=v?(a._window||window).getSelection():null;if(null===c||null===e)return!1;let h=d.createElement("span");h.style.cssText="position: fixed; top: -1000px;";h.append(d.createTextNode("#"));c.append(h);c=new Range;c.setStart(h,0);c.setEnd(h,1);e.removeAllRanges();e.addRange(c);return new Promise(g=>
-{let k=a.registerCommand(p.COPY_COMMAND,q=>{n.objectKlassEquals(q,ClipboardEvent)&&(k(),null!==C&&(window.clearTimeout(C),C=null),g(D(a,q)));return!0},p.COMMAND_PRIORITY_CRITICAL);C=window.setTimeout(()=>{k();C=null;g(!1)},50);d.execCommand("copy");h.remove()})}
+'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();null==b&&t(166);return r.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?"":f.$generateHtmlFromNodes(a,b)}function w(a){let b=r.$getSelection();null==b&&t(166);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,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)};
+exports.$insertDataTransferForRichText=function(a,b,c,e){let g=a.getData("application/x-lexical-editor");if(g)try{let d=JSON.parse(g);if(d.namespace===c._config.namespace&&Array.isArray(d.nodes)){let h=A(d.nodes);return y(c,h,b)}}catch(d){}if(!e||"insertReplacementText"!==e.inputType||!a.types.includes("text/plain"))if(e=a.getData("text/html"))try{var k=(new DOMParser).parseFromString(e,"text/html");let d=f.$generateNodesFromDOM(c,k);return y(c,d,b)}catch(d){}a=a.getData("text/plain")||a.getData("text/uri-list");
+if(null!=a)if(r.$isRangeSelection(b))for(b=a.split(/(\r?\n|\t)/),""===b[b.length-1]&&b.pop(),a=0;a<b.length;a++)c=r.$getSelection(),r.$isRangeSelection(c)&&(k=b[a],"\n"===k||"\r\n"===k?c.insertParagraph():"\t"===k?c.insertNodes([r.$createTabNode()]):c.insertText(k));else b.insertRawText(a)};exports.$insertGeneratedNodes=y;
+exports.copyToClipboard=async function(a,b){if(null!==B)return!1;if(null!==b)return new Promise(d=>{a.update(()=>{d(C(a,b))})});var c=a.getRootElement();let e=null==a._window?window.document:a._window.document,g=u?(a._window||window).getSelection():null;if(null===c||null===g)return!1;let k=e.createElement("span");k.style.cssText="position: fixed; top: -1000px;";k.append(e.createTextNode("#"));c.append(k);c=new Range;c.setStart(k,0);c.setEnd(k,1);g.removeAllRanges();g.addRange(c);return new Promise(d=>
+{let h=a.registerCommand(r.COPY_COMMAND,n=>{q.objectKlassEquals(n,ClipboardEvent)&&(h(),null!==B&&(window.clearTimeout(B),B=null),d(C(a,n)));return!0},r.COMMAND_PRIORITY_CRITICAL);B=window.setTimeout(()=>{h();B=null;d(!1)},50);e.execCommand("copy");k.remove()})}
diff --git a/LexicalClipboard.prod.mjs b/LexicalClipboard.prod.mjs
index 6b572db295155b182e3077f64b308cbbf993e241..32076e8a14b02d37e0a8302e51920f13dc211180 100644
--- a/LexicalClipboard.prod.mjs
+++ b/LexicalClipboard.prod.mjs
@@ -6,4 +6,4 @@
*
*/
-import{$generateHtmlFromNodes as t,$generateNodesFromDOM as e}from"@lexical/html";import{$addNodeStyle as n,$cloneWithProperties as o,$sliceSelectedTextNodeContent as l}from"@lexical/selection";import{objectKlassEquals as r}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as s,$createTabNode as a,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND as c,$getRoot as u,$parseSerializedNode as d,$isTextNode as f,COPY_COMMAND as p,COMMAND_PRIORITY_CRITICAL as m,isSelectionWithinEditor as h,$isElementNode as g}from"lexical";function x(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var w=x((function(t){const e=new URLSearchParams;e.append("code",t);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const y="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,v=t=>y?(t||window).getSelection():null;function D(e){const n=i();return null==n&&w(166),s(n)&&n.isCollapsed()||0===n.getNodes().length?"":t(e,n)}function C(t){const e=i();return null==e&&w(166),s(e)&&e.isCollapsed()||0===e.getNodes().length?null:JSON.stringify(A(t,e))}function N(t,e){const n=t.getData("text/plain")||t.getData("text/uri-list");null!=n&&e.insertRawText(n)}function _(t,n,o){const l=t.getData("application/x-lexical-editor");if(l)try{const t=JSON.parse(l);if(t.namespace===o._config.namespace&&Array.isArray(t.nodes)){return T(o,R(t.nodes),n)}}catch(t){}const r=t.getData("text/html");if(r)try{const t=(new DOMParser).parseFromString(r,"text/html");return T(o,e(o,t),n)}catch(t){}const c=t.getData("text/plain")||t.getData("text/uri-list");if(null!=c)if(s(n)){const t=c.split(/(\r?\n|\t)/);""===t[t.length-1]&&t.pop();for(let e=0;e<t.length;e++){const n=i();if(s(n)){const o=t[e];"\n"===o||"\r\n"===o?n.insertParagraph():"\t"===o?n.insertNodes([a()]):n.insertText(o)}}}else n.insertRawText(c)}function T(t,e,n){t.dispatchCommand(c,{nodes:e,selection:n})||n.insertNodes(e)}function S(t,e,n,r=[]){let i=null===e||n.isSelected(e);const s=g(n)&&n.excludeFromCopy("html");let a=n;if(null!==e){let t=o(n);t=f(t)&&null!==e?l(e,t):t,a=t}const c=g(a)?a.getChildren():[],u=function(t){const e=t.exportJSON(),n=t.constructor;if(e.type!==n.getType()&&w(58,n.name),g(t)){const t=e.children;Array.isArray(t)||w(59,n.name)}return e}(a);if(f(a)){const t=a.__text;t.length>0?u.text=t:i=!1}for(let o=0;o<c.length;o++){const l=c[o],r=S(t,e,l,u.children);!i&&g(n)&&r&&n.extractWithChild(l,e,"clone")&&(i=!0)}if(i&&!s)r.push(u);else if(Array.isArray(u.children))for(let t=0;t<u.children.length;t++){const e=u.children[t];r.push(e)}return i}function A(t,e){const n=[],o=u().getChildren();for(let l=0;l<o.length;l++){S(t,e,o[l],n)}return{namespace:t._config.namespace,nodes:n}}function R(t){const e=[];for(let o=0;o<t.length;o++){const l=t[o],r=d(l);f(r)&&n(r),e.push(r)}return e}let E=null;async function O(t,e){if(null!==E)return!1;if(null!==e)return new Promise(((n,o)=>{t.update((()=>{n(P(t,e))}))}));const n=t.getRootElement(),o=null==t._window?window.document:t._window.document,l=v(t._window);if(null===n||null===l)return!1;const i=o.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(o.createTextNode("#")),n.append(i);const s=new Range;return s.setStart(i,0),s.setEnd(i,1),l.removeAllRanges(),l.addRange(s),new Promise(((e,n)=>{const l=t.registerCommand(p,(n=>(r(n,ClipboardEvent)&&(l(),null!==E&&(window.clearTimeout(E),E=null),e(P(t,n))),!0)),m);E=window.setTimeout((()=>{l(),E=null,e(!1)}),50),o.execCommand("copy"),i.remove()}))}function P(t,e){const n=v(t._window);if(!n)return!1;const o=n.anchorNode,l=n.focusNode;if(null!==o&&null!==l&&!h(t,o,l))return!1;e.preventDefault();const r=e.clipboardData,s=i();if(null===r||null===s)return!1;const a=D(t),c=C(t);let u="";return null!==s&&(u=s.getTextContent()),null!==a&&r.setData("text/html",a),null!==c&&r.setData("application/x-lexical-editor",c),r.setData("text/plain",u),!0}export{A as $generateJSONFromSelectedNodes,R as $generateNodesFromSerializedNodes,D as $getHtmlContent,C as $getLexicalContent,N as $insertDataTransferForPlainText,_ as $insertDataTransferForRichText,T as $insertGeneratedNodes,O as copyToClipboard};
+import{$generateHtmlFromNodes as e,$generateNodesFromDOM as t}from"@lexical/html";import{$addNodeStyle as n,$cloneWithProperties as l,$sliceSelectedTextNodeContent as o}from"@lexical/selection";import{objectKlassEquals as r}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as s,$createTabNode as a,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND as c,$getRoot as u,$parseSerializedNode as d,$isTextNode as p,COPY_COMMAND as f,COMMAND_PRIORITY_CRITICAL as m,isSelectionWithinEditor as h,$isElementNode as g}from"lexical";var x=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const w="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,y=e=>w?(e||window).getSelection():null;function v(t){const n=i();return null==n&&x(166),s(n)&&n.isCollapsed()||0===n.getNodes().length?"":e(t,n)}function D(e){const t=i();return null==t&&x(166),s(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(S(e,t))}function C(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)}function T(e,n,l,o){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===l._config.namespace&&Array.isArray(e.nodes)){return N(l,_(e.nodes),n)}}catch(e){}if(!(o&&"insertReplacementText"===o.inputType&&e.types.includes("text/plain"))){const o=e.getData("text/html");if(o)try{const e=(new DOMParser).parseFromString(o,"text/html");return N(l,t(l,e),n)}catch(e){}}const c=e.getData("text/plain")||e.getData("text/uri-list");if(null!=c)if(s(n)){const e=c.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=i();if(s(n)){const l=e[t];"\n"===l||"\r\n"===l?n.insertParagraph():"\t"===l?n.insertNodes([a()]):n.insertText(l)}}}else n.insertRawText(c)}function N(e,t,n){e.dispatchCommand(c,{nodes:t,selection:n})||n.insertNodes(t)}function R(e,t,n,r=[]){let i=null===t||n.isSelected(t);const s=g(n)&&n.excludeFromCopy("html");let a=n;if(null!==t){let e=l(n);e=p(e)&&null!==t?o(t,e):e,a=e}const c=g(a)?a.getChildren():[],u=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&x(58,n.name),g(e)){const e=t.children;Array.isArray(e)||x(59,n.name)}return t}(a);if(p(a)){const e=a.__text;e.length>0?u.text=e:i=!1}for(let l=0;l<c.length;l++){const o=c[l],r=R(e,t,o,u.children);!i&&g(n)&&r&&n.extractWithChild(o,t,"clone")&&(i=!0)}if(i&&!s)r.push(u);else if(Array.isArray(u.children))for(let e=0;e<u.children.length;e++){const t=u.children[e];r.push(t)}return i}function S(e,t){const n=[],l=u().getChildren();for(let o=0;o<l.length;o++){R(e,t,l[o],n)}return{namespace:e._config.namespace,nodes:n}}function _(e){const t=[];for(let l=0;l<e.length;l++){const o=e[l],r=d(o);p(r)&&n(r),t.push(r)}return t}let A=null;async function E(e,t){if(null!==A)return!1;if(null!==t)return new Promise(((n,l)=>{e.update((()=>{n(P(e,t))}))}));const n=e.getRootElement(),l=null==e._window?window.document:e._window.document,o=y(e._window);if(null===n||null===o)return!1;const i=l.createElement("span");i.style.cssText="position: fixed; top: -1000px;",i.append(l.createTextNode("#")),n.append(i);const s=new Range;return s.setStart(i,0),s.setEnd(i,1),o.removeAllRanges(),o.addRange(s),new Promise(((t,n)=>{const o=e.registerCommand(f,(n=>(r(n,ClipboardEvent)&&(o(),null!==A&&(window.clearTimeout(A),A=null),t(P(e,n))),!0)),m);A=window.setTimeout((()=>{o(),A=null,t(!1)}),50),l.execCommand("copy"),i.remove()}))}function P(e,t){const n=y(e._window);if(!n)return!1;const l=n.anchorNode,o=n.focusNode;if(null!==l&&null!==o&&!h(e,l,o))return!1;t.preventDefault();const r=t.clipboardData,s=i();if(null===r||null===s)return!1;const a=v(e),c=D(e);let u="";return null!==s&&(u=s.getTextContent()),null!==a&&r.setData("text/html",a),null!==c&&r.setData("application/x-lexical-editor",c),r.setData("text/plain",u),!0}export{S as $generateJSONFromSelectedNodes,_ as $generateNodesFromSerializedNodes,v as $getHtmlContent,D as $getLexicalContent,C as $insertDataTransferForPlainText,T as $insertDataTransferForRichText,N as $insertGeneratedNodes,E as copyToClipboard};
diff --git a/clipboard.d.ts b/clipboard.d.ts
index 99e2138389b64d298a1330d7b354ba87d2e6f24e..83250a4c2049f94e08bfdfc757e03e8a85a08dd4 100644
--- a/clipboard.d.ts
+++ b/clipboard.d.ts
@@ -44,7 +44,7 @@ export declare function $insertDataTransferForPlainText(dataTransfer: DataTransf
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor): void;
+export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor, event?: InputEvent): void;
/**
* Inserts Lexical nodes into the editor using different strategies depending on
* some simple selection-based heuristics. If you're looking for a generic way to

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -44,9 +44,9 @@
"@types/react-native-vector-icons/@types/react": "17.0.2", "@types/react-native-vector-icons/@types/react": "17.0.2",
"@types/react-native/@types/react": "17.0.2", "@types/react-native/@types/react": "17.0.2",
"@types/hoist-non-react-statics/@types/react": "17.0.2", "@types/hoist-non-react-statics/@types/react": "17.0.2",
"@lexical/clipboard@0.14.5": "patch:@lexical/clipboard@npm:0.14.5#.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch", "@lexical/clipboard@0.16.0": "patch:@lexical/clipboard@npm:0.16.0#.yarn/patches/@lexical-clipboard-npm-0.16.0-3053c4af9c.patch",
"@lexical/rich-text@0.14.5": "patch:@lexical/rich-text@npm:0.14.5#.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch", "@lexical/rich-text@0.16.0": "patch:@lexical/rich-text@npm:0.16.0#.yarn/patches/@lexical-rich-text-npm-0.16.0-f484a17832.patch",
"@lexical/list@0.14.5": "patch:@lexical/list@npm:0.14.5#.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch" "@lexical/list@0.16.0": "patch:@lexical/list@npm:0.16.0#.yarn/patches/@lexical-list-npm-0.16.0-8f91da4ad5.patch"
}, },
"dependencies": { "dependencies": {
"@standardnotes/snjs": "workspace:*" "@standardnotes/snjs": "workspace:*"

View File

@@ -107,17 +107,17 @@
}, },
"dependencies": { "dependencies": {
"@ariakit/react": "^0.3.9", "@ariakit/react": "^0.3.9",
"@lexical/clipboard": "0.14.5", "@lexical/clipboard": "0.16.0",
"@lexical/headless": "0.14.5", "@lexical/headless": "0.16.0",
"@lexical/link": "0.14.5", "@lexical/link": "0.16.0",
"@lexical/list": "0.14.5", "@lexical/list": "0.16.0",
"@lexical/react": "0.14.5", "@lexical/react": "0.16.0",
"@lexical/rich-text": "0.14.5", "@lexical/rich-text": "0.16.0",
"@lexical/utils": "0.14.5", "@lexical/utils": "0.16.0",
"@radix-ui/react-slot": "^1.0.1", "@radix-ui/react-slot": "^1.0.1",
"@react-pdf/renderer": "^3.3.2", "@react-pdf/renderer": "^3.3.2",
"comlink": "^4.4.1", "comlink": "^4.4.1",
"fast-diff": "^1.3.0", "fast-diff": "^1.3.0",
"lexical": "0.14.5" "lexical": "0.16.0"
} }
} }

394
yarn.lock
View File

@@ -3902,298 +3902,298 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/clipboard@npm:0.14.5": "@lexical/clipboard@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/clipboard@npm:0.14.5" resolution: "@lexical/clipboard@npm:0.16.0"
dependencies: dependencies:
"@lexical/html": 0.14.5 "@lexical/html": 0.16.0
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 9fb6db51a0471c3a78bcbcdfa1561f18d03358002bd8b4ef3d6898f50d9f0b4e552ffc8c78551829be50d537c7798e28706c3688cc7549b92ce998973a114b86 checksum: 8fe5cf11a1ad84d4da39205610cb2969046455a0dc0b33d4de748abc9fe9904c2381ce85c495f2b9c85233548d7223270eec030619f3455bb911d6767a3516f2
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/clipboard@patch:@lexical/clipboard@npm:0.14.5#.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.": "@lexical/clipboard@patch:@lexical/clipboard@npm:0.16.0#.yarn/patches/@lexical-clipboard-npm-0.16.0-3053c4af9c.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/clipboard@patch:@lexical/clipboard@npm%3A0.14.5#.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch::version=0.14.5&hash=f7f0fd&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A." resolution: "@lexical/clipboard@patch:@lexical/clipboard@npm%3A0.16.0#.yarn/patches/@lexical-clipboard-npm-0.16.0-3053c4af9c.patch::version=0.16.0&hash=ef7a9a&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
dependencies: dependencies:
"@lexical/html": 0.14.5 "@lexical/html": 0.16.0
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 05ae231a22f032c15506c87cdeed100f504a907853ea14dce4a7e3eac84fdde733db652fbf05610dffdfb79f44bada34253b90866965aee693e9296311fb38ac checksum: 4bfeeaef9a31d15bfa35bc58d4508ec19eeb3a8c68f88a5d1eb69bcba007fca934c0cd278d3b10adf754b0b9370a0aa16e48d31f26fa3a7d7a95bfa736f0417c
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/code@npm:0.14.5": "@lexical/code@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/code@npm:0.14.5" resolution: "@lexical/code@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
prismjs: ^1.27.0 prismjs: ^1.27.0
checksum: fc91f46c0570c54ac943ac88f91094b157f3f6fb4efc2e07184c3679a63b7482655201d7d4fee4f45b4507be4329075e38fa332a6b1d050ced3323c0ef2b63fb checksum: 4f6283beca15df5b9520f2245803f7e34fc4297fbaafd790371d44a590a8ba33107515f63a8db281191280d85b170c7eca3fc151eec5929b3b5a212cc5255ecf
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/devtools-core@npm:0.14.5": "@lexical/devtools-core@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/devtools-core@npm:0.14.5" resolution: "@lexical/devtools-core@npm:0.16.0"
dependencies: dependencies:
"@lexical/html": 0.14.5 "@lexical/html": 0.16.0
"@lexical/link": 0.14.5 "@lexical/link": 0.16.0
"@lexical/mark": 0.14.5 "@lexical/mark": 0.16.0
"@lexical/table": 0.14.5 "@lexical/table": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
peerDependencies: peerDependencies:
react: ">=17.x" react: ">=17.x"
react-dom: ">=17.x" react-dom: ">=17.x"
checksum: 1461941156b632e34c79b51bada748d19cd7be7d2ec562c744c12548fd24c9d1041a25f9a8eedda957a9da75d39d1967cbf7bc6b79c2af0919622a87c26ac8bc checksum: c6ba99da01c2bef29537e0c3f39f0e6c91a6c091239b96048ae9cba5d9911edac9906f053430e17599608d9d01721efbeca00471dfb8ce7878492f767105e056
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/dragon@npm:0.14.5": "@lexical/dragon@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/dragon@npm:0.14.5" resolution: "@lexical/dragon@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: 9e4b2d8f824476c4bab02ed2510b7466f09633e18c7da79507f3d9291f556c7223eac2f023049b33ab9b2d37f72202f7a816efbedce51493faaf42799b9a2fcd checksum: 8f6fa617559bdf204da8509d545e34f78d19c8268a8335bf7e62621f053f88e328521879cf60e8e6eab85d7580681b09ed90dc77a6088aaac32d0f62f860f1dd
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/hashtag@npm:0.14.5": "@lexical/hashtag@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/hashtag@npm:0.14.5" resolution: "@lexical/hashtag@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 22303fb67947ebfb73de22b79afed80e39cfc6bdd6c29a8c5eaf9bf2004f5bb036aa02f1e42587137a86c3336af3d33493ff1a4b870fa49a5761457802cabe78 checksum: a569b35a89708d6291c072ac91dbf69b759383862633fc1d8f2322ebdec9b4200f8f5a3c30f46f58963c80290ba3182da8d44d468f352760b85e00e760db2753
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/headless@npm:0.14.5": "@lexical/headless@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/headless@npm:0.14.5" resolution: "@lexical/headless@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: d7bbbeaed2789c724ad2978a71704d6b449d7965728d9ea9eb1da84b6a8a357f17cd7842bfbde96ef9c0acd9c1b49f16422c1249d70d5734b9ec8862ed9cc78d checksum: 6a03375495e839965b52d2d5980ffd821dd9f72acfb8793df74db2fed424cb9e9cd787d76684112651efdaa9c1af6feae4674dbb79b67edcd7b37331f67880b1
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/history@npm:0.14.5": "@lexical/history@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/history@npm:0.14.5" resolution: "@lexical/history@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 6cc9672c04ab5c2c2fc4d52f002ad5a2b5b7d82c0bc2e1d9a07c7acdd60c74360e84404fccada919ec78a0fe66f5e74918aaf89c995fc6c88333be6d8fbce05e checksum: a26311ddcc2a283eb069abd4fc6963d3401b57e618bfdb061a7f36b376a04af32223b3d63575185cf7e38de34416efe4e184979f42a4a71395ffad54e5337cf0
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/html@npm:0.14.5": "@lexical/html@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/html@npm:0.14.5" resolution: "@lexical/html@npm:0.16.0"
dependencies: dependencies:
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: f28e3f8f260f5a0ad30c4e80f691729006e19b9a87da87647f19f1fe9a39597b28cef693a1f1ddb409ded6c2cdabaa01eec74443329c836282ffcb3e8206f4ea checksum: 3b3ffa982318a46bfa189805352dda6e3139b10c2b9e4242efce98037bbb26eeb7656bd169b5e2666503cd91cdf93ac7e154f10905eb9cffa4a092b11e0811d9
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/link@npm:0.14.5": "@lexical/link@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/link@npm:0.14.5" resolution: "@lexical/link@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 674bd80c218033549b0b4d0151b7df05a7269bb2b80ce8c0e6251b59db5ae67bbfb996698f2520c54756c4c6c2027db364f6ee2dbde9be0ed111cfe6662d9525 checksum: 2b2900001a97bf22550f0141dea358bbb7fe1b59bffe7506afd5e834ec722371de4d62b9e9899a4a960d3d85369bfe3faf5ba79367640b9e45b7bcff46bf1409
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/list@npm:0.14.5": "@lexical/list@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/list@npm:0.14.5" resolution: "@lexical/list@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 971b7876372f42dbc65871c6eb5c1e769986d24cc1b48dad89917df1c02894d72bbbfe8d42166f4d8731d0ecdca38d65f7084980482001cffc346bf419c2f3ef checksum: f60fd40d03b276624b67371498f42cd70fb8ad6971d0c3e396681e8f3c2fc2d9678472912363388c4b7913c93bc526f2400b925dbc3cfcdb61aea06a0af53a0b
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/list@patch:@lexical/list@npm:0.14.5#.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.": "@lexical/list@patch:@lexical/list@npm:0.16.0#.yarn/patches/@lexical-list-npm-0.16.0-8f91da4ad5.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/list@patch:@lexical/list@npm%3A0.14.5#.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch::version=0.14.5&hash=7cd604&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A." resolution: "@lexical/list@patch:@lexical/list@npm%3A0.16.0#.yarn/patches/@lexical-list-npm-0.16.0-8f91da4ad5.patch::version=0.16.0&hash=6af727&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 21350cfcad37510291f115d65262d0e582b6fa237625cd2b6fa91d5296f7ec036b98f0e20a9de6b7a9644f5faa306c1cebb28b91c128e89828299cced7094e5f checksum: bb546181595b39180ce4b733f36ea34adf1b6f89cdee1ffd74b4ece4b299e9ef51a0b269e8eb90dcbff10b78f2f3ddd333d611a7c91defe218f2b717cf9ca93b
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/mark@npm:0.14.5": "@lexical/mark@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/mark@npm:0.14.5" resolution: "@lexical/mark@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 479b643a2c5137968a5c96cefbaf5920da674519114b7e52e019523cb7684c2241392246053e7b0c1791ad2063eae4dceee2118de85456003e71359d0327dd4c checksum: 08067e266d0518bce4aa402e73dc066a6be3af138a4cee76f2255725b2032248bdc4ebd98a85b19923c441853cfde154f12e3b87eae8ae203bca30f0e4d49700
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/markdown@npm:0.14.5": "@lexical/markdown@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/markdown@npm:0.14.5" resolution: "@lexical/markdown@npm:0.16.0"
dependencies: dependencies:
"@lexical/code": 0.14.5 "@lexical/code": 0.16.0
"@lexical/link": 0.14.5 "@lexical/link": 0.16.0
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/rich-text": 0.14.5 "@lexical/rich-text": 0.16.0
"@lexical/text": 0.14.5 "@lexical/text": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 889d877b147ca83e12551afd16f70aa33fe86630ecd33c67e9a1c5de3b24a1807a8c6ff62138f8cf66986339c71e82581ddc85a349063f09642524feb0133b50 checksum: 2d061e4a3b0f8eee0c7975cfff8043601a435aece33c06c0e717a639cf680fa68e3727b95247468cb55d81e1d8970ee8ea8b9348d8bef755b968dc306be19792
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/offset@npm:0.14.5": "@lexical/offset@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/offset@npm:0.14.5" resolution: "@lexical/offset@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: 92d6aa77867c4fb4166dbfba721cdb056d9849c45eb5d61f618934f3549cc4a2d77aa568f64624a10f8cb1bf0c79d7d6fb3dd38596ce78e2282d5e33ac6acdf0 checksum: c6c581be2f084d20aa2b1ef7b0d3deaac9b4550792f9278a35427d493d35d68aaf7ec2eb4357b5defa61c50001928c74199d7867a94670cda648944451bfbfbf
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/overflow@npm:0.14.5": "@lexical/overflow@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/overflow@npm:0.14.5" resolution: "@lexical/overflow@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: ea0b68b47a8463805361a80fd437c3c633b16fb80b91618f6d4e67b203c71f47c4789faa7109f20f3d7296cbec50c5a32b22b90001a3738e4eb98923eeb08593 checksum: 9b659e40537ffd09ab3f8a6ba7e61eb7adddaefb0dd4922d7cb912e2d94c606960a5d8e7737267fc36e95792526cb9b158f3605bedcdade0ce1594895ee0304b
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/plain-text@npm:0.14.5": "@lexical/plain-text@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/plain-text@npm:0.14.5" resolution: "@lexical/plain-text@npm:0.16.0"
dependencies: dependencies:
"@lexical/clipboard": 0.14.5 "@lexical/clipboard": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: b0662a60bbc55824f785e0b976c6030bc60dbade1169b78a1a8d73bd3eb82e3e00e9dacefd0fb1cfe11e830a6b12fed02c8a7717e6a0b0a28c1998d21e2d5391 checksum: 026a745849ed6cc6fe7b68cc1982f1be32fbe56c63a5afd27383f786482438cb38ab7b06d3e2cb8dfd0c689ea92d12ba6be62a453ea52c068e5df57c7489d453
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/react@npm:0.14.5": "@lexical/react@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/react@npm:0.14.5" resolution: "@lexical/react@npm:0.16.0"
dependencies: dependencies:
"@lexical/clipboard": 0.14.5 "@lexical/clipboard": 0.16.0
"@lexical/code": 0.14.5 "@lexical/code": 0.16.0
"@lexical/devtools-core": 0.14.5 "@lexical/devtools-core": 0.16.0
"@lexical/dragon": 0.14.5 "@lexical/dragon": 0.16.0
"@lexical/hashtag": 0.14.5 "@lexical/hashtag": 0.16.0
"@lexical/history": 0.14.5 "@lexical/history": 0.16.0
"@lexical/link": 0.14.5 "@lexical/link": 0.16.0
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/mark": 0.14.5 "@lexical/mark": 0.16.0
"@lexical/markdown": 0.14.5 "@lexical/markdown": 0.16.0
"@lexical/overflow": 0.14.5 "@lexical/overflow": 0.16.0
"@lexical/plain-text": 0.14.5 "@lexical/plain-text": 0.16.0
"@lexical/rich-text": 0.14.5 "@lexical/rich-text": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/table": 0.14.5 "@lexical/table": 0.16.0
"@lexical/text": 0.14.5 "@lexical/text": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
"@lexical/yjs": 0.14.5 "@lexical/yjs": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
react-error-boundary: ^3.1.4 react-error-boundary: ^3.1.4
peerDependencies: peerDependencies:
react: ">=17.x" react: ">=17.x"
react-dom: ">=17.x" react-dom: ">=17.x"
checksum: 12a297e133379f2fe47f5a2b396f17028d7cb1844a7fd1f0f2435b3f2ab1e519b45d51312ca41792c4c8f2853f236141c8a23b50241b9c57cfbeaf5d5fdf5db0 checksum: a58988010f1ae2182b0779280e92086bfe9c36f15baf96d069b1c81da48595579afaf01bbf69ecb3a10fdad01a32eda134bfe5efde31e545711c68516a088018
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/rich-text@npm:0.14.5": "@lexical/rich-text@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/rich-text@npm:0.14.5" resolution: "@lexical/rich-text@npm:0.16.0"
dependencies: dependencies:
"@lexical/clipboard": 0.14.5 "@lexical/clipboard": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: 0cdaacd62b4ff86287c838826ec7a91ac8cec285a8661dc6e1817c5088816865941970a36c971514496b8d7d32078c4ceeb65c3b074c14e48697d714776c406d checksum: 00318a6a7813406e7f1c3fe7509c622ecaeb336c4b3c8bfef428cc7aa4dd5a8af4d2110e4884b6880ea28663b97ab0e8a9b3e9282de3fc7aa4aba910d215431e
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/rich-text@patch:@lexical/rich-text@npm:0.14.5#.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.": "@lexical/rich-text@patch:@lexical/rich-text@npm:0.16.0#.yarn/patches/@lexical-rich-text-npm-0.16.0-f484a17832.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/rich-text@patch:@lexical/rich-text@npm%3A0.14.5#.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch::version=0.14.5&hash=b571ad&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A." resolution: "@lexical/rich-text@patch:@lexical/rich-text@npm%3A0.16.0#.yarn/patches/@lexical-rich-text-npm-0.16.0-f484a17832.patch::version=0.16.0&hash=24f58c&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A."
dependencies: dependencies:
"@lexical/clipboard": 0.14.5 "@lexical/clipboard": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: fa91d3056fcf1b1f6f51222e8b9f469d533d5885716bdbae31a1d763d27d61c41884cc0931bda440c03dc6a4c492e96047c0fde07bfb635c2a80b6a51825468b checksum: fb69c079641d385e4aa5f6568769051837fbd7dac9db264d10dcb95326bd79f94379cda43e157d53d7a01849722bd3ad82f15c7cff5f2fa365d203f41f5ad159
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/selection@npm:0.14.5": "@lexical/selection@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/selection@npm:0.14.5" resolution: "@lexical/selection@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: eb624fd2a0bf09926a0da2e0081c5b5bc29ae8993f84c43cbf45c18daf192c27ff909278408ed622e9741fba96a2dda76bc704fbb6e923925233b198c65f9b80 checksum: fd4832f3b01018b4025706ea86ada3e3dd5a70e2b73722d993fb7e272c3fa2a339e22c914f5fb1836ae077a56daefc6b16dfa77477c56648135ef6ea5ba53f05
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/table@npm:0.14.5": "@lexical/table@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/table@npm:0.14.5" resolution: "@lexical/table@npm:0.16.0"
dependencies: dependencies:
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: a5598595efbb09d538cd233b3fd535aa4d0fe5d4a3cd91e73ebaa846793c0b4aea57f92f8e18cdeecc1fda341b55d59c6d63d095c5062cd4681da1fd43235a75 checksum: 484b6c53dd62aa679f71c9f2b602463de8cf64974a4c6c7052798f1f995b2b8805f2da7a34895fcc73fdaa9938f7a3785ca92a954ba9d79c0c126c496551ad40
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/text@npm:0.14.5": "@lexical/text@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/text@npm:0.14.5" resolution: "@lexical/text@npm:0.16.0"
dependencies: dependencies:
lexical: 0.14.5 lexical: 0.16.0
checksum: aa57dac2bc521d64a7319d76e3f0e69d6f70d2f57fc0f72ed23605484e643017b40c6ec752912b1f90ac2a3fb0f059bce63d85e26118162cd263881932fec044 checksum: 60eadf8d4c037af3a53dfb8c1168949529e02d1a7aaf31876eb9f0a790c4bc9b0c46747535fc03974c6a637e9a6dd0026d556bb0f61e918ad72e811987d08b65
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/utils@npm:0.14.5": "@lexical/utils@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/utils@npm:0.14.5" resolution: "@lexical/utils@npm:0.16.0"
dependencies: dependencies:
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/selection": 0.14.5 "@lexical/selection": 0.16.0
"@lexical/table": 0.14.5 "@lexical/table": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
checksum: d5646a39c3588c78fe1d59fe630cc3583041046a5aa1b79e38903afbd9dfbffdbca10c1ea94613e82ded8379cec2db3b119ef0397b1554cb9acabf1084bdf0fa checksum: b6696b83b9ef7027cd7b117c25e6d6e30266f73b892e72e9718e02190b925c050f51b83aae25782c7abc950b6ef31d89e3c09ae3e37cae82274fcd42c5a60958
languageName: node languageName: node
linkType: hard linkType: hard
"@lexical/yjs@npm:0.14.5": "@lexical/yjs@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "@lexical/yjs@npm:0.14.5" resolution: "@lexical/yjs@npm:0.16.0"
dependencies: dependencies:
"@lexical/offset": 0.14.5 "@lexical/offset": 0.16.0
lexical: 0.14.5 lexical: 0.16.0
peerDependencies: peerDependencies:
yjs: ">=13.5.22" yjs: ">=13.5.22"
checksum: c48406d0dd342b849d1caaf3de772cb2da6e29fea914598b11696c8b62e4f54dcd9c263af5eaa12c0b813546f5bb1690f8d362b6ed3eb515683b129d989b6e20 checksum: 906056977928fa605593ee9fb323e37905960f97b7ef59ae20065f7644b51db72ddb8ef8ae1020c0a0b9bec9c2b18ed276c32ee5f4aabe4bc811cb8be102e9ac
languageName: node languageName: node
linkType: hard linkType: hard
@@ -7877,13 +7877,13 @@ __metadata:
"@babel/plugin-transform-react-jsx": ^7.19.0 "@babel/plugin-transform-react-jsx": ^7.19.0
"@babel/preset-env": "*" "@babel/preset-env": "*"
"@babel/preset-typescript": ^7.21.5 "@babel/preset-typescript": ^7.21.5
"@lexical/clipboard": 0.14.5 "@lexical/clipboard": 0.16.0
"@lexical/headless": 0.14.5 "@lexical/headless": 0.16.0
"@lexical/link": 0.14.5 "@lexical/link": 0.16.0
"@lexical/list": 0.14.5 "@lexical/list": 0.16.0
"@lexical/react": 0.14.5 "@lexical/react": 0.16.0
"@lexical/rich-text": 0.14.5 "@lexical/rich-text": 0.16.0
"@lexical/utils": 0.14.5 "@lexical/utils": 0.16.0
"@pmmmwh/react-refresh-webpack-plugin": ^0.5.10 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.10
"@radix-ui/react-slot": ^1.0.1 "@radix-ui/react-slot": ^1.0.1
"@react-pdf/renderer": ^3.3.2 "@react-pdf/renderer": ^3.3.2
@@ -7935,7 +7935,7 @@ __metadata:
identity-obj-proxy: ^3.0.0 identity-obj-proxy: ^3.0.0
jest: ^29.3.1 jest: ^29.3.1
jest-environment-jsdom: ^29.3.1 jest-environment-jsdom: ^29.3.1
lexical: 0.14.5 lexical: 0.16.0
lint-staged: ">=13" lint-staged: ">=13"
mini-css-extract-plugin: ^2.7.2 mini-css-extract-plugin: ^2.7.2
minimatch: ^5.1.1 minimatch: ^5.1.1
@@ -18882,10 +18882,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"lexical@npm:0.14.5": "lexical@npm:0.16.0":
version: 0.14.5 version: 0.16.0
resolution: "lexical@npm:0.14.5" resolution: "lexical@npm:0.16.0"
checksum: 066fbba86f78045323281861cb1a45b01b61ff6f4076c4c083b82300ace7786cb77694f88e6c91b4ecbc278a0dbab569f17e9f5ac3b03a6015c845781a0567fe checksum: ef43cf65dd30e044f7bbab1e56078b8ebee70a4182e517d1379c190d90174c04550c86921780360ad154fc78ce11cdd859bb0b8824971d072a38e0833166fe18
languageName: node languageName: node
linkType: hard linkType: hard