mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 06:38:59 +02:00
feat(collection/presentation): support custom background color per slide
This commit is contained in:
parent
f377df32ed
commit
bbda8d3357
@ -174,7 +174,13 @@ function Presentation({ presentation, setApi } : { presentation: PresentationMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Slide({ slide }: { slide: PresentationSlideBaseModel }) {
|
function Slide({ slide }: { slide: PresentationSlideBaseModel }) {
|
||||||
return <section data-note-id={slide.noteId} dangerouslySetInnerHTML={slide.content} />;
|
return (
|
||||||
|
<section
|
||||||
|
data-note-id={slide.noteId}
|
||||||
|
data-background-color={slide.backgroundColor}
|
||||||
|
dangerouslySetInnerHTML={slide.content}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNoteIdFromSlide(slide: HTMLElement | undefined) {
|
function getNoteIdFromSlide(slide: HTMLElement | undefined) {
|
||||||
|
@ -12,6 +12,7 @@ interface PresentationSlideModel extends PresentationSlideBaseModel {
|
|||||||
export interface PresentationSlideBaseModel {
|
export interface PresentationSlideBaseModel {
|
||||||
noteId: string;
|
noteId: string;
|
||||||
content: DangerouslySetInnerHTML;
|
content: DangerouslySetInnerHTML;
|
||||||
|
backgroundColor?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PresentationModel {
|
export interface PresentationModel {
|
||||||
@ -40,7 +41,8 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise<undefined |
|
|||||||
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
||||||
return {
|
return {
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
content: await processContent(note)
|
content: await processContent(note),
|
||||||
|
backgroundColor: note.getLabelValue("slide:background") ?? undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ type Labels = {
|
|||||||
maxNestingDepth: number;
|
maxNestingDepth: number;
|
||||||
includeArchived: boolean;
|
includeArchived: boolean;
|
||||||
"presentation:theme": string;
|
"presentation:theme": string;
|
||||||
|
"slide:background": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user