From 6ba72adeb121ffe1c15749e133376723170ae292 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Apr 2024 13:20:51 +0200 Subject: [PATCH 1/3] update(caniuse-lite): use latest to mute warning Signed-off-by: Max --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 43d3d3dcd11..018e7dac7c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7937,9 +7937,9 @@ "integrity": "sha512-A/8PwLk/T7IJDfUdQ68NR24QHa8rIlnN/stiJEBo6dmVUkD4K14LswG0w3VwdeK/o7qOwRUR1k2MhK5Rpy2m7A==" }, "node_modules/caniuse-lite": { - "version": "1.0.30001509", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz", - "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==", + "version": "1.0.30001612", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz", + "integrity": "sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==", "dev": true, "funding": [ { @@ -36579,9 +36579,9 @@ "integrity": "sha512-A/8PwLk/T7IJDfUdQ68NR24QHa8rIlnN/stiJEBo6dmVUkD4K14LswG0w3VwdeK/o7qOwRUR1k2MhK5Rpy2m7A==" }, "caniuse-lite": { - "version": "1.0.30001509", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001509.tgz", - "integrity": "sha512-2uDDk+TRiTX5hMcUYT/7CSyzMZxjfGu0vAUjS2g0LSD8UoXOv0LtpH4LxGMemsiPq6LCVIUjNwVM0erkOkGCDA==", + "version": "1.0.30001612", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001612.tgz", + "integrity": "sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==", "dev": true }, "caseless": { From d63c262f781ceb072d704365d00ea34ad73fb847 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Apr 2024 13:43:21 +0200 Subject: [PATCH 2/3] fix(linkBubble): only render when needed Prevents 503 requests during tests. See #5442. Signed-off-by: Max --- src/plugins/LinkBubblePluginView.js | 18 +++++++++--------- src/tests/nodes/TaskItem.spec.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/LinkBubblePluginView.js b/src/plugins/LinkBubblePluginView.js index e20ae89413a..17c48a47282 100644 --- a/src/plugins/LinkBubblePluginView.js +++ b/src/plugins/LinkBubblePluginView.js @@ -13,14 +13,6 @@ class LinkBubblePluginView { this.view = view this.plugin = plugin this.#editor = this.options.editor - - this.#component = new VueRenderer(LinkBubbleView, { - parent: this.options.parent, - propsData: { - editor: this.options.editor, - href: null, - }, - }) } addEventListeners() { @@ -71,6 +63,14 @@ class LinkBubblePluginView { return } + this.#component ||= new VueRenderer(LinkBubbleView, { + parent: this.options.parent, + propsData: { + editor: this.options.editor, + href: null, + }, + }) + this.tippy = tippy(editorElement, { duration: 100, getReferenceClientRect: null, @@ -112,7 +112,7 @@ class LinkBubblePluginView { } const clientRect = referenceEl?.getBoundingClientRect() - this.#component.updateProps({ + this.#component?.updateProps({ href: domHref(mark), }) diff --git a/src/tests/nodes/TaskItem.spec.js b/src/tests/nodes/TaskItem.spec.js index b0333d80dee..abc0a6d7b6e 100644 --- a/src/tests/nodes/TaskItem.spec.js +++ b/src/tests/nodes/TaskItem.spec.js @@ -18,7 +18,7 @@ describe('TaskItem extension', () => { expect(taskItem.spec.toMarkdown).toBeDefined() }) - test('markdown syntax is preserved through editor', () => { + it('markdown syntax is preserved through editor', () => { // Invalid ones but should be syntactical unchanged expect(markdownThroughEditor('- [F] asd')).toBe('- [F] asd') expect(markdownThroughEditor('- [ [asd](sdf)')).toBe('- [ [asd](sdf)') From 02af121e5ed891073bbf829cab9fc8ba085609d6 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 23 Apr 2024 13:46:41 +0200 Subject: [PATCH 3/3] fix(lint): trailing comma was missing Signed-off-by: Max --- src/plugins/LinkBubblePluginView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/LinkBubblePluginView.js b/src/plugins/LinkBubblePluginView.js index 17c48a47282..8fa511fa859 100644 --- a/src/plugins/LinkBubblePluginView.js +++ b/src/plugins/LinkBubblePluginView.js @@ -24,7 +24,7 @@ class LinkBubblePluginView { ) document.addEventListener('scroll', this.closeOnExternalEvents, - { capture: true } + { capture: true }, ) } @@ -37,7 +37,7 @@ class LinkBubblePluginView { ) document.removeEventListener('scroll', this.closeOnExternalEvents, - { capture: true } + { capture: true }, ) }