@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.
@@ -1,12 +1,12 @@
1
- const r = "crk-scroller-kwWVy", c = "crk-inner-vJ0BK", o = "crk-gridline-pcX-9", a = "crk-nowLine-05lmp", e = "crk-cursorLine-k7KZo", t = "crk-eventLine-znElH", i = "crk-axis--LqeF", s = "crk-axisDivider-gBKss", n = "crk-axisSticky-J-rsF", l = "crk-axisUtc-ySg72", d = "crk-axisViewDate-oRqHL", k = "crk-axisViewTime-bL50a", g = "crk-axisTickLabel-9V7QB", p = "crk-axisDateLabel-QPPf7", y = "crk-axisTickMark-HGAZI", w = "crk-axisSubLabel-mmUpt", x = "crk-axisMinorMark-LmQdS", b = "crk-axisMinorMedium-yyNB-", h = "crk-axisChip-Xr9r0", m = "crk-axisChipEvent-K9r-4", u = "crk-lane-hvtL1", L = "crk-axisLine-ZRK0p", v = "crk-bar-pqjsX", S = "crk-barPending-NsYu7", T = "crk-barDot-ZtYdm", P = "crk-stem-24Ud2", B = "crk-elbow-nQxQZ", E = "crk-chip-vC8yf", H = "crk-chipArrow-pyTpt", C = "crk-chipBadge-Tz11H", D = "crk-chipOp-qkIIM", M = "crk-chipTime-IoXbi", A = "crk-drawerCustom-w5gWa", K = "crk-drawerHead-mfyc3", R = "crk-drawerHeadRow-w-lfX", V = "crk-methodBadge-lfL4x", X = "crk-statusBadge-XiUl9", I = "crk-statusPending-Yg9At", U = "crk-statusError-G7XH8", G = "crk-drawerRoute-L-hK0", O = "crk-drawerSpacer-f6nIh", Q = "crk-drawerUrl-ajRgO", f = "crk-drawerRid-UsUb1", F = "crk-drawerXrid-JEUOj", Z = "crk-drawerTiming-FCpcS", N = "crk-drawerBody-Cx5-E", q = "crk-drawerSection-Zjpm1", J = "crk-kvRow-DXfXI", j = "crk-kvKey-MmSqV", W = "crk-kvKeyQuery-0hpds", Y = "crk-kvVal-PlEQT", z = "crk-awaiting-FNO2u", _ = "crk-awaitingDot-b4OtX", $ = "crk-dockAside-Q-I1l", rr = "crk-dockHead-kyJbl", cr = "crk-dockTitle-aZfap", or = "crk-dockCount-sTZG3", ar = "crk-dockScroll-EbMO5", er = "crk-dockEmpty-4I13b", tr = "crk-bodyHead-IAsVD", ir = "crk-bodyLabel-QeGYK", sr = "crk-payloadCopy-5FM-J", nr = "crk-copyStop-aE-Th", lr = "crk-logAside-Nmqov", dr = "crk-logBody-X2Ftb", kr = "crk-logEntry-eASJr", gr = "crk-logEntrySelected-AdHlH", pr = "crk-logEntryFlash-26ElD", yr = "crk-logTop-48t09", wr = "crk-logNum-1-eb7", xr = "crk-badgeSm-vw04n", br = "crk-logPair-i-P-t", hr = "crk-logClock-mrTdy", mr = "crk-logOp-qfkTp", ur = "crk-logPath-eHd2Z", Lr = "crk-logPayloadHead-jKUKx", vr = "crk-logPayloadLabel-wteWa", Sr = "crk-logPre-8h-ke", Tr = "crk-rail-IIJaP", Pr = "crk-railBtn-WNtG7", Br = "crk-railBtnActive-HnV74", Er = "crk-railGlyphDetails-h8Ip-", Hr = "crk-railGlyphLog-auInm", Cr = {
2
- scroller: r,
1
+ const o = "crk-scroller-kwWVy", c = "crk-inner-vJ0BK", r = "crk-gridline-pcX-9", e = "crk-nowLine-05lmp", a = "crk-cursorLine-k7KZo", t = "crk-eventLine-znElH", s = "crk-axis--LqeF", i = "crk-axisDivider-gBKss", n = "crk-axisSticky-J-rsF", l = "crk-axisUtc-ySg72", d = "crk-axisViewDate-oRqHL", k = "crk-axisViewTime-bL50a", g = "crk-axisTickLabel-9V7QB", p = "crk-axisDateLabel-QPPf7", y = "crk-axisTickMark-HGAZI", w = "crk-axisSubLabel-mmUpt", h = "crk-axisMinorMark-LmQdS", x = "crk-axisMinorMedium-yyNB-", b = "crk-axisChip-Xr9r0", u = "crk-axisChipEvent-K9r-4", L = "crk-lane-hvtL1", m = "crk-axisLine-ZRK0p", P = "crk-bar-pqjsX", v = "crk-barPending-NsYu7", f = "crk-barDot-ZtYdm", S = "crk-stem-24Ud2", C = "crk-elbow-nQxQZ", T = "crk-chip-vC8yf", B = "crk-chipArrow-pyTpt", E = "crk-chipBadge-Tz11H", H = "crk-chipOp-qkIIM", M = "crk-chipTime-IoXbi", D = "crk-drawerCustom-w5gWa", F = "crk-drawerHead-mfyc3", V = "crk-drawerHeadRow-w-lfX", R = "crk-methodBadge-lfL4x", A = "crk-statusBadge-XiUl9", K = "crk-statusPending-Yg9At", I = "crk-statusError-G7XH8", Q = "crk-statusWarn-iYFhY", G = "crk-drawerRoute-L-hK0", N = "crk-drawerSpacer-f6nIh", X = "crk-fieldList-AvAgH", O = "crk-field-4QFFP", U = "crk-headFields-eHFIf", Z = "crk-bodyHead-IAsVD", q = "crk-fieldLabel-GVRma", J = "crk-fieldValue-OzPQ8", W = "crk-fieldMono-pdJaC", z = "crk-fieldPre-2nolU", Y = "crk-emptyNote-VTNmM", j = "crk-drawerBody-Cx5-E", _ = "crk-drawerSection-Zjpm1", $ = "crk-kvRow-DXfXI", oo = "crk-kvKey-MmSqV", co = "crk-kvKeyQuery-0hpds", ro = "crk-kvVal-PlEQT", eo = "crk-awaiting-FNO2u", ao = "crk-awaitingDot-b4OtX", to = "crk-dockCol-4dgEp", so = "crk-dockColResizer-qUAce", io = "crk-cardFlushRight-QGTEx", no = "crk-dockAside-Q-I1l", lo = "crk-dockHead-kyJbl", ko = "crk-dockTitle-aZfap", go = "crk-dockCount-sTZG3", po = "crk-dockScroll-EbMO5", yo = "crk-dockEmpty-4I13b", wo = "crk-bodyLabel-QeGYK", ho = "crk-payloadCopy-5FM-J", xo = "crk-logEntry-eASJr", bo = "crk-copyStop-aE-Th", uo = "crk-logBody-X2Ftb", Lo = "crk-logEntrySelected-AdHlH", mo = "crk-logEntryFlash-26ElD", Po = "crk-logTop-48t09", vo = "crk-logNum-1-eb7", fo = "crk-badgeSm-vw04n", So = "crk-logPair-i-P-t", Co = "crk-logClock-mrTdy", To = "crk-logOp-qfkTp", Bo = "crk-logPath-eHd2Z", Eo = "crk-logMessage-t7B7v", Ho = "crk-logFields-newk5", Mo = "crk-logPayloadHead-jKUKx", Do = "crk-logPayloadLabel-wteWa", Fo = "crk-logPre-8h-ke", Vo = "crk-rail-IIJaP", Ro = "crk-railBtn-WNtG7", Ao = "crk-railBtnActive-HnV74", Ko = "crk-railGlyphDetails-h8Ip-", Io = "crk-railGlyphLog-auInm", Qo = {
2
+ scroller: o,
3
3
  inner: c,
4
- gridline: o,
5
- nowLine: a,
6
- cursorLine: e,
4
+ gridline: r,
5
+ nowLine: e,
6
+ cursorLine: a,
7
7
  eventLine: t,
8
- axis: i,
9
- axisDivider: s,
8
+ axis: s,
9
+ axisDivider: i,
10
10
  axisSticky: n,
11
11
  axisUtc: l,
12
12
  axisViewDate: d,
@@ -15,85 +15,94 @@ const r = "crk-scroller-kwWVy", c = "crk-inner-vJ0BK", o = "crk-gridline-pcX-9",
15
15
  axisDateLabel: p,
16
16
  axisTickMark: y,
17
17
  axisSubLabel: w,
18
- axisMinorMark: x,
19
- axisMinorMedium: b,
20
- axisChip: h,
21
- axisChipEvent: m,
22
- lane: u,
23
- axisLine: L,
24
- bar: v,
25
- barPending: S,
26
- barDot: T,
27
- stem: P,
28
- elbow: B,
29
- chip: E,
30
- chipArrow: H,
31
- chipBadge: C,
32
- chipOp: D,
18
+ axisMinorMark: h,
19
+ axisMinorMedium: x,
20
+ axisChip: b,
21
+ axisChipEvent: u,
22
+ lane: L,
23
+ axisLine: m,
24
+ bar: P,
25
+ barPending: v,
26
+ barDot: f,
27
+ stem: S,
28
+ elbow: C,
29
+ chip: T,
30
+ chipArrow: B,
31
+ chipBadge: E,
32
+ chipOp: H,
33
33
  chipTime: M,
34
- drawerCustom: A,
35
- drawerHead: K,
36
- drawerHeadRow: R,
37
- methodBadge: V,
38
- statusBadge: X,
39
- statusPending: I,
40
- statusError: U,
34
+ drawerCustom: D,
35
+ drawerHead: F,
36
+ drawerHeadRow: V,
37
+ methodBadge: R,
38
+ statusBadge: A,
39
+ statusPending: K,
40
+ statusError: I,
41
+ statusWarn: Q,
41
42
  drawerRoute: G,
42
- drawerSpacer: O,
43
- drawerUrl: Q,
44
- drawerRid: f,
45
- drawerXrid: F,
46
- drawerTiming: Z,
47
- drawerBody: N,
48
- drawerSection: q,
49
- kvRow: J,
50
- kvKey: j,
51
- kvKeyQuery: W,
52
- kvVal: Y,
53
- awaiting: z,
54
- awaitingDot: _,
55
- dockAside: $,
56
- dockHead: rr,
57
- dockTitle: cr,
58
- dockCount: or,
59
- dockScroll: ar,
60
- dockEmpty: er,
61
- bodyHead: tr,
62
- bodyLabel: ir,
63
- payloadCopy: sr,
64
- copyStop: nr,
65
- logAside: lr,
66
- logBody: dr,
67
- logEntry: kr,
68
- logEntrySelected: gr,
69
- logEntryFlash: pr,
70
- logTop: yr,
71
- logNum: wr,
72
- badgeSm: xr,
73
- logPair: br,
74
- logClock: hr,
75
- logOp: mr,
76
- logPath: ur,
77
- logPayloadHead: Lr,
78
- logPayloadLabel: vr,
79
- logPre: Sr,
80
- rail: Tr,
81
- railBtn: Pr,
82
- railBtnActive: Br,
83
- railGlyphDetails: Er,
84
- railGlyphLog: Hr
43
+ drawerSpacer: N,
44
+ fieldList: X,
45
+ field: O,
46
+ headFields: U,
47
+ bodyHead: Z,
48
+ fieldLabel: q,
49
+ fieldValue: J,
50
+ fieldMono: W,
51
+ fieldPre: z,
52
+ emptyNote: Y,
53
+ drawerBody: j,
54
+ drawerSection: _,
55
+ kvRow: $,
56
+ kvKey: oo,
57
+ kvKeyQuery: co,
58
+ kvVal: ro,
59
+ awaiting: eo,
60
+ awaitingDot: ao,
61
+ dockCol: to,
62
+ dockColResizer: so,
63
+ cardFlushRight: io,
64
+ dockAside: no,
65
+ dockHead: lo,
66
+ dockTitle: ko,
67
+ dockCount: go,
68
+ dockScroll: po,
69
+ dockEmpty: yo,
70
+ bodyLabel: wo,
71
+ payloadCopy: ho,
72
+ logEntry: xo,
73
+ copyStop: bo,
74
+ logBody: uo,
75
+ logEntrySelected: Lo,
76
+ logEntryFlash: mo,
77
+ logTop: Po,
78
+ logNum: vo,
79
+ badgeSm: fo,
80
+ logPair: So,
81
+ logClock: Co,
82
+ logOp: To,
83
+ logPath: Bo,
84
+ logMessage: Eo,
85
+ logFields: Ho,
86
+ logPayloadHead: Mo,
87
+ logPayloadLabel: Do,
88
+ logPre: Fo,
89
+ rail: Vo,
90
+ railBtn: Ro,
91
+ railBtnActive: Ao,
92
+ railGlyphDetails: Ko,
93
+ railGlyphLog: Io
85
94
  };
86
95
  export {
87
- z as awaiting,
88
- _ as awaitingDot,
89
- i as axis,
90
- h as axisChip,
91
- m as axisChipEvent,
96
+ eo as awaiting,
97
+ ao as awaitingDot,
98
+ s as axis,
99
+ b as axisChip,
100
+ u as axisChipEvent,
92
101
  p as axisDateLabel,
93
- s as axisDivider,
94
- L as axisLine,
95
- x as axisMinorMark,
96
- b as axisMinorMedium,
102
+ i as axisDivider,
103
+ m as axisLine,
104
+ h as axisMinorMark,
105
+ x as axisMinorMedium,
97
106
  n as axisSticky,
98
107
  w as axisSubLabel,
99
108
  g as axisTickLabel,
@@ -101,71 +110,80 @@ export {
101
110
  l as axisUtc,
102
111
  d as axisViewDate,
103
112
  k as axisViewTime,
104
- xr as badgeSm,
105
- v as bar,
106
- T as barDot,
107
- S as barPending,
108
- tr as bodyHead,
109
- ir as bodyLabel,
110
- E as chip,
111
- H as chipArrow,
112
- C as chipBadge,
113
- D as chipOp,
113
+ fo as badgeSm,
114
+ P as bar,
115
+ f as barDot,
116
+ v as barPending,
117
+ Z as bodyHead,
118
+ wo as bodyLabel,
119
+ io as cardFlushRight,
120
+ T as chip,
121
+ B as chipArrow,
122
+ E as chipBadge,
123
+ H as chipOp,
114
124
  M as chipTime,
115
- nr as copyStop,
116
- e as cursorLine,
117
- Cr as default,
118
- $ as dockAside,
119
- or as dockCount,
120
- er as dockEmpty,
121
- rr as dockHead,
122
- ar as dockScroll,
123
- cr as dockTitle,
124
- N as drawerBody,
125
- A as drawerCustom,
126
- K as drawerHead,
127
- R as drawerHeadRow,
128
- f as drawerRid,
125
+ bo as copyStop,
126
+ a as cursorLine,
127
+ Qo as default,
128
+ no as dockAside,
129
+ to as dockCol,
130
+ so as dockColResizer,
131
+ go as dockCount,
132
+ yo as dockEmpty,
133
+ lo as dockHead,
134
+ po as dockScroll,
135
+ ko as dockTitle,
136
+ j as drawerBody,
137
+ D as drawerCustom,
138
+ F as drawerHead,
139
+ V as drawerHeadRow,
129
140
  G as drawerRoute,
130
- q as drawerSection,
131
- O as drawerSpacer,
132
- Z as drawerTiming,
133
- Q as drawerUrl,
134
- F as drawerXrid,
135
- B as elbow,
141
+ _ as drawerSection,
142
+ N as drawerSpacer,
143
+ C as elbow,
144
+ Y as emptyNote,
136
145
  t as eventLine,
137
- o as gridline,
146
+ O as field,
147
+ q as fieldLabel,
148
+ X as fieldList,
149
+ W as fieldMono,
150
+ z as fieldPre,
151
+ J as fieldValue,
152
+ r as gridline,
153
+ U as headFields,
138
154
  c as inner,
139
- j as kvKey,
140
- W as kvKeyQuery,
141
- J as kvRow,
142
- Y as kvVal,
143
- u as lane,
144
- lr as logAside,
145
- dr as logBody,
146
- hr as logClock,
147
- kr as logEntry,
148
- pr as logEntryFlash,
149
- gr as logEntrySelected,
150
- wr as logNum,
151
- mr as logOp,
152
- br as logPair,
153
- ur as logPath,
154
- Lr as logPayloadHead,
155
- vr as logPayloadLabel,
156
- Sr as logPre,
157
- yr as logTop,
158
- V as methodBadge,
159
- a as nowLine,
160
- sr as payloadCopy,
161
- Tr as rail,
162
- Pr as railBtn,
163
- Br as railBtnActive,
164
- Er as railGlyphDetails,
165
- Hr as railGlyphLog,
166
- r as scroller,
167
- X as statusBadge,
168
- U as statusError,
169
- I as statusPending,
170
- P as stem
155
+ oo as kvKey,
156
+ co as kvKeyQuery,
157
+ $ as kvRow,
158
+ ro as kvVal,
159
+ L as lane,
160
+ uo as logBody,
161
+ Co as logClock,
162
+ xo as logEntry,
163
+ mo as logEntryFlash,
164
+ Lo as logEntrySelected,
165
+ Ho as logFields,
166
+ Eo as logMessage,
167
+ vo as logNum,
168
+ To as logOp,
169
+ So as logPair,
170
+ Bo as logPath,
171
+ Mo as logPayloadHead,
172
+ Do as logPayloadLabel,
173
+ Fo as logPre,
174
+ Po as logTop,
175
+ R as methodBadge,
176
+ e as nowLine,
177
+ ho as payloadCopy,
178
+ Vo as rail,
179
+ Ro as railBtn,
180
+ Ao as railBtnActive,
181
+ Ko as railGlyphDetails,
182
+ Io as railGlyphLog,
183
+ o as scroller,
184
+ A as statusBadge,
185
+ I as statusError,
186
+ K as statusPending,
187
+ Q as statusWarn,
188
+ S as stem
171
189
  };
@@ -9,6 +9,20 @@ export interface DemoManifest {
9
9
  events: TraceTimelineEvent[];
10
10
  }
11
11
  export declare function sampleManifests(): DemoManifest[];
12
+ export interface DemoTrace {
13
+ title: string;
14
+ services: string[];
15
+ events: TraceTimelineEvent[];
16
+ }
17
+ /**
18
+ * Order lifecycle: no HTTP anywhere — every entry is a domain event carrying
19
+ * a message, and some a payload, a level or extra labeled fields.
20
+ */
21
+ export declare function plainEventTrace(): DemoTrace;
22
+ /** The minimal case: events that carry nothing but a `payload`. */
23
+ export declare function payloadOnlyTrace(): DemoTrace;
24
+ /** Requests and domain events on the same band. */
25
+ export declare function mixedTrace(): DemoTrace;
12
26
  export interface SimStep {
13
27
  at: number;
14
28
  ev: Record<string, unknown>;
@@ -1,6 +1,11 @@
1
1
  export type { TimelineSummaryPlacement } from './TimelineShared';
2
+ export type { TimelineWheelZoom } from './useTimeline';
2
3
  export { TraceTimeline } from './TraceTimeline';
3
- export type { TraceTimelineProps, TraceTimelineEvent, TraceTimelineClasses, TraceTimelineDock, TraceTimelineItemContext, } from './TraceTimeline';
4
+ export type { TraceTimelineProps, TraceTimelineEvent, TraceTimelineField, TraceTimelineLevel, TraceTimelineClasses, TraceTimelineDock, TraceTimelineItemContext, } from './TraceTimeline';
5
+ export { TraceEventDetails } from './TraceEventDetails';
6
+ export type { TraceEventDetailsProps, TraceEventDetailsClasses } from './TraceEventDetails';
7
+ export { isRequestEvent, badgeOf, extraFieldsOf } from './traceEvent';
8
+ export type { TraceBadgeTone } from './traceEvent';
4
9
  export { HistoryTimeline } from './HistoryTimeline';
5
10
  export type { HistoryTimelineProps, HistoryTimelineEvent, HistoryTimelineClasses, HistoryTimelineOrientation, HistoryTimelineSpacing, HistoryTimelineItemContext, } from './HistoryTimeline';
6
11
  export { GanttTimeline } from './GanttTimeline';
@@ -62,9 +62,10 @@ export interface HighlightPart {
62
62
  export declare function highlightParts(text: unknown, q: string | undefined): HighlightPart[];
63
63
  /**
64
64
  * Keyword match: case-insensitive AND over whitespace-separated tokens against
65
- * the JSON serialization of the event.
65
+ * the JSON serialization of the event. Top-level keys in `omit` are excluded
66
+ * from the haystack (hidden plumbing fields shouldn't attract highlights).
66
67
  */
67
- export declare function eventMatches(ev: unknown, q: string | undefined): boolean;
68
+ export declare function eventMatches(ev: unknown, q: string | undefined, omit?: readonly string[]): boolean;
68
69
  /**
69
70
  * Fuzzy score for pickers: each token scores by substring position (best) or
70
71
  * character subsequence (weak); a token that matches neither zeroes the score.
@@ -1,31 +1,31 @@
1
- const O = 1e3, U = 6e4, N = 36e5, S = 864e5, c = (t) => String(t).padStart(2, "0"), A = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
1
+ const O = 1e3, U = 6e4, N = 36e5, S = 864e5, l = (t) => String(t).padStart(2, "0"), A = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2
2
  function u(t, e) {
3
3
  const n = new Date(t);
4
- return c(n.getHours()) + ":" + c(n.getMinutes()) + ":" + c(n.getSeconds()) + (e ? "." + String(n.getMilliseconds()).padStart(3, "0") : "");
4
+ return l(n.getHours()) + ":" + l(n.getMinutes()) + ":" + l(n.getSeconds()) + (e ? "." + String(n.getMilliseconds()).padStart(3, "0") : "");
5
5
  }
6
6
  function s(t) {
7
7
  const e = new Date(t);
8
8
  return A[e.getMonth()] + " " + e.getDate();
9
9
  }
10
- function C(t) {
10
+ function d(t) {
11
11
  const e = new Date(t).getFullYear(), n = e !== (/* @__PURE__ */ new Date()).getFullYear();
12
12
  return n && Date.now() - t > 2 * 365 * 864e5 ? s(t) + " " + e : s(t) + (n ? " " + e : "") + " · " + u(t);
13
13
  }
14
- function Y(t, e) {
14
+ function h(t, e) {
15
15
  const n = new Date(t);
16
- return c(n.getUTCHours()) + ":" + c(n.getUTCMinutes()) + ":" + c(n.getUTCSeconds()) + (e ? "." + String(n.getUTCMilliseconds()).padStart(3, "0") : "");
16
+ return l(n.getUTCHours()) + ":" + l(n.getUTCMinutes()) + ":" + l(n.getUTCSeconds()) + (e ? "." + String(n.getUTCMilliseconds()).padStart(3, "0") : "");
17
17
  }
18
- function h(t) {
18
+ function Y(t) {
19
19
  const e = new Date(t);
20
- return e.getUTCFullYear() + "-" + c(e.getUTCMonth() + 1) + "-" + c(e.getUTCDate());
20
+ return e.getUTCFullYear() + "-" + l(e.getUTCMonth() + 1) + "-" + l(e.getUTCDate());
21
21
  }
22
- function M(t, e) {
23
- return h(t) + "T" + Y(t, e) + "Z";
22
+ function g(t, e) {
23
+ return Y(t) + "T" + h(t, e) + "Z";
24
24
  }
25
- function d(t) {
25
+ function C(t) {
26
26
  return t == null ? "" : t < 1e3 ? Math.round(t) + "ms" : t < 6e4 ? (t / 1e3).toFixed(t < 10 * 1e3 ? 1 : 0) + "s" : t < 36e5 ? Math.floor(t / 6e4) + "m " + Math.round(t % 6e4 / 1e3) + "s" : t < 2 * 864e5 ? Math.floor(t / 36e5) + "h " + Math.round(t % 36e5 / 6e4) + "m" : t < 365 * 864e5 ? (t / 864e5).toFixed(1) + "d" : (t / (365.25 * 864e5)).toFixed(t < 3650 * 864e5 ? 1 : 0) + "y";
27
27
  }
28
- const l = [
28
+ const D = [
29
29
  1,
30
30
  2,
31
31
  5,
@@ -112,42 +112,47 @@ const l = [
112
112
  [91311 * 864e5, [5, 0]],
113
113
  [182625 * 864e5, [5, 0]]
114
114
  ]);
115
- function g(t) {
115
+ function M(t) {
116
116
  const e = E.get(t) || [4, 0];
117
117
  return { parts: e[0], medium: e[1] };
118
118
  }
119
- function T(t, e, n, a) {
120
- a = a || 88;
121
- const D = Math.max(1, e - t), r = l.find((f) => f / D * n >= a) || l[l.length - 1], o = [];
119
+ function T(t, e, n, o) {
120
+ o = o || 88;
121
+ const a = Math.max(1, e - t), r = D.find((f) => f / a * n >= o) || D[D.length - 1], c = [];
122
122
  let i = Math.ceil(t / r) * r;
123
123
  for (; i <= e; i += r)
124
- o.push({ t: i, label: r >= 864e5 ? s(i) : u(i, r < 1e3) });
125
- return { step: r, list: o };
124
+ c.push({ t: i, label: r >= 864e5 ? s(i) : u(i, r < 1e3) });
125
+ return { step: r, list: c };
126
126
  }
127
127
  function I(t, e) {
128
128
  const n = String(t ?? "");
129
129
  if (e = (e || "").trim(), !e) return [{ t: n, hit: !1 }];
130
- const a = e.toLowerCase(), D = n.toLowerCase(), r = [];
131
- let o = 0;
130
+ const o = e.toLowerCase(), a = n.toLowerCase(), r = [];
131
+ let c = 0;
132
132
  for (; ; ) {
133
- const i = D.indexOf(a, o);
133
+ const i = a.indexOf(o, c);
134
134
  if (i < 0) {
135
- o < n.length && r.push({ t: n.slice(o), hit: !1 });
135
+ c < n.length && r.push({ t: n.slice(c), hit: !1 });
136
136
  break;
137
137
  }
138
- i > o && r.push({ t: n.slice(o, i), hit: !1 }), r.push({ t: n.slice(i, i + e.length), hit: !0 }), o = i + e.length;
138
+ i > c && r.push({ t: n.slice(c, i), hit: !1 }), r.push({ t: n.slice(i, i + e.length), hit: !0 }), c = i + e.length;
139
139
  }
140
140
  return r.length ? r : [{ t: n, hit: !1 }];
141
141
  }
142
- function k(t, e) {
142
+ function k(t, e, n) {
143
143
  if (e = (e || "").trim(), !e) return !0;
144
- let n;
144
+ if (n?.length && t !== null && typeof t == "object" && !Array.isArray(t)) {
145
+ const a = { ...t };
146
+ for (const r of n) delete a[r];
147
+ t = a;
148
+ }
149
+ let o;
145
150
  try {
146
- n = JSON.stringify(t).toLowerCase();
151
+ o = JSON.stringify(t).toLowerCase();
147
152
  } catch {
148
- n = String(t).toLowerCase();
153
+ o = String(t).toLowerCase();
149
154
  }
150
- return e.toLowerCase().split(/\s+/).filter(Boolean).every((a) => n.includes(a));
155
+ return e.toLowerCase().split(/\s+/).filter(Boolean).every((a) => o.includes(a));
151
156
  }
152
157
  const H = [
153
158
  "var(--crk-timeline-1, #0e7568)",
@@ -160,7 +165,7 @@ const H = [
160
165
  function R(t, e) {
161
166
  return `color-mix(in srgb, ${t} ${e}%, white)`;
162
167
  }
163
- const m = {
168
+ const b = {
164
169
  body: "var(--crk-timeline-body, #3b352f)",
165
170
  stem: "var(--crk-timeline-stem, #c9c1b5)",
166
171
  stemHot: "var(--crk-timeline-stem-hot, #8a8175)",
@@ -175,19 +180,19 @@ export {
175
180
  N as HOUR,
176
181
  U as MINUTE,
177
182
  O as SECOND,
178
- l as TICK_STEPS,
183
+ D as TICK_STEPS,
179
184
  H as TIMELINE_PALETTE_VARS,
180
- m as TL_COLORS,
185
+ b as TL_COLORS,
181
186
  k as eventMatches,
182
187
  u as fmtClock,
183
- Y as fmtClockUTC,
188
+ h as fmtClockUTC,
184
189
  s as fmtDate,
185
- h as fmtDateISO,
186
- C as fmtDateTime,
187
- d as fmtDur,
188
- M as fmtISO,
190
+ Y as fmtDateISO,
191
+ d as fmtDateTime,
192
+ C as fmtDur,
193
+ g as fmtISO,
189
194
  I as highlightParts,
190
- g as tickSubdiv,
195
+ M as tickSubdiv,
191
196
  T as ticks,
192
197
  R as tint
193
198
  };
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The trace event model shared by TraceTimeline and TraceEventDetails, plus
3
+ * the pure helpers that decide how much of an event is renderable. Kept apart
4
+ * from both components so neither has to import the other.
5
+ */
6
+ /**
7
+ * Severity/outcome of a non-request event. Colors the detail-panel and
8
+ * full-log badge the way `status` does for requests.
9
+ */
10
+ export type TraceTimelineLevel = 'debug' | 'info' | 'success' | 'warning' | 'error';
11
+ /**
12
+ * One labeled value in the detail panel — the label is rendered above the
13
+ * value, and values stack vertically (never side by side).
14
+ */
15
+ export interface TraceTimelineField {
16
+ /** Uppercase micro-label rendered above the value. */
17
+ label: string;
18
+ /**
19
+ * The value. Strings/numbers/booleans render inline (keyword-highlighted),
20
+ * React elements render as-is, anything else is pretty-printed as JSON in a
21
+ * copyable block.
22
+ */
23
+ value: unknown;
24
+ /** Monospace the value. @default true */
25
+ mono?: boolean;
26
+ /** Add a copy button beside the label (always on for JSON blocks). */
27
+ copy?: boolean;
28
+ }
29
+ /**
30
+ * One event on the trace. Only `id`, `service` and `start` are required —
31
+ * everything else enriches the chip, tooltip and detail panel *when present*,
32
+ * so a plain lifecycle/audit event (no method, no status, no bodies) renders
33
+ * as cleanly as a full HTTP call: sections with nothing behind them are
34
+ * skipped rather than shown empty. Extra fields are allowed, participate in
35
+ * keyword matching and are listed under *Other fields* in the detail panel.
36
+ */
37
+ export interface TraceTimelineEvent {
38
+ /** Stable identifier. */
39
+ id: string;
40
+ /** Target component/service the event belongs to (colors the bar). */
41
+ service: string;
42
+ /**
43
+ * Caller shown as the chip's origin badge. Defaults to `'client'` for
44
+ * request-like events and to nothing for plain events (the chip then shows
45
+ * the service alone).
46
+ */
47
+ source?: string;
48
+ /** Friendly operation id, bold in the chip (e.g. `create_manifest`). */
49
+ op?: string;
50
+ /**
51
+ * How the event is rendered. Inferred when omitted: `'request'` as soon as
52
+ * any of `method`/`url`/`status`/`query`/`reqHeaders`/`reqBody`/
53
+ * `resHeaders`/`resBody` is set, `'event'` otherwise. Request events get
54
+ * the Request/Response sections and the in-flight "Awaiting response…"
55
+ * state; plain events get Message/Payload/Details instead.
56
+ */
57
+ kind?: 'request' | 'event';
58
+ /** Severity badge for plain events (requests use `status` instead). */
59
+ level?: TraceTimelineLevel;
60
+ /** One-line human description (detail panel + full log). */
61
+ message?: string;
62
+ /**
63
+ * Generic body for events that aren't requests — pretty-printed as JSON
64
+ * (strings render verbatim) under a *Payload* heading with a copy button.
65
+ * Requests should use `reqBody`/`resBody`; an event may use `payload`
66
+ * alone and nothing else.
67
+ */
68
+ payload?: unknown;
69
+ /**
70
+ * Extra labeled values for the detail panel and full log, in order. Each
71
+ * renders label-above-value; object values become copyable JSON blocks.
72
+ */
73
+ details?: TraceTimelineField[];
74
+ /** Technical request id (fallback chip label; shown in the detail panel). */
75
+ requestId?: string;
76
+ /** HTTP method for the detail panel badge. */
77
+ method?: string;
78
+ /** Full URL (detail panel + tooltip). */
79
+ url?: string;
80
+ /** Short label for the tooltip. Defaults to `method + path`. */
81
+ label?: string;
82
+ /** Query parameters (detail panel). */
83
+ query?: Record<string, string>;
84
+ /** Request headers (detail panel; `x-request-id` is surfaced). */
85
+ reqHeaders?: Record<string, string>;
86
+ /** Request body, pretty-printed as JSON in the detail panel. */
87
+ reqBody?: unknown;
88
+ /** Response status; `>= 400` renders as an error badge. */
89
+ status?: number;
90
+ /** Response headers (detail panel). */
91
+ resHeaders?: Record<string, string>;
92
+ /** Response body, pretty-printed as JSON in the detail panel. */
93
+ resBody?: unknown;
94
+ /** Start time, epoch ms (UTC display). */
95
+ start: number;
96
+ /** End time, epoch ms. `null`/`undefined` while in flight (bar grows live). */
97
+ end?: number | null;
98
+ [extra: string]: unknown;
99
+ }
100
+ /** Fields the panel renders itself — everything else lands in *Other fields*. */
101
+ export declare const KNOWN_KEYS: Set<string>;
102
+ /** Whether the event should render the Request/Response sections. */
103
+ export declare const isRequestEvent: (e: TraceTimelineEvent) => boolean;
104
+ /** Chip/log headline: operation id, falling back to request ids, then `id`. */
105
+ export declare const ridOf: (e: TraceTimelineEvent) => string;
106
+ /**
107
+ * Origin badge. Requests keep the implicit `client` caller; plain events show
108
+ * no origin at all unless one was given.
109
+ */
110
+ export declare const srcOf: (e: TraceTimelineEvent) => string;
111
+ /** `origin → target`, or the target alone when there is no origin. */
112
+ export declare const routeOf: (e: TraceTimelineEvent) => string;
113
+ /** Values rendered inline rather than as a JSON block. */
114
+ export declare const isInline: (v: unknown) => v is string | number | boolean;
115
+ /** Pretty-print for payload blocks; strings are shown verbatim. */
116
+ export declare const toText: (v: unknown) => string;
117
+ export type TraceBadgeTone = 'ok' | 'pending' | 'warn' | 'error';
118
+ /** Badge shown beside the method: status for requests, level for events. */
119
+ export declare function badgeOf(e: TraceTimelineEvent, pending: boolean): {
120
+ text: string;
121
+ tone: TraceBadgeTone;
122
+ } | null;
123
+ /**
124
+ * Extra (unknown) event keys as labeled fields, in insertion order. Keys in
125
+ * `hidden` are skipped — for plumbing values that ride along on the event but
126
+ * shouldn't be displayed.
127
+ */
128
+ export declare function extraFieldsOf(e: TraceTimelineEvent, hidden?: readonly string[]): TraceTimelineField[];