2019-07-13 11:35:57 +02:00
|
|
|
<script>
|
2020-02-03 10:50:30 +01:00
|
|
|
import ComponentsHierarchy from "./ComponentsHierarchy.svelte"
|
2020-02-10 16:51:09 +01:00
|
|
|
import ComponentsHierarchyChildren from "./ComponentsHierarchyChildren.svelte"
|
2020-02-20 18:11:41 +01:00
|
|
|
import MasterLayout from "./MasterLayout.svelte"
|
2020-02-03 10:50:30 +01:00
|
|
|
import PagesList from "./PagesList.svelte"
|
|
|
|
import { store } from "../builderStore"
|
|
|
|
import IconButton from "../common/IconButton.svelte"
|
|
|
|
import Modal from "../common/Modal.svelte"
|
2020-02-25 11:05:43 +01:00
|
|
|
import NewScreen from "./NewScreen.svelte"
|
2020-02-03 10:50:30 +01:00
|
|
|
import CurrentItemPreview from "./CurrentItemPreview.svelte"
|
|
|
|
import SettingsView from "./SettingsView.svelte"
|
|
|
|
import PageView from "./PageView.svelte"
|
|
|
|
import ComponentsPaneSwitcher from "./ComponentsPaneSwitcher.svelte"
|
2020-02-18 17:51:28 +01:00
|
|
|
import ConfirmDialog from "../common/ConfirmDialog.svelte"
|
|
|
|
import { last } from "lodash/fp"
|
2020-02-20 18:11:41 +01:00
|
|
|
import { AddIcon } from "../common/Icons"
|
2020-02-03 10:50:30 +01:00
|
|
|
|
2020-02-25 11:05:43 +01:00
|
|
|
let newScreenPicker
|
2020-02-18 17:51:28 +01:00
|
|
|
let confirmDeleteDialog
|
|
|
|
let componentToDelete = ""
|
2020-02-03 10:50:30 +01:00
|
|
|
|
2020-02-25 11:05:43 +01:00
|
|
|
const newScreen = () => {
|
|
|
|
newScreenPicker.show()
|
2020-02-03 10:50:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
let settingsView
|
|
|
|
const settings = () => {
|
|
|
|
settingsView.show()
|
|
|
|
}
|
2020-02-18 17:51:28 +01:00
|
|
|
|
|
|
|
const confirmDeleteComponent = component => {
|
|
|
|
componentToDelete = component
|
|
|
|
confirmDeleteDialog.show()
|
|
|
|
}
|
2020-02-20 18:11:41 +01:00
|
|
|
|
|
|
|
const lastPartOfName = c => (c ? last(c.split("/")) : "")
|
2019-07-13 11:35:57 +02:00
|
|
|
</script>
|
|
|
|
|
2019-07-26 18:08:59 +02:00
|
|
|
<div class="root">
|
2020-01-20 15:12:29 +01:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
<div class="ui-nav">
|
2019-07-31 09:09:04 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
<div class="pages-list-container">
|
2020-02-20 18:11:41 +01:00
|
|
|
<div class="nav-header">
|
2020-02-03 10:50:30 +01:00
|
|
|
<span class="navigator-title">Navigator</span>
|
2020-02-20 18:11:41 +01:00
|
|
|
<span class="components-nav-header">Pages</span>
|
2020-02-03 10:50:30 +01:00
|
|
|
</div>
|
2020-02-20 18:11:41 +01:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
<div class="nav-items-container">
|
|
|
|
<PagesList />
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-20 16:41:40 +01:00
|
|
|
|
2020-02-20 18:11:41 +01:00
|
|
|
<div class="border-line" />
|
2020-02-10 16:51:09 +01:00
|
|
|
|
|
|
|
<div class="components-list-container">
|
|
|
|
<div class="nav-group-header">
|
2020-02-20 18:11:41 +01:00
|
|
|
<span class="components-nav-header" style="margin-top: 0;">
|
2020-02-10 16:51:09 +01:00
|
|
|
Screens
|
|
|
|
</span>
|
2020-02-20 18:11:41 +01:00
|
|
|
<div>
|
2020-02-25 11:05:43 +01:00
|
|
|
<button on:click={newScreen}>
|
2020-02-20 18:11:41 +01:00
|
|
|
<AddIcon />
|
|
|
|
</button>
|
|
|
|
</div>
|
2020-02-10 16:51:09 +01:00
|
|
|
</div>
|
|
|
|
<div class="nav-items-container">
|
2020-02-20 18:11:41 +01:00
|
|
|
<MasterLayout layout={$store.pages[$store.currentPageName]} />
|
|
|
|
<ComponentsHierarchy screens={$store.screens} />
|
2020-02-03 10:50:30 +01:00
|
|
|
</div>
|
2019-07-26 18:08:59 +02:00
|
|
|
</div>
|
2019-07-30 09:31:07 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
</div>
|
2019-07-30 09:31:07 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
<div class="preview-pane">
|
2020-02-10 16:51:09 +01:00
|
|
|
<CurrentItemPreview />
|
2020-02-03 10:50:30 +01:00
|
|
|
</div>
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2020-02-10 16:51:09 +01:00
|
|
|
{#if $store.currentFrontEndType === 'screen' || $store.currentFrontEndType === 'page'}
|
2020-02-03 10:50:30 +01:00
|
|
|
<div class="components-pane">
|
|
|
|
<ComponentsPaneSwitcher />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2019-07-13 11:35:57 +02:00
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
</div>
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2020-02-25 11:05:43 +01:00
|
|
|
<NewScreen bind:this={newScreenPicker} />
|
2019-08-19 22:18:23 +02:00
|
|
|
<SettingsView bind:this={settingsView} />
|
2019-08-07 10:03:49 +02:00
|
|
|
|
2020-02-20 18:11:41 +01:00
|
|
|
<ConfirmDialog
|
|
|
|
bind:this={confirmDeleteDialog}
|
|
|
|
title="Confirm Delete"
|
|
|
|
body={`Are you sure you wish to delete this '${lastPartOfName(componentToDelete)}' component`}
|
2020-02-18 17:51:28 +01:00
|
|
|
okText="Delete Component"
|
2020-02-20 18:11:41 +01:00
|
|
|
onOk={() => store.deleteComponent(componentToDelete)} />
|
2020-02-18 17:51:28 +01:00
|
|
|
|
2019-07-13 11:35:57 +02:00
|
|
|
<style>
|
2020-02-03 10:50:30 +01:00
|
|
|
button {
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
border-radius: 5px;
|
2020-02-20 18:11:41 +01:00
|
|
|
width: 20px;
|
2020-02-03 10:50:30 +01:00
|
|
|
padding-bottom: 10px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2020-02-20 18:11:41 +01:00
|
|
|
padding: 0;
|
2020-02-03 10:50:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.root {
|
|
|
|
display: grid;
|
2020-02-12 22:01:53 +01:00
|
|
|
grid-template-columns: 290px 1fr 350px;
|
2020-02-03 10:50:30 +01:00
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
background: #fafafa;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui-nav {
|
|
|
|
grid-column: 1;
|
|
|
|
background-color: var(--secondary5);
|
2020-02-26 17:36:30 +01:00
|
|
|
height: calc(100vh - 49px);
|
|
|
|
padding: 0;
|
|
|
|
overflow: hidden;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-02-03 10:50:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.preview-pane {
|
|
|
|
grid-column: 2;
|
2020-03-09 14:03:02 +01:00
|
|
|
margin: 40px;
|
2020-02-03 10:50:30 +01:00
|
|
|
background: #fff;
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 0 0px 6px rgba(0, 0, 0, 0.05);
|
|
|
|
}
|
|
|
|
|
|
|
|
.components-pane {
|
|
|
|
grid-column: 3;
|
|
|
|
background-color: var(--secondary5);
|
|
|
|
min-height: 0px;
|
|
|
|
overflow-y: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.components-nav-header {
|
|
|
|
font-size: 0.75rem;
|
|
|
|
color: #999;
|
|
|
|
text-transform: uppercase;
|
2020-02-20 18:11:41 +01:00
|
|
|
margin-top: 1rem;
|
|
|
|
font-weight: 500;
|
2020-02-03 10:50:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header {
|
|
|
|
font-size: 0.9rem;
|
|
|
|
padding-left: 1rem;
|
|
|
|
}
|
|
|
|
|
2020-02-20 18:11:41 +01:00
|
|
|
.nav-header {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
margin-top: 1.5rem;
|
|
|
|
padding: 0 1.8rem;
|
|
|
|
}
|
|
|
|
|
2020-02-03 10:50:30 +01:00
|
|
|
.nav-items-container {
|
|
|
|
padding: 1rem 0rem 0rem 0rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header {
|
|
|
|
display: flex;
|
2020-02-20 18:11:41 +01:00
|
|
|
padding: 1.5rem 0 0 1.8rem;
|
2020-02-03 10:50:30 +01:00
|
|
|
font-size: 0.9rem;
|
|
|
|
font-weight: bold;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header > div:nth-child(1) {
|
|
|
|
padding: 0rem 0.5rem 0rem 0rem;
|
|
|
|
vertical-align: bottom;
|
|
|
|
grid-column-start: icon;
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
|
2020-02-10 16:51:09 +01:00
|
|
|
.nav-group-header > span:nth-child(3) {
|
2020-02-03 10:50:30 +01:00
|
|
|
margin-left: 5px;
|
|
|
|
vertical-align: bottom;
|
|
|
|
grid-column-start: title;
|
|
|
|
margin-top: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header > div:nth-child(3) {
|
|
|
|
vertical-align: bottom;
|
|
|
|
grid-column-start: button;
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--primary75);
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header > div:nth-child(3):hover {
|
|
|
|
color: var(--primary75);
|
|
|
|
}
|
|
|
|
|
|
|
|
.navigator-title {
|
|
|
|
text-transform: uppercase;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #999;
|
2020-02-20 18:11:41 +01:00
|
|
|
font-size: 0.9rem;
|
2020-02-03 10:50:30 +01:00
|
|
|
}
|
2020-02-10 16:51:09 +01:00
|
|
|
|
2020-02-20 18:11:41 +01:00
|
|
|
.border-line {
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
margin-top: 1.5rem;
|
|
|
|
width: calc(100% + 1.5rem);
|
2020-02-10 16:51:09 +01:00
|
|
|
}
|
2020-02-26 17:36:30 +01:00
|
|
|
|
|
|
|
.components-list-container {
|
|
|
|
overflow: auto;
|
|
|
|
padding: 0 30px 0 0;
|
|
|
|
}
|
2020-01-20 15:12:29 +01:00
|
|
|
</style>
|