mirror of
https://github.com/zadam/trilium.git
synced 2025-12-07 16:04:23 +01:00
fix(EditableTest): Fix EdtableText to use new API
This commit is contained in:
parent
4eb773569c
commit
adfa01b8e8
@ -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";
|
||||
|
||||
/**
|
||||
* The editor can operate into two distinct modes:
|
||||
@ -106,17 +106,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<string> {
|
||||
const { note }= await note_create.createNoteFromAction(
|
||||
action,
|
||||
true,
|
||||
title,
|
||||
parentNotePath,
|
||||
)
|
||||
return note?.getBestNotePathString() ?? "";
|
||||
},
|
||||
// Keyboard shortcut
|
||||
async followLinkUnderCursorCommand() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user