2019-08-16 16:48:45 +02:00
|
|
|
<script>
|
2020-01-28 22:17:04 +01:00
|
|
|
import PropsView from "./PropsView.svelte";
|
|
|
|
import { store } from "../builderStore";
|
|
|
|
import IconButton from "../common/IconButton.svelte";
|
|
|
|
import Textbox from "../common/Textbox.svelte";
|
|
|
|
import Button from "../common/Button.svelte";
|
|
|
|
import { LayoutIcon, PaintIcon, TerminalIcon } from '../common/Icons/';
|
|
|
|
|
|
|
|
import {
|
|
|
|
cloneDeep,
|
|
|
|
join,
|
|
|
|
split,
|
|
|
|
last
|
|
|
|
} from "lodash/fp";
|
|
|
|
import { assign } from "lodash";
|
|
|
|
|
|
|
|
$: component = $store.currentFrontEndItem;
|
|
|
|
$: componentInfo = $store.currentComponentInfo;
|
|
|
|
$: components = $store.components;
|
|
|
|
|
|
|
|
|
|
|
|
const updateComponent = doChange =>
|
|
|
|
doChange(cloneDeep(component));
|
|
|
|
|
|
|
|
const onPropsChanged = newProps => {
|
|
|
|
updateComponent(newComponent =>
|
|
|
|
assign(newComponent.props, newProps));
|
|
|
|
}
|
2019-08-16 16:48:45 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="root">
|
|
|
|
|
2020-01-21 15:50:35 +01:00
|
|
|
<ul>
|
|
|
|
<li><button><PaintIcon /></button></li>
|
|
|
|
<li><button><LayoutIcon /></button></li>
|
|
|
|
<li><button><TerminalIcon /></button></li>
|
|
|
|
</ul>
|
2019-08-16 16:48:45 +02:00
|
|
|
|
2019-10-03 07:12:13 +02:00
|
|
|
<div class="component-props-container">
|
2020-01-24 15:30:17 +01:00
|
|
|
<PropsView
|
2019-08-16 16:48:45 +02:00
|
|
|
{componentInfo}
|
2020-01-18 00:06:42 +01:00
|
|
|
{onPropsChanged} />
|
2019-08-16 16:48:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
2020-01-28 22:17:04 +01:00
|
|
|
.root {
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.title > div:nth-child(1) {
|
|
|
|
grid-column-start: name;
|
|
|
|
color: var(--secondary100);
|
|
|
|
}
|
|
|
|
|
|
|
|
.title > div:nth-child(2) {
|
|
|
|
grid-column-start: actions;
|
|
|
|
}
|
|
|
|
|
|
|
|
.component-props-container {
|
|
|
|
flex: 1 1 auto;
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul {
|
|
|
|
list-style: none;
|
|
|
|
display: flex;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
li {
|
|
|
|
margin-right: 20px;
|
|
|
|
background: none;
|
|
|
|
border-radius: 5px;
|
|
|
|
width: 45px;
|
|
|
|
height: 45px;
|
|
|
|
}
|
|
|
|
|
|
|
|
li button {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background: none;
|
|
|
|
border: none;
|
|
|
|
border-radius: 5px;
|
|
|
|
padding: 12px;
|
|
|
|
}
|
2020-01-20 18:13:58 +01:00
|
|
|
</style>
|