@overdoser/react-toolkit 0.10.1 → 0.12.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/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 +202 -196
- package/components/Timeline/HistoryTimeline.d.ts +10 -0
- package/components/Timeline/HistoryTimeline.js +219 -214
- package/components/Timeline/Timeline.module.scss.js +126 -96
- package/components/Timeline/TimelineShared.d.ts +35 -4
- package/components/Timeline/TimelineShared.js +215 -102
- package/components/Timeline/TraceTimeline.d.ts +50 -9
- package/components/Timeline/TraceTimeline.js +716 -432
- package/components/Timeline/TraceTimeline.module.scss.js +159 -95
- package/components/Timeline/index.d.ts +2 -1
- package/components/Timeline/useTimeline.d.ts +11 -0
- package/components/Timeline/useTimeline.js +36 -32
- package/index.css +1 -1
- package/index.d.ts +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +16 -8
- package/manifest.json +630 -170
- package/package.json +1 -1
|
@@ -1,173 +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:
|
|
5
|
+
import { highlightParts as Z } from "./timelineCore.js";
|
|
6
|
+
import { Draggable as E } from "../Draggable/Draggable.js";
|
|
7
|
+
function G({
|
|
8
|
+
items: o,
|
|
9
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:
|
|
16
|
+
function J({
|
|
17
|
+
zoomPct: o,
|
|
18
18
|
fitActive: s,
|
|
19
|
-
onZoomIn:
|
|
20
|
-
onZoomOut:
|
|
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:
|
|
43
|
+
function Q({
|
|
44
|
+
value: o,
|
|
45
45
|
options: s,
|
|
46
|
-
onChange:
|
|
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: () => r
|
|
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
|
-
|
|
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",
|
|
62
105
|
items: s,
|
|
63
|
-
onPick:
|
|
64
|
-
placement:
|
|
106
|
+
onPick: a,
|
|
107
|
+
placement: r = "left",
|
|
65
108
|
floatingDefaultPosition: i,
|
|
66
|
-
|
|
109
|
+
bubbleGlyphColors: p,
|
|
110
|
+
className: b
|
|
67
111
|
}) {
|
|
68
|
-
const f =
|
|
69
|
-
let
|
|
70
|
-
s.forEach((
|
|
71
|
-
|
|
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);
|
|
72
116
|
});
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
const
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
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
|
|
86
130
|
] }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
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(
|
|
148
|
+
"button",
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
className: e.summaryCollapse,
|
|
152
|
+
"aria-label": "Collapse event summary",
|
|
153
|
+
onClick: (n) => {
|
|
154
|
+
n.stopPropagation(), g(!1), v({ x: 0, y: 0 });
|
|
155
|
+
},
|
|
156
|
+
onPointerDown: (n) => n.stopPropagation(),
|
|
157
|
+
children: "×"
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }) : /* @__PURE__ */ t("span", { className: e.summaryCount, children: s.length })
|
|
161
|
+
] }), x = /* @__PURE__ */ h(
|
|
89
162
|
"div",
|
|
90
163
|
{
|
|
91
|
-
className:
|
|
164
|
+
className: c(
|
|
92
165
|
e.summary,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
|
98
173
|
),
|
|
99
174
|
onMouseEnter: () => {
|
|
100
|
-
|
|
175
|
+
y.current = !0;
|
|
101
176
|
},
|
|
102
177
|
onMouseLeave: () => {
|
|
103
|
-
|
|
178
|
+
y.current = !1;
|
|
104
179
|
},
|
|
105
180
|
children: [
|
|
106
|
-
|
|
107
|
-
/* @__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(
|
|
108
183
|
"div",
|
|
109
184
|
{
|
|
110
185
|
ref: f,
|
|
111
|
-
className:
|
|
112
|
-
children: s.map((
|
|
186
|
+
className: c(e.summaryList, A && e.summaryListGrid),
|
|
187
|
+
children: s.map((n) => /* @__PURE__ */ h(
|
|
113
188
|
"div",
|
|
114
189
|
{
|
|
115
190
|
"data-timeline-summary-row": !0,
|
|
116
191
|
role: "button",
|
|
117
192
|
tabIndex: 0,
|
|
118
|
-
className:
|
|
193
|
+
className: c(
|
|
119
194
|
e.summaryRow,
|
|
120
|
-
|
|
121
|
-
|
|
195
|
+
n.inView && e.summaryRowInView,
|
|
196
|
+
n.selected && e.summaryRowSelected
|
|
122
197
|
),
|
|
123
|
-
onClick: () =>
|
|
124
|
-
onKeyDown: (
|
|
125
|
-
(
|
|
198
|
+
onClick: () => a(n.id),
|
|
199
|
+
onKeyDown: (m) => {
|
|
200
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a(n.id));
|
|
126
201
|
},
|
|
127
202
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
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 })
|
|
132
207
|
]
|
|
133
208
|
},
|
|
134
|
-
|
|
209
|
+
n.id
|
|
135
210
|
))
|
|
136
211
|
}
|
|
137
|
-
)
|
|
212
|
+
),
|
|
213
|
+
N && /* @__PURE__ */ t("div", { className: e.summaryFootnote, children: "Tinted rows are in the viewport" })
|
|
138
214
|
]
|
|
139
215
|
}
|
|
140
216
|
);
|
|
141
|
-
return
|
|
142
|
-
|
|
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,
|
|
233
|
+
{
|
|
234
|
+
className: e.summaryBubblePanel,
|
|
235
|
+
bounds: "viewport",
|
|
236
|
+
position: k,
|
|
237
|
+
onDrag: v,
|
|
238
|
+
children: x
|
|
239
|
+
}
|
|
240
|
+
) }) : /* @__PURE__ */ t("div", { className: e.summaryBubbleAnchor, children: /* @__PURE__ */ h(
|
|
241
|
+
"button",
|
|
242
|
+
{
|
|
243
|
+
type: "button",
|
|
244
|
+
className: c(e.summaryBubble, b),
|
|
245
|
+
title: "Event summary",
|
|
246
|
+
onClick: () => g(!0),
|
|
247
|
+
children: [
|
|
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 })
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
) }) : H ? /* @__PURE__ */ t(
|
|
254
|
+
E,
|
|
143
255
|
{
|
|
144
256
|
className: e.summaryFloating,
|
|
145
257
|
bounds: "viewport",
|
|
146
258
|
defaultPosition: i ?? { x: 0, y: 0 },
|
|
147
|
-
children:
|
|
259
|
+
children: x
|
|
148
260
|
}
|
|
149
|
-
) :
|
|
261
|
+
) : x;
|
|
150
262
|
}
|
|
151
|
-
function
|
|
152
|
-
x:
|
|
263
|
+
function _({
|
|
264
|
+
x: o,
|
|
153
265
|
y: s,
|
|
154
|
-
children:
|
|
155
|
-
className:
|
|
266
|
+
children: a,
|
|
267
|
+
className: r,
|
|
156
268
|
style: i
|
|
157
269
|
}) {
|
|
158
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ t("div", { className: c(e.tooltip, r), style: { left: o, top: s, ...i }, children: a });
|
|
159
271
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
(
|
|
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)
|
|
164
276
|
) });
|
|
165
277
|
}
|
|
166
278
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
173
286
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { TimelineSummaryPlacement } from './TimelineShared';
|
|
3
3
|
import { DraggablePosition } from '../Draggable';
|
|
4
|
+
import { TimelineWheelZoom } from './useTimeline';
|
|
4
5
|
/**
|
|
5
6
|
* One request/response (or custom) event on the trace. Only `id`, `service`
|
|
6
7
|
* and `start` are required — everything else enriches the chip, tooltip and
|
|
@@ -54,9 +55,13 @@ export interface TraceTimelineClasses {
|
|
|
54
55
|
summary: string;
|
|
55
56
|
search: string;
|
|
56
57
|
drawer: string;
|
|
58
|
+
log: string;
|
|
59
|
+
rail: string;
|
|
57
60
|
tooltip: string;
|
|
58
61
|
footnote: string;
|
|
59
62
|
}
|
|
63
|
+
/** Which right-side drawer is docked open (`null` = none). */
|
|
64
|
+
export type TraceTimelineDock = 'details' | 'log' | null;
|
|
60
65
|
/** Context handed to the TraceTimeline render-prop slots. */
|
|
61
66
|
export interface TraceTimelineItemContext {
|
|
62
67
|
/** Resolved service color. */
|
|
@@ -111,27 +116,58 @@ export interface TraceTimelineProps {
|
|
|
111
116
|
showGridlines?: boolean;
|
|
112
117
|
/** Toolbar row with the zoom −/%/+/Fit controls. @default true */
|
|
113
118
|
showControls?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* How the mouse wheel / trackpad zooms the timeline: `'ctrl'` zooms only
|
|
121
|
+
* while Ctrl/Cmd is held (plain scrolling passes through to the page;
|
|
122
|
+
* trackpad pinch still zooms), `'free'` zooms on any scroll over the
|
|
123
|
+
* canvas, `'none'` disables wheel zoom entirely — the toolbar buttons
|
|
124
|
+
* still work.
|
|
125
|
+
* @default 'ctrl'
|
|
126
|
+
*/
|
|
127
|
+
wheelZoom?: TimelineWheelZoom;
|
|
114
128
|
/** Colored dot + name legend for the services present. @default true */
|
|
115
129
|
showLegend?: boolean;
|
|
116
130
|
/**
|
|
117
|
-
* Dense one-line-per-event summary panel
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* click-to-navigate — the
|
|
121
|
-
*
|
|
122
|
-
*
|
|
131
|
+
* Dense one-line-per-event summary panel: all events numbered
|
|
132
|
+
* chronologically from `01`, a highlight band over the events currently
|
|
133
|
+
* visible in the viewport (auto-follows drag-panning), and
|
|
134
|
+
* click-to-navigate — picking a row selects the event and smooth-scrolls
|
|
135
|
+
* the timeline (~1s, decelerating) to center it (and scrolls the full-log
|
|
136
|
+
* drawer to its entry when that is open). The panel scrolls independently.
|
|
137
|
+
* @default true
|
|
123
138
|
*/
|
|
124
139
|
showSummary?: boolean;
|
|
125
140
|
/**
|
|
126
|
-
* Where the summary panel sits:
|
|
141
|
+
* Where the summary panel sits: `'bubble'` — a collapsed pill anchored
|
|
142
|
+
* bottom-left of the timeline that expands in place into a draggable panel
|
|
143
|
+
* (collapsing snaps it back to its corner) — docked `'left'`/`'right'`,
|
|
127
144
|
* full-width `'top'`/`'bottom'`, or `'floating'` — a draggable palette over
|
|
128
|
-
* the timeline, grabbed by its header. @default '
|
|
145
|
+
* the timeline, grabbed by its header. @default 'bubble'
|
|
129
146
|
*/
|
|
130
147
|
summaryPlacement?: TimelineSummaryPlacement;
|
|
131
148
|
/** Floating summary: initial offset from the component's top-left corner. */
|
|
132
149
|
summaryDefaultPosition?: DraggablePosition;
|
|
150
|
+
/**
|
|
151
|
+
* Sticky icon rail on the far right with two toggles docking a drawer
|
|
152
|
+
* beside the timeline: *Event details* (the request/response panel, with an
|
|
153
|
+
* empty state until an event is picked) and *Full log* (every event
|
|
154
|
+
* vertically with payloads and copy buttons). One drawer at a time; nothing
|
|
155
|
+
* is docked initially, but clicking an event opens the details drawer.
|
|
156
|
+
* With `false`, the rail and full log disappear and the details panel
|
|
157
|
+
* simply opens/closes with the selection. @default true
|
|
158
|
+
*/
|
|
159
|
+
showDock?: boolean;
|
|
160
|
+
/** Drawer docked open initially (uncontrolled). @default null */
|
|
161
|
+
defaultDock?: TraceTimelineDock;
|
|
133
162
|
/** Max height of the scrollable canvas. @default '80vh' */
|
|
134
163
|
maxHeight?: number | string;
|
|
164
|
+
/**
|
|
165
|
+
* Minimum height of the event band, px (the sticky axis adds its 68px on
|
|
166
|
+
* top). Sparse traces stretch to it with the bar band kept vertically
|
|
167
|
+
* centered; dense traces still grow past it when their chip rows need
|
|
168
|
+
* more room. @default 420
|
|
169
|
+
*/
|
|
170
|
+
minHeight?: number;
|
|
135
171
|
/** Controlled id of the event open in the detail panel (`null` = closed). */
|
|
136
172
|
selectedEventId?: string | null;
|
|
137
173
|
/** Initially open event (uncontrolled). */
|
|
@@ -165,7 +201,12 @@ export interface TraceTimelineProps {
|
|
|
165
201
|
* axis with cursor timestamp chip, day-change date labels and a sticky
|
|
166
202
|
* current-date marker; wheel-zoom, drag-pan, fit-to-width; keyword
|
|
167
203
|
* highlighting; in-flight events render dashed with a "now" line and grow
|
|
168
|
-
* live
|
|
204
|
+
* live. A right-side icon rail docks one drawer at a time: *Event details*
|
|
205
|
+
* (the request/response panel, opened by clicking an event) or *Full log*
|
|
206
|
+
* (every event vertically with copy-to-clipboard payloads, kept in sync with
|
|
207
|
+
* timeline clicks both ways). An events-summary bubble sits bottom-left,
|
|
208
|
+
* expanding into a draggable panel that bands the events currently in view
|
|
209
|
+
* and navigates on click.
|
|
169
210
|
*
|
|
170
211
|
* @example
|
|
171
212
|
* ```tsx
|