|
|
@ -30,7 +30,10 @@ |
|
|
let selectedCategory = categories[0] |
|
|
let selectedCategory = categories[0] |
|
|
|
|
|
|
|
|
$: components = $store.components |
|
|
$: components = $store.components |
|
|
$: componentInstance = $store.currentView !== "component" ? {...$store.currentPreviewItem, ...$store.currentComponentInfo} : $store.currentComponentInfo |
|
|
$: componentInstance = |
|
|
|
|
|
$store.currentView !== "component" |
|
|
|
|
|
? { ...$store.currentPreviewItem, ...$store.currentComponentInfo } |
|
|
|
|
|
: $store.currentComponentInfo |
|
|
$: componentDefinition = $store.components[componentInstance._component] |
|
|
$: componentDefinition = $store.components[componentInstance._component] |
|
|
$: componentPropDefinition = |
|
|
$: componentPropDefinition = |
|
|
flattenedPanel.find( |
|
|
flattenedPanel.find( |
|
|
@ -46,18 +49,21 @@ |
|
|
|
|
|
|
|
|
const onStyleChanged = store.setComponentStyle |
|
|
const onStyleChanged = store.setComponentStyle |
|
|
|
|
|
|
|
|
function onPropChanged(key, value) { |
|
|
function onPropChanged(key, value) { |
|
|
if($store.currentView !== "component") { |
|
|
if ($store.currentView !== "component") { |
|
|
store.setPageOrScreenProp(key, value) |
|
|
store.setPageOrScreenProp(key, value) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
store.setComponentProp(key, value) |
|
|
store.setComponentProp(key, value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$: isComponentOrScreen = $store.currentView === "component" || $store.currentFrontEndType === "screen" |
|
|
$: isComponentOrScreen = |
|
|
|
|
|
$store.currentView === "component" || |
|
|
|
|
|
$store.currentFrontEndType === "screen" |
|
|
$: isNotScreenslot = componentInstance._component !== "##builtin/screenslot" |
|
|
$: isNotScreenslot = componentInstance._component !== "##builtin/screenslot" |
|
|
|
|
|
|
|
|
$: displayName = isComponentOrScreen && componentInstance._instanceName && isNotScreenslot |
|
|
$: displayName = |
|
|
|
|
|
isComponentOrScreen && componentInstance._instanceName && isNotScreenslot |
|
|
|
|
|
|
|
|
function walkProps(component, action) { |
|
|
function walkProps(component, action) { |
|
|
action(component) |
|
|
action(component) |
|
|
@ -92,11 +98,11 @@ |
|
|
{categories} |
|
|
{categories} |
|
|
{selectedCategory} /> |
|
|
{selectedCategory} /> |
|
|
|
|
|
|
|
|
{#if displayName} |
|
|
{#if displayName} |
|
|
<div class="instance-name"> |
|
|
<div class="instance-name"> |
|
|
<strong>{componentInstance._instanceName}</strong> |
|
|
<strong>{componentInstance._instanceName}</strong> |
|
|
</div> |
|
|
</div> |
|
|
{/if} |
|
|
{/if} |
|
|
|
|
|
|
|
|
<div class="component-props-container"> |
|
|
<div class="component-props-container"> |
|
|
{#if selectedCategory.value === 'design'} |
|
|
{#if selectedCategory.value === 'design'} |
|
|
@ -108,8 +114,7 @@ |
|
|
{panelDefinition} |
|
|
{panelDefinition} |
|
|
displayNameField={displayName} |
|
|
displayNameField={displayName} |
|
|
onChange={onPropChanged} |
|
|
onChange={onPropChanged} |
|
|
screenOrPageInstance={$store.currentView !== "component" && $store.currentPreviewItem} /> |
|
|
screenOrPageInstance={$store.currentView !== 'component' && $store.currentPreviewItem} /> |
|
|
|
|
|
|
|
|
{:else if selectedCategory.value === 'events'} |
|
|
{:else if selectedCategory.value === 'events'} |
|
|
<EventsEditor component={componentInstance} /> |
|
|
<EventsEditor component={componentInstance} /> |
|
|
{/if} |
|
|
{/if} |
|
|
|