diff --git a/ts/components/WithContext.svelte b/ts/components/WithContext.svelte
index 111da8c1e..5cfba6123 100644
--- a/ts/components/WithContext.svelte
+++ b/ts/components/WithContext.svelte
@@ -6,7 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { Readable } from "svelte/store";
import { getContext } from "svelte";
- type T = unknown;
+ type T = boolean;
export let key: Symbol | string;
diff --git a/ts/editor/CommandIconButton.svelte b/ts/editor/CommandIconButton.svelte
new file mode 100644
index 000000000..4781d2ccc
--- /dev/null
+++ b/ts/editor/CommandIconButton.svelte
@@ -0,0 +1,79 @@
+
+
+
+
+ {#if withoutShortcut && withoutState}
+ document.execCommand(key)}>
+
+
+ {:else if withoutShortcut}
+ document.queryCommandState(key)}
+ let:state={active}
+ let:updateState
+ >
+ {
+ document.execCommand(key);
+ updateState(event);
+ }}
+ >
+
+
+
+ {:else if withoutState}
+
+ document.execCommand(key)}
+ on:mount={createShortcut}
+ >
+
+
+
+ {:else}
+
+ document.queryCommandState(key)}
+ let:state={active}
+ let:updateState
+ >
+ {
+ document.execCommand(key);
+ updateState(event);
+ }}
+ on:mount={createShortcut}
+ >
+
+
+
+
+ {/if}
+
diff --git a/ts/editor/FormatBlockButtons.svelte b/ts/editor/FormatBlockButtons.svelte
index 358b02ad5..f1d4376ea 100644
--- a/ts/editor/FormatBlockButtons.svelte
+++ b/ts/editor/FormatBlockButtons.svelte
@@ -11,8 +11,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import IconButton from "components/IconButton.svelte";
import ButtonDropdown from "components/ButtonDropdown.svelte";
import ButtonToolbarItem from "components/ButtonToolbarItem.svelte";
- import WithState from "components/WithState.svelte";
import WithDropdownMenu from "components/WithDropdownMenu.svelte";
+ import OnlyEditable from "./OnlyEditable.svelte";
+ import CommandIconButton from "./CommandIconButton.svelte";
import { getListItem } from "./helpers";
import {
@@ -46,134 +47,66 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- document.queryCommandState("insertUnorderedList")}
- let:state={active}
- let:updateState
+ tooltip={tr.editingUnorderedList()}
+ withoutShortcut>{@html ulIcon}
- {
- document.execCommand("insertUnorderedList");
- updateState(event);
- }}
- >
- {@html ulIcon}
-
-
- document.queryCommandState("insertOrderedList")}
- let:state={active}
- let:updateState
+ tooltip={tr.editingOrderedList()}
+ withoutShortcut>{@html olIcon}
- {
- document.execCommand("insertOrderedList");
- updateState(event);
- }}
- >
- {@html olIcon}
-
-
-
- {@html listOptionsIcon}
-
+
+
+ {@html listOptionsIcon}
+
+