From ecb2c53c6f0af8898157004441bee9af8e71191a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 15 Feb 2025 01:02:24 +0200 Subject: [PATCH] feat(in_app_help): support webviews --- src/services/in_app_help.ts | 14 ++++++++++++++ src/services/meta/note_meta.ts | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.ts index 0af911684..fffbf7812 100644 --- a/src/services/in_app_help.ts +++ b/src/services/in_app_help.ts @@ -44,6 +44,15 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt for (const attribute of noteMeta.attributes ?? []) { if (attribute.name === "iconClass") { iconClass = attribute.value; + continue; + } + + if (attribute.name === "webViewSrc") { + item.attributes?.push({ + type: "label", + name: attribute.name, + value: attribute.value + }); } } @@ -64,6 +73,11 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt }); } + // Handle web views + if (noteMeta.type === "webView") { + item.type = "webView"; + } + // Handle children if (noteMeta.children) { const children: HiddenSubtreeItem[] = []; diff --git a/src/services/meta/note_meta.ts b/src/services/meta/note_meta.ts index 0aaafb6b5..681ca4f8c 100644 --- a/src/services/meta/note_meta.ts +++ b/src/services/meta/note_meta.ts @@ -1,3 +1,4 @@ +import type { NoteType } from "../../becca/entities/rows.js"; import type AttachmentMeta from "./attachment_meta.js"; import type AttributeMeta from "./attribute_meta.js"; @@ -15,7 +16,7 @@ export default interface NoteMeta { notePosition?: number; prefix?: string | null; isExpanded?: boolean; - type?: string; + type?: NoteType; mime?: string; /** 'html' or 'markdown', applicable to text notes only */ format?: "html" | "markdown";