mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
feat(client/print): render presentation without shadow DOM
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { allViewTypes, ViewModeProps, ViewTypeOptions } from "./interface";
|
||||
import { allViewTypes, ViewModeMedia, ViewModeProps, ViewTypeOptions } from "./interface";
|
||||
import { useNoteContext, useNoteLabel, useNoteLabelBoolean, useTriliumEvent } from "../react/hooks";
|
||||
import FNote from "../../entities/fnote";
|
||||
import "./NoteList.css";
|
||||
@@ -22,9 +22,10 @@ interface NoteListProps {
|
||||
displayOnlyCollections?: boolean;
|
||||
isEnabled: boolean;
|
||||
ntxId: string | null | undefined;
|
||||
media: ViewModeMedia;
|
||||
}
|
||||
|
||||
export default function NoteList<T extends object>(props: Pick<NoteListProps, "displayOnlyCollections">) {
|
||||
export default function NoteList<T extends object>(props: Pick<NoteListProps, "displayOnlyCollections" | "media">) {
|
||||
const { note, noteContext, notePath, ntxId } = useNoteContext();
|
||||
const isEnabled = noteContext?.hasNoteList();
|
||||
return <CustomNoteList note={note} isEnabled={!!isEnabled} notePath={notePath} ntxId={ntxId} {...props} />
|
||||
@@ -34,7 +35,7 @@ export function SearchNoteList<T extends object>(props: Omit<NoteListProps, "isE
|
||||
return <CustomNoteList {...props} isEnabled={true} />
|
||||
}
|
||||
|
||||
export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId }: NoteListProps) {
|
||||
export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, ...restProps }: NoteListProps) {
|
||||
const widgetRef = useRef<HTMLDivElement>(null);
|
||||
const viewType = useNoteViewType(note);
|
||||
const noteIds = useNoteIds(note, viewType, ntxId);
|
||||
@@ -76,7 +77,8 @@ export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable
|
||||
note, noteIds, notePath,
|
||||
highlightedTokens,
|
||||
viewConfig: viewModeConfig[0],
|
||||
saveConfig: viewModeConfig[1]
|
||||
saveConfig: viewModeConfig[1],
|
||||
...restProps
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user