From 701855344e9be60487ecfef8eb794b26a1db6c22 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 18 Aug 2025 09:40:36 +0300 Subject: [PATCH] feat(react/settings): port text features --- .../type_widgets/options/text_notes.tsx | 22 +++++++++ .../options/text_notes/features.ts | 45 ------------------- 2 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 apps/client/src/widgets/type_widgets/options/text_notes/features.ts diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsx index 4ae575317..c08f7289b 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx +++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx @@ -8,6 +8,7 @@ export default function TextNoteSettings() { return ( <> + ) } @@ -43,4 +44,25 @@ function FormattingToolbar() { /> ) +} + +function EditorFeatures() { + const [ textNoteEmojiCompletionEnabled, setTextNoteEmojiCompletionEnabled] = useTriliumOptionBool("textNoteEmojiCompletionEnabled"); + const [ textNoteCompletionEnabled, setTextNoteCompletionEnabled ] = useTriliumOptionBool("textNoteCompletionEnabled"); + + return ( + + + + + + ); } \ No newline at end of file diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/features.ts b/apps/client/src/widgets/type_widgets/options/text_notes/features.ts deleted file mode 100644 index d0986fe0d..000000000 --- a/apps/client/src/widgets/type_widgets/options/text_notes/features.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { OptionMap } from "@triliumnext/commons"; -import OptionsWidget from "../options_widget"; -import { t } from "../../../../services/i18n"; - -const TPL = /*html*/` -
-

${t("editorfeatures.title")}

- -
- -
- -
- -
-
-`; - -export default class EditorFeaturesOptions extends OptionsWidget { - - private $emojiCompletionEnabledCheckbox!: JQuery; - private $noteCompletionEnabledCheckbox!: JQuery; - - doRender() { - this.$widget = $(TPL); - - this.$emojiCompletionEnabledCheckbox = this.$widget.find(`input[name="emoji-completion-enabled"]`); - this.$emojiCompletionEnabledCheckbox.on("change", () => this.updateCheckboxOption("textNoteEmojiCompletionEnabled", this.$emojiCompletionEnabledCheckbox)) - - this.$noteCompletionEnabledCheckbox = this.$widget.find(`input[name="note-completion-enabled"]`); - this.$noteCompletionEnabledCheckbox.on("change", () => this.updateCheckboxOption("textNoteCompletionEnabled", this.$noteCompletionEnabledCheckbox)) - } - - optionsLoaded(options: OptionMap) { - this.setCheckboxState(this.$emojiCompletionEnabledCheckbox, options.textNoteEmojiCompletionEnabled); - this.setCheckboxState(this.$noteCompletionEnabledCheckbox, options.textNoteCompletionEnabled); - } - -}