2019-07-13 21:35:57 +12:00
|
|
|
<script>
|
2020-02-03 22:50:30 +13:00
|
|
|
import ComponentsHierarchy from "./ComponentsHierarchy.svelte"
|
2020-02-11 04:51:09 +13:00
|
|
|
import ComponentsHierarchyChildren from "./ComponentsHierarchyChildren.svelte"
|
2020-04-03 04:37:22 +13:00
|
|
|
import PageLayout from "./PageLayout.svelte"
|
2020-02-03 22:50:30 +13:00
|
|
|
import PagesList from "./PagesList.svelte"
|
2020-04-01 00:16:03 +13:00
|
|
|
import { store } from "builderStore"
|
|
|
|
import IconButton from "components/common/IconButton.svelte"
|
2020-02-25 23:05:43 +13:00
|
|
|
import NewScreen from "./NewScreen.svelte"
|
2020-05-03 02:29:10 +12:00
|
|
|
import AppPreview from "./AppPreview"
|
2020-02-03 22:50:30 +13:00
|
|
|
import PageView from "./PageView.svelte"
|
|
|
|
import ComponentsPaneSwitcher from "./ComponentsPaneSwitcher.svelte"
|
2020-04-01 00:16:03 +13:00
|
|
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
2020-02-19 05:51:28 +13:00
|
|
|
import { last } from "lodash/fp"
|
2020-04-01 00:16:03 +13:00
|
|
|
import { AddIcon } from "components/common/Icons"
|
2020-02-03 22:50:30 +13:00
|
|
|
|
2020-02-25 23:05:43 +13:00
|
|
|
let newScreenPicker
|
2020-02-19 05:51:28 +13:00
|
|
|
let confirmDeleteDialog
|
|
|
|
let componentToDelete = ""
|
2020-02-03 22:50:30 +13:00
|
|
|
|
2020-02-25 23:05:43 +13:00
|
|
|
const newScreen = () => {
|
|
|
|
newScreenPicker.show()
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
2020-02-19 05:51:28 +13:00
|
|
|
const confirmDeleteComponent = component => {
|
|
|
|
componentToDelete = component
|
|
|
|
confirmDeleteDialog.show()
|
|
|
|
}
|
2020-02-21 06:11:41 +13:00
|
|
|
|
|
|
|
const lastPartOfName = c => (c ? last(c.split("/")) : "")
|
2019-07-13 21:35:57 +12:00
|
|
|
</script>
|
|
|
|
|
2019-07-27 04:08:59 +12:00
|
|
|
<div class="root">
|
2020-01-21 03:12:29 +13:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="ui-nav">
|
2019-07-31 19:09:04 +12:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="pages-list-container">
|
2020-02-21 06:11:41 +13:00
|
|
|
<div class="nav-header">
|
2020-02-03 22:50:30 +13:00
|
|
|
<span class="navigator-title">Navigator</span>
|
2020-03-28 05:58:32 +13:00
|
|
|
<div class="border-line" />
|
2020-03-24 23:56:48 +13:00
|
|
|
|
|
|
|
<span class="components-nav-page">Pages</span>
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2020-02-21 06:11:41 +13:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="nav-items-container">
|
|
|
|
<PagesList />
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-21 04:41:40 +13:00
|
|
|
|
2020-02-21 06:11:41 +13:00
|
|
|
<div class="border-line" />
|
2020-02-11 04:51:09 +13:00
|
|
|
|
2020-04-03 04:37:22 +13:00
|
|
|
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
|
|
|
|
|
|
|
<div class="border-line" />
|
|
|
|
|
2020-02-11 04:51:09 +13:00
|
|
|
<div class="components-list-container">
|
|
|
|
<div class="nav-group-header">
|
2020-02-21 06:11:41 +13:00
|
|
|
<span class="components-nav-header" style="margin-top: 0;">
|
2020-02-11 04:51:09 +13:00
|
|
|
Screens
|
|
|
|
</span>
|
2020-02-21 06:11:41 +13:00
|
|
|
<div>
|
2020-02-25 23:05:43 +13:00
|
|
|
<button on:click={newScreen}>
|
2020-02-21 06:11:41 +13:00
|
|
|
<AddIcon />
|
|
|
|
</button>
|
|
|
|
</div>
|
2020-02-11 04:51:09 +13:00
|
|
|
</div>
|
|
|
|
<div class="nav-items-container">
|
2020-02-21 06:11:41 +13:00
|
|
|
<ComponentsHierarchy screens={$store.screens} />
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2019-07-27 04:08:59 +12:00
|
|
|
</div>
|
2019-07-30 19:31:07 +12:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2019-07-30 19:31:07 +12:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="preview-pane">
|
2020-05-03 02:29:10 +12:00
|
|
|
<AppPreview />
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2019-08-07 20:03:49 +12:00
|
|
|
|
2020-02-11 04:51:09 +13:00
|
|
|
{#if $store.currentFrontEndType === 'screen' || $store.currentFrontEndType === 'page'}
|
2020-02-03 22:50:30 +13:00
|
|
|
<div class="components-pane">
|
|
|
|
<ComponentsPaneSwitcher />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2019-07-13 21:35:57 +12:00
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
</div>
|
2019-08-07 20:03:49 +12:00
|
|
|
|
2020-02-25 23:05:43 +13:00
|
|
|
<NewScreen bind:this={newScreenPicker} />
|
2019-08-07 20:03:49 +12:00
|
|
|
|
2020-02-21 06:11:41 +13:00
|
|
|
<ConfirmDialog
|
|
|
|
bind:this={confirmDeleteDialog}
|
|
|
|
title="Confirm Delete"
|
|
|
|
body={`Are you sure you wish to delete this '${lastPartOfName(componentToDelete)}' component`}
|
2020-02-19 05:51:28 +13:00
|
|
|
okText="Delete Component"
|
2020-02-21 06:11:41 +13:00
|
|
|
onOk={() => store.deleteComponent(componentToDelete)} />
|
2020-02-19 05:51:28 +13:00
|
|
|
|
2019-07-13 21:35:57 +12:00
|
|
|
<style>
|
2020-02-03 22:50:30 +13:00
|
|
|
button {
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
|
|
|
border: none;
|
|
|
|
border-radius: 5px;
|
2020-02-21 06:11:41 +13:00
|
|
|
width: 20px;
|
2020-02-03 22:50:30 +13:00
|
|
|
padding-bottom: 10px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2020-02-21 06:11:41 +13:00
|
|
|
padding: 0;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
.root {
|
|
|
|
display: grid;
|
2020-03-28 05:58:32 +13:00
|
|
|
grid-template-columns: 275px 1fr 275px;
|
2020-02-03 22:50:30 +13:00
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
background: #fafafa;
|
|
|
|
}
|
2020-03-28 05:58:32 +13:00
|
|
|
|
|
|
|
@media only screen and (min-width: 1800px) {
|
|
|
|
.root {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 300px 1fr 300px;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
background: #fafafa;
|
|
|
|
}
|
|
|
|
}
|
2020-02-03 22:50:30 +13:00
|
|
|
|
|
|
|
.ui-nav {
|
|
|
|
grid-column: 1;
|
2020-03-24 23:56:48 +13:00
|
|
|
background-color: var(--white);
|
2020-02-27 05:36:30 +13:00
|
|
|
height: calc(100vh - 49px);
|
|
|
|
padding: 0;
|
2020-04-24 21:35:54 +12:00
|
|
|
overflow: scroll;
|
2020-02-27 05:36:30 +13:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
.preview-pane {
|
|
|
|
grid-column: 2;
|
2020-03-10 02:03:02 +13:00
|
|
|
margin: 40px;
|
2020-02-03 22:50:30 +13:00
|
|
|
background: #fff;
|
|
|
|
border-radius: 5px;
|
|
|
|
box-shadow: 0 0px 6px rgba(0, 0, 0, 0.05);
|
|
|
|
}
|
|
|
|
|
|
|
|
.components-pane {
|
|
|
|
grid-column: 3;
|
2020-03-24 23:56:48 +13:00
|
|
|
background-color: var(--white);
|
2020-02-03 22:50:30 +13:00
|
|
|
min-height: 0px;
|
2020-04-24 21:35:54 +12:00
|
|
|
overflow-y: scroll;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
2020-03-24 23:56:48 +13:00
|
|
|
.components-nav-page {
|
2020-04-03 05:11:38 +13:00
|
|
|
font-size: 13px;
|
2020-03-24 23:56:48 +13:00
|
|
|
color: #000333;
|
2020-02-03 22:50:30 +13:00
|
|
|
text-transform: uppercase;
|
2020-03-24 23:56:48 +13:00
|
|
|
padding-left: 20px;
|
|
|
|
margin-top: 20px;
|
2020-03-25 00:12:08 +13:00
|
|
|
font-weight: 600;
|
|
|
|
opacity: 0.4;
|
|
|
|
letter-spacing: 1px;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
2020-03-24 23:56:48 +13:00
|
|
|
.components-nav-header {
|
2020-04-03 05:11:38 +13:00
|
|
|
font-size: 13px;
|
2020-03-24 23:56:48 +13:00
|
|
|
color: #000333;
|
|
|
|
text-transform: uppercase;
|
|
|
|
margin-top: 20px;
|
2020-03-25 00:12:08 +13:00
|
|
|
font-weight: 600;
|
|
|
|
opacity: 0.4;
|
|
|
|
letter-spacing: 1px;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
|
|
|
|
2020-02-21 06:11:41 +13:00
|
|
|
.nav-header {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-03-24 23:56:48 +13:00
|
|
|
margin-top: 20px;
|
2020-02-21 06:11:41 +13:00
|
|
|
}
|
|
|
|
|
2020-02-03 22:50:30 +13:00
|
|
|
.nav-items-container {
|
|
|
|
padding: 1rem 0rem 0rem 0rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-group-header {
|
|
|
|
display: flex;
|
2020-03-24 23:56:48 +13:00
|
|
|
padding: 0px 20px 0px 20px;
|
2020-02-03 22:50:30 +13: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-11 04:51:09 +13:00
|
|
|
.nav-group-header > span:nth-child(3) {
|
2020-02-03 22:50:30 +13: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 {
|
2020-03-24 23:56:48 +13:00
|
|
|
font-size: 14px;
|
|
|
|
color: var(--secondary100);
|
2020-03-25 00:12:08 +13:00
|
|
|
font-weight: 600;
|
2020-02-03 22:50:30 +13:00
|
|
|
text-transform: uppercase;
|
2020-03-24 23:56:48 +13:00
|
|
|
padding: 0 20px 20px 20px;
|
|
|
|
line-height: 1rem !important;
|
2020-03-25 00:12:08 +13:00
|
|
|
letter-spacing: 1px;
|
2020-02-03 22:50:30 +13:00
|
|
|
}
|
2020-02-11 04:51:09 +13:00
|
|
|
|
2020-02-21 06:11:41 +13:00
|
|
|
.border-line {
|
2020-03-24 23:56:48 +13:00
|
|
|
border-bottom: 1px solid #d8d8d8;
|
2020-02-11 04:51:09 +13:00
|
|
|
}
|
2020-02-27 05:36:30 +13:00
|
|
|
|
|
|
|
.components-list-container {
|
2020-03-24 23:56:48 +13:00
|
|
|
padding: 20px 0px 0 0;
|
2020-02-27 05:36:30 +13:00
|
|
|
}
|
2020-01-21 03:12:29 +13:00
|
|
|
</style>
|