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