mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
refactor(client): standalone rendering mechanism for ribbon
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { KeyboardActionNames } from "@triliumnext/commons";
|
||||
import NoteContext from "../../components/note_context";
|
||||
import FNote from "../../entities/fnote";
|
||||
import { VNode } from "preact";
|
||||
|
||||
export interface TabContext {
|
||||
note: FNote | null | undefined;
|
||||
@@ -11,3 +13,20 @@ export interface TabContext {
|
||||
componentId: string;
|
||||
activate(): void;
|
||||
}
|
||||
|
||||
export interface TitleContext {
|
||||
note: FNote | null | undefined;
|
||||
}
|
||||
|
||||
export interface TabConfiguration {
|
||||
title: string | ((context: TitleContext) => string);
|
||||
icon: string;
|
||||
content: (context: TabContext) => VNode | false;
|
||||
show: boolean | ((context: TitleContext) => boolean | null | undefined);
|
||||
toggleCommand?: KeyboardActionNames;
|
||||
activate?: boolean | ((context: TitleContext) => boolean);
|
||||
/**
|
||||
* By default the tab content will not be rendered unless the tab is active (i.e. selected by the user). Setting to `true` will ensure that the tab is rendered even when inactive, for cases where the tab needs to be accessible at all times (e.g. for the detached editor toolbar) or if event handling is needed.
|
||||
*/
|
||||
stayInDom?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user