MapComplete/src/UI/Studio/SchemaBasedTranslationInput.svelte

16 lines
584 B
Svelte

<script lang="ts">
import EditLayerState from "./EditLayerState";
import type { ConfigMeta } from "./configMeta";
import { UIEventSource } from "../../Logic/UIEventSource";
import TranslationInput from "../InputElement/Helpers/TranslationInput.svelte";
export let state: EditLayerState;
export let path: (string | number)[] = [];
export let schema: ConfigMeta;
let value = new UIEventSource<string>({});
console.log("Registering translation to path", path)
state.register(path, value.mapD(v => JSON.parse(value.data )));
</script>
<TranslationInput {value} />