@almadar/ui 2.5.2 → 2.7.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.
@@ -2,7 +2,7 @@ import { OrbitalSchema } from '@almadar/core';
2
2
  import { E as EventBusContextType, a as EventListener } from '../event-bus-types-CjJduURa.js';
3
3
  export { K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-CjJduURa.js';
4
4
  export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, S as SlotContent, a as UISlot, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BBjNvQtb.js';
5
- import * as React from 'react';
5
+ import * as React$1 from 'react';
6
6
  import React__default, { ReactNode } from 'react';
7
7
  import * as _tanstack_react_query from '@tanstack/react-query';
8
8
  import { Entity, getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/index.js';
@@ -953,7 +953,7 @@ interface I18nContextValue {
953
953
  * </I18nProvider>
954
954
  * ```
955
955
  */
956
- declare const I18nProvider: React.Provider<I18nContextValue>;
956
+ declare const I18nProvider: React$1.Provider<I18nContextValue>;
957
957
  /**
958
958
  * Hook to access the current locale and translate function.
959
959
  * Safe to call without a provider — returns passthrough t().
@@ -1029,6 +1029,136 @@ interface AuthContextValue {
1029
1029
  */
1030
1030
  declare function useAuthContext(): AuthContextValue;
1031
1031
 
1032
+ interface SwipeGestureOptions {
1033
+ /** Minimum distance in px to trigger a swipe (default: 50) */
1034
+ threshold?: number;
1035
+ /** Minimum velocity in px/ms to qualify (default: 0.3) */
1036
+ velocityThreshold?: number;
1037
+ /** Prevent default touch behavior during swipe (default: false) */
1038
+ preventDefault?: boolean;
1039
+ }
1040
+ interface SwipeGestureResult {
1041
+ onSwipeLeft?: () => void;
1042
+ onSwipeRight?: () => void;
1043
+ onSwipeUp?: () => void;
1044
+ onSwipeDown?: () => void;
1045
+ }
1046
+ interface SwipeHandlers {
1047
+ onPointerDown: (e: React__default.PointerEvent) => void;
1048
+ onPointerMove: (e: React__default.PointerEvent) => void;
1049
+ onPointerUp: (e: React__default.PointerEvent) => void;
1050
+ onPointerCancel: (e: React__default.PointerEvent) => void;
1051
+ /** Current horizontal offset during swipe (for animation) */
1052
+ offsetX: number;
1053
+ /** Whether a swipe gesture is in progress */
1054
+ isSwiping: boolean;
1055
+ }
1056
+
1057
+ declare function useSwipeGesture(callbacks: SwipeGestureResult, options?: SwipeGestureOptions): SwipeHandlers;
1058
+
1059
+ interface LongPressOptions {
1060
+ /** Hold duration in ms before triggering (default: 500) */
1061
+ duration?: number;
1062
+ /** Movement tolerance in px before canceling (default: 10) */
1063
+ moveThreshold?: number;
1064
+ }
1065
+ interface LongPressHandlers {
1066
+ onPointerDown: (e: React__default.PointerEvent) => void;
1067
+ onPointerMove: (e: React__default.PointerEvent) => void;
1068
+ onPointerUp: () => void;
1069
+ onPointerCancel: () => void;
1070
+ /** Whether the long press is currently active (held down, timer running) */
1071
+ isPressed: boolean;
1072
+ }
1073
+ declare function useLongPress(onLongPress: () => void, options?: LongPressOptions): LongPressHandlers;
1074
+
1075
+ interface DragReorderResult<T> {
1076
+ /** The reordered items array */
1077
+ items: T[];
1078
+ /** Index of the item currently being dragged (-1 if not dragging) */
1079
+ dragIndex: number;
1080
+ /** Index of the drop target (-1 if not over any target) */
1081
+ dragOverIndex: number;
1082
+ /** Whether a drag is in progress */
1083
+ isDragging: boolean;
1084
+ /** Props to spread on the drag handle element for a given index */
1085
+ getDragHandleProps: (index: number) => {
1086
+ onPointerDown: (e: React__default.PointerEvent) => void;
1087
+ style: React__default.CSSProperties;
1088
+ 'aria-grabbed': boolean;
1089
+ role: string;
1090
+ };
1091
+ /** Props to spread on each list item for a given index */
1092
+ getItemProps: (index: number) => {
1093
+ onPointerMove: (e: React__default.PointerEvent) => void;
1094
+ onPointerUp: () => void;
1095
+ 'aria-dropeffect': string;
1096
+ style: React__default.CSSProperties;
1097
+ };
1098
+ }
1099
+ declare function useDragReorder<T>(initialItems: T[], onReorder: (fromIndex: number, toIndex: number, item: T) => void): DragReorderResult<T>;
1100
+
1101
+ interface InfiniteScrollOptions {
1102
+ /** Root margin for IntersectionObserver (default: "200px") */
1103
+ rootMargin?: string;
1104
+ /** Whether more items are available to load */
1105
+ hasMore?: boolean;
1106
+ /** Whether a load is currently in progress */
1107
+ isLoading?: boolean;
1108
+ }
1109
+ interface InfiniteScrollResult {
1110
+ /** Ref to attach to the sentinel element */
1111
+ sentinelRef: React.RefCallback<HTMLElement>;
1112
+ }
1113
+ declare function useInfiniteScroll(onLoadMore: () => void, options?: InfiniteScrollOptions): InfiniteScrollResult;
1114
+
1115
+ interface PullToRefreshOptions {
1116
+ /** Distance in px to pull before triggering refresh (default: 60) */
1117
+ threshold?: number;
1118
+ /** Maximum pull distance in px (default: 120) */
1119
+ maxPull?: number;
1120
+ }
1121
+ interface PullToRefreshResult {
1122
+ /** Current pull distance in px */
1123
+ pullDistance: number;
1124
+ /** Whether the user is actively pulling */
1125
+ isPulling: boolean;
1126
+ /** Whether a refresh was triggered and is in progress */
1127
+ isRefreshing: boolean;
1128
+ /** Props to spread on the scrollable container */
1129
+ containerProps: {
1130
+ onTouchStart: (e: React__default.TouchEvent) => void;
1131
+ onTouchMove: (e: React__default.TouchEvent) => void;
1132
+ onTouchEnd: () => void;
1133
+ style: React__default.CSSProperties;
1134
+ };
1135
+ /** Call this when the refresh operation completes */
1136
+ endRefresh: () => void;
1137
+ }
1138
+ declare function usePullToRefresh(onRefresh: () => void, options?: PullToRefreshOptions): PullToRefreshResult;
1139
+
1140
+ interface PinchZoomResult {
1141
+ /** Current zoom scale (1 = no zoom) */
1142
+ scale: number;
1143
+ /** Whether a pinch gesture is active */
1144
+ isPinching: boolean;
1145
+ /** Props to spread on the zoomable container */
1146
+ gestureProps: {
1147
+ onTouchStart: (e: React__default.TouchEvent) => void;
1148
+ onTouchMove: (e: React__default.TouchEvent) => void;
1149
+ onTouchEnd: () => void;
1150
+ };
1151
+ /** Reset zoom to 1 */
1152
+ resetZoom: () => void;
1153
+ }
1154
+ interface PinchZoomOptions {
1155
+ /** Minimum zoom scale (default: 0.5) */
1156
+ minScale?: number;
1157
+ /** Maximum zoom scale (default: 4) */
1158
+ maxScale?: number;
1159
+ }
1160
+ declare function usePinchZoom(options?: PinchZoomOptions): PinchZoomResult;
1161
+
1032
1162
  /**
1033
1163
  * GitHub connection status
1034
1164
  */
@@ -1088,4 +1218,4 @@ declare function useGitHubBranches(owner: string, repo: string, enabled?: boolea
1088
1218
  branches: string[];
1089
1219
  }, Error>;
1090
1220
 
1091
- export { type AuthContextValue, type AuthUser, type ChangeSummary, type CompileResult, type CompileStage, ENTITY_EVENTS, Entity, type EntityDataAdapter, EntityDataProvider, type EntityDataRecord, type EntityMutationResult, EventBusContextType, EventListener, type Extension, type ExtensionManifest, type FileSystemFile, type FileSystemStatus, type GitHubRepo, type GitHubStatus, type HistoryTimelineItem, type I18nContextValue, I18nProvider, type OpenFile, type OrbitalEventPayload, type OrbitalEventResponse, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, type QueryState, type ResolvedEntity, type RevertResult, type SelectedFile, type TranslateFunction, type UseCompileResult, type UseEntityDetailResult, type UseEntityListOptions, type UseEntityListResult, type UseEntityMutationsOptions, type UseExtensionsOptions, type UseExtensionsResult, type UseFileEditorOptions, type UseFileEditorResult, type UseFileSystemResult, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, clearEntities, createTranslate, entityDataKeys, getAllEntities, getByType, getEntity, getSingleton, parseQueryBinding, removeEntity, spawnEntity, updateEntity, updateSingleton, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEmitEvent, useEntities, useEntitiesByType, useEntity$1 as useEntity, useEntity as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntityMutations, useEntitySuspense, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useTranslate, useUIEvents, useUpdateEntity, useValidation };
1221
+ export { type AuthContextValue, type AuthUser, type ChangeSummary, type CompileResult, type CompileStage, type DragReorderResult, ENTITY_EVENTS, Entity, type EntityDataAdapter, EntityDataProvider, type EntityDataRecord, type EntityMutationResult, EventBusContextType, EventListener, type Extension, type ExtensionManifest, type FileSystemFile, type FileSystemStatus, type GitHubRepo, type GitHubStatus, type HistoryTimelineItem, type I18nContextValue, I18nProvider, type InfiniteScrollOptions, type InfiniteScrollResult, type LongPressHandlers, type LongPressOptions, type OpenFile, type OrbitalEventPayload, type OrbitalEventResponse, type PinchZoomOptions, type PinchZoomResult, type PullToRefreshOptions, type PullToRefreshResult, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, type QueryState, type ResolvedEntity, type RevertResult, type SelectedFile, type SwipeGestureOptions, type SwipeGestureResult, type SwipeHandlers, type TranslateFunction, type UseCompileResult, type UseEntityDetailResult, type UseEntityListOptions, type UseEntityListResult, type UseEntityMutationsOptions, type UseExtensionsOptions, type UseExtensionsResult, type UseFileEditorOptions, type UseFileEditorResult, type UseFileSystemResult, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, clearEntities, createTranslate, entityDataKeys, getAllEntities, getByType, getEntity, getSingleton, parseQueryBinding, removeEntity, spawnEntity, updateEntity, updateSingleton, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useDragReorder, useEmitEvent, useEntities, useEntitiesByType, useEntity$1 as useEntity, useEntity as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntityMutations, useEntitySuspense, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useSwipeGesture, useTranslate, useUIEvents, useUpdateEntity, useValidation };
@@ -1,8 +1,8 @@
1
- export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-2UMN2BLO.js';
1
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-2QM732NQ.js';
2
2
  import '../chunk-3HJHHULT.js';
3
- export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
4
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-GOZKH7QW.js';
3
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-WGJIL4YR.js';
5
4
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
6
5
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
7
6
  import '../chunk-TSETXL2E.js';
7
+ export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
8
8
  import '../chunk-PKBMQBKP.js';
@@ -353,6 +353,14 @@ declare function getBridgeHealth(): BridgeHealth | null;
353
353
  declare function getSummary(): VerificationSummary;
354
354
  declare function getSnapshot(): VerificationSnapshot;
355
355
  declare function subscribeToVerification(listener: ChangeListener): () => void;
356
+ /** Asset load status for canvas verification */
357
+ type AssetLoadStatus = "loaded" | "failed" | "pending";
358
+ /** Event bus log entry for verification */
359
+ interface EventLogEntry {
360
+ type: string;
361
+ payload?: Record<string, unknown>;
362
+ timestamp: number;
363
+ }
356
364
  /** Exposed on window for Playwright to query */
357
365
  interface OrbitalVerificationAPI {
358
366
  getSnapshot: () => VerificationSnapshot;
@@ -366,6 +374,14 @@ interface OrbitalVerificationAPI {
366
374
  sendEvent?: (event: string, payload?: Record<string, unknown>) => void;
367
375
  /** Get current trait state */
368
376
  getTraitState?: (traitName: string) => string | undefined;
377
+ /** Capture a canvas frame as PNG data URL. Registered by game organisms. */
378
+ captureFrame?: () => string | null;
379
+ /** Asset load status map. Registered by game organisms. */
380
+ assetStatus?: Record<string, AssetLoadStatus>;
381
+ /** Event bus log. Records all emit() calls for verification. */
382
+ eventLog?: EventLogEntry[];
383
+ /** Clear the event log. */
384
+ clearEventLog?: () => void;
369
385
  }
370
386
  declare global {
371
387
  interface Window {
@@ -378,16 +394,31 @@ declare global {
378
394
  */
379
395
  declare function waitForTransition(event: string, timeoutMs?: number): Promise<TransitionTrace | null>;
380
396
  /**
381
- * Bind the EventBus so automation can send events.
397
+ * Bind the EventBus so automation can send events and log emissions.
382
398
  * Call this during app initialization.
383
399
  */
384
400
  declare function bindEventBus(eventBus: {
385
401
  emit: (type: string, payload?: Record<string, unknown>) => void;
402
+ onAny?: (listener: (event: {
403
+ type: string;
404
+ payload?: Record<string, unknown>;
405
+ }) => void) => () => void;
386
406
  }): void;
387
407
  /**
388
408
  * Bind a trait state getter so automation can query current states.
389
409
  */
390
410
  declare function bindTraitStateGetter(getter: (traitName: string) => string | undefined): void;
411
+ /**
412
+ * Register a canvas frame capture function.
413
+ * Called by game organisms (IsometricCanvas, PlatformerCanvas, SimulationCanvas)
414
+ * so the verifier can snapshot canvas content at checkpoints.
415
+ */
416
+ declare function bindCanvasCapture(captureFn: () => string | null): void;
417
+ /**
418
+ * Update asset load status for canvas verification.
419
+ * Game organisms call this when images load or fail.
420
+ */
421
+ declare function updateAssetStatus(url: string, status: AssetLoadStatus): void;
391
422
  declare function clearVerification(): void;
392
423
 
393
424
  /**
@@ -424,4 +455,4 @@ declare function getNestedValue(obj: Record<string, unknown> | null | undefined,
424
455
  */
425
456
  declare function formatNestedFieldLabel(path: string): string;
426
457
 
427
- export { ApiError, type BridgeHealth, type CheckStatus, type DebugEvent, type DebugEventType, type EffectTrace, type EntitySnapshot, type EntityState, type GuardContext, type GuardEvaluation, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type TransitionTrace, type VerificationCheck, type VerificationSnapshot, type VerificationSummary, apiClient, bindEventBus, bindTraitStateGetter, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTransitions, getTransitionsForTrait, initDebugShortcut, isDebugEnabled, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, recordGuardEvaluation, recordTransition, registerCheck, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
458
+ export { ApiError, type AssetLoadStatus, type BridgeHealth, type CheckStatus, type DebugEvent, type DebugEventType, type EffectTrace, type EntitySnapshot, type EntityState, type EventLogEntry, type GuardContext, type GuardEvaluation, type PersistentEntityInfo, type RuntimeEntity, type TickExecution, type TraitDebugInfo, type TraitGuard, type TraitTransition, type TransitionTrace, type VerificationCheck, type VerificationSnapshot, type VerificationSummary, apiClient, bindCanvasCapture, bindEventBus, bindTraitStateGetter, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTransitions, getTransitionsForTrait, initDebugShortcut, isDebugEnabled, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, recordGuardEvaluation, recordTransition, registerCheck, registerTick, registerTrait, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
package/dist/lib/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  export { DEFAULT_CONFIG, extractOutputsFromTransitions, extractStateMachine, formatGuard, getEffectSummary, parseContentSegments, parseMarkdownWithCodeBlocks, renderStateMachineToDomData, renderStateMachineToSvg } from '../chunk-N6DJVKZ6.js';
2
2
  export { ApiError, apiClient } from '../chunk-3HJHHULT.js';
3
- export { bindEventBus, bindTraitStateGetter, clearVerification, getAllChecks, getBridgeHealth, getSnapshot, getSummary, getTransitions, getTransitionsForTrait, recordTransition, registerCheck, subscribeToVerification, updateBridgeHealth, updateCheck, waitForTransition } from '../chunk-45CTDYBT.js';
4
- export { cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getNestedValue, isDebugEnabled } from '../chunk-KKCVDUK7.js';
3
+ export { bindCanvasCapture, bindEventBus, bindTraitStateGetter, clearVerification, cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllChecks, getBridgeHealth, getNestedValue, getSnapshot, getSummary, getTransitions, getTransitionsForTrait, isDebugEnabled, recordTransition, registerCheck, subscribeToVerification, updateAssetStatus, updateBridgeHealth, updateCheck, waitForTransition } from '../chunk-RPYMP7ZC.js';
5
4
  import '../chunk-PKBMQBKP.js';
6
5
 
7
6
  // lib/debugUtils.ts
@@ -1,13 +1,12 @@
1
- import { SuspenseConfigProvider } from '../chunk-AL6BLHMG.js';
1
+ import { SuspenseConfigProvider } from '../chunk-VJP2HCLY.js';
2
2
  import { ThemeProvider } from '../chunk-DKQN5FVU.js';
3
- import { SelectionProvider, EntityDataProvider } from '../chunk-GOZKH7QW.js';
4
- export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-GOZKH7QW.js';
3
+ import { SelectionProvider, EntityDataProvider } from '../chunk-WGJIL4YR.js';
4
+ export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-WGJIL4YR.js';
5
5
  import { useEventBus, EventBusProvider } from '../chunk-YXZM3WCF.js';
6
6
  export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
7
7
  import '../chunk-3JGAROCW.js';
8
+ import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from '../chunk-RPYMP7ZC.js';
8
9
  import '../chunk-TSETXL2E.js';
9
- import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from '../chunk-45CTDYBT.js';
10
- import '../chunk-KKCVDUK7.js';
11
10
  import { useOfflineExecutor } from '../chunk-K2D5D3WK.js';
12
11
  import '../chunk-PKBMQBKP.js';
13
12
  import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.5.2",
3
+ "version": "2.7.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",
@@ -1,104 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { twMerge } from 'tailwind-merge';
3
-
4
- // lib/cn.ts
5
- function cn(...inputs) {
6
- return twMerge(clsx(inputs));
7
- }
8
-
9
- // lib/debug.ts
10
- var DEBUG_ENABLED = typeof window !== "undefined" && (localStorage.getItem("debug") === "true" || process.env.NODE_ENV === "development");
11
- function isDebugEnabled() {
12
- return DEBUG_ENABLED;
13
- }
14
- function debug(...args) {
15
- if (DEBUG_ENABLED) {
16
- console.log("[DEBUG]", ...args);
17
- }
18
- }
19
- function debugGroup(label) {
20
- if (DEBUG_ENABLED) {
21
- console.group(`[DEBUG] ${label}`);
22
- }
23
- }
24
- function debugGroupEnd() {
25
- if (DEBUG_ENABLED) {
26
- console.groupEnd();
27
- }
28
- }
29
- function debugWarn(...args) {
30
- if (DEBUG_ENABLED) {
31
- console.warn("[DEBUG]", ...args);
32
- }
33
- }
34
- function debugError(...args) {
35
- if (DEBUG_ENABLED) {
36
- console.error("[DEBUG]", ...args);
37
- }
38
- }
39
- function debugTable(data) {
40
- if (DEBUG_ENABLED) {
41
- console.table(data);
42
- }
43
- }
44
- function debugTime(label) {
45
- if (DEBUG_ENABLED) {
46
- console.time(`[DEBUG] ${label}`);
47
- }
48
- }
49
- function debugTimeEnd(label) {
50
- if (DEBUG_ENABLED) {
51
- console.timeEnd(`[DEBUG] ${label}`);
52
- }
53
- }
54
- function debugInput(inputType, data) {
55
- if (DEBUG_ENABLED) {
56
- console.log(`[DEBUG:INPUT] ${inputType}:`, data);
57
- }
58
- }
59
- function debugCollision(entityA, entityB, details) {
60
- if (DEBUG_ENABLED) {
61
- console.log(
62
- `[DEBUG:COLLISION] ${entityA.type || entityA.id} <-> ${entityB.type || entityB.id}`,
63
- details ?? ""
64
- );
65
- }
66
- }
67
- function debugPhysics(entityId, physics) {
68
- if (DEBUG_ENABLED) {
69
- console.log(`[DEBUG:PHYSICS] ${entityId}:`, physics);
70
- }
71
- }
72
- function debugGameState(stateName, value) {
73
- if (DEBUG_ENABLED) {
74
- console.log(`[DEBUG:GAME_STATE] ${stateName}:`, value);
75
- }
76
- }
77
-
78
- // lib/getNestedValue.ts
79
- function getNestedValue(obj, path) {
80
- if (obj === null || obj === void 0) {
81
- return void 0;
82
- }
83
- if (!path.includes(".")) {
84
- return obj[path];
85
- }
86
- const parts = path.split(".");
87
- let value = obj;
88
- for (const part of parts) {
89
- if (value === null || value === void 0) {
90
- return void 0;
91
- }
92
- if (typeof value !== "object") {
93
- return void 0;
94
- }
95
- value = value[part];
96
- }
97
- return value;
98
- }
99
- function formatNestedFieldLabel(path) {
100
- const lastPart = path.includes(".") ? path.split(".").pop() : path;
101
- return lastPart.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
102
- }
103
-
104
- export { cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getNestedValue, isDebugEnabled };