mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
feat(assistant): a card framework every addon package plugs into
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { AssistantApplied } from '@trek/shared';
|
||||
import { createContext, useContext } from 'react';
|
||||
|
||||
import type { EntityTarget } from './cards/cardTypes';
|
||||
|
||||
/** What the parts deep inside a chat need from whoever shows it. */
|
||||
export interface AssistantView {
|
||||
tripId: number;
|
||||
@@ -8,8 +9,12 @@ export interface AssistantView {
|
||||
variant: 'window' | 'fullscreen';
|
||||
/** How much room the chat has: a narrow window and the phone are 'compact'. */
|
||||
density?: 'compact' | 'roomy';
|
||||
/** Shows an applied change in the planner; the button is left out where nothing can show it. */
|
||||
onShowOnMap?: (applied: AssistantApplied) => void;
|
||||
/**
|
||||
* Opens what a card or an applied change points at: a spot on the plan's
|
||||
* map, a tab of the trip, another page. The buttons are left out where
|
||||
* nothing can open them.
|
||||
*/
|
||||
onOpen?: (target: EntityTarget) => void;
|
||||
/** Selects a day in the planner, from its weather; left out where no planner can show it. */
|
||||
onFocusDay?: (dayId: number) => void;
|
||||
/** Brings the map into view where the chat covers it (the phone), before the map moves. */
|
||||
|
||||
Reference in New Issue
Block a user