From 29c69bd544898c70d3ab7d577a993e9f6a757945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 6 Mar 2024 10:33:00 +0100 Subject: [PATCH 1/3] fix: Disable nested embedding fully MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/EditorFactory.js | 3 ++- src/components/Editor.vue | 2 ++ src/components/ViewerComponent.vue | 10 ++++++++++ src/extensions/RichText.js | 5 ++++- src/nodes/Paragraph.js | 6 ++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/EditorFactory.js b/src/EditorFactory.js index af57e08f736..c30371c22c2 100644 --- a/src/EditorFactory.js +++ b/src/EditorFactory.js @@ -49,12 +49,13 @@ const loadSyntaxHighlight = async (language) => { } } -const createEditor = ({ language, onCreate, onUpdate = () => {}, extensions, enableRichEditing, session, relativePath }) => { +const createEditor = ({ language, onCreate, onUpdate = () => {}, extensions, enableRichEditing, session, relativePath, isEmbedded = false }) => { let defaultExtensions if (enableRichEditing) { defaultExtensions = [ RichText.configure({ relativePath, + isEmbedded, component: this, extensions: [ Mention.configure({ diff --git a/src/components/Editor.vue b/src/components/Editor.vue index caa2d7727c7..90436699b9a 100644 --- a/src/components/Editor.vue +++ b/src/components/Editor.vue @@ -181,6 +181,7 @@ export default { return val }, + inject: ['isEmbedded'], props: { richWorkspace: { type: Boolean, @@ -542,6 +543,7 @@ export default { }), ], enableRichEditing: this.isRichEditor, + isEmbedded: this.isEmbedded, }) this.hasEditor = true if (!documentState && documentSource) { diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue index 13f3a0f3246..c22c9f86d45 100644 --- a/src/components/ViewerComponent.vue +++ b/src/components/ViewerComponent.vue @@ -27,6 +27,7 @@ :active="active" :autofocus="autofocus" :share-token="shareToken" + :is-embedded="isEmbedded" :mime="mime" :show-outline-outside="showOutlineOutside" />
Object.assign(rule, { preserveWhitespace: 'full' })) }, From f49005304934c9c0d425eb591ca34806ca1859c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 7 Mar 2024 10:21:26 +0100 Subject: [PATCH 2/3] fix: Also load if embedded property is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/ViewerComponent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue index c22c9f86d45..1279698d54e 100644 --- a/src/components/ViewerComponent.vue +++ b/src/components/ViewerComponent.vue @@ -24,7 +24,7 @@ Date: Thu, 7 Mar 2024 10:52:45 +0100 Subject: [PATCH 3/3] fix: Adjust to new preview node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/Link/LinkBubbleView.vue | 1 + src/components/ViewerComponent.vue | 1 - src/extensions/RichText.js | 8 ++++---- src/nodes/Paragraph.js | 6 ------ src/nodes/Preview.js | 1 + src/nodes/Preview.vue | 3 ++- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/components/Link/LinkBubbleView.vue b/src/components/Link/LinkBubbleView.vue index e0245c2a7d8..e62bad78354 100644 --- a/src/components/Link/LinkBubbleView.vue +++ b/src/components/Link/LinkBubbleView.vue @@ -73,6 +73,7 @@ ref="referencelist" :text="sanitizedHref" :limit="1" + :interactive="false" :display-fallback="true" class="link-view-bubble__reference-list" @loaded="onReferenceListLoaded" /> diff --git a/src/components/ViewerComponent.vue b/src/components/ViewerComponent.vue index 1279698d54e..8c6b22fb1ad 100644 --- a/src/components/ViewerComponent.vue +++ b/src/components/ViewerComponent.vue @@ -27,7 +27,6 @@ :active="active || isEmbedded" :autofocus="autofocus" :share-token="shareToken" - :is-embedded="isEmbedded" :mime="mime" :show-outline-outside="showOutlineOutside" />
Object.assign(rule, { preserveWhitespace: 'full' })) }, diff --git a/src/nodes/Preview.js b/src/nodes/Preview.js index 94628bda3a0..98eaef15c33 100644 --- a/src/nodes/Preview.js +++ b/src/nodes/Preview.js @@ -38,6 +38,7 @@ export default Node.create({ addOptions() { return { + isEmbedded: false, relativePath: null, } }, diff --git a/src/nodes/Preview.vue b/src/nodes/Preview.vue index 8375fe16341..9bc01cbe65a 100644 --- a/src/nodes/Preview.vue +++ b/src/nodes/Preview.vue @@ -29,7 +29,8 @@ :value.sync="value" @update:value="convertToParagraph" /> + :limit="1" + :interactive="!extension.options.isEmbedded" />