refactoring composer part2

This commit is contained in:
Samuel Andert
2023-08-03 14:35:15 +02:00
parent dcb94e7c58
commit 02d068fef3
7 changed files with 189 additions and 59 deletions

View File

@ -1,59 +1,5 @@
<script>
import Composer from '$lib/core/refactor/Composer.svelte';
let composer = {
id: 'ComposerParent',
layout: {
columns: '1fr 1fr',
areas: `
"left right"
`
},
children: [
{
id: 'ComposerBob',
component: 'ComposerBob',
slot: 'left',
store: {
machine: { state: 'NOTREADY' }
},
machine: {
initial: 'NOTREADY',
states: {
NOTREADY: {
on: { TOGGLE: 'READY' }
},
READY: {
on: { TOGGLE: 'NOTREADY' }
}
}
}
},
{
id: 'ComposerAlice',
component: 'ComposerAlice',
slot: 'right',
machine: {
initial: 'RED',
states: {
GREEN: {
on: { SWITCH: 'YELLOW' }
},
YELLOW: {
on: { SWITCH: 'RED' }
},
RED: {
on: { SWITCH: 'GREEN' }
}
},
on: {
READY: 'GREEN',
NOTREADY: 'RED'
}
}
}
]
};
import ComposerWrap from '$lib/components/refactor/ComposerWrap.svelte';
</script>
<Composer {composer} />
<ComposerWrap />