@almadar/ui 5.28.5 → 5.30.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 +178 -113
- package/dist/avl/index.js +178 -113
- package/dist/components/core/molecules/DocumentViewer.d.ts +0 -2
- package/dist/components/core/molecules/Header.d.ts +0 -4
- package/dist/components/core/molecules/Navigation.d.ts +0 -2
- package/dist/components/core/molecules/PageHeader.d.ts +0 -2
- package/dist/components/core/molecules/PropertyInspector.d.ts +8 -1
- package/dist/components/core/organisms/index.d.ts +1 -1
- package/dist/components/core/templates/index.d.ts +3 -0
- package/dist/components/game/{organisms → molecules}/GameCanvas3D.d.ts +1 -3
- package/dist/components/game/molecules/index.d.ts +1 -0
- package/dist/components/game/{organisms → molecules}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
- package/dist/components/game/{organisms → molecules}/three/index.cjs +29 -4
- package/dist/components/game/{organisms → molecules}/three/index.css +3 -3
- package/dist/components/game/{organisms → molecules}/three/index.js +29 -4
- package/dist/components/game/{organisms → molecules}/three/renderers/FeatureRenderer.d.ts +1 -1
- package/dist/components/game/{organisms → molecules}/three/renderers/FeatureRenderer3D.d.ts +1 -1
- package/dist/components/game/{organisms → molecules}/three/renderers/TileRenderer.d.ts +1 -1
- package/dist/components/game/{organisms → molecules}/three/renderers/UnitRenderer.d.ts +1 -1
- package/dist/components/game/organisms/TraitSlot.d.ts +3 -1
- package/dist/components/game/organisms/index.d.ts +0 -9
- package/dist/components/game/organisms/types/isometric.d.ts +2 -0
- package/dist/components/index.cjs +786 -692
- package/dist/components/index.js +788 -694
- package/dist/providers/index.cjs +178 -113
- package/dist/providers/index.js +178 -113
- package/dist/renderer/pattern-resolver.d.ts +2 -5
- package/dist/runtime/index.cjs +178 -113
- package/dist/runtime/index.js +178 -113
- package/package.json +9 -4
- package/dist/components/game/organisms/CombatLog.d.ts +0 -2
- package/dist/components/game/organisms/DialogueBox.d.ts +0 -2
- package/dist/components/game/organisms/GameHud.d.ts +0 -2
- package/dist/components/game/organisms/GameMenu.d.ts +0 -2
- package/dist/components/game/organisms/GameOverScreen.d.ts +0 -2
- package/dist/components/game/organisms/InventoryPanel.d.ts +0 -2
- package/dist/components/game/organisms/IsometricCanvas.d.ts +0 -3
- package/dist/components/game/organisms/PlatformerCanvas.d.ts +0 -2
- /package/dist/components/game/{organisms → molecules}/three/Camera3D.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/Lighting3D.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/Scene3D.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/components/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/components/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/components/ModelLoader.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/components/PhysicsObject3D.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/components/index.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/hooks/useRaycaster.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/hooks/useThree.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/index.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/loaders/AssetLoader.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/renderers/index.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/utils/culling.d.ts +0 -0
- /package/dist/components/game/{organisms → molecules}/three/utils/grid3D.d.ts +0 -0
|
@@ -756,7 +756,7 @@ var AssetLoader = class {
|
|
|
756
756
|
};
|
|
757
757
|
var assetLoader = new AssetLoader();
|
|
758
758
|
|
|
759
|
-
// components/game/
|
|
759
|
+
// components/game/molecules/three/hooks/useThree.ts
|
|
760
760
|
var DEFAULT_OPTIONS = {
|
|
761
761
|
cameraMode: "isometric",
|
|
762
762
|
cameraPosition: [10, 10, 10],
|
|
@@ -1476,7 +1476,7 @@ function useEmitEvent() {
|
|
|
1476
1476
|
);
|
|
1477
1477
|
}
|
|
1478
1478
|
|
|
1479
|
-
// components/game/
|
|
1479
|
+
// components/game/molecules/three/hooks/useGameCanvas3DEvents.ts
|
|
1480
1480
|
function useGameCanvas3DEvents(options) {
|
|
1481
1481
|
const {
|
|
1482
1482
|
tileClickEvent,
|
|
@@ -1732,6 +1732,30 @@ function TileRenderer({
|
|
|
1732
1732
|
const x = (tile.x - offsetX) * cellSize;
|
|
1733
1733
|
const z = ((tile.z ?? tile.y ?? 0) - offsetZ) * cellSize;
|
|
1734
1734
|
const y = (tile.elevation ?? 0) * 0.1;
|
|
1735
|
+
const position = [x, y, z];
|
|
1736
|
+
if (tile.modelUrl) {
|
|
1737
|
+
return /* @__PURE__ */ jsx(
|
|
1738
|
+
"group",
|
|
1739
|
+
{
|
|
1740
|
+
userData: { type: "tile", tileId: tile.id, gridX: tile.x, gridZ: tile.z ?? tile.y },
|
|
1741
|
+
onClick: () => onTileClick?.(tile),
|
|
1742
|
+
onPointerEnter: () => onTileHover?.(tile),
|
|
1743
|
+
onPointerLeave: () => onTileHover?.(null),
|
|
1744
|
+
children: /* @__PURE__ */ jsx(
|
|
1745
|
+
ModelLoader,
|
|
1746
|
+
{
|
|
1747
|
+
url: tile.modelUrl,
|
|
1748
|
+
position,
|
|
1749
|
+
scale: cellSize * 0.9,
|
|
1750
|
+
fallbackGeometry: "box",
|
|
1751
|
+
castShadow: true,
|
|
1752
|
+
receiveShadow: true
|
|
1753
|
+
}
|
|
1754
|
+
)
|
|
1755
|
+
},
|
|
1756
|
+
tile.id ?? `tile-${tile.x}-${tile.y}`
|
|
1757
|
+
);
|
|
1758
|
+
}
|
|
1735
1759
|
const colorHex = terrainColors[tile.type || ""] || terrainColors[tile.terrain || ""] || "#808080";
|
|
1736
1760
|
const isSelected = tile.id ? selectedTileIds.includes(tile.id) : false;
|
|
1737
1761
|
const isValidMove = validMoves.some(
|
|
@@ -1747,7 +1771,7 @@ function TileRenderer({
|
|
|
1747
1771
|
return /* @__PURE__ */ jsxs(
|
|
1748
1772
|
"mesh",
|
|
1749
1773
|
{
|
|
1750
|
-
position
|
|
1774
|
+
position,
|
|
1751
1775
|
userData: { type: "tile", tileId: tile.id, gridX: tile.x, gridZ: tile.z ?? tile.y },
|
|
1752
1776
|
onClick: () => onTileClick?.(tile),
|
|
1753
1777
|
onPointerEnter: () => onTileHover?.(tile),
|
|
@@ -1769,7 +1793,8 @@ function TileRenderer({
|
|
|
1769
1793
|
);
|
|
1770
1794
|
});
|
|
1771
1795
|
};
|
|
1772
|
-
|
|
1796
|
+
const hasModelTiles = tiles.some((t) => t.modelUrl);
|
|
1797
|
+
if (useInstancing && tiles.length > 0 && !hasModelTiles) {
|
|
1773
1798
|
return /* @__PURE__ */ jsx(
|
|
1774
1799
|
"instancedMesh",
|
|
1775
1800
|
{
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { IsometricFeature } from '
|
|
10
|
+
import type { IsometricFeature } from '../../../organisms/types/isometric';
|
|
11
11
|
export interface FeatureRendererProps {
|
|
12
12
|
/** Array of features to render */
|
|
13
13
|
features: IsometricFeature[];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { IsometricFeature } from '
|
|
10
|
+
import type { IsometricFeature } from '../../../organisms/types/isometric';
|
|
11
11
|
export interface FeatureRenderer3DProps {
|
|
12
12
|
/** Array of features to render */
|
|
13
13
|
features: IsometricFeature[];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { IsometricTile } from '
|
|
10
|
+
import type { IsometricTile } from '../../../organisms/types/isometric';
|
|
11
11
|
export interface TileRendererProps {
|
|
12
12
|
/** Array of tiles to render */
|
|
13
13
|
tiles: IsometricTile[];
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type { IsometricUnit } from '
|
|
10
|
+
import type { IsometricUnit } from '../../../organisms/types/isometric';
|
|
11
11
|
export type UnitAnimationState = 'idle' | 'walk' | 'attack' | 'hurt' | 'die';
|
|
12
12
|
export interface UnitRendererProps {
|
|
13
13
|
/** Array of units to render */
|
|
@@ -29,7 +29,9 @@ export type SlotItemData = {
|
|
|
29
29
|
description?: string;
|
|
30
30
|
/** Emoji or text icon */
|
|
31
31
|
iconEmoji?: string;
|
|
32
|
-
/** Image URL icon (takes precedence over iconEmoji)
|
|
32
|
+
/** Image URL icon (takes precedence over iconEmoji)
|
|
33
|
+
* @default https://almadar-kflow-assets.web.app/shared/platformer/items/platformPack_item001.png
|
|
34
|
+
*/
|
|
33
35
|
iconUrl?: AssetUrl;
|
|
34
36
|
/** Optional state machine for tooltip display */
|
|
35
37
|
stateMachine?: TraitStateMachineDefinition;
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export { IsometricCanvas, type IsometricCanvasProps } from './IsometricCanvas';
|
|
10
|
-
export { PlatformerCanvas, type PlatformerCanvasProps, type PlatformerPlatform, type PlatformerPlayer } from './PlatformerCanvas';
|
|
11
9
|
export { CanvasEffect, type CanvasEffectProps, type CombatActionType } from './CanvasEffect';
|
|
12
10
|
export type { IsometricTile, IsometricUnit, IsometricFeature, CameraState, } from './types/isometric';
|
|
13
11
|
export type { AnimationName, FacingDirection, SpriteDirection, ResolvedFrame, UnitAnimationState, SpriteFrameDims, SpriteSheetUrls, AnimationDef, } from './types/spriteAnimation';
|
|
@@ -22,11 +20,6 @@ export { PhysicsManager, type Physics2DState, type PhysicsBounds, type PhysicsCo
|
|
|
22
20
|
export { isoToScreen, screenToIso, TILE_WIDTH, TILE_HEIGHT, FLOOR_HEIGHT, DIAMOND_TOP_Y, FEATURE_COLORS, } from './utils/isometric';
|
|
23
21
|
export { inferDirection, resolveSheetDirection, getCurrentFrame, resolveFrame, createUnitAnimationState, transitionAnimation, tickAnimationState, } from './utils/spriteAnimation';
|
|
24
22
|
export { SPRITE_SHEET_LAYOUT, SHEET_COLUMNS } from './utils/spriteSheetConstants';
|
|
25
|
-
export { GameHud, type GameHudProps, type GameHudStat, type GameHudElement } from './GameHud';
|
|
26
|
-
export { GameMenu, type GameMenuProps, type MenuOption } from './GameMenu';
|
|
27
|
-
export { GameOverScreen, type GameOverScreenProps, type GameOverStat, type GameOverAction } from './GameOverScreen';
|
|
28
|
-
export { InventoryPanel, type InventoryPanelProps, type InventoryItem } from './InventoryPanel';
|
|
29
|
-
export { DialogueBox, type DialogueBoxProps, type DialogueNode, type DialogueChoice } from './DialogueBox';
|
|
30
23
|
export { BattleBoard, type BattleBoardProps, type BattlePhase, type BattleSlotContext, } from './BattleBoard';
|
|
31
24
|
export { UncontrolledBattleBoard, type UncontrolledBattleBoardProps, } from './UncontrolledBattleBoard';
|
|
32
25
|
export { useBattleState, type BattleStateEventConfig, type BattleStateCallbacks, type BattleStateResult, } from './hooks/useBattleState';
|
|
@@ -44,8 +37,6 @@ export * from './puzzles/builder';
|
|
|
44
37
|
export * from './puzzles/debugger';
|
|
45
38
|
export * from './puzzles/negotiator';
|
|
46
39
|
export * from './physics-sim';
|
|
47
|
-
export { CombatLog } from './CombatLog';
|
|
48
|
-
export type { CombatLogProps, CombatEvent, CombatLogEventType } from './CombatLog';
|
|
49
40
|
export { createInitialGameState, calculateValidMoves, calculateAttackTargets, } from './types/game';
|
|
50
41
|
export type { Position, GameUnit, UnitTrait, BoardTile, GamePhase, GameState, GameAction, } from './types/game';
|
|
51
42
|
export { combatAnimations, combatClasses, combatEffects, applyTemporaryEffect, calculateDamage, generateCombatMessage, } from './utils/combatEffects';
|
|
@@ -31,6 +31,8 @@ export interface IsometricTile {
|
|
|
31
31
|
tileType?: string;
|
|
32
32
|
/** Elevation offset for 3D rendering */
|
|
33
33
|
elevation?: number;
|
|
34
|
+
/** 3D model URL (GLB format) for GameCanvas3D — rendered via ModelLoader with box fallback */
|
|
35
|
+
modelUrl?: AssetUrl;
|
|
34
36
|
}
|
|
35
37
|
/** A unit positioned on the isometric grid */
|
|
36
38
|
export type IsometricUnit = {
|