@almadar/ui 5.91.0 → 5.93.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.
@@ -8,10 +8,18 @@ export interface DialogueBubbleProps {
8
8
  portrait?: Asset;
9
9
  /** Position of the bubble on screen */
10
10
  position?: 'top' | 'bottom';
11
+ /** Speaker mood — drives a portrait-ring accent; LOLO sets this per dialogue node/transition. */
12
+ mood?: 'neutral' | 'happy' | 'concerned' | 'angry';
13
+ /**
14
+ * Number of `text` characters to reveal (typewriter effect). Omit to show
15
+ * the full string — LOLO drives this from `@entity.revealedChars` via a
16
+ * tick, incrementing it until it reaches `text.length`.
17
+ */
18
+ revealedChars?: number;
11
19
  /** Additional CSS classes */
12
20
  className?: string;
13
21
  }
14
- export declare function DialogueBubble({ speaker, text, portrait, position, className, }: DialogueBubbleProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function DialogueBubble({ speaker, text, portrait, position, mood, revealedChars, className, }: DialogueBubbleProps): import("react/jsx-runtime").JSX.Element;
15
23
  export declare namespace DialogueBubble {
16
24
  var displayName: string;
17
25
  }
@@ -14,6 +14,12 @@ export interface GameCardProps {
14
14
  disabled?: boolean;
15
15
  /** Size variant — controls card dimensions and art pixel size */
16
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';
17
23
  /** Direct click callback */
18
24
  onClick?: (id: string) => void;
19
25
  /** Event-bus event emitted with `{ cardId }` on click */
@@ -22,7 +28,7 @@ export interface GameCardProps {
22
28
  }>;
23
29
  className?: string;
24
30
  }
25
- export declare function GameCard({ id, cost, art, frameAsset, attack, defense, name, selected, disabled, size, onClick, clickEvent, className, }: GameCardProps): React.JSX.Element;
31
+ export declare function GameCard({ id, cost, art, frameAsset, attack, defense, name, selected, disabled, size, animState, onClick, clickEvent, className, }: GameCardProps): React.JSX.Element;
26
32
  export declare namespace GameCard {
27
33
  var displayName: string;
28
34
  }
@@ -118,6 +118,14 @@ export interface Canvas2DProps {
118
118
  animate?: {
119
119
  fps: number;
120
120
  };
121
+ /**
122
+ * Opt-in: smooth-interpolate unit positions between LOLO tick snapshots
123
+ * via a `requestAnimationFrame` loop (same fixed-timestep technique
124
+ * `SideView` already uses for the player), instead of the default
125
+ * tick-rate-cadence redraw. DEFAULT OFF — for continuous-movement boards
126
+ * only; tile-snapped boards see no behavior change.
127
+ */
128
+ interpolateUnits?: boolean;
121
129
  /** Show debug grid lines and coordinates. */
122
130
  debug?: boolean;
123
131
  /** Ratio of unit draw height to scaledFloorHeight. Default 1.5. */
@@ -155,7 +163,7 @@ export interface Canvas2DProps {
155
163
  effects?: Record<string, Asset>;
156
164
  };
157
165
  }
158
- export declare function Canvas2D({ className, isLoading, error, projection, tiles: _tilesPropRaw, units: _unitsPropRaw, features: _featuresPropRaw, effects: _effectsPropRaw, platforms, player, backgroundImage, selectedUnitId, validMoves, attackTargets, hoveredTile, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, keyMap, keyUpMap, camera, scale, unitScale, showMinimap, animate, debug, spriteHeightRatio, spriteMaxWidthRatio, diamondTopY: diamondTopYProp, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, playerSprite, tileSprites, bgColor, worldWidth, worldHeight, assetManifest, }: Canvas2DProps): React.JSX.Element;
166
+ export declare function Canvas2D({ className, isLoading, error, projection, tiles: _tilesPropRaw, units: _unitsPropRaw, features: _featuresPropRaw, effects: _effectsPropRaw, platforms, player, backgroundImage, selectedUnitId, validMoves, attackTargets, hoveredTile, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, keyMap, keyUpMap, camera, scale, unitScale, showMinimap, animate, interpolateUnits, debug, spriteHeightRatio, spriteMaxWidthRatio, diamondTopY: diamondTopYProp, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, playerSprite, tileSprites, bgColor, worldWidth, worldHeight, assetManifest, }: Canvas2DProps): React.JSX.Element;
159
167
  export declare namespace Canvas2D {
160
168
  var displayName: string;
161
169
  }
@@ -8,16 +8,26 @@
8
8
  * @packageDocumentation
9
9
  */
10
10
  import React from 'react';
11
- import type { SlotItemData } from '../molecules/TraitSlot';
11
+ import type { EventEmit } from '@almadar/core';
12
+ import type { SlotItemData } from './TraitSlot';
12
13
  export interface SequenceBarProps {
13
14
  /** The current sequence (sparse — undefined means empty slot) */
14
15
  slots: Array<SlotItemData | undefined>;
15
16
  /** Max number of slots */
16
17
  maxSlots: number;
17
- /** Called when an item is dropped into slot at index */
18
- onSlotDrop: (index: number, item: SlotItemData) => void;
19
- /** Called when a slot is cleared */
20
- onSlotRemove: (index: number) => void;
18
+ /** Called when an item is dropped into slot at index (callback path) */
19
+ onSlotDrop?: (index: number, item: SlotItemData) => void;
20
+ /** Called when a slot is cleared (callback path) */
21
+ onSlotRemove?: (index: number) => void;
22
+ /** Emits UI:{slotDropEvent} with { slotNumber, itemId } when an item is dropped (declarative path) */
23
+ slotDropEvent?: EventEmit<{
24
+ slotNumber: number;
25
+ itemId: string;
26
+ }>;
27
+ /** Emits UI:{slotRemoveEvent} with { slotNumber } when a slot is cleared (declarative path) */
28
+ slotRemoveEvent?: EventEmit<{
29
+ slotNumber: number;
30
+ }>;
21
31
  /** Whether the sequence is currently playing (disable interaction) */
22
32
  playing?: boolean;
23
33
  /** Current step index during playback (-1 = not playing) */
@@ -34,7 +44,7 @@ export interface SequenceBarProps {
34
44
  /** Additional CSS classes */
35
45
  className?: string;
36
46
  }
37
- export declare function SequenceBar({ slots, maxSlots, onSlotDrop, onSlotRemove, playing, currentStep, categoryColors, slotFeedback, size, className, }: SequenceBarProps): React.JSX.Element;
47
+ export declare function SequenceBar({ slots, maxSlots, onSlotDrop, onSlotRemove, slotDropEvent, slotRemoveEvent, playing, currentStep, categoryColors, slotFeedback, size, className, }: SequenceBarProps): React.JSX.Element;
38
48
  export declare namespace SequenceBar {
39
49
  var displayName: string;
40
50
  }
@@ -44,7 +44,7 @@ export { TraitSlot, type TraitSlotProps, type SlotItemData, } from './TraitSlot'
44
44
  export { CollapsibleSection, EditorSlider, EditorSelect, EditorCheckbox, EditorTextInput, StatusBar, TerrainPalette, EditorToolbar, TERRAIN_COLORS, FEATURE_TYPES, type EditorMode, type CollapsibleSectionProps, type EditorSliderProps, type EditorSelectProps, type EditorCheckboxProps, type EditorTextInputProps, type StatusBarProps, type TerrainPaletteProps, type EditorToolbarProps, } from '../../shared/lib/editorUtils';
45
45
  export { ActionTile, type ActionTileProps } from './ActionTile';
46
46
  export { ActionPalette, type ActionPaletteProps } from './ActionPalette';
47
- export { SequenceBar, type SequenceBarProps } from '../organisms/SequenceBar';
47
+ export { SequenceBar, type SequenceBarProps } from './SequenceBar';
48
48
  export { SequencerBoard, type SequencerBoardProps } from '../organisms/SequencerBoard';
49
49
  export { RuleEditor, type RuleEditorProps, type RuleDefinition } from './RuleEditor';
50
50
  export { EventLog, type EventLogProps, type EventLogEntry } from './EventLog';
@@ -61,10 +61,6 @@ export { ClassifierBoard, type ClassifierBoardProps, type ClassifierItem, type C
61
61
  export { BuilderBoard, type BuilderBoardProps, type BuilderComponent, type BuilderSlot } from '../organisms/BuilderBoard';
62
62
  export { DebuggerBoard, type DebuggerBoardProps, type DebuggerLine } from '../organisms/DebuggerBoard';
63
63
  export { NegotiatorBoard, type NegotiatorBoardProps, type NegotiatorAction, type PayoffEntry } from '../organisms/NegotiatorBoard';
64
- export { SimulationCanvas, type SimulationCanvasProps } from '../organisms/SimulationCanvas';
65
- export { SimulationControls, type SimulationControlsProps } from '../organisms/SimulationControls';
66
- export { SimulationGraph, type SimulationGraphProps, type MeasurementPoint } from '../organisms/SimulationGraph';
67
- export type { PhysicsPreset, PhysicsBody, PhysicsConstraint } from '../../shared/lib/physicsTypes';
68
64
  export { projectileMotion, pendulum, springOscillator, ALL_PRESETS } from '../../shared/lib/physicsPresets';
69
65
  export { GameTemplate, type GameTemplateProps } from '../templates/GameTemplate';
70
66
  export { GameShell, type GameShellProps } from '../templates/GameShell';
@@ -4,25 +4,17 @@
4
4
  * Type definitions for frame-based sprite sheet animation system.
5
5
  * Supports standard 8-column × 5-row character sheets.
6
6
  *
7
+ * `AnimationName`, `AnimationDef`, and `SpriteDirection` are canonically owned
8
+ * by `@almadar/core` (they travel with a `spriteSheet`-role `Asset.url`'s
9
+ * resolved atlas contract) — re-exported here so existing call sites in this
10
+ * package don't need to change their import path.
11
+ *
7
12
  * @packageDocumentation
8
13
  */
9
- /** Animation names matching sprite sheet row layout */
10
- export type AnimationName = 'idle' | 'walk' | 'attack' | 'hit' | 'death';
11
- /** Sheet file directions (physical PNG files) */
12
- export type SpriteDirection = 'se' | 'sw';
14
+ import type { AnimationName } from '@almadar/core';
15
+ export type { AnimationName, AnimationDef, SpriteDirection } from '@almadar/core';
13
16
  /** Unit facing direction on screen (4 isometric directions) */
14
17
  export type FacingDirection = 'se' | 'sw' | 'ne' | 'nw';
15
- /** Definition for a single animation row in the sprite sheet */
16
- export interface AnimationDef {
17
- /** Row index in the sprite sheet (0-4) */
18
- row: number;
19
- /** Number of frames in this animation */
20
- frames: number;
21
- /** Frames per second */
22
- frameRate: number;
23
- /** Whether the animation loops */
24
- loop: boolean;
25
- }
26
18
  /** A resolved frame ready to draw on canvas */
27
19
  export interface ResolvedFrame {
28
20
  /** URL of the sprite sheet image */
@@ -74,24 +66,7 @@ export interface SpriteSheetUrls {
74
66
  /**
75
67
  * Parsed sprite-sheet atlas JSON (e.g. `guardian-sprite-sheet.json`).
76
68
  * Sits next to the `.png` sheets and drives the frame rect deterministically.
69
+ * Canonically `@almadar/core`'s `SpriteSheetAtlas` — re-exported under this
70
+ * package's existing name so call sites don't need to change.
77
71
  */
78
- export interface SpriteAtlas {
79
- /** Unit archetype key */
80
- unit?: string;
81
- /** Visual type key */
82
- type?: string;
83
- /** Width of a single frame in pixels */
84
- frameWidth: number;
85
- /** Height of a single frame in pixels */
86
- frameHeight: number;
87
- /** Number of columns (frames per row) */
88
- columns: number;
89
- /** Number of rows (animations) */
90
- rows: number;
91
- /** Directions present as physical PNG files */
92
- directions: SpriteDirection[];
93
- /** Relative PNG sheet paths per direction */
94
- sheets: Partial<Record<SpriteDirection, string>>;
95
- /** Animation row layout keyed by animation name */
96
- animations: Partial<Record<AnimationName, AnimationDef>>;
97
- }
72
+ export type { SpriteSheetAtlas as SpriteAtlas } from '@almadar/core';