@msb235/blits-panel 0.4.1 → 0.6.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/dist/pose.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { type Watched } from '@msb235/blits';
2
+ /** Each numeric part of a pose under a flat key: `x`, `position[1]`, `color.l`. */
3
+ export declare function flatten(pose: unknown, out?: Record<string, number>, key?: string, depth?: number): Record<string, number>;
4
+ /** A color pose as the CSS color it shows, then an ordered blend mode's layers, bottom first. */
5
+ export declare const colorsOf: (pose: ArrayLike<number>) => string[];
6
+ /**
7
+ * A pose as the plots show it, each channel read by its kind. A color channel, blend modes
8
+ * included, is the CSS color it shows, then an ordered mode's layers bottom first; an `affine`
9
+ * channel is its parts, `at.x` to `at.scaleY`; any other channel is its numbers by `flatten`.
10
+ */
11
+ export declare function readPose(pose: unknown, entry: Pick<Watched, 'channels' | 'kinds'>): {
12
+ values: Record<string, number>;
13
+ colors: Record<string, string[]>;
14
+ };
@@ -31,11 +31,14 @@ export interface VoiceInfo {
31
31
  }
32
32
  /**
33
33
  * The picked subject in one frame: each numeric part of its pose by a flat key (`x`,
34
- * `position[1]`, `color.l`), and each voice's weight on it by voice id.
34
+ * `position[1]`, `at.rotate`), each color channel as CSS colors, and each voice's weight on it by
35
+ * voice id.
35
36
  */
36
37
  export interface Sample {
37
38
  now: number;
38
39
  values: Record<string, number>;
40
+ /** By channel: the color it shows, then an ordered blend mode's layers, bottom first. */
41
+ colors?: Record<string, string[]>;
39
42
  weights: Record<number, number>;
40
43
  /** The host did not read the subject this frame, so the panel read it. */
41
44
  read: boolean;
package/dist/store.d.ts CHANGED
@@ -17,10 +17,14 @@ export declare class Samples {
17
17
  get length(): number;
18
18
  reset(): void;
19
19
  push(s: Sample): void;
20
- /** The times, and each key's values in the same order, NaN where a sample lacks the key. */
20
+ /**
21
+ * The times, and each key's values in the same order: NaN where a sample lacks a number,
22
+ * undefined where it lacks a color.
23
+ */
21
24
  series(): {
22
25
  times: number[];
23
26
  values: Map<string, number[]>;
27
+ colors: Map<string, (readonly string[] | undefined)[]>;
24
28
  weights: Map<number, number[]>;
25
29
  read: boolean[];
26
30
  };
@@ -0,0 +1,15 @@
1
+ export interface ColorStripProps {
2
+ label: string;
3
+ times: readonly number[];
4
+ /** Each sample's colors: the one shown, then an ordered blend mode's layers, bottom first. */
5
+ colors: readonly (readonly string[] | undefined)[];
6
+ playhead: number;
7
+ /** The span of time drawn; the samples' own span otherwise. */
8
+ range?: readonly [number, number];
9
+ width?: number;
10
+ }
11
+ /**
12
+ * A color channel over time: a band painted with the color it shows at each sample, over a
13
+ * checkerboard so its opacity reads, and a thin band per layer of an ordered blend mode beneath.
14
+ */
15
+ export declare function ColorStrip({ label, times, colors, playhead, range: span, width, }: ColorStripProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msb235/blits-panel",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "A debugger window for blits: every mix on the page, its voices and subjects, channels plotted over time, and a clock to pause, step and scrub",
5
5
  "keywords": [
6
6
  "blits",
@@ -45,12 +45,12 @@
45
45
  "@weasel-js/ui": "1.12.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@msb235/blits": "^0.16.0",
48
+ "@msb235/blits": "^0.18.0",
49
49
  "react": "^19.3.0",
50
50
  "react-dom": "^19.3.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@msb235/blits": "0.16.1",
53
+ "@msb235/blits": "0.18.0",
54
54
  "@types/react": "^19.3.0",
55
55
  "@types/react-dom": "^19.3.0",
56
56
  "@vitejs/plugin-react": "^6.0.0",