2023-06-18 00:44:57 +02:00
|
|
|
<script lang="ts">
|
2023-08-23 11:11:53 +02:00
|
|
|
import type { ConfigMeta } from "./configMeta";
|
|
|
|
import SchemaBasedField from "./SchemaBasedField.svelte";
|
|
|
|
import EditLayerState from "./EditLayerState";
|
|
|
|
import SchemaBasedArray from "./SchemaBasedArray.svelte";
|
|
|
|
import SchemaBasedMultiType from "./SchemaBasedMultiType.svelte";
|
|
|
|
import SchemaBasedTranslationInput from "./SchemaBasedTranslationInput.svelte";
|
2023-06-22 15:07:14 +02:00
|
|
|
|
2023-08-23 11:11:53 +02:00
|
|
|
export let schema: ConfigMeta;
|
|
|
|
export let state: EditLayerState;
|
|
|
|
export let path: (string | number)[] = [];
|
|
|
|
|
2023-06-18 00:44:57 +02:00
|
|
|
</script>
|
2023-08-08 13:52:58 +02:00
|
|
|
{#if schema.hints.typehint === "tagrendering[]"}
|
2023-08-23 11:11:53 +02:00
|
|
|
<!-- We cheat a bit here by matching this 'magical' type... -->
|
|
|
|
<SchemaBasedArray {path} {state} {schema} />
|
2023-08-08 13:52:58 +02:00
|
|
|
{:else if schema.type === "array"}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedArray {path} {state} {schema} />
|
2023-06-30 13:36:02 +02:00
|
|
|
{:else if schema.type === "translation"}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedTranslationInput {path} {state} {schema} />
|
2023-06-21 17:13:09 +02:00
|
|
|
{:else if schema.hints.types}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedMultiType {path} {state} {schema} />
|
2023-06-18 00:44:57 +02:00
|
|
|
{:else}
|
2023-08-23 11:11:53 +02:00
|
|
|
<SchemaBasedField {path} {state} {schema} />
|
2023-06-18 00:44:57 +02:00
|
|
|
{/if}
|