diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 19987764e5..f195ea4d99 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -285,6 +285,7 @@ export const getFrontendStore = () => { _id: uuid(), _component: definition.component, _styles: { normal: {}, hover: {}, active: {} }, + _transition: "", _instanceName: `New ${definition.name}`, ...cloneDeep(props), ...extras, @@ -487,6 +488,15 @@ export const getFrontendStore = () => { selected._styles = { normal: {}, hover: {}, active: {} } await store.actions.preview.saveSelected() }, + updateTransition: async (transition) => { + const selected = get(selectedComponent) + if (transition == null || transition === "") { + selected = "" + } else { + selected._transition = transition + } + await store.actions.preview.saveSelected() + }, updateProp: async (name, value) => { let component = get(selectedComponent) if (!name || !component) { diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js b/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js index 182736a1d5..c4085e483c 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js +++ b/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js @@ -14,6 +14,7 @@ export class Component extends BaseStructure { active: {}, selected: {}, }, + _transition: "", _instanceName: "", _children: [], } @@ -39,6 +40,11 @@ export class Component extends BaseStructure { return this } + transition(transition) { + this._json._transition = transition + return this + } + // Shorthand for custom props "type" type(type) { this._json.type = type diff --git a/packages/builder/src/components/design/PropertiesPanel/DesignView.svelte b/packages/builder/src/components/design/PropertiesPanel/DesignView.svelte index dee6595ed5..d40fe7c8e7 100644 --- a/packages/builder/src/components/design/PropertiesPanel/DesignView.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/DesignView.svelte @@ -1,5 +1,5 @@ -