@almadar/ui 2.13.2 → 2.14.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.
Files changed (34) hide show
  1. package/dist/chunk-4N3BAPDB.js +1667 -0
  2. package/dist/{chunk-PERGHHON.js → chunk-IRIGCHP4.js} +2 -12
  3. package/dist/{chunk-ZW5N4AUU.js → chunk-M7MOIE46.js} +3 -3
  4. package/dist/{chunk-Y7IHEYYE.js → chunk-QU2X55WH.js} +11 -1
  5. package/dist/{chunk-77CBR3Z7.js → chunk-SKWPSQHQ.js} +13448 -2279
  6. package/dist/{chunk-4ZBSL37D.js → chunk-XL7WB2O5.js} +415 -58
  7. package/dist/components/index.css +508 -0
  8. package/dist/components/index.js +769 -11187
  9. package/dist/components/organisms/game/three/index.js +49 -1709
  10. package/dist/hooks/index.js +2 -2
  11. package/dist/lib/index.js +1 -3
  12. package/dist/providers/index.css +599 -0
  13. package/dist/providers/index.js +5 -4
  14. package/dist/runtime/index.css +599 -0
  15. package/dist/runtime/index.js +6 -6
  16. package/package.json +5 -4
  17. package/dist/ThemeContext-D9xUORq5.d.ts +0 -105
  18. package/dist/chunk-42YQ6JVR.js +0 -48
  19. package/dist/chunk-WCTZ7WZX.js +0 -311
  20. package/dist/cn-C_ATNPvi.d.ts +0 -332
  21. package/dist/components/index.d.ts +0 -9788
  22. package/dist/components/organisms/game/three/index.d.ts +0 -1233
  23. package/dist/context/index.d.ts +0 -208
  24. package/dist/event-bus-types-CjJduURa.d.ts +0 -73
  25. package/dist/hooks/index.d.ts +0 -1221
  26. package/dist/isometric-ynNHVPZx.d.ts +0 -111
  27. package/dist/lib/index.d.ts +0 -320
  28. package/dist/locales/index.d.ts +0 -22
  29. package/dist/offline-executor-CHr4uAhf.d.ts +0 -401
  30. package/dist/providers/index.d.ts +0 -465
  31. package/dist/renderer/index.d.ts +0 -525
  32. package/dist/runtime/index.d.ts +0 -280
  33. package/dist/stores/index.d.ts +0 -151
  34. package/dist/useUISlots-BBjNvQtb.d.ts +0 -85
@@ -1,111 +0,0 @@
1
- /**
2
- * Isometric Game Types
3
- *
4
- * Type definitions for isometric grid rendering: tiles, units, features.
5
- * Used by IsometricCanvas and game hooks.
6
- *
7
- * @packageDocumentation
8
- */
9
- /** A single isometric tile on the grid */
10
- interface IsometricTile {
11
- /** Optional unique identifier (required for 3D rendering) */
12
- id?: string;
13
- /** Grid x coordinate */
14
- x: number;
15
- /** Grid y coordinate (2D) */
16
- y: number;
17
- /** Grid z coordinate (3D alternative to y) */
18
- z?: number;
19
- /** Terrain type key (e.g., 'grass', 'stone', 'water') - 2D */
20
- terrain?: string;
21
- /** Tile type for visual rendering (3D) */
22
- type?: string;
23
- /** Direct sprite URL override (bypasses getTerrainSprite resolver) */
24
- terrainSprite?: string;
25
- /** Whether units can traverse this tile (default true) */
26
- passable?: boolean;
27
- /** Movement cost for pathfinding (default 1) */
28
- movementCost?: number;
29
- /** Optional tile type for visual variants */
30
- tileType?: string;
31
- /** Elevation offset for 3D rendering */
32
- elevation?: number;
33
- }
34
- /** A unit positioned on the isometric grid */
35
- interface IsometricUnit {
36
- /** Unique unit identifier */
37
- id: string;
38
- /** Current grid position (2D format) */
39
- position?: {
40
- x: number;
41
- y: number;
42
- };
43
- /** Grid x coordinate (3D format) */
44
- x?: number;
45
- /** Grid y coordinate (3D format) */
46
- y?: number;
47
- /** Grid z coordinate (3D format) */
48
- z?: number;
49
- /** Static sprite URL (used when no sprite sheet animation) */
50
- sprite?: string;
51
- /** Unit archetype key for sprite resolution */
52
- unitType?: string;
53
- /** Hero identifier for sprite sheet lookup */
54
- heroId?: string;
55
- /** Display name rendered below the unit */
56
- name?: string;
57
- /** Team affiliation for coloring */
58
- team?: 'player' | 'enemy' | 'neutral';
59
- /** Faction for 3D rendering (player/enemy/neutral) */
60
- faction?: 'player' | 'enemy' | 'neutral';
61
- /** Current health */
62
- health?: number;
63
- /** Maximum health */
64
- maxHealth?: number;
65
- /** Trait attachments for state display */
66
- traits?: {
67
- name: string;
68
- currentState: string;
69
- states: string[];
70
- cooldown: number;
71
- }[];
72
- /** Previous position for movement trail ghost */
73
- previousPosition?: {
74
- x: number;
75
- y: number;
76
- };
77
- /** Elevation offset for 3D rendering */
78
- elevation?: number;
79
- }
80
- /** A map feature (resource, building, portal, etc.) */
81
- interface IsometricFeature {
82
- /** Optional unique identifier (required for 3D rendering) */
83
- id?: string;
84
- /** Grid x coordinate */
85
- x: number;
86
- /** Grid y coordinate (2D) */
87
- y: number;
88
- /** Grid z coordinate (3D alternative to y) */
89
- z?: number;
90
- /** Feature type key (e.g., 'goldMine', 'castle', 'portal') */
91
- type: string;
92
- /** Direct sprite URL override (bypasses getFeatureSprite resolver) */
93
- sprite?: string;
94
- /** 3D model URL (GLB format) for GameCanvas3D */
95
- assetUrl?: string;
96
- /** Color override for 3D rendering */
97
- color?: string;
98
- /** Elevation offset for 3D rendering */
99
- elevation?: number;
100
- }
101
- /** Camera state for pan/zoom */
102
- interface CameraState {
103
- /** Camera X offset in pixels */
104
- x: number;
105
- /** Camera Y offset in pixels */
106
- y: number;
107
- /** Zoom level (1.0 = 100%) */
108
- zoom: number;
109
- }
110
-
111
- export type { CameraState as C, IsometricTile as I, IsometricUnit as a, IsometricFeature as b };
@@ -1,320 +0,0 @@
1
- export { A as AssetLoadStatus, B as BridgeHealth, C as CheckStatus, a as ContentSegment, D as DEFAULT_CONFIG, b as DomEntityBox, c as DomLayoutData, d as DomOutputsBox, e as DomStateNode, f as DomTransitionLabel, g as DomTransitionPath, E as EffectTrace, h as EntityDefinition, i as EventLogEntry, R as RenderOptions, S as StateDefinition, j as StateMachineDefinition, T as TransitionDefinition, k as TransitionTrace, V as VerificationCheck, l as VerificationSnapshot, m as VerificationSummary, n as VisualizerConfig, o as bindCanvasCapture, p as bindEventBus, q as bindTraitStateGetter, r as clearVerification, s as cn, t as extractOutputsFromTransitions, u as extractStateMachine, v as formatGuard, w as getAllChecks, x as getBridgeHealth, y as getEffectSummary, z as getSnapshot, F as getSummary, G as getTransitions, H as getTransitionsForTrait, I as parseContentSegments, J as parseMarkdownWithCodeBlocks, K as recordTransition, L as registerCheck, M as renderStateMachineToDomData, N as renderStateMachineToSvg, O as subscribeToVerification, P as updateAssetStatus, Q as updateBridgeHealth, U as updateCheck, W as waitForTransition } from '../cn-C_ATNPvi.js';
2
- import 'clsx';
3
-
4
- /**
5
- * Trait Registry - Tracks active traits and their state machines for debugging
6
- *
7
- * @packageDocumentation
8
- */
9
- interface TraitTransition {
10
- from: string;
11
- to: string;
12
- event: string;
13
- guard?: string;
14
- }
15
- interface TraitGuard {
16
- name: string;
17
- lastResult?: boolean;
18
- }
19
- interface TraitDebugInfo {
20
- id: string;
21
- name: string;
22
- currentState: string;
23
- states: string[];
24
- transitions: TraitTransition[];
25
- guards: TraitGuard[];
26
- transitionCount: number;
27
- }
28
- type ChangeListener$3 = () => void;
29
- declare function registerTrait(info: TraitDebugInfo): void;
30
- declare function updateTraitState(id: string, newState: string): void;
31
- declare function updateGuardResult(traitId: string, guardName: string, result: boolean): void;
32
- declare function unregisterTrait(id: string): void;
33
- declare function getAllTraits(): TraitDebugInfo[];
34
- declare function getTrait(id: string): TraitDebugInfo | undefined;
35
- declare function subscribeToTraitChanges(listener: ChangeListener$3): () => void;
36
- declare function clearTraits(): void;
37
-
38
- /**
39
- * Tick Registry - Tracks scheduled tick executions for debugging
40
- *
41
- * @packageDocumentation
42
- */
43
- interface TickExecution {
44
- id: string;
45
- traitName: string;
46
- /** Tick name (display name) */
47
- name: string;
48
- /** Tick identifier */
49
- tickName: string;
50
- interval: number;
51
- /** Last execution timestamp */
52
- lastRun: number;
53
- lastExecuted: number | null;
54
- nextExecution: number | null;
55
- /** Number of times this tick has run */
56
- runCount: number;
57
- executionCount: number;
58
- /** Average execution time in ms */
59
- executionTime: number;
60
- /** Whether the tick is currently active */
61
- active: boolean;
62
- isActive: boolean;
63
- /** Guard name if this tick has a guard */
64
- guardName?: string;
65
- /** Whether the guard passed on last evaluation */
66
- guardPassed?: boolean;
67
- }
68
- type ChangeListener$2 = () => void;
69
- declare function registerTick(tick: TickExecution): void;
70
- declare function updateTickExecution(id: string, timestamp: number): void;
71
- declare function setTickActive(id: string, isActive: boolean): void;
72
- declare function unregisterTick(id: string): void;
73
- declare function getAllTicks(): TickExecution[];
74
- declare function getTick(id: string): TickExecution | undefined;
75
- declare function subscribeToTickChanges(listener: ChangeListener$2): () => void;
76
- declare function clearTicks(): void;
77
-
78
- /**
79
- * Guard Registry - Tracks guard evaluations for debugging
80
- *
81
- * @packageDocumentation
82
- */
83
- interface GuardContext {
84
- traitName?: string;
85
- type?: "transition" | "tick";
86
- transitionFrom?: string;
87
- transitionTo?: string;
88
- tickName?: string;
89
- [key: string]: unknown;
90
- }
91
- interface GuardEvaluation {
92
- id: string;
93
- traitName: string;
94
- guardName: string;
95
- expression: string;
96
- result: boolean;
97
- context: GuardContext;
98
- timestamp: number;
99
- /** Input values used in guard evaluation */
100
- inputs: Record<string, unknown>;
101
- }
102
- type ChangeListener$1 = () => void;
103
- declare function recordGuardEvaluation(evaluation: Omit<GuardEvaluation, "id" | "timestamp">): void;
104
- declare function getGuardHistory(): GuardEvaluation[];
105
- declare function getRecentGuardEvaluations(count: number): GuardEvaluation[];
106
- declare function getGuardEvaluationsForTrait(traitName: string): GuardEvaluation[];
107
- declare function subscribeToGuardChanges(listener: ChangeListener$1): () => void;
108
- declare function clearGuardHistory(): void;
109
-
110
- /**
111
- * Entity Debug - Provides entity state snapshots for debugging
112
- *
113
- * @packageDocumentation
114
- */
115
- interface EntityState {
116
- id: string;
117
- type: string;
118
- fields: Record<string, unknown>;
119
- lastUpdated: number;
120
- }
121
- interface RuntimeEntity {
122
- id: string;
123
- type: string;
124
- data: Record<string, unknown>;
125
- }
126
- interface PersistentEntityInfo {
127
- loaded: boolean;
128
- count: number;
129
- }
130
- interface EntitySnapshot {
131
- entities: EntityState[];
132
- timestamp: number;
133
- totalCount: number;
134
- /** Singleton entities by name */
135
- singletons: Record<string, unknown>;
136
- /** Runtime entities (in-memory) */
137
- runtime: RuntimeEntity[];
138
- /** Persistent entities info by type */
139
- persistent: Record<string, PersistentEntityInfo>;
140
- }
141
- type EntityProvider = () => EntityState[];
142
- declare function setEntityProvider(provider: EntityProvider): void;
143
- declare function clearEntityProvider(): void;
144
- declare function getEntitySnapshot(): EntitySnapshot | null;
145
- declare function getEntityById(id: string): EntityState | undefined;
146
- declare function getEntitiesByType(type: string): EntityState[];
147
-
148
- /**
149
- * Debug Registry - Central event log for debugging
150
- *
151
- * @packageDocumentation
152
- */
153
- type DebugEventType = 'state-change' | 'event-fired' | 'effect-executed' | 'guard-evaluated' | 'error' | 'warning' | 'info';
154
- interface DebugEvent {
155
- id: string;
156
- type: DebugEventType;
157
- source: string;
158
- message: string;
159
- data?: Record<string, unknown>;
160
- timestamp: number;
161
- }
162
- type ChangeListener = () => void;
163
- declare function logDebugEvent(type: DebugEventType, source: string, message: string, data?: Record<string, unknown>): void;
164
- declare function logStateChange(source: string, from: string, to: string, event?: string): void;
165
- declare function logEventFired(source: string, eventName: string, payload?: unknown): void;
166
- declare function logEffectExecuted(source: string, effectType: string, details?: unknown): void;
167
- declare function logError(source: string, message: string, error?: unknown): void;
168
- declare function logWarning(source: string, message: string, data?: Record<string, unknown>): void;
169
- declare function logInfo(source: string, message: string, data?: Record<string, unknown>): void;
170
- declare function getDebugEvents(): DebugEvent[];
171
- declare function getRecentEvents(count: number): DebugEvent[];
172
- declare function getEventsByType(type: DebugEventType): DebugEvent[];
173
- declare function getEventsBySource(source: string): DebugEvent[];
174
- declare function subscribeToDebugEvents(listener: ChangeListener): () => void;
175
- declare function clearDebugEvents(): void;
176
-
177
- /**
178
- * API Client - HTTP client for backend API calls
179
- *
180
- * Provides typed methods for making API requests.
181
- * All requests go through the backend server, NOT directly to Firestore.
182
- *
183
- * @packageDocumentation
184
- */
185
- /**
186
- * API Error class for handling HTTP errors
187
- */
188
- declare class ApiError extends Error {
189
- status: number;
190
- statusText: string;
191
- constructor(status: number, statusText: string, message?: string);
192
- }
193
- /**
194
- * API client with typed methods
195
- */
196
- declare const apiClient: {
197
- /**
198
- * GET request
199
- */
200
- get<T>(endpoint: string): Promise<T>;
201
- /**
202
- * POST request
203
- */
204
- post<T>(endpoint: string, data?: unknown): Promise<T>;
205
- /**
206
- * PUT request
207
- */
208
- put<T>(endpoint: string, data?: unknown): Promise<T>;
209
- /**
210
- * PATCH request
211
- */
212
- patch<T>(endpoint: string, data?: unknown): Promise<T>;
213
- /**
214
- * DELETE request
215
- */
216
- delete<T = void>(endpoint: string): Promise<T>;
217
- };
218
-
219
- /**
220
- * Debug utilities for development
221
- */
222
- declare function isDebugEnabled(): boolean;
223
- declare function debug(...args: unknown[]): void;
224
- declare function debugGroup(label: string): void;
225
- declare function debugGroupEnd(): void;
226
- declare function debugWarn(...args: unknown[]): void;
227
- declare function debugError(...args: unknown[]): void;
228
- declare function debugTable(data: unknown): void;
229
- declare function debugTime(label: string): void;
230
- declare function debugTimeEnd(label: string): void;
231
- /**
232
- * Debug input events (keyboard, mouse, touch)
233
- * @param inputType - Type of input (e.g., 'keydown', 'keyup', 'mouse')
234
- * @param data - Input data to log
235
- */
236
- declare function debugInput(inputType: string, data: unknown): void;
237
- /**
238
- * Debug collision events between entities
239
- * @param entityA - First entity in collision
240
- * @param entityB - Second entity in collision
241
- * @param details - Additional collision details
242
- */
243
- declare function debugCollision(entityA: {
244
- id?: string;
245
- type?: string;
246
- }, entityB: {
247
- id?: string;
248
- type?: string;
249
- }, details?: unknown): void;
250
- /**
251
- * Debug physics updates (position, velocity)
252
- * @param entityId - Entity identifier
253
- * @param physics - Physics data to log
254
- */
255
- declare function debugPhysics(entityId: string, physics: unknown): void;
256
- /**
257
- * Debug game state changes
258
- * @param stateName - Name of the state that changed
259
- * @param value - New state value
260
- */
261
- declare function debugGameState(stateName: string, value: unknown): void;
262
-
263
- /**
264
- * Debug Utilities - Functions for toggling and checking debug mode
265
- *
266
- * @packageDocumentation
267
- */
268
- type DebugToggleListener = (enabled: boolean) => void;
269
- /**
270
- * Enable or disable debug mode
271
- */
272
- declare function setDebugEnabled(enabled: boolean): void;
273
- /**
274
- * Toggle debug mode
275
- */
276
- declare function toggleDebug(): boolean;
277
- /**
278
- * Subscribe to debug mode changes
279
- */
280
- declare function onDebugToggle(listener: DebugToggleListener): () => void;
281
- /**
282
- * Initialize debug mode from keyboard shortcut (Ctrl+Shift+D)
283
- */
284
- declare function initDebugShortcut(): () => void;
285
-
286
- /**
287
- * Get Nested Value Utility
288
- *
289
- * Safely retrieves nested values from objects using dot-notation paths.
290
- * Used by display components to support relation field access like "company.name".
291
- *
292
- * @packageDocumentation
293
- */
294
- /**
295
- * Get a nested value from an object using dot-notation path.
296
- *
297
- * @param obj - The object to traverse
298
- * @param path - Dot-notation path (e.g., "company.name", "address.city")
299
- * @returns The value at the path, or undefined if not found
300
- *
301
- * @example
302
- * const data = { company: { name: "Acme Corp", address: { city: "NYC" } } };
303
- * getNestedValue(data, "company.name"); // => "Acme Corp"
304
- * getNestedValue(data, "company.address.city"); // => "NYC"
305
- * getNestedValue(data, "company.missing"); // => undefined
306
- */
307
- declare function getNestedValue(obj: Record<string, unknown> | null | undefined, path: string): unknown;
308
- /**
309
- * Format a nested field path as a human-readable label.
310
- *
311
- * @param path - Dot-notation path (e.g., "company.name")
312
- * @returns Formatted label (e.g., "Company Name")
313
- *
314
- * @example
315
- * formatFieldLabel("company.name"); // => "Company Name"
316
- * formatFieldLabel("address.zipCode"); // => "Address Zip Code"
317
- */
318
- declare function formatNestedFieldLabel(path: string): string;
319
-
320
- export { ApiError, type DebugEvent, type DebugEventType, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, apiClient, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllTicks, getAllTraits, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getTick, getTrait, initDebugShortcut, isDebugEnabled, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, recordGuardEvaluation, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, toggleDebug, unregisterTick, unregisterTrait, updateGuardResult, updateTickExecution, updateTraitState };
@@ -1,22 +0,0 @@
1
- /**
2
- * Core locale loader for @almadar/ui.
3
- *
4
- * Exports message maps for en/ar/sl and a helper to merge
5
- * project-specific messages on top of core.
6
- */
7
- type SupportedLocale = 'en' | 'ar' | 'sl';
8
- interface LocaleMeta {
9
- locale: string;
10
- direction: 'ltr' | 'rtl';
11
- }
12
- /** Core messages keyed by locale */
13
- declare const coreMessages: Record<SupportedLocale, Record<string, string>>;
14
- /** Locale metadata */
15
- declare const localeMeta: Record<SupportedLocale, LocaleMeta>;
16
- /**
17
- * Merge core messages with project-specific messages.
18
- * Project keys override core keys.
19
- */
20
- declare function mergeMessages(locale: SupportedLocale, projectMessages: Record<string, string>): Record<string, string>;
21
-
22
- export { type LocaleMeta, type SupportedLocale, coreMessages, localeMeta, mergeMessages };