-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.svelte
More file actions
46 lines (41 loc) · 963 Bytes
/
App.svelte
File metadata and controls
46 lines (41 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<script lang="ts">
import { onMount } from "svelte";
import { Pane, Splitpanes } from "svelte-splitpanes";
import Markdown from "./Components/Markdown.svelte";
import Statusbar from "./Components/Statusbar.svelte";
import "./css/main.css";
import { Runtime } from "./ts/runtime";
export let runtime: Runtime;
const {
wordWrap,
monospace,
spellcheck,
buffer,
isClient,
markdownPreview,
statusBar,
path,
File,
} = runtime;
let input: HTMLTextAreaElement;
onMount(() => {
runtime.setTextarea(input);
});
</script>
<Splitpanes>
<Pane minSize={$markdownPreview ? 25 : 100}>
<textarea
bind:value={$buffer}
bind:this={input}
class:nowrap={!$wordWrap}
class:monospace={$monospace}
spellcheck={$spellcheck}
readonly={$isClient}
wrap="soft"
/>
</Pane>
{#if $markdownPreview}
<Markdown {runtime} />
{/if}
</Splitpanes>
<Statusbar {runtime} />