@almadar/ui 5.141.0 → 5.143.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.
@@ -1,7 +1,7 @@
1
- export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-rwc3svaX.cjs';
1
+ export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-CvImTgKH.cjs';
2
2
  import { FieldValue, EntityRow, EventPayload } from '@almadar/core';
3
3
  export { AssetLoadStatus, BridgeHealth, CheckStatus, EffectTrace, EventLogEntry, OrbitalVerificationAPI, ServerResponseTrace, TraitStateSnapshot, TransitionTrace, VerificationCheck, VerificationSnapshot, VerificationSummary } from '@almadar/core';
4
- import '../paintDispatch-BQn5Lyx1.cjs';
4
+ import '../paintDispatch-D3-5_cOb.cjs';
5
5
  import 'clsx';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
- export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-BDwC4QpH.js';
1
+ export { C as ContentSegment, D as DEFAULT_CONFIG, a as DomEntityBox, b as DomLayoutData, c as DomOutputsBox, d as DomStateNode, e as DomTransitionLabel, f as DomTransitionPath, E as EntityDefinition, R as RenderOptions, S as StateDefinition, g as StateMachineDefinition, T as TraitSnapshotGetter, h as TransitionDefinition, V as VisualizerConfig, i as bindCanvasCapture, j as bindEventBus, k as bindLastDrawables, l as bindTraitStateGetter, m as clearVerification, n as cn, o as extractOutputsFromTransitions, p as extractStateMachine, q as formatGuard, r as getAllChecks, s as getBridgeHealth, t as getEffectSummary, u as getSnapshot, v as getSummary, w as getTraitSnapshots, x as getTransitions, y as getTransitionsForTrait, z as parseContentSegments, A as parseMarkdownWithCodeBlocks, B as recordServerResponse, F as recordTransition, G as registerCheck, H as registerTraitSnapshot, I as renderStateMachineToDomData, J as renderStateMachineToSvg, K as subscribeToVerification, L as updateAssetStatus, M as updateBridgeHealth, N as updateCheck, O as waitForTransition } from '../cn-DryTiahe.js';
2
2
  import { FieldValue, EntityRow, EventPayload } from '@almadar/core';
3
3
  export { AssetLoadStatus, BridgeHealth, CheckStatus, EffectTrace, EventLogEntry, OrbitalVerificationAPI, ServerResponseTrace, TraitStateSnapshot, TransitionTrace, VerificationCheck, VerificationSnapshot, VerificationSummary } from '@almadar/core';
4
- import '../paintDispatch-BQn5Lyx1.js';
4
+ import '../paintDispatch-D3-5_cOb.js';
5
5
  import 'clsx';
6
6
 
7
7
  /**
@@ -271,42 +271,15 @@ interface DrawTextProps extends DrawableBase {
271
271
  opacity?: number;
272
272
  }
273
273
 
274
- /**
275
- * `draw-group` — the drawable CONTAINER atom (dimension-agnostic).
276
- *
277
- * Multi-shape art (a hero token = cloak + head + sword shapes) travels as ONE
278
- * node: the host paints the group by translating to its projected position,
279
- * applying `scale`/`rotate`/`opacity`, then painting each `items` descriptor
280
- * through the normal dispatch. `items` is a plain data prop (NOT `children`,
281
- * which UISlotRenderer special-cases) — same convention as the `draw-*-layer`
282
- * molecules. The React component renders `null`; it exists so the pattern
283
- * pipeline registers a `draw-group` pattern and standalone pages stay
284
- * inspectable. 2D-canvas only — the 3D backend skips it with a warn.
285
- */
286
-
287
- interface DrawGroupProps extends DrawableBase {
288
- type: 'draw-group';
289
- /** Logical scene position; the projector maps it to pixels / world. */
290
- position: ScenePos;
291
- /** Uniform scale applied to the whole group. */
292
- scale?: number;
293
- /** Rotation in radians (painter units). */
294
- rotate?: number;
295
- /** 0..1 opacity. */
296
- opacity?: number;
297
- /** Clip the group's items to an SVG path (`d` syntax) in world units relative to the group origin — masked reveals, meters, portraits. */
298
- clip?: string;
299
- /** The grouped drawables, painted through the normal dispatch. */
300
- items: DrawableNode[];
301
- }
302
-
303
274
  /**
304
275
  * `draw-mesh` — the volumetric 3D drawable atom (3D-canvas backend).
305
276
  *
306
277
  * ONE descriptor (`DrawMeshProps`, grounded in core `ScenePos`) with the R3F
307
278
  * backend `Mesh3D` in `lib/drawable/three/DrawMesh3D` (kept OUT of this file so
308
279
  * the 2D path never pulls three). A parametric primitive (box, sphere, capsule,
309
- * cylinder, cone, torus, plane, circle) at a scene position `position.z` is
280
+ * cylinder, cone, torus, plane, circle `plane`/`circle` lie flat in the
281
+ * scene ground plane facing up, matching the 2D painter) or a raw-geometry `polyhedron`
282
+ * (`vertices` + `faces` as plain data) at a scene position — `position.z` is
310
283
  * height in cells — with a data-driven material (`standard`/`physical`/`toon`/
311
284
  * `basic`), an optional inverted-hull outline, and keyframe animation over
312
285
  * transform/material tracks. Low-poly is a knob, not a geometry rewrite:
@@ -316,7 +289,7 @@ interface DrawGroupProps extends DrawableBase {
316
289
  * pattern and standalone pages stay inspectable.
317
290
  */
318
291
 
319
- type MeshShapeKind = 'box' | 'sphere' | 'capsule' | 'cylinder' | 'cone' | 'torus' | 'plane' | 'circle';
292
+ type MeshShapeKind = 'box' | 'sphere' | 'capsule' | 'cylinder' | 'cone' | 'torus' | 'plane' | 'circle' | 'polyhedron';
320
293
  type MeshMaterialKind = 'standard' | 'physical' | 'toon' | 'basic';
321
294
  type MeshMaterialSide = 'front' | 'back' | 'double';
322
295
  /**
@@ -386,6 +359,22 @@ interface DrawMeshAnimation {
386
359
  /** Keyframes ordered by `at` (0..1). */
387
360
  keyframes: DrawMeshKeyframe[];
388
361
  }
362
+ /**
363
+ * Smooth-skinning data for a `polyhedron` — plain declarative data, no runtime
364
+ * objects. Vertices carry blended bone weights (a neck-base vertex can be 60%
365
+ * neck / 40% spine), so the surface stretches continuously across joints
366
+ * instead of cracking at rigid chunk boundaries.
367
+ */
368
+ interface DrawMeshSkin {
369
+ /** Bone names, resolved against sibling `draw-group` `bone:` names in the same canvas. */
370
+ bones: string[];
371
+ /** One 16-float column-major inverse bind matrix per bone (model space → bone bind-local; translations in cells). */
372
+ inverseBindMatrices: number[][];
373
+ /** Per-vertex bone indices into `bones`, up to 4 each (pad with 0). */
374
+ indices: number[][];
375
+ /** Per-vertex blend weights matching `indices`, normalized to sum 1 (pad with 0). */
376
+ weights: number[][];
377
+ }
389
378
  interface DrawMeshProps extends DrawableBase {
390
379
  type: 'draw-mesh';
391
380
  shape: MeshShapeKind;
@@ -407,9 +396,15 @@ interface DrawMeshProps extends DrawableBase {
407
396
  tube?: number;
408
397
  /** Curved-surface tessellation, clamped 3..64 (default 24). 4–8 + `flatShading` = low-poly. */
409
398
  segments?: number;
399
+ /** `polyhedron` only: raw vertices as scene-frame `[x, y, z]` triples in cells, `z` = up. */
400
+ vertices?: number[][];
401
+ /** `polyhedron` only: triangle index triples into `vertices`, wound counter-clockwise seen from OUTSIDE in the scene frame. */
402
+ faces?: number[][];
403
+ /** `polyhedron` only: smooth-skinning weights binding the vertices to named bone groups. Vertices must then be authored in BIND POSE model space; the bones' animated transforms deform them. */
404
+ skin?: DrawMeshSkin;
410
405
  /** Euler rotation `[x, y, z]` in radians. */
411
406
  rotation?: [number, number, number];
412
- /** `bottom` (default) rests the mesh on its position's ground plane; `center` centers it there. */
407
+ /** `bottom` (default) rests the mesh on its position's ground plane; `center` centers it there. For `polyhedron`, `bottom` lifts by −min(z) and `center` applies no offset — the vertices are authoritative. */
413
408
  pivot?: 'bottom' | 'center';
414
409
  material?: MeshMaterial;
415
410
  outline?: MeshOutline;
@@ -421,6 +416,51 @@ interface DrawMeshProps extends DrawableBase {
421
416
  opacity?: number;
422
417
  }
423
418
 
419
+ /**
420
+ * `draw-group` — the drawable CONTAINER atom (dimension-agnostic).
421
+ *
422
+ * Multi-shape art (a hero token = cloak + head + sword shapes) travels as ONE
423
+ * node: the host paints the group by translating to its projected position,
424
+ * applying `scale`/`rotate`/`opacity`, then painting each `items` descriptor
425
+ * through the normal dispatch. `items` is a plain data prop (NOT `children`,
426
+ * which UISlotRenderer special-cases) — same convention as the `draw-*-layer`
427
+ * molecules. The React component renders `null`; it exists so the pattern
428
+ * pipeline registers a `draw-group` pattern and standalone pages stay
429
+ * inspectable. Both backends paint it: 2D as a canvas transform, 3D as a three
430
+ * `<group>` — with `rotation` + `animation` a nested group chain is a skeleton
431
+ * bone chain (rotate the shoulder group and the forearm group follows).
432
+ */
433
+
434
+ interface DrawGroupProps extends DrawableBase {
435
+ type: 'draw-group';
436
+ /** Logical scene position; the projector maps it to pixels / world. */
437
+ position: ScenePos;
438
+ /** Uniform scale applied to the whole group. */
439
+ scale?: number;
440
+ /** Rotation in radians (painter units). */
441
+ rotate?: number;
442
+ /** Euler rotation `[x, y, z]` in radians (world axes) — per-axis joint rotation for the 3D backend; a group placed at a joint with children authored joint-local IS a bone. The 2D painter applies only the in-plane `z` component, after `rotate`. */
443
+ rotation?: [number, number, number];
444
+ /** Skeleton bone name. A named group is addressable by a `draw-mesh` `skin`
445
+ * block (smooth skinning): the skinned mesh deforms with this group's
446
+ * animated transform. Names resolve within the nearest enclosing
447
+ * `skeleton: true` group (falling back to the canvas), so multiple
448
+ * instances of one rig never collide. Distinct from `id` (the hit-test
449
+ * handle). */
450
+ bone?: string;
451
+ /** Marks this group as a skeleton SCOPE: `bone` names and `skin` bindings in
452
+ * its subtree resolve against each other only — one scope per rig instance. */
453
+ skeleton?: boolean;
454
+ /** Keyframe animation over the group TRANSFORM tracks (`offsetX/Y/Z` in cells, `rotateX/Y/Z` in radians, `scale`; the 2D painter also honors `opacity`) — children inherit it, so nested animated groups form a joint chain. Material tracks belong on leaf meshes. */
455
+ animation?: DrawMeshAnimation;
456
+ /** 0..1 opacity. */
457
+ opacity?: number;
458
+ /** Clip the group's items to an SVG path (`d` syntax) in world units relative to the group origin — masked reveals, meters, portraits. */
459
+ clip?: string;
460
+ /** The grouped drawables, painted through the normal dispatch. */
461
+ items: DrawableNode[];
462
+ }
463
+
424
464
  /**
425
465
  * `draw-sprite-layer` — batch multiple sprites in one descriptor for O(layers) rendering.
426
466
  *
@@ -271,42 +271,15 @@ interface DrawTextProps extends DrawableBase {
271
271
  opacity?: number;
272
272
  }
273
273
 
274
- /**
275
- * `draw-group` — the drawable CONTAINER atom (dimension-agnostic).
276
- *
277
- * Multi-shape art (a hero token = cloak + head + sword shapes) travels as ONE
278
- * node: the host paints the group by translating to its projected position,
279
- * applying `scale`/`rotate`/`opacity`, then painting each `items` descriptor
280
- * through the normal dispatch. `items` is a plain data prop (NOT `children`,
281
- * which UISlotRenderer special-cases) — same convention as the `draw-*-layer`
282
- * molecules. The React component renders `null`; it exists so the pattern
283
- * pipeline registers a `draw-group` pattern and standalone pages stay
284
- * inspectable. 2D-canvas only — the 3D backend skips it with a warn.
285
- */
286
-
287
- interface DrawGroupProps extends DrawableBase {
288
- type: 'draw-group';
289
- /** Logical scene position; the projector maps it to pixels / world. */
290
- position: ScenePos;
291
- /** Uniform scale applied to the whole group. */
292
- scale?: number;
293
- /** Rotation in radians (painter units). */
294
- rotate?: number;
295
- /** 0..1 opacity. */
296
- opacity?: number;
297
- /** Clip the group's items to an SVG path (`d` syntax) in world units relative to the group origin — masked reveals, meters, portraits. */
298
- clip?: string;
299
- /** The grouped drawables, painted through the normal dispatch. */
300
- items: DrawableNode[];
301
- }
302
-
303
274
  /**
304
275
  * `draw-mesh` — the volumetric 3D drawable atom (3D-canvas backend).
305
276
  *
306
277
  * ONE descriptor (`DrawMeshProps`, grounded in core `ScenePos`) with the R3F
307
278
  * backend `Mesh3D` in `lib/drawable/three/DrawMesh3D` (kept OUT of this file so
308
279
  * the 2D path never pulls three). A parametric primitive (box, sphere, capsule,
309
- * cylinder, cone, torus, plane, circle) at a scene position `position.z` is
280
+ * cylinder, cone, torus, plane, circle `plane`/`circle` lie flat in the
281
+ * scene ground plane facing up, matching the 2D painter) or a raw-geometry `polyhedron`
282
+ * (`vertices` + `faces` as plain data) at a scene position — `position.z` is
310
283
  * height in cells — with a data-driven material (`standard`/`physical`/`toon`/
311
284
  * `basic`), an optional inverted-hull outline, and keyframe animation over
312
285
  * transform/material tracks. Low-poly is a knob, not a geometry rewrite:
@@ -316,7 +289,7 @@ interface DrawGroupProps extends DrawableBase {
316
289
  * pattern and standalone pages stay inspectable.
317
290
  */
318
291
 
319
- type MeshShapeKind = 'box' | 'sphere' | 'capsule' | 'cylinder' | 'cone' | 'torus' | 'plane' | 'circle';
292
+ type MeshShapeKind = 'box' | 'sphere' | 'capsule' | 'cylinder' | 'cone' | 'torus' | 'plane' | 'circle' | 'polyhedron';
320
293
  type MeshMaterialKind = 'standard' | 'physical' | 'toon' | 'basic';
321
294
  type MeshMaterialSide = 'front' | 'back' | 'double';
322
295
  /**
@@ -386,6 +359,22 @@ interface DrawMeshAnimation {
386
359
  /** Keyframes ordered by `at` (0..1). */
387
360
  keyframes: DrawMeshKeyframe[];
388
361
  }
362
+ /**
363
+ * Smooth-skinning data for a `polyhedron` — plain declarative data, no runtime
364
+ * objects. Vertices carry blended bone weights (a neck-base vertex can be 60%
365
+ * neck / 40% spine), so the surface stretches continuously across joints
366
+ * instead of cracking at rigid chunk boundaries.
367
+ */
368
+ interface DrawMeshSkin {
369
+ /** Bone names, resolved against sibling `draw-group` `bone:` names in the same canvas. */
370
+ bones: string[];
371
+ /** One 16-float column-major inverse bind matrix per bone (model space → bone bind-local; translations in cells). */
372
+ inverseBindMatrices: number[][];
373
+ /** Per-vertex bone indices into `bones`, up to 4 each (pad with 0). */
374
+ indices: number[][];
375
+ /** Per-vertex blend weights matching `indices`, normalized to sum 1 (pad with 0). */
376
+ weights: number[][];
377
+ }
389
378
  interface DrawMeshProps extends DrawableBase {
390
379
  type: 'draw-mesh';
391
380
  shape: MeshShapeKind;
@@ -407,9 +396,15 @@ interface DrawMeshProps extends DrawableBase {
407
396
  tube?: number;
408
397
  /** Curved-surface tessellation, clamped 3..64 (default 24). 4–8 + `flatShading` = low-poly. */
409
398
  segments?: number;
399
+ /** `polyhedron` only: raw vertices as scene-frame `[x, y, z]` triples in cells, `z` = up. */
400
+ vertices?: number[][];
401
+ /** `polyhedron` only: triangle index triples into `vertices`, wound counter-clockwise seen from OUTSIDE in the scene frame. */
402
+ faces?: number[][];
403
+ /** `polyhedron` only: smooth-skinning weights binding the vertices to named bone groups. Vertices must then be authored in BIND POSE model space; the bones' animated transforms deform them. */
404
+ skin?: DrawMeshSkin;
410
405
  /** Euler rotation `[x, y, z]` in radians. */
411
406
  rotation?: [number, number, number];
412
- /** `bottom` (default) rests the mesh on its position's ground plane; `center` centers it there. */
407
+ /** `bottom` (default) rests the mesh on its position's ground plane; `center` centers it there. For `polyhedron`, `bottom` lifts by −min(z) and `center` applies no offset — the vertices are authoritative. */
413
408
  pivot?: 'bottom' | 'center';
414
409
  material?: MeshMaterial;
415
410
  outline?: MeshOutline;
@@ -421,6 +416,51 @@ interface DrawMeshProps extends DrawableBase {
421
416
  opacity?: number;
422
417
  }
423
418
 
419
+ /**
420
+ * `draw-group` — the drawable CONTAINER atom (dimension-agnostic).
421
+ *
422
+ * Multi-shape art (a hero token = cloak + head + sword shapes) travels as ONE
423
+ * node: the host paints the group by translating to its projected position,
424
+ * applying `scale`/`rotate`/`opacity`, then painting each `items` descriptor
425
+ * through the normal dispatch. `items` is a plain data prop (NOT `children`,
426
+ * which UISlotRenderer special-cases) — same convention as the `draw-*-layer`
427
+ * molecules. The React component renders `null`; it exists so the pattern
428
+ * pipeline registers a `draw-group` pattern and standalone pages stay
429
+ * inspectable. Both backends paint it: 2D as a canvas transform, 3D as a three
430
+ * `<group>` — with `rotation` + `animation` a nested group chain is a skeleton
431
+ * bone chain (rotate the shoulder group and the forearm group follows).
432
+ */
433
+
434
+ interface DrawGroupProps extends DrawableBase {
435
+ type: 'draw-group';
436
+ /** Logical scene position; the projector maps it to pixels / world. */
437
+ position: ScenePos;
438
+ /** Uniform scale applied to the whole group. */
439
+ scale?: number;
440
+ /** Rotation in radians (painter units). */
441
+ rotate?: number;
442
+ /** Euler rotation `[x, y, z]` in radians (world axes) — per-axis joint rotation for the 3D backend; a group placed at a joint with children authored joint-local IS a bone. The 2D painter applies only the in-plane `z` component, after `rotate`. */
443
+ rotation?: [number, number, number];
444
+ /** Skeleton bone name. A named group is addressable by a `draw-mesh` `skin`
445
+ * block (smooth skinning): the skinned mesh deforms with this group's
446
+ * animated transform. Names resolve within the nearest enclosing
447
+ * `skeleton: true` group (falling back to the canvas), so multiple
448
+ * instances of one rig never collide. Distinct from `id` (the hit-test
449
+ * handle). */
450
+ bone?: string;
451
+ /** Marks this group as a skeleton SCOPE: `bone` names and `skin` bindings in
452
+ * its subtree resolve against each other only — one scope per rig instance. */
453
+ skeleton?: boolean;
454
+ /** Keyframe animation over the group TRANSFORM tracks (`offsetX/Y/Z` in cells, `rotateX/Y/Z` in radians, `scale`; the 2D painter also honors `opacity`) — children inherit it, so nested animated groups form a joint chain. Material tracks belong on leaf meshes. */
455
+ animation?: DrawMeshAnimation;
456
+ /** 0..1 opacity. */
457
+ opacity?: number;
458
+ /** Clip the group's items to an SVG path (`d` syntax) in world units relative to the group origin — masked reveals, meters, portraits. */
459
+ clip?: string;
460
+ /** The grouped drawables, painted through the normal dispatch. */
461
+ items: DrawableNode[];
462
+ }
463
+
424
464
  /**
425
465
  * `draw-sprite-layer` — batch multiple sprites in one descriptor for O(layers) rendering.
426
466
  *