From 3e7e0eea88f19a3e35ec6ef6315395aec66f2a23 Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Mon, 24 May 2021 19:44:20 +0200 Subject: [PATCH 1/7] Fix toggle tooltips in settings --- src/Settings/metaEditSettingsTab.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Settings/metaEditSettingsTab.ts b/src/Settings/metaEditSettingsTab.ts index 5c23cd2..d794d75 100644 --- a/src/Settings/metaEditSettingsTab.ts +++ b/src/Settings/metaEditSettingsTab.ts @@ -89,7 +89,7 @@ export class MetaEditSettingsTab extends PluginSettingTab { .setDesc("Quick switch for values you know the value of.") .addToggle(toggle => { toggle - .setTooltip("Toggle Progress Properties") + .setTooltip("Toggle Auto Properties") .setValue(this.plugin.settings.AutoProperties.enabled) .onChange(async value => { if (value === this.plugin.settings.AutoProperties.enabled) return; @@ -126,7 +126,7 @@ export class MetaEditSettingsTab extends PluginSettingTab { .setDesc("Hide these properties from the menu.") .addToggle(toggle => { toggle - .setTooltip("Toggle Progress Properties") + .setTooltip("Toggle Ignored Properties") .setValue(this.plugin.settings.IgnoredProperties.enabled) .onChange(async value => { if (value === this.plugin.settings.IgnoredProperties.enabled) return; From ebffa79fe934caf98c038749be9f226d9dfd575c Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Mon, 24 May 2021 20:31:31 +0200 Subject: [PATCH 2/7] Add auto-property suggest when adding new properties --- src/Modals/GenericPrompt/GenericPrompt.ts | 8 ++++-- .../GenericPrompt/GenericPromptContent.svelte | 18 ++++++++++-- .../GenericPrompt/genericTextSuggester.ts | 28 +++++++++++++++++++ src/Modals/metaEditSuggester.ts | 19 +++++++++++-- src/metaController.ts | 4 +-- 5 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 src/Modals/GenericPrompt/genericTextSuggester.ts diff --git a/src/Modals/GenericPrompt/GenericPrompt.ts b/src/Modals/GenericPrompt/GenericPrompt.ts index c2d4e92..32a6960 100644 --- a/src/Modals/GenericPrompt/GenericPrompt.ts +++ b/src/Modals/GenericPrompt/GenericPrompt.ts @@ -7,20 +7,22 @@ export default class GenericPrompt extends Modal { private input: string; public waitForClose: Promise; - public static Prompt(app: App, header: string, placeholder?: string, value?: string): Promise { - const newPromptModal = new GenericPrompt(app, header, placeholder, value); + public static Prompt(app: App, header: string, placeholder?: string, value?: string, suggestValues?: string[]): Promise { + const newPromptModal = new GenericPrompt(app, header, placeholder, value, suggestValues); return newPromptModal.waitForClose; } - private constructor(app: App, header: string, placeholder?: string, value?: string) { + private constructor(app: App, header: string, placeholder?: string, value?: string, suggestValues?: string[]) { super(app); this.modalContent = new GenericPromptContent({ target: this.contentEl, props: { + app, header, placeholder, value, + suggestValues, onSubmit: (input: string) => { this.input = input; this.close(); diff --git a/src/Modals/GenericPrompt/GenericPromptContent.svelte b/src/Modals/GenericPrompt/GenericPromptContent.svelte index c0a0638..f7d013b 100644 --- a/src/Modals/GenericPrompt/GenericPromptContent.svelte +++ b/src/Modals/GenericPrompt/GenericPromptContent.svelte @@ -1,13 +1,21 @@