Something went wrong. Try again.
A free, open-source, self-hosted place to write a novel.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566/** * The boards that can sit beside the prose, and the two rows of keys that reach * them. The chrome and the dock share one vocabulary on purpose: a writer who * moves between them should not learn a second name for the board they already * know, and the deck's own controls should say what the keys say. * * A surface joins the workspace by appearing here and in whichever row reaches * it. Nothing else names one: the deck renders from this table, and so do the * chrome's writing cluster and the dock. */export type SurfaceId = 'scene' | 'notes' | 'grid' | 'history' | 'search' | 'progress';
export type SurfacePolicy = 'toggle' | 'promote' | 'stack';
export type SurfaceRefresh = 'before' | 'after' | 'progress';
export interface Surface { /** The full name a board uses for itself, and what its own controls say. */ label: string; /** The short word on a chrome key or a dock key. */ key: string; /** Needs an open scene. A board with nothing to show is disabled, not empty. */ needsScene?: boolean; /** * How opening the board refreshes its data: `before` awaits `invalidateAll` * before mounting (for prop-seeded forms), `after` refreshes once mounted, * and `progress` asks the progress endpoint in the background. */ refresh?: SurfaceRefresh;}
export const SURFACES: Record<SurfaceId, Surface> = { scene: { key: 'Scene', label: 'Scene', needsScene: true, refresh: 'before' }, notes: { key: 'Notes', label: 'Notes' }, grid: { key: 'Grid', label: 'Plot grid' }, history: { key: 'Versions', label: 'Scene versions', needsScene: true, refresh: 'after' }, search: { key: 'Search', label: 'Search' }, progress: { key: 'Progress', label: 'Progress', refresh: 'progress' }};
/** * The dock's order, which is also the order a wheel pan walks the deck in, so * panning reaches a board in the place its key sits. */export const DOCK_SURFACES: readonly SurfaceId[] = [ 'scene', 'notes', 'grid', 'history', 'search', 'progress'];
/** * The chrome's writing cluster, in row order. Find is the scene's own search bar * rather than a board, so it is no surface of its own; it keeps its place beside * Search because the two answer the same question at two widths. */export const WRITING_CLUSTER: readonly (SurfaceId | 'find')[] = [ 'scene', 'notes', 'find', 'search', 'progress'];