diff --git a/packages/text-editor/src/components/CollaboratorEditor.svelte b/packages/text-editor/src/components/CollaboratorEditor.svelte index e37f33d773..b540ca96f6 100644 --- a/packages/text-editor/src/components/CollaboratorEditor.svelte +++ b/packages/text-editor/src/components/CollaboratorEditor.svelte @@ -65,6 +65,7 @@ export let documentId: string export let readonly = false + export let visible = true export let token: string export let collaboratorURL: string @@ -129,8 +130,10 @@ editor.commands.toggleStrike() } - export function getHTML (): string { - return editor.getHTML() + export function getHTML (): string | undefined { + if (editor) { + return editor.getHTML() + } } export function getLink () { @@ -466,144 +469,146 @@ let showDiff = true -
- {#if isFormatting && !readonly} -
-
- - - - - - -
- - -
- -
- - - - - {#if activeModes.has('table')} - - {/if} -
-
- {#if comparedVersion !== undefined} +{#if visible} +
+ {#if isFormatting && !readonly} +
{ - showDiff = !showDiff - editor.chain().focus() - }} + selected={activeModes.has('heading')} + showTooltip={{ label: getEmbeddedLabel(`H${headingLevel}`) }} + on:click={toggleHeader} /> - + + + + + +
+ + +
+ +
+ + + + + {#if activeModes.has('table')} + + {/if}
- {:else} -
- -
- {/if} +
+ {#if comparedVersion !== undefined} +
+ { + showDiff = !showDiff + editor.chain().focus() + }} + /> + +
+ {:else} +
+ +
+ {/if} +
+ {:else if comparedVersion !== undefined} +
+ { + showDiff = !showDiff + editor.chain().focus() + }} + /> + +
+ {/if} +
+
- {:else if comparedVersion !== undefined} -
- { - showDiff = !showDiff - editor.chain().focus() - }} - /> - -
- {/if} -
-
-
+{/if}