Refactorings for page and settings props
This commit is contained in:
parent
b136eaea17
commit
dd0eec0592
|
@ -295,6 +295,7 @@ const setCurrentPage = store => pageName => {
|
||||||
|
|
||||||
state.currentFrontEndType = "page"
|
state.currentFrontEndType = "page"
|
||||||
state.currentPageName = pageName
|
state.currentPageName = pageName
|
||||||
|
state.currentView = "detail"
|
||||||
state.screens = Array.isArray(current_screens)
|
state.screens = Array.isArray(current_screens)
|
||||||
? current_screens
|
? current_screens
|
||||||
: Object.values(current_screens)
|
: Object.values(current_screens)
|
||||||
|
@ -455,6 +456,7 @@ const setScreenType = store => type => {
|
||||||
|
|
||||||
state.currentComponentInfo = pageOrScreen ? pageOrScreen.props : null
|
state.currentComponentInfo = pageOrScreen ? pageOrScreen.props : null
|
||||||
state.currentPreviewItem = pageOrScreen
|
state.currentPreviewItem = pageOrScreen
|
||||||
|
state.currentView = "detail"
|
||||||
return state
|
return state
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,25 +58,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let componentInstance = {}
|
$: componentInstance = $store.currentView !== "component" ? {...$store.currentPreviewItem, ...$store.currentComponentInfo} : $store.currentComponentInfo
|
||||||
$: {
|
|
||||||
if(($store.currentFrontEndType === "screen" || $store.currentFrontEndType === "page") && $store.currentView !== "component") {
|
|
||||||
componentInstance = {...$store.currentPreviewItem, ...$store.currentComponentInfo}
|
|
||||||
}else {
|
|
||||||
componentInstance = $store.currentComponentInfo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onStyleChanged = store.setComponentStyle
|
const onStyleChanged = store.setComponentStyle
|
||||||
|
|
||||||
function onPropChanged(key, value) {
|
function onPropChanged(key, value) {
|
||||||
if($store.currentFrontEndType === "page") {
|
if($store.currentView !== "component") {
|
||||||
store.editPageOrScreen(key, value)
|
store.editPageOrScreen(key, value)
|
||||||
}else if($store.currentFrontEndType === "screen" && $store.currentView !== "component") {
|
return
|
||||||
store.editPageOrScreen(key, value)
|
|
||||||
}else {
|
|
||||||
store.setComponentProp(key, value)
|
|
||||||
}
|
}
|
||||||
|
store.setComponentProp(key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function walkProps(component, action) {
|
function walkProps(component, action) {
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
newScreenPicker.show()
|
newScreenPicker.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
$: console.log("STORE SCREENS", $store.screens)
|
|
||||||
let newScreenPicker
|
let newScreenPicker
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue