diff --git a/packages/builder/src/builderStore/store.js b/packages/builder/src/builderStore/store.js index 2a00582bc8..96802e5699 100644 --- a/packages/builder/src/builderStore/store.js +++ b/packages/builder/src/builderStore/store.js @@ -508,14 +508,6 @@ const removeComponentLibrary = store => lib => { const addStylesheet = store => stylesheet => { store.update(s => { s.pages.stylesheets.push(stylesheet); - - const styles = document.createElement('link'); - styles.rel = 'stylesheet'; - styles.type = 'text/css'; - styles.media = 'screen'; - styles.href = stylesheet; - document.getElementsByTagName('head')[0].appendChild(styles); - savePackage(store, s); return s; }) @@ -554,14 +546,14 @@ const savePackage = (store, s) => { hierarchy:s.hierarchy, triggers:s.triggers, actions: groupBy("name")(s.actions), - pages:s.pages, mainUi: s.mainUi, unauthenticatedUi: s.unauthenticatedUi }; const data = { appDefinition, - accessLevels:s.accessLevels + accessLevels:s.accessLevels, + pages:s.pages, } api.post(`/_builder/api/${s.appname}/appPackage`, data); diff --git a/packages/builder/src/userInterface/CurrentItemPreview.svelte b/packages/builder/src/userInterface/CurrentItemPreview.svelte index f9ebd9d669..1317328e83 100644 --- a/packages/builder/src/userInterface/CurrentItemPreview.svelte +++ b/packages/builder/src/userInterface/CurrentItemPreview.svelte @@ -2,39 +2,57 @@ import { store } from "../builderStore"; import { last, - split + split, + map, + join } from "lodash/fp"; import { pipe } from "../common/core"; import { splitName } from "./pagesParsing/splitRootComponentName" +import { afterUpdate } from 'svelte'; let component; +let stylesheetLinks = ""; +let componentHtml = ""; store.subscribe(s => { const {componentName, libName} = splitName( s.currentComponentInfo.rootComponent.name); component = s.libraries[libName][componentName]; + stylesheetLinks = pipe(s.pages.stylesheets, [ + map(s => ``), + join("\n") + ]) }); + + +afterUpdate(() => { + componentHtml = document.getElementById("comonent-container-mock").innerHTML +}); + +