2021-06-10 13:30:39 +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">
|
2021-10-07 15:31:49 +02:00
|
|
|
import * as tr from "../lib/ftl";
|
2021-11-24 03:09:55 +01:00
|
|
|
import marked from "marked";
|
|
|
|
import { ChangeNotetypeState, MapContext } from "./lib";
|
|
|
|
import Container from "../components/Container.svelte";
|
|
|
|
import Row from "../components/Row.svelte";
|
|
|
|
import Col from "../components/Col.svelte";
|
2021-06-10 13:30:39 +02:00
|
|
|
import NotetypeSelector from "./NotetypeSelector.svelte";
|
2021-11-24 03:09:55 +01:00
|
|
|
import StickyNav from "./StickyNav.svelte";
|
2021-06-10 13:30:39 +02:00
|
|
|
import Mapper from "./Mapper.svelte";
|
|
|
|
|
|
|
|
export let state: ChangeNotetypeState;
|
2021-11-24 03:09:55 +01:00
|
|
|
$: info = state.info;
|
|
|
|
let offset: number;
|
2021-06-10 13:30:39 +02:00
|
|
|
</script>
|
|
|
|
|
2021-11-24 03:09:55 +01:00
|
|
|
<div bind:offsetHeight={offset}>
|
|
|
|
<NotetypeSelector {state} />
|
|
|
|
</div>
|
2021-06-10 13:30:39 +02:00
|
|
|
|
2021-11-24 03:09:55 +01:00
|
|
|
<div id="scrollArea" style="--offset: {offset}px; --gutter-inline: 0.25rem;">
|
|
|
|
<Row class="gx-0" --cols={2}>
|
|
|
|
<Col --col-size={1} breakpoint="md">
|
|
|
|
<Container>
|
|
|
|
<StickyNav {state} ctx={MapContext.Field} />
|
|
|
|
<Mapper {state} ctx={MapContext.Field} />
|
|
|
|
</Container>
|
|
|
|
</Col>
|
|
|
|
<Col --col-size={1} breakpoint="md">
|
|
|
|
<Container>
|
|
|
|
<StickyNav {state} ctx={MapContext.Template} />
|
|
|
|
{#if $info.templates}
|
|
|
|
<Mapper {state} ctx={MapContext.Template} />
|
|
|
|
{:else}
|
|
|
|
<div>{@html marked(tr.changeNotetypeToFromCloze())}</div>
|
|
|
|
{/if}
|
|
|
|
</Container>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</div>
|
2021-06-10 13:30:39 +02:00
|
|
|
|
|
|
|
<style>
|
2021-11-24 03:09:55 +01:00
|
|
|
#scrollArea {
|
|
|
|
padding: 0;
|
|
|
|
overflow: hidden auto;
|
|
|
|
height: calc(100% - var(--offset));
|
2021-06-10 13:30:39 +02:00
|
|
|
}
|
|
|
|
</style>
|