@almadar/ui 5.89.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.
- package/dist/avl/index.cjs +1350 -1562
- package/dist/avl/index.js +353 -565
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +9 -1
- package/dist/components/game/2d/atoms/GameCard.d.ts +7 -1
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +9 -1
- package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
- package/dist/components/game/2d/{organisms → molecules}/SequenceBar.d.ts +15 -5
- package/dist/components/game/2d/molecules/StateJsonView.d.ts +37 -0
- package/dist/components/game/2d/{organisms → molecules}/TraitSlot.d.ts +6 -3
- package/dist/components/game/2d/{organisms → molecules}/TraitStateViewer.d.ts +0 -2
- package/dist/components/game/2d/molecules/VariablePanel.d.ts +28 -0
- package/dist/components/game/2d/molecules/index.d.ts +12 -16
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
- package/dist/components/game/shared/spriteAnimationTypes.d.ts +10 -35
- package/dist/components/index.cjs +121 -420
- package/dist/components/index.js +123 -419
- package/dist/lib/verificationRegistry.d.ts +1 -1
- package/dist/providers/index.cjs +1214 -1398
- package/dist/providers/index.js +324 -508
- package/dist/runtime/index.cjs +1211 -1423
- package/dist/runtime/index.js +333 -545
- package/package.json +3 -3
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +0 -27
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +0 -51
- package/dist/components/game/2d/organisms/SimulationGraph.d.ts +0 -25
- package/dist/components/game/2d/organisms/StateJsonView.d.ts +0 -17
- package/dist/components/game/2d/organisms/VariablePanel.d.ts +0 -22
- /package/dist/components/game/2d/{organisms → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/ActionTile.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/EventLog.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/RuleEditor.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/StateNode.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/TransitionArrow.d.ts +0 -0
|
@@ -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,19 +8,24 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import type { EntityRow } from '@almadar/core';
|
|
11
|
+
import type { EntityRow, EventEmit } from '@almadar/core';
|
|
12
12
|
import { type RuleDefinition } from './RuleEditor';
|
|
13
13
|
export interface ObjectRulePanelProps {
|
|
14
14
|
/** The selected puzzle-object row (`EntityRow` carrying the editable object data) */
|
|
15
15
|
object: EntityRow;
|
|
16
|
-
/** Called when rules change */
|
|
17
|
-
onRulesChange
|
|
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
|
+
}>;
|
|
18
23
|
/** Whether editing is disabled */
|
|
19
24
|
disabled?: boolean;
|
|
20
25
|
/** Additional CSS classes */
|
|
21
26
|
className?: string;
|
|
22
27
|
}
|
|
23
|
-
export declare function ObjectRulePanel({ object, onRulesChange, disabled, className, }: ObjectRulePanelProps): React.JSX.Element;
|
|
28
|
+
export declare function ObjectRulePanel({ object, onRulesChange, rulesChangeEvent, disabled, className, }: ObjectRulePanelProps): React.JSX.Element;
|
|
24
29
|
export declare namespace ObjectRulePanel {
|
|
25
30
|
var displayName: string;
|
|
26
31
|
}
|
|
@@ -8,16 +8,26 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
+
import type { EventEmit } from '@almadar/core';
|
|
11
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
|
|
19
|
-
/** Called when a slot is cleared */
|
|
20
|
-
onSlotRemove
|
|
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
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StateJsonView Component
|
|
3
|
+
*
|
|
4
|
+
* Shows a state machine's definition as an expandable code block, so the learner
|
|
5
|
+
* sees the declarative schema behind the visual graph. Dumb molecule: takes the
|
|
6
|
+
* machine as plain typed fields (name/states/initialState/transitions) — the
|
|
7
|
+
* .lolo organism owns the entity and the molecule renders + stringifies it.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export interface StateJsonTransition {
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
event: string;
|
|
16
|
+
}
|
|
17
|
+
export interface StateJsonViewProps {
|
|
18
|
+
/** Machine name */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Initial state */
|
|
21
|
+
initialState: string;
|
|
22
|
+
/** All state names */
|
|
23
|
+
states: string[];
|
|
24
|
+
/** The player's wired transitions */
|
|
25
|
+
transitions: StateJsonTransition[];
|
|
26
|
+
/** Header label */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Whether the code block is expanded by default */
|
|
29
|
+
defaultExpanded?: boolean;
|
|
30
|
+
/** Additional CSS classes */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function StateJsonView({ name, initialState, states, transitions, label, defaultExpanded, className, }: StateJsonViewProps): React.JSX.Element;
|
|
34
|
+
export declare namespace StateJsonView {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
37
|
+
export default StateJsonView;
|
|
@@ -66,8 +66,6 @@ export interface TraitSlotProps {
|
|
|
66
66
|
isLoading?: boolean;
|
|
67
67
|
/** Error state */
|
|
68
68
|
error?: UiError | null;
|
|
69
|
-
/** Entity name for schema-driven auto-fetch */
|
|
70
|
-
entity?: string;
|
|
71
69
|
/** Called when an item is dropped on this slot */
|
|
72
70
|
onItemDrop?: (item: SlotItemData) => void;
|
|
73
71
|
/** Whether this slot's equipped item is draggable */
|
|
@@ -88,8 +86,13 @@ export interface TraitSlotProps {
|
|
|
88
86
|
removeEvent?: EventEmit<{
|
|
89
87
|
slotNumber: number;
|
|
90
88
|
}>;
|
|
89
|
+
/** Emits UI:{dropEvent} with { slotNumber, itemId } when an item is dropped into this slot */
|
|
90
|
+
dropEvent?: EventEmit<{
|
|
91
|
+
slotNumber: number;
|
|
92
|
+
itemId: string;
|
|
93
|
+
}>;
|
|
91
94
|
}
|
|
92
|
-
export declare function TraitSlot({ slotNumber, equippedItem, locked, lockLabel, selected, size, showTooltip, categoryColors, tooltipFrameUrl, className, feedback, onItemDrop, draggable, onDragStart, onClick, onRemove, clickEvent, removeEvent, }: TraitSlotProps): React.JSX.Element;
|
|
95
|
+
export declare function TraitSlot({ slotNumber, equippedItem, locked, lockLabel, selected, size, showTooltip, categoryColors, tooltipFrameUrl, className, feedback, onItemDrop, draggable, onDragStart, onClick, onRemove, clickEvent, removeEvent, dropEvent, }: TraitSlotProps): React.JSX.Element;
|
|
93
96
|
export declare namespace TraitSlot {
|
|
94
97
|
var displayName: string;
|
|
95
98
|
}
|
|
@@ -44,8 +44,6 @@ export interface TraitStateViewerProps {
|
|
|
44
44
|
isLoading?: boolean;
|
|
45
45
|
/** Error state */
|
|
46
46
|
error?: UiError | null;
|
|
47
|
-
/** Entity name for schema-driven auto-fetch */
|
|
48
|
-
entity?: string;
|
|
49
47
|
}
|
|
50
48
|
export declare function TraitStateViewer({ trait, variant, size, showTransitions, onStateClick, stateStyles, className, }: TraitStateViewerProps): React.JSX.Element;
|
|
51
49
|
export declare namespace TraitStateViewer {
|
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -39,32 +39,28 @@ export { GameAudioProvider, GameAudioContext, useGameAudioContext, type GameAudi
|
|
|
39
39
|
export { GameAudioToggle, type GameAudioToggleProps, } from '../atoms/GameAudioToggle';
|
|
40
40
|
export { useGameAudio, type AudioManifest, type SoundEntry, type GameAudioControls, type UseGameAudioOptions, } from '../../shared/hooks/useGameAudio';
|
|
41
41
|
export { useCamera } from '../../shared/hooks/useCamera';
|
|
42
|
-
export { TraitStateViewer, type TraitStateViewerProps, type TraitStateMachineDefinition, type TraitTransition, } from '
|
|
43
|
-
export { TraitSlot, type TraitSlotProps, type SlotItemData, } from '
|
|
42
|
+
export { TraitStateViewer, type TraitStateViewerProps, type TraitStateMachineDefinition, type TraitTransition, } from './TraitStateViewer';
|
|
43
|
+
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
|
-
export { ActionTile, type ActionTileProps } from '
|
|
46
|
-
export { ActionPalette, type ActionPaletteProps } from '
|
|
47
|
-
export { SequenceBar, type SequenceBarProps } from '
|
|
45
|
+
export { ActionTile, type ActionTileProps } from './ActionTile';
|
|
46
|
+
export { ActionPalette, type ActionPaletteProps } from './ActionPalette';
|
|
47
|
+
export { SequenceBar, type SequenceBarProps } from './SequenceBar';
|
|
48
48
|
export { SequencerBoard, type SequencerBoardProps } from '../organisms/SequencerBoard';
|
|
49
|
-
export { RuleEditor, type RuleEditorProps, type RuleDefinition } from '
|
|
50
|
-
export { EventLog, type EventLogProps, type EventLogEntry } from '
|
|
51
|
-
export { ObjectRulePanel, type ObjectRulePanelProps } from '
|
|
49
|
+
export { RuleEditor, type RuleEditorProps, type RuleDefinition } from './RuleEditor';
|
|
50
|
+
export { EventLog, type EventLogProps, type EventLogEntry } from './EventLog';
|
|
51
|
+
export { ObjectRulePanel, type ObjectRulePanelProps } from './ObjectRulePanel';
|
|
52
52
|
export { EventHandlerBoard, type EventHandlerBoardProps } from '../organisms/EventHandlerBoard';
|
|
53
53
|
export * from '../../shared/lib/puzzleObject';
|
|
54
|
-
export { StateNode, type StateNodeProps } from '
|
|
55
|
-
export { TransitionArrow, type TransitionArrowProps } from '
|
|
56
|
-
export { VariablePanel, type VariablePanelProps } from '
|
|
57
|
-
export { StateJsonView, type StateJsonViewProps } from '
|
|
54
|
+
export { StateNode, type StateNodeProps } from './StateNode';
|
|
55
|
+
export { TransitionArrow, type TransitionArrowProps } from './TransitionArrow';
|
|
56
|
+
export { VariablePanel, type VariablePanelProps } from './VariablePanel';
|
|
57
|
+
export { StateJsonView, type StateJsonViewProps } from './StateJsonView';
|
|
58
58
|
export { StateArchitectBoard, type StateArchitectBoardProps, type StateArchitectTransition, type TestCase, } from '../organisms/StateArchitectBoard';
|
|
59
59
|
export { SimulatorBoard, type SimulatorBoardProps, type SimulatorParameter } from '../organisms/SimulatorBoard';
|
|
60
60
|
export { ClassifierBoard, type ClassifierBoardProps, type ClassifierItem, type ClassifierCategory } from '../organisms/ClassifierBoard';
|
|
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';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
15
15
|
import type { DisplayStateProps } from '../../../core/organisms/types';
|
|
16
|
-
import type { RuleDefinition } from '
|
|
16
|
+
import type { RuleDefinition } from '../molecules/RuleEditor';
|
|
17
17
|
export interface EventHandlerBoardProps extends DisplayStateProps {
|
|
18
18
|
/** Puzzle board-state entity (single row or array). The board reads
|
|
19
19
|
* `objects` / `triggerEvents` / `goalEvent` etc. off the row; the editable
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
import type { EntityWith } from '@almadar/core';
|
|
12
|
-
import type { RuleDefinition, RuleOption } from '../../2d/
|
|
12
|
+
import type { RuleDefinition, RuleOption } from '../../2d/molecules/RuleEditor';
|
|
13
13
|
type PuzzleObjectRow = EntityWith<{
|
|
14
14
|
name?: string;
|
|
15
15
|
icon?: string;
|
|
@@ -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
|
-
|
|
10
|
-
export type AnimationName
|
|
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
|
|
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';
|