/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type Formatters } from "@elaraai/east-ui-components"; import { type PeriodRead } from "../shared/loading.js"; import { type ScheduleCellShading } from "../shared/schedule/cells.js"; import type { CalendarBucket } from "./cells.js"; import type { ScheduleOverlaps } from "../shared/schedule/overlaps.js"; import type { ScheduleEditing } from "../shared/schedule/editing.js"; import { type RowAnchor } from "../shared/schedule/row-anchor.js"; import { type CalendarShownResources } from "./controls.js"; import { type CalendarDrag } from "./drag.js"; import { type CalendarOptimised } from "./optimise.js"; import type { CalendarCommands } from "./actions.js"; import { type CalendarPagedDemand, type CalendarPages } from "./pages.js"; import { type CalendarItem, type CalendarRange, type CalendarRow, type CalendarStyles, type CalendarUncounted, type CalendarValue, type CalendarView } from "./model.js"; /** * The views share selection, commands, drafts and overlap state. `rows` are every resource, what an event's label * names; `shownRows` are the ones the rail shows (#1343), each layout's columns and rows, and `shown` each kind's. */ export interface CalendarViewsProps { value: CalendarValue; view: CalendarView; setView: (view: CalendarView) => void; range: CalendarRange; format: Formatters; items: readonly CalendarItem[]; rows: readonly CalendarRow[]; shownRows: readonly CalendarRow[]; shown: CalendarShownResources; now: Date; narrow: boolean; styles: CalendarStyles; selected: ReadonlySet; select: (item: CalendarItem, additive?: boolean) => void; clear: () => void; overlaps: ScheduleOverlaps; commands: CalendarCommands | undefined; drag: CalendarDrag; /** * What the views draw of the period's read (#1398): the period as read; a period not read yet — `items` none, its * regions washed and its counts placeholders, unseen until the frame's reveal says so; or one whose read failed — the * failure said once, its cells blank. */ read: PeriodRead; /** Moves each time Today is pressed: the time grid and the timeline bring the now line into view (#1398). */ nowRevision?: number | undefined; /** Where each layout's view last rested (#1398): what it comes back to as it mounts. */ anchor?: CalendarAnchor | undefined; /** Told where a layout's view rests as it settles. */ onAnchor?: ((next: Partial) => void) | undefined; /** The event a pick asks to be shown (#1398), by its printed key: the timeline brings its row and its time into view. */ reveal?: string | undefined; /** Told once the event to show is drawn, with its element. */ onRevealed?: ((element: HTMLElement) => void) | undefined; /** Opens the selection's Details — Enter on an event, as the Schematic's Enter does (retest C5); `undefined` with no inspector. */ onOpen?: (() => void) | undefined; /** What the figures leave out (#1424): the kinds past the cap, which neither a day's count nor a resource's booked hours counts. */ uncounted?: CalendarUncounted | undefined; /** * The resources' shading (#1424): by a resource kind's slot, then its resource's key, the share of each of the view's * periods the events of a kind past the cap book there — or none, the no-data hatch. */ shading?: ScheduleCellShading | undefined; /** The periods the shading is cut into: the timeline's by its period, the Resources view's day. */ bucket?: CalendarBucket | undefined; /** * The paged resource kind's windows the frame holds (#1424): its rows on the timeline and its columns in the * Resources view, laid out at their places in its order — those not read yet as placeholders, read a window at a * time around what the view shows. */ pages?: CalendarPages | undefined; /** Where the views report the paged kind's places they show, as their scroll rests: what its windows and cells are read around. */ demand?: CalendarPagedDemand | undefined; /** * The paged kind's resources whose cells the reader holds (#1424), each by its slot and key (`scheduleCellId`): any * other's row or column draws the wash under what it holds, and its booked hours a placeholder, until they land; * `undefined` where no kind is read by its cells. */ drawnRows?: ReadonlySet | undefined; /** * What a run of the app's optimiser left on the events (#1409, R7, R17): each event's operation, which its block * carries (`data-op`) and its hover says, and where a removed or a moved event stood, where its ghost goes. */ optimised?: CalendarOptimised | undefined; /** Whether the run's highlight is on (R15, R16): the ghosts show for it alone. */ lit?: boolean | undefined; /** * The editing (#1398): what an event draws of it — its draft, and the optimiser's marks and ghosts — and whether its * kind takes a gesture, whatever a read in flight holds back; `undefined` read only. What edits is `commands`'. */ editing?: ScheduleEditing | undefined; /** * The events whose rows break their kind's bounds (#1585), by their element keys: each wears the warn ring, stored or * changed, as one holding a conflict does. */ bounded?: ReadonlySet | undefined; /** * Whether the events carry their drag handles and edges (#1398, CL9): wherever the board takes edits — an editing, no * run of the optimiser out, its read not failed — through a read in flight too. Retained content refuses the gesture * itself — the shared drag sensors pick nothing up inside the `aria-disabled` main (CL8) — and its `commands` are * withheld meanwhile, so an event draws the same through a read and as it lands. */ grips?: boolean | undefined; } /** * Where each layout's view rests (#1398): the time grid's hour at its top, and the timeline's top line, by its key, with * the px scrolled into it — never a pixel offset of the whole, which the rows above it would move. */ export interface CalendarAnchor { readonly gridHour?: number | undefined; readonly timeline?: RowAnchor | undefined; } /** Where each layout's view rests, as storage keeps it. */ export declare const readCalendarAnchor: import("@elaraai/east-ui-components/internal").KeptReader; /** * An hour's height in the time grid, by the Calendar's density: the pitch its cold load's cover stands at too (#1398, CL1). * * @param density - The Calendar's density * @returns The hour's height, in px */ export declare function calendarHour(density: CalendarValue["settings"]["density"]): number; /** * Install (or clear) the booked-hours probe. Test use only. * * @param fn - Called each time a resource's events are summed event by event; `undefined` clears it */ export declare function setBookedProbe(fn: (() => void) | undefined): void; /** * Install (or clear) the event block render probe. Test use only. * * @param fn - Called with an event's key each time its block renders; `undefined` clears it */ export declare function setEventBlockRenderProbe(fn: ((id: string) => void) | undefined): void; /** * Install (or clear) the event face render probe. Test use only. * * @param fn - Called with an event's key each time its face renders; `undefined` clears it */ export declare function setEventFaceRenderProbe(fn: ((id: string) => void) | undefined): void; /** * Install (or clear) the timeline row render probe. Test use only. * * @param fn - Called with a resource row's key each time its row renders; `undefined` clears it */ export declare function setTimelineRowRenderProbe(fn: ((row: string) => void) | undefined): void; /** * Install (or clear) the fit measure probe. Test use only. * * @param fn - Called with an event's key each time its block's fit is measured; `undefined` clears it */ export declare function setFitMeasureProbe(fn: ((id: string) => void) | undefined): void; /** Calendar's main view; the narrow branch contains no drag hooks. Its event blocks are measured by one observer of its own. */ export declare function CalendarViews(props: CalendarViewsProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=views.d.ts.map