awesome-timeline-react 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -108,6 +108,12 @@ The following properties for Timeline component are available:
108
108
 
109
109
  - `timeBar` – configure the two-row time bar (see Time bar rows). Defaults to a day row over an hour row.
110
110
 
111
+ - `showPointerLine` – a dashed vertical line follows the pointer over the rows, with its time shown in the time bar (default `false`). Colors come from `theme.pointerLineColor` / `theme.pointerLabelColor`.
112
+
113
+ - `formatPointerTime` – `(time: number) => string`, the pointer line's label for a unix-seconds time (default: the browser's locale date and time).
114
+
115
+ - `onPointerTime` – `(time: number | null) => void`, fires as the pointer moves over the rows with the time under it, and `null` when it leaves. Feed it to a linked timeline's `setPointerTime` handle method so one line runs through both.
116
+
111
117
  - `animations` – layout animations when events re-stack (rows growing, events changing lanes). `true` (default), `false` to disable, or `{ layoutMs?: number, fadeMs?: number }` to tune (defaults 200/120; `layoutMs` is the stacking tween, `fadeMs` the resize-handle fade). A dropped event always lands instantly — only the events re-stacking around it animate.
112
118
 
113
119
  ## Theming
@@ -321,7 +327,7 @@ ref.current?.updateEvents([
321
327
  ]);
322
328
  ```
323
329
 
324
- The full handle: `setEvents`, `updateEvents`, `getEvent`, `scrollToRow`, `scrollToTime`, `setWindow`, `getVisibleRange`, `redraw`.
330
+ The full handle: `setEvents`, `updateEvents`, `getEvent`, `scrollToRow`, `scrollToTime`, `setWindow`, `getVisibleRange`, `setPointerTime`, `redraw`.
325
331
 
326
332
  **Reconciliation rule:** the `events` prop is authoritative whenever its reference changes — a new array fully resets the store and discards imperative state. Pick one mode: declarative (swap the prop) or imperative (stable prop + handle calls).
327
333
 
@@ -65,6 +65,7 @@ declare type CanvasBoardProps = {
65
65
  onEventHover?: (props: OnEventHoverProps) => void;
66
66
  eventsResize: boolean;
67
67
  stripeOverlap: boolean;
68
+ timeBar?: TimeBarConfig;
68
69
  panZoom?: PanZoomConfig;
69
70
  animations: {
70
71
  layoutMs: number;
@@ -123,6 +124,11 @@ export declare const computeZoom: (windowTime: [number, number], tick: number, c
123
124
  cellWidth: number;
124
125
  };
125
126
 
127
+ /** Rescales on a width change. The window is read when the callback fires, never captured: the first
128
+ * callback lands a frame after mount, by when a consumer may already have called `setWindow`, and a
129
+ * captured window would overwrite that window's scale with the one the timeline mounted on. */
130
+ export declare const createWidthObserver: (getWindow: () => number[], onScale: (tick: number, cellWidth: number) => void) => ResizeObserver;
131
+
126
132
  /**
127
133
  * Returns the window-visible slice of a startTime-sorted event array.
128
134
  * Binary search cuts the tail (startTime > windowEnd) in O(log n); the head
@@ -146,6 +152,13 @@ export declare const default_alias: {
146
152
  */
147
153
  export declare const default_alias_1: React_2.ForwardRefExoticComponent<CanvasBoardProps & React_2.RefAttributes<HTMLDivElement>>;
148
154
 
155
+ export declare const default_alias_10: ({ windowTimeRef, setTick, setCellWidth, contentRef, }: {
156
+ windowTimeRef: React.MutableRefObject<number[]>;
157
+ setTick: React.Dispatch<React.SetStateAction<number | null>>;
158
+ setCellWidth: React.Dispatch<React.SetStateAction<number>>;
159
+ contentRef: React.MutableRefObject<HTMLDivElement | null>;
160
+ }) => void;
161
+
149
162
  export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, timeBar, }: {
150
163
  windowTime: number[];
151
164
  tick: number | null;
@@ -163,16 +176,27 @@ export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollW
163
176
  */
164
177
  export declare const default_alias_3: React_2.ForwardRefExoticComponent<EventPromptType & React_2.RefAttributes<EventPromptActionsType>>;
165
178
 
166
- export declare const default_alias_4: ({ tick, windowTime, }: {
179
+ /** A dashed vertical line under the pointer, with its time in the time bar. Moved imperatively, so a
180
+ * pointer move costs one transform rather than a React render or a canvas redraw. */
181
+ export declare const default_alias_4: React_2.ForwardRefExoticComponent<{
182
+ contentRef: React_2.MutableRefObject<HTMLDivElement | null>;
183
+ mainRef: React_2.MutableRefObject<HTMLDivElement | null>;
184
+ top: number;
185
+ color: string;
186
+ labelColor: string;
187
+ font?: string;
188
+ } & React_2.RefAttributes<PointerLineActions>>;
189
+
190
+ export declare const default_alias_5: ({ tick, windowTime, }: {
167
191
  tick: number | null;
168
192
  windowTime: number[];
169
193
  }) => React_2.JSX.Element;
170
194
 
171
- export declare const default_alias_5: (monthIndex: number) => string;
195
+ export declare const default_alias_6: (monthIndex: number) => string;
172
196
 
173
- export declare const default_alias_6: (dayIndex: number) => string;
197
+ export declare const default_alias_7: (dayIndex: number) => string;
174
198
 
175
- export declare const default_alias_7: (eventA: EventType, eventB: EventType) => 1 | -1;
199
+ export declare const default_alias_8: (eventA: EventType, eventB: EventType) => 1 | -1;
176
200
 
177
201
  /**
178
202
  * Pointer-event state machine for the canvas board: pan the time window,
@@ -180,7 +204,7 @@ export declare const default_alias_7: (eventA: EventType, eventB: EventType) =>
180
204
  * change grid granularity (middle-click mode or ctrl+wheel). Event mutations
181
205
  * are applied straight to the SceneStore — no React state on the hot path.
182
206
  */
183
- export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, selectable, applySelection, getSelection, }: UseCanvasInteractionsArgs) => {
207
+ export declare const default_alias_9: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, selectable, applySelection, getSelection, }: UseCanvasInteractionsArgs) => {
184
208
  handlePointerDown: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
185
209
  handlePointerMove: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
186
210
  handlePointerUp: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
@@ -189,13 +213,6 @@ export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, b
189
213
  handleAuxClick: (pointerEvent: React_2.MouseEvent<HTMLCanvasElement>) => void;
190
214
  };
191
215
 
192
- export declare const default_alias_9: ({ windowTime, setTick, setCellWidth, contentRef, }: {
193
- windowTime: number[];
194
- setTick: React.Dispatch<React.SetStateAction<number | null>>;
195
- setCellWidth: React.Dispatch<React.SetStateAction<number>>;
196
- contentRef: React.MutableRefObject<HTMLDivElement | null>;
197
- }) => void;
198
-
199
216
  export declare const DEFAULT_FADE_DURATION_MS = 120;
200
217
 
201
218
  /** Defaults mirror the pre-0.2.x constants (20px bars, 22px lanes, 10px pad). */
@@ -203,9 +220,24 @@ export declare const DEFAULT_GEOMETRY: Geometry;
203
220
 
204
221
  export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
205
222
 
223
+ export declare const DEFAULT_MIN_BLOCK_WIDTH = 40;
224
+
206
225
  /** Defaults mirror the pre-0.2.0 stylesheet values. */
207
226
  export declare const DEFAULT_THEME: ResolvedTheme;
208
227
 
228
+ declare const DEFAULT_TIME_BAR_LEVELS: TimeBarLevel[];
229
+ export { DEFAULT_TIME_BAR_LEVELS }
230
+ export { DEFAULT_TIME_BAR_LEVELS as DEFAULT_TIME_BAR_LEVELS_alias_1 }
231
+
232
+ /** Vertical grid lines on the time bar's block edges, so they line up with its
233
+ * separators at any unit. Same edge rule as `drawGridLines`. */
234
+ export declare const drawBlockGridLines: (ctx: CanvasRenderingContext2D, { width, height, blocks, color, }: {
235
+ width: number;
236
+ height: number;
237
+ blocks: TimeBlock[];
238
+ color?: string;
239
+ }) => void;
240
+
209
241
  /**
210
242
  * Custom canvas renderer for an event. Return false to fall through to the
211
243
  * library's default drawing.
@@ -407,8 +439,8 @@ export declare class FrameScheduler {
407
439
  /**
408
440
  * The default two-row time bar: a day row over an hour row. Thin wrapper over
409
441
  * `generateUnitBlocks` kept for the golden tests and as the documented
410
- * default; the canvas time bar resolves `TimeBarConfig` and calls
411
- * `generateUnitBlocks` per row directly.
442
+ * default; the canvas time bar resolves `TimeBarConfig` through
443
+ * `resolveTimeBar` and calls `generateUnitBlocks` per row.
412
444
  */
413
445
  export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
414
446
  windowStart: number;
@@ -487,6 +519,9 @@ export declare type HitTestView = {
487
519
 
488
520
  export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
489
521
 
522
+ /** ISO-8601 week number (weeks start Monday; week 1 holds the year's first Thursday). */
523
+ export declare const isoWeek: (date: Date) => number;
524
+
490
525
  /**
491
526
  * Whether an event may be dropped onto a row, given its `droppableRowIds`.
492
527
  * `undefined` = unrestricted (any row); otherwise the target must be listed.
@@ -624,6 +659,12 @@ export { PanZoomConfig as PanZoomConfig_alias_1 }
624
659
 
625
660
  export declare type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
626
661
 
662
+ export declare type PointerLineActions = {
663
+ /** draw the line `x` px into the content column; `label` null draws it without a time label */
664
+ show: (x: number, label: string | null) => void;
665
+ hide: () => void;
666
+ };
667
+
627
668
  declare type Rect = {
628
669
  x: number;
629
670
  y: number;
@@ -647,6 +688,7 @@ export declare type RendererView = {
647
688
  drawEvent?: DrawEventFn;
648
689
  eventsResize: boolean;
649
690
  stripeOverlap: boolean;
691
+ timeBar?: TimeBarConfig;
650
692
  hoveredEventId: string | null;
651
693
  draggedEventId: string | null;
652
694
  resizePreview: ResizePreview | null;
@@ -665,6 +707,9 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
665
707
 
666
708
  export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
667
709
 
710
+ /** The two rows `timeBar` draws at this zoom. */
711
+ export declare const resolveTimeBar: (timeBar: TimeBarConfig | undefined, windowStart: number, windowEnd: number, tick: number | null) => TimeBarLevel;
712
+
668
713
  export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
669
714
 
670
715
  declare type RowType = {
@@ -862,29 +907,63 @@ declare type Theme = {
862
907
  headerShadow?: string;
863
908
  /** the frame around the rows; unset, the stylesheet's black applies */
864
909
  borderColor?: string;
910
+ /** the pointer line and its time label's background (default "rgba(15,23,42,0.7)") */
911
+ pointerLineColor?: string;
912
+ /** the pointer time label's text (default "#ffffff") */
913
+ pointerLabelColor?: string;
865
914
  };
866
915
  export { Theme }
867
916
  export { Theme as Theme_alias_1 }
868
917
 
918
+ export declare const TIME_BAR_HEIGHT = 50;
919
+
869
920
  /** Per-row configuration for the two-row time bar. */
870
- export declare type TimeBarConfig = {
921
+ declare type TimeBarConfig = {
871
922
  topRow?: TimeBarRowConfig;
872
923
  bottomRow?: TimeBarRowConfig;
924
+ /** pick the rows by zoom instead: the first of `levels` (finest first; default
925
+ * day/hour → day/6 h → week/day → month/week → year/month) whose bottom-row
926
+ * blocks are at least `minBlockWidth` px wide (default 40). `topRow`/`bottomRow`
927
+ * are ignored, and the grid lines follow the bottom row rather than the grid
928
+ * cell; drops still snap to the cell. */
929
+ auto?: boolean | {
930
+ levels?: TimeBarLevel[];
931
+ minBlockWidth?: number;
932
+ };
873
933
  };
934
+ export { TimeBarConfig }
935
+ export { TimeBarConfig as TimeBarConfig_alias_1 }
874
936
 
875
- export declare type TimeBarRowConfig = {
937
+ /** One zoom level of an automatic time bar. */
938
+ declare type TimeBarLevel = {
939
+ topRow: TimeBarRowConfig;
940
+ bottomRow: TimeBarRowConfig;
941
+ };
942
+ export { TimeBarLevel }
943
+ export { TimeBarLevel as TimeBarLevel_alias_1 }
944
+
945
+ declare type TimeBarRowConfig = {
876
946
  /** the unit each block spans (default: "day" for the top row, "hour" for
877
- * the bottom row), or a fixed step like `{ stepSeconds: 8 * 3600 }`. */
947
+ * the bottom row), a fixed step like `{ stepSeconds: 8 * 3600 }`, or
948
+ * `{ boundaries }` for uneven blocks such as real shifts: it returns the
949
+ * sorted block edges in unix seconds, one at or before `windowStart` and one
950
+ * at or after `windowEnd`, so the row tiles the window. */
878
951
  unit?: TimeBarUnit | {
879
952
  stepSeconds: number;
953
+ } | {
954
+ boundaries: (windowStart: number, windowEnd: number) => number[];
880
955
  };
881
956
  /** label for a block; receives the block's start and end. Defaults mirror
882
957
  * the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
883
958
  format?: (blockStart: Date, blockEnd: Date) => string;
884
959
  };
960
+ export { TimeBarRowConfig }
961
+ export { TimeBarRowConfig as TimeBarRowConfig_alias_1 }
885
962
 
886
963
  /** Calendar unit for a time-bar row, or a fixed step in seconds. */
887
- export declare type TimeBarUnit = "hour" | "day" | "week" | "month";
964
+ declare type TimeBarUnit = "hour" | "day" | "week" | "month" | "year";
965
+ export { TimeBarUnit }
966
+ export { TimeBarUnit as TimeBarUnit_alias_1 }
888
967
 
889
968
  export declare type TimeBlock = {
890
969
  label: string;
@@ -901,6 +980,14 @@ declare const Timeline: React_2.ForwardRefExoticComponent<TimelineProps & React_
901
980
  export { Timeline }
902
981
  export { Timeline as Timeline_alias_1 }
903
982
 
983
+ /**
984
+ * `timeBar.auto`: the rows follow the zoom (day/hour → day/6 h → week/day → month/week → year/month),
985
+ * and the grid follows the bottom row. Zoom with the buttons or ctrl/cmd + wheel; no block may get
986
+ * narrower than 40 px. "Uneven blocks" swaps the two finest levels for a `boundaries` row: three
987
+ * blocks a weekday and one over the weekend.
988
+ */
989
+ export declare const TimelineAutoTimeBar: () => React_2.JSX.Element;
990
+
904
991
  export declare const TimelineCanvas: () => React_2.JSX.Element;
905
992
 
906
993
  /**
@@ -955,6 +1042,9 @@ declare type TimelineHandle = {
955
1042
  startTime: number;
956
1043
  endTime: number;
957
1044
  };
1045
+ /** draw the pointer line at this time (unix seconds) from outside, e.g. where the pointer is on a
1046
+ * linked timeline; null hides it. Labelled only when this timeline shows its time bar. */
1047
+ setPointerTime(time: number | null): void;
958
1048
  /** replace the current selection with these event ids. No `groupId`-tag
959
1049
  * expansion (that's Cmd/Ctrl+click only), but a group-parent id still pulls
960
1050
  * in its child events (parent → children). Requires `selectable`; fires
@@ -1006,6 +1096,8 @@ export declare const TimelineLongRowLabels: () => React_2.JSX.Element;
1006
1096
  */
1007
1097
  export declare const TimelineNarrowWindow: () => React_2.JSX.Element;
1008
1098
 
1099
+ export declare const TimelinePointerLine: () => React_2.JSX.Element;
1100
+
1009
1101
  export declare const TimelinePrimary: () => React_2.JSX.Element;
1010
1102
 
1011
1103
  declare type TimelineProps = {
@@ -1066,6 +1158,14 @@ declare type TimelineProps = {
1066
1158
  /** draw the two-row time bar above the rows (default true). Off, the timeline is just its rows —
1067
1159
  * e.g. a secondary strip kept in step with a main timeline through `onWindowChange`/`setWindow`. */
1068
1160
  showTimeBar?: boolean;
1161
+ /** a dashed vertical line follows the pointer over the rows, its time shown in the time bar;
1162
+ * hidden while the pointer is on an event (default false) */
1163
+ showPointerLine?: boolean;
1164
+ /** the pointer line's label for a time in unix seconds (default: the browser's locale date and time) */
1165
+ formatPointerTime?: (time: number) => string;
1166
+ /** fires as the pointer moves over the rows with the time under it, and null when it leaves —
1167
+ * feed it to a linked timeline's `setPointerTime` */
1168
+ onPointerTime?: (time: number | null) => void;
1069
1169
  /** layout animations: true (default), false to disable, or durations */
1070
1170
  animations?: AnimationConfig;
1071
1171
  };
@@ -1101,6 +1201,7 @@ export declare class TimelineRenderer {
1101
1201
  flush(): void;
1102
1202
  dispose(): void;
1103
1203
  private resizeCanvases;
1204
+ private drawGrid;
1104
1205
  private drawFrame;
1105
1206
  }
1106
1207
 
@@ -1146,6 +1247,10 @@ export declare const TimelineStreaming10k: () => React_2.JSX.Element;
1146
1247
  */
1147
1248
  export declare const TimelineStripedOverlap: () => React_2.JSX.Element;
1148
1249
 
1250
+ /** The strip mounts on its own three weeks and is moved to the main timeline's three days at once —
1251
+ * the first resize callback, a frame later, must not put it back on the three-week scale. */
1252
+ export declare const TimelineStripMountedLate: () => React_2.JSX.Element;
1253
+
1149
1254
  /**
1150
1255
  * Themeable bar geometry: chunky 32px bars with a 6px lane gap, wide row
1151
1256
  * padding, and a larger corner radius. Verifies stacking, hit-testing
@@ -65,6 +65,7 @@ declare type CanvasBoardProps = {
65
65
  onEventHover?: (props: OnEventHoverProps) => void;
66
66
  eventsResize: boolean;
67
67
  stripeOverlap: boolean;
68
+ timeBar?: TimeBarConfig;
68
69
  panZoom?: PanZoomConfig;
69
70
  animations: {
70
71
  layoutMs: number;
@@ -123,6 +124,11 @@ export declare const computeZoom: (windowTime: [number, number], tick: number, c
123
124
  cellWidth: number;
124
125
  };
125
126
 
127
+ /** Rescales on a width change. The window is read when the callback fires, never captured: the first
128
+ * callback lands a frame after mount, by when a consumer may already have called `setWindow`, and a
129
+ * captured window would overwrite that window's scale with the one the timeline mounted on. */
130
+ export declare const createWidthObserver: (getWindow: () => number[], onScale: (tick: number, cellWidth: number) => void) => ResizeObserver;
131
+
126
132
  /**
127
133
  * Returns the window-visible slice of a startTime-sorted event array.
128
134
  * Binary search cuts the tail (startTime > windowEnd) in O(log n); the head
@@ -146,6 +152,13 @@ export declare const default_alias: {
146
152
  */
147
153
  export declare const default_alias_1: React_2.ForwardRefExoticComponent<CanvasBoardProps & React_2.RefAttributes<HTMLDivElement>>;
148
154
 
155
+ export declare const default_alias_10: ({ windowTimeRef, setTick, setCellWidth, contentRef, }: {
156
+ windowTimeRef: React.MutableRefObject<number[]>;
157
+ setTick: React.Dispatch<React.SetStateAction<number | null>>;
158
+ setCellWidth: React.Dispatch<React.SetStateAction<number>>;
159
+ contentRef: React.MutableRefObject<HTMLDivElement | null>;
160
+ }) => void;
161
+
149
162
  export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, timeBar, }: {
150
163
  windowTime: number[];
151
164
  tick: number | null;
@@ -163,16 +176,27 @@ export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollW
163
176
  */
164
177
  export declare const default_alias_3: React_2.ForwardRefExoticComponent<EventPromptType & React_2.RefAttributes<EventPromptActionsType>>;
165
178
 
166
- export declare const default_alias_4: ({ tick, windowTime, }: {
179
+ /** A dashed vertical line under the pointer, with its time in the time bar. Moved imperatively, so a
180
+ * pointer move costs one transform rather than a React render or a canvas redraw. */
181
+ export declare const default_alias_4: React_2.ForwardRefExoticComponent<{
182
+ contentRef: React_2.MutableRefObject<HTMLDivElement | null>;
183
+ mainRef: React_2.MutableRefObject<HTMLDivElement | null>;
184
+ top: number;
185
+ color: string;
186
+ labelColor: string;
187
+ font?: string;
188
+ } & React_2.RefAttributes<PointerLineActions>>;
189
+
190
+ export declare const default_alias_5: ({ tick, windowTime, }: {
167
191
  tick: number | null;
168
192
  windowTime: number[];
169
193
  }) => React_2.JSX.Element;
170
194
 
171
- export declare const default_alias_5: (monthIndex: number) => string;
195
+ export declare const default_alias_6: (monthIndex: number) => string;
172
196
 
173
- export declare const default_alias_6: (dayIndex: number) => string;
197
+ export declare const default_alias_7: (dayIndex: number) => string;
174
198
 
175
- export declare const default_alias_7: (eventA: EventType, eventB: EventType) => 1 | -1;
199
+ export declare const default_alias_8: (eventA: EventType, eventB: EventType) => 1 | -1;
176
200
 
177
201
  /**
178
202
  * Pointer-event state machine for the canvas board: pan the time window,
@@ -180,7 +204,7 @@ export declare const default_alias_7: (eventA: EventType, eventB: EventType) =>
180
204
  * change grid granularity (middle-click mode or ctrl+wheel). Event mutations
181
205
  * are applied straight to the SceneStore — no React state on the hot path.
182
206
  */
183
- export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, selectable, applySelection, getSelection, }: UseCanvasInteractionsArgs) => {
207
+ export declare const default_alias_9: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, selectable, applySelection, getSelection, }: UseCanvasInteractionsArgs) => {
184
208
  handlePointerDown: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
185
209
  handlePointerMove: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
186
210
  handlePointerUp: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
@@ -189,13 +213,6 @@ export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, b
189
213
  handleAuxClick: (pointerEvent: React_2.MouseEvent<HTMLCanvasElement>) => void;
190
214
  };
191
215
 
192
- export declare const default_alias_9: ({ windowTime, setTick, setCellWidth, contentRef, }: {
193
- windowTime: number[];
194
- setTick: React.Dispatch<React.SetStateAction<number | null>>;
195
- setCellWidth: React.Dispatch<React.SetStateAction<number>>;
196
- contentRef: React.MutableRefObject<HTMLDivElement | null>;
197
- }) => void;
198
-
199
216
  export declare const DEFAULT_FADE_DURATION_MS = 120;
200
217
 
201
218
  /** Defaults mirror the pre-0.2.x constants (20px bars, 22px lanes, 10px pad). */
@@ -203,9 +220,24 @@ export declare const DEFAULT_GEOMETRY: Geometry;
203
220
 
204
221
  export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
205
222
 
223
+ export declare const DEFAULT_MIN_BLOCK_WIDTH = 40;
224
+
206
225
  /** Defaults mirror the pre-0.2.0 stylesheet values. */
207
226
  export declare const DEFAULT_THEME: ResolvedTheme;
208
227
 
228
+ declare const DEFAULT_TIME_BAR_LEVELS: TimeBarLevel[];
229
+ export { DEFAULT_TIME_BAR_LEVELS }
230
+ export { DEFAULT_TIME_BAR_LEVELS as DEFAULT_TIME_BAR_LEVELS_alias_1 }
231
+
232
+ /** Vertical grid lines on the time bar's block edges, so they line up with its
233
+ * separators at any unit. Same edge rule as `drawGridLines`. */
234
+ export declare const drawBlockGridLines: (ctx: CanvasRenderingContext2D, { width, height, blocks, color, }: {
235
+ width: number;
236
+ height: number;
237
+ blocks: TimeBlock[];
238
+ color?: string;
239
+ }) => void;
240
+
209
241
  /**
210
242
  * Custom canvas renderer for an event. Return false to fall through to the
211
243
  * library's default drawing.
@@ -407,8 +439,8 @@ export declare class FrameScheduler {
407
439
  /**
408
440
  * The default two-row time bar: a day row over an hour row. Thin wrapper over
409
441
  * `generateUnitBlocks` kept for the golden tests and as the documented
410
- * default; the canvas time bar resolves `TimeBarConfig` and calls
411
- * `generateUnitBlocks` per row directly.
442
+ * default; the canvas time bar resolves `TimeBarConfig` through
443
+ * `resolveTimeBar` and calls `generateUnitBlocks` per row.
412
444
  */
413
445
  export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
414
446
  windowStart: number;
@@ -487,6 +519,9 @@ export declare type HitTestView = {
487
519
 
488
520
  export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
489
521
 
522
+ /** ISO-8601 week number (weeks start Monday; week 1 holds the year's first Thursday). */
523
+ export declare const isoWeek: (date: Date) => number;
524
+
490
525
  /**
491
526
  * Whether an event may be dropped onto a row, given its `droppableRowIds`.
492
527
  * `undefined` = unrestricted (any row); otherwise the target must be listed.
@@ -624,6 +659,12 @@ export { PanZoomConfig as PanZoomConfig_alias_1 }
624
659
 
625
660
  export declare type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>;
626
661
 
662
+ export declare type PointerLineActions = {
663
+ /** draw the line `x` px into the content column; `label` null draws it without a time label */
664
+ show: (x: number, label: string | null) => void;
665
+ hide: () => void;
666
+ };
667
+
627
668
  declare type Rect = {
628
669
  x: number;
629
670
  y: number;
@@ -647,6 +688,7 @@ export declare type RendererView = {
647
688
  drawEvent?: DrawEventFn;
648
689
  eventsResize: boolean;
649
690
  stripeOverlap: boolean;
691
+ timeBar?: TimeBarConfig;
650
692
  hoveredEventId: string | null;
651
693
  draggedEventId: string | null;
652
694
  resizePreview: ResizePreview | null;
@@ -665,6 +707,9 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
665
707
 
666
708
  export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
667
709
 
710
+ /** The two rows `timeBar` draws at this zoom. */
711
+ export declare const resolveTimeBar: (timeBar: TimeBarConfig | undefined, windowStart: number, windowEnd: number, tick: number | null) => TimeBarLevel;
712
+
668
713
  export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
669
714
 
670
715
  declare type RowType = {
@@ -862,29 +907,63 @@ declare type Theme = {
862
907
  headerShadow?: string;
863
908
  /** the frame around the rows; unset, the stylesheet's black applies */
864
909
  borderColor?: string;
910
+ /** the pointer line and its time label's background (default "rgba(15,23,42,0.7)") */
911
+ pointerLineColor?: string;
912
+ /** the pointer time label's text (default "#ffffff") */
913
+ pointerLabelColor?: string;
865
914
  };
866
915
  export { Theme }
867
916
  export { Theme as Theme_alias_1 }
868
917
 
918
+ export declare const TIME_BAR_HEIGHT = 50;
919
+
869
920
  /** Per-row configuration for the two-row time bar. */
870
- export declare type TimeBarConfig = {
921
+ declare type TimeBarConfig = {
871
922
  topRow?: TimeBarRowConfig;
872
923
  bottomRow?: TimeBarRowConfig;
924
+ /** pick the rows by zoom instead: the first of `levels` (finest first; default
925
+ * day/hour → day/6 h → week/day → month/week → year/month) whose bottom-row
926
+ * blocks are at least `minBlockWidth` px wide (default 40). `topRow`/`bottomRow`
927
+ * are ignored, and the grid lines follow the bottom row rather than the grid
928
+ * cell; drops still snap to the cell. */
929
+ auto?: boolean | {
930
+ levels?: TimeBarLevel[];
931
+ minBlockWidth?: number;
932
+ };
873
933
  };
934
+ export { TimeBarConfig }
935
+ export { TimeBarConfig as TimeBarConfig_alias_1 }
874
936
 
875
- export declare type TimeBarRowConfig = {
937
+ /** One zoom level of an automatic time bar. */
938
+ declare type TimeBarLevel = {
939
+ topRow: TimeBarRowConfig;
940
+ bottomRow: TimeBarRowConfig;
941
+ };
942
+ export { TimeBarLevel }
943
+ export { TimeBarLevel as TimeBarLevel_alias_1 }
944
+
945
+ declare type TimeBarRowConfig = {
876
946
  /** the unit each block spans (default: "day" for the top row, "hour" for
877
- * the bottom row), or a fixed step like `{ stepSeconds: 8 * 3600 }`. */
947
+ * the bottom row), a fixed step like `{ stepSeconds: 8 * 3600 }`, or
948
+ * `{ boundaries }` for uneven blocks such as real shifts: it returns the
949
+ * sorted block edges in unix seconds, one at or before `windowStart` and one
950
+ * at or after `windowEnd`, so the row tiles the window. */
878
951
  unit?: TimeBarUnit | {
879
952
  stepSeconds: number;
953
+ } | {
954
+ boundaries: (windowStart: number, windowEnd: number) => number[];
880
955
  };
881
956
  /** label for a block; receives the block's start and end. Defaults mirror
882
957
  * the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
883
958
  format?: (blockStart: Date, blockEnd: Date) => string;
884
959
  };
960
+ export { TimeBarRowConfig }
961
+ export { TimeBarRowConfig as TimeBarRowConfig_alias_1 }
885
962
 
886
963
  /** Calendar unit for a time-bar row, or a fixed step in seconds. */
887
- export declare type TimeBarUnit = "hour" | "day" | "week" | "month";
964
+ declare type TimeBarUnit = "hour" | "day" | "week" | "month" | "year";
965
+ export { TimeBarUnit }
966
+ export { TimeBarUnit as TimeBarUnit_alias_1 }
888
967
 
889
968
  export declare type TimeBlock = {
890
969
  label: string;
@@ -901,6 +980,14 @@ declare const Timeline: React_2.ForwardRefExoticComponent<TimelineProps & React_
901
980
  export { Timeline }
902
981
  export { Timeline as Timeline_alias_1 }
903
982
 
983
+ /**
984
+ * `timeBar.auto`: the rows follow the zoom (day/hour → day/6 h → week/day → month/week → year/month),
985
+ * and the grid follows the bottom row. Zoom with the buttons or ctrl/cmd + wheel; no block may get
986
+ * narrower than 40 px. "Uneven blocks" swaps the two finest levels for a `boundaries` row: three
987
+ * blocks a weekday and one over the weekend.
988
+ */
989
+ export declare const TimelineAutoTimeBar: () => React_2.JSX.Element;
990
+
904
991
  export declare const TimelineCanvas: () => React_2.JSX.Element;
905
992
 
906
993
  /**
@@ -955,6 +1042,9 @@ declare type TimelineHandle = {
955
1042
  startTime: number;
956
1043
  endTime: number;
957
1044
  };
1045
+ /** draw the pointer line at this time (unix seconds) from outside, e.g. where the pointer is on a
1046
+ * linked timeline; null hides it. Labelled only when this timeline shows its time bar. */
1047
+ setPointerTime(time: number | null): void;
958
1048
  /** replace the current selection with these event ids. No `groupId`-tag
959
1049
  * expansion (that's Cmd/Ctrl+click only), but a group-parent id still pulls
960
1050
  * in its child events (parent → children). Requires `selectable`; fires
@@ -1006,6 +1096,8 @@ export declare const TimelineLongRowLabels: () => React_2.JSX.Element;
1006
1096
  */
1007
1097
  export declare const TimelineNarrowWindow: () => React_2.JSX.Element;
1008
1098
 
1099
+ export declare const TimelinePointerLine: () => React_2.JSX.Element;
1100
+
1009
1101
  export declare const TimelinePrimary: () => React_2.JSX.Element;
1010
1102
 
1011
1103
  declare type TimelineProps = {
@@ -1066,6 +1158,14 @@ declare type TimelineProps = {
1066
1158
  /** draw the two-row time bar above the rows (default true). Off, the timeline is just its rows —
1067
1159
  * e.g. a secondary strip kept in step with a main timeline through `onWindowChange`/`setWindow`. */
1068
1160
  showTimeBar?: boolean;
1161
+ /** a dashed vertical line follows the pointer over the rows, its time shown in the time bar;
1162
+ * hidden while the pointer is on an event (default false) */
1163
+ showPointerLine?: boolean;
1164
+ /** the pointer line's label for a time in unix seconds (default: the browser's locale date and time) */
1165
+ formatPointerTime?: (time: number) => string;
1166
+ /** fires as the pointer moves over the rows with the time under it, and null when it leaves —
1167
+ * feed it to a linked timeline's `setPointerTime` */
1168
+ onPointerTime?: (time: number | null) => void;
1069
1169
  /** layout animations: true (default), false to disable, or durations */
1070
1170
  animations?: AnimationConfig;
1071
1171
  };
@@ -1101,6 +1201,7 @@ export declare class TimelineRenderer {
1101
1201
  flush(): void;
1102
1202
  dispose(): void;
1103
1203
  private resizeCanvases;
1204
+ private drawGrid;
1104
1205
  private drawFrame;
1105
1206
  }
1106
1207
 
@@ -1146,6 +1247,10 @@ export declare const TimelineStreaming10k: () => React_2.JSX.Element;
1146
1247
  */
1147
1248
  export declare const TimelineStripedOverlap: () => React_2.JSX.Element;
1148
1249
 
1250
+ /** The strip mounts on its own three weeks and is moved to the main timeline's three days at once —
1251
+ * the first resize callback, a frame later, must not put it back on the three-week scale. */
1252
+ export declare const TimelineStripMountedLate: () => React_2.JSX.Element;
1253
+
1149
1254
  /**
1150
1255
  * Themeable bar geometry: chunky 32px bars with a 6px lane gap, wide row
1151
1256
  * padding, and a larger corner radius. Verifies stacking, hit-testing
package/dist/index.css CHANGED
@@ -150,4 +150,26 @@
150
150
  pointer-events: none;
151
151
  z-index: 2;
152
152
  }
153
+ .pointer-line {
154
+ display: none;
155
+ position: absolute;
156
+ left: 0;
157
+ width: 0;
158
+ border-left: 1px dashed;
159
+ pointer-events: none;
160
+ z-index: 2;
161
+ }
162
+ .pointer-label {
163
+ display: none;
164
+ position: absolute;
165
+ top: 26px;
166
+ left: 0;
167
+ padding: 0 6px;
168
+ border-radius: 4px;
169
+ line-height: 18px;
170
+ font-size: 11px;
171
+ white-space: nowrap;
172
+ pointer-events: none;
173
+ z-index: 4;
174
+ }
153
175
  /*# sourceMappingURL=index.css.map */