2021-04-15 15:59:52 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-04-07 23:53:09 +02:00
|
|
|
<script context="module" lang="typescript">
|
2021-04-09 20:55:49 +02:00
|
|
|
import "./legacy.css";
|
2021-04-07 23:53:09 +02:00
|
|
|
import { writable } from "svelte/store";
|
|
|
|
|
|
|
|
const disabled = writable(false);
|
|
|
|
|
|
|
|
export function enableButtons(): void {
|
|
|
|
disabled.set(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function disableButtons(): void {
|
|
|
|
disabled.set(true);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-03-25 23:32:23 +01:00
|
|
|
<script lang="typescript">
|
2021-04-27 22:35:25 +02:00
|
|
|
import { setContext } from "svelte";
|
2021-04-27 23:08:47 +02:00
|
|
|
import { disabledKey, nightModeKey } from "components/contextKeys";
|
|
|
|
|
|
|
|
import WithTheming from "components/WithTheming.svelte";
|
|
|
|
import StickyBar from "components/StickyBar.svelte";
|
2021-03-30 06:14:00 +02:00
|
|
|
|
2021-04-27 21:01:44 +02:00
|
|
|
import NoteTypeButtons from "./NoteTypeButtons.svelte";
|
2021-04-28 02:27:38 +02:00
|
|
|
import FormatInlineButtons from "./FormatInlineButtons.svelte";
|
|
|
|
import FormatBlockButtons from "./FormatBlockButtons.svelte";
|
|
|
|
import ColorButtons from "./ColorButtons.svelte";
|
|
|
|
import TemplateButtons from "./TemplateButtons.svelte";
|
2021-04-27 21:01:44 +02:00
|
|
|
|
2021-03-25 23:32:23 +01:00
|
|
|
export let nightMode: boolean;
|
|
|
|
|
2021-03-30 06:14:00 +02:00
|
|
|
setContext(nightModeKey, nightMode);
|
2021-03-31 03:34:08 +02:00
|
|
|
setContext(disabledKey, disabled);
|
2021-04-08 23:25:13 +02:00
|
|
|
|
|
|
|
export let size: number = 30;
|
|
|
|
export let wraps: boolean = true;
|
|
|
|
|
|
|
|
$: style = `--toolbar-size: ${size}px; --toolbar-wrap: ${
|
|
|
|
wraps ? "wrap" : "nowrap"
|
|
|
|
}`;
|
2021-03-25 21:11:40 +01:00
|
|
|
</script>
|
|
|
|
|
2021-04-27 22:35:25 +02:00
|
|
|
<WithTheming {style}>
|
|
|
|
<StickyBar>
|
|
|
|
<NoteTypeButtons />
|
2021-04-28 02:27:38 +02:00
|
|
|
<FormatInlineButtons />
|
2021-04-27 22:35:25 +02:00
|
|
|
</StickyBar>
|
|
|
|
</WithTheming>
|