@almadar/ui 2.0.1 → 2.0.2

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 (238) hide show
  1. package/dist/components/index.css +9 -11
  2. package/dist/components/index.js +3 -3
  3. package/dist/providers/index.css +9 -11
  4. package/dist/providers/index.js +2 -2
  5. package/package.json +2 -2
  6. package/dist/components/atoms/Avatar.d.ts +0 -58
  7. package/dist/components/atoms/Badge.d.ts +0 -8
  8. package/dist/components/atoms/Box.d.ts +0 -57
  9. package/dist/components/atoms/Button.d.ts +0 -24
  10. package/dist/components/atoms/Card.d.ts +0 -18
  11. package/dist/components/atoms/Center.d.ts +0 -33
  12. package/dist/components/atoms/Checkbox.d.ts +0 -5
  13. package/dist/components/atoms/ConditionalWrapper.d.ts +0 -68
  14. package/dist/components/atoms/Divider.d.ts +0 -29
  15. package/dist/components/atoms/Icon.d.ts +0 -38
  16. package/dist/components/atoms/Input.d.ts +0 -26
  17. package/dist/components/atoms/Label.d.ts +0 -5
  18. package/dist/components/atoms/LawReferenceTooltip.d.ts +0 -48
  19. package/dist/components/atoms/Overlay.d.ts +0 -16
  20. package/dist/components/atoms/ProgressBar.d.ts +0 -63
  21. package/dist/components/atoms/Radio.d.ts +0 -26
  22. package/dist/components/atoms/Select.d.ts +0 -12
  23. package/dist/components/atoms/Spacer.d.ts +0 -25
  24. package/dist/components/atoms/Spinner.d.ts +0 -6
  25. package/dist/components/atoms/Stack.d.ts +0 -64
  26. package/dist/components/atoms/Switch.d.ts +0 -12
  27. package/dist/components/atoms/TextHighlight.d.ts +0 -53
  28. package/dist/components/atoms/Textarea.d.ts +0 -5
  29. package/dist/components/atoms/ThemeSelector.d.ts +0 -21
  30. package/dist/components/atoms/ThemeToggle.d.ts +0 -33
  31. package/dist/components/atoms/Typography.d.ts +0 -57
  32. package/dist/components/atoms/game/ControlButton.d.ts +0 -31
  33. package/dist/components/atoms/game/HealthBar.d.ts +0 -18
  34. package/dist/components/atoms/game/ScoreDisplay.d.ts +0 -21
  35. package/dist/components/atoms/game/Sprite.d.ts +0 -63
  36. package/dist/components/atoms/game/StateIndicator.d.ts +0 -31
  37. package/dist/components/atoms/game/index.d.ts +0 -12
  38. package/dist/components/atoms/index.d.ts +0 -27
  39. package/dist/components/index.d.ts +0 -6
  40. package/dist/components/molecules/Accordion.d.ts +0 -67
  41. package/dist/components/molecules/Alert.d.ts +0 -24
  42. package/dist/components/molecules/Breadcrumb.d.ts +0 -55
  43. package/dist/components/molecules/ButtonGroup.d.ts +0 -67
  44. package/dist/components/molecules/Card.d.ts +0 -44
  45. package/dist/components/molecules/Container.d.ts +0 -30
  46. package/dist/components/molecules/Drawer.d.ts +0 -46
  47. package/dist/components/molecules/EmptyState.d.ts +0 -25
  48. package/dist/components/molecules/ErrorBoundary.d.ts +0 -55
  49. package/dist/components/molecules/ErrorState.d.ts +0 -13
  50. package/dist/components/molecules/FilterGroup.d.ts +0 -54
  51. package/dist/components/molecules/Flex.d.ts +0 -43
  52. package/dist/components/molecules/FloatingActionButton.d.ts +0 -69
  53. package/dist/components/molecules/FormField.d.ts +0 -16
  54. package/dist/components/molecules/FormSectionHeader.d.ts +0 -30
  55. package/dist/components/molecules/Grid.d.ts +0 -54
  56. package/dist/components/molecules/InputGroup.d.ts +0 -24
  57. package/dist/components/molecules/LoadingState.d.ts +0 -7
  58. package/dist/components/molecules/Menu.d.ts +0 -40
  59. package/dist/components/molecules/Modal.d.ts +0 -26
  60. package/dist/components/molecules/Pagination.d.ts +0 -66
  61. package/dist/components/molecules/Popover.d.ts +0 -39
  62. package/dist/components/molecules/QuizBlock.d.ts +0 -20
  63. package/dist/components/molecules/RelationSelect.d.ts +0 -48
  64. package/dist/components/molecules/RepeatableFormSection.d.ts +0 -58
  65. package/dist/components/molecules/ScaledDiagram.d.ts +0 -20
  66. package/dist/components/molecules/SearchInput.d.ts +0 -60
  67. package/dist/components/molecules/SidePanel.d.ts +0 -47
  68. package/dist/components/molecules/SimpleGrid.d.ts +0 -27
  69. package/dist/components/molecules/Skeleton.d.ts +0 -35
  70. package/dist/components/molecules/Tabs.d.ts +0 -45
  71. package/dist/components/molecules/Toast.d.ts +0 -35
  72. package/dist/components/molecules/Tooltip.d.ts +0 -25
  73. package/dist/components/molecules/ViolationAlert.d.ts +0 -49
  74. package/dist/components/molecules/WizardNavigation.d.ts +0 -51
  75. package/dist/components/molecules/WizardProgress.d.ts +0 -42
  76. package/dist/components/molecules/game/StatBadge.d.ts +0 -27
  77. package/dist/components/molecules/index.d.ts +0 -38
  78. package/dist/components/molecules/markdown/CodeBlock.d.ts +0 -25
  79. package/dist/components/molecules/markdown/MarkdownContent.d.ts +0 -26
  80. package/dist/components/organisms/CardGrid.d.ts +0 -72
  81. package/dist/components/organisms/Chart.d.ts +0 -59
  82. package/dist/components/organisms/CodeViewer.d.ts +0 -67
  83. package/dist/components/organisms/ComponentPatterns.d.ts +0 -441
  84. package/dist/components/organisms/ConfirmDialog.d.ts +0 -50
  85. package/dist/components/organisms/ContentRenderer.d.ts +0 -23
  86. package/dist/components/organisms/CustomPattern.d.ts +0 -104
  87. package/dist/components/organisms/DataTable.d.ts +0 -63
  88. package/dist/components/organisms/DetailPanel.d.ts +0 -71
  89. package/dist/components/organisms/DocumentViewer.d.ts +0 -60
  90. package/dist/components/organisms/DrawerSlot.d.ts +0 -39
  91. package/dist/components/organisms/Form.d.ts +0 -203
  92. package/dist/components/organisms/FormSection.d.ts +0 -59
  93. package/dist/components/organisms/GraphCanvas.d.ts +0 -69
  94. package/dist/components/organisms/Header.d.ts +0 -110
  95. package/dist/components/organisms/JazariStateMachine.d.ts +0 -60
  96. package/dist/components/organisms/LayoutPatterns.d.ts +0 -181
  97. package/dist/components/organisms/List.d.ts +0 -76
  98. package/dist/components/organisms/MasterDetail.d.ts +0 -43
  99. package/dist/components/organisms/MediaGallery.d.ts +0 -66
  100. package/dist/components/organisms/Meter.d.ts +0 -58
  101. package/dist/components/organisms/ModalSlot.d.ts +0 -35
  102. package/dist/components/organisms/Navigation.d.ts +0 -68
  103. package/dist/components/organisms/OrbitalVisualization.d.ts +0 -48
  104. package/dist/components/organisms/PageHeader.d.ts +0 -59
  105. package/dist/components/organisms/Section.d.ts +0 -44
  106. package/dist/components/organisms/Sidebar.d.ts +0 -65
  107. package/dist/components/organisms/SignaturePad.d.ts +0 -44
  108. package/dist/components/organisms/Split.d.ts +0 -42
  109. package/dist/components/organisms/StatCard.d.ts +0 -66
  110. package/dist/components/organisms/StateMachineView.d.ts +0 -36
  111. package/dist/components/organisms/Table.d.ts +0 -99
  112. package/dist/components/organisms/Timeline.d.ts +0 -58
  113. package/dist/components/organisms/ToastSlot.d.ts +0 -38
  114. package/dist/components/organisms/UISlotRenderer.d.ts +0 -112
  115. package/dist/components/organisms/WizardContainer.d.ts +0 -160
  116. package/dist/components/organisms/book/BookChapterView.d.ts +0 -17
  117. package/dist/components/organisms/book/BookCoverPage.d.ts +0 -19
  118. package/dist/components/organisms/book/BookNavBar.d.ts +0 -18
  119. package/dist/components/organisms/book/BookTableOfContents.d.ts +0 -18
  120. package/dist/components/organisms/book/BookViewer.d.ts +0 -28
  121. package/dist/components/organisms/book/index.d.ts +0 -7
  122. package/dist/components/organisms/book/types.d.ts +0 -77
  123. package/dist/components/organisms/game/BattleBoard.d.ts +0 -167
  124. package/dist/components/organisms/game/CanvasEffect.d.ts +0 -68
  125. package/dist/components/organisms/game/CastleBoard.d.ts +0 -85
  126. package/dist/components/organisms/game/DialogueBox.d.ts +0 -73
  127. package/dist/components/organisms/game/GameAudioProvider.d.ts +0 -47
  128. package/dist/components/organisms/game/GameAudioToggle.d.ts +0 -28
  129. package/dist/components/organisms/game/GameHud.d.ts +0 -40
  130. package/dist/components/organisms/game/GameMenu.d.ts +0 -43
  131. package/dist/components/organisms/game/GameOverScreen.d.ts +0 -56
  132. package/dist/components/organisms/game/InventoryPanel.d.ts +0 -67
  133. package/dist/components/organisms/game/IsometricCanvas.d.ts +0 -123
  134. package/dist/components/organisms/game/TraitSlot.d.ts +0 -86
  135. package/dist/components/organisms/game/TraitStateViewer.d.ts +0 -53
  136. package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +0 -26
  137. package/dist/components/organisms/game/WorldMapBoard.d.ts +0 -147
  138. package/dist/components/organisms/game/editor/editorUtils.d.ts +0 -109
  139. package/dist/components/organisms/game/editor/index.d.ts +0 -9
  140. package/dist/components/organisms/game/hooks/useBattleState.d.ts +0 -35
  141. package/dist/components/organisms/game/hooks/useCamera.d.ts +0 -41
  142. package/dist/components/organisms/game/hooks/useGameAudio.d.ts +0 -47
  143. package/dist/components/organisms/game/hooks/useImageCache.d.ts +0 -16
  144. package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +0 -45
  145. package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +0 -43
  146. package/dist/components/organisms/game/index.d.ts +0 -36
  147. package/dist/components/organisms/game/managers/PhysicsManager.d.ts +0 -103
  148. package/dist/components/organisms/game/types/effects.d.ts +0 -253
  149. package/dist/components/organisms/game/types/isometric.d.ts +0 -109
  150. package/dist/components/organisms/game/types/spriteAnimation.d.ts +0 -73
  151. package/dist/components/organisms/game/utils/canvasEffects.d.ts +0 -50
  152. package/dist/components/organisms/game/utils/combatPresets.d.ts +0 -15
  153. package/dist/components/organisms/game/utils/isometric.d.ts +0 -61
  154. package/dist/components/organisms/game/utils/spriteAnimation.d.ts +0 -57
  155. package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +0 -16
  156. package/dist/components/organisms/index.d.ts +0 -37
  157. package/dist/components/organisms/layout/DashboardGrid.d.ts +0 -34
  158. package/dist/components/organisms/layout/MasterDetail.d.ts +0 -32
  159. package/dist/components/organisms/layout/SplitPane.d.ts +0 -34
  160. package/dist/components/organisms/layout/TabbedContainer.d.ts +0 -42
  161. package/dist/components/organisms/layout/index.d.ts +0 -9
  162. package/dist/components/organisms/types.d.ts +0 -65
  163. package/dist/components/templates/AuthLayout.d.ts +0 -14
  164. package/dist/components/templates/BattleTemplate.d.ts +0 -25
  165. package/dist/components/templates/CastleTemplate.d.ts +0 -23
  166. package/dist/components/templates/CounterTemplate.d.ts +0 -44
  167. package/dist/components/templates/DashboardLayout.d.ts +0 -32
  168. package/dist/components/templates/GameShell.d.ts +0 -33
  169. package/dist/components/templates/GameTemplate.d.ts +0 -36
  170. package/dist/components/templates/GenericAppTemplate.d.ts +0 -30
  171. package/dist/components/templates/WorldMapTemplate.d.ts +0 -29
  172. package/dist/components/templates/index.d.ts +0 -10
  173. package/dist/components/templates/types.d.ts +0 -17
  174. package/dist/context/DesignThemeContext.d.ts +0 -21
  175. package/dist/context/ThemeContext.d.ts +0 -104
  176. package/dist/context/UISlotContext.d.ts +0 -75
  177. package/dist/context/UserContext.d.ts +0 -111
  178. package/dist/context/index.d.ts +0 -8
  179. package/dist/hooks/event-bus-types.d.ts +0 -71
  180. package/dist/hooks/index.d.ts +0 -25
  181. package/dist/hooks/useAgentChat.d.ts +0 -104
  182. package/dist/hooks/useAuthContext.d.ts +0 -25
  183. package/dist/hooks/useCompile.d.ts +0 -22
  184. package/dist/hooks/useDeepAgentGeneration.d.ts +0 -46
  185. package/dist/hooks/useEntities.d.ts +0 -52
  186. package/dist/hooks/useEntityData.d.ts +0 -155
  187. package/dist/hooks/useEntityMutations.d.ts +0 -80
  188. package/dist/hooks/useEventBus.d.ts +0 -96
  189. package/dist/hooks/useExtensions.d.ts +0 -32
  190. package/dist/hooks/useFileEditor.d.ts +0 -32
  191. package/dist/hooks/useFileSystem.d.ts +0 -40
  192. package/dist/hooks/useGitHub.d.ts +0 -58
  193. package/dist/hooks/useOrbitalHistory.d.ts +0 -39
  194. package/dist/hooks/useOrbitalMutations.d.ts +0 -95
  195. package/dist/hooks/usePreview.d.ts +0 -57
  196. package/dist/hooks/useQuerySingleton.d.ts +0 -78
  197. package/dist/hooks/useResolvedEntity.d.ts +0 -32
  198. package/dist/hooks/useTranslate.d.ts +0 -35
  199. package/dist/hooks/useUIEvents.d.ts +0 -35
  200. package/dist/hooks/useUISlots.d.ts +0 -84
  201. package/dist/hooks/useValidation.d.ts +0 -46
  202. package/dist/lib/api-client.d.ts +0 -42
  203. package/dist/lib/cn.d.ts +0 -6
  204. package/dist/lib/debug.d.ts +0 -43
  205. package/dist/lib/debugRegistry.d.ts +0 -29
  206. package/dist/lib/debugUtils.d.ts +0 -27
  207. package/dist/lib/entityDebug.d.ts +0 -38
  208. package/dist/lib/getNestedValue.d.ts +0 -33
  209. package/dist/lib/guardRegistry.d.ts +0 -32
  210. package/dist/lib/index.d.ts +0 -18
  211. package/dist/lib/jazari/svg-paths.d.ts +0 -61
  212. package/dist/lib/parseContentSegments.d.ts +0 -41
  213. package/dist/lib/tickRegistry.d.ts +0 -40
  214. package/dist/lib/traitRegistry.d.ts +0 -34
  215. package/dist/lib/verificationRegistry.d.ts +0 -107
  216. package/dist/lib/visualizer/index.d.ts +0 -143
  217. package/dist/locales/index.d.ts +0 -20
  218. package/dist/providers/EventBusProvider.d.ts +0 -60
  219. package/dist/providers/FetchedDataProvider.d.ts +0 -105
  220. package/dist/providers/OfflineModeProvider.d.ts +0 -79
  221. package/dist/providers/OrbitalProvider.d.ts +0 -101
  222. package/dist/providers/SelectionProvider.d.ts +0 -81
  223. package/dist/providers/VerificationProvider.d.ts +0 -63
  224. package/dist/providers/index.d.ts +0 -17
  225. package/dist/renderer/client-effect-executor.d.ts +0 -68
  226. package/dist/renderer/data-resolver.d.ts +0 -68
  227. package/dist/renderer/index.d.ts +0 -28
  228. package/dist/renderer/init.d.ts +0 -14
  229. package/dist/renderer/navigation.d.ts +0 -142
  230. package/dist/renderer/offline-executor.d.ts +0 -238
  231. package/dist/renderer/pattern-resolver.d.ts +0 -91
  232. package/dist/renderer/slot-definitions.d.ts +0 -45
  233. package/dist/renderer/types.d.ts +0 -160
  234. package/dist/renderer/useClientEffects.d.ts +0 -88
  235. package/dist/stores/entityStore.d.ts +0 -99
  236. package/dist/stores/filtering.d.ts +0 -51
  237. package/dist/stores/index.d.ts +0 -7
  238. package/dist/{chunk-RIZ76XRF.js → chunk-X3IKFHFT.js} +1 -1
@@ -1,155 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import React from "react";
3
- export interface EntityDataAdapter {
4
- /** Get all records for an entity */
5
- getData: (entity: string) => Record<string, unknown>[];
6
- /** Get a single record by entity name and ID */
7
- getById: (entity: string, id: string) => Record<string, unknown> | undefined;
8
- /** Whether data is currently loading */
9
- isLoading: boolean;
10
- /** Current error */
11
- error: string | null;
12
- }
13
- /**
14
- * Provider that bridges a host app's data source to useEntityList/useEntity hooks.
15
- *
16
- * @example
17
- * ```tsx
18
- * // In builder runtime
19
- * const fetchedData = useFetchedData();
20
- * const adapter = {
21
- * getData: fetchedData.getData,
22
- * getById: fetchedData.getById,
23
- * isLoading: fetchedData.loading,
24
- * error: fetchedData.error,
25
- * };
26
- * <EntityDataProvider adapter={adapter}>
27
- * {children}
28
- * </EntityDataProvider>
29
- * ```
30
- */
31
- export declare function EntityDataProvider({ adapter, children, }: {
32
- adapter: EntityDataAdapter;
33
- children: ReactNode;
34
- }): React.FunctionComponentElement<React.ProviderProps<EntityDataAdapter | null>>;
35
- /**
36
- * Access the entity data adapter (null if no provider).
37
- */
38
- export declare function useEntityDataAdapter(): EntityDataAdapter | null;
39
- export declare const entityDataKeys: {
40
- all: readonly ["entities"];
41
- lists: () => readonly ["entities", "list"];
42
- list: (entity: string, filters?: Record<string, unknown>) => readonly ["entities", "list", string, Record<string, unknown> | undefined];
43
- details: () => readonly ["entities", "detail"];
44
- detail: (entity: string, id: string) => readonly ["entities", "detail", string, string];
45
- };
46
- export type EntityDataRecord = Record<string, unknown>;
47
- export interface UseEntityListOptions {
48
- /** Skip fetching */
49
- skip?: boolean;
50
- }
51
- export interface UseEntityListResult<T = Record<string, unknown>> {
52
- data: T[];
53
- isLoading: boolean;
54
- error: Error | null;
55
- refetch: () => void;
56
- }
57
- export interface UseEntityDetailResult<T = Record<string, unknown>> {
58
- data: T | null;
59
- isLoading: boolean;
60
- error: Error | null;
61
- refetch: () => void;
62
- }
63
- export interface PaginationParams {
64
- page: number;
65
- pageSize: number;
66
- search?: string;
67
- sortBy?: string;
68
- sortDirection?: "asc" | "desc";
69
- filters?: Record<string, unknown>;
70
- }
71
- export interface UsePaginatedEntityListResult<T = Record<string, unknown>> {
72
- data: T[];
73
- isLoading: boolean;
74
- error: Error | null;
75
- totalCount: number;
76
- totalPages: number;
77
- hasNextPage: boolean;
78
- hasPreviousPage: boolean;
79
- refetch: () => void;
80
- }
81
- /**
82
- * Hook for fetching entity list data.
83
- * Uses EntityDataContext if available, otherwise falls back to stub.
84
- */
85
- export declare function useEntityList<T = Record<string, unknown>>(entity: string | undefined, options?: UseEntityListOptions): UseEntityListResult<T>;
86
- /**
87
- * Hook for fetching a single entity by ID.
88
- * Uses EntityDataContext if available, otherwise falls back to stub.
89
- */
90
- export declare function useEntity<T = Record<string, unknown>>(entity: string | undefined, id: string | undefined): {
91
- data: T | null;
92
- isLoading: boolean;
93
- error: Error | null;
94
- };
95
- /**
96
- * Hook for fetching entity detail by ID (alias for useEntity with refetch).
97
- * Uses EntityDataContext if available, otherwise falls back to stub.
98
- */
99
- export declare function useEntityDetail<T = Record<string, unknown>>(entity: string | undefined, id: string | undefined): UseEntityDetailResult<T>;
100
- /**
101
- * Hook for fetching paginated entity list data.
102
- * Uses EntityDataContext if available (client-side pagination), otherwise falls back to stub.
103
- */
104
- export declare function usePaginatedEntityList<T = Record<string, unknown>>(entity: string | undefined, params: PaginationParams, options?: UseEntityListOptions): UsePaginatedEntityListResult<T>;
105
- /**
106
- * Suspense-compatible hook for fetching entity list data.
107
- *
108
- * Instead of returning `isLoading`/`error`, this hook **suspends** (throws a Promise)
109
- * when data is not ready. Use inside a `<Suspense>` boundary.
110
- *
111
- * Falls back to the adapter when available; otherwise suspends briefly for stub data.
112
- *
113
- * @example
114
- * ```tsx
115
- * <Suspense fallback={<Skeleton variant="table" />}>
116
- * <ErrorBoundary>
117
- * <TaskList entity="Task" />
118
- * </ErrorBoundary>
119
- * </Suspense>
120
- *
121
- * function TaskList({ entity }: { entity: string }) {
122
- * const { data } = useEntityListSuspense<Task>(entity);
123
- * // No loading check needed — Suspense handles it
124
- * return <DataTable data={data} ... />;
125
- * }
126
- * ```
127
- */
128
- export declare function useEntityListSuspense<T = Record<string, unknown>>(entity: string): {
129
- data: T[];
130
- refetch: () => void;
131
- };
132
- /**
133
- * Suspense-compatible hook for fetching a single entity by ID.
134
- *
135
- * Suspends when data is not ready. Use inside a `<Suspense>` boundary.
136
- *
137
- * @example
138
- * ```tsx
139
- * <Suspense fallback={<Skeleton variant="form" />}>
140
- * <ErrorBoundary>
141
- * <TaskDetail entity="Task" id={taskId} />
142
- * </ErrorBoundary>
143
- * </Suspense>
144
- *
145
- * function TaskDetail({ entity, id }: { entity: string; id: string }) {
146
- * const { data } = useEntitySuspense<Task>(entity, id);
147
- * return <DetailPanel data={data} ... />;
148
- * }
149
- * ```
150
- */
151
- export declare function useEntitySuspense<T = Record<string, unknown>>(entity: string, id: string): {
152
- data: T | null;
153
- refetch: () => void;
154
- };
155
- export default useEntityList;
@@ -1,80 +0,0 @@
1
- /**
2
- * useEntityMutations - Entity CRUD mutation hooks
3
- *
4
- * Provides create, update, and delete mutations for entities.
5
- * Used by trait hooks for persist_data effects.
6
- *
7
- * @deprecated For new code, prefer useOrbitalMutations which sends mutations
8
- * through the orbital events route. This ensures all mutations go through
9
- * trait state machines and enforce guards/effects.
10
- *
11
- * Migration:
12
- * ```tsx
13
- * // Old (deprecated):
14
- * const { createEntity } = useEntityMutations('Task');
15
- *
16
- * // New (recommended):
17
- * const { createEntity } = useOrbitalMutations('Task', 'TaskManager');
18
- * ```
19
- *
20
- * @see useOrbitalMutations
21
- */
22
- import { type OrbitalEventResponse } from './useOrbitalMutations';
23
- export interface EntityMutationResult {
24
- id: string;
25
- [key: string]: unknown;
26
- }
27
- /**
28
- * Hook for creating entities
29
- */
30
- export declare function useCreateEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<EntityMutationResult, Error, Record<string, unknown>, unknown>;
31
- /**
32
- * Hook for updating entities
33
- */
34
- export declare function useUpdateEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<EntityMutationResult, Error, {
35
- id: string;
36
- data: Record<string, unknown>;
37
- }, unknown>;
38
- /**
39
- * Hook for deleting entities
40
- */
41
- export declare function useDeleteEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<{
42
- id: string;
43
- }, Error, string, unknown>;
44
- export interface UseEntityMutationsOptions {
45
- /**
46
- * If provided, mutations go through orbital events route instead of direct CRUD.
47
- * This is the recommended approach for Phase 7+ compliance.
48
- */
49
- orbitalName?: string;
50
- /**
51
- * Custom event names when using orbital-based mutations
52
- */
53
- events?: {
54
- create?: string;
55
- update?: string;
56
- delete?: string;
57
- };
58
- }
59
- /**
60
- * Combined hook that provides all entity mutations
61
- * Used by trait hooks for persist_data effects
62
- *
63
- * @param entityName - The entity type name
64
- * @param options - Optional configuration including orbital-based mutations
65
- *
66
- * @deprecated For new code, prefer useOrbitalMutations directly
67
- */
68
- export declare function useEntityMutations(entityName: string, options?: UseEntityMutationsOptions): {
69
- createEntity: (entityOrData: string | Record<string, unknown>, data?: Record<string, unknown>) => Promise<OrbitalEventResponse | EntityMutationResult | undefined>;
70
- updateEntity: (id: string | undefined, data: Record<string, unknown>) => Promise<OrbitalEventResponse | EntityMutationResult | undefined>;
71
- deleteEntity: (id: string | undefined) => Promise<OrbitalEventResponse | {
72
- id: string;
73
- } | undefined>;
74
- isCreating: boolean;
75
- isUpdating: boolean;
76
- isDeleting: boolean;
77
- createError: Error | null;
78
- updateError: Error | null;
79
- deleteError: Error | null;
80
- };
@@ -1,96 +0,0 @@
1
- import type { KFlowEvent, EventListener, Unsubscribe, EventBusContextType } from './event-bus-types';
2
- export type { KFlowEvent, EventListener, Unsubscribe, EventBusContextType };
3
- declare global {
4
- interface Window {
5
- __kflowEventBus?: EventBusContextType | null;
6
- }
7
- }
8
- /**
9
- * Global event bus reference for bridging between packages.
10
- *
11
- * Uses window-level global to enable cross-package communication.
12
- * This allows @almadar/ui components to emit events to the same bus
13
- * that the consuming app's trait state machine listens to.
14
- *
15
- * When the EventBusProvider mounts, it sets window.__kflowEventBus.
16
- * Components in any package can then use this shared event bus.
17
- *
18
- * SSR Safety: All window access is guarded by `typeof window !== 'undefined'`.
19
- * React Compiler Safety: The global bus reference is set once at provider mount
20
- * and is stable — no render-path side effects. In practice, the React context
21
- * path (priority 1) is used in real apps; the window global (priority 2) is
22
- * only reached when no EventBusProvider is in the tree (e.g., Storybook).
23
- */
24
- /**
25
- * Set the global event bus reference.
26
- * Called by EventBusProvider when it mounts.
27
- *
28
- * @param bus - The event bus context to set as global, or null to clear
29
- */
30
- export declare function setGlobalEventBus(bus: EventBusContextType | null): void;
31
- /**
32
- * Get the global event bus reference.
33
- *
34
- * @returns The global event bus if set, null otherwise
35
- */
36
- export declare function getGlobalEventBus(): EventBusContextType | null;
37
- /**
38
- * Hook for accessing the event bus.
39
- *
40
- * Uses EventBusProvider context if available, otherwise falls back to
41
- * a simple in-memory event bus (for design system / Storybook).
42
- *
43
- * @returns Event bus instance with emit, on, once, and hasListeners methods
44
- *
45
- * @example
46
- * ```tsx
47
- * const eventBus = useEventBus();
48
- *
49
- * // Emit an event
50
- * eventBus.emit('UI:CLICK', { id: '123' });
51
- *
52
- * // Subscribe to an event
53
- * useEffect(() => {
54
- * return eventBus.on('UI:CLICK', (event) => {
55
- * console.log('Clicked:', event.payload);
56
- * });
57
- * }, []);
58
- * ```
59
- */
60
- export declare function useEventBus(): EventBusContextType;
61
- /**
62
- * Hook for subscribing to a specific event.
63
- * Automatically cleans up subscription on unmount.
64
- *
65
- * @param event - Event name to subscribe to
66
- * @param handler - Event handler function
67
- *
68
- * @example
69
- * ```tsx
70
- * useEventListener('UI:CLICK', (event) => {
71
- * console.log('Clicked:', event.payload);
72
- * });
73
- * ```
74
- */
75
- export declare function useEventListener(event: string, handler: EventListener): void;
76
- /**
77
- * Alias for useEventListener for backward compatibility
78
- */
79
- export declare const useEventSubscription: typeof useEventListener;
80
- /**
81
- * Hook for emitting events.
82
- * Returns a memoized emit function.
83
- *
84
- * @returns Function to emit events
85
- *
86
- * @example
87
- * ```tsx
88
- * const emit = useEmitEvent();
89
- *
90
- * const handleClick = () => {
91
- * emit('UI:CLICK', { id: '123' });
92
- * };
93
- * ```
94
- */
95
- export declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
96
- export default useEventBus;
@@ -1,32 +0,0 @@
1
- export interface Extension {
2
- id: string;
3
- name: string;
4
- language?: string;
5
- loaded: boolean;
6
- }
7
- export interface ExtensionEntry {
8
- file: string;
9
- language?: string;
10
- }
11
- export interface ExtensionManifest {
12
- languages: Record<string, {
13
- extensions: string[];
14
- icon?: string;
15
- color?: string;
16
- }>;
17
- extensions: ExtensionEntry[];
18
- }
19
- export interface UseExtensionsOptions {
20
- appId: string;
21
- loadOnMount?: boolean;
22
- }
23
- export interface UseExtensionsResult {
24
- extensions: Extension[];
25
- manifest: ExtensionManifest;
26
- isLoading: boolean;
27
- error: string | null;
28
- loadExtension: (extensionId: string) => Promise<void>;
29
- loadExtensions: () => Promise<void>;
30
- getExtensionForFile: (filename: string) => Extension | null;
31
- }
32
- export declare function useExtensions(options: UseExtensionsOptions): UseExtensionsResult;
@@ -1,32 +0,0 @@
1
- import type { UseExtensionsResult } from './useExtensions';
2
- import type { UseFileSystemResult } from './useFileSystem';
3
- import type { OrbitalSchema } from '@almadar/core';
4
- export interface OpenFile {
5
- path: string;
6
- content: string;
7
- isDirty: boolean;
8
- language?: string;
9
- }
10
- export interface UseFileEditorOptions {
11
- extensions: UseExtensionsResult;
12
- fileSystem: UseFileSystemResult;
13
- onSchemaUpdate?: (schema: OrbitalSchema) => Promise<void>;
14
- }
15
- export interface FileEditResult {
16
- success: boolean;
17
- action?: 'updated_schema' | 'converted_extension' | 'saved_extension' | 'saved';
18
- error?: string;
19
- }
20
- export interface UseFileEditorResult {
21
- openFiles: OpenFile[];
22
- activeFile: OpenFile | null;
23
- isSaving: boolean;
24
- openFile: (path: string) => Promise<void>;
25
- closeFile: (path: string) => void;
26
- setActiveFile: (path: string) => void;
27
- updateFileContent: (path: string, content: string) => void;
28
- handleFileEdit: (path: string, content: string) => Promise<FileEditResult>;
29
- saveFile: (path: string) => Promise<void>;
30
- saveAllFiles: () => Promise<void>;
31
- }
32
- export declare function useFileEditor(options: UseFileEditorOptions): UseFileEditorResult;
@@ -1,40 +0,0 @@
1
- export interface FileNode {
2
- path: string;
3
- name: string;
4
- type: 'file' | 'directory';
5
- children?: FileNode[];
6
- }
7
- export type FileSystemStatus = 'idle' | 'booting' | 'ready' | 'running' | 'error';
8
- export interface FileSystemFile {
9
- path: string;
10
- content: string;
11
- }
12
- export interface SelectedFile {
13
- path: string;
14
- content: string;
15
- language?: string;
16
- isDirty?: boolean;
17
- }
18
- export interface UseFileSystemResult {
19
- status: FileSystemStatus;
20
- error: string | null;
21
- isLoading: boolean;
22
- files: FileNode[];
23
- selectedFile: SelectedFile | null;
24
- selectedPath: string | null;
25
- previewUrl: string | null;
26
- boot: () => Promise<void>;
27
- mountFiles: (files: FileSystemFile[] | Record<string, unknown>) => Promise<void>;
28
- readFile: (path: string) => Promise<string>;
29
- writeFile: (path: string, content: string) => Promise<void>;
30
- selectFile: (path: string) => Promise<void>;
31
- updateContent: (pathOrContent: string, content?: string) => void;
32
- updateSelectedContent: (content: string) => void;
33
- refreshTree: () => Promise<void>;
34
- runCommand: (command: string) => Promise<{
35
- exitCode: number;
36
- output: string;
37
- }>;
38
- startDevServer: () => Promise<void>;
39
- }
40
- export declare function useFileSystem(): UseFileSystemResult;
@@ -1,58 +0,0 @@
1
- /**
2
- * GitHub connection status
3
- */
4
- export interface GitHubStatus {
5
- connected: boolean;
6
- username?: string;
7
- avatarUrl?: string;
8
- scopes?: string[];
9
- connectedAt?: number;
10
- lastUsedAt?: number;
11
- }
12
- /**
13
- * GitHub repository
14
- */
15
- export interface GitHubRepo {
16
- id: number;
17
- name: string;
18
- fullName: string;
19
- owner: string;
20
- isPrivate: boolean;
21
- description: string | null;
22
- defaultBranch: string;
23
- url: string;
24
- }
25
- /**
26
- * Hook to get GitHub connection status
27
- */
28
- export declare function useGitHubStatus(): import("@tanstack/react-query").UseQueryResult<GitHubStatus, Error>;
29
- /**
30
- * Hook to connect GitHub (initiate OAuth flow)
31
- */
32
- export declare function useConnectGitHub(): {
33
- connectGitHub: () => void;
34
- };
35
- /**
36
- * Hook to disconnect GitHub
37
- */
38
- export declare function useDisconnectGitHub(): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
39
- /**
40
- * Hook to list GitHub repositories
41
- */
42
- export declare function useGitHubRepos(page?: number, perPage?: number): import("@tanstack/react-query").UseQueryResult<{
43
- repos: GitHubRepo[];
44
- page: number;
45
- perPage: number;
46
- }, Error>;
47
- /**
48
- * Hook to get repository details
49
- */
50
- export declare function useGitHubRepo(owner: string, repo: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
51
- repo: GitHubRepo;
52
- }, Error>;
53
- /**
54
- * Hook to list repository branches
55
- */
56
- export declare function useGitHubBranches(owner: string, repo: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
57
- branches: string[];
58
- }, Error>;
@@ -1,39 +0,0 @@
1
- import type { OrbitalSchema } from '@almadar/core';
2
- export interface ChangeSummary {
3
- added: number;
4
- modified: number;
5
- removed: number;
6
- }
7
- export interface HistoryTimelineItem {
8
- id: string;
9
- type: 'changeset' | 'snapshot';
10
- version: number;
11
- timestamp: number;
12
- description: string;
13
- source?: string;
14
- summary?: ChangeSummary;
15
- reason?: string;
16
- }
17
- export interface RevertResult {
18
- success: boolean;
19
- error?: string;
20
- restoredSchema?: OrbitalSchema;
21
- }
22
- export interface UseOrbitalHistoryOptions {
23
- appId: string | null;
24
- /** Firebase auth token for authenticated API requests */
25
- authToken?: string | null;
26
- /** User ID for x-user-id header (required for Firestore path) */
27
- userId?: string | null;
28
- onHistoryChange?: (timeline: HistoryTimelineItem[]) => void;
29
- onRevertSuccess?: (restoredSchema: OrbitalSchema) => void;
30
- }
31
- export interface UseOrbitalHistoryResult {
32
- timeline: HistoryTimelineItem[];
33
- currentVersion: number;
34
- isLoading: boolean;
35
- error: string | null;
36
- revertToSnapshot: (snapshotId: string) => Promise<RevertResult>;
37
- refresh: () => Promise<void>;
38
- }
39
- export declare function useOrbitalHistory(options: UseOrbitalHistoryOptions): UseOrbitalHistoryResult;
@@ -1,95 +0,0 @@
1
- /**
2
- * useOrbitalMutations - Event-based entity mutations via orbital events route
3
- *
4
- * This hook provides entity mutations that go through the orbital events route
5
- * instead of direct CRUD API calls. This ensures all mutations:
6
- * 1. Go through trait state machines
7
- * 2. Enforce guards
8
- * 3. Execute all trait effects (including persist)
9
- *
10
- * This is the Phase 7 replacement for direct CRUD mutations.
11
- *
12
- * @example
13
- * ```tsx
14
- * const { createEntity, updateEntity, deleteEntity } = useOrbitalMutations('Task', 'TaskManager');
15
- *
16
- * // Create - sends ENTITY_CREATE event to orbital
17
- * await createEntity({ title: 'New Task', status: 'pending' });
18
- *
19
- * // Update - sends ENTITY_UPDATE event to orbital
20
- * await updateEntity(taskId, { status: 'completed' });
21
- *
22
- * // Delete - sends ENTITY_DELETE event to orbital
23
- * await deleteEntity(taskId);
24
- * ```
25
- *
26
- * @packageDocumentation
27
- */
28
- /**
29
- * Standard events for entity mutations
30
- * These are handled by orbitals with CRUD-capable traits
31
- */
32
- export declare const ENTITY_EVENTS: {
33
- readonly CREATE: "ENTITY_CREATE";
34
- readonly UPDATE: "ENTITY_UPDATE";
35
- readonly DELETE: "ENTITY_DELETE";
36
- };
37
- export interface OrbitalEventPayload {
38
- event: string;
39
- payload?: Record<string, unknown>;
40
- entityId?: string;
41
- }
42
- export interface OrbitalEventResponse {
43
- success: boolean;
44
- transitioned: boolean;
45
- states: Record<string, string>;
46
- emittedEvents: Array<{
47
- event: string;
48
- payload?: unknown;
49
- }>;
50
- error?: string;
51
- }
52
- /**
53
- * Hook for event-based entity mutations via orbital events route
54
- *
55
- * @param entityName - The entity type name (for cache invalidation)
56
- * @param orbitalName - The orbital to send events to
57
- * @param options - Optional configuration
58
- */
59
- export declare function useOrbitalMutations(entityName: string, orbitalName: string, options?: {
60
- /** Custom event names for create/update/delete */
61
- events?: {
62
- create?: string;
63
- update?: string;
64
- delete?: string;
65
- };
66
- /** Enable debug logging */
67
- debug?: boolean;
68
- }): {
69
- createEntity: (data: Record<string, unknown>) => Promise<OrbitalEventResponse>;
70
- updateEntity: (id: string | undefined, data: Record<string, unknown>) => Promise<OrbitalEventResponse | undefined>;
71
- deleteEntity: (id: string | undefined) => Promise<OrbitalEventResponse | undefined>;
72
- createMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, Record<string, unknown>, unknown>;
73
- updateMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, {
74
- id: string;
75
- data: Record<string, unknown>;
76
- }, unknown>;
77
- deleteMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, string, unknown>;
78
- isCreating: boolean;
79
- isUpdating: boolean;
80
- isDeleting: boolean;
81
- isMutating: boolean;
82
- createError: Error | null;
83
- updateError: Error | null;
84
- deleteError: Error | null;
85
- };
86
- /**
87
- * Send a custom event to an orbital
88
- * For non-CRUD operations that go through trait state machines
89
- */
90
- export declare function useSendOrbitalEvent(orbitalName: string): {
91
- sendEvent: (event: string, payload?: Record<string, unknown>, entityId?: string) => Promise<OrbitalEventResponse>;
92
- isPending: boolean;
93
- error: Error | null;
94
- data: OrbitalEventResponse | undefined;
95
- };
@@ -1,57 +0,0 @@
1
- import type { OrbitalSchema } from '@almadar/core';
2
- export interface PreviewApp {
3
- id: string;
4
- name: string;
5
- status: 'loading' | 'ready' | 'error';
6
- schema?: OrbitalSchema;
7
- graphView: {
8
- version: string;
9
- };
10
- }
11
- export interface Notification {
12
- id: string;
13
- type: 'info' | 'warning' | 'error' | 'success';
14
- title: string;
15
- message: string;
16
- timestamp: number;
17
- read?: boolean;
18
- actionLabel?: string;
19
- onAction?: () => void;
20
- autoDismiss?: boolean;
21
- dismissAfter?: number;
22
- }
23
- export interface NotificationsState {
24
- notifications: Notification[];
25
- isPanelOpen: boolean;
26
- closePanel: () => void;
27
- dismissNotification: (id: string) => void;
28
- markAsRead: (id: string) => void;
29
- clearAll: () => void;
30
- }
31
- export interface ErrorToast {
32
- message: string;
33
- }
34
- export interface UsePreviewResult {
35
- previewUrl: string | null;
36
- isLoading: boolean;
37
- error: string | null;
38
- loadError: string | null;
39
- app: PreviewApp | null;
40
- isFullscreen: boolean;
41
- isExecutingEvent: boolean;
42
- errorToast: ErrorToast | null;
43
- currentStateName: string | null;
44
- notifications: NotificationsState;
45
- startPreview: () => Promise<void>;
46
- stopPreview: () => Promise<void>;
47
- refresh: () => Promise<void>;
48
- handleRefresh: () => Promise<void>;
49
- handleReset: () => Promise<void>;
50
- toggleFullscreen: () => void;
51
- setErrorToast: (toast: ErrorToast | null) => void;
52
- dismissErrorToast: () => void;
53
- }
54
- export interface UsePreviewOptions {
55
- appId?: string;
56
- }
57
- export declare function usePreview(options?: UsePreviewOptions): UsePreviewResult;