@mechane-ai/elements 0.68.0 → 0.69.1

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.
Files changed (72) hide show
  1. package/dist/ai.js +1 -1
  2. package/dist/{article-Ni152e-v.js → article-CTSxWe4y.js} +1 -1
  3. package/dist/article.js +1 -1
  4. package/dist/catalog.json +82 -7
  5. package/dist/{categorical-values-6Iz03F1i.js → categorical-values-DwomVcSd.js} +1 -1
  6. package/dist/charts/cartesian.js +1 -1
  7. package/dist/charts/comparison.js +1 -1
  8. package/dist/charts/distribution.js +1 -1
  9. package/dist/charts/figure.js +12 -12
  10. package/dist/charts/graph.js +1 -1
  11. package/dist/charts/hierarchy.js +1 -1
  12. package/dist/charts/image.js +1 -1
  13. package/dist/charts/matrix.js +1 -1
  14. package/dist/charts/plot.js +6 -6
  15. package/dist/charts/relationship.js +1 -1
  16. package/dist/charts/text.js +1 -1
  17. package/dist/charts/timeline.js +2 -2
  18. package/dist/charts/trend.js +1 -1
  19. package/dist/charts.js +2 -2
  20. package/dist/content.js +1 -1
  21. package/dist/{dumbbell-plot-jaQvOctJ.js → dumbbell-plot-S4RyfxmW.js} +4 -4
  22. package/dist/{embedding-map-DnZL1kvY.js → embedding-map-Bm7aTA6z.js} +3 -3
  23. package/dist/{figure-frame-96zFqsWz.js → figure-frame-BHCNceS4.js} +1 -1
  24. package/dist/{image-grid-B6fdmE9c.js → image-grid-TTrLxvaI.js} +2 -2
  25. package/dist/kits/evaluation.js +3 -3
  26. package/dist/kits/interpretability.js +6 -6
  27. package/dist/kits/operations.js +3 -3
  28. package/dist/kits/research.js +801 -356
  29. package/dist/kits/training.js +2 -2
  30. package/dist/locate-Dcq5ZZSk.js +14 -0
  31. package/dist/mdx.js +2 -2
  32. package/dist/packages/charts/src/plot/index.d.ts +1 -0
  33. package/dist/packages/charts/src/plot/locate.d.ts +3 -1
  34. package/dist/packages/charts/src/plot/spatial-layer.d.ts +5 -1
  35. package/dist/packages/charts/src/plot/step-history.d.ts +13 -0
  36. package/dist/packages/charts/src/timeline/event-strip.d.ts +3 -3
  37. package/dist/packages/content/src/timeline-scrubber.d.ts +3 -1
  38. package/dist/packages/kits/src/research/index.d.ts +8 -1
  39. package/dist/packages/kits/src/research/motion-clip.d.ts +1 -39
  40. package/dist/packages/kits/src/research/motion-figure.d.ts +4 -1
  41. package/dist/packages/kits/src/research/motion-frame.d.ts +3 -3
  42. package/dist/packages/kits/src/research/motion-inspection.d.ts +14 -0
  43. package/dist/packages/kits/src/research/motion-location.d.ts +9 -0
  44. package/dist/packages/kits/src/research/motion-scene.d.ts +9 -2
  45. package/dist/packages/kits/src/research/motion-types.d.ts +54 -0
  46. package/dist/packages/kits/src/research/motion-view.d.ts +9 -0
  47. package/dist/packages/kits/src/research/native-motion-figure.d.ts +17 -0
  48. package/dist/packages/kits/src/research/native-motion.d.ts +18 -0
  49. package/dist/plot-BIYlgY2B.js +223 -0
  50. package/dist/{plot-layout-1MG72ZWn.js → plot-layout-CNNFMC8H.js} +1 -1
  51. package/dist/{plot-surface-8-FZI94y.js → plot-surface-BSjoNIva.js} +1 -1
  52. package/dist/{reference-lines-C18o1yEY.js → reference-lines-Bet_hRyA.js} +1 -1
  53. package/dist/{scene-B8dppj5V.js → scene-C88Xkz4l.js} +4 -4
  54. package/dist/scene.js +1 -1
  55. package/dist/{slope-chart-CELflRJd.js → slope-chart-B6Mtcta2.js} +5 -5
  56. package/dist/{src-BsqbWDxS.js → src-DCozYUGI.js} +146 -131
  57. package/dist/styles2.css +4 -4
  58. package/dist/{time-series-DtAtGoT_.js → time-series-DJk-2Mt0.js} +6 -6
  59. package/dist/{timeline-CzianQir.js → timeline-BHpj7i7K.js} +3 -3
  60. package/dist/{token-heatmap-m6oaMwkK.js → token-heatmap-DEqEaoGE.js} +2 -2
  61. package/dist/{token-predictions-CpGVjOIs.js → token-predictions-Bjdh0K-A.js} +4 -4
  62. package/dist/{tree-diagram-D9ekymCQ.js → tree-diagram-BxSDOBFj.js} +3 -3
  63. package/dist/{treemap-DT8q65LQ.js → treemap-DzHAp4ia.js} +4 -4
  64. package/dist/{violin-plot-83HSjnQM.js → violin-plot-B4Cf38Y9.js} +4 -4
  65. package/dist/{waterfall-DmApvdrY.js → waterfall-CNDkDS6T.js} +84 -80
  66. package/package.json +1 -1
  67. package/recipes/research-history.tsx +51 -0
  68. package/skills/review-elements/SKILL.md +3 -1
  69. package/skills/use-elements/SKILL.md +4 -0
  70. package/skills/use-elements/references/kits.md +10 -0
  71. package/dist/locate-Bcg3QcP4.js +0 -11
  72. package/dist/plot-CpTwLIYN.js +0 -101
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "../src-DIS0YOj0.js";
2
2
  import { i as t, t as n } from "../tone-scope-DKiSw-JR.js";
3
- import { r, s as i } from "../slope-chart-CELflRJd.js";
3
+ import { r, s as i } from "../slope-chart-B6Mtcta2.js";
4
4
  import { c as a, o } from "../src-Bkov5TTa.js";
5
- import { T as s } from "../plot-layout-1MG72ZWn.js";
5
+ import { T as s } from "../plot-layout-CNNFMC8H.js";
6
6
  import { o as c, t as l } from "../cells-BRI8LpMU.js";
7
7
  import { r as u } from "../figure-format-BVb7yFCA.js";
8
8
  import { d, g as f, h as p } from "../src-Dc1t1ugL.js";
@@ -0,0 +1,14 @@
1
+ function e({ marks: e, width: t, height: n, axis: r = "both", maxDistance: i }) {
2
+ return (a) => {
3
+ let o = a.width / t, s = a.height / n, c = {
4
+ distance: (i ?? Infinity) ** 2,
5
+ id: void 0
6
+ };
7
+ for (let t of e) {
8
+ let e = r === "y" ? 0 : t.x * o - a.x, n = r === "x" ? 0 : t.y * s - a.y, i = e * e + n * n;
9
+ i <= c.distance && (c.distance = i, c.id = t.id);
10
+ }
11
+ return c.id;
12
+ };
13
+ }
14
+ export { e as t };
package/dist/mdx.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-Ni152e-v.js";
1
+ import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-CTSxWe4y.js";
2
2
  import { n as se, t as ce } from "./param-Dk92C-K1.js";
3
3
  import { a as l, i as u, n as d, o as f, t as p } from "./transport-DQ1yzsQl.js";
4
- import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-B8dppj5V.js";
4
+ import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-C88Xkz4l.js";
5
5
  import { t as R } from "./code-block-DbW_t9U4.js";
6
6
  import { t as z } from "./content-link-BN4NPp0u.js";
7
7
  import * as B from "@stylexjs/stylex";
@@ -49,3 +49,4 @@ export type { TickInput, TimeTickInput } from './ticks.ts';
49
49
  export { linearTicks, logTicks, scaleTicks, symlogTicks, timeTicks } from './ticks.ts';
50
50
  export { SpatialLayer } from './spatial-layer.tsx';
51
51
  export type { SpatialLayerProps } from './spatial-layer.tsx';
52
+ export { StepHistory } from './step-history.tsx';
@@ -9,10 +9,12 @@ export type MarkPosition = {
9
9
  * A chart `locate` for marks at known positions: the pointer inspects the nearest one. The `axis` option limits the
10
10
  * distance to one direction, for marks a reader scans along a single axis such as the steps of a curve.
11
11
  */
12
- export declare function locateNearest({ marks, width, height, axis, }: {
12
+ export declare function locateNearest({ marks, width, height, axis, maxDistance, }: {
13
13
  readonly marks: ReadonlyArray<MarkPosition>;
14
14
  /** The size the marks were laid out in. The pointer arrives in rendered pixels and is rescaled to it. */
15
15
  readonly width: number;
16
16
  readonly height: number;
17
+ /** Largest hit distance in rendered CSS pixels. */
18
+ readonly maxDistance?: number;
17
19
  readonly axis?: 'x' | 'y' | 'both' | undefined;
18
20
  }): (point: ChartPoint) => string | undefined;
@@ -9,6 +9,7 @@ export type SpatialLayerProps = {
9
9
  readonly y: number;
10
10
  readonly label: string;
11
11
  } | undefined;
12
+ readonly destination?: readonly [number, number] | undefined;
12
13
  readonly bounds: Bounds;
13
14
  readonly locale: string;
14
15
  readonly isDense: boolean;
@@ -21,12 +22,15 @@ export type SpatialLayerProps = {
21
22
  }>;
22
23
  readonly points: ReadonlyArray<{
23
24
  readonly id: string;
25
+ readonly label?: string;
24
26
  readonly x: number;
25
27
  readonly y: number;
26
28
  readonly trail: ReadonlyArray<readonly [number, number]>;
27
29
  }>;
30
+ readonly onSelectedChange?: ((id: string) => void) | undefined;
31
+ readonly showTrails?: boolean;
28
32
  readonly selected?: string | null | undefined;
29
33
  };
30
34
  /** A fixed camera in screen coordinates. Preserve distances on both axes and clip paths outside the camera. */
31
- export declare function SpatialLayer({ label, bounds, regions, points, tone, shape, selected, origin, locale, isDense, isCompact, }: SpatialLayerProps): ReactNode;
35
+ export declare function SpatialLayer({ label, bounds, regions, points, tone, shape, selected, origin, locale, isDense, isCompact, showTrails, destination, onSelectedChange, }: SpatialLayerProps): ReactNode;
32
36
  export {};
@@ -0,0 +1,13 @@
1
+ import type { ChartTone } from '../../../foundations/src/chart-tones.ts';
2
+ type HistorySeries = {
3
+ readonly id: string;
4
+ readonly tone: ChartTone;
5
+ readonly values: ReadonlyArray<readonly [number, number]>;
6
+ };
7
+ /** A scrubber backdrop with bounded path complexity. Holds each measurement until its next change. */
8
+ export declare const StepHistory: import("react").MemoExoticComponent<({ series, first, last, }: {
9
+ readonly series: ReadonlyArray<HistorySeries>;
10
+ readonly first: number;
11
+ readonly last: number;
12
+ }) => import("react").JSX.Element | null>;
13
+ export {};
@@ -75,8 +75,8 @@ export declare const eventStripLimits: {
75
75
  */
76
76
  export declare function eventStripGutter(labels: ReadonlyArray<string>): number;
77
77
  /**
78
- * Events along time in a few lanes: deploys, incidents, evaluation runs and alerts. An instant is a dot and an interval
79
- * a bar, and events that overlap in a lane stack into rows. Dashed rules mark supplied instants across every lane, and
80
- * the arrow keys step through events in time while Up and Down move to a neighboring lane.
78
+ * Show events in lanes with dots for instants, bars for intervals and dashed rules for shared markers. Use the arrow
79
+ * keys to inspect events in time and move between lanes. Time windows clip marks, and inspection and the data table
80
+ * report the recorded times and duration.
81
81
  */
82
82
  export declare function EventStrip(props: EventStripProps): ReactNode;
@@ -11,6 +11,8 @@ export type TimelineMarker = {
11
11
  /** Why the timeline position changed: pointer scrubbing, keyboard stepping, marker navigation, or a call. */
12
12
  export type TimelineScrubberChangeDetails = ChangeDetails<'scrub' | 'step-key' | 'marker' | 'imperative'>;
13
13
  export type TimelineScrubberProps = {
14
+ /** An optional background plot covering the same linear domain as the scrub rail. */
15
+ readonly backdrop?: ReactNode;
14
16
  readonly value: number;
15
17
  readonly max: number;
16
18
  readonly min?: number;
@@ -31,4 +33,4 @@ export type TimelineScrubberProps = {
31
33
  * keyboard stepping, `[`/`]` and `Alt+Arrow` marker jumping, `Enter`/`Space` marker selection, pointer capture
32
34
  * dragging, and `@mechane-ai/elements/agent` inspection while leaving playback timing to the caller.
33
35
  */
34
- export declare function TimelineScrubber({ value, max, min, step, onValueChange, onScrubStart, onScrubEnd, markers, onMarkerSelect, formatValue, isDisabled, label, xstyle, }: TimelineScrubberProps): ReactNode;
36
+ export declare function TimelineScrubber({ backdrop, value, max, min, step, onValueChange, onScrubStart, onScrubEnd, markers, onMarkerSelect, formatValue, isDisabled, label, xstyle, }: TimelineScrubberProps): ReactNode;
@@ -8,10 +8,17 @@ export type { SpecimenDiffLabels, SpecimenDiffProps, SpecimenDiffRow, SpecimenFi
8
8
  export { SpecimenDiff } from './specimen-diff.tsx';
9
9
  export type { WorkHeartbeatLabels, WorkHeartbeatProps, WorkHeartbeatState, WorkProgress, WorkReportItem, } from './work-heartbeat.tsx';
10
10
  export { WorkHeartbeat } from './work-heartbeat.tsx';
11
- export type { MotionClip, MotionArm, MotionMoment, MotionPoint, MotionBounds, MotionTrack } from './motion-clip.ts';
11
+ export type { MotionClip, MotionArm, MotionMoment, MotionPoint, MotionBounds, MotionTrack, MotionNote, } from './motion-types.ts';
12
12
  export { parseMotionClip } from './motion-clip.ts';
13
13
  export { motionSceneAt } from './motion-frame.ts';
14
14
  export type { MotionLabels, MotionSceneProps } from './motion-scene.tsx';
15
15
  export { MotionScene } from './motion-scene.tsx';
16
16
  export type { MotionFigureProps } from './motion-figure.tsx';
17
17
  export { MotionFigure } from './motion-figure.tsx';
18
+ export { defaultMotionView, normalizeMotionView } from './motion-view.ts';
19
+ export type { MotionView } from './motion-types.ts';
20
+ export { readMotionLocation, writeMotionLocation } from './motion-location.ts';
21
+ export type { NativeMotionMapping } from './native-motion.ts';
22
+ export { parseNativeMotionMapping, verifyNativeMotion, nativeMotionTime, motionSha256 } from './native-motion.ts';
23
+ export type { NativeMotionSource, NativeMotionFigureProps } from './native-motion-figure.tsx';
24
+ export { NativeMotionFigure } from './native-motion-figure.tsx';
@@ -1,41 +1,3 @@
1
- export type MotionBounds = readonly [number, number, number, number];
2
- export type MotionPoint = readonly [tick: number, horizontal: number, vertical: number];
3
- export type MotionTrack = {
4
- readonly id: string;
5
- readonly label: string;
6
- readonly points: ReadonlyArray<MotionPoint>;
7
- readonly end: number;
8
- readonly notes?: ReadonlyArray<readonly [number, string]>;
9
- };
10
- export type MotionArm = {
11
- readonly label: string;
12
- readonly tracks: ReadonlyArray<MotionTrack>;
13
- readonly regions?: ReadonlyArray<{
14
- readonly label: string;
15
- readonly bounds: MotionBounds;
16
- }>;
17
- readonly metrics?: ReadonlyArray<{
18
- readonly label: string;
19
- readonly values: ReadonlyArray<readonly [number, number]>;
20
- }>;
21
- };
22
- export type MotionMoment = {
23
- readonly id: string;
24
- readonly label: string;
25
- readonly tick: number;
26
- readonly detail?: string;
27
- };
28
- export type MotionClip = {
29
- readonly version: 1;
30
- readonly title: string;
31
- readonly first: number;
32
- readonly last: number;
33
- readonly hz: number;
34
- readonly speed: number;
35
- readonly bounds: MotionBounds;
36
- readonly arms: ReadonlyArray<MotionArm>;
37
- readonly moments: ReadonlyArray<MotionMoment>;
38
- readonly source?: unknown;
39
- };
1
+ import type { MotionClip } from './motion-types.ts';
40
2
  /** Decode JSON once per clip. Hosts limit bytes before parsing, including opaque provenance. */
41
3
  export declare function parseMotionClip(input: unknown): MotionClip;
@@ -1,9 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { MotionSceneProps } from './motion-scene.tsx';
3
3
  export type MotionFigureProps = MotionSceneProps & {
4
+ readonly scene?: ReactNode;
5
+ readonly speed?: number | undefined;
6
+ readonly onSpeedChange?: ((speed: number) => void) | undefined;
4
7
  readonly onTickChange: (tick: number) => void;
5
8
  readonly isPlaying?: boolean;
6
9
  readonly onPlayingChange?: (isPlaying: boolean) => void;
7
10
  };
8
11
  /** Play only on request. Pause on every seek and when the reader enables reduced motion. */
9
- export declare function MotionFigure({ clip, tick, onTickChange, isPlaying: controlled, onPlayingChange, isInspecting, isGuided, locale, labels: given, }: MotionFigureProps): ReactNode;
12
+ export declare function MotionFigure({ clip, scene, speed: givenSpeed, onSpeedChange, view: controlledView, onViewChange, tick, onTickChange, isPlaying: controlled, onPlayingChange, isInspecting, isGuided, locale, labels: given, }: MotionFigureProps): ReactNode;
@@ -1,10 +1,10 @@
1
- import type { MotionClip } from './motion-clip.ts';
1
+ import type { MotionClip } from './motion-types.ts';
2
2
  /** A seek in either direction has the same result. Only positions interpolate, within a single observed segment. */
3
3
  export declare function motionSceneAt(clip: MotionClip, tick: number): {
4
4
  label: string;
5
5
  regions: readonly {
6
6
  readonly label: string;
7
- readonly bounds: import("./motion-clip.ts").MotionBounds;
7
+ readonly bounds: import("./motion-types.ts").MotionBounds;
8
8
  }[];
9
9
  actors: {
10
10
  x: number;
@@ -13,7 +13,7 @@ export declare function motionSceneAt(clip: MotionClip, tick: number): {
13
13
  id: string;
14
14
  label: string;
15
15
  trail: (readonly [number, number])[];
16
- note: readonly [number, string] | undefined;
16
+ note: import("./motion-types.ts").MotionNote | undefined;
17
17
  }[];
18
18
  metrics: {
19
19
  label: string;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { MotionLabels } from './motion-scene.tsx';
3
+ import type { MotionClip, MotionView } from './motion-types.ts';
4
+ export declare function MotionInspection({ clip, view, onChange, labels, hasMap, }: {
5
+ readonly clip: MotionClip;
6
+ readonly view: MotionView;
7
+ readonly onChange: (view: MotionView) => void;
8
+ readonly labels: MotionLabels;
9
+ readonly hasMap: boolean;
10
+ }): ReactNode;
11
+ export declare function MotionHistory({ clip, metric }: {
12
+ readonly clip: MotionClip;
13
+ readonly metric: string;
14
+ }): ReactNode;
@@ -0,0 +1,9 @@
1
+ import type { MotionClip, MotionView } from './motion-types.ts';
2
+ /** Restore the tick and supported inspection choices from a shared link. */
3
+ export declare function readMotionLocation(clip: MotionClip, params: URLSearchParams): {
4
+ tick: number;
5
+ isNative: boolean;
6
+ view: MotionView;
7
+ };
8
+ /** Keep shared links short by omitting the default camera and overlays. */
9
+ export declare function writeMotionLocation(tick: number, view: MotionView, isNative?: boolean): URLSearchParams;
@@ -1,7 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { MotionClip } from './motion-clip.ts';
2
+ import type { MotionClip, MotionView } from './motion-types.ts';
3
3
  export type MotionLabels = {
4
4
  readonly tick: string;
5
+ readonly metric: string;
6
+ readonly zoom: string;
7
+ readonly follow: string;
8
+ readonly trails: string;
9
+ readonly regions: string;
5
10
  readonly start: string;
6
11
  readonly moment: string;
7
12
  readonly actor: string;
@@ -12,6 +17,8 @@ export type MotionLabels = {
12
17
  export declare const defaultMotionLabels: MotionLabels;
13
18
  export type MotionSceneProps = {
14
19
  readonly clip: MotionClip;
20
+ readonly view?: MotionView | undefined;
21
+ readonly onViewChange?: ((view: MotionView) => void) | undefined;
15
22
  readonly tick: number;
16
23
  readonly isInspecting?: boolean;
17
24
  readonly isGuided?: boolean;
@@ -19,4 +26,4 @@ export type MotionSceneProps = {
19
26
  readonly labels?: Partial<MotionLabels>;
20
27
  };
21
28
  /** Draw one frame at an integer tick. Posters, movies and interactive playback share this rendering. */
22
- export declare function MotionScene({ clip, tick, isInspecting, isGuided, locale, labels: given, }: MotionSceneProps): ReactNode;
29
+ export declare function MotionScene({ clip, view: controlled, onViewChange, tick, isInspecting, isGuided, locale, labels: given, }: MotionSceneProps): ReactNode;
@@ -0,0 +1,54 @@
1
+ export declare const motionZoomLevels: readonly [1, 2, 4, 8];
2
+ export type MotionZoom = (typeof motionZoomLevels)[number];
3
+ export type MotionView = {
4
+ readonly selected: {
5
+ readonly arm: number;
6
+ readonly id: string;
7
+ } | null;
8
+ readonly zoom: MotionZoom;
9
+ readonly isFollowing: boolean;
10
+ readonly showTrails: boolean;
11
+ readonly showRegions: boolean;
12
+ readonly metric?: string;
13
+ };
14
+ export type MotionBounds = readonly [number, number, number, number];
15
+ export type MotionPoint = readonly [tick: number, horizontal: number, vertical: number];
16
+ export type MotionNote = readonly [tick: number, message: string, destination?: readonly [number, number]];
17
+ export type MotionTrack = {
18
+ readonly id: string;
19
+ readonly label: string;
20
+ readonly points: ReadonlyArray<MotionPoint>;
21
+ readonly end: number;
22
+ readonly notes?: ReadonlyArray<MotionNote>;
23
+ };
24
+ export type MotionArm = {
25
+ readonly label: string;
26
+ readonly tracks: ReadonlyArray<MotionTrack>;
27
+ readonly regions?: ReadonlyArray<{
28
+ readonly label: string;
29
+ readonly bounds: MotionBounds;
30
+ }>;
31
+ readonly metrics?: ReadonlyArray<{
32
+ readonly label: string;
33
+ readonly values: ReadonlyArray<readonly [number, number]>;
34
+ }>;
35
+ };
36
+ export type MotionMoment = {
37
+ readonly id: string;
38
+ readonly label: string;
39
+ readonly tick: number;
40
+ readonly detail?: string;
41
+ readonly view?: Partial<MotionView>;
42
+ };
43
+ export type MotionClip = {
44
+ readonly version: 1;
45
+ readonly title: string;
46
+ readonly first: number;
47
+ readonly last: number;
48
+ readonly hz: number;
49
+ readonly speed: number;
50
+ readonly bounds: MotionBounds;
51
+ readonly arms: ReadonlyArray<MotionArm>;
52
+ readonly moments: ReadonlyArray<MotionMoment>;
53
+ readonly source?: unknown;
54
+ };
@@ -0,0 +1,9 @@
1
+ import type { MotionBounds, MotionClip, MotionView } from './motion-types.ts';
2
+ export declare const defaultMotionView: Readonly<MotionView>;
3
+ export declare function normalizeMotionView(clip: Pick<MotionClip, 'arms'>, input: Partial<MotionView>): MotionView;
4
+ export declare function inspectedMetric(clip: MotionClip, view: MotionView): string | undefined;
5
+ /** Every comparison arm uses the same camera, including when following an actor in one arm. */
6
+ export declare function motionCamera(bounds: MotionBounds, view: MotionView, actor: {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ } | undefined): MotionBounds;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { MotionFigureProps } from './motion-figure.tsx';
3
+ import type { NativeMotionMapping } from './native-motion.ts';
4
+ export type NativeMotionSource = {
5
+ readonly src: string;
6
+ readonly mapping: NativeMotionMapping;
7
+ };
8
+ type LazySource = {
9
+ readonly load: () => Promise<NativeMotionSource>;
10
+ };
11
+ export type NativeMotionFigureProps = MotionFigureProps & {
12
+ readonly native?: NativeMotionSource | LazySource;
13
+ readonly isNative?: boolean;
14
+ readonly onNativeChange?: (isNative: boolean) => void;
15
+ };
16
+ export declare function NativeMotionFigure({ native, isNative: controlled, onNativeChange, isPlaying: controlledPlaying, onPlayingChange, speed: controlledSpeed, onSpeedChange, ...props }: NativeMotionFigureProps): ReactNode;
17
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { MotionClip } from './motion-types.ts';
2
+ export type NativeMotionMapping = {
3
+ readonly version: 1;
4
+ readonly arm: number;
5
+ readonly firstTick: number;
6
+ readonly lastTick: number;
7
+ readonly secondsPerTick: number;
8
+ readonly startSeconds: HTMLMediaElement['currentTime'];
9
+ readonly clipSha256: string;
10
+ readonly movieSha256: string;
11
+ readonly fps: number;
12
+ readonly ticks: ReadonlyArray<number>;
13
+ };
14
+ export declare function parseNativeMotionMapping(input: unknown, clip: MotionClip): NativeMotionMapping;
15
+ export declare function motionSha256(blob: Blob): Promise<string>;
16
+ export declare function verifyNativeMotion(clipBytes: Blob, movie: Blob, mapping: NativeMotionMapping): Promise<void>;
17
+ /** Seek to the last frame at or before the playhead, including repeated capture ticks. */
18
+ export declare function nativeMotionTime(mapping: NativeMotionMapping, tick: number): number;
@@ -0,0 +1,223 @@
1
+ import { E as e, O as t, h as n, j as r, s as i } from "./plot-layout-CNNFMC8H.js";
2
+ import { n as a } from "./plot-width-D3hTycYX.js";
3
+ import { t as o } from "./locate-Dcq5ZZSk.js";
4
+ import { r as s } from "./path-BglsXpnO.js";
5
+ import { c, d as l, f as u, l as d, n as f, p } from "./plot-marks-DgCtcd3L.js";
6
+ import { t as m } from "./plot-surface-BSjoNIva.js";
7
+ import { n as h, r as g } from "./scale-C2xgZyZN.js";
8
+ import * as _ from "@stylexjs/stylex";
9
+ import { memo as v } from "react";
10
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
11
+ // packages/charts/src/plot/spatial-layer.tsx
12
+ function x({ label: h, bounds: g, regions: v, points: x, tone: S, shape: C, selected: w, origin: T, locale: E, isDense: D, isCompact: O = !1, showTrails: k = !0, destination: A, onSelectedChange: j }) {
13
+ let [M, N, P, F] = g, I = O ? 246 : 480, L = Math.min(440, Math.max(140, Math.round((I - 72) * (F - N) / (P - M) + 44))), R = new Intl.NumberFormat(E, { maximumSignificantDigits: 6 }), z = Math.min((I - 72) / (P - M), (L - 44) / (F - N));
14
+ function B(e) {
15
+ return I / 2 + (e - (M + P) / 2) * z;
16
+ }
17
+ function V(e) {
18
+ return L / 2 + (e - (N + F) / 2) * z;
19
+ }
20
+ let H = i({
21
+ width: I,
22
+ height: L,
23
+ margins: {
24
+ left: B(M),
25
+ right: I - B(P),
26
+ top: V(N),
27
+ bottom: L - V(F)
28
+ }
29
+ }), U = x.find((e) => e.id === w);
30
+ function W(e) {
31
+ return /* @__PURE__ */ b("svg", {
32
+ role: "img",
33
+ "aria-label": h,
34
+ width: I,
35
+ height: L,
36
+ viewBox: `0 0 ${I} ${L}`,
37
+ className: "x1lliihq xh8yej3 xt7dq6l xpvm0e4 xb3r6kr",
38
+ children: [
39
+ n([M, P], O ? 3 : 5).map((e) => /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y("line", {
40
+ x1: B(e),
41
+ x2: B(e),
42
+ y1: V(N),
43
+ y2: V(F),
44
+ ..._.props(a.grid)
45
+ }), /* @__PURE__ */ y(c, {
46
+ x: B(e),
47
+ y: V(F) + 16,
48
+ anchor: "middle",
49
+ children: R.format(e)
50
+ })] }, e)),
51
+ n([N, F], Math.max(2, Math.floor(L / 60))).map((e) => /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y(c, {
52
+ x: B(M) - 6,
53
+ y: V(e) + 4,
54
+ anchor: "end",
55
+ children: R.format(e)
56
+ }), /* @__PURE__ */ y("line", {
57
+ x1: B(M),
58
+ x2: B(P),
59
+ y1: V(e),
60
+ y2: V(e),
61
+ ..._.props(a.grid)
62
+ })] }, e)),
63
+ /* @__PURE__ */ b(m, {
64
+ box: H,
65
+ children: [
66
+ v.map((e) => {
67
+ let [t, n, r, i] = e.bounds, a = `M${B(t)},${V(n)}H${B(r)}V${V(i)}H${B(t)}Z`;
68
+ return /* @__PURE__ */ b("g", { children: [
69
+ /* @__PURE__ */ y(f, {
70
+ d: a,
71
+ tone: S
72
+ }),
73
+ /* @__PURE__ */ y(d, {
74
+ d: a,
75
+ tone: S,
76
+ stroke: "dashed"
77
+ }),
78
+ /* @__PURE__ */ y(c, {
79
+ x: B(t),
80
+ y: V(n) - 6,
81
+ children: e.label
82
+ })
83
+ ] }, JSON.stringify(e));
84
+ }),
85
+ T !== void 0 && /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y(p, {
86
+ shape: C,
87
+ x: B(T.x),
88
+ y: V(T.y),
89
+ tone: S,
90
+ radius: 7,
91
+ isHollow: !0
92
+ }), /* @__PURE__ */ y(c, {
93
+ x: B(T.x),
94
+ y: V(T.y) - 13,
95
+ anchor: "middle",
96
+ children: T.label
97
+ })] }),
98
+ A !== void 0 && U !== void 0 && /* @__PURE__ */ b("g", { children: [/* @__PURE__ */ y(u, {
99
+ x1: B(U.x),
100
+ y1: V(U.y),
101
+ x2: B(A[0]),
102
+ y2: V(A[1]),
103
+ stroke: "dashed",
104
+ tone: S
105
+ }), /* @__PURE__ */ y(l, {
106
+ x: B(A[0]),
107
+ y: V(A[1])
108
+ })] }),
109
+ k && x.map((e) => e.trail.length < 2 ? null : /* @__PURE__ */ y(d, {
110
+ d: s(e.trail.map(([e, t]) => ({
111
+ x: B(e),
112
+ y: V(t)
113
+ }))),
114
+ tone: S,
115
+ emphasis: e.id === w ? "normal" : "receded"
116
+ }, e.id)),
117
+ x.map((t) => /* @__PURE__ */ y(p, {
118
+ mark: t.id,
119
+ x: B(t.x),
120
+ y: V(t.y),
121
+ tone: S,
122
+ shape: C,
123
+ radius: D ? 2.5 : 5,
124
+ isSelected: t.id === w,
125
+ isInspected: t.id === e,
126
+ emphasis: w != null && w !== t.id ? "receded" : "normal"
127
+ }, t.id))
128
+ ]
129
+ })
130
+ ]
131
+ });
132
+ }
133
+ if (j === void 0) return W(null);
134
+ let G = x.filter((e) => e.x >= M && e.x <= P && e.y >= N && e.y <= F), K = G.map((e) => ({
135
+ id: e.id,
136
+ x: B(e.x),
137
+ y: V(e.y)
138
+ })), q = G.map((e) => ({
139
+ id: e.id,
140
+ label: e.label ?? e.id
141
+ }));
142
+ return /* @__PURE__ */ y(e, {
143
+ items: q,
144
+ selected: w,
145
+ onSelect: j,
146
+ arrows: "both",
147
+ locate: o({
148
+ marks: K,
149
+ width: I,
150
+ height: L,
151
+ maxDistance: 16
152
+ }),
153
+ render: (e, { inspected: n }) => /* @__PURE__ */ y("figure", {
154
+ ...e,
155
+ className: "x1ghz6dp xeuugli",
156
+ children: /* @__PURE__ */ y(t, {
157
+ role: "group",
158
+ "aria-label": r({
159
+ title: h,
160
+ marks: "actors",
161
+ isSelectable: !0
162
+ }),
163
+ children: W(n)
164
+ })
165
+ })
166
+ });
167
+ }
168
+ // packages/charts/src/plot/step-history.tsx
169
+ var S = 640, C = 56, w = 3, T = 4;
170
+ function E(e, t, n) {
171
+ if (e.length <= S * T) return e;
172
+ let r = /* @__PURE__ */ new Map();
173
+ for (let i of e) {
174
+ let e = Math.floor((i[0] - t) * S / (n - t)), a = r.get(e);
175
+ a === void 0 ? r.set(e, {
176
+ first: i,
177
+ low: i,
178
+ high: i,
179
+ last: i
180
+ }) : (i[1] < a.low[1] && (a.low = i), i[1] > a.high[1] && (a.high = i), a.last = i);
181
+ }
182
+ return [...r.values()].flatMap(({ first: e, low: t, high: n, last: r }) => [.../* @__PURE__ */ new Set([
183
+ e,
184
+ t,
185
+ n,
186
+ r
187
+ ])].toSorted((e, t) => e[0] - t[0]));
188
+ }
189
+ var D = v(({ series: e, first: t, last: n }) => {
190
+ if (t === n) return null;
191
+ let r = e.map((e) => ({
192
+ ...e,
193
+ values: E(e.values, t, n)
194
+ })), i = r.flatMap((e) => e.values.map(([, e]) => e)), a = h(i);
195
+ if (a === void 0) return null;
196
+ let [o, c] = a, l = g({
197
+ domain: [t, n],
198
+ range: [0, S]
199
+ }), u = g({
200
+ domain: o === c ? [o - 1, c + 1] : [o, c],
201
+ range: [53, w]
202
+ });
203
+ return /* @__PURE__ */ y("svg", {
204
+ "aria-hidden": !0,
205
+ viewBox: `0 0 ${S} ${C}`,
206
+ preserveAspectRatio: "none",
207
+ className: "xh8yej3 x5yr21d x1lliihq",
208
+ children: r.map((e) => {
209
+ let t = e.values.map(([e, t]) => ({
210
+ x: l.position(e),
211
+ y: u.position(t)
212
+ })), n = t.at(-1);
213
+ return n === void 0 ? null : /* @__PURE__ */ y(d, {
214
+ tone: e.tone,
215
+ d: s([...t, {
216
+ x: S,
217
+ y: n.y
218
+ }], "step")
219
+ }, e.id);
220
+ })
221
+ });
222
+ });
223
+ export { x as n, D as t };
@@ -174,7 +174,7 @@ var A = b({
174
174
  width: a.width,
175
175
  height: a.height
176
176
  });
177
- s === void 0 ? i === "item-hover" && r && (o(null, {
177
+ s === void 0 ? (r || i === "item-press") && (o(null, {
178
178
  reason: i,
179
179
  event: t
180
180
  }), r = !1) : (o(s, {
@@ -1,5 +1,5 @@
1
1
  import { n as e, t } from "./plot-width-D3hTycYX.js";
2
- import { O as n, c as r } from "./plot-layout-1MG72ZWn.js";
2
+ import { O as n, c as r } from "./plot-layout-CNNFMC8H.js";
3
3
  import * as i from "@stylexjs/stylex";
4
4
  import { useId as a } from "react";
5
5
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { M as e } from "./plot-layout-1MG72ZWn.js";
1
+ import { M as e } from "./plot-layout-CNNFMC8H.js";
2
2
  import { t } from "./label-spacing-BncjePGb.js";
3
3
  import { n, t as r } from "./label-place-Z0fryBZb.js";
4
4
  import { c as i, f as a } from "./plot-marks-DgCtcd3L.js";