Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
Merge remote-tracking branch 'origin/main' into react/type_widgets
Elian Doran7fc9f0884364
diff --cc apps/client/src/widgets/NoteDetail.cssindex 99bbfe2c29,0000000000..4382277805mode 100644,000000..100644--- a/apps/client/src/widgets/NoteDetail.css+++ b/apps/client/src/widgets/NoteDetail.css@@@ -1,19 -1,0 +1,15 @@@+.component.note-detail {+ max-width: var(--max-content-width); /* Inherited from .note-split */+ font-family: var(--detail-font-family);+ font-size: var(--detail-font-size);+ contain: none;+}++body.prefers-centered-content .note-detail {+ /* Horizontally center the widget in its parent when the "Keep content centered" option is on */+ margin-inline: auto;+}+- .note-detail.full-height {- height: 100%;- }-+.note-detail > * {+ contain: none;+}diff --cc apps/client/src/widgets/note_types.tsxindex cb4372c4aa,0000000000..a6b3feb278mode 100644,000000..100644--- a/apps/client/src/widgets/note_types.tsx+++ b/apps/client/src/widgets/note_types.tsx@@@ -1,142 -1,0 +1,143 @@@+/**+ * @module+ * Contains the definitions for all the note types supported by the application.+ */++import { NoteType } from "@triliumnext/commons";+import { VNode, type JSX } from "preact";+import { TypeWidgetProps } from "./type_widgets/type_widget";++/**+ * 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,+ * for protected session or attachment information.+ */+export type ExtendedNoteType = Exclude<NoteType, "launcher" | "text" | "code"> | "empty" | "readOnlyCode" | "readOnlyText" | "editableText" | "editableCode" | "attachmentDetail" | "attachmentList" | "protectedSession" | "aiChat";++export type TypeWidget = ((props: TypeWidgetProps) => VNode | JSX.Element);+type NoteTypeView = () => (Promise<{ default: TypeWidget } | TypeWidget> | TypeWidget);++interface NoteTypeMapping {+ view: NoteTypeView;+ printable?: boolean;+ /** The class name to assign to the note type wrapper */+ className: string;+ isFullHeight?: boolean;+}++export const TYPE_MAPPINGS: Record<ExtendedNoteType, NoteTypeMapping> = {+ empty: {+ view: () => import("./type_widgets/Empty"),+ className: "note-detail-empty",+ printable: true+ },+ doc: {+ view: () => import("./type_widgets/Doc"),+ className: "note-detail-doc",+ printable: true+ },+ search: {+ view: () => (props: TypeWidgetProps) => <></>,+ className: "note-detail-none",+ printable: true+ },+ protectedSession: {+ view: () => import("./type_widgets/ProtectedSession"),+ className: "protected-session-password-component"+ },+ book: {+ view: () => import("./type_widgets/Book"),+ className: "note-detail-book",+ printable: true,+ },+ contentWidget: {+ view: () => import("./type_widgets/ContentWidget"),+ className: "note-detail-content-widget",+ printable: true+ },+ webView: {+ view: () => import("./type_widgets/WebView"),+ className: "note-detail-web-view",+ printable: true,+ isFullHeight: true+ },+ file: {+ view: () => import("./type_widgets/File"),+ className: "note-detail-file",+ printable: true,+ isFullHeight: true+ },+ image: {+ view: () => import("./type_widgets/Image"),+ className: "note-detail-image",+ printable: true+ },+ readOnlyCode: {+ view: async () => (await import("./type_widgets/code/Code")).ReadOnlyCode,+ className: "note-detail-readonly-code",+ printable: true+ },+ editableCode: {+ view: async () => (await import("./type_widgets/code/Code")).EditableCode,+ className: "note-detail-code",+ printable: true+ },+ mermaid: {+ view: () => import("./type_widgets/Mermaid"),+ className: "note-detail-mermaid",+ printable: true,+ isFullHeight: true+ },+ mindMap: {+ view: () => import("./type_widgets/MindMap"),+ className: "note-detail-mind-map",+ printable: true,+ isFullHeight: true+ },+ attachmentList: {+ view: async () => (await import("./type_widgets/Attachment")).AttachmentList,+ className: "attachment-list",+ printable: true+ },+ attachmentDetail: {+ view: async () => (await import("./type_widgets/Attachment")).AttachmentDetail,+ className: "attachment-detail",+ printable: true+ },+ readOnlyText: {+ view: () => import("./type_widgets/text/ReadOnlyText"),+ className: "note-detail-readonly-text"+ },+ editableText: {+ view: () => import("./type_widgets/text/EditableText"),+ className: "note-detail-editable-text",+ printable: true+ },+ render: {+ view: () => import("./type_widgets/Render"),+ className: "note-detail-render",+ printable: true+ },+ canvas: {+ view: () => import("./type_widgets/canvas/Canvas"),+ className: "note-detail-canvas",+ printable: true,+ isFullHeight: true+ },+ relationMap: {+ view: () => import("./type_widgets/relation_map/RelationMap"),+ className: "note-detail-relation-map",- printable: true++ printable: true,++ isFullHeight: true+ },+ noteMap: {+ view: () => import("./type_widgets/NoteMap"),+ className: "note-detail-note-map",+ printable: true,+ isFullHeight: true+ },+ aiChat: {+ view: () => import("./type_widgets/AiChat"),+ className: "ai-chat-widget-container",+ isFullHeight: true+ }+};diff --cc apps/client/src/widgets/type_widgets/canvas/Canvas.cssindex cf5a2804a2,0000000000..08b3553189mode 100644,000000..100644--- a/apps/client/src/widgets/type_widgets/canvas/Canvas.css+++ b/apps/client/src/widgets/type_widgets/canvas/Canvas.css@@@ -1,34 -1,0 +1,38 @@@++.canvas-widget {++ height: 100%;++}+++.excalidraw .App-menu_top .buttonList {+ display: flex;+}++/* Conflict between excalidraw and bootstrap classes keeps the menu hidden */+/* https://github.com/zadam/trilium/issues/3780 */+/* https://github.com/excalidraw/excalidraw/issues/6567 */+.excalidraw .dropdown-menu {+ display: block;+}++.excalidraw-wrapper {+ height: 100%;+}++:root[dir="ltr"]+.excalidraw+.layer-ui__wrapper+.zen-mode-transition.App-menu_bottom--transition-left {+ transform: none;+}++/* collaboration not possible so hide the button */+.CollabButton {+ display: none !important;+}++.library-button {+ display: none !important; /* library won't work without extra support which isn't currently implemented */+}++.note-detail-canvas > .canvas-render {+ height: 100%;+}