fix(EditableTest): Fix EdtableText to use new API

This commit is contained in:
Jakob Schlanstedt 2025-11-21 11:17:59 +01:00
parent 995e765276
commit 213c36ba84

View File

@ -16,7 +16,7 @@ import note_create from "../../../services/note_create";
import TouchBar, { TouchBarButton, TouchBarGroup, TouchBarSegmentedControl } from "../../react/TouchBar"; import TouchBar, { TouchBarButton, TouchBarGroup, TouchBarSegmentedControl } from "../../react/TouchBar";
import { RefObject } from "preact"; import { RefObject } from "preact";
import { buildSelectedBackgroundColor } from "../../../components/touch_bar"; import { buildSelectedBackgroundColor } from "../../../components/touch_bar";
import { deferred } from "@triliumnext/commons"; import { CreateNoteAction, deferred } from "@triliumnext/commons";
import { t } from "../../../services/i18n"; import { t } from "../../../services/i18n";
/** /**
@ -107,17 +107,18 @@ export default function EditableText({ note, parentComponent, ntxId, noteContext
}, },
loadIncludedNote, loadIncludedNote,
// Creating notes in @-completion // Creating notes in @-completion
async createNoteForReferenceLink(title: string) { async createNoteFromCkEditor (
const notePath = noteContext?.notePath; title: string,
if (!notePath) return; parentNotePath: string | undefined,
action: CreateNoteAction
const resp = await note_create.createNoteWithTypePrompt(notePath, { ): Promise<string> {
activate: false, const { note }= await note_create.createNoteFromAction(
title: title action,
}); true,
title,
if (!resp || !resp.note) return; parentNotePath,
return resp.note.getBestNotePathString(); )
return note?.getBestNotePathString() ?? "";
}, },
// Keyboard shortcut // Keyboard shortcut
async followLinkUnderCursorCommand() { async followLinkUnderCursorCommand() {