diff --git a/.yarn/cache/@lexical-clipboard-npm-0.14.3-58877f1e45-4895644d65.zip b/.yarn/cache/@lexical-clipboard-npm-0.14.5-09010c7dc6-9fb6db51a0.zip similarity index 85% rename from .yarn/cache/@lexical-clipboard-npm-0.14.3-58877f1e45-4895644d65.zip rename to .yarn/cache/@lexical-clipboard-npm-0.14.5-09010c7dc6-9fb6db51a0.zip index 683cd3421ba..404a793022c 100644 Binary files a/.yarn/cache/@lexical-clipboard-npm-0.14.3-58877f1e45-4895644d65.zip and b/.yarn/cache/@lexical-clipboard-npm-0.14.5-09010c7dc6-9fb6db51a0.zip differ diff --git a/.yarn/cache/@lexical-clipboard-patch-28c6b1b4e7-05ae231a22.zip b/.yarn/cache/@lexical-clipboard-patch-28c6b1b4e7-05ae231a22.zip new file mode 100644 index 00000000000..1726dac88f0 Binary files /dev/null and b/.yarn/cache/@lexical-clipboard-patch-28c6b1b4e7-05ae231a22.zip differ diff --git a/.yarn/cache/@lexical-clipboard-patch-52c3b31c3e-0f723b5dd1.zip b/.yarn/cache/@lexical-clipboard-patch-52c3b31c3e-0f723b5dd1.zip deleted file mode 100644 index b492b170b1c..00000000000 Binary files a/.yarn/cache/@lexical-clipboard-patch-52c3b31c3e-0f723b5dd1.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-code-npm-0.14.3-39405b7a8b-eb8e6d5770.zip b/.yarn/cache/@lexical-code-npm-0.14.3-39405b7a8b-eb8e6d5770.zip deleted file mode 100644 index 7de0789b340..00000000000 Binary files a/.yarn/cache/@lexical-code-npm-0.14.3-39405b7a8b-eb8e6d5770.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-code-npm-0.14.5-950a4ae248-fc91f46c05.zip b/.yarn/cache/@lexical-code-npm-0.14.5-950a4ae248-fc91f46c05.zip new file mode 100644 index 00000000000..b2214576e96 Binary files /dev/null and b/.yarn/cache/@lexical-code-npm-0.14.5-950a4ae248-fc91f46c05.zip differ diff --git a/.yarn/cache/@lexical-devtools-core-npm-0.14.5-92c74e85c9-1461941156.zip b/.yarn/cache/@lexical-devtools-core-npm-0.14.5-92c74e85c9-1461941156.zip new file mode 100644 index 00000000000..77195ef4a12 Binary files /dev/null and b/.yarn/cache/@lexical-devtools-core-npm-0.14.5-92c74e85c9-1461941156.zip differ diff --git a/.yarn/cache/@lexical-dragon-npm-0.14.3-20ff9f68d0-89c8f29716.zip b/.yarn/cache/@lexical-dragon-npm-0.14.3-20ff9f68d0-89c8f29716.zip deleted file mode 100644 index 610793b2f14..00000000000 Binary files a/.yarn/cache/@lexical-dragon-npm-0.14.3-20ff9f68d0-89c8f29716.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-dragon-npm-0.14.5-682fe8d9d2-9e4b2d8f82.zip b/.yarn/cache/@lexical-dragon-npm-0.14.5-682fe8d9d2-9e4b2d8f82.zip new file mode 100644 index 00000000000..cd2ac92346e Binary files /dev/null and b/.yarn/cache/@lexical-dragon-npm-0.14.5-682fe8d9d2-9e4b2d8f82.zip differ diff --git a/.yarn/cache/@lexical-hashtag-npm-0.14.3-1368436a9b-dd2a702700.zip b/.yarn/cache/@lexical-hashtag-npm-0.14.5-23bf2fd7bf-22303fb679.zip similarity index 82% rename from .yarn/cache/@lexical-hashtag-npm-0.14.3-1368436a9b-dd2a702700.zip rename to .yarn/cache/@lexical-hashtag-npm-0.14.5-23bf2fd7bf-22303fb679.zip index a78e05605f3..d9ec801f25d 100644 Binary files a/.yarn/cache/@lexical-hashtag-npm-0.14.3-1368436a9b-dd2a702700.zip and b/.yarn/cache/@lexical-hashtag-npm-0.14.5-23bf2fd7bf-22303fb679.zip differ diff --git a/.yarn/cache/@lexical-headless-npm-0.14.3-3158a76b2b-e37aca0ed5.zip b/.yarn/cache/@lexical-headless-npm-0.14.3-3158a76b2b-e37aca0ed5.zip deleted file mode 100644 index 01657937040..00000000000 Binary files a/.yarn/cache/@lexical-headless-npm-0.14.3-3158a76b2b-e37aca0ed5.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-headless-npm-0.14.5-c8f57a1ee6-d7bbbeaed2.zip b/.yarn/cache/@lexical-headless-npm-0.14.5-c8f57a1ee6-d7bbbeaed2.zip new file mode 100644 index 00000000000..ed37e11e069 Binary files /dev/null and b/.yarn/cache/@lexical-headless-npm-0.14.5-c8f57a1ee6-d7bbbeaed2.zip differ diff --git a/.yarn/cache/@lexical-history-npm-0.14.3-885fd48550-1209689ab5.zip b/.yarn/cache/@lexical-history-npm-0.14.3-885fd48550-1209689ab5.zip deleted file mode 100644 index 4c49060ae9c..00000000000 Binary files a/.yarn/cache/@lexical-history-npm-0.14.3-885fd48550-1209689ab5.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-history-npm-0.14.5-9c188a5353-6cc9672c04.zip b/.yarn/cache/@lexical-history-npm-0.14.5-9c188a5353-6cc9672c04.zip new file mode 100644 index 00000000000..520ad97f77c Binary files /dev/null and b/.yarn/cache/@lexical-history-npm-0.14.5-9c188a5353-6cc9672c04.zip differ diff --git a/.yarn/cache/@lexical-html-npm-0.14.3-f783a3be2b-ae556dd2bf.zip b/.yarn/cache/@lexical-html-npm-0.14.3-f783a3be2b-ae556dd2bf.zip deleted file mode 100644 index 79569bb9759..00000000000 Binary files a/.yarn/cache/@lexical-html-npm-0.14.3-f783a3be2b-ae556dd2bf.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-html-npm-0.14.5-088d55fa82-f28e3f8f26.zip b/.yarn/cache/@lexical-html-npm-0.14.5-088d55fa82-f28e3f8f26.zip new file mode 100644 index 00000000000..9d50a2a5f1e Binary files /dev/null and b/.yarn/cache/@lexical-html-npm-0.14.5-088d55fa82-f28e3f8f26.zip differ diff --git a/.yarn/cache/@lexical-link-npm-0.14.3-dbb35311d9-25c6d8e3a3.zip b/.yarn/cache/@lexical-link-npm-0.14.3-dbb35311d9-25c6d8e3a3.zip deleted file mode 100644 index def5f7f1e4e..00000000000 Binary files a/.yarn/cache/@lexical-link-npm-0.14.3-dbb35311d9-25c6d8e3a3.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-link-npm-0.14.5-bb6575572d-674bd80c21.zip b/.yarn/cache/@lexical-link-npm-0.14.5-bb6575572d-674bd80c21.zip new file mode 100644 index 00000000000..11c99b3bfae Binary files /dev/null and b/.yarn/cache/@lexical-link-npm-0.14.5-bb6575572d-674bd80c21.zip differ diff --git a/.yarn/cache/@lexical-list-npm-0.14.3-aefc41c62a-fcc6995765.zip b/.yarn/cache/@lexical-list-npm-0.14.5-348640e630-971b787637.zip similarity index 67% rename from .yarn/cache/@lexical-list-npm-0.14.3-aefc41c62a-fcc6995765.zip rename to .yarn/cache/@lexical-list-npm-0.14.5-348640e630-971b787637.zip index 0a97ba4e2a0..e1730feb6c9 100644 Binary files a/.yarn/cache/@lexical-list-npm-0.14.3-aefc41c62a-fcc6995765.zip and b/.yarn/cache/@lexical-list-npm-0.14.5-348640e630-971b787637.zip differ diff --git a/.yarn/cache/@lexical-list-patch-b30ed8e8d1-21350cfcad.zip b/.yarn/cache/@lexical-list-patch-b30ed8e8d1-21350cfcad.zip new file mode 100644 index 00000000000..d66f1b998e4 Binary files /dev/null and b/.yarn/cache/@lexical-list-patch-b30ed8e8d1-21350cfcad.zip differ diff --git a/.yarn/cache/@lexical-mark-npm-0.14.3-948d0f0c7f-b2f358ef22.zip b/.yarn/cache/@lexical-mark-npm-0.14.3-948d0f0c7f-b2f358ef22.zip deleted file mode 100644 index 9c99801cfd1..00000000000 Binary files a/.yarn/cache/@lexical-mark-npm-0.14.3-948d0f0c7f-b2f358ef22.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-mark-npm-0.14.5-111e9445ac-479b643a2c.zip b/.yarn/cache/@lexical-mark-npm-0.14.5-111e9445ac-479b643a2c.zip new file mode 100644 index 00000000000..a6ff53b7595 Binary files /dev/null and b/.yarn/cache/@lexical-mark-npm-0.14.5-111e9445ac-479b643a2c.zip differ diff --git a/.yarn/cache/@lexical-markdown-npm-0.14.3-de9ca2d868-8edda933dd.zip b/.yarn/cache/@lexical-markdown-npm-0.14.5-98457f2ce8-889d877b14.zip similarity index 66% rename from .yarn/cache/@lexical-markdown-npm-0.14.3-de9ca2d868-8edda933dd.zip rename to .yarn/cache/@lexical-markdown-npm-0.14.5-98457f2ce8-889d877b14.zip index ad513dfae2b..b1bd18eb627 100644 Binary files a/.yarn/cache/@lexical-markdown-npm-0.14.3-de9ca2d868-8edda933dd.zip and b/.yarn/cache/@lexical-markdown-npm-0.14.5-98457f2ce8-889d877b14.zip differ diff --git a/.yarn/cache/@lexical-offset-npm-0.14.3-f617f7cfbf-a0bb3f47f8.zip b/.yarn/cache/@lexical-offset-npm-0.14.3-f617f7cfbf-a0bb3f47f8.zip deleted file mode 100644 index 69989dbb93f..00000000000 Binary files a/.yarn/cache/@lexical-offset-npm-0.14.3-f617f7cfbf-a0bb3f47f8.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-offset-npm-0.14.5-85d2f6cbbb-92d6aa7786.zip b/.yarn/cache/@lexical-offset-npm-0.14.5-85d2f6cbbb-92d6aa7786.zip new file mode 100644 index 00000000000..580f00095e7 Binary files /dev/null and b/.yarn/cache/@lexical-offset-npm-0.14.5-85d2f6cbbb-92d6aa7786.zip differ diff --git a/.yarn/cache/@lexical-overflow-npm-0.14.3-2bf415e7e1-2b27058e10.zip b/.yarn/cache/@lexical-overflow-npm-0.14.3-2bf415e7e1-2b27058e10.zip deleted file mode 100644 index 016e75a5884..00000000000 Binary files a/.yarn/cache/@lexical-overflow-npm-0.14.3-2bf415e7e1-2b27058e10.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-overflow-npm-0.14.5-9fc23a7965-ea0b68b47a.zip b/.yarn/cache/@lexical-overflow-npm-0.14.5-9fc23a7965-ea0b68b47a.zip new file mode 100644 index 00000000000..f90711f3cc5 Binary files /dev/null and b/.yarn/cache/@lexical-overflow-npm-0.14.5-9fc23a7965-ea0b68b47a.zip differ diff --git a/.yarn/cache/@lexical-plain-text-npm-0.14.3-99f024f9b9-27e6e26874.zip b/.yarn/cache/@lexical-plain-text-npm-0.14.3-99f024f9b9-27e6e26874.zip deleted file mode 100644 index 5fb9dd0f7d2..00000000000 Binary files a/.yarn/cache/@lexical-plain-text-npm-0.14.3-99f024f9b9-27e6e26874.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-plain-text-npm-0.14.5-ace8cb936f-b0662a60bb.zip b/.yarn/cache/@lexical-plain-text-npm-0.14.5-ace8cb936f-b0662a60bb.zip new file mode 100644 index 00000000000..8f61fefa3d3 Binary files /dev/null and b/.yarn/cache/@lexical-plain-text-npm-0.14.5-ace8cb936f-b0662a60bb.zip differ diff --git a/.yarn/cache/@lexical-react-npm-0.14.3-c4ca2afc94-94f0e1c2a3.zip b/.yarn/cache/@lexical-react-npm-0.14.5-47fc556246-12a297e133.zip similarity index 74% rename from .yarn/cache/@lexical-react-npm-0.14.3-c4ca2afc94-94f0e1c2a3.zip rename to .yarn/cache/@lexical-react-npm-0.14.5-47fc556246-12a297e133.zip index ae80e1b5209..a3a438fa44a 100644 Binary files a/.yarn/cache/@lexical-react-npm-0.14.3-c4ca2afc94-94f0e1c2a3.zip and b/.yarn/cache/@lexical-react-npm-0.14.5-47fc556246-12a297e133.zip differ diff --git a/.yarn/cache/@lexical-rich-text-npm-0.14.3-02ac98ca96-a55a1ee12c.zip b/.yarn/cache/@lexical-rich-text-npm-0.14.3-02ac98ca96-a55a1ee12c.zip deleted file mode 100644 index bbcad087a8f..00000000000 Binary files a/.yarn/cache/@lexical-rich-text-npm-0.14.3-02ac98ca96-a55a1ee12c.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-rich-text-npm-0.14.5-147db14dfa-0cdaacd62b.zip b/.yarn/cache/@lexical-rich-text-npm-0.14.5-147db14dfa-0cdaacd62b.zip new file mode 100644 index 00000000000..6099e0ad947 Binary files /dev/null and b/.yarn/cache/@lexical-rich-text-npm-0.14.5-147db14dfa-0cdaacd62b.zip differ diff --git a/.yarn/cache/@lexical-rich-text-patch-174c44186d-077c3c954f.zip b/.yarn/cache/@lexical-rich-text-patch-174c44186d-077c3c954f.zip deleted file mode 100644 index 91e9fac0215..00000000000 Binary files a/.yarn/cache/@lexical-rich-text-patch-174c44186d-077c3c954f.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-rich-text-patch-b862ce1ffa-fa91d3056f.zip b/.yarn/cache/@lexical-rich-text-patch-b862ce1ffa-fa91d3056f.zip new file mode 100644 index 00000000000..f1a747345a1 Binary files /dev/null and b/.yarn/cache/@lexical-rich-text-patch-b862ce1ffa-fa91d3056f.zip differ diff --git a/.yarn/cache/@lexical-selection-npm-0.14.3-b6c4616508-601cc3225b.zip b/.yarn/cache/@lexical-selection-npm-0.14.3-b6c4616508-601cc3225b.zip deleted file mode 100644 index 6cc11ce9e04..00000000000 Binary files a/.yarn/cache/@lexical-selection-npm-0.14.3-b6c4616508-601cc3225b.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-selection-npm-0.14.5-67319769bd-eb624fd2a0.zip b/.yarn/cache/@lexical-selection-npm-0.14.5-67319769bd-eb624fd2a0.zip new file mode 100644 index 00000000000..bf0cf5fa681 Binary files /dev/null and b/.yarn/cache/@lexical-selection-npm-0.14.5-67319769bd-eb624fd2a0.zip differ diff --git a/.yarn/cache/@lexical-table-npm-0.14.3-2c0d3dcf50-231bc2bffb.zip b/.yarn/cache/@lexical-table-npm-0.14.3-2c0d3dcf50-231bc2bffb.zip deleted file mode 100644 index cc8fed809f3..00000000000 Binary files a/.yarn/cache/@lexical-table-npm-0.14.3-2c0d3dcf50-231bc2bffb.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-table-npm-0.14.5-0426b5e7fd-a5598595ef.zip b/.yarn/cache/@lexical-table-npm-0.14.5-0426b5e7fd-a5598595ef.zip new file mode 100644 index 00000000000..dea5e694293 Binary files /dev/null and b/.yarn/cache/@lexical-table-npm-0.14.5-0426b5e7fd-a5598595ef.zip differ diff --git a/.yarn/cache/@lexical-text-npm-0.14.3-001bd000e7-1bf057ee96.zip b/.yarn/cache/@lexical-text-npm-0.14.5-56de989ed0-aa57dac2bc.zip similarity index 81% rename from .yarn/cache/@lexical-text-npm-0.14.3-001bd000e7-1bf057ee96.zip rename to .yarn/cache/@lexical-text-npm-0.14.5-56de989ed0-aa57dac2bc.zip index e0f5244c635..abfa36e4e42 100644 Binary files a/.yarn/cache/@lexical-text-npm-0.14.3-001bd000e7-1bf057ee96.zip and b/.yarn/cache/@lexical-text-npm-0.14.5-56de989ed0-aa57dac2bc.zip differ diff --git a/.yarn/cache/@lexical-utils-npm-0.14.3-08d1b55bc7-4d9d50e7e3.zip b/.yarn/cache/@lexical-utils-npm-0.14.3-08d1b55bc7-4d9d50e7e3.zip deleted file mode 100644 index 7bb26452f5b..00000000000 Binary files a/.yarn/cache/@lexical-utils-npm-0.14.3-08d1b55bc7-4d9d50e7e3.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-utils-npm-0.14.5-682586df21-d5646a39c3.zip b/.yarn/cache/@lexical-utils-npm-0.14.5-682586df21-d5646a39c3.zip new file mode 100644 index 00000000000..61702004db9 Binary files /dev/null and b/.yarn/cache/@lexical-utils-npm-0.14.5-682586df21-d5646a39c3.zip differ diff --git a/.yarn/cache/@lexical-yjs-npm-0.14.3-ef0aca9723-57cc11dff5.zip b/.yarn/cache/@lexical-yjs-npm-0.14.3-ef0aca9723-57cc11dff5.zip deleted file mode 100644 index c8a3409dd50..00000000000 Binary files a/.yarn/cache/@lexical-yjs-npm-0.14.3-ef0aca9723-57cc11dff5.zip and /dev/null differ diff --git a/.yarn/cache/@lexical-yjs-npm-0.14.5-33bc618c17-c48406d0dd.zip b/.yarn/cache/@lexical-yjs-npm-0.14.5-33bc618c17-c48406d0dd.zip new file mode 100644 index 00000000000..3fe8b40bb32 Binary files /dev/null and b/.yarn/cache/@lexical-yjs-npm-0.14.5-33bc618c17-c48406d0dd.zip differ diff --git a/.yarn/cache/lexical-npm-0.14.3-0c8b16372f-11ddf0eb51.zip b/.yarn/cache/lexical-npm-0.14.3-0c8b16372f-11ddf0eb51.zip deleted file mode 100644 index abdc874d628..00000000000 Binary files a/.yarn/cache/lexical-npm-0.14.3-0c8b16372f-11ddf0eb51.zip and /dev/null differ diff --git a/.yarn/cache/lexical-npm-0.14.5-5c8648c157-066fbba86f.zip b/.yarn/cache/lexical-npm-0.14.5-5c8648c157-066fbba86f.zip new file mode 100644 index 00000000000..94b2a5f7ff0 Binary files /dev/null and b/.yarn/cache/lexical-npm-0.14.5-5c8648c157-066fbba86f.zip differ diff --git a/.yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch b/.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch similarity index 68% rename from .yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch rename to .yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch index 8d6a0f0c1e5..7985d42e7f9 100644 --- a/.yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch +++ b/.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.patch @@ -1,8 +1,18 @@ diff --git a/LexicalClipboard.dev.js b/LexicalClipboard.dev.js -index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..512433f1dac08f8b8bd261315827924020035f85 100644 +index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..78aa3bc5048bb4354339efc558031ec0185163dd 100644 --- a/LexicalClipboard.dev.js +++ b/LexicalClipboard.dev.js -@@ -102,7 +102,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) { +@@ -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. */ @@ -11,7 +21,7 @@ index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..512433f1dac08f8b8bd2613158279240 const lexicalString = dataTransfer.getData('application/x-lexical-editor'); if (lexicalString) { try { -@@ -115,15 +115,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) { +@@ -115,15 +117,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) { // Fail silently. } } @@ -39,11 +49,45 @@ index 9e72de896d52d9c342e520a79b05dbf8fd9bcee3..512433f1dac08f8b8bd2613158279240 } } +@@ -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..d43c3be65b908bc4c6ba1b5c95100fa1739765f7 100644 +index e5b580537bc7b3ce1bd9546f6858988b4f58003f..ef944d097da9cc4383c38c874a6d1e7c20ab22d0 100644 --- a/LexicalClipboard.dev.mjs +++ b/LexicalClipboard.dev.mjs -@@ -100,7 +100,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) { +@@ -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. */ @@ -52,7 +96,7 @@ index e5b580537bc7b3ce1bd9546f6858988b4f58003f..d43c3be65b908bc4c6ba1b5c95100fa1 const lexicalString = dataTransfer.getData('application/x-lexical-editor'); if (lexicalString) { try { -@@ -113,15 +113,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) { +@@ -113,15 +115,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) { // Fail silently. } } @@ -80,11 +124,84 @@ index e5b580537bc7b3ce1bd9546f6858988b4f58003f..d43c3be65b908bc4c6ba1b5c95100fa1 } } +@@ -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..f60bbdf361d44ed078cf9cb403251f8976d665f9 100644 +index 494ab7597d14cfa0386f7bad294c567a8f0110c1..8b3d21203d28eb2be142ad3d7061f2e0cffbdd23 100644 --- a/LexicalClipboard.prod.js +++ b/LexicalClipboard.prod.js -@@ -7,11 +7,11 @@ +@@ -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{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(a=a.split(/(\r?\n|\t)/),""===a[a.length-1]&&a.pop(),c=0;c{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..3c7ab354805312e4b432c7e1f27e8095faf07162 100644 +index e975808a82c8e8bd1b7dc80867ba65bec9a96fa9..48e6331eaa95219007cb3066fbe4a9c73551912e 100644 --- a/LexicalClipboard.prod.mjs +++ b/LexicalClipboard.prod.mjs -@@ -4,4 +4,4 @@ +@@ -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;ew?(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;t0?u.text=e:i=!1}for(let o=0;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 a,$createTabNode as c,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;ew?(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(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 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;t0?u.text=e:i=!1}for(let l=0;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 a=new Range;return a.setStart(i,0),a.setEnd(i,1),o.removeAllRanges(),o.addRange(a),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,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{S as $generateJSONFromSelectedNodes,R as $generateNodesFromSerializedNodes,v as $getHtmlContent,D as $getLexicalContent,C as $insertDataTransferForPlainText,T as $insertDataTransferForRichText,E as $insertGeneratedNodes,A 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;ew?(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;t0?u.text=e:i=!1}for(let l=0;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 diff --git a/.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch b/.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch new file mode 100644 index 00000000000..1707de632fd --- /dev/null +++ b/.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch @@ -0,0 +1,160 @@ +diff --git a/LexicalList.dev.js b/LexicalList.dev.js +index d4c8a5066b96e6ee7c02192e71c714a3a589ec75..2be629bb6e11541208d378c9e0f7cd8223c758f8 100644 +--- a/LexicalList.dev.js ++++ b/LexicalList.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 lexical = require('lexical'); +@@ -168,7 +170,7 @@ function insertList(editor, listType) { + const list = $createListNode(listType); + if (lexical.$isRootOrShadowRoot(anchorNodeParent)) { + anchorNode.replace(list); +- const listItem = $createListItemNode(); ++ const listItem = $createListItemNode(listType === 'check' ? false : undefined); + if (lexical.$isElementNode(anchorNode)) { + listItem.setFormat(anchorNode.getFormatType()); + listItem.setIndent(anchorNode.getIndent()); +@@ -225,7 +227,7 @@ function createListOrMerge(node, listType) { + } + const previousSibling = node.getPreviousSibling(); + const nextSibling = node.getNextSibling(); +- const listItem = $createListItemNode(); ++ const listItem = $createListItemNode(listType === 'check' ? false : undefined); + listItem.setFormat(node.getFormatType()); + listItem.setIndent(node.getIndent()); + append(listItem, node.getChildren()); +diff --git a/LexicalList.dev.mjs b/LexicalList.dev.mjs +index b79963c9b940bb1769b6ebc54c002b7956819d27..d78a526c5317688dd2e0fd77db8e0693ba4c570f 100644 +--- a/LexicalList.dev.mjs ++++ b/LexicalList.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 { $getSelection, $isRangeSelection, $isRootOrShadowRoot, $isElementNode, $isLeafNode, $createParagraphNode, $isParagraphNode, $applyNodeReplacement, ElementNode, $createTextNode, createCommand } from 'lexical'; + import { $getNearestNodeOfType, removeClassNamesFromElement, addClassNamesToElement, isHTMLElement } from '@lexical/utils'; + +@@ -166,7 +168,7 @@ function insertList(editor, listType) { + const list = $createListNode(listType); + if ($isRootOrShadowRoot(anchorNodeParent)) { + anchorNode.replace(list); +- const listItem = $createListItemNode(); ++ const listItem = $createListItemNode(listType === 'check' ? false : undefined); + if ($isElementNode(anchorNode)) { + listItem.setFormat(anchorNode.getFormatType()); + listItem.setIndent(anchorNode.getIndent()); +@@ -223,7 +225,7 @@ function createListOrMerge(node, listType) { + } + const previousSibling = node.getPreviousSibling(); + const nextSibling = node.getNextSibling(); +- const listItem = $createListItemNode(); ++ const listItem = $createListItemNode(listType === 'check' ? false : undefined); + listItem.setFormat(node.getFormatType()); + listItem.setIndent(node.getIndent()); + append(listItem, node.getChildren()); +diff --git a/LexicalList.js b/LexicalList.js +index e02cbb53b19afee910a6f6df62735a912060a1ef..15983e9e88bc47c8c58cb3ad7af31464510e1bb2 100644 +--- a/LexicalList.js ++++ b/LexicalList.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 LexicalList = process.env.NODE_ENV === 'development' ? require('./LexicalList.dev.js') : require('./LexicalList.prod.js'); + module.exports = LexicalList; +\ No newline at end of file +diff --git a/LexicalList.mjs b/LexicalList.mjs +index b6dfed17fee1e984b492dc2a0c669c6380cd7bf2..a1b43af84b8b9b32c22b13785b3c0177fd04b55e 100644 +--- a/LexicalList.mjs ++++ b/LexicalList.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 './LexicalList.dev.mjs'; + import * as modProd from './LexicalList.prod.mjs'; + const mod = process.env.NODE_ENV === 'development' ? modDev : modProd; +diff --git a/LexicalList.node.mjs b/LexicalList.node.mjs +index c337fbe49d002284d8b79a87ed54cc34a05eb216..570de0ade2c2c6b5fe086b082c93b2585cb9b133 100644 +--- a/LexicalList.node.mjs ++++ b/LexicalList.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('./LexicalList.dev.mjs') : import('./LexicalList.prod.mjs')); + export const $createListItemNode = mod.$createListItemNode; + export const $createListNode = mod.$createListNode; +diff --git a/LexicalList.prod.js b/LexicalList.prod.js +index 219fab0b47142543387fe80f802cc1efbcbc3034..efee262e99bde7129ca93b03e98933d3b0011ad9 100644 +--- a/LexicalList.prod.js ++++ b/LexicalList.prod.js +@@ -3,11 +3,13 @@ + * + * 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 g=require("lexical"),h=require("@lexical/utils");function l(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;cf.append(k));d=x();e=D(e);d.append(e);z(e,a.getNextSiblings());c.insertBefore(b);c.insertAfter(d);c.replace(a)}}}} + function G(...a){let b=[];for(let c of a)if(c&&"string"===typeof c)for(let [d]of c.matchAll(/\S+/g))b.push(d);return b} +@@ -22,15 +24,15 @@ else if(q(d)){c=x();let k=D(d.getListType());c.append(k);k.append(this);f?f.inse + function J(a,b,c){let d=[],e=[];var f=(b=b.list)?b.listitem:void 0;if(b&&b.nested)var k=b.nested.listitem;void 0!==f&&d.push(...G(f));if(b){f=c.getParent();f=q(f)&&"check"===f.getListType();let m=c.getChecked();f&&!m||e.push(b.listitemUnchecked);f&&m||e.push(b.listitemChecked);f&&d.push(m?b.listitemChecked:b.listitemUnchecked)}void 0!==k&&(k=G(k),c.getChildren().some(m=>q(m))?d.push(...k):e.push(...k));0{if(!q(a))throw Error("node is not a ListNode");var b=a.getNextSibling();q(b)&&a.getListType()===b.getListType()&&E(a,b);b="check"!==a.getListType();let c=a.getStart();for(let d of a.getChildren())p(d)&&(d.getValue()!==c&&d.setValue(c),b&&null!=d.getChecked()&&d.setChecked(void 0),q(d.getFirstChild())||c++)}}static importDOM(){return{ol:()=> +-({conversion:Q,priority:0}),ul:()=>({conversion:Q,priority:0})}}static importJSON(a){let b=D(a.listType,a.start);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportDOM(a){({element:a}=super.exportDOM(a));a&&h.isHTMLElement(a)&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(), +-tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=0;c{q(a)||l(163);var b=a.getNextSibling();q(b)&&a.getListType()===b.getListType()&&E(a,b);b="check"!==a.getListType();let c=a.getStart();for(let d of a.getChildren())p(d)&&(d.getValue()!==c&&d.setValue(c),b&&null!=d.getChecked()&&d.setChecked(void 0),q(d.getFirstChild())||c++)}}static importDOM(){return{ol:()=>({conversion:Q, ++priority:0}),ul:()=>({conversion:Q,priority:0})}}static importJSON(a){let b=D(a.listType,a.start);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportDOM(a){({element:a}=super.exportDOM(a));a&&h.isHTMLElement(a)&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(), ++type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=0;c{q(e)&&b.push(w(e))})):b.push(w(c))}return b}function Q(a){let b=a.nodeName.toLowerCase(),c=null;"ol"===b?c=D("number",a.start):"ul"===b&&(c=h.isHTMLElement(a)&&"check"===a.getAttribute("__lexicallisttype")?D("check"):D("bullet"));return{after:R,node:c}}let O={ol:"number",ul:"bullet"};function D(a,b=1){return g.$applyNodeReplacement(new L(a,b))} + function q(a){return a instanceof L}let S=g.createCommand("INSERT_UNORDERED_LIST_COMMAND"),T=g.createCommand("INSERT_ORDERED_LIST_COMMAND"),U=g.createCommand("INSERT_CHECK_LIST_COMMAND"),V=g.createCommand("REMOVE_LIST_COMMAND");exports.$createListItemNode=x;exports.$createListNode=D;exports.$getListDepth=n; + exports.$handleListInsertParagraph=function(){var a=g.$getSelection();if(!g.$isRangeSelection(a)||!a.isCollapsed())return!1;a=a.anchor.getNode();if(!p(a)||0!==a.getChildrenSize())return!1;var b=r(a),c=a.getParent();q(c)||l(40);let d=c.getParent(),e;if(g.$isRootOrShadowRoot(d))e=g.$createParagraphNode(),b.insertAfter(e);else if(p(d))e=x(),d.insertAfter(e);else return!1;e.select();b=a.getNextSiblings();if(0{k.remove();f.append(k)})}v(a);return!0};exports.$isListItemNode=p;exports.$isListNode=q;exports.INSERT_CHECK_LIST_COMMAND=U;exports.INSERT_ORDERED_LIST_COMMAND=T;exports.INSERT_UNORDERED_LIST_COMMAND=S;exports.ListItemNode=H;exports.ListNode=L;exports.REMOVE_LIST_COMMAND=V; +-exports.insertList=function(a,b){a.update(()=>{var c=g.$getSelection();if(null!==c){var d=c.getNodes();if(g.$isRangeSelection(c)){c=c.getStartEndPoints();null===c&&l(143);[c]=c;c=c.getNode();var e=c.getParent();if(y(c,d)){d=D(b);g.$isRootOrShadowRoot(e)?(c.replace(d),e=x(),g.$isElementNode(c)&&(e.setFormat(c.getFormatType()),e.setIndent(c.getIndent())),d.append(e)):p(c)&&(c=c.getParentOrThrow(),z(d,c.getChildren()),c.replace(d));return}}c=new Set;for(e=0;e{var c=g.$getSelection();if(null!==c){var d=c.getNodes();if(g.$isRangeSelection(c)){c=c.getStartEndPoints();null===c&&l(143);[c]=c;c=c.getNode();var e=c.getParent();if(y(c,d)){d=D(b);g.$isRootOrShadowRoot(e)?(c.replace(d),e=x("check"===b?!1:void 0),g.$isElementNode(c)&&(e.setFormat(c.getFormatType()),e.setIndent(c.getIndent())),d.append(e)):p(c)&&(c=c.getParentOrThrow(),z(d,c.getChildren()),c.replace(d));return}}c=new Set;for(e=0;e{let b=g.$getSelection();if(g.$isRangeSelection(b)){var c=new Set,d=b.getNodes(),e=b.anchor.getNode();if(y(e,d))c.add(r(e));else for(e=0;e{const s=e();if(null!==s){const e=s.getNodes();if(t(s)){const t=s.getStartEndPoints();null===t&&p(143);const[i]=t,c=i.getNode(),l=c.getParent();if(T(c,e)){const e=J(o);if(n(l)){c.replace(e);const t=D();r(c)&&(t.setFormat(c.getFormatType()),t.setIndent(c.getIndent())),e.append(t)}else if(I(c)){const t=c.getParentOrThrow();S(e,t.getChildren()),t.replace(e)}return}}const c=new Set;for(let t=0;t0&&e.append(...i),t.remove()}function N(n){n.update((()=>{const n=e();if(t(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(T(r,t))e.add(m(r));else for(let n=0;ns.append(e)));const o=D(),c=J(r);o.append(c),S(c,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function O(){const r=e();if(!t(r)||!r.isCollapsed())return!1;const i=r.anchor.getNode();if(!I(i)||0!==i.getChildrenSize())return!1;const c=m(i),l=i.getParent();z(l)||p(40);const h=l.getParent();let a;if(n(h))a=s(),c.insertAfter(a);else{if(!I(h))return!1;a=D(),h.insertAfter(a)}a.select();const u=i.getNextSiblings();if(u.length>0){const e=J(l.getListType());if(o(a))a.insertAfter(e);else{const t=D();t.append(e),a.insertAfter(t)}u.forEach((t=>{t.remove(),e.append(t)}))}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!I(t)&&!z(t))break;t=e}t.remove()}(i),!0}function L(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class E extends l{static getType(){return"listitem"}static clone(e){return new E(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return z(n)&&"check"===n.getListType()&&w(t,this,null),t.value=this.__value,F(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return z(r)&&"check"===r.getListType()&&w(t,this,e),t.value=this.__value,F(t,n.theme,this),!1}static transform(){return e=>{if(I(e)||p(144),null==e.__checked)return;const t=e.getParent();z(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:e=>({conversion:M,priority:0})}}static importJSON(e){const t=D();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(z(n)||p(39),I(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=J(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&y(t)&&y(n)&&(P(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=D(null==this.__checked&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=s();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=I(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;I(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"==typeof e&&e>-1||p(117);let t=this.getIndent();for(;t!==e;)tz(e)))?r.push(...e):i.push(...e)}i.length>0&&g(e,...i),r.length>0&&d(e,...r)}function w(e,t,n,r){z(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function M(e){return{node:D(f(e)&&"true"===e.getAttribute("aria-checked"))}}function D(e){return c(new E(void 0,e))}function I(e){return e instanceof E}class R extends l{static getType(){return"list"}static clone(e){const t=e.__listType||V[e.__tag];return new R(t,e.__start,e.__key)}constructor(e,t,n){super(n);const r=V[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,K(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(K(t,n.theme,this),!1)}static transform(){return e=>{if(!z(e))throw Error("node is not a ListNode");!function(e){const t=e.getNextSibling();z(t)&&e.getListType()===t.getListType()&&P(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())I(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getChecked()&&r.setChecked(void 0),z(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:e=>({conversion:W,priority:0}),ul:e=>({conversion:W,priority:0})}}static importJSON(e){const t=J(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&f(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t1?r.push(...e):i.push(...e)}}i.length>0&&g(e,...i),r.length>0&&d(e,...r)}function B(e){const t=[];for(let n=0;n1&&e.forEach((e=>{z(e)&&t.push(C(e))}))}else t.push(C(r))}return t}function W(e){const t=e.nodeName.toLowerCase();let n=null;if("ol"===t){n=J("number",e.start)}else"ul"===t&&(n=f(e)&&"check"===e.getAttribute("__lexicallisttype")?J("check"):J("bullet"));return{after:B,node:n}}const V={ol:"number",ul:"bullet"};function J(e,t=1){return c(new R(e,t))}function z(e){return e instanceof R}const U=a("INSERT_UNORDERED_LIST_COMMAND"),$=a("INSERT_ORDERED_LIST_COMMAND"),q=a("INSERT_CHECK_LIST_COMMAND"),H=a("REMOVE_LIST_COMMAND");export{D as $createListItemNode,J as $createListNode,_ as $getListDepth,O as $handleListInsertParagraph,I as $isListItemNode,z as $isListNode,q as INSERT_CHECK_LIST_COMMAND,$ as INSERT_ORDERED_LIST_COMMAND,U as INSERT_UNORDERED_LIST_COMMAND,E as ListItemNode,R as ListNode,H as REMOVE_LIST_COMMAND,k as insertList,N as removeList}; ++ ++import{$getSelection as e,$isRangeSelection as t,$isRootOrShadowRoot as n,$isElementNode as r,$isLeafNode as i,$createParagraphNode as s,$isParagraphNode as o,$applyNodeReplacement as c,ElementNode as l,$createTextNode as h,createCommand as a}from"lexical";import{$getNearestNodeOfType as u,removeClassNamesFromElement as g,addClassNamesToElement as d,isHTMLElement as f}from"@lexical/utils";var p=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{const s=e();if(null!==s){const e=s.getNodes();if(t(s)){const t=s.getStartEndPoints();null===t&&p(143);const[i]=t,c=i.getNode(),l=c.getParent();if(T(c,e)){const e=J(o);if(n(l)){c.replace(e);const t=D("check"!==o&&void 0);r(c)&&(t.setFormat(c.getFormatType()),t.setIndent(c.getIndent())),e.append(t)}else if(I(c)){const t=c.getParentOrThrow();S(e,t.getChildren()),t.replace(e)}return}}const c=new Set;for(let t=0;t0&&e.append(...i),t.remove()}function x(n){n.update((()=>{const n=e();if(t(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(T(r,t))e.add(m(r));else for(let n=0;ns.append(e)));const o=D(),c=J(r);o.append(c),S(c,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function O(){const r=e();if(!t(r)||!r.isCollapsed())return!1;const i=r.anchor.getNode();if(!I(i)||0!==i.getChildrenSize())return!1;const c=m(i),l=i.getParent();z(l)||p(40);const h=l.getParent();let a;if(n(h))a=s(),c.insertAfter(a);else{if(!I(h))return!1;a=D(),h.insertAfter(a)}a.select();const u=i.getNextSiblings();if(u.length>0){const e=J(l.getListType());if(o(a))a.insertAfter(e);else{const t=D();t.append(e),a.insertAfter(t)}u.forEach((t=>{t.remove(),e.append(t)}))}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!I(t)&&!z(t))break;t=e}t.remove()}(i),!0}function L(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class E extends l{static getType(){return"listitem"}static clone(e){return new E(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return z(n)&&"check"===n.getListType()&&M(t,this,null),t.value=this.__value,F(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return z(r)&&"check"===r.getListType()&&M(t,this,e),t.value=this.__value,F(t,n.theme,this),!1}static transform(){return e=>{if(I(e)||p(144),null==e.__checked)return;const t=e.getParent();z(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:e=>({conversion:w,priority:0})}}static importJSON(e){const t=D();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(z(n)||p(39),I(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=J(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&y(t)&&y(n)&&(P(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=D(null==this.__checked&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=s();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=I(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;I(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"==typeof e&&e>-1||p(117);let t=this.getIndent();for(;t!==e;)tz(e)))?r.push(...e):i.push(...e)}i.length>0&&g(e,...i),r.length>0&&d(e,...r)}function M(e,t,n,r){z(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function w(e){return{node:D(f(e)&&"true"===e.getAttribute("aria-checked"))}}function D(e){return c(new E(void 0,e))}function I(e){return e instanceof E}class R extends l{static getType(){return"list"}static clone(e){const t=e.__listType||V[e.__tag];return new R(t,e.__start,e.__key)}constructor(e,t,n){super(n);const r=V[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag="number"===e?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,K(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(K(t,n.theme,this),!1)}static transform(){return e=>{z(e)||p(163),function(e){const t=e.getNextSibling();z(t)&&e.getListType()===t.getListType()&&P(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())I(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getChecked()&&r.setChecked(void 0),z(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:e=>({conversion:W,priority:0}),ul:e=>({conversion:W,priority:0})}}static importJSON(e){const t=J(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&f(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t1?r.push(...e):i.push(...e)}}i.length>0&&g(e,...i),r.length>0&&d(e,...r)}function B(e){const t=[];for(let n=0;n1&&e.forEach((e=>{z(e)&&t.push(C(e))}))}else t.push(C(r))}return t}function W(e){const t=e.nodeName.toLowerCase();let n=null;if("ol"===t){n=J("number",e.start)}else"ul"===t&&(n=f(e)&&"check"===e.getAttribute("__lexicallisttype")?J("check"):J("bullet"));return{after:B,node:n}}const V={ol:"number",ul:"bullet"};function J(e,t=1){return c(new R(e,t))}function z(e){return e instanceof R}const U=a("INSERT_UNORDERED_LIST_COMMAND"),$=a("INSERT_ORDERED_LIST_COMMAND"),q=a("INSERT_CHECK_LIST_COMMAND"),H=a("REMOVE_LIST_COMMAND");export{D as $createListItemNode,J as $createListNode,_ as $getListDepth,O as $handleListInsertParagraph,I as $isListItemNode,z as $isListNode,q as INSERT_CHECK_LIST_COMMAND,$ as INSERT_ORDERED_LIST_COMMAND,U as INSERT_UNORDERED_LIST_COMMAND,E as ListItemNode,R as ListNode,H as REMOVE_LIST_COMMAND,k as insertList,x as removeList}; diff --git a/.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch b/.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch deleted file mode 100644 index e95ccd60183..00000000000 --- a/.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/LexicalRichText.dev.js b/LexicalRichText.dev.js -index c8b965525ae365ee3d0fdf877cf349093586b308..0268042f23477fe15b4dab173d01dcee3936d042 100644 ---- a/LexicalRichText.dev.js -+++ b/LexicalRichText.dev.js -@@ -463,7 +463,7 @@ function registerRichText(editor) { - } - const dataTransfer = eventOrText.dataTransfer; - if (dataTransfer != null) { -- clipboard.$insertDataTransferForRichText(dataTransfer, selection, editor); -+ clipboard.$insertDataTransferForRichText(dataTransfer, selection, editor, eventOrText); - } else if (lexical.$isRangeSelection(selection)) { - const data = eventOrText.data; - if (data) { -diff --git a/LexicalRichText.dev.mjs b/LexicalRichText.dev.mjs -index a5e1f61cb837a14913d4fe06c1630cc013ffc21e..f02cc9835d67fc13142263287a156c94d0c8142b 100644 ---- a/LexicalRichText.dev.mjs -+++ b/LexicalRichText.dev.mjs -@@ -461,7 +461,7 @@ function registerRichText(editor) { - } - const dataTransfer = eventOrText.dataTransfer; - if (dataTransfer != null) { -- $insertDataTransferForRichText(dataTransfer, selection, editor); -+ $insertDataTransferForRichText(dataTransfer, selection, editor, eventOrText); - } else if ($isRangeSelection(selection)) { - const data = eventOrText.data; - if (data) { -diff --git a/LexicalRichText.prod.js b/LexicalRichText.prod.js -index 2c24e0de17ab5435322614bd3d34c2583ef368b6..eceaba036cad55f93724c258518937acce045330 100644 ---- a/LexicalRichText.prod.js -+++ b/LexicalRichText.prod.js -@@ -18,7 +18,7 @@ function I(b){let a=null;h.objectKlassEquals(b,DragEvent)?a=b.dataTransfer:h.obj - function J(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m{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)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,()=>J(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>J(a=>{const d=a.getIndent();0{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!K(a.target)){if(a=d.getNodes(),0({conversion:xt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=ht();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){const n=f(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=f();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}}function ht(){return m(new pt)}function vt(t){return t instanceof pt}class Ct extends d{static getType(){return"heading"}static clone(t){return new Ct(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e){return!1}static importDOM(){return{h1:t=>({conversion:Dt,priority:0}),h2:t=>({conversion:Dt,priority:0}),h3:t=>({conversion:Dt,priority:0}),h4:t=>({conversion:Dt,priority:0}),h5:t=>({conversion:Dt,priority:0}),h6:t=>({conversion:Dt,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&yt(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>yt(t)?{conversion:t=>({node:wt("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=wt(t.tag);return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=n!==this.getTextContentSize()&&t?wt(this.getTag()):f(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,e),0===n&&!this.isEmpty()&&t){const t=f();t.select(),this.replace(t,!0)}return r}collapseAtStart(){const t=this.isEmpty()?f():wt(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function yt(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Dt(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=wt(e),null!==t.style&&n.setFormat(t.style.textAlign)),{node:n}}function xt(t){const e=ht();return null!==t.style&&e.setFormat(t.style.textAlign),{node:e}}function wt(t){return m(new Ct(t))}function Et(t){return t instanceof Ct}function Nt(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function At(t){const e=p();if(!C(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e0}function Pt(t){const e=V(t);return K(e)}function Ot(o){return a(o.registerCommand(g,(t=>{const e=p();return!!h(e)&&(e.clear(),!0)}),0),o.registerCommand(v,(t=>{const e=p();return!!C(e)&&(e.deleteCharacter(t),!0)}),y),o.registerCommand(D,(t=>{const e=p();return!!C(e)&&(e.deleteWord(t),!0)}),y),o.registerCommand(x,(t=>{const e=p();return!!C(e)&&(e.deleteLine(t),!0)}),y),o.registerCommand(w,(e=>{const n=p();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o);else if(C(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),y),o.registerCommand(E,(()=>{const t=p();return!!C(t)&&(t.removeText(),!0)}),y),o.registerCommand(N,(t=>{const e=p();return!!C(e)&&(e.formatText(t),!0)}),y),o.registerCommand(A,(t=>{const e=p();if(!C(e)&&!h(e))return!1;const n=e.getNodes();for(const e of n){const n=c(e,(t=>P(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),y),o.registerCommand(O,(t=>{const e=p();return!!C(e)&&(e.insertLineBreak(t),!0)}),y),o.registerCommand(T,(()=>{const t=p();return!!C(t)&&(t.insertParagraph(),!0)}),y),o.registerCommand(I,(()=>(S([_()]),!0)),y),o.registerCommand(F,(()=>At((t=>{const e=t.getIndent();t.setIndent(e+1)}))),y),o.registerCommand(M,(()=>At((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),y),o.registerCommand(b,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(C(e)){const n=k(e.focus,!0);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),y),o.registerCommand(J,(t=>{const e=p();if(h(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(C(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===q().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),y),o.registerCommand(L,(t=>{const e=p();if(h(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!C(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),y),o.registerCommand(R,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!C(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),y),o.registerCommand(z,(t=>{if(Pt(t.target))return!1;const e=p();if(!C(e))return!1;t.preventDefault();const{anchor:n}=e,r=n.getNode();if(e.isCollapsed()&&0===n.offset&&!W(r)){if(u(r).getIndent()>0)return o.dispatchCommand(M,void 0)}return o.dispatchCommand(v,!0)}),y),o.registerCommand(X,(t=>{if(Pt(t.target))return!1;const e=p();return!!C(e)&&(t.preventDefault(),o.dispatchCommand(v,!1))}),y),o.registerCommand(Y,(t=>{const e=p();if(!C(e))return!1;if(null!==t){if((dt||lt||ft)&&ut)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(O,!1)}return o.dispatchCommand(T,void 0)}),y),o.registerCommand(B,(()=>{const t=p();return!!C(t)&&(o.blur(),!0)}),y),o.registerCommand(G,(t=>{const[,e]=Nt(t);if(e.length>0){const n=st(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=V(r);if(null!==i){const e=j();if(H(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Q(e);U(n)}o.dispatchCommand(gt,e)}return t.preventDefault(),!0}const n=p();return!!C(n)}),y),o.registerCommand(Z,(t=>{const[e]=Nt(t),n=p();return!(e&&!C(n))}),y),o.registerCommand($,(t=>{const[e]=Nt(t),n=p();if(e&&!C(n))return!1;const r=st(t.clientX,t.clientY);if(null!==r){const e=V(r.node);K(e)&&t.preventDefault()}return!0}),y),o.registerCommand(tt,(()=>(et(),!0)),y),o.registerCommand(nt,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),y),o.registerCommand(rt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=p();C(t)?t.removeText():h(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),y),o.registerCommand(ot,(e=>{const[,n,r]=Nt(e);if(n.length>0&&!r)return o.dispatchCommand(gt,n),!0;if(it(e.target))return!1;return null!==p()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=p(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:"paste"})}(e,o),!0)}),y))}export{wt as $createHeadingNode,ht as $createQuoteNode,Et as $isHeadingNode,vt as $isQuoteNode,gt as DRAG_DROP_PASTE,Ct as HeadingNode,pt as QuoteNode,Nt as eventFiles,Ot as registerRichText}; -+import{$insertDataTransferForRichText as t,copyToClipboard as e}from"@lexical/clipboard";import{$shouldOverrideDefaultCharacterSelection as n,$moveCharacter as r}from"@lexical/selection";import{addClassNamesToElement as o,isHTMLElement as i,objectKlassEquals as s,mergeRegister as a,$findMatchingParent as c,$getNearestBlockElementAncestorOrThrow as u}from"@lexical/utils";import{createCommand as l,ElementNode as d,$applyNodeReplacement as m,$createParagraphNode as f,CLICK_COMMAND as g,$getSelection as p,$isNodeSelection as h,DELETE_CHARACTER_COMMAND as v,$isRangeSelection as C,COMMAND_PRIORITY_EDITOR as y,DELETE_WORD_COMMAND as D,DELETE_LINE_COMMAND as x,CONTROLLED_TEXT_INSERTION_COMMAND as w,REMOVE_TEXT_COMMAND as E,FORMAT_TEXT_COMMAND as N,FORMAT_ELEMENT_COMMAND as A,$isElementNode as P,INSERT_LINE_BREAK_COMMAND as O,INSERT_PARAGRAPH_COMMAND as T,INSERT_TAB_COMMAND as I,$insertNodes as S,$createTabNode as _,INDENT_CONTENT_COMMAND as F,OUTDENT_CONTENT_COMMAND as M,KEY_ARROW_UP_COMMAND as b,$isDecoratorNode as K,$getAdjacentNode as k,KEY_ARROW_DOWN_COMMAND as J,$getRoot as q,KEY_ARROW_LEFT_COMMAND as L,KEY_ARROW_RIGHT_COMMAND as R,KEY_BACKSPACE_COMMAND as z,$isRootNode as W,KEY_DELETE_COMMAND as X,KEY_ENTER_COMMAND as Y,KEY_ESCAPE_COMMAND as B,DROP_COMMAND as G,$getNearestNodeFromDOMNode as V,$createRangeSelection as j,$isTextNode as H,$normalizeSelection__EXPERIMENTAL as Q,$setSelection as U,DRAGSTART_COMMAND as Z,DRAGOVER_COMMAND as $,SELECT_ALL_COMMAND as tt,$selectAll as et,COPY_COMMAND as nt,CUT_COMMAND as rt,PASTE_COMMAND as ot,isSelectionCapturedInDecoratorInput as it}from"lexical";function st(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const at="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ct=at&&"documentMode"in document?document.documentMode:null;at&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),at&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);const ut=!(!at||!("InputEvent"in window)||ct)&&"getTargetRanges"in new window.InputEvent("input"),lt=at&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),dt=at&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mt=(at&&/Android/.test(navigator.userAgent),at&&/^(?=.*Chrome).*/i.test(navigator.userAgent)),ft=at&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mt,gt=l("DRAG_DROP_PASTE_FILE");class pt extends d{static getType(){return"quote"}static clone(t){return new pt(t.__key)}constructor(t){super(t)}createDOM(t){const e=document.createElement("blockquote");return o(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:xt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=ht();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){const n=f(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=f();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}}function ht(){return m(new pt)}function vt(t){return t instanceof pt}class Ct extends d{static getType(){return"heading"}static clone(t){return new Ct(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e){return!1}static importDOM(){return{h1:t=>({conversion:Dt,priority:0}),h2:t=>({conversion:Dt,priority:0}),h3:t=>({conversion:Dt,priority:0}),h4:t=>({conversion:Dt,priority:0}),h5:t=>({conversion:Dt,priority:0}),h6:t=>({conversion:Dt,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&yt(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>yt(t)?{conversion:t=>({node:wt("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=wt(t.tag);return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=n!==this.getTextContentSize()&&t?wt(this.getTag()):f(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,e),0===n&&!this.isEmpty()&&t){const t=f();t.select(),this.replace(t,!0)}return r}collapseAtStart(){const t=this.isEmpty()?f():wt(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function yt(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Dt(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=wt(e),null!==t.style&&n.setFormat(t.style.textAlign)),{node:n}}function xt(t){const e=ht();return null!==t.style&&e.setFormat(t.style.textAlign),{node:e}}function wt(t){return m(new Ct(t))}function Et(t){return t instanceof Ct}function Nt(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function At(t){const e=p();if(!C(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e0}function Pt(t){const e=V(t);return K(e)}function Ot(o){return a(o.registerCommand(g,(t=>{const e=p();return!!h(e)&&(e.clear(),!0)}),0),o.registerCommand(v,(t=>{const e=p();return!!C(e)&&(e.deleteCharacter(t),!0)}),y),o.registerCommand(D,(t=>{const e=p();return!!C(e)&&(e.deleteWord(t),!0)}),y),o.registerCommand(x,(t=>{const e=p();return!!C(e)&&(e.deleteLine(t),!0)}),y),o.registerCommand(w,(e=>{const n=p();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o,e);else if(C(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),y),o.registerCommand(E,(()=>{const t=p();return!!C(t)&&(t.removeText(),!0)}),y),o.registerCommand(N,(t=>{const e=p();return!!C(e)&&(e.formatText(t),!0)}),y),o.registerCommand(A,(t=>{const e=p();if(!C(e)&&!h(e))return!1;const n=e.getNodes();for(const e of n){const n=c(e,(t=>P(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),y),o.registerCommand(O,(t=>{const e=p();return!!C(e)&&(e.insertLineBreak(t),!0)}),y),o.registerCommand(T,(()=>{const t=p();return!!C(t)&&(t.insertParagraph(),!0)}),y),o.registerCommand(I,(()=>(S([_()]),!0)),y),o.registerCommand(F,(()=>At((t=>{const e=t.getIndent();t.setIndent(e+1)}))),y),o.registerCommand(M,(()=>At((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),y),o.registerCommand(b,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(C(e)){const n=k(e.focus,!0);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),y),o.registerCommand(J,(t=>{const e=p();if(h(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(C(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===q().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),y),o.registerCommand(L,(t=>{const e=p();if(h(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!C(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),y),o.registerCommand(R,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!C(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),y),o.registerCommand(z,(t=>{if(Pt(t.target))return!1;const e=p();if(!C(e))return!1;t.preventDefault();const{anchor:n}=e,r=n.getNode();if(e.isCollapsed()&&0===n.offset&&!W(r)){if(u(r).getIndent()>0)return o.dispatchCommand(M,void 0)}return o.dispatchCommand(v,!0)}),y),o.registerCommand(X,(t=>{if(Pt(t.target))return!1;const e=p();return!!C(e)&&(t.preventDefault(),o.dispatchCommand(v,!1))}),y),o.registerCommand(Y,(t=>{const e=p();if(!C(e))return!1;if(null!==t){if((dt||lt||ft)&&ut)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(O,!1)}return o.dispatchCommand(T,void 0)}),y),o.registerCommand(B,(()=>{const t=p();return!!C(t)&&(o.blur(),!0)}),y),o.registerCommand(G,(t=>{const[,e]=Nt(t);if(e.length>0){const n=st(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=V(r);if(null!==i){const e=j();if(H(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Q(e);U(n)}o.dispatchCommand(gt,e)}return t.preventDefault(),!0}const n=p();return!!C(n)}),y),o.registerCommand(Z,(t=>{const[e]=Nt(t),n=p();return!(e&&!C(n))}),y),o.registerCommand($,(t=>{const[e]=Nt(t),n=p();if(e&&!C(n))return!1;const r=st(t.clientX,t.clientY);if(null!==r){const e=V(r.node);K(e)&&t.preventDefault()}return!0}),y),o.registerCommand(tt,(()=>(et(),!0)),y),o.registerCommand(nt,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),y),o.registerCommand(rt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=p();C(t)?t.removeText():h(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),y),o.registerCommand(ot,(e=>{const[,n,r]=Nt(e);if(n.length>0&&!r)return o.dispatchCommand(gt,n),!0;if(it(e.target))return!1;return null!==p()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=p(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:"paste"})}(e,o),!0)}),y))}export{wt as $createHeadingNode,ht as $createQuoteNode,Et as $isHeadingNode,vt as $isQuoteNode,gt as DRAG_DROP_PASTE,Ct as HeadingNode,pt as QuoteNode,Nt as eventFiles,Ot as registerRichText}; diff --git a/.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch b/.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch new file mode 100644 index 00000000000..0db1ee88f81 --- /dev/null +++ b/.yarn/patches/@lexical-rich-text-npm-0.14.5-147db14dfa.patch @@ -0,0 +1,182 @@ +diff --git a/LexicalRichText.dev.js b/LexicalRichText.dev.js +index a3b5c0e76d59f15704819590692a7dac93d41a37..96089d34908e286703d6c008ba1e2d5a8cb77a5a 100644 +--- a/LexicalRichText.dev.js ++++ b/LexicalRichText.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 clipboard = require('@lexical/clipboard'); +@@ -411,7 +413,10 @@ function handleIndentAndOutdent(indentOrOutdent) { + if (alreadyHandled.has(key)) { + continue; + } +- const parentBlock = utils.$getNearestBlockElementAncestorOrThrow(node); ++ const parentBlock = utils.$findMatchingParent(node, parentNode => lexical.$isElementNode(parentNode) && !parentNode.isInline()); ++ if (parentBlock === null) { ++ continue; ++ } + const parentKey = parentBlock.getKey(); + if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) { + alreadyHandled.add(parentKey); +@@ -469,7 +474,7 @@ function registerRichText(editor) { + } + const dataTransfer = eventOrText.dataTransfer; + if (dataTransfer != null) { +- clipboard.$insertDataTransferForRichText(dataTransfer, selection, editor); ++ clipboard.$insertDataTransferForRichText(dataTransfer, selection, editor, eventOrText); + } else if (lexical.$isRangeSelection(selection)) { + const data = eventOrText.data; + if (data) { +diff --git a/LexicalRichText.dev.mjs b/LexicalRichText.dev.mjs +index 06552f21b6ac4b0758a35da486c5f7b219d701fe..69e9c7321f09e864e76b14dd89cca95fcd99910c 100644 +--- a/LexicalRichText.dev.mjs ++++ b/LexicalRichText.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 { $insertDataTransferForRichText, copyToClipboard } from '@lexical/clipboard'; + import { $shouldOverrideDefaultCharacterSelection, $moveCharacter } from '@lexical/selection'; + import { addClassNamesToElement, isHTMLElement, objectKlassEquals, mergeRegister, $findMatchingParent, $getNearestBlockElementAncestorOrThrow } from '@lexical/utils'; +@@ -409,7 +411,10 @@ function handleIndentAndOutdent(indentOrOutdent) { + if (alreadyHandled.has(key)) { + continue; + } +- const parentBlock = $getNearestBlockElementAncestorOrThrow(node); ++ const parentBlock = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline()); ++ if (parentBlock === null) { ++ continue; ++ } + const parentKey = parentBlock.getKey(); + if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) { + alreadyHandled.add(parentKey); +@@ -467,7 +472,7 @@ function registerRichText(editor) { + } + const dataTransfer = eventOrText.dataTransfer; + if (dataTransfer != null) { +- $insertDataTransferForRichText(dataTransfer, selection, editor); ++ $insertDataTransferForRichText(dataTransfer, selection, editor, eventOrText); + } else if ($isRangeSelection(selection)) { + const data = eventOrText.data; + if (data) { +diff --git a/LexicalRichText.js b/LexicalRichText.js +index 122ed25dc87e94acbd2af57519aee75aae357475..adf85437f4369491d0260b8a20de4ee3d52af214 100644 +--- a/LexicalRichText.js ++++ b/LexicalRichText.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 LexicalRichText = process.env.NODE_ENV === 'development' ? require('./LexicalRichText.dev.js') : require('./LexicalRichText.prod.js'); + module.exports = LexicalRichText; +\ No newline at end of file +diff --git a/LexicalRichText.mjs b/LexicalRichText.mjs +index a662073c786ddee88068585cb780882fa9a54b95..2d88655cd657da5a0d593796e62e3523bd853e8a 100644 +--- a/LexicalRichText.mjs ++++ b/LexicalRichText.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 './LexicalRichText.dev.mjs'; + import * as modProd from './LexicalRichText.prod.mjs'; + const mod = process.env.NODE_ENV === 'development' ? modDev : modProd; +diff --git a/LexicalRichText.node.mjs b/LexicalRichText.node.mjs +index cac1a134ac8633f222f7b36c9e40f495e22d2a85..19516e418bacb5e5ae218d6dd72cd4ef5a714ab8 100644 +--- a/LexicalRichText.node.mjs ++++ b/LexicalRichText.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('./LexicalRichText.dev.mjs') : import('./LexicalRichText.prod.mjs')); + export const $createHeadingNode = mod.$createHeadingNode; + export const $createQuoteNode = mod.$createQuoteNode; +diff --git a/LexicalRichText.prod.js b/LexicalRichText.prod.js +index 2c24e0de17ab5435322614bd3d34c2583ef368b6..db5738ab58ce426bd04a53dc8148c0b34c715ea4 100644 +--- a/LexicalRichText.prod.js ++++ b/LexicalRichText.prod.js +@@ -3,30 +3,32 @@ + * + * 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 c=require("@lexical/clipboard"),g=require("@lexical/selection"),h=require("@lexical/utils"),k=require("lexical");function l(b,a){return"undefined"!==typeof document.caretRangeFromPoint?(b=document.caretRangeFromPoint(b,a),null===b?null:{node:b.startContainer,offset:b.startOffset}):"undefined"!==document.caretPositionFromPoint?(b=document.caretPositionFromPoint(b,a),null===b?null:{node:b.offsetNode,offset:b.offset}):null} + let n="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,p=n&&"documentMode"in document?document.documentMode:null;n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);n&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent); +-let q=n&&"InputEvent"in window&&!p?"getTargetRanges"in new window.InputEvent("input"):!1,r=n&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),t=n&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,u=n&&/Android/.test(navigator.userAgent),v=n&&/^(?=.*Chrome).*/i.test(navigator.userAgent);n&&u&&v;let w=n&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!v,x=k.createCommand("DRAG_DROP_PASTE_FILE"); +-class y extends k.ElementNode{static getType(){return"quote"}static clone(b){return new y(b.__key)}constructor(b){super(b)}createDOM(b){let a=document.createElement("blockquote");h.addClassNamesToElement(a,b.theme.quote);return a}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:z,priority:0})}}exportDOM(b){({element:b}=super.exportDOM(b));if(b&&h.isHTMLElement(b)){this.isEmpty()&&b.append(document.createElement("br"));var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir= +-a}return{element:b}}static importJSON(b){let a=A();a.setFormat(b.format);a.setIndent(b.indent);a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(b,a){b=k.$createParagraphNode();let d=this.getDirection();b.setDirection(d);this.insertAfter(b,a);return b}collapseAtStart(){let b=k.$createParagraphNode();this.getChildren().forEach(a=>b.append(a));this.replace(b);return!0}}function A(){return k.$applyNodeReplacement(new y)} +-class C extends k.ElementNode{static getType(){return"heading"}static clone(b){return new C(b.__tag,b.__key)}constructor(b,a){super(a);this.__tag=b}getTag(){return this.__tag}createDOM(b){let a=this.__tag,d=document.createElement(a);b=b.theme.heading;void 0!==b&&h.addClassNamesToElement(d,b[a]);return d}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:D,priority:0}),h2:()=>({conversion:D,priority:0}),h3:()=>({conversion:D,priority:0}),h4:()=>({conversion:D,priority:0}),h5:()=>({conversion:D, +-priority:0}),h6:()=>({conversion:D,priority:0}),p:b=>{b=b.firstChild;return null!==b&&E(b)?{conversion:()=>({node:null}),priority:3}:null},span:b=>E(b)?{conversion:()=>({node:F("h1")}),priority:3}:null}}exportDOM(b){({element:b}=super.exportDOM(b));if(b&&h.isHTMLElement(b)){this.isEmpty()&&b.append(document.createElement("br"));var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir=a}return{element:b}}static importJSON(b){let a=F(b.tag);a.setFormat(b.format);a.setIndent(b.indent); +-a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(b,a=!0){let d=b?b.anchor.offset:0,e=d!==this.getTextContentSize()&&b?F(this.getTag()):k.$createParagraphNode(),f=this.getDirection();e.setDirection(f);this.insertAfter(e,a);0===d&&!this.isEmpty()&&b&&(b=k.$createParagraphNode(),b.select(),this.replace(b,!0));return e}collapseAtStart(){let b=this.isEmpty()?k.$createParagraphNode():F(this.getTag());this.getChildren().forEach(a=> +-b.append(a));this.replace(b);return!0}extractWithChild(){return!0}}function E(b){return"span"===b.nodeName.toLowerCase()?"26pt"===b.style.fontSize:!1}function D(b){let a=b.nodeName.toLowerCase(),d=null;if("h1"===a||"h2"===a||"h3"===a||"h4"===a||"h5"===a||"h6"===a)d=F(a),null!==b.style&&d.setFormat(b.style.textAlign);return{node:d}}function z(b){let a=A();null!==b.style&&a.setFormat(b.style.textAlign);return{node:a}}function F(b){return k.$applyNodeReplacement(new C(b))} +-function G(b,a){b.preventDefault();a.update(()=>{let d=k.$getSelection(),e=h.objectKlassEquals(b,InputEvent)||h.objectKlassEquals(b,KeyboardEvent)?null:b.clipboardData;null!=e&&null!==d&&c.$insertDataTransferForRichText(e,d,a)},{tag:"paste"})}async function H(b,a){await c.copyToClipboard(a,h.objectKlassEquals(b,ClipboardEvent)?b:null);a.update(()=>{let d=k.$getSelection();k.$isRangeSelection(d)?d.removeText():k.$isNodeSelection(d)&&d.getNodes().forEach(e=>e.remove())})} +-function I(b){let a=null;h.objectKlassEquals(b,DragEvent)?a=b.dataTransfer:h.objectKlassEquals(b,ClipboardEvent)&&(a=b.clipboardData);if(null===a)return[!1,[],!1];var d=a.types;b=d.includes("Files");d=d.includes("text/html")||d.includes("text/plain");return[b,Array.from(a.files),d]} +-function J(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m({conversion:A,priority:0})}}exportDOM(b){({element:b}=super.exportDOM(b));if(b&&h.isHTMLElement(b)){this.isEmpty()&&b.append(document.createElement("br"));var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir= ++a}return{element:b}}static importJSON(b){let a=B();a.setFormat(b.format);a.setIndent(b.indent);a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(b,a){b=k.$createParagraphNode();let d=this.getDirection();b.setDirection(d);this.insertAfter(b,a);return b}collapseAtStart(){let b=k.$createParagraphNode();this.getChildren().forEach(a=>b.append(a));this.replace(b);return!0}}function B(){return k.$applyNodeReplacement(new z)} ++class D extends k.ElementNode{static getType(){return"heading"}static clone(b){return new D(b.__tag,b.__key)}constructor(b,a){super(a);this.__tag=b}getTag(){return this.__tag}createDOM(b){let a=this.__tag,d=document.createElement(a);b=b.theme.heading;void 0!==b&&h.addClassNamesToElement(d,b[a]);return d}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:E,priority:0}),h2:()=>({conversion:E,priority:0}),h3:()=>({conversion:E,priority:0}),h4:()=>({conversion:E,priority:0}),h5:()=>({conversion:E, ++priority:0}),h6:()=>({conversion:E,priority:0}),p:b=>{b=b.firstChild;return null!==b&&F(b)?{conversion:()=>({node:null}),priority:3}:null},span:b=>F(b)?{conversion:()=>({node:G("h1")}),priority:3}:null}}exportDOM(b){({element:b}=super.exportDOM(b));if(b&&h.isHTMLElement(b)){this.isEmpty()&&b.append(document.createElement("br"));var a=this.getFormatType();b.style.textAlign=a;if(a=this.getDirection())b.dir=a}return{element:b}}static importJSON(b){let a=G(b.tag);a.setFormat(b.format);a.setIndent(b.indent); ++a.setDirection(b.direction);return a}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(b,a=!0){let d=b?b.anchor.offset:0,e=d!==this.getTextContentSize()&&b?G(this.getTag()):k.$createParagraphNode(),f=this.getDirection();e.setDirection(f);this.insertAfter(e,a);0===d&&!this.isEmpty()&&b&&(b=k.$createParagraphNode(),b.select(),this.replace(b,!0));return e}collapseAtStart(){let b=this.isEmpty()?k.$createParagraphNode():G(this.getTag());this.getChildren().forEach(a=> ++b.append(a));this.replace(b);return!0}extractWithChild(){return!0}}function F(b){return"span"===b.nodeName.toLowerCase()?"26pt"===b.style.fontSize:!1}function E(b){let a=b.nodeName.toLowerCase(),d=null;if("h1"===a||"h2"===a||"h3"===a||"h4"===a||"h5"===a||"h6"===a)d=G(a),null!==b.style&&d.setFormat(b.style.textAlign);return{node:d}}function A(b){let a=B();null!==b.style&&a.setFormat(b.style.textAlign);return{node:a}}function G(b){return k.$applyNodeReplacement(new D(b))} ++function H(b,a){b.preventDefault();a.update(()=>{let d=k.$getSelection(),e=h.objectKlassEquals(b,InputEvent)||h.objectKlassEquals(b,KeyboardEvent)?null:b.clipboardData;null!=e&&null!==d&&c.$insertDataTransferForRichText(e,d,a)},{tag:"paste"})}async function I(b,a){await c.copyToClipboard(a,h.objectKlassEquals(b,ClipboardEvent)?b:null);a.update(()=>{let d=k.$getSelection();k.$isRangeSelection(d)?d.removeText():k.$isNodeSelection(d)&&d.getNodes().forEach(e=>e.remove())})} ++function J(b){let a=null;h.objectKlassEquals(b,DragEvent)?a=b.dataTransfer:h.objectKlassEquals(b,ClipboardEvent)&&(a=b.clipboardData);if(null===a)return[!1,[],!1];var d=a.types;b=d.includes("Files");d=d.includes("text/html")||d.includes("text/plain");return[b,Array.from(a.files),d]} ++function K(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;mk.$isElementNode(u)&&!u.isInline()),null!==e&&(f=e.getKey(),e.canIndent()&&!d.has(f)&&(d.add(f),b(e))))}return 0{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)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,()=>J(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>J(a=>{const d=a.getIndent();0{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!K(a.target)){if(a=d.getNodes(),0K(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>K(a=>{const d=a.getIndent();0{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!L(a.target)){if(a=d.getNodes(),0{var d=k.$getSelection();if(k.$isNodeSelection(d)){if(a=d.getNodes(),0{const d=k.$getSelection();if(k.$isNodeSelection(d)){var e=d.getNodes();if(0{const d=k.$getSelection();if(k.$isNodeSelection(d)&& +-!K(a.target)){var e=d.getNodes();if(0{if(K(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;a.preventDefault();({anchor:a}=d);const e=a.getNode();return d.isCollapsed()&&0===a.offset&& +-!k.$isRootNode(e)&&0{if(K(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;a.preventDefault();return b.dispatchCommand(k.DELETE_CHARACTER_COMMAND,!1)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ENTER_COMMAND,a=>{const d=k.$getSelection(); +-if(!k.$isRangeSelection(d))return!1;if(null!==a){if((t||r||w)&&q)return!1;a.preventDefault();if(a.shiftKey)return b.dispatchCommand(k.INSERT_LINE_BREAK_COMMAND,!1)}return b.dispatchCommand(k.INSERT_PARAGRAPH_COMMAND,void 0)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ESCAPE_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;b.blur();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DROP_COMMAND,a=>{const [,d]=I(a);if(0{[a]=I(a);const d=k.$getSelection();return a&&!k.$isRangeSelection(d)?!1:!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DRAGOVER_COMMAND,a=>{var [d]=I(a);const e=k.$getSelection();if(d&&!k.$isRangeSelection(e))return!1;d=l(a.clientX,a.clientY);null!==d&&(d=k.$getNearestNodeFromDOMNode(d.node),k.$isDecoratorNode(d)&&a.preventDefault());return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.SELECT_ALL_COMMAND,()=>{k.$selectAll();return!0},k.COMMAND_PRIORITY_EDITOR), +-b.registerCommand(k.COPY_COMMAND,a=>{c.copyToClipboard(b,h.objectKlassEquals(a,ClipboardEvent)?a:null);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CUT_COMMAND,a=>{H(a,b);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.PASTE_COMMAND,a=>{const [,d,e]=I(a);return 0{if(L(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;a.preventDefault();({anchor:a}=d);const e=a.getNode();return d.isCollapsed()&&0===a.offset&& ++!k.$isRootNode(e)&&0{if(L(a.target))return!1;const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;a.preventDefault();return b.dispatchCommand(k.DELETE_CHARACTER_COMMAND,!1)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ENTER_COMMAND,a=>{const d=k.$getSelection(); ++if(!k.$isRangeSelection(d))return!1;if(null!==a){if((t||r||x)&&q)return!1;a.preventDefault();if(a.shiftKey)return b.dispatchCommand(k.INSERT_LINE_BREAK_COMMAND,!1)}return b.dispatchCommand(k.INSERT_PARAGRAPH_COMMAND,void 0)},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ESCAPE_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;b.blur();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DROP_COMMAND,a=>{const [,d]=J(a);if(0{[a]=J(a);const d=k.$getSelection();return a&&!k.$isRangeSelection(d)?!1:!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DRAGOVER_COMMAND,a=>{var [d]=J(a);const e=k.$getSelection();if(d&&!k.$isRangeSelection(e))return!1;d=l(a.clientX,a.clientY);null!==d&&(d=k.$getNearestNodeFromDOMNode(d.node),k.$isDecoratorNode(d)&&a.preventDefault());return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.SELECT_ALL_COMMAND,()=>{k.$selectAll();return!0},k.COMMAND_PRIORITY_EDITOR), ++b.registerCommand(k.COPY_COMMAND,a=>{c.copyToClipboard(b,h.objectKlassEquals(a,ClipboardEvent)?a:null);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CUT_COMMAND,a=>{I(a,b);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.PASTE_COMMAND,a=>{const [,d,e]=J(a);return 0({conversion:xt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=ht();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){const n=f(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=f();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}}function ht(){return m(new pt)}function vt(t){return t instanceof pt}class Ct extends d{static getType(){return"heading"}static clone(t){return new Ct(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e){return!1}static importDOM(){return{h1:t=>({conversion:Dt,priority:0}),h2:t=>({conversion:Dt,priority:0}),h3:t=>({conversion:Dt,priority:0}),h4:t=>({conversion:Dt,priority:0}),h5:t=>({conversion:Dt,priority:0}),h6:t=>({conversion:Dt,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&yt(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>yt(t)?{conversion:t=>({node:wt("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=wt(t.tag);return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=n!==this.getTextContentSize()&&t?wt(this.getTag()):f(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,e),0===n&&!this.isEmpty()&&t){const t=f();t.select(),this.replace(t,!0)}return r}collapseAtStart(){const t=this.isEmpty()?f():wt(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function yt(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Dt(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=wt(e),null!==t.style&&n.setFormat(t.style.textAlign)),{node:n}}function xt(t){const e=ht();return null!==t.style&&e.setFormat(t.style.textAlign),{node:e}}function wt(t){return m(new Ct(t))}function Et(t){return t instanceof Ct}function Nt(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function At(t){const e=p();if(!C(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;e0}function Pt(t){const e=V(t);return K(e)}function Ot(o){return a(o.registerCommand(g,(t=>{const e=p();return!!h(e)&&(e.clear(),!0)}),0),o.registerCommand(v,(t=>{const e=p();return!!C(e)&&(e.deleteCharacter(t),!0)}),y),o.registerCommand(D,(t=>{const e=p();return!!C(e)&&(e.deleteWord(t),!0)}),y),o.registerCommand(x,(t=>{const e=p();return!!C(e)&&(e.deleteLine(t),!0)}),y),o.registerCommand(w,(e=>{const n=p();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o);else if(C(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),y),o.registerCommand(E,(()=>{const t=p();return!!C(t)&&(t.removeText(),!0)}),y),o.registerCommand(N,(t=>{const e=p();return!!C(e)&&(e.formatText(t),!0)}),y),o.registerCommand(A,(t=>{const e=p();if(!C(e)&&!h(e))return!1;const n=e.getNodes();for(const e of n){const n=c(e,(t=>P(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),y),o.registerCommand(O,(t=>{const e=p();return!!C(e)&&(e.insertLineBreak(t),!0)}),y),o.registerCommand(T,(()=>{const t=p();return!!C(t)&&(t.insertParagraph(),!0)}),y),o.registerCommand(I,(()=>(S([_()]),!0)),y),o.registerCommand(F,(()=>At((t=>{const e=t.getIndent();t.setIndent(e+1)}))),y),o.registerCommand(M,(()=>At((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),y),o.registerCommand(b,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(C(e)){const n=k(e.focus,!0);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),y),o.registerCommand(J,(t=>{const e=p();if(h(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(C(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===q().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),y),o.registerCommand(L,(t=>{const e=p();if(h(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!C(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),y),o.registerCommand(R,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!C(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),y),o.registerCommand(z,(t=>{if(Pt(t.target))return!1;const e=p();if(!C(e))return!1;t.preventDefault();const{anchor:n}=e,r=n.getNode();if(e.isCollapsed()&&0===n.offset&&!W(r)){if(u(r).getIndent()>0)return o.dispatchCommand(M,void 0)}return o.dispatchCommand(v,!0)}),y),o.registerCommand(X,(t=>{if(Pt(t.target))return!1;const e=p();return!!C(e)&&(t.preventDefault(),o.dispatchCommand(v,!1))}),y),o.registerCommand(Y,(t=>{const e=p();if(!C(e))return!1;if(null!==t){if((dt||lt||ft)&&ut)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(O,!1)}return o.dispatchCommand(T,void 0)}),y),o.registerCommand(B,(()=>{const t=p();return!!C(t)&&(o.blur(),!0)}),y),o.registerCommand(G,(t=>{const[,e]=Nt(t);if(e.length>0){const n=st(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=V(r);if(null!==i){const e=j();if(H(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Q(e);U(n)}o.dispatchCommand(gt,e)}return t.preventDefault(),!0}const n=p();return!!C(n)}),y),o.registerCommand(Z,(t=>{const[e]=Nt(t),n=p();return!(e&&!C(n))}),y),o.registerCommand($,(t=>{const[e]=Nt(t),n=p();if(e&&!C(n))return!1;const r=st(t.clientX,t.clientY);if(null!==r){const e=V(r.node);K(e)&&t.preventDefault()}return!0}),y),o.registerCommand(tt,(()=>(et(),!0)),y),o.registerCommand(nt,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),y),o.registerCommand(rt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=p();C(t)?t.removeText():h(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),y),o.registerCommand(ot,(e=>{const[,n,r]=Nt(e);if(n.length>0&&!r)return o.dispatchCommand(gt,n),!0;if(it(e.target))return!1;return null!==p()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=p(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:"paste"})}(e,o),!0)}),y))}export{wt as $createHeadingNode,ht as $createQuoteNode,Et as $isHeadingNode,vt as $isQuoteNode,gt as DRAG_DROP_PASTE,Ct as HeadingNode,pt as QuoteNode,Nt as eventFiles,Ot as registerRichText}; ++ ++import{$insertDataTransferForRichText as t,copyToClipboard as e}from"@lexical/clipboard";import{$shouldOverrideDefaultCharacterSelection as n,$moveCharacter as r}from"@lexical/selection";import{addClassNamesToElement as o,isHTMLElement as i,objectKlassEquals as s,mergeRegister as c,$findMatchingParent as a,$getNearestBlockElementAncestorOrThrow as u}from"@lexical/utils";import{createCommand as l,ElementNode as d,$applyNodeReplacement as m,$createParagraphNode as f,CLICK_COMMAND as g,$getSelection as p,$isNodeSelection as h,DELETE_CHARACTER_COMMAND as v,$isRangeSelection as C,COMMAND_PRIORITY_EDITOR as y,DELETE_WORD_COMMAND as D,DELETE_LINE_COMMAND as x,CONTROLLED_TEXT_INSERTION_COMMAND as w,REMOVE_TEXT_COMMAND as E,FORMAT_TEXT_COMMAND as N,FORMAT_ELEMENT_COMMAND as A,$isElementNode as P,INSERT_LINE_BREAK_COMMAND as I,INSERT_PARAGRAPH_COMMAND as O,INSERT_TAB_COMMAND as T,$insertNodes as S,$createTabNode as _,INDENT_CONTENT_COMMAND as F,OUTDENT_CONTENT_COMMAND as M,KEY_ARROW_UP_COMMAND as b,$isDecoratorNode as K,$getAdjacentNode as k,KEY_ARROW_DOWN_COMMAND as J,$getRoot as q,KEY_ARROW_LEFT_COMMAND as L,KEY_ARROW_RIGHT_COMMAND as R,KEY_BACKSPACE_COMMAND as z,$isRootNode as W,KEY_DELETE_COMMAND as X,KEY_ENTER_COMMAND as Y,KEY_ESCAPE_COMMAND as B,DROP_COMMAND as G,$getNearestNodeFromDOMNode as V,$createRangeSelection as j,$isTextNode as H,$normalizeSelection__EXPERIMENTAL as Q,$setSelection as U,DRAGSTART_COMMAND as Z,DRAGOVER_COMMAND as $,SELECT_ALL_COMMAND as tt,$selectAll as et,COPY_COMMAND as nt,CUT_COMMAND as rt,PASTE_COMMAND as ot,isSelectionCapturedInDecoratorInput as it}from"lexical";function st(t,e){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(t,e);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(t,e);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const ct="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,at=ct&&"documentMode"in document?document.documentMode:null;ct&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ct&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);const ut=!(!ct||!("InputEvent"in window)||at)&&"getTargetRanges"in new window.InputEvent("input"),lt=ct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),dt=ct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mt=(ct&&/Android/.test(navigator.userAgent),ct&&/^(?=.*Chrome).*/i.test(navigator.userAgent)),ft=ct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mt,gt=l("DRAG_DROP_PASTE_FILE");class pt extends d{static getType(){return"quote"}static clone(t){return new pt(t.__key)}constructor(t){super(t)}createDOM(t){const e=document.createElement("blockquote");return o(e,t.theme.quote),e}updateDOM(t,e){return!1}static importDOM(){return{blockquote:t=>({conversion:xt,priority:0})}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=ht();return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(t,e){const n=f(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,e),n}collapseAtStart(){const t=f();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}}function ht(){return m(new pt)}function vt(t){return t instanceof pt}class Ct extends d{static getType(){return"heading"}static clone(t){return new Ct(t.__tag,t.__key)}constructor(t,e){super(e),this.__tag=t}getTag(){return this.__tag}createDOM(t){const e=this.__tag,n=document.createElement(e),r=t.theme.heading;if(void 0!==r){const t=r[e];o(n,t)}return n}updateDOM(t,e){return!1}static importDOM(){return{h1:t=>({conversion:Dt,priority:0}),h2:t=>({conversion:Dt,priority:0}),h3:t=>({conversion:Dt,priority:0}),h4:t=>({conversion:Dt,priority:0}),h5:t=>({conversion:Dt,priority:0}),h6:t=>({conversion:Dt,priority:0}),p:t=>{const e=t.firstChild;return null!==e&&yt(e)?{conversion:()=>({node:null}),priority:3}:null},span:t=>yt(t)?{conversion:t=>({node:wt("h1")}),priority:3}:null}}exportDOM(t){const{element:e}=super.exportDOM(t);if(e&&i(e)){this.isEmpty()&&e.append(document.createElement("br"));const t=this.getFormatType();e.style.textAlign=t;const n=this.getDirection();n&&(e.dir=n)}return{element:e}}static importJSON(t){const e=wt(t.tag);return e.setFormat(t.format),e.setIndent(t.indent),e.setDirection(t.direction),e}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(t,e=!0){const n=t?t.anchor.offset:0,r=n!==this.getTextContentSize()&&t?wt(this.getTag()):f(),o=this.getDirection();if(r.setDirection(o),this.insertAfter(r,e),0===n&&!this.isEmpty()&&t){const t=f();t.select(),this.replace(t,!0)}return r}collapseAtStart(){const t=this.isEmpty()?f():wt(this.getTag());return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}extractWithChild(){return!0}}function yt(t){return"span"===t.nodeName.toLowerCase()&&"26pt"===t.style.fontSize}function Dt(t){const e=t.nodeName.toLowerCase();let n=null;return"h1"!==e&&"h2"!==e&&"h3"!==e&&"h4"!==e&&"h5"!==e&&"h6"!==e||(n=wt(e),null!==t.style&&n.setFormat(t.style.textAlign)),{node:n}}function xt(t){const e=ht();return null!==t.style&&e.setFormat(t.style.textAlign),{node:e}}function wt(t){return m(new Ct(t))}function Et(t){return t instanceof Ct}function Nt(t){let e=null;if(s(t,DragEvent)?e=t.dataTransfer:s(t,ClipboardEvent)&&(e=t.clipboardData),null===e)return[!1,[],!1];const n=e.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(e.files),o]}function At(t){const e=p();if(!C(e))return!1;const n=new Set,r=e.getNodes();for(let e=0;eP(t)&&!t.isInline()));if(null===s)continue;const c=s.getKey();s.canIndent()&&!n.has(c)&&(n.add(c),t(s))}return n.size>0}function Pt(t){const e=V(t);return K(e)}function It(o){return c(o.registerCommand(g,(t=>{const e=p();return!!h(e)&&(e.clear(),!0)}),0),o.registerCommand(v,(t=>{const e=p();return!!C(e)&&(e.deleteCharacter(t),!0)}),y),o.registerCommand(D,(t=>{const e=p();return!!C(e)&&(e.deleteWord(t),!0)}),y),o.registerCommand(x,(t=>{const e=p();return!!C(e)&&(e.deleteLine(t),!0)}),y),o.registerCommand(w,(e=>{const n=p();if("string"==typeof e)null!==n&&n.insertText(e);else{if(null===n)return!1;const r=e.dataTransfer;if(null!=r)t(r,n,o,e);else if(C(n)){const t=e.data;return t&&n.insertText(t),!0}}return!0}),y),o.registerCommand(E,(()=>{const t=p();return!!C(t)&&(t.removeText(),!0)}),y),o.registerCommand(N,(t=>{const e=p();return!!C(e)&&(e.formatText(t),!0)}),y),o.registerCommand(A,(t=>{const e=p();if(!C(e)&&!h(e))return!1;const n=e.getNodes();for(const e of n){const n=a(e,(t=>P(t)&&!t.isInline()));null!==n&&n.setFormat(t)}return!0}),y),o.registerCommand(I,(t=>{const e=p();return!!C(e)&&(e.insertLineBreak(t),!0)}),y),o.registerCommand(O,(()=>{const t=p();return!!C(t)&&(t.insertParagraph(),!0)}),y),o.registerCommand(T,(()=>(S([_()]),!0)),y),o.registerCommand(F,(()=>At((t=>{const e=t.getIndent();t.setIndent(e+1)}))),y),o.registerCommand(M,(()=>At((t=>{const e=t.getIndent();e>0&&t.setIndent(e-1)}))),y),o.registerCommand(b,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const t=e.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(C(e)){const n=k(e.focus,!0);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),t.preventDefault(),!0}return!1}),y),o.registerCommand(J,(t=>{const e=p();if(h(e)){const t=e.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(C(e)){if(function(t){const e=t.focus;return"root"===e.key&&e.offset===q().getChildrenSize()}(e))return t.preventDefault(),!0;const n=k(e.focus,!1);if(!t.shiftKey&&K(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),t.preventDefault(),!0}return!1}),y),o.registerCommand(L,(t=>{const e=p();if(h(e)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectPrevious(),!0}if(!C(e))return!1;if(n(e,!0)){const n=t.shiftKey;return t.preventDefault(),r(e,n,!0),!0}return!1}),y),o.registerCommand(R,(t=>{const e=p();if(h(e)&&!Pt(t.target)){const n=e.getNodes();if(n.length>0)return t.preventDefault(),n[0].selectNext(0,0),!0}if(!C(e))return!1;const o=t.shiftKey;return!!n(e,!1)&&(t.preventDefault(),r(e,o,!1),!0)}),y),o.registerCommand(z,(t=>{if(Pt(t.target))return!1;const e=p();if(!C(e))return!1;t.preventDefault();const{anchor:n}=e,r=n.getNode();if(e.isCollapsed()&&0===n.offset&&!W(r)){if(u(r).getIndent()>0)return o.dispatchCommand(M,void 0)}return o.dispatchCommand(v,!0)}),y),o.registerCommand(X,(t=>{if(Pt(t.target))return!1;const e=p();return!!C(e)&&(t.preventDefault(),o.dispatchCommand(v,!1))}),y),o.registerCommand(Y,(t=>{const e=p();if(!C(e))return!1;if(null!==t){if((dt||lt||ft)&&ut)return!1;if(t.preventDefault(),t.shiftKey)return o.dispatchCommand(I,!1)}return o.dispatchCommand(O,void 0)}),y),o.registerCommand(B,(()=>{const t=p();return!!C(t)&&(o.blur(),!0)}),y),o.registerCommand(G,(t=>{const[,e]=Nt(t);if(e.length>0){const n=st(t.clientX,t.clientY);if(null!==n){const{offset:t,node:r}=n,i=V(r);if(null!==i){const e=j();if(H(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}const n=Q(e);U(n)}o.dispatchCommand(gt,e)}return t.preventDefault(),!0}const n=p();return!!C(n)}),y),o.registerCommand(Z,(t=>{const[e]=Nt(t),n=p();return!(e&&!C(n))}),y),o.registerCommand($,(t=>{const[e]=Nt(t),n=p();if(e&&!C(n))return!1;const r=st(t.clientX,t.clientY);if(null!==r){const e=V(r.node);K(e)&&t.preventDefault()}return!0}),y),o.registerCommand(tt,(()=>(et(),!0)),y),o.registerCommand(nt,(t=>(e(o,s(t,ClipboardEvent)?t:null),!0)),y),o.registerCommand(rt,(t=>(async function(t,n){await e(n,s(t,ClipboardEvent)?t:null),n.update((()=>{const t=p();C(t)?t.removeText():h(t)&&t.getNodes().forEach((t=>t.remove()))}))}(t,o),!0)),y),o.registerCommand(ot,(e=>{const[,n,r]=Nt(e);if(n.length>0&&!r)return o.dispatchCommand(gt,n),!0;if(it(e.target))return!1;return null!==p()&&(function(e,n){e.preventDefault(),n.update((()=>{const r=p(),o=s(e,InputEvent)||s(e,KeyboardEvent)?null:e.clipboardData;null!=o&&null!==r&&t(o,r,n)}),{tag:"paste"})}(e,o),!0)}),y))}export{wt as $createHeadingNode,ht as $createQuoteNode,Et as $isHeadingNode,vt as $isQuoteNode,gt as DRAG_DROP_PASTE,Ct as HeadingNode,pt as QuoteNode,Nt as eventFiles,It as registerRichText}; diff --git a/package.json b/package.json index 89b54753cc3..cf5796e652e 100644 --- a/package.json +++ b/package.json @@ -44,8 +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.14.3": "patch:@lexical/clipboard@npm:0.14.3#.yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch", - "@lexical/rich-text@0.14.3": "patch:@lexical/rich-text@npm:0.14.3#.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch" + "@lexical/clipboard@0.14.5": "patch:@lexical/clipboard@npm:0.14.5#.yarn/patches/@lexical-clipboard-npm-0.14.5-09010c7dc6.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/list@0.14.5": "patch:@lexical/list@npm:0.14.5#.yarn/patches/@lexical-list-npm-0.14.5-348640e630.patch" }, "dependencies": { "@standardnotes/snjs": "workspace:*" diff --git a/packages/web/package.json b/packages/web/package.json index e6473c253bb..47178b1d7f9 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -107,17 +107,17 @@ }, "dependencies": { "@ariakit/react": "^0.3.9", - "@lexical/clipboard": "0.14.3", - "@lexical/headless": "0.14.3", - "@lexical/link": "0.14.3", - "@lexical/list": "0.14.3", - "@lexical/react": "0.14.3", - "@lexical/rich-text": "0.14.3", - "@lexical/utils": "0.14.3", + "@lexical/clipboard": "0.14.5", + "@lexical/headless": "0.14.5", + "@lexical/link": "0.14.5", + "@lexical/list": "0.14.5", + "@lexical/react": "0.14.5", + "@lexical/rich-text": "0.14.5", + "@lexical/utils": "0.14.5", "@radix-ui/react-slot": "^1.0.1", "@react-pdf/renderer": "^3.3.2", "comlink": "^4.4.1", "fast-diff": "^1.3.0", - "lexical": "0.14.3" + "lexical": "0.14.5" } } diff --git a/yarn.lock b/yarn.lock index 39cfb443977..c065282c1e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3902,270 +3902,298 @@ __metadata: languageName: node linkType: hard -"@lexical/clipboard@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/clipboard@npm:0.14.3" +"@lexical/clipboard@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/clipboard@npm:0.14.5" dependencies: - "@lexical/html": 0.14.3 - "@lexical/list": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 4895644d658ec34013d4abfc40b1a48dcf412efaae9c35cfc4c4a0e7c9df41a47c52d5d11e1c141b4dab215ad0b80ebeabfd8a95c1633ae0652c4f4d84bfca54 + "@lexical/html": 0.14.5 + "@lexical/list": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 9fb6db51a0471c3a78bcbcdfa1561f18d03358002bd8b4ef3d6898f50d9f0b4e552ffc8c78551829be50d537c7798e28706c3688cc7549b92ce998973a114b86 languageName: node linkType: hard -"@lexical/clipboard@patch:@lexical/clipboard@npm:0.14.3#.yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.": - version: 0.14.3 - resolution: "@lexical/clipboard@patch:@lexical/clipboard@npm%3A0.14.3#.yarn/patches/@lexical-clipboard-npm-0.14.3-58877f1e45.patch::version=0.14.3&hash=63c68d&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A." +"@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.": + version: 0.14.5 + 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." dependencies: - "@lexical/html": 0.14.3 - "@lexical/list": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 0f723b5dd15115dbcf8b6df7568576531ea3eb966c767ffbea9f7e43e5afe2cacce973dbba4e9291239f868b6988ec18e30cd1c24fb4853fe4fb5a4a32a29214 + "@lexical/html": 0.14.5 + "@lexical/list": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 05ae231a22f032c15506c87cdeed100f504a907853ea14dce4a7e3eac84fdde733db652fbf05610dffdfb79f44bada34253b90866965aee693e9296311fb38ac languageName: node linkType: hard -"@lexical/code@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/code@npm:0.14.3" +"@lexical/code@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/code@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 prismjs: ^1.27.0 - checksum: eb8e6d577079dbb914504e3de0de98cbb29ccc69b60c6868fd19979714d01f88d7580d3092d7349a8c4e6f7c357b418394cd909c3c185a10972f180e5da8cc91 + checksum: fc91f46c0570c54ac943ac88f91094b157f3f6fb4efc2e07184c3679a63b7482655201d7d4fee4f45b4507be4329075e38fa332a6b1d050ced3323c0ef2b63fb + languageName: node + linkType: hard + +"@lexical/devtools-core@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/devtools-core@npm:0.14.5" + dependencies: + "@lexical/html": 0.14.5 + "@lexical/link": 0.14.5 + "@lexical/mark": 0.14.5 + "@lexical/table": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + peerDependencies: + react: ">=17.x" + react-dom: ">=17.x" + checksum: 1461941156b632e34c79b51bada748d19cd7be7d2ec562c744c12548fd24c9d1041a25f9a8eedda957a9da75d39d1967cbf7bc6b79c2af0919622a87c26ac8bc languageName: node linkType: hard -"@lexical/dragon@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/dragon@npm:0.14.3" +"@lexical/dragon@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/dragon@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: 89c8f2971679ff28dde7d82c4e2d3fa8a9d7e46e1f7fc54cadf2bde358b7a1cba741607f2d4fb0888e8bba51abcf36fc35fb393009729e51d18ff04a82770304 + lexical: 0.14.5 + checksum: 9e4b2d8f824476c4bab02ed2510b7466f09633e18c7da79507f3d9291f556c7223eac2f023049b33ab9b2d37f72202f7a816efbedce51493faaf42799b9a2fcd languageName: node linkType: hard -"@lexical/hashtag@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/hashtag@npm:0.14.3" +"@lexical/hashtag@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/hashtag@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: dd2a7027003ac9dd100bd409428f42d839c863719b33a8c76050b215cd9be6f9137bb7c9914f243954575bbd0caaa5ea94e7ac1617abadbfd17b6c69fce018d7 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 22303fb67947ebfb73de22b79afed80e39cfc6bdd6c29a8c5eaf9bf2004f5bb036aa02f1e42587137a86c3336af3d33493ff1a4b870fa49a5761457802cabe78 languageName: node linkType: hard -"@lexical/headless@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/headless@npm:0.14.3" +"@lexical/headless@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/headless@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: e37aca0ed52e6c46bad8b314c087a008af22d24d1eb0643c9d06afdcd60d3dc4529c301c6b3dbba5d3d1ba3dc78241e6f25a11eac5beb54883587838888195fd + lexical: 0.14.5 + checksum: d7bbbeaed2789c724ad2978a71704d6b449d7965728d9ea9eb1da84b6a8a357f17cd7842bfbde96ef9c0acd9c1b49f16422c1249d70d5734b9ec8862ed9cc78d languageName: node linkType: hard -"@lexical/history@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/history@npm:0.14.3" +"@lexical/history@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/history@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 1209689ab52281d2f0cb05340f67c1ccab96ecf6548934031b4ded4a7f8b923e7a2b56e16d92817c42a9c4b25512ffd0372e87e48844b7a6a83466216d2b32c7 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 6cc9672c04ab5c2c2fc4d52f002ad5a2b5b7d82c0bc2e1d9a07c7acdd60c74360e84404fccada919ec78a0fe66f5e74918aaf89c995fc6c88333be6d8fbce05e languageName: node linkType: hard -"@lexical/html@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/html@npm:0.14.3" +"@lexical/html@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/html@npm:0.14.5" dependencies: - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: ae556dd2bfee5db4394a94cf530d5e87f919eb004905dcb59cde1ab80d645c01e4c7ef3777ed81b0b86ddfcf41175aae460c201bf92c3321c332fe9e84d34bad + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: f28e3f8f260f5a0ad30c4e80f691729006e19b9a87da87647f19f1fe9a39597b28cef693a1f1ddb409ded6c2cdabaa01eec74443329c836282ffcb3e8206f4ea languageName: node linkType: hard -"@lexical/link@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/link@npm:0.14.3" +"@lexical/link@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/link@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 25c6d8e3a3159f7d6a257abe3f33e77409b4fec29b599b1c371cc05c8649130b19c5a026f478d92fb29a656484daf819da706db3293cc798a1b559ddf040c0c8 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 674bd80c218033549b0b4d0151b7df05a7269bb2b80ce8c0e6251b59db5ae67bbfb996698f2520c54756c4c6c2027db364f6ee2dbde9be0ed111cfe6662d9525 languageName: node linkType: hard -"@lexical/list@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/list@npm:0.14.3" +"@lexical/list@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/list@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: fcc69957656c7610c3637d092f8568e0d009fa86a69616ba27ca2aa6d01b514562ad1f5e1ecbf86a07008ef034cb15dd01b5919df8cdf352cc50de26f9563146 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 971b7876372f42dbc65871c6eb5c1e769986d24cc1b48dad89917df1c02894d72bbbfe8d42166f4d8731d0ecdca38d65f7084980482001cffc346bf419c2f3ef languageName: node linkType: hard -"@lexical/mark@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/mark@npm:0.14.3" +"@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.": + version: 0.14.5 + 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." dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: b2f358ef2216d94f034119a92583d83a423fe5ca926c59ae33bf94af029a6466ce7a5f04bc02f68a67bad42516b2584ba37dc7210eaf05c96f71adeb81d3e558 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 21350cfcad37510291f115d65262d0e582b6fa237625cd2b6fa91d5296f7ec036b98f0e20a9de6b7a9644f5faa306c1cebb28b91c128e89828299cced7094e5f languageName: node linkType: hard -"@lexical/markdown@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/markdown@npm:0.14.3" +"@lexical/mark@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/mark@npm:0.14.5" dependencies: - "@lexical/code": 0.14.3 - "@lexical/link": 0.14.3 - "@lexical/list": 0.14.3 - "@lexical/rich-text": 0.14.3 - "@lexical/text": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 8edda933ddf08e357b37158995c61d76c214a384af1d1aac23b2feb247be2eaf03b9f4d258d626d72e7951f341e6a8cbc184ffdbb46d2ea3ebc03bb86f1a2d3a + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 479b643a2c5137968a5c96cefbaf5920da674519114b7e52e019523cb7684c2241392246053e7b0c1791ad2063eae4dceee2118de85456003e71359d0327dd4c languageName: node linkType: hard -"@lexical/offset@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/offset@npm:0.14.3" +"@lexical/markdown@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/markdown@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: a0bb3f47f8031f47b3f21fa603afe2219724b5645a7ac4b5f1ec2f8ac92caee9a9b1146cee477b1b030b979ed1138f62433ca3ae7c300007ce9ad58c4f41dc00 + "@lexical/code": 0.14.5 + "@lexical/link": 0.14.5 + "@lexical/list": 0.14.5 + "@lexical/rich-text": 0.14.5 + "@lexical/text": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 889d877b147ca83e12551afd16f70aa33fe86630ecd33c67e9a1c5de3b24a1807a8c6ff62138f8cf66986339c71e82581ddc85a349063f09642524feb0133b50 languageName: node linkType: hard -"@lexical/overflow@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/overflow@npm:0.14.3" +"@lexical/offset@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/offset@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: 2b27058e1095fbd3f301b1080fea291dc3475b88a977393a7be263d12c37d3c46f70ac94d6b665d570696f1de3ae7e86ce46137770bb2109ce555ebedb158ba1 + lexical: 0.14.5 + checksum: 92d6aa77867c4fb4166dbfba721cdb056d9849c45eb5d61f618934f3549cc4a2d77aa568f64624a10f8cb1bf0c79d7d6fb3dd38596ce78e2282d5e33ac6acdf0 languageName: node linkType: hard -"@lexical/plain-text@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/plain-text@npm:0.14.3" +"@lexical/overflow@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/overflow@npm:0.14.5" dependencies: - "@lexical/clipboard": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 27e6e2687442bd9415a9a15abb7a21d30556440436f41c737e98ab9c0dce645f08c8ac2b8b1c2afc4214313197ab4ca11c789fc5201cbfe23e07f406adc82a33 + lexical: 0.14.5 + checksum: ea0b68b47a8463805361a80fd437c3c633b16fb80b91618f6d4e67b203c71f47c4789faa7109f20f3d7296cbec50c5a32b22b90001a3738e4eb98923eeb08593 languageName: node linkType: hard -"@lexical/react@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/react@npm:0.14.3" +"@lexical/plain-text@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/plain-text@npm:0.14.5" dependencies: - "@lexical/clipboard": 0.14.3 - "@lexical/code": 0.14.3 - "@lexical/dragon": 0.14.3 - "@lexical/hashtag": 0.14.3 - "@lexical/history": 0.14.3 - "@lexical/link": 0.14.3 - "@lexical/list": 0.14.3 - "@lexical/mark": 0.14.3 - "@lexical/markdown": 0.14.3 - "@lexical/overflow": 0.14.3 - "@lexical/plain-text": 0.14.3 - "@lexical/rich-text": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/table": 0.14.3 - "@lexical/text": 0.14.3 - "@lexical/utils": 0.14.3 - "@lexical/yjs": 0.14.3 - lexical: 0.14.3 + "@lexical/clipboard": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: b0662a60bbc55824f785e0b976c6030bc60dbade1169b78a1a8d73bd3eb82e3e00e9dacefd0fb1cfe11e830a6b12fed02c8a7717e6a0b0a28c1998d21e2d5391 + languageName: node + linkType: hard + +"@lexical/react@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/react@npm:0.14.5" + dependencies: + "@lexical/clipboard": 0.14.5 + "@lexical/code": 0.14.5 + "@lexical/devtools-core": 0.14.5 + "@lexical/dragon": 0.14.5 + "@lexical/hashtag": 0.14.5 + "@lexical/history": 0.14.5 + "@lexical/link": 0.14.5 + "@lexical/list": 0.14.5 + "@lexical/mark": 0.14.5 + "@lexical/markdown": 0.14.5 + "@lexical/overflow": 0.14.5 + "@lexical/plain-text": 0.14.5 + "@lexical/rich-text": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/table": 0.14.5 + "@lexical/text": 0.14.5 + "@lexical/utils": 0.14.5 + "@lexical/yjs": 0.14.5 + lexical: 0.14.5 react-error-boundary: ^3.1.4 peerDependencies: react: ">=17.x" react-dom: ">=17.x" - checksum: 94f0e1c2a3b202c57173a50e8956a6b90f5ec4f23df4456a860f8da8aea1f2e3fcf4b53b0b345609fca1b9343516d87012c60f309175275f54603745550c2003 + checksum: 12a297e133379f2fe47f5a2b396f17028d7cb1844a7fd1f0f2435b3f2ab1e519b45d51312ca41792c4c8f2853f236141c8a23b50241b9c57cfbeaf5d5fdf5db0 languageName: node linkType: hard -"@lexical/rich-text@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/rich-text@npm:0.14.3" +"@lexical/rich-text@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/rich-text@npm:0.14.5" dependencies: - "@lexical/clipboard": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: a55a1ee12c24f358dfcdfa0ca3d0c39e1e38ae23a609265e9bc34ada8f2c78f9147c174445284ad0ff2d90762149755408da0ca24f116bf4bedf8b1850c50904 + "@lexical/clipboard": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: 0cdaacd62b4ff86287c838826ec7a91ac8cec285a8661dc6e1817c5088816865941970a36c971514496b8d7d32078c4ceeb65c3b074c14e48697d714776c406d languageName: node linkType: hard -"@lexical/rich-text@patch:@lexical/rich-text@npm:0.14.3#.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch::locator=%40standardnotes%2Fapp-monorepo%40workspace%3A.": - version: 0.14.3 - resolution: "@lexical/rich-text@patch:@lexical/rich-text@npm%3A0.14.3#.yarn/patches/@lexical-rich-text-npm-0.14.3-02ac98ca96.patch::version=0.14.3&hash=b8208d&locator=%40standardnotes%2Fapp-monorepo%40workspace%3A." +"@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.": + version: 0.14.5 + 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." dependencies: - "@lexical/clipboard": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 077c3c954fc07dfeb4c40dc23e14cea0b3ba61e99cbfce5faeb54eaca21b44e6eae6e78339f6bbb1711305e2bf222f640cf8ce39090be83f64aac76f588740a6 + "@lexical/clipboard": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: fa91d3056fcf1b1f6f51222e8b9f469d533d5885716bdbae31a1d763d27d61c41884cc0931bda440c03dc6a4c492e96047c0fde07bfb635c2a80b6a51825468b languageName: node linkType: hard -"@lexical/selection@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/selection@npm:0.14.3" +"@lexical/selection@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/selection@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: 601cc3225b754aab6f9833d4b2b272474f1890c5eb3f0e58a31f20d0eac8270eb05153c924883de9066cb996130868d0dd9420eb2101acf46f9d4f7f38aee0b4 + lexical: 0.14.5 + checksum: eb624fd2a0bf09926a0da2e0081c5b5bc29ae8993f84c43cbf45c18daf192c27ff909278408ed622e9741fba96a2dda76bc704fbb6e923925233b198c65f9b80 languageName: node linkType: hard -"@lexical/table@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/table@npm:0.14.3" +"@lexical/table@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/table@npm:0.14.5" dependencies: - "@lexical/utils": 0.14.3 - lexical: 0.14.3 - checksum: 231bc2bffb398c6d5a4bc105f21d58274a8b17922c1091cbb812cc9142fff96b23834206f20a62b0f491d15fac7fd4ef3e20625fa08e1a346a3e2a23cc0c90ea + "@lexical/utils": 0.14.5 + lexical: 0.14.5 + checksum: a5598595efbb09d538cd233b3fd535aa4d0fe5d4a3cd91e73ebaa846793c0b4aea57f92f8e18cdeecc1fda341b55d59c6d63d095c5062cd4681da1fd43235a75 languageName: node linkType: hard -"@lexical/text@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/text@npm:0.14.3" +"@lexical/text@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/text@npm:0.14.5" dependencies: - lexical: 0.14.3 - checksum: 1bf057ee96b2b4e393021e34be30428b04b321d64e437c42a7b9a7e51671babfa1e7a6aa040b0596e5a91bfca70a9e3d7280f06014e7cb373807b598b8c6b778 + lexical: 0.14.5 + checksum: aa57dac2bc521d64a7319d76e3f0e69d6f70d2f57fc0f72ed23605484e643017b40c6ec752912b1f90ac2a3fb0f059bce63d85e26118162cd263881932fec044 languageName: node linkType: hard -"@lexical/utils@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/utils@npm:0.14.3" +"@lexical/utils@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/utils@npm:0.14.5" dependencies: - "@lexical/list": 0.14.3 - "@lexical/selection": 0.14.3 - "@lexical/table": 0.14.3 - lexical: 0.14.3 - checksum: 4d9d50e7e3c7b66588e76b9f19d8b14fe4e1226f69ef20a6d0a2ed3e6b5eda6e99cc6250001f4d336c051f7d61e20bb2f8e191ce6f31571c1d6f8800c6d933d1 + "@lexical/list": 0.14.5 + "@lexical/selection": 0.14.5 + "@lexical/table": 0.14.5 + lexical: 0.14.5 + checksum: d5646a39c3588c78fe1d59fe630cc3583041046a5aa1b79e38903afbd9dfbffdbca10c1ea94613e82ded8379cec2db3b119ef0397b1554cb9acabf1084bdf0fa languageName: node linkType: hard -"@lexical/yjs@npm:0.14.3": - version: 0.14.3 - resolution: "@lexical/yjs@npm:0.14.3" +"@lexical/yjs@npm:0.14.5": + version: 0.14.5 + resolution: "@lexical/yjs@npm:0.14.5" dependencies: - "@lexical/offset": 0.14.3 - lexical: 0.14.3 + "@lexical/offset": 0.14.5 + lexical: 0.14.5 peerDependencies: yjs: ">=13.5.22" - checksum: 57cc11dff5e4d870de768e2a718c9f09b164c259b54834fe477d49a1e9cd587f1aaedb34688124ddd638066b0744f529f729dd80d9a39c3a1632eae7486229c6 + checksum: c48406d0dd342b849d1caaf3de772cb2da6e29fea914598b11696c8b62e4f54dcd9c263af5eaa12c0b813546f5bb1690f8d362b6ed3eb515683b129d989b6e20 languageName: node linkType: hard @@ -7849,13 +7877,13 @@ __metadata: "@babel/plugin-transform-react-jsx": ^7.19.0 "@babel/preset-env": "*" "@babel/preset-typescript": ^7.21.5 - "@lexical/clipboard": 0.14.3 - "@lexical/headless": 0.14.3 - "@lexical/link": 0.14.3 - "@lexical/list": 0.14.3 - "@lexical/react": 0.14.3 - "@lexical/rich-text": 0.14.3 - "@lexical/utils": 0.14.3 + "@lexical/clipboard": 0.14.5 + "@lexical/headless": 0.14.5 + "@lexical/link": 0.14.5 + "@lexical/list": 0.14.5 + "@lexical/react": 0.14.5 + "@lexical/rich-text": 0.14.5 + "@lexical/utils": 0.14.5 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.10 "@radix-ui/react-slot": ^1.0.1 "@react-pdf/renderer": ^3.3.2 @@ -7907,7 +7935,7 @@ __metadata: identity-obj-proxy: ^3.0.0 jest: ^29.3.1 jest-environment-jsdom: ^29.3.1 - lexical: 0.14.3 + lexical: 0.14.5 lint-staged: ">=13" mini-css-extract-plugin: ^2.7.2 minimatch: ^5.1.1 @@ -18854,10 +18882,10 @@ __metadata: languageName: node linkType: hard -"lexical@npm:0.14.3": - version: 0.14.3 - resolution: "lexical@npm:0.14.3" - checksum: 11ddf0eb510fbfe6407b8714c4d245704499fc7b655c600d5716c12f7d6fe9f63068c25b94ad15e1673b97c4b6d11701c63ae59b48dab993006147e124492fba +"lexical@npm:0.14.5": + version: 0.14.5 + resolution: "lexical@npm:0.14.5" + checksum: 066fbba86f78045323281861cb1a45b01b61ff6f4076c4c083b82300ace7786cb77694f88e6c91b4ecbc278a0dbab569f17e9f5ac3b03a6015c845781a0567fe languageName: node linkType: hard