Skip to content

Commit

Permalink
fix: Adjust to new preview node
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Mar 7, 2024
1 parent f490053 commit a4a572f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/components/Link/LinkBubbleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
ref="referencelist"
:text="sanitizedHref"
:limit="1"
:interactive="false"
:display-fallback="true"
class="link-view-bubble__reference-list"
@loaded="onReferenceListLoaded" />
Expand Down
1 change: 0 additions & 1 deletion src/components/ViewerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
:active="active || isEmbedded"
:autofocus="autofocus"
:share-token="shareToken"
:is-embedded="isEmbedded"
:mime="mime"
:show-outline-outside="showOutlineOutside" />
<div v-else
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/RichText.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export default Extension.create({
this.options.editing ? Markdown : null,
Document,
Text,
Paragraph.configure({
isEmbedded: this.options.isEmbedded,
}),
Paragraph,
HardBreak,
Heading,
Strong,
Expand All @@ -105,7 +103,9 @@ export default Extension.create({
TaskList,
TaskItem,
Callouts,
Preview,
Preview.configure({
isEmbedded: this.options.isEmbedded,
}),
Underline,
Image,
ImageInline,
Expand Down
6 changes: 0 additions & 6 deletions src/nodes/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ const Paragraph = TiptapParagraph.extend({
return VueNodeViewRenderer(ParagraphView)
},

addOptions() {
return {
isEmbedded: false,
}
},

parseHTML() {
return this.parent().map(rule => Object.assign(rule, { preserveWhitespace: 'full' }))
},
Expand Down
1 change: 1 addition & 0 deletions src/nodes/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default Node.create({

addOptions() {
return {
isEmbedded: false,
relativePath: null,
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/nodes/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
:value.sync="value"
@update:value="convertToParagraph" />
<NcReferenceList :text="node.attrs.href"
:limit="1" />
:limit="1"
:interactive="!extension.options.isEmbedded" />
</NodeViewWrapper>
</template>

Expand Down

0 comments on commit a4a572f

Please sign in to comment.