From 69f18072890e45732629cb8d2c6faa47cd907805 Mon Sep 17 00:00:00 2001 From: mrsadman99 <60566490+mrsadman99@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:21:09 +0700 Subject: [PATCH] EZQ-49: Update collaborator (#2677) Signed-off-by: Anton Brechka --- .../src/components/CollaboratorEditor.svelte | 271 +++++++++--------- .../src/components/DocumentEditor.svelte | 2 +- 2 files changed, 139 insertions(+), 134 deletions(-) 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}