@almadar/ui 5.107.0 → 5.109.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 (83) hide show
  1. package/dist/avl/index.cjs +1427 -2828
  2. package/dist/avl/index.js +525 -1926
  3. package/dist/components/core/atoms/Box.d.ts +2 -0
  4. package/dist/components/{game → core}/atoms/GameIcon.d.ts +1 -1
  5. package/dist/components/core/atoms/index.d.ts +1 -0
  6. package/dist/components/core/templates/index.d.ts +0 -1
  7. package/dist/components/game/molecules/index.d.ts +8 -28
  8. package/dist/components/index.cjs +223 -1691
  9. package/dist/components/index.js +213 -1671
  10. package/dist/lib/drawable/projector.d.ts +1 -1
  11. package/dist/{components/game/three/molecules/GameCanvas3D.d.ts → lib/drawable/three/Canvas3DHost.d.ts} +12 -9
  12. package/dist/lib/drawable/{Drawable3D.d.ts → three/Drawable3D.d.ts} +2 -2
  13. package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
  14. package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
  15. package/dist/{components/game → lib/drawable}/three/hooks/useGameCanvas3DEvents.d.ts +1 -1
  16. package/dist/{components/game → lib/drawable}/three/index.cjs +2019 -2020
  17. package/dist/{components/game → lib/drawable}/three/index.css +3 -3
  18. package/dist/lib/drawable/three/index.d.ts +39 -0
  19. package/dist/{components/game → lib/drawable}/three/index.js +1932 -1934
  20. package/dist/lib/drawable/{mesh3d.d.ts → three/mesh3d.d.ts} +4 -4
  21. package/dist/{components/game/lib → lib}/puzzleObject.d.ts +11 -2
  22. package/dist/marketing/index.d.cts +2 -0
  23. package/dist/{components/game/providers → providers}/GameAudioProvider.d.ts +1 -1
  24. package/dist/providers/index.cjs +1619 -2690
  25. package/dist/providers/index.d.ts +2 -0
  26. package/dist/providers/index.js +827 -1902
  27. package/dist/runtime/index.cjs +1288 -2689
  28. package/dist/runtime/index.js +505 -1906
  29. package/package.json +7 -7
  30. package/dist/components/game/atoms/ActionButton.d.ts +0 -31
  31. package/dist/components/game/atoms/ComboCounter.d.ts +0 -20
  32. package/dist/components/game/atoms/DamageNumber.d.ts +0 -18
  33. package/dist/components/game/atoms/GameCard.d.ts +0 -34
  34. package/dist/components/game/atoms/ItemSlot.d.ts +0 -31
  35. package/dist/components/game/atoms/ResourceCounter.d.ts +0 -26
  36. package/dist/components/game/atoms/Sprite.d.ts +0 -52
  37. package/dist/components/game/atoms/StatusEffect.d.ts +0 -25
  38. package/dist/components/game/atoms/TurnIndicator.d.ts +0 -22
  39. package/dist/components/game/atoms/WaypointMarker.d.ts +0 -23
  40. package/dist/components/game/molecules/EventLog.d.ts +0 -31
  41. package/dist/components/game/molecules/InventoryGrid.d.ts +0 -35
  42. package/dist/components/game/molecules/ObjectRulePanel.d.ts +0 -32
  43. package/dist/components/game/molecules/ResourceBar.d.ts +0 -26
  44. package/dist/components/game/molecules/RuleEditor.d.ts +0 -39
  45. package/dist/components/game/molecules/VariablePanel.d.ts +0 -28
  46. package/dist/components/game/templates/GameTemplate.d.ts +0 -35
  47. package/dist/components/game/three/atoms/SpriteBillboard3D.d.ts +0 -18
  48. package/dist/components/game/three/game3dTheme.d.ts +0 -55
  49. package/dist/components/game/three/index.d.ts +0 -12
  50. package/dist/components/game/three/lib/game3dAssetManifest.d.ts +0 -48
  51. package/dist/components/game/three/molecules/GameCamera3D.d.ts +0 -35
  52. package/dist/components/game/three/molecules/index.d.ts +0 -32
  53. package/dist/components/game/three/patterns.d.ts +0 -16
  54. /package/dist/{components/game/hooks → hooks}/useCamera.d.ts +0 -0
  55. /package/dist/{components/game/hooks → hooks}/useGameAudio.d.ts +0 -0
  56. /package/dist/{components/game/hooks → hooks}/useImageCache.d.ts +0 -0
  57. /package/dist/{components/game/hooks → hooks}/useUnitSpriteAtlas.d.ts +0 -0
  58. /package/dist/{components/game/lib → lib}/boardEntity.d.ts +0 -0
  59. /package/dist/{components/game/three/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
  60. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
  61. /package/dist/{components/game/three/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
  62. /package/dist/{components/game/three/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
  63. /package/dist/{components/game/three/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
  64. /package/dist/{components/game/three/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
  65. /package/dist/{components/game → lib/drawable}/three/hooks/useAssetLoader.d.ts +0 -0
  66. /package/dist/{components/game → lib/drawable}/three/hooks/useRaycaster.d.ts +0 -0
  67. /package/dist/{components/game → lib/drawable}/three/hooks/useSceneGraph.d.ts +0 -0
  68. /package/dist/{components/game → lib/drawable}/three/hooks/useThree.d.ts +0 -0
  69. /package/dist/{components/game → lib/drawable}/three/lib/AssetLoader.d.ts +0 -0
  70. /package/dist/{components/game → lib/drawable}/three/lib/culling.d.ts +0 -0
  71. /package/dist/{components/game → lib/drawable}/three/lib/grid3D.d.ts +0 -0
  72. /package/dist/{components/game/lib → lib}/editorUtils.d.ts +0 -0
  73. /package/dist/{components/game/lib → lib}/game.d.ts +0 -0
  74. /package/dist/{components/game/lib/index.d.ts → lib/gameShared.d.ts} +0 -0
  75. /package/dist/{components/game/lib → lib}/isometric.d.ts +0 -0
  76. /package/dist/{components/game/lib → lib}/isometricTypes.d.ts +0 -0
  77. /package/dist/{components/game/lib → lib}/makeAsset.d.ts +0 -0
  78. /package/dist/{components/game/lib → lib}/mechanics.d.ts +0 -0
  79. /package/dist/{components/game/lib → lib}/physicsPresets.d.ts +0 -0
  80. /package/dist/{components/game/lib → lib}/physicsTypes.d.ts +0 -0
  81. /package/dist/{components/game/lib → lib}/spriteAnimation.d.ts +0 -0
  82. /package/dist/{components/game/lib → lib}/spriteAnimationTypes.d.ts +0 -0
  83. /package/dist/{components/game/lib → lib}/spriteSheetConstants.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.107.0",
3
+ "version": "5.109.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -52,14 +52,14 @@
52
52
  "require": "./dist/lib/index.cjs"
53
53
  },
54
54
  "./components/organisms/game/three": {
55
- "types": "./dist/components/game/three/index.d.ts",
56
- "import": "./dist/components/game/three/index.js",
57
- "require": "./dist/components/game/three/index.cjs"
55
+ "types": "./dist/lib/drawable/three/index.d.ts",
56
+ "import": "./dist/lib/drawable/three/index.js",
57
+ "require": "./dist/lib/drawable/three/index.cjs"
58
58
  },
59
59
  "./components/molecules/game/three": {
60
- "types": "./dist/components/game/three/index.d.ts",
61
- "import": "./dist/components/game/three/index.js",
62
- "require": "./dist/components/game/three/index.cjs"
60
+ "types": "./dist/lib/drawable/three/index.d.ts",
61
+ "import": "./dist/lib/drawable/three/index.js",
62
+ "require": "./dist/lib/drawable/three/index.cjs"
63
63
  },
64
64
  "./components/organisms/game/TraitStateViewer": {
65
65
  "import": "./components/game/molecules/TraitStateViewer.tsx",
@@ -1,31 +0,0 @@
1
- import * as React from 'react';
2
- import { type IconInput } from '../../core/atoms/Icon';
3
- import type { Asset, EventKey } from '@almadar/core';
4
- export interface ActionButtonProps {
5
- /** Sprite asset — takes precedence over icon when provided */
6
- assetUrl?: Asset;
7
- /** Button label text */
8
- label: string;
9
- /** Icon displayed before the label */
10
- icon?: IconInput;
11
- /** Cooldown progress from 0 (ready) to 1 (full cooldown) */
12
- cooldown?: number;
13
- /** Whether the button is disabled */
14
- disabled?: boolean;
15
- /** Keyboard hotkey to display as a badge */
16
- hotkey?: string;
17
- /** Size variant */
18
- size?: 'sm' | 'md' | 'lg';
19
- /** Visual variant */
20
- variant?: 'primary' | 'secondary' | 'danger';
21
- /** Click handler */
22
- onClick?: () => void;
23
- /** Declarative event name — emits UI:{action} via eventBus on click */
24
- action?: EventKey;
25
- /** Additional CSS classes */
26
- className?: string;
27
- }
28
- export declare function ActionButton({ assetUrl, label, icon, cooldown, disabled, hotkey, size, variant, onClick, action, className, }: ActionButtonProps): React.JSX.Element;
29
- export declare namespace ActionButton {
30
- var displayName: string;
31
- }
@@ -1,20 +0,0 @@
1
- import * as React from 'react';
2
- import type { Asset } from '@almadar/core';
3
- export interface ComboCounterProps {
4
- /** Sprite asset displayed alongside the combo number */
5
- assetUrl?: Asset;
6
- /** Current combo count */
7
- combo: number;
8
- /** Score multiplier */
9
- multiplier?: number;
10
- /** Current streak */
11
- streak?: number;
12
- /** Size variant */
13
- size?: 'sm' | 'md' | 'lg';
14
- /** Additional CSS classes */
15
- className?: string;
16
- }
17
- export declare function ComboCounter({ assetUrl, combo, multiplier, streak, size, className, }: ComboCounterProps): React.JSX.Element | null;
18
- export declare namespace ComboCounter {
19
- var displayName: string;
20
- }
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import type { Asset } from '@almadar/core';
3
- export interface DamageNumberProps {
4
- /** Sprite asset — displayed as a hit-effect icon alongside the number */
5
- assetUrl?: Asset;
6
- /** The damage/heal value to display */
7
- value: number;
8
- /** Type of number display */
9
- type?: 'damage' | 'heal' | 'crit' | 'miss';
10
- /** Size variant */
11
- size?: 'sm' | 'md' | 'lg';
12
- /** Additional CSS classes */
13
- className?: string;
14
- }
15
- export declare function DamageNumber({ assetUrl, value, type, size, className, }: DamageNumberProps): React.JSX.Element;
16
- export declare namespace DamageNumber {
17
- var displayName: string;
18
- }
@@ -1,34 +0,0 @@
1
- import * as React from 'react';
2
- import type { Asset, EventEmit } from '@almadar/core';
3
- export interface GameCardProps {
4
- id: string;
5
- cost?: number;
6
- /** Card art asset */
7
- art?: Asset;
8
- /** Asset rendered as the card border/frame via backgroundImage; falls back to CSS border styling when absent. */
9
- frameAsset?: Asset;
10
- attack?: number;
11
- defense?: number;
12
- name?: string;
13
- selected?: boolean;
14
- disabled?: boolean;
15
- /** Size variant — controls card dimensions and art pixel size */
16
- size?: 'sm' | 'md' | 'lg';
17
- /**
18
- * One-shot pose LOLO drives on a transition (`DRAW`/`PLAY`), auto-reverted
19
- * to `'idle'` by a short tick — same idiom as `HealthBar.animated`, plain
20
- * CSS transform driven off a prop, no internal timer here.
21
- */
22
- animState?: 'idle' | 'drawn' | 'played' | 'flipped';
23
- /** Direct click callback */
24
- onClick?: (id: string) => void;
25
- /** Event-bus event emitted with `{ cardId }` on click */
26
- clickEvent?: EventEmit<{
27
- cardId: string;
28
- }>;
29
- className?: string;
30
- }
31
- export declare function GameCard({ id, cost, art, frameAsset, attack, defense, name, selected, disabled, size, animState, onClick, clickEvent, className, }: GameCardProps): React.JSX.Element;
32
- export declare namespace GameCard {
33
- var displayName: string;
34
- }
@@ -1,31 +0,0 @@
1
- import * as React from 'react';
2
- import { type IconInput } from '../../core/atoms/Icon';
3
- import type { Asset, EventKey } from '@almadar/core';
4
- export interface ItemSlotProps {
5
- /** Sprite asset — takes precedence over icon when provided */
6
- assetUrl?: Asset;
7
- /** Icon component or emoji — shown only when assetUrl is absent */
8
- icon?: IconInput;
9
- /** Item label */
10
- label?: string;
11
- /** Stack quantity */
12
- quantity?: number;
13
- /** Rarity tier affecting border color */
14
- rarity?: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
15
- /** Whether the slot is empty */
16
- empty?: boolean;
17
- /** Size variant */
18
- size?: 'sm' | 'md' | 'lg';
19
- /** Whether the slot is selected */
20
- selected?: boolean;
21
- /** Click handler */
22
- onClick?: () => void;
23
- /** Declarative event name — emits UI:{action} via eventBus on select */
24
- action?: EventKey;
25
- /** Additional CSS classes */
26
- className?: string;
27
- }
28
- export declare function ItemSlot({ assetUrl, icon, label, quantity, rarity, empty, size, selected, onClick, action, className, }: ItemSlotProps): React.JSX.Element;
29
- export declare namespace ItemSlot {
30
- var displayName: string;
31
- }
@@ -1,26 +0,0 @@
1
- import * as React from 'react';
2
- import type { ColorToken } from '../../core/atoms/types';
3
- import { type IconInput } from '../../core/atoms/Icon';
4
- import type { Asset } from '@almadar/core';
5
- export interface ResourceCounterProps {
6
- /** Sprite asset — takes precedence over icon when provided */
7
- assetUrl?: Asset;
8
- /** Icon component or emoji */
9
- icon?: IconInput;
10
- /** Resource label */
11
- label: string;
12
- /** Current value */
13
- value: number;
14
- /** Maximum value */
15
- max?: number;
16
- /** Semantic palette token or an arbitrary Tailwind color class. */
17
- color?: ColorToken | string;
18
- /** Size variant */
19
- size?: 'sm' | 'md' | 'lg';
20
- /** Additional CSS classes */
21
- className?: string;
22
- }
23
- export declare function ResourceCounter({ assetUrl, icon, label, value, max, color, size, className, }: ResourceCounterProps): React.JSX.Element;
24
- export declare namespace ResourceCounter {
25
- var displayName: string;
26
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Sprite Component
3
- *
4
- * Renders a single frame from a spritesheet with transform support.
5
- */
6
- import React from 'react';
7
- import type { EventKey, Asset } from "@almadar/core";
8
- import type { AnimationName } from '../lib/spriteAnimationTypes';
9
- export interface SpriteProps {
10
- /** Spritesheet asset */
11
- spritesheet: Asset;
12
- /** Width of each frame in pixels */
13
- frameWidth: number;
14
- /** Height of each frame in pixels */
15
- frameHeight: number;
16
- /** Frame index to display (0-based, left-to-right, top-to-bottom) */
17
- frame: number;
18
- /** X position in pixels */
19
- x: number;
20
- /** Y position in pixels */
21
- y: number;
22
- /** Scale factor (default: 1) */
23
- scale?: number;
24
- /** Flip horizontally */
25
- flipX?: boolean;
26
- /** Flip vertically */
27
- flipY?: boolean;
28
- /** Rotation in degrees */
29
- rotation?: number;
30
- /** Opacity (0-1) */
31
- opacity?: number;
32
- /** Z-index for layering */
33
- zIndex?: number;
34
- /** Number of columns in spritesheet (for frame calculation) */
35
- columns?: number;
36
- /** Animation state name — drives lolo-ui config knob for animation selection */
37
- animState?: AnimationName;
38
- /** Frames per second — drives lolo-ui config knob for animation speed */
39
- frameRate?: number;
40
- /** Optional className */
41
- className?: string;
42
- /** Optional onClick handler */
43
- onClick?: () => void;
44
- /** Declarative event name emitted on click via useEventBus */
45
- action?: EventKey;
46
- }
47
- export declare function Sprite({ spritesheet, frameWidth, frameHeight, frame, x, y, scale, flipX, flipY, rotation, opacity, zIndex, columns, animState: _animState, frameRate: _frameRate, className, onClick, action, }: SpriteProps): React.JSX.Element;
48
- /**
49
- * Canvas-based sprite renderer for better performance in game loops
50
- */
51
- export declare function drawSprite(ctx: CanvasRenderingContext2D, image: HTMLImageElement, props: Omit<SpriteProps, 'spritesheet' | 'className' | 'onClick'>): void;
52
- export default Sprite;
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { type IconInput } from '../../core/atoms/Icon';
3
- import type { Asset } from '@almadar/core';
4
- export interface StatusEffectProps {
5
- /** Sprite asset — takes precedence over icon when provided */
6
- assetUrl?: Asset;
7
- /** Lucide icon name or component */
8
- icon?: IconInput;
9
- /** Label describing the effect */
10
- label?: string;
11
- /** Remaining duration in seconds */
12
- duration?: number;
13
- /** Number of stacks */
14
- stacks?: number;
15
- /** Effect type */
16
- variant?: 'buff' | 'debuff' | 'neutral';
17
- /** Size variant */
18
- size?: 'sm' | 'md' | 'lg';
19
- /** Additional CSS classes */
20
- className?: string;
21
- }
22
- export declare function StatusEffect({ assetUrl, icon, label, duration, stacks, variant, size, className, }: StatusEffectProps): React.JSX.Element;
23
- export declare namespace StatusEffect {
24
- var displayName: string;
25
- }
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- import type { Asset } from '@almadar/core';
3
- export interface TurnIndicatorProps {
4
- /** Sprite asset — takes precedence over the dot indicator when provided */
5
- assetUrl?: Asset;
6
- /** Current turn number */
7
- currentTurn: number;
8
- /** Maximum number of turns */
9
- maxTurns?: number;
10
- /** Name of the active team */
11
- activeTeam?: string;
12
- /** Current phase label */
13
- phase?: string;
14
- /** Size variant */
15
- size?: 'sm' | 'md' | 'lg';
16
- /** Additional CSS classes */
17
- className?: string;
18
- }
19
- export declare function TurnIndicator({ assetUrl, currentTurn, maxTurns, activeTeam, phase, size, className, }: TurnIndicatorProps): React.JSX.Element;
20
- export declare namespace TurnIndicator {
21
- var displayName: string;
22
- }
@@ -1,23 +0,0 @@
1
- import * as React from 'react';
2
- import { type IconInput } from '../../core/atoms/Icon';
3
- import type { Asset } from '@almadar/core';
4
- export interface WaypointMarkerProps {
5
- /** Sprite asset — takes precedence over icon when provided */
6
- assetUrl?: Asset;
7
- /** Label text below the marker */
8
- label?: string;
9
- /** Custom icon to render inside the marker */
10
- icon?: IconInput;
11
- /** Whether this waypoint is currently active */
12
- active?: boolean;
13
- /** Whether this waypoint has been completed */
14
- completed?: boolean;
15
- /** Size variant */
16
- size?: 'sm' | 'md' | 'lg';
17
- /** Additional CSS classes */
18
- className?: string;
19
- }
20
- export declare function WaypointMarker({ assetUrl, label, icon, active, completed, size, className, }: WaypointMarkerProps): React.JSX.Element;
21
- export declare namespace WaypointMarker {
22
- var displayName: string;
23
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * EventLog Component
3
- *
4
- * Scrolling log of events during playback in the Event Handler tier.
5
- * Shows the chain reaction as events cascade through objects.
6
- *
7
- * @packageDocumentation
8
- */
9
- import React from 'react';
10
- export interface EventLogEntry {
11
- id: string;
12
- timestamp: number;
13
- icon: string;
14
- message: string;
15
- status: 'pending' | 'active' | 'done' | 'error';
16
- }
17
- export interface EventLogProps {
18
- /** Log entries */
19
- entries: EventLogEntry[];
20
- /** Max visible height before scroll */
21
- maxHeight?: number;
22
- /** Title label */
23
- label?: string;
24
- /** Additional CSS classes */
25
- className?: string;
26
- }
27
- export declare function EventLog({ entries, maxHeight, label, className, }: EventLogProps): React.JSX.Element;
28
- export declare namespace EventLog {
29
- var displayName: string;
30
- }
31
- export default EventLog;
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import type { EventEmit, Asset } from '@almadar/core';
3
- import type { IconInput } from '../../core/atoms/index';
4
- export interface InventoryGridItem {
5
- id: string;
6
- icon?: IconInput;
7
- assetUrl?: Asset;
8
- label?: string;
9
- quantity?: number;
10
- rarity?: 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary';
11
- }
12
- export interface InventoryGridProps {
13
- /** Array of items to display in the grid */
14
- items: InventoryGridItem[];
15
- /** Number of columns in the grid */
16
- columns?: number;
17
- /** Total number of slots (empty slots fill remaining space) */
18
- totalSlots?: number;
19
- /** Currently selected item ID */
20
- selectedId?: string;
21
- /** Callback when an item is selected */
22
- onSelect?: (id: string) => void;
23
- /** Event bus event name for selection */
24
- selectEvent?: EventEmit<{
25
- id: string;
26
- }>;
27
- /** Size variant for all item slots */
28
- size?: 'sm' | 'md' | 'lg';
29
- /** Additional CSS classes */
30
- className?: string;
31
- }
32
- export declare function InventoryGrid({ items, columns, totalSlots, selectedId, onSelect, selectEvent, size, className, }: InventoryGridProps): React.JSX.Element;
33
- export declare namespace InventoryGrid {
34
- var displayName: string;
35
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * ObjectRulePanel Component
3
- *
4
- * Shows the rules panel for a selected world object in the Event Handler tier.
5
- * Displays object info, its current state (via TraitStateViewer), and
6
- * a list of WHEN/THEN rules the kid has set.
7
- *
8
- * @packageDocumentation
9
- */
10
- import React from 'react';
11
- import type { EntityRow, EventEmit } from '@almadar/core';
12
- import { type RuleDefinition } from './RuleEditor';
13
- export interface ObjectRulePanelProps {
14
- /** The selected puzzle-object row (`EntityRow` carrying the editable object data) */
15
- object: EntityRow;
16
- /** Called when rules change (callback path) */
17
- onRulesChange?: (objectId: string, rules: RuleDefinition[]) => void;
18
- /** Emits UI:{rulesChangeEvent} with { objectId, rules } when rules change (declarative path) */
19
- rulesChangeEvent?: EventEmit<{
20
- objectId: string;
21
- rules: RuleDefinition[];
22
- }>;
23
- /** Whether editing is disabled */
24
- disabled?: boolean;
25
- /** Additional CSS classes */
26
- className?: string;
27
- }
28
- export declare function ObjectRulePanel({ object, onRulesChange, rulesChangeEvent, disabled, className, }: ObjectRulePanelProps): React.JSX.Element;
29
- export declare namespace ObjectRulePanel {
30
- var displayName: string;
31
- }
32
- export default ObjectRulePanel;
@@ -1,26 +0,0 @@
1
- import * as React from 'react';
2
- import type { Asset } from '@almadar/core';
3
- import type { IconInput } from '../../core/atoms/index';
4
- export interface ResourceBarResource {
5
- /** Icon for the resource */
6
- icon?: IconInput;
7
- assetUrl?: Asset;
8
- /** Resource name */
9
- label: string;
10
- /** Current amount */
11
- value?: number;
12
- /** Maximum amount (displays as bar if provided) */
13
- max?: number;
14
- }
15
- export interface ResourceBarProps {
16
- /** Resources to display */
17
- resources: ResourceBarResource[];
18
- /** Size variant */
19
- size?: 'sm' | 'md' | 'lg';
20
- /** Additional CSS classes */
21
- className?: string;
22
- }
23
- export declare function ResourceBar({ resources, size, className, }: ResourceBarProps): React.JSX.Element;
24
- export declare namespace ResourceBar {
25
- var displayName: string;
26
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * RuleEditor Component
3
- *
4
- * A single WHEN/THEN rule row for the Event Handler tier (ages 9-12).
5
- * Kid picks an event trigger and an action from dropdowns.
6
- *
7
- * @packageDocumentation
8
- */
9
- import React from 'react';
10
- export type RuleDefinition = {
11
- id: string;
12
- whenEvent: string;
13
- thenAction: string;
14
- };
15
- export interface RuleOption {
16
- value: string;
17
- label: string;
18
- }
19
- export interface RuleEditorProps {
20
- /** The current rule */
21
- rule: RuleDefinition;
22
- /** Available event triggers to listen for */
23
- availableEvents: RuleOption[];
24
- /** Available actions to perform */
25
- availableActions: RuleOption[];
26
- /** Called when rule changes */
27
- onChange: (rule: RuleDefinition) => void;
28
- /** Called when rule is removed */
29
- onRemove?: () => void;
30
- /** Whether editing is disabled (during playback) */
31
- disabled?: boolean;
32
- /** Additional CSS classes */
33
- className?: string;
34
- }
35
- export declare function RuleEditor({ rule, availableEvents, availableActions, onChange, onRemove, disabled, className, }: RuleEditorProps): React.JSX.Element;
36
- export declare namespace RuleEditor {
37
- var displayName: string;
38
- }
39
- export default RuleEditor;
@@ -1,28 +0,0 @@
1
- /**
2
- * VariablePanel Component
3
- *
4
- * Shows a machine's variables and their current values during State Architect
5
- * playback. Dumb molecule: takes a plain typed list of { name, value } — the
6
- * .lolo organism owns the entity data and passes it already flattened.
7
- *
8
- * @packageDocumentation
9
- */
10
- import React from 'react';
11
- /** A single variable row (already flattened by the .lolo — plain strings). */
12
- export interface VariablePanelVariable {
13
- name: string;
14
- value: string;
15
- }
16
- export interface VariablePanelProps {
17
- /** Entity name shown in the header */
18
- entityName: string;
19
- /** Variable rows to display */
20
- variables: VariablePanelVariable[];
21
- /** Additional CSS classes */
22
- className?: string;
23
- }
24
- export declare function VariablePanel({ entityName, variables, className, }: VariablePanelProps): React.JSX.Element;
25
- export declare namespace VariablePanel {
26
- var displayName: string;
27
- }
28
- export default VariablePanel;
@@ -1,35 +0,0 @@
1
- /**
2
- * GameTemplate
3
- *
4
- * A presentational template for game applications.
5
- * Includes a main game canvas/area, HUD overlay, and an optional debug sidebar.
6
- * **Atomic Design**: Composed using Box, Typography, and Layout molecules/atoms.
7
- */
8
- import React from "react";
9
- import type { Asset } from "@almadar/core";
10
- import type { TemplateProps } from "../../core/templates/types";
11
- export interface GameControls {
12
- onPlay?: () => void;
13
- onPause?: () => void;
14
- onReset?: () => void;
15
- isPlaying?: boolean;
16
- }
17
- export interface GameTemplateProps extends TemplateProps {
18
- /** Title of the game */
19
- title?: string;
20
- /** The main game canvas or content */
21
- children: React.ReactNode;
22
- /** HUD overlay content (scores, health, etc.) */
23
- hud?: React.ReactNode;
24
- /** Debug panel content */
25
- debugPanel?: React.ReactNode;
26
- /** Whether the debug panel is visible */
27
- showDebugPanel?: boolean;
28
- /** Game controls */
29
- controls?: GameControls;
30
- /** Additional class name */
31
- className?: string;
32
- /** Background image for the canvas area. Falls back to bg-muted flat color. */
33
- backgroundAsset?: Asset;
34
- }
35
- export declare const GameTemplate: React.FC<GameTemplateProps>;
@@ -1,18 +0,0 @@
1
- /**
2
- * SpriteBillboard3D
3
- *
4
- * Billboarded sprite-sheet plane for a unit. Loads the atlas's PNG sheet as a
5
- * texture and crops a SINGLE frame via UV `repeat`/`offset`, advancing per
6
- * animation state. Mirrors the 2D canvas: one frame, never the whole sheet.
7
- *
8
- * @packageDocumentation
9
- */
10
- import React from 'react';
11
- import type { ResolvedFrame } from '../../lib/spriteAnimationTypes';
12
- export interface SpriteBillboard3DProps {
13
- sheetUrl: string;
14
- resolveFrame: () => ResolvedFrame | null;
15
- height?: number;
16
- }
17
- export declare function SpriteBillboard3D({ sheetUrl, resolveFrame, height, }: SpriteBillboard3DProps): React.JSX.Element | null;
18
- export default SpriteBillboard3D;
@@ -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,12 +0,0 @@
1
- /**
2
- * Game 3D (three.js) — public code-split barrel.
3
- *
4
- * Published behind the `@almadar/ui/components/{molecules,organisms}/game/three`
5
- * subpath only, NEVER from the main `components/index.ts` barrel — re-exporting
6
- * it there would statically pull @react-three/fiber into every app's bundle.
7
- * The component registry lazy-imports this barrel so the 3D family stays a
8
- * dynamic, code-split chunk.
9
- *
10
- * @packageDocumentation
11
- */
12
- export * from './molecules';