@almadar/ui 4.21.0 → 4.22.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/components/molecules/Accordion.d.ts +5 -1
- package/dist/components/molecules/CalendarGrid.d.ts +8 -5
- package/dist/components/molecules/Card.d.ts +3 -3
- package/dist/components/molecules/Carousel.d.ts +4 -1
- package/dist/components/molecules/EmptyState.d.ts +2 -1
- package/dist/components/molecules/ErrorState.d.ts +2 -1
- package/dist/components/molecules/MapView.d.ts +7 -3
- package/dist/components/molecules/Modal.d.ts +2 -1
- package/dist/components/molecules/Pagination.d.ts +7 -2
- package/dist/components/molecules/SidePanel.d.ts +2 -1
- package/dist/components/molecules/Tabs.d.ts +4 -1
- package/dist/components/molecules/Toast.d.ts +3 -2
- package/dist/components/molecules/WizardProgress.d.ts +4 -1
- package/dist/components/molecules/game/ActionButtons.d.ts +5 -1
- package/dist/components/molecules/game/CraftingRecipe.d.ts +4 -1
- package/dist/components/molecules/game/DPad.d.ts +5 -1
- package/dist/components/molecules/game/DialogueBox.d.ts +7 -5
- package/dist/components/molecules/game/InventoryGrid.d.ts +4 -1
- package/dist/components/molecules/game/InventoryPanel.d.ts +12 -6
- package/dist/components/molecules/game/IsometricCanvas.d.ts +13 -4
- package/dist/components/molecules/game/PlatformerCanvas.d.ts +9 -4
- package/dist/components/organisms/GraphCanvas.d.ts +4 -2
- package/dist/components/organisms/MediaGallery.d.ts +4 -1
- package/dist/components/organisms/PageHeader.d.ts +2 -1
- package/dist/components/organisms/Sidebar.d.ts +6 -3
- package/dist/components/organisms/SignaturePad.d.ts +5 -2
- package/dist/components/organisms/game/BattleBoard.d.ts +20 -8
- package/dist/components/organisms/game/CanvasEffect.d.ts +2 -1
- package/dist/components/organisms/game/CastleBoard.d.ts +14 -3
- package/dist/components/organisms/game/GameCanvas3D.d.ts +52 -8
- package/dist/components/organisms/game/TraitSlot.d.ts +7 -2
- package/dist/components/organisms/game/WorldMapBoard.d.ts +22 -5
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +19 -7
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +5 -2
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +8 -2
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +6 -2
- package/dist/components/organisms/game/three/hooks/useGameCanvas3DEvents.d.ts +52 -8
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses Button, Icon, Typography, and Divider atoms.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export interface AccordionItem {
|
|
9
10
|
/**
|
|
10
11
|
* Item ID (auto-generated from header/title if not provided)
|
|
@@ -62,6 +63,9 @@ export interface AccordionProps {
|
|
|
62
63
|
*/
|
|
63
64
|
className?: string;
|
|
64
65
|
/** Declarative toggle event — emits UI:{toggleEvent} with { itemId, isOpen } */
|
|
65
|
-
toggleEvent?:
|
|
66
|
+
toggleEvent?: EventEmit<{
|
|
67
|
+
itemId: string;
|
|
68
|
+
isOpen: boolean;
|
|
69
|
+
}>;
|
|
66
70
|
}
|
|
67
71
|
export declare const Accordion: React.FC<AccordionProps>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Composes DayCell and TimeSlotCell atoms into a 7-day grid.
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
|
-
import type { EventPayload } from "@almadar/core";
|
|
9
|
+
import type { EventEmit, EventPayload } from "@almadar/core";
|
|
10
10
|
export interface CalendarEvent {
|
|
11
11
|
id: string;
|
|
12
12
|
title: string;
|
|
@@ -29,14 +29,17 @@ export interface CalendarGridProps {
|
|
|
29
29
|
onEventClick?: (event: CalendarEvent) => void;
|
|
30
30
|
/** Additional CSS classes */
|
|
31
31
|
className?: string;
|
|
32
|
-
/** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time } */
|
|
33
|
-
longPressEvent?:
|
|
32
|
+
/** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time, ...longPressPayload } */
|
|
33
|
+
longPressEvent?: EventEmit<{
|
|
34
|
+
date: string;
|
|
35
|
+
time?: string;
|
|
36
|
+
}>;
|
|
34
37
|
/** Additional payload for long-press events */
|
|
35
38
|
longPressPayload?: EventPayload;
|
|
36
39
|
/** Event emitted on swipe left (next week): UI:{swipeLeftEvent} */
|
|
37
|
-
swipeLeftEvent?: string
|
|
40
|
+
swipeLeftEvent?: EventEmit<Record<string, never>>;
|
|
38
41
|
/** Event emitted on swipe right (prev week): UI:{swipeRightEvent} */
|
|
39
|
-
swipeRightEvent?: string
|
|
42
|
+
swipeRightEvent?: EventEmit<Record<string, never>>;
|
|
40
43
|
}
|
|
41
44
|
export declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, }: CalendarGridProps): React.JSX.Element;
|
|
42
45
|
export declare namespace CalendarGrid {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @generated by Orbital Compiler
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
-
import type { EventKey, EventPayload } from "@almadar/core";
|
|
10
|
+
import type { EventEmit, EventKey, EventPayload } from "@almadar/core";
|
|
11
11
|
export interface CardAction {
|
|
12
12
|
label: string;
|
|
13
13
|
onClick?: () => void;
|
|
@@ -42,8 +42,8 @@ export interface CardProps {
|
|
|
42
42
|
level?: number;
|
|
43
43
|
/** Maximum level */
|
|
44
44
|
maxLevel?: number;
|
|
45
|
-
/** Event emitted on long press: UI:{longPressEvent} */
|
|
46
|
-
longPressEvent?:
|
|
45
|
+
/** Event emitted on long press: UI:{longPressEvent} (payload: longPressPayload spread — variable) */
|
|
46
|
+
longPressEvent?: EventEmit<EventPayload>;
|
|
47
47
|
/** Additional payload for long-press events */
|
|
48
48
|
longPressPayload?: EventPayload;
|
|
49
49
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Pure UI molecule with no entity binding.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import type { EventEmit } from '@almadar/core';
|
|
9
10
|
export interface CarouselProps<T = Record<string, unknown>> {
|
|
10
11
|
/** Array of items to display as slides */
|
|
11
12
|
items: T[];
|
|
@@ -24,7 +25,9 @@ export interface CarouselProps<T = Record<string, unknown>> {
|
|
|
24
25
|
/** Enable infinite loop */
|
|
25
26
|
loop?: boolean;
|
|
26
27
|
/** Declarative event name for slide change */
|
|
27
|
-
slideChangeEvent?:
|
|
28
|
+
slideChangeEvent?: EventEmit<{
|
|
29
|
+
index: number;
|
|
30
|
+
}>;
|
|
28
31
|
/** Payload to include with the slide change event */
|
|
29
32
|
slideChangePayload?: Record<string, unknown>;
|
|
30
33
|
/** Additional CSS classes */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { EventEmit } from "@almadar/core";
|
|
2
3
|
import { LucideIcon } from "lucide-react";
|
|
3
4
|
export interface EmptyStateProps {
|
|
4
5
|
/**
|
|
@@ -20,6 +21,6 @@ export interface EmptyStateProps {
|
|
|
20
21
|
/** Variant for color styling */
|
|
21
22
|
variant?: "default" | "success" | "error" | "warning" | "info";
|
|
22
23
|
/** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
|
|
23
|
-
actionEvent?: string
|
|
24
|
+
actionEvent?: EventEmit<Record<string, never>>;
|
|
24
25
|
}
|
|
25
26
|
export declare const EmptyState: React.FC<EmptyStateProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { EventEmit } from "@almadar/core";
|
|
2
3
|
export interface ErrorStateProps {
|
|
3
4
|
title?: string;
|
|
4
5
|
/** Error message to display */
|
|
@@ -8,6 +9,6 @@ export interface ErrorStateProps {
|
|
|
8
9
|
onRetry?: () => void;
|
|
9
10
|
className?: string;
|
|
10
11
|
/** Declarative retry event — emits UI:{retryEvent} via eventBus when retry button is clicked */
|
|
11
|
-
retryEvent?: string
|
|
12
|
+
retryEvent?: EventEmit<Record<string, never>>;
|
|
12
13
|
}
|
|
13
14
|
export declare const ErrorState: React.FC<ErrorStateProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
export interface MapMarkerData {
|
|
2
3
|
/** Unique marker identifier */
|
|
3
4
|
id: string | number;
|
|
@@ -26,9 +27,12 @@ export interface MapViewProps {
|
|
|
26
27
|
/** Callback when the map is clicked (programmatic use) */
|
|
27
28
|
onMapClick?: (lat: number, lng: number) => void;
|
|
28
29
|
/** Event name dispatched via event bus when the map is clicked. Payload: { latitude, longitude } */
|
|
29
|
-
mapClickEvent?:
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
mapClickEvent?: EventEmit<{
|
|
31
|
+
latitude: number;
|
|
32
|
+
longitude: number;
|
|
33
|
+
}>;
|
|
34
|
+
/** Event name dispatched via event bus when a marker is clicked. Payload: full MapMarkerData spread. */
|
|
35
|
+
markerClickEvent?: EventEmit<MapMarkerData>;
|
|
32
36
|
/** Whether to show a pin at the clicked location */
|
|
33
37
|
showClickedPin?: boolean;
|
|
34
38
|
/** Additional CSS classes */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses theme-aware CSS variables for styling.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
9
10
|
export interface ModalProps {
|
|
10
11
|
/** Whether the modal is open (defaults to true when rendered by slot wrapper) */
|
|
@@ -21,7 +22,7 @@ export interface ModalProps {
|
|
|
21
22
|
closeOnEscape?: boolean;
|
|
22
23
|
className?: string;
|
|
23
24
|
/** Declarative close event — emits UI:{closeEvent} via eventBus when modal should close */
|
|
24
|
-
closeEvent?: string
|
|
25
|
+
closeEvent?: EventEmit<Record<string, never>>;
|
|
25
26
|
/** Enable swipe-down-to-close on mobile bottom sheet (default: true) */
|
|
26
27
|
swipeDownToClose?: boolean;
|
|
27
28
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses Button, Icon, Typography, and Input atoms.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export interface PaginationProps {
|
|
9
10
|
/**
|
|
10
11
|
* Current page (1-indexed)
|
|
@@ -59,8 +60,12 @@ export interface PaginationProps {
|
|
|
59
60
|
*/
|
|
60
61
|
className?: string;
|
|
61
62
|
/** Declarative page change event — emits UI:{pageChangeEvent} with { page } */
|
|
62
|
-
pageChangeEvent?:
|
|
63
|
+
pageChangeEvent?: EventEmit<{
|
|
64
|
+
page: number;
|
|
65
|
+
}>;
|
|
63
66
|
/** Declarative page size change event — emits UI:{pageSizeChangeEvent} with { pageSize } */
|
|
64
|
-
pageSizeChangeEvent?:
|
|
67
|
+
pageSizeChangeEvent?: EventEmit<{
|
|
68
|
+
pageSize: number;
|
|
69
|
+
}>;
|
|
65
70
|
}
|
|
66
71
|
export declare const Pagination: React.FC<PaginationProps>;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses Button, Typography atoms.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export interface SidePanelProps {
|
|
9
10
|
/**
|
|
10
11
|
* Panel title
|
|
@@ -42,6 +43,6 @@ export interface SidePanelProps {
|
|
|
42
43
|
*/
|
|
43
44
|
className?: string;
|
|
44
45
|
/** Declarative close event — emits UI:{closeEvent} via eventBus when panel should close */
|
|
45
|
-
closeEvent?: string
|
|
46
|
+
closeEvent?: EventEmit<Record<string, never>>;
|
|
46
47
|
}
|
|
47
48
|
export declare const SidePanel: React.FC<SidePanelProps>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import type { LucideIcon } from 'lucide-react';
|
|
9
|
+
import type { EventEmit } from '@almadar/core';
|
|
9
10
|
export interface TabItem {
|
|
10
11
|
/** Tab ID */
|
|
11
12
|
id: string;
|
|
@@ -36,7 +37,9 @@ export interface TabsProps {
|
|
|
36
37
|
/** Callback when tab changes */
|
|
37
38
|
onTabChange?: (tabId: string) => void;
|
|
38
39
|
/** Declarative tab change event — emits UI:{tabChangeEvent} with { tabId } */
|
|
39
|
-
tabChangeEvent?:
|
|
40
|
+
tabChangeEvent?: EventEmit<{
|
|
41
|
+
tabId: string;
|
|
42
|
+
}>;
|
|
40
43
|
/** Tab variant */
|
|
41
44
|
variant?: 'default' | 'pills' | 'underline';
|
|
42
45
|
/** Tab orientation */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses theme-aware CSS variables for styling.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export type ToastVariant = "success" | "error" | "info" | "warning";
|
|
9
10
|
export interface ToastProps {
|
|
10
11
|
/** Toast variant */
|
|
@@ -28,8 +29,8 @@ export interface ToastProps {
|
|
|
28
29
|
/** Additional CSS classes */
|
|
29
30
|
className?: string;
|
|
30
31
|
/** Declarative dismiss event — emits UI:{dismissEvent} via eventBus when toast is dismissed */
|
|
31
|
-
dismissEvent?: string
|
|
32
|
+
dismissEvent?: EventEmit<Record<string, never>>;
|
|
32
33
|
/** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
|
|
33
|
-
actionEvent?: string
|
|
34
|
+
actionEvent?: EventEmit<Record<string, never>>;
|
|
34
35
|
}
|
|
35
36
|
export declare const Toast: React.FC<ToastProps>;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Uses wireframe theme styling (high contrast, sharp edges).
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
+
import type { EventEmit } from "@almadar/core";
|
|
10
11
|
/**
|
|
11
12
|
* Step info needed by WizardProgress.
|
|
12
13
|
* Compatible with WizardContainer's WizardStep (subset of fields).
|
|
@@ -33,7 +34,9 @@ export interface WizardProgressProps {
|
|
|
33
34
|
/** Additional CSS classes */
|
|
34
35
|
className?: string;
|
|
35
36
|
/** Declarative step click event — emits UI:{stepClickEvent} with { stepIndex } */
|
|
36
|
-
stepClickEvent?:
|
|
37
|
+
stepClickEvent?: EventEmit<{
|
|
38
|
+
stepIndex: number;
|
|
39
|
+
}>;
|
|
37
40
|
}
|
|
38
41
|
/**
|
|
39
42
|
* WizardProgress - Step progress indicator
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { EventEmit } from '@almadar/core';
|
|
2
3
|
export interface ActionButtonConfig {
|
|
3
4
|
/** Unique identifier */
|
|
4
5
|
id: string;
|
|
@@ -18,7 +19,10 @@ export interface ActionButtonsProps {
|
|
|
18
19
|
/** Called when a button is pressed/released */
|
|
19
20
|
onAction?: (id: string, pressed: boolean) => void;
|
|
20
21
|
/** Declarative event name emitted on action via useEventBus */
|
|
21
|
-
actionEvent?:
|
|
22
|
+
actionEvent?: EventEmit<{
|
|
23
|
+
id: string;
|
|
24
|
+
pressed: boolean;
|
|
25
|
+
}>;
|
|
22
26
|
/** Layout variant */
|
|
23
27
|
layout?: 'horizontal' | 'vertical' | 'diamond';
|
|
24
28
|
/** Size variant */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { EventEmit } from '@almadar/core';
|
|
2
3
|
export interface CraftingIngredient {
|
|
3
4
|
/** Icon component or emoji */
|
|
4
5
|
icon?: React.ReactNode;
|
|
@@ -23,7 +24,9 @@ export interface CraftingRecipeProps {
|
|
|
23
24
|
/** Callback when the craft button is clicked */
|
|
24
25
|
onCraft?: () => void;
|
|
25
26
|
/** Event bus event name for crafting */
|
|
26
|
-
craftEvent?:
|
|
27
|
+
craftEvent?: EventEmit<{
|
|
28
|
+
output: string;
|
|
29
|
+
}>;
|
|
27
30
|
/** Additional CSS classes */
|
|
28
31
|
className?: string;
|
|
29
32
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
export type DPadDirection = 'up' | 'down' | 'left' | 'right';
|
|
2
3
|
/** Event Contract:
|
|
3
4
|
* Emits: UI:DIRECTION
|
|
@@ -6,7 +7,10 @@ export interface DPadProps {
|
|
|
6
7
|
/** Called when a direction is pressed/released */
|
|
7
8
|
onDirection?: (direction: DPadDirection, pressed: boolean) => void;
|
|
8
9
|
/** Declarative event name emitted on direction press/release via useEventBus */
|
|
9
|
-
directionEvent?:
|
|
10
|
+
directionEvent?: EventEmit<{
|
|
11
|
+
direction: DPadDirection;
|
|
12
|
+
pressed: boolean;
|
|
13
|
+
}>;
|
|
10
14
|
/** Size variant */
|
|
11
15
|
size?: 'sm' | 'md' | 'lg';
|
|
12
16
|
/** Whether to include diagonal buttons */
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* concern analogous to Form's `formData`.
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import type { EventPayload } from '@almadar/core';
|
|
15
|
+
import type { EventEmit, EventPayload } from '@almadar/core';
|
|
16
16
|
export type DialogueChoice = EventPayload & {
|
|
17
17
|
text: string;
|
|
18
18
|
action?: string;
|
|
@@ -46,11 +46,13 @@ export interface DialogueBoxProps {
|
|
|
46
46
|
/** Called when dialogue is advanced (no choices) */
|
|
47
47
|
onAdvance?: () => void;
|
|
48
48
|
/** Declarative event: emits UI:{completeEvent} when text animation completes */
|
|
49
|
-
completeEvent?: string
|
|
50
|
-
/** Declarative event: emits UI:{choiceEvent} with { choice } when a choice is selected */
|
|
51
|
-
choiceEvent?:
|
|
49
|
+
completeEvent?: EventEmit<Record<string, never>>;
|
|
50
|
+
/** Declarative event: emits UI:{choiceEvent} with { choice: DialogueChoice } when a choice is selected */
|
|
51
|
+
choiceEvent?: EventEmit<{
|
|
52
|
+
choice: DialogueChoice;
|
|
53
|
+
}>;
|
|
52
54
|
/** Declarative event: emits UI:{advanceEvent} when dialogue is advanced */
|
|
53
|
-
advanceEvent?: string
|
|
55
|
+
advanceEvent?: EventEmit<Record<string, never>>;
|
|
54
56
|
/** Optional className */
|
|
55
57
|
className?: string;
|
|
56
58
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { EventEmit } from '@almadar/core';
|
|
2
3
|
export interface InventoryGridItem {
|
|
3
4
|
id: string;
|
|
4
5
|
icon?: React.ReactNode;
|
|
@@ -18,7 +19,9 @@ export interface InventoryGridProps {
|
|
|
18
19
|
/** Callback when an item is selected */
|
|
19
20
|
onSelect?: (id: string) => void;
|
|
20
21
|
/** Event bus event name for selection */
|
|
21
|
-
selectEvent?:
|
|
22
|
+
selectEvent?: EventEmit<{
|
|
23
|
+
id: string;
|
|
24
|
+
}>;
|
|
22
25
|
/** Size variant for all item slots */
|
|
23
26
|
size?: 'sm' | 'md' | 'lg';
|
|
24
27
|
/** Additional CSS classes */
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Local state is hover/tooltip only — rendering-only concerns.
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import type { EventPayload } from "@almadar/core";
|
|
14
|
+
import type { EventEmit, EventPayload } from "@almadar/core";
|
|
15
15
|
export type InventoryItem = EventPayload & {
|
|
16
16
|
id: string;
|
|
17
17
|
type: string;
|
|
@@ -36,11 +36,17 @@ export interface InventoryPanelProps {
|
|
|
36
36
|
/** Called when an item is dropped */
|
|
37
37
|
onDropItem?: (item: InventoryItem) => void;
|
|
38
38
|
/** Declarative event: emits UI:{selectSlotEvent} with { index } when a slot is selected */
|
|
39
|
-
selectSlotEvent?:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/** Declarative event: emits UI:{
|
|
43
|
-
|
|
39
|
+
selectSlotEvent?: EventEmit<{
|
|
40
|
+
index: number;
|
|
41
|
+
}>;
|
|
42
|
+
/** Declarative event: emits UI:{useItemEvent} with { item: InventoryItem } when an item is used */
|
|
43
|
+
useItemEvent?: EventEmit<{
|
|
44
|
+
item: InventoryItem;
|
|
45
|
+
}>;
|
|
46
|
+
/** Declarative event: emits UI:{dropItemEvent} with { item: InventoryItem } when an item is dropped */
|
|
47
|
+
dropItemEvent?: EventEmit<{
|
|
48
|
+
item: InventoryItem;
|
|
49
|
+
}>;
|
|
44
50
|
/** Show item tooltips on hover */
|
|
45
51
|
showTooltips?: boolean;
|
|
46
52
|
/** Optional className */
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* @packageDocumentation
|
|
25
25
|
*/
|
|
26
26
|
import * as React from 'react';
|
|
27
|
+
import type { EventEmit } from '@almadar/core';
|
|
27
28
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../../organisms/game/types/isometric';
|
|
28
29
|
import type { ResolvedFrame } from '../../organisms/game/types/spriteAnimation';
|
|
29
30
|
/** Event Contract:
|
|
@@ -67,13 +68,21 @@ export interface IsometricCanvasProps {
|
|
|
67
68
|
onTileHover?: (x: number, y: number) => void;
|
|
68
69
|
onTileLeave?: () => void;
|
|
69
70
|
/** Declarative event: emits UI:{tileClickEvent} with { x, y } on tile click */
|
|
70
|
-
tileClickEvent?:
|
|
71
|
+
tileClickEvent?: EventEmit<{
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
}>;
|
|
71
75
|
/** Declarative event: emits UI:{unitClickEvent} with { unitId } on unit click */
|
|
72
|
-
unitClickEvent?:
|
|
76
|
+
unitClickEvent?: EventEmit<{
|
|
77
|
+
unitId: string;
|
|
78
|
+
}>;
|
|
73
79
|
/** Declarative event: emits UI:{tileHoverEvent} with { x, y } on tile hover */
|
|
74
|
-
tileHoverEvent?:
|
|
80
|
+
tileHoverEvent?: EventEmit<{
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
}>;
|
|
75
84
|
/** Declarative event: emits UI:{tileLeaveEvent} with {} on tile leave */
|
|
76
|
-
tileLeaveEvent?: string
|
|
85
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
77
86
|
/** Render scale (0.4 = 40% zoom) */
|
|
78
87
|
scale?: number;
|
|
79
88
|
/** Show debug grid lines and coordinates */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
export interface PlatformerPlatform {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -39,10 +40,14 @@ export interface PlatformerCanvasProps {
|
|
|
39
40
|
/** Base URL prefix for asset URLs */
|
|
40
41
|
assetBaseUrl?: string;
|
|
41
42
|
/** Event names for keyboard controls */
|
|
42
|
-
leftEvent?:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
leftEvent?: EventEmit<{
|
|
44
|
+
direction: number;
|
|
45
|
+
}>;
|
|
46
|
+
rightEvent?: EventEmit<{
|
|
47
|
+
direction: number;
|
|
48
|
+
}>;
|
|
49
|
+
jumpEvent?: EventEmit<Record<string, never>>;
|
|
50
|
+
stopEvent?: EventEmit<Record<string, never>>;
|
|
46
51
|
/** Additional CSS classes */
|
|
47
52
|
className?: string;
|
|
48
53
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - className for external styling
|
|
12
12
|
*/
|
|
13
13
|
import React from "react";
|
|
14
|
-
import type { EventPayload } from "@almadar/core";
|
|
14
|
+
import type { EventEmit, EventPayload } from "@almadar/core";
|
|
15
15
|
export type GraphNode = EventPayload & {
|
|
16
16
|
id: string;
|
|
17
17
|
label?: string;
|
|
@@ -55,7 +55,9 @@ export interface GraphCanvasProps {
|
|
|
55
55
|
/** On node click */
|
|
56
56
|
onNodeClick?: (node: GraphNode) => void;
|
|
57
57
|
/** Node click event */
|
|
58
|
-
nodeClickEvent?:
|
|
58
|
+
nodeClickEvent?: EventEmit<{
|
|
59
|
+
id: string;
|
|
60
|
+
}>;
|
|
59
61
|
/** Layout algorithm */
|
|
60
62
|
layout?: "force" | "circular" | "grid";
|
|
61
63
|
/** Entity name for schema-driven auto-fetch */
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - className for external styling
|
|
12
12
|
*/
|
|
13
13
|
import React from "react";
|
|
14
|
+
import type { EventEmit } from "@almadar/core";
|
|
14
15
|
import type { EntityDisplayProps } from "./types";
|
|
15
16
|
import type { EntityRow } from "@almadar/core";
|
|
16
17
|
export type MediaItem = EntityRow & {
|
|
@@ -47,7 +48,9 @@ export interface MediaGalleryProps extends EntityDisplayProps<MediaItem> {
|
|
|
47
48
|
/** Selected item IDs */
|
|
48
49
|
selectedItems?: readonly string[];
|
|
49
50
|
/** Event name emitted when selection changes (emitted as UI:{selectionEvent}) */
|
|
50
|
-
selectionEvent?:
|
|
51
|
+
selectionEvent?: EventEmit<{
|
|
52
|
+
selection: string[];
|
|
53
|
+
}>;
|
|
51
54
|
/** Show upload button */
|
|
52
55
|
showUpload?: boolean;
|
|
53
56
|
/** Actions */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { EventEmit } from "@almadar/core";
|
|
2
3
|
import { LucideIcon } from "lucide-react";
|
|
3
4
|
export interface PageBreadcrumb {
|
|
4
5
|
label: string;
|
|
@@ -28,7 +29,7 @@ export interface PageHeaderProps {
|
|
|
28
29
|
/** Show back button */
|
|
29
30
|
showBack?: boolean;
|
|
30
31
|
/** Event to emit when back is clicked (default: BACK) */
|
|
31
|
-
backEvent?: string
|
|
32
|
+
backEvent?: EventEmit<Record<string, never>>;
|
|
32
33
|
/** Breadcrumbs */
|
|
33
34
|
breadcrumbs?: readonly PageBreadcrumb[];
|
|
34
35
|
/** Status badge */
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - logoClickEvent — emitted when logo/brand area clicked
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import type { EventEmit } from '@almadar/core';
|
|
13
14
|
import type { LucideIcon } from 'lucide-react';
|
|
14
15
|
export interface SidebarItem {
|
|
15
16
|
/** Item ID */
|
|
@@ -55,14 +56,16 @@ export interface SidebarProps {
|
|
|
55
56
|
/** Default collapsed state */
|
|
56
57
|
defaultCollapsed?: boolean;
|
|
57
58
|
/** Event emitted when collapse state changes, payload: { collapsed: boolean } */
|
|
58
|
-
collapseChangeEvent?:
|
|
59
|
+
collapseChangeEvent?: EventEmit<{
|
|
60
|
+
collapsed: boolean;
|
|
61
|
+
}>;
|
|
59
62
|
/** Hide the collapse/expand button */
|
|
60
63
|
hideCollapseButton?: boolean;
|
|
61
64
|
/** Show a close button (for mobile) */
|
|
62
65
|
showCloseButton?: boolean;
|
|
63
66
|
/** Event emitted when close button is clicked */
|
|
64
|
-
closeEvent?: string
|
|
67
|
+
closeEvent?: EventEmit<Record<string, never>>;
|
|
65
68
|
/** Event emitted when logo/brand is clicked */
|
|
66
|
-
logoClickEvent?: string
|
|
69
|
+
logoClickEvent?: EventEmit<Record<string, never>>;
|
|
67
70
|
}
|
|
68
71
|
export declare const Sidebar: React.FC<SidebarProps>;
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - className for external styling
|
|
12
12
|
*/
|
|
13
13
|
import React from "react";
|
|
14
|
+
import type { EventEmit } from "@almadar/core";
|
|
14
15
|
export interface SignaturePadProps {
|
|
15
16
|
/** Label above the pad */
|
|
16
17
|
label?: string;
|
|
@@ -29,9 +30,11 @@ export interface SignaturePadProps {
|
|
|
29
30
|
/** Callback when signature changes */
|
|
30
31
|
onChange?: (dataUrl: string | null) => void;
|
|
31
32
|
/** Event to emit on sign */
|
|
32
|
-
signEvent?:
|
|
33
|
+
signEvent?: EventEmit<{
|
|
34
|
+
signature: string;
|
|
35
|
+
}>;
|
|
33
36
|
/** Event to emit on clear */
|
|
34
|
-
clearEvent?: string
|
|
37
|
+
clearEvent?: EventEmit<Record<string, never>>;
|
|
35
38
|
/** Entity name for schema-driven context */
|
|
36
39
|
entity?: string;
|
|
37
40
|
/** Loading state */
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import type { EventEmit } from '@almadar/core';
|
|
21
22
|
import type { EntityDisplayProps } from '../types';
|
|
22
23
|
import type { IsometricTile, IsometricFeature } from './types/isometric';
|
|
23
24
|
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
@@ -153,19 +154,30 @@ export interface BattleBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
|
153
154
|
effectSpriteUrls?: string[];
|
|
154
155
|
resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
|
|
155
156
|
/** Emits UI:{tileClickEvent} with { x, y } on tile click */
|
|
156
|
-
tileClickEvent?:
|
|
157
|
+
tileClickEvent?: EventEmit<{
|
|
158
|
+
x: number;
|
|
159
|
+
y: number;
|
|
160
|
+
}>;
|
|
157
161
|
/** Emits UI:{unitClickEvent} with { unitId } on unit click */
|
|
158
|
-
unitClickEvent?:
|
|
162
|
+
unitClickEvent?: EventEmit<{
|
|
163
|
+
unitId: string;
|
|
164
|
+
}>;
|
|
159
165
|
/** Emits UI:{endTurnEvent} with {} on end turn */
|
|
160
|
-
endTurnEvent?: string
|
|
166
|
+
endTurnEvent?: EventEmit<Record<string, never>>;
|
|
161
167
|
/** Emits UI:{cancelEvent} with {} on cancel */
|
|
162
|
-
cancelEvent?: string
|
|
163
|
-
/** Emits UI:{gameEndEvent} with { result } on game end */
|
|
164
|
-
gameEndEvent?:
|
|
168
|
+
cancelEvent?: EventEmit<Record<string, never>>;
|
|
169
|
+
/** Emits UI:{gameEndEvent} with { result: 'victory' | 'defeat' } on game end */
|
|
170
|
+
gameEndEvent?: EventEmit<{
|
|
171
|
+
result: 'victory' | 'defeat';
|
|
172
|
+
}>;
|
|
165
173
|
/** Emits UI:{playAgainEvent} with {} on play again / reset */
|
|
166
|
-
playAgainEvent?: string
|
|
174
|
+
playAgainEvent?: EventEmit<Record<string, never>>;
|
|
167
175
|
/** Emits UI:{attackEvent} with { attackerId, targetId, damage } on attack */
|
|
168
|
-
attackEvent?:
|
|
176
|
+
attackEvent?: EventEmit<{
|
|
177
|
+
attackerId: string;
|
|
178
|
+
targetId: string;
|
|
179
|
+
damage: number;
|
|
180
|
+
}>;
|
|
169
181
|
className?: string;
|
|
170
182
|
}
|
|
171
183
|
export declare function BattleBoard({ entity, scale, unitScale, header, sidebar, actions, overlay, gameOverOverlay, onAttack, onGameEnd, onUnitMove, calculateDamage, onDrawEffects, hasActiveEffects, effectSpriteUrls, resolveUnitFrame, tileClickEvent, unitClickEvent, endTurnEvent, cancelEvent, gameEndEvent, playAgainEvent, attackEvent, className, }: BattleBoardProps): React.JSX.Element;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* @packageDocumentation
|
|
25
25
|
*/
|
|
26
26
|
import * as React from 'react';
|
|
27
|
+
import type { EventEmit } from '@almadar/core';
|
|
27
28
|
import type { CombatActionType, EffectAssetManifest } from './types/effects';
|
|
28
29
|
export type { CombatActionType } from './types/effects';
|
|
29
30
|
export type { EffectAssetManifest } from './types/effects';
|
|
@@ -41,7 +42,7 @@ export interface CanvasEffectProps {
|
|
|
41
42
|
/** Callback when the effect animation completes */
|
|
42
43
|
onComplete?: () => void;
|
|
43
44
|
/** Declarative event: emits UI:{completeEvent} when the effect animation completes */
|
|
44
|
-
completeEvent?: string
|
|
45
|
+
completeEvent?: EventEmit<Record<string, never>>;
|
|
45
46
|
/** Additional CSS classes */
|
|
46
47
|
className?: string;
|
|
47
48
|
/** Loading state indicator */
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
15
|
import React from 'react';
|
|
16
|
+
import type { EventEmit } from '@almadar/core';
|
|
16
17
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
17
18
|
/** Entity shape consumed by CastleBoard */
|
|
18
19
|
export interface CastleEntity {
|
|
@@ -71,11 +72,21 @@ export interface CastleBoardProps {
|
|
|
71
72
|
/** Called when any tile is clicked */
|
|
72
73
|
onTileClick?: (x: number, y: number) => void;
|
|
73
74
|
/** Event name to emit via event bus when a feature is clicked (emits UI:{featureClickEvent}) */
|
|
74
|
-
featureClickEvent?:
|
|
75
|
+
featureClickEvent?: EventEmit<{
|
|
76
|
+
featureId: string;
|
|
77
|
+
featureType: string;
|
|
78
|
+
x: number;
|
|
79
|
+
y: number;
|
|
80
|
+
}>;
|
|
75
81
|
/** Event name to emit via event bus when a unit is clicked (emits UI:{unitClickEvent}) */
|
|
76
|
-
unitClickEvent?:
|
|
82
|
+
unitClickEvent?: EventEmit<{
|
|
83
|
+
unitId: string;
|
|
84
|
+
}>;
|
|
77
85
|
/** Event name to emit via event bus when a tile is clicked (emits UI:{tileClickEvent}) */
|
|
78
|
-
tileClickEvent?:
|
|
86
|
+
tileClickEvent?: EventEmit<{
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
}>;
|
|
79
90
|
className?: string;
|
|
80
91
|
}
|
|
81
92
|
export declare function CastleBoard({ entity, scale, header, sidePanel, overlay, footer, onFeatureClick, onUnitClick, onTileClick, featureClickEvent, unitClickEvent, tileClickEvent, className, }: CastleBoardProps): React.JSX.Element;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* @packageDocumentation
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
+
import type { EventEmit } from '@almadar/core';
|
|
17
18
|
import * as THREE from 'three';
|
|
18
19
|
import { AssetLoader } from './three/loaders/AssetLoader';
|
|
19
20
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
@@ -106,21 +107,64 @@ export interface GameCanvas3DProps {
|
|
|
106
107
|
/** URLs to preload */
|
|
107
108
|
preloadAssets?: string[];
|
|
108
109
|
/** Declarative event: tile click */
|
|
109
|
-
tileClickEvent?:
|
|
110
|
+
tileClickEvent?: EventEmit<{
|
|
111
|
+
tileId: string;
|
|
112
|
+
x: number;
|
|
113
|
+
z: number;
|
|
114
|
+
type?: string;
|
|
115
|
+
terrain?: string;
|
|
116
|
+
elevation?: number;
|
|
117
|
+
}>;
|
|
110
118
|
/** Declarative event: unit click */
|
|
111
|
-
unitClickEvent?:
|
|
119
|
+
unitClickEvent?: EventEmit<{
|
|
120
|
+
unitId: string;
|
|
121
|
+
x: number;
|
|
122
|
+
z: number;
|
|
123
|
+
unitType?: string;
|
|
124
|
+
name?: string;
|
|
125
|
+
team?: string;
|
|
126
|
+
faction?: string;
|
|
127
|
+
health?: number;
|
|
128
|
+
maxHealth?: number;
|
|
129
|
+
}>;
|
|
112
130
|
/** Declarative event: feature click */
|
|
113
|
-
featureClickEvent?:
|
|
131
|
+
featureClickEvent?: EventEmit<{
|
|
132
|
+
featureId: string;
|
|
133
|
+
x: number;
|
|
134
|
+
z: number;
|
|
135
|
+
type?: string;
|
|
136
|
+
elevation?: number;
|
|
137
|
+
}>;
|
|
114
138
|
/** Declarative event: canvas click */
|
|
115
|
-
canvasClickEvent?:
|
|
139
|
+
canvasClickEvent?: EventEmit<{
|
|
140
|
+
clientX: number;
|
|
141
|
+
clientY: number;
|
|
142
|
+
button: number;
|
|
143
|
+
}>;
|
|
116
144
|
/** Declarative event: tile hover */
|
|
117
|
-
tileHoverEvent?:
|
|
145
|
+
tileHoverEvent?: EventEmit<{
|
|
146
|
+
tileId: string;
|
|
147
|
+
x: number;
|
|
148
|
+
z: number;
|
|
149
|
+
type?: string;
|
|
150
|
+
}>;
|
|
118
151
|
/** Declarative event: tile leave */
|
|
119
|
-
tileLeaveEvent?: string
|
|
152
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
120
153
|
/** Declarative event: unit animation */
|
|
121
|
-
unitAnimationEvent?:
|
|
154
|
+
unitAnimationEvent?: EventEmit<{
|
|
155
|
+
unitId: string;
|
|
156
|
+
state: string;
|
|
157
|
+
timestamp: number;
|
|
158
|
+
}>;
|
|
122
159
|
/** Declarative event: camera change */
|
|
123
|
-
cameraChangeEvent?:
|
|
160
|
+
cameraChangeEvent?: EventEmit<{
|
|
161
|
+
position: {
|
|
162
|
+
x: number;
|
|
163
|
+
y: number;
|
|
164
|
+
z: number;
|
|
165
|
+
};
|
|
166
|
+
timestamp: number;
|
|
167
|
+
}>;
|
|
124
168
|
/** Loading message */
|
|
125
169
|
loadingMessage?: string;
|
|
126
170
|
/** Whether to use instancing for tiles */
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import type { EventEmit } from '@almadar/core';
|
|
21
22
|
import { type TraitStateMachineDefinition } from './TraitStateViewer';
|
|
22
23
|
/** Data shape for a slot's equipped item */
|
|
23
24
|
export interface SlotItemData {
|
|
@@ -79,9 +80,13 @@ export interface TraitSlotProps {
|
|
|
79
80
|
/** Remove handler */
|
|
80
81
|
onRemove?: () => void;
|
|
81
82
|
/** Emits UI:{clickEvent} with { slotNumber } */
|
|
82
|
-
clickEvent?:
|
|
83
|
+
clickEvent?: EventEmit<{
|
|
84
|
+
slotNumber: number;
|
|
85
|
+
}>;
|
|
83
86
|
/** Emits UI:{removeEvent} with { slotNumber } */
|
|
84
|
-
removeEvent?:
|
|
87
|
+
removeEvent?: EventEmit<{
|
|
88
|
+
slotNumber: number;
|
|
89
|
+
}>;
|
|
85
90
|
}
|
|
86
91
|
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;
|
|
87
92
|
export declare namespace TraitSlot {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
+
import type { EventEmit } from '@almadar/core';
|
|
22
23
|
import type { IsometricFeature } from './types/isometric';
|
|
23
24
|
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
24
25
|
/** A hero on the world map */
|
|
@@ -125,15 +126,31 @@ export interface WorldMapBoardProps {
|
|
|
125
126
|
y: number;
|
|
126
127
|
}, range: number) => boolean;
|
|
127
128
|
/** Emits UI:{heroSelectEvent} with { heroId } */
|
|
128
|
-
heroSelectEvent?:
|
|
129
|
+
heroSelectEvent?: EventEmit<{
|
|
130
|
+
heroId: string;
|
|
131
|
+
}>;
|
|
129
132
|
/** Emits UI:{heroMoveEvent} with { heroId, toX, toY } */
|
|
130
|
-
heroMoveEvent?:
|
|
133
|
+
heroMoveEvent?: EventEmit<{
|
|
134
|
+
heroId: string;
|
|
135
|
+
toX: number;
|
|
136
|
+
toY: number;
|
|
137
|
+
}>;
|
|
131
138
|
/** Emits UI:{battleEncounterEvent} with { attackerId, defenderId } */
|
|
132
|
-
battleEncounterEvent?:
|
|
139
|
+
battleEncounterEvent?: EventEmit<{
|
|
140
|
+
attackerId: string;
|
|
141
|
+
defenderId: string;
|
|
142
|
+
}>;
|
|
133
143
|
/** Emits UI:{featureEnterEvent} with { heroId, feature, hex } */
|
|
134
|
-
featureEnterEvent?:
|
|
144
|
+
featureEnterEvent?: EventEmit<{
|
|
145
|
+
heroId: string;
|
|
146
|
+
feature: string;
|
|
147
|
+
hex: MapHex;
|
|
148
|
+
}>;
|
|
135
149
|
/** Emits UI:{tileClickEvent} with { x, y } */
|
|
136
|
-
tileClickEvent?:
|
|
150
|
+
tileClickEvent?: EventEmit<{
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
}>;
|
|
137
154
|
/** Header / top bar */
|
|
138
155
|
header?: (ctx: WorldMapSlotContext) => React.ReactNode;
|
|
139
156
|
/** Side panel (hero detail, hero lists, etc.) */
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
import type { BattleUnit, BattlePhase } from '../BattleBoard';
|
|
2
3
|
export interface BattleStateEventConfig {
|
|
3
|
-
tileClickEvent?:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
tileClickEvent?: EventEmit<{
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}>;
|
|
8
|
+
unitClickEvent?: EventEmit<{
|
|
9
|
+
unitId: string;
|
|
10
|
+
}>;
|
|
11
|
+
endTurnEvent?: EventEmit<Record<string, never>>;
|
|
12
|
+
cancelEvent?: EventEmit<Record<string, never>>;
|
|
13
|
+
gameEndEvent?: EventEmit<{
|
|
14
|
+
result: 'victory' | 'defeat';
|
|
15
|
+
}>;
|
|
16
|
+
playAgainEvent?: EventEmit<Record<string, never>>;
|
|
17
|
+
attackEvent?: EventEmit<{
|
|
18
|
+
attackerId: string;
|
|
19
|
+
targetId: string;
|
|
20
|
+
damage: number;
|
|
21
|
+
}>;
|
|
10
22
|
}
|
|
11
23
|
export interface BattleStateCallbacks {
|
|
12
24
|
/** Called when a unit attacks another */
|
|
@@ -9,6 +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
13
|
import type { EntityDisplayProps } from '../../../types';
|
|
13
14
|
export interface BuilderComponent {
|
|
14
15
|
id: string;
|
|
@@ -44,7 +45,10 @@ export interface BuilderPuzzleEntity {
|
|
|
44
45
|
}
|
|
45
46
|
export interface BuilderBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
46
47
|
entity: BuilderPuzzleEntity;
|
|
47
|
-
completeEvent?:
|
|
48
|
+
completeEvent?: EventEmit<{
|
|
49
|
+
success: boolean;
|
|
50
|
+
attempts: number;
|
|
51
|
+
}>;
|
|
48
52
|
}
|
|
49
53
|
export declare function BuilderBoard({ entity, completeEvent, className, }: BuilderBoardProps): React.JSX.Element;
|
|
50
54
|
export declare namespace BuilderBoard {
|
|
@@ -10,6 +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
14
|
import type { EntityDisplayProps } from '../../../types';
|
|
14
15
|
export interface ClassifierItem {
|
|
15
16
|
id: string;
|
|
@@ -45,7 +46,10 @@ export interface ClassifierPuzzleEntity {
|
|
|
45
46
|
}
|
|
46
47
|
export interface ClassifierBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
47
48
|
entity: ClassifierPuzzleEntity;
|
|
48
|
-
completeEvent?:
|
|
49
|
+
completeEvent?: EventEmit<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
attempts: number;
|
|
52
|
+
}>;
|
|
49
53
|
}
|
|
50
54
|
export declare function ClassifierBoard({ entity, completeEvent, className, }: ClassifierBoardProps): React.JSX.Element;
|
|
51
55
|
export declare namespace ClassifierBoard {
|
|
@@ -9,6 +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
13
|
import type { EntityDisplayProps } from '../../../types';
|
|
13
14
|
export interface DebuggerLine {
|
|
14
15
|
id: string;
|
|
@@ -37,7 +38,10 @@ export interface DebuggerPuzzleEntity {
|
|
|
37
38
|
}
|
|
38
39
|
export interface DebuggerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
39
40
|
entity: DebuggerPuzzleEntity;
|
|
40
|
-
completeEvent?:
|
|
41
|
+
completeEvent?: EventEmit<{
|
|
42
|
+
success: boolean;
|
|
43
|
+
attempts: number;
|
|
44
|
+
}>;
|
|
41
45
|
}
|
|
42
46
|
export declare function DebuggerBoard({ entity, completeEvent, className, }: DebuggerBoardProps): React.JSX.Element;
|
|
43
47
|
export declare namespace DebuggerBoard {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
+
import type { EventEmit } from '@almadar/core';
|
|
14
15
|
import type { EntityDisplayProps } from '../../../types';
|
|
15
16
|
import { type PuzzleObjectDef } from './ObjectRulePanel';
|
|
16
17
|
export interface EventHandlerPuzzleEntity {
|
|
@@ -44,9 +45,11 @@ export interface EventHandlerBoardProps extends Omit<EntityDisplayProps, 'entity
|
|
|
44
45
|
/** Playback speed in ms per event */
|
|
45
46
|
stepDurationMs?: number;
|
|
46
47
|
/** Emits UI:{playEvent} */
|
|
47
|
-
playEvent?: string
|
|
48
|
+
playEvent?: EventEmit<Record<string, never>>;
|
|
48
49
|
/** Emits UI:{completeEvent} with { success } */
|
|
49
|
-
completeEvent?:
|
|
50
|
+
completeEvent?: EventEmit<{
|
|
51
|
+
success: boolean;
|
|
52
|
+
}>;
|
|
50
53
|
}
|
|
51
54
|
export declare function EventHandlerBoard({ entity, stepDurationMs, playEvent, completeEvent, className, }: EventHandlerBoardProps): React.JSX.Element;
|
|
52
55
|
export declare namespace EventHandlerBoard {
|
|
@@ -11,6 +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
15
|
import type { EntityDisplayProps } from '../../../types';
|
|
15
16
|
export interface NegotiatorAction {
|
|
16
17
|
id: string;
|
|
@@ -46,7 +47,10 @@ export interface NegotiatorPuzzleEntity {
|
|
|
46
47
|
}
|
|
47
48
|
export interface NegotiatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
48
49
|
entity: NegotiatorPuzzleEntity;
|
|
49
|
-
completeEvent?:
|
|
50
|
+
completeEvent?: EventEmit<{
|
|
51
|
+
success: boolean;
|
|
52
|
+
score: number;
|
|
53
|
+
}>;
|
|
50
54
|
}
|
|
51
55
|
export declare function NegotiatorBoard({ entity, completeEvent, className, }: NegotiatorBoardProps): React.JSX.Element;
|
|
52
56
|
export declare namespace NegotiatorBoard {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import type { EventEmit } from '@almadar/core';
|
|
21
22
|
import type { SlotItemData } from '../../TraitSlot';
|
|
22
23
|
import type { EntityDisplayProps } from '../../../types';
|
|
23
24
|
export interface SequencerPuzzleEntity {
|
|
@@ -61,9 +62,14 @@ export interface SequencerBoardProps extends Omit<EntityDisplayProps, 'entity'>
|
|
|
61
62
|
/** Playback speed in ms per step */
|
|
62
63
|
stepDurationMs?: number;
|
|
63
64
|
/** Emits UI:{playEvent} with { sequence: string[] } */
|
|
64
|
-
playEvent?:
|
|
65
|
+
playEvent?: EventEmit<{
|
|
66
|
+
sequence: string[];
|
|
67
|
+
}>;
|
|
65
68
|
/** Emits UI:{completeEvent} with { success: boolean } */
|
|
66
|
-
completeEvent?:
|
|
69
|
+
completeEvent?: EventEmit<{
|
|
70
|
+
success: boolean;
|
|
71
|
+
sequence: string[];
|
|
72
|
+
}>;
|
|
67
73
|
}
|
|
68
74
|
export declare function SequencerBoard({ entity, categoryColors, stepDurationMs, playEvent, completeEvent, className, }: SequencerBoardProps): React.JSX.Element;
|
|
69
75
|
export declare namespace SequencerBoard {
|
|
@@ -10,6 +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
14
|
import type { EntityDisplayProps } from '../../../types';
|
|
14
15
|
export interface SimulatorParameter {
|
|
15
16
|
id: string;
|
|
@@ -46,7 +47,10 @@ export interface SimulatorPuzzleEntity {
|
|
|
46
47
|
}
|
|
47
48
|
export interface SimulatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
48
49
|
entity: SimulatorPuzzleEntity;
|
|
49
|
-
completeEvent?:
|
|
50
|
+
completeEvent?: EventEmit<{
|
|
51
|
+
success: boolean;
|
|
52
|
+
attempts: number;
|
|
53
|
+
}>;
|
|
50
54
|
}
|
|
51
55
|
export declare function SimulatorBoard({ entity, completeEvent, className, }: SimulatorBoardProps): React.JSX.Element;
|
|
52
56
|
export declare namespace SimulatorBoard {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
+
import type { EventEmit } from '@almadar/core';
|
|
11
12
|
import type { EntityDisplayProps } from '../../../types';
|
|
12
13
|
import { type VariableDef } from './VariablePanel';
|
|
13
14
|
export interface StateArchitectTransition {
|
|
@@ -65,9 +66,12 @@ export interface StateArchitectBoardProps extends Omit<EntityDisplayProps, 'enti
|
|
|
65
66
|
/** Playback speed */
|
|
66
67
|
stepDurationMs?: number;
|
|
67
68
|
/** Emits UI:{testEvent} */
|
|
68
|
-
testEvent?: string
|
|
69
|
+
testEvent?: EventEmit<Record<string, never>>;
|
|
69
70
|
/** Emits UI:{completeEvent} with { success, passedTests } */
|
|
70
|
-
completeEvent?:
|
|
71
|
+
completeEvent?: EventEmit<{
|
|
72
|
+
success: boolean;
|
|
73
|
+
passedTests: number;
|
|
74
|
+
}>;
|
|
71
75
|
}
|
|
72
76
|
export declare function StateArchitectBoard({ entity, stepDurationMs, testEvent, completeEvent, className, }: StateArchitectBoardProps): React.JSX.Element;
|
|
73
77
|
export declare namespace StateArchitectBoard {
|
|
@@ -1,21 +1,65 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../../types/isometric';
|
|
2
3
|
export interface GameCanvas3DEventConfig {
|
|
3
4
|
/** Event name for tile clicks */
|
|
4
|
-
tileClickEvent?:
|
|
5
|
+
tileClickEvent?: EventEmit<{
|
|
6
|
+
tileId: string;
|
|
7
|
+
x: number;
|
|
8
|
+
z: number;
|
|
9
|
+
type?: string;
|
|
10
|
+
terrain?: string;
|
|
11
|
+
elevation?: number;
|
|
12
|
+
}>;
|
|
5
13
|
/** Event name for unit clicks */
|
|
6
|
-
unitClickEvent?:
|
|
14
|
+
unitClickEvent?: EventEmit<{
|
|
15
|
+
unitId: string;
|
|
16
|
+
x: number;
|
|
17
|
+
z: number;
|
|
18
|
+
unitType?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
team?: string;
|
|
21
|
+
faction?: string;
|
|
22
|
+
health?: number;
|
|
23
|
+
maxHealth?: number;
|
|
24
|
+
}>;
|
|
7
25
|
/** Event name for feature clicks */
|
|
8
|
-
featureClickEvent?:
|
|
26
|
+
featureClickEvent?: EventEmit<{
|
|
27
|
+
featureId: string;
|
|
28
|
+
x: number;
|
|
29
|
+
z: number;
|
|
30
|
+
type?: string;
|
|
31
|
+
elevation?: number;
|
|
32
|
+
}>;
|
|
9
33
|
/** Event name for canvas clicks */
|
|
10
|
-
canvasClickEvent?:
|
|
34
|
+
canvasClickEvent?: EventEmit<{
|
|
35
|
+
clientX: number;
|
|
36
|
+
clientY: number;
|
|
37
|
+
button: number;
|
|
38
|
+
}>;
|
|
11
39
|
/** Event name for tile hover */
|
|
12
|
-
tileHoverEvent?:
|
|
40
|
+
tileHoverEvent?: EventEmit<{
|
|
41
|
+
tileId: string;
|
|
42
|
+
x: number;
|
|
43
|
+
z: number;
|
|
44
|
+
type?: string;
|
|
45
|
+
}>;
|
|
13
46
|
/** Event name for tile leave */
|
|
14
|
-
tileLeaveEvent?: string
|
|
47
|
+
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
15
48
|
/** Event name for unit animation changes */
|
|
16
|
-
unitAnimationEvent?:
|
|
49
|
+
unitAnimationEvent?: EventEmit<{
|
|
50
|
+
unitId: string;
|
|
51
|
+
state: string;
|
|
52
|
+
timestamp: number;
|
|
53
|
+
}>;
|
|
17
54
|
/** Event name for camera changes */
|
|
18
|
-
cameraChangeEvent?:
|
|
55
|
+
cameraChangeEvent?: EventEmit<{
|
|
56
|
+
position: {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
z: number;
|
|
60
|
+
};
|
|
61
|
+
timestamp: number;
|
|
62
|
+
}>;
|
|
19
63
|
}
|
|
20
64
|
/** Minimal mouse event interface — satisfied by both React.MouseEvent and ThreeEvent<MouseEvent> */
|
|
21
65
|
export interface MinimalMouseEvent {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.22.0",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@almadar/core": "^7.
|
|
121
|
+
"@almadar/core": "^7.10.0",
|
|
122
122
|
"@almadar/evaluator": ">=2.9.2",
|
|
123
123
|
"@almadar/patterns": ">=2.17.1",
|
|
124
124
|
"@almadar/runtime": "^6.0.0",
|