awesome-timeline-react 0.2.0 → 0.3.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 +59 -3
- package/dist/_tsup-dts-rollup.d.mts +186 -52
- package/dist/_tsup-dts-rollup.d.ts +186 -52
- package/dist/index.js +535 -252
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +474 -191
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ declare type CanvasBoardProps = {
|
|
|
44
44
|
rowsHeaderClassName?: string;
|
|
45
45
|
setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
|
|
46
46
|
setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
|
|
47
|
+
setTick: React_2.Dispatch<React_2.SetStateAction<number | null>>;
|
|
47
48
|
onDrop?: (props: OnDropProps) => void;
|
|
48
49
|
onResize?: (props: OnResizeProps) => void;
|
|
49
50
|
onEventClick?: (props: OnEventClickProps) => void;
|
|
@@ -56,7 +57,12 @@ declare type CanvasBoardProps = {
|
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
59
|
|
|
59
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Drop: snap the dropped start to the nearest grid cell boundary. Cells are
|
|
62
|
+
* anchored to absolute time (multiples of the cell duration), matching the
|
|
63
|
+
* vertical grid lines (`drawGridLines`) — so a dropped event lands on a line
|
|
64
|
+
* regardless of how the window has been panned.
|
|
65
|
+
*/
|
|
60
66
|
export declare const computeDropTimes: ({ pointerX, cellWidth, tick, windowStart, duration, }: {
|
|
61
67
|
pointerX: number;
|
|
62
68
|
cellWidth: number;
|
|
@@ -79,6 +85,26 @@ tick: number, direction: "left" | "right") => {
|
|
|
79
85
|
endTime: number;
|
|
80
86
|
} | null;
|
|
81
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Time-frame zoom: returns a new visible window (+ derived tick and cellWidth)
|
|
90
|
+
* for scaling the visible duration by `factor` (newDuration = oldDuration *
|
|
91
|
+
* factor; <1 zooms in, >1 zooms out), anchored so the timestamp under
|
|
92
|
+
* `anchorX` (px from the content's left edge) stays under that pixel.
|
|
93
|
+
*
|
|
94
|
+
* `tick` is recomputed from the new (integer-rounded) window; `cellWidth` is
|
|
95
|
+
* then derived from the *actual* new tick so time-per-cell (`cellWidth * tick`)
|
|
96
|
+
* — i.e. the grid cell duration the grid lines snap to — is preserved exactly.
|
|
97
|
+
* Rescaling cellWidth by the unrounded factor instead would let rounding drift
|
|
98
|
+
* the cell duration off the hour over many zooms, so the grid lines would creep
|
|
99
|
+
* out of step with the time-bar blocks. The new duration is clamped to the
|
|
100
|
+
* limits; the anchor still holds after clamping.
|
|
101
|
+
*/
|
|
102
|
+
export declare const computeZoom: (windowTime: [number, number], tick: number, cellWidth: number, anchorX: number, factor: number, contentWidth: number, { minWindowSeconds, maxWindowSeconds }: ZoomLimits) => {
|
|
103
|
+
windowTime: [number, number];
|
|
104
|
+
tick: number;
|
|
105
|
+
cellWidth: number;
|
|
106
|
+
};
|
|
107
|
+
|
|
82
108
|
/**
|
|
83
109
|
* Returns the window-visible slice of a startTime-sorted event array.
|
|
84
110
|
* Binary search cuts the tail (startTime > windowEnd) in O(log n); the head
|
|
@@ -102,19 +128,13 @@ export declare const default_alias: {
|
|
|
102
128
|
*/
|
|
103
129
|
export declare const default_alias_1: React_2.ForwardRefExoticComponent<CanvasBoardProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
104
130
|
|
|
105
|
-
export declare const
|
|
106
|
-
windowTime: number[];
|
|
107
|
-
setTick: React.Dispatch<React.SetStateAction<number | null>>;
|
|
108
|
-
setCellWidth: React.Dispatch<React.SetStateAction<number>>;
|
|
109
|
-
contentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
110
|
-
}) => void;
|
|
111
|
-
|
|
112
|
-
export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, }: {
|
|
131
|
+
export declare const default_alias_2: ({ windowTime, tick, contentWidth, scrollWidth, theme, timeBar, }: {
|
|
113
132
|
windowTime: number[];
|
|
114
133
|
tick: number | null;
|
|
115
134
|
contentWidth: number | null;
|
|
116
135
|
scrollWidth: number;
|
|
117
136
|
theme?: ResolvedTheme;
|
|
137
|
+
timeBar?: TimeBarConfig;
|
|
118
138
|
}) => React_2.JSX.Element;
|
|
119
139
|
|
|
120
140
|
/**
|
|
@@ -142,24 +162,27 @@ export declare const default_alias_7: (eventA: EventType, eventB: EventType) =>
|
|
|
142
162
|
* change grid granularity (middle-click mode or ctrl+wheel). Event mutations
|
|
143
163
|
* are applied straight to the SceneStore — no React state on the hot path.
|
|
144
164
|
*/
|
|
145
|
-
export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, }: UseCanvasInteractionsArgs) => {
|
|
165
|
+
export declare const default_alias_8: ({ scene, rendererRef, dynamicCanvasRef, bodyRef, ghostRef, eventPromptRef, setWindowTime, setCellWidth, setTick, onDrop, onResize, onEventClick, onEventHover, eventsResize, panZoom, }: UseCanvasInteractionsArgs) => {
|
|
146
166
|
handlePointerDown: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
147
167
|
handlePointerMove: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
148
168
|
handlePointerUp: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
149
169
|
handlePointerLeave: () => void;
|
|
170
|
+
handlePointerCancel: (pointerEvent: React_2.PointerEvent<HTMLCanvasElement>) => void;
|
|
150
171
|
handleAuxClick: (pointerEvent: React_2.MouseEvent<HTMLCanvasElement>) => void;
|
|
151
172
|
};
|
|
152
173
|
|
|
153
|
-
export declare const default_alias_9: ({ windowTime,
|
|
174
|
+
export declare const default_alias_9: ({ windowTime, setTick, setCellWidth, contentRef, }: {
|
|
154
175
|
windowTime: number[];
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
};
|
|
176
|
+
setTick: React.Dispatch<React.SetStateAction<number | null>>;
|
|
177
|
+
setCellWidth: React.Dispatch<React.SetStateAction<number>>;
|
|
178
|
+
contentRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
179
|
+
}) => void;
|
|
160
180
|
|
|
161
181
|
export declare const DEFAULT_FADE_DURATION_MS = 120;
|
|
162
182
|
|
|
183
|
+
/** Defaults mirror the pre-0.2.x constants (20px bars, 22px lanes, 10px pad). */
|
|
184
|
+
export declare const DEFAULT_GEOMETRY: Geometry;
|
|
185
|
+
|
|
163
186
|
export declare const DEFAULT_LAYOUT_DURATION_MS = 200;
|
|
164
187
|
|
|
165
188
|
/** Defaults mirror the pre-0.2.0 stylesheet values. */
|
|
@@ -181,14 +204,18 @@ export { DrawEventFn as DrawEventFn_alias_1 }
|
|
|
181
204
|
export declare const drawEvents: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, font: string, animator: LayoutAnimator) => void;
|
|
182
205
|
|
|
183
206
|
/**
|
|
184
|
-
* Vertical grid lines, one per cellWidth
|
|
185
|
-
*
|
|
186
|
-
*
|
|
207
|
+
* Vertical grid lines, one per grid cell (`cellWidth` px == `cellWidth * tick`
|
|
208
|
+
* seconds). Lines are anchored to absolute time — placed at cell boundaries
|
|
209
|
+
* (multiples of the cell duration), not at fixed screen offsets — so they pan
|
|
210
|
+
* with the content and stay aligned with the time-bar blocks. Keeps the legacy
|
|
211
|
+
* "hide-last-line" behavior: no line within 1px of either edge.
|
|
187
212
|
*/
|
|
188
|
-
export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, height, cellWidth, color, }: {
|
|
213
|
+
export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, height, cellWidth, windowStart, tick, color, }: {
|
|
189
214
|
width: number;
|
|
190
215
|
height: number;
|
|
191
216
|
cellWidth: number;
|
|
217
|
+
windowStart: number;
|
|
218
|
+
tick: number;
|
|
192
219
|
color?: string;
|
|
193
220
|
}) => void;
|
|
194
221
|
|
|
@@ -196,21 +223,20 @@ export declare const drawGridLines: (ctx: CanvasRenderingContext2D, { width, hei
|
|
|
196
223
|
export declare const drawRowDividers: (ctx: CanvasRenderingContext2D, view: RendererView, scene: SceneStore, animator: LayoutAnimator) => void;
|
|
197
224
|
|
|
198
225
|
/**
|
|
199
|
-
*
|
|
200
|
-
* time-bar.tsx.
|
|
201
|
-
*
|
|
226
|
+
* Two-row time bar (top row over bottom row) — canvas replacement for the
|
|
227
|
+
* day/hour block divs of time-bar.tsx. The two rows are unit-agnostic
|
|
228
|
+
* (day/hour by default, configurable via TimeBarConfig). Background is left
|
|
229
|
+
* transparent so the .time-bar container color shows through.
|
|
202
230
|
*/
|
|
203
|
-
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height,
|
|
231
|
+
export declare const drawTimeBar: (ctx: CanvasRenderingContext2D, { width, height, topBlocks, bottomBlocks, font, borderColor, textColor, }: {
|
|
204
232
|
width: number;
|
|
205
233
|
height: number;
|
|
206
234
|
font: string;
|
|
207
235
|
borderColor?: string;
|
|
208
236
|
textColor?: string;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
export declare const EVENT_RADIUS = 5;
|
|
237
|
+
topBlocks: TimeBlock[];
|
|
238
|
+
bottomBlocks: TimeBlock[];
|
|
239
|
+
}) => void;
|
|
214
240
|
|
|
215
241
|
/** Imperative event mutation, applied without React re-renders. */
|
|
216
242
|
declare type EventPatch = {
|
|
@@ -307,18 +333,58 @@ export declare class FrameScheduler {
|
|
|
307
333
|
}
|
|
308
334
|
|
|
309
335
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
336
|
+
* The default two-row time bar: a day row over an hour row. Thin wrapper over
|
|
337
|
+
* `generateUnitBlocks` kept for the golden tests and as the documented
|
|
338
|
+
* default; the canvas time bar resolves `TimeBarConfig` and calls
|
|
339
|
+
* `generateUnitBlocks` per row directly.
|
|
314
340
|
*/
|
|
315
|
-
export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth,
|
|
341
|
+
export declare const generateTimeBlocks: ({ windowStart, tick, contentWidth, }: {
|
|
316
342
|
windowStart: number;
|
|
317
343
|
tick: number | null;
|
|
318
344
|
contentWidth: number | null;
|
|
319
|
-
|
|
345
|
+
/** @deprecated unused — block widths now derive from `tick` */
|
|
346
|
+
blockWidth?: number;
|
|
320
347
|
}) => TimeBlocks;
|
|
321
348
|
|
|
349
|
+
/**
|
|
350
|
+
* Positioned blocks for one time-bar row. Walks real calendar/step boundaries
|
|
351
|
+
* from `windowStart` to `windowEnd` and derives each block's pixel x/width
|
|
352
|
+
* from `tick` (seconds per pixel), so blocks stay aligned to the wall clock as
|
|
353
|
+
* the window pans. The first/last blocks are clipped to the window edges, so
|
|
354
|
+
* the row tiles contiguously from x=0 to the content width.
|
|
355
|
+
*/
|
|
356
|
+
export declare const generateUnitBlocks: ({ unit, format, windowStart, windowEnd, tick, }: TimeBarRowConfig & {
|
|
357
|
+
windowStart: number;
|
|
358
|
+
windowEnd: number;
|
|
359
|
+
tick: number | null;
|
|
360
|
+
}) => TimeBlock[];
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Resolved vertical layout for event bars and rows (px). Derived once from the
|
|
364
|
+
* theme (see `geometryFromTheme`) and owned by the SceneStore, which both the
|
|
365
|
+
* renderer (`draw-events`) and hit-testing read so positioning stays in sync.
|
|
366
|
+
*
|
|
367
|
+
* Only `barHeight`, `laneGap`, `rowPaddingY`, and `barRadius` are themeable;
|
|
368
|
+
* the rest are derived from them.
|
|
369
|
+
*/
|
|
370
|
+
export declare type Geometry = {
|
|
371
|
+
/** event bar height */
|
|
372
|
+
barHeight: number;
|
|
373
|
+
/** vertical stride between stacked lanes (barHeight + laneGap) */
|
|
374
|
+
laneHeight: number;
|
|
375
|
+
/** top padding before the first lane (== rowPaddingY) */
|
|
376
|
+
laneTopOffset: number;
|
|
377
|
+
/** minimum row height with no stacking (barHeight + 2*rowPaddingY) */
|
|
378
|
+
rowBaseHeight: number;
|
|
379
|
+
/** static-event height with no stacking (== barHeight) */
|
|
380
|
+
staticEventBaseHeight: number;
|
|
381
|
+
/** event bar corner radius */
|
|
382
|
+
barRadius: number;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
/** Derive the full Geometry from the resolved theme's geometry tokens. */
|
|
386
|
+
export declare const geometryFromTheme: (theme: ResolvedTheme) => Geometry;
|
|
387
|
+
|
|
322
388
|
export declare type HitTarget = {
|
|
323
389
|
kind: "event" | "static";
|
|
324
390
|
event: EventType;
|
|
@@ -345,16 +411,12 @@ export declare type HitTestView = {
|
|
|
345
411
|
|
|
346
412
|
export declare const intersectsWindow: (event: EventType, windowStart: number, windowEnd: number) => boolean;
|
|
347
413
|
|
|
348
|
-
export declare const LANE_HEIGHT = 22;
|
|
349
|
-
|
|
350
|
-
export declare const LANE_TOP_OFFSET = 10;
|
|
351
|
-
|
|
352
414
|
export declare type LaneResult = {
|
|
353
415
|
laneOf: Map<string, number>;
|
|
354
416
|
highestLane: number;
|
|
355
417
|
};
|
|
356
418
|
|
|
357
|
-
export declare const laneTop: (lane: number) => number;
|
|
419
|
+
export declare const laneTop: (lane: number, g?: Geometry) => number;
|
|
358
420
|
|
|
359
421
|
export declare type Layer = "static" | "dynamic";
|
|
360
422
|
|
|
@@ -456,11 +518,24 @@ export { OnResizeProps as OnResizeProps_alias_1 }
|
|
|
456
518
|
declare type PanZoomConfig = {
|
|
457
519
|
/** drag the empty background to pan the time window (default true) */
|
|
458
520
|
panOnDragBackground?: boolean;
|
|
459
|
-
/** ctrl/cmd + wheel
|
|
521
|
+
/** ctrl/cmd + wheel (and trackpad pinch) zooms the visible time frame,
|
|
522
|
+
* anchored at the cursor (default true). Since 0.2.x this is time-frame
|
|
523
|
+
* zoom — grid granularity now lives on middle-click+wheel only. */
|
|
460
524
|
ctrlWheelZoom?: boolean;
|
|
461
|
-
/**
|
|
525
|
+
/** two-finger pinch zooms the time frame on touch devices (default true) */
|
|
526
|
+
pinchZoom?: boolean;
|
|
527
|
+
/** ctrl/cmd + drag on the background zooms the time frame: drag right to zoom
|
|
528
|
+
* in, left to zoom out (default true) */
|
|
529
|
+
dragZoom?: boolean;
|
|
530
|
+
/** smallest visible window in seconds the zoom will go to (default 900 = 15 min) */
|
|
531
|
+
minWindowSeconds?: number;
|
|
532
|
+
/** largest visible window in seconds the zoom will go to (default 30 days) */
|
|
533
|
+
maxWindowSeconds?: number;
|
|
534
|
+
/** multiplier applied to the window per wheel notch (default 1.15) */
|
|
535
|
+
zoomWheelFactor?: number;
|
|
536
|
+
/** middle-click toggles wheel grid-granularity mode (default true) */
|
|
462
537
|
middleClickGranularity?: boolean;
|
|
463
|
-
/** seconds per granularity step (default 900 = 15 min) */
|
|
538
|
+
/** seconds per grid-granularity step (default 900 = 15 min) */
|
|
464
539
|
zoomStepSeconds?: number;
|
|
465
540
|
};
|
|
466
541
|
export { PanZoomConfig }
|
|
@@ -507,9 +582,7 @@ export { ResolvedTheme as ResolvedTheme_alias_1 }
|
|
|
507
582
|
|
|
508
583
|
export declare const resolveTheme: (theme?: Theme) => ResolvedTheme;
|
|
509
584
|
|
|
510
|
-
export declare const
|
|
511
|
-
|
|
512
|
-
export declare const rowMinHeight: (highestLane: number) => number;
|
|
585
|
+
export declare const rowMinHeight: (highestLane: number, g?: Geometry) => number;
|
|
513
586
|
|
|
514
587
|
declare type RowType = {
|
|
515
588
|
id: string;
|
|
@@ -532,7 +605,10 @@ export declare class SceneStore {
|
|
|
532
605
|
private rowOrder;
|
|
533
606
|
private eventRow;
|
|
534
607
|
private listeners;
|
|
608
|
+
private geometry;
|
|
535
609
|
version: number;
|
|
610
|
+
setGeometry(geometry: Geometry): void;
|
|
611
|
+
getGeometry(): Geometry;
|
|
536
612
|
setRows(rows: RowType[]): void;
|
|
537
613
|
setEvents(events: EventType[]): void;
|
|
538
614
|
setStaticEvents(events: EventType[]): void;
|
|
@@ -564,17 +640,15 @@ export declare class SceneStore {
|
|
|
564
640
|
*/
|
|
565
641
|
export declare const sizeCanvas: (canvas: HTMLCanvasElement, cssWidth: number, cssHeight: number, dpr: number) => CanvasRenderingContext2D | null;
|
|
566
642
|
|
|
567
|
-
export declare const
|
|
568
|
-
|
|
569
|
-
export declare const staticEventHeight: (highestLane: number) => number;
|
|
643
|
+
export declare const staticEventHeight: (highestLane: number, g?: Geometry) => number;
|
|
570
644
|
|
|
571
645
|
/** Grid granularity step: same clamp as content.tsx handleOnWheel. */
|
|
572
646
|
export declare const stepCellWidth: (cellWidth: number, deltaY: number, tick: number) => number;
|
|
573
647
|
|
|
574
648
|
/**
|
|
575
|
-
* Color/font tokens for everything drawn to canvas. Defaults mirror
|
|
576
|
-
* pre-0.2.0 stylesheet.
|
|
577
|
-
*
|
|
649
|
+
* Color/font/geometry tokens for everything drawn to canvas. Defaults mirror
|
|
650
|
+
* the pre-0.2.0 stylesheet. Bar geometry (height, lane spacing, row padding,
|
|
651
|
+
* radius) is themeable since 0.2.x — see `core/geometry.ts`.
|
|
578
652
|
*/
|
|
579
653
|
declare type Theme = {
|
|
580
654
|
eventFill?: string;
|
|
@@ -586,10 +660,38 @@ declare type Theme = {
|
|
|
586
660
|
timeBarTextColor?: string;
|
|
587
661
|
/** canvas text font; defaults to the canvas element's computed font */
|
|
588
662
|
font?: string;
|
|
663
|
+
/** event bar height in px (default 20) */
|
|
664
|
+
barHeight?: number;
|
|
665
|
+
/** gap between stacked lanes in px; laneHeight = barHeight + laneGap (default 2) */
|
|
666
|
+
laneGap?: number;
|
|
667
|
+
/** vertical padding above/below the bars within a row in px (default 10) */
|
|
668
|
+
rowPaddingY?: number;
|
|
669
|
+
/** event bar corner radius in px (default 5) */
|
|
670
|
+
barRadius?: number;
|
|
589
671
|
};
|
|
590
672
|
export { Theme }
|
|
591
673
|
export { Theme as Theme_alias_1 }
|
|
592
674
|
|
|
675
|
+
/** Per-row configuration for the two-row time bar. */
|
|
676
|
+
export declare type TimeBarConfig = {
|
|
677
|
+
topRow?: TimeBarRowConfig;
|
|
678
|
+
bottomRow?: TimeBarRowConfig;
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
export declare type TimeBarRowConfig = {
|
|
682
|
+
/** the unit each block spans (default: "day" for the top row, "hour" for
|
|
683
|
+
* the bottom row), or a fixed step like `{ stepSeconds: 8 * 3600 }`. */
|
|
684
|
+
unit?: TimeBarUnit | {
|
|
685
|
+
stepSeconds: number;
|
|
686
|
+
};
|
|
687
|
+
/** label for a block; receives the block's start and end. Defaults mirror
|
|
688
|
+
* the built-in day ("Mon 1 Jan") and hour ("HH:00") labels. */
|
|
689
|
+
format?: (blockStart: Date, blockEnd: Date) => string;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
/** Calendar unit for a time-bar row, or a fixed step in seconds. */
|
|
693
|
+
export declare type TimeBarUnit = "hour" | "day" | "week" | "month";
|
|
694
|
+
|
|
593
695
|
export declare type TimeBlock = {
|
|
594
696
|
label: string;
|
|
595
697
|
x: number;
|
|
@@ -638,6 +740,14 @@ declare type TimelineHandle = {
|
|
|
638
740
|
export { TimelineHandle }
|
|
639
741
|
export { TimelineHandle as TimelineHandle_alias_1 }
|
|
640
742
|
|
|
743
|
+
/**
|
|
744
|
+
* A small, sub-day window (~6h). With a window narrower than a day the time
|
|
745
|
+
* bar must still track the hour labels to the actual time as you pan — pan the
|
|
746
|
+
* background and watch the hour labels advance continuously (rather than
|
|
747
|
+
* staying pinned and then jumping by a whole day near midnight).
|
|
748
|
+
*/
|
|
749
|
+
export declare const TimelineNarrowWindow: () => React_2.JSX.Element;
|
|
750
|
+
|
|
641
751
|
export declare const TimelinePrimary: () => React_2.JSX.Element;
|
|
642
752
|
|
|
643
753
|
declare type TimelineProps = {
|
|
@@ -659,6 +769,8 @@ declare type TimelineProps = {
|
|
|
659
769
|
showEventPrompt?: boolean;
|
|
660
770
|
eventPromptTemplate?: (event: EventType) => JSX.Element;
|
|
661
771
|
panZoom?: PanZoomConfig;
|
|
772
|
+
/** configure each row's unit/label in the two-row time bar */
|
|
773
|
+
timeBar?: TimeBarConfig;
|
|
662
774
|
/** layout animations: true (default), false to disable, or durations */
|
|
663
775
|
animations?: AnimationConfig;
|
|
664
776
|
};
|
|
@@ -697,6 +809,14 @@ export declare class TimelineRenderer {
|
|
|
697
809
|
private drawFrame;
|
|
698
810
|
}
|
|
699
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Configurable time-bar rows: a day row over 8-hour "shift" blocks instead of
|
|
814
|
+
* hours. The bottom row uses `{ stepSeconds: 8 * 3600 }` with a custom
|
|
815
|
+
* `format`. Grid lines and drop snapping stay on the hour grid, independent of
|
|
816
|
+
* the time-bar rows.
|
|
817
|
+
*/
|
|
818
|
+
export declare const TimelineShiftBar: () => React_2.JSX.Element;
|
|
819
|
+
|
|
700
820
|
/**
|
|
701
821
|
* 10k events across 500 rows with a fake websocket pushing 200 random
|
|
702
822
|
* event moves every 100ms through the imperative handle — zero React
|
|
@@ -704,6 +824,14 @@ export declare class TimelineRenderer {
|
|
|
704
824
|
*/
|
|
705
825
|
export declare const TimelineStreaming10k: () => React_2.JSX.Element;
|
|
706
826
|
|
|
827
|
+
/**
|
|
828
|
+
* Themeable bar geometry: chunky 32px bars with a 6px lane gap, wide row
|
|
829
|
+
* padding, and a larger corner radius. Verifies stacking, hit-testing
|
|
830
|
+
* (hover/resize zones), drag-ghost height, and header alignment all follow the
|
|
831
|
+
* geometry. Compare with TimelineCanvas (default 20px bars).
|
|
832
|
+
*/
|
|
833
|
+
export declare const TimelineThemed: () => React_2.JSX.Element;
|
|
834
|
+
|
|
707
835
|
/** @deprecated renamed to TimelineProps in 0.2.0 */
|
|
708
836
|
declare type TimelineType = TimelineProps;
|
|
709
837
|
export { TimelineType }
|
|
@@ -722,6 +850,7 @@ declare type UseCanvasInteractionsArgs = {
|
|
|
722
850
|
eventPromptRef: React_2.MutableRefObject<EventPromptActionsType | null>;
|
|
723
851
|
setWindowTime: React_2.Dispatch<React_2.SetStateAction<number[]>>;
|
|
724
852
|
setCellWidth: React_2.Dispatch<React_2.SetStateAction<number>>;
|
|
853
|
+
setTick: React_2.Dispatch<React_2.SetStateAction<number | null>>;
|
|
725
854
|
onDrop?: (props: OnDropProps) => void;
|
|
726
855
|
onResize?: (props: OnResizeProps) => void;
|
|
727
856
|
onEventClick?: (props: OnEventClickProps) => void;
|
|
@@ -735,4 +864,9 @@ export declare const watchDpr: (onChange: (dpr: number) => void) => (() => void)
|
|
|
735
864
|
|
|
736
865
|
export declare const xToTime: (x: number, windowStart: number, tick: number) => number;
|
|
737
866
|
|
|
867
|
+
export declare type ZoomLimits = {
|
|
868
|
+
minWindowSeconds: number;
|
|
869
|
+
maxWindowSeconds: number;
|
|
870
|
+
};
|
|
871
|
+
|
|
738
872
|
export { }
|