Compare commits

...
Author SHA1 Message Date
StandardNotes CI cfa2e75adc chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2024-01-24 08:34:33 +00:00
Aman Harwara 418d1a7371 feat: Super notes can now be exported as PDF (#2776) 2024-01-24 13:23:38 +05:30
StandardNotes CI 813304c959 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2024-01-23 08:33:41 +00:00
Karol Sójko ba236a2f2b chore: add sync backoff mechanism checks (#2786) 2024-01-23 09:04:55 +01:00
StandardNotes CI 2757884d10 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2024-01-21 07:50:00 +00:00
Aman Harwara f2bcab6131 chore: fix issue with link editor position on iOS 2024-01-21 12:50:33 +05:30
Aman Harwara 327f732adc chore: fix changelog [skip e2e] 2024-01-21 12:35:59 +05:30
StandardNotes CI 909ab8ffad chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2024-01-20 15:25:38 +00:00
Aman Harwara 814afc3e6d chore: fix mobile toolbar conditional [skip e2e] 2024-01-20 20:46:47 +05:30
StandardNotes CI 2d68fb7c7d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2024-01-20 15:14:39 +00:00
Aman Harwara 5463b7b58e chore: fix super editor menus overflowing 2024-01-20 20:16:26 +05:30
StandardNotes CI b53ae1d09b chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2024-01-20 10:23:44 +00:00
Aman Harwara cb083e2a05 chore: fix super block/item picker menu item colors 2024-01-20 15:24:56 +05:30
Aman Harwara f3276e2876 chore: re-order super toolbar items 2024-01-20 15:24:56 +05:30
Aman Harwara 396ee3f449 feat: Editing large notes (greater than 1.5MB) will result in more optimized syncing, in which changes are saved locally immediately, but sync with the server less frequently (roughly every 30 seconds rather than after every change). (#2768) 2024-01-20 15:22:09 +05:30
StandardNotes CI c6060aaab3 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
2024-01-17 16:00:53 +00:00
Aman Harwara 29a50f9353 chore: upgrade lexical & apply patches (#2757) 2024-01-17 21:00:08 +05:30
StandardNotes CI 6b7d260dda chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2024-01-17 13:34:51 +00:00
Aman Harwara 2156e77135 chore: fix arrow down when a collapsed collapsible is the last node 2024-01-17 15:44:48 +05:30
StandardNotes CI 1bca31cdcb chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
2024-01-12 14:52:59 +00:00
Karol Sójko d91402e673 chore: fix e2e matcher 2024-01-12 15:24:05 +01:00
StandardNotes CI 766f156c89 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2024-01-11 14:55:34 +00:00
Karol Sójko cf4b5ccf0a chore: global sync per minute safety limit (#2765) 2024-01-11 15:26:09 +01:00
Aman Harwara 3d895ca499 chore: memoize plain editor ref function 2024-01-11 19:39:07 +05:30
StandardNotes CI 7bafde5be7 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
2024-01-10 12:07:58 +00:00
Aman Harwara 9ccbea8e0a chore: fix swipe gesture issue on iOS 2024-01-10 17:07:44 +05:30
StandardNotes CI 2298a551ed chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2024-01-08 15:17:11 +00:00
Aman Harwara 65d68f8080 refactor: zip download progress notification 2024-01-08 20:17:28 +05:30
Aman Harwara 130b63b1a5 feat: Added option to download multiple files as a zip when using the desktop app or a supported browser (#2748) 2024-01-08 19:59:28 +05:30
Aman Harwara ee895ad44d refactor: select image/file node in super when clicking inside it 2024-01-08 19:56:24 +05:30
StandardNotes CI 14a82941b8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-08 09:28:20 +00:00
Aman Harwara 6e1d7926c3 refactor: toast 2024-01-08 14:29:15 +05:30
StandardNotes CI b7f8105cd6 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-06 22:44:38 +00:00
Mo 04106b3e15 chore: fix server selection ux [skip e2e] 2024-01-06 16:35:58 -06:00
StandardNotes CI 23efad85df chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-06 21:35:51 +00:00
Mo acd20dcc70 fix: Fixes issue where self-hosted accounts may not have loaded correct server 2024-01-06 15:05:56 -06:00
StandardNotes CI 604f341f8f chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-05 17:13:48 +00:00
Aman Harwara afaf53a7a4 chore: let user know about 429 status (#2747) 2024-01-05 22:13:54 +05:30
StandardNotes CI 121d07288a chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-04 18:35:23 +00:00
Mo b5a6e60146 chore: await local propagation before replacing plain text contents 2024-01-04 12:06:31 -06:00
StandardNotes CI bf18d242bf chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-03 17:55:15 +00:00
Aman Harwara 64351dd304 chore: fix issue with downloading multiple files on macOS 2024-01-03 22:56:01 +05:30
StandardNotes CI bc0f444ed8 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-03 11:16:40 +00:00
Aman Harwara 83cefb3492 refactor: file embed plugin 2024-01-03 16:17:56 +05:30
StandardNotes CI 423c62bc8e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-03 09:40:49 +00:00
Aman Harwara 9019e6de81 chore: remove 5-second timeout when applying theme based on system color scheme 2024-01-03 14:42:34 +05:30
StandardNotes CI bcafb4a905 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-03 09:05:39 +00:00
Aman Harwara 8a3fab1024 chore: fix checklist indentation jumping 2024-01-03 14:07:07 +05:30
StandardNotes CI 990baf2a06 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-02 10:44:10 +00:00
Aman Harwara 948dd117d3 refactor: file download controller 2024-01-02 15:43:55 +05:30
StandardNotes CI 8418e62950 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-02 09:31:39 +00:00
Karol Sójko 5f5d817e04 chore: fix directory separator on windows (#2736) 2024-01-02 10:02:11 +01:00
StandardNotes CI e6d7bcecae chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2024-01-01 08:02:55 +00:00
Aman Harwara 80489cc7b6 refactor: super file insertion plugin 2024-01-01 13:04:10 +05:30
StandardNotes CI 3bb8ffbbe0 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-28 11:03:17 +00:00
Aman Harwara 3da5c85658 chore: fix file preview modal keyboard navigation 2023-12-28 16:04:28 +05:30
Aman Harwara 775f4d4d50 chore: update super demo initial content 2023-12-28 15:49:45 +05:30
Aman Harwara 8b5d455a6e chore: fix panel resizer double-click behavior 2023-12-28 15:38:57 +05:30
Karol SójkoandAman Harwara bc845c1633 chore: add server switcher (#2717)
* wip

* wip2

* refactor: use radio button group

* chore: add persisting host per workspace

* chore: header style

* chore: update server picker title style

* chore: margin

* chore: label

* chore: remove separator

* rename migration to latest snjs version

---------

Co-authored-by: Aman Harwara <[email protected]>
2023-12-28 10:50:14 +01:00
StandardNotes CI f376607f27 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected].9
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-28 09:45:09 +00:00
Karol Sójko 7a8fc49d86 chore: normalize creation and update timestamps on payloads (#2731) 2023-12-28 10:16:20 +01:00
StandardNotes CI c43f029381 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-23 08:49:07 +00:00
Aman Harwara 7e152774b7 chore: @lexical/clipboard patch 2023-12-23 13:49:14 +05:30
Aman Harwara 54d215e6da chore: fix lexical patch dependency 2023-12-23 13:42:51 +05:30
Aman Harwara 90afb74ce1 chore: patch lexical for ios text format bug 2023-12-23 13:31:41 +05:30
Aman Harwara 98d2f2ba23 chore: upgrade lexical 2023-12-23 13:26:39 +05:30
StandardNotes CI a656251e71 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-23 07:39:17 +00:00
Aman Harwara 2383d3db34 chore: fix issue with creating new Super notes [skip e2e] 2023-12-23 13:00:50 +05:30
Aman Harwara a5e2551dd0 chore: upgrade tailwind 2023-12-23 12:46:47 +05:30
StandardNotes CI 0b7372a007 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-22 11:41:11 +00:00
Aman Harwara 29b7e989a6 chore: show Super demo modal if user doesn't have subscription when switching editor to Super 2023-12-22 16:40:42 +05:30
StandardNotes CI 485339be86 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-22 08:01:08 +00:00
Aman Harwara 69a7563b4e chore: sync super markdown import implementation with lexical 2023-12-22 12:32:07 +05:30
StandardNotes CI 0efcf13010 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-18 08:22:47 +00:00
Aman Harwara 661cb73749 chore: fix scroll sync in conflict resolution modal 2023-12-18 13:23:39 +05:30
StandardNotes CI 3b0e0ac013 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-15 17:12:21 +00:00
Aman Harwara 8d50201c68 chore: add slight border to code blocks nested in collapsible blocks 2023-12-15 22:11:08 +05:30
Aman Harwara 44d2624cd9 chore: fix nested collapsible background color 2023-12-15 22:09:49 +05:30
Aman Harwara 4d6caffa3a chore: fix nested collapsible arrow direction 2023-12-15 22:04:05 +05:30
Aman Harwara 118421c5e0 chore: improve super markdown export when exporting nested nodes 2023-12-15 21:42:20 +05:30
Aman Harwara 5dc1a401e8 chore: fix code block background color when nested in a collapsible block 2023-12-15 21:28:54 +05:30
StandardNotes CI f1fb02c6e5 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-14 18:27:12 +00:00
Aman Harwara ba11551dfa Revert "refactor: use ariakit for super note popovers"
This reverts commit 3c5c6723ac.
2023-12-14 23:28:24 +05:30
StandardNotes CI 9054d5e356 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-14 11:10:41 +00:00
Aman Harwara 6c1c2532e6 chore: update ariakit 2023-12-14 16:11:21 +05:30
Aman Harwara 3c5c6723ac refactor: use ariakit for super note popovers 2023-12-14 16:11:21 +05:30
StandardNotes CI caab23d8d1 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-13 19:12:47 +00:00
Aman Harwara 8f755b19db chore: fix note options menu size on some screen sizes 2023-12-14 00:13:36 +05:30
StandardNotes CI 798176be61 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-13 11:06:12 +00:00
Karol Sójko 695429e07f chore: fix home server address when there is no internet connection (#2696) 2023-12-13 11:36:07 +01:00
Aman Harwara 8e73cee200 chore: fix overflow issues in import modal 2023-12-13 15:58:36 +05:30
StandardNotes CI b7f037a7be chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2023-12-12 16:52:01 +00:00
Aman Harwara a092d134c6 chore: fix super block picker menu height in certain cases 2023-12-12 21:52:35 +05:30
Aman Harwara 6e3b337f67 chore: remove unnecessary border on challenge modals on mobile 2023-12-12 21:03:26 +05:30
Aman Harwara 337c6532d1 chore: fix plaintext icon color on hover in selection dropdown 2023-12-12 19:04:52 +05:30
StandardNotes CI 5231b3ce90 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
 - @standardnotes/[email protected]
2023-12-12 11:15:57 +00:00
Karol Sójko db6151e253 chore: activate paid subscriptions for revisions e2e suites (#2693) 2023-12-12 11:47:14 +01:00
277 changed files with 5532 additions and 1181 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,77 @@
diff --git a/LexicalClipboard.dev.js b/LexicalClipboard.dev.js
index 08c80def0bffdd5011948bc73733af51a2f95b3f..b8d5a467b6964b88002d1f0c2ce5d5974755ec75 100644
--- a/LexicalClipboard.dev.js
+++ b/LexicalClipboard.dev.js
@@ -102,7 +102,7 @@ function $insertDataTransferForPlainText(dataTransfer, selection) {
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-function $insertDataTransferForRichText(dataTransfer, selection, editor) {
+function $insertDataTransferForRichText(dataTransfer, selection, editor, event) {
const lexicalString = dataTransfer.getData('application/x-lexical-editor');
if (lexicalString) {
try {
@@ -115,15 +115,18 @@ function $insertDataTransferForRichText(dataTransfer, selection, editor) {
// Fail silently.
}
}
- const htmlString = dataTransfer.getData('text/html');
- if (htmlString) {
- try {
- const parser = new DOMParser();
- const dom = parser.parseFromString(htmlString, 'text/html');
- const nodes = html.$generateNodesFromDOM(editor, dom);
- return $insertGeneratedNodes(editor, nodes, selection);
- } catch (_unused2) {
- // Fail silently.
+ const shouldIgnoreHTML = event && event.inputType === 'insertReplacementText' && dataTransfer.types.includes('text/plain');
+ if (!shouldIgnoreHTML) {
+ const htmlString = dataTransfer.getData('text/html');
+ if (htmlString) {
+ try {
+ const parser = new DOMParser();
+ const dom = parser.parseFromString(htmlString, 'text/html');
+ const nodes = html.$generateNodesFromDOM(editor, dom);
+ return $insertGeneratedNodes(editor, nodes, selection);
+ } catch (_unused2) {
+ // Fail silently.
+ }
}
}
diff --git a/LexicalClipboard.prod.js b/LexicalClipboard.prod.js
index 217fed14ce25e926fafe748de74a9cc2597854ea..0489348de734c563e7befc0af50aaefec74ccd98 100644
--- a/LexicalClipboard.prod.js
+++ b/LexicalClipboard.prod.js
@@ -7,11 +7,11 @@
'use strict';var f=require("@lexical/html"),m=require("@lexical/selection"),q=require("@lexical/utils"),r=require("lexical");function t(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;c<arguments.length;c++)b.append("v",arguments[c]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${b} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}
let u="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function v(a){let b=r.$getSelection();if(null==b)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?"":f.$generateHtmlFromNodes(a,b)}
function w(a){let b=r.$getSelection();if(null==b)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(b)&&b.isCollapsed()||0===b.getNodes().length?null:JSON.stringify(x(a,b))}function y(a,b,c){a.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:b,selection:c})||c.insertNodes(b)}
-function z(a,b,c,d=[]){let e=null!=b?c.isSelected(b):!0,h=r.$isElementNode(c)&&c.excludeFromCopy("html");var g=c;if(null!==b){var k=m.$cloneWithProperties(c);g=k=r.$isTextNode(k)&&null!=b?m.$sliceSelectedTextNodeContent(b,k):k}let n=r.$isElementNode(g)?g.getChildren():[];var l=g;k=l.exportJSON();var p=l.constructor;k.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(k.children)||t(59,p.name));r.$isTextNode(g)&&(g=g.__text,0<g.length?k.text=g:e=!1);for(g=0;g<n.length;g++)l=n[g],
-p=z(a,b,l,k.children),!e&&r.$isElementNode(c)&&p&&c.extractWithChild(l,b,"clone")&&(e=!0);if(e&&!h)d.push(k);else if(Array.isArray(k.children))for(a=0;a<k.children.length;a++)d.push(k.children[a]);return e}function x(a,b){let c=[],d=r.$getRoot().getChildren();for(let e=0;e<d.length;e++)z(a,b,d[e],c);return{namespace:a._config.namespace,nodes:c}}function A(a){let b=[];for(let c=0;c<a.length;c++){let d=r.$parseSerializedNode(a[c]);r.$isTextNode(d)&&m.$addNodeStyle(d);b.push(d)}return b}let B=null;
-function C(a,b){var c=u?(a._window||window).getSelection():null;if(!c)return!1;var d=c.anchorNode;c=c.focusNode;if(null!==d&&null!==c&&!r.isSelectionWithinEditor(a,d,c))return!1;b.preventDefault();b=b.clipboardData;d=r.$getSelection();if(null===b||null===d)return!1;c=v(a);a=w(a);let e="";null!==d&&(e=d.getTextContent());null!==c&&b.setData("text/html",c);null!==a&&b.setData("application/x-lexical-editor",a);b.setData("text/plain",e);return!0}exports.$generateJSONFromSelectedNodes=x;
+function z(a,b,c,e=[]){let g=null!=b?c.isSelected(b):!0,k=r.$isElementNode(c)&&c.excludeFromCopy("html");var d=c;if(null!==b){var h=m.$cloneWithProperties(c);d=h=r.$isTextNode(h)&&null!=b?m.$sliceSelectedTextNodeContent(b,h):h}let n=r.$isElementNode(d)?d.getChildren():[];var l=d;h=l.exportJSON();var p=l.constructor;h.type!==p.getType()&&t(58,p.name);r.$isElementNode(l)&&(Array.isArray(h.children)||t(59,p.name));r.$isTextNode(d)&&(d=d.__text,0<d.length?h.text=d:g=!1);for(d=0;d<n.length;d++)l=n[d],
+p=z(a,b,l,h.children),!g&&r.$isElementNode(c)&&p&&c.extractWithChild(l,b,"clone")&&(g=!0);if(g&&!k)e.push(h);else if(Array.isArray(h.children))for(a=0;a<h.children.length;a++)e.push(h.children[a]);return g}function x(a,b){let c=[],e=r.$getRoot().getChildren();for(let g=0;g<e.length;g++)z(a,b,e[g],c);return{namespace:a._config.namespace,nodes:c}}function A(a){let b=[];for(let c=0;c<a.length;c++){let e=r.$parseSerializedNode(a[c]);r.$isTextNode(e)&&m.$addNodeStyle(e);b.push(e)}return b}let B=null;
+function C(a,b){var c=u?(a._window||window).getSelection():null;if(!c)return!1;var e=c.anchorNode;c=c.focusNode;if(null!==e&&null!==c&&!r.isSelectionWithinEditor(a,e,c))return!1;b.preventDefault();b=b.clipboardData;e=r.$getSelection();if(null===b||null===e)return!1;c=v(a);a=w(a);let g="";null!==e&&(g=e.getTextContent());null!==c&&b.setData("text/html",c);null!==a&&b.setData("application/x-lexical-editor",a);b.setData("text/plain",g);return!0}exports.$generateJSONFromSelectedNodes=x;
exports.$generateNodesFromSerializedNodes=A;exports.$getHtmlContent=v;exports.$getLexicalContent=w;exports.$insertDataTransferForPlainText=function(a,b){a=a.getData("text/plain")||a.getData("text/uri-list");null!=a&&b.insertRawText(a)};
-exports.$insertDataTransferForRichText=function(a,b,c){var d=a.getData("application/x-lexical-editor");if(d)try{let h=JSON.parse(d);if(h.namespace===c._config.namespace&&Array.isArray(h.nodes)){let g=A(h.nodes);return y(c,g,b)}}catch(h){}if(d=a.getData("text/html"))try{var e=(new DOMParser).parseFromString(d,"text/html");let h=f.$generateNodesFromDOM(c,e);return y(c,h,b)}catch(h){}a=a.getData("text/plain")||a.getData("text/uri-list");if(null!=a)if(r.$isRangeSelection(b))for(a=a.split(/(\r?\n|\t)/),
-""===a[a.length-1]&&a.pop(),c=0;c<a.length;c++)e=a[c],"\n"===e||"\r\n"===e?b.insertParagraph():"\t"===e?b.insertNodes([r.$createTabNode()]):b.insertText(e);else b.insertRawText(a)};exports.$insertGeneratedNodes=y;
-exports.copyToClipboard=async function(a,b){if(null!==B)return!1;if(null!==b)return new Promise(g=>{a.update(()=>{g(C(a,b))})});var c=a.getRootElement();let d=null==a._window?window.document:a._window.document,e=u?(a._window||window).getSelection():null;if(null===c||null===e)return!1;let h=d.createElement("span");h.style.cssText="position: fixed; top: -1000px;";h.append(d.createTextNode("#"));c.append(h);c=new Range;c.setStart(h,0);c.setEnd(h,1);e.removeAllRanges();e.addRange(c);return new Promise(g=>
-{let k=a.registerCommand(r.COPY_COMMAND,n=>{q.objectKlassEquals(n,ClipboardEvent)&&(k(),null!==B&&(window.clearTimeout(B),B=null),g(C(a,n)));return!0},r.COMMAND_PRIORITY_CRITICAL);B=window.setTimeout(()=>{k();B=null;g(!1)},50);d.execCommand("copy");h.remove()})}
+exports.$insertDataTransferForRichText=function(a,b,c,e){let g=a.getData("application/x-lexical-editor");if(g)try{let d=JSON.parse(g);if(d.namespace===c._config.namespace&&Array.isArray(d.nodes)){let h=A(d.nodes);return y(c,h,b)}}catch(d){}if(!e||"insertReplacementText"!==e.inputType||!a.types.includes("text/plain"))if(e=a.getData("text/html"))try{var k=(new DOMParser).parseFromString(e,"text/html");let d=f.$generateNodesFromDOM(c,k);return y(c,d,b)}catch(d){}a=a.getData("text/plain")||a.getData("text/uri-list");
+if(null!=a)if(r.$isRangeSelection(b))for(a=a.split(/(\r?\n|\t)/),""===a[a.length-1]&&a.pop(),c=0;c<a.length;c++)k=a[c],"\n"===k||"\r\n"===k?b.insertParagraph():"\t"===k?b.insertNodes([r.$createTabNode()]):b.insertText(k);else b.insertRawText(a)};exports.$insertGeneratedNodes=y;
+exports.copyToClipboard=async function(a,b){if(null!==B)return!1;if(null!==b)return new Promise(d=>{a.update(()=>{d(C(a,b))})});var c=a.getRootElement();let e=null==a._window?window.document:a._window.document,g=u?(a._window||window).getSelection():null;if(null===c||null===g)return!1;let k=e.createElement("span");k.style.cssText="position: fixed; top: -1000px;";k.append(e.createTextNode("#"));c.append(k);c=new Range;c.setStart(k,0);c.setEnd(k,1);g.removeAllRanges();g.addRange(c);return new Promise(d=>
+{let h=a.registerCommand(r.COPY_COMMAND,n=>{q.objectKlassEquals(n,ClipboardEvent)&&(h(),null!==B&&(window.clearTimeout(B),B=null),d(C(a,n)));return!0},r.COMMAND_PRIORITY_CRITICAL);B=window.setTimeout(()=>{h();B=null;d(!1)},50);e.execCommand("copy");k.remove()})}
diff --git a/clipboard.d.ts b/clipboard.d.ts
index 99e2138389b64d298a1330d7b354ba87d2e6f24e..83250a4c2049f94e08bfdfc757e03e8a85a08dd4 100644
--- a/clipboard.d.ts
+++ b/clipboard.d.ts
@@ -44,7 +44,7 @@ export declare function $insertDataTransferForPlainText(dataTransfer: DataTransf
* @param selection the selection to use as the insertion point for the content in the DataTransfer object
* @param editor the LexicalEditor the content is being inserted into.
*/
-export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor): void;
+export declare function $insertDataTransferForRichText(dataTransfer: DataTransfer, selection: BaseSelection, editor: LexicalEditor, event?: InputEvent): void;
/**
* Inserts Lexical nodes into the editor using different strategies depending on
* some simple selection-based heuristics. If you're looking for a generic way to
@@ -0,0 +1,26 @@
diff --git a/LexicalRichText.dev.js b/LexicalRichText.dev.js
index 235657f94e5563d9be091677ec30a2814bc9fdcf..778c7a77da5d5ab04c3cc5d13a1d6c1f4e781864 100644
--- a/LexicalRichText.dev.js
+++ b/LexicalRichText.dev.js
@@ -458,7 +458,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.prod.js b/LexicalRichText.prod.js
index 796f509fe353577592040c0bcd31e4d0155eb661..a91ec007ab7fd4f50e21dda262151b95441a5212 100644
--- a/LexicalRichText.prod.js
+++ b/LexicalRichText.prod.js
@@ -18,7 +18,7 @@ function H(b){let a=null;b instanceof DragEvent?a=b.dataTransfer:b instanceof Cl
function I(b){var a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;let d=new Set;a=a.getNodes();for(let m=0;m<a.length;m++){var e=a[m],f=e.getKey();d.has(f)||(e=h.$getNearestBlockElementAncestorOrThrow(e),f=e.getKey(),e.canIndent()&&!d.has(f)&&(d.add(f),b(e)))}return 0<d.size}function J(b){b=k.$getNearestNodeFromDOMNode(b);return k.$isDecoratorNode(b)}exports.$createHeadingNode=E;exports.$createQuoteNode=z;exports.$isHeadingNode=function(b){return b instanceof B};
exports.$isQuoteNode=function(b){return b instanceof x};exports.DRAG_DROP_PASTE=w;exports.HeadingNode=B;exports.QuoteNode=x;exports.eventFiles=H;
exports.registerRichText=function(b){return h.mergeRegister(b.registerCommand(k.CLICK_COMMAND,()=>{const a=k.$getSelection();return k.$isNodeSelection(a)?(a.clear(),!0):!1},0),b.registerCommand(k.DELETE_CHARACTER_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteCharacter(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.DELETE_WORD_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteWord(a);return!0},k.COMMAND_PRIORITY_EDITOR),
-b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)k.$INTERNAL_isPointSelection(d)&&d.insertText(a);else{if(!k.$INTERNAL_isPointSelection(d))return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),
+b.registerCommand(k.DELETE_LINE_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.deleteLine(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.CONTROLLED_TEXT_INSERTION_COMMAND,a=>{const d=k.$getSelection();if("string"===typeof a)k.$INTERNAL_isPointSelection(d)&&d.insertText(a);else{if(!k.$INTERNAL_isPointSelection(d))return!1;const e=a.dataTransfer;null!=e?c.$insertDataTransferForRichText(e,d,b,a):k.$isRangeSelection(d)&&(a=a.data)&&d.insertText(a)}return!0},k.COMMAND_PRIORITY_EDITOR),
b.registerCommand(k.REMOVE_TEXT_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.removeText();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_TEXT_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.formatText(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.FORMAT_ELEMENT_COMMAND,a=>{var d=k.$getSelection();if(!k.$isRangeSelection(d)&&!k.$isNodeSelection(d))return!1;d=d.getNodes();for(const e of d)d=h.$findMatchingParent(e,
f=>k.$isElementNode(f)&&!f.isInline()),null!==d&&d.setFormat(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_LINE_BREAK_COMMAND,a=>{const d=k.$getSelection();if(!k.$isRangeSelection(d))return!1;d.insertLineBreak(a);return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_PARAGRAPH_COMMAND,()=>{const a=k.$getSelection();if(!k.$isRangeSelection(a))return!1;a.insertParagraph();return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INSERT_TAB_COMMAND,()=>{k.$insertNodes([k.$createTabNode()]);
return!0},k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.INDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();a.setIndent(d+1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.OUTDENT_CONTENT_COMMAND,()=>I(a=>{const d=a.getIndent();0<d&&a.setIndent(d-1)}),k.COMMAND_PRIORITY_EDITOR),b.registerCommand(k.KEY_ARROW_UP_COMMAND,a=>{var d=k.$getSelection();if(k.$isNodeSelection(d)&&!J(a.target)){if(a=d.getNodes(),0<a.length)return a[0].selectPrevious(),!0}else if(k.$isRangeSelection(d)&&(d=k.$getAdjacentNode(d.focus,

Some files were not shown because too many files have changed in this diff Show More