mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-29 01:06:36 +01:00 
			
		
		
		
	feat(client/text): provide a way to disable slash commands
This commit is contained in:
		| @@ -1962,7 +1962,8 @@ | ||||
|   "editorfeatures": { | ||||
|     "title": "Features", | ||||
|     "emoji_completion_enabled": "Enable Emoji auto-completion", | ||||
|     "note_completion_enabled": "Enable note auto-completion" | ||||
|     "note_completion_enabled": "Enable note auto-completion", | ||||
|     "slash_commands_enabled": "Enable slash commands" | ||||
|   }, | ||||
|   "table_view": { | ||||
|     "new-row": "New row", | ||||
|   | ||||
| @@ -244,5 +244,9 @@ function getDisabledPlugins() { | ||||
|         disabledPlugins.push("EmojiMention"); | ||||
|     } | ||||
|  | ||||
|     if (options.get("textNoteSlashCommandsEnabled") !== "true") { | ||||
|         disabledPlugins.push("SlashCommand"); | ||||
|     } | ||||
|  | ||||
|     return disabledPlugins; | ||||
| } | ||||
|   | ||||
| @@ -73,6 +73,7 @@ function EditorFeatures() { | ||||
|         <OptionsSection title={t("editorfeatures.title")}> | ||||
|             <EditorFeature name="emoji-completion-enabled" optionName="textNoteEmojiCompletionEnabled" label={t("editorfeatures.emoji_completion_enabled")} /> | ||||
|             <EditorFeature name="note-completion-enabled" optionName="textNoteCompletionEnabled" label={t("editorfeatures.note_completion_enabled")} /> | ||||
|             <EditorFeature name="slash-commands-enabled" optionName="textNoteSlashCommandsEnabled" label={t("editorfeatures.slash_commands_enabled")} /> | ||||
|         </OptionsSection> | ||||
|     ); | ||||
| } | ||||
|   | ||||
| @@ -91,6 +91,7 @@ const ALLOWED_OPTIONS = new Set<OptionNames>([ | ||||
|     "textNoteEditorMultilineToolbar", | ||||
|     "textNoteEmojiCompletionEnabled", | ||||
|     "textNoteCompletionEnabled", | ||||
|     "textNoteSlashCommandsEnabled", | ||||
|     "layoutOrientation", | ||||
|     "backgroundEffects", | ||||
|     "allowedHtmlTags", | ||||
|   | ||||
| @@ -184,6 +184,7 @@ const defaultOptions: DefaultOption[] = [ | ||||
|     { name: "textNoteEditorMultilineToolbar", value: "false", isSynced: true }, | ||||
|     { name: "textNoteEmojiCompletionEnabled", value: "true", isSynced: true }, | ||||
|     { name: "textNoteCompletionEnabled", value: "true", isSynced: true }, | ||||
|     { name: "textNoteSlashCommandsEnabled", value: "true", isSynced: true }, | ||||
|  | ||||
|     // HTML import configuration | ||||
|     { name: "layoutOrientation", value: "vertical", isSynced: false }, | ||||
|   | ||||
| @@ -127,6 +127,8 @@ export interface OptionDefinitions extends KeyboardShortcutsOptions<KeyboardActi | ||||
|     textNoteEmojiCompletionEnabled: boolean; | ||||
|     /** Whether keyboard auto-completion for notes is triggered when typing `@` in text notes (attribute editing is not affected). */ | ||||
|     textNoteCompletionEnabled: boolean; | ||||
|     /** Whether keyboard auto-completion for editing commands is triggered when typing `/`. */ | ||||
|     textNoteSlashCommandsEnabled: boolean; | ||||
|     backgroundEffects: boolean; | ||||
|  | ||||
|     // Share settings | ||||
|   | ||||
		Reference in New Issue
	
	Block a user