2021-08-04 22:01:03 +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-08-05 23:34:26 +02:00
|
|
|
import HandleSelection from "./HandleSelection.svelte";
|
2021-08-05 23:45:45 +02:00
|
|
|
import HandleBackground from "./HandleBackground.svelte";
|
|
|
|
import HandleControl from "./HandleControl.svelte";
|
2021-08-06 00:59:52 +02:00
|
|
|
import MathjaxHandleInlineBlock from "./MathjaxHandleInlineBlock.svelte";
|
2021-08-05 23:34:26 +02:00
|
|
|
|
|
|
|
export let activeImage: HTMLImageElement | null = null;
|
|
|
|
export let container: HTMLElement;
|
2021-08-06 00:59:52 +02:00
|
|
|
export let isRtl: boolean;
|
|
|
|
|
|
|
|
let updateSelection: () => void;
|
2021-08-04 22:01:03 +02:00
|
|
|
</script>
|
2021-08-05 23:34:26 +02:00
|
|
|
|
2021-08-06 04:25:19 +02:00
|
|
|
{#if activeImage}
|
|
|
|
<HandleSelection
|
|
|
|
image={activeImage}
|
|
|
|
{container}
|
|
|
|
offsetX={2}
|
|
|
|
offsetY={2}
|
|
|
|
bind:updateSelection
|
|
|
|
>
|
2021-08-05 23:34:26 +02:00
|
|
|
<HandleBackground />
|
2021-08-05 23:45:45 +02:00
|
|
|
|
2021-08-06 00:59:52 +02:00
|
|
|
<div
|
|
|
|
class="mathjax-handle-inline-block"
|
|
|
|
class:is-rtl={isRtl}
|
|
|
|
on:click={updateSelection}
|
|
|
|
>
|
|
|
|
<MathjaxHandleInlineBlock {activeImage} {isRtl} />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<HandleControl />
|
2021-08-06 04:25:19 +02:00
|
|
|
</HandleSelection>
|
|
|
|
{/if}
|
2021-08-06 00:59:52 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
div {
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mathjax-handle-inline-block {
|
|
|
|
left: 3px;
|
|
|
|
top: 3px;
|
|
|
|
|
|
|
|
&.is-rtl {
|
|
|
|
left: auto;
|
|
|
|
right: 3px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|