diff --git a/packages/builder/src/builderStore/store.js b/packages/builder/src/builderStore/store.js index 28e4007087..85b959e16b 100644 --- a/packages/builder/src/builderStore/store.js +++ b/packages/builder/src/builderStore/store.js @@ -37,6 +37,7 @@ export const getStore = () => { currentFrontEndItem:null, currentComponentInfo:null, currentComponentIsNew:false, + currentFrontEndType:"none", currentPageName: "", currentNodeIsNew: false, errors: [], @@ -501,12 +502,11 @@ const renameDerivedComponent = store => (oldname, newname) => { const savePage = store => async page => { store.update(s => { - if(s.currentFrontEndIsComponent || !s.currentFrontEndItem) { + if(s.currentFrontEndType === "page" || !s.currentPageName) { return; } s.pages[s.currentPageName] = page; - s.currentFrontEndItem = page; savePackage(store, s); return s; }); @@ -624,7 +624,7 @@ const savePackage = (store, s) => { const setCurrentComponent = store => component => { store.update(s => { s.currentFrontEndItem = component; - s.currentFrontEndIsComponent = true; + s.currentFrontEndType = "component"; s.currentComponentIsNew = false; s.currentComponentInfo = getComponentInfo(s.allComponents, component.name); return s; @@ -633,8 +633,7 @@ const setCurrentComponent = store => component => { const setCurrentPage = store => pageName => { store.update(s => { - s.currentFrontEndItem = s.pages[pageName]; - s.currentFrontEndIsComponent = false; + s.currentFrontEndType = "page"; s.currentPageName = pageName; return s; }) diff --git a/packages/builder/src/userInterface/ComponentsHierarchy.svelte b/packages/builder/src/userInterface/ComponentsHierarchy.svelte index a9e0a498f7..bba67e28da 100644 --- a/packages/builder/src/userInterface/ComponentsHierarchy.svelte +++ b/packages/builder/src/userInterface/ComponentsHierarchy.svelte @@ -87,8 +87,9 @@ const expandFolder = folder => { } -const isComponentSelected = (current,c) => - current +const isComponentSelected = (type, current,c) => + type==="component" + && current && current.name === c.name const isFolderSelected = (current, folder) => @@ -134,7 +135,7 @@ $: { {/each} {#each componentsThisLevel as component} -
Name | \nPermissions | \n\n |
---|---|---|
{level.name} | \n{getPermissionsString(level.permissions)} | \n\n onLevelEdit(level)}>{@html getIcon(\"edit\")}\n onLevelDelete(level)}>{@html getIcon(\"trash\")}\n | \n
Name | \nPermissions | \n\n |
---|---|---|
{level.name} | \n{getPermissionsString(level.permissions)} | \n\n onLevelEdit(level)}>{@html getIcon(\"edit\")}\n onLevelDelete(level)}>{@html getIcon(\"trash\")}\n | \n
Component Libraries\n \n \n \n \n
\n {#each $store.pages.componentLibraries as lib}\nStylesheets\n \n \n \n \n
\n {#each $store.pages.stylesheets as stylesheet}\n