@almadar/ui 5.94.1 → 5.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1872 -1379
- package/dist/avl/index.js +873 -380
- package/dist/components/core/atoms/AtlasImage.d.ts +58 -0
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/core/molecules/index.d.ts +1 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +10 -6
- package/dist/components/game/2d/templates/GameShell.d.ts +19 -23
- package/dist/components/game/3d/index.cjs +543 -212
- package/dist/components/game/3d/index.js +371 -36
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +7 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- package/dist/components/index.cjs +2153 -1655
- package/dist/components/index.js +1160 -665
- package/dist/components/learning/molecules/AlgorithmCanvas.d.ts +58 -0
- package/dist/lib/atlasSlice.d.ts +58 -0
- package/dist/marketing/index.cjs +208 -73
- package/dist/marketing/index.js +166 -28
- package/dist/providers/index.cjs +1740 -1247
- package/dist/providers/index.js +849 -356
- package/dist/runtime/index.cjs +1733 -1240
- package/dist/runtime/index.js +853 -360
- package/package.json +2 -2
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import type { EventEmit } from '@almadar/core';
|
|
17
|
+
import type { EventEmit, Asset } from '@almadar/core';
|
|
18
|
+
import type { Platform, SidePlayer } from '../../2d/molecules/Canvas2D';
|
|
18
19
|
import * as THREE from 'three';
|
|
19
20
|
import { AssetLoader } from '../../shared/lib/AssetLoader';
|
|
20
21
|
import { type MinimalMouseEvent } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
@@ -30,8 +31,15 @@ export interface GameEvent {
|
|
|
30
31
|
y?: number;
|
|
31
32
|
message?: string;
|
|
32
33
|
}
|
|
33
|
-
/** Camera mode for 3D view */
|
|
34
|
-
export type CameraMode = 'isometric' | 'perspective' | 'top-down';
|
|
34
|
+
/** Camera mode for 3D view. `follow` tracks the side-view player (or the selected unit). */
|
|
35
|
+
export type CameraMode = 'isometric' | 'perspective' | 'top-down' | 'follow';
|
|
36
|
+
/** Per-role model manifest — the 3D analogue of Canvas2D's assetManifest (values are GLB Assets). */
|
|
37
|
+
export interface GameCanvas3DAssetManifest {
|
|
38
|
+
terrains?: Record<string, Asset>;
|
|
39
|
+
units?: Record<string, Asset>;
|
|
40
|
+
features?: Record<string, Asset>;
|
|
41
|
+
effects?: Record<string, Asset>;
|
|
42
|
+
}
|
|
35
43
|
/** Map orientation */
|
|
36
44
|
export type MapOrientation = 'standard' | 'rotated';
|
|
37
45
|
/** Overlay control */
|
|
@@ -184,6 +192,29 @@ export interface GameCanvas3DProps {
|
|
|
184
192
|
unitScale?: number;
|
|
185
193
|
/** Board zoom/group scale. Applied to the scene group. Default 0.45. */
|
|
186
194
|
scale?: number;
|
|
195
|
+
/** Maps a keydown `e.code` → the board's SEMANTIC event, e.g. `{ ArrowLeft: "LEFT", Space: "JUMP" }`.
|
|
196
|
+
* The input layer emits `UI:<event>` so the FSM stays device-agnostic — keyboard and d-pad converge. */
|
|
197
|
+
keyMap?: Record<string, string>;
|
|
198
|
+
/** Maps a keyup `e.code` → the board's SEMANTIC event, e.g. `{ ArrowLeft: "STOP" }`. */
|
|
199
|
+
keyUpMap?: Record<string, string>;
|
|
200
|
+
/** Side-view player (pixel coords, LOLO-owned physics) — presence switches to side-scroller rendering. */
|
|
201
|
+
player?: SidePlayer;
|
|
202
|
+
/** Side-view level geometry (pixel AABBs, same contract as Canvas2D). */
|
|
203
|
+
platforms?: Platform[];
|
|
204
|
+
/** Side-view world size in pixels. */
|
|
205
|
+
worldWidth?: number;
|
|
206
|
+
/** Side-view world size in pixels. */
|
|
207
|
+
worldHeight?: number;
|
|
208
|
+
/** Pixel→world-unit divisor for side view (default 32 = one 2D tile per 3D cell). */
|
|
209
|
+
pixelsPerUnit?: number;
|
|
210
|
+
/** Player model — named for 2D parity; in 3D the Asset's url is a GLB. */
|
|
211
|
+
playerSprite?: Asset;
|
|
212
|
+
/** Platform-type → model map — named for 2D parity; values are GLB Assets. */
|
|
213
|
+
tileSprites?: Record<string, Asset>;
|
|
214
|
+
/** Per-role model manifest; resolves tiles/units/features without explicit modelUrl/assetUrl. */
|
|
215
|
+
assetManifest?: GameCanvas3DAssetManifest;
|
|
216
|
+
/** Opt-in: smooth-lerp unit positions between LOLO tick snapshots. DEFAULT OFF. */
|
|
217
|
+
interpolateUnits?: boolean;
|
|
187
218
|
}
|
|
188
219
|
/** Imperative handle for GameCanvas3D */
|
|
189
220
|
export interface GameCanvas3DHandle {
|
|
@@ -26,6 +26,12 @@ export interface ModelLoaderProps {
|
|
|
26
26
|
onHover?: (hovered: boolean) => void;
|
|
27
27
|
/** Fallback geometry type */
|
|
28
28
|
fallbackGeometry?: 'box' | 'sphere' | 'cylinder' | 'none';
|
|
29
|
+
/**
|
|
30
|
+
* Named GLB animation clip to play (e.g. "idle", "walk") — the LOLO state machine
|
|
31
|
+
* drives this from the unit's `animation` field. Matched case-insensitively; an
|
|
32
|
+
* unknown or absent name leaves the model static (bind pose).
|
|
33
|
+
*/
|
|
34
|
+
animation?: string;
|
|
29
35
|
/** Enable shadows */
|
|
30
36
|
castShadow?: boolean;
|
|
31
37
|
/** Receive shadows */
|
|
@@ -40,5 +46,5 @@ export interface ModelLoaderProps {
|
|
|
40
46
|
/**
|
|
41
47
|
* ModelLoader component for rendering GLB models in React Three Fiber
|
|
42
48
|
*/
|
|
43
|
-
export declare function ModelLoader({ url, position, scale, rotation, isSelected, isHovered, onClick, onHover, fallbackGeometry, castShadow, receiveShadow, resourceBasePath, }: ModelLoaderProps): React.JSX.Element;
|
|
49
|
+
export declare function ModelLoader({ url, position, scale, rotation, isSelected, isHovered, onClick, onHover, fallbackGeometry, castShadow, receiveShadow, resourceBasePath, animation, }: ModelLoaderProps): React.JSX.Element;
|
|
44
50
|
export default ModelLoader;
|
|
@@ -20,7 +20,6 @@ export { useGameCanvas3DEvents, type UseGameCanvas3DEventsOptions, type UseGameC
|
|
|
20
20
|
export { AssetLoader, assetLoader, type LoadedModel, } from '../../shared/lib/AssetLoader';
|
|
21
21
|
export type { UnitAnimationState } from '../../shared/spriteAnimationTypes';
|
|
22
22
|
export { GameCanvas3D, type GameCanvas3DProps } from './GameCanvas3D';
|
|
23
|
-
export { Canvas3D, type Canvas3DProps } from './Canvas3D';
|
|
24
23
|
export { GameCanvas3DBattleTemplate, type GameCanvas3DBattleTemplateProps } from '../templates/GameCanvas3DBattleTemplate';
|
|
25
24
|
export { GameCanvas3DCastleTemplate, type GameCanvas3DCastleTemplateProps } from '../templates/GameCanvas3DCastleTemplate';
|
|
26
25
|
export { GameCanvas3DWorldMapTemplate, type GameCanvas3DWorldMapTemplateProps } from '../templates/GameCanvas3DWorldMapTemplate';
|