Remove transition setting from components

This commit is contained in:
Andrew Kingston 2021-06-18 12:41:15 +01:00
parent e3c064901d
commit be03bbe5bc
11 changed files with 2 additions and 66 deletions

View File

@ -305,7 +305,6 @@ export const getFrontendStore = () => {
_id: uuid(), _id: uuid(),
_component: definition.component, _component: definition.component,
_styles: { normal: {}, hover: {}, active: {} }, _styles: { normal: {}, hover: {}, active: {} },
_transition: "",
_instanceName: `New ${definition.name}`, _instanceName: `New ${definition.name}`,
...cloneDeep(props), ...cloneDeep(props),
...extras, ...extras,
@ -508,15 +507,6 @@ export const getFrontendStore = () => {
selected._styles = { normal: {}, hover: {}, active: {} } selected._styles = { normal: {}, hover: {}, active: {} }
await store.actions.preview.saveSelected() await store.actions.preview.saveSelected()
}, },
updateTransition: async transition => {
const selected = get(selectedComponent)
if (transition == null || transition === "") {
selected._transition = ""
} else {
selected._transition = transition
}
await store.actions.preview.saveSelected()
},
updateProp: async (name, value) => { updateProp: async (name, value) => {
let component = get(selectedComponent) let component = get(selectedComponent)
if (!name || !component) { if (!name || !component) {

View File

@ -14,7 +14,6 @@ export class Component extends BaseStructure {
active: {}, active: {},
selected: {}, selected: {},
}, },
_transition: "",
_instanceName: "", _instanceName: "",
_children: [], _children: [],
} }
@ -40,11 +39,6 @@ export class Component extends BaseStructure {
return this return this
} }
transition(transition) {
this._json._transition = transition
return this
}
// Shorthand for custom props "type" // Shorthand for custom props "type"
type(type) { type(type) {
this._json.type = type this._json.type = type

View File

@ -55,7 +55,6 @@
if (routeError) return false if (routeError) return false
draftScreen.props._instanceName = name draftScreen.props._instanceName = name
draftScreen.props._transition = "fade"
draftScreen.props._component = baseComponent draftScreen.props._component = baseComponent
draftScreen.routing = { route, roleId } draftScreen.routing = { route, roleId }

View File

@ -8,7 +8,6 @@
export let componentInstance = {} export let componentInstance = {}
export let onStyleChanged = () => {} export let onStyleChanged = () => {}
export let onCustomStyleChanged = () => {} export let onCustomStyleChanged = () => {}
export let onUpdateTransition = () => {}
export let onResetStyles = () => {} export let onResetStyles = () => {}
let selectedCategory = "normal" let selectedCategory = "normal"
@ -24,14 +23,6 @@
{ value: "active", text: "Active" }, { value: "active", text: "Active" },
] ]
const transitions = [
"none",
"fade",
"blur",
"fly",
"scale", // slide is hidden because it does not seem to result in any effect
]
const capitalize = ([first, ...rest]) => first.toUpperCase() + rest.join("") const capitalize = ([first, ...rest]) => first.toUpperCase() + rest.join("")
$: groups = componentDefinition?.styleable ? Object.keys(allStyles) : [] $: groups = componentDefinition?.styleable ? Object.keys(allStyles) : []
@ -78,18 +69,6 @@
{/if} {/if}
</div> </div>
</div> </div>
{#if componentDefinition?.transitionable}
<div class="transitions">
<Select
value={componentInstance._transition}
on:change={event => onUpdateTransition(event.detail)}
name="transition"
label="Transition"
options={transitions}
getOptionLabel={capitalize}
/>
</div>
{/if}
</div> </div>
<style> <style>

View File

@ -18,7 +18,6 @@
const onStyleChanged = store.actions.components.updateStyle const onStyleChanged = store.actions.components.updateStyle
const onCustomStyleChanged = store.actions.components.updateCustomStyle const onCustomStyleChanged = store.actions.components.updateCustomStyle
const onUpdateTransition = store.actions.components.updateTransition
const onResetStyles = store.actions.components.resetStyles const onResetStyles = store.actions.components.resetStyles
function setAssetProps(name, value) { function setAssetProps(name, value) {
@ -64,7 +63,6 @@
componentDefinition={definition} componentDefinition={definition}
{onStyleChanged} {onStyleChanged}
{onCustomStyleChanged} {onCustomStyleChanged}
{onUpdateTransition}
{onResetStyles} {onResetStyles}
/> />
</div> </div>

View File

@ -54,7 +54,6 @@
children: children.length, children: children.length,
styles: { ...instance._styles, id, empty, interactive }, styles: { ...instance._styles, id, empty, interactive },
empty, empty,
transition: instance._transition,
selected, selected,
props: componentProps, props: componentProps,
name, name,

View File

@ -7,7 +7,6 @@ import {
builderStore, builderStore,
} from "./store" } from "./store"
import { styleable } from "./utils/styleable" import { styleable } from "./utils/styleable"
import transition from "./utils/transition"
import { linkable } from "./utils/linkable" import { linkable } from "./utils/linkable"
import { getAction } from "./utils/getAction" import { getAction } from "./utils/getAction"
import Provider from "./components/Provider.svelte" import Provider from "./components/Provider.svelte"
@ -21,7 +20,6 @@ export default {
screenStore, screenStore,
builderStore, builderStore,
styleable, styleable,
transition,
linkable, linkable,
getAction, getAction,
Provider, Provider,

View File

@ -1,16 +0,0 @@
import { fade, blur, scale, fly } from "svelte/transition"
// Default options
const transitions = new Map([
["fade", { tn: fade, opt: {} }],
["blur", { tn: blur, opt: {} }],
// This one seems to not result in any effect
// ["slide", { tn: slide, opt: {} }],
["scale", { tn: scale, opt: {} }],
["fly", { tn: fly, opt: { y: 80 } }],
])
export default function transition(node, { type, options = {} }) {
const { tn, opt } = transitions.get(type) || { tn: () => {}, opt: {} }
return tn(node, { ...opt, ...options })
}

View File

@ -5,7 +5,6 @@
"icon": "Sandbox", "icon": "Sandbox",
"hasChildren": true, "hasChildren": true,
"styleable": true, "styleable": true,
"transitionable": true,
"illegalChildren": [], "illegalChildren": [],
"settings": [ "settings": [
{ {
@ -63,7 +62,6 @@
"icon": "Sandbox", "icon": "Sandbox",
"hasChildren": true, "hasChildren": true,
"styleable": true, "styleable": true,
"transitionable": true,
"illegalChildren": ["section"], "illegalChildren": ["section"],
"showSettingsBar": true, "showSettingsBar": true,
"settings": [ "settings": [
@ -183,7 +181,6 @@
"icon": "ColumnTwoB", "icon": "ColumnTwoB",
"hasChildren": true, "hasChildren": true,
"styleable": true, "styleable": true,
"transitionable": true,
"illegalChildren": ["Section"], "illegalChildren": ["Section"],
"showEmptyState": false, "showEmptyState": false,
"settings": [ "settings": [

View File

@ -1,7 +1,7 @@
<script> <script>
import { getContext } from "svelte" import { getContext } from "svelte"
const { styleable, transition } = getContext("sdk") const { styleable } = getContext("sdk")
const component = getContext("component") const component = getContext("component")
export let direction export let direction
@ -17,7 +17,6 @@
<div <div
class={[directionClass, hAlignClass, vAlignClass, sizeClass].join(" ")} class={[directionClass, hAlignClass, vAlignClass, sizeClass].join(" ")}
in:transition={{ type: $component.transition }}
use:styleable={$component.styles} use:styleable={$component.styles}
> >
<slot /> <slot />

View File

@ -2,7 +2,7 @@
import { getContext } from "svelte" import { getContext } from "svelte"
import Placeholder from "./Placeholder.svelte" import Placeholder from "./Placeholder.svelte"
const { styleable, transition, builderStore } = getContext("sdk") const { styleable, builderStore } = getContext("sdk")
const component = getContext("component") const component = getContext("component")
export let type = "mainSidebar" export let type = "mainSidebar"
@ -31,7 +31,6 @@
<div <div
bind:clientWidth={containerWidth} bind:clientWidth={containerWidth}
in:transition={{ type: $component.transition }}
class="{type} columns-{columnsDependingOnSize}" class="{type} columns-{columnsDependingOnSize}"
use:styleable={$component.styles} use:styleable={$component.styles}
> >