Action button prototype

This commit is contained in:
Zef Hemel
2022-05-06 18:55:04 +02:00
parent 3037dbe58a
commit 7e221ce5aa
20 changed files with 324 additions and 54 deletions
+14 -1
View File
@@ -9,6 +9,13 @@ export type Notification = {
date: Date;
};
export type ActionButton = {
label: string;
tooltip?: string;
orderId?: number;
run: () => void;
};
export type AppViewState = {
currentPage?: string;
showPageNavigator: boolean;
@@ -23,6 +30,7 @@ export type AppViewState = {
allPages: Set<PageMeta>;
commands: Map<string, AppCommand>;
notifications: Notification[];
actionButtons: ActionButton[];
showFilterBox: boolean;
filterBoxLabel: string;
@@ -45,6 +53,7 @@ export const initialViewState: AppViewState = {
allPages: new Set(),
commands: new Map(),
notifications: [],
actionButtons: [],
showFilterBox: false,
filterBoxHelpText: "",
filterBoxLabel: "",
@@ -60,7 +69,11 @@ export type Action =
| { type: "page-saved" }
| { type: "start-navigate" }
| { type: "stop-navigate" }
| { type: "update-commands"; commands: Map<string, AppCommand> }
| {
type: "update-commands";
commands: Map<string, AppCommand>;
actionButtons: ActionButton[];
}
| { type: "show-palette"; context?: string }
| { type: "hide-palette" }
| { type: "show-notification"; notification: Notification }