From 213c36ba84b7b51b0e73e1db649ac4dd88d246aa Mon Sep 17 00:00:00 2001 From: Jakob Schlanstedt Date: Fri, 21 Nov 2025 11:17:59 +0100 Subject: [PATCH] fix(EditableTest): Fix EdtableText to use new API --- .../type_widgets/text/EditableText.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/text/EditableText.tsx b/apps/client/src/widgets/type_widgets/text/EditableText.tsx index 5e3d06a76..6ad0114b4 100644 --- a/apps/client/src/widgets/type_widgets/text/EditableText.tsx +++ b/apps/client/src/widgets/type_widgets/text/EditableText.tsx @@ -16,7 +16,7 @@ import note_create from "../../../services/note_create"; import TouchBar, { TouchBarButton, TouchBarGroup, TouchBarSegmentedControl } from "../../react/TouchBar"; import { RefObject } from "preact"; import { buildSelectedBackgroundColor } from "../../../components/touch_bar"; -import { deferred } from "@triliumnext/commons"; +import { CreateNoteAction, deferred } from "@triliumnext/commons"; import { t } from "../../../services/i18n"; /** @@ -107,17 +107,18 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext }, loadIncludedNote, // Creating notes in @-completion - async createNoteForReferenceLink(title: string) { - const notePath = noteContext?.notePath; - if (!notePath) return; - - const resp = await note_create.createNoteWithTypePrompt(notePath, { - activate: false, - title: title - }); - - if (!resp || !resp.note) return; - return resp.note.getBestNotePathString(); + async createNoteFromCkEditor ( + title: string, + parentNotePath: string | undefined, + action: CreateNoteAction + ): Promise { + const { note }= await note_create.createNoteFromAction( + action, + true, + title, + parentNotePath, + ) + return note?.getBestNotePathString() ?? ""; }, // Keyboard shortcut async followLinkUnderCursorCommand() {