diff --git a/src/public/app/components/app_context.ts b/src/public/app/components/app_context.ts index e06ee5dd7..69b153661 100644 --- a/src/public/app/components/app_context.ts +++ b/src/public/app/components/app_context.ts @@ -23,6 +23,7 @@ import type { Attribute } from "../services/attribute_parser.js"; import type NoteTreeWidget from "../widgets/note_tree.js"; import type { default as NoteContext, GetTextEditorCallback } from "./note_context.js"; import type TypeWidget from "../widgets/type_widgets/type_widget.js"; +import type EditableTextTypeWidget from "../widgets/type_widgets/editable_text.js"; interface Layout { getRootWidget: (appContext: AppContext) => RootWidget; @@ -131,10 +132,10 @@ export type CommandMappings = { protectSubtree: ContextMenuCommandData; unprotectSubtree: ContextMenuCommandData; openBulkActionsDialog: - | ContextMenuCommandData - | { - selectedOrActiveNoteIds?: string[]; - }; + | ContextMenuCommandData + | { + selectedOrActiveNoteIds?: string[]; + }; editBranchPrefix: ContextMenuCommandData; convertNoteToAttachment: ContextMenuCommandData; duplicateSubtree: ContextMenuCommandData; @@ -361,6 +362,10 @@ type EventMappings = { relationMapResetZoomIn: { ntxId: string | null | undefined }; relationMapResetZoomOut: { ntxId: string | null | undefined }; activeNoteChangedEvent: {}; + showAddLinkDialog: { + textTypeWidget: EditableTextTypeWidget; + text: string; + }; }; export type EventListener = { diff --git a/src/public/app/widgets/dialogs/about.ts b/src/public/app/widgets/dialogs/about.ts index f77f67372..790e5e578 100644 --- a/src/public/app/widgets/dialogs/about.ts +++ b/src/public/app/widgets/dialogs/about.ts @@ -83,7 +83,7 @@ export default class AboutDialog extends BasicWidget { this.$dataDirectory = this.$widget.find(".data-directory"); } - async refresh(): Promise { + async refresh() { const appInfo = await server.get("app-info"); this.$appVersion.text(appInfo.appVersion); @@ -109,7 +109,7 @@ export default class AboutDialog extends BasicWidget { } } - async openAboutDialogEvent(): Promise { + async openAboutDialogEvent() { await this.refresh(); utils.openDialog(this.$widget); } diff --git a/src/public/app/widgets/dialogs/add_link.ts b/src/public/app/widgets/dialogs/add_link.ts index fff519a1e..2a987d3ff 100644 --- a/src/public/app/widgets/dialogs/add_link.ts +++ b/src/public/app/widgets/dialogs/add_link.ts @@ -5,6 +5,7 @@ import utils from "../../services/utils.js"; import BasicWidget from "../basic_widget.js"; import type { Suggestion } from "../../services/note_autocomplete.js"; import type { default as TextTypeWidget } from "../type_widgets/editable_text.js"; +import type { EventData } from "../../components/app_context.js"; const TPL = `