2021-04-12 06:18:30 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
|
|
|
import ConfigSelector from "./ConfigSelector.svelte";
|
|
|
|
import ConfigEditor from "./ConfigEditor.svelte";
|
|
|
|
import type { DeckConfigState } from "./lib";
|
2021-04-22 11:52:44 +02:00
|
|
|
import { primaryModifierForPlatform } from "sveltelib/shortcuts";
|
2021-04-12 06:18:30 +02:00
|
|
|
|
|
|
|
export let state: DeckConfigState;
|
2021-04-22 11:52:44 +02:00
|
|
|
|
|
|
|
function onKeyDown(evt: KeyboardEvent): void {
|
|
|
|
if (
|
|
|
|
evt.code === "Enter" &&
|
|
|
|
evt.getModifierState(primaryModifierForPlatform())
|
|
|
|
) {
|
|
|
|
state.save(false);
|
|
|
|
}
|
|
|
|
}
|
2021-04-12 06:18:30 +02:00
|
|
|
</script>
|
|
|
|
|
2021-04-22 07:39:50 +02:00
|
|
|
<style lang="scss">
|
|
|
|
.editor {
|
|
|
|
// without this, the initial viewport can be wrong
|
|
|
|
overflow-x: hidden;
|
2021-04-12 06:18:30 +02:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2021-04-22 11:52:44 +02:00
|
|
|
<div on:keydown={onKeyDown}>
|
|
|
|
<div id="modal">
|
|
|
|
<!-- filled in later-->
|
|
|
|
</div>
|
2021-04-16 15:29:21 +02:00
|
|
|
|
2021-04-22 11:52:44 +02:00
|
|
|
<ConfigSelector {state} />
|
2021-04-18 05:02:33 +02:00
|
|
|
|
2021-04-22 11:52:44 +02:00
|
|
|
<div class="editor">
|
|
|
|
<ConfigEditor {state} />
|
|
|
|
</div>
|
2021-04-12 06:18:30 +02:00
|
|
|
</div>
|