@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,213 +1,286 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as h, Fragment as L, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useState as D, useEffect as S } from "react";
|
|
3
|
+
import c from "clsx";
|
|
4
4
|
import e from "./Timeline.module.scss.js";
|
|
5
|
-
import { highlightParts as
|
|
6
|
-
import { Draggable as
|
|
7
|
-
function
|
|
8
|
-
items:
|
|
9
|
-
className:
|
|
5
|
+
import { highlightParts as Z } from "./timelineCore.js";
|
|
6
|
+
import { Draggable as E } from "../Draggable/Draggable.js";
|
|
7
|
+
function G({
|
|
8
|
+
items: o,
|
|
9
|
+
className: s
|
|
10
10
|
}) {
|
|
11
|
-
return
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
] },
|
|
11
|
+
return o.length ? /* @__PURE__ */ t("div", { className: c(e.legend, s), children: o.map((a) => /* @__PURE__ */ h("span", { className: e.legendItem, children: [
|
|
12
|
+
/* @__PURE__ */ t("span", { className: e.legendDot, style: { background: a.color } }),
|
|
13
|
+
a.name
|
|
14
|
+
] }, a.name)) }) : null;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
zoomPct:
|
|
18
|
-
fitActive:
|
|
19
|
-
onZoomIn:
|
|
20
|
-
onZoomOut:
|
|
16
|
+
function J({
|
|
17
|
+
zoomPct: o,
|
|
18
|
+
fitActive: s,
|
|
19
|
+
onZoomIn: a,
|
|
20
|
+
onZoomOut: r,
|
|
21
21
|
onFit: i,
|
|
22
|
-
hint:
|
|
23
|
-
children:
|
|
24
|
-
className:
|
|
22
|
+
hint: p,
|
|
23
|
+
children: b,
|
|
24
|
+
className: f
|
|
25
25
|
}) {
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ h("div", { className: c(e.controls, f), children: [
|
|
27
|
+
b,
|
|
28
|
+
/* @__PURE__ */ t("button", { type: "button", className: e.zoomBtn, title: "Zoom out", onClick: r, children: "−" }),
|
|
29
|
+
/* @__PURE__ */ t("span", { className: e.zoomPct, children: o }),
|
|
30
|
+
/* @__PURE__ */ t("button", { type: "button", className: e.zoomBtn, title: "Zoom in", onClick: a, children: "+" }),
|
|
31
|
+
/* @__PURE__ */ t(
|
|
32
32
|
"button",
|
|
33
33
|
{
|
|
34
34
|
type: "button",
|
|
35
|
-
className:
|
|
35
|
+
className: c(e.fitBtn, s && e.fitBtnActive),
|
|
36
36
|
onClick: i,
|
|
37
37
|
children: "Fit"
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
|
|
40
|
+
p ? /* @__PURE__ */ t("span", { className: e.controlsHint, children: p }) : null
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
value:
|
|
45
|
-
options:
|
|
46
|
-
onChange:
|
|
43
|
+
function Q({
|
|
44
|
+
value: o,
|
|
45
|
+
options: s,
|
|
46
|
+
onChange: a
|
|
47
47
|
}) {
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ t("div", { className: e.segmented, children: s.map((r) => /* @__PURE__ */ t(
|
|
49
49
|
"button",
|
|
50
50
|
{
|
|
51
51
|
type: "button",
|
|
52
|
-
title:
|
|
53
|
-
className:
|
|
54
|
-
onClick: () =>
|
|
55
|
-
children:
|
|
52
|
+
title: r.title,
|
|
53
|
+
className: c(e.segmentedBtn, r.value === o && e.segmentedBtnActive),
|
|
54
|
+
onClick: () => a(r.value),
|
|
55
|
+
children: r.label
|
|
56
56
|
},
|
|
57
|
-
|
|
57
|
+
r.value
|
|
58
58
|
)) });
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
function j({
|
|
61
|
+
panel: o,
|
|
62
|
+
width: s,
|
|
63
|
+
min: a,
|
|
64
|
+
max: r,
|
|
65
|
+
onResize: i,
|
|
66
|
+
label: p,
|
|
67
|
+
className: b
|
|
68
|
+
}) {
|
|
69
|
+
const f = T(null), [y, B] = D(!1), g = T(s);
|
|
70
|
+
g.current = s;
|
|
71
|
+
const u = (l) => Math.min(r, Math.max(a, l));
|
|
72
|
+
return S(() => {
|
|
73
|
+
if (!y) return;
|
|
74
|
+
const l = (P) => {
|
|
75
|
+
const k = f.current;
|
|
76
|
+
if (!k) return;
|
|
77
|
+
const v = P.clientX - k.x;
|
|
78
|
+
i(Math.min(r, Math.max(a, k.w + (o === "left" ? v : -v))));
|
|
79
|
+
}, d = () => {
|
|
80
|
+
f.current = null, B(!1);
|
|
81
|
+
};
|
|
82
|
+
return window.addEventListener("pointermove", l), window.addEventListener("pointerup", d), () => {
|
|
83
|
+
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", d);
|
|
84
|
+
};
|
|
85
|
+
}, [y, o, a, r, i]), /* @__PURE__ */ t(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: c(e.dockResizer, y && e.dockResizerActive, b),
|
|
89
|
+
role: "separator",
|
|
90
|
+
"aria-orientation": "vertical",
|
|
91
|
+
"aria-label": p,
|
|
92
|
+
tabIndex: 0,
|
|
93
|
+
onPointerDown: (l) => {
|
|
94
|
+
l.button > 0 || (l.preventDefault(), f.current = { x: l.clientX, w: g.current }, B(!0));
|
|
95
|
+
},
|
|
96
|
+
onKeyDown: (l) => {
|
|
97
|
+
const d = l.key === "ArrowLeft" ? -16 : l.key === "ArrowRight" ? 16 : 0;
|
|
98
|
+
d && (l.preventDefault(), i(u(g.current + (o === "left" ? d : -d))));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function Y({
|
|
104
|
+
heading: o = "Events",
|
|
105
|
+
items: s,
|
|
106
|
+
onPick: a,
|
|
107
|
+
placement: r = "left",
|
|
65
108
|
floatingDefaultPosition: i,
|
|
66
|
-
bubbleGlyphColors:
|
|
67
|
-
className:
|
|
109
|
+
bubbleGlyphColors: p,
|
|
110
|
+
className: b
|
|
68
111
|
}) {
|
|
69
|
-
const
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
|
|
112
|
+
const f = T(null), y = T(!1), [B, g] = D(!1), [u, l] = D(!1), [d, P] = D(262), [k, v] = D({ x: 0, y: 0 }), N = r === "bubble", H = r === "floating", z = H || N && !u, A = r === "top" || r === "bottom";
|
|
113
|
+
let w = -1, C = -1;
|
|
114
|
+
s.forEach((n, m) => {
|
|
115
|
+
n.inView && (w < 0 && (w = m), C = m);
|
|
73
116
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
}, [
|
|
83
|
-
const
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
117
|
+
const M = w === 0 && C === s.length - 1;
|
|
118
|
+
S(() => {
|
|
119
|
+
const n = f.current;
|
|
120
|
+
if (!n || y.current || w < 0 || M) return;
|
|
121
|
+
const m = n.querySelectorAll("[data-timeline-summary-row]"), I = m[w], R = m[C];
|
|
122
|
+
if (!I || !R) return;
|
|
123
|
+
const V = (I.offsetTop + R.offsetTop + R.offsetHeight) / 2;
|
|
124
|
+
n.scrollTop = Math.max(0, V - n.clientHeight / 2);
|
|
125
|
+
}, [w, C, M]);
|
|
126
|
+
const F = /* @__PURE__ */ h(L, { children: [
|
|
127
|
+
/* @__PURE__ */ h("span", { children: [
|
|
128
|
+
z && /* @__PURE__ */ t("span", { className: e.summaryGrip, "aria-hidden": !0, children: "⠿" }),
|
|
129
|
+
o
|
|
87
130
|
] }),
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
131
|
+
N ? /* @__PURE__ */ h("span", { className: e.summaryHeadTools, children: [
|
|
132
|
+
/* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length }),
|
|
133
|
+
/* @__PURE__ */ t(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
className: e.summaryDockBtn,
|
|
138
|
+
"aria-label": u ? "Undock event summary" : "Dock event summary",
|
|
139
|
+
title: u ? "Float the panel" : "Dock to the left edge",
|
|
140
|
+
onClick: (n) => {
|
|
141
|
+
n.stopPropagation(), l(!u), v({ x: 0, y: 0 });
|
|
142
|
+
},
|
|
143
|
+
onPointerDown: (n) => n.stopPropagation(),
|
|
144
|
+
children: u ? "⇱" : "⇤"
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
/* @__PURE__ */ t(
|
|
91
148
|
"button",
|
|
92
149
|
{
|
|
93
150
|
type: "button",
|
|
94
151
|
className: e.summaryCollapse,
|
|
95
152
|
"aria-label": "Collapse event summary",
|
|
96
|
-
onClick: (
|
|
97
|
-
|
|
153
|
+
onClick: (n) => {
|
|
154
|
+
n.stopPropagation(), g(!1), v({ x: 0, y: 0 });
|
|
98
155
|
},
|
|
99
|
-
onPointerDown: (
|
|
156
|
+
onPointerDown: (n) => n.stopPropagation(),
|
|
100
157
|
children: "×"
|
|
101
158
|
}
|
|
102
159
|
)
|
|
103
|
-
] }) : /* @__PURE__ */
|
|
104
|
-
] }),
|
|
160
|
+
] }) : /* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length })
|
|
161
|
+
] }), x = /* @__PURE__ */ h(
|
|
105
162
|
"div",
|
|
106
163
|
{
|
|
107
|
-
className:
|
|
164
|
+
className: c(
|
|
108
165
|
e.summary,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
166
|
+
A && e.summaryHorizontal,
|
|
167
|
+
r === "top" && e.summaryTop,
|
|
168
|
+
r === "bottom" && e.summaryBottom,
|
|
169
|
+
H && e.summaryFloatingCard,
|
|
170
|
+
N && e.summaryBubbleCard,
|
|
171
|
+
N && u && e.summaryDockCard,
|
|
172
|
+
b
|
|
115
173
|
),
|
|
116
174
|
onMouseEnter: () => {
|
|
117
|
-
|
|
175
|
+
y.current = !0;
|
|
118
176
|
},
|
|
119
177
|
onMouseLeave: () => {
|
|
120
|
-
|
|
178
|
+
y.current = !1;
|
|
121
179
|
},
|
|
122
180
|
children: [
|
|
123
|
-
|
|
124
|
-
/* @__PURE__ */
|
|
181
|
+
z ? /* @__PURE__ */ t(E.Handle, { className: c(e.summaryHeader, e.summaryHandle), children: F }) : /* @__PURE__ */ t("div", { className: e.summaryHeader, children: F }),
|
|
182
|
+
/* @__PURE__ */ t(
|
|
125
183
|
"div",
|
|
126
184
|
{
|
|
127
|
-
ref:
|
|
128
|
-
className:
|
|
129
|
-
children:
|
|
185
|
+
ref: f,
|
|
186
|
+
className: c(e.summaryList, A && e.summaryListGrid),
|
|
187
|
+
children: s.map((n) => /* @__PURE__ */ h(
|
|
130
188
|
"div",
|
|
131
189
|
{
|
|
132
190
|
"data-timeline-summary-row": !0,
|
|
133
191
|
role: "button",
|
|
134
192
|
tabIndex: 0,
|
|
135
|
-
className:
|
|
193
|
+
className: c(
|
|
136
194
|
e.summaryRow,
|
|
137
|
-
|
|
138
|
-
|
|
195
|
+
n.inView && e.summaryRowInView,
|
|
196
|
+
n.selected && e.summaryRowSelected
|
|
139
197
|
),
|
|
140
|
-
onClick: () =>
|
|
141
|
-
onKeyDown: (
|
|
142
|
-
(
|
|
198
|
+
onClick: () => a(n.id),
|
|
199
|
+
onKeyDown: (m) => {
|
|
200
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a(n.id));
|
|
143
201
|
},
|
|
144
202
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
203
|
+
/* @__PURE__ */ t("span", { className: e.summaryNum, children: n.number }),
|
|
204
|
+
/* @__PURE__ */ t("span", { className: e.summaryDot, style: { background: n.color } }),
|
|
205
|
+
/* @__PURE__ */ t("span", { className: e.summaryLabel, children: n.label }),
|
|
206
|
+
n.time && /* @__PURE__ */ t("span", { className: e.summaryTime, children: n.time })
|
|
149
207
|
]
|
|
150
208
|
},
|
|
151
|
-
|
|
209
|
+
n.id
|
|
152
210
|
))
|
|
153
211
|
}
|
|
154
212
|
),
|
|
155
|
-
|
|
213
|
+
N && /* @__PURE__ */ t("div", { className: e.summaryFootnote, children: "Tinted rows are in the viewport" })
|
|
156
214
|
]
|
|
157
215
|
}
|
|
158
216
|
);
|
|
159
|
-
return
|
|
160
|
-
|
|
217
|
+
return N ? B ? u ? /* @__PURE__ */ h("div", { className: e.summaryDock, style: { flexBasis: d }, children: [
|
|
218
|
+
x,
|
|
219
|
+
/* @__PURE__ */ t(
|
|
220
|
+
j,
|
|
221
|
+
{
|
|
222
|
+
panel: "left",
|
|
223
|
+
width: d,
|
|
224
|
+
min: 200,
|
|
225
|
+
max: 520,
|
|
226
|
+
onResize: P,
|
|
227
|
+
label: "Resize event summary",
|
|
228
|
+
className: e.summaryDockResizer
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
] }) : /* @__PURE__ */ t("div", { className: e.summaryBubbleAnchor, children: /* @__PURE__ */ t(
|
|
232
|
+
E,
|
|
161
233
|
{
|
|
162
234
|
className: e.summaryBubblePanel,
|
|
163
235
|
bounds: "viewport",
|
|
164
|
-
position:
|
|
165
|
-
onDrag:
|
|
166
|
-
children:
|
|
236
|
+
position: k,
|
|
237
|
+
onDrag: v,
|
|
238
|
+
children: x
|
|
167
239
|
}
|
|
168
|
-
) }) : /* @__PURE__ */
|
|
240
|
+
) }) : /* @__PURE__ */ t("div", { className: e.summaryBubbleAnchor, children: /* @__PURE__ */ h(
|
|
169
241
|
"button",
|
|
170
242
|
{
|
|
171
243
|
type: "button",
|
|
172
|
-
className:
|
|
244
|
+
className: c(e.summaryBubble, b),
|
|
173
245
|
title: "Event summary",
|
|
174
|
-
onClick: () =>
|
|
246
|
+
onClick: () => g(!0),
|
|
175
247
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
|
|
178
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ t("span", { className: e.summaryBubbleGlyph, "aria-hidden": !0, children: (p && p.length ? p : ["var(--crk-timeline-accent)"]).slice(0, 3).map((n, m) => /* @__PURE__ */ t("span", { style: { background: n } }, m)) }),
|
|
249
|
+
o,
|
|
250
|
+
/* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length })
|
|
179
251
|
]
|
|
180
252
|
}
|
|
181
|
-
) }) :
|
|
182
|
-
|
|
253
|
+
) }) : H ? /* @__PURE__ */ t(
|
|
254
|
+
E,
|
|
183
255
|
{
|
|
184
256
|
className: e.summaryFloating,
|
|
185
257
|
bounds: "viewport",
|
|
186
258
|
defaultPosition: i ?? { x: 0, y: 0 },
|
|
187
|
-
children:
|
|
259
|
+
children: x
|
|
188
260
|
}
|
|
189
|
-
) :
|
|
261
|
+
) : x;
|
|
190
262
|
}
|
|
191
|
-
function
|
|
192
|
-
x:
|
|
193
|
-
y:
|
|
194
|
-
children:
|
|
195
|
-
className:
|
|
263
|
+
function _({
|
|
264
|
+
x: o,
|
|
265
|
+
y: s,
|
|
266
|
+
children: a,
|
|
267
|
+
className: r,
|
|
196
268
|
style: i
|
|
197
269
|
}) {
|
|
198
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ t("div", { className: c(e.tooltip, r), style: { left: o, top: s, ...i }, children: a });
|
|
199
271
|
}
|
|
200
|
-
function
|
|
201
|
-
const
|
|
202
|
-
return
|
|
203
|
-
(
|
|
272
|
+
function $({ text: o, query: s }) {
|
|
273
|
+
const a = Z(o, s);
|
|
274
|
+
return a.length === 1 && !a[0].hit ? /* @__PURE__ */ t(L, { children: a[0].t }) : /* @__PURE__ */ t(L, { children: a.map(
|
|
275
|
+
(r, i) => r.hit ? /* @__PURE__ */ t("span", { className: e.mark, children: r.t }, i) : /* @__PURE__ */ t("span", { children: r.t }, i)
|
|
204
276
|
) });
|
|
205
277
|
}
|
|
206
278
|
export {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
279
|
+
$ as HighlightText,
|
|
280
|
+
G as TimelineLegend,
|
|
281
|
+
j as TimelineResizer,
|
|
282
|
+
Q as TimelineSegmented,
|
|
283
|
+
Y as TimelineSummary,
|
|
284
|
+
_ as TimelineTooltip,
|
|
285
|
+
J as TimelineZoomControls
|
|
213
286
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { TraceTimelineEvent, TraceTimelineField } from './traceEvent';
|
|
3
|
+
/** Status/level badge: `201`, `pending`, `ongoing`, `error`… */
|
|
4
|
+
export declare function EventBadge({ event, pending, small, }: {
|
|
5
|
+
event: TraceTimelineEvent;
|
|
6
|
+
pending: boolean;
|
|
7
|
+
small?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
/**
|
|
10
|
+
* One labeled value: the label always sits above its value, and fields stack
|
|
11
|
+
* vertically. Non-inline values (objects, arrays) become copyable JSON blocks.
|
|
12
|
+
*/
|
|
13
|
+
export declare function FieldRow({ field, query, className, }: {
|
|
14
|
+
field: TraceTimelineField;
|
|
15
|
+
query?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
/** A JSON payload block: uppercase heading + copy button + pretty-printed body. */
|
|
19
|
+
export declare function PayloadBlock({ label, value, copyLabel, section, }: {
|
|
20
|
+
label: string;
|
|
21
|
+
value: unknown;
|
|
22
|
+
copyLabel: string;
|
|
23
|
+
/** Render the heading as a panel section title instead of a micro-label. */
|
|
24
|
+
section?: boolean;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface TraceEventDetailsClasses {
|
|
27
|
+
root: string;
|
|
28
|
+
head: string;
|
|
29
|
+
body: string;
|
|
30
|
+
section: string;
|
|
31
|
+
field: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TraceEventDetailsProps {
|
|
34
|
+
/** The event to describe. */
|
|
35
|
+
event: TraceTimelineEvent;
|
|
36
|
+
/**
|
|
37
|
+
* "Now" for an unfinished event's running duration, epoch ms — pass a
|
|
38
|
+
* ticking value to keep it live. @default Date.now()
|
|
39
|
+
*/
|
|
40
|
+
now?: number;
|
|
41
|
+
/** Keyword to mark inside field values (same matcher as the timeline). */
|
|
42
|
+
highlight?: string;
|
|
43
|
+
/**
|
|
44
|
+
* List event keys the panel doesn't render itself under an *Other fields*
|
|
45
|
+
* section. @default true
|
|
46
|
+
*/
|
|
47
|
+
showExtraFields?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Extra event keys to leave out of *Other fields* — for plumbing values
|
|
50
|
+
* (tenant ids, ingestion timestamps, …) that ride along on the event but
|
|
51
|
+
* aren't part of its story. Finer-grained than `showExtraFields`, which
|
|
52
|
+
* hides the whole section.
|
|
53
|
+
*/
|
|
54
|
+
hiddenFields?: string[];
|
|
55
|
+
/** Adds a ✕ button to the header row when provided. */
|
|
56
|
+
onClose?: () => void;
|
|
57
|
+
/** Override class names on internal elements. */
|
|
58
|
+
classes?: Partial<TraceEventDetailsClasses>;
|
|
59
|
+
className?: string;
|
|
60
|
+
style?: CSSProperties;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The event inspector used by TraceTimeline's *Event details* drawer, usable
|
|
64
|
+
* on its own in any panel, modal or split view.
|
|
65
|
+
*
|
|
66
|
+
* It adapts to the event instead of assuming an HTTP call: every value is
|
|
67
|
+
* rendered under its own label (identity, URL, request id and **Started /
|
|
68
|
+
* Ended / Duration**, each stacked on its own row), and only the sections the
|
|
69
|
+
* event actually has are shown. A request (`method`/`url`/`status`/headers/
|
|
70
|
+
* bodies present, or `kind: 'request'`) gets Query parameters / Headers /
|
|
71
|
+
* Body under Request and Response — in flight, the Response section becomes
|
|
72
|
+
* "Awaiting response…". A plain event gets its `message`, `payload` and
|
|
73
|
+
* consumer-defined `details` fields instead, badged by `level` rather than a
|
|
74
|
+
* status code. Anything unrecognized lands under *Other fields*.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <TraceEventDetails
|
|
79
|
+
* event={{
|
|
80
|
+
* id: 'evt-1',
|
|
81
|
+
* service: 'Payments',
|
|
82
|
+
* op: 'payment.authorized',
|
|
83
|
+
* level: 'success',
|
|
84
|
+
* message: 'Authorized on the first attempt.',
|
|
85
|
+
* payload: { authCode: '88112', amount: 148.9 },
|
|
86
|
+
* start: Date.now() - 400,
|
|
87
|
+
* end: Date.now(),
|
|
88
|
+
* }}
|
|
89
|
+
* />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const TraceEventDetails: import('react').ForwardRefExoticComponent<TraceEventDetailsProps & import('react').RefAttributes<HTMLDivElement>>;
|