|
|
|
@ -7,20 +7,16 @@ |
|
|
|
import { store, currentAsset } from "builderStore" |
|
|
|
import { writable } from "svelte/store" |
|
|
|
|
|
|
|
export let layout = $currentAsset |
|
|
|
export let layout |
|
|
|
|
|
|
|
let confirmDeleteDialog |
|
|
|
let componentToDelete = "" |
|
|
|
|
|
|
|
const dragDropStore = writable({}) |
|
|
|
|
|
|
|
const lastPartOfName = c => |
|
|
|
c && last(c.name ? c.name.split("/") : c._component.split("/")) |
|
|
|
|
|
|
|
$: _layout = { |
|
|
|
component: $currentAsset, |
|
|
|
title: lastPartOfName(layout), |
|
|
|
} |
|
|
|
$: console.log({ |
|
|
|
$currentAsset, layout |
|
|
|
}) |
|
|
|
|
|
|
|
const setCurrentScreenToLayout = () => { |
|
|
|
store.actions.selectAssetType(FrontendTypes.LAYOUT) |
|
|
|
@ -33,13 +29,14 @@ |
|
|
|
icon="ri-layout-3-line" |
|
|
|
text={layout.name} |
|
|
|
withArrow |
|
|
|
selected={$store.currentComponentInfo?._id === _layout.component.props._id} |
|
|
|
opened={$store.currentPreviewItem?.name === _layout.title} |
|
|
|
selected={$store.currentComponentInfo?._id === layout.props._id} |
|
|
|
opened={$currentAsset._id === layout._id} |
|
|
|
on:click={setCurrentScreenToLayout} /> |
|
|
|
|
|
|
|
{#if $store.currentPreviewItem?.name === _layout.title && _layout.component.props._children} |
|
|
|
{#if $currentAsset._id === layout._id && layout.props._children} |
|
|
|
<ComponentTree |
|
|
|
components={_layout.component.props._children} |
|
|
|
layout |
|
|
|
components={layout.props._children} |
|
|
|
currentComponent={$store.currentComponentInfo} |
|
|
|
{dragDropStore} /> |
|
|
|
{/if} |
|
|
|
|