diff --git a/ts/components/contextKeys.ts b/ts/components/contextKeys.ts
index 10979427f..008569399 100644
--- a/ts/components/contextKeys.ts
+++ b/ts/components/contextKeys.ts
@@ -6,3 +6,4 @@ export const disabledKey = Symbol("disabled");
export const buttonToolbarKey = Symbol("buttonToolbar");
export const buttonGroupKey = Symbol("buttonGroup");
export const dropdownKey = Symbol("dropdown");
+export const modalsKey = Symbol("modals");
diff --git a/ts/deckoptions/BUILD.bazel b/ts/deckoptions/BUILD.bazel
index b4ab8312e..ce2c723ee 100644
--- a/ts/deckoptions/BUILD.bazel
+++ b/ts/deckoptions/BUILD.bazel
@@ -61,11 +61,9 @@ ts_library(
"lib.ts",
"steps.ts",
"strings.ts",
- "textInputModal.ts",
],
module_name = "deckoptions",
deps = [
- "TextInputModal",
"//ts:image_module_support",
"//ts/lib",
"//ts/lib:backend_proto",
diff --git a/ts/deckoptions/ConfigSelector.svelte b/ts/deckoptions/ConfigSelector.svelte
index 836f53559..d75918f05 100644
--- a/ts/deckoptions/ConfigSelector.svelte
+++ b/ts/deckoptions/ConfigSelector.svelte
@@ -6,8 +6,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import * as tr from "lib/i18n";
import type { DeckOptionsState, ConfigListEntry } from "./lib";
- import WithTheming from "components/WithTheming.svelte";
+ import TextInputModal from "./TextInputModal.svelte";
import StickyBar from "components/StickyBar.svelte";
+ import WithTheming from "components/WithTheming.svelte";
import ButtonToolbar from "components/ButtonToolbar.svelte";
import ButtonToolbarItem from "components/ButtonToolbarItem.svelte";
import ButtonGroup from "components/ButtonGroup.svelte";
@@ -20,6 +21,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let state: DeckOptionsState;
let configList = state.configList;
+ let addModalKey: string;
+ let renameModalKey: string;
+
function configLabel(entry: ConfigListEntry): string {
const count = tr.deckConfigUsedByDecks({ decks: entry.useCount });
return `${entry.name} (${count})`;
@@ -28,8 +32,31 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
function blur(event: Event): void {
state.setCurrentIndex(parseInt((event.target! as HTMLSelectElement).value));
}
+
+ function onAddConfig(text: string): void {
+ const trimmed = text.trim();
+ if (trimmed.length) {
+ state.addConfig(trimmed);
+ }
+ }
+
+ function onRenameConfig(text: string): void {
+ state.setCurrentName(text);
+ }
+
+
+
@@ -50,7 +77,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-
+
diff --git a/ts/deckoptions/DeckOptionsPage.svelte b/ts/deckoptions/DeckOptionsPage.svelte
index 809c93bda..32eacae6d 100644
--- a/ts/deckoptions/DeckOptionsPage.svelte
+++ b/ts/deckoptions/DeckOptionsPage.svelte
@@ -41,21 +41,5 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
onDestroy(() => registerCleanup?.());
-
-
-
-
+
diff --git a/ts/deckoptions/SaveButton.svelte b/ts/deckoptions/SaveButton.svelte
index 9bc6d1f31..28a79dc5a 100644
--- a/ts/deckoptions/SaveButton.svelte
+++ b/ts/deckoptions/SaveButton.svelte
@@ -4,8 +4,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
@@ -78,8 +69,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html