diff --git a/apps/client/src/widgets/dialogs/include_note.tsx b/apps/client/src/widgets/dialogs/include_note.tsx index 757d23829..911ed0dc0 100644 --- a/apps/client/src/widgets/dialogs/include_note.tsx +++ b/apps/client/src/widgets/dialogs/include_note.tsx @@ -8,7 +8,7 @@ import Button from "../react/Button"; import { Suggestion, triggerRecentNotes } from "../../services/note_autocomplete"; import tree from "../../services/tree"; import froca from "../../services/froca"; -import EditableTextTypeWidget from "../type_widgets/editable_text"; +import EditableTextTypeWidget, { type BoxSize } from "../type_widgets/editable_text"; import { useTriliumEvent } from "../react/hooks"; export default function IncludeNoteDialog() { @@ -37,7 +37,7 @@ export default function IncludeNoteDialog() { } setShown(false); - includeNote(suggestion.notePath, textTypeWidget); + includeNote(suggestion.notePath, textTypeWidget, boxSize as BoxSize); }} footer={} show={shown} @@ -69,13 +69,12 @@ export default function IncludeNoteDialog() { ) } -async function includeNote(notePath: string, textTypeWidget: EditableTextTypeWidget) { +async function includeNote(notePath: string, textTypeWidget: EditableTextTypeWidget, boxSize: BoxSize) { const noteId = tree.getNoteIdFromUrl(notePath); if (!noteId) { return; } const note = await froca.getNote(noteId); - const boxSize = $("input[name='include-note-box-size']:checked").val() as string; if (["image", "canvas", "mermaid"].includes(note?.type ?? "")) { // there's no benefit to use insert note functionlity for images, diff --git a/apps/client/src/widgets/type_widgets/editable_text.ts b/apps/client/src/widgets/type_widgets/editable_text.ts index 696e7900e..a092ae696 100644 --- a/apps/client/src/widgets/type_widgets/editable_text.ts +++ b/apps/client/src/widgets/type_widgets/editable_text.ts @@ -14,6 +14,8 @@ import type FNote from "../../entities/fnote.js"; import { PopupEditor, ClassicEditor, EditorWatchdog, type CKTextEditor, type MentionFeed, type WatchdogConfig, EditorConfig } from "@triliumnext/ckeditor5"; import { updateTemplateCache } from "./ckeditor/snippets.js"; +export type BoxSize = "small" | "medium" | "full"; + const TPL = /*html*/`