@almadar/ui 5.17.0 → 5.17.1
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 +181 -153
- package/dist/avl/index.js +181 -153
- package/dist/components/atoms/Avatar.d.ts +4 -2
- package/dist/components/atoms/ConditionalWrapper.d.ts +2 -2
- package/dist/components/atoms/Icon.d.ts +6 -2
- package/dist/components/atoms/Input.d.ts +3 -2
- package/dist/components/atoms/LawReferenceTooltip.d.ts +2 -2
- package/dist/components/atoms/types.d.ts +10 -10
- package/dist/components/index.cjs +181 -153
- package/dist/components/index.js +181 -153
- package/dist/components/molecules/OptionConstraintGroup.d.ts +5 -3
- package/dist/components/molecules/ViolationAlert.d.ts +2 -2
- package/dist/components/molecules/game/CraftingRecipe.d.ts +4 -4
- package/dist/components/molecules/game/DialogueBox.d.ts +2 -2
- package/dist/components/organisms/ComponentPatterns.d.ts +2 -1
- package/dist/components/organisms/CustomPattern.d.ts +2 -1
- package/dist/components/organisms/DataTable.d.ts +1 -1
- package/dist/components/organisms/Form.d.ts +3 -3
- package/dist/components/organisms/LayoutPatterns.d.ts +4 -3
- package/dist/components/organisms/StateMachineView.d.ts +6 -3
- package/dist/components/organisms/book/types.d.ts +2 -2
- package/dist/components/organisms/game/CastleBoard.d.ts +4 -3
- package/dist/components/organisms/game/TraitStateViewer.d.ts +4 -4
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +9 -4
- package/dist/components/organisms/game/WorldMapBoard.d.ts +5 -4
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +3 -3
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +3 -3
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +3 -3
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +7 -4
- package/dist/components/organisms/game/puzzles/event-handler/ObjectRulePanel.d.ts +2 -2
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +3 -3
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +5 -4
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +3 -3
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +5 -4
- package/dist/components/templates/GenericAppTemplate.d.ts +1 -7
- package/dist/components/templates/types.d.ts +14 -6
- package/dist/docs/index.cjs +60 -22
- package/dist/docs/index.d.cts +9 -4
- package/dist/docs/index.js +58 -20
- package/dist/marketing/index.cjs +61 -23
- package/dist/marketing/index.d.cts +10 -6
- package/dist/marketing/index.js +58 -20
- package/dist/providers/index.cjs +181 -153
- package/dist/providers/index.js +181 -153
- package/dist/runtime/index.cjs +181 -153
- package/dist/runtime/index.js +181 -153
- package/package.json +1 -1
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import type { EventEmit } from '@almadar/core';
|
|
13
|
-
export
|
|
13
|
+
export type OptionConstraintOption = {
|
|
14
14
|
id: string;
|
|
15
15
|
label: string;
|
|
16
16
|
priceDelta?: number;
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
outOfStock?: boolean;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
export type OptionConstraint = {
|
|
21
21
|
type: 'single';
|
|
22
22
|
required?: boolean;
|
|
@@ -30,7 +30,9 @@ export interface OptionConstraintGroupProps {
|
|
|
30
30
|
title: string;
|
|
31
31
|
description?: string;
|
|
32
32
|
options: OptionConstraintOption[];
|
|
33
|
-
constraint
|
|
33
|
+
/** Selection constraint. Optional — defaults to single-select (the generic
|
|
34
|
+
* factory can't author a discriminated-union value; an author overrides it). */
|
|
35
|
+
constraint?: OptionConstraint;
|
|
34
36
|
selected?: string[];
|
|
35
37
|
onChange?: (selected: string[]) => void;
|
|
36
38
|
changeEvent?: EventEmit<{
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - penalty: Penalty proceedings (error, severe)
|
|
11
11
|
*/
|
|
12
12
|
import React from "react";
|
|
13
|
-
export
|
|
13
|
+
export type ViolationRecord = {
|
|
14
14
|
/** Unique violation identifier */
|
|
15
15
|
id: string;
|
|
16
16
|
/** Law reference (e.g., "ZVPOT-1") */
|
|
@@ -29,7 +29,7 @@ export interface ViolationRecord {
|
|
|
29
29
|
fieldId?: string;
|
|
30
30
|
/** Tab/form where violation occurred */
|
|
31
31
|
tabId?: string;
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
export interface ViolationAlertProps {
|
|
34
34
|
/** Violation data */
|
|
35
35
|
violation: ViolationRecord;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { EventEmit } from '@almadar/core';
|
|
3
|
-
export
|
|
3
|
+
export type CraftingIngredient = {
|
|
4
4
|
/** Icon component or emoji */
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
/** Ingredient label */
|
|
@@ -9,15 +9,15 @@ export interface CraftingIngredient {
|
|
|
9
9
|
required: number;
|
|
10
10
|
/** Number currently available */
|
|
11
11
|
available: number;
|
|
12
|
-
}
|
|
13
|
-
export
|
|
12
|
+
};
|
|
13
|
+
export type CraftingOutput = {
|
|
14
14
|
/** Icon component or emoji */
|
|
15
15
|
icon?: React.ReactNode;
|
|
16
16
|
/** Output item label */
|
|
17
17
|
label: string;
|
|
18
18
|
/** Rarity tier */
|
|
19
19
|
rarity?: string;
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
21
|
export interface CraftingRecipeProps {
|
|
22
22
|
/** Input ingredients for the recipe */
|
|
23
23
|
inputs: CraftingIngredient[];
|
|
@@ -19,14 +19,14 @@ export type DialogueChoice = EventPayload & {
|
|
|
19
19
|
next?: string;
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type DialogueNode = {
|
|
23
23
|
id?: string;
|
|
24
24
|
speaker: string;
|
|
25
25
|
text: string;
|
|
26
26
|
portrait?: string;
|
|
27
27
|
choices?: DialogueChoice[];
|
|
28
28
|
autoAdvance?: number;
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
/** Event Contract:
|
|
31
31
|
* Emits: UI:COMPLETE
|
|
32
32
|
* Emits: UI:CHOICE
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import type { EventKey, EventPayload } from '@almadar/core';
|
|
13
|
+
import type { UiError } from '../atoms/types';
|
|
13
14
|
import { type ButtonProps } from '../atoms/Button';
|
|
14
15
|
import { type BadgeVariant } from '../atoms/Badge';
|
|
15
16
|
import { type AlertVariant } from '../molecules/Alert';
|
|
@@ -20,7 +21,7 @@ import { type MapViewProps } from '../molecules/MapView';
|
|
|
20
21
|
interface ClosedCircuitProps {
|
|
21
22
|
className?: string;
|
|
22
23
|
isLoading?: boolean;
|
|
23
|
-
error?:
|
|
24
|
+
error?: UiError | null;
|
|
24
25
|
entity?: string;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import React from "react";
|
|
11
11
|
import type { EventKey, EventPayload } from "@almadar/core";
|
|
12
|
+
import type { UiError } from "../atoms/types";
|
|
12
13
|
/**
|
|
13
14
|
* Allowed element types for custom patterns.
|
|
14
15
|
*/
|
|
@@ -52,7 +53,7 @@ export interface CustomPatternProps {
|
|
|
52
53
|
/** Loading state */
|
|
53
54
|
isLoading?: boolean;
|
|
54
55
|
/** Error state */
|
|
55
|
-
error?:
|
|
56
|
+
error?: UiError | null;
|
|
56
57
|
/** Entity name */
|
|
57
58
|
entity?: string;
|
|
58
59
|
}
|
|
@@ -45,7 +45,7 @@ export interface DataTableProps<T extends EntityRow & {
|
|
|
45
45
|
variant?: "default" | "primary" | "secondary" | "ghost" | "danger" | string;
|
|
46
46
|
onClick?: (row: T) => void;
|
|
47
47
|
}[];
|
|
48
|
-
emptyIcon?: LucideIcon;
|
|
48
|
+
emptyIcon?: LucideIcon | string;
|
|
49
49
|
emptyTitle?: string;
|
|
50
50
|
emptyDescription?: string;
|
|
51
51
|
emptyAction?: DataTableEmptyAction;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* - Nested sections with collapsible support
|
|
13
13
|
*/
|
|
14
14
|
import React from "react";
|
|
15
|
-
import type { EventKey } from "@almadar/core";
|
|
15
|
+
import type { EventKey, FieldValue } from "@almadar/core";
|
|
16
16
|
import { type SelectOption } from "../atoms/Select";
|
|
17
17
|
import { type RelationOption } from "../molecules/RelationSelect";
|
|
18
18
|
import type { OrbitalEntity } from "@almadar/core";
|
|
@@ -202,8 +202,8 @@ export interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement
|
|
|
202
202
|
/** Callback when any field value changes */
|
|
203
203
|
onFieldChange?: (change: {
|
|
204
204
|
fieldId: string;
|
|
205
|
-
value:
|
|
206
|
-
formValues: Record<string,
|
|
205
|
+
value: FieldValue | undefined;
|
|
206
|
+
formValues: Record<string, FieldValue | undefined>;
|
|
207
207
|
}) => void;
|
|
208
208
|
/** Config path for form configuration (schema-driven) */
|
|
209
209
|
configPath?: string;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import type { UiError } from '../atoms/types';
|
|
13
14
|
import { type StackGap, type StackAlign, type StackJustify } from '../atoms/Stack';
|
|
14
15
|
import { type BoxPadding, type BoxBg, type BoxRounded, type BoxShadow } from '../atoms/Box';
|
|
15
16
|
import { type GridCols, type GridGap, type ResponsiveGridCols } from '../molecules/Grid';
|
|
@@ -27,7 +28,7 @@ export interface LayoutPatternProps {
|
|
|
27
28
|
/** Loading state */
|
|
28
29
|
isLoading?: boolean;
|
|
29
30
|
/** Error state */
|
|
30
|
-
error?:
|
|
31
|
+
error?: UiError | null;
|
|
31
32
|
/** Entity name */
|
|
32
33
|
entity?: string;
|
|
33
34
|
}
|
|
@@ -130,7 +131,7 @@ export interface SpacerPatternProps {
|
|
|
130
131
|
/** Loading state */
|
|
131
132
|
isLoading?: boolean;
|
|
132
133
|
/** Error state */
|
|
133
|
-
error?:
|
|
134
|
+
error?: UiError | null;
|
|
134
135
|
/** Entity name */
|
|
135
136
|
entity?: string;
|
|
136
137
|
}
|
|
@@ -157,7 +158,7 @@ export interface DividerPatternProps {
|
|
|
157
158
|
/** Loading state */
|
|
158
159
|
isLoading?: boolean;
|
|
159
160
|
/** Error state */
|
|
160
|
-
error?:
|
|
161
|
+
error?: UiError | null;
|
|
161
162
|
/** Entity name */
|
|
162
163
|
entity?: string;
|
|
163
164
|
}
|
|
@@ -18,14 +18,14 @@ import React from 'react';
|
|
|
18
18
|
import type { DomLayoutData, DomStateNode, DomTransitionLabel, VisualizerConfig } from '../../lib/visualizer/index.js';
|
|
19
19
|
import type { UiError } from '../atoms/types';
|
|
20
20
|
/** Bundled transitions between same from→to states */
|
|
21
|
-
export
|
|
21
|
+
export type TransitionBundle = {
|
|
22
22
|
id: string;
|
|
23
23
|
from: string;
|
|
24
24
|
to: string;
|
|
25
25
|
labels: DomTransitionLabel[];
|
|
26
26
|
isBidirectional: boolean;
|
|
27
27
|
isReverse: boolean;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
export interface StateMachineViewProps {
|
|
30
30
|
/** Additional CSS classes */
|
|
31
31
|
className?: string;
|
|
@@ -33,7 +33,10 @@ export interface StateMachineViewProps {
|
|
|
33
33
|
isLoading?: boolean;
|
|
34
34
|
/** Error state */
|
|
35
35
|
error?: UiError | null;
|
|
36
|
-
|
|
36
|
+
/** Pre-computed visualizer layout. Optional: when absent the view renders
|
|
37
|
+
* nothing (an author wires real layout via config; the generic factory
|
|
38
|
+
* can't synthesize a `DomLayoutData`). */
|
|
39
|
+
layoutData?: DomLayoutData;
|
|
37
40
|
/** Custom state node renderer — when provided, replaces the default circle nodes */
|
|
38
41
|
renderStateNode?: (state: DomStateNode, config: VisualizerConfig) => React.ReactNode;
|
|
39
42
|
}
|
|
@@ -22,12 +22,12 @@ export interface BookPart {
|
|
|
22
22
|
title: string;
|
|
23
23
|
chapters: BookChapter[];
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type BookChapter = {
|
|
26
26
|
id: string;
|
|
27
27
|
title: string;
|
|
28
28
|
content: string;
|
|
29
29
|
orbitalSchema?: OrbitalSchema;
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
/**
|
|
32
32
|
* Maps raw entity field names to canonical BookData field names.
|
|
33
33
|
* Each key is a canonical field, each value is the entity field name.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import type { EventEmit } from '@almadar/core';
|
|
16
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
17
17
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
18
18
|
/** Entity shape consumed by CastleBoard */
|
|
19
19
|
export interface CastleEntity {
|
|
@@ -53,8 +53,9 @@ export type CastleSlotContext = {
|
|
|
53
53
|
scale: number;
|
|
54
54
|
};
|
|
55
55
|
export interface CastleBoardProps {
|
|
56
|
-
/** Castle entity data
|
|
57
|
-
|
|
56
|
+
/** Castle entity data. Also accepts the canonical `EntityRow` the compiler
|
|
57
|
+
* binds (and arrays); narrowed to `CastleEntity` internally. */
|
|
58
|
+
entity?: CastleEntity | EntityRow | readonly (CastleEntity | EntityRow)[];
|
|
58
59
|
/** Canvas render scale */
|
|
59
60
|
scale?: number;
|
|
60
61
|
/** Top bar / header */
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { type StateStyle } from '../../atoms/game/StateIndicator';
|
|
14
14
|
import type { UiError } from '../../atoms/types';
|
|
15
|
-
export
|
|
15
|
+
export type TraitTransition = {
|
|
16
16
|
from: string;
|
|
17
17
|
to: string;
|
|
18
18
|
event: string;
|
|
19
19
|
guardHint?: string;
|
|
20
|
-
}
|
|
21
|
-
export
|
|
20
|
+
};
|
|
21
|
+
export type TraitStateMachineDefinition = {
|
|
22
22
|
name: string;
|
|
23
23
|
states: string[];
|
|
24
24
|
currentState: string;
|
|
25
25
|
transitions: TraitTransition[];
|
|
26
26
|
description?: string;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
export interface TraitStateViewerProps {
|
|
29
29
|
/** The trait / state machine to visualize */
|
|
30
30
|
trait: TraitStateMachineDefinition;
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import type { EntityRow } from '@almadar/core';
|
|
16
18
|
import { type BattleBoardProps, type BattleUnit } from './BattleBoard';
|
|
19
|
+
/** Uncontrolled entity read-shape: controlled game-state fields are dropped in
|
|
20
|
+
* favor of `initialUnits`, which the internal `useBattleState` hook manages. */
|
|
21
|
+
export type UncontrolledBattleEntity = Omit<BattleBoardProps['entity'], 'units' | 'phase' | 'turn' | 'gameResult' | 'selectedUnitId'> & {
|
|
22
|
+
initialUnits: BattleUnit[];
|
|
23
|
+
};
|
|
17
24
|
export interface UncontrolledBattleBoardProps extends Omit<BattleBoardProps, 'entity'> {
|
|
18
|
-
entity
|
|
19
|
-
initialUnits: BattleUnit[];
|
|
20
|
-
};
|
|
25
|
+
entity?: UncontrolledBattleEntity | EntityRow | readonly (UncontrolledBattleEntity | EntityRow)[];
|
|
21
26
|
}
|
|
22
|
-
export declare function UncontrolledBattleBoard({ entity, ...rest }: UncontrolledBattleBoardProps):
|
|
27
|
+
export declare function UncontrolledBattleBoard({ entity, ...rest }: UncontrolledBattleBoardProps): React.JSX.Element | null;
|
|
23
28
|
export declare namespace UncontrolledBattleBoard {
|
|
24
29
|
var displayName: string;
|
|
25
30
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
-
import type { EventEmit } from '@almadar/core';
|
|
22
|
+
import type { EventEmit, EntityRow, FieldValue } from '@almadar/core';
|
|
23
23
|
import type { IsometricFeature } from './types/isometric';
|
|
24
24
|
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
25
25
|
import type { UiError } from '../../atoms/types';
|
|
@@ -50,7 +50,7 @@ export type MapHex = {
|
|
|
50
50
|
terrain: string;
|
|
51
51
|
terrainSprite?: string;
|
|
52
52
|
feature?: string;
|
|
53
|
-
featureData?: Record<string,
|
|
53
|
+
featureData?: Record<string, FieldValue | undefined>;
|
|
54
54
|
passable?: boolean;
|
|
55
55
|
};
|
|
56
56
|
/** Context exposed to render-prop slots */
|
|
@@ -110,8 +110,9 @@ export interface WorldMapBoardProps {
|
|
|
110
110
|
isLoading?: boolean;
|
|
111
111
|
/** Error state */
|
|
112
112
|
error?: UiError | null;
|
|
113
|
-
/** World map entity data
|
|
114
|
-
|
|
113
|
+
/** World map entity data. Also accepts the canonical `EntityRow` the
|
|
114
|
+
* compiler binds; the component narrows to `WorldMapEntity` below. */
|
|
115
|
+
entity?: WorldMapEntity | EntityRow | readonly (WorldMapEntity | EntityRow)[];
|
|
115
116
|
/** Canvas render scale */
|
|
116
117
|
scale?: number;
|
|
117
118
|
/** Unit draw-size multiplier */
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Events emitted via completeEvent (default UI:PUZZLE_COMPLETE).
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import type { EventEmit } from '@almadar/core';
|
|
12
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
13
13
|
import type { EntityDisplayProps } from '../../../types';
|
|
14
14
|
export interface BuilderComponent {
|
|
15
15
|
id: string;
|
|
@@ -44,13 +44,13 @@ export interface BuilderPuzzleEntity {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export interface BuilderBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
47
|
-
entity
|
|
47
|
+
entity?: BuilderPuzzleEntity | EntityRow | readonly (BuilderPuzzleEntity | EntityRow)[];
|
|
48
48
|
completeEvent?: EventEmit<{
|
|
49
49
|
success: boolean;
|
|
50
50
|
attempts: number;
|
|
51
51
|
}>;
|
|
52
52
|
}
|
|
53
|
-
export declare function BuilderBoard({ entity, completeEvent, className, }: BuilderBoardProps): React.JSX.Element;
|
|
53
|
+
export declare function BuilderBoard({ entity, completeEvent, className, }: BuilderBoardProps): React.JSX.Element | null;
|
|
54
54
|
export declare namespace BuilderBoard {
|
|
55
55
|
var displayName: string;
|
|
56
56
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Events emitted via completeEvent (default UI:PUZZLE_COMPLETE).
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import type { EventEmit } from '@almadar/core';
|
|
13
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
14
14
|
import type { EntityDisplayProps } from '../../../types';
|
|
15
15
|
export interface ClassifierItem {
|
|
16
16
|
id: string;
|
|
@@ -45,13 +45,13 @@ export interface ClassifierPuzzleEntity {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
export interface ClassifierBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
48
|
-
entity
|
|
48
|
+
entity?: ClassifierPuzzleEntity | EntityRow | readonly (ClassifierPuzzleEntity | EntityRow)[];
|
|
49
49
|
completeEvent?: EventEmit<{
|
|
50
50
|
success: boolean;
|
|
51
51
|
attempts: number;
|
|
52
52
|
}>;
|
|
53
53
|
}
|
|
54
|
-
export declare function ClassifierBoard({ entity, completeEvent, className, }: ClassifierBoardProps): React.JSX.Element;
|
|
54
|
+
export declare function ClassifierBoard({ entity, completeEvent, className, }: ClassifierBoardProps): React.JSX.Element | null;
|
|
55
55
|
export declare namespace ClassifierBoard {
|
|
56
56
|
var displayName: string;
|
|
57
57
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Events emitted via completeEvent (default UI:PUZZLE_COMPLETE).
|
|
10
10
|
*/
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import type { EventEmit } from '@almadar/core';
|
|
12
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
13
13
|
import type { EntityDisplayProps } from '../../../types';
|
|
14
14
|
export interface DebuggerLine {
|
|
15
15
|
id: string;
|
|
@@ -37,13 +37,13 @@ export interface DebuggerPuzzleEntity {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
export interface DebuggerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
40
|
-
entity
|
|
40
|
+
entity?: DebuggerPuzzleEntity | EntityRow | readonly (DebuggerPuzzleEntity | EntityRow)[];
|
|
41
41
|
completeEvent?: EventEmit<{
|
|
42
42
|
success: boolean;
|
|
43
43
|
attempts: number;
|
|
44
44
|
}>;
|
|
45
45
|
}
|
|
46
|
-
export declare function DebuggerBoard({ entity, completeEvent, className, }: DebuggerBoardProps): React.JSX.Element;
|
|
46
|
+
export declare function DebuggerBoard({ entity, completeEvent, className, }: DebuggerBoardProps): React.JSX.Element | null;
|
|
47
47
|
export declare namespace DebuggerBoard {
|
|
48
48
|
var displayName: string;
|
|
49
49
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import type { EventEmit } from '@almadar/core';
|
|
14
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
15
15
|
import type { EntityDisplayProps } from '../../../types';
|
|
16
16
|
import { type PuzzleObjectDef } from './ObjectRulePanel';
|
|
17
17
|
export interface EventHandlerPuzzleEntity {
|
|
@@ -40,8 +40,11 @@ export interface EventHandlerPuzzleEntity {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
export interface EventHandlerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
43
|
-
/** Puzzle data
|
|
44
|
-
|
|
43
|
+
/** Puzzle data. The compiler binds the generic `EntityRow`, so the inlet
|
|
44
|
+
* accepts it (and arrays) as union members; the component narrows to its
|
|
45
|
+
* curated `EventHandlerPuzzleEntity` read-shape below (a valid
|
|
46
|
+
* union-narrow) and renders nothing until a puzzle entity is present. */
|
|
47
|
+
entity?: EventHandlerPuzzleEntity | EntityRow | readonly (EventHandlerPuzzleEntity | EntityRow)[];
|
|
45
48
|
/** Playback speed in ms per event */
|
|
46
49
|
stepDurationMs?: number;
|
|
47
50
|
/** Emits UI:{playEvent} */
|
|
@@ -51,7 +54,7 @@ export interface EventHandlerBoardProps extends Omit<EntityDisplayProps, 'entity
|
|
|
51
54
|
success: boolean;
|
|
52
55
|
}>;
|
|
53
56
|
}
|
|
54
|
-
export declare function EventHandlerBoard({ entity, stepDurationMs, playEvent, completeEvent, className, }: EventHandlerBoardProps): React.JSX.Element;
|
|
57
|
+
export declare function EventHandlerBoard({ entity, stepDurationMs, playEvent, completeEvent, className, }: EventHandlerBoardProps): React.JSX.Element | null;
|
|
55
58
|
export declare namespace EventHandlerBoard {
|
|
56
59
|
var displayName: string;
|
|
57
60
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { type RuleDefinition } from './RuleEditor';
|
|
12
|
-
export
|
|
12
|
+
export type PuzzleObjectDef = {
|
|
13
13
|
id: string;
|
|
14
14
|
name: string;
|
|
15
15
|
icon: string;
|
|
@@ -27,7 +27,7 @@ export interface PuzzleObjectDef {
|
|
|
27
27
|
rules: RuleDefinition[];
|
|
28
28
|
/** Max rules allowed on this object */
|
|
29
29
|
maxRules?: number;
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
export interface ObjectRulePanelProps {
|
|
32
32
|
/** The selected object */
|
|
33
33
|
object: PuzzleObjectDef;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Events emitted via completeEvent (default UI:PUZZLE_COMPLETE).
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import type { EventEmit } from '@almadar/core';
|
|
14
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
15
15
|
import type { EntityDisplayProps } from '../../../types';
|
|
16
16
|
export interface NegotiatorAction {
|
|
17
17
|
id: string;
|
|
@@ -46,13 +46,13 @@ export interface NegotiatorPuzzleEntity {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
export interface NegotiatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
49
|
-
entity
|
|
49
|
+
entity?: NegotiatorPuzzleEntity | EntityRow | readonly (NegotiatorPuzzleEntity | EntityRow)[];
|
|
50
50
|
completeEvent?: EventEmit<{
|
|
51
51
|
success: boolean;
|
|
52
52
|
score: number;
|
|
53
53
|
}>;
|
|
54
54
|
}
|
|
55
|
-
export declare function NegotiatorBoard({ entity, completeEvent, className, }: NegotiatorBoardProps): React.JSX.Element;
|
|
55
|
+
export declare function NegotiatorBoard({ entity, completeEvent, className, }: NegotiatorBoardProps): React.JSX.Element | null;
|
|
56
56
|
export declare namespace NegotiatorBoard {
|
|
57
57
|
var displayName: string;
|
|
58
58
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
-
import type { EventEmit } from '@almadar/core';
|
|
21
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
22
22
|
import type { SlotItemData } from '../../TraitSlot';
|
|
23
23
|
import type { EntityDisplayProps } from '../../../types';
|
|
24
24
|
export interface SequencerPuzzleEntity {
|
|
@@ -52,8 +52,9 @@ export interface SequencerPuzzleEntity {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export interface SequencerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
55
|
-
/** Puzzle data
|
|
56
|
-
|
|
55
|
+
/** Puzzle data. Also accepts the canonical `EntityRow` the compiler binds
|
|
56
|
+
* (and arrays); narrowed to `SequencerPuzzleEntity` internally. */
|
|
57
|
+
entity?: SequencerPuzzleEntity | EntityRow | readonly (SequencerPuzzleEntity | EntityRow)[];
|
|
57
58
|
/** Category → color mapping */
|
|
58
59
|
categoryColors?: Record<string, {
|
|
59
60
|
bg: string;
|
|
@@ -71,7 +72,7 @@ export interface SequencerBoardProps extends Omit<EntityDisplayProps, 'entity'>
|
|
|
71
72
|
sequence: string[];
|
|
72
73
|
}>;
|
|
73
74
|
}
|
|
74
|
-
export declare function SequencerBoard({ entity, categoryColors, stepDurationMs, playEvent, completeEvent, className, }: SequencerBoardProps): React.JSX.Element;
|
|
75
|
+
export declare function SequencerBoard({ entity, categoryColors, stepDurationMs, playEvent, completeEvent, className, }: SequencerBoardProps): React.JSX.Element | null;
|
|
75
76
|
export declare namespace SequencerBoard {
|
|
76
77
|
var displayName: string;
|
|
77
78
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Events emitted via completeEvent (default UI:PUZZLE_COMPLETE).
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import type { EventEmit } from '@almadar/core';
|
|
13
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
14
14
|
import type { EntityDisplayProps } from '../../../types';
|
|
15
15
|
export interface SimulatorParameter {
|
|
16
16
|
id: string;
|
|
@@ -46,13 +46,13 @@ export interface SimulatorPuzzleEntity {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
export interface SimulatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
49
|
-
entity
|
|
49
|
+
entity?: SimulatorPuzzleEntity | EntityRow | readonly (SimulatorPuzzleEntity | EntityRow)[];
|
|
50
50
|
completeEvent?: EventEmit<{
|
|
51
51
|
success: boolean;
|
|
52
52
|
attempts: number;
|
|
53
53
|
}>;
|
|
54
54
|
}
|
|
55
|
-
export declare function SimulatorBoard({ entity, completeEvent, className, }: SimulatorBoardProps): React.JSX.Element;
|
|
55
|
+
export declare function SimulatorBoard({ entity, completeEvent, className, }: SimulatorBoardProps): React.JSX.Element | null;
|
|
56
56
|
export declare namespace SimulatorBoard {
|
|
57
57
|
var displayName: string;
|
|
58
58
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import type { EventEmit } from '@almadar/core';
|
|
11
|
+
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
12
12
|
import type { EntityDisplayProps } from '../../../types';
|
|
13
13
|
import { type VariableDef } from './VariablePanel';
|
|
14
14
|
export interface StateArchitectTransition {
|
|
@@ -61,8 +61,9 @@ export interface StateArchitectPuzzleEntity {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export interface StateArchitectBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
64
|
-
/** Puzzle data
|
|
65
|
-
|
|
64
|
+
/** Puzzle data. Also accepts the canonical `EntityRow` the compiler binds
|
|
65
|
+
* (and arrays); narrowed to `StateArchitectPuzzleEntity` internally. */
|
|
66
|
+
entity?: StateArchitectPuzzleEntity | EntityRow | readonly (StateArchitectPuzzleEntity | EntityRow)[];
|
|
66
67
|
/** Playback speed */
|
|
67
68
|
stepDurationMs?: number;
|
|
68
69
|
/** Emits UI:{testEvent} */
|
|
@@ -73,7 +74,7 @@ export interface StateArchitectBoardProps extends Omit<EntityDisplayProps, 'enti
|
|
|
73
74
|
passedTests: number;
|
|
74
75
|
}>;
|
|
75
76
|
}
|
|
76
|
-
export declare function StateArchitectBoard({ entity, stepDurationMs, testEvent, completeEvent, className, }: StateArchitectBoardProps): React.JSX.Element;
|
|
77
|
+
export declare function StateArchitectBoard({ entity, stepDurationMs, testEvent, completeEvent, className, }: StateArchitectBoardProps): React.JSX.Element | null;
|
|
77
78
|
export declare namespace StateArchitectBoard {
|
|
78
79
|
var displayName: string;
|
|
79
80
|
}
|
|
@@ -7,12 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
9
|
import type { TemplateProps } from "./types";
|
|
10
|
-
interface
|
|
11
|
-
id: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
subtitle?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface GenericAppTemplateProps extends TemplateProps<GenericAppEntity> {
|
|
10
|
+
export interface GenericAppTemplateProps extends TemplateProps {
|
|
16
11
|
/** Page title */
|
|
17
12
|
title: string;
|
|
18
13
|
/** Subtitle or description */
|
|
@@ -27,4 +22,3 @@ export interface GenericAppTemplateProps extends TemplateProps<GenericAppEntity>
|
|
|
27
22
|
className?: string;
|
|
28
23
|
}
|
|
29
24
|
export declare const GenericAppTemplate: React.FC<GenericAppTemplateProps>;
|
|
30
|
-
export {};
|
|
@@ -9,19 +9,27 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @see docs/Almadar_Templates.md
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
import type { EntityRow } from "@almadar/core";
|
|
13
|
+
/** Base props for all templates — enforces entity-only data flow.
|
|
14
|
+
*
|
|
15
|
+
* The constraint is `{ id?: string }` (optional id) so the canonical
|
|
16
|
+
* `EntityRow` from `@almadar/core` — whose `id` is optional — satisfies it. */
|
|
13
17
|
export interface TemplateProps<E extends {
|
|
14
|
-
id
|
|
15
|
-
} = {
|
|
16
|
-
id: string;
|
|
17
|
-
}> {
|
|
18
|
+
id?: string;
|
|
19
|
+
} = EntityRow> {
|
|
18
20
|
/**
|
|
19
21
|
* Entity data — single object or array (pre-resolved by the compiler
|
|
20
22
|
* from `@payload.data` on the calling trait). The legacy `string`
|
|
21
23
|
* entity-name branch was removed in V2 Phase 6 along with the
|
|
22
24
|
* EntityStore resolver.
|
|
25
|
+
*
|
|
26
|
+
* The inlet always also accepts the canonical `EntityRow` (and arrays of
|
|
27
|
+
* it), because the compiler binds the generic data-store row regardless of
|
|
28
|
+
* a template's curated read-shape `E`. A template that reads specific
|
|
29
|
+
* fields narrows `entity` to `E` internally (a valid union-narrow) — no
|
|
30
|
+
* `as unknown` cast and no per-template inlet widening required.
|
|
23
31
|
*/
|
|
24
|
-
entity?: E | readonly E[];
|
|
32
|
+
entity?: E | EntityRow | readonly (E | EntityRow)[];
|
|
25
33
|
/** External styling override */
|
|
26
34
|
className?: string;
|
|
27
35
|
}
|