Move data to builder

This commit is contained in:
Adria Navarro 2025-01-20 20:06:02 +01:00
parent 3c4ac9ad5a
commit 75dab572e9
4 changed files with 8 additions and 4 deletions

View File

@ -68,6 +68,9 @@
port: window.location.port, port: window.location.port,
}, },
snippets: $snippets, snippets: $snippets,
componentErrors: {
c5ea93132725c48b2a365fcc1facaee86: ["Ups...!"],
}, // TODO
} }
// Refresh the preview when required // Refresh the preview when required

View File

@ -43,6 +43,7 @@ const loadBudibase = async () => {
usedPlugins: window["##BUDIBASE_USED_PLUGINS##"], usedPlugins: window["##BUDIBASE_USED_PLUGINS##"],
location: window["##BUDIBASE_LOCATION##"], location: window["##BUDIBASE_LOCATION##"],
snippets: window["##BUDIBASE_SNIPPETS##"], snippets: window["##BUDIBASE_SNIPPETS##"],
componentErrors: window["##BUDIBASE_COMPONENT_ERRORS##"],
}) })
// Set app ID - this window flag is set by both the preview and the real // Set app ID - this window flag is set by both the preview and the real

View File

@ -19,9 +19,7 @@ const createBuilderStore = () => {
eventResolvers: {}, eventResolvers: {},
metadata: null, metadata: null,
snippets: null, snippets: null,
componentErrors: { componentErrors: {},
c5ea93132725c48b2a365fcc1facaee86: ["Ups...!"],
}, // TODO
// Legacy - allow the builder to specify a layout // Legacy - allow the builder to specify a layout
layout: null, layout: null,

View File

@ -73,7 +73,8 @@
hiddenComponentIds, hiddenComponentIds,
usedPlugins, usedPlugins,
location, location,
snippets snippets,
componentErrors
} = parsed } = parsed
// Set some flags so the app knows we're in the builder // Set some flags so the app knows we're in the builder
@ -91,6 +92,7 @@
window["##BUDIBASE_USED_PLUGINS##"] = usedPlugins window["##BUDIBASE_USED_PLUGINS##"] = usedPlugins
window["##BUDIBASE_LOCATION##"] = location window["##BUDIBASE_LOCATION##"] = location
window["##BUDIBASE_SNIPPETS##"] = snippets window["##BUDIBASE_SNIPPETS##"] = snippets
window['##BUDIBASE_COMPONENT_ERRORS##'] = componentErrors
// Initialise app // Initialise app
try { try {