@almadar/ui 5.87.0 → 5.91.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 +1510 -1426
- package/dist/avl/index.js +500 -416
- package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
- package/dist/components/game/2d/molecules/StateGraph.d.ts +38 -0
- 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 -11
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/2d/organisms/SequenceBar.d.ts +1 -1
- package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
- package/dist/components/index.cjs +275 -189
- package/dist/components/index.js +275 -190
- package/dist/providers/index.cjs +1377 -1293
- package/dist/providers/index.js +476 -392
- package/dist/runtime/index.cjs +1371 -1287
- package/dist/runtime/index.js +480 -396
- package/package.json +1 -1
- 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,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
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StateGraph (molecule)
|
|
3
|
+
*
|
|
4
|
+
* Dumb visual renderer for a state-machine graph: lays states out on a circle,
|
|
5
|
+
* draws the player's transitions as SVG arrows, and emits a node-click event.
|
|
6
|
+
* All state (which transitions exist, the pending "from" selection, test results)
|
|
7
|
+
* lives in the .lolo FSM — this molecule only renders and reports clicks.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import type { EventKey } from '@almadar/core';
|
|
11
|
+
export interface StateGraphTransition {
|
|
12
|
+
from: string;
|
|
13
|
+
to: string;
|
|
14
|
+
event: string;
|
|
15
|
+
guardHint?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface StateGraphProps {
|
|
18
|
+
/** All states in the machine (node labels). */
|
|
19
|
+
states: string[];
|
|
20
|
+
/** Player-built transitions rendered as arrows. */
|
|
21
|
+
transitions?: StateGraphTransition[];
|
|
22
|
+
/** State highlighted as current (test playback / initial). */
|
|
23
|
+
currentState?: string;
|
|
24
|
+
/** State the player has selected (first click). */
|
|
25
|
+
selectedState?: string;
|
|
26
|
+
/** When set, the graph is in "pick a target" mode from this state. */
|
|
27
|
+
addingFrom?: string;
|
|
28
|
+
/** The machine's initial state (ring-marked). */
|
|
29
|
+
initialState?: string;
|
|
30
|
+
/** Graph canvas width. */
|
|
31
|
+
width?: number;
|
|
32
|
+
/** Graph canvas height. */
|
|
33
|
+
height?: number;
|
|
34
|
+
/** Emits UI:{nodeClickEvent} with { stateId } when a node is clicked. */
|
|
35
|
+
nodeClickEvent?: EventKey;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function StateGraph({ states, transitions, currentState, selectedState, addingFrom, initialState, width, height, nodeClickEvent, className, }: StateGraphProps): React.JSX.Element;
|
|
@@ -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;
|
|
@@ -32,28 +32,29 @@ export { InventoryGrid, type InventoryGridProps, type InventoryGridItem } from '
|
|
|
32
32
|
export { ResourceBar, type ResourceBarProps, type ResourceBarResource } from './ResourceBar';
|
|
33
33
|
export { GameHud, type GameHudProps, type GameHudStat, type GameHudElement } from './GameHud';
|
|
34
34
|
export { GameMenu, type GameMenuProps, type MenuOption } from './GameMenu';
|
|
35
|
+
export { StateGraph, type StateGraphProps, type StateGraphTransition } from './StateGraph';
|
|
35
36
|
export { Canvas2D, type Canvas2DProps, type Projection, type CameraMode, type Platform, type SidePlayer, type TileCoord, } from './Canvas2D';
|
|
36
37
|
export { useUnitSpriteAtlas } from '../../shared/hooks/useUnitSpriteAtlas';
|
|
37
38
|
export { GameAudioProvider, GameAudioContext, useGameAudioContext, type GameAudioProviderProps, type GameAudioContextValue, } from '../../shared/providers/GameAudioProvider';
|
|
38
39
|
export { GameAudioToggle, type GameAudioToggleProps, } from '../atoms/GameAudioToggle';
|
|
39
40
|
export { useGameAudio, type AudioManifest, type SoundEntry, type GameAudioControls, type UseGameAudioOptions, } from '../../shared/hooks/useGameAudio';
|
|
40
41
|
export { useCamera } from '../../shared/hooks/useCamera';
|
|
41
|
-
export { TraitStateViewer, type TraitStateViewerProps, type TraitStateMachineDefinition, type TraitTransition, } from '
|
|
42
|
-
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';
|
|
43
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';
|
|
44
|
-
export { ActionTile, type ActionTileProps } from '
|
|
45
|
-
export { ActionPalette, type ActionPaletteProps } from '
|
|
45
|
+
export { ActionTile, type ActionTileProps } from './ActionTile';
|
|
46
|
+
export { ActionPalette, type ActionPaletteProps } from './ActionPalette';
|
|
46
47
|
export { SequenceBar, type SequenceBarProps } from '../organisms/SequenceBar';
|
|
47
48
|
export { SequencerBoard, type SequencerBoardProps } from '../organisms/SequencerBoard';
|
|
48
|
-
export { RuleEditor, type RuleEditorProps, type RuleDefinition } from '
|
|
49
|
-
export { EventLog, type EventLogProps, type EventLogEntry } from '
|
|
50
|
-
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';
|
|
51
52
|
export { EventHandlerBoard, type EventHandlerBoardProps } from '../organisms/EventHandlerBoard';
|
|
52
53
|
export * from '../../shared/lib/puzzleObject';
|
|
53
|
-
export { StateNode, type StateNodeProps } from '
|
|
54
|
-
export { TransitionArrow, type TransitionArrowProps } from '
|
|
55
|
-
export { VariablePanel, type VariablePanelProps } from '
|
|
56
|
-
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';
|
|
57
58
|
export { StateArchitectBoard, type StateArchitectBoardProps, type StateArchitectTransition, type TestCase, } from '../organisms/StateArchitectBoard';
|
|
58
59
|
export { SimulatorBoard, type SimulatorBoardProps, type SimulatorParameter } from '../organisms/SimulatorBoard';
|
|
59
60
|
export { ClassifierBoard, type ClassifierBoardProps, type ClassifierItem, type ClassifierCategory } from '../organisms/ClassifierBoard';
|
|
@@ -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
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import type { SlotItemData } from '
|
|
11
|
+
import type { SlotItemData } from '../molecules/TraitSlot';
|
|
12
12
|
export interface SequenceBarProps {
|
|
13
13
|
/** The current sequence (sparse — undefined means empty slot) */
|
|
14
14
|
slots: Array<SlotItemData | undefined>;
|
|
@@ -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;
|