@workflow/web-shared 4.0.1-beta.5
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/LICENSE.md +21 -0
- package/README.md +76 -0
- package/dist/api/workflow-api-client.d.ts +303 -0
- package/dist/api/workflow-api-client.d.ts.map +1 -0
- package/dist/api/workflow-api-client.js +797 -0
- package/dist/api/workflow-api-client.js.map +1 -0
- package/dist/api/workflow-server-actions.d.ts +97 -0
- package/dist/api/workflow-server-actions.d.ts.map +1 -0
- package/dist/api/workflow-server-actions.js +329 -0
- package/dist/api/workflow-server-actions.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.jsx +22 -0
- package/dist/components/ui/alert.jsx.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +11 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +19 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/run-trace-view.d.ts +8 -0
- package/dist/run-trace-view.d.ts.map +1 -0
- package/dist/run-trace-view.jsx +25 -0
- package/dist/run-trace-view.jsx.map +1 -0
- package/dist/sidebar/attribute-panel.d.ts +11 -0
- package/dist/sidebar/attribute-panel.d.ts.map +1 -0
- package/dist/sidebar/attribute-panel.jsx +153 -0
- package/dist/sidebar/attribute-panel.jsx.map +1 -0
- package/dist/sidebar/detail-card.d.ts +6 -0
- package/dist/sidebar/detail-card.d.ts.map +1 -0
- package/dist/sidebar/detail-card.jsx +13 -0
- package/dist/sidebar/detail-card.jsx.map +1 -0
- package/dist/sidebar/events-list.d.ts +8 -0
- package/dist/sidebar/events-list.d.ts.map +1 -0
- package/dist/sidebar/events-list.jsx +67 -0
- package/dist/sidebar/events-list.jsx.map +1 -0
- package/dist/sidebar/workflow-detail-panel.d.ts +8 -0
- package/dist/sidebar/workflow-detail-panel.d.ts.map +1 -0
- package/dist/sidebar/workflow-detail-panel.jsx +59 -0
- package/dist/sidebar/workflow-detail-panel.jsx.map +1 -0
- package/dist/trace-viewer/components/map.d.ts +8 -0
- package/dist/trace-viewer/components/map.d.ts.map +1 -0
- package/dist/trace-viewer/components/map.jsx +164 -0
- package/dist/trace-viewer/components/map.jsx.map +1 -0
- package/dist/trace-viewer/components/markers.d.ts +22 -0
- package/dist/trace-viewer/components/markers.d.ts.map +1 -0
- package/dist/trace-viewer/components/markers.jsx +400 -0
- package/dist/trace-viewer/components/markers.jsx.map +1 -0
- package/dist/trace-viewer/components/node.d.ts +31 -0
- package/dist/trace-viewer/components/node.d.ts.map +1 -0
- package/dist/trace-viewer/components/node.jsx +116 -0
- package/dist/trace-viewer/components/node.jsx.map +1 -0
- package/dist/trace-viewer/components/search-input.d.ts +9 -0
- package/dist/trace-viewer/components/search-input.d.ts.map +1 -0
- package/dist/trace-viewer/components/search-input.jsx +16 -0
- package/dist/trace-viewer/components/search-input.jsx.map +1 -0
- package/dist/trace-viewer/components/search.d.ts +3 -0
- package/dist/trace-viewer/components/search.d.ts.map +1 -0
- package/dist/trace-viewer/components/search.jsx +27 -0
- package/dist/trace-viewer/components/search.jsx.map +1 -0
- package/dist/trace-viewer/components/span-detail-panel.d.ts +10 -0
- package/dist/trace-viewer/components/span-detail-panel.d.ts.map +1 -0
- package/dist/trace-viewer/components/span-detail-panel.jsx +388 -0
- package/dist/trace-viewer/components/span-detail-panel.jsx.map +1 -0
- package/dist/trace-viewer/components/ui.d.ts +28 -0
- package/dist/trace-viewer/components/ui.d.ts.map +1 -0
- package/dist/trace-viewer/components/ui.jsx +54 -0
- package/dist/trace-viewer/components/ui.jsx.map +1 -0
- package/dist/trace-viewer/components/zoom-button.d.ts +3 -0
- package/dist/trace-viewer/components/zoom-button.d.ts.map +1 -0
- package/dist/trace-viewer/components/zoom-button.jsx +40 -0
- package/dist/trace-viewer/components/zoom-button.jsx.map +1 -0
- package/dist/trace-viewer/components/zoom-icons.d.ts +11 -0
- package/dist/trace-viewer/components/zoom-icons.d.ts.map +1 -0
- package/dist/trace-viewer/components/zoom-icons.jsx +23 -0
- package/dist/trace-viewer/components/zoom-icons.jsx.map +1 -0
- package/dist/trace-viewer/context.d.ts +183 -0
- package/dist/trace-viewer/context.d.ts.map +1 -0
- package/dist/trace-viewer/context.jsx +326 -0
- package/dist/trace-viewer/context.jsx.map +1 -0
- package/dist/trace-viewer/index.d.ts +5 -0
- package/dist/trace-viewer/index.d.ts.map +1 -0
- package/dist/trace-viewer/index.jsx +4 -0
- package/dist/trace-viewer/index.jsx.map +1 -0
- package/dist/trace-viewer/trace-viewer.d.ts +22 -0
- package/dist/trace-viewer/trace-viewer.d.ts.map +1 -0
- package/dist/trace-viewer/trace-viewer.jsx +311 -0
- package/dist/trace-viewer/trace-viewer.jsx.map +1 -0
- package/dist/trace-viewer/trace-viewer.module.css +1275 -0
- package/dist/trace-viewer/types.d.ts +201 -0
- package/dist/trace-viewer/types.d.ts.map +1 -0
- package/dist/trace-viewer/types.js +2 -0
- package/dist/trace-viewer/types.js.map +1 -0
- package/dist/trace-viewer/util/constants.d.ts +9 -0
- package/dist/trace-viewer/util/constants.d.ts.map +1 -0
- package/dist/trace-viewer/util/constants.js +9 -0
- package/dist/trace-viewer/util/constants.js.map +1 -0
- package/dist/trace-viewer/util/scrollbar-width.d.ts +2 -0
- package/dist/trace-viewer/util/scrollbar-width.d.ts.map +1 -0
- package/dist/trace-viewer/util/scrollbar-width.js +14 -0
- package/dist/trace-viewer/util/scrollbar-width.js.map +1 -0
- package/dist/trace-viewer/util/timing.d.ts +8 -0
- package/dist/trace-viewer/util/timing.d.ts.map +1 -0
- package/dist/trace-viewer/util/timing.js +29 -0
- package/dist/trace-viewer/util/timing.js.map +1 -0
- package/dist/trace-viewer/util/tree.d.ts +13 -0
- package/dist/trace-viewer/util/tree.d.ts.map +1 -0
- package/dist/trace-viewer/util/tree.js +223 -0
- package/dist/trace-viewer/util/tree.js.map +1 -0
- package/dist/trace-viewer/util/use-immediate-style.d.ts +15 -0
- package/dist/trace-viewer/util/use-immediate-style.d.ts.map +1 -0
- package/dist/trace-viewer/util/use-immediate-style.js +22 -0
- package/dist/trace-viewer/util/use-immediate-style.js.map +1 -0
- package/dist/trace-viewer/util/use-streaming-spans.d.ts +8 -0
- package/dist/trace-viewer/util/use-streaming-spans.d.ts.map +1 -0
- package/dist/trace-viewer/util/use-streaming-spans.js +332 -0
- package/dist/trace-viewer/util/use-streaming-spans.js.map +1 -0
- package/dist/trace-viewer/util/use-trackpad-zoom.d.ts +6 -0
- package/dist/trace-viewer/util/use-trackpad-zoom.d.ts.map +1 -0
- package/dist/trace-viewer/util/use-trackpad-zoom.jsx +38 -0
- package/dist/trace-viewer/util/use-trackpad-zoom.jsx.map +1 -0
- package/dist/trace-viewer/worker.d.ts +2 -0
- package/dist/trace-viewer/worker.d.ts.map +1 -0
- package/dist/trace-viewer/worker.js +107 -0
- package/dist/trace-viewer/worker.js.map +1 -0
- package/dist/workflow-trace-view.d.ts +12 -0
- package/dist/workflow-trace-view.d.ts.map +1 -0
- package/dist/workflow-trace-view.jsx +129 -0
- package/dist/workflow-trace-view.jsx.map +1 -0
- package/dist/workflow-traces/event-colors.d.ts +31 -0
- package/dist/workflow-traces/event-colors.d.ts.map +1 -0
- package/dist/workflow-traces/event-colors.js +68 -0
- package/dist/workflow-traces/event-colors.js.map +1 -0
- package/dist/workflow-traces/trace-colors.d.ts +15 -0
- package/dist/workflow-traces/trace-colors.d.ts.map +1 -0
- package/dist/workflow-traces/trace-colors.js +89 -0
- package/dist/workflow-traces/trace-colors.js.map +1 -0
- package/dist/workflow-traces/trace-span-construction.d.ts +31 -0
- package/dist/workflow-traces/trace-span-construction.d.ts.map +1 -0
- package/dist/workflow-traces/trace-span-construction.js +173 -0
- package/dist/workflow-traces/trace-span-construction.js.map +1 -0
- package/dist/workflow-traces/trace-time-utils.d.ts +13 -0
- package/dist/workflow-traces/trace-time-utils.d.ts.map +1 -0
- package/dist/workflow-traces/trace-time-utils.js +34 -0
- package/dist/workflow-traces/trace-time-utils.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { MutableRefObject, ReactNode } from 'react';
|
|
2
|
+
export type MemoCacheKey = Record<string, never>;
|
|
3
|
+
export type MemoCache = Map<string, MemoCacheKey>;
|
|
4
|
+
export interface Span {
|
|
5
|
+
name: string;
|
|
6
|
+
kind: number;
|
|
7
|
+
resource: string;
|
|
8
|
+
library: {
|
|
9
|
+
name: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
};
|
|
12
|
+
spanId: string;
|
|
13
|
+
parentSpanId?: string;
|
|
14
|
+
status: {
|
|
15
|
+
code: number;
|
|
16
|
+
};
|
|
17
|
+
traceFlags: number;
|
|
18
|
+
attributes: Record<string, unknown>;
|
|
19
|
+
links: Record<string, unknown>[];
|
|
20
|
+
events: SpanEvent[];
|
|
21
|
+
startTime: [number, number];
|
|
22
|
+
endTime: [number, number];
|
|
23
|
+
duration: [number, number];
|
|
24
|
+
}
|
|
25
|
+
export interface SpanEvent {
|
|
26
|
+
name: string;
|
|
27
|
+
timestamp: [number, number];
|
|
28
|
+
attributes: Record<string, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* Optional custom color for this event marker (workflow-specific feature).
|
|
31
|
+
* If provided, this color will be used for the event marker line/diamond.
|
|
32
|
+
*/
|
|
33
|
+
color?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to show a vertical line for this event in the timeline (workflow-specific feature).
|
|
36
|
+
* If false, only the diamond marker on the span will be shown.
|
|
37
|
+
* Defaults to true if not specified.
|
|
38
|
+
*/
|
|
39
|
+
showVerticalLine?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface Resource {
|
|
42
|
+
name: string;
|
|
43
|
+
attributes: Record<string, string>;
|
|
44
|
+
}
|
|
45
|
+
export interface Trace {
|
|
46
|
+
traceId: string;
|
|
47
|
+
resources?: Resource[];
|
|
48
|
+
spans: Span[];
|
|
49
|
+
rootSpanId?: string;
|
|
50
|
+
}
|
|
51
|
+
interface EveryNode {
|
|
52
|
+
startTime: number;
|
|
53
|
+
endTime: number;
|
|
54
|
+
duration: number;
|
|
55
|
+
/**
|
|
56
|
+
* How deep is this node within the tree
|
|
57
|
+
*/
|
|
58
|
+
depth: number;
|
|
59
|
+
/**
|
|
60
|
+
* All direct child nodes of this node
|
|
61
|
+
*/
|
|
62
|
+
children: SpanNode[];
|
|
63
|
+
}
|
|
64
|
+
export interface RootNode extends EveryNode {
|
|
65
|
+
/**
|
|
66
|
+
* The depth is always 0 for the root node
|
|
67
|
+
*/
|
|
68
|
+
depth: 0;
|
|
69
|
+
}
|
|
70
|
+
export interface SpanNode extends EveryNode {
|
|
71
|
+
/**
|
|
72
|
+
* This original Span that this node is based on
|
|
73
|
+
*/
|
|
74
|
+
span: Span;
|
|
75
|
+
/**
|
|
76
|
+
* The immediate parent of this node
|
|
77
|
+
*/
|
|
78
|
+
parent: RootNode | SpanNode;
|
|
79
|
+
/**
|
|
80
|
+
* A generated label to use (overrides the span.name) if present
|
|
81
|
+
*/
|
|
82
|
+
label?: string;
|
|
83
|
+
/**
|
|
84
|
+
* OTEL events that are present on this span (e.g. TTFB)
|
|
85
|
+
*/
|
|
86
|
+
events?: SpanNodeEvent[];
|
|
87
|
+
/**
|
|
88
|
+
* Whether this span originated in Vercel's infrastructure.
|
|
89
|
+
*/
|
|
90
|
+
isVercel: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether this span matches the current search filter
|
|
93
|
+
*/
|
|
94
|
+
isHighlighted?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether this span is a placeholder to hint at where user spans
|
|
97
|
+
* would appear if proper instrumentation were available
|
|
98
|
+
*/
|
|
99
|
+
isInstrumentationHint?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The index of the resource that this node belongs to (used for color)
|
|
102
|
+
*/
|
|
103
|
+
resourceIndex: number;
|
|
104
|
+
}
|
|
105
|
+
export interface SpanNodeEvent {
|
|
106
|
+
/** A unique key for this event to help with rendering in React */
|
|
107
|
+
key: string;
|
|
108
|
+
/** The timestamp of this event in milliseconds */
|
|
109
|
+
timestamp: number;
|
|
110
|
+
/** The original event model */
|
|
111
|
+
event: SpanEvent;
|
|
112
|
+
}
|
|
113
|
+
export type TraceNode = RootNode | SpanNode;
|
|
114
|
+
export interface VisibleSpan extends SpanNode {
|
|
115
|
+
/**
|
|
116
|
+
* The ref for this span's element in the DOM
|
|
117
|
+
*/
|
|
118
|
+
ref?: MutableRefObject<HTMLButtonElement | null>;
|
|
119
|
+
/**
|
|
120
|
+
* The y position of this span (in # of rows)
|
|
121
|
+
*/
|
|
122
|
+
row: number;
|
|
123
|
+
/**
|
|
124
|
+
* Whether the CursorMarker is intersecting this span
|
|
125
|
+
*/
|
|
126
|
+
isHovered: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Whether this is the selected span
|
|
129
|
+
*/
|
|
130
|
+
isSelected: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Whether this node is visible (based on its size on screen)
|
|
133
|
+
*/
|
|
134
|
+
isVisible: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Events also need to be able to hold a ref to their element in the DOM
|
|
137
|
+
*/
|
|
138
|
+
events?: VisibleSpanEvent[];
|
|
139
|
+
}
|
|
140
|
+
export interface VisibleSpanEvent extends SpanNodeEvent {
|
|
141
|
+
/**
|
|
142
|
+
* The ref for this span's element in the DOM
|
|
143
|
+
*/
|
|
144
|
+
ref?: MutableRefObject<HTMLDivElement | null>;
|
|
145
|
+
/**
|
|
146
|
+
* Whether the CursorMarker is intersecting this span
|
|
147
|
+
*/
|
|
148
|
+
isHovered: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface ScrollSnapshot {
|
|
151
|
+
anchorT: number;
|
|
152
|
+
anchorX: number;
|
|
153
|
+
scrollLeft: number;
|
|
154
|
+
scrollTop: number;
|
|
155
|
+
startTime: number;
|
|
156
|
+
endTime: number;
|
|
157
|
+
startRow: number;
|
|
158
|
+
endRow: number;
|
|
159
|
+
scale: number;
|
|
160
|
+
}
|
|
161
|
+
export type WorkerRequest = {
|
|
162
|
+
requestId: number;
|
|
163
|
+
} & ({
|
|
164
|
+
type: 'calculateSpanPositions';
|
|
165
|
+
root: RootNode;
|
|
166
|
+
} | {
|
|
167
|
+
type: 'filterSpans';
|
|
168
|
+
root: RootNode;
|
|
169
|
+
filter: string;
|
|
170
|
+
});
|
|
171
|
+
export type WorkerResponse = {
|
|
172
|
+
requestId: number;
|
|
173
|
+
} & ({
|
|
174
|
+
type: 'setRowsResult';
|
|
175
|
+
rows: VisibleSpan[][];
|
|
176
|
+
isEnd: boolean;
|
|
177
|
+
} | {
|
|
178
|
+
type: 'updateHighlight';
|
|
179
|
+
matches: Set<string>;
|
|
180
|
+
});
|
|
181
|
+
/**
|
|
182
|
+
* Represents one link to a page related to the selected
|
|
183
|
+
* span in the detail panel.
|
|
184
|
+
*/
|
|
185
|
+
export interface QuickLink {
|
|
186
|
+
/** Used as a React key and the user-facing name for the link */
|
|
187
|
+
key: string;
|
|
188
|
+
/** Until this Promise is fulfilled, the row will render with a skeleton for the value. */
|
|
189
|
+
value: Promise<QuickLinkValue>;
|
|
190
|
+
}
|
|
191
|
+
export interface QuickLinkValue {
|
|
192
|
+
/** The visible components for the right side of this link */
|
|
193
|
+
label: ReactNode;
|
|
194
|
+
/** A special suffix to show for this link, defaults to the ExternalLink icon */
|
|
195
|
+
icon?: ReactNode;
|
|
196
|
+
/** The href that this link will open when clicked */
|
|
197
|
+
href: string;
|
|
198
|
+
}
|
|
199
|
+
export type GetQuickLinks = (node: Span) => QuickLink[];
|
|
200
|
+
export {};
|
|
201
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/trace-viewer/types.ts"],"names":[],"mapp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I,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACtB,CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,0FAA0F;IAC1F,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB,gFAAgF;IAChF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/trace-viewer/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const SEARCH_HEIGHT = 40;
|
|
2
|
+
export declare const SEARCH_GAP = 8;
|
|
3
|
+
export declare const MAP_HEIGHT = 56;
|
|
4
|
+
export declare const TIMELINE_PADDING = 8;
|
|
5
|
+
export declare const ROW_PADDING = 2;
|
|
6
|
+
export declare const ROW_HEIGHT = 24;
|
|
7
|
+
export declare const MARKER_HEIGHT = 24;
|
|
8
|
+
export declare const MARKER_NOTCH_HEIGHT = 8;
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,mBAAmB,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const SEARCH_HEIGHT = 40;
|
|
2
|
+
export const SEARCH_GAP = 8;
|
|
3
|
+
export const MAP_HEIGHT = 56;
|
|
4
|
+
export const TIMELINE_PADDING = 8;
|
|
5
|
+
export const ROW_PADDING = 2;
|
|
6
|
+
export const ROW_HEIGHT = 24;
|
|
7
|
+
export const MARKER_HEIGHT = 24;
|
|
8
|
+
export const MARKER_NOTCH_HEIGHT = 8;
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/trace-viewer/util/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAC5B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAC7B,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollbar-width.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/scrollbar-width.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,QAAO,MAYvC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const detectScrollbarWidth = () => {
|
|
2
|
+
if (!('document' in globalThis))
|
|
3
|
+
return 0;
|
|
4
|
+
const size = 400;
|
|
5
|
+
const container = document.createElement('div');
|
|
6
|
+
container.style.width = `${size}px`;
|
|
7
|
+
container.style.height = `${size}px`;
|
|
8
|
+
container.style.overflow = 'scroll';
|
|
9
|
+
document.body.appendChild(container);
|
|
10
|
+
const scrollbarWidth = size - container.scrollWidth;
|
|
11
|
+
container.remove();
|
|
12
|
+
return scrollbarWidth;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=scrollbar-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollbar-width.js","sourceRoot":"","sources":["../../../src/trace-viewer/util/scrollbar-width.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAW,EAAE;IAC/C,IAAI,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC;QAAE,OAAO,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,GAAG,CAAC;IACjB,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC;IACpC,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC;IACrC,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC;IACpD,SAAS,CAAC,MAAM,EAAE,CAAC;IAEnB,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function getHighResInMs([seconds, nanoseconds]: [
|
|
2
|
+
number,
|
|
3
|
+
number
|
|
4
|
+
]): number;
|
|
5
|
+
export declare function getMsInHighRes(ms: number): [number, number];
|
|
6
|
+
export declare function formatDuration(ms: number): string;
|
|
7
|
+
export declare function formatTimeSelection(ms: number): string;
|
|
8
|
+
//# sourceMappingURL=timing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/timing.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE;IACrD,MAAM;IACN,MAAM;CACP,GAAG,MAAM,CAET;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE3D;AAMD,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAOjD;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKtD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function getHighResInMs([seconds, nanoseconds]) {
|
|
2
|
+
return seconds * 1000 + nanoseconds / 1e6;
|
|
3
|
+
}
|
|
4
|
+
export function getMsInHighRes(ms) {
|
|
5
|
+
return [Math.floor(ms / 1000), (ms % 1000) * 1000];
|
|
6
|
+
}
|
|
7
|
+
const durationFormatter = new Intl.NumberFormat(undefined, {
|
|
8
|
+
maximumFractionDigits: 2,
|
|
9
|
+
});
|
|
10
|
+
export function formatDuration(ms) {
|
|
11
|
+
if (ms === 0) {
|
|
12
|
+
return '0';
|
|
13
|
+
}
|
|
14
|
+
else if (ms >= 1000) {
|
|
15
|
+
return `${durationFormatter.format(ms / 1000)}s`;
|
|
16
|
+
}
|
|
17
|
+
return `${durationFormatter.format(ms)}ms`;
|
|
18
|
+
}
|
|
19
|
+
const timeSelectionFormatter = new Intl.NumberFormat(undefined, {
|
|
20
|
+
minimumFractionDigits: 2,
|
|
21
|
+
maximumFractionDigits: 2,
|
|
22
|
+
});
|
|
23
|
+
export function formatTimeSelection(ms) {
|
|
24
|
+
if (ms >= 1000) {
|
|
25
|
+
return `${timeSelectionFormatter.format(ms / 1000)}s`;
|
|
26
|
+
}
|
|
27
|
+
return `${timeSelectionFormatter.format(ms)}ms`;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=timing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing.js","sourceRoot":"","sources":["../../../src/trace-viewer/util/timing.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,CAAC,OAAO,EAAE,WAAW,CAGnD;IACC,OAAO,OAAO,GAAG,IAAI,GAAG,WAAW,GAAG,GAAG,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;IACzD,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,GAAG,CAAC;IACb,CAAC;SAAM,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QACtB,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED,MAAM,sBAAsB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE;IAC9D,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,GAAG,sBAAsB,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IACxD,CAAC;IACD,OAAO,GAAG,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RootNode, SpanNode, Trace, TraceNode, VisibleSpan } from '../types';
|
|
2
|
+
export declare const parseTrace: (trace: Trace) => {
|
|
3
|
+
root: RootNode;
|
|
4
|
+
map: Record<string, SpanNode>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Adds a node to a row and attempts to find the ideal placement
|
|
8
|
+
* within an existing row, creating a new one if necessary
|
|
9
|
+
*/
|
|
10
|
+
export declare const addToRow: (placed: VisibleSpan[][], node: VisibleSpan, precision: number) => void;
|
|
11
|
+
export declare const spanVisiblityHelper: (node: TraceNode, scale: number, visible: VisibleSpan[]) => void;
|
|
12
|
+
export declare const adjustSpanVisibility: (span: VisibleSpan, _scale: number) => boolean;
|
|
13
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EAER,QAAQ,EAER,KAAK,EACL,SAAS,EACT,WAAW,EACZ,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,KACX;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAuLjD,CAAC;AAgBF;;;GAGG;AACH,eAAO,MAAM,QAAQ,GACnB,QAAQ,WAAW,EAAE,EAAE,EACvB,MAAM,WAAW,EACjB,WAAW,MAAM,KAChB,IAoBF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,EACf,OAAO,MAAM,EACb,SAAS,WAAW,EAAE,KACrB,IAeF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,MAAM,WAAW,EACjB,QAAQ,MAAM,KACb,OAMF,CAAC"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { getHighResInMs, getMsInHighRes } from './timing';
|
|
2
|
+
export const parseTrace = (trace) => {
|
|
3
|
+
const { spans } = trace;
|
|
4
|
+
const root = {
|
|
5
|
+
startTime: 0,
|
|
6
|
+
endTime: 0,
|
|
7
|
+
duration: 0,
|
|
8
|
+
depth: 0,
|
|
9
|
+
children: [],
|
|
10
|
+
};
|
|
11
|
+
const map = {};
|
|
12
|
+
const resourceIndices = new Map();
|
|
13
|
+
const getResourceIndex = (resource) => {
|
|
14
|
+
const existing = resourceIndices.get(resource);
|
|
15
|
+
if (existing)
|
|
16
|
+
return existing;
|
|
17
|
+
const index = resourceIndices.size + 1;
|
|
18
|
+
resourceIndices.set(resource, index);
|
|
19
|
+
return index;
|
|
20
|
+
};
|
|
21
|
+
let hasUserSpans = false;
|
|
22
|
+
for (const span of spans) {
|
|
23
|
+
const startTime = getHighResInMs(span.startTime);
|
|
24
|
+
const endTime = getHighResInMs(span.endTime);
|
|
25
|
+
const duration = getHighResInMs(span.duration);
|
|
26
|
+
if (endTime > root.endTime) {
|
|
27
|
+
root.endTime = endTime;
|
|
28
|
+
root.duration = endTime - root.startTime;
|
|
29
|
+
}
|
|
30
|
+
if (root.startTime === 0 || startTime < root.startTime) {
|
|
31
|
+
root.startTime = startTime;
|
|
32
|
+
root.duration = root.endTime - startTime;
|
|
33
|
+
}
|
|
34
|
+
const isVercelResource = span.resource.startsWith('vercel.');
|
|
35
|
+
if (!isVercelResource) {
|
|
36
|
+
hasUserSpans = true;
|
|
37
|
+
}
|
|
38
|
+
const isVercel = isVercelResource &&
|
|
39
|
+
(span.resource !== 'vercel.serverless-runtime' ||
|
|
40
|
+
!('http.method' in span.attributes));
|
|
41
|
+
const resourceIndex = isVercel ? 0 : getResourceIndex(span.resource);
|
|
42
|
+
let label;
|
|
43
|
+
if (isVercel) {
|
|
44
|
+
label = `▲ ${span.name}`;
|
|
45
|
+
}
|
|
46
|
+
map[span.spanId] = {
|
|
47
|
+
parent: null,
|
|
48
|
+
startTime,
|
|
49
|
+
endTime,
|
|
50
|
+
duration,
|
|
51
|
+
span,
|
|
52
|
+
depth: 0,
|
|
53
|
+
label,
|
|
54
|
+
events: parseEvents(span),
|
|
55
|
+
isVercel,
|
|
56
|
+
children: [],
|
|
57
|
+
resourceIndex,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const addTo = (node, parentId) => {
|
|
61
|
+
let parent;
|
|
62
|
+
if (parentId) {
|
|
63
|
+
parent = map[parentId];
|
|
64
|
+
if (!parent) {
|
|
65
|
+
if (process.env.NODE_ENV === 'development') {
|
|
66
|
+
console.warn('Could not find parent span with spanId: %s', parentId);
|
|
67
|
+
}
|
|
68
|
+
parent = root;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
parent = root;
|
|
73
|
+
}
|
|
74
|
+
node.parent = parent;
|
|
75
|
+
parent.children.push(node);
|
|
76
|
+
};
|
|
77
|
+
const updateDepth = (node) => {
|
|
78
|
+
if ('parent' in node) {
|
|
79
|
+
node.depth = node.parent.depth + 1;
|
|
80
|
+
}
|
|
81
|
+
for (const child of node.children) {
|
|
82
|
+
updateDepth(child);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
let hintIdCounter = 1;
|
|
86
|
+
const addInstrumentationHint = (node, name) => {
|
|
87
|
+
if ('parent' in node) {
|
|
88
|
+
if (node.span.name === name) {
|
|
89
|
+
let waitUntilStart = node.endTime;
|
|
90
|
+
// Detect the parent that's most likely to be at the bottom of the UI
|
|
91
|
+
const findParent = (span) => {
|
|
92
|
+
if (!span.children.length) {
|
|
93
|
+
if (span.span.name === 'waitUntil') {
|
|
94
|
+
waitUntilStart = span.startTime;
|
|
95
|
+
return span.parent;
|
|
96
|
+
}
|
|
97
|
+
return span;
|
|
98
|
+
}
|
|
99
|
+
return (span.children
|
|
100
|
+
.map(findParent)
|
|
101
|
+
.sort((a, b) => a.duration - b.duration)[0] || span);
|
|
102
|
+
};
|
|
103
|
+
const parent = findParent(node);
|
|
104
|
+
const spanId = `instrumentation-hint-${hintIdCounter++}`;
|
|
105
|
+
const offset = node.duration * 0.05;
|
|
106
|
+
const startTime = node.startTime + offset;
|
|
107
|
+
const endTime = Math.max(startTime + offset, Math.min(waitUntilStart - node.duration * 0.01, node.endTime - offset));
|
|
108
|
+
const duration = endTime - startTime;
|
|
109
|
+
const hint = {
|
|
110
|
+
parent,
|
|
111
|
+
startTime,
|
|
112
|
+
endTime,
|
|
113
|
+
duration,
|
|
114
|
+
span: {
|
|
115
|
+
spanId,
|
|
116
|
+
name: 'Add your spans here',
|
|
117
|
+
resource: '',
|
|
118
|
+
kind: 0,
|
|
119
|
+
library: {
|
|
120
|
+
name: '',
|
|
121
|
+
},
|
|
122
|
+
status: {
|
|
123
|
+
code: 200,
|
|
124
|
+
},
|
|
125
|
+
traceFlags: 0,
|
|
126
|
+
attributes: {},
|
|
127
|
+
links: [],
|
|
128
|
+
events: [],
|
|
129
|
+
startTime: getMsInHighRes(startTime),
|
|
130
|
+
endTime: getMsInHighRes(endTime),
|
|
131
|
+
duration: getMsInHighRes(duration),
|
|
132
|
+
},
|
|
133
|
+
depth: node.depth + 1,
|
|
134
|
+
isVercel: false,
|
|
135
|
+
isInstrumentationHint: true,
|
|
136
|
+
children: [],
|
|
137
|
+
resourceIndex: 1,
|
|
138
|
+
};
|
|
139
|
+
parent.children.push(hint);
|
|
140
|
+
map[spanId] = hint;
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
for (const child of node.children) {
|
|
145
|
+
if (addInstrumentationHint(child, name))
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
return false;
|
|
149
|
+
};
|
|
150
|
+
// Create tree by matching nodes to their parents
|
|
151
|
+
for (const node of Object.values(map)) {
|
|
152
|
+
addTo(node, node.span.parentSpanId);
|
|
153
|
+
}
|
|
154
|
+
// Adjust depth of each node now that the tree is fully constructed
|
|
155
|
+
updateDepth(root);
|
|
156
|
+
// Add hints in the places where user spans would appear
|
|
157
|
+
if (!hasUserSpans) {
|
|
158
|
+
for (const name of [
|
|
159
|
+
'Invoke Function',
|
|
160
|
+
'Invoke Middleware',
|
|
161
|
+
'Vercel Runtime',
|
|
162
|
+
]) {
|
|
163
|
+
if (addInstrumentationHint(root, name))
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { root, map };
|
|
168
|
+
};
|
|
169
|
+
const parseEvents = (span) => {
|
|
170
|
+
if (!span.events.length)
|
|
171
|
+
return;
|
|
172
|
+
const keyPrefix = `${span.spanId}:ev`;
|
|
173
|
+
return span.events
|
|
174
|
+
.map((event, index) => ({
|
|
175
|
+
key: `${keyPrefix}${index}`,
|
|
176
|
+
timestamp: getHighResInMs(event.timestamp),
|
|
177
|
+
event,
|
|
178
|
+
}))
|
|
179
|
+
.sort((a, b) => a.timestamp - b.timestamp);
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Adds a node to a row and attempts to find the ideal placement
|
|
183
|
+
* within an existing row, creating a new one if necessary
|
|
184
|
+
*/
|
|
185
|
+
export const addToRow = (placed, node, precision) => {
|
|
186
|
+
const parent = node.parent;
|
|
187
|
+
for (let y = (parent?.row || -1) + 1;; ++y) {
|
|
188
|
+
let row = placed[y];
|
|
189
|
+
if (!row) {
|
|
190
|
+
row = [];
|
|
191
|
+
placed.push(row);
|
|
192
|
+
}
|
|
193
|
+
else if (!row.every(({ startTime, endTime }) => startTime + precision > node.endTime ||
|
|
194
|
+
endTime - precision < node.startTime)) {
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
node.row = y;
|
|
198
|
+
row.push(node);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
export const spanVisiblityHelper = (node, scale, visible) => {
|
|
203
|
+
if ('parent' in node) {
|
|
204
|
+
const n = node;
|
|
205
|
+
n.row = -1;
|
|
206
|
+
// Always make spans visible regardless of width
|
|
207
|
+
n.isVisible = true;
|
|
208
|
+
n.isHovered = false;
|
|
209
|
+
if (!n.isVisible)
|
|
210
|
+
return;
|
|
211
|
+
visible.push(n);
|
|
212
|
+
}
|
|
213
|
+
for (const child of node.children) {
|
|
214
|
+
spanVisiblityHelper(child, scale, visible);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
export const adjustSpanVisibility = (span, _scale) => {
|
|
218
|
+
// Always make spans visible regardless of width
|
|
219
|
+
span.isVisible = true;
|
|
220
|
+
span.isHovered = false;
|
|
221
|
+
return span.isVisible;
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/trace-viewer/util/tree.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAY,EACuC,EAAE;IACrD,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,MAAM,IAAI,GAAa;QACrB,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,EAAE;KACb,CAAC;IACF,MAAM,GAAG,GAA6B,EAAE,CAAC;IAEzC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClD,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAU,EAAE;QACpD,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAE9B,MAAM,K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IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAEvB,OAAO,IAAI,CAAC,SAAS,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CSSProperties, MutableRefObject } from 'react';
|
|
2
|
+
type SetStyle = (propertyName: string, value: string | undefined) => void;
|
|
3
|
+
interface ImmediateStyle {
|
|
4
|
+
setStyle: SetStyle;
|
|
5
|
+
styleRef: MutableRefObject<CSSProperties>;
|
|
6
|
+
style: CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Update an element's style without forcing renders, but in a way that is still
|
|
10
|
+
* safe if the element re-renders for another reason.
|
|
11
|
+
* @returns The current style & a method to update the style
|
|
12
|
+
*/
|
|
13
|
+
export declare function useImmediateStyle(ref: MutableRefObject<HTMLElement | null>): ImmediateStyle;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=use-immediate-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-immediate-style.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/use-immediate-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG7D,KAAK,QAAQ,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;AAE1E,UAAU,cAAc;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC1C,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,GACxC,cAAc,CAiBhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Update an element's style without forcing renders, but in a way that is still
|
|
4
|
+
* safe if the element re-renders for another reason.
|
|
5
|
+
* @returns The current style & a method to update the style
|
|
6
|
+
*/
|
|
7
|
+
export function useImmediateStyle(ref) {
|
|
8
|
+
const styleRef = useRef({});
|
|
9
|
+
const setStyle = useCallback((propertyName, value) => {
|
|
10
|
+
// @ts-expect-error typeof keyof CSSProperties is too big of a union
|
|
11
|
+
styleRef.current[propertyName] = value;
|
|
12
|
+
if (!ref.current)
|
|
13
|
+
return;
|
|
14
|
+
if (!value) {
|
|
15
|
+
ref.current.style.removeProperty(propertyName);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
ref.current.style.setProperty(propertyName, value);
|
|
19
|
+
}, [ref]);
|
|
20
|
+
return { setStyle, styleRef, style: { ...styleRef.current } };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use-immediate-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-immediate-style.js","sourceRoot":"","sources":["../../../src/trace-viewer/util/use-immediate-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAU5C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,GAAyC;IAEzC,MAAM,QAAQ,GAAG,MAAM,CAAgB,EAAE,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;QACtB,oEAAoE;QACpE,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;QACD,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC,EACD,CAAC,GAAG,CAAC,CACN,CAAC;IAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VisibleSpan, VisibleSpanEvent } from '../types';
|
|
2
|
+
export declare const useStreamingSpans: (highlightedSpans?: string[]) => {
|
|
3
|
+
rows: VisibleSpan[][];
|
|
4
|
+
spans: VisibleSpan[];
|
|
5
|
+
events: VisibleSpanEvent[];
|
|
6
|
+
scale: number;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=use-streaming-spans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-streaming-spans.d.ts","sourceRoot":"","sources":["../../../src/trace-viewer/util/use-streaming-spans.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAsBlB,eAAO,MAAM,iBAAiB,GAC5B,mBAAmB,MAAM,EAAE,KAC1B;IACD,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC;IACtB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CAyVf,CAAC"}
|