From 4239bb2cb573f97ede3c298a8919f3bd4177bc45 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 7 Feb 2022 12:49:33 +0000 Subject: [PATCH] Update rich text editor fullscreen and side-by-side modes to work on desktop and mobile properly with any type of layout navigation --- .../bbui/src/Form/Core/RichTextField.svelte | 2 +- packages/bbui/src/Form/RichTextField.svelte | 2 +- packages/bbui/src/Markdown/SpectrumMDE.svelte | 28 ++++++++++++++--- .../client/src/components/app/Layout.svelte | 31 +++++++++++++++++-- .../components/app/forms/LongFormField.svelte | 9 +++--- 5 files changed, 58 insertions(+), 14 deletions(-) diff --git a/packages/bbui/src/Form/Core/RichTextField.svelte b/packages/bbui/src/Form/Core/RichTextField.svelte index df39fc1a0a..f964405f0d 100644 --- a/packages/bbui/src/Form/Core/RichTextField.svelte +++ b/packages/bbui/src/Form/Core/RichTextField.svelte @@ -7,7 +7,7 @@ export let error = null export let height = null export let id = null - export let fullScreenOffset = 0 + export let fullScreenOffset = null export let easyMDEOptions = null diff --git a/packages/bbui/src/Form/RichTextField.svelte b/packages/bbui/src/Form/RichTextField.svelte index d357a13ae2..275242df49 100644 --- a/packages/bbui/src/Form/RichTextField.svelte +++ b/packages/bbui/src/Form/RichTextField.svelte @@ -11,7 +11,7 @@ export let error = null export let height = null export let id = null - export let fullScreenOffset = 0 + export let fullScreenOffset = null export let easyMDEOptions = null const dispatch = createEventDispatcher() diff --git a/packages/bbui/src/Markdown/SpectrumMDE.svelte b/packages/bbui/src/Markdown/SpectrumMDE.svelte index eb7198bf5b..9b0832c91f 100644 --- a/packages/bbui/src/Markdown/SpectrumMDE.svelte +++ b/packages/bbui/src/Markdown/SpectrumMDE.svelte @@ -8,7 +8,7 @@ export let easyMDEOptions = null export let mde = null export let id = null - export let fullScreenOffset = 0 + export let fullScreenOffset = null export let disabled = false let element @@ -30,9 +30,18 @@ mde.toTextArea() } }) + + $: styleString = getStyleString(fullScreenOffset) + + const getStyleString = offset => { + let string = "" + string += `--fullscreen-offset-x:${offset?.x || "0px"};` + string += `--fullscreen-offset-y:${offset?.y || "0px"};` + return string + } -
+