@almadar/ui 2.11.6 → 2.11.7

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.
@@ -1,7 +1,30 @@
1
1
  import { useUISlotManager } from './chunk-3JGAROCW.js';
2
- import { createContext, useMemo, useState, useEffect, useCallback, useContext } from 'react';
2
+ import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
+ var UISlotContext = createContext(null);
6
+ function UISlotProvider({ children }) {
7
+ const slotManager = useUISlotManager();
8
+ const contextValue = useMemo(() => slotManager, [slotManager]);
9
+ return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
10
+ }
11
+ function useUISlots() {
12
+ const context = useContext(UISlotContext);
13
+ if (!context) {
14
+ throw new Error(
15
+ "useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
16
+ );
17
+ }
18
+ return context;
19
+ }
20
+ function useSlotContent(slot) {
21
+ const { getContent } = useUISlots();
22
+ return getContent(slot);
23
+ }
24
+ function useSlotHasContent(slot) {
25
+ const { hasContent } = useUISlots();
26
+ return hasContent(slot);
27
+ }
5
28
  var BUILT_IN_THEMES = [
6
29
  {
7
30
  name: "wireframe",
@@ -252,28 +275,5 @@ function useTheme() {
252
275
  return context;
253
276
  }
254
277
  var ThemeContext_default = ThemeContext;
255
- var UISlotContext = createContext(null);
256
- function UISlotProvider({ children }) {
257
- const slotManager = useUISlotManager();
258
- const contextValue = useMemo(() => slotManager, [slotManager]);
259
- return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
260
- }
261
- function useUISlots() {
262
- const context = useContext(UISlotContext);
263
- if (!context) {
264
- throw new Error(
265
- "useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
266
- );
267
- }
268
- return context;
269
- }
270
- function useSlotContent(slot) {
271
- const { getContent } = useUISlots();
272
- return getContent(slot);
273
- }
274
- function useSlotHasContent(slot) {
275
- const { hasContent } = useUISlots();
276
- return hasContent(slot);
277
- }
278
278
 
279
279
  export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };
@@ -1,14 +1,14 @@
1
1
  import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments, isDebugEnabled, onDebugToggle, subscribeToTickChanges, subscribeToGuardChanges, subscribeToDebugEvents, getEntitySnapshot, getDebugEvents, getGuardHistory, getAllTicks } from '../chunk-4ZBSL37D.js';
2
- import { useAuthContext } from '../chunk-GTIAVPI5.js';
3
- 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-GTIAVPI5.js';
2
+ import { useAuthContext } from '../chunk-3FENGM4Y.js';
3
+ 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-3FENGM4Y.js';
4
4
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
5
5
  import { subscribeToTraitChanges, getAllTraits } from '../chunk-42YQ6JVR.js';
6
6
  import '../chunk-3HJHHULT.js';
7
- import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-4LBNLALH.js';
8
- export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-4LBNLALH.js';
9
- import '../chunk-DKQN5FVU.js';
10
- import { useTranslate } from '../chunk-WGJIL4YR.js';
11
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-WGJIL4YR.js';
7
+ import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-4NAQLJ2M.js';
8
+ export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-4NAQLJ2M.js';
9
+ import '../chunk-YLKXEXBP.js';
10
+ import { useTranslate } from '../chunk-RUL35VPK.js';
11
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-RUL35VPK.js';
12
12
  import { useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
13
13
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
14
14
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
@@ -1,5 +1,5 @@
1
- import { ThemeProvider, useTheme } from '../chunk-DKQN5FVU.js';
2
- export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-DKQN5FVU.js';
1
+ import { ThemeProvider, useTheme } from '../chunk-YLKXEXBP.js';
2
+ export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-YLKXEXBP.js';
3
3
  import '../chunk-3JGAROCW.js';
4
4
  import '../chunk-PKBMQBKP.js';
5
5
  import { createContext, useCallback, useMemo, useContext } from 'react';
@@ -7,67 +7,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';
9
9
 
10
- declare global {
11
- interface Window {
12
- __kflowEventBus?: EventBusContextType | null;
13
- }
14
- }
15
- /**
16
- * Hook for accessing the event bus.
17
- *
18
- * Uses EventBusProvider context if available, otherwise falls back to
19
- * a simple in-memory event bus (for design system / Storybook).
20
- *
21
- * @returns Event bus instance with emit, on, once, and hasListeners methods
22
- *
23
- * @example
24
- * ```tsx
25
- * const eventBus = useEventBus();
26
- *
27
- * // Emit an event
28
- * eventBus.emit('UI:CLICK', { id: '123' });
29
- *
30
- * // Subscribe to an event
31
- * useEffect(() => {
32
- * return eventBus.on('UI:CLICK', (event) => {
33
- * console.log('Clicked:', event.payload);
34
- * });
35
- * }, []);
36
- * ```
37
- */
38
- declare function useEventBus(): EventBusContextType;
39
- /**
40
- * Hook for subscribing to a specific event.
41
- * Automatically cleans up subscription on unmount.
42
- *
43
- * @param event - Event name to subscribe to
44
- * @param handler - Event handler function
45
- *
46
- * @example
47
- * ```tsx
48
- * useEventListener('UI:CLICK', (event) => {
49
- * console.log('Clicked:', event.payload);
50
- * });
51
- * ```
52
- */
53
- declare function useEventListener(event: string, handler: EventListener): void;
54
- /**
55
- * Hook for emitting events.
56
- * Returns a memoized emit function.
57
- *
58
- * @returns Function to emit events
59
- *
60
- * @example
61
- * ```tsx
62
- * const emit = useEmitEvent();
63
- *
64
- * const handleClick = () => {
65
- * emit('UI:CLICK', { id: '123' });
66
- * };
67
- * ```
68
- */
69
- declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
70
-
71
10
  interface ChangeSummary {
72
11
  added: number;
73
12
  modified: number;
@@ -488,6 +427,67 @@ interface UseValidationResult {
488
427
  }
489
428
  declare function useValidation(): UseValidationResult;
490
429
 
430
+ declare global {
431
+ interface Window {
432
+ __kflowEventBus?: EventBusContextType | null;
433
+ }
434
+ }
435
+ /**
436
+ * Hook for accessing the event bus.
437
+ *
438
+ * Uses EventBusProvider context if available, otherwise falls back to
439
+ * a simple in-memory event bus (for design system / Storybook).
440
+ *
441
+ * @returns Event bus instance with emit, on, once, and hasListeners methods
442
+ *
443
+ * @example
444
+ * ```tsx
445
+ * const eventBus = useEventBus();
446
+ *
447
+ * // Emit an event
448
+ * eventBus.emit('UI:CLICK', { id: '123' });
449
+ *
450
+ * // Subscribe to an event
451
+ * useEffect(() => {
452
+ * return eventBus.on('UI:CLICK', (event) => {
453
+ * console.log('Clicked:', event.payload);
454
+ * });
455
+ * }, []);
456
+ * ```
457
+ */
458
+ declare function useEventBus(): EventBusContextType;
459
+ /**
460
+ * Hook for subscribing to a specific event.
461
+ * Automatically cleans up subscription on unmount.
462
+ *
463
+ * @param event - Event name to subscribe to
464
+ * @param handler - Event handler function
465
+ *
466
+ * @example
467
+ * ```tsx
468
+ * useEventListener('UI:CLICK', (event) => {
469
+ * console.log('Clicked:', event.payload);
470
+ * });
471
+ * ```
472
+ */
473
+ declare function useEventListener(event: string, handler: EventListener): void;
474
+ /**
475
+ * Hook for emitting events.
476
+ * Returns a memoized emit function.
477
+ *
478
+ * @returns Function to emit events
479
+ *
480
+ * @example
481
+ * ```tsx
482
+ * const emit = useEmitEvent();
483
+ *
484
+ * const handleClick = () => {
485
+ * emit('UI:CLICK', { id: '123' });
486
+ * };
487
+ * ```
488
+ */
489
+ declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
490
+
491
491
  /**
492
492
  * Hook to bridge UI events to state machine dispatch
493
493
  *
@@ -1,7 +1,7 @@
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-GTIAVPI5.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-3FENGM4Y.js';
2
2
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
3
3
  import '../chunk-3HJHHULT.js';
4
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-WGJIL4YR.js';
4
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-RUL35VPK.js';
5
5
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
6
6
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
7
7
  import '../chunk-TSETXL2E.js';
@@ -1,7 +1,7 @@
1
- export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-A2NPH2P3.js';
2
- import '../chunk-4LBNLALH.js';
3
- import '../chunk-DKQN5FVU.js';
4
- export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-WGJIL4YR.js';
1
+ export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-5K3GTPBX.js';
2
+ import '../chunk-4NAQLJ2M.js';
3
+ import '../chunk-YLKXEXBP.js';
4
+ export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-RUL35VPK.js';
5
5
  export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
6
6
  import '../chunk-3JGAROCW.js';
7
7
  import '../chunk-TSETXL2E.js';
@@ -1,11 +1,11 @@
1
- import '../chunk-GTIAVPI5.js';
1
+ import '../chunk-3FENGM4Y.js';
2
2
  import '../chunk-N7MVUW4R.js';
3
3
  import { registerTrait, unregisterTrait, updateTraitState } from '../chunk-42YQ6JVR.js';
4
4
  import '../chunk-3HJHHULT.js';
5
- import { useFetchedDataContext } from '../chunk-A2NPH2P3.js';
6
- import '../chunk-4LBNLALH.js';
7
- import '../chunk-DKQN5FVU.js';
8
- import '../chunk-WGJIL4YR.js';
5
+ import { useFetchedDataContext } from '../chunk-5K3GTPBX.js';
6
+ import '../chunk-4NAQLJ2M.js';
7
+ import '../chunk-YLKXEXBP.js';
8
+ import '../chunk-RUL35VPK.js';
9
9
  import { useEventBus } from '../chunk-YXZM3WCF.js';
10
10
  import '../chunk-3JGAROCW.js';
11
11
  import '../chunk-TSETXL2E.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.11.6",
3
+ "version": "2.11.7",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",