@almadar/ui 5.112.0 → 5.113.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,4 +1,4 @@
1
- import { AnimationName, Asset, ScenePos, JsonObject, JsonValue } from '@almadar/core';
1
+ import { AnimationName, Asset, JsonObject, JsonValue } from '@almadar/core';
2
2
 
3
3
  /**
4
4
  * Sprite Sheet Animation Types
@@ -278,224 +278,6 @@ interface CameraState {
278
278
  zoom: number;
279
279
  }
280
280
 
281
- /** Source sub-rectangle within a texture (an atlas frame). Omitted → whole texture. */
282
- interface BlitSrc {
283
- x: number;
284
- y: number;
285
- w: number;
286
- h: number;
287
- }
288
- /** A polyline/polygon vertex in pixel space. */
289
- interface PainterPoint {
290
- x: number;
291
- y: number;
292
- }
293
- /** A drop shadow applied to subsequent draws until cleared. */
294
- interface PainterShadow {
295
- color: string;
296
- blur: number;
297
- }
298
-
299
- /**
300
- * Drawable contract — the shared vocabulary every neutral drawable primitive
301
- * (the `draw-sprite`/`draw-shape`/`draw-text` atoms, `draw-sprite-layer`/
302
- * `draw-shape-layer` molecules) is authored against. A drawable is a pure
303
- * descriptor the canvas HOST walks and paints via the portable {@link Painter2D}
304
- * seam — no `CanvasRenderingContext2D`, no DOM. Genre (a "unit"/"tile"/
305
- * "highlight") is a `.lolo` COMPOSITION of these, never its own primitive.
306
- *
307
- * A position is a core `ScenePos` (logical scene space). The host's {@link Projector}
308
- * maps it to pixels; primitives never do projection math themselves. Because the
309
- * `ScenePos` type identity is what pattern-sync stamps as the `drawable`
310
- * capability, every drawable descriptor's `position` MUST be a core `ScenePos`.
311
- */
312
-
313
- /**
314
- * How a drawable aligns to its projected position.
315
- * - `top-left` — the cell's top-left corner (tiles).
316
- * - `ground` — the cell's ground point, bottom-center of the drawable (units/features).
317
- * - `center` — the cell's visual center (effects).
318
- */
319
- type DrawableAnchor = 'top-left' | 'ground' | 'center';
320
- /** Common shape of every drawable descriptor. `type` keys the host's paint dispatch. */
321
- interface DrawableBase {
322
- type: string;
323
- /**
324
- * Optional hit-test handle. When a board authors a per-entity id here (e.g.
325
- * `id: (object/get @u id)` on a unit sprite), the canvas host indexes the
326
- * descriptor's `ScenePos → id` and resolves a pointer/raycast at that cell to
327
- * this id — the source of `unitClickEvent {unitId}`. A source-tagged handle,
328
- * NOT a heuristic: no id → the host emits only the coordinate (tile click).
329
- */
330
- id?: string;
331
- }
332
-
333
- /**
334
- * `draw-sprite` — the neutral image/atlas-frame drawable atom (dimension-agnostic).
335
- *
336
- * ONE descriptor (`DrawSpriteProps`, grounded in core `ScenePos` + `Asset`) with
337
- * TWO backends: `paintSprite` (2D, here — via the portable `Painter2D` seam) and
338
- * an R3F mesh (`Sprite3D` in `lib/drawable/mesh3d`, kept OUT of this file so the
339
- * 2D paint path never pulls `three`/`drei` into an app bundle — the codebase
340
- * code-splits R3F). The canvas host picks the backend by `mode`; that is what
341
- * makes canvas-2d and canvas-3d the same `children` interface. Genre uses (tile,
342
- * unit body, feature, effect, movement ghost, background cover) are all this atom
343
- * with different `anchor`/`size`/`frame`/`flip`/`shadow` — composed in `.lolo`,
344
- * not here. The React component renders `null` (a drawable is painted by the host,
345
- * not the DOM); it exists so the pattern pipeline registers a `draw-sprite`
346
- * pattern and standalone pages stay inspectable.
347
- */
348
-
349
- interface DrawSpriteProps extends DrawableBase {
350
- type: 'draw-sprite';
351
- /** Logical scene position; the projector maps it to pixels / world. */
352
- position: ScenePos;
353
- /** The image / atlas reference to blit. */
354
- asset: Asset;
355
- /** How the sprite aligns to its projected position. Default `'top-left'`. */
356
- anchor?: DrawableAnchor;
357
- /** Draw width in world units (fractions of `projector.tileWidth`); omitted → resolved source width in px. */
358
- width?: number;
359
- /** Draw height in world units (fractions of `projector.tileWidth`); omitted → resolved source height in px. */
360
- height?: number;
361
- /** Explicit atlas sub-rect override (px); omitted → resolved from `asset.atlas`/`asset.sprite`. */
362
- frame?: BlitSrc;
363
- /** Mirror horizontally (facing). */
364
- flipX?: boolean;
365
- /** Rotation in radians about the sprite's center. */
366
- rotation?: number;
367
- /** 0..1 opacity. */
368
- opacity?: number;
369
- /** Drop shadow (e.g. a team-colored glow). */
370
- shadow?: PainterShadow;
371
- }
372
-
373
- /**
374
- * `draw-shape` — the neutral vector-fill/stroke drawable atom (dimension-agnostic).
375
- *
376
- * ONE descriptor (`DrawShapeProps`, grounded in core `ScenePos`) with TWO
377
- * backends: `paintShape` (2D, here) and an R3F ground-plane mesh (`Shape3D` in
378
- * `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
379
- * Paints a cell footprint, an axis-aligned rect, an ellipse, or a poly at a scene
380
- * position, fill and/or stroke. Genre uses (tile fallback, iso/hex diamond
381
- * fallback, cell highlight, feature disc, unit selection ring, unit fallback
382
- * circle, ground/ghost discs, solid backgrounds, side-view platform rects) are
383
- * all this atom with different `shape`/`anchor`/geometry — composed in `.lolo`,
384
- * not here. The React component renders `null`; it exists so the pattern pipeline
385
- * registers a `draw-shape` pattern and standalone pages stay inspectable.
386
- */
387
-
388
- type ShapeKind = 'cell' | 'rect' | 'ellipse' | 'poly';
389
- interface DrawShapeProps extends DrawableBase {
390
- type: 'draw-shape';
391
- shape: ShapeKind;
392
- /** Logical scene position; the projector maps it to pixels / world. */
393
- position: ScenePos;
394
- /** How the shape aligns to its projected position. Default varies by `shape`. */
395
- anchor?: DrawableAnchor;
396
- /** Rect width in world units (fractions of `projector.tileWidth`). */
397
- width?: number;
398
- /** Rect height in world units (fractions of `projector.tileWidth`). */
399
- height?: number;
400
- /** Ellipse horizontal radius in world units (fractions of `projector.tileWidth`). */
401
- radiusX?: number;
402
- /** Ellipse vertical radius in world units; omitted → `radiusX` (a circle). */
403
- radiusY?: number;
404
- /** Fine nudge from the anchor point in world units. */
405
- offsetX?: number;
406
- offsetY?: number;
407
- /** Poly vertices as world-unit offsets relative to the cell's projected top-left. */
408
- points?: PainterPoint[];
409
- fill?: string;
410
- stroke?: string;
411
- strokeWidth?: number;
412
- /** 0..1 opacity. */
413
- opacity?: number;
414
- }
415
-
416
- /**
417
- * `draw-text` — the neutral text drawable atom (dimension-agnostic).
418
- *
419
- * ONE descriptor (`DrawTextProps`, grounded in core `ScenePos`) with TWO backends:
420
- * `paintText` (2D, here) and an R3F billboarded `<Text>` (`Text3D` in
421
- * `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
422
- * Paints a string at a scene position with font/color/alignment. The React
423
- * component renders `null` (a drawable is painted by the host, not the DOM).
424
- */
425
-
426
- interface DrawTextProps extends DrawableBase {
427
- type: 'draw-text';
428
- text: string;
429
- /** Logical scene position; the projector maps it to pixels / world. */
430
- position: ScenePos;
431
- anchor?: DrawableAnchor;
432
- offsetX?: number;
433
- offsetY?: number;
434
- color: string;
435
- font?: string;
436
- align?: CanvasTextAlign;
437
- baseline?: CanvasTextBaseline;
438
- opacity?: number;
439
- }
440
-
441
- /**
442
- * `draw-sprite-layer` — batch multiple sprites in one descriptor for O(layers) rendering.
443
- *
444
- * Composes the `draw-sprite` atom; the layer itself carries no `position` — each
445
- * item does. It is drawable-by-composition: its `items` are `draw-sprite`
446
- * descriptors (each grounded in core `ScenePos`), which is what stamps the layer
447
- * `drawable` at pattern-sync time.
448
- */
449
-
450
- interface DrawSpriteLayerProps extends DrawableBase {
451
- type: 'draw-sprite-layer';
452
- /** Sprites painted in array order; z-ordering is the caller's responsibility. */
453
- items: DrawSpriteProps[];
454
- }
455
-
456
- /**
457
- * `draw-shape-layer` — batch of shapes in one descriptor for O(layers) perf.
458
- *
459
- * Composes the `draw-shape` atom; drawable-by-composition (its `items` are
460
- * `draw-shape` descriptors, each grounded in core `ScenePos`). The React
461
- * component renders `null` (a drawable is painted by the host, not the DOM).
462
- */
463
-
464
- interface DrawShapeLayerProps extends DrawableBase {
465
- type: 'draw-shape-layer';
466
- items: DrawShapeProps[];
467
- }
468
-
469
- /**
470
- * `draw-text-layer` — batch of text labels in one descriptor for O(layers) perf.
471
- *
472
- * Composes the `draw-text` atom; drawable-by-composition (its `items` are
473
- * `draw-text` descriptors, each grounded in core `ScenePos`). Covers the batched
474
- * world-space text pass — fx messages, damage numbers, unit labels — that a
475
- * board maps from an entity array (`items: (array/map @entity.fx (fn ...))`),
476
- * which a literal `children` array can't express. The React component renders
477
- * `null` (a drawable is painted by the host, not the DOM).
478
- */
479
-
480
- interface DrawTextLayerProps extends DrawableBase {
481
- type: 'draw-text-layer';
482
- items: DrawTextProps[];
483
- }
484
-
485
- /**
486
- * Drawable paint dispatch (2D) + the `DrawableNode` union.
487
- *
488
- * `paintDrawable` routes ONE descriptor to its 2D painter; the host walks its
489
- * `children` through it. The "drawable" designation itself is NOT recorded here —
490
- * it is DERIVED from the core `ScenePos` type each descriptor's `position` uses
491
- * and stamped into `patterns-registry.json` by pattern-sync (mirroring how `Asset`
492
- * is tagged), then read by the orbital-rust validator. So this module is pure
493
- * paint routing; the capability is the registry's, not a hand-list.
494
- */
495
-
496
- /** Every drawable descriptor. The host's `children` are a `DrawableNode[]`. */
497
- type DrawableNode = DrawSpriteProps | DrawShapeProps | DrawTextProps | DrawSpriteLayerProps | DrawShapeLayerProps | DrawTextLayerProps;
498
-
499
281
  /**
500
282
  * AVL Schema Parser
501
283
  *
@@ -608,4 +390,4 @@ interface TransitionLevelData {
608
390
  slotTargets: SlotTarget[];
609
391
  }
610
392
 
611
- export { type ApplicationLevelData as A, type BoardTile as B, type CameraState as C, type DrawableNode as D, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, type SpriteFrameDims as d, type FieldInfo as e, type OrbitalTraitInfo as f, type OrbitalPageInfo as g, type GamePhase as h, type GameState as i, type GameUnit as j, type UnitTrait as k, calculateAttackTargets as l, calculateValidMoves as m, createInitialGameState as n };
393
+ export { type ApplicationLevelData as A, type BoardTile as B, type CameraState as C, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, type SpriteFrameDims as d, type FieldInfo as e, type OrbitalTraitInfo as f, type OrbitalPageInfo as g, type GamePhase as h, type GameState as i, type GameUnit as j, type UnitTrait as k, calculateAttackTargets as l, calculateValidMoves as m, createInitialGameState as n };
@@ -1,4 +1,4 @@
1
- import { AnimationName, Asset, ScenePos, JsonObject, JsonValue } from '@almadar/core';
1
+ import { AnimationName, Asset, JsonObject, JsonValue } from '@almadar/core';
2
2
 
3
3
  /**
4
4
  * Sprite Sheet Animation Types
@@ -278,224 +278,6 @@ interface CameraState {
278
278
  zoom: number;
279
279
  }
280
280
 
281
- /** Source sub-rectangle within a texture (an atlas frame). Omitted → whole texture. */
282
- interface BlitSrc {
283
- x: number;
284
- y: number;
285
- w: number;
286
- h: number;
287
- }
288
- /** A polyline/polygon vertex in pixel space. */
289
- interface PainterPoint {
290
- x: number;
291
- y: number;
292
- }
293
- /** A drop shadow applied to subsequent draws until cleared. */
294
- interface PainterShadow {
295
- color: string;
296
- blur: number;
297
- }
298
-
299
- /**
300
- * Drawable contract — the shared vocabulary every neutral drawable primitive
301
- * (the `draw-sprite`/`draw-shape`/`draw-text` atoms, `draw-sprite-layer`/
302
- * `draw-shape-layer` molecules) is authored against. A drawable is a pure
303
- * descriptor the canvas HOST walks and paints via the portable {@link Painter2D}
304
- * seam — no `CanvasRenderingContext2D`, no DOM. Genre (a "unit"/"tile"/
305
- * "highlight") is a `.lolo` COMPOSITION of these, never its own primitive.
306
- *
307
- * A position is a core `ScenePos` (logical scene space). The host's {@link Projector}
308
- * maps it to pixels; primitives never do projection math themselves. Because the
309
- * `ScenePos` type identity is what pattern-sync stamps as the `drawable`
310
- * capability, every drawable descriptor's `position` MUST be a core `ScenePos`.
311
- */
312
-
313
- /**
314
- * How a drawable aligns to its projected position.
315
- * - `top-left` — the cell's top-left corner (tiles).
316
- * - `ground` — the cell's ground point, bottom-center of the drawable (units/features).
317
- * - `center` — the cell's visual center (effects).
318
- */
319
- type DrawableAnchor = 'top-left' | 'ground' | 'center';
320
- /** Common shape of every drawable descriptor. `type` keys the host's paint dispatch. */
321
- interface DrawableBase {
322
- type: string;
323
- /**
324
- * Optional hit-test handle. When a board authors a per-entity id here (e.g.
325
- * `id: (object/get @u id)` on a unit sprite), the canvas host indexes the
326
- * descriptor's `ScenePos → id` and resolves a pointer/raycast at that cell to
327
- * this id — the source of `unitClickEvent {unitId}`. A source-tagged handle,
328
- * NOT a heuristic: no id → the host emits only the coordinate (tile click).
329
- */
330
- id?: string;
331
- }
332
-
333
- /**
334
- * `draw-sprite` — the neutral image/atlas-frame drawable atom (dimension-agnostic).
335
- *
336
- * ONE descriptor (`DrawSpriteProps`, grounded in core `ScenePos` + `Asset`) with
337
- * TWO backends: `paintSprite` (2D, here — via the portable `Painter2D` seam) and
338
- * an R3F mesh (`Sprite3D` in `lib/drawable/mesh3d`, kept OUT of this file so the
339
- * 2D paint path never pulls `three`/`drei` into an app bundle — the codebase
340
- * code-splits R3F). The canvas host picks the backend by `mode`; that is what
341
- * makes canvas-2d and canvas-3d the same `children` interface. Genre uses (tile,
342
- * unit body, feature, effect, movement ghost, background cover) are all this atom
343
- * with different `anchor`/`size`/`frame`/`flip`/`shadow` — composed in `.lolo`,
344
- * not here. The React component renders `null` (a drawable is painted by the host,
345
- * not the DOM); it exists so the pattern pipeline registers a `draw-sprite`
346
- * pattern and standalone pages stay inspectable.
347
- */
348
-
349
- interface DrawSpriteProps extends DrawableBase {
350
- type: 'draw-sprite';
351
- /** Logical scene position; the projector maps it to pixels / world. */
352
- position: ScenePos;
353
- /** The image / atlas reference to blit. */
354
- asset: Asset;
355
- /** How the sprite aligns to its projected position. Default `'top-left'`. */
356
- anchor?: DrawableAnchor;
357
- /** Draw width in world units (fractions of `projector.tileWidth`); omitted → resolved source width in px. */
358
- width?: number;
359
- /** Draw height in world units (fractions of `projector.tileWidth`); omitted → resolved source height in px. */
360
- height?: number;
361
- /** Explicit atlas sub-rect override (px); omitted → resolved from `asset.atlas`/`asset.sprite`. */
362
- frame?: BlitSrc;
363
- /** Mirror horizontally (facing). */
364
- flipX?: boolean;
365
- /** Rotation in radians about the sprite's center. */
366
- rotation?: number;
367
- /** 0..1 opacity. */
368
- opacity?: number;
369
- /** Drop shadow (e.g. a team-colored glow). */
370
- shadow?: PainterShadow;
371
- }
372
-
373
- /**
374
- * `draw-shape` — the neutral vector-fill/stroke drawable atom (dimension-agnostic).
375
- *
376
- * ONE descriptor (`DrawShapeProps`, grounded in core `ScenePos`) with TWO
377
- * backends: `paintShape` (2D, here) and an R3F ground-plane mesh (`Shape3D` in
378
- * `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
379
- * Paints a cell footprint, an axis-aligned rect, an ellipse, or a poly at a scene
380
- * position, fill and/or stroke. Genre uses (tile fallback, iso/hex diamond
381
- * fallback, cell highlight, feature disc, unit selection ring, unit fallback
382
- * circle, ground/ghost discs, solid backgrounds, side-view platform rects) are
383
- * all this atom with different `shape`/`anchor`/geometry — composed in `.lolo`,
384
- * not here. The React component renders `null`; it exists so the pattern pipeline
385
- * registers a `draw-shape` pattern and standalone pages stay inspectable.
386
- */
387
-
388
- type ShapeKind = 'cell' | 'rect' | 'ellipse' | 'poly';
389
- interface DrawShapeProps extends DrawableBase {
390
- type: 'draw-shape';
391
- shape: ShapeKind;
392
- /** Logical scene position; the projector maps it to pixels / world. */
393
- position: ScenePos;
394
- /** How the shape aligns to its projected position. Default varies by `shape`. */
395
- anchor?: DrawableAnchor;
396
- /** Rect width in world units (fractions of `projector.tileWidth`). */
397
- width?: number;
398
- /** Rect height in world units (fractions of `projector.tileWidth`). */
399
- height?: number;
400
- /** Ellipse horizontal radius in world units (fractions of `projector.tileWidth`). */
401
- radiusX?: number;
402
- /** Ellipse vertical radius in world units; omitted → `radiusX` (a circle). */
403
- radiusY?: number;
404
- /** Fine nudge from the anchor point in world units. */
405
- offsetX?: number;
406
- offsetY?: number;
407
- /** Poly vertices as world-unit offsets relative to the cell's projected top-left. */
408
- points?: PainterPoint[];
409
- fill?: string;
410
- stroke?: string;
411
- strokeWidth?: number;
412
- /** 0..1 opacity. */
413
- opacity?: number;
414
- }
415
-
416
- /**
417
- * `draw-text` — the neutral text drawable atom (dimension-agnostic).
418
- *
419
- * ONE descriptor (`DrawTextProps`, grounded in core `ScenePos`) with TWO backends:
420
- * `paintText` (2D, here) and an R3F billboarded `<Text>` (`Text3D` in
421
- * `lib/drawable/mesh3d`, kept OUT of this file so the 2D path never pulls R3F).
422
- * Paints a string at a scene position with font/color/alignment. The React
423
- * component renders `null` (a drawable is painted by the host, not the DOM).
424
- */
425
-
426
- interface DrawTextProps extends DrawableBase {
427
- type: 'draw-text';
428
- text: string;
429
- /** Logical scene position; the projector maps it to pixels / world. */
430
- position: ScenePos;
431
- anchor?: DrawableAnchor;
432
- offsetX?: number;
433
- offsetY?: number;
434
- color: string;
435
- font?: string;
436
- align?: CanvasTextAlign;
437
- baseline?: CanvasTextBaseline;
438
- opacity?: number;
439
- }
440
-
441
- /**
442
- * `draw-sprite-layer` — batch multiple sprites in one descriptor for O(layers) rendering.
443
- *
444
- * Composes the `draw-sprite` atom; the layer itself carries no `position` — each
445
- * item does. It is drawable-by-composition: its `items` are `draw-sprite`
446
- * descriptors (each grounded in core `ScenePos`), which is what stamps the layer
447
- * `drawable` at pattern-sync time.
448
- */
449
-
450
- interface DrawSpriteLayerProps extends DrawableBase {
451
- type: 'draw-sprite-layer';
452
- /** Sprites painted in array order; z-ordering is the caller's responsibility. */
453
- items: DrawSpriteProps[];
454
- }
455
-
456
- /**
457
- * `draw-shape-layer` — batch of shapes in one descriptor for O(layers) perf.
458
- *
459
- * Composes the `draw-shape` atom; drawable-by-composition (its `items` are
460
- * `draw-shape` descriptors, each grounded in core `ScenePos`). The React
461
- * component renders `null` (a drawable is painted by the host, not the DOM).
462
- */
463
-
464
- interface DrawShapeLayerProps extends DrawableBase {
465
- type: 'draw-shape-layer';
466
- items: DrawShapeProps[];
467
- }
468
-
469
- /**
470
- * `draw-text-layer` — batch of text labels in one descriptor for O(layers) perf.
471
- *
472
- * Composes the `draw-text` atom; drawable-by-composition (its `items` are
473
- * `draw-text` descriptors, each grounded in core `ScenePos`). Covers the batched
474
- * world-space text pass — fx messages, damage numbers, unit labels — that a
475
- * board maps from an entity array (`items: (array/map @entity.fx (fn ...))`),
476
- * which a literal `children` array can't express. The React component renders
477
- * `null` (a drawable is painted by the host, not the DOM).
478
- */
479
-
480
- interface DrawTextLayerProps extends DrawableBase {
481
- type: 'draw-text-layer';
482
- items: DrawTextProps[];
483
- }
484
-
485
- /**
486
- * Drawable paint dispatch (2D) + the `DrawableNode` union.
487
- *
488
- * `paintDrawable` routes ONE descriptor to its 2D painter; the host walks its
489
- * `children` through it. The "drawable" designation itself is NOT recorded here —
490
- * it is DERIVED from the core `ScenePos` type each descriptor's `position` uses
491
- * and stamped into `patterns-registry.json` by pattern-sync (mirroring how `Asset`
492
- * is tagged), then read by the orbital-rust validator. So this module is pure
493
- * paint routing; the capability is the registry's, not a hand-list.
494
- */
495
-
496
- /** Every drawable descriptor. The host's `children` are a `DrawableNode[]`. */
497
- type DrawableNode = DrawSpriteProps | DrawShapeProps | DrawTextProps | DrawSpriteLayerProps | DrawShapeLayerProps | DrawTextLayerProps;
498
-
499
281
  /**
500
282
  * AVL Schema Parser
501
283
  *
@@ -608,4 +390,4 @@ interface TransitionLevelData {
608
390
  slotTargets: SlotTarget[];
609
391
  }
610
392
 
611
- export { type ApplicationLevelData as A, type BoardTile as B, type CameraState as C, type DrawableNode as D, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, type SpriteFrameDims as d, type FieldInfo as e, type OrbitalTraitInfo as f, type OrbitalPageInfo as g, type GamePhase as h, type GameState as i, type GameUnit as j, type UnitTrait as k, calculateAttackTargets as l, calculateValidMoves as m, createInitialGameState as n };
393
+ export { type ApplicationLevelData as A, type BoardTile as B, type CameraState as C, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, type SpriteFrameDims as d, type FieldInfo as e, type OrbitalTraitInfo as f, type OrbitalPageInfo as g, type GamePhase as h, type GameState as i, type GameUnit as j, type UnitTrait as k, calculateAttackTargets as l, calculateValidMoves as m, createInitialGameState as n };
@@ -1,4 +1,5 @@
1
1
  import { OrbitalSchema, SExpr, Effect, OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
2
+ import { D as DrawableNode } from './paintDispatch-DR942knx.cjs';
2
3
  import { ClassValue } from 'clsx';
3
4
 
4
5
  /**
@@ -277,7 +278,7 @@ declare function bindCanvasCapture(captureFn: () => string | null): void;
277
278
  * Lets verification scripts inspect exactly which neutral descriptors reached
278
279
  * the painter without re-deriving them from state.
279
280
  */
280
- declare function bindLastDrawables(getDrawables: () => unknown[] | null): void;
281
+ declare function bindLastDrawables(getDrawables: () => DrawableNode[] | null): void;
281
282
  /**
282
283
  * Update asset load status for canvas verification.
283
284
  * Game organisms call this when images load or fail.
@@ -1,4 +1,5 @@
1
1
  import { OrbitalSchema, SExpr, Effect, OrbitalVerificationAPI, TraitStateSnapshot, EventPayload, BusEvent, VerificationCheck, BridgeHealth, VerificationSnapshot, VerificationSummary, TransitionTrace, ServerResponseTrace, CheckStatus, AssetLoadStatus } from '@almadar/core';
2
+ import { D as DrawableNode } from './paintDispatch-DR942knx.js';
2
3
  import { ClassValue } from 'clsx';
3
4
 
4
5
  /**
@@ -277,7 +278,7 @@ declare function bindCanvasCapture(captureFn: () => string | null): void;
277
278
  * Lets verification scripts inspect exactly which neutral descriptors reached
278
279
  * the painter without re-deriving them from state.
279
280
  */
280
- declare function bindLastDrawables(getDrawables: () => unknown[] | null): void;
281
+ declare function bindLastDrawables(getDrawables: () => DrawableNode[] | null): void;
281
282
  /**
282
283
  * Update asset load status for canvas verification.
283
284
  * Game organisms call this when images load or fail.
@@ -16117,14 +16117,16 @@ function Canvas2D({
16117
16117
  cameraPos,
16118
16118
  bgColor
16119
16119
  }) {
16120
+ const instanceId = React73.useMemo(() => Math.random().toString(36).slice(2, 8), []);
16121
+ function isDrawableLayer(node) {
16122
+ return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
16123
+ }
16120
16124
  const layerSummaries = drawables?.map((d) => {
16121
- if (!d || typeof d !== "object") return d;
16122
- const rec = d;
16123
- return { type: rec.type, itemsLen: Array.isArray(rec.items) ? rec.items.length : void 0, firstItem: Array.isArray(rec.items) ? rec.items[0] : void 0 };
16125
+ if (!isDrawableLayer(d)) return { type: d.type };
16126
+ return { type: d.type, itemsLen: d.items.length, firstItem: d.items[0] };
16124
16127
  });
16125
- console.error("[debug:Canvas2D] " + JSON.stringify({ projection, scale, cameraMode: camera, cameraPos, drawablesCount: drawables?.length, layerSummaries }));
16128
+ canvas2DLog.debug("Canvas2D render", { instanceId, projection, scale, cameraMode: camera, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, drawablesCount: drawables?.length, layerSummaries: layerSummaries ? JSON.stringify(layerSummaries) : void 0 });
16126
16129
  const backgroundImage = normalizeBackdrop(backgroundImageRaw);
16127
- const instanceId = React73.useMemo(() => Math.random().toString(36).slice(2, 8), []);
16128
16130
  const isFree = projection === "free";
16129
16131
  const squareGrid = projection === "flat" || isFree || projection === "side";
16130
16132
  const layout = projection === "side" ? "free" : projection;
@@ -16259,7 +16261,7 @@ function Canvas2D({
16259
16261
  }
16260
16262
  const containerRect = containerRef.current?.getBoundingClientRect();
16261
16263
  const canvasRect = canvas.getBoundingClientRect();
16262
- console.error("[debug:Canvas2D:draw:" + instanceId + "] " + JSON.stringify({ viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null }));
16264
+ canvas2DLog.debug("Canvas2D draw", { instanceId, viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null });
16263
16265
  const painter = createWebPainter(ctx, bumpAtlas);
16264
16266
  painter.save();
16265
16267
  painter.translate(viewportSize.width / 2, viewportSize.height / 2);
@@ -16471,6 +16473,7 @@ function Canvas2D({
16471
16473
  }
16472
16474
  );
16473
16475
  }
16476
+ var canvas2DLog;
16474
16477
  var init_Canvas2D = __esm({
16475
16478
  "components/game/molecules/Canvas2D.tsx"() {
16476
16479
  "use client";
@@ -16492,6 +16495,7 @@ var init_Canvas2D = __esm({
16492
16495
  init_paintDispatch();
16493
16496
  init_hitTest();
16494
16497
  init_isometric();
16498
+ canvas2DLog = logger.createLogger("almadar:ui:game-canvas");
16495
16499
  Canvas2D.displayName = "Canvas2D";
16496
16500
  }
16497
16501
  });
@@ -16530,7 +16534,7 @@ function Canvas({
16530
16534
  keyMap,
16531
16535
  keyUpMap
16532
16536
  }) {
16533
- console.error("[debug:Canvas] " + JSON.stringify({ mode, drawablesCount: drawables?.length, projection, camera }));
16537
+ canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
16534
16538
  const zoom = camera?.zoom;
16535
16539
  if (mode === "3d") {
16536
16540
  const props3d = {
@@ -16583,7 +16587,7 @@ function Canvas({
16583
16587
  }
16584
16588
  );
16585
16589
  }
16586
- var Canvas3DHost;
16590
+ var Canvas3DHost, canvasLog;
16587
16591
  var init_Canvas = __esm({
16588
16592
  "components/game/molecules/Canvas.tsx"() {
16589
16593
  "use client";
@@ -16591,6 +16595,7 @@ var init_Canvas = __esm({
16591
16595
  Canvas3DHost = React73.lazy(
16592
16596
  () => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
16593
16597
  );
16598
+ canvasLog = logger.createLogger("almadar:ui:game-canvas");
16594
16599
  Canvas.displayName = "Canvas";
16595
16600
  }
16596
16601
  });
@@ -6,10 +6,11 @@ import { LucideIcon } from 'lucide-react';
6
6
  import { C as ColorToken, U as UiError, P as Point, L as LinkAction, I as ImageSource } from '../GameAudioProvider-CPGwD49P.cjs';
7
7
  export { A as AudioManifest, G as GameAudioContext, a as GameAudioContextValue, e as GameAudioControls, b as GameAudioProvider, c as GameAudioProviderProps, R as Rect, S as SoundEntry, f as UseGameAudioOptions, g as useGameAudio, u as useGameAudioContext } from '../GameAudioProvider-CPGwD49P.cjs';
8
8
  import { SExpr } from '@almadar/evaluator';
9
- import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, D as DrawableNode, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-DKRm-nyh.cjs';
10
- export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-DKRm-nyh.cjs';
11
- import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-BbPvQLHt.cjs';
12
- export { n as cn } from '../cn-BbPvQLHt.cjs';
9
+ import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-B8Onmfsu.cjs';
10
+ export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-B8Onmfsu.cjs';
11
+ import { D as DrawableNode } from '../paintDispatch-DR942knx.cjs';
12
+ import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-BkQrMR01.cjs';
13
+ export { n as cn } from '../cn-BkQrMR01.cjs';
13
14
  import { b as SlotContent } from '../useUISlots-BesZYMks.cjs';
14
15
  export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.cjs';
15
16
  export { ALMADAR_DND_MIME, AuthContextValue, AuthUser, CanvasGestureCallbacks, CanvasGestureHandlers, CompileResult, CompileStage, DragReorderResult, DraggablePayload, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, HistoryChangeSummary, HistoryTimelineItem, I18nContextValue, I18nProvider, InfiniteScrollOptions, InfiniteScrollResult, LongPressHandlers, LongPressOptions, OpenFile, Positioned, PullToRefreshOptions, PullToRefreshResult, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RenderInterpolationHandle, RenderInterpolationOptions, RevertResult, SelectedFile, SharedEntityStore, SharedEntitySubscriber, SharedEntityWriter, SwipeGestureOptions, SwipeGestureResult, SwipeHandlers, TapRevealOptions, TapRevealResult, TraitListenSpec, TranslateFunction, UseCanvasGesturesOptions, UseCompileResult, UseDraggableOptions, UseDraggableResult, UseDropZoneOptions, UseDropZoneResult, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult, UseOrbitalHistoryOptions, UseOrbitalHistoryResult, createSharedEntityStore, createTranslate, parseQueryBinding, runTickFrame, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useLongPress, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSwipeGesture, useTapReveal, useTraitListens, useTranslate, useUIEvents, useValidation } from '../hooks/index.cjs';
@@ -6,10 +6,11 @@ import { LucideIcon } from 'lucide-react';
6
6
  import { C as ColorToken, U as UiError, P as Point, L as LinkAction, I as ImageSource } from '../GameAudioProvider-CPGwD49P.js';
7
7
  export { A as AudioManifest, G as GameAudioContext, a as GameAudioContextValue, e as GameAudioControls, b as GameAudioProvider, c as GameAudioProviderProps, R as Rect, S as SoundEntry, f as UseGameAudioOptions, g as useGameAudio, u as useGameAudioContext } from '../GameAudioProvider-CPGwD49P.js';
8
8
  import { SExpr } from '@almadar/evaluator';
9
- import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, D as DrawableNode, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-DKRm-nyh.js';
10
- export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-DKRm-nyh.js';
11
- import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-BbPvQLHt.js';
12
- export { n as cn } from '../cn-BbPvQLHt.js';
9
+ import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, d as SpriteFrameDims, R as ResolvedFrame, a as IsometricUnit, C as CameraState, e as FieldInfo, f as OrbitalTraitInfo, g as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-B8Onmfsu.js';
10
+ export { B as BoardTile, G as GameAction, h as GamePhase, i as GameState, j as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, k as UnitTrait, l as calculateAttackTargets, m as calculateValidMoves, n as createInitialGameState } from '../avl-schema-parser-B8Onmfsu.js';
11
+ import { D as DrawableNode } from '../paintDispatch-DR942knx.js';
12
+ import { C as ContentSegment, b as DomLayoutData, d as DomStateNode, V as VisualizerConfig, e as DomTransitionLabel } from '../cn-CTEFm9PC.js';
13
+ export { n as cn } from '../cn-CTEFm9PC.js';
13
14
  import { b as SlotContent } from '../useUISlots-BesZYMks.js';
14
15
  export { D as DEFAULT_SLOTS, S as SlotAnimation, a as SlotChangeCallback, c as SlotRenderConfig, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BesZYMks.js';
15
16
  export { ALMADAR_DND_MIME, AuthContextValue, AuthUser, CanvasGestureCallbacks, CanvasGestureHandlers, CompileResult, CompileStage, DragReorderResult, DraggablePayload, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, HistoryChangeSummary, HistoryTimelineItem, I18nContextValue, I18nProvider, InfiniteScrollOptions, InfiniteScrollResult, LongPressHandlers, LongPressOptions, OpenFile, Positioned, PullToRefreshOptions, PullToRefreshResult, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RenderInterpolationHandle, RenderInterpolationOptions, RevertResult, SelectedFile, SharedEntityStore, SharedEntitySubscriber, SharedEntityWriter, SwipeGestureOptions, SwipeGestureResult, SwipeHandlers, TapRevealOptions, TapRevealResult, TraitListenSpec, TranslateFunction, UseCanvasGesturesOptions, UseCompileResult, UseDraggableOptions, UseDraggableResult, UseDropZoneOptions, UseDropZoneResult, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult, UseOrbitalHistoryOptions, UseOrbitalHistoryResult, createSharedEntityStore, createTranslate, parseQueryBinding, runTickFrame, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useLongPress, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSwipeGesture, useTapReveal, useTraitListens, useTranslate, useUIEvents, useValidation } from '../hooks/index.js';