Split out editor, add to theme editing

This commit is contained in:
Robin van der Linde 2024-02-13 11:44:09 +01:00
parent 2c018d7af3
commit a8313022a0
Signed by untrusted user: Robin-van-der-Linde
GPG key ID: 53956B3252478F0D
3 changed files with 116 additions and 72 deletions

View file

@ -6,6 +6,7 @@
import TabbedGroup from "../Base/TabbedGroup.svelte"
import ShowConversionMessages from "./ShowConversionMessages.svelte"
import Region from "./Region.svelte"
import RawEditor from "./RawEditor.svelte"
export let state: EditThemeState
let schema: ConfigMeta[] = state.schema.filter((schema) => schema.path.length > 0)
@ -20,7 +21,7 @@
const perRegion: Record<string, ConfigMeta[]> = {}
for (const schemaElement of schema) {
if(schemaElement.path.length > 1 && schemaElement.path[0] === "layers"){
if (schemaElement.path.length > 1 && schemaElement.path[0] === "layers") {
continue
}
const key = schemaElement.hints.group ?? "no-group"
@ -73,9 +74,13 @@
</div>
<div slot="title4">Configuration file</div>
<div slot="content4">
<div class="literal-code">
{JSON.stringify($config)}
<div slot="content4" class="h-full">
<div>
Below, you'll find the raw configuration file in `.json`-format. This is mostly for
debugging purposes, but you can also edit the file directly if you want.
</div>
<div class="literal-code h-full w-full">
<RawEditor {state} />
</div>
<ShowConversionMessages messages={$messages} />