@overdoser/react-toolkit 0.10.1 → 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/AGENTS.md +2 -2
- package/CHANGELOG.md +108 -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 +202 -196
- package/components/Timeline/HistoryTimeline.d.ts +10 -0
- package/components/Timeline/HistoryTimeline.js +219 -214
- package/components/Timeline/Timeline.module.scss.js +126 -96
- package/components/Timeline/TimelineShared.d.ts +35 -4
- package/components/Timeline/TimelineShared.js +215 -102
- package/components/Timeline/TraceTimeline.d.ts +50 -9
- package/components/Timeline/TraceTimeline.js +716 -432
- package/components/Timeline/TraceTimeline.module.scss.js +159 -95
- package/components/Timeline/index.d.ts +2 -1
- package/components/Timeline/useTimeline.d.ts +11 -0
- package/components/Timeline/useTimeline.js +36 -32
- package/index.css +1 -1
- package/index.d.ts +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +16 -8
- package/manifest.json +630 -170
- package/package.json +1 -1
|
@@ -1,127 +1,130 @@
|
|
|
1
|
-
import { jsx as t, jsxs as f, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as t, jsxs as f, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as tn, useRef as S, useState as k, useCallback as V, useEffect as ln, useMemo as rn, useLayoutEffect as an } from "react";
|
|
3
3
|
import d from "clsx";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ticks as
|
|
7
|
-
import { TimelineSummary as
|
|
8
|
-
import { useNowTicker as
|
|
9
|
-
const w = 230,
|
|
10
|
-
function(
|
|
4
|
+
import a from "./Timeline.module.scss.js";
|
|
5
|
+
import r from "./GanttTimeline.module.scss.js";
|
|
6
|
+
import { ticks as sn, TIMELINE_PALETTE_VARS as x, fmtDate as de, fmtDur as Z, eventMatches as on, fmtDateTime as F, tint as cn } from "./timelineCore.js";
|
|
7
|
+
import { TimelineSummary as dn, TimelineZoomControls as un, HighlightText as mn, TimelineTooltip as hn } from "./TimelineShared.js";
|
|
8
|
+
import { useNowTicker as fn, useContainerWidth as wn, useTimelinePan as pn, useWheelZoom as gn, animateScrollTo as Nn, wheelZoomAllowed as vn } from "./useTimeline.js";
|
|
9
|
+
const w = 230, We = 24, R = 400, xn = 26, Cn = tn(
|
|
10
|
+
function(Ce, De) {
|
|
11
11
|
const {
|
|
12
12
|
tasks: z,
|
|
13
13
|
title: B,
|
|
14
|
-
meta:
|
|
15
|
-
highlight:
|
|
14
|
+
meta: G,
|
|
15
|
+
highlight: K,
|
|
16
16
|
defaultHighlight: He,
|
|
17
|
-
onHighlightChange:
|
|
18
|
-
showSearch:
|
|
19
|
-
renderSearch:
|
|
20
|
-
compactRows:
|
|
21
|
-
showGridlines:
|
|
22
|
-
showControls:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
onHighlightChange: Ie,
|
|
18
|
+
showSearch: Ee = !0,
|
|
19
|
+
renderSearch: ue,
|
|
20
|
+
compactRows: Ae = !1,
|
|
21
|
+
showGridlines: Oe = !0,
|
|
22
|
+
showControls: me = !0,
|
|
23
|
+
wheelZoom: U = "ctrl",
|
|
24
|
+
showSummary: I = !1,
|
|
25
|
+
summaryPlacement: T = "left",
|
|
26
|
+
summaryDefaultPosition: Ve,
|
|
27
|
+
maxHeight: Ze = "74vh",
|
|
27
28
|
selectedTaskId: _,
|
|
28
29
|
defaultSelectedTaskId: Fe = null,
|
|
29
|
-
onTaskSelect:
|
|
30
|
-
renderRowLabel:
|
|
30
|
+
onTaskSelect: ze,
|
|
31
|
+
renderRowLabel: he,
|
|
31
32
|
renderBar: $,
|
|
32
|
-
renderTooltip:
|
|
33
|
-
renderDetails:
|
|
33
|
+
renderTooltip: X,
|
|
34
|
+
renderDetails: Y,
|
|
34
35
|
classes: u,
|
|
35
|
-
className:
|
|
36
|
-
style:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
const
|
|
36
|
+
className: Be,
|
|
37
|
+
style: Ge
|
|
38
|
+
} = Ce, p = S(null), [fe, we] = k(null), [pe, ge] = k(!0), [g, j] = k(null), [Ke, Ue] = k(Fe), P = _ !== void 0 ? _ : Ke, [M, _e] = k({ l: 0, t: 0, w: 0, h: 0 }), Ne = S(I);
|
|
39
|
+
Ne.current = I;
|
|
40
|
+
const q = S(null), J = V(() => {
|
|
40
41
|
const e = p.current;
|
|
41
42
|
e && _e(
|
|
42
43
|
(n) => n.l === e.scrollLeft && n.t === e.scrollTop && n.w === e.clientWidth && n.h === e.clientHeight ? n : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
|
|
43
44
|
);
|
|
44
|
-
}, []), [W, $e] =
|
|
45
|
-
|
|
46
|
-
const
|
|
45
|
+
}, []), [W, $e] = k({ l: 0, w: 2e3 }), Q = S(W);
|
|
46
|
+
Q.current = W;
|
|
47
|
+
const ee = V(() => {
|
|
47
48
|
const e = p.current;
|
|
48
49
|
if (!e) return;
|
|
49
50
|
const n = Math.floor(e.scrollLeft / R) * R, l = (Math.ceil((e.clientWidth || 1600) / R) + 1) * R;
|
|
50
|
-
(n !==
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
(n !== Q.current.l || l !== Q.current.w) && $e({ l: n, w: l });
|
|
52
|
+
}, []), Xe = V(() => {
|
|
53
|
+
q.current == null && (q.current = requestAnimationFrame(() => {
|
|
54
|
+
q.current = null, ee(), Ne.current && J();
|
|
54
55
|
}));
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
}, [J, ee]);
|
|
57
|
+
ln(() => {
|
|
58
|
+
I && J();
|
|
58
59
|
});
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
},
|
|
60
|
+
const ve = z.some((e) => e.end == null), N = fn(ve, 400), ne = wn(p), C = pn(p), [Ye, je] = k(He ?? ""), te = K !== void 0 ? K : Ye, E = te.trim(), xe = (e) => {
|
|
61
|
+
K === void 0 && je(e), Ie?.(e);
|
|
62
|
+
}, Me = ue ? ue({ value: te, setValue: xe }) : Ee ? /* @__PURE__ */ t(
|
|
62
63
|
"input",
|
|
63
64
|
{
|
|
64
|
-
className: d(
|
|
65
|
+
className: d(a.searchInput, u?.search),
|
|
65
66
|
placeholder: "Highlight keyword in tasks…",
|
|
66
67
|
"aria-label": "Highlight keyword",
|
|
67
|
-
value:
|
|
68
|
-
onChange: (e) =>
|
|
68
|
+
value: te,
|
|
69
|
+
onChange: (e) => xe(e.target.value)
|
|
69
70
|
}
|
|
70
|
-
) : null,
|
|
71
|
-
let m =
|
|
72
|
-
const
|
|
73
|
-
m -=
|
|
74
|
-
const ae =
|
|
75
|
-
|
|
76
|
-
const
|
|
71
|
+
) : null, o = rn(() => z.slice().sort((e, n) => e.start - n.start), [z]);
|
|
72
|
+
let m = o.length ? Math.min(...o.map((e) => e.start)) : N - 1, le = o.length ? Math.max(m + 1, ...o.map((e) => e.end == null ? N : e.end)) : N;
|
|
73
|
+
const re = (le - m) * 0.03;
|
|
74
|
+
m -= re, le += re;
|
|
75
|
+
const ae = le - m, A = Math.max(240, ne - w - We) / ae, i = pe || !fe ? A : fe, se = S(A), be = S(i);
|
|
76
|
+
se.current = A, be.current = i;
|
|
77
|
+
const O = S(null);
|
|
77
78
|
an(() => {
|
|
78
|
-
|
|
79
|
+
O.current != null && p.current && (p.current.scrollLeft = O.current, O.current = null), ee();
|
|
79
80
|
});
|
|
80
|
-
const
|
|
81
|
+
const oe = V((e, n) => {
|
|
81
82
|
const l = p.current;
|
|
82
83
|
if (!l) return;
|
|
83
|
-
const c =
|
|
84
|
-
|
|
84
|
+
const c = be.current || 1e-4, h = Math.max(se.current ? se.current * 0.2 : 1e-9, Math.min(1, c * e)), v = (l.scrollLeft + n - w) / c;
|
|
85
|
+
O.current = v * h + w - n, ge(!1), we(h);
|
|
85
86
|
}, []);
|
|
86
|
-
|
|
87
|
+
gn(p, (e) => {
|
|
88
|
+
if (!vn(U, e)) return;
|
|
87
89
|
e.preventDefault();
|
|
88
90
|
const n = p.current;
|
|
89
|
-
n &&
|
|
91
|
+
n && oe(Math.exp(-e.deltaY * 18e-4), e.clientX - n.getBoundingClientRect().left);
|
|
90
92
|
});
|
|
91
93
|
const ie = (e) => {
|
|
92
|
-
_ === void 0 && Ue(e ? e.id : null),
|
|
93
|
-
},
|
|
94
|
+
_ === void 0 && Ue(e ? e.id : null), ze?.(e);
|
|
95
|
+
}, qe = (e) => {
|
|
94
96
|
const n = window.innerWidth || 1200, l = window.innerHeight || 800, c = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, h = Math.max(130, Math.min(e.clientY, l - 130));
|
|
95
97
|
return { x: c, y: h };
|
|
96
|
-
}, L =
|
|
97
|
-
left: Math.round(w + (e.t - m) *
|
|
98
|
+
}, L = Ae ? 42 : 54, s = P != null && o.find((e) => e.id === P) || null, Te = Math.ceil(w + ae * i + We + 90), Je = m + (Te - w) / i, ye = Math.max(m, m + (W.l - R - w) / i), Se = Math.min(Je, m + (W.l + W.w + R - w) / i), ke = sn(ye, Se, Math.max(1, (Se - ye) * i)).list.map((e) => ({
|
|
99
|
+
left: Math.round(w + (e.t - m) * i),
|
|
98
100
|
label: e.label
|
|
99
|
-
})),
|
|
100
|
-
|
|
101
|
+
})), Qe = o.filter((e) => e.end == null).length, D = I ? /* @__PURE__ */ t(
|
|
102
|
+
dn,
|
|
101
103
|
{
|
|
102
104
|
heading: "Tasks",
|
|
103
105
|
className: u?.summary,
|
|
104
|
-
placement:
|
|
105
|
-
floatingDefaultPosition:
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
placement: T,
|
|
107
|
+
floatingDefaultPosition: Ve,
|
|
108
|
+
bubbleGlyphColors: x.slice(0, 3),
|
|
109
|
+
items: o.map((e, n) => {
|
|
110
|
+
const l = e.end == null ? N : e.end, c = Math.round(w + (e.start - m) * i), h = Math.max(14, Math.round(Math.max(0, l - e.start) * i)), v = 34 + n * L, b = !M.w || c < M.l + M.w && c + h > M.l, y = !M.h || v < M.t + M.h && v + L > M.t;
|
|
108
111
|
return {
|
|
109
112
|
id: e.id,
|
|
110
113
|
number: String(n + 1).padStart(2, "0"),
|
|
111
114
|
label: e.name,
|
|
112
|
-
color:
|
|
113
|
-
time:
|
|
114
|
-
inView:
|
|
115
|
+
color: x[n % x.length],
|
|
116
|
+
time: de(e.start),
|
|
117
|
+
inView: b && y,
|
|
115
118
|
selected: P === e.id
|
|
116
119
|
};
|
|
117
120
|
}),
|
|
118
121
|
onPick: (e) => {
|
|
119
|
-
const n =
|
|
122
|
+
const n = o.findIndex((H) => H.id === e), l = p.current;
|
|
120
123
|
if (n < 0 || !l) return;
|
|
121
|
-
const c =
|
|
122
|
-
left: Math.max(0, v +
|
|
124
|
+
const c = o[n], h = c.end == null ? N : c.end, v = Math.round(w + (c.start - m) * i), b = Math.max(14, Math.round(Math.max(0, h - c.start) * i)), y = {
|
|
125
|
+
left: Math.max(0, v + b / 2 - l.clientWidth / 2)
|
|
123
126
|
};
|
|
124
|
-
l.clientHeight && (
|
|
127
|
+
l.clientHeight && (y.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)), Nn(l, y);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
) : null;
|
|
@@ -129,177 +132,180 @@ const w = 230, Pe = 24, R = 400, Nn = 26, Pn = nn(
|
|
|
129
132
|
"div",
|
|
130
133
|
{
|
|
131
134
|
ref: De,
|
|
132
|
-
className: d(
|
|
133
|
-
style:
|
|
135
|
+
className: d(a.root, u?.root, Be),
|
|
136
|
+
style: Ge,
|
|
134
137
|
children: [
|
|
135
|
-
(
|
|
136
|
-
/* @__PURE__ */ f("div", { className:
|
|
137
|
-
B != null && /* @__PURE__ */ t("span", { className:
|
|
138
|
-
/* @__PURE__ */ t("span", { className:
|
|
138
|
+
(me || Me || B != null || G != null) && /* @__PURE__ */ f("div", { className: d(a.toolbar, u?.toolbar), children: [
|
|
139
|
+
/* @__PURE__ */ f("div", { className: a.toolbarText, children: [
|
|
140
|
+
B != null && /* @__PURE__ */ t("span", { className: a.toolbarTitle, children: B }),
|
|
141
|
+
/* @__PURE__ */ t("span", { className: a.toolbarMeta, children: G ?? (o.length ? `${o.length} tasks · ${Z(ae - 2 * re)} · ${Qe} running` : "No tasks") })
|
|
139
142
|
] }),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
Me,
|
|
144
|
+
me && /* @__PURE__ */ t(
|
|
145
|
+
un,
|
|
143
146
|
{
|
|
144
|
-
zoomPct: `${Math.round(
|
|
145
|
-
fitActive:
|
|
146
|
-
onZoomIn: () =>
|
|
147
|
-
onZoomOut: () =>
|
|
147
|
+
zoomPct: `${Math.round(i / A * 100)}%`,
|
|
148
|
+
fitActive: pe,
|
|
149
|
+
onZoomIn: () => oe(1.5, ne / 2),
|
|
150
|
+
onZoomOut: () => oe(1 / 1.5, ne / 2),
|
|
148
151
|
onFit: () => {
|
|
149
|
-
|
|
152
|
+
ge(!0), we(null);
|
|
150
153
|
},
|
|
151
|
-
hint: "scroll zooms · drag pans"
|
|
154
|
+
hint: U === "none" ? "drag pans" : (U === "ctrl" ? "Ctrl+scroll zooms" : "scroll zooms") + " · drag pans"
|
|
152
155
|
}
|
|
153
156
|
)
|
|
154
157
|
] }),
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */ f("div", { className:
|
|
157
|
-
|
|
158
|
-
/* @__PURE__ */ f("div", { className:
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
"div",
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
{
|
|
175
|
-
className: a.nowLine,
|
|
176
|
-
style: { left: Math.round(w + (N - m) * o) }
|
|
177
|
-
}
|
|
178
|
-
),
|
|
179
|
-
/* @__PURE__ */ t("div", { className: d(a.axis, u?.axis), children: Se.map((e, n) => /* @__PURE__ */ t("div", { className: a.axisLabel, style: { left: e.left }, children: e.label }, n)) }),
|
|
180
|
-
i.map((e, n) => {
|
|
181
|
-
const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = sn(e, I), M = b[n % b.length], T = Math.round(w + (e.start - m) * o), H = Math.max(14, Math.round(h * o)), ke = F(h) + (l ? " · running" : ""), Le = H > 130, Re = { index: n, color: M, running: l, durationMs: h };
|
|
182
|
-
return /* @__PURE__ */ f(
|
|
158
|
+
T === "top" && D,
|
|
159
|
+
/* @__PURE__ */ f("div", { className: a.layout, children: [
|
|
160
|
+
T === "left" && D,
|
|
161
|
+
/* @__PURE__ */ f("div", { className: a.main, children: [
|
|
162
|
+
/* @__PURE__ */ f("div", { className: a.cardWrap, children: [
|
|
163
|
+
/* @__PURE__ */ t("div", { className: d(a.card, u?.card), children: /* @__PURE__ */ t(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: p,
|
|
167
|
+
className: d(a.scroller, r.scroller, u?.scroller),
|
|
168
|
+
style: { maxHeight: Ze },
|
|
169
|
+
onPointerDown: C.onPointerDown,
|
|
170
|
+
onPointerMove: C.onPointerMove,
|
|
171
|
+
onPointerUp: C.onPointerUp,
|
|
172
|
+
onPointerLeave: C.onPointerUp,
|
|
173
|
+
onScroll: Xe,
|
|
174
|
+
children: /* @__PURE__ */ f("div", { className: r.inner, style: { width: Te }, children: [
|
|
175
|
+
Oe && ke.map((e, n) => /* @__PURE__ */ t("div", { className: r.gridline, style: { left: e.left } }, n)),
|
|
176
|
+
ve && /* @__PURE__ */ t(
|
|
183
177
|
"div",
|
|
184
178
|
{
|
|
185
|
-
className:
|
|
186
|
-
style: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
179
|
+
className: r.nowLine,
|
|
180
|
+
style: { left: Math.round(w + (N - m) * i) }
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ t("div", { className: d(r.axis, u?.axis), children: ke.map((e, n) => /* @__PURE__ */ t("div", { className: r.axisLabel, style: { left: e.left }, children: e.label }, n)) }),
|
|
184
|
+
o.map((e, n) => {
|
|
185
|
+
const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = on(e, E), b = x[n % x.length], y = Math.round(w + (e.start - m) * i), H = Math.max(14, Math.round(h * i)), Le = Z(h) + (l ? " · running" : ""), Re = H > 130, Pe = { index: n, color: b, running: l, durationMs: h };
|
|
186
|
+
return /* @__PURE__ */ f(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
className: d(r.row, u?.row),
|
|
190
|
+
style: { height: L, opacity: E && !v ? 0.3 : 1 },
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ t("div", { className: d(r.rowLabel, u?.rowLabel), children: he ? he(e, Pe) : /* @__PURE__ */ f(ce, { children: [
|
|
193
|
+
/* @__PURE__ */ t("span", { className: r.rowName, children: /* @__PURE__ */ t(mn, { text: e.name, query: E }) }),
|
|
194
|
+
/* @__PURE__ */ t("span", { className: r.rowDates, children: de(e.start) + (l ? " → now" : " → " + de(c)) })
|
|
195
|
+
] }) }),
|
|
196
|
+
/* @__PURE__ */ t(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
className: d(r.bar, l && r.barRunning, u?.bar),
|
|
200
|
+
style: {
|
|
201
|
+
left: y,
|
|
202
|
+
top: Math.round((L - xn) / 2),
|
|
203
|
+
width: H,
|
|
204
|
+
borderColor: b,
|
|
205
|
+
background: l ? cn(b, 72) : b,
|
|
206
|
+
boxShadow: E && v ? "0 0 0 3px var(--crk-timeline-hl-ring, #f3d98b)" : "none"
|
|
207
|
+
},
|
|
208
|
+
onClick: () => {
|
|
209
|
+
C.wasDragSuppressed() || (j(null), ie(P === e.id ? null : e));
|
|
210
|
+
},
|
|
211
|
+
onMouseEnter: (en) => {
|
|
212
|
+
if (P === e.id) return;
|
|
213
|
+
const nn = qe(en);
|
|
214
|
+
j({
|
|
215
|
+
...nn,
|
|
216
|
+
id: e.id,
|
|
217
|
+
title: e.name,
|
|
218
|
+
time: F(e.start) + (l ? "" : " → " + F(c)),
|
|
219
|
+
durLine: (l ? "running · " : "took ") + Z(h) + (e.owner ? " · " + e.owner : ""),
|
|
220
|
+
detail: e.detail || ""
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
onMouseLeave: () => j(null),
|
|
224
|
+
children: $ ? $(e, Pe) : /* @__PURE__ */ f(ce, { children: [
|
|
225
|
+
l && /* @__PURE__ */ t("span", { className: d(a.pulseDot, r.barDot) }),
|
|
226
|
+
Re && /* @__PURE__ */ t("span", { className: r.barTextInside, children: Le })
|
|
227
|
+
] })
|
|
228
|
+
}
|
|
229
|
+
),
|
|
230
|
+
!$ && !Re && /* @__PURE__ */ t("div", { className: r.barTextOutside, style: { left: y + H + 10 }, children: Le })
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
e.id
|
|
234
|
+
);
|
|
235
|
+
})
|
|
236
|
+
] })
|
|
237
|
+
}
|
|
238
|
+
) }),
|
|
239
|
+
T === "bubble" && D
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ t("div", { className: d(a.footnote, u?.footnote), children: "Click a bar to open details in the side panel · dashed bars are still running and keep growing" })
|
|
236
242
|
] }),
|
|
237
|
-
s &&
|
|
243
|
+
s && Y && /* @__PURE__ */ t("aside", { className: d(a.aside, r.drawer, u?.drawer), children: Y(s, {
|
|
238
244
|
close: () => ie(null),
|
|
239
245
|
running: s.end == null
|
|
240
246
|
}) }),
|
|
241
|
-
s && !
|
|
242
|
-
/* @__PURE__ */ f("div", { className:
|
|
247
|
+
s && !Y && /* @__PURE__ */ f("aside", { className: d(a.aside, r.drawer, u?.drawer), children: [
|
|
248
|
+
/* @__PURE__ */ f("div", { className: r.drawerHead, children: [
|
|
243
249
|
/* @__PURE__ */ t(
|
|
244
250
|
"span",
|
|
245
251
|
{
|
|
246
|
-
className:
|
|
252
|
+
className: r.drawerSwatch,
|
|
247
253
|
style: {
|
|
248
|
-
background:
|
|
254
|
+
background: x[o.indexOf(s) % x.length]
|
|
249
255
|
}
|
|
250
256
|
}
|
|
251
257
|
),
|
|
252
|
-
/* @__PURE__ */ t("span", { className:
|
|
258
|
+
/* @__PURE__ */ t("span", { className: r.drawerOwner, children: s.owner || "—" }),
|
|
253
259
|
/* @__PURE__ */ t(
|
|
254
260
|
"span",
|
|
255
261
|
{
|
|
256
262
|
className: d(
|
|
257
|
-
|
|
258
|
-
s.end == null &&
|
|
263
|
+
r.drawerState,
|
|
264
|
+
s.end == null && r.drawerStateRunning
|
|
259
265
|
),
|
|
260
266
|
children: s.end == null ? "running" : "done"
|
|
261
267
|
}
|
|
262
268
|
),
|
|
263
|
-
/* @__PURE__ */ t("div", { className:
|
|
269
|
+
/* @__PURE__ */ t("div", { className: r.drawerSpacer }),
|
|
264
270
|
/* @__PURE__ */ t(
|
|
265
271
|
"button",
|
|
266
272
|
{
|
|
267
273
|
type: "button",
|
|
268
|
-
className:
|
|
274
|
+
className: a.asideClose,
|
|
269
275
|
"aria-label": "Close details",
|
|
270
276
|
onClick: () => ie(null),
|
|
271
277
|
children: "✕"
|
|
272
278
|
}
|
|
273
279
|
)
|
|
274
280
|
] }),
|
|
275
|
-
/* @__PURE__ */ t("div", { className:
|
|
276
|
-
/* @__PURE__ */ t("div", { className:
|
|
277
|
-
/* @__PURE__ */ t("div", { className:
|
|
278
|
-
/* @__PURE__ */ t("div", { className:
|
|
279
|
-
/* @__PURE__ */ t("pre", { className:
|
|
281
|
+
/* @__PURE__ */ t("div", { className: r.drawerName, children: s.name }),
|
|
282
|
+
/* @__PURE__ */ t("div", { className: r.drawerTiming, children: F(s.start) + " → " + (s.end == null ? "now" : F(s.end)) + " · " + Z((s.end == null ? N : s.end) - s.start) }),
|
|
283
|
+
/* @__PURE__ */ t("div", { className: r.drawerDetail, children: s.detail || "—" }),
|
|
284
|
+
/* @__PURE__ */ t("div", { className: a.asideSection, children: "Raw event" }),
|
|
285
|
+
/* @__PURE__ */ t("pre", { className: a.asideRaw, children: JSON.stringify(s, null, 2) })
|
|
280
286
|
] }),
|
|
281
|
-
(
|
|
287
|
+
(T === "right" || T === "floating") && D
|
|
282
288
|
] }),
|
|
283
|
-
|
|
289
|
+
T === "bottom" && D,
|
|
284
290
|
g && (() => {
|
|
285
|
-
const e =
|
|
286
|
-
index:
|
|
287
|
-
color:
|
|
291
|
+
const e = o.find((l) => l.id === g.id), n = e && X ? X(e, {
|
|
292
|
+
index: o.indexOf(e),
|
|
293
|
+
color: x[o.indexOf(e) % x.length],
|
|
288
294
|
running: e.end == null,
|
|
289
295
|
durationMs: (e.end == null ? N : e.end) - e.start
|
|
290
296
|
}) : void 0;
|
|
291
|
-
return
|
|
292
|
-
/* @__PURE__ */ t("div", { className:
|
|
297
|
+
return X && n == null ? null : /* @__PURE__ */ t(hn, { x: g.x, y: g.y, className: u?.tooltip, children: n !== void 0 ? n : /* @__PURE__ */ f(ce, { children: [
|
|
298
|
+
/* @__PURE__ */ t("div", { className: a.tooltipTitle, children: g.title }),
|
|
293
299
|
/* @__PURE__ */ t(
|
|
294
300
|
"div",
|
|
295
301
|
{
|
|
296
|
-
className: d(
|
|
302
|
+
className: d(a.tooltipLine, a.tooltipMono),
|
|
297
303
|
style: { marginTop: 4 },
|
|
298
304
|
children: g.time
|
|
299
305
|
}
|
|
300
306
|
),
|
|
301
|
-
/* @__PURE__ */ t("div", { className:
|
|
302
|
-
g.detail && /* @__PURE__ */ t("div", { className:
|
|
307
|
+
/* @__PURE__ */ t("div", { className: a.tooltipLine, children: g.durLine }),
|
|
308
|
+
g.detail && /* @__PURE__ */ t("div", { className: a.tooltipDim, style: { marginTop: 5 }, children: g.detail })
|
|
303
309
|
] }) });
|
|
304
310
|
})()
|
|
305
311
|
]
|
|
@@ -308,5 +314,5 @@ const w = 230, Pe = 24, R = 400, Nn = 26, Pn = nn(
|
|
|
308
314
|
}
|
|
309
315
|
);
|
|
310
316
|
export {
|
|
311
|
-
|
|
317
|
+
Cn as GanttTimeline
|
|
312
318
|
};
|
|
@@ -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
|
export type HistoryTimelineOrientation = 'horizontal' | 'vertical';
|
|
5
6
|
export type HistoryTimelineSpacing = 'equal' | 'log' | 'proportional';
|
|
6
7
|
/**
|
|
@@ -108,6 +109,15 @@ export interface HistoryTimelineProps {
|
|
|
108
109
|
tagColors?: Record<string, string>;
|
|
109
110
|
/** Toolbar with orientation/spacing toggles + zoom controls. @default true */
|
|
110
111
|
showControls?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* How the mouse wheel / trackpad zooms the timeline: `'ctrl'` zooms only
|
|
114
|
+
* while Ctrl/Cmd is held (plain scrolling passes through to the page;
|
|
115
|
+
* trackpad pinch still zooms), `'free'` zooms on any scroll over the
|
|
116
|
+
* canvas, `'none'` disables wheel zoom entirely — the toolbar buttons
|
|
117
|
+
* still work.
|
|
118
|
+
* @default 'ctrl'
|
|
119
|
+
*/
|
|
120
|
+
wheelZoom?: TimelineWheelZoom;
|
|
111
121
|
/** Colored bullet + tag name legend. @default true */
|
|
112
122
|
showLegend?: boolean;
|
|
113
123
|
/**
|