@almadar/ui 5.141.0 → 5.142.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 +1236 -1213
- package/dist/avl/index.js +263 -240
- package/dist/{avl-schema-parser-B8Onmfsu.d.cts → avl-schema-parser-DAs12kxP.d.ts} +229 -2
- package/dist/{avl-schema-parser-B8Onmfsu.d.ts → avl-schema-parser-wOkfbwAh.d.cts} +229 -2
- package/dist/components/index.cjs +1220 -1197
- package/dist/components/index.d.cts +10 -3
- package/dist/components/index.d.ts +10 -3
- package/dist/components/index.js +254 -231
- package/dist/lib/drawable/three/index.cjs +187 -22
- package/dist/lib/drawable/three/index.d.cts +14 -173
- package/dist/lib/drawable/three/index.d.ts +14 -173
- package/dist/lib/drawable/three/index.js +188 -23
- package/dist/providers/index.cjs +1119 -1096
- package/dist/providers/index.js +238 -215
- package/dist/runtime/index.cjs +1097 -1074
- package/dist/runtime/index.js +243 -220
- package/package.json +3 -3
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { AnimationName, Asset, JsonObject, JsonValue } from '@almadar/core';
|
|
1
|
+
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject, JsonValue } from '@almadar/core';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { D as DrawableNode } from './paintDispatch-BQn5Lyx1.js';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Sprite Sheet Animation Types
|
|
@@ -278,6 +281,230 @@ interface CameraState {
|
|
|
278
281
|
zoom: number;
|
|
279
282
|
}
|
|
280
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Canvas3DHost — the thin 3D draw-host: the `canvas` host's 3D painter backend
|
|
286
|
+
* (the R3F "vessel" behind the neutral drawables), the exact 3D analogue of the
|
|
287
|
+
* 2D `Painter2D` seam. Reached only via the lazy `@almadar/ui/.../game/three`
|
|
288
|
+
* subpath so three.js never enters a 2D bundle.
|
|
289
|
+
*
|
|
290
|
+
* The 3D twin of Canvas2D: the board authors a `drawables` list (the neutral
|
|
291
|
+
* `draw-*` children) and this host maps each descriptor through `Drawable3D` to a
|
|
292
|
+
* three.js mesh (a raw descriptor NEVER reaches `<group>{children}` — R3F throws).
|
|
293
|
+
* It owns NO game data — tiles, units, features, selection, health bars and labels
|
|
294
|
+
* are all `draw-*` children composed in `.lolo`, not props here. Only view state
|
|
295
|
+
* (camera, error boundary) is local.
|
|
296
|
+
*
|
|
297
|
+
* Camera: `isometric`/`perspective`/`top-down` frame the scene bounds (derived from
|
|
298
|
+
* the drawn descriptors); `follow`/`chase` track the neutral core `Camera.target`
|
|
299
|
+
* (forwarded as `followTarget`), falling back to the scene centre.
|
|
300
|
+
*
|
|
301
|
+
* Interaction: keyboard maps to semantic events (device-agnostic input). Pointer
|
|
302
|
+
* click/hover on neutral drawables needs a per-entity id + a scene-space raycast
|
|
303
|
+
* the descriptors don't yet carry — that hit-test is a tracked fork
|
|
304
|
+
* (docs/Almadar_Std_Game_V2_PLAN.md); the click/hover event props are accepted but
|
|
305
|
+
* not yet emitted from a raycast.
|
|
306
|
+
*
|
|
307
|
+
* @packageDocumentation
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/** Camera mode for 3D view.
|
|
311
|
+
* - `follow` tracks `followTarget` (the neutral `Camera.target`) from a fixed offset.
|
|
312
|
+
* - `chase` sits behind + above the target. */
|
|
313
|
+
type CameraMode = 'isometric' | 'perspective' | 'top-down' | 'follow' | 'chase';
|
|
314
|
+
/** Map orientation */
|
|
315
|
+
type MapOrientation = 'standard' | 'rotated';
|
|
316
|
+
/** Overlay control */
|
|
317
|
+
type OverlayControl = 'default' | 'hidden' | 'minimap';
|
|
318
|
+
/** Single light's tunable knobs (ambient/directional share this shape). */
|
|
319
|
+
interface CanvasLightConfig {
|
|
320
|
+
intensity?: number;
|
|
321
|
+
color?: string;
|
|
322
|
+
position?: [number, number, number];
|
|
323
|
+
}
|
|
324
|
+
/** Hemisphere (sky/ground) light config. */
|
|
325
|
+
interface CanvasHemisphereConfig {
|
|
326
|
+
intensity?: number;
|
|
327
|
+
color?: string;
|
|
328
|
+
groundColor?: string;
|
|
329
|
+
}
|
|
330
|
+
/** Point light config — `position` is required since a point light has no
|
|
331
|
+
* meaningful default placement. */
|
|
332
|
+
interface CanvasPointLightConfig {
|
|
333
|
+
intensity?: number;
|
|
334
|
+
color?: string;
|
|
335
|
+
position: [number, number, number];
|
|
336
|
+
distance?: number;
|
|
337
|
+
decay?: number;
|
|
338
|
+
}
|
|
339
|
+
/** Canvas-level 3D light rig, authored as data. Every field is optional — an
|
|
340
|
+
* omitted field falls back to today's fixed rig (the defaults live in `Lighting3D`). */
|
|
341
|
+
interface CanvasLighting {
|
|
342
|
+
/** Default intensity 0.6, color '#ffffff'. */
|
|
343
|
+
ambient?: CanvasLightConfig;
|
|
344
|
+
/** Default intensity 0.8, color '#ffffff', position [10, 20, 10]. */
|
|
345
|
+
directional?: CanvasLightConfig;
|
|
346
|
+
/** Default intensity 0.3, color '#87ceeb', groundColor '#362d1d'. */
|
|
347
|
+
hemisphere?: CanvasHemisphereConfig;
|
|
348
|
+
/** Additional point lights. Default none. */
|
|
349
|
+
points?: CanvasPointLightConfig[];
|
|
350
|
+
/** Procedural environment for PBR reflection (metals/glass). 'room' uses three's
|
|
351
|
+
* RoomEnvironment via PMREMGenerator — no network fetch. Default 'none' (today's
|
|
352
|
+
* look). */
|
|
353
|
+
environment?: 'room' | 'none';
|
|
354
|
+
}
|
|
355
|
+
/** Canvas-level post-processing stack. Every field is optional — an omitted field
|
|
356
|
+
* means that pass is not mounted. */
|
|
357
|
+
interface CanvasPost {
|
|
358
|
+
bloom?: {
|
|
359
|
+
intensity?: number;
|
|
360
|
+
threshold?: number;
|
|
361
|
+
smoothing?: number;
|
|
362
|
+
};
|
|
363
|
+
vignette?: {
|
|
364
|
+
offset?: number;
|
|
365
|
+
darkness?: number;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
/** Props for GameCanvas3D component */
|
|
369
|
+
interface Canvas3DHostProps {
|
|
370
|
+
/** Additional CSS classes */
|
|
371
|
+
className?: string;
|
|
372
|
+
/** Declarative JSX drawable children — rendered in a hidden DOM mount where they
|
|
373
|
+
* register their descriptors via DrawableRegistryContext (same contract as Canvas2D). */
|
|
374
|
+
children?: React__default.ReactNode;
|
|
375
|
+
/** Neutral drawable descriptors — the same `children` vocabulary as Canvas2D. The
|
|
376
|
+
* host maps each through `Drawable3D` to a mesh. */
|
|
377
|
+
drawables?: DrawableNode[];
|
|
378
|
+
/** Loading state indicator */
|
|
379
|
+
isLoading?: boolean;
|
|
380
|
+
/** Error state */
|
|
381
|
+
error?: string | null;
|
|
382
|
+
/** Fog of war data (accepted for API parity; presentation-only). */
|
|
383
|
+
fogOfWar?: boolean[][];
|
|
384
|
+
/** Map orientation (data attribute). */
|
|
385
|
+
orientation?: MapOrientation;
|
|
386
|
+
/** Camera mode */
|
|
387
|
+
cameraMode?: CameraMode;
|
|
388
|
+
/** Follow-camera target in scene space (the neutral core `Camera.target`). */
|
|
389
|
+
followTarget?: ScenePos;
|
|
390
|
+
/** Show grid */
|
|
391
|
+
showGrid?: boolean;
|
|
392
|
+
/** Show coordinates overlay (accepted for API parity). */
|
|
393
|
+
showCoordinates?: boolean;
|
|
394
|
+
/** Show tile information (accepted for API parity). */
|
|
395
|
+
showTileInfo?: boolean;
|
|
396
|
+
/** Overlay control mode (data attribute). */
|
|
397
|
+
overlay?: OverlayControl;
|
|
398
|
+
/** Enable shadows */
|
|
399
|
+
shadows?: boolean;
|
|
400
|
+
/** Background color */
|
|
401
|
+
backgroundColor?: string;
|
|
402
|
+
/** Declarative event: tile click. Emitted from a ground-plane raycast → scene cell
|
|
403
|
+
* `{ x, z }` (the FSM validates the cell). `tileId` is optional — the neutral host
|
|
404
|
+
* has no per-tile id, and the board FSMs key off the coordinate. */
|
|
405
|
+
tileClickEvent?: EventEmit<{
|
|
406
|
+
x: number;
|
|
407
|
+
z: number;
|
|
408
|
+
tileId?: string;
|
|
409
|
+
type?: string;
|
|
410
|
+
terrain?: string;
|
|
411
|
+
elevation?: number;
|
|
412
|
+
}>;
|
|
413
|
+
/** Declarative event: unit click. Emitted `{ unitId, x, z }` when the raycast lands on a
|
|
414
|
+
* cell whose descriptor carries an `id` (a tagged unit sprite). */
|
|
415
|
+
unitClickEvent?: EventEmit<{
|
|
416
|
+
unitId: string;
|
|
417
|
+
x: number;
|
|
418
|
+
z: number;
|
|
419
|
+
unitType?: string;
|
|
420
|
+
name?: string;
|
|
421
|
+
team?: string;
|
|
422
|
+
faction?: string;
|
|
423
|
+
health?: number;
|
|
424
|
+
maxHealth?: number;
|
|
425
|
+
}>;
|
|
426
|
+
/** Declarative event: feature click. Accepted; not yet emitted (see `tileClickEvent`). */
|
|
427
|
+
featureClickEvent?: EventEmit<{
|
|
428
|
+
featureId: string;
|
|
429
|
+
x: number;
|
|
430
|
+
z: number;
|
|
431
|
+
type?: string;
|
|
432
|
+
elevation?: number;
|
|
433
|
+
}>;
|
|
434
|
+
/** Declarative event: canvas (background) click. */
|
|
435
|
+
canvasClickEvent?: EventEmit<{
|
|
436
|
+
clientX: number;
|
|
437
|
+
clientY: number;
|
|
438
|
+
button: number;
|
|
439
|
+
}>;
|
|
440
|
+
/** Declarative event: tile hover. Accepted; not yet emitted (see `tileClickEvent`). */
|
|
441
|
+
tileHoverEvent?: EventEmit<{
|
|
442
|
+
tileId: string;
|
|
443
|
+
x: number;
|
|
444
|
+
z: number;
|
|
445
|
+
type?: string;
|
|
446
|
+
}>;
|
|
447
|
+
/** Declarative event: tile leave. */
|
|
448
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
449
|
+
/** Declarative event: unit animation. */
|
|
450
|
+
unitAnimationEvent?: EventEmit<{
|
|
451
|
+
unitId: string;
|
|
452
|
+
state: string;
|
|
453
|
+
timestamp: number;
|
|
454
|
+
}>;
|
|
455
|
+
/** Declarative event: camera change. */
|
|
456
|
+
cameraChangeEvent?: EventEmit<{
|
|
457
|
+
position: {
|
|
458
|
+
x: number;
|
|
459
|
+
y: number;
|
|
460
|
+
z: number;
|
|
461
|
+
};
|
|
462
|
+
timestamp: number;
|
|
463
|
+
}>;
|
|
464
|
+
/** Loading message */
|
|
465
|
+
loadingMessage?: string;
|
|
466
|
+
/** Unit draw-size multiplier (accepted for API parity; sizing is drawable-authored). */
|
|
467
|
+
unitScale?: number;
|
|
468
|
+
/** Board zoom (accepted for API parity; 3D zoom is camera-driven, not group-scaled). */
|
|
469
|
+
scale?: number;
|
|
470
|
+
/** Maps a keydown `e.code` → the board's SEMANTIC event (device-agnostic input). */
|
|
471
|
+
keyMap?: Record<string, string>;
|
|
472
|
+
/** Maps a keyup `e.code` → the board's SEMANTIC event. */
|
|
473
|
+
keyUpMap?: Record<string, string>;
|
|
474
|
+
/** Side-view world size in pixels (accepted for API parity). */
|
|
475
|
+
worldWidth?: number;
|
|
476
|
+
/** Side-view world size in pixels (accepted for API parity). */
|
|
477
|
+
worldHeight?: number;
|
|
478
|
+
/** Pixel→world-unit divisor for pixel-authored (side-view) scenes: world size =
|
|
479
|
+
* scene size ÷ `pixelsPerUnit`. Omitted → 1 world unit per scene unit (grid boards). */
|
|
480
|
+
pixelsPerUnit?: number;
|
|
481
|
+
/** Perspective field of view in degrees — the neutral `Camera.fov`. Default 45. */
|
|
482
|
+
fov?: number;
|
|
483
|
+
/** 3D scene light rig as data — ambient/directional/hemisphere/point lights + optional
|
|
484
|
+
* 'room' environment. Omitted → the standard fixed rig (this host's current
|
|
485
|
+
* hardcoded lights, unchanged). */
|
|
486
|
+
lighting?: CanvasLighting;
|
|
487
|
+
/** 3D post-processing stack — bloom + vignette. Omitted → no composer pass mounted. */
|
|
488
|
+
post?: CanvasPost;
|
|
489
|
+
}
|
|
490
|
+
/** Imperative handle for GameCanvas3D */
|
|
491
|
+
interface Canvas3DHostHandle {
|
|
492
|
+
/** Get current camera position */
|
|
493
|
+
getCameraPosition: () => THREE.Vector3 | null;
|
|
494
|
+
/** Set camera position */
|
|
495
|
+
setCameraPosition: (x: number, y: number, z: number) => void;
|
|
496
|
+
/** Look at a specific point */
|
|
497
|
+
lookAt: (x: number, y: number, z: number) => void;
|
|
498
|
+
/** Reset camera to default position */
|
|
499
|
+
resetCamera: () => void;
|
|
500
|
+
/** Take a screenshot */
|
|
501
|
+
screenshot: () => string | null;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Canvas3DHost — thin 3D draw-host. Walks `drawables` through `Drawable3D`.
|
|
505
|
+
*/
|
|
506
|
+
declare const Canvas3DHost: React__default.ForwardRefExoticComponent<Canvas3DHostProps & React__default.RefAttributes<Canvas3DHostHandle>>;
|
|
507
|
+
|
|
281
508
|
/**
|
|
282
509
|
* AVL Schema Parser
|
|
283
510
|
*
|
|
@@ -390,4 +617,4 @@ interface TransitionLevelData {
|
|
|
390
617
|
slotTargets: SlotTarget[];
|
|
391
618
|
}
|
|
392
619
|
|
|
393
|
-
export { type ApplicationLevelData as A, type BoardTile as B, type
|
|
620
|
+
export { type ApplicationLevelData as A, type BoardTile as B, type CanvasPointLightConfig as C, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, Canvas3DHost as d, type Canvas3DHostHandle as e, type Canvas3DHostProps as f, type SpriteFrameDims as g, type CanvasLighting as h, type CanvasPost as i, type CameraState as j, type FieldInfo as k, type OrbitalTraitInfo as l, type OrbitalPageInfo as m, type GamePhase as n, type GameState as o, type GameUnit as p, type UnitTrait as q, calculateAttackTargets as r, calculateValidMoves as s, createInitialGameState as t };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { AnimationName, Asset, JsonObject, JsonValue } from '@almadar/core';
|
|
1
|
+
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject, JsonValue } from '@almadar/core';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import * as THREE from 'three';
|
|
4
|
+
import { D as DrawableNode } from './paintDispatch-BQn5Lyx1.cjs';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Sprite Sheet Animation Types
|
|
@@ -278,6 +281,230 @@ interface CameraState {
|
|
|
278
281
|
zoom: number;
|
|
279
282
|
}
|
|
280
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Canvas3DHost — the thin 3D draw-host: the `canvas` host's 3D painter backend
|
|
286
|
+
* (the R3F "vessel" behind the neutral drawables), the exact 3D analogue of the
|
|
287
|
+
* 2D `Painter2D` seam. Reached only via the lazy `@almadar/ui/.../game/three`
|
|
288
|
+
* subpath so three.js never enters a 2D bundle.
|
|
289
|
+
*
|
|
290
|
+
* The 3D twin of Canvas2D: the board authors a `drawables` list (the neutral
|
|
291
|
+
* `draw-*` children) and this host maps each descriptor through `Drawable3D` to a
|
|
292
|
+
* three.js mesh (a raw descriptor NEVER reaches `<group>{children}` — R3F throws).
|
|
293
|
+
* It owns NO game data — tiles, units, features, selection, health bars and labels
|
|
294
|
+
* are all `draw-*` children composed in `.lolo`, not props here. Only view state
|
|
295
|
+
* (camera, error boundary) is local.
|
|
296
|
+
*
|
|
297
|
+
* Camera: `isometric`/`perspective`/`top-down` frame the scene bounds (derived from
|
|
298
|
+
* the drawn descriptors); `follow`/`chase` track the neutral core `Camera.target`
|
|
299
|
+
* (forwarded as `followTarget`), falling back to the scene centre.
|
|
300
|
+
*
|
|
301
|
+
* Interaction: keyboard maps to semantic events (device-agnostic input). Pointer
|
|
302
|
+
* click/hover on neutral drawables needs a per-entity id + a scene-space raycast
|
|
303
|
+
* the descriptors don't yet carry — that hit-test is a tracked fork
|
|
304
|
+
* (docs/Almadar_Std_Game_V2_PLAN.md); the click/hover event props are accepted but
|
|
305
|
+
* not yet emitted from a raycast.
|
|
306
|
+
*
|
|
307
|
+
* @packageDocumentation
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/** Camera mode for 3D view.
|
|
311
|
+
* - `follow` tracks `followTarget` (the neutral `Camera.target`) from a fixed offset.
|
|
312
|
+
* - `chase` sits behind + above the target. */
|
|
313
|
+
type CameraMode = 'isometric' | 'perspective' | 'top-down' | 'follow' | 'chase';
|
|
314
|
+
/** Map orientation */
|
|
315
|
+
type MapOrientation = 'standard' | 'rotated';
|
|
316
|
+
/** Overlay control */
|
|
317
|
+
type OverlayControl = 'default' | 'hidden' | 'minimap';
|
|
318
|
+
/** Single light's tunable knobs (ambient/directional share this shape). */
|
|
319
|
+
interface CanvasLightConfig {
|
|
320
|
+
intensity?: number;
|
|
321
|
+
color?: string;
|
|
322
|
+
position?: [number, number, number];
|
|
323
|
+
}
|
|
324
|
+
/** Hemisphere (sky/ground) light config. */
|
|
325
|
+
interface CanvasHemisphereConfig {
|
|
326
|
+
intensity?: number;
|
|
327
|
+
color?: string;
|
|
328
|
+
groundColor?: string;
|
|
329
|
+
}
|
|
330
|
+
/** Point light config — `position` is required since a point light has no
|
|
331
|
+
* meaningful default placement. */
|
|
332
|
+
interface CanvasPointLightConfig {
|
|
333
|
+
intensity?: number;
|
|
334
|
+
color?: string;
|
|
335
|
+
position: [number, number, number];
|
|
336
|
+
distance?: number;
|
|
337
|
+
decay?: number;
|
|
338
|
+
}
|
|
339
|
+
/** Canvas-level 3D light rig, authored as data. Every field is optional — an
|
|
340
|
+
* omitted field falls back to today's fixed rig (the defaults live in `Lighting3D`). */
|
|
341
|
+
interface CanvasLighting {
|
|
342
|
+
/** Default intensity 0.6, color '#ffffff'. */
|
|
343
|
+
ambient?: CanvasLightConfig;
|
|
344
|
+
/** Default intensity 0.8, color '#ffffff', position [10, 20, 10]. */
|
|
345
|
+
directional?: CanvasLightConfig;
|
|
346
|
+
/** Default intensity 0.3, color '#87ceeb', groundColor '#362d1d'. */
|
|
347
|
+
hemisphere?: CanvasHemisphereConfig;
|
|
348
|
+
/** Additional point lights. Default none. */
|
|
349
|
+
points?: CanvasPointLightConfig[];
|
|
350
|
+
/** Procedural environment for PBR reflection (metals/glass). 'room' uses three's
|
|
351
|
+
* RoomEnvironment via PMREMGenerator — no network fetch. Default 'none' (today's
|
|
352
|
+
* look). */
|
|
353
|
+
environment?: 'room' | 'none';
|
|
354
|
+
}
|
|
355
|
+
/** Canvas-level post-processing stack. Every field is optional — an omitted field
|
|
356
|
+
* means that pass is not mounted. */
|
|
357
|
+
interface CanvasPost {
|
|
358
|
+
bloom?: {
|
|
359
|
+
intensity?: number;
|
|
360
|
+
threshold?: number;
|
|
361
|
+
smoothing?: number;
|
|
362
|
+
};
|
|
363
|
+
vignette?: {
|
|
364
|
+
offset?: number;
|
|
365
|
+
darkness?: number;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
/** Props for GameCanvas3D component */
|
|
369
|
+
interface Canvas3DHostProps {
|
|
370
|
+
/** Additional CSS classes */
|
|
371
|
+
className?: string;
|
|
372
|
+
/** Declarative JSX drawable children — rendered in a hidden DOM mount where they
|
|
373
|
+
* register their descriptors via DrawableRegistryContext (same contract as Canvas2D). */
|
|
374
|
+
children?: React__default.ReactNode;
|
|
375
|
+
/** Neutral drawable descriptors — the same `children` vocabulary as Canvas2D. The
|
|
376
|
+
* host maps each through `Drawable3D` to a mesh. */
|
|
377
|
+
drawables?: DrawableNode[];
|
|
378
|
+
/** Loading state indicator */
|
|
379
|
+
isLoading?: boolean;
|
|
380
|
+
/** Error state */
|
|
381
|
+
error?: string | null;
|
|
382
|
+
/** Fog of war data (accepted for API parity; presentation-only). */
|
|
383
|
+
fogOfWar?: boolean[][];
|
|
384
|
+
/** Map orientation (data attribute). */
|
|
385
|
+
orientation?: MapOrientation;
|
|
386
|
+
/** Camera mode */
|
|
387
|
+
cameraMode?: CameraMode;
|
|
388
|
+
/** Follow-camera target in scene space (the neutral core `Camera.target`). */
|
|
389
|
+
followTarget?: ScenePos;
|
|
390
|
+
/** Show grid */
|
|
391
|
+
showGrid?: boolean;
|
|
392
|
+
/** Show coordinates overlay (accepted for API parity). */
|
|
393
|
+
showCoordinates?: boolean;
|
|
394
|
+
/** Show tile information (accepted for API parity). */
|
|
395
|
+
showTileInfo?: boolean;
|
|
396
|
+
/** Overlay control mode (data attribute). */
|
|
397
|
+
overlay?: OverlayControl;
|
|
398
|
+
/** Enable shadows */
|
|
399
|
+
shadows?: boolean;
|
|
400
|
+
/** Background color */
|
|
401
|
+
backgroundColor?: string;
|
|
402
|
+
/** Declarative event: tile click. Emitted from a ground-plane raycast → scene cell
|
|
403
|
+
* `{ x, z }` (the FSM validates the cell). `tileId` is optional — the neutral host
|
|
404
|
+
* has no per-tile id, and the board FSMs key off the coordinate. */
|
|
405
|
+
tileClickEvent?: EventEmit<{
|
|
406
|
+
x: number;
|
|
407
|
+
z: number;
|
|
408
|
+
tileId?: string;
|
|
409
|
+
type?: string;
|
|
410
|
+
terrain?: string;
|
|
411
|
+
elevation?: number;
|
|
412
|
+
}>;
|
|
413
|
+
/** Declarative event: unit click. Emitted `{ unitId, x, z }` when the raycast lands on a
|
|
414
|
+
* cell whose descriptor carries an `id` (a tagged unit sprite). */
|
|
415
|
+
unitClickEvent?: EventEmit<{
|
|
416
|
+
unitId: string;
|
|
417
|
+
x: number;
|
|
418
|
+
z: number;
|
|
419
|
+
unitType?: string;
|
|
420
|
+
name?: string;
|
|
421
|
+
team?: string;
|
|
422
|
+
faction?: string;
|
|
423
|
+
health?: number;
|
|
424
|
+
maxHealth?: number;
|
|
425
|
+
}>;
|
|
426
|
+
/** Declarative event: feature click. Accepted; not yet emitted (see `tileClickEvent`). */
|
|
427
|
+
featureClickEvent?: EventEmit<{
|
|
428
|
+
featureId: string;
|
|
429
|
+
x: number;
|
|
430
|
+
z: number;
|
|
431
|
+
type?: string;
|
|
432
|
+
elevation?: number;
|
|
433
|
+
}>;
|
|
434
|
+
/** Declarative event: canvas (background) click. */
|
|
435
|
+
canvasClickEvent?: EventEmit<{
|
|
436
|
+
clientX: number;
|
|
437
|
+
clientY: number;
|
|
438
|
+
button: number;
|
|
439
|
+
}>;
|
|
440
|
+
/** Declarative event: tile hover. Accepted; not yet emitted (see `tileClickEvent`). */
|
|
441
|
+
tileHoverEvent?: EventEmit<{
|
|
442
|
+
tileId: string;
|
|
443
|
+
x: number;
|
|
444
|
+
z: number;
|
|
445
|
+
type?: string;
|
|
446
|
+
}>;
|
|
447
|
+
/** Declarative event: tile leave. */
|
|
448
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
449
|
+
/** Declarative event: unit animation. */
|
|
450
|
+
unitAnimationEvent?: EventEmit<{
|
|
451
|
+
unitId: string;
|
|
452
|
+
state: string;
|
|
453
|
+
timestamp: number;
|
|
454
|
+
}>;
|
|
455
|
+
/** Declarative event: camera change. */
|
|
456
|
+
cameraChangeEvent?: EventEmit<{
|
|
457
|
+
position: {
|
|
458
|
+
x: number;
|
|
459
|
+
y: number;
|
|
460
|
+
z: number;
|
|
461
|
+
};
|
|
462
|
+
timestamp: number;
|
|
463
|
+
}>;
|
|
464
|
+
/** Loading message */
|
|
465
|
+
loadingMessage?: string;
|
|
466
|
+
/** Unit draw-size multiplier (accepted for API parity; sizing is drawable-authored). */
|
|
467
|
+
unitScale?: number;
|
|
468
|
+
/** Board zoom (accepted for API parity; 3D zoom is camera-driven, not group-scaled). */
|
|
469
|
+
scale?: number;
|
|
470
|
+
/** Maps a keydown `e.code` → the board's SEMANTIC event (device-agnostic input). */
|
|
471
|
+
keyMap?: Record<string, string>;
|
|
472
|
+
/** Maps a keyup `e.code` → the board's SEMANTIC event. */
|
|
473
|
+
keyUpMap?: Record<string, string>;
|
|
474
|
+
/** Side-view world size in pixels (accepted for API parity). */
|
|
475
|
+
worldWidth?: number;
|
|
476
|
+
/** Side-view world size in pixels (accepted for API parity). */
|
|
477
|
+
worldHeight?: number;
|
|
478
|
+
/** Pixel→world-unit divisor for pixel-authored (side-view) scenes: world size =
|
|
479
|
+
* scene size ÷ `pixelsPerUnit`. Omitted → 1 world unit per scene unit (grid boards). */
|
|
480
|
+
pixelsPerUnit?: number;
|
|
481
|
+
/** Perspective field of view in degrees — the neutral `Camera.fov`. Default 45. */
|
|
482
|
+
fov?: number;
|
|
483
|
+
/** 3D scene light rig as data — ambient/directional/hemisphere/point lights + optional
|
|
484
|
+
* 'room' environment. Omitted → the standard fixed rig (this host's current
|
|
485
|
+
* hardcoded lights, unchanged). */
|
|
486
|
+
lighting?: CanvasLighting;
|
|
487
|
+
/** 3D post-processing stack — bloom + vignette. Omitted → no composer pass mounted. */
|
|
488
|
+
post?: CanvasPost;
|
|
489
|
+
}
|
|
490
|
+
/** Imperative handle for GameCanvas3D */
|
|
491
|
+
interface Canvas3DHostHandle {
|
|
492
|
+
/** Get current camera position */
|
|
493
|
+
getCameraPosition: () => THREE.Vector3 | null;
|
|
494
|
+
/** Set camera position */
|
|
495
|
+
setCameraPosition: (x: number, y: number, z: number) => void;
|
|
496
|
+
/** Look at a specific point */
|
|
497
|
+
lookAt: (x: number, y: number, z: number) => void;
|
|
498
|
+
/** Reset camera to default position */
|
|
499
|
+
resetCamera: () => void;
|
|
500
|
+
/** Take a screenshot */
|
|
501
|
+
screenshot: () => string | null;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Canvas3DHost — thin 3D draw-host. Walks `drawables` through `Drawable3D`.
|
|
505
|
+
*/
|
|
506
|
+
declare const Canvas3DHost: React__default.ForwardRefExoticComponent<Canvas3DHostProps & React__default.RefAttributes<Canvas3DHostHandle>>;
|
|
507
|
+
|
|
281
508
|
/**
|
|
282
509
|
* AVL Schema Parser
|
|
283
510
|
*
|
|
@@ -390,4 +617,4 @@ interface TransitionLevelData {
|
|
|
390
617
|
slotTargets: SlotTarget[];
|
|
391
618
|
}
|
|
392
619
|
|
|
393
|
-
export { type ApplicationLevelData as A, type BoardTile as B, type
|
|
620
|
+
export { type ApplicationLevelData as A, type BoardTile as B, type CanvasPointLightConfig as C, type ExternalLink as E, type FacingDirection as F, type GameAction as G, type IsometricTile as I, type OrbitalLevelData as O, type Position as P, type ResolvedFrame as R, type SpriteSheetUrls as S, type TraitLevelData as T, type UnitAnimationState as U, type IsometricUnit as a, type IsometricFeature as b, type TransitionLevelData as c, Canvas3DHost as d, type Canvas3DHostHandle as e, type Canvas3DHostProps as f, type SpriteFrameDims as g, type CanvasLighting as h, type CanvasPost as i, type CameraState as j, type FieldInfo as k, type OrbitalTraitInfo as l, type OrbitalPageInfo as m, type GamePhase as n, type GameState as o, type GameUnit as p, type UnitTrait as q, calculateAttackTargets as r, calculateValidMoves as s, createInitialGameState as t };
|