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";
|
2021-11-24 03:09:55 +01:00
|
|
|
import Spacer from "../components/Spacer.svelte";
|
2021-06-10 13:30:39 +02:00
|
|
|
|
|
|
|
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} />
|
|
|
|
<Spacer --height="1em" />
|
|
|
|
</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;
|
|
|
|
background: var(--pane-bg);
|
|
|
|
height: calc(100% - var(--offset));
|
|
|
|
border: 1px solid var(--medium-border);
|
|
|
|
border-radius: 0.25rem;
|
2021-06-10 13:30:39 +02:00
|
|
|
}
|
|
|
|
</style>
|