@mechane-ai/elements 0.58.1 → 0.60.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/README.md +55 -54
- package/dist/ai.js +1 -1
- package/dist/catalog.json +37 -1
- package/dist/chart-range-Du1gDxCY.js +163 -0
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/figure.js +2 -2
- package/dist/charts/timeline.js +3 -1
- package/dist/content.js +1 -1
- package/dist/kits/operations.js +2 -2
- package/dist/kits/research.js +2 -2
- package/dist/packages/charts/src/timeline/index.d.ts +5 -1
- package/dist/packages/charts/src/timeline/trace-timeline-layout.d.ts +85 -0
- package/dist/packages/charts/src/timeline/trace-timeline.d.ts +37 -0
- package/dist/packages/charts/src/timeline/waterfall.d.ts +23 -7
- package/dist/packages/content/src/has-renderable-node.d.ts +2 -0
- package/dist/packages/content/src/index.d.ts +1 -1
- package/dist/packages/content/src/playback-bar.d.ts +11 -4
- package/dist/packages/content/src/timeline-scrubber.d.ts +6 -2
- package/dist/src-BAlO76fa.js +1140 -0
- package/dist/styles2.css +47 -7
- package/dist/{time-series-CoAtNizi.js → time-series-BbUBF3IE.js} +521 -679
- package/dist/timeline-C1d9YJlJ.js +620 -0
- package/dist/waterfall-Dre6i02Z.js +684 -0
- package/package.json +1 -1
- package/skills/use-elements/SKILL.md +18 -18
- package/dist/src-DWKqgI2I.js +0 -957
- package/dist/waterfall-BjUXqaWu.js +0 -615
|
@@ -3,6 +3,7 @@ import type { ReactNode, Ref } from 'react';
|
|
|
3
3
|
import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
|
|
4
4
|
import type { ValueFormat } from '../figure/figure-format.ts';
|
|
5
5
|
import type { FigureProps } from '../figure/figure-props.ts';
|
|
6
|
+
import type { NumericDomain } from '../plot/scale.ts';
|
|
6
7
|
/** A row's timing: two recorded endpoints, one recorded instant, or none. Nothing is drawn from a missing endpoint. */
|
|
7
8
|
export type WaterfallGeometry = {
|
|
8
9
|
readonly kind: 'interval';
|
|
@@ -15,11 +16,17 @@ export type WaterfallGeometry = {
|
|
|
15
16
|
} | {
|
|
16
17
|
readonly kind: 'unavailable';
|
|
17
18
|
};
|
|
18
|
-
/** The
|
|
19
|
-
export type WaterfallTone =
|
|
19
|
+
/** The hues a waterfall row takes: neutral, semantic positive/negative, or any numbered series hue. */
|
|
20
|
+
export type WaterfallTone = ChartTone;
|
|
21
|
+
/** Row height density: compact single-line APM rows or comfortable uniform two-line rows. */
|
|
22
|
+
export type WaterfallDensity = 'compact' | 'comfortable';
|
|
20
23
|
/** One timed row. Rows keep the supplied order and share one scale. */
|
|
21
24
|
export type WaterfallItem = {
|
|
22
25
|
readonly id: string;
|
|
26
|
+
/** Optional parent row id to indent nested child spans and enable branch collapse. */
|
|
27
|
+
readonly parentId?: string | undefined;
|
|
28
|
+
/** Optional explicit indentation level (0–6) when `parentId` is omitted. */
|
|
29
|
+
readonly depth?: number | undefined;
|
|
23
30
|
readonly label: string;
|
|
24
31
|
readonly detail: string;
|
|
25
32
|
readonly summary: string;
|
|
@@ -31,23 +38,32 @@ export type WaterfallItem = {
|
|
|
31
38
|
};
|
|
32
39
|
/** Why the selection wants to change: a press or Enter on a row, or a call such as an agent's step. */
|
|
33
40
|
export type WaterfallSelectDetails = Parameters<NonNullable<SpansProps['onValueChange']>>[1];
|
|
41
|
+
/** Props for a uniform-row timing waterfall supporting full series color-coding, tree nesting, and zoom sync. */
|
|
34
42
|
export type WaterfallProps = Pick<FigureProps, 'title' | 'description' | 'report' | 'actions' | 'locale' | 'source' | 'transforms' | 'emptyLabel'> & {
|
|
35
43
|
readonly items: ReadonlyArray<WaterfallItem>;
|
|
36
|
-
/** The time domain every row shares, in the unit of `offsetFormat`. */
|
|
44
|
+
/** The full time domain every row shares, in the unit of `offsetFormat`. */
|
|
37
45
|
readonly start: number;
|
|
38
46
|
readonly end: number;
|
|
47
|
+
/** Optional zoomed time window inside `[start, end]` to sync with a parent timeline. */
|
|
48
|
+
readonly visibleRange?: NumericDomain | undefined;
|
|
39
49
|
readonly rowLabel: string;
|
|
40
50
|
readonly summaryLabel: string;
|
|
51
|
+
/** Uniform row density. Defaults to `'comfortable'`. */
|
|
52
|
+
readonly density?: WaterfallDensity | undefined;
|
|
41
53
|
readonly selected?: string | null | undefined;
|
|
42
54
|
/** The selected row, which takes focus, so an owner can return focus to it. */
|
|
43
55
|
readonly selectedRef?: Ref<HTMLDivElement> | undefined;
|
|
44
56
|
readonly onSelectedChange: (id: string, details: WaterfallSelectDetails) => void;
|
|
57
|
+
/** Optional row ids kept at full emphasis while non-matching rows recede. */
|
|
58
|
+
readonly highlightedIds?: ReadonlyArray<string> | undefined;
|
|
59
|
+
/** Called when the reader activates a row by double-clicking it. */
|
|
60
|
+
readonly onActivate?: ((id: string) => void) | undefined;
|
|
45
61
|
/** How a time from the start of the domain is written, with its unit. */
|
|
46
62
|
readonly offsetFormat: ValueFormat;
|
|
47
63
|
};
|
|
48
64
|
/**
|
|
49
|
-
* Recorded intervals and instants of many rows on one time scale, such as the steps of a request or
|
|
50
|
-
*
|
|
51
|
-
*
|
|
65
|
+
* Recorded intervals and instants of many rows on one time scale, such as the steps of a request or an agent run. Every
|
|
66
|
+
* row keeps a uniform fixed height with single-line ellipsis truncation, supports full series color-coding, optional
|
|
67
|
+
* parent-child hierarchy, and synced zoom windows via `visibleRange`.
|
|
52
68
|
*/
|
|
53
|
-
export declare function Waterfall({ items, start, end, rowLabel, summaryLabel, emptyLabel, selected, selectedRef, onSelectedChange, offsetFormat, ...frame }: WaterfallProps): ReactNode;
|
|
69
|
+
export declare function Waterfall({ items, start, end, visibleRange, rowLabel, summaryLabel, density, emptyLabel, selected, selectedRef, onSelectedChange, highlightedIds, onActivate, offsetFormat, ...frame }: WaterfallProps): ReactNode;
|
|
@@ -10,7 +10,7 @@ export type { StackFrame, StackTraceProps } from './stack-trace.tsx';
|
|
|
10
10
|
export { StackTrace } from './stack-trace.tsx';
|
|
11
11
|
export type { MatchRange, MatchSegment, TextMatchMode, TextMatchProps, TextMatchTone } from './text-match.tsx';
|
|
12
12
|
export { fuzzyScore, matchRanges, matchSegments, TextMatch } from './text-match.tsx';
|
|
13
|
-
export type { TimelineMarker, TimelineMarkerTone, TimelineScrubberProps } from './timeline-scrubber.tsx';
|
|
13
|
+
export type { TimelineMarker, TimelineMarkerTone, TimelineScrubberChangeDetails, TimelineScrubberProps, } from './timeline-scrubber.tsx';
|
|
14
14
|
export { TimelineScrubber } from './timeline-scrubber.tsx';
|
|
15
15
|
export type { TraceStatus, TraceRootProps, TraceGroupProps, TraceItemProps } from './trace.tsx';
|
|
16
16
|
export { Trace } from './trace.tsx';
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { ControlDensity } from '../../core/src/index.ts';
|
|
3
3
|
import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
4
|
-
|
|
4
|
+
type PlaybackBarSpeedProps = {
|
|
5
|
+
readonly speed: number;
|
|
6
|
+
readonly onSpeedChange: (speed: number) => void;
|
|
7
|
+
readonly speeds?: ReadonlyArray<number>;
|
|
8
|
+
} | {
|
|
9
|
+
readonly speed?: never;
|
|
10
|
+
readonly onSpeedChange?: never;
|
|
11
|
+
readonly speeds?: never;
|
|
12
|
+
};
|
|
13
|
+
export type PlaybackBarProps = PlaybackBarSpeedProps & {
|
|
5
14
|
readonly isPlaying: boolean;
|
|
6
15
|
readonly onPlayingChange: (isPlaying: boolean) => void;
|
|
7
16
|
readonly onStepBackward?: () => void;
|
|
8
17
|
readonly onStepForward?: () => void;
|
|
9
|
-
readonly speed?: number;
|
|
10
|
-
readonly speeds?: ReadonlyArray<number>;
|
|
11
|
-
readonly onSpeedChange?: (speed: number) => void;
|
|
12
18
|
readonly readout?: string;
|
|
13
19
|
readonly actions?: ReactNode;
|
|
14
20
|
readonly density?: ControlDensity;
|
|
@@ -24,3 +30,4 @@ export type PlaybackBarProps = {
|
|
|
24
30
|
* and trailing actions. Leaves playback clocks, frame advancement, and media state to the consuming application.
|
|
25
31
|
*/
|
|
26
32
|
export declare function PlaybackBar({ isPlaying, onPlayingChange, onStepBackward, onStepForward, speed, speeds, onSpeedChange, readout, actions, density, isDisabled, playLabel, pauseLabel, label, xstyle, }: PlaybackBarProps): ReactNode;
|
|
33
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { PlacementStyle } from '../../foundations/src/style-composition.ts';
|
|
3
4
|
export type TimelineMarkerTone = 'neutral' | 'positive' | 'warning' | 'negative' | 'accent';
|
|
@@ -7,12 +8,14 @@ export type TimelineMarker = {
|
|
|
7
8
|
readonly tone?: TimelineMarkerTone;
|
|
8
9
|
readonly label: string;
|
|
9
10
|
};
|
|
11
|
+
/** Why the timeline position changed: pointer scrubbing, keyboard stepping, marker navigation, or a call. */
|
|
12
|
+
export type TimelineScrubberChangeDetails = ChangeDetails<'scrub' | 'step-key' | 'marker' | 'imperative'>;
|
|
10
13
|
export type TimelineScrubberProps = {
|
|
11
14
|
readonly value: number;
|
|
12
15
|
readonly max: number;
|
|
13
16
|
readonly min?: number;
|
|
14
17
|
readonly step?: number;
|
|
15
|
-
readonly onValueChange: (value: number) => void;
|
|
18
|
+
readonly onValueChange: (value: number, details?: TimelineScrubberChangeDetails) => void;
|
|
16
19
|
readonly onScrubStart?: () => void;
|
|
17
20
|
readonly onScrubEnd?: () => void;
|
|
18
21
|
readonly markers?: ReadonlyArray<TimelineMarker>;
|
|
@@ -25,6 +28,7 @@ export type TimelineScrubberProps = {
|
|
|
25
28
|
};
|
|
26
29
|
/**
|
|
27
30
|
* Accessible horizontal scrub track for media or simulation timelines with optional clickable event markers. Supports
|
|
28
|
-
* keyboard stepping,
|
|
31
|
+
* keyboard stepping, `[`/`]` and `Alt+Arrow` marker jumping, `Enter`/`Space` marker selection, pointer capture
|
|
32
|
+
* dragging, and `@mechane-ai/elements/agent` inspection while leaving playback timing to the caller.
|
|
29
33
|
*/
|
|
30
34
|
export declare function TimelineScrubber({ value, max, min, step, onValueChange, onScrubStart, onScrubEnd, markers, onMarkerSelect, formatValue, isDisabled, label, xstyle, }: TimelineScrubberProps): ReactNode;
|