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">
|
2022-01-16 04:29:48 +01:00
|
|
|
import { marked } from "marked";
|
2022-02-04 09:36:34 +01:00
|
|
|
|
|
|
|
import Col from "../components/Col.svelte";
|
2021-11-24 03:09:55 +01:00
|
|
|
import Container from "../components/Container.svelte";
|
|
|
|
import Row from "../components/Row.svelte";
|
2022-09-27 04:16:45 +02:00
|
|
|
import StickyContainer from "../components/StickyContainer.svelte";
|
2022-02-04 09:36:34 +01:00
|
|
|
import * as tr from "../lib/ftl";
|
|
|
|
import { ChangeNotetypeState, MapContext } from "./lib";
|
|
|
|
import Mapper from "./Mapper.svelte";
|
2021-06-10 13:30:39 +02:00
|
|
|
import NotetypeSelector from "./NotetypeSelector.svelte";
|
2021-12-04 23:18:58 +01:00
|
|
|
import StickyHeader from "./StickyHeader.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}>
|
2022-09-27 04:16:45 +02:00
|
|
|
<StickyContainer
|
|
|
|
--gutter-block="0.1rem"
|
|
|
|
--gutter-inline="0.25rem"
|
|
|
|
--sticky-borders="0 0 1px"
|
|
|
|
--z-index="4"
|
|
|
|
>
|
|
|
|
<NotetypeSelector {state} />
|
|
|
|
</StickyContainer>
|
2021-11-24 03:09:55 +01:00
|
|
|
</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>
|
2022-09-27 04:16:45 +02:00
|
|
|
<StickyHeader {state} ctx={MapContext.Field} --z-index="2" />
|
2021-11-24 03:09:55 +01:00
|
|
|
<Mapper {state} ctx={MapContext.Field} />
|
|
|
|
</Container>
|
|
|
|
</Col>
|
|
|
|
<Col --col-size={1} breakpoint="md">
|
|
|
|
<Container>
|
2022-09-27 04:16:45 +02:00
|
|
|
<StickyHeader {state} ctx={MapContext.Template} --z-index="2" />
|
2021-11-24 03:09:55 +01:00
|
|
|
{#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>
|