This commit is contained in:
Michael Shanks 2020-06-02 11:16:30 +01:00
parent a95e244767
commit 50bdb7801f
3 changed files with 9 additions and 9 deletions

View File

@ -23,7 +23,7 @@ import {
savePage as _savePage, savePage as _savePage,
saveCurrentPreviewItem as _saveCurrentPreviewItem, saveCurrentPreviewItem as _saveCurrentPreviewItem,
saveScreenApi as _saveScreenApi, saveScreenApi as _saveScreenApi,
regenerateCssForCurentScreen, regenerateCssForCurrentScreen,
} from "../storeUtils" } from "../storeUtils"
export const getStore = () => { export const getStore = () => {
@ -178,7 +178,7 @@ const setCurrentScreen = store => screenName => {
s.currentPreviewItem = screen s.currentPreviewItem = screen
s.currentFrontEndType = "screen" s.currentFrontEndType = "screen"
s.currentView = "detail" s.currentView = "detail"
regenerateCssForCurentScreen(s) regenerateCssForCurrentScreen(s)
const safeProps = makePropsSafe( const safeProps = makePropsSafe(
s.components[screen.props._component], s.components[screen.props._component],
screen.props screen.props
@ -296,7 +296,7 @@ const setCurrentPage = store => pageName => {
state.currentComponentInfo = safeProps state.currentComponentInfo = safeProps
currentPage.props = safeProps currentPage.props = safeProps
state.currentPreviewItem = state.pages[pageName] state.currentPreviewItem = state.pages[pageName]
regenerateCssForCurentScreen(state) regenerateCssForCurrentScreen(state)
for (let screen of state.screens) { for (let screen of state.screens) {
screen._css = generate_screen_css([screen.props]) screen._css = generate_screen_css([screen.props])
@ -373,7 +373,7 @@ const addTemplatedComponent = store => props => {
state.currentComponentInfo._children = state.currentComponentInfo._children.concat( state.currentComponentInfo._children = state.currentComponentInfo._children.concat(
props props
) )
regenerateCssForCurentScreen(state) regenerateCssForCurrentScreen(state)
setCurrentPageFunctions(state) setCurrentPageFunctions(state)
_saveCurrentPreviewItem(state) _saveCurrentPreviewItem(state)
@ -407,7 +407,7 @@ const setComponentStyle = store => (type, name, value) => {
} }
state.currentComponentInfo._styles[type][name] = value state.currentComponentInfo._styles[type][name] = value
regenerateCssForCurentScreen(state) regenerateCssForCurrentScreen(state)
// save without messing with the store // save without messing with the store
_saveCurrentPreviewItem(state) _saveCurrentPreviewItem(state)

View File

@ -59,7 +59,7 @@ export const walkProps = (props, action, cancelToken = null) => {
} }
} }
export const regenerateCssForCurentScreen = state => { export const regenerateCssForCurrentScreen = state => {
state.currentPreviewItem._css = generate_screen_css([ state.currentPreviewItem._css = generate_screen_css([
state.currentPreviewItem.props, state.currentPreviewItem.props,
]) ])

View File

@ -10,7 +10,7 @@
getParent, getParent,
walkProps, walkProps,
saveCurrentPreviewItem, saveCurrentPreviewItem,
regenerateCssForCurentScreen, regenerateCssForCurrentScreen,
} from "builderStore/storeUtils" } from "builderStore/storeUtils"
import { uuid } from "builderStore/uuid" import { uuid } from "builderStore/uuid"
@ -86,7 +86,7 @@
parent._children = [...parent._children, copiedComponent] parent._children = [...parent._children, copiedComponent]
saveCurrentPreviewItem(s) saveCurrentPreviewItem(s)
s.currentComponentInfo = copiedComponent s.currentComponentInfo = copiedComponent
regenerateCssForCurentScreen(s) regenerateCssForCurrentScreen(s)
return s return s
}) })
} }
@ -142,7 +142,7 @@
const targetIndex = parent._children.indexOf(component) const targetIndex = parent._children.indexOf(component)
const index = mode === "above" ? targetIndex : targetIndex + 1 const index = mode === "above" ? targetIndex : targetIndex + 1
parent._children.splice(index, 0, cloneDeep(componentToPaste)) parent._children.splice(index, 0, cloneDeep(componentToPaste))
regenerateCssForCurentScreen(s) regenerateCssForCurrentScreen(s)
saveCurrentPreviewItem(s) saveCurrentPreviewItem(s)
selectComponent(s, componentToPaste) selectComponent(s, componentToPaste)