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-23 19:02:28 +02:00
|
|
|
import type { ToolbarItem, IterableToolbarItem } from "./types";
|
2021-04-08 22:11:50 +02:00
|
|
|
|
2021-04-25 19:15:00 +02:00
|
|
|
import EditorToolbar from "./EditorToolbar.svelte";
|
|
|
|
export { default as EditorToolbar } from "./EditorToolbar.svelte";
|
2021-03-25 21:11:40 +01:00
|
|
|
|
2021-04-14 14:37:14 +02:00
|
|
|
import "./bootstrap.css";
|
2021-04-14 14:29:06 +02:00
|
|
|
|
2021-04-25 18:25:03 +02:00
|
|
|
export function editorToolbar(
|
|
|
|
target: HTMLElement,
|
2021-04-25 19:15:00 +02:00
|
|
|
buttons: IterableToolbarItem[] = [],
|
|
|
|
menus: ToolbarItem[] = []
|
|
|
|
): EditorToolbar {
|
|
|
|
return new EditorToolbar({
|
2021-04-25 18:25:03 +02:00
|
|
|
target,
|
|
|
|
props: {
|
|
|
|
buttons,
|
|
|
|
menus,
|
|
|
|
nightMode: document.documentElement.classList.contains("night-mode"),
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2021-04-01 02:26:56 +02:00
|
|
|
|
2021-04-20 02:07:15 +02:00
|
|
|
/* Exports for editor */
|
2021-04-22 19:19:39 +02:00
|
|
|
// @ts-expect-error insufficient typing of svelte modules
|
2021-04-09 00:51:20 +02:00
|
|
|
export { updateActiveButtons, clearActiveButtons } from "./CommandIconButton.svelte";
|
2021-04-22 19:19:39 +02:00
|
|
|
// @ts-expect-error insufficient typing of svelte modules
|
2021-04-09 00:51:20 +02:00
|
|
|
export { enableButtons, disableButtons } from "./EditorToolbar.svelte";
|