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-16 16:48:45 +02:00
|
|
|
import EditComponent from "./EditComponent.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-09-03 13:12:24 +02:00
|
|
|
import { isComponent } from "./pagesParsing/searchComponents";
|
2019-08-07 10:03:49 +02:00
|
|
|
import IconButton from "../common/IconButton.svelte";
|
|
|
|
import Modal from "../common/Modal.svelte";
|
|
|
|
import NewComponent from "./NewComponent.svelte";
|
2019-08-19 22:18:23 +02:00
|
|
|
import CurrentItemPreview from "./CurrentItemPreview.svelte";
|
|
|
|
import SettingsView from "./SettingsView.svelte";
|
2019-09-03 13:12:24 +02:00
|
|
|
import PageView from "./PageView.svelte";
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2019-08-16 16:48:45 +02:00
|
|
|
let newComponentPicker;
|
2019-08-07 10:03:49 +02:00
|
|
|
const newComponent = () => {
|
2019-08-16 16:48:45 +02:00
|
|
|
newComponentPicker.show();
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2019-08-19 22:18:23 +02:00
|
|
|
let settingsView;
|
|
|
|
const settings = () => {
|
|
|
|
settingsView.show();
|
|
|
|
}
|
|
|
|
|
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>
|
2019-09-23 23:22:57 +02:00
|
|
|
<span class="components-nav-header">Components</span>
|
2019-08-07 10:03:49 +02:00
|
|
|
<div>
|
2019-08-19 22:18:23 +02:00
|
|
|
<IconButton icon="settings"
|
2019-09-23 23:22:57 +02:00
|
|
|
size="14px"
|
2019-08-19 22:18:23 +02:00
|
|
|
on:click={settings}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
<IconButton icon="plus"
|
2019-08-16 16:48:45 +02:00
|
|
|
on:click={newComponent}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="nav-items-container">
|
2019-08-27 08:32:56 +02:00
|
|
|
<ComponentsHierarchy components={$store.derivedComponents}/>
|
2019-08-07 10:03:49 +02:00
|
|
|
</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>
|
2019-09-23 23:22:57 +02:00
|
|
|
<span>Pages</span>
|
2019-08-07 10:03:49 +02:00
|
|
|
</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
|
|
|
|
2019-08-19 22:18:23 +02:00
|
|
|
<div>
|
2019-08-02 15:54:10 +02:00
|
|
|
{#if $store.currentFrontEndItem}
|
2019-09-03 13:12:24 +02:00
|
|
|
{#if isComponent($store.currentFrontEndItem)}
|
|
|
|
<CurrentItemPreview />
|
|
|
|
{:else}
|
|
|
|
<PageView />
|
|
|
|
{/if}
|
2019-08-02 15:54:10 +02:00
|
|
|
{/if}
|
2019-07-30 09:31:07 +02:00
|
|
|
</div>
|
|
|
|
|
2019-09-03 13:12:24 +02:00
|
|
|
{#if $store.currentFrontEndItem && isComponent($store.currentFrontEndItem)}
|
2019-08-07 10:03:49 +02:00
|
|
|
<div class="properties-pane">
|
2019-08-16 16:48:45 +02:00
|
|
|
<EditComponent />
|
2019-08-07 10:03:49 +02:00
|
|
|
</div>
|
2019-09-03 13:12:24 +02:00
|
|
|
{/if}
|
2019-08-07 10:03:49 +02:00
|
|
|
|
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-16 16:48:45 +02:00
|
|
|
<NewComponent bind:this={newComponentPicker}/>
|
2019-08-19 22:18:23 +02:00
|
|
|
<SettingsView bind:this={settingsView} />
|
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-19 09:51:01 +02:00
|
|
|
grid-template-columns: [uiNav] 250px [preview] auto [properties] 300px;
|
2019-07-30 09:31:07 +02:00
|
|
|
height: 100%;
|
2019-07-31 09:09:04 +02:00
|
|
|
width: 100%;
|
2019-09-20 10:02:22 +02:00
|
|
|
overflow-y: auto;
|
2019-07-30 09:31:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.ui-nav {
|
|
|
|
grid-column-start: uiNav;
|
2019-09-23 23:22:57 +02:00
|
|
|
background-color: var(--secondary5);
|
2019-08-04 23:21:16 +02:00
|
|
|
height: 100%;
|
2019-07-30 09:31:07 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.properties-pane {
|
|
|
|
grid-column-start: properties;
|
2019-09-23 23:22:57 +02:00
|
|
|
background-color: var(--secondary5);
|
2019-08-07 10:03:49 +02:00
|
|
|
height: 100%;
|
2019-09-20 10:02:22 +02:00
|
|
|
overflow-y: hidden;
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
|
|
|
|
2019-08-04 23:21:16 +02:00
|
|
|
.pages-list-container {
|
2019-09-23 23:22:57 +02:00
|
|
|
padding-top: 2rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.components-nav-header {
|
|
|
|
font-size: .9rem;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.nav-group-header {
|
2019-09-23 23:22:57 +02:00
|
|
|
font-size: .9rem;
|
|
|
|
padding-left: 1rem;
|
2019-08-02 15:54:10 +02:00
|
|
|
}
|
|
|
|
|
2019-08-07 10:03:49 +02:00
|
|
|
.nav-items-container {
|
2019-09-23 23:22:57 +02:00
|
|
|
padding: 1rem 1rem 0rem 1rem;
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header {
|
|
|
|
display:grid;
|
|
|
|
grid-template-columns: [icon] auto [title] 1fr [button] auto;
|
2019-09-23 23:22:57 +02:00
|
|
|
padding: 2rem 1rem 0rem 1rem;
|
|
|
|
font-size: .9rem;
|
|
|
|
font-weight: bold;
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header>div:nth-child(1) {
|
2019-09-23 23:22:57 +02:00
|
|
|
padding: 0rem .5rem 0rem 0rem;
|
2019-08-07 10:03:49 +02:00
|
|
|
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;
|
2019-09-23 23:22:57 +02:00
|
|
|
color: var(--primary75);
|
2019-08-07 10:03:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header>div:nth-child(3):hover {
|
|
|
|
color: var(--primary75);
|
|
|
|
}
|
|
|
|
|
2019-07-13 11:35:57 +02:00
|
|
|
</style>
|