POC
This commit is contained in:
parent
915832ab91
commit
5365de6a8d
|
@ -1,6 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import Panel from "components/design/Panel.svelte"
|
import Panel from "components/design/Panel.svelte"
|
||||||
import { store, selectedComponent, selectedScreen } from "builderStore"
|
import {
|
||||||
|
store,
|
||||||
|
selectedComponent,
|
||||||
|
selectedScreen,
|
||||||
|
themeStore,
|
||||||
|
} from "builderStore"
|
||||||
import ComponentSettingsSection from "./ComponentSettingsSection.svelte"
|
import ComponentSettingsSection from "./ComponentSettingsSection.svelte"
|
||||||
import DesignSection from "./DesignSection.svelte"
|
import DesignSection from "./DesignSection.svelte"
|
||||||
import CustomStylesSection from "./CustomStylesSection.svelte"
|
import CustomStylesSection from "./CustomStylesSection.svelte"
|
||||||
|
@ -21,6 +26,21 @@
|
||||||
$selectedScreen,
|
$selectedScreen,
|
||||||
$store.selectedComponentId
|
$store.selectedComponentId
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// frontend Constant Themes
|
||||||
|
$: globalBindings = [
|
||||||
|
...bindings,
|
||||||
|
{
|
||||||
|
type: "context",
|
||||||
|
runtimeBinding: `[device].[theme]`, //app.settings?
|
||||||
|
readableBinding: `App.Theme`,
|
||||||
|
category: "Settings",
|
||||||
|
icon: "Settings",
|
||||||
|
display: { type: "string", name: "Theme" },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
$: console.log(globalBindings)
|
||||||
|
|
||||||
$: componentBindings = getComponentBindableProperties(
|
$: componentBindings = getComponentBindableProperties(
|
||||||
$selectedScreen,
|
$selectedScreen,
|
||||||
$store.selectedComponentId
|
$store.selectedComponentId
|
||||||
|
@ -61,24 +81,28 @@
|
||||||
<ComponentSettingsSection
|
<ComponentSettingsSection
|
||||||
{componentInstance}
|
{componentInstance}
|
||||||
{componentDefinition}
|
{componentDefinition}
|
||||||
{bindings}
|
bindings={globalBindings}
|
||||||
{componentBindings}
|
{componentBindings}
|
||||||
{isScreen}
|
{isScreen}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if section == "styles"}
|
{#if section == "styles"}
|
||||||
<DesignSection {componentInstance} {componentDefinition} {bindings} />
|
<DesignSection
|
||||||
|
{componentInstance}
|
||||||
|
{componentDefinition}
|
||||||
|
bindings={globalBindings}
|
||||||
|
/>
|
||||||
<CustomStylesSection
|
<CustomStylesSection
|
||||||
{componentInstance}
|
{componentInstance}
|
||||||
{componentDefinition}
|
{componentDefinition}
|
||||||
{bindings}
|
bindings={globalBindings}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{#if section == "conditions"}
|
{#if section == "conditions"}
|
||||||
<ConditionalUISection
|
<ConditionalUISection
|
||||||
{componentInstance}
|
{componentInstance}
|
||||||
{componentDefinition}
|
{componentDefinition}
|
||||||
{bindings}
|
bindings={globalBindings}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Provider from "./Provider.svelte"
|
import Provider from "./Provider.svelte"
|
||||||
import { onMount, onDestroy } from "svelte"
|
import { onMount, onDestroy } from "svelte"
|
||||||
|
import { themeStore } from "stores"
|
||||||
|
|
||||||
let width = window.innerWidth
|
let width = window.innerWidth
|
||||||
let height = window.innerHeight
|
let height = window.innerHeight
|
||||||
|
@ -13,11 +14,16 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$: theme = $themeStore.theme
|
||||||
|
$: baseTheme = $themeStore.baseTheme
|
||||||
|
|
||||||
$: data = {
|
$: data = {
|
||||||
mobile: width && width < tabletBreakpoint,
|
mobile: width && width < tabletBreakpoint,
|
||||||
tablet: width && width >= tabletBreakpoint && width < desktopBreakpoint,
|
tablet: width && width >= tabletBreakpoint && width < desktopBreakpoint,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
theme,
|
||||||
|
baseTheme,
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
|
Loading…
Reference in New Issue