2019-07-13 11:35:57 +02:00
|
|
|
<script>
|
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
import ComponentsHierarchy from "./ComponentsHierarchy.svelte";
|
|
|
|
import PagesList from "./PagesList.svelte"
|
2019-08-07 10:03:49 +02:00
|
|
|
import PropsView from "./PropsView.svelte";
|
2019-07-31 09:09:04 +02:00
|
|
|
import { store } from "../builderStore";
|
2019-08-04 23:21:16 +02:00
|
|
|
import getIcon from "../common/icon";
|
2019-08-07 10:03:49 +02:00
|
|
|
import { isRootComponent } from "./pagesParsing/searchComponents";
|
|
|
|
import IconButton from "../common/IconButton.svelte";
|
|
|
|
import Modal from "../common/Modal.svelte";
|
|
|
|
import NewComponent from "./NewComponent.svelte";
|
|
|
|
|
|
|
|
let isCreatingNewComponent = false;
|
|
|
|
const newComponent = () => {
|
|
|
|
isCreatingNewComponent = true;
|
|
|
|
}
|
2019-07-13 11:35:57 +02:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|
2019-07-26 18:08:59 +02:00
|
|
|
<div class="root">
|
2019-07-30 09:31:07 +02:00
|
|
|
|
|
|
|
<div class="ui-nav">
|
2019-07-31 09:09:04 +02:00
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
<div class="components-list-container">
|
2019-08-07 10:03:49 +02:00
|
|
|
<div class="nav-group-header">
|
|
|
|
<div>{@html getIcon("sidebar","18")}</div>
|
|
|
|
<span>COMPONENTS</span>
|
|
|
|
<div>
|
|
|
|
<IconButton icon="plus"
|
2019-08-14 23:11:59 +02:00
|
|
|
on:click={newComponent}
|
|
|
|
attributes={{"uk-toggle" : "target: #new-component-modal" }}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="nav-items-container">
|
|
|
|
<ComponentsHierarchy components={$store.allComponents}/>
|
|
|
|
</div>
|
2019-08-02 15:54:10 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="pages-list-container">
|
2019-08-07 10:03:49 +02:00
|
|
|
<div class="nav-group-header">
|
|
|
|
<div>{@html getIcon("grid","18")}</div>
|
|
|
|
<span>PAGES</span>
|
|
|
|
</div>
|
|
|
|
<div class="nav-items-container">
|
|
|
|
<PagesList />
|
|
|
|
</div>
|
2019-08-02 15:54:10 +02:00
|
|
|
</div>
|
|
|
|
|
2019-07-26 18:08:59 +02:00
|
|
|
</div>
|
2019-07-30 09:31:07 +02:00
|
|
|
|
|
|
|
<div class="component-preview">
|
2019-08-02 15:54:10 +02:00
|
|
|
{#if $store.currentFrontEndItem}
|
|
|
|
<div class="component-container">
|
|
|
|
<h1>{$store.currentFrontEndItem.name}</h1>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2019-07-30 09:31:07 +02:00
|
|
|
</div>
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
<div class="properties-pane">
|
|
|
|
{#if $store.currentFrontEndItem && !isRootComponent($store.currentFrontEndItem)}
|
|
|
|
<PropsView allComponents={$store.allComponents}
|
2019-08-14 23:11:59 +02:00
|
|
|
component={$store.currentFrontEndItem}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
2019-07-26 18:08:59 +02:00
|
|
|
</div>
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2019-08-14 23:11:59 +02:00
|
|
|
<NewComponent bind:isCreatingNewComponent={isCreatingNewComponent}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
|
|
|
|
|
2019-07-13 11:35:57 +02:00
|
|
|
<style>
|
|
|
|
|
2019-07-26 18:08:59 +02:00
|
|
|
.root {
|
|
|
|
display: grid;
|
2019-08-07 10:03:49 +02:00
|
|
|
grid-template-columns: [uiNav] 250px [preview] auto [properties] 250px;
|
2019-07-30 09:31:07 +02:00
|
|
|
height: 100%;
|
2019-07-31 09:09:04 +02:00
|
|
|
width: 100%;
|
2019-07-30 09:31:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.ui-nav {
|
|
|
|
grid-column-start: uiNav;
|
2019-08-02 15:54:10 +02:00
|
|
|
background-color: var(--primary10);
|
2019-08-04 23:21:16 +02:00
|
|
|
height: 100%;
|
2019-07-30 09:31:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.component-preview {
|
2019-08-02 15:54:10 +02:00
|
|
|
display: grid;
|
|
|
|
grid-template-rows: [top] 1fr [middle] auto [bottom] 1fr;
|
|
|
|
grid-template-columns: [left] 1fr [middle] auto [right] 1fr;
|
2019-07-30 09:31:07 +02:00
|
|
|
grid-column-start: preview;
|
2019-07-26 18:08:59 +02:00
|
|
|
}
|
|
|
|
|
2019-08-02 15:54:10 +02:00
|
|
|
.component-container {
|
|
|
|
grid-row-start: middle;
|
|
|
|
grid-column-start: middle;
|
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.properties-pane {
|
|
|
|
grid-column-start: properties;
|
|
|
|
background-color: var(--primary10);
|
|
|
|
height: 100%;
|
2019-08-14 23:11:59 +02:00
|
|
|
padding: 10px;
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
|
|
|
|
2019-08-04 23:21:16 +02:00
|
|
|
.pages-list-container {
|
|
|
|
padding-top: 20px;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.nav-group-header {
|
2019-08-04 23:21:16 +02:00
|
|
|
font-size: 10pt;
|
|
|
|
padding-left: 10px;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.nav-items-container {
|
|
|
|
padding-top: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header {
|
|
|
|
display:grid;
|
|
|
|
grid-template-columns: [icon] auto [title] 1fr [button] auto;
|
|
|
|
padding: 10px 2px 0px 7px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header>div:nth-child(1) {
|
|
|
|
padding:0px 7px 0px 0px;
|
|
|
|
vertical-align: bottom;
|
|
|
|
grid-column-start: icon;
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header>span:nth-child(2) {
|
2019-08-04 23:21:16 +02:00
|
|
|
margin-left:5px;
|
|
|
|
vertical-align: bottom;
|
2019-08-07 10:03:49 +02:00
|
|
|
grid-column-start: title;
|
|
|
|
margin-top:auto;
|
2019-08-04 23:21:16 +02:00
|
|
|
}
|
2019-08-07 10:03:49 +02:00
|
|
|
|
|
|
|
.nav-group-header>div:nth-child(3) {
|
|
|
|
vertical-align: bottom;
|
|
|
|
grid-column-start: button;
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--slate);
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header>div:nth-child(3):hover {
|
|
|
|
color: var(--primary75);
|
|
|
|
}
|
|
|
|
|
2019-07-13 11:35:57 +02:00
|
|
|
</style>
|