anki/ts/editor-toolbar/EditorToolbar.svelte

64 lines
2.0 KiB
Svelte
Raw Normal View History

2021-03-25 23:32:23 +01:00
<script lang="typescript">
import ButtonBarOuter from "./ButtonBarOuter.svelte";
import ButtonBar from "./ButtonBar.svelte";
2021-03-29 14:54:10 +02:00
import LabelButton from "./LabelButton.svelte";
import IconButton from "./IconButton.svelte";
2021-03-25 23:32:23 +01:00
2021-03-29 14:54:10 +02:00
import boldIcon from "./type-bold.svg";
import italicIcon from "./type-italic.svg";
import underlineIcon from "./type-underline.svg";
2021-03-29 15:27:42 +02:00
import superscriptIcon from "./format-superscript.svg";
import subscriptIcon from "./format-subscript.svg";
import bracketsIcon from "./code-brackets.svg";
import eraserIcon from "./eraser.svg";
import paperclipIcon from "./paperclip.svg";
import micIcon from "./mic.svg";
import threeDotsIcon from "./three-dots.svg";
import { forecolorButton, colorpickerButton } from "./color";
2021-03-29 14:54:10 +02:00
export let leftButtons = [
{ component: LabelButton, label: "Fields..." },
{ component: LabelButton, label: "Cards..." },
];
export let rightButtons = [
{ component: IconButton, icon: boldIcon },
{ component: IconButton, icon: italicIcon },
{ component: IconButton, icon: underlineIcon },
2021-03-29 15:27:42 +02:00
{ component: IconButton, icon: superscriptIcon },
{ component: IconButton, icon: subscriptIcon },
{ component: IconButton, icon: eraserIcon },
forecolorButton,
colorpickerButton,
2021-03-29 15:27:42 +02:00
{ component: IconButton, icon: bracketsIcon },
{ component: IconButton, icon: paperclipIcon },
{ component: IconButton, icon: micIcon },
{ component: IconButton, icon: threeDotsIcon },
2021-03-29 14:54:10 +02:00
];
2021-03-25 23:32:23 +01:00
export let nightMode: boolean;
console.log(nightMode);
2021-03-25 21:11:40 +01:00
</script>
2021-03-25 23:32:23 +01:00
<ButtonBarOuter>
<ButtonBar>
{#each leftButtons as leftButton}
2021-03-29 14:54:10 +02:00
<svelte:component this={leftButton.component} {...leftButton} />
2021-03-25 23:32:23 +01:00
{/each}
</ButtonBar>
2021-03-25 21:11:40 +01:00
2021-03-25 23:32:23 +01:00
<ButtonBar>
{#each rightButtons as rightButton}
2021-03-29 14:54:10 +02:00
<svelte:component this={rightButton.component} {...rightButton} />
2021-03-25 23:32:23 +01:00
{/each}
</ButtonBar>
</ButtonBarOuter>