diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsx
index e65f8ec66..af25ac905 100644
--- a/apps/client/src/widgets/NoteDetail.tsx
+++ b/apps/client/src/widgets/NoteDetail.tsx
@@ -11,6 +11,7 @@ import { TypeWidgetProps } from "./type_widgets/type_widget";
import ProtectedSession from "./type_widgets/ProtectedSession";
import Book from "./type_widgets/Book";
import ContentWidget from "./type_widgets/ContentWidget";
+import WebView from "./type_widgets/WebView";
/**
* A `NoteType` altered by the note detail widget, taking into consideration whether the note is editable or not and adding special note types such as an empty one,
@@ -64,6 +65,7 @@ function getCorrespondingWidget(noteType: ExtendedNoteType | undefined, props: T
case "protectedSession": return
case "book": return
case "contentWidget": return
+ case "webView": return
default: break;
}
}
diff --git a/apps/client/src/widgets/type_widgets/WebView.tsx b/apps/client/src/widgets/type_widgets/WebView.tsx
new file mode 100644
index 000000000..fd4d364c6
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/WebView.tsx
@@ -0,0 +1,37 @@
+import { t } from "../../services/i18n";
+import utils from "../../services/utils";
+import Alert from "../react/Alert";
+import { useNoteLabel } from "../react/hooks";
+import { TypeWidgetProps } from "./type_widget";
+
+const isElectron = utils.isElectron();
+
+export default function WebView({ note }: TypeWidgetProps) {
+ const [ webViewSrc ] = useNoteLabel(note, "webViewSrc");
+
+ return (
+
+ {webViewSrc
+ ?
+ : }
+
+ )
+}
+
+function WebViewContent({ src }: { src: string }) {
+ if (!isElectron) {
+ return
+ } else {
+ return
+ }
+}
+
+function WebViewHelp() {
+ return (
+
+ {t("web_view.web_view")}
+ {t("web_view.embed_websites")}
+ {t("web_view.create_label")}
+
+ )
+}
diff --git a/apps/client/src/widgets/type_widgets_old/web_view.ts b/apps/client/src/widgets/type_widgets_old/web_view.ts
index 26575d3dc..a4b0c47c7 100644
--- a/apps/client/src/widgets/type_widgets_old/web_view.ts
+++ b/apps/client/src/widgets/type_widgets_old/web_view.ts
@@ -6,23 +6,13 @@ import type { EventData } from "../../components/app_context.js";
import utils from "../../services/utils.js";
const TPL = /*html*/`
-
-
-
${t("web_view.web_view")}
-
-
${t("web_view.embed_websites")}
-
-
${t("web_view.create_label")}
-
-
${buildElement()}
`;
function buildElement() {
if (!utils.isElectron()) {
- return ``;
} else {
- return ``;
+ return ``;
}
}
diff --git a/packages/commons/src/lib/attribute_names.ts b/packages/commons/src/lib/attribute_names.ts
index 8b8de89c1..ed527308a 100644
--- a/packages/commons/src/lib/attribute_names.ts
+++ b/packages/commons/src/lib/attribute_names.ts
@@ -39,6 +39,9 @@ type Labels = {
"board:groupBy": string;
maxNestingDepth: number;
includeArchived: boolean;
+
+ // Note-type specific
+ webViewSrc: string;
}
/**