@overdoser/react-toolkit 0.8.3 → 0.10.1

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.
Files changed (33) hide show
  1. package/AGENTS.md +6 -0
  2. package/CHANGELOG.md +88 -0
  3. package/README.md +2 -0
  4. package/components/Timeline/GanttTimeline.d.ts +144 -0
  5. package/components/Timeline/GanttTimeline.js +312 -0
  6. package/components/Timeline/GanttTimeline.module.scss.js +55 -0
  7. package/components/Timeline/HistoryTimeline.d.ts +184 -0
  8. package/components/Timeline/HistoryTimeline.js +445 -0
  9. package/components/Timeline/HistoryTimeline.module.scss.js +59 -0
  10. package/components/Timeline/Timeline.module.scss.js +111 -0
  11. package/components/Timeline/TimelineShared.d.ts +79 -0
  12. package/components/Timeline/TimelineShared.js +173 -0
  13. package/components/Timeline/TraceTimeline.d.ts +180 -0
  14. package/components/Timeline/TraceTimeline.js +536 -0
  15. package/components/Timeline/TraceTimeline.module.scss.js +111 -0
  16. package/components/Timeline/demoData.d.ts +42 -0
  17. package/components/Timeline/historyLayout.d.ts +82 -0
  18. package/components/Timeline/historyLayout.js +264 -0
  19. package/components/Timeline/index.d.ts +7 -0
  20. package/components/Timeline/timelineCore.d.ts +100 -0
  21. package/components/Timeline/timelineCore.js +193 -0
  22. package/components/Timeline/traceLayout.d.ts +72 -0
  23. package/components/Timeline/traceLayout.js +92 -0
  24. package/components/Timeline/useTimeline.d.ts +39 -0
  25. package/components/Timeline/useTimeline.js +81 -0
  26. package/index.css +1 -1
  27. package/index.d.ts +2 -0
  28. package/index.js +93 -87
  29. package/index.layered.css +1 -1
  30. package/llms.txt +115 -1
  31. package/manifest.json +323 -0
  32. package/package.json +2 -1
  33. package/recipes/live-timeline-feed.tsx +147 -0
@@ -0,0 +1,536 @@
1
+ import { jsx as n, jsxs as r, Fragment as R } from "react/jsx-runtime";
2
+ import { forwardRef as $t, useRef as x, useState as N, useCallback as _, useEffect as Ft, useLayoutEffect as jt, useMemo as zt } from "react";
3
+ import c from "clsx";
4
+ import i from "./Timeline.module.scss.js";
5
+ import s from "./TraceTimeline.module.scss.js";
6
+ import { fmtDateISO as de, fmtClockUTC as Y, fmtISO as I, ticks as Zt, tickSubdiv as _t, TL_COLORS as w, fmtDur as ue, eventMatches as Yt, tint as H, TIMELINE_PALETTE_VARS as ot } from "./timelineCore.js";
7
+ import { traceChipWidth as Gt, layoutTraceBand as Jt } from "./traceLayout.js";
8
+ import { TimelineSummary as Qt, TimelineZoomControls as en, TimelineLegend as tn, HighlightText as nn, TimelineTooltip as sn } from "./TimelineShared.js";
9
+ import { useNowTicker as ln, useContainerWidth as an, useTimelinePan as rn, useWheelZoom as cn, animateScrollTo as on } from "./useTimeline.js";
10
+ const p = 84, dt = 24, q = 400, dn = 51, me = 300, yn = $t(
11
+ function(ut, mt) {
12
+ const {
13
+ events: u,
14
+ title: he,
15
+ meta: pe,
16
+ highlight: fe,
17
+ defaultHighlight: ht,
18
+ onHighlightChange: pt,
19
+ showSearch: ft = !0,
20
+ renderSearch: Ve,
21
+ services: Ue,
22
+ serviceColors: vt,
23
+ compactRows: gt = !1,
24
+ showGridlines: Nt = !0,
25
+ showControls: Ke = !0,
26
+ showLegend: wt = !0,
27
+ showSummary: G = !1,
28
+ summaryPlacement: E = "left",
29
+ summaryDefaultPosition: xt,
30
+ maxHeight: yt = "80vh",
31
+ selectedEventId: ve,
32
+ defaultSelectedEventId: bt = null,
33
+ onEventSelect: Mt,
34
+ renderChip: Xe,
35
+ renderTooltip: ge,
36
+ renderDetails: Ne,
37
+ classes: m,
38
+ className: Tt,
39
+ style: St
40
+ } = ut, h = x(null), [$e, Fe] = N(null), [je, ze] = N(!0), [f, we] = N(null), [Lt, Ze] = N(null), [S, xe] = N(null), [O, _e] = N(null), [kt, Ct] = N(null), [Rt, Ht] = N(null), Ye = x(!1), [Et, Pt] = N(bt), P = ve !== void 0 ? ve : Et, [J, Dt] = N({ l: 0, w: 0 }), Ge = x(G);
41
+ Ge.current = G;
42
+ const ye = _(() => {
43
+ const e = h.current;
44
+ e && Dt(
45
+ (t) => t.l === e.scrollLeft && t.w === e.clientWidth ? t : { l: e.scrollLeft, w: e.clientWidth }
46
+ );
47
+ }, []);
48
+ Ft(() => {
49
+ G && ye();
50
+ });
51
+ const [A, Bt] = N({ l: 0, w: 2e3 }), be = x(A);
52
+ be.current = A;
53
+ const Me = _(() => {
54
+ const e = h.current;
55
+ if (!e) return;
56
+ const t = Math.floor(e.scrollLeft / q) * q, l = (Math.ceil((e.clientWidth || 1600) / q) + 1) * q;
57
+ (t !== be.current.l || l !== be.current.w) && Bt({ l: t, w: l });
58
+ }, []), Je = u.some((e) => e.end == null), M = ln(Je, 400), Te = an(h), V = rn(h), [Wt, It] = N(ht ?? ""), Se = fe !== void 0 ? fe : Wt, L = Se.trim(), Qe = (e) => {
59
+ fe === void 0 && It(e), pt?.(e);
60
+ }, et = Ve ? Ve({ value: Se, setValue: Qe }) : ft ? /* @__PURE__ */ n(
61
+ "input",
62
+ {
63
+ className: c(i.searchInput, m?.search),
64
+ placeholder: "Highlight keyword in events…",
65
+ "aria-label": "Highlight keyword",
66
+ value: Se,
67
+ onChange: (e) => Qe(e.target.value)
68
+ }
69
+ ) : null, U = (e) => e.op || e.requestId || e.reqHeaders && e.reqHeaders["x-request-id"] || e.id, Q = (e) => e.source || "client";
70
+ let o, K;
71
+ u.length ? (o = Math.min(...u.map((e) => e.start)), K = Math.max(o + 1e3, ...u.map((e) => e.end ?? M))) : (o = M - 3e4, K = M + 5e3);
72
+ const Le = (K - o) * 0.03;
73
+ o -= Le, K += Le;
74
+ const ke = K - o, tt = Math.max(240, Te - p - dt), ee = Math.max(tt * 0.45, tt - 210) / ke, v = je || !$e ? ee : $e, Ce = x(ee), D = x(v), Re = x(o), He = x(1e9);
75
+ Ce.current = ee, D.current = v, Re.current = o;
76
+ const te = x(null);
77
+ jt(() => {
78
+ te.current != null && h.current && (h.current.scrollLeft = te.current, te.current = null), Me();
79
+ });
80
+ const Ee = _((e, t) => {
81
+ const l = h.current;
82
+ if (!l) return;
83
+ const y = D.current || 1e-3, d = Math.max(Ce.current ? Ce.current * 0.2 : 1e-7, Math.min(10, y * e)), g = (l.scrollLeft + t - p) / y;
84
+ te.current = g * d + p - t, ze(!1), Fe(d);
85
+ }, []);
86
+ cn(h, (e) => {
87
+ e.preventDefault();
88
+ const t = h.current;
89
+ t && Ee(
90
+ Math.exp(-(e.deltaY || e.deltaX) * 22e-4),
91
+ e.clientX - t.getBoundingClientRect().left
92
+ );
93
+ });
94
+ const Pe = x(null), qt = _(() => {
95
+ Pe.current == null && (Pe.current = requestAnimationFrame(() => {
96
+ Pe.current = null;
97
+ const e = h.current;
98
+ if (!e || !D.current) return;
99
+ const t = Re.current + Math.max(0, e.scrollLeft + 117 - p) / D.current;
100
+ Ct(de(t)), Ht(Ye.current ? Y(t) : null), Me(), Ge.current && ye();
101
+ }));
102
+ }, [ye, Me]), De = x(null), Ot = _((e) => {
103
+ const t = e.clientX;
104
+ De.current == null && (De.current = requestAnimationFrame(() => {
105
+ De.current = null;
106
+ const l = h.current;
107
+ if (!l) return;
108
+ const y = l.getBoundingClientRect(), d = t - y.left + l.scrollLeft;
109
+ if (d < p + 5 || !D.current) {
110
+ xe(null);
111
+ return;
112
+ }
113
+ const g = Re.current + (d - p) / D.current, b = Math.max(88, Math.min(Math.round(d), He.current - 88));
114
+ xe({ left: Math.round(d), chipLeft: b, label: I(g, !0), t: g });
115
+ }));
116
+ }, []), Be = (e) => {
117
+ ve === void 0 && Pt(e ? e.id : null), Mt?.(e);
118
+ }, nt = zt(() => {
119
+ const e = [];
120
+ return (Ue || []).forEach((t) => {
121
+ u.some((l) => l.service === t) && e.push(t);
122
+ }), u.forEach((t) => {
123
+ e.includes(t.service) || e.push(t.service);
124
+ }), e;
125
+ }, [u, Ue]), T = {};
126
+ nt.forEach((e, t) => {
127
+ T[e] = ot[t % ot.length];
128
+ }), Object.assign(T, vt);
129
+ const st = gt, lt = st ? 20 : 26, At = st ? 60 : 66, Vt = u.map((e) => ({
130
+ id: e.id,
131
+ left: Math.round(p + (e.start - o) * v),
132
+ width: Math.round(Math.max(12, ((e.end ?? M) - e.start) * v)),
133
+ labelW: Gt(Q(e), e.service, String(U(e)))
134
+ })), ne = Jt(Vt, {
135
+ barH: lt,
136
+ rowH: At,
137
+ chipH: dn,
138
+ minH: 420
139
+ }), se = new Map(ne.items.map((e) => [e.id, e])), We = Math.ceil(Math.max(p + ke * v + dt + 60, ne.maxExt + 26));
140
+ He.current = We;
141
+ const Ut = o + (We - p) / v, X = Math.max(o, o + (A.l - q - p) / v), le = Math.min(Ut, o + (A.l + A.w + q - p) / v), k = Zt(X, le, Math.max(1, (le - X) * v), 64), ie = k.step < 1e3;
142
+ Ye.current = ie;
143
+ const Ie = [], it = Math.max(o, (k.list.length ? k.list[0].t : X) - k.step);
144
+ let at = de(it), rt = Y(it);
145
+ k.list.forEach((e) => {
146
+ const t = de(e.t), l = Y(e.t);
147
+ Ie.push({
148
+ left: Math.round(p + (e.t - o) * v),
149
+ date: t !== at ? t : null,
150
+ time: !ie || l !== rt ? l : null,
151
+ sub: ie ? "." + String(new Date(e.t).getUTCMilliseconds()).padStart(3, "0") : null
152
+ }), at = t, rt = l;
153
+ });
154
+ const ct = [], B = _t(k.step);
155
+ if (B.parts > 1) {
156
+ const e = k.step / B.parts;
157
+ if ((le - X) / e < 2e3)
158
+ for (let t = Math.ceil(X / e); t * e <= le; t++)
159
+ t % B.parts !== 0 && ct.push({
160
+ left: Math.round(p + (t * e - o) * v),
161
+ medium: B.medium > 0 && t % B.parts === B.medium
162
+ });
163
+ }
164
+ const qe = S ? S.t : null, a = P != null && u.find((e) => e.id === P) || null, Kt = (e, t) => {
165
+ const l = se.get(e.id);
166
+ if (!l) return;
167
+ const y = e.end == null, d = (e.end ?? M) - e.start;
168
+ if (_e({
169
+ left: l.left,
170
+ chipLeft: Math.max(88, Math.min(l.left, He.current - 88)),
171
+ label: I(e.start, !0)
172
+ }), Ze(e.id), P === e.id) return;
173
+ const g = h.current, b = g ? g.getBoundingClientRect() : { left: 0 }, $ = g ? g.scrollLeft : 0, re = window.innerWidth || 1200, F = window.innerHeight || 800, ce = l.showLabel ? l.labelW : 0, j = l.showLabel ? l.labelX : l.left, Ae = b.left - $ + Math.min(l.left, j), z = b.left - $ + Math.max(l.left + l.width, j + ce), Z = t.currentTarget.getBoundingClientRect();
174
+ let C = z + 28, oe = Math.max(95, Math.min(t.clientY, F - 120));
175
+ C + me > re - 12 && (C = Ae - me - 28), C < 12 && (C = Math.max(12, Math.min(re - me - 12, t.clientX - me / 2)), oe = Z.bottom + 108, oe > F - 95 && (oe = Math.max(95, Z.top - 108))), we({
176
+ id: e.id,
177
+ x: C,
178
+ y: oe,
179
+ rid: String(U(e)),
180
+ route: Q(e) + " → " + e.service,
181
+ label: e.label || (e.method || "GET") + " " + (e.url ? e.url.replace(/^https?:\/\/[^/]+/, "") : e.id),
182
+ time: I(e.start, !0),
183
+ durLine: y ? "in flight · " + ue(d) + " so far" : ue(d) + " · status " + (e.status ?? "—"),
184
+ url: e.url || ""
185
+ });
186
+ }, Xt = () => {
187
+ we(null), _e(null), Ze(null);
188
+ }, Oe = (e) => Object.entries(e || {}).map(([t, l]) => ({ k: t, v: String(l) })), W = a ? a.end == null : !1, ae = G ? /* @__PURE__ */ n(
189
+ Qt,
190
+ {
191
+ className: m?.summary,
192
+ placement: E,
193
+ floatingDefaultPosition: xt,
194
+ items: u.slice().sort((e, t) => e.start - t.start).map((e, t) => {
195
+ const l = se.get(e.id);
196
+ return {
197
+ id: e.id,
198
+ number: String(t + 1).padStart(2, "0"),
199
+ label: String(U(e)),
200
+ color: T[e.service] || w.body,
201
+ time: Y(e.start),
202
+ inView: !l || !J.w ? !0 : l.left < J.l + J.w && l.left + l.width > J.l,
203
+ selected: P === e.id
204
+ };
205
+ }),
206
+ onPick: (e) => {
207
+ const t = se.get(e), l = h.current;
208
+ !t || !l || on(l, {
209
+ left: Math.max(0, t.left + t.width / 2 - l.clientWidth / 2)
210
+ });
211
+ }
212
+ }
213
+ ) : null;
214
+ return /* @__PURE__ */ r("div", { ref: mt, className: c(i.root, m?.root, Tt), style: St, children: [
215
+ (Ke || et || he != null || pe != null) && /* @__PURE__ */ r("div", { className: c(i.toolbar, m?.toolbar), children: [
216
+ /* @__PURE__ */ r("div", { className: i.toolbarText, children: [
217
+ he != null && /* @__PURE__ */ n("span", { className: i.toolbarTitle, children: he }),
218
+ /* @__PURE__ */ n("span", { className: i.toolbarMeta, children: pe ?? (u.length ? `${u.length} events · span ${ue(ke - 2 * Le)} · times in UTC` : "No events") })
219
+ ] }),
220
+ et,
221
+ Ke && /* @__PURE__ */ n(
222
+ en,
223
+ {
224
+ zoomPct: `${Math.round(v / ee * 100)}%`,
225
+ fitActive: je,
226
+ onZoomIn: () => Ee(1.5, Te / 2),
227
+ onZoomOut: () => Ee(1 / 1.5, Te / 2),
228
+ onFit: () => {
229
+ ze(!0), Fe(null);
230
+ },
231
+ hint: "scroll zooms · drag pans"
232
+ }
233
+ )
234
+ ] }),
235
+ wt && /* @__PURE__ */ n(
236
+ tn,
237
+ {
238
+ className: m?.legend,
239
+ items: nt.map((e) => ({ name: e, color: T[e] }))
240
+ }
241
+ ),
242
+ E === "top" && ae,
243
+ /* @__PURE__ */ r("div", { className: i.layout, children: [
244
+ E === "left" && ae,
245
+ /* @__PURE__ */ r("div", { className: i.main, children: [
246
+ /* @__PURE__ */ n("div", { className: c(i.card, m?.card), children: /* @__PURE__ */ n(
247
+ "div",
248
+ {
249
+ ref: h,
250
+ className: c(i.scroller, s.scroller, m?.scroller),
251
+ style: { maxHeight: yt },
252
+ onPointerDown: V.onPointerDown,
253
+ onPointerMove: V.onPointerMove,
254
+ onPointerUp: V.onPointerUp,
255
+ onPointerLeave: () => {
256
+ V.onPointerUp(), xe(null);
257
+ },
258
+ onMouseMove: Ot,
259
+ onScroll: qt,
260
+ children: /* @__PURE__ */ r("div", { className: s.inner, style: { width: We }, children: [
261
+ Nt && Ie.map((e, t) => /* @__PURE__ */ n("div", { className: s.gridline, style: { left: e.left } }, t)),
262
+ Je && /* @__PURE__ */ n(
263
+ "div",
264
+ {
265
+ className: s.nowLine,
266
+ style: { left: Math.round(p + (M - o) * v) }
267
+ }
268
+ ),
269
+ S && !f && /* @__PURE__ */ n("div", { className: s.cursorLine, style: { left: S.left } }),
270
+ O && /* @__PURE__ */ n("div", { className: s.eventLine, style: { left: O.left } }),
271
+ /* @__PURE__ */ r("div", { className: c(s.axis, m?.axis), children: [
272
+ /* @__PURE__ */ n("div", { className: s.axisDivider }),
273
+ /* @__PURE__ */ r("div", { className: s.axisSticky, children: [
274
+ /* @__PURE__ */ n("span", { className: s.axisUtc, children: "UTC" }),
275
+ /* @__PURE__ */ n("span", { className: s.axisViewDate, children: kt || (u.length ? de(o) : "") }),
276
+ ie && /* @__PURE__ */ n("span", { className: s.axisViewTime, children: Rt || Y(o) })
277
+ ] }),
278
+ Ie.map((e, t) => /* @__PURE__ */ r("span", { children: [
279
+ e.date && /* @__PURE__ */ n("span", { className: s.axisDateLabel, style: { left: e.left }, children: e.date }),
280
+ e.time && /* @__PURE__ */ n("span", { className: s.axisTickLabel, style: { left: e.left }, children: e.time }),
281
+ e.sub && /* @__PURE__ */ n("span", { className: s.axisSubLabel, style: { left: e.left }, children: e.sub }),
282
+ /* @__PURE__ */ n("span", { className: s.axisTickMark, style: { left: e.left } })
283
+ ] }, t)),
284
+ ct.map((e, t) => /* @__PURE__ */ n(
285
+ "span",
286
+ {
287
+ className: c(s.axisMinorMark, e.medium && s.axisMinorMedium),
288
+ style: { left: e.left }
289
+ },
290
+ t
291
+ )),
292
+ S && !f && /* @__PURE__ */ n("div", { className: s.axisChip, style: { left: S.chipLeft }, children: S.label }),
293
+ O && /* @__PURE__ */ r(
294
+ "div",
295
+ {
296
+ className: c(s.axisChip, s.axisChipEvent),
297
+ style: { left: O.chipLeft },
298
+ children: [
299
+ "▸ ",
300
+ O.label
301
+ ]
302
+ }
303
+ )
304
+ ] }),
305
+ /* @__PURE__ */ r("div", { className: s.lane, style: { height: ne.h }, children: [
306
+ /* @__PURE__ */ n("div", { className: s.axisLine, style: { top: ne.axisY } }),
307
+ u.map((e) => {
308
+ const t = se.get(e.id);
309
+ if (!t) return null;
310
+ const l = T[e.service] || w.body, y = e.end == null, d = Yt(e, L), g = qe != null && qe >= e.start && qe <= (e.end ?? M), b = Lt === e.id, $ = L && !d ? 0.25 : 1, re = String(U(e)), F = Q(e), ce = T[F] || w.body, j = T[e.service] || w.body, Ae = b ? `0 0 0 3px ${H(l, 55)}, 0 4px 14px rgba(35,32,28,.22)` : L && d ? `0 0 0 3px ${w.hlRing}` : P === e.id ? `0 0 0 3px ${w.selectedRing}` : g ? `0 0 0 3px ${H(l, 30)}` : "none", z = b ? l : g ? w.stemHot : w.stem, Z = {
311
+ onClick: () => {
312
+ V.wasDragSuppressed() || (we(null), Be(P === e.id ? null : e));
313
+ },
314
+ onMouseEnter: (C) => Kt(e, C),
315
+ onMouseLeave: Xt
316
+ };
317
+ return /* @__PURE__ */ r("span", { children: [
318
+ t.showLabel && /* @__PURE__ */ r(R, { children: [
319
+ t.conn && !t.hconn && /* @__PURE__ */ n(
320
+ "div",
321
+ {
322
+ className: s.stem,
323
+ style: {
324
+ left: t.left,
325
+ top: t.connTop,
326
+ height: t.connH,
327
+ background: z
328
+ }
329
+ }
330
+ ),
331
+ t.conn && t.hconn && /* @__PURE__ */ r(R, { children: [
332
+ /* @__PURE__ */ n(
333
+ "div",
334
+ {
335
+ className: s.stem,
336
+ style: {
337
+ left: t.left,
338
+ top: t.connTop,
339
+ height: t.connH,
340
+ background: z
341
+ }
342
+ }
343
+ ),
344
+ /* @__PURE__ */ n(
345
+ "div",
346
+ {
347
+ className: s.elbow,
348
+ style: {
349
+ left: t.hconnLeft,
350
+ top: t.hconnTop,
351
+ width: t.hconnW,
352
+ background: z
353
+ }
354
+ }
355
+ )
356
+ ] }),
357
+ /* @__PURE__ */ n(
358
+ "div",
359
+ {
360
+ ...Z,
361
+ className: c(s.chip, m?.chip),
362
+ style: {
363
+ left: t.labelX,
364
+ top: t.labelTop,
365
+ opacity: $,
366
+ background: b ? H(l, 7) : L && d ? w.hlWashSoft : void 0,
367
+ borderColor: b ? l : L && d ? w.hlBorder : g ? l : void 0,
368
+ boxShadow: b ? `0 0 0 2px ${H(l, 40)}, 0 4px 12px rgba(35,32,28,.16)` : "0 1px 2px rgba(35,32,28,.06)"
369
+ },
370
+ children: Xe ? Xe(e, {
371
+ color: l,
372
+ pending: y,
373
+ durationMs: (e.end ?? M) - e.start
374
+ }) : /* @__PURE__ */ r(R, { children: [
375
+ /* @__PURE__ */ r("div", { children: [
376
+ /* @__PURE__ */ n(
377
+ "span",
378
+ {
379
+ className: s.chipBadge,
380
+ style: { background: H(ce, 14), color: ce },
381
+ children: F
382
+ }
383
+ ),
384
+ /* @__PURE__ */ n("span", { className: s.chipArrow, children: " → " }),
385
+ /* @__PURE__ */ n(
386
+ "span",
387
+ {
388
+ className: s.chipBadge,
389
+ style: { background: H(j, 14), color: j },
390
+ children: e.service
391
+ }
392
+ )
393
+ ] }),
394
+ /* @__PURE__ */ n("div", { className: s.chipOp, children: /* @__PURE__ */ n(nn, { text: re, query: L }) }),
395
+ /* @__PURE__ */ n("div", { className: s.chipTime, children: I(e.start, !0) })
396
+ ] })
397
+ }
398
+ )
399
+ ] }),
400
+ /* @__PURE__ */ n(
401
+ "div",
402
+ {
403
+ ...Z,
404
+ className: c(s.bar, y && s.barPending, m?.bar),
405
+ style: {
406
+ left: t.left,
407
+ top: t.barTop,
408
+ width: t.width,
409
+ height: lt,
410
+ background: L && d ? w.hlBarBg : H(l, 22),
411
+ borderColor: l,
412
+ opacity: $,
413
+ boxShadow: Ae
414
+ },
415
+ children: y && /* @__PURE__ */ n(
416
+ "span",
417
+ {
418
+ className: c(i.pulseDot, s.barDot),
419
+ style: { background: l }
420
+ }
421
+ )
422
+ }
423
+ )
424
+ ] }, e.id);
425
+ })
426
+ ] })
427
+ ] })
428
+ }
429
+ ) }),
430
+ /* @__PURE__ */ n("div", { className: c(i.footnote, m?.footnote), children: "Click an event to open its details in the side panel · dashed pills are still in flight" })
431
+ ] }),
432
+ a && Ne && /* @__PURE__ */ n("aside", { className: c(i.aside, s.drawerCustom, m?.drawer), children: Ne(a, { close: () => Be(null), pending: W }) }),
433
+ a && !Ne && /* @__PURE__ */ r("aside", { className: c(i.aside, m?.drawer), children: [
434
+ /* @__PURE__ */ r("div", { className: s.drawerHead, children: [
435
+ /* @__PURE__ */ r("div", { className: s.drawerHeadRow, children: [
436
+ /* @__PURE__ */ n("span", { className: s.methodBadge, children: a.method || "—" }),
437
+ /* @__PURE__ */ n(
438
+ "span",
439
+ {
440
+ className: c(
441
+ s.statusBadge,
442
+ W && s.statusPending,
443
+ !W && (a.status ?? 0) >= 400 && s.statusError
444
+ ),
445
+ children: W ? "pending" : String(a.status ?? "—")
446
+ }
447
+ ),
448
+ /* @__PURE__ */ n("span", { className: s.drawerRoute, children: Q(a) + " → " + a.service }),
449
+ /* @__PURE__ */ n("div", { className: s.drawerSpacer }),
450
+ /* @__PURE__ */ n(
451
+ "button",
452
+ {
453
+ type: "button",
454
+ className: i.asideClose,
455
+ "aria-label": "Close details",
456
+ onClick: () => Be(null),
457
+ children: "✕"
458
+ }
459
+ )
460
+ ] }),
461
+ /* @__PURE__ */ n("div", { className: s.drawerUrl, children: a.url || a.label || a.id }),
462
+ /* @__PURE__ */ n("div", { className: s.drawerRid, children: String(U(a)) }),
463
+ /* @__PURE__ */ n("div", { className: s.drawerXrid, children: a.reqHeaders && a.reqHeaders["x-request-id"] || a.requestId || a.id }),
464
+ /* @__PURE__ */ n("div", { className: s.drawerTiming, children: I(a.start, !0) + (W ? " · in flight" : " → " + I(a.end, !0) + " · " + ue(a.end - a.start)) })
465
+ ] }),
466
+ /* @__PURE__ */ r("div", { className: s.drawerBody, children: [
467
+ /* @__PURE__ */ n("div", { className: s.drawerSection, children: "Request" }),
468
+ !!Object.keys(a.query || {}).length && /* @__PURE__ */ r(R, { children: [
469
+ /* @__PURE__ */ n("div", { className: i.asideSection, children: "Query parameters" }),
470
+ Oe(a.query).map((e) => /* @__PURE__ */ r("div", { className: s.kvRow, children: [
471
+ /* @__PURE__ */ n("span", { className: c(s.kvKey, s.kvKeyQuery), children: e.k }),
472
+ /* @__PURE__ */ n("span", { className: s.kvVal, children: e.v })
473
+ ] }, e.k))
474
+ ] }),
475
+ /* @__PURE__ */ n("div", { className: i.asideSection, children: "Headers" }),
476
+ Oe(a.reqHeaders).map((e) => /* @__PURE__ */ r("div", { className: s.kvRow, children: [
477
+ /* @__PURE__ */ n("span", { className: s.kvKey, children: e.k }),
478
+ /* @__PURE__ */ n("span", { className: s.kvVal, children: e.v })
479
+ ] }, e.k)),
480
+ a.reqBody != null && /* @__PURE__ */ r(R, { children: [
481
+ /* @__PURE__ */ n("div", { className: i.asideSection, children: "Body" }),
482
+ /* @__PURE__ */ n("pre", { className: i.asideRaw, children: JSON.stringify(a.reqBody, null, 2) })
483
+ ] }),
484
+ /* @__PURE__ */ n("div", { className: s.drawerSection, children: "Response" }),
485
+ W ? /* @__PURE__ */ r("div", { className: s.awaiting, children: [
486
+ /* @__PURE__ */ n("span", { className: c(i.pulseDot, s.awaitingDot) }),
487
+ "Awaiting response…"
488
+ ] }) : /* @__PURE__ */ r(R, { children: [
489
+ /* @__PURE__ */ n("div", { className: i.asideSection, children: "Headers" }),
490
+ Oe(a.resHeaders).map((e) => /* @__PURE__ */ r("div", { className: s.kvRow, children: [
491
+ /* @__PURE__ */ n("span", { className: s.kvKey, children: e.k }),
492
+ /* @__PURE__ */ n("span", { className: s.kvVal, children: e.v })
493
+ ] }, e.k)),
494
+ /* @__PURE__ */ n("div", { className: i.asideSection, children: "Body" }),
495
+ /* @__PURE__ */ n("pre", { className: i.asideRaw, children: a.resBody != null ? JSON.stringify(a.resBody, null, 2) : "(empty)" })
496
+ ] })
497
+ ] })
498
+ ] }),
499
+ (E === "right" || E === "floating") && ae
500
+ ] }),
501
+ E === "bottom" && ae,
502
+ f && (() => {
503
+ const e = u.find((l) => l.id === f.id), t = e && ge ? ge(e, {
504
+ color: T[e.service] || w.body,
505
+ pending: e.end == null,
506
+ durationMs: (e.end ?? M) - e.start
507
+ }) : void 0;
508
+ return ge && t == null ? null : /* @__PURE__ */ n(sn, { x: f.x, y: f.y, className: m?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ r(R, { children: [
509
+ /* @__PURE__ */ n("div", { className: c(i.tooltipTitle, i.tooltipMono), children: f.rid }),
510
+ /* @__PURE__ */ n("div", { className: i.tooltipLine, style: { marginTop: 4 }, children: f.route }),
511
+ /* @__PURE__ */ n(
512
+ "div",
513
+ {
514
+ className: c(i.tooltipLine, i.tooltipMono),
515
+ style: { marginTop: 2 },
516
+ children: f.label
517
+ }
518
+ ),
519
+ /* @__PURE__ */ n("div", { className: i.tooltipLine, style: { marginTop: 4 }, children: f.time }),
520
+ /* @__PURE__ */ n("div", { className: i.tooltipLine, children: f.durLine }),
521
+ f.url && /* @__PURE__ */ n(
522
+ "div",
523
+ {
524
+ className: c(i.tooltipDim, i.tooltipMono),
525
+ style: { marginTop: 4, wordBreak: "break-all", fontSize: "10.5px" },
526
+ children: f.url
527
+ }
528
+ )
529
+ ] }) });
530
+ })()
531
+ ] });
532
+ }
533
+ );
534
+ export {
535
+ yn as TraceTimeline
536
+ };
@@ -0,0 +1,111 @@
1
+ const r = "crk-scroller-kwWVy", a = "crk-inner-vJ0BK", i = "crk-gridline-pcX-9", e = "crk-nowLine-05lmp", c = "crk-cursorLine-k7KZo", s = "crk-eventLine-znElH", t = "crk-axis--LqeF", n = "crk-axisDivider-gBKss", o = "crk-axisSticky-J-rsF", k = "crk-axisUtc-ySg72", d = "crk-axisViewDate-oRqHL", w = "crk-axisViewTime-bL50a", x = "crk-axisTickLabel-9V7QB", l = "crk-axisDateLabel-QPPf7", p = "crk-axisTickMark-HGAZI", g = "crk-axisSubLabel-mmUpt", u = "crk-axisMinorMark-LmQdS", m = "crk-axisMinorMedium-yyNB-", b = "crk-axisChip-Xr9r0", h = "crk-axisChipEvent-K9r-4", L = "crk-lane-hvtL1", v = "crk-axisLine-ZRK0p", y = "crk-bar-pqjsX", T = "crk-barPending-NsYu7", M = "crk-barDot-ZtYdm", B = "crk-stem-24Ud2", D = "crk-elbow-nQxQZ", S = "crk-chip-vC8yf", R = "crk-chipArrow-pyTpt", X = "crk-chipBadge-Tz11H", C = "crk-chipOp-qkIIM", K = "crk-chipTime-IoXbi", U = "crk-drawerCustom-w5gWa", V = "crk-drawerHead-mfyc3", H = "crk-drawerHeadRow-w-lfX", E = "crk-methodBadge-lfL4x", P = "crk-statusBadge-XiUl9", Q = "crk-statusPending-Yg9At", f = "crk-statusError-G7XH8", O = "crk-drawerRoute-L-hK0", I = "crk-drawerSpacer-f6nIh", Z = "crk-drawerUrl-ajRgO", q = "crk-drawerRid-UsUb1", A = "crk-drawerXrid-JEUOj", j = "crk-drawerTiming-FCpcS", F = "crk-drawerBody-Cx5-E", J = "crk-drawerSection-Zjpm1", N = "crk-kvRow-DXfXI", Y = "crk-kvKey-MmSqV", z = "crk-kvKeyQuery-0hpds", G = "crk-kvVal-PlEQT", W = "crk-awaiting-FNO2u", _ = "crk-awaitingDot-b4OtX", $ = {
2
+ scroller: r,
3
+ inner: a,
4
+ gridline: i,
5
+ nowLine: e,
6
+ cursorLine: c,
7
+ eventLine: s,
8
+ axis: t,
9
+ axisDivider: n,
10
+ axisSticky: o,
11
+ axisUtc: k,
12
+ axisViewDate: d,
13
+ axisViewTime: w,
14
+ axisTickLabel: x,
15
+ axisDateLabel: l,
16
+ axisTickMark: p,
17
+ axisSubLabel: g,
18
+ axisMinorMark: u,
19
+ axisMinorMedium: m,
20
+ axisChip: b,
21
+ axisChipEvent: h,
22
+ lane: L,
23
+ axisLine: v,
24
+ bar: y,
25
+ barPending: T,
26
+ barDot: M,
27
+ stem: B,
28
+ elbow: D,
29
+ chip: S,
30
+ chipArrow: R,
31
+ chipBadge: X,
32
+ chipOp: C,
33
+ chipTime: K,
34
+ drawerCustom: U,
35
+ drawerHead: V,
36
+ drawerHeadRow: H,
37
+ methodBadge: E,
38
+ statusBadge: P,
39
+ statusPending: Q,
40
+ statusError: f,
41
+ drawerRoute: O,
42
+ drawerSpacer: I,
43
+ drawerUrl: Z,
44
+ drawerRid: q,
45
+ drawerXrid: A,
46
+ drawerTiming: j,
47
+ drawerBody: F,
48
+ drawerSection: J,
49
+ kvRow: N,
50
+ kvKey: Y,
51
+ kvKeyQuery: z,
52
+ kvVal: G,
53
+ awaiting: W,
54
+ awaitingDot: _
55
+ };
56
+ export {
57
+ W as awaiting,
58
+ _ as awaitingDot,
59
+ t as axis,
60
+ b as axisChip,
61
+ h as axisChipEvent,
62
+ l as axisDateLabel,
63
+ n as axisDivider,
64
+ v as axisLine,
65
+ u as axisMinorMark,
66
+ m as axisMinorMedium,
67
+ o as axisSticky,
68
+ g as axisSubLabel,
69
+ x as axisTickLabel,
70
+ p as axisTickMark,
71
+ k as axisUtc,
72
+ d as axisViewDate,
73
+ w as axisViewTime,
74
+ y as bar,
75
+ M as barDot,
76
+ T as barPending,
77
+ S as chip,
78
+ R as chipArrow,
79
+ X as chipBadge,
80
+ C as chipOp,
81
+ K as chipTime,
82
+ c as cursorLine,
83
+ $ as default,
84
+ F as drawerBody,
85
+ U as drawerCustom,
86
+ V as drawerHead,
87
+ H as drawerHeadRow,
88
+ q as drawerRid,
89
+ O as drawerRoute,
90
+ J as drawerSection,
91
+ I as drawerSpacer,
92
+ j as drawerTiming,
93
+ Z as drawerUrl,
94
+ A as drawerXrid,
95
+ D as elbow,
96
+ s as eventLine,
97
+ i as gridline,
98
+ a as inner,
99
+ Y as kvKey,
100
+ z as kvKeyQuery,
101
+ N as kvRow,
102
+ G as kvVal,
103
+ L as lane,
104
+ E as methodBadge,
105
+ e as nowLine,
106
+ r as scroller,
107
+ P as statusBadge,
108
+ f as statusError,
109
+ Q as statusPending,
110
+ B as stem
111
+ };