@almadar/ui 2.0.0 → 2.0.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.
Files changed (237) hide show
  1. package/dist/components/atoms/Avatar.d.ts +58 -0
  2. package/dist/components/atoms/Badge.d.ts +8 -0
  3. package/dist/components/atoms/Box.d.ts +57 -0
  4. package/dist/components/atoms/Button.d.ts +24 -0
  5. package/dist/components/atoms/Card.d.ts +18 -0
  6. package/dist/components/atoms/Center.d.ts +33 -0
  7. package/dist/components/atoms/Checkbox.d.ts +5 -0
  8. package/dist/components/atoms/ConditionalWrapper.d.ts +68 -0
  9. package/dist/components/atoms/Divider.d.ts +29 -0
  10. package/dist/components/atoms/Icon.d.ts +38 -0
  11. package/dist/components/atoms/Input.d.ts +26 -0
  12. package/dist/components/atoms/Label.d.ts +5 -0
  13. package/dist/components/atoms/LawReferenceTooltip.d.ts +48 -0
  14. package/dist/components/atoms/Overlay.d.ts +16 -0
  15. package/dist/components/atoms/ProgressBar.d.ts +63 -0
  16. package/dist/components/atoms/Radio.d.ts +26 -0
  17. package/dist/components/atoms/Select.d.ts +12 -0
  18. package/dist/components/atoms/Spacer.d.ts +25 -0
  19. package/dist/components/atoms/Spinner.d.ts +6 -0
  20. package/dist/components/atoms/Stack.d.ts +64 -0
  21. package/dist/components/atoms/Switch.d.ts +12 -0
  22. package/dist/components/atoms/TextHighlight.d.ts +53 -0
  23. package/dist/components/atoms/Textarea.d.ts +5 -0
  24. package/dist/components/atoms/ThemeSelector.d.ts +21 -0
  25. package/dist/components/atoms/ThemeToggle.d.ts +33 -0
  26. package/dist/components/atoms/Typography.d.ts +57 -0
  27. package/dist/components/atoms/game/ControlButton.d.ts +31 -0
  28. package/dist/components/atoms/game/HealthBar.d.ts +18 -0
  29. package/dist/components/atoms/game/ScoreDisplay.d.ts +21 -0
  30. package/dist/components/atoms/game/Sprite.d.ts +63 -0
  31. package/dist/components/atoms/game/StateIndicator.d.ts +31 -0
  32. package/dist/components/atoms/game/index.d.ts +12 -0
  33. package/dist/components/atoms/index.d.ts +27 -0
  34. package/dist/components/index.d.ts +6 -0
  35. package/dist/components/index.js +5 -5
  36. package/dist/components/molecules/Accordion.d.ts +67 -0
  37. package/dist/components/molecules/Alert.d.ts +24 -0
  38. package/dist/components/molecules/Breadcrumb.d.ts +55 -0
  39. package/dist/components/molecules/ButtonGroup.d.ts +67 -0
  40. package/dist/components/molecules/Card.d.ts +44 -0
  41. package/dist/components/molecules/Container.d.ts +30 -0
  42. package/dist/components/molecules/Drawer.d.ts +46 -0
  43. package/dist/components/molecules/EmptyState.d.ts +25 -0
  44. package/dist/components/molecules/ErrorBoundary.d.ts +55 -0
  45. package/dist/components/molecules/ErrorState.d.ts +13 -0
  46. package/dist/components/molecules/FilterGroup.d.ts +54 -0
  47. package/dist/components/molecules/Flex.d.ts +43 -0
  48. package/dist/components/molecules/FloatingActionButton.d.ts +69 -0
  49. package/dist/components/molecules/FormField.d.ts +16 -0
  50. package/dist/components/molecules/FormSectionHeader.d.ts +30 -0
  51. package/dist/components/molecules/Grid.d.ts +54 -0
  52. package/dist/components/molecules/InputGroup.d.ts +24 -0
  53. package/dist/components/molecules/LoadingState.d.ts +7 -0
  54. package/dist/components/molecules/Menu.d.ts +40 -0
  55. package/dist/components/molecules/Modal.d.ts +26 -0
  56. package/dist/components/molecules/Pagination.d.ts +66 -0
  57. package/dist/components/molecules/Popover.d.ts +39 -0
  58. package/dist/components/molecules/QuizBlock.d.ts +20 -0
  59. package/dist/components/molecules/RelationSelect.d.ts +48 -0
  60. package/dist/components/molecules/RepeatableFormSection.d.ts +58 -0
  61. package/dist/components/molecules/ScaledDiagram.d.ts +20 -0
  62. package/dist/components/molecules/SearchInput.d.ts +60 -0
  63. package/dist/components/molecules/SidePanel.d.ts +47 -0
  64. package/dist/components/molecules/SimpleGrid.d.ts +27 -0
  65. package/dist/components/molecules/Skeleton.d.ts +35 -0
  66. package/dist/components/molecules/Tabs.d.ts +45 -0
  67. package/dist/components/molecules/Toast.d.ts +35 -0
  68. package/dist/components/molecules/Tooltip.d.ts +25 -0
  69. package/dist/components/molecules/ViolationAlert.d.ts +49 -0
  70. package/dist/components/molecules/WizardNavigation.d.ts +51 -0
  71. package/dist/components/molecules/WizardProgress.d.ts +42 -0
  72. package/dist/components/molecules/game/StatBadge.d.ts +27 -0
  73. package/dist/components/molecules/index.d.ts +38 -0
  74. package/dist/components/molecules/markdown/CodeBlock.d.ts +25 -0
  75. package/dist/components/molecules/markdown/MarkdownContent.d.ts +26 -0
  76. package/dist/components/organisms/CardGrid.d.ts +72 -0
  77. package/dist/components/organisms/Chart.d.ts +59 -0
  78. package/dist/components/organisms/CodeViewer.d.ts +67 -0
  79. package/dist/components/organisms/ComponentPatterns.d.ts +441 -0
  80. package/dist/components/organisms/ConfirmDialog.d.ts +50 -0
  81. package/dist/components/organisms/ContentRenderer.d.ts +23 -0
  82. package/dist/components/organisms/CustomPattern.d.ts +104 -0
  83. package/dist/components/organisms/DataTable.d.ts +63 -0
  84. package/dist/components/organisms/DetailPanel.d.ts +71 -0
  85. package/dist/components/organisms/DocumentViewer.d.ts +60 -0
  86. package/dist/components/organisms/DrawerSlot.d.ts +39 -0
  87. package/dist/components/organisms/Form.d.ts +203 -0
  88. package/dist/components/organisms/FormSection.d.ts +59 -0
  89. package/dist/components/organisms/GraphCanvas.d.ts +69 -0
  90. package/dist/components/organisms/Header.d.ts +110 -0
  91. package/dist/components/organisms/JazariStateMachine.d.ts +60 -0
  92. package/dist/components/organisms/LayoutPatterns.d.ts +181 -0
  93. package/dist/components/organisms/List.d.ts +76 -0
  94. package/dist/components/organisms/MasterDetail.d.ts +43 -0
  95. package/dist/components/organisms/MediaGallery.d.ts +66 -0
  96. package/dist/components/organisms/Meter.d.ts +58 -0
  97. package/dist/components/organisms/ModalSlot.d.ts +35 -0
  98. package/dist/components/organisms/Navigation.d.ts +68 -0
  99. package/dist/components/organisms/OrbitalVisualization.d.ts +48 -0
  100. package/dist/components/organisms/PageHeader.d.ts +59 -0
  101. package/dist/components/organisms/Section.d.ts +44 -0
  102. package/dist/components/organisms/Sidebar.d.ts +65 -0
  103. package/dist/components/organisms/SignaturePad.d.ts +44 -0
  104. package/dist/components/organisms/Split.d.ts +42 -0
  105. package/dist/components/organisms/StatCard.d.ts +66 -0
  106. package/dist/components/organisms/StateMachineView.d.ts +36 -0
  107. package/dist/components/organisms/Table.d.ts +99 -0
  108. package/dist/components/organisms/Timeline.d.ts +58 -0
  109. package/dist/components/organisms/ToastSlot.d.ts +38 -0
  110. package/dist/components/organisms/UISlotRenderer.d.ts +112 -0
  111. package/dist/components/organisms/WizardContainer.d.ts +160 -0
  112. package/dist/components/organisms/book/BookChapterView.d.ts +17 -0
  113. package/dist/components/organisms/book/BookCoverPage.d.ts +19 -0
  114. package/dist/components/organisms/book/BookNavBar.d.ts +18 -0
  115. package/dist/components/organisms/book/BookTableOfContents.d.ts +18 -0
  116. package/dist/components/organisms/book/BookViewer.d.ts +28 -0
  117. package/dist/components/organisms/book/index.d.ts +7 -0
  118. package/dist/components/organisms/book/types.d.ts +77 -0
  119. package/dist/components/organisms/game/BattleBoard.d.ts +167 -0
  120. package/dist/components/organisms/game/CanvasEffect.d.ts +68 -0
  121. package/dist/components/organisms/game/CastleBoard.d.ts +85 -0
  122. package/dist/components/organisms/game/DialogueBox.d.ts +73 -0
  123. package/dist/components/organisms/game/GameAudioProvider.d.ts +47 -0
  124. package/dist/components/organisms/game/GameAudioToggle.d.ts +28 -0
  125. package/dist/components/organisms/game/GameHud.d.ts +40 -0
  126. package/dist/components/organisms/game/GameMenu.d.ts +43 -0
  127. package/dist/components/organisms/game/GameOverScreen.d.ts +56 -0
  128. package/dist/components/organisms/game/InventoryPanel.d.ts +67 -0
  129. package/dist/components/organisms/game/IsometricCanvas.d.ts +123 -0
  130. package/dist/components/organisms/game/TraitSlot.d.ts +86 -0
  131. package/dist/components/organisms/game/TraitStateViewer.d.ts +53 -0
  132. package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +26 -0
  133. package/dist/components/organisms/game/WorldMapBoard.d.ts +147 -0
  134. package/dist/components/organisms/game/editor/editorUtils.d.ts +109 -0
  135. package/dist/components/organisms/game/editor/index.d.ts +9 -0
  136. package/dist/components/organisms/game/hooks/useBattleState.d.ts +35 -0
  137. package/dist/components/organisms/game/hooks/useCamera.d.ts +41 -0
  138. package/dist/components/organisms/game/hooks/useGameAudio.d.ts +47 -0
  139. package/dist/components/organisms/game/hooks/useImageCache.d.ts +16 -0
  140. package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +45 -0
  141. package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +43 -0
  142. package/dist/components/organisms/game/index.d.ts +36 -0
  143. package/dist/components/organisms/game/managers/PhysicsManager.d.ts +103 -0
  144. package/dist/components/organisms/game/types/effects.d.ts +253 -0
  145. package/dist/components/organisms/game/types/isometric.d.ts +109 -0
  146. package/dist/components/organisms/game/types/spriteAnimation.d.ts +73 -0
  147. package/dist/components/organisms/game/utils/canvasEffects.d.ts +50 -0
  148. package/dist/components/organisms/game/utils/combatPresets.d.ts +15 -0
  149. package/dist/components/organisms/game/utils/isometric.d.ts +61 -0
  150. package/dist/components/organisms/game/utils/spriteAnimation.d.ts +57 -0
  151. package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +16 -0
  152. package/dist/components/organisms/index.d.ts +37 -0
  153. package/dist/components/organisms/layout/DashboardGrid.d.ts +34 -0
  154. package/dist/components/organisms/layout/MasterDetail.d.ts +32 -0
  155. package/dist/components/organisms/layout/SplitPane.d.ts +34 -0
  156. package/dist/components/organisms/layout/TabbedContainer.d.ts +42 -0
  157. package/dist/components/organisms/layout/index.d.ts +9 -0
  158. package/dist/components/organisms/types.d.ts +65 -0
  159. package/dist/components/templates/AuthLayout.d.ts +14 -0
  160. package/dist/components/templates/BattleTemplate.d.ts +25 -0
  161. package/dist/components/templates/CastleTemplate.d.ts +23 -0
  162. package/dist/components/templates/CounterTemplate.d.ts +44 -0
  163. package/dist/components/templates/DashboardLayout.d.ts +32 -0
  164. package/dist/components/templates/GameShell.d.ts +33 -0
  165. package/dist/components/templates/GameTemplate.d.ts +36 -0
  166. package/dist/components/templates/GenericAppTemplate.d.ts +30 -0
  167. package/dist/components/templates/WorldMapTemplate.d.ts +29 -0
  168. package/dist/components/templates/index.d.ts +10 -0
  169. package/dist/components/templates/types.d.ts +17 -0
  170. package/dist/context/DesignThemeContext.d.ts +21 -0
  171. package/dist/context/ThemeContext.d.ts +104 -0
  172. package/dist/context/UISlotContext.d.ts +75 -0
  173. package/dist/context/UserContext.d.ts +111 -0
  174. package/dist/context/index.d.ts +8 -0
  175. package/dist/hooks/event-bus-types.d.ts +71 -0
  176. package/dist/hooks/index.d.ts +25 -0
  177. package/dist/hooks/useAgentChat.d.ts +104 -0
  178. package/dist/hooks/useAuthContext.d.ts +25 -0
  179. package/dist/hooks/useCompile.d.ts +22 -0
  180. package/dist/hooks/useDeepAgentGeneration.d.ts +46 -0
  181. package/dist/hooks/useEntities.d.ts +52 -0
  182. package/dist/hooks/useEntityData.d.ts +155 -0
  183. package/dist/hooks/useEntityMutations.d.ts +80 -0
  184. package/dist/hooks/useEventBus.d.ts +96 -0
  185. package/dist/hooks/useExtensions.d.ts +32 -0
  186. package/dist/hooks/useFileEditor.d.ts +32 -0
  187. package/dist/hooks/useFileSystem.d.ts +40 -0
  188. package/dist/hooks/useGitHub.d.ts +58 -0
  189. package/dist/hooks/useOrbitalHistory.d.ts +39 -0
  190. package/dist/hooks/useOrbitalMutations.d.ts +95 -0
  191. package/dist/hooks/usePreview.d.ts +57 -0
  192. package/dist/hooks/useQuerySingleton.d.ts +78 -0
  193. package/dist/hooks/useResolvedEntity.d.ts +32 -0
  194. package/dist/hooks/useTranslate.d.ts +35 -0
  195. package/dist/hooks/useUIEvents.d.ts +35 -0
  196. package/dist/hooks/useUISlots.d.ts +84 -0
  197. package/dist/hooks/useValidation.d.ts +46 -0
  198. package/dist/lib/api-client.d.ts +42 -0
  199. package/dist/lib/cn.d.ts +6 -0
  200. package/dist/lib/debug.d.ts +43 -0
  201. package/dist/lib/debugRegistry.d.ts +29 -0
  202. package/dist/lib/debugUtils.d.ts +27 -0
  203. package/dist/lib/entityDebug.d.ts +38 -0
  204. package/dist/lib/getNestedValue.d.ts +33 -0
  205. package/dist/lib/guardRegistry.d.ts +32 -0
  206. package/dist/lib/index.d.ts +18 -0
  207. package/dist/lib/jazari/svg-paths.d.ts +61 -0
  208. package/dist/lib/parseContentSegments.d.ts +41 -0
  209. package/dist/lib/tickRegistry.d.ts +40 -0
  210. package/dist/lib/traitRegistry.d.ts +34 -0
  211. package/dist/lib/verificationRegistry.d.ts +107 -0
  212. package/dist/lib/visualizer/index.d.ts +143 -0
  213. package/dist/locales/index.d.ts +20 -0
  214. package/dist/providers/EventBusProvider.d.ts +60 -0
  215. package/dist/providers/FetchedDataProvider.d.ts +105 -0
  216. package/dist/providers/OfflineModeProvider.d.ts +79 -0
  217. package/dist/providers/OrbitalProvider.d.ts +101 -0
  218. package/dist/providers/SelectionProvider.d.ts +81 -0
  219. package/dist/providers/VerificationProvider.d.ts +63 -0
  220. package/dist/providers/index.d.ts +17 -0
  221. package/dist/providers/index.js +3 -3
  222. package/dist/renderer/client-effect-executor.d.ts +68 -0
  223. package/dist/renderer/data-resolver.d.ts +68 -0
  224. package/dist/renderer/index.d.ts +28 -0
  225. package/dist/renderer/index.js +1 -1
  226. package/dist/renderer/init.d.ts +14 -0
  227. package/dist/renderer/navigation.d.ts +142 -0
  228. package/dist/renderer/offline-executor.d.ts +238 -0
  229. package/dist/renderer/pattern-resolver.d.ts +91 -0
  230. package/dist/renderer/slot-definitions.d.ts +45 -0
  231. package/dist/renderer/types.d.ts +160 -0
  232. package/dist/renderer/useClientEffects.d.ts +88 -0
  233. package/dist/stores/entityStore.d.ts +99 -0
  234. package/dist/stores/filtering.d.ts +51 -0
  235. package/dist/stores/index.d.ts +7 -0
  236. package/package.json +4 -3
  237. package/dist/{chunk-YNP2OBK4.js → chunk-RIZ76XRF.js} +1 -1
@@ -0,0 +1,101 @@
1
+ /**
2
+ * OrbitalProvider
3
+ *
4
+ * Unified provider that combines all required contexts for Orbital applications.
5
+ * Provides a single import for both Builder preview and compiled shell.
6
+ *
7
+ * Combines:
8
+ * - ThemeProvider - Theme and color mode management
9
+ * - EventBusProvider - Page-scoped event pub/sub
10
+ * - SelectionProvider - Selected entity tracking
11
+ * - FetchedDataProvider - Server-fetched entity data
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+ import React, { type ReactNode } from 'react';
16
+ import { type ThemeDefinition } from '../context/ThemeContext';
17
+ export interface OrbitalProviderProps {
18
+ children: ReactNode;
19
+ /** Custom themes (merged with built-in themes) */
20
+ themes?: ThemeDefinition[];
21
+ /** Default theme name */
22
+ defaultTheme?: string;
23
+ /** Default color mode */
24
+ defaultMode?: 'light' | 'dark' | 'system';
25
+ /** Optional target element ref for scoped theme application */
26
+ targetRef?: React.RefObject<HTMLElement>;
27
+ /** Skip ThemeProvider (use when already inside a themed container like shadow DOM) */
28
+ skipTheme?: boolean;
29
+ /** Enable debug logging for all providers */
30
+ debug?: boolean;
31
+ /** Initial fetched data */
32
+ initialData?: Record<string, unknown[]>;
33
+ /**
34
+ * Enable Suspense mode. When true, UISlotRenderer wraps each slot in
35
+ * `<ErrorBoundary><Suspense>` with Skeleton fallbacks.
36
+ * Opt-in — existing isLoading prop pattern still works when false/absent.
37
+ */
38
+ suspense?: boolean;
39
+ /**
40
+ * Enable verification wiring for visual testing.
41
+ * When true, lifecycle events are recorded and exposed via
42
+ * `window.__orbitalVerification` for Playwright/automation.
43
+ * Default: true in development, false in production.
44
+ */
45
+ verification?: boolean;
46
+ }
47
+ /**
48
+ * OrbitalProvider - Unified context provider for Orbital applications
49
+ *
50
+ * Wraps your application with all required providers in the correct order.
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * // Basic usage
55
+ * function App() {
56
+ * return (
57
+ * <OrbitalProvider>
58
+ * <Router>
59
+ * <Routes />
60
+ * </Router>
61
+ * </OrbitalProvider>
62
+ * );
63
+ * }
64
+ *
65
+ * // With configuration
66
+ * function App() {
67
+ * return (
68
+ * <OrbitalProvider
69
+ * defaultTheme="minimalist"
70
+ * defaultMode="dark"
71
+ * debug={process.env.NODE_ENV === 'development'}
72
+ * >
73
+ * <Router>
74
+ * <Routes />
75
+ * </Router>
76
+ * </OrbitalProvider>
77
+ * );
78
+ * }
79
+ *
80
+ * // With custom themes from schema
81
+ * import { THEMES } from './generated/theme-manifest';
82
+ *
83
+ * function App() {
84
+ * return (
85
+ * <OrbitalProvider themes={THEMES} defaultTheme="ocean">
86
+ * <Router>
87
+ * <Routes />
88
+ * </Router>
89
+ * </OrbitalProvider>
90
+ * );
91
+ * }
92
+ * ```
93
+ */
94
+ export declare function OrbitalProvider({ children, themes, defaultTheme, defaultMode, targetRef, skipTheme, debug, initialData, suspense, verification, }: OrbitalProviderProps): React.ReactElement;
95
+ export declare namespace OrbitalProvider {
96
+ var displayName: string;
97
+ }
98
+ export { ThemeProvider } from '../context/ThemeContext';
99
+ export { EventBusProvider } from './EventBusProvider';
100
+ export { SelectionProvider } from './SelectionProvider';
101
+ export { FetchedDataProvider } from './FetchedDataProvider';
@@ -0,0 +1,81 @@
1
+ /**
2
+ * SelectionProvider - Manages selected entity state
3
+ *
4
+ * Separates selection state from the EventBusProvider to maintain
5
+ * clean architecture (event bus stays pure pub/sub).
6
+ *
7
+ * This provider:
8
+ * - Listens to UI:VIEW and UI:SELECT events to track selected entity
9
+ * - Listens to UI:CLOSE, UI:DESELECT, UI:CANCEL to clear selection
10
+ * - Provides the selected entity to any component that needs it
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+ import React, { type ReactNode } from 'react';
15
+ export interface SelectionContextType<T = unknown> {
16
+ /** The currently selected entity */
17
+ selected: T | null;
18
+ /** Manually set the selected entity */
19
+ setSelected: (entity: T | null) => void;
20
+ /** Clear the selection */
21
+ clearSelection: () => void;
22
+ /** Check if an entity is selected */
23
+ isSelected: (entity: T) => boolean;
24
+ }
25
+ declare const SelectionContext: React.Context<SelectionContextType<unknown> | null>;
26
+ interface SelectionProviderProps {
27
+ children: ReactNode;
28
+ /** Enable debug logging */
29
+ debug?: boolean;
30
+ /** Custom comparison function for isSelected */
31
+ compareEntities?: (a: unknown, b: unknown) => boolean;
32
+ }
33
+ /**
34
+ * Provider component for selection state.
35
+ *
36
+ * Must be used within an EventBusProvider.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * function OrderListPage() {
41
+ * return (
42
+ * <EventBusProvider>
43
+ * <SelectionProvider debug={process.env.NODE_ENV === 'development'}>
44
+ * <OrderTable />
45
+ * <OrderDetailDrawer />
46
+ * </SelectionProvider>
47
+ * </EventBusProvider>
48
+ * );
49
+ * }
50
+ * ```
51
+ */
52
+ export declare function SelectionProvider({ children, debug, compareEntities, }: SelectionProviderProps): import("react/jsx-runtime").JSX.Element;
53
+ /**
54
+ * Hook to access selection state.
55
+ *
56
+ * @throws Error if used outside SelectionProvider
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * function OrderDetailDrawer() {
61
+ * const { selected, clearSelection } = useSelection<Order>();
62
+ *
63
+ * if (!selected) return null;
64
+ *
65
+ * return (
66
+ * <Drawer onClose={clearSelection}>
67
+ * <OrderDetail order={selected} />
68
+ * </Drawer>
69
+ * );
70
+ * }
71
+ * ```
72
+ */
73
+ export declare function useSelection<T = unknown>(): SelectionContextType<T>;
74
+ /**
75
+ * Hook to access selection state with fallback for components
76
+ * that may be used outside SelectionProvider.
77
+ *
78
+ * Returns null if no SelectionProvider is found.
79
+ */
80
+ export declare function useSelectionOptional<T = unknown>(): SelectionContextType<T> | null;
81
+ export { SelectionContext };
@@ -0,0 +1,63 @@
1
+ /**
2
+ * VerificationProvider
3
+ *
4
+ * Wires the verification registry to both compiled and runtime execution paths.
5
+ *
6
+ * **Compiled apps**: Intercepts event bus lifecycle events
7
+ * (`{traitName}:DISPATCH`, `{traitName}:{event}:SUCCESS`, `{traitName}:{event}:ERROR`)
8
+ * emitted by `useOrbitalBridge` and records transitions via `recordTransition()`.
9
+ *
10
+ * **Runtime apps**: Accepts an optional `StateMachineManager` and wires its
11
+ * `TransitionObserver` to `recordTransition()`.
12
+ *
13
+ * **Both**: Calls `bindEventBus()` and `bindTraitStateGetter()` to populate
14
+ * `window.__orbitalVerification` for Playwright/automation.
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+ import React, { type ReactNode } from 'react';
19
+ /**
20
+ * Observer interface compatible with `StateMachineManager.setObserver()`.
21
+ * Defined locally to avoid hard dependency on `@almadar/runtime`.
22
+ */
23
+ interface TransitionObserver {
24
+ onTransition(trace: {
25
+ traitName: string;
26
+ from: string;
27
+ to: string;
28
+ event: string;
29
+ guardResult?: boolean;
30
+ effects: Array<{
31
+ type: string;
32
+ args: unknown[];
33
+ status: 'executed' | 'failed' | 'skipped';
34
+ error?: string;
35
+ durationMs?: number;
36
+ }>;
37
+ }): void;
38
+ }
39
+ /**
40
+ * Minimal interface for StateMachineManager — avoids importing the full runtime.
41
+ */
42
+ interface StateMachineManagerLike {
43
+ setObserver(observer: TransitionObserver): void;
44
+ getState?(traitName: string): string | undefined;
45
+ }
46
+ export interface VerificationProviderProps {
47
+ children: ReactNode;
48
+ /** Enable verification wiring (default: true in dev, false in prod) */
49
+ enabled?: boolean;
50
+ /** Optional runtime StateMachineManager for interpreted mode */
51
+ runtimeManager?: StateMachineManagerLike;
52
+ /** Optional trait state getter for compiled apps (maps traitName → currentState) */
53
+ traitStateGetter?: (traitName: string) => string | undefined;
54
+ }
55
+ /**
56
+ * VerificationProvider — wires the verification registry to the event bus
57
+ * and optional runtime manager. Renders children unchanged.
58
+ */
59
+ export declare function VerificationProvider({ children, enabled, runtimeManager, traitStateGetter, }: VerificationProviderProps): React.ReactElement;
60
+ export declare namespace VerificationProvider {
61
+ var displayName: string;
62
+ }
63
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Providers barrel export
3
+ *
4
+ * Unified providers for Orbital applications.
5
+ * Use OrbitalProvider for most cases - it combines all required providers.
6
+ */
7
+ export { OrbitalProvider, type OrbitalProviderProps } from './OrbitalProvider';
8
+ export type { ThemeDefinition } from '../context/ThemeContext';
9
+ export { EventBusProvider, EventBusContext } from './EventBusProvider';
10
+ export { SelectionProvider, SelectionContext, useSelection, useSelectionOptional } from './SelectionProvider';
11
+ export type { SelectionContextType } from './SelectionProvider';
12
+ export { FetchedDataProvider, FetchedDataContext, useFetchedDataContext, useFetchedData, useFetchedEntity, } from './FetchedDataProvider';
13
+ export type { FetchedDataProviderProps, FetchedDataContextValue, FetchedDataState, EntityRecord, } from './FetchedDataProvider';
14
+ export { VerificationProvider } from './VerificationProvider';
15
+ export type { VerificationProviderProps } from './VerificationProvider';
16
+ export { OfflineModeProvider, useOfflineMode, useOptionalOfflineMode, } from './OfflineModeProvider';
17
+ export type { OfflineModeContextValue, OfflineModeProviderProps, } from './OfflineModeProvider';
@@ -1,12 +1,12 @@
1
- import { SuspenseConfigProvider } from '../chunk-YNP2OBK4.js';
1
+ import { SuspenseConfigProvider } from '../chunk-RIZ76XRF.js';
2
+ import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from '../chunk-45CTDYBT.js';
3
+ import '../chunk-KKCVDUK7.js';
2
4
  import { ThemeProvider } from '../chunk-BTXQJGFB.js';
3
5
  import { SelectionProvider, EntityDataProvider } from '../chunk-PE2H3NAW.js';
4
6
  export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-PE2H3NAW.js';
5
7
  import { useEventBus, EventBusProvider } from '../chunk-YXZM3WCF.js';
6
8
  export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
7
9
  import '../chunk-7NEWMNNU.js';
8
- import { recordTransition, registerCheck, bindEventBus, bindTraitStateGetter } from '../chunk-45CTDYBT.js';
9
- import '../chunk-KKCVDUK7.js';
10
10
  import { useOfflineExecutor } from '../chunk-PL7MD6GF.js';
11
11
  import '../chunk-PKBMQBKP.js';
12
12
  import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect } from 'react';
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Client Effect Executor
3
+ *
4
+ * Executes client effects returned from the server.
5
+ * This is the core of the dual execution model - the server processes
6
+ * events and returns client effects, which this module executes.
7
+ *
8
+ * Used by both Builder preview and compiled shells.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import type { ClientEffect, ClientEffectExecutorConfig, PatternConfig, NotifyOptions } from './types';
13
+ /**
14
+ * Execute an array of client effects.
15
+ *
16
+ * Effects are executed sequentially in order.
17
+ * Errors in one effect don't prevent subsequent effects from executing.
18
+ *
19
+ * @param effects - Array of client effects to execute
20
+ * @param config - Configuration providing implementations for each effect type
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * executeClientEffects(
25
+ * [
26
+ * ['render-ui', 'main', { type: 'entity-table', entity: 'Task' }],
27
+ * ['notify', 'Tasks loaded!', { type: 'success' }]
28
+ * ],
29
+ * {
30
+ * renderToSlot: (slot, pattern) => slotManager.render(slot, pattern),
31
+ * navigate: (path) => router.push(path),
32
+ * notify: (message, opts) => toast.show(message, opts),
33
+ * eventBus: { emit: (event, payload) => bus.emit(event, payload) }
34
+ * }
35
+ * );
36
+ * ```
37
+ */
38
+ export declare function executeClientEffects(effects: ClientEffect[], config: ClientEffectExecutorConfig): void;
39
+ /**
40
+ * Parse a raw effect array into a typed ClientEffect.
41
+ * Handles unknown effect formats gracefully.
42
+ */
43
+ export declare function parseClientEffect(raw: unknown[]): ClientEffect | null;
44
+ /**
45
+ * Parse an array of raw effects into typed ClientEffects.
46
+ * Filters out invalid effects.
47
+ */
48
+ export declare function parseClientEffects(raw: unknown[] | undefined): ClientEffect[];
49
+ /**
50
+ * Filter effects by type.
51
+ */
52
+ export declare function filterEffectsByType<T extends ClientEffect[0]>(effects: ClientEffect[], type: T): Extract<ClientEffect, [T, ...unknown[]]>[];
53
+ /**
54
+ * Get all render-ui effects.
55
+ */
56
+ export declare function getRenderUIEffects(effects: ClientEffect[]): Array<['render-ui', string, PatternConfig | null]>;
57
+ /**
58
+ * Get all navigate effects.
59
+ */
60
+ export declare function getNavigateEffects(effects: ClientEffect[]): Array<['navigate', string, Record<string, unknown>?]>;
61
+ /**
62
+ * Get all notify effects.
63
+ */
64
+ export declare function getNotifyEffects(effects: ClientEffect[]): Array<['notify', string, NotifyOptions?]>;
65
+ /**
66
+ * Get all emit effects.
67
+ */
68
+ export declare function getEmitEffects(effects: ClientEffect[]): Array<['emit', string, unknown?]>;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Data Resolver
3
+ *
4
+ * Resolves entity data for pattern rendering.
5
+ * Supports multiple data sources with priority:
6
+ * 1. Server-provided data (from EventResponse.data)
7
+ * 2. Entity store (Builder in-memory mock data)
8
+ * 3. Empty array (fallback)
9
+ *
10
+ * Used by both Builder's PatternRenderer and compiled shell's UISlotRenderer.
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+ import type { DataContext, DataResolution } from './types';
15
+ /**
16
+ * Resolve entity data from available sources.
17
+ *
18
+ * Priority:
19
+ * 1. fetchedData (from server response) - highest priority
20
+ * 2. entityStore (Builder mock data)
21
+ * 3. Empty array (fallback)
22
+ *
23
+ * @param entityName - Name of the entity to resolve data for
24
+ * @param context - Data context with available sources
25
+ * @returns Resolved data with loading state
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const { data, loading } = resolveEntityData('Task', {
30
+ * fetchedData: response.data,
31
+ * entityStore: mockStore
32
+ * });
33
+ * ```
34
+ */
35
+ export declare function resolveEntityData(entityName: string, context: DataContext): DataResolution;
36
+ /**
37
+ * Resolve entity data with query filtering.
38
+ *
39
+ * Applies query singleton filters if available.
40
+ *
41
+ * @param entityName - Name of the entity
42
+ * @param queryRef - Optional query reference for filtering
43
+ * @param context - Data context
44
+ * @returns Filtered resolved data
45
+ */
46
+ export declare function resolveEntityDataWithQuery(entityName: string, queryRef: string | undefined, context: DataContext): DataResolution;
47
+ /**
48
+ * Get a single entity record by ID.
49
+ */
50
+ export declare function resolveEntityById(entityName: string, id: string | number, context: DataContext): unknown | null;
51
+ /**
52
+ * Get the count of entities matching criteria.
53
+ */
54
+ export declare function resolveEntityCount(entityName: string, context: DataContext, filters?: Record<string, unknown>): number;
55
+ /**
56
+ * Check if any entities exist for a given entity name.
57
+ */
58
+ export declare function hasEntities(entityName: string, context: DataContext): boolean;
59
+ /**
60
+ * Create a data context from fetched data only.
61
+ * Convenience function for compiled shells.
62
+ */
63
+ export declare function createFetchedDataContext(data: Record<string, unknown[]>): DataContext;
64
+ /**
65
+ * Merge multiple data contexts.
66
+ * Later contexts take precedence.
67
+ */
68
+ export declare function mergeDataContexts(...contexts: DataContext[]): DataContext;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Shared Renderer Module
3
+ *
4
+ * Provides unified rendering logic for both Builder preview and compiled shells.
5
+ * This is the core of the runtime unification - both systems use this same code.
6
+ *
7
+ * Key components:
8
+ * - Types: Shared type definitions for effects, patterns, responses
9
+ * - Pattern Resolver: Pattern → Component resolution
10
+ * - Client Effect Executor: Execute clientEffects from server
11
+ * - useClientEffects: React hook for effect execution
12
+ * - Data Resolver: Entity data resolution with filtering
13
+ * - Slot Definitions: Inline vs portal slot configuration
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ export type { ClientEffect, NotifyOptions, ClientEffectExecutorConfig, PatternConfig, ResolvedPattern, EventResponse, UISlot, SlotType, SlotDefinition, DataContext, DataResolution, } from './types';
18
+ export { resolvePattern, isKnownPattern, getKnownPatterns, getPatternsByCategory, getPatternMapping, getPatternDefinition, initializePatternResolver, setComponentMapping, setPatternRegistry, } from './pattern-resolver';
19
+ export { executeClientEffects, parseClientEffect, parseClientEffects, filterEffectsByType, getRenderUIEffects, getNavigateEffects, getNotifyEffects, getEmitEffects, } from './client-effect-executor';
20
+ export { useClientEffects, useClientEffectConfig, useClientEffectConfigOptional, ClientEffectConfigProvider, ClientEffectConfigContext, } from './useClientEffects';
21
+ export type { UseClientEffectsOptions, UseClientEffectsResult, } from './useClientEffects';
22
+ export { resolveEntityData, resolveEntityDataWithQuery, resolveEntityById, resolveEntityCount, hasEntities, createFetchedDataContext, mergeDataContexts, } from './data-resolver';
23
+ export { SLOT_DEFINITIONS, getSlotDefinition, isPortalSlot, isInlineSlot, getSlotsByType, getInlineSlots, getPortalSlots, ALL_SLOTS, } from './slot-definitions';
24
+ export { OfflineExecutor, createOfflineExecutor, useOfflineExecutor, } from './offline-executor';
25
+ export type { PendingSyncEffect, OfflineExecutorConfig, OfflineExecutorState, UseOfflineExecutorOptions, UseOfflineExecutorResult, } from './offline-executor';
26
+ export { NavigationProvider, useNavigation, useNavigateTo, useNavigationState, useInitPayload, useActivePage, useNavigationId, matchPath, extractRouteParams, pathMatches, findPageByPath, findPageByName, getDefaultPage, getAllPages, } from './navigation';
27
+ export type { NavigationState, NavigationContextValue, NavigationProviderProps, } from './navigation';
28
+ export { initializePatterns } from './init';
@@ -126,7 +126,7 @@ function useClientEffects(effects, options) {
126
126
  }
127
127
  execute(effects);
128
128
  }, [effects, enabled, execute]);
129
- const prevEffectsRef = useRef();
129
+ const prevEffectsRef = useRef(void 0);
130
130
  useEffect(() => {
131
131
  if (effects !== prevEffectsRef.current) {
132
132
  prevEffectsRef.current = effects;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Pattern Resolver Initialization
3
+ *
4
+ * Loads pattern registry and component mapping from orbital-shared/patterns/
5
+ * and initializes the pattern resolver at app startup.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ /**
10
+ * Initialize the pattern resolver with shared pattern data.
11
+ * Must be called once at app startup before any pattern rendering.
12
+ * @returns The number of patterns initialized
13
+ */
14
+ export declare function initializePatterns(): number;
@@ -0,0 +1,142 @@
1
+ /**
2
+ * NavigationContext - Schema-Driven Navigation for Orbital Runtime
3
+ *
4
+ * Provides navigation within the orbital schema without react-router dependency.
5
+ * Navigation works by:
6
+ * 1. Matching path to a page in the schema
7
+ * 2. Extracting route params (e.g., /inspection/:id → { id: "123" })
8
+ * 3. Switching active page
9
+ * 4. Triggering INIT with merged payload
10
+ *
11
+ * This approach works whether OrbitalRuntime is standalone or embedded in another app.
12
+ *
13
+ * Used by both:
14
+ * - Builder runtime (interpreted execution)
15
+ * - Compiled shells (generated applications)
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ import React from 'react';
20
+ import type { OrbitalSchema, OrbitalPage } from '@almadar/core';
21
+ /**
22
+ * Match a concrete path against a pattern with :param placeholders.
23
+ * Returns null if no match, or the extracted params if match.
24
+ *
25
+ * @example
26
+ * matchPath('/inspection/:id', '/inspection/123') // { id: '123' }
27
+ * matchPath('/users/:userId/posts/:postId', '/users/42/posts/7') // { userId: '42', postId: '7' }
28
+ * matchPath('/about', '/about') // {}
29
+ * matchPath('/about', '/contact') // null
30
+ */
31
+ export declare function matchPath(pattern: string, path: string): Record<string, string> | null;
32
+ /**
33
+ * Extract route params from a path given its pattern.
34
+ * Wrapper around matchPath for explicit use.
35
+ */
36
+ export declare function extractRouteParams(pattern: string, path: string): Record<string, string>;
37
+ /**
38
+ * Check if a path matches a pattern.
39
+ */
40
+ export declare function pathMatches(pattern: string, path: string): boolean;
41
+ /**
42
+ * Find a page in the schema by matching its path pattern against a concrete path.
43
+ * Returns the page and extracted route params.
44
+ */
45
+ export declare function findPageByPath(schema: OrbitalSchema, path: string): {
46
+ page: OrbitalPage;
47
+ params: Record<string, string>;
48
+ orbitalName: string;
49
+ } | null;
50
+ /**
51
+ * Find a page by name.
52
+ */
53
+ export declare function findPageByName(schema: OrbitalSchema, pageName: string): {
54
+ page: OrbitalPage;
55
+ orbitalName: string;
56
+ } | null;
57
+ /**
58
+ * Get the first page in the schema (default page).
59
+ */
60
+ export declare function getDefaultPage(schema: OrbitalSchema): {
61
+ page: OrbitalPage;
62
+ orbitalName: string;
63
+ } | null;
64
+ /**
65
+ * Get all pages from the schema.
66
+ */
67
+ export declare function getAllPages(schema: OrbitalSchema): Array<{
68
+ page: OrbitalPage;
69
+ orbitalName: string;
70
+ }>;
71
+ export interface NavigationState {
72
+ /** Current active page name */
73
+ activePage: string;
74
+ /** Current path (for URL sync) */
75
+ currentPath: string;
76
+ /** Payload to pass to INIT when page loads */
77
+ initPayload: Record<string, unknown>;
78
+ /** Navigation counter (increments on each navigation) */
79
+ navigationId: number;
80
+ }
81
+ export interface NavigationContextValue {
82
+ /** Current navigation state */
83
+ state: NavigationState;
84
+ /** Navigate to a path with optional payload */
85
+ navigateTo: (path: string, payload?: Record<string, unknown>) => void;
86
+ /** Navigate to a page by name with optional payload */
87
+ navigateToPage: (pageName: string, payload?: Record<string, unknown>) => void;
88
+ /** The schema being navigated */
89
+ schema: OrbitalSchema;
90
+ /** Whether navigation is ready (schema loaded) */
91
+ isReady: boolean;
92
+ }
93
+ export interface NavigationProviderProps {
94
+ /** The schema to navigate within */
95
+ schema: OrbitalSchema;
96
+ /** Initial page name (optional, defaults to first page) */
97
+ initialPage?: string;
98
+ /** Whether to update browser URL on navigation (default: true) */
99
+ updateUrl?: boolean;
100
+ /** Callback when navigation occurs */
101
+ onNavigate?: (pageName: string, path: string, payload: Record<string, unknown>) => void;
102
+ /** Children */
103
+ children: React.ReactNode;
104
+ }
105
+ /**
106
+ * NavigationProvider - Provides schema-driven navigation context
107
+ *
108
+ * @example
109
+ * ```tsx
110
+ * <NavigationProvider schema={mySchema}>
111
+ * <OrbitalRuntimeContent />
112
+ * </NavigationProvider>
113
+ * ```
114
+ */
115
+ export declare function NavigationProvider({ schema, initialPage, updateUrl, onNavigate, children, }: NavigationProviderProps): React.ReactElement;
116
+ /**
117
+ * Hook to access navigation context.
118
+ * Returns null if not within NavigationProvider.
119
+ */
120
+ export declare function useNavigation(): NavigationContextValue | null;
121
+ /**
122
+ * Hook to get the navigateTo function.
123
+ * Returns a no-op function if not within NavigationProvider.
124
+ */
125
+ export declare function useNavigateTo(): (path: string, payload?: Record<string, unknown>) => void;
126
+ /**
127
+ * Hook to get current navigation state.
128
+ */
129
+ export declare function useNavigationState(): NavigationState | null;
130
+ /**
131
+ * Hook to get the current INIT payload (for passing to trait INIT events).
132
+ */
133
+ export declare function useInitPayload(): Record<string, unknown>;
134
+ /**
135
+ * Hook to get current active page name.
136
+ */
137
+ export declare function useActivePage(): string | null;
138
+ /**
139
+ * Hook to get navigation ID (changes on each navigation, useful for triggering effects).
140
+ */
141
+ export declare function useNavigationId(): number;
142
+ export default NavigationProvider;