diff --git a/manifest.json b/manifest.json index 59bf9ae..3cdf35a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "metaedit", "name": "MetaEdit", - "version": "1.6.1", + "version": "1.6.2", "minAppVersion": "0.12.0", "description": "MetaEdit helps you manage your metadata.", "author": "Christian B. B. Houmann", diff --git a/package.json b/package.json index bd125cb..56a73ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metaedit", - "version": "1.6.1", + "version": "1.6.2", "description": "MetaEdit helps you manage your metadata.", "main": "main.js", "scripts": { 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..8a03330 100644 --- a/src/Modals/GenericPrompt/GenericPromptContent.svelte +++ b/src/Modals/GenericPrompt/GenericPromptContent.svelte @@ -1,13 +1,21 @@