@overdoser/react-toolkit 0.11.0 → 0.13.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/AGENTS.md +2 -2
- package/CHANGELOG.md +94 -0
- package/components/Draggable/Draggable.d.ts +1 -1
- package/components/Draggable/Draggable.js +94 -84
- package/components/Timeline/GanttTimeline.d.ts +10 -0
- package/components/Timeline/GanttTimeline.js +193 -189
- package/components/Timeline/HistoryTimeline.d.ts +10 -0
- package/components/Timeline/HistoryTimeline.js +197 -193
- package/components/Timeline/Timeline.module.scss.js +114 -100
- package/components/Timeline/TimelineShared.d.ts +23 -2
- package/components/Timeline/TimelineShared.js +200 -127
- package/components/Timeline/TraceEventDetails.d.ts +92 -0
- package/components/Timeline/TraceEventDetails.js +181 -0
- package/components/Timeline/TraceTimeline.d.ts +34 -47
- package/components/Timeline/TraceTimeline.js +631 -612
- package/components/Timeline/TraceTimeline.module.scss.js +162 -144
- package/components/Timeline/demoData.d.ts +14 -0
- package/components/Timeline/index.d.ts +6 -1
- package/components/Timeline/timelineCore.d.ts +3 -2
- package/components/Timeline/timelineCore.js +41 -36
- package/components/Timeline/traceEvent.d.ts +128 -0
- package/components/Timeline/traceEvent.js +64 -0
- package/components/Timeline/useTimeline.d.ts +11 -0
- package/components/Timeline/useTimeline.js +36 -32
- package/index.css +1 -1
- package/index.d.ts +2 -2
- package/index.js +61 -55
- package/index.layered.css +1 -1
- package/llms.txt +36 -5
- package/manifest.json +653 -166
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -101,8 +101,8 @@ For exhaustive component reference (every prop, every variant, every signature),
|
|
|
101
101
|
- Tiny inline trend (table cell, KPI tile) → `<Sparkline>`.
|
|
102
102
|
- Axis-based charts share a `config` object: `{ [dataKey]: { label, color } }`. `PieChart` uses `nameKey` + `valueKey` (+ optional `colorKey`) instead. Colors via `var(--crk-chart-1)` … `var(--crk-chart-5)`.
|
|
103
103
|
|
|
104
|
-
- **Need a timeline of events?** Three views, all fully controlled (you pass the pre-filtered event array; items without an `end` render live and keep growing until an update completes them), all with wheel-zoom / drag-pan / Fit, keyword highlighting (built-in toolbar search box by default — `showSearch={false}` to hide, `renderSearch` to inject your own element, or controlled `highlight` + `onHighlightChange` for an external box), tooltips, a click-to-open detail side panel, and an optional `showSummary` panel (dense numbered event list with a live viewport band and click-to-navigate smooth scrolling; `summaryPlacement` docks it left/right/top/bottom, floats it as a draggable palette, or — `'bubble'`, the TraceTimeline default — collapses it into a pill bottom-left of the timeline that expands in place). Customize via `--crk-timeline-*` tokens, `classes`, or render-prop slots (`renderChip`/`renderCard`/`renderBar`+`renderRowLabel`, `renderTooltip`, `renderDetails`) that inject custom components while the layout algorithms keep owning geometry:
|
|
105
|
-
- Request/response flow across services (one correlated "manifest"/saga/order) on a proportional UTC band → `<TraceTimeline events title services highlight />`. Ships a right-side dock rail by default (`showDock={false}` to remove): one docked drawer at a time — *Event details*
|
|
104
|
+
- **Need a timeline of events?** Three views, all fully controlled (you pass the pre-filtered event array; items without an `end` render live and keep growing until an update completes them), all with wheel-zoom (Ctrl/Cmd-gated by default; `wheelZoom`: `'ctrl' | 'free' | 'none'`) / drag-pan / Fit, keyword highlighting (built-in toolbar search box by default — `showSearch={false}` to hide, `renderSearch` to inject your own element, or controlled `highlight` + `onHighlightChange` for an external box), tooltips, a click-to-open detail side panel, and an optional `showSummary` panel (dense numbered event list with a live viewport band and click-to-navigate smooth scrolling; `summaryPlacement` docks it left/right/top/bottom, floats it as a draggable palette, or — `'bubble'`, the TraceTimeline default — collapses it into a pill bottom-left of the timeline that expands in place and can dock from its header as a full-height resizable column flush beside the card). Customize via `--crk-timeline-*` tokens, `classes`, or render-prop slots (`renderChip`/`renderCard`/`renderBar`+`renderRowLabel`, `renderTooltip`, `renderDetails`) that inject custom components while the layout algorithms keep owning geometry:
|
|
105
|
+
- Request/response flow across services (one correlated "manifest"/saga/order) on a proportional UTC band → `<TraceTimeline events title services highlight />`. Events don't have to be requests: an entry with no `method`/`status`/headers/bodies is treated as a plain event and the panel adapts — every value is rendered under its own label, and only the sections the event actually has appear (`message`, `payload`, consumer-defined `details: { label, value }[]`, unknown keys under *Other fields*; `level` badges plain events the way `status` badges requests). The details panel is also exported on its own as **`TraceEventDetails`** (`event`, `now`, `highlight`, `showExtraFields`, `hiddenFields`, `onClose`) for use in your own drawer/modal/split view, along with its inference helpers `isRequestEvent` / `badgeOf` / `extraFieldsOf`. `hiddenFields` (on both components) names extra event keys to keep out of *Other fields* and — on the timeline — out of keyword matching, for plumbing values shared by every event. Ships a right-side dock rail by default (`showDock={false}` to remove): one docked drawer at a time — *Event details* or *Full log* (all events vertically with payloads + copy buttons, scroll-synced with timeline clicks both ways); drawers sit flush against the timeline card at full card height, with a draggable divider to resize drawer vs timeline.
|
|
106
106
|
- One subject's life story (order, incident, candidate, deploy) as cards alternating around an axis, horizontal or vertical, equal/log/proportional spacing → `<HistoryTimeline events subjectName defaultSpacing />`.
|
|
107
107
|
- Tasks stacked by start time with duration bars (Gantt) → `<GanttTimeline tasks title onTaskSelect />`.
|
|
108
108
|
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,100 @@ All notable changes to `@overdoser/react-toolkit` are documented here.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/), and this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.13.0]
|
|
8
|
+
|
|
9
|
+
Trace events no longer have to be HTTP requests, and the event inspector is
|
|
10
|
+
now a component of its own.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Flexible trace events** — `TraceTimelineEvent` gains `kind?: 'request' |
|
|
15
|
+
'event'` (inferred when omitted: `'request'` as soon as any of
|
|
16
|
+
`method`/`url`/`status`/`query`/`reqHeaders`/`reqBody`/`resHeaders`/`resBody`
|
|
17
|
+
is set), `level?: 'debug' | 'info' | 'success' | 'warning' | 'error'` (badge
|
|
18
|
+
in place of a status code), `message?: string`, `payload?: unknown` (the
|
|
19
|
+
generic body for non-request events — pretty-printed with a copy button; an
|
|
20
|
+
event may carry nothing else) and `details?: TraceTimelineField[]`
|
|
21
|
+
(`{ label, value, mono?, copy? }` — ordered custom labeled values, objects
|
|
22
|
+
rendered as copyable JSON blocks). The details drawer and full log render
|
|
23
|
+
only the sections an event actually has — plain events get
|
|
24
|
+
Message/Payload/Details instead of empty Request/Response scaffolding, read
|
|
25
|
+
"ongoing" rather than "pending" while unfinished, and no longer default
|
|
26
|
+
`source` to `client`. Unknown event keys are listed under a new *Other
|
|
27
|
+
fields* section (`showExtraFields={false}` to hide).
|
|
28
|
+
- **`TraceEventDetails`** — the event inspector behind TraceTimeline's details
|
|
29
|
+
drawer, exported standalone for use in your own drawer, modal or split view
|
|
30
|
+
(`event`, `now`, `highlight`, `showExtraFields`, `hiddenFields`, `onClose`,
|
|
31
|
+
`classes`). Ships no shell of its own; every value renders under its own
|
|
32
|
+
label — identity, URL, request id and Started / Ended / Duration each
|
|
33
|
+
stacked on their own row. Its inference helpers are exported too:
|
|
34
|
+
`isRequestEvent`, `badgeOf` (with the `TraceBadgeTone` type) and
|
|
35
|
+
`extraFieldsOf`.
|
|
36
|
+
- **`hiddenFields?: string[]`** on `TraceTimeline` and `TraceEventDetails` —
|
|
37
|
+
named extra keys are kept out of *Other fields* and, on the timeline, out of
|
|
38
|
+
keyword matching; for plumbing values (tenant ids, ingestion timestamps,
|
|
39
|
+
shared correlation ids) that ride along on every event.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **Every value in the trace details panel is a labeled field** — the previous
|
|
44
|
+
unlabeled URL/request-id/timing lines were replaced by stacked
|
|
45
|
+
label-above-value rows, and the sticky drawer head slimmed down to a
|
|
46
|
+
one-line badge strip (identity and timing scroll with the body).
|
|
47
|
+
|
|
48
|
+
## [0.12.0]
|
|
49
|
+
|
|
50
|
+
The timeline summary and drawers become dockable, flush and resizable, and
|
|
51
|
+
wheel zoom is now Ctrl/Cmd-gated by default — see *Changed* for the two
|
|
52
|
+
behavior changes and how to opt back out.
|
|
53
|
+
|
|
54
|
+
### Added
|
|
55
|
+
|
|
56
|
+
- **Timeline summary dock mode** — the events-summary bubble panel's header
|
|
57
|
+
gained a dock/undock toggle (all three timelines): docked, the panel becomes
|
|
58
|
+
a full-height column flush left of the timeline card and the card shrinks to
|
|
59
|
+
make room (nothing overlays the canvas, so sticky labels stay visible).
|
|
60
|
+
Dockedness survives collapse/re-expand; undocking floats the panel back at
|
|
61
|
+
its home corner.
|
|
62
|
+
- **Resizable dock dividers** — the visible 7px divider strip between a docked
|
|
63
|
+
panel and the timeline card (summary on the left, drawers on the right) is a
|
|
64
|
+
drag handle: drag to trade width between panel and timeline, or nudge with
|
|
65
|
+
the arrow keys when focused (summary 200–520px, details 280–640px, log
|
|
66
|
+
320–680px).
|
|
67
|
+
- **`wheelZoom` prop** on `TraceTimeline` / `HistoryTimeline` /
|
|
68
|
+
`GanttTimeline`: `'ctrl' | 'free' | 'none'`. `'ctrl'` zooms only while
|
|
69
|
+
Ctrl/Cmd is held (trackpad pinch still zooms — browsers report it as a
|
|
70
|
+
`ctrlKey` wheel), `'free'` zooms on any scroll, `'none'` leaves zooming to
|
|
71
|
+
the toolbar buttons. Exported `TimelineWheelZoom` type; the Trace/Gantt
|
|
72
|
+
toolbar hint follows the active mode.
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
|
|
76
|
+
- **Wheel zoom is Ctrl/Cmd-gated by default** (`wheelZoom` defaults to
|
|
77
|
+
`'ctrl'`): plain scrolling over the canvas now passes through to the page
|
|
78
|
+
instead of zooming. Pass `wheelZoom="free"` for the pre-0.12 behavior.
|
|
79
|
+
- **TraceTimeline drawers dock into the card row** — the details and full-log
|
|
80
|
+
drawers now sit flush against the timeline card at full card height (square
|
|
81
|
+
touching corners, no gap) instead of floating as sticky siblings with a 16px
|
|
82
|
+
gutter, and are resizable via their divider.
|
|
83
|
+
- The bubble summary (pill, dragged panel and docked panel) now anchors to the
|
|
84
|
+
card's exact box via a new card wrapper in all three timelines.
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
- **`Draggable` re-clamps to its bounds outside drag gestures** — a
|
|
89
|
+
ResizeObserver on the element (and its parent for `bounds="parent"`) plus a
|
|
90
|
+
window resize listener re-apply clamping when sizes change. Previously a
|
|
91
|
+
panel dragged to an edge could grow past the viewport (e.g. the summary
|
|
92
|
+
bubble panel gaining rows from live events) with its drag handle stuck
|
|
93
|
+
off-screen. Controlled components receive the corrected offset via `onDrag`.
|
|
94
|
+
- Full-log copy buttons melted into the selected row's tint (the CopyButton
|
|
95
|
+
secondary variant has a transparent resting background) — they now sit on a
|
|
96
|
+
solid surface background.
|
|
97
|
+
- The full-log navigation flash is a keyframe animation that always decays
|
|
98
|
+
back to the row's resting background, instead of a steady tint that could
|
|
99
|
+
read as a second "selected" row.
|
|
100
|
+
|
|
7
101
|
## [0.11.0]
|
|
8
102
|
|
|
9
103
|
TraceTimeline gets the summary bubble, dock drawers and a full-log view
|
|
@@ -17,7 +17,7 @@ export interface DraggableProps extends Omit<ComponentPropsWithoutRef<'div'>, 'o
|
|
|
17
17
|
position?: DraggablePosition;
|
|
18
18
|
/** Restrict movement to one axis. @default 'both' */
|
|
19
19
|
axis?: 'both' | 'x' | 'y';
|
|
20
|
-
/** Where the element is allowed to move. `'viewport'` and `'parent'` clamp to those bounds; `'none'` is unconstrained. @default 'viewport' */
|
|
20
|
+
/** Where the element is allowed to move. `'viewport'` and `'parent'` clamp to those bounds — during drags and again whenever the element or its bounds resize; `'none'` is unconstrained. @default 'viewport' */
|
|
21
21
|
bounds?: 'viewport' | 'parent' | 'none';
|
|
22
22
|
/** Pixel step applied when moving via arrow keys with a focused handle. @default 10 */
|
|
23
23
|
keyboardStep?: number;
|
|
@@ -1,142 +1,152 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as et, useRef as b, useState as L, useCallback as s, useEffect as X, useContext as nt, createContext as rt } from "react";
|
|
3
|
+
import W from "clsx";
|
|
4
|
+
import g from "./Draggable.module.scss.js";
|
|
5
|
+
const q = rt(null), F = et(
|
|
6
6
|
({
|
|
7
|
-
children:
|
|
7
|
+
children: R,
|
|
8
8
|
defaultPosition: C,
|
|
9
|
-
position:
|
|
9
|
+
position: p,
|
|
10
10
|
axis: a = "both",
|
|
11
11
|
bounds: o = "viewport",
|
|
12
|
-
keyboardStep:
|
|
13
|
-
disabled:
|
|
14
|
-
onDragStart:
|
|
15
|
-
onDrag:
|
|
16
|
-
onDragEnd:
|
|
12
|
+
keyboardStep: m = 10,
|
|
13
|
+
disabled: c = !1,
|
|
14
|
+
onDragStart: Y,
|
|
15
|
+
onDrag: z,
|
|
16
|
+
onDragEnd: v,
|
|
17
17
|
classes: A,
|
|
18
18
|
className: J,
|
|
19
|
-
style:
|
|
19
|
+
style: E,
|
|
20
20
|
...Q
|
|
21
|
-
},
|
|
22
|
-
const h =
|
|
21
|
+
}, w) => {
|
|
22
|
+
const h = b(null), M = p !== void 0, [T, V] = L(
|
|
23
23
|
C ?? { x: 0, y: 0 }
|
|
24
|
-
),
|
|
25
|
-
|
|
26
|
-
const [
|
|
27
|
-
|
|
24
|
+
), x = M ? p : T, l = b(x);
|
|
25
|
+
l.current = x;
|
|
26
|
+
const [y, B] = L(!1), D = b(null), P = b(0), [$, K] = L(!1), Z = s(() => (P.current += 1, K(!0), () => {
|
|
27
|
+
P.current -= 1, P.current === 0 && K(!1);
|
|
28
28
|
}), []), _ = s(
|
|
29
29
|
(t) => {
|
|
30
|
-
h.current = t, typeof
|
|
30
|
+
h.current = t, typeof w == "function" ? w(t) : w && (w.current = t);
|
|
31
31
|
},
|
|
32
|
-
[
|
|
33
|
-
),
|
|
34
|
-
const
|
|
35
|
-
return
|
|
36
|
-
}, []),
|
|
37
|
-
(t,
|
|
38
|
-
if (o === "none" || typeof window > "u") return { x: t, y:
|
|
39
|
-
const
|
|
32
|
+
[w]
|
|
33
|
+
), u = s((t) => {
|
|
34
|
+
const n = h.current?.getBoundingClientRect();
|
|
35
|
+
return n ? { left: n.left - t.x, top: n.top - t.y, width: n.width, height: n.height } : { left: 0, top: 0, width: 0, height: 0 };
|
|
36
|
+
}, []), d = s(
|
|
37
|
+
(t, n, r) => {
|
|
38
|
+
if (o === "none" || typeof window > "u") return { x: t, y: n };
|
|
39
|
+
const e = o === "parent" && h.current?.parentElement ? h.current.parentElement.getBoundingClientRect() : { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight }, i = e.left - r.left, H = e.right - r.width - r.left, I = e.top - r.top, U = e.bottom - r.height - r.top;
|
|
40
40
|
return {
|
|
41
|
-
x: Math.min(Math.max(t, Math.min(i,
|
|
42
|
-
y: Math.min(Math.max(
|
|
41
|
+
x: Math.min(Math.max(t, Math.min(i, H)), Math.max(i, H)),
|
|
42
|
+
y: Math.min(Math.max(n, Math.min(I, U)), Math.max(I, U))
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
45
|
[o]
|
|
46
|
-
),
|
|
46
|
+
), f = s(
|
|
47
47
|
(t) => {
|
|
48
|
-
|
|
48
|
+
l.current = t, M || V(t), z?.(t);
|
|
49
49
|
},
|
|
50
|
-
[
|
|
51
|
-
),
|
|
50
|
+
[M, z]
|
|
51
|
+
), O = s(
|
|
52
52
|
(t) => {
|
|
53
|
-
if (
|
|
53
|
+
if (c || t.button > 0) return;
|
|
54
54
|
t.preventDefault();
|
|
55
|
-
const
|
|
56
|
-
|
|
55
|
+
const n = l.current;
|
|
56
|
+
D.current = {
|
|
57
57
|
startX: t.clientX,
|
|
58
58
|
startY: t.clientY,
|
|
59
|
-
origin:
|
|
60
|
-
base:
|
|
61
|
-
}, B(!0),
|
|
59
|
+
origin: n,
|
|
60
|
+
base: u(n)
|
|
61
|
+
}, B(!0), Y?.(n);
|
|
62
62
|
},
|
|
63
|
-
[
|
|
63
|
+
[c, u, Y]
|
|
64
64
|
);
|
|
65
|
-
|
|
66
|
-
if (!
|
|
65
|
+
X(() => {
|
|
66
|
+
if (!y) return;
|
|
67
67
|
const t = (r) => {
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
70
|
-
const i = a === "y" ?
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
B(!1),
|
|
68
|
+
const e = D.current;
|
|
69
|
+
if (!e) return;
|
|
70
|
+
const i = a === "y" ? e.origin.x : e.origin.x + (r.clientX - e.startX), H = a === "x" ? e.origin.y : e.origin.y + (r.clientY - e.startY);
|
|
71
|
+
f(d(i, H, e.base));
|
|
72
|
+
}, n = () => {
|
|
73
|
+
B(!1), D.current = null, v?.(l.current);
|
|
74
74
|
};
|
|
75
|
-
return window.addEventListener("pointermove", t), window.addEventListener("pointerup",
|
|
76
|
-
window.removeEventListener("pointermove", t), window.removeEventListener("pointerup",
|
|
75
|
+
return window.addEventListener("pointermove", t), window.addEventListener("pointerup", n), () => {
|
|
76
|
+
window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", n);
|
|
77
77
|
};
|
|
78
|
-
}, [
|
|
78
|
+
}, [y, a, d, f, v]), X(() => {
|
|
79
|
+
if (o === "none" || typeof window > "u") return;
|
|
80
|
+
const t = () => {
|
|
81
|
+
if (D.current) return;
|
|
82
|
+
const e = l.current, i = d(e.x, e.y, u(e));
|
|
83
|
+
(i.x !== e.x || i.y !== e.y) && f(i);
|
|
84
|
+
}, n = h.current, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
85
|
+
return n && (r?.observe(n), o === "parent" && n.parentElement && r?.observe(n.parentElement)), window.addEventListener("resize", t), () => {
|
|
86
|
+
r?.disconnect(), window.removeEventListener("resize", t);
|
|
87
|
+
};
|
|
88
|
+
}, [o, d, f, u]);
|
|
79
89
|
const k = s(
|
|
80
90
|
(t) => {
|
|
81
|
-
if (
|
|
91
|
+
if (c) return;
|
|
82
92
|
const r = {
|
|
83
|
-
ArrowLeft: [-
|
|
84
|
-
ArrowRight: [
|
|
85
|
-
ArrowUp: [0, -
|
|
86
|
-
ArrowDown: [0,
|
|
93
|
+
ArrowLeft: [-m, 0],
|
|
94
|
+
ArrowRight: [m, 0],
|
|
95
|
+
ArrowUp: [0, -m],
|
|
96
|
+
ArrowDown: [0, m]
|
|
87
97
|
}[t.key];
|
|
88
98
|
if (!r || a === "x" && r[1] !== 0 || a === "y" && r[0] !== 0) return;
|
|
89
99
|
t.preventDefault();
|
|
90
|
-
const
|
|
91
|
-
|
|
100
|
+
const e = l.current, i = d(e.x + r[0], e.y + r[1], u(e));
|
|
101
|
+
f(i), v?.(i);
|
|
92
102
|
},
|
|
93
|
-
[a,
|
|
103
|
+
[a, d, f, c, u, m, v]
|
|
94
104
|
), S = {
|
|
95
|
-
startPointerDrag:
|
|
105
|
+
startPointerDrag: O,
|
|
96
106
|
onHandleKeyDown: k,
|
|
97
107
|
registerHandle: Z,
|
|
98
108
|
handleClassName: A?.handle,
|
|
99
|
-
disabled:
|
|
100
|
-
dragging:
|
|
101
|
-
},
|
|
102
|
-
...
|
|
103
|
-
transform:
|
|
109
|
+
disabled: c,
|
|
110
|
+
dragging: y
|
|
111
|
+
}, j = `translate(${x.x}px, ${x.y}px)`, tt = {
|
|
112
|
+
...E,
|
|
113
|
+
transform: E?.transform ? `${j} ${E.transform}` : j
|
|
104
114
|
};
|
|
105
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ N(q.Provider, { value: S, children: /* @__PURE__ */ N(
|
|
106
116
|
"div",
|
|
107
117
|
{
|
|
108
118
|
ref: _,
|
|
109
|
-
className:
|
|
110
|
-
|
|
111
|
-
!$ && !
|
|
112
|
-
|
|
119
|
+
className: W(
|
|
120
|
+
g.root,
|
|
121
|
+
!$ && !c && g.surfaceDraggable,
|
|
122
|
+
y && g.dragging,
|
|
113
123
|
A?.root,
|
|
114
124
|
J
|
|
115
125
|
),
|
|
116
126
|
style: tt,
|
|
117
|
-
onPointerDown: $ ? void 0 :
|
|
127
|
+
onPointerDown: $ ? void 0 : O,
|
|
118
128
|
...Q,
|
|
119
|
-
children:
|
|
129
|
+
children: R
|
|
120
130
|
}
|
|
121
131
|
) });
|
|
122
132
|
}
|
|
123
133
|
);
|
|
124
134
|
F.displayName = "Draggable";
|
|
125
|
-
function G({ children:
|
|
126
|
-
const o =
|
|
135
|
+
function G({ children: R, className: C, style: p, ...a }) {
|
|
136
|
+
const o = nt(q);
|
|
127
137
|
if (!o)
|
|
128
138
|
throw new Error("Draggable.Handle must be rendered inside a <Draggable>.");
|
|
129
|
-
return
|
|
139
|
+
return X(() => o.registerHandle(), [o.registerHandle]), /* @__PURE__ */ N(
|
|
130
140
|
"div",
|
|
131
141
|
{
|
|
132
|
-
className:
|
|
133
|
-
|
|
134
|
-
o.disabled &&
|
|
135
|
-
o.dragging &&
|
|
142
|
+
className: W(
|
|
143
|
+
g.handle,
|
|
144
|
+
o.disabled && g.handleDisabled,
|
|
145
|
+
o.dragging && g.handleDragging,
|
|
136
146
|
o.handleClassName,
|
|
137
147
|
C
|
|
138
148
|
),
|
|
139
|
-
style:
|
|
149
|
+
style: p,
|
|
140
150
|
role: "button",
|
|
141
151
|
"aria-label": "Drag handle",
|
|
142
152
|
"aria-disabled": o.disabled || void 0,
|
|
@@ -144,12 +154,12 @@ function G({ children: b, className: C, style: f, ...a }) {
|
|
|
144
154
|
onPointerDown: o.startPointerDrag,
|
|
145
155
|
onKeyDown: o.onHandleKeyDown,
|
|
146
156
|
...a,
|
|
147
|
-
children:
|
|
157
|
+
children: R
|
|
148
158
|
}
|
|
149
159
|
);
|
|
150
160
|
}
|
|
151
161
|
G.displayName = "Draggable.Handle";
|
|
152
|
-
const
|
|
162
|
+
const ct = Object.assign(F, { Handle: G });
|
|
153
163
|
export {
|
|
154
|
-
|
|
164
|
+
ct as Draggable
|
|
155
165
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { TimelineSummaryPlacement } from './TimelineShared';
|
|
3
3
|
import { DraggablePosition } from '../Draggable';
|
|
4
|
+
import { TimelineWheelZoom } from './useTimeline';
|
|
4
5
|
/** One task row. A task with no `end` is running and keeps growing. */
|
|
5
6
|
export interface GanttTimelineTask {
|
|
6
7
|
/** Stable identifier (selection, completion). */
|
|
@@ -81,6 +82,15 @@ export interface GanttTimelineProps {
|
|
|
81
82
|
showGridlines?: boolean;
|
|
82
83
|
/** Toolbar row with the zoom −/%/+/Fit controls. @default true */
|
|
83
84
|
showControls?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* How the mouse wheel / trackpad zooms the timeline: `'ctrl'` zooms only
|
|
87
|
+
* while Ctrl/Cmd is held (plain scrolling passes through to the page;
|
|
88
|
+
* trackpad pinch still zooms), `'free'` zooms on any scroll over the
|
|
89
|
+
* canvas, `'none'` disables wheel zoom entirely — the toolbar buttons
|
|
90
|
+
* still work.
|
|
91
|
+
* @default 'ctrl'
|
|
92
|
+
*/
|
|
93
|
+
wheelZoom?: TimelineWheelZoom;
|
|
84
94
|
/**
|
|
85
95
|
* Dense one-line-per-task summary panel beside the chart: all tasks
|
|
86
96
|
* numbered chronologically from `01`, a highlight band over the tasks
|