From 299637a0a026cdd3961cb1481426c88645039480 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 14 Feb 2025 13:12:00 +0100 Subject: [PATCH] Fix types --- packages/client/src/index.ts | 9 +------- packages/client/src/stores/builder.ts | 22 +++++++++---------- .../controllers/static/templates/preview.hbs | 1 - 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index c5df424361..4d2bd0e1e2 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -18,7 +18,6 @@ import type { ActionTypes } from "@/constants" import { Readable } from "svelte/store" import { Screen, - Layout, Theme, AppCustomTheme, PreviewDevice, @@ -57,13 +56,8 @@ declare global { "##BUDIBASE_PREVIEW_NAVIGATION##"?: AppNavigation "##BUDIBASE_HIDDEN_COMPONENT_IDS##"?: string[] "##BUDIBASE_USED_PLUGINS##"?: Plugin[] - "##BUDIBASE_LOCATION##"?: { - protocol: string - hostname: string - port: string - } "##BUDIBASE_SNIPPETS##"?: Snippet[] - "##BUDIBASE_COMPONENT_ERRORS##"?: Record[] + "##BUDIBASE_COMPONENT_ERRORS##"?: Record "##BUDIBASE_CUSTOM_COMPONENTS##"?: CustomComponent[] // Other flags @@ -122,7 +116,6 @@ const loadBudibase = async () => { navigation: window["##BUDIBASE_PREVIEW_NAVIGATION##"], hiddenComponentIds: window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"], usedPlugins: window["##BUDIBASE_USED_PLUGINS##"], - location: window["##BUDIBASE_LOCATION##"], snippets: window["##BUDIBASE_SNIPPETS##"], componentErrors: window["##BUDIBASE_COMPONENT_ERRORS##"], }) diff --git a/packages/client/src/stores/builder.ts b/packages/client/src/stores/builder.ts index 9fe84e0c6f..36ba7fffb8 100644 --- a/packages/client/src/stores/builder.ts +++ b/packages/client/src/stores/builder.ts @@ -18,19 +18,19 @@ import { interface BuilderStore { inBuilder: boolean - screen: Screen | null - selectedComponentId: string | null + screen?: Screen | null + selectedComponentId?: string | null editMode: boolean - previewId: string | null - theme: Theme | null - customTheme: AppCustomTheme | null - previewDevice: PreviewDevice - navigation: AppNavigation | null - hiddenComponentIds: string[] - usedPlugins: Plugin[] | null + previewId?: number | null + theme?: Theme | null + customTheme?: AppCustomTheme | null + previewDevice?: PreviewDevice + navigation?: AppNavigation | null + hiddenComponentIds?: string[] + usedPlugins?: Plugin[] | null metadata: { componentId: string; step: number } | null - snippets: Snippet[] | null - componentErrors: Record + snippets?: Snippet[] | null + componentErrors?: Record } const createBuilderStore = () => { diff --git a/packages/server/src/api/controllers/static/templates/preview.hbs b/packages/server/src/api/controllers/static/templates/preview.hbs index 5eb8a8bcbb..fc6de9a28c 100644 --- a/packages/server/src/api/controllers/static/templates/preview.hbs +++ b/packages/server/src/api/controllers/static/templates/preview.hbs @@ -89,7 +89,6 @@ window["##BUDIBASE_PREVIEW_NAVIGATION##"] = navigation window["##BUDIBASE_HIDDEN_COMPONENT_IDS##"] = hiddenComponentIds window["##BUDIBASE_USED_PLUGINS##"] = usedPlugins - window["##BUDIBASE_LOCATION##"] = location window["##BUDIBASE_SNIPPETS##"] = snippets window['##BUDIBASE_COMPONENT_ERRORS##'] = componentErrors