@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
|
@@ -1,307 +1,311 @@
|
|
|
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
14
|
meta: G,
|
|
15
15
|
highlight: K,
|
|
16
|
-
defaultHighlight:
|
|
17
|
-
onHighlightChange:
|
|
18
|
-
showSearch:
|
|
19
|
-
renderSearch:
|
|
20
|
-
compactRows:
|
|
21
|
-
showGridlines:
|
|
22
|
-
showControls:
|
|
16
|
+
defaultHighlight: He,
|
|
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",
|
|
23
24
|
showSummary: I = !1,
|
|
24
25
|
summaryPlacement: T = "left",
|
|
25
|
-
summaryDefaultPosition:
|
|
26
|
-
maxHeight:
|
|
27
|
-
selectedTaskId:
|
|
26
|
+
summaryDefaultPosition: Ve,
|
|
27
|
+
maxHeight: Ze = "74vh",
|
|
28
|
+
selectedTaskId: _,
|
|
28
29
|
defaultSelectedTaskId: Fe = null,
|
|
29
|
-
onTaskSelect:
|
|
30
|
-
renderRowLabel:
|
|
31
|
-
renderBar:
|
|
32
|
-
renderTooltip:
|
|
33
|
-
renderDetails:
|
|
30
|
+
onTaskSelect: ze,
|
|
31
|
+
renderRowLabel: he,
|
|
32
|
+
renderBar: $,
|
|
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
|
-
e &&
|
|
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,
|
|
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
|
-
I &&
|
|
56
|
+
}, [J, ee]);
|
|
57
|
+
ln(() => {
|
|
58
|
+
I && J();
|
|
58
59
|
});
|
|
59
|
-
const
|
|
60
|
-
K === void 0 &&
|
|
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
|
-
|
|
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;
|
|
76
77
|
const O = S(null);
|
|
77
78
|
an(() => {
|
|
78
|
-
O.current != null && p.current && (p.current.scrollLeft = O.current, O.current = null),
|
|
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
|
-
O.current = v * h + w - n,
|
|
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
|
-
|
|
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
106
|
placement: T,
|
|
105
|
-
floatingDefaultPosition:
|
|
107
|
+
floatingDefaultPosition: Ve,
|
|
106
108
|
bubbleGlyphColors: x.slice(0, 3),
|
|
107
|
-
items:
|
|
108
|
-
const l = e.end == null ? N : e.end, c = Math.round(w + (e.start - m) *
|
|
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;
|
|
109
111
|
return {
|
|
110
112
|
id: e.id,
|
|
111
113
|
number: String(n + 1).padStart(2, "0"),
|
|
112
114
|
label: e.name,
|
|
113
115
|
color: x[n % x.length],
|
|
114
|
-
time:
|
|
116
|
+
time: de(e.start),
|
|
115
117
|
inView: b && y,
|
|
116
118
|
selected: P === e.id
|
|
117
119
|
};
|
|
118
120
|
}),
|
|
119
121
|
onPick: (e) => {
|
|
120
|
-
const n =
|
|
122
|
+
const n = o.findIndex((H) => H.id === e), l = p.current;
|
|
121
123
|
if (n < 0 || !l) return;
|
|
122
|
-
const c =
|
|
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 = {
|
|
123
125
|
left: Math.max(0, v + b / 2 - l.clientWidth / 2)
|
|
124
126
|
};
|
|
125
|
-
l.clientHeight && (y.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)),
|
|
127
|
+
l.clientHeight && (y.top = Math.max(0, 34 + n * L + L / 2 - l.clientHeight / 2)), Nn(l, y);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
) : null;
|
|
129
131
|
return /* @__PURE__ */ f(
|
|
130
132
|
"div",
|
|
131
133
|
{
|
|
132
|
-
ref:
|
|
133
|
-
className: d(
|
|
134
|
-
style:
|
|
134
|
+
ref: De,
|
|
135
|
+
className: d(a.root, u?.root, Be),
|
|
136
|
+
style: Ge,
|
|
135
137
|
children: [
|
|
136
|
-
(
|
|
137
|
-
/* @__PURE__ */ f("div", { className:
|
|
138
|
-
B != null && /* @__PURE__ */ t("span", { className:
|
|
139
|
-
/* @__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") })
|
|
140
142
|
] }),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
Me,
|
|
144
|
+
me && /* @__PURE__ */ t(
|
|
145
|
+
un,
|
|
144
146
|
{
|
|
145
|
-
zoomPct: `${Math.round(
|
|
146
|
-
fitActive:
|
|
147
|
-
onZoomIn: () =>
|
|
148
|
-
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),
|
|
149
151
|
onFit: () => {
|
|
150
|
-
|
|
152
|
+
ge(!0), we(null);
|
|
151
153
|
},
|
|
152
|
-
hint: "scroll zooms · drag pans"
|
|
154
|
+
hint: U === "none" ? "drag pans" : (U === "ctrl" ? "Ctrl+scroll zooms" : "scroll zooms") + " · drag pans"
|
|
153
155
|
}
|
|
154
156
|
)
|
|
155
157
|
] }),
|
|
156
158
|
T === "top" && D,
|
|
157
|
-
/* @__PURE__ */ f("div", { className:
|
|
159
|
+
/* @__PURE__ */ f("div", { className: a.layout, children: [
|
|
158
160
|
T === "left" && D,
|
|
159
|
-
/* @__PURE__ */ f("div", { className:
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
"div",
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
{
|
|
176
|
-
className: a.nowLine,
|
|
177
|
-
style: { left: Math.round(w + (N - m) * o) }
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
/* @__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)) }),
|
|
181
|
-
i.map((e, n) => {
|
|
182
|
-
const l = e.end == null, c = l ? N : e.end, h = Math.max(0, c - e.start), v = sn(e, E), b = x[n % x.length], y = 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: b, running: l, durationMs: h };
|
|
183
|
-
return /* @__PURE__ */ f(
|
|
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(
|
|
184
177
|
"div",
|
|
185
178
|
{
|
|
186
|
-
className:
|
|
187
|
-
style: {
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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" })
|
|
238
242
|
] }),
|
|
239
|
-
s &&
|
|
243
|
+
s && Y && /* @__PURE__ */ t("aside", { className: d(a.aside, r.drawer, u?.drawer), children: Y(s, {
|
|
240
244
|
close: () => ie(null),
|
|
241
245
|
running: s.end == null
|
|
242
246
|
}) }),
|
|
243
|
-
s && !
|
|
244
|
-
/* @__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: [
|
|
245
249
|
/* @__PURE__ */ t(
|
|
246
250
|
"span",
|
|
247
251
|
{
|
|
248
|
-
className:
|
|
252
|
+
className: r.drawerSwatch,
|
|
249
253
|
style: {
|
|
250
|
-
background: x[
|
|
254
|
+
background: x[o.indexOf(s) % x.length]
|
|
251
255
|
}
|
|
252
256
|
}
|
|
253
257
|
),
|
|
254
|
-
/* @__PURE__ */ t("span", { className:
|
|
258
|
+
/* @__PURE__ */ t("span", { className: r.drawerOwner, children: s.owner || "—" }),
|
|
255
259
|
/* @__PURE__ */ t(
|
|
256
260
|
"span",
|
|
257
261
|
{
|
|
258
262
|
className: d(
|
|
259
|
-
|
|
260
|
-
s.end == null &&
|
|
263
|
+
r.drawerState,
|
|
264
|
+
s.end == null && r.drawerStateRunning
|
|
261
265
|
),
|
|
262
266
|
children: s.end == null ? "running" : "done"
|
|
263
267
|
}
|
|
264
268
|
),
|
|
265
|
-
/* @__PURE__ */ t("div", { className:
|
|
269
|
+
/* @__PURE__ */ t("div", { className: r.drawerSpacer }),
|
|
266
270
|
/* @__PURE__ */ t(
|
|
267
271
|
"button",
|
|
268
272
|
{
|
|
269
273
|
type: "button",
|
|
270
|
-
className:
|
|
274
|
+
className: a.asideClose,
|
|
271
275
|
"aria-label": "Close details",
|
|
272
276
|
onClick: () => ie(null),
|
|
273
277
|
children: "✕"
|
|
274
278
|
}
|
|
275
279
|
)
|
|
276
280
|
] }),
|
|
277
|
-
/* @__PURE__ */ t("div", { className:
|
|
278
|
-
/* @__PURE__ */ t("div", { className:
|
|
279
|
-
/* @__PURE__ */ t("div", { className:
|
|
280
|
-
/* @__PURE__ */ t("div", { className:
|
|
281
|
-
/* @__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) })
|
|
282
286
|
] }),
|
|
283
287
|
(T === "right" || T === "floating") && D
|
|
284
288
|
] }),
|
|
285
289
|
T === "bottom" && D,
|
|
286
290
|
g && (() => {
|
|
287
|
-
const e =
|
|
288
|
-
index:
|
|
289
|
-
color: x[
|
|
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],
|
|
290
294
|
running: e.end == null,
|
|
291
295
|
durationMs: (e.end == null ? N : e.end) - e.start
|
|
292
296
|
}) : void 0;
|
|
293
|
-
return
|
|
294
|
-
/* @__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 }),
|
|
295
299
|
/* @__PURE__ */ t(
|
|
296
300
|
"div",
|
|
297
301
|
{
|
|
298
|
-
className: d(
|
|
302
|
+
className: d(a.tooltipLine, a.tooltipMono),
|
|
299
303
|
style: { marginTop: 4 },
|
|
300
304
|
children: g.time
|
|
301
305
|
}
|
|
302
306
|
),
|
|
303
|
-
/* @__PURE__ */ t("div", { className:
|
|
304
|
-
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 })
|
|
305
309
|
] }) });
|
|
306
310
|
})()
|
|
307
311
|
]
|
|
@@ -310,5 +314,5 @@ const w = 230, Pe = 24, R = 400, Nn = 26, Pn = nn(
|
|
|
310
314
|
}
|
|
311
315
|
);
|
|
312
316
|
export {
|
|
313
|
-
|
|
317
|
+
Cn as GanttTimeline
|
|
314
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
|
/**
|