@almadar/ui 4.21.0 → 4.22.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 +17 -13
- package/dist/avl/index.js +17 -13
- package/dist/components/index.cjs +17 -13
- package/dist/components/index.js +17 -13
- 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/DataGrid.d.ts +9 -3
- package/dist/components/molecules/DataList.d.ts +9 -3
- 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/dist/providers/index.cjs +17 -13
- package/dist/providers/index.js +17 -13
- package/dist/runtime/index.cjs +17 -13
- package/dist/runtime/index.js +17 -13
- package/package.json +2 -2
|
@@ -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.) */
|