From 0371405c236d86cbb81a185726dfed98ef921564 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 6 May 2021 01:58:14 +0200 Subject: [PATCH] Use ButtonGroupItem for all buttons in editor --- ts/components/ColorPicker.svelte | 24 +-- ts/components/IconButton.svelte | 21 ++- ts/components/LabelButton.svelte | 13 +- ts/components/WithDropdownMenu.svelte | 7 +- ts/editor/ColorButtons.svelte | 37 +++-- ts/editor/FormatBlockButtons.svelte | 221 ++++++++++++++------------ ts/editor/FormatInlineButtons.svelte | 216 +++++++++++++------------ ts/editor/TemplateButtons.svelte | 69 ++++---- 8 files changed, 334 insertions(+), 274 deletions(-) diff --git a/ts/components/ColorPicker.svelte b/ts/components/ColorPicker.svelte index 4430452c9..b2e8288fd 100644 --- a/ts/components/ColorPicker.svelte +++ b/ts/components/ColorPicker.svelte @@ -6,21 +6,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { onMount, createEventDispatcher, getContext } from "svelte"; import { nightModeKey } from "./contextKeys"; - export let id: string; - export let className = ""; - export let tooltip: string | undefined; + export let id: string | undefined = undefined; + let className = ""; + export { className as class }; + + export let tooltip: string | undefined = undefined; const nightMode = getContext(nightModeKey); - let buttonRef: HTMLButtonElement; - let inputRef: HTMLInputElement; - function delegateToInput() { inputRef.click(); } + let buttonRef: HTMLButtonElement; + let inputRef: HTMLInputElement; + const dispatch = createEventDispatcher(); - onMount(() => dispatch("mount", { button: buttonRef })); + onMount(() => dispatch("mount", { button: buttonRef, input: inputRef }));