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-05-06 23:15:41 +02:00
|
|
|
// @ts-expect-error Insufficient typing
|
2021-04-28 13:32:25 +02:00
|
|
|
import { updateAllState, resetAllState } from "components/WithState.svelte";
|
|
|
|
|
|
|
|
export function updateActiveButtons(event: Event) {
|
2021-04-28 14:01:55 +02:00
|
|
|
updateAllState(event);
|
2021-04-28 13:32:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function clearActiveButtons() {
|
|
|
|
resetAllState(false);
|
2021-04-07 23:53:09 +02:00
|
|
|
}
|
2021-05-05 01:22:51 +02:00
|
|
|
|
|
|
|
/* Export components */
|
2021-05-06 20:29:55 +02:00
|
|
|
import AddonButtons from "./AddonButtons.svelte";
|
2021-05-06 16:10:26 +02:00
|
|
|
import PreviewButton from "./PreviewButton.svelte";
|
2021-05-05 01:22:51 +02:00
|
|
|
import LabelButton from "components/LabelButton.svelte";
|
|
|
|
import IconButton from "components/IconButton.svelte";
|
2021-05-06 16:10:26 +02:00
|
|
|
|
|
|
|
export const editorToolbar = {
|
2021-05-06 20:29:55 +02:00
|
|
|
AddonButtons,
|
2021-05-06 16:10:26 +02:00
|
|
|
PreviewButton,
|
|
|
|
LabelButton,
|
|
|
|
IconButton,
|
|
|
|
};
|
2021-04-07 23:53:09 +02:00
|
|
|
</script>
|
|
|
|
|
2021-03-25 23:32:23 +01:00
|
|
|
<script lang="typescript">
|
2021-04-27 23:08:47 +02:00
|
|
|
import StickyBar from "components/StickyBar.svelte";
|
2021-05-06 18:51:44 +02:00
|
|
|
import ButtonToolbar from "components/ButtonToolbar.svelte";
|
2021-05-06 19:26:50 +02:00
|
|
|
import ButtonToolbarItem from "components/ButtonToolbarItem.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-05-06 19:26:50 +02:00
|
|
|
export const toolbar = {};
|
2021-05-05 01:22:51 +02:00
|
|
|
export const notetypeButtons = {};
|
2021-05-06 16:10:26 +02:00
|
|
|
export const formatInlineButtons = {};
|
|
|
|
export const formatBlockButtons = {};
|
|
|
|
export const colorButtons = {};
|
|
|
|
export const templateButtons = {};
|
2021-05-05 01:22:51 +02:00
|
|
|
|
2021-06-04 07:11:34 +02:00
|
|
|
export let size = 1.85;
|
2021-05-27 17:13:36 +02:00
|
|
|
export let wrap = true;
|
2021-03-25 21:11:40 +01:00
|
|
|
</script>
|
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
<StickyBar>
|
|
|
|
<ButtonToolbar {size} {wrap} api={toolbar}>
|
|
|
|
<ButtonToolbarItem id="notetype">
|
|
|
|
<NoteTypeButtons api={notetypeButtons} />
|
|
|
|
</ButtonToolbarItem>
|
2021-05-06 19:26:50 +02:00
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
<ButtonToolbarItem id="inlineFormatting">
|
|
|
|
<FormatInlineButtons api={formatInlineButtons} />
|
|
|
|
</ButtonToolbarItem>
|
2021-05-06 19:26:50 +02:00
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
<ButtonToolbarItem id="blockFormatting">
|
|
|
|
<FormatBlockButtons api={formatBlockButtons} />
|
|
|
|
</ButtonToolbarItem>
|
2021-05-06 19:26:50 +02:00
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
<ButtonToolbarItem id="color">
|
|
|
|
<ColorButtons api={colorButtons} />
|
|
|
|
</ButtonToolbarItem>
|
2021-05-06 19:26:50 +02:00
|
|
|
|
2021-05-27 17:13:36 +02:00
|
|
|
<ButtonToolbarItem id="template">
|
|
|
|
<TemplateButtons api={templateButtons} />
|
|
|
|
</ButtonToolbarItem>
|
|
|
|
</ButtonToolbar>
|
|
|
|
</StickyBar>
|