@almadar/ui 1.0.13 → 1.0.15

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,16 +1,15 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import { SExpr } from '@almadar/evaluator';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import { Entity } from '../stores/index.js';
7
- export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../stores/index.js';
8
6
  export { AuthContextValue, AuthUser, ChangeSummary, CompileResult, CompileStage, ENTITY_EVENTS, EntityDataRecord, EntityMutationResult, Extension, ExtensionManifest, FileSystemFile, FileSystemStatus, GitHubRepo, GitHubStatus, HistoryTimelineItem, OpenFile, OrbitalEventPayload, OrbitalEventResponse, QuerySingletonEntity, QuerySingletonResult, QuerySingletonState, QueryState, RevertResult, SelectedFile, UseCompileResult, UseEntityDetailResult, UseEntityListOptions, UseEntityListResult, UseEntityMutationsOptions, UseExtensionsOptions, UseExtensionsResult, UseFileEditorOptions, UseFileEditorResult, UseFileSystemResult, UseOrbitalHistoryOptions, UseOrbitalHistoryResult, entityDataKeys, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEmitEvent, useEntities, useEntitiesByType, useEntity, useEntityById, useEntityDetail, useEntityList, useEntityMutations, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../hooks/index.js';
9
7
  import { E as EventBusContextType } from '../event-bus-types-8-cjyMxw.js';
10
8
  export { a as EventListener, K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-8-cjyMxw.js';
11
9
  import { S as SlotContent, a as UISlot } from '../useUISlots-mnggE9X9.js';
12
10
  export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, U as UISlotManager, u as useUISlotManager } from '../useUISlots-mnggE9X9.js';
13
11
  export { c as cn } from '../cn-mqkxz8Sd.js';
12
+ export { Entity, clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../stores/index.js';
14
13
  import '@almadar/core';
15
14
  import '@tanstack/react-query';
16
15
  import 'clsx';
@@ -36,9 +35,9 @@ interface SelectOption$1 {
36
35
  value: string;
37
36
  label: string;
38
37
  }
39
- interface InputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> {
38
+ interface InputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
40
39
  /** Input type - supports 'select' and 'textarea' in addition to standard types */
41
- type?: "text" | "email" | "password" | "number" | "tel" | "url" | "search" | "date" | "datetime-local" | "time" | "checkbox" | "select" | "textarea";
40
+ inputType?: "text" | "email" | "password" | "number" | "tel" | "url" | "search" | "date" | "datetime-local" | "time" | "checkbox" | "select" | "textarea";
42
41
  error?: string;
43
42
  leftIcon?: React__default.ReactNode;
44
43
  rightIcon?: React__default.ReactNode;
@@ -340,7 +339,7 @@ interface ProgressBarProps {
340
339
  * Type of the progress bar (linear, circular, stepped)
341
340
  * @default 'linear'
342
341
  */
343
- type?: ProgressBarType;
342
+ progressType?: ProgressBarType;
344
343
  /**
345
344
  * Variant/color of the progress bar
346
345
  * @default 'primary'
@@ -418,7 +417,7 @@ interface SwitchProps {
418
417
  name?: string;
419
418
  className?: string;
420
419
  }
421
- declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
420
+ declare const Switch: React$1.ForwardRefExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
422
421
 
423
422
  /**
424
423
  * Spacer Component
@@ -519,7 +518,7 @@ interface TextHighlightProps {
519
518
  /**
520
519
  * Type of highlight (determines color)
521
520
  */
522
- type: HighlightType;
521
+ highlightType: HighlightType;
523
522
  /**
524
523
  * Whether the highlight is currently active/focused
525
524
  * @default false
@@ -806,7 +805,7 @@ interface ScoreDisplayProps {
806
805
  /** Label to display before score */
807
806
  label?: string;
808
807
  /** Icon component or emoji */
809
- icon?: React.ReactNode;
808
+ icon?: React$1.ReactNode;
810
809
  /** Size variant */
811
810
  size?: 'sm' | 'md' | 'lg' | 'xl';
812
811
  /** Additional CSS classes */
@@ -825,7 +824,7 @@ interface ControlButtonProps {
825
824
  /** Button label text */
826
825
  label?: string;
827
826
  /** Icon component or emoji */
828
- icon?: React.ReactNode;
827
+ icon?: React$1.ReactNode;
829
828
  /** Size variant */
830
829
  size?: 'sm' | 'md' | 'lg' | 'xl' | string;
831
830
  /** Shape variant */
@@ -3184,7 +3183,7 @@ interface ListProps {
3184
3183
  id: string;
3185
3184
  }[] | readonly unknown[] | unknown;
3186
3185
  /** Entity type name for display */
3187
- type?: string;
3186
+ entityType?: string;
3188
3187
  /** Loading state */
3189
3188
  isLoading?: boolean;
3190
3189
  /** Error state */
@@ -3713,97 +3712,616 @@ interface TabbedContainerProps {
3713
3712
  declare const TabbedContainer: React__default.FC<TabbedContainerProps>;
3714
3713
 
3715
3714
  /**
3716
- * Game entity with position and rendering data
3715
+ * Isometric Game Types
3716
+ *
3717
+ * Type definitions for isometric grid rendering: tiles, units, features.
3718
+ * Used by IsometricCanvas and game hooks.
3719
+ *
3720
+ * @packageDocumentation
3717
3721
  */
3718
- interface GameEntity extends Entity {
3722
+ /** A single isometric tile on the grid */
3723
+ interface IsometricTile {
3724
+ /** Grid x coordinate */
3719
3725
  x: number;
3726
+ /** Grid y coordinate */
3720
3727
  y: number;
3721
- vx?: number;
3722
- vy?: number;
3723
- width?: number;
3724
- height?: number;
3725
- layer?: number;
3728
+ /** Terrain type key (e.g., 'grass', 'stone', 'water') */
3729
+ terrain: string;
3730
+ /** Direct sprite URL override (bypasses getTerrainSprite resolver) */
3731
+ terrainSprite?: string;
3732
+ /** Whether units can traverse this tile (default true) */
3733
+ passable?: boolean;
3734
+ /** Movement cost for pathfinding (default 1) */
3735
+ movementCost?: number;
3736
+ /** Optional tile type for visual variants */
3737
+ tileType?: string;
3738
+ }
3739
+ /** A unit positioned on the isometric grid */
3740
+ interface IsometricUnit {
3741
+ /** Unique unit identifier */
3742
+ id: string;
3743
+ /** Current grid position */
3744
+ position: {
3745
+ x: number;
3746
+ y: number;
3747
+ };
3748
+ /** Static sprite URL (used when no sprite sheet animation) */
3726
3749
  sprite?: string;
3727
- color?: string;
3728
- rotation?: number;
3729
- scale?: number;
3730
- visible?: boolean;
3731
- collider?: {
3732
- width: number;
3733
- height: number;
3734
- offsetX?: number;
3735
- offsetY?: number;
3750
+ /** Unit archetype key for sprite resolution */
3751
+ unitType?: string;
3752
+ /** Hero identifier for sprite sheet lookup */
3753
+ heroId?: string;
3754
+ /** Display name rendered below the unit */
3755
+ name?: string;
3756
+ /** Team affiliation for coloring */
3757
+ team?: 'player' | 'enemy' | 'neutral';
3758
+ /** Current health */
3759
+ health?: number;
3760
+ /** Maximum health */
3761
+ maxHealth?: number;
3762
+ /** Trait attachments for state display */
3763
+ traits?: {
3764
+ name: string;
3765
+ currentState: string;
3766
+ states: string[];
3767
+ cooldown: number;
3768
+ }[];
3769
+ /** Previous position for movement trail ghost */
3770
+ previousPosition?: {
3771
+ x: number;
3772
+ y: number;
3736
3773
  };
3737
3774
  }
3775
+ /** A map feature (resource, building, portal, etc.) */
3776
+ interface IsometricFeature {
3777
+ /** Grid x coordinate */
3778
+ x: number;
3779
+ /** Grid y coordinate */
3780
+ y: number;
3781
+ /** Feature type key (e.g., 'goldMine', 'castle', 'portal') */
3782
+ type: string;
3783
+ /** Direct sprite URL override (bypasses getFeatureSprite resolver) */
3784
+ sprite?: string;
3785
+ }
3786
+ /** Camera state for pan/zoom */
3787
+ interface CameraState {
3788
+ /** Camera X offset in pixels */
3789
+ x: number;
3790
+ /** Camera Y offset in pixels */
3791
+ y: number;
3792
+ /** Zoom level (1.0 = 100%) */
3793
+ zoom: number;
3794
+ }
3795
+
3796
+ /**
3797
+ * Sprite Sheet Animation Types
3798
+ *
3799
+ * Type definitions for frame-based sprite sheet animation system.
3800
+ * Supports standard 8-column × 5-row character sheets.
3801
+ *
3802
+ * @packageDocumentation
3803
+ */
3804
+ /** Animation names matching sprite sheet row layout */
3805
+ type AnimationName = 'idle' | 'walk' | 'attack' | 'hit' | 'death';
3806
+ /** Sheet file directions (physical PNG files) */
3807
+ type SpriteDirection = 'se' | 'sw';
3808
+ /** Unit facing direction on screen (4 isometric directions) */
3809
+ type FacingDirection = 'se' | 'sw' | 'ne' | 'nw';
3810
+ /** Definition for a single animation row in the sprite sheet */
3811
+ interface AnimationDef {
3812
+ /** Row index in the sprite sheet (0-4) */
3813
+ row: number;
3814
+ /** Number of frames in this animation */
3815
+ frames: number;
3816
+ /** Frames per second */
3817
+ frameRate: number;
3818
+ /** Whether the animation loops */
3819
+ loop: boolean;
3820
+ }
3821
+ /** A resolved frame ready to draw on canvas */
3822
+ interface ResolvedFrame {
3823
+ /** URL of the sprite sheet image */
3824
+ sheetUrl: string;
3825
+ /** Source X in the sheet (pixel offset) */
3826
+ sx: number;
3827
+ /** Source Y in the sheet (pixel offset) */
3828
+ sy: number;
3829
+ /** Source width (frame width) */
3830
+ sw: number;
3831
+ /** Source height (frame height) */
3832
+ sh: number;
3833
+ /** Whether to flip horizontally when drawing (for NE/NW directions) */
3834
+ flipX: boolean;
3835
+ /** When true, canvas should apply sine-bob breathing offset (frozen idle frame) */
3836
+ applyBreathing?: boolean;
3837
+ }
3838
+ /** Per-unit animation state tracked in the animation system */
3839
+ interface UnitAnimationState {
3840
+ /** Unit identifier */
3841
+ unitId: string;
3842
+ /** Current animation playing */
3843
+ animation: AnimationName;
3844
+ /** Current facing direction */
3845
+ direction: FacingDirection;
3846
+ /** Current frame index within the animation */
3847
+ frame: number;
3848
+ /** Elapsed time in current animation (ms) */
3849
+ elapsed: number;
3850
+ /** Animation to play after current one-shot completes (null = idle) */
3851
+ queuedAnimation: AnimationName | null;
3852
+ /** Whether the current one-shot animation has finished its last frame */
3853
+ finished: boolean;
3854
+ }
3855
+ /** Frame dimensions for a sprite sheet */
3856
+ interface SpriteFrameDims {
3857
+ /** Width of a single frame in pixels */
3858
+ width: number;
3859
+ /** Height of a single frame in pixels */
3860
+ height: number;
3861
+ }
3862
+ /** Sheet URLs for both directions */
3863
+ interface SpriteSheetUrls {
3864
+ /** Southeast-facing sheet URL */
3865
+ se: string;
3866
+ /** Southwest-facing sheet URL */
3867
+ sw: string;
3868
+ }
3869
+
3738
3870
  /**
3739
- * Entity renderer function type
3871
+ * IsometricCanvas
3872
+ *
3873
+ * Core isometric game renderer. Maps to the `game-canvas` pattern.
3874
+ * Adapted from projects/trait-wars/design-system/organisms/IsometricGameCanvas.tsx
3875
+ * with full closed-circuit pattern compliance (className, isLoading, error, entity).
3876
+ *
3877
+ * Architecture:
3878
+ * - 2:1 diamond isometric projection
3879
+ * - Painter's algorithm (tile → feature → unit depth sort)
3880
+ * - Camera pan/zoom with lerp
3881
+ * - Off-screen culling
3882
+ * - Minimap on separate canvas
3883
+ * - Sprite sheet animation via resolveUnitFrame
3884
+ * - Event bus–friendly handlers (onTileClick, onUnitClick, etc.)
3885
+ *
3886
+ * @packageDocumentation
3740
3887
  */
3741
- type EntityRenderer = (ctx: CanvasRenderingContext2D, entity: GameEntity) => void;
3742
- /** Input key bindings - supports both field-based and event-based formats */
3743
- interface InputBinding$1 {
3744
- key: string;
3745
- /** Direct field mapping (e.g., 'left', 'right', 'jump') */
3746
- field?: 'left' | 'right' | 'jump' | 'attack';
3747
- /** Event-based mapping (e.g., 'MOVE_LEFT', 'JUMP') - mapped to fields */
3748
- event?: string;
3749
- /** Whether to hold the input (continuous) or trigger once */
3750
- hold?: boolean;
3751
- }
3752
- /** Collision definition from schema */
3753
- interface CollisionDef {
3754
- /** Entity types that collide [typeA, typeB] */
3755
- between: [string, string];
3756
- /** Collision type: 'solid' resolves overlap, 'trigger' emits event */
3757
- type: 'solid' | 'trigger';
3758
- /** Event to emit for trigger collisions */
3759
- emits?: string;
3760
- }
3761
- interface GameCanvasProps {
3762
- /** Entity type names to render (optional filter) */
3763
- renderEntities?: string[];
3764
- /** Rendering functions per entity type */
3765
- renderers?: Record<string, EntityRenderer>;
3766
- /**
3767
- * Renderer type hint from schema (e.g., 'phaser', 'canvas').
3768
- * Currently ignored - component uses Canvas2D.
3769
- * Reserved for future multi-renderer support.
3770
- */
3771
- renderer?: string;
3772
- /** Background color or gradient */
3773
- background?: string;
3774
- /** Canvas width in pixels or 'full' for responsive */
3775
- width?: number | 'full';
3776
- /** Canvas height in pixels or 'auto' for aspect ratio */
3777
- height?: number | 'auto';
3778
- /** Aspect ratio (e.g., '16:9', '4:3') */
3779
- aspectRatio?: string;
3780
- /** Camera offset for scrolling */
3781
- cameraOffset?: {
3888
+
3889
+ interface IsometricCanvasProps {
3890
+ /** Additional CSS classes */
3891
+ className?: string;
3892
+ /** Loading state indicator */
3893
+ isLoading?: boolean;
3894
+ /** Error state */
3895
+ error?: Error | null;
3896
+ /** Entity name for schema-driven auto-fetch */
3897
+ entity?: string;
3898
+ /** Array of tiles to render */
3899
+ tiles?: IsometricTile[];
3900
+ /** Array of units on the board */
3901
+ units?: IsometricUnit[];
3902
+ /** Array of features (resources, portals, buildings, etc.) */
3903
+ features?: IsometricFeature[];
3904
+ /** Currently selected unit ID */
3905
+ selectedUnitId?: string | null;
3906
+ /** Valid move positions (shown as pulsing green highlights) */
3907
+ validMoves?: Array<{
3782
3908
  x: number;
3783
3909
  y: number;
3784
- };
3785
- /** Debug mode shows hitboxes and entity info */
3910
+ }>;
3911
+ /** Attack target positions (shown as pulsing red highlights) */
3912
+ attackTargets?: Array<{
3913
+ x: number;
3914
+ y: number;
3915
+ }>;
3916
+ /** Hovered tile position */
3917
+ hoveredTile?: {
3918
+ x: number;
3919
+ y: number;
3920
+ } | null;
3921
+ /** Tile click handler */
3922
+ onTileClick?: (x: number, y: number) => void;
3923
+ /** Unit click handler */
3924
+ onUnitClick?: (unitId: string) => void;
3925
+ /** Tile hover handler */
3926
+ onTileHover?: (x: number, y: number) => void;
3927
+ /** Tile leave handler */
3928
+ onTileLeave?: () => void;
3929
+ /** Render scale (0.4 = 40% zoom) */
3930
+ scale?: number;
3931
+ /** Show debug grid lines and coordinates */
3786
3932
  debug?: boolean;
3933
+ /** Background image URL tiled behind the isometric grid */
3934
+ backgroundImage?: string;
3935
+ /** Toggle minimap overlay */
3936
+ showMinimap?: boolean;
3937
+ /** Enable camera pan/zoom controls */
3938
+ enableCamera?: boolean;
3939
+ /** Extra scale multiplier for unit draw size. 1 = default. */
3940
+ unitScale?: number;
3941
+ /** Resolve terrain sprite URL from terrain key */
3942
+ getTerrainSprite?: (terrain: string) => string | undefined;
3943
+ /** Resolve feature sprite URL from feature type key */
3944
+ getFeatureSprite?: (featureType: string) => string | undefined;
3945
+ /** Resolve unit static sprite URL */
3946
+ getUnitSprite?: (unit: IsometricUnit) => string | undefined;
3947
+ /** Resolve animated sprite sheet frame for a unit */
3948
+ resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
3949
+ /** Additional sprite URLs to preload (e.g., effect sprites) */
3950
+ effectSpriteUrls?: string[];
3951
+ /** Callback to draw canvas effects after units */
3952
+ onDrawEffects?: (ctx: CanvasRenderingContext2D, animTime: number, getImage: (url: string) => HTMLImageElement | undefined) => void;
3953
+ /** Whether there are active effects — keeps RAF loop alive */
3954
+ hasActiveEffects?: boolean;
3955
+ /** Base URL for remote asset resolution. When set, manifest paths
3956
+ * are prefixed with this URL. Example: "https://trait-wars-assets.web.app" */
3957
+ assetBaseUrl?: string;
3958
+ /** Manifest mapping entity keys to relative sprite paths.
3959
+ * Combined with assetBaseUrl to produce full URLs.
3960
+ * Used as a fallback when inline URLs and callbacks don't resolve. */
3961
+ assetManifest?: {
3962
+ terrains?: Record<string, string>;
3963
+ units?: Record<string, string>;
3964
+ features?: Record<string, string>;
3965
+ effects?: Record<string, string>;
3966
+ };
3967
+ }
3968
+ declare function IsometricCanvas({ className, isLoading, error, entity, tiles: tilesProp, units, features, selectedUnitId, validMoves, attackTargets, hoveredTile, onTileClick, onUnitClick, onTileHover, onTileLeave, scale, debug, backgroundImage, showMinimap, enableCamera, unitScale, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, hasActiveEffects, assetBaseUrl, assetManifest, }: IsometricCanvasProps): JSX.Element;
3969
+ declare namespace IsometricCanvas {
3970
+ var displayName: string;
3971
+ }
3972
+
3973
+ /**
3974
+ * Combat action types that map to effect compositions.
3975
+ * Superset of trait-wars types + almadar-ui originals.
3976
+ */
3977
+ type CombatActionType = 'melee' | 'ranged' | 'magic' | 'heal' | 'defend' | 'hit' | 'death' | 'buff' | 'debuff' | 'shield' | 'aoe' | 'critical';
3978
+ /**
3979
+ * Effect asset manifest — the sprites and animation frames available for
3980
+ * the particle engine. This is the `assetManifest.effects` section.
3981
+ */
3982
+ interface EffectAssetManifest {
3983
+ /** Base URL for all asset paths */
3984
+ baseUrl: string;
3985
+ /** Particle sprite groups (white-on-transparent, tinted at runtime) */
3986
+ particles?: {
3987
+ slash?: string[];
3988
+ magic?: string[];
3989
+ fire?: string[];
3990
+ flame?: string[];
3991
+ smoke?: string[];
3992
+ scorch?: string[];
3993
+ circle?: string[];
3994
+ flare?: string;
3995
+ spark?: string[];
3996
+ muzzle?: string[];
3997
+ star?: string[];
3998
+ trace?: string[];
3999
+ twirl?: string[];
4000
+ light?: string[];
4001
+ dirt?: string[];
4002
+ scratch?: string[];
4003
+ symbol?: string[];
4004
+ };
4005
+ /** Frame-sequence animations (array of frame image paths) */
4006
+ animations?: {
4007
+ explosion?: string[];
4008
+ smokePuff?: string[];
4009
+ flash?: string[];
4010
+ blackSmoke?: string[];
4011
+ gasSmoke?: string[];
4012
+ smokeExplosion?: string[];
4013
+ };
4014
+ }
4015
+
4016
+ /**
4017
+ * CanvasEffect Component
4018
+ *
4019
+ * Renders animated visual effects using a `<canvas>` element with
4020
+ * sprite-based particles, frame-sequence animations, and overlays.
4021
+ * This is a render-ui pattern that can be placed in any slot —
4022
+ * it renders on top of whatever occupies that slot.
4023
+ *
4024
+ * Pattern: canvas-effect
4025
+ *
4026
+ * When an EffectAssetManifest is provided (via assetManifest prop),
4027
+ * the component uses the full particle engine with tinted sprites.
4028
+ * Without a manifest, it falls back to emoji-based rendering.
4029
+ *
4030
+ * @packageDocumentation
4031
+ */
4032
+
4033
+ interface CanvasEffectProps {
4034
+ /** The type of combat action to visualise */
4035
+ actionType: CombatActionType;
4036
+ /** Screen-space X position (center of the effect) */
4037
+ x: number;
4038
+ /** Screen-space Y position (center of the effect) */
4039
+ y: number;
4040
+ /** Duration in ms before auto-dismiss (default 2000 for canvas, 800 for emoji) */
4041
+ duration?: number;
4042
+ /** Optional intensity multiplier (1 = normal, 2 = double size/brightness) */
4043
+ intensity?: number;
4044
+ /** Callback when the effect animation completes */
4045
+ onComplete?: () => void;
3787
4046
  /** Additional CSS classes */
3788
4047
  className?: string;
3789
- /** Click handler for canvas */
3790
- onClick?: (x: number, y: number, entity?: GameEntity) => void;
3791
- /** Enable keyboard input handling (updates Input entity) */
3792
- enableInput?: boolean;
3793
- /** Custom input key bindings */
3794
- inputBindings?: InputBinding$1[];
3795
- /** Collision definitions from schema */
3796
- collisions?: CollisionDef[];
3797
- /** Event bus for emitting collision events */
3798
- eventBus?: {
3799
- emit: (event: string, payload?: unknown) => void;
3800
- };
4048
+ /** Loading state indicator */
4049
+ isLoading?: boolean;
4050
+ /** Error state */
4051
+ error?: Error | null;
4052
+ /** Sprite URL for the effect (emoji fallback mode).
4053
+ * When set without assetManifest, renders this image instead of emoji. */
4054
+ effectSpriteUrl?: string;
4055
+ /** Base URL for remote assets. Prepended to relative effectSpriteUrl paths. */
4056
+ assetBaseUrl?: string;
4057
+ /** Full effect asset manifest for the sprite particle engine.
4058
+ * When provided, enables the canvas-based particle system. */
4059
+ assetManifest?: EffectAssetManifest;
4060
+ /** Canvas width (default 400) */
4061
+ width?: number;
4062
+ /** Canvas height (default 300) */
4063
+ height?: number;
3801
4064
  }
3802
- declare function GameCanvas({ renderEntities, renderers, background, width, height, aspectRatio, cameraOffset, debug, className, onClick, enableInput, inputBindings, collisions, eventBus, }: GameCanvasProps): react_jsx_runtime.JSX.Element;
3803
- declare namespace GameCanvas {
4065
+ declare function CanvasEffect(props: CanvasEffectProps): JSX.Element | null;
4066
+ declare namespace CanvasEffect {
3804
4067
  var displayName: string;
3805
4068
  }
3806
4069
 
4070
+ /**
4071
+ * useImageCache Hook
4072
+ *
4073
+ * Preloads and caches images by URL for canvas rendering.
4074
+ * Returns a getter function that returns loaded HTMLImageElement instances.
4075
+ * Tracks loading progress to support isLoading state.
4076
+ *
4077
+ * @packageDocumentation
4078
+ */
4079
+ interface ImageCacheResult {
4080
+ /** Get a cached image by URL. Returns undefined if not yet loaded. */
4081
+ getImage: (url: string) => HTMLImageElement | undefined;
4082
+ /** Whether all requested images have loaded */
4083
+ isLoaded: boolean;
4084
+ /** Number of images currently loading */
4085
+ pendingCount: number;
4086
+ }
4087
+ /**
4088
+ * Preload and cache images for canvas rendering.
4089
+ *
4090
+ * @param urls - Array of image URLs to preload
4091
+ * @returns Cache getter, loading state, and pending count
4092
+ */
4093
+ declare function useImageCache(urls: string[]): ImageCacheResult;
4094
+
4095
+ /**
4096
+ * useCamera Hook
4097
+ *
4098
+ * Manages camera pan/zoom state for canvas rendering.
4099
+ * Provides mouse event handlers and coordinate conversion.
4100
+ *
4101
+ * @packageDocumentation
4102
+ */
4103
+
4104
+ interface CameraResult {
4105
+ /** Mutable camera state ref (x, y, zoom) */
4106
+ cameraRef: React.MutableRefObject<CameraState>;
4107
+ /** Target camera position for smooth lerp centering. Set to null when reached. */
4108
+ targetCameraRef: React.MutableRefObject<{
4109
+ x: number;
4110
+ y: number;
4111
+ } | null>;
4112
+ /** Whether the user is currently dragging */
4113
+ isDragging: () => boolean;
4114
+ /** Total drag distance — used to distinguish click from pan (threshold: 5px) */
4115
+ dragDistance: () => number;
4116
+ /** Mouse down handler — starts panning */
4117
+ handleMouseDown: (e: React.MouseEvent) => void;
4118
+ /** Mouse up handler — stops panning */
4119
+ handleMouseUp: () => void;
4120
+ /** Mouse move handler — pans camera if dragging, returns true if panning */
4121
+ handleMouseMove: (e: React.MouseEvent, drawFn?: () => void) => boolean;
4122
+ /** Mouse leave handler — cancels drag */
4123
+ handleMouseLeave: () => void;
4124
+ /** Wheel handler — zoom in/out */
4125
+ handleWheel: (e: React.WheelEvent, drawFn?: () => void) => void;
4126
+ /** Convert screen coordinates to world coordinates (inverse camera transform) */
4127
+ screenToWorld: (clientX: number, clientY: number, canvas: HTMLCanvasElement, viewportSize: {
4128
+ width: number;
4129
+ height: number;
4130
+ }) => {
4131
+ x: number;
4132
+ y: number;
4133
+ };
4134
+ /** Lerp camera toward target. Call in animation loop. Returns true if still animating. */
4135
+ lerpToTarget: (t?: number) => boolean;
4136
+ }
4137
+ /**
4138
+ * Camera hook for pan/zoom canvas rendering.
4139
+ *
4140
+ * @returns Camera state, event handlers, and coordinate conversion
4141
+ */
4142
+ declare function useCamera(): CameraResult;
4143
+
4144
+ /**
4145
+ * useSpriteAnimations Hook
4146
+ *
4147
+ * Manages per-unit sprite sheet animation state for the canvas draw loop.
4148
+ * Follows the useCanvasEffects pattern: mutable state in refs, pure functions
4149
+ * in utils, no re-renders per frame.
4150
+ *
4151
+ * Project-agnostic: accepts generic sprite sheet resolution callbacks
4152
+ * rather than a project-specific asset manifest.
4153
+ *
4154
+ * @packageDocumentation
4155
+ */
4156
+
4157
+ interface UseSpriteAnimationsResult {
4158
+ /**
4159
+ * Sync unit list and advance all animation timers.
4160
+ * Call once per animation frame. Auto-detects movement
4161
+ * and infers direction from position deltas.
4162
+ */
4163
+ syncUnits: (units: IsometricUnit[], deltaMs: number) => void;
4164
+ /**
4165
+ * Explicitly set a unit's animation (for combat: attack, hit, death).
4166
+ * Optionally override direction.
4167
+ */
4168
+ setUnitAnimation: (unitId: string, animation: AnimationName, direction?: FacingDirection) => void;
4169
+ /**
4170
+ * Resolve the current frame for a unit. Returns null if no sprite sheet
4171
+ * is available for this unit (falls back to static sprite in canvas).
4172
+ * Pass this to IsometricCanvas.resolveUnitFrame.
4173
+ */
4174
+ resolveUnitFrame: (unitId: string) => ResolvedFrame | null;
4175
+ }
4176
+ interface UseSpriteAnimationsOptions {
4177
+ /** Playback speed multiplier. 1.0 = baseline, 2.0 = double speed. Default: 1. */
4178
+ speed?: number;
4179
+ }
4180
+ /**
4181
+ * Resolve sprite sheet URLs for a unit. Return null if no sheet available.
4182
+ * This is the project-agnostic callback version — projects pass manifest-specific logic.
4183
+ */
4184
+ type SheetUrlResolver = (unit: IsometricUnit) => SpriteSheetUrls | null;
4185
+ /**
4186
+ * Resolve frame dimensions for a unit's sprite sheet.
4187
+ * Projects pass manifest-specific logic.
4188
+ */
4189
+ type FrameDimsResolver = (unit: IsometricUnit) => SpriteFrameDims | null;
4190
+ /**
4191
+ * Hook for managing per-unit sprite sheet animations.
4192
+ *
4193
+ * @param getSheetUrls - Callback to resolve sprite sheet URLs for a unit
4194
+ * @param getFrameDims - Callback to resolve frame dimensions for a unit
4195
+ * @param options - Playback speed options
4196
+ */
4197
+ declare function useSpriteAnimations(getSheetUrls: SheetUrlResolver, getFrameDims: FrameDimsResolver, options?: UseSpriteAnimationsOptions): UseSpriteAnimationsResult;
4198
+
4199
+ /**
4200
+ * Isometric Coordinate Utilities
4201
+ *
4202
+ * Pure functions for 2:1 diamond isometric coordinate conversion.
4203
+ * No React dependencies — usable in any context.
4204
+ *
4205
+ * @packageDocumentation
4206
+ */
4207
+ /** Base tile width in pixels (before scale) */
4208
+ declare const TILE_WIDTH = 256;
4209
+ /** Base tile height in pixels (before scale) — full diamond height */
4210
+ declare const TILE_HEIGHT = 384;
4211
+ /** Floor diamond height — the "walkable surface" portion of the tile */
4212
+ declare const FLOOR_HEIGHT = 149;
4213
+ /**
4214
+ * Feature type → fallback color mapping (when sprites not loaded).
4215
+ */
4216
+ declare const FEATURE_COLORS: Record<string, string>;
4217
+ /**
4218
+ * Convert tile grid coordinates to screen pixel coordinates.
4219
+ *
4220
+ * Uses 2:1 diamond isometric projection:
4221
+ * - X increases to the lower-right
4222
+ * - Y increases to the lower-left
4223
+ *
4224
+ * @param tileX - Grid X coordinate
4225
+ * @param tileY - Grid Y coordinate
4226
+ * @param scale - Render scale factor
4227
+ * @param baseOffsetX - Horizontal offset to center the grid
4228
+ * @returns Screen position { x, y } of the tile's top-left corner
4229
+ */
4230
+ declare function isoToScreen(tileX: number, tileY: number, scale: number, baseOffsetX: number): {
4231
+ x: number;
4232
+ y: number;
4233
+ };
4234
+ /**
4235
+ * Convert screen pixel coordinates back to tile grid coordinates.
4236
+ *
4237
+ * Inverse of isoToScreen. Snaps to nearest integer tile position.
4238
+ *
4239
+ * @param screenX - Screen X in pixels
4240
+ * @param screenY - Screen Y in pixels
4241
+ * @param scale - Render scale factor
4242
+ * @param baseOffsetX - Horizontal offset used in isoToScreen
4243
+ * @returns Snapped grid position { x, y }
4244
+ */
4245
+ declare function screenToIso(screenX: number, screenY: number, scale: number, baseOffsetX: number): {
4246
+ x: number;
4247
+ y: number;
4248
+ };
4249
+
4250
+ /**
4251
+ * Sprite Animation Engine
4252
+ *
4253
+ * Pure functions for sprite sheet animation: direction inference,
4254
+ * frame computation, sheet resolution, and animation state management.
4255
+ * No React dependencies — usable in any context.
4256
+ *
4257
+ * @packageDocumentation
4258
+ */
4259
+
4260
+ /**
4261
+ * Infer facing direction from a movement delta on the isometric grid.
4262
+ * dx/dy are tile coordinate deltas (not screen pixels).
4263
+ *
4264
+ * Isometric grid:
4265
+ * NW ← (-x) NE ← (-y)
4266
+ * SW ← (+y) SE ← (+x)
4267
+ */
4268
+ declare function inferDirection(dx: number, dy: number): FacingDirection;
4269
+ /**
4270
+ * Map a 4-direction facing to the actual sheet file direction + flipX flag.
4271
+ * We only have SE and SW sheet images. NE/NW are rendered by flipping:
4272
+ * SE → SE sheet, no flip
4273
+ * SW → SW sheet, no flip
4274
+ * NE → SW sheet, flipX (mirror of SW gives NE)
4275
+ * NW → SE sheet, flipX (mirror of SE gives NW)
4276
+ */
4277
+ declare function resolveSheetDirection(facing: FacingDirection): {
4278
+ sheetDir: SpriteDirection;
4279
+ flipX: boolean;
4280
+ };
4281
+ /**
4282
+ * Compute the current frame index and whether the animation has finished.
4283
+ */
4284
+ declare function getCurrentFrame(animName: AnimationName, elapsed: number): {
4285
+ frame: number;
4286
+ finished: boolean;
4287
+ };
4288
+ /**
4289
+ * Resolve a complete frame descriptor for canvas drawing.
4290
+ * Returns null if no sprite sheet URLs are available for this unit.
4291
+ */
4292
+ declare function resolveFrame(sheetUrls: SpriteSheetUrls | null, frameDims: SpriteFrameDims, animState: UnitAnimationState): ResolvedFrame | null;
4293
+ /**
4294
+ * Create initial animation state for a unit (idle, facing SE).
4295
+ */
4296
+ declare function createUnitAnimationState(unitId: string): UnitAnimationState;
4297
+ /**
4298
+ * Transition to a new animation. Resets elapsed time.
4299
+ * Optionally updates direction. Death cannot be overridden.
4300
+ */
4301
+ declare function transitionAnimation(state: UnitAnimationState, newAnim: AnimationName, direction?: FacingDirection): UnitAnimationState;
4302
+ /**
4303
+ * Advance animation state by deltaMs.
4304
+ * Handles one-shot → queued/idle transitions automatically.
4305
+ */
4306
+ declare function tickAnimationState(state: UnitAnimationState, deltaMs: number): UnitAnimationState;
4307
+
4308
+ /**
4309
+ * Sprite Sheet Constants
4310
+ *
4311
+ * Standard layout for 8-column × 5-row character sprite sheets.
4312
+ * All characters share identical sheet geometry.
4313
+ *
4314
+ * @packageDocumentation
4315
+ */
4316
+
4317
+ /** Number of columns in a sprite sheet (frames per row) */
4318
+ declare const SHEET_COLUMNS = 8;
4319
+ /**
4320
+ * Standard sprite sheet row layout.
4321
+ * Row 0 = idle, Row 1 = walk, Row 2 = attack, Row 3 = hit, Row 4 = death.
4322
+ */
4323
+ declare const SPRITE_SHEET_LAYOUT: Record<AnimationName, AnimationDef>;
4324
+
3807
4325
  interface StatBadgeProps {
3808
4326
  /** Stat label */
3809
4327
  label: string;
@@ -3818,7 +4336,7 @@ interface StatBadgeProps {
3818
4336
  /** Display format */
3819
4337
  format?: 'number' | 'hearts' | 'bar' | 'text' | string;
3820
4338
  /** Icon component or emoji */
3821
- icon?: React.ReactNode;
4339
+ icon?: React$1.ReactNode;
3822
4340
  /** Size variant */
3823
4341
  size?: 'sm' | 'md' | 'lg' | string;
3824
4342
  /** Visual variant */
@@ -3867,43 +4385,6 @@ declare namespace GameHud {
3867
4385
  var displayName: string;
3868
4386
  }
3869
4387
 
3870
- interface GameControl {
3871
- /** Unique identifier */
3872
- id?: string;
3873
- /** Alias for id (schema compatibility) */
3874
- key?: string;
3875
- /** Event to emit on press */
3876
- event: string;
3877
- /** Display label */
3878
- label?: string;
3879
- /** Icon component or emoji */
3880
- icon?: React.ReactNode;
3881
- /** Button variant */
3882
- variant?: "primary" | "secondary" | "ghost" | string;
3883
- }
3884
- interface GameControlsProps {
3885
- /** Control layout type */
3886
- layout: "dpad" | "joystick" | "buttons" | "custom" | string;
3887
- /** Position on screen */
3888
- position: "bottom-left" | "bottom-right" | "bottom-center" | "split" | string;
3889
- /** Controls to display - accepts readonly for compatibility with generated const arrays */
3890
- controls?: readonly GameControl[];
3891
- /** Called when control is pressed/released */
3892
- onControl?: (event: string, pressed: boolean) => void;
3893
- /** Size variant */
3894
- size?: "sm" | "md" | "lg";
3895
- /** Additional CSS classes */
3896
- className?: string;
3897
- /** Whether controls are visible */
3898
- visible?: boolean;
3899
- /** Opacity when visible */
3900
- opacity?: number;
3901
- }
3902
- declare function GameControls({ layout, position, controls, onControl, size, className, visible, opacity, }: GameControlsProps): react_jsx_runtime.JSX.Element | null;
3903
- declare namespace GameControls {
3904
- var displayName: string;
3905
- }
3906
-
3907
4388
  interface MenuOption {
3908
4389
  /** Optional ID (generated from index if not provided) */
3909
4390
  id?: string;
@@ -3947,39 +4428,6 @@ declare namespace GameMenu {
3947
4428
  var displayName: string;
3948
4429
  }
3949
4430
 
3950
- interface PauseOption {
3951
- /** Display label */
3952
- label: string;
3953
- /** Event to emit on click */
3954
- event?: string;
3955
- /** Page to navigate to */
3956
- navigatesTo?: string;
3957
- /** Button variant */
3958
- variant?: "primary" | "secondary" | "ghost" | "destructive";
3959
- }
3960
- interface GamePauseOverlayProps {
3961
- /** Pause menu options */
3962
- options?: PauseOption[];
3963
- /** Alias for options (schema compatibility) */
3964
- menuItems?: PauseOption[];
3965
- /** Called when an option is selected (legacy callback, prefer event bus) */
3966
- onSelect?: (option: PauseOption) => void;
3967
- /** Event bus for emitting UI events (optional, uses hook if not provided) */
3968
- eventBus?: EventBusContextType;
3969
- /** Title (default: "PAUSED") */
3970
- title?: string;
3971
- /** Additional CSS classes */
3972
- className?: string;
3973
- /** Whether the pause menu is visible */
3974
- visible?: boolean;
3975
- /** Called when clicking outside the menu */
3976
- onDismiss?: () => void;
3977
- }
3978
- declare function GamePauseOverlay({ options, menuItems, onSelect, eventBus: eventBusProp, title, className, visible, onDismiss, }: GamePauseOverlayProps): react_jsx_runtime.JSX.Element | null;
3979
- declare namespace GamePauseOverlay {
3980
- var displayName: string;
3981
- }
3982
-
3983
4431
  interface GameOverStat {
3984
4432
  /** Stat label */
3985
4433
  label: string;
@@ -3994,7 +4442,7 @@ interface GameOverStat {
3994
4442
  /** Display format */
3995
4443
  format?: "number" | "time" | "text";
3996
4444
  /** Icon */
3997
- icon?: React.ReactNode;
4445
+ icon?: React$1.ReactNode;
3998
4446
  }
3999
4447
  interface GameOverAction {
4000
4448
  /** Display label */
@@ -4035,145 +4483,18 @@ declare namespace GameOverScreen {
4035
4483
  var displayName: string;
4036
4484
  }
4037
4485
 
4038
- interface LevelData {
4039
- /** Unique level identifier */
4486
+ /**
4487
+ * InventoryPanel Component
4488
+ *
4489
+ * Grid-based inventory UI with item selection and tooltips.
4490
+ */
4491
+ interface InventoryItem {
4040
4492
  id: string;
4041
- /** Level ID (alternative to id) */
4042
- levelId?: string;
4043
- /** Level number */
4044
- number?: number;
4045
- /** Level name/title */
4493
+ type: string;
4494
+ quantity: number;
4495
+ sprite?: string;
4046
4496
  name?: string;
4047
- /** Stars earned (0-3) */
4048
- stars?: number;
4049
- /** Difficulty level */
4050
- difficulty?: 'easy' | 'medium' | 'hard' | string;
4051
- /** Whether the level is locked */
4052
- isLocked?: boolean;
4053
- /** Best score on this level */
4054
- bestScore?: number;
4055
- /** Thumbnail image URL */
4056
- thumbnail?: string;
4057
- /** Allow additional properties from schema */
4058
- [key: string]: unknown;
4059
- }
4060
- interface LevelFieldDisplay {
4061
- /** Field name */
4062
- field?: string;
4063
- /** Display type */
4064
- display?: 'title' | 'number' | 'stars' | 'locked' | 'thumbnail' | string;
4065
- }
4066
- interface LevelSelectProps {
4067
- /** Level data */
4068
- levels?: LevelData[];
4069
- /** Entity name (schema config) */
4070
- entity?: string;
4071
- /** Layout variant */
4072
- layout?: 'grid' | 'list' | 'carousel' | string;
4073
- /** Fields to display per level */
4074
- fields?: LevelFieldDisplay[];
4075
- /** Event to emit on selection (schema config) */
4076
- selectEvent?: string;
4077
- /** Called when a level is selected */
4078
- onSelect?: (level: LevelData) => void;
4079
- /** Path to navigate to on selection. Supports :id, :levelId, :number placeholders */
4080
- navigatesTo?: string;
4081
- /** Currently selected level ID */
4082
- selectedId?: string;
4083
- /** Maximum stars possible per level */
4084
- maxStars?: number;
4085
- /** Additional CSS classes */
4086
- className?: string;
4087
- /** Title above the level grid */
4088
- title?: string;
4089
- }
4090
- declare function LevelSelect({ levels, entity: _entity, layout, fields, selectEvent: _selectEvent, onSelect, navigatesTo, selectedId, maxStars, className, title, }: LevelSelectProps): react_jsx_runtime.JSX.Element;
4091
- declare namespace LevelSelect {
4092
- var displayName: string;
4093
- }
4094
-
4095
- /**
4096
- * TilemapRenderer Component
4097
- *
4098
- * Canvas-based tilemap renderer with culling and parallax support.
4099
- */
4100
- interface TileLayer {
4101
- name: string;
4102
- data: number[];
4103
- width: number;
4104
- height: number;
4105
- visible?: boolean;
4106
- }
4107
- interface Tileset {
4108
- url: string;
4109
- tileWidth: number;
4110
- tileHeight: number;
4111
- columns: number;
4112
- }
4113
- interface ParallaxConfig {
4114
- layer: string;
4115
- factor: number;
4116
- }
4117
- interface TilemapRendererProps {
4118
- /** Tile layers to render */
4119
- layers: TileLayer[];
4120
- /** Tileset configuration */
4121
- tileset: Tileset;
4122
- /** Camera position */
4123
- camera: {
4124
- x: number;
4125
- y: number;
4126
- };
4127
- /** Viewport width in pixels */
4128
- viewportWidth: number;
4129
- /** Viewport height in pixels */
4130
- viewportHeight: number;
4131
- /** Enable pixel art rendering (no smoothing) */
4132
- pixelArt?: boolean;
4133
- /** Parallax configuration per layer */
4134
- parallaxLayers?: ParallaxConfig[];
4135
- /** Optional className */
4136
- className?: string;
4137
- /** Scale factor for rendering */
4138
- scale?: number;
4139
- /** Show debug grid */
4140
- debug?: boolean;
4141
- }
4142
- /**
4143
- * Tilemap renderer component with efficient canvas-based rendering
4144
- *
4145
- * @example
4146
- * ```tsx
4147
- * <TilemapRenderer
4148
- * layers={levelData.layers}
4149
- * tileset={{
4150
- * url: '/tilesets/terrain.png',
4151
- * tileWidth: 16,
4152
- * tileHeight: 16,
4153
- * columns: 16
4154
- * }}
4155
- * camera={{ x: playerX - 160, y: playerY - 120 }}
4156
- * viewportWidth={320}
4157
- * viewportHeight={240}
4158
- * pixelArt
4159
- * scale={2}
4160
- * />
4161
- * ```
4162
- */
4163
- declare function TilemapRenderer({ layers, tileset, camera, viewportWidth, viewportHeight, pixelArt, parallaxLayers, className, scale, debug, }: TilemapRendererProps): JSX.Element;
4164
-
4165
- /**
4166
- * InventoryPanel Component
4167
- *
4168
- * Grid-based inventory UI with item selection and tooltips.
4169
- */
4170
- interface InventoryItem {
4171
- id: string;
4172
- type: string;
4173
- quantity: number;
4174
- sprite?: string;
4175
- name?: string;
4176
- description?: string;
4497
+ description?: string;
4177
4498
  }
4178
4499
  interface InventoryPanelProps {
4179
4500
  /** Array of items in inventory */
@@ -4273,102 +4594,6 @@ interface DialogueBoxProps {
4273
4594
  */
4274
4595
  declare function DialogueBox({ dialogue, typewriterSpeed, position, onComplete, onChoice, onAdvance, className, }: DialogueBoxProps): JSX.Element;
4275
4596
 
4276
- /**
4277
- * InputListener - Invisible component that captures keyboard input
4278
- *
4279
- * Rendered by InputCapture trait via render_ui effect.
4280
- * Listens for keydown/keyup events and:
4281
- * 1. Updates the Input singleton entity
4282
- * 2. Emits INPUT:* events via event bus
4283
- *
4284
- * This follows the closed circuit pattern:
4285
- * Trait (render_ui) → Component (InputListener) → Events (INPUT:*) → Trait (state machine)
4286
- *
4287
- * @generated pattern component
4288
- */
4289
-
4290
- /**
4291
- * Input binding configuration
4292
- */
4293
- interface InputBinding {
4294
- /** Key code or key value (e.g., 'ArrowLeft', 'KeyA', 'Space') */
4295
- key: string;
4296
- /** Field name in the Input singleton (e.g., 'left', 'right', 'jump') */
4297
- field: string;
4298
- /** Optional custom event name (defaults to INPUT:{FIELD}_DOWN/UP) */
4299
- event?: string;
4300
- }
4301
- /**
4302
- * InputListener props
4303
- */
4304
- interface InputListenerProps {
4305
- /** Key bindings configuration */
4306
- bindings?: readonly InputBinding[];
4307
- /** Whether input listening is enabled */
4308
- enabled?: boolean;
4309
- /** Event bus for emitting events (optional, uses hook if not provided) */
4310
- eventBus?: EventBusContextType;
4311
- }
4312
- /**
4313
- * InputListener Component
4314
- *
4315
- * Invisible component that captures keyboard input and emits events.
4316
- * Designed to be rendered by the InputCapture trait via render_ui effect.
4317
- */
4318
- declare function InputListener({ bindings, enabled, eventBus: eventBusProp, }: InputListenerProps): null;
4319
- declare namespace InputListener {
4320
- var displayName: string;
4321
- }
4322
-
4323
- /**
4324
- * CollisionDetector - Invisible component that runs collision detection
4325
- *
4326
- * Rendered by Collision2DSystem trait via render_ui effect.
4327
- * Runs AABB collision checks each frame and emits collision events.
4328
- *
4329
- * This follows the closed circuit pattern:
4330
- * Trait (render_ui) → Component (CollisionDetector) → Events (COLLISION_*) → Trait (state machine)
4331
- *
4332
- * @generated pattern component
4333
- */
4334
-
4335
- /**
4336
- * Collision rule configuration
4337
- */
4338
- interface CollisionRule {
4339
- /** Entity type A */
4340
- typeA: string;
4341
- /** Entity type B */
4342
- typeB: string;
4343
- /** Whether this is a trigger (pass-through) or solid collision */
4344
- isTrigger?: boolean;
4345
- /** Custom event name to emit (defaults to COLLISION_ENTER/TRIGGER_ENTER) */
4346
- event?: string;
4347
- }
4348
- /**
4349
- * CollisionDetector props
4350
- */
4351
- interface CollisionDetectorProps {
4352
- /** Collision detection algorithm */
4353
- algorithm?: 'aabb' | 'circle';
4354
- /** Collision rules to check */
4355
- rules?: readonly CollisionRule[];
4356
- /** Whether collision detection is enabled */
4357
- enabled?: boolean;
4358
- /** Event bus for emitting events (optional, uses hook if not provided) */
4359
- eventBus?: EventBusContextType;
4360
- }
4361
- /**
4362
- * CollisionDetector Component
4363
- *
4364
- * Invisible component that runs collision detection each frame and emits events.
4365
- * Designed to be rendered by the Collision2DSystem trait via render_ui effect.
4366
- */
4367
- declare function CollisionDetector({ algorithm, rules, enabled, eventBus: eventBusProp, }: CollisionDetectorProps): null;
4368
- declare namespace CollisionDetector {
4369
- var displayName: string;
4370
- }
4371
-
4372
4597
  /**
4373
4598
  * UISlotRenderer Component
4374
4599
  *
@@ -4531,6 +4756,494 @@ interface ToastSlotProps {
4531
4756
  */
4532
4757
  declare const ToastSlot: React__default.FC<ToastSlotProps>;
4533
4758
 
4759
+ /**
4760
+ * Chart Organism Component
4761
+ *
4762
+ * A data visualization component supporting bar, line, pie, and area chart types.
4763
+ * Composes atoms and molecules for layout, uses CSS variables for theming.
4764
+ *
4765
+ * Orbital Component Interface Compliance:
4766
+ * - Entity binding with auto-fetch when entity is a string
4767
+ * - Event emission via useEventBus (UI:* events)
4768
+ * - isLoading and error state props
4769
+ * - className for external styling
4770
+ */
4771
+
4772
+ type ChartType = "bar" | "line" | "pie" | "area" | "donut";
4773
+ interface ChartDataPoint {
4774
+ label: string;
4775
+ value: number;
4776
+ color?: string;
4777
+ }
4778
+ interface ChartSeries {
4779
+ name: string;
4780
+ data: readonly ChartDataPoint[];
4781
+ color?: string;
4782
+ }
4783
+ interface ChartAction {
4784
+ label: string;
4785
+ event?: string;
4786
+ navigatesTo?: string;
4787
+ variant?: "primary" | "secondary" | "ghost";
4788
+ }
4789
+ interface ChartProps {
4790
+ /** Chart title */
4791
+ title?: string;
4792
+ /** Chart subtitle / description */
4793
+ subtitle?: string;
4794
+ /** Chart type */
4795
+ chartType?: ChartType;
4796
+ /** Data series */
4797
+ series?: readonly ChartSeries[];
4798
+ /** Simple data (single series shorthand) */
4799
+ data?: readonly ChartDataPoint[];
4800
+ /** Chart height in px */
4801
+ height?: number;
4802
+ /** Show legend */
4803
+ showLegend?: boolean;
4804
+ /** Show values on chart */
4805
+ showValues?: boolean;
4806
+ /** Actions for chart interactions */
4807
+ actions?: readonly ChartAction[];
4808
+ /** Entity name for schema-driven auto-fetch */
4809
+ entity?: string;
4810
+ /** Loading state */
4811
+ isLoading?: boolean;
4812
+ /** Error state */
4813
+ error?: Error | null;
4814
+ /** Additional CSS classes */
4815
+ className?: string;
4816
+ }
4817
+ declare const Chart: React__default.FC<ChartProps>;
4818
+
4819
+ /**
4820
+ * Meter Organism Component
4821
+ *
4822
+ * A gauge/meter component for displaying a value within a range.
4823
+ * Supports linear, radial, and segmented display modes.
4824
+ *
4825
+ * Orbital Component Interface Compliance:
4826
+ * - Entity binding with auto-fetch when entity is a string
4827
+ * - Event emission via useEventBus (UI:* events)
4828
+ * - isLoading and error state props
4829
+ * - className for external styling
4830
+ */
4831
+
4832
+ type MeterVariant = "linear" | "radial" | "segmented";
4833
+ interface MeterThreshold {
4834
+ value: number;
4835
+ color: string;
4836
+ label?: string;
4837
+ }
4838
+ interface MeterAction {
4839
+ label: string;
4840
+ event?: string;
4841
+ navigatesTo?: string;
4842
+ variant?: "primary" | "secondary" | "ghost";
4843
+ }
4844
+ interface MeterProps {
4845
+ /** Current value */
4846
+ value: number;
4847
+ /** Minimum value */
4848
+ min?: number;
4849
+ /** Maximum value */
4850
+ max?: number;
4851
+ /** Display label */
4852
+ label?: string;
4853
+ /** Unit suffix (e.g., '%', 'MB', 'credits') */
4854
+ unit?: string;
4855
+ /** Display variant */
4856
+ variant?: MeterVariant;
4857
+ /** Color thresholds */
4858
+ thresholds?: readonly MeterThreshold[];
4859
+ /** Number of segments (for segmented variant) */
4860
+ segments?: number;
4861
+ /** Show value text */
4862
+ showValue?: boolean;
4863
+ /** Size (for radial variant) */
4864
+ size?: "sm" | "md" | "lg";
4865
+ /** Actions */
4866
+ actions?: readonly MeterAction[];
4867
+ /** Entity name for schema-driven auto-fetch */
4868
+ entity?: string;
4869
+ /** Loading state */
4870
+ isLoading?: boolean;
4871
+ /** Error state */
4872
+ error?: Error | null;
4873
+ /** Additional CSS classes */
4874
+ className?: string;
4875
+ }
4876
+ declare const Meter: React__default.FC<MeterProps>;
4877
+
4878
+ /**
4879
+ * Timeline Organism Component
4880
+ *
4881
+ * A vertical timeline component for displaying chronological events.
4882
+ * Composes atoms and molecules for layout, uses CSS variables for theming.
4883
+ *
4884
+ * Orbital Component Interface Compliance:
4885
+ * - Entity binding with auto-fetch when entity is a string
4886
+ * - Event emission via useEventBus (UI:* events)
4887
+ * - isLoading and error state props
4888
+ * - className for external styling
4889
+ */
4890
+
4891
+ type TimelineItemStatus = "complete" | "active" | "pending" | "error";
4892
+ interface TimelineItem {
4893
+ /** Unique identifier */
4894
+ id: string;
4895
+ /** Item title */
4896
+ title: string;
4897
+ /** Item description */
4898
+ description?: string;
4899
+ /** Timestamp string */
4900
+ date?: string;
4901
+ /** Status indicator */
4902
+ status?: TimelineItemStatus;
4903
+ /** Icon override */
4904
+ icon?: LucideIcon;
4905
+ /** Additional metadata tags */
4906
+ tags?: readonly string[];
4907
+ }
4908
+ interface TimelineAction {
4909
+ label: string;
4910
+ event?: string;
4911
+ navigatesTo?: string;
4912
+ variant?: "primary" | "secondary" | "ghost";
4913
+ }
4914
+ interface TimelineProps {
4915
+ /** Timeline title */
4916
+ title?: string;
4917
+ /** Timeline items */
4918
+ items?: readonly TimelineItem[];
4919
+ /** Schema-driven data */
4920
+ data?: readonly Record<string, unknown>[];
4921
+ /** Fields to display */
4922
+ fields?: readonly string[];
4923
+ /** Actions per item */
4924
+ itemActions?: readonly TimelineAction[];
4925
+ /** Entity name for schema-driven auto-fetch */
4926
+ entity?: string;
4927
+ /** Loading state */
4928
+ isLoading?: boolean;
4929
+ /** Error state */
4930
+ error?: Error | null;
4931
+ /** Additional CSS classes */
4932
+ className?: string;
4933
+ }
4934
+ declare const Timeline: React__default.FC<TimelineProps>;
4935
+
4936
+ /**
4937
+ * MediaGallery Organism Component
4938
+ *
4939
+ * A gallery component for displaying images and media in a grid layout.
4940
+ * Supports lightbox viewing, selection, and upload interactions.
4941
+ *
4942
+ * Orbital Component Interface Compliance:
4943
+ * - Entity binding with auto-fetch when entity is a string
4944
+ * - Event emission via useEventBus (UI:* events)
4945
+ * - isLoading and error state props
4946
+ * - className for external styling
4947
+ */
4948
+
4949
+ interface MediaItem {
4950
+ /** Unique identifier */
4951
+ id: string;
4952
+ /** Media URL */
4953
+ src: string;
4954
+ /** Alt text */
4955
+ alt?: string;
4956
+ /** Thumbnail URL (defaults to src) */
4957
+ thumbnail?: string;
4958
+ /** Media type */
4959
+ mediaType?: "image" | "video";
4960
+ /** Caption */
4961
+ caption?: string;
4962
+ /** File size */
4963
+ fileSize?: string;
4964
+ }
4965
+ interface MediaGalleryAction {
4966
+ label: string;
4967
+ event?: string;
4968
+ navigatesTo?: string;
4969
+ variant?: "primary" | "secondary" | "ghost";
4970
+ }
4971
+ interface MediaGalleryProps {
4972
+ /** Gallery title */
4973
+ title?: string;
4974
+ /** Media items */
4975
+ items?: readonly MediaItem[];
4976
+ /** Schema-driven data */
4977
+ data?: readonly Record<string, unknown>[];
4978
+ /** Column count */
4979
+ columns?: 2 | 3 | 4 | 5 | 6;
4980
+ /** Enable item selection */
4981
+ selectable?: boolean;
4982
+ /** Selected item IDs */
4983
+ selectedItems?: readonly string[];
4984
+ /** Selection change callback */
4985
+ onSelectionChange?: (ids: string[]) => void;
4986
+ /** Show upload button */
4987
+ showUpload?: boolean;
4988
+ /** Actions */
4989
+ actions?: readonly MediaGalleryAction[];
4990
+ /** Aspect ratio for thumbnails */
4991
+ aspectRatio?: "square" | "landscape" | "portrait";
4992
+ /** Entity name for schema-driven auto-fetch */
4993
+ entity?: string;
4994
+ /** Loading state */
4995
+ isLoading?: boolean;
4996
+ /** Error state */
4997
+ error?: Error | null;
4998
+ /** Additional CSS classes */
4999
+ className?: string;
5000
+ }
5001
+ declare const MediaGallery: React__default.FC<MediaGalleryProps>;
5002
+
5003
+ /**
5004
+ * SignaturePad Organism Component
5005
+ *
5006
+ * A canvas-based signature capture pad.
5007
+ * Uses a minimal canvas wrapper (necessary for drawing) but composes all
5008
+ * surrounding UI with atoms and molecules.
5009
+ *
5010
+ * Orbital Component Interface Compliance:
5011
+ * - Event emission via useEventBus (UI:* events)
5012
+ * - isLoading and error state props
5013
+ * - className for external styling
5014
+ */
5015
+
5016
+ interface SignaturePadProps {
5017
+ /** Label above the pad */
5018
+ label?: string;
5019
+ /** Helper text */
5020
+ helperText?: string;
5021
+ /** Stroke color */
5022
+ strokeColor?: string;
5023
+ /** Stroke width */
5024
+ strokeWidth?: number;
5025
+ /** Pad height */
5026
+ height?: number;
5027
+ /** Whether the pad is read-only */
5028
+ readOnly?: boolean;
5029
+ /** Existing signature image URL */
5030
+ value?: string;
5031
+ /** Callback when signature changes */
5032
+ onChange?: (dataUrl: string | null) => void;
5033
+ /** Event to emit on sign */
5034
+ signEvent?: string;
5035
+ /** Event to emit on clear */
5036
+ clearEvent?: string;
5037
+ /** Entity name for schema-driven context */
5038
+ entity?: string;
5039
+ /** Loading state */
5040
+ isLoading?: boolean;
5041
+ /** Error state */
5042
+ error?: Error | null;
5043
+ /** Additional CSS classes */
5044
+ className?: string;
5045
+ }
5046
+ declare const SignaturePad: React__default.FC<SignaturePadProps>;
5047
+
5048
+ /**
5049
+ * DocumentViewer Organism Component
5050
+ *
5051
+ * A document viewer for displaying PDFs, documents, and rich text content.
5052
+ * Uses iframe for PDF rendering (necessary) and atoms for all surrounding UI.
5053
+ *
5054
+ * Orbital Component Interface Compliance:
5055
+ * - Entity binding with auto-fetch when entity is a string
5056
+ * - Event emission via useEventBus (UI:* events)
5057
+ * - isLoading and error state props
5058
+ * - className for external styling
5059
+ */
5060
+
5061
+ type DocumentType = "pdf" | "text" | "html" | "markdown";
5062
+ interface DocumentAction {
5063
+ label: string;
5064
+ event?: string;
5065
+ navigatesTo?: string;
5066
+ variant?: "primary" | "secondary" | "ghost";
5067
+ }
5068
+ interface DocumentViewerProps {
5069
+ /** Document title */
5070
+ title?: string;
5071
+ /** Document URL (for PDF/external documents) */
5072
+ src?: string;
5073
+ /** Document content (for text/html/markdown) */
5074
+ content?: string;
5075
+ /** Document type */
5076
+ documentType?: DocumentType;
5077
+ /** Current page (for multi-page documents) */
5078
+ currentPage?: number;
5079
+ /** Total pages */
5080
+ totalPages?: number;
5081
+ /** Viewer height */
5082
+ height?: number | string;
5083
+ /** Show toolbar */
5084
+ showToolbar?: boolean;
5085
+ /** Show download button */
5086
+ showDownload?: boolean;
5087
+ /** Show print button */
5088
+ showPrint?: boolean;
5089
+ /** Actions */
5090
+ actions?: readonly DocumentAction[];
5091
+ /** Multiple documents (tabbed view) */
5092
+ documents?: readonly {
5093
+ label: string;
5094
+ src?: string;
5095
+ content?: string;
5096
+ documentType?: DocumentType;
5097
+ }[];
5098
+ /** Entity name for schema-driven auto-fetch */
5099
+ entity?: string;
5100
+ /** Loading state */
5101
+ isLoading?: boolean;
5102
+ /** Error state */
5103
+ error?: Error | null;
5104
+ /** Additional CSS classes */
5105
+ className?: string;
5106
+ }
5107
+ declare const DocumentViewer: React__default.FC<DocumentViewerProps>;
5108
+
5109
+ /**
5110
+ * GraphCanvas Organism Component
5111
+ *
5112
+ * A force-directed graph visualization component for node-link data.
5113
+ * Uses canvas (necessary for performant graph rendering) with atom wrappers.
5114
+ *
5115
+ * Orbital Component Interface Compliance:
5116
+ * - Entity binding with auto-fetch when entity is a string
5117
+ * - Event emission via useEventBus (UI:* events)
5118
+ * - isLoading and error state props
5119
+ * - className for external styling
5120
+ */
5121
+
5122
+ interface GraphNode {
5123
+ id: string;
5124
+ label?: string;
5125
+ group?: string;
5126
+ color?: string;
5127
+ size?: number;
5128
+ /** Position (optional, computed if missing) */
5129
+ x?: number;
5130
+ y?: number;
5131
+ }
5132
+ interface GraphEdge {
5133
+ source: string;
5134
+ target: string;
5135
+ label?: string;
5136
+ weight?: number;
5137
+ color?: string;
5138
+ }
5139
+ interface GraphAction {
5140
+ label: string;
5141
+ event?: string;
5142
+ navigatesTo?: string;
5143
+ variant?: "primary" | "secondary" | "ghost";
5144
+ }
5145
+ interface GraphCanvasProps {
5146
+ /** Graph title */
5147
+ title?: string;
5148
+ /** Graph nodes */
5149
+ nodes?: readonly GraphNode[];
5150
+ /** Graph edges */
5151
+ edges?: readonly GraphEdge[];
5152
+ /** Canvas height */
5153
+ height?: number;
5154
+ /** Show node labels */
5155
+ showLabels?: boolean;
5156
+ /** Enable zoom/pan */
5157
+ interactive?: boolean;
5158
+ /** Enable node dragging */
5159
+ draggable?: boolean;
5160
+ /** Actions */
5161
+ actions?: readonly GraphAction[];
5162
+ /** On node click */
5163
+ onNodeClick?: (node: GraphNode) => void;
5164
+ /** Node click event */
5165
+ nodeClickEvent?: string;
5166
+ /** Layout algorithm */
5167
+ layout?: "force" | "circular" | "grid";
5168
+ /** Entity name for schema-driven auto-fetch */
5169
+ entity?: string;
5170
+ /** Loading state */
5171
+ isLoading?: boolean;
5172
+ /** Error state */
5173
+ error?: Error | null;
5174
+ /** Additional CSS classes */
5175
+ className?: string;
5176
+ }
5177
+ declare const GraphCanvas: React__default.FC<GraphCanvasProps>;
5178
+
5179
+ /**
5180
+ * CodeViewer Organism Component
5181
+ *
5182
+ * A code/diff viewer with syntax highlighting and line numbers.
5183
+ * Composes atoms and molecules for layout. Uses pre/code elements
5184
+ * which are semantically necessary for code display.
5185
+ *
5186
+ * Orbital Component Interface Compliance:
5187
+ * - Entity binding with auto-fetch when entity is a string
5188
+ * - Event emission via useEventBus (UI:* events)
5189
+ * - isLoading and error state props
5190
+ * - className for external styling
5191
+ */
5192
+
5193
+ type CodeViewerMode = "code" | "diff";
5194
+ interface DiffLine {
5195
+ type: "add" | "remove" | "context";
5196
+ content: string;
5197
+ lineNumber?: number;
5198
+ }
5199
+ interface CodeViewerAction {
5200
+ label: string;
5201
+ event?: string;
5202
+ navigatesTo?: string;
5203
+ variant?: "primary" | "secondary" | "ghost";
5204
+ }
5205
+ interface CodeViewerProps {
5206
+ /** Viewer title */
5207
+ title?: string;
5208
+ /** Code content */
5209
+ code?: string;
5210
+ /** Language for display label */
5211
+ language?: string;
5212
+ /** Diff lines (for diff mode) */
5213
+ diff?: readonly DiffLine[];
5214
+ /** Old value (for generating diff) */
5215
+ oldValue?: string;
5216
+ /** New value (for generating diff) */
5217
+ newValue?: string;
5218
+ /** Display mode */
5219
+ mode?: CodeViewerMode;
5220
+ /** Show line numbers */
5221
+ showLineNumbers?: boolean;
5222
+ /** Show copy button */
5223
+ showCopy?: boolean;
5224
+ /** Enable word wrap */
5225
+ wordWrap?: boolean;
5226
+ /** Max height before scrolling */
5227
+ maxHeight?: number | string;
5228
+ /** Multiple files (tabbed view) */
5229
+ files?: readonly {
5230
+ label: string;
5231
+ code: string;
5232
+ language?: string;
5233
+ }[];
5234
+ /** Actions */
5235
+ actions?: readonly CodeViewerAction[];
5236
+ /** Entity name for schema-driven auto-fetch */
5237
+ entity?: string;
5238
+ /** Loading state */
5239
+ isLoading?: boolean;
5240
+ /** Error state */
5241
+ error?: Error | null;
5242
+ /** Additional CSS classes */
5243
+ className?: string;
5244
+ }
5245
+ declare const CodeViewer: React__default.FC<CodeViewerProps>;
5246
+
4534
5247
  interface NavItem {
4535
5248
  label: string;
4536
5249
  href: string;
@@ -4957,4 +5670,318 @@ interface GameShellProps {
4957
5670
  */
4958
5671
  declare const GameShell: React__default.FC<GameShellProps>;
4959
5672
 
4960
- export { Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, Alert, type AlertProps, type AlertVariant, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, Center, type CenterProps, Checkbox, type CheckboxProps, type CollisionDef, CollisionDetector, type CollisionDetectorProps, type CollisionRule, type Column, type ColumnConfig, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, Container, type ContainerProps, ControlButton, type ControlButtonProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, type CrudItem, CrudTemplate, type CrudTemplateProps, type CrudVariant, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, DialogueBox, type DialogueBoxProps, type DialogueChoice, type DialogueNode, Divider, type DividerOrientation, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, EmptyState, type EmptyStateProps, Entity, type EntityRenderer, ErrorState, type ErrorStateProps, EventBusContextType, type FieldConfig, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterValue, Flex, type FlexProps, FloatingActionButton, type FloatingActionButtonProps, Form, FormActions, type FormActionsProps, FormField, type FormFieldConfig, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, FormTemplate, type FormTemplateProps, type FormVariant, GameCanvas, type GameCanvasProps, type GameControl, GameControls, type GameControlsProps, type GameEntity, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameMenu, type GameMenuProps, type GameOverAction, GameOverScreen, type GameOverScreenProps, type GameOverStat, GamePauseOverlay, type GamePauseOverlayProps, GameShell, type GameShellProps, GameTemplate, type GameTemplateProps, GenericAppTemplate, type GenericAppTemplateProps, Grid, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, type HighlightType, Icon, type IconAnimation, type IconProps, type IconSize, Input, type InputBinding, InputGroup, type InputGroupProps, InputListener, type InputListenerProps, type InputProps, type InventoryItem, InventoryPanel, type InventoryPanelProps, Label, type LabelProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, type LevelData, type LevelFieldDisplay, LevelSelect, type LevelSelectProps, List, type ListItem, type ListProps, ListTemplate, type ListTemplateItem, type ListTemplateProps, type ListVariant, LoadingState, type LoadingStateProps, MasterDetail, type MasterDetailProps, Menu, type MenuItem, type MenuOption, type MenuProps, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, type ParallaxConfig, type PauseOption, Popover, type PopoverProps, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, type RowAction, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, Section, type SectionProps, Select, type SelectOption, type SelectProps, type SettingsFieldConfig, type SettingsSectionConfig, SettingsTemplate, type SettingsTemplateProps, type SettingsVariant, SidePanel, type SidePanelProps, Sidebar, type SidebarItem, type SidebarProps, SimpleGrid, type SimpleGridProps, SlotContent, SlotContentRenderer, type SortDirection, Spacer, type SpacerProps, type SpacerSize, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, Sprite, type SpriteProps, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StatCard, type StatCardProps, Switch, type SwitchProps, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeSelector, ThemeToggle, type ThemeToggleProps, TilemapRenderer, type TilemapRendererProps, type TileLayer as TilemapTileLayer, type Tileset as TilemapTileset, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, UISlot, UISlotComponent, UISlotRenderer, type UISlotRendererProps, VStack, type VStackProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, drawSprite };
5673
+ /**
5674
+ * BattleTemplate
5675
+ *
5676
+ * Generalized tactical battle template composing IsometricCanvas from almadar-ui.
5677
+ * Provides turn-based phase management, movement animation, valid-move/attack-target
5678
+ * calculation, screen shake/flash, and a game-over overlay.
5679
+ *
5680
+ * Game-specific UI (combat log, trait viewer, damage popups, etc.) is injected via
5681
+ * render-prop slots so this template remains project-agnostic.
5682
+ *
5683
+ * @packageDocumentation
5684
+ */
5685
+
5686
+ /** Battle phases an encounter walks through */
5687
+ type BattlePhase = 'observation' | 'selection' | 'movement' | 'action' | 'enemy_turn' | 'game_over';
5688
+ /** A unit participating in battle */
5689
+ interface BattleUnit {
5690
+ id: string;
5691
+ name: string;
5692
+ unitType?: string;
5693
+ heroId?: string;
5694
+ sprite?: string;
5695
+ team: 'player' | 'enemy';
5696
+ position: {
5697
+ x: number;
5698
+ y: number;
5699
+ };
5700
+ health: number;
5701
+ maxHealth: number;
5702
+ movement: number;
5703
+ attack: number;
5704
+ defense: number;
5705
+ traits?: {
5706
+ name: string;
5707
+ currentState: string;
5708
+ states: string[];
5709
+ cooldown?: number;
5710
+ }[];
5711
+ }
5712
+ /** Minimal tile for map generation */
5713
+ interface BattleTile {
5714
+ x: number;
5715
+ y: number;
5716
+ terrain: string;
5717
+ terrainSprite?: string;
5718
+ }
5719
+ /** Context exposed to render-prop slots */
5720
+ interface BattleSlotContext {
5721
+ phase: BattlePhase;
5722
+ turn: number;
5723
+ selectedUnit: BattleUnit | null;
5724
+ hoveredUnit: BattleUnit | null;
5725
+ playerUnits: BattleUnit[];
5726
+ enemyUnits: BattleUnit[];
5727
+ gameResult: 'victory' | 'defeat' | null;
5728
+ onEndTurn: () => void;
5729
+ onCancel: () => void;
5730
+ onReset: () => void;
5731
+ attackTargets: Array<{
5732
+ x: number;
5733
+ y: number;
5734
+ }>;
5735
+ /** Resolve screen position of a tile for overlays */
5736
+ tileToScreen: (x: number, y: number) => {
5737
+ x: number;
5738
+ y: number;
5739
+ };
5740
+ }
5741
+ interface BattleTemplateProps {
5742
+ /** Initial units for the battle */
5743
+ initialUnits: BattleUnit[];
5744
+ /** Isometric tiles (pre-resolved with terrainSprite) */
5745
+ tiles: IsometricTile[];
5746
+ /** Canvas render scale */
5747
+ scale?: number;
5748
+ /** Board width for bounds checking */
5749
+ boardWidth?: number;
5750
+ /** Board height for bounds checking */
5751
+ boardHeight?: number;
5752
+ /** Asset manifest for IsometricCanvas */
5753
+ assetManifest?: {
5754
+ baseUrl: string;
5755
+ terrains?: Record<string, string>;
5756
+ units?: Record<string, string>;
5757
+ features?: Record<string, string>;
5758
+ effects?: Record<string, string>;
5759
+ };
5760
+ /** Background image URL for canvas */
5761
+ backgroundImage?: string;
5762
+ /** Unit draw-size multiplier */
5763
+ unitScale?: number;
5764
+ /** Header area — receives battle context */
5765
+ header?: (ctx: BattleSlotContext) => React__default.ReactNode;
5766
+ /** Sidebar content (combat log, unit roster, etc.) */
5767
+ sidebar?: (ctx: BattleSlotContext) => React__default.ReactNode;
5768
+ /** Floating action buttons */
5769
+ actions?: (ctx: BattleSlotContext) => React__default.ReactNode;
5770
+ /** Floating overlays above the canvas (damage popups, tooltips) */
5771
+ overlay?: (ctx: BattleSlotContext) => React__default.ReactNode;
5772
+ /** Game-over screen overlay */
5773
+ gameOverOverlay?: (ctx: BattleSlotContext) => React__default.ReactNode;
5774
+ /** Static features (obstacles, decorations) rendered on the grid */
5775
+ features?: IsometricFeature[];
5776
+ /** Called when a unit attacks another */
5777
+ onAttack?: (attacker: BattleUnit, target: BattleUnit, damage: number) => void;
5778
+ /** Called when battle ends */
5779
+ onGameEnd?: (result: 'victory' | 'defeat') => void;
5780
+ /** Called after a unit moves */
5781
+ onUnitMove?: (unit: BattleUnit, to: {
5782
+ x: number;
5783
+ y: number;
5784
+ }) => void;
5785
+ /** Custom combat damage calculator */
5786
+ calculateDamage?: (attacker: BattleUnit, target: BattleUnit) => number;
5787
+ onDrawEffects?: (ctx: CanvasRenderingContext2D, timestamp: number) => void;
5788
+ hasActiveEffects?: boolean;
5789
+ effectSpriteUrls?: string[];
5790
+ resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
5791
+ className?: string;
5792
+ }
5793
+ declare function BattleTemplate({ initialUnits, tiles, scale, boardWidth, boardHeight, assetManifest, backgroundImage, unitScale, header, sidebar, actions, overlay, gameOverOverlay, features, onAttack, onGameEnd, onUnitMove, calculateDamage, onDrawEffects, hasActiveEffects, effectSpriteUrls, resolveUnitFrame, className, }: BattleTemplateProps): JSX.Element;
5794
+ declare namespace BattleTemplate {
5795
+ var displayName: string;
5796
+ }
5797
+
5798
+ /**
5799
+ * CastleTemplate
5800
+ *
5801
+ * Generalized castle / base-management template composing IsometricCanvas from
5802
+ * almadar-ui. Renders an isometric courtyard/base view and exposes a side-panel
5803
+ * area via slots for game-specific UI (building details, recruitment, garrison).
5804
+ *
5805
+ * @packageDocumentation
5806
+ */
5807
+
5808
+ /** Context exposed to render-prop slots */
5809
+ interface CastleSlotContext {
5810
+ /** Currently hovered tile coordinates (null when not hovering) */
5811
+ hoveredTile: {
5812
+ x: number;
5813
+ y: number;
5814
+ } | null;
5815
+ /** Feature that sits on the hovered tile, if any */
5816
+ hoveredFeature: IsometricFeature | null;
5817
+ /** Unit that sits on the hovered tile, if any */
5818
+ hoveredUnit: IsometricUnit | null;
5819
+ /** The clicked feature (e.g. building) for detail view */
5820
+ selectedFeature: IsometricFeature | null;
5821
+ /** Clear selected feature */
5822
+ clearSelection: () => void;
5823
+ /** Resolve screen position for overlay positioning */
5824
+ tileToScreen: (x: number, y: number) => {
5825
+ x: number;
5826
+ y: number;
5827
+ };
5828
+ /** Canvas scale */
5829
+ scale: number;
5830
+ }
5831
+ interface CastleTemplateProps {
5832
+ /** Isometric tiles (pre-resolved with terrainSprite) */
5833
+ tiles: IsometricTile[];
5834
+ /** Building features rendered on the grid */
5835
+ features?: IsometricFeature[];
5836
+ /** Garrison / stationed units on the grid */
5837
+ units?: IsometricUnit[];
5838
+ /** Canvas render scale */
5839
+ scale?: number;
5840
+ /** Asset manifest for IsometricCanvas */
5841
+ assetManifest?: {
5842
+ baseUrl: string;
5843
+ terrains?: Record<string, string>;
5844
+ units?: Record<string, string>;
5845
+ features?: Record<string, string>;
5846
+ };
5847
+ /** Background image URL */
5848
+ backgroundImage?: string;
5849
+ /** Top bar / header */
5850
+ header?: (ctx: CastleSlotContext) => React__default.ReactNode;
5851
+ /** Side panel content (buildings list, recruit tab, garrison tab) */
5852
+ sidePanel?: (ctx: CastleSlotContext) => React__default.ReactNode;
5853
+ /** Canvas overlay (hover tooltips, etc.) */
5854
+ overlay?: (ctx: CastleSlotContext) => React__default.ReactNode;
5855
+ /** Bottom bar (income summary, etc.) */
5856
+ footer?: (ctx: CastleSlotContext) => React__default.ReactNode;
5857
+ /** Called when a feature (building) is clicked */
5858
+ onFeatureClick?: (feature: IsometricFeature) => void;
5859
+ /** Called when a unit is clicked */
5860
+ onUnitClick?: (unit: IsometricUnit) => void;
5861
+ /** Called when any tile is clicked */
5862
+ onTileClick?: (x: number, y: number) => void;
5863
+ className?: string;
5864
+ }
5865
+ declare function CastleTemplate({ tiles, features, units, scale, assetManifest, backgroundImage, header, sidePanel, overlay, footer, onFeatureClick, onUnitClick, onTileClick, className, }: CastleTemplateProps): JSX.Element;
5866
+ declare namespace CastleTemplate {
5867
+ var displayName: string;
5868
+ }
5869
+
5870
+ /**
5871
+ * WorldMapTemplate
5872
+ *
5873
+ * Generalized strategic world-map template composing IsometricCanvas from
5874
+ * almadar-ui. Renders an isometric hex/iso map with hero selection, movement
5875
+ * animation, and encounter callbacks. Game-specific panels (hero detail, hero
5876
+ * lists, resource bars) are injected via render-prop slots.
5877
+ *
5878
+ * @packageDocumentation
5879
+ */
5880
+
5881
+ /** A hero on the world map */
5882
+ interface MapHero {
5883
+ id: string;
5884
+ name: string;
5885
+ owner: 'player' | 'enemy' | string;
5886
+ position: {
5887
+ x: number;
5888
+ y: number;
5889
+ };
5890
+ movement: number;
5891
+ sprite?: string;
5892
+ level?: number;
5893
+ }
5894
+ /** A feature hex on the map */
5895
+ interface MapHex {
5896
+ x: number;
5897
+ y: number;
5898
+ terrain: string;
5899
+ terrainSprite?: string;
5900
+ feature?: string;
5901
+ featureData?: Record<string, unknown>;
5902
+ passable?: boolean;
5903
+ }
5904
+ /** Context exposed to render-prop slots */
5905
+ interface WorldMapSlotContext {
5906
+ /** Currently hovered tile */
5907
+ hoveredTile: {
5908
+ x: number;
5909
+ y: number;
5910
+ } | null;
5911
+ /** Hex at the hovered tile */
5912
+ hoveredHex: MapHex | null;
5913
+ /** Hero at the hovered tile */
5914
+ hoveredHero: MapHero | null;
5915
+ /** Currently selected hero */
5916
+ selectedHero: MapHero | null;
5917
+ /** Valid move tiles for selected hero */
5918
+ validMoves: Array<{
5919
+ x: number;
5920
+ y: number;
5921
+ }>;
5922
+ /** Selects a hero */
5923
+ selectHero: (id: string) => void;
5924
+ /** Resolve screen position of a tile for overlays */
5925
+ tileToScreen: (x: number, y: number) => {
5926
+ x: number;
5927
+ y: number;
5928
+ };
5929
+ /** Canvas scale */
5930
+ scale: number;
5931
+ }
5932
+ interface WorldMapTemplateProps {
5933
+ /** All map hexes (with pre-resolved terrain sprites) */
5934
+ hexes: MapHex[];
5935
+ /** Heroes on the map */
5936
+ heroes: MapHero[];
5937
+ /** Features rendered on tiles */
5938
+ features?: IsometricFeature[];
5939
+ /** Currently selected hero ID */
5940
+ selectedHeroId?: string | null;
5941
+ /** Canvas render scale */
5942
+ scale?: number;
5943
+ /** Unit draw-size multiplier */
5944
+ unitScale?: number;
5945
+ /** Asset manifest for IsometricCanvas */
5946
+ assetManifest?: {
5947
+ baseUrl: string;
5948
+ terrains?: Record<string, string>;
5949
+ units?: Record<string, string>;
5950
+ features?: Record<string, string>;
5951
+ };
5952
+ /** Background image URL */
5953
+ backgroundImage?: string;
5954
+ /** Allow selecting / moving ALL heroes (including enemy). For testing. */
5955
+ allowMoveAllHeroes?: boolean;
5956
+ /** Custom movement range validator */
5957
+ isInRange?: (from: {
5958
+ x: number;
5959
+ y: number;
5960
+ }, to: {
5961
+ x: number;
5962
+ y: number;
5963
+ }, range: number) => boolean;
5964
+ /** Header / top bar */
5965
+ header?: (ctx: WorldMapSlotContext) => React__default.ReactNode;
5966
+ /** Side panel (hero detail, hero lists, etc.) */
5967
+ sidePanel?: (ctx: WorldMapSlotContext) => React__default.ReactNode;
5968
+ /** Canvas overlay (tooltips, popups) */
5969
+ overlay?: (ctx: WorldMapSlotContext) => React__default.ReactNode;
5970
+ /** Footer */
5971
+ footer?: (ctx: WorldMapSlotContext) => React__default.ReactNode;
5972
+ onHeroSelect?: (heroId: string) => void;
5973
+ onHeroMove?: (heroId: string, toX: number, toY: number) => void;
5974
+ /** Called when hero clicks an enemy hero tile */
5975
+ onBattleEncounter?: (attackerId: string, defenderId: string) => void;
5976
+ /** Called when hero enters a feature hex (castle, resource, etc.) */
5977
+ onFeatureEnter?: (heroId: string, hex: MapHex) => void;
5978
+ effectSpriteUrls?: string[];
5979
+ resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
5980
+ className?: string;
5981
+ }
5982
+ declare function WorldMapTemplate({ hexes, heroes, features, selectedHeroId, scale, unitScale, assetManifest, backgroundImage, allowMoveAllHeroes, isInRange, header, sidePanel, overlay, footer, onHeroSelect, onHeroMove, onBattleEncounter, onFeatureEnter, effectSpriteUrls, resolveUnitFrame, className, }: WorldMapTemplateProps): JSX.Element;
5983
+ declare namespace WorldMapTemplate {
5984
+ var displayName: string;
5985
+ }
5986
+
5987
+ export { Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, Alert, type AlertProps, type AlertVariant, type AnimationDef, type AnimationName, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, type BattlePhase, type BattleSlotContext, BattleTemplate, type BattleTemplateProps, type BattleTile, type BattleUnit, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CameraState, CanvasEffect, type CanvasEffectProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, type CastleSlotContext, CastleTemplate, type CastleTemplateProps, Center, type CenterProps, Chart, type ChartDataPoint, type ChartProps, type ChartSeries, type ChartType, Checkbox, type CheckboxProps, CodeViewer, type CodeViewerMode, type CodeViewerProps, type Column, type ColumnConfig, type CombatActionType, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, Container, type ContainerProps, ControlButton, type ControlButtonProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, type CrudItem, CrudTemplate, type CrudTemplateProps, type CrudVariant, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataTable, type DataTableProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, DialogueBox, type DialogueBoxProps, type DialogueChoice, type DialogueNode, type DiffLine, Divider, type DividerOrientation, type DividerProps, type DocumentType, DocumentViewer, type DocumentViewerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, EventBusContextType, FEATURE_COLORS, FLOOR_HEIGHT, type FacingDirection, type FieldConfig, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterValue, Flex, type FlexProps, FloatingActionButton, type FloatingActionButtonProps, Form, FormActions, type FormActionsProps, FormField, type FormFieldConfig, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, FormTemplate, type FormTemplateProps, type FormVariant, type FrameDimsResolver, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameMenu, type GameMenuProps, type GameOverAction, GameOverScreen, type GameOverScreenProps, type GameOverStat, GameShell, type GameShellProps, GameTemplate, type GameTemplateProps, GenericAppTemplate, type GenericAppTemplateProps, GraphCanvas, type GraphCanvasProps, type GraphEdge, type GraphNode, Grid, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, type HighlightType, Icon, type IconAnimation, type IconProps, type IconSize, Input, InputGroup, type InputGroupProps, type InputProps, type InventoryItem, InventoryPanel, type InventoryPanelProps, IsometricCanvas, type IsometricCanvasProps, type IsometricFeature, type IsometricTile, type IsometricUnit, Label, type LabelProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, List, type ListItem, type ListProps, ListTemplate, type ListTemplateItem, type ListTemplateProps, type ListVariant, LoadingState, type LoadingStateProps, type MapHero, type MapHex, MasterDetail, type MasterDetailProps, MediaGallery, type MediaGalleryProps, type MediaItem, Menu, type MenuItem, type MenuOption, type MenuProps, Meter, type MeterProps, type MeterThreshold, type MeterVariant, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Popover, type PopoverProps, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, Radio, type RadioProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, type ResolvedFrame, type RowAction, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, Section, type SectionProps, Select, type SelectOption, type SelectProps, type SettingsFieldConfig, type SettingsSectionConfig, SettingsTemplate, type SettingsTemplateProps, type SettingsVariant, type SheetUrlResolver, SidePanel, type SidePanelProps, Sidebar, type SidebarItem, type SidebarProps, SignaturePad, type SignaturePadProps, SimpleGrid, type SimpleGridProps, SlotContent, SlotContentRenderer, type SortDirection, Spacer, type SpacerProps, type SpacerSize, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, Sprite, type SpriteDirection, type SpriteFrameDims, type SpriteProps, type SpriteSheetUrls, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StatCard, type StatCardProps, Switch, type SwitchProps, TILE_HEIGHT, TILE_WIDTH, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, Table, type TableColumn, type TableProps, Tabs, type TabsProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeSelector, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineItem, type TimelineItemStatus, type TimelineProps, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, UISlot, UISlotComponent, UISlotRenderer, type UISlotRendererProps, type UnitAnimationState, type UseSpriteAnimationsOptions, type UseSpriteAnimationsResult, VStack, type VStackProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, type WorldMapSlotContext, WorldMapTemplate, type WorldMapTemplateProps, createUnitAnimationState, drawSprite, getCurrentFrame, inferDirection, isoToScreen, resolveFrame, resolveSheetDirection, screenToIso, tickAnimationState, transitionAnimation, useCamera, useImageCache, useSpriteAnimations };