@almadar/ui 5.105.0 → 5.108.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.
Files changed (146) hide show
  1. package/dist/avl/index.cjs +2127 -5818
  2. package/dist/avl/index.js +1234 -4925
  3. package/dist/components/{game/2d → core}/atoms/GameIcon.d.ts +1 -1
  4. package/dist/components/core/atoms/index.d.ts +2 -1
  5. package/dist/components/core/molecules/index.d.ts +1 -1
  6. package/dist/components/core/organisms/index.d.ts +1 -1
  7. package/dist/components/core/templates/index.d.ts +1 -2
  8. package/dist/components/game/{2d/atoms → atoms}/ChoiceButton.d.ts +1 -1
  9. package/dist/components/game/{2d/atoms → atoms}/ControlButton.d.ts +1 -1
  10. package/dist/components/game/atoms/DrawShape.d.ts +50 -0
  11. package/dist/components/game/atoms/DrawSprite.d.ts +47 -0
  12. package/dist/components/game/atoms/DrawText.d.ts +31 -0
  13. package/dist/components/game/{2d/atoms → atoms}/GameAudioToggle.d.ts +1 -1
  14. package/dist/components/game/{2d/atoms → atoms}/MiniMap.d.ts +1 -1
  15. package/dist/components/game/{2d/atoms → atoms}/ScoreDisplay.d.ts +1 -1
  16. package/dist/components/game/{2d/atoms → atoms}/StateIndicator.d.ts +1 -1
  17. package/dist/components/game/{2d/molecules → molecules}/ActionTile.d.ts +1 -1
  18. package/dist/components/game/molecules/Canvas.d.ts +96 -0
  19. package/dist/components/game/molecules/Canvas2D.d.ts +120 -0
  20. package/dist/components/game/{2d/molecules → molecules}/ControlGrid.d.ts +1 -1
  21. package/dist/components/game/molecules/DrawShapeLayer.d.ts +19 -0
  22. package/dist/components/game/molecules/DrawSpriteLayer.d.ts +21 -0
  23. package/dist/components/game/molecules/DrawTextLayer.d.ts +22 -0
  24. package/dist/components/game/{2d/molecules → molecules}/GameHud.d.ts +1 -1
  25. package/dist/components/game/{2d/molecules → molecules}/StatBadge.d.ts +1 -1
  26. package/dist/components/game/{2d/molecules → molecules}/StateNode.d.ts +1 -1
  27. package/dist/components/game/{2d/molecules → molecules}/TraitSlot.d.ts +1 -1
  28. package/dist/components/game/{2d/molecules → molecules}/TraitStateViewer.d.ts +1 -1
  29. package/dist/components/game/{2d/molecules → molecules}/TransitionArrow.d.ts +1 -1
  30. package/dist/components/game/molecules/index.d.ts +39 -0
  31. package/dist/components/game/patterns.d.ts +20 -0
  32. package/dist/components/index.cjs +2417 -5988
  33. package/dist/components/index.js +1520 -5074
  34. package/dist/{components/game/shared/hooks → hooks}/useCamera.d.ts +1 -1
  35. package/dist/{components/game/shared/hooks → hooks}/useUnitSpriteAtlas.d.ts +2 -2
  36. package/dist/lib/drawable/contract.d.ts +68 -0
  37. package/dist/lib/drawable/hitTest.d.ts +23 -0
  38. package/dist/lib/drawable/paintDispatch.d.ts +22 -0
  39. package/dist/lib/drawable/projector.d.ts +14 -0
  40. package/dist/lib/drawable/projector3d.d.ts +20 -0
  41. package/dist/lib/drawable/three/Canvas3DHost.d.ts +178 -0
  42. package/dist/lib/drawable/three/Drawable3D.d.ts +20 -0
  43. package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
  44. package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
  45. package/dist/{components/game/shared → lib/drawable/three}/hooks/useGameCanvas3DEvents.d.ts +4 -3
  46. package/dist/{components/game/3d → lib/drawable/three}/index.cjs +2223 -4466
  47. package/dist/{components/game/3d → lib/drawable/three}/index.css +3 -3
  48. package/dist/lib/drawable/three/index.d.ts +39 -0
  49. package/dist/{components/game/3d → lib/drawable/three}/index.js +2132 -4375
  50. package/dist/lib/drawable/three/mesh3d.d.ts +28 -0
  51. package/dist/{components/game/shared/index.d.ts → lib/gameShared.d.ts} +1 -2
  52. package/dist/lib/imageCache.d.ts +9 -0
  53. package/dist/lib/painter2d.d.ts +81 -0
  54. package/dist/{components/game/shared/lib → lib}/puzzleObject.d.ts +11 -2
  55. package/dist/lib/webPainter2d.d.ts +7 -0
  56. package/dist/marketing/index.cjs +10 -0
  57. package/dist/marketing/index.js +10 -0
  58. package/dist/{components/game/shared/providers → providers}/GameAudioProvider.d.ts +1 -1
  59. package/dist/providers/index.cjs +2524 -5889
  60. package/dist/providers/index.d.ts +2 -0
  61. package/dist/providers/index.js +1743 -5112
  62. package/dist/runtime/index.cjs +1982 -5673
  63. package/dist/runtime/index.js +1208 -4899
  64. package/package.json +13 -13
  65. package/dist/components/game/2d/atoms/ActionButton.d.ts +0 -31
  66. package/dist/components/game/2d/atoms/ComboCounter.d.ts +0 -20
  67. package/dist/components/game/2d/atoms/DamageNumber.d.ts +0 -18
  68. package/dist/components/game/2d/atoms/GameCard.d.ts +0 -34
  69. package/dist/components/game/2d/atoms/ItemSlot.d.ts +0 -31
  70. package/dist/components/game/2d/atoms/ResourceCounter.d.ts +0 -26
  71. package/dist/components/game/2d/atoms/Sprite.d.ts +0 -52
  72. package/dist/components/game/2d/atoms/StatusEffect.d.ts +0 -25
  73. package/dist/components/game/2d/atoms/TurnIndicator.d.ts +0 -22
  74. package/dist/components/game/2d/atoms/WaypointMarker.d.ts +0 -23
  75. package/dist/components/game/2d/molecules/Canvas2D.d.ts +0 -175
  76. package/dist/components/game/2d/molecules/EventLog.d.ts +0 -31
  77. package/dist/components/game/2d/molecules/InventoryGrid.d.ts +0 -35
  78. package/dist/components/game/2d/molecules/ObjectRulePanel.d.ts +0 -32
  79. package/dist/components/game/2d/molecules/ResourceBar.d.ts +0 -26
  80. package/dist/components/game/2d/molecules/RuleEditor.d.ts +0 -39
  81. package/dist/components/game/2d/molecules/SideCanvas2D.d.ts +0 -36
  82. package/dist/components/game/2d/molecules/VariablePanel.d.ts +0 -28
  83. package/dist/components/game/2d/molecules/index.d.ts +0 -66
  84. package/dist/components/game/2d/organisms/BuilderBoard.d.ts +0 -60
  85. package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +0 -66
  86. package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +0 -61
  87. package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +0 -42
  88. package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +0 -56
  89. package/dist/components/game/2d/organisms/SequencerBoard.d.ts +0 -69
  90. package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +0 -58
  91. package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +0 -61
  92. package/dist/components/game/2d/templates/GameTemplate.d.ts +0 -35
  93. package/dist/components/game/3d/atoms/EventMarker3D.d.ts +0 -17
  94. package/dist/components/game/3d/atoms/SpriteBillboard3D.d.ts +0 -18
  95. package/dist/components/game/3d/index.d.ts +0 -13
  96. package/dist/components/game/3d/molecules/FeatureMesh3D.d.ts +0 -21
  97. package/dist/components/game/3d/molecules/GameCamera3D.d.ts +0 -35
  98. package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +0 -259
  99. package/dist/components/game/3d/molecules/SideScene3D.d.ts +0 -31
  100. package/dist/components/game/3d/molecules/TileMesh3D.d.ts +0 -28
  101. package/dist/components/game/3d/molecules/UnitMesh3D.d.ts +0 -29
  102. package/dist/components/game/3d/molecules/index.d.ts +0 -35
  103. package/dist/components/game/3d/organisms/GameBoard3D.d.ts +0 -66
  104. package/dist/components/game/3d/patterns.d.ts +0 -20
  105. package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +0 -82
  106. package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +0 -87
  107. package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +0 -95
  108. package/dist/components/game/shared/effects.d.ts +0 -253
  109. package/dist/components/game/shared/game3dTheme.d.ts +0 -55
  110. package/dist/components/game/shared/lib/game3dAssetManifest.d.ts +0 -48
  111. /package/dist/components/game/{2d/atoms → atoms}/DialogueBubble.d.ts +0 -0
  112. /package/dist/components/game/{2d/atoms → atoms}/HealthBar.d.ts +0 -0
  113. /package/dist/components/game/{2d/atoms → atoms}/TimerDisplay.d.ts +0 -0
  114. /package/dist/components/game/{2d/molecules → molecules}/ActionPalette.d.ts +0 -0
  115. /package/dist/components/game/{2d/molecules → molecules}/GameMenu.d.ts +0 -0
  116. /package/dist/components/game/{2d/molecules → molecules}/SequenceBar.d.ts +0 -0
  117. /package/dist/components/game/{2d/molecules → molecules}/StateGraph.d.ts +0 -0
  118. /package/dist/components/game/{2d/molecules → molecules}/StateJsonView.d.ts +0 -0
  119. /package/dist/components/game/{2d/templates → templates}/GameShell.d.ts +0 -0
  120. /package/dist/{components/game/shared/hooks → hooks}/useGameAudio.d.ts +0 -0
  121. /package/dist/{components/game/shared → hooks}/useImageCache.d.ts +0 -0
  122. /package/dist/{components/game/shared → lib}/boardEntity.d.ts +0 -0
  123. /package/dist/{components/game/3d/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
  124. /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
  125. /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
  126. /package/dist/{components/game/3d/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
  127. /package/dist/{components/game/3d/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
  128. /package/dist/{components/game/3d/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
  129. /package/dist/{components/game/shared → lib/drawable/three}/hooks/useAssetLoader.d.ts +0 -0
  130. /package/dist/{components/game/shared → lib/drawable/three}/hooks/useRaycaster.d.ts +0 -0
  131. /package/dist/{components/game/shared → lib/drawable/three}/hooks/useSceneGraph.d.ts +0 -0
  132. /package/dist/{components/game/shared → lib/drawable/three}/hooks/useThree.d.ts +0 -0
  133. /package/dist/{components/game/shared → lib/drawable/three}/lib/AssetLoader.d.ts +0 -0
  134. /package/dist/{components/game/shared → lib/drawable/three}/lib/culling.d.ts +0 -0
  135. /package/dist/{components/game/shared → lib/drawable/three}/lib/grid3D.d.ts +0 -0
  136. /package/dist/{components/game/shared/lib → lib}/editorUtils.d.ts +0 -0
  137. /package/dist/{components/game/shared → lib}/game.d.ts +0 -0
  138. /package/dist/{components/game/shared → lib}/isometric.d.ts +0 -0
  139. /package/dist/{components/game/shared → lib}/isometricTypes.d.ts +0 -0
  140. /package/dist/{components/game/shared → lib}/makeAsset.d.ts +0 -0
  141. /package/dist/{components/game/shared/lib → lib}/mechanics.d.ts +0 -0
  142. /package/dist/{components/game/shared/lib → lib}/physicsPresets.d.ts +0 -0
  143. /package/dist/{components/game/shared/lib → lib}/physicsTypes.d.ts +0 -0
  144. /package/dist/{components/game/shared → lib}/spriteAnimation.d.ts +0 -0
  145. /package/dist/{components/game/shared → lib}/spriteAnimationTypes.d.ts +0 -0
  146. /package/dist/{components/game/shared → lib}/spriteSheetConstants.d.ts +0 -0
@@ -1,82 +0,0 @@
1
- /**
2
- * GameCanvas3DBattleTemplate
3
- *
4
- * Declarative template for 3D battle/tactical combat.
5
- * Delegates all interaction state (selectedUnitId, validMoves, attackTargets)
6
- * to <GameBoard3D> so the model (not this template) owns gameplay state.
7
- *
8
- * Page: Battle3DPage
9
- * Entity: Battle3D / GameBoard3DItem
10
- * ViewType: detail
11
- *
12
- * Events Emitted:
13
- * - TILE_CLICK - When a tile is clicked
14
- * - UNIT_CLICK - When a unit is clicked
15
- * - END_TURN - When ending turn
16
- * - EXIT_BATTLE - When exiting battle
17
- *
18
- * @packageDocumentation
19
- */
20
- import React from 'react';
21
- import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
22
- import type { TemplateProps } from '../../../core/templates/types';
23
- import { type Game3DAssetManifest } from '../../shared/lib/game3dAssetManifest';
24
- export interface GameCanvas3DBattleTemplateProps extends TemplateProps {
25
- /** Fallback tile data when no entity is present (layout only — model URLs resolve from assetManifest) */
26
- tiles?: IsometricTile[];
27
- /** Fallback feature data when no entity is present */
28
- features?: IsometricFeature[];
29
- /** GLB model URLs keyed by terrain — owns all asset choice (no hardcoded URLs in this template). */
30
- assetManifest?: Game3DAssetManifest;
31
- /** 3D camera mode - defaults to perspective for dramatic effect */
32
- cameraMode?: 'isometric' | 'perspective' | 'top-down';
33
- /** Show grid helper */
34
- showGrid?: boolean;
35
- /** Enable shadows */
36
- shadows?: boolean;
37
- /** Background color - darker for battle atmosphere */
38
- backgroundColor?: string;
39
- /** Event name for tile clicks — forwarded to the model */
40
- tileClickEvent?: string;
41
- /** Event name for unit clicks — forwarded to the model */
42
- unitClickEvent?: string;
43
- /** Event name for ending turn */
44
- endTurnEvent?: string;
45
- /** Event name for cancel/deselect */
46
- cancelEvent?: string;
47
- /** Event name for attack emission */
48
- attackEvent?: string;
49
- /** Event name for play again / reset */
50
- playAgainEvent?: string;
51
- /** Event name for game end detection */
52
- gameEndEvent?: string;
53
- /** Event name for exiting battle */
54
- exitEvent?: string;
55
- /** Show turn indicator overlay */
56
- showTurnIndicator?: boolean;
57
- /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
58
- unitScale?: number;
59
- /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
60
- scale?: number;
61
- }
62
- /**
63
- * GameCanvas3DBattleTemplate Component
64
- *
65
- * Template for 3D battle/tactical combat view.
66
- * Interaction state lives in the entity (model), not in this component.
67
- *
68
- * @example
69
- * ```tsx
70
- * <GameCanvas3DBattleTemplate
71
- * entity={battleEntity}
72
- * cameraMode="perspective"
73
- * tileClickEvent="TILE_CLICK"
74
- * unitClickEvent="UNIT_CLICK"
75
- * />
76
- * ```
77
- */
78
- export declare function GameCanvas3DBattleTemplate({ entity, tiles: propTiles, features: propFeatures, assetManifest, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, unitScale, scale, className, }: GameCanvas3DBattleTemplateProps): React.JSX.Element | null;
79
- export declare namespace GameCanvas3DBattleTemplate {
80
- var displayName: string;
81
- }
82
- export default GameCanvas3DBattleTemplate;
@@ -1,87 +0,0 @@
1
- /**
2
- * GameCanvas3DCastleTemplate
3
- *
4
- * Declarative template for 3D castle/settlement view.
5
- * Delegates interaction state (selectedUnitId, validMoves, attackTargets)
6
- * to <GameBoard3D> so the model owns all gameplay state.
7
- *
8
- * Page: Castle3DPage, Settlement3DPage
9
- * Entity: Castle3D / GameBoard3DItem
10
- * ViewType: detail
11
- *
12
- * Events Emitted:
13
- * - BUILDING_SELECTED - When a building is clicked
14
- * - UNIT_SELECTED - When a garrison unit is clicked
15
- * - BUILD - When building/upgrading
16
- * - RECRUIT - When recruiting units
17
- * - EXIT - When exiting castle view
18
- *
19
- * @packageDocumentation
20
- */
21
- import React from 'react';
22
- import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
23
- import type { TemplateProps } from '../../../core/templates/types';
24
- import { type Game3DAssetManifest } from '../../shared/lib/game3dAssetManifest';
25
- export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
26
- /** Fallback tile data when no entity is present (layout only — model URLs resolve from assetManifest) */
27
- tiles?: IsometricTile[];
28
- /** Fallback feature data when no entity is present */
29
- features?: IsometricFeature[];
30
- /** GLB model URLs keyed by terrain — owns all asset choice (no hardcoded URLs in this template). */
31
- assetManifest?: Game3DAssetManifest;
32
- /** 3D camera mode */
33
- cameraMode?: 'isometric' | 'perspective' | 'top-down';
34
- /** Show grid helper */
35
- showGrid?: boolean;
36
- /** Enable shadows */
37
- shadows?: boolean;
38
- /** Background color */
39
- backgroundColor?: string;
40
- /** Event name for building (feature) clicks */
41
- buildingClickEvent?: string;
42
- /** Event name for unit clicks */
43
- unitClickEvent?: string;
44
- /** Event name for ending turn */
45
- endTurnEvent?: string;
46
- /** Event name for cancel/deselect */
47
- cancelEvent?: string;
48
- /** Event name for attack emission */
49
- attackEvent?: string;
50
- /** Event name for play again / reset */
51
- playAgainEvent?: string;
52
- /** Event name for game end detection */
53
- gameEndEvent?: string;
54
- /** Event name for build action */
55
- buildEvent?: string;
56
- /** Event name for recruit action */
57
- recruitEvent?: string;
58
- /** Event name for exit */
59
- exitEvent?: string;
60
- /** Show castle name header */
61
- showHeader?: boolean;
62
- /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
63
- unitScale?: number;
64
- /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
65
- scale?: number;
66
- }
67
- /**
68
- * GameCanvas3DCastleTemplate Component
69
- *
70
- * Template for 3D castle/settlement management view.
71
- * Interaction state lives in the entity (model), not in this component.
72
- *
73
- * @example
74
- * ```tsx
75
- * <GameCanvas3DCastleTemplate
76
- * entity={castleEntity}
77
- * cameraMode="isometric"
78
- * showHeader={true}
79
- * buildingClickEvent="UNIT_CLICK"
80
- * />
81
- * ```
82
- */
83
- export declare function GameCanvas3DCastleTemplate({ entity, tiles: propTiles, features: propFeatures, assetManifest, cameraMode, backgroundColor, buildingClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, showHeader, unitScale, scale, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
84
- export declare namespace GameCanvas3DCastleTemplate {
85
- var displayName: string;
86
- }
87
- export default GameCanvas3DCastleTemplate;
@@ -1,95 +0,0 @@
1
- /**
2
- * GameCanvas3DWorldMapTemplate
3
- *
4
- * Declarative template for 3D world map.
5
- * Delegates interaction state (selectedUnitId, validMoves, attackTargets)
6
- * to <GameBoard3D> so the model owns all gameplay state.
7
- *
8
- * Page: WorldMap3DPage
9
- * Entity: WorldMap3D / GameBoard3DItem
10
- * ViewType: detail
11
- *
12
- * Events Emitted:
13
- * - TILE_CLICK - When a tile is clicked ({ tileId, x, z, type })
14
- * - UNIT_CLICK - When a unit is clicked ({ unitId, x, z, name })
15
- * - FEATURE_CLICK - When a feature is clicked ({ featureId, x, z, type })
16
- * - TILE_HOVER - When hovering over a tile ({ tileId, x, z })
17
- * - TILE_LEAVE - When leaving a tile ({})
18
- * - CAMERA_CHANGE - When camera position changes ({ position })
19
- *
20
- * @packageDocumentation
21
- */
22
- import React from 'react';
23
- import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
24
- import type { TemplateProps } from '../../../core/templates/types';
25
- import { type Game3DAssetManifest } from '../../shared/lib/game3dAssetManifest';
26
- export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
27
- /** Fallback tile data when no entity is present (layout only — model URLs resolve from assetManifest) */
28
- tiles?: IsometricTile[];
29
- /** Fallback feature data when no entity is present */
30
- features?: IsometricFeature[];
31
- /** GLB model URLs keyed by terrain — owns all asset choice (no hardcoded URLs in this template). */
32
- assetManifest?: Game3DAssetManifest;
33
- /** 3D camera mode */
34
- cameraMode?: 'isometric' | 'perspective' | 'top-down';
35
- /** Show grid helper */
36
- showGrid?: boolean;
37
- /** Show coordinate overlay */
38
- showCoordinates?: boolean;
39
- /** Show tile info on hover */
40
- showTileInfo?: boolean;
41
- /** Enable shadows */
42
- shadows?: boolean;
43
- /** Background color */
44
- backgroundColor?: string;
45
- /** Event name for tile clicks — forwarded to the model */
46
- tileClickEvent?: string;
47
- /** Event name for unit clicks — forwarded to the model */
48
- unitClickEvent?: string;
49
- /** Event name for ending turn */
50
- endTurnEvent?: string;
51
- /** Event name for cancel/deselect */
52
- cancelEvent?: string;
53
- /** Event name for attack emission */
54
- attackEvent?: string;
55
- /** Event name for play again / reset */
56
- playAgainEvent?: string;
57
- /** Event name for game end detection */
58
- gameEndEvent?: string;
59
- /** Event name for feature clicks */
60
- featureClickEvent?: string;
61
- /** Event name for tile hover */
62
- tileHoverEvent?: string;
63
- /** Event name for tile leave */
64
- tileLeaveEvent?: string;
65
- /** Event name for camera changes */
66
- cameraChangeEvent?: string;
67
- /** Exit/back event name */
68
- exitEvent?: string;
69
- /** Unit draw-size multiplier forwarded to GameBoard3D. Default 1. */
70
- unitScale?: number;
71
- /** Board zoom/group scale forwarded to GameBoard3D. Default 0.45. */
72
- scale?: number;
73
- }
74
- /**
75
- * GameCanvas3DWorldMapTemplate Component
76
- *
77
- * Template for 3D world map view.
78
- * Interaction state lives in the entity (model), not in this component.
79
- *
80
- * @example
81
- * ```tsx
82
- * <GameCanvas3DWorldMapTemplate
83
- * entity={worldMapEntity}
84
- * cameraMode="isometric"
85
- * tileClickEvent="TILE_CLICK"
86
- * unitClickEvent="UNIT_CLICK"
87
- * showCoordinates={true}
88
- * />
89
- * ```
90
- */
91
- export declare function GameCanvas3DWorldMapTemplate({ entity, tiles: propTiles, features: propFeatures, assetManifest, cameraMode, backgroundColor, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, attackEvent, playAgainEvent, gameEndEvent, unitScale, scale, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
92
- export declare namespace GameCanvas3DWorldMapTemplate {
93
- var displayName: string;
94
- }
95
- export default GameCanvas3DWorldMapTemplate;
@@ -1,253 +0,0 @@
1
- /**
2
- * Canvas Effect Types
3
- *
4
- * Type definitions for the canvas-based particle, sequence, and overlay
5
- * effect system. Used by canvasEffects engine and combat presets.
6
- *
7
- * Ported from trait-wars and generalized for any almadar-ui client.
8
- */
9
- /**
10
- * A single particle in flight — rendered as a tinted sprite each frame.
11
- */
12
- export interface CanvasParticle {
13
- /** Sprite URL (white-on-transparent particle) */
14
- spriteUrl: string;
15
- /** Current position in screen pixels */
16
- x: number;
17
- y: number;
18
- /** Velocity in pixels per second */
19
- vx: number;
20
- vy: number;
21
- /** Downward acceleration in px/s² (positive = down) */
22
- gravity: number;
23
- /** Current rotation in radians */
24
- rotation: number;
25
- /** Rotation speed in radians per second */
26
- rotationSpeed: number;
27
- /** Current scale (1.0 = original size) */
28
- scale: number;
29
- /** Scale change per second (negative = shrink) */
30
- scaleSpeed: number;
31
- /** Current alpha (0-1) */
32
- alpha: number;
33
- /** Alpha change per second (negative = fade out) */
34
- fadeRate: number;
35
- /** RGB tint color (applied via offscreen canvas compositing) */
36
- tint: {
37
- r: number;
38
- g: number;
39
- b: number;
40
- };
41
- /** Canvas blend mode */
42
- blendMode: GlobalCompositeOperation;
43
- /** Time this particle was spawned (ms) */
44
- spawnTime: number;
45
- /** Maximum lifetime in ms (particle removed after) */
46
- lifetime: number;
47
- }
48
- /**
49
- * Configuration for spawning a burst of particles.
50
- */
51
- export interface ParticleEmitterConfig {
52
- /** Array of sprite URLs to randomly pick from */
53
- spriteUrls: string[];
54
- /** Number of particles to spawn */
55
- count: number;
56
- /** Spawn origin in screen pixels */
57
- originX: number;
58
- originY: number;
59
- /** Random spread radius from origin (px) */
60
- spread: number;
61
- /** Velocity range (px/s) */
62
- velocityMin: number;
63
- velocityMax: number;
64
- /** Emission angle range (radians, 0 = right, PI/2 = down) */
65
- angleMin: number;
66
- angleMax: number;
67
- /** Gravity (px/s²) */
68
- gravity: number;
69
- /** RGB tint */
70
- tint: {
71
- r: number;
72
- g: number;
73
- b: number;
74
- };
75
- /** Scale range */
76
- scaleMin: number;
77
- scaleMax: number;
78
- /** Scale speed (per second) */
79
- scaleSpeed?: number;
80
- /** Particle lifetime range (ms) */
81
- lifetimeMin: number;
82
- lifetimeMax: number;
83
- /** Fade rate (alpha per second, negative = fade out) */
84
- fadeRate?: number;
85
- /** Starting alpha */
86
- alpha?: number;
87
- /** Canvas blend mode */
88
- blendMode?: GlobalCompositeOperation;
89
- /** Rotation speed range (radians/s) */
90
- rotationSpeedMin?: number;
91
- rotationSpeedMax?: number;
92
- }
93
- /**
94
- * A frame-sequence animation (e.g., explosion, smoke puff).
95
- */
96
- export interface CanvasSequence {
97
- /** Ordered array of frame sprite URLs */
98
- frameUrls: string[];
99
- /** Position in screen pixels (top-left of sprite) */
100
- x: number;
101
- y: number;
102
- /** Duration per frame in ms */
103
- frameDuration: number;
104
- /** Time this sequence started (ms) */
105
- startTime: number;
106
- /** Whether to loop the animation */
107
- loop: boolean;
108
- /** Render scale */
109
- scale: number;
110
- /** RGB tint (null = no tinting) */
111
- tint: {
112
- r: number;
113
- g: number;
114
- b: number;
115
- } | null;
116
- /** Alpha (0-1) */
117
- alpha: number;
118
- /** Canvas blend mode */
119
- blendMode: GlobalCompositeOperation;
120
- }
121
- /**
122
- * Configuration for spawning a frame sequence.
123
- */
124
- export interface SequenceConfig {
125
- frameUrls: string[];
126
- originX: number;
127
- originY: number;
128
- frameDuration: number;
129
- loop?: boolean;
130
- scale?: number;
131
- tint?: {
132
- r: number;
133
- g: number;
134
- b: number;
135
- } | null;
136
- alpha?: number;
137
- blendMode?: GlobalCompositeOperation;
138
- }
139
- /**
140
- * A static/fading overlay image (e.g., ground scorch mark, shield circle).
141
- */
142
- export interface CanvasOverlay {
143
- /** Sprite URL */
144
- spriteUrl: string;
145
- /** Center position in screen pixels */
146
- x: number;
147
- y: number;
148
- /** Current alpha (0-1) */
149
- alpha: number;
150
- /** Alpha change per second (negative = fade out) */
151
- fadeRate: number;
152
- /** Pulse amplitude (0 = no pulse, 0.3 = alpha oscillates ±0.3) */
153
- pulseAmplitude: number;
154
- /** Pulse frequency in Hz */
155
- pulseFrequency: number;
156
- /** Render scale */
157
- scale: number;
158
- /** Canvas blend mode */
159
- blendMode: GlobalCompositeOperation;
160
- /** Time this overlay was spawned (ms) */
161
- spawnTime: number;
162
- /** Maximum lifetime in ms */
163
- lifetime: number;
164
- }
165
- /**
166
- * Configuration for spawning an overlay.
167
- */
168
- export interface OverlayConfig {
169
- spriteUrl: string;
170
- originX: number;
171
- originY: number;
172
- alpha?: number;
173
- fadeRate?: number;
174
- pulseAmplitude?: number;
175
- pulseFrequency?: number;
176
- scale?: number;
177
- blendMode?: GlobalCompositeOperation;
178
- lifetime?: number;
179
- }
180
- /**
181
- * Full state of all active effects on the canvas.
182
- */
183
- export interface CanvasEffectState {
184
- particles: CanvasParticle[];
185
- sequences: CanvasSequence[];
186
- overlays: CanvasOverlay[];
187
- }
188
- /**
189
- * Combat action types that map to effect compositions.
190
- * Superset of trait-wars types + almadar-ui originals.
191
- */
192
- export type CombatActionType = 'melee' | 'ranged' | 'magic' | 'heal' | 'defend' | 'hit' | 'death' | 'buff' | 'debuff' | 'shield' | 'aoe' | 'critical';
193
- /**
194
- * A combat preset composes multiple effect layers.
195
- */
196
- export interface CombatPreset {
197
- /** Particle emitter configs to spawn */
198
- particles: ParticleEmitterConfig[];
199
- /** Sequence configs to spawn */
200
- sequences: SequenceConfig[];
201
- /** Overlay configs to spawn */
202
- overlays: OverlayConfig[];
203
- /** Screen shake intensity in pixels (0 = none) */
204
- screenShake: number;
205
- /** Screen flash color and duration */
206
- screenFlash: {
207
- r: number;
208
- g: number;
209
- b: number;
210
- duration: number;
211
- } | null;
212
- }
213
- /**
214
- * Effect asset manifest — the sprites and animation frames available for
215
- * the particle engine. This is the `assetManifest.effects` section.
216
- */
217
- export interface EffectAssetManifest {
218
- /** Base URL for all asset paths */
219
- baseUrl: string;
220
- /** Particle sprite groups (white-on-transparent, tinted at runtime) */
221
- particles?: {
222
- slash?: string[];
223
- magic?: string[];
224
- fire?: string[];
225
- flame?: string[];
226
- smoke?: string[];
227
- scorch?: string[];
228
- circle?: string[];
229
- flare?: string;
230
- spark?: string[];
231
- muzzle?: string[];
232
- star?: string[];
233
- trace?: string[];
234
- twirl?: string[];
235
- light?: string[];
236
- dirt?: string[];
237
- scratch?: string[];
238
- symbol?: string[];
239
- };
240
- /** Frame-sequence animations (array of frame image paths) */
241
- animations?: {
242
- explosion?: string[];
243
- smokePuff?: string[];
244
- flash?: string[];
245
- blackSmoke?: string[];
246
- gasSmoke?: string[];
247
- smokeExplosion?: string[];
248
- };
249
- }
250
- /**
251
- * Empty effect state constant.
252
- */
253
- export declare const EMPTY_EFFECT_STATE: CanvasEffectState;
@@ -1,55 +0,0 @@
1
- /**
2
- * game3dTheme
3
- *
4
- * Single source of truth for the 3D game renderer's DEFAULT palettes + sizing.
5
- * These were previously baked (and in several cases duplicated) inside
6
- * `GameCanvas3D.tsx`'s inline sub-renderers. The decomposed mesh components
7
- * (`TileMesh3D`, `UnitMesh3D`, `FeatureMesh3D`, `EventMarker3D`, `SideScene3D`)
8
- * read these as DEFAULTS so the renderer stays "dumb": every color/size can be
9
- * overridden per-item via the descriptor data (`tile.color`, `unit.tint`, …)
10
- * that `.lolo` computes. No React deps — pure constants, usable anywhere.
11
- *
12
- * Values are the exact literals that lived inline in GameCanvas3D before the
13
- * decomposition, so a board that supplies no overrides renders identically.
14
- *
15
- * @packageDocumentation
16
- */
17
- /** Tile fallback color by terrain kind (DefaultTile 555–560). */
18
- export declare const TERRAIN_COLORS_3D: Record<string, number>;
19
- /** Tile emissive tint by highlight state (DefaultTile 562–566). */
20
- export declare const HIGHLIGHT_EMISSIVE_3D: Record<string, number>;
21
- /** Unit fallback color by faction/team (DefaultUnit 624). */
22
- export declare const FACTION_COLORS_3D: Record<string, number>;
23
- /** Selection ring color (DefaultUnit 644). */
24
- export declare const SELECTION_RING_COLOR_3D = "#ffff00";
25
- /** Health-bar palette + geometry (DefaultUnit 690–716). */
26
- export declare const HEALTHBAR_3D: {
27
- bg: number;
28
- /** fill color thresholds: fraction > key → color */
29
- high: number;
30
- mid: number;
31
- low: number;
32
- width: number;
33
- };
34
- /** Resolve the health-bar fill color for a health fraction (0..1). */
35
- export declare function healthbarFill3D(fraction: number): number;
36
- /** Procedural tree colors (DefaultFeature 753–760). */
37
- export declare const TREE_COLORS_3D: {
38
- trunk: number;
39
- foliage: number;
40
- };
41
- /** Procedural rock color (DefaultFeature 765). */
42
- export declare const ROCK_COLOR_3D = 8421504;
43
- /** Floating event/feedback label color by event type (EventMarker 487–498). */
44
- export declare const EVENT_COLORS_3D: Record<string, number>;
45
- /** Side-scroller platform palette (SideScene SIDE_PLATFORM_COLORS 356–362). */
46
- export declare const SIDE_PLATFORM_COLORS_3D: Record<string, number>;
47
- /** Side-scroller player fallback capsule color (SideScene 470). */
48
- export declare const SIDE_PLAYER_COLOR_3D = "#4488ff";
49
- /** Grid line colors for the drei `<Grid>` (GameCanvas3D 1245/1248). */
50
- export declare const GRID_COLORS_3D: {
51
- cell: string;
52
- section: string;
53
- };
54
- /** Default scene background (GameCanvas3DProps.backgroundColor default, line 114). */
55
- export declare const DEFAULT_BACKGROUND_3D = "#1a1a2e";
@@ -1,48 +0,0 @@
1
- /**
2
- * game3dAssetManifest — shared, asset-URL-free helpers for the 3D game-canvas
3
- * templates (battle / castle / world-map).
4
- *
5
- * Every GLB model URL lives in the lolo `assetManifest` config and arrives via
6
- * props; these helpers resolve a tile's / feature's `modelUrl` from that manifest
7
- * by terrain/feature key. NO asset URLs are declared here — the templates and this
8
- * module stay pure, exactly like the `GameCanvas3D` molecule.
9
- *
10
- * @packageDocumentation
11
- */
12
- import type { Asset, EntityRow } from '@almadar/core';
13
- import type { IsometricTile, IsometricFeature } from '../isometricTypes';
14
- /** GLB model assets for a 3D board, keyed by terrain "kind" and (optionally) feature type. */
15
- export interface Game3DAssetManifest {
16
- /** Floor model assets by terrain kind ('wall' | 'dirt' | 'open'). */
17
- models?: Record<string, Asset>;
18
- /** Feature/structure model assets by feature type ('gold_mine', 'portal', …). */
19
- features?: Record<string, Asset>;
20
- }
21
- /** Layout-only tile (no model URL): position + terrain kind. */
22
- export interface Tile3DLayout {
23
- id?: string;
24
- x: number;
25
- y: number;
26
- z?: number;
27
- type: string;
28
- passable?: boolean;
29
- /** Terrain kind that maps into `assetManifest.models` (wall | dirt | open). */
30
- kind: string;
31
- }
32
- /**
33
- * Resolve a layout tile array into render-ready `IsometricTile[]`, attaching each
34
- * tile's `modelUrl` from `assetManifest.models` by terrain kind. Pure: URLs come
35
- * only from the manifest.
36
- */
37
- export declare function resolveTilesWithModels(layout: readonly Tile3DLayout[], manifest: Game3DAssetManifest | undefined): IsometricTile[];
38
- /**
39
- * Map prop `IsometricTile[]` (which already carry `type`/`passable` but no model)
40
- * into render-ready tiles with manifest-resolved model URLs.
41
- */
42
- export declare function resolvePropTiles(tiles: readonly IsometricTile[], manifest: Game3DAssetManifest | undefined): IsometricTile[];
43
- /** Read entity-carried tile rows into render-ready `IsometricTile[]` with manifest-resolved models. */
44
- export declare function resolveEntityTiles(entity: EntityRow | readonly EntityRow[] | undefined, manifest: Game3DAssetManifest | undefined): IsometricTile[];
45
- /** Resolve feature model URLs from `assetManifest.features` by feature type. */
46
- export declare function resolveFeaturesWithModels(features: readonly IsometricFeature[], manifest: Game3DAssetManifest | undefined): IsometricFeature[];
47
- /** Read entity-carried feature rows into render-ready `IsometricFeature[]` with manifest models. */
48
- export declare function resolveEntityFeatures(entity: EntityRow | readonly EntityRow[] | undefined, manifest: Game3DAssetManifest | undefined): IsometricFeature[];