From b3e23562f024782b2b446badd0966ed8e3ed0e13 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 8 Jun 2023 15:12:50 +0100 Subject: [PATCH] Update in builder preview to be a full screen overlay rather than opening in a new tab --- .../src/builderStore/store/frontend.js | 1 + .../src/components/deploy/AppActions.svelte | 5 +- .../_components/PreviewOverlay.svelte | 69 +++++++++++++++++++ .../builder/app/[application]/_layout.svelte | 11 ++- packages/client/src/api/api.js | 10 +-- .../client/src/components/ClientApp.svelte | 6 +- .../components/devtools/DevToolsHeader.svelte | 47 +++++++++---- packages/client/src/index.js | 6 -- .../client/src/stores/derived/currentRole.js | 7 +- .../src/stores/derived/devToolsEnabled.js | 10 +++ packages/client/src/stores/derived/index.js | 1 + packages/client/src/stores/devTools.js | 10 +-- 12 files changed, 141 insertions(+), 42 deletions(-) create mode 100644 packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte create mode 100644 packages/client/src/stores/derived/devToolsEnabled.js diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 7f83b2b464..d0414b5733 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -74,6 +74,7 @@ const INITIAL_FRONTEND_STATE = { propertyFocus: null, builderSidePanel: false, hasLock: true, + showPreview: false, // URL params selectedScreenId: null, diff --git a/packages/builder/src/components/deploy/AppActions.svelte b/packages/builder/src/components/deploy/AppActions.svelte index 9813237317..a85eb5a154 100644 --- a/packages/builder/src/components/deploy/AppActions.svelte +++ b/packages/builder/src/components/deploy/AppActions.svelte @@ -62,7 +62,10 @@ } const previewApp = () => { - window.open(`/${application}`) + store.update(state => ({ + ...state, + showPreview: true, + })) } const viewApp = () => { diff --git a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte new file mode 100644 index 0000000000..1715b54ba0 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte @@ -0,0 +1,69 @@ + + +
+
+