@workflow/web 5.0.0-beta.5 → 5.0.0-beta.7
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/build/client/assets/{encryption-CEh0YXii.js → encryption-C69WMRfh.js} +12 -6
- package/build/client/assets/{highlighted-body-B3W2YXNL-L1CrwoL_.js → highlighted-body-B3W2YXNL-Cq4feDhL.js} +1 -1
- package/build/client/assets/{home-B6UmDDP6.js → home-B-DWbULo.js} +3 -3
- package/build/client/assets/{index-B4xuge0I.js → index-Byi8AWfe.js} +31 -0
- package/build/client/assets/{manifest-e4c1c787.js → manifest-21016363.js} +1 -1
- package/build/client/assets/{mermaid-3ZIDBTTL-BQLU7GUr.js → mermaid-3ZIDBTTL-PK-k2mDG.js} +192 -103
- package/build/client/assets/root-B527kgKt.css +1 -0
- package/build/client/assets/{root-Yk3JVwUh.js → root-DDT0W3fG.js} +1 -1
- package/build/client/assets/{run-detail-DMUaWXhb.js → run-detail-COyTZwjr.js} +31 -7
- package/build/client/assets/server-build-BUmla00D.css +1 -0
- package/build/client/assets/{workflow-graph-viewer-yqeN-U_2.js → workflow-graph-viewer-CVUKAMV1.js} +2 -2
- package/build/server/assets/{app-L1V62FgT.js → app-CASBD2Jz.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-CZjJIpdD.js → highlighted-body-B3W2YXNL-DtYGrm0G.js} +2 -2
- package/build/server/assets/{index-BwtNigf1.js → index-B_Gtun0B.js} +3 -3
- package/build/server/assets/{mermaid-3ZIDBTTL-Cc8IPTBj.js → mermaid-3ZIDBTTL-D37Y2lwn.js} +2 -2
- package/build/server/assets/{server-build-DtcOUEHS.js → server-build-BZS28Q46.js} +1270 -959
- package/build/server/assets/{token-DHnArVm7.js → token-98GkKm4t.js} +2 -2
- package/build/server/assets/{token-util-B3uKeZ0s.js → token-util-CHxt50WW.js} +2 -2
- package/build/server/index.js +1 -1
- package/package.json +6 -6
- package/build/client/assets/root-C0Tu5TVN.css +0 -1
- package/build/client/assets/server-build-DqaxIrF0.css +0 -1
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { W as WorkflowRuntimeError } from "./index-
|
|
1
|
+
import { W as WorkflowRuntimeError } from "./index-Byi8AWfe.js";
|
|
2
2
|
import "./index-BsV8i_Jn.js";
|
|
3
3
|
const NONCE_LENGTH = 12;
|
|
4
4
|
const TAG_LENGTH = 128;
|
|
5
5
|
const KEY_LENGTH = 32;
|
|
6
|
-
async function importKey(raw) {
|
|
6
|
+
async function importKey(raw, usages = ["encrypt", "decrypt"]) {
|
|
7
7
|
if (raw.byteLength !== KEY_LENGTH) {
|
|
8
8
|
throw new WorkflowRuntimeError(`Encryption key must be exactly ${KEY_LENGTH} bytes, got ${raw.byteLength}`);
|
|
9
9
|
}
|
|
10
|
-
return globalThis.crypto.subtle.importKey(
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return globalThis.crypto.subtle.importKey(
|
|
11
|
+
"raw",
|
|
12
|
+
raw,
|
|
13
|
+
"AES-GCM",
|
|
14
|
+
false,
|
|
15
|
+
// `KeyUsage` is a DOM-lib type that's not in scope under `es2022`.
|
|
16
|
+
// The `ReadonlyArray<'encrypt' | 'decrypt'>` parameter type matches
|
|
17
|
+
// a strict subset of `KeyUsage[]`, so this cast is sound.
|
|
18
|
+
usages
|
|
19
|
+
);
|
|
14
20
|
}
|
|
15
21
|
async function decrypt(key, data) {
|
|
16
22
|
const minLength = NONCE_LENGTH + TAG_LENGTH / 8;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-
|
|
1
|
+
import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-PK-k2mDG.js";
|
|
2
2
|
import { r as reactExports, j as jsxRuntimeExports } from "./index-BsV8i_Jn.js";
|
|
3
3
|
var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
|
|
4
4
|
let { shikiTheme: l } = reactExports.useContext(R), o = Ks(), [m, i] = reactExports.useState(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as reactExports, D as ReactDOM, j as jsxRuntimeExports, A as Link, f as reactDomExports, C as useSearchParams, B as useNavigate, G as useLocation, w as withComponentProps } from "./index-BsV8i_Jn.js";
|
|
2
|
-
import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as Check, X, q as useControllableState$1, P as Primitive$1, s as composeEventHandlers$1, t as Presence, v as useSize, w as createContextScope$1, x as cancelRun, y as reenqueueRun, z as parseWorkflowName, B as StatusBadge, Z as Zap, F as CircleX, G as RunActionsDropdownItems, H as unwrapServerActionResult, I as WorkflowGraphViewer, T as Tabs, J as TabsList, K as TabsTrigger, L as TabsContent, M as ErrorBoundary } from "./workflow-graph-viewer-
|
|
3
|
-
import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-
|
|
4
|
-
import "./index-
|
|
2
|
+
import { R as ResolveHookModal, S as Send, a as Skeleton, u as unwrapOrThrow, W as WorkflowWebAPIError, b as RelativeTime, A as Alert, C as CircleAlert, c as AlertTitle, d as AlertDescription, g as getErrorMessage, e as CopyableText, D as DropdownMenu, f as DropdownMenuTrigger, E as Ellipsis, h as DropdownMenuContent, i as DropdownMenuItem, j as ChevronRight, r as resumeHook, k as createCollection, l as hideOthers, m as ReactRemoveScroll, n as useDirection, o as ChevronDown, p as Check, X, q as useControllableState$1, P as Primitive$1, s as composeEventHandlers$1, t as Presence, v as useSize, w as createContextScope$1, x as cancelRun, y as reenqueueRun, z as parseWorkflowName, B as StatusBadge, Z as Zap, F as CircleX, G as RunActionsDropdownItems, H as unwrapServerActionResult, I as WorkflowGraphViewer, T as Tabs, J as TabsList, K as TabsTrigger, L as TabsContent, M as ErrorBoundary } from "./workflow-graph-viewer-CVUKAMV1.js";
|
|
3
|
+
import { g as useLayoutEffect2, P as Primitive, c as createLucideIcon, h as useToast, d as cn, D as DEFAULT_PAGE_SIZE, i as fetchRuns, j as fetchHooks, k as getPaginationDisplay, T as Tooltip, a as TooltipTrigger, B as Button, b as TooltipContent, l as fetchEvents, m as useCallbackRef, n as useComposedRefs, A as Anchor, o as composeEventHandlers, p as useId, q as createPopperScope, s as DismissableLayer, v as createContextScope, w as createSlot, C as Content$1, x as useControllableState, y as Root2$1, V as VISUALLY_HIDDEN_STYLES, z as Arrow, E as useComposedRefs$1, u as useServerConfig, t as toast, L as LoaderCircle, F as fetchRun, G as cva, H as Presence$1, I as createContext2, J as fetchWorkflowsManifest } from "./mermaid-3ZIDBTTL-PK-k2mDG.js";
|
|
4
|
+
import "./index-Byi8AWfe.js";
|
|
5
5
|
var PORTAL_NAME$2 = "Portal";
|
|
6
6
|
var Portal$2 = reactExports.forwardRef((props, forwardedRef) => {
|
|
7
7
|
var _a;
|
|
@@ -162,6 +162,9 @@ function buildFramedDetails(hint, slug) {
|
|
|
162
162
|
out.push({ label: "docs", value: `${BASE_URL}/${slug}` });
|
|
163
163
|
return out;
|
|
164
164
|
}
|
|
165
|
+
const ERROR_SLUGS = {
|
|
166
|
+
HOOK_CONFLICT: "hook-conflict"
|
|
167
|
+
};
|
|
165
168
|
class WorkflowError extends Error {
|
|
166
169
|
constructor(message, options) {
|
|
167
170
|
const msgDocs = appendFramedDetails(message, buildFramedDetails(void 0, options == null ? void 0 : options.slug));
|
|
@@ -190,6 +193,25 @@ class WorkflowRuntimeError extends WorkflowError {
|
|
|
190
193
|
return isError(value) && value.name === "WorkflowRuntimeError";
|
|
191
194
|
}
|
|
192
195
|
}
|
|
196
|
+
class HookConflictError extends WorkflowError {
|
|
197
|
+
constructor(token, conflictingRunId) {
|
|
198
|
+
super(`Hook token "${token}" is already in use by another workflow${conflictingRunId ? ` (run "${conflictingRunId}")` : ""}`, {
|
|
199
|
+
slug: ERROR_SLUGS.HOOK_CONFLICT
|
|
200
|
+
});
|
|
201
|
+
__publicField(this, "token");
|
|
202
|
+
// TODO: Make this required once all persisted hook_conflict events and World
|
|
203
|
+
// implementations always include the active hook owner's run ID.
|
|
204
|
+
__publicField(this, "conflictingRunId");
|
|
205
|
+
this.name = "HookConflictError";
|
|
206
|
+
this.token = token;
|
|
207
|
+
if (conflictingRunId !== void 0) {
|
|
208
|
+
this.conflictingRunId = conflictingRunId;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
static is(value) {
|
|
212
|
+
return isError(value) && value.name === "HookConflictError";
|
|
213
|
+
}
|
|
214
|
+
}
|
|
193
215
|
class FatalError extends Error {
|
|
194
216
|
constructor(message) {
|
|
195
217
|
super(message);
|
|
@@ -225,6 +247,7 @@ class RetryableError extends Error {
|
|
|
225
247
|
const VERCEL_403_ERROR_MESSAGE = "Your current vercel account does not have access to this resource. Use `vercel login` or `vercel switch` to ensure you are linked to the right account.";
|
|
226
248
|
const FATAL_ERROR_KEY = Symbol.for("@workflow/errors//FatalError");
|
|
227
249
|
const RETRYABLE_ERROR_KEY = Symbol.for("@workflow/errors//RetryableError");
|
|
250
|
+
const HOOK_CONFLICT_ERROR_KEY = Symbol.for("@workflow/errors//HookConflictError");
|
|
228
251
|
if (typeof globalThis !== "undefined") {
|
|
229
252
|
if (!Object.hasOwn(globalThis, FATAL_ERROR_KEY)) {
|
|
230
253
|
Object.defineProperty(globalThis, FATAL_ERROR_KEY, {
|
|
@@ -242,6 +265,14 @@ if (typeof globalThis !== "undefined") {
|
|
|
242
265
|
configurable: false
|
|
243
266
|
});
|
|
244
267
|
}
|
|
268
|
+
if (!Object.hasOwn(globalThis, HOOK_CONFLICT_ERROR_KEY)) {
|
|
269
|
+
Object.defineProperty(globalThis, HOOK_CONFLICT_ERROR_KEY, {
|
|
270
|
+
value: HookConflictError,
|
|
271
|
+
writable: false,
|
|
272
|
+
enumerable: false,
|
|
273
|
+
configurable: false
|
|
274
|
+
});
|
|
275
|
+
}
|
|
245
276
|
}
|
|
246
277
|
export {
|
|
247
278
|
VERCEL_403_ERROR_MESSAGE as V,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DtOpLtMQ.js","imports":["/assets/index-BsV8i_Jn.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DtOpLtMQ.js","imports":["/assets/index-BsV8i_Jn.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DDT0W3fG.js","imports":["/assets/index-BsV8i_Jn.js","/assets/mermaid-3ZIDBTTL-PK-k2mDG.js"],"css":["/assets/root-B527kgKt.css","/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"]},"routes/home":{"id":"routes/home","parentId":"root","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/home-B-DWbULo.js","imports":["/assets/index-BsV8i_Jn.js","/assets/workflow-graph-viewer-CVUKAMV1.js","/assets/mermaid-3ZIDBTTL-PK-k2mDG.js","/assets/index-Byi8AWfe.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"]},"routes/run-detail":{"id":"routes/run-detail","parentId":"root","path":"run/:runId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/run-detail-COyTZwjr.js","imports":["/assets/index-BsV8i_Jn.js","/assets/workflow-graph-viewer-CVUKAMV1.js","/assets/mermaid-3ZIDBTTL-PK-k2mDG.js","/assets/encryption-C69WMRfh.js","/assets/index-Byi8AWfe.js"],"css":["/assets/workflow-graph-viewer-DnlNuQQH.css","/assets/mermaid-3ZIDBTTL-DKxHcEOp.css"]},"routes/api.rpc":{"id":"routes/api.rpc","parentId":"root","path":"api/rpc","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.rpc-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.stream.$streamId":{"id":"routes/api.stream.$streamId","parentId":"root","path":"api/stream/:streamId","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.stream._streamId-l0sNRNKZ.js","imports":[],"css":[]}},"url":"/assets/manifest-21016363.js","version":"21016363"};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/encryption-C69WMRfh.js","assets/index-Byi8AWfe.js","assets/index-BsV8i_Jn.js","assets/highlighted-body-B3W2YXNL-Cq4feDhL.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -10359,7 +10359,7 @@ function hydrateData(value, revivers) {
|
|
|
10359
10359
|
async function hydrateDataWithKey(value, revivers, key) {
|
|
10360
10360
|
if (value instanceof Uint8Array && isEncryptedData(value) && key) {
|
|
10361
10361
|
const { decrypt } = await __vitePreload(async () => {
|
|
10362
|
-
const { decrypt: decrypt2 } = await import("./encryption-
|
|
10362
|
+
const { decrypt: decrypt2 } = await import("./encryption-C69WMRfh.js");
|
|
10363
10363
|
return { decrypt: decrypt2 };
|
|
10364
10364
|
}, true ? __vite__mapDeps([0,1,2]) : void 0);
|
|
10365
10365
|
const { payload } = decodeFormatPrefix(value);
|
|
@@ -15360,6 +15360,7 @@ const StepCompletedEventSchema = BaseEventSchema.extend({
|
|
|
15360
15360
|
eventType: literal("step_completed"),
|
|
15361
15361
|
correlationId: string$2(),
|
|
15362
15362
|
eventData: object({
|
|
15363
|
+
stepName: string$2().optional(),
|
|
15363
15364
|
result: SerializedDataSchema
|
|
15364
15365
|
})
|
|
15365
15366
|
});
|
|
@@ -15367,6 +15368,7 @@ const StepFailedEventSchema = BaseEventSchema.extend({
|
|
|
15367
15368
|
eventType: literal("step_failed"),
|
|
15368
15369
|
correlationId: string$2(),
|
|
15369
15370
|
eventData: object({
|
|
15371
|
+
stepName: string$2().optional(),
|
|
15370
15372
|
// The thrown value, serialized via the workflow serialization pipeline.
|
|
15371
15373
|
// Can be any JavaScript value (string, number, object, Error, etc.)
|
|
15372
15374
|
error: SerializedDataSchema
|
|
@@ -15376,6 +15378,7 @@ const StepRetryingEventSchema = BaseEventSchema.extend({
|
|
|
15376
15378
|
eventType: literal("step_retrying"),
|
|
15377
15379
|
correlationId: string$2(),
|
|
15378
15380
|
eventData: object({
|
|
15381
|
+
stepName: string$2().optional(),
|
|
15379
15382
|
// The thrown value, serialized via the workflow serialization pipeline.
|
|
15380
15383
|
// Can be any JavaScript value (string, number, object, Error, etc.)
|
|
15381
15384
|
error: SerializedDataSchema,
|
|
@@ -15386,6 +15389,7 @@ const StepStartedEventSchema = BaseEventSchema.extend({
|
|
|
15386
15389
|
eventType: literal("step_started"),
|
|
15387
15390
|
correlationId: string$2(),
|
|
15388
15391
|
eventData: object({
|
|
15392
|
+
stepName: string$2().optional(),
|
|
15389
15393
|
attempt: number$2().optional()
|
|
15390
15394
|
}).optional()
|
|
15391
15395
|
});
|
|
@@ -15411,18 +15415,25 @@ const HookReceivedEventSchema = BaseEventSchema.extend({
|
|
|
15411
15415
|
eventType: literal("hook_received"),
|
|
15412
15416
|
correlationId: string$2(),
|
|
15413
15417
|
eventData: object({
|
|
15418
|
+
token: string$2().optional(),
|
|
15414
15419
|
payload: SerializedDataSchema
|
|
15415
15420
|
})
|
|
15416
15421
|
});
|
|
15417
15422
|
const HookDisposedEventSchema = BaseEventSchema.extend({
|
|
15418
15423
|
eventType: literal("hook_disposed"),
|
|
15419
|
-
correlationId: string$2()
|
|
15424
|
+
correlationId: string$2(),
|
|
15425
|
+
eventData: object({
|
|
15426
|
+
token: string$2().optional()
|
|
15427
|
+
}).optional()
|
|
15420
15428
|
});
|
|
15421
15429
|
const HookConflictEventSchema = BaseEventSchema.extend({
|
|
15422
15430
|
eventType: literal("hook_conflict"),
|
|
15423
15431
|
correlationId: string$2(),
|
|
15424
15432
|
eventData: object({
|
|
15425
|
-
token: string$2()
|
|
15433
|
+
token: string$2(),
|
|
15434
|
+
// TODO: Make this required once all persisted hook_conflict events and
|
|
15435
|
+
// remote World implementations always include the active hook owner's run ID.
|
|
15436
|
+
conflictingRunId: string$2().optional()
|
|
15426
15437
|
})
|
|
15427
15438
|
});
|
|
15428
15439
|
const WaitCreatedEventSchema = BaseEventSchema.extend({
|
|
@@ -15434,7 +15445,10 @@ const WaitCreatedEventSchema = BaseEventSchema.extend({
|
|
|
15434
15445
|
});
|
|
15435
15446
|
const WaitCompletedEventSchema = BaseEventSchema.extend({
|
|
15436
15447
|
eventType: literal("wait_completed"),
|
|
15437
|
-
correlationId: string$2()
|
|
15448
|
+
correlationId: string$2(),
|
|
15449
|
+
eventData: object({
|
|
15450
|
+
resumeAt: date().optional()
|
|
15451
|
+
}).optional()
|
|
15438
15452
|
});
|
|
15439
15453
|
const RunCreatedEventSchema = BaseEventSchema.extend({
|
|
15440
15454
|
eventType: literal("run_created"),
|
|
@@ -15686,7 +15700,7 @@ object({
|
|
|
15686
15700
|
message: string$2(),
|
|
15687
15701
|
stack: string$2().optional(),
|
|
15688
15702
|
code: string$2().optional()
|
|
15689
|
-
// Populated with RunErrorCode values (USER_ERROR, RUNTIME_ERROR) for run_failed events
|
|
15703
|
+
// Populated with RunErrorCode values (USER_ERROR, RUNTIME_ERROR, etc.) for run_failed events
|
|
15690
15704
|
});
|
|
15691
15705
|
const StepStatusSchema = _enum([
|
|
15692
15706
|
"pending",
|
|
@@ -16012,7 +16026,7 @@ async function hydrateResourceIOWithKey(resource, key) {
|
|
|
16012
16026
|
return { hydrateDataWithKey: hydrateDataWithKey3 };
|
|
16013
16027
|
}, true ? void 0 : void 0);
|
|
16014
16028
|
const { importKey } = await __vitePreload(async () => {
|
|
16015
|
-
const { importKey: importKey2 } = await import("./encryption-
|
|
16029
|
+
const { importKey: importKey2 } = await import("./encryption-C69WMRfh.js");
|
|
16016
16030
|
return { importKey: importKey2 };
|
|
16017
16031
|
}, true ? __vite__mapDeps([0,1,2]) : void 0);
|
|
16018
16032
|
const cryptoKey = await importKey(key);
|
|
@@ -43144,7 +43158,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
43144
43158
|
var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
|
|
43145
43159
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
43146
43160
|
var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
|
|
43147
|
-
var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-
|
|
43161
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-Cq4feDhL.js"), true ? __vite__mapDeps([3,2]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
43148
43162
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
43149
43163
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
43150
43164
|
return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
|
|
@@ -43911,7 +43925,7 @@ var Nt = ({ chart: e, className: t, config: o, fullscreen: n = false, showContro
|
|
|
43911
43925
|
const MAP_HEIGHT = 56;
|
|
43912
43926
|
const TIMELINE_PADDING = 8;
|
|
43913
43927
|
const ROW_PADDING = 2;
|
|
43914
|
-
const ROW_HEIGHT
|
|
43928
|
+
const ROW_HEIGHT = 24;
|
|
43915
43929
|
const MARKER_HEIGHT = 24;
|
|
43916
43930
|
const initialState = {
|
|
43917
43931
|
root: {
|
|
@@ -44647,17 +44661,17 @@ function computeIsNearRightSide(node2, root2, scrollSnapshotRef, isHovered) {
|
|
|
44647
44661
|
}
|
|
44648
44662
|
function computeDefaultLayout(node2, root2, scale, scrollSnapshotRef) {
|
|
44649
44663
|
const left = (node2.startTime - root2.startTime) * scale;
|
|
44650
|
-
let top = MARKER_HEIGHT + (ROW_HEIGHT
|
|
44664
|
+
let top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * node2.row;
|
|
44651
44665
|
const actualWidth = node2.duration * scale;
|
|
44652
44666
|
const width = Math.max(actualWidth, MIN_SPAN_WIDTH);
|
|
44653
|
-
let height = ROW_HEIGHT
|
|
44667
|
+
let height = ROW_HEIGHT;
|
|
44654
44668
|
const isHuge = computeIsHuge(actualWidth);
|
|
44655
44669
|
const isSmall = computeIsSmall(actualWidth);
|
|
44656
44670
|
const isHovered = computeIsHovered(node2, isHuge);
|
|
44657
44671
|
const isExpanded = isHovered || Boolean(node2.isSelected);
|
|
44658
44672
|
if (isSmall && !isExpanded) {
|
|
44659
44673
|
height *= 0.4;
|
|
44660
|
-
top += (ROW_HEIGHT
|
|
44674
|
+
top += (ROW_HEIGHT - height) * 0.5;
|
|
44661
44675
|
}
|
|
44662
44676
|
const isNearRightSide = computeIsNearRightSide(node2, root2, scrollSnapshotRef, isExpanded);
|
|
44663
44677
|
return {
|
|
@@ -44823,8 +44837,8 @@ const SpanComponent = reactExports.memo(function SpanComponent2({ node: node2, r
|
|
|
44823
44837
|
layout.isSmall = liveActualWidth < 64;
|
|
44824
44838
|
layout.isHuge = liveActualWidth >= 500;
|
|
44825
44839
|
if (!layout.isSmall) {
|
|
44826
|
-
layout.height = ROW_HEIGHT
|
|
44827
|
-
layout.top = MARKER_HEIGHT + (ROW_HEIGHT
|
|
44840
|
+
layout.height = ROW_HEIGHT;
|
|
44841
|
+
layout.top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * segmentNode.row;
|
|
44828
44842
|
}
|
|
44829
44843
|
}
|
|
44830
44844
|
reactExports.useEffect(() => {
|
|
@@ -44899,7 +44913,7 @@ const SpanEventComponent = reactExports.memo(function SpanEventComponent2({ even
|
|
|
44899
44913
|
}
|
|
44900
44914
|
}
|
|
44901
44915
|
const left = (event.timestamp - root2.startTime) * scale;
|
|
44902
|
-
const top = MARKER_HEIGHT + (ROW_HEIGHT
|
|
44916
|
+
const top = MARKER_HEIGHT + (ROW_HEIGHT + ROW_PADDING) * node2.row;
|
|
44903
44917
|
const isLeftAligned = node2.duration <= 0 || (event.timestamp - node2.startTime) / node2.duration < 0.5;
|
|
44904
44918
|
const customClassName = customSpanEventClassNameFunc ? customSpanEventClassNameFunc(event) : "";
|
|
44905
44919
|
return jsxRuntimeExports.jsxs("div", { title: phaseDuration ? `${displayLabel} ${timestamp}
|
|
@@ -45281,11 +45295,36 @@ function computeSpanGaps(spans, viewStart, viewEnd) {
|
|
|
45281
45295
|
return gaps;
|
|
45282
45296
|
}
|
|
45283
45297
|
const RESOURCE_COLORS = {
|
|
45284
|
-
run: {
|
|
45285
|
-
|
|
45286
|
-
|
|
45287
|
-
|
|
45288
|
-
|
|
45298
|
+
run: {
|
|
45299
|
+
bg: "var(--ds-blue-200)",
|
|
45300
|
+
border: "var(--ds-blue-500)",
|
|
45301
|
+
errorBg: "var(--ds-red-200)",
|
|
45302
|
+
errorBorder: "var(--ds-red-500)"
|
|
45303
|
+
},
|
|
45304
|
+
step: {
|
|
45305
|
+
bg: "var(--ds-green-200)",
|
|
45306
|
+
border: "var(--ds-green-500)",
|
|
45307
|
+
errorBg: "var(--ds-red-200)",
|
|
45308
|
+
errorBorder: "var(--ds-red-500)"
|
|
45309
|
+
},
|
|
45310
|
+
hook: {
|
|
45311
|
+
bg: "var(--ds-amber-200)",
|
|
45312
|
+
border: "var(--ds-amber-500)",
|
|
45313
|
+
errorBg: "var(--ds-red-200)",
|
|
45314
|
+
errorBorder: "var(--ds-red-500)"
|
|
45315
|
+
},
|
|
45316
|
+
sleep: {
|
|
45317
|
+
bg: "var(--ds-purple-200)",
|
|
45318
|
+
border: "var(--ds-purple-500)",
|
|
45319
|
+
errorBg: "var(--ds-red-200)",
|
|
45320
|
+
errorBorder: "var(--ds-red-500)"
|
|
45321
|
+
},
|
|
45322
|
+
default: {
|
|
45323
|
+
bg: "var(--ds-gray-200)",
|
|
45324
|
+
border: "var(--ds-gray-500)",
|
|
45325
|
+
errorBg: "var(--ds-red-200)",
|
|
45326
|
+
errorBorder: "var(--ds-red-500)"
|
|
45327
|
+
}
|
|
45289
45328
|
};
|
|
45290
45329
|
function getResourceColor(resource) {
|
|
45291
45330
|
return RESOURCE_COLORS[resource] ?? RESOURCE_COLORS.default;
|
|
@@ -45478,87 +45517,143 @@ function computeSpanSegments(span) {
|
|
|
45478
45517
|
return [];
|
|
45479
45518
|
}
|
|
45480
45519
|
}
|
|
45481
|
-
const SEGMENT_CONFIG = {
|
|
45482
|
-
queued: { className: "bg-gray-500" },
|
|
45483
|
-
retrying: {
|
|
45484
|
-
className: "box-border bg-gray-500"
|
|
45485
|
-
},
|
|
45486
|
-
waiting: { className: "bg-gray-500" },
|
|
45487
|
-
running: { className: "bg-blue-700" },
|
|
45488
|
-
failed: { className: "bg-red-700" },
|
|
45489
|
-
succeeded: { className: "bg-green-700" },
|
|
45490
|
-
sleeping: { className: "bg-gray-500" },
|
|
45491
|
-
received: { className: "bg-blue-700" }
|
|
45492
|
-
};
|
|
45493
|
-
const BAR_HEIGHT_PX = 24;
|
|
45494
45520
|
const TINY_BAR_BOX_SIZE_PX = 24;
|
|
45495
45521
|
const TINY_BAR_WIDTH_PX = 4;
|
|
45496
|
-
const SEGMENT_GAP_PX = 1;
|
|
45497
|
-
const ROW_HEIGHT = 40;
|
|
45498
|
-
const CONTAINER_PAD_Y = 8;
|
|
45499
|
-
const END_CAP_HEIGHT = 8;
|
|
45500
45522
|
const TIMELINE_PADDING_PX = 16;
|
|
45501
|
-
const
|
|
45502
|
-
|
|
45503
|
-
|
|
45504
|
-
|
|
45505
|
-
|
|
45506
|
-
|
|
45507
|
-
|
|
45508
|
-
|
|
45509
|
-
|
|
45510
|
-
}
|
|
45511
|
-
const
|
|
45523
|
+
const SEGMENT_CLASSES = {
|
|
45524
|
+
queued: "bg-gray-400 border border-gray-500",
|
|
45525
|
+
retrying: "bg-gray-400 border border-gray-500",
|
|
45526
|
+
waiting: "bg-gray-400 border border-gray-500",
|
|
45527
|
+
running: "bg-blue-200 border border-blue-500",
|
|
45528
|
+
failed: "bg-red-200 border border-red-500",
|
|
45529
|
+
succeeded: "bg-green-200 border border-green-500",
|
|
45530
|
+
sleeping: "bg-gray-400 border border-gray-500",
|
|
45531
|
+
received: "bg-blue-200 border border-blue-500"
|
|
45532
|
+
};
|
|
45533
|
+
const TIMELINE_INSET_STYLE = {
|
|
45534
|
+
left: TIMELINE_PADDING_PX,
|
|
45535
|
+
right: TIMELINE_PADDING_PX
|
|
45536
|
+
};
|
|
45537
|
+
function computeBarGeometry(startMs, endMs, viewStart, viewEnd, containerWidth) {
|
|
45538
|
+
const viewDuration = viewEnd - viewStart;
|
|
45539
|
+
const visibleStartMs = Math.max(startMs, viewStart);
|
|
45540
|
+
const visibleEndMs = Math.min(endMs, viewEnd);
|
|
45541
|
+
const visibleDurationMs = Math.max(0, visibleEndMs - visibleStartMs);
|
|
45542
|
+
const widthFrac = viewDuration > 0 ? visibleDurationMs / viewDuration : 0;
|
|
45543
|
+
const visiblePixelWidth = widthFrac * containerWidth;
|
|
45544
|
+
const isTiny = containerWidth > 0 && visiblePixelWidth < TINY_BAR_BOX_SIZE_PX;
|
|
45545
|
+
const extendsOffLeft = startMs < viewStart;
|
|
45546
|
+
const extendsOffRight = endMs > viewEnd;
|
|
45547
|
+
const mode = isTiny && (extendsOffLeft || extendsOffRight) ? { kind: "arrow", direction: extendsOffRight ? "right" : "left" } : isTiny ? { kind: "tiny" } : { kind: "full" };
|
|
45548
|
+
return {
|
|
45549
|
+
mode,
|
|
45550
|
+
leftPct: viewDuration > 0 ? (visibleStartMs - viewStart) / viewDuration * 100 : 0,
|
|
45551
|
+
widthPct: widthFrac * 100,
|
|
45552
|
+
visibleStartMs,
|
|
45553
|
+
visibleEndMs,
|
|
45554
|
+
visiblePixelWidth
|
|
45555
|
+
};
|
|
45556
|
+
}
|
|
45557
|
+
function getBarPositionStyle(geometry) {
|
|
45558
|
+
switch (geometry.mode.kind) {
|
|
45559
|
+
case "arrow":
|
|
45560
|
+
return {
|
|
45561
|
+
left: geometry.mode.direction === "right" ? `calc(100% - ${TINY_BAR_BOX_SIZE_PX}px)` : "0px",
|
|
45562
|
+
width: `${TINY_BAR_BOX_SIZE_PX}px`
|
|
45563
|
+
};
|
|
45564
|
+
case "tiny":
|
|
45565
|
+
return {
|
|
45566
|
+
left: `min(${geometry.leftPct}%, calc(100% - ${TINY_BAR_WIDTH_PX}px))`,
|
|
45567
|
+
width: `${TINY_BAR_WIDTH_PX}px`
|
|
45568
|
+
};
|
|
45569
|
+
case "full":
|
|
45570
|
+
return {
|
|
45571
|
+
left: `${geometry.leftPct}%`,
|
|
45572
|
+
width: `max(${geometry.widthPct}%, 4px)`
|
|
45573
|
+
};
|
|
45574
|
+
}
|
|
45575
|
+
}
|
|
45576
|
+
function projectSegments(segments, spanStartMs, spanDurationMs, geometry) {
|
|
45577
|
+
const visibleDurationMs = geometry.visibleEndMs - geometry.visibleStartMs;
|
|
45578
|
+
if (visibleDurationMs <= 0)
|
|
45579
|
+
return [];
|
|
45580
|
+
return segments.flatMap((seg) => {
|
|
45581
|
+
const segStartMs = spanStartMs + seg.startFraction * spanDurationMs;
|
|
45582
|
+
const segEndMs = spanStartMs + seg.endFraction * spanDurationMs;
|
|
45583
|
+
const startMs = Math.max(segStartMs, geometry.visibleStartMs);
|
|
45584
|
+
const endMs = Math.min(segEndMs, geometry.visibleEndMs);
|
|
45585
|
+
if (endMs <= startMs)
|
|
45586
|
+
return [];
|
|
45587
|
+
const widthFrac = (endMs - startMs) / visibleDurationMs;
|
|
45588
|
+
return [
|
|
45589
|
+
{
|
|
45590
|
+
status: seg.status,
|
|
45591
|
+
leftPct: (startMs - geometry.visibleStartMs) / visibleDurationMs * 100,
|
|
45592
|
+
widthPct: widthFrac * 100,
|
|
45593
|
+
pixelWidth: widthFrac * geometry.visiblePixelWidth,
|
|
45594
|
+
fullDurationMs: (seg.endFraction - seg.startFraction) * spanDurationMs
|
|
45595
|
+
}
|
|
45596
|
+
];
|
|
45597
|
+
});
|
|
45598
|
+
}
|
|
45599
|
+
function DurationLabel({ label }) {
|
|
45600
|
+
return jsxRuntimeExports.jsx("span", { className: "pointer-events-none absolute inset-0 flex items-center justify-start overflow-hidden px-1 text-[10px] font-mono font-medium leading-none whitespace-nowrap text-left text-gray-1000 tabular-nums opacity-0 group-hover/timeline-row:opacity-100", children: label });
|
|
45601
|
+
}
|
|
45602
|
+
function BoundaryArrow({ direction }) {
|
|
45603
|
+
const Icon2 = direction === "right" ? ArrowRight : ArrowLeft;
|
|
45604
|
+
return jsxRuntimeExports.jsx("div", { className: "flex h-6 w-6 items-center justify-center rounded-[0.25rem]", children: jsxRuntimeExports.jsx(Icon2, { className: "size-3 text-gray-900" }) });
|
|
45605
|
+
}
|
|
45606
|
+
function PlainBar({ bg, border, label }) {
|
|
45607
|
+
return jsxRuntimeExports.jsx("div", { className: "relative h-6 w-full min-w-1 rounded-[0.25rem] border", style: { background: bg, borderColor: border }, children: label ? jsxRuntimeExports.jsx(DurationLabel, { label }) : null });
|
|
45608
|
+
}
|
|
45609
|
+
function SegmentBar({ segments }) {
|
|
45610
|
+
return jsxRuntimeExports.jsx("div", { className: "relative h-6 w-full", children: segments.map((seg, i) => {
|
|
45611
|
+
const label = formatDuration(seg.fullDurationMs);
|
|
45612
|
+
const showLabel = seg.pixelWidth >= Math.max(40, label.length * 6 + 12);
|
|
45613
|
+
const isNarrowQueued = seg.status === "queued" && seg.pixelWidth < 20;
|
|
45614
|
+
const overrideBg = isNarrowQueued ? "var(--ds-gray-400)" : void 0;
|
|
45615
|
+
const overrideBorder = isNarrowQueued ? "var(--ds-gray-500)" : void 0;
|
|
45616
|
+
return jsxRuntimeExports.jsx("div", { className: cn$4("absolute h-full rounded-[0.25rem]", SEGMENT_CLASSES[seg.status]), style: {
|
|
45617
|
+
// 1px gap between adjacent segments, distributed equally.
|
|
45618
|
+
left: `calc(${seg.leftPct}% + 0.5px)`,
|
|
45619
|
+
width: `calc(${seg.widthPct}% - 1px)`,
|
|
45620
|
+
minWidth: 1,
|
|
45621
|
+
background: overrideBg,
|
|
45622
|
+
borderColor: overrideBorder
|
|
45623
|
+
}, children: showLabel ? jsxRuntimeExports.jsx(DurationLabel, { label }) : null }, `${seg.status}-${i}`);
|
|
45624
|
+
}) });
|
|
45625
|
+
}
|
|
45626
|
+
const TimelineBar = reactExports.memo(function TimelineBar2({ span, viewStart, viewDuration, containerWidth, isSelected, onSelect }) {
|
|
45512
45627
|
var _a3;
|
|
45513
|
-
const
|
|
45514
|
-
const
|
|
45628
|
+
const startMs = getHighResInMs(span.startTime);
|
|
45629
|
+
const endMs = getHighResInMs(span.endTime);
|
|
45515
45630
|
const totalDurationMs = getSpanDurationMs(span);
|
|
45516
|
-
const
|
|
45517
|
-
const
|
|
45518
|
-
const
|
|
45519
|
-
const leftPct = leftFracRaw * 100;
|
|
45520
|
-
const widthPct = widthFrac * 100;
|
|
45521
|
-
const pixelWidth = widthFrac * containerWidth;
|
|
45522
|
-
const visibleLeftFrac = Math.max(0, Math.min(1, leftFracRaw));
|
|
45523
|
-
const visibleRightFrac = Math.max(0, Math.min(1, rightFracRaw));
|
|
45524
|
-
const visiblePixelWidth = Math.max(0, visibleRightFrac - visibleLeftFrac) * containerWidth;
|
|
45525
|
-
const isTinyBar = containerWidth > 0 && visiblePixelWidth < TINY_BAR_BOX_SIZE_PX;
|
|
45526
|
-
const [isRowHovered, setIsRowHovered] = reactExports.useState(false);
|
|
45527
|
-
const segments = reactExports.useMemo(() => computeSpanSegments(span), [span]);
|
|
45631
|
+
const geometry = reactExports.useMemo(() => computeBarGeometry(startMs, endMs, viewStart, viewStart + viewDuration, containerWidth), [startMs, endMs, viewStart, viewDuration, containerWidth]);
|
|
45632
|
+
const baseSegments = reactExports.useMemo(() => computeSpanSegments(span), [span]);
|
|
45633
|
+
const segments = reactExports.useMemo(() => geometry.mode.kind === "full" ? projectSegments(baseSegments, startMs, totalDurationMs, geometry) : [], [geometry, baseSegments, startMs, totalDurationMs]);
|
|
45528
45634
|
const workflowStatus = (_a3 = span.attributes.data) == null ? void 0 : _a3.status;
|
|
45529
45635
|
const isErrored = span.status.code === 2 || workflowStatus === "failed";
|
|
45530
45636
|
const colors = getResourceColor(span.resource);
|
|
45531
|
-
const
|
|
45532
|
-
const
|
|
45533
|
-
const
|
|
45534
|
-
const
|
|
45535
|
-
const
|
|
45536
|
-
|
|
45537
|
-
|
|
45538
|
-
|
|
45539
|
-
|
|
45540
|
-
|
|
45541
|
-
|
|
45542
|
-
|
|
45543
|
-
|
|
45544
|
-
|
|
45545
|
-
|
|
45546
|
-
|
|
45547
|
-
|
|
45548
|
-
|
|
45549
|
-
|
|
45550
|
-
|
|
45551
|
-
minWidth: 4,
|
|
45552
|
-
background: fallbackColor
|
|
45553
|
-
}, children: showBarDurationLabel ? renderDurationLabel(totalDurationLabel) : null });
|
|
45554
|
-
return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: cn$4("h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200"), onMouseEnter: () => setIsRowHovered(true), onMouseLeave: () => setIsRowHovered(false), onClick, children: jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0", style: {
|
|
45555
|
-
left: TIMELINE_PADDING_PX,
|
|
45556
|
-
right: TIMELINE_PADDING_PX
|
|
45557
|
-
}, children: jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 -translate-y-1/2", style: {
|
|
45558
|
-
left: showBoundaryArrow ? `min(max(${leftPct}%, 0px), calc(100% - ${TINY_BAR_BOX_SIZE_PX}px))` : isTinyBar ? `min(${leftPct}%, calc(100% - ${TINY_BAR_WIDTH_PX}px))` : `${leftPct}%`,
|
|
45559
|
-
width: showBoundaryArrow ? `${TINY_BAR_BOX_SIZE_PX}px` : isTinyBar ? `${TINY_BAR_WIDTH_PX}px` : `max(${widthPct}%, 4px)`,
|
|
45560
|
-
height: BAR_HEIGHT_PX
|
|
45561
|
-
}, children: barContent }) }) });
|
|
45637
|
+
const fallbackBg = isErrored ? colors.errorBg ?? "var(--ds-red-200)" : colors.bg;
|
|
45638
|
+
const fallbackBorder = isErrored ? colors.errorBorder ?? "var(--ds-red-500)" : colors.border;
|
|
45639
|
+
const totalLabel = formatDuration(totalDurationMs);
|
|
45640
|
+
const showTotalLabel = geometry.visiblePixelWidth >= Math.max(40, totalLabel.length * 6 + 12);
|
|
45641
|
+
const handleClick = reactExports.useCallback(() => {
|
|
45642
|
+
onSelect(span.spanId);
|
|
45643
|
+
}, [onSelect, span.spanId]);
|
|
45644
|
+
return jsxRuntimeExports.jsx("div", { role: "treeitem", "aria-selected": isSelected, "aria-expanded": isSelected, "aria-level": 1, className: "group/timeline-row h-10 relative flex items-center hover:bg-gray-100 aria-selected:bg-gray-100 aria-selected:hover:bg-gray-200", onClick: handleClick, children: jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx("div", { className: "absolute top-1/2 h-6 -translate-y-1/2", style: getBarPositionStyle(geometry), children: geometry.mode.kind === "arrow" ? jsxRuntimeExports.jsx(BoundaryArrow, { direction: geometry.mode.direction }) : geometry.mode.kind === "tiny" ? jsxRuntimeExports.jsx("div", { className: "h-6 rounded-[0.25rem] border", style: { background: fallbackBg, borderColor: fallbackBorder } }) : segments.length > 0 ? jsxRuntimeExports.jsx(SegmentBar, { segments }) : jsxRuntimeExports.jsx(PlainBar, { bg: fallbackBg, border: fallbackBorder, label: showTotalLabel ? totalLabel : null }) }) }) });
|
|
45645
|
+
});
|
|
45646
|
+
const DELTA_ROW_HEIGHT_PX = 40;
|
|
45647
|
+
const DELTA_CAP_HEIGHT_PX = 8;
|
|
45648
|
+
const DELTA_ROW_OFFSET_PX = 8;
|
|
45649
|
+
const DeltaIndicator = reactExports.memo(function DeltaIndicator2({ leftFrac, rightFrac, label, rowIndex }) {
|
|
45650
|
+
const centerY = DELTA_ROW_OFFSET_PX + (rowIndex + 1) * DELTA_ROW_HEIGHT_PX;
|
|
45651
|
+
return jsxRuntimeExports.jsxs("div", { className: "absolute pointer-events-none", style: {
|
|
45652
|
+
left: `${leftFrac * 100}%`,
|
|
45653
|
+
width: `${(rightFrac - leftFrac) * 100}%`,
|
|
45654
|
+
top: centerY - DELTA_CAP_HEIGHT_PX / 2,
|
|
45655
|
+
height: DELTA_CAP_HEIGHT_PX
|
|
45656
|
+
}, children: [jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-0 w-px h-full bg-amber-800" }), jsxRuntimeExports.jsx("div", { className: "absolute left-0 right-0 top-1/2 h-px bg-amber-800" }), jsxRuntimeExports.jsx("div", { className: "absolute right-0 top-0 w-px h-full bg-amber-800" }), jsxRuntimeExports.jsx("span", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-label-12 leading-none whitespace-nowrap rounded-xs px-1 py-0.5 text-gray-100 bg-amber-800", children: label })] });
|
|
45562
45657
|
});
|
|
45563
45658
|
function TimelineHeader({ markers: markers2, hoverInfo: hoverInfo2 }) {
|
|
45564
45659
|
return jsxRuntimeExports.jsx("div", { className: "relative bg-background-100 border-b border-gray-alpha-400 h-10 min-h-10 flex items-end px-4 pb-1", children: jsxRuntimeExports.jsxs("div", { className: "relative h-full flex-1", children: [markers2.map((m2) => jsxRuntimeExports.jsx("span", { className: "absolute bottom-1 font-mono text-xs font-normal leading-4 text-gray-900 whitespace-nowrap", style: { left: `${m2.position * 100}%` }, children: m2.label }, `${m2.position}-${m2.label}`)), hoverInfo2 && jsxRuntimeExports.jsx("span", { className: "absolute top-1 pointer-events-none z-10 font-mono text-[11px] leading-4 text-gray-1000 whitespace-nowrap bg-background-100 border border-gray-alpha-400 rounded px-1 -translate-x-1/2", style: { left: `${hoverInfo2.fraction * 100}%` }, children: hoverInfo2.label })] }) });
|
|
@@ -45579,16 +45674,10 @@ function Timeline({ spans, viewStart, viewEnd, markers: markers2, selectedId, on
|
|
|
45579
45674
|
return () => ro2.disconnect();
|
|
45580
45675
|
}, []);
|
|
45581
45676
|
const gaps = reactExports.useMemo(() => computeSpanGaps(spans, viewStart, viewEnd), [spans, viewStart, viewEnd]);
|
|
45582
|
-
return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style:
|
|
45583
|
-
left
|
|
45584
|
-
|
|
45585
|
-
},
|
|
45586
|
-
left: TIMELINE_PADDING_PX,
|
|
45587
|
-
right: TIMELINE_PADDING_PX
|
|
45588
|
-
}, children: jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-400", style: { left: `${hoverFraction * 100}%` } }) }), spans.map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, onClick: () => onSelect(span.spanId) }, span.spanId)), altHeld && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: {
|
|
45589
|
-
left: TIMELINE_PADDING_PX,
|
|
45590
|
-
right: TIMELINE_PADDING_PX
|
|
45591
|
-
}, children: gaps.map((gap) => jsxRuntimeExports.jsx(DeltaIndicator, { leftFrac: gap.leftFrac, rightFrac: gap.rightFrac, label: formatDuration(gap.gapMs, true), rowIndex: gap.rowIndex }, gap.rowIndex)) })] });
|
|
45677
|
+
return jsxRuntimeExports.jsxs("div", { ref: containerRef, className: "relative h-full overflow-hidden", children: [jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: markers2.map((marker2) => (
|
|
45678
|
+
// Skip the "0s" origin marker since the left edge already implies it.
|
|
45679
|
+
Math.abs(marker2.value) > 1e-6 ? jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-300", style: { left: `${marker2.position * 100}%` } }, `${marker2.position}-${marker2.label}`) : null
|
|
45680
|
+
)) }), hoverFraction != null && jsxRuntimeExports.jsx("div", { className: "absolute inset-y-0 pointer-events-none z-10", style: TIMELINE_INSET_STYLE, children: jsxRuntimeExports.jsx("div", { className: "absolute top-0 bottom-0 w-px bg-gray-alpha-500", style: { left: `${hoverFraction * 100}%` } }) }), spans.map((span) => jsxRuntimeExports.jsx(TimelineBar, { span, viewStart, viewDuration, containerWidth: timelineWidth, isSelected: selectedId === span.spanId, onSelect }, span.spanId)), altHeld && jsxRuntimeExports.jsx("div", { "aria-hidden": true, className: "absolute inset-y-0 pointer-events-none", style: TIMELINE_INSET_STYLE, children: gaps.map((gap) => jsxRuntimeExports.jsx(DeltaIndicator, { leftFrac: gap.leftFrac, rightFrac: gap.rightFrac, label: formatDuration(gap.gapMs, true), rowIndex: gap.rowIndex }, gap.rowIndex)) })] });
|
|
45592
45681
|
}
|
|
45593
45682
|
const ActiveSpanContext = reactExports.createContext(null);
|
|
45594
45683
|
ActiveSpanContext.displayName = "ActiveSpanContext";
|