@almadar/ui 1.0.30 → 1.0.32
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.
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/{ThemeContext-lI5bo85E.d.ts → ThemeContext-D9xUORq5.d.ts} +2 -0
- package/dist/chunk-45CTDYBT.js +174 -0
- package/dist/{chunk-4UFNDD6B.js → chunk-BTXQJGFB.js} +41 -8
- package/dist/chunk-N6DJVKZ6.js +747 -0
- package/dist/chunk-PE2H3NAW.js +383 -0
- package/dist/{chunk-7IYF4RUG.js → chunk-RFD6G3ZR.js} +23 -68
- package/dist/chunk-UCXZS2YJ.js +9501 -0
- package/dist/chunk-YXZM3WCF.js +222 -0
- package/dist/cn-BoBXsxuX.d.ts +194 -0
- package/dist/components/index.css +1154 -0
- package/dist/components/index.d.ts +1082 -673
- package/dist/components/index.js +8935 -16486
- package/dist/components/organisms/game/three/index.css +315 -0
- package/dist/components/organisms/game/three/index.d.ts +1162 -0
- package/dist/components/organisms/game/three/index.js +2378 -0
- package/dist/context/index.d.ts +4 -4
- package/dist/context/index.js +2 -3
- package/dist/{event-bus-types-8-cjyMxw.d.ts → event-bus-types-CjJduURa.d.ts} +8 -0
- package/dist/hooks/index.d.ts +120 -106
- package/dist/hooks/index.js +4 -3
- package/dist/isometric-ynNHVPZx.d.ts +111 -0
- package/dist/lib/index.d.ts +117 -153
- package/dist/lib/index.js +4 -683
- package/dist/providers/index.css +1154 -0
- package/dist/providers/index.d.ts +84 -4
- package/dist/providers/index.js +165 -8
- package/dist/{useUISlots-mnggE9X9.d.ts → useUISlots-D0mttBSP.d.ts} +0 -20
- package/package.json +32 -11
- package/dist/chunk-HY5EFCOK.js +0 -419
- package/dist/chunk-W5YTXLXL.js +0 -29
- package/dist/cn-mqkxz8Sd.d.ts +0 -9
package/dist/context/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { U as UISlotManager, a as UISlot, S as SlotContent } from '../useUISlots-
|
|
4
|
-
export { R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback } from '../useUISlots-
|
|
5
|
-
import { T as ThemeProviderProps } from '../ThemeContext-
|
|
6
|
-
export { B as BUILT_IN_THEMES, C as ColorMode, D as DesignTheme, R as ResolvedMode, a as ThemeContext, b as ThemeDefinition, c as ThemeProvider, u as useTheme } from '../ThemeContext-
|
|
3
|
+
import { U as UISlotManager, a as UISlot, S as SlotContent } from '../useUISlots-D0mttBSP.js';
|
|
4
|
+
export { R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback } from '../useUISlots-D0mttBSP.js';
|
|
5
|
+
import { T as ThemeProviderProps } from '../ThemeContext-D9xUORq5.js';
|
|
6
|
+
export { B as BUILT_IN_THEMES, C as ColorMode, D as DesignTheme, R as ResolvedMode, a as ThemeContext, b as ThemeDefinition, c as ThemeProvider, u as useTheme } from '../ThemeContext-D9xUORq5.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* UISlotContext
|
package/dist/context/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ThemeProvider, useTheme } from '../chunk-BTXQJGFB.js';
|
|
2
|
+
export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-BTXQJGFB.js';
|
|
2
3
|
import '../chunk-7NEWMNNU.js';
|
|
3
|
-
import { ThemeProvider, useTheme } from '../chunk-4UFNDD6B.js';
|
|
4
|
-
export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, useTheme } from '../chunk-4UFNDD6B.js';
|
|
5
4
|
import '../chunk-PKBMQBKP.js';
|
|
6
5
|
import { createContext, useCallback, useMemo, useContext } from 'react';
|
|
7
6
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -60,6 +60,14 @@ interface EventBusContextType {
|
|
|
60
60
|
* @returns True if there are listeners
|
|
61
61
|
*/
|
|
62
62
|
hasListeners: (type: string) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Subscribe to ALL events regardless of type.
|
|
65
|
+
* Useful for verification, debugging, and analytics.
|
|
66
|
+
*
|
|
67
|
+
* @param listener - Callback function invoked for every emitted event
|
|
68
|
+
* @returns Unsubscribe function
|
|
69
|
+
*/
|
|
70
|
+
onAny?: (listener: EventListener) => Unsubscribe;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
export type { EventBusContextType as E, KFlowEvent as K, Unsubscribe as U, EventListener as a };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import { OrbitalSchema } from '@almadar/core';
|
|
2
|
-
import { E as EventBusContextType, a as EventListener } from '../event-bus-types-
|
|
3
|
-
export { K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-
|
|
4
|
-
export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, S as SlotContent, a as UISlot, U as UISlotManager, u as useUISlotManager } from '../useUISlots-
|
|
2
|
+
import { E as EventBusContextType, a as EventListener } from '../event-bus-types-CjJduURa.js';
|
|
3
|
+
export { K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-CjJduURa.js';
|
|
4
|
+
export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, S as SlotContent, a as UISlot, U as UISlotManager, u as useUISlotManager } from '../useUISlots-D0mttBSP.js';
|
|
5
|
+
import * as React from 'react';
|
|
5
6
|
import React__default, { ReactNode } from 'react';
|
|
6
7
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
7
8
|
import { Entity, getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/index.js';
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* useEventBus Hook
|
|
11
|
-
*
|
|
12
|
-
* Provides event bus utilities for component communication.
|
|
13
|
-
* This connects to the EventBusProvider for real applications
|
|
14
|
-
* or provides a simple in-memory bus for design system / Storybook.
|
|
15
|
-
*
|
|
16
|
-
* @packageDocumentation
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
10
|
declare global {
|
|
20
11
|
interface Window {
|
|
21
12
|
__kflowEventBus?: EventBusContextType | null;
|
|
@@ -77,13 +68,6 @@ declare function useEventListener(event: string, handler: EventListener): void;
|
|
|
77
68
|
*/
|
|
78
69
|
declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
|
|
79
70
|
|
|
80
|
-
/**
|
|
81
|
-
* useOrbitalHistory Hook
|
|
82
|
-
*
|
|
83
|
-
* Provides version control timeline for OrbitalSchema changes.
|
|
84
|
-
* Tracks changesets and snapshots, supports reverting to previous versions.
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
71
|
interface ChangeSummary {
|
|
88
72
|
added: number;
|
|
89
73
|
modified: number;
|
|
@@ -123,12 +107,6 @@ interface UseOrbitalHistoryResult {
|
|
|
123
107
|
}
|
|
124
108
|
declare function useOrbitalHistory(options: UseOrbitalHistoryOptions): UseOrbitalHistoryResult;
|
|
125
109
|
|
|
126
|
-
/**
|
|
127
|
-
* useFileSystem Hook
|
|
128
|
-
*
|
|
129
|
-
* Provides file system operations for WebContainer-based file management.
|
|
130
|
-
* Handles booting, mounting files, reading/writing, and tree operations.
|
|
131
|
-
*/
|
|
132
110
|
interface FileNode {
|
|
133
111
|
path: string;
|
|
134
112
|
name: string;
|
|
@@ -170,11 +148,6 @@ interface UseFileSystemResult {
|
|
|
170
148
|
}
|
|
171
149
|
declare function useFileSystem(): UseFileSystemResult;
|
|
172
150
|
|
|
173
|
-
/**
|
|
174
|
-
* useExtensions Hook
|
|
175
|
-
*
|
|
176
|
-
* Manages loading and accessing language/editor extensions.
|
|
177
|
-
*/
|
|
178
151
|
interface Extension {
|
|
179
152
|
id: string;
|
|
180
153
|
name: string;
|
|
@@ -208,12 +181,6 @@ interface UseExtensionsResult {
|
|
|
208
181
|
}
|
|
209
182
|
declare function useExtensions(options: UseExtensionsOptions): UseExtensionsResult;
|
|
210
183
|
|
|
211
|
-
/**
|
|
212
|
-
* useFileEditor Hook
|
|
213
|
-
*
|
|
214
|
-
* Manages file editing state and operations.
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
184
|
interface OpenFile {
|
|
218
185
|
path: string;
|
|
219
186
|
content: string;
|
|
@@ -244,11 +211,6 @@ interface UseFileEditorResult {
|
|
|
244
211
|
}
|
|
245
212
|
declare function useFileEditor(options: UseFileEditorOptions): UseFileEditorResult;
|
|
246
213
|
|
|
247
|
-
/**
|
|
248
|
-
* useCompile Hook
|
|
249
|
-
*
|
|
250
|
-
* Handles schema compilation to generate application files.
|
|
251
|
-
*/
|
|
252
214
|
interface SchemaLike {
|
|
253
215
|
name: string;
|
|
254
216
|
version?: string;
|
|
@@ -272,13 +234,6 @@ interface UseCompileResult {
|
|
|
272
234
|
}
|
|
273
235
|
declare function useCompile(): UseCompileResult;
|
|
274
236
|
|
|
275
|
-
/**
|
|
276
|
-
* usePreview Hook
|
|
277
|
-
*
|
|
278
|
-
* Stub implementation for app preview state management.
|
|
279
|
-
* Actual API calls should be implemented by the consuming client.
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
237
|
interface PreviewApp {
|
|
283
238
|
id: string;
|
|
284
239
|
name: string;
|
|
@@ -336,12 +291,6 @@ interface UsePreviewOptions {
|
|
|
336
291
|
}
|
|
337
292
|
declare function usePreview(options?: UsePreviewOptions): UsePreviewResult;
|
|
338
293
|
|
|
339
|
-
/**
|
|
340
|
-
* useDeepAgentGeneration Hook
|
|
341
|
-
*
|
|
342
|
-
* Stub implementation for deep agent generation functionality.
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
294
|
interface DeepAgentActionRequest {
|
|
346
295
|
id: string;
|
|
347
296
|
type: string;
|
|
@@ -388,12 +337,6 @@ interface UseDeepAgentGenerationResult {
|
|
|
388
337
|
}
|
|
389
338
|
declare function useDeepAgentGeneration(): UseDeepAgentGenerationResult;
|
|
390
339
|
|
|
391
|
-
/**
|
|
392
|
-
* useAgentChat Hook
|
|
393
|
-
*
|
|
394
|
-
* Stub implementation for agent chat functionality.
|
|
395
|
-
*/
|
|
396
|
-
|
|
397
340
|
interface ChatMessage {
|
|
398
341
|
id: string;
|
|
399
342
|
role: 'user' | 'assistant' | 'system';
|
|
@@ -498,11 +441,6 @@ interface UseAgentChatResult {
|
|
|
498
441
|
}
|
|
499
442
|
declare function useAgentChat(options?: UseAgentChatOptions): UseAgentChatResult;
|
|
500
443
|
|
|
501
|
-
/**
|
|
502
|
-
* useValidation Hook
|
|
503
|
-
*
|
|
504
|
-
* Stub implementation for schema validation.
|
|
505
|
-
*/
|
|
506
444
|
interface LLMErrorContext {
|
|
507
445
|
rawValuePreview?: string;
|
|
508
446
|
expectedType?: string;
|
|
@@ -550,16 +488,6 @@ interface UseValidationResult {
|
|
|
550
488
|
}
|
|
551
489
|
declare function useValidation(): UseValidationResult;
|
|
552
490
|
|
|
553
|
-
/**
|
|
554
|
-
* useUIEvents - UI Event to State Machine Bridge
|
|
555
|
-
*
|
|
556
|
-
* Listens for UI events from the event bus and dispatches
|
|
557
|
-
* corresponding state machine events.
|
|
558
|
-
*
|
|
559
|
-
* Components emit events like `UI:VIEW`, `UI:SAVE`, `UI:CANCEL`
|
|
560
|
-
* This hook translates them to state machine dispatch calls.
|
|
561
|
-
*/
|
|
562
|
-
|
|
563
491
|
/**
|
|
564
492
|
* Hook to bridge UI events to state machine dispatch
|
|
565
493
|
*
|
|
@@ -595,17 +523,6 @@ declare function useUIEvents<E extends string>(dispatch: (event: E, payload?: un
|
|
|
595
523
|
*/
|
|
596
524
|
declare function useSelectedEntity<T>(eventBusInstance?: ReturnType<typeof useEventBus>): [T | null, (entity: T | null) => void];
|
|
597
525
|
|
|
598
|
-
/**
|
|
599
|
-
* useEntityData Hook
|
|
600
|
-
*
|
|
601
|
-
* Provides data fetching utilities for entity lists and details.
|
|
602
|
-
* Uses a pluggable EntityDataContext when available (e.g., builder runtime
|
|
603
|
-
* bridges FetchedDataContext). Falls back to stubs when no provider is
|
|
604
|
-
* present (Storybook, standalone design system).
|
|
605
|
-
*
|
|
606
|
-
* @packageDocumentation
|
|
607
|
-
*/
|
|
608
|
-
|
|
609
526
|
interface EntityDataAdapter {
|
|
610
527
|
/** Get all records for an entity */
|
|
611
528
|
getData: (entity: string) => Record<string, unknown>[];
|
|
@@ -685,16 +602,57 @@ declare function useEntity$1<T = Record<string, unknown>>(entity: string | undef
|
|
|
685
602
|
* Uses EntityDataContext if available, otherwise falls back to stub.
|
|
686
603
|
*/
|
|
687
604
|
declare function useEntityDetail<T = Record<string, unknown>>(entity: string | undefined, id: string | undefined): UseEntityDetailResult<T>;
|
|
688
|
-
|
|
689
605
|
/**
|
|
690
|
-
*
|
|
606
|
+
* Suspense-compatible hook for fetching entity list data.
|
|
691
607
|
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
* In a real application, this would connect to the orbital query singleton.
|
|
608
|
+
* Instead of returning `isLoading`/`error`, this hook **suspends** (throws a Promise)
|
|
609
|
+
* when data is not ready. Use inside a `<Suspense>` boundary.
|
|
695
610
|
*
|
|
696
|
-
*
|
|
611
|
+
* Falls back to the adapter when available; otherwise suspends briefly for stub data.
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```tsx
|
|
615
|
+
* <Suspense fallback={<Skeleton variant="table" />}>
|
|
616
|
+
* <ErrorBoundary>
|
|
617
|
+
* <TaskList entity="Task" />
|
|
618
|
+
* </ErrorBoundary>
|
|
619
|
+
* </Suspense>
|
|
620
|
+
*
|
|
621
|
+
* function TaskList({ entity }: { entity: string }) {
|
|
622
|
+
* const { data } = useEntityListSuspense<Task>(entity);
|
|
623
|
+
* // No loading check needed — Suspense handles it
|
|
624
|
+
* return <DataTable data={data} ... />;
|
|
625
|
+
* }
|
|
626
|
+
* ```
|
|
697
627
|
*/
|
|
628
|
+
declare function useEntityListSuspense<T = Record<string, unknown>>(entity: string): {
|
|
629
|
+
data: T[];
|
|
630
|
+
refetch: () => void;
|
|
631
|
+
};
|
|
632
|
+
/**
|
|
633
|
+
* Suspense-compatible hook for fetching a single entity by ID.
|
|
634
|
+
*
|
|
635
|
+
* Suspends when data is not ready. Use inside a `<Suspense>` boundary.
|
|
636
|
+
*
|
|
637
|
+
* @example
|
|
638
|
+
* ```tsx
|
|
639
|
+
* <Suspense fallback={<Skeleton variant="form" />}>
|
|
640
|
+
* <ErrorBoundary>
|
|
641
|
+
* <TaskDetail entity="Task" id={taskId} />
|
|
642
|
+
* </ErrorBoundary>
|
|
643
|
+
* </Suspense>
|
|
644
|
+
*
|
|
645
|
+
* function TaskDetail({ entity, id }: { entity: string; id: string }) {
|
|
646
|
+
* const { data } = useEntitySuspense<Task>(entity, id);
|
|
647
|
+
* return <DetailPanel data={data} ... />;
|
|
648
|
+
* }
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
declare function useEntitySuspense<T = Record<string, unknown>>(entity: string, id: string): {
|
|
652
|
+
data: T | null;
|
|
653
|
+
refetch: () => void;
|
|
654
|
+
};
|
|
655
|
+
|
|
698
656
|
/**
|
|
699
657
|
* Query state for filters and search
|
|
700
658
|
*/
|
|
@@ -928,13 +886,6 @@ declare function useEntityMutations(entityName: string, options?: UseEntityMutat
|
|
|
928
886
|
deleteError: Error | null;
|
|
929
887
|
};
|
|
930
888
|
|
|
931
|
-
/**
|
|
932
|
-
* useEntities Hook
|
|
933
|
-
*
|
|
934
|
-
* React hook to access the entity store.
|
|
935
|
-
* Uses useSyncExternalStore for efficient updates.
|
|
936
|
-
*/
|
|
937
|
-
|
|
938
889
|
/**
|
|
939
890
|
* Hook to access all entities
|
|
940
891
|
*/
|
|
@@ -984,6 +935,74 @@ declare function useInput(): {
|
|
|
984
935
|
updateInput: (updates: Partial<Entity>) => void;
|
|
985
936
|
};
|
|
986
937
|
|
|
938
|
+
type TranslateFunction = (key: string, params?: Record<string, string | number>) => string;
|
|
939
|
+
interface I18nContextValue {
|
|
940
|
+
/** Current locale code (e.g. 'en', 'ar', 'sl') */
|
|
941
|
+
locale: string;
|
|
942
|
+
/** Text direction for the current locale */
|
|
943
|
+
direction: 'ltr' | 'rtl';
|
|
944
|
+
/** Translate a key, with optional interpolation params */
|
|
945
|
+
t: TranslateFunction;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Provider component — wrap your app or Storybook decorator with this.
|
|
949
|
+
*
|
|
950
|
+
* ```tsx
|
|
951
|
+
* <I18nProvider value={{ locale: 'ar', direction: 'rtl', t: createTranslate(arMessages) }}>
|
|
952
|
+
* <App />
|
|
953
|
+
* </I18nProvider>
|
|
954
|
+
* ```
|
|
955
|
+
*/
|
|
956
|
+
declare const I18nProvider: React.Provider<I18nContextValue>;
|
|
957
|
+
/**
|
|
958
|
+
* Hook to access the current locale and translate function.
|
|
959
|
+
* Safe to call without a provider — returns passthrough t().
|
|
960
|
+
*/
|
|
961
|
+
declare function useTranslate(): I18nContextValue;
|
|
962
|
+
/**
|
|
963
|
+
* Create a translate function from a flat messages object.
|
|
964
|
+
*
|
|
965
|
+
* ```ts
|
|
966
|
+
* const t = createTranslate({ 'common.save': 'Save', 'table.showing': 'Showing {{count}} of {{total}}' });
|
|
967
|
+
* t('common.save') // → 'Save'
|
|
968
|
+
* t('table.showing', { count: 5, total: 20 }) // → 'Showing 5 of 20'
|
|
969
|
+
* t('missing.key') // → 'missing.key' (fallback)
|
|
970
|
+
* ```
|
|
971
|
+
*/
|
|
972
|
+
declare function createTranslate(messages: Record<string, string>): TranslateFunction;
|
|
973
|
+
|
|
974
|
+
interface ResolvedEntity<T> {
|
|
975
|
+
/** Resolved data array */
|
|
976
|
+
data: T[];
|
|
977
|
+
/** True when data was provided directly via props (not fetched) */
|
|
978
|
+
isLocal: boolean;
|
|
979
|
+
/** Loading state — always false for local data */
|
|
980
|
+
isLoading: boolean;
|
|
981
|
+
/** Error state — always null for local data */
|
|
982
|
+
error: Error | null;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Resolves entity data from either a direct `data` prop or an `entity` string.
|
|
986
|
+
*
|
|
987
|
+
* When `data` is provided, it is used directly (isLocal: true).
|
|
988
|
+
* When only `entity` (string) is provided, data is fetched via useEntityList.
|
|
989
|
+
* Direct `data` always takes precedence over auto-fetch.
|
|
990
|
+
*
|
|
991
|
+
* @param entity - Entity name string for auto-fetch, or undefined
|
|
992
|
+
* @param data - Direct data array from trait render-ui, or undefined
|
|
993
|
+
* @returns Normalized { data, isLocal, isLoading, error }
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```tsx
|
|
997
|
+
* function MyOrganism({ entity, data, isLoading, error }: MyProps) {
|
|
998
|
+
* const resolved = useResolvedEntity<Item>(entity, data);
|
|
999
|
+
* // resolved.data is always T[] regardless of source
|
|
1000
|
+
* // resolved.isLocal tells you if data came from props
|
|
1001
|
+
* }
|
|
1002
|
+
* ```
|
|
1003
|
+
*/
|
|
1004
|
+
declare function useResolvedEntity<T = Record<string, unknown>>(entity: string | undefined, data: readonly T[] | T[] | undefined): ResolvedEntity<T>;
|
|
1005
|
+
|
|
987
1006
|
/**
|
|
988
1007
|
* Auth Context Hook Stub
|
|
989
1008
|
*
|
|
@@ -1010,11 +1029,6 @@ interface AuthContextValue {
|
|
|
1010
1029
|
*/
|
|
1011
1030
|
declare function useAuthContext(): AuthContextValue;
|
|
1012
1031
|
|
|
1013
|
-
/**
|
|
1014
|
-
* GitHub Integration Hooks
|
|
1015
|
-
*
|
|
1016
|
-
* React hooks for GitHub OAuth and repository management.
|
|
1017
|
-
*/
|
|
1018
1032
|
/**
|
|
1019
1033
|
* GitHub connection status
|
|
1020
1034
|
*/
|
|
@@ -1074,4 +1088,4 @@ declare function useGitHubBranches(owner: string, repo: string, enabled?: boolea
|
|
|
1074
1088
|
branches: string[];
|
|
1075
1089
|
}, Error>;
|
|
1076
1090
|
|
|
1077
|
-
export { type AuthContextValue, type AuthUser, type ChangeSummary, type CompileResult, type CompileStage, ENTITY_EVENTS, Entity, type EntityDataAdapter, EntityDataProvider, type EntityDataRecord, type EntityMutationResult, EventBusContextType, EventListener, type Extension, type ExtensionManifest, type FileSystemFile, type FileSystemStatus, type GitHubRepo, type GitHubStatus, type HistoryTimelineItem, type OpenFile, type OrbitalEventPayload, type OrbitalEventResponse, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, type QueryState, type RevertResult, type SelectedFile, type UseCompileResult, type UseEntityDetailResult, type UseEntityListOptions, type UseEntityListResult, type UseEntityMutationsOptions, type UseExtensionsOptions, type UseExtensionsResult, type UseFileEditorOptions, type UseFileEditorResult, type UseFileSystemResult, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, clearEntities, entityDataKeys, getAllEntities, getByType, getEntity, getSingleton, parseQueryBinding, removeEntity, spawnEntity, updateEntity, updateSingleton, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEmitEvent, useEntities, useEntitiesByType, useEntity$1 as useEntity, useEntity as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityMutations, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation };
|
|
1091
|
+
export { type AuthContextValue, type AuthUser, type ChangeSummary, type CompileResult, type CompileStage, ENTITY_EVENTS, Entity, type EntityDataAdapter, EntityDataProvider, type EntityDataRecord, type EntityMutationResult, EventBusContextType, EventListener, type Extension, type ExtensionManifest, type FileSystemFile, type FileSystemStatus, type GitHubRepo, type GitHubStatus, type HistoryTimelineItem, type I18nContextValue, I18nProvider, type OpenFile, type OrbitalEventPayload, type OrbitalEventResponse, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, type QueryState, type ResolvedEntity, type RevertResult, type SelectedFile, type TranslateFunction, type UseCompileResult, type UseEntityDetailResult, type UseEntityListOptions, type UseEntityListResult, type UseEntityMutationsOptions, type UseExtensionsOptions, type UseExtensionsResult, type UseFileEditorOptions, type UseFileEditorResult, type UseFileSystemResult, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, clearEntities, createTranslate, entityDataKeys, getAllEntities, getByType, getEntity, getSingleton, parseQueryBinding, removeEntity, spawnEntity, updateEntity, updateSingleton, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEmitEvent, useEntities, useEntitiesByType, useEntity$1 as useEntity, useEntity as useEntityById, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntityMutations, useEntitySuspense, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useTranslate, useUIEvents, useUpdateEntity, useValidation };
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { ENTITY_EVENTS,
|
|
2
|
-
export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.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, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-RFD6G3ZR.js';
|
|
3
2
|
import '../chunk-XSEDIUM6.js';
|
|
4
|
-
export { EntityDataProvider, entityDataKeys,
|
|
3
|
+
export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useQuerySingleton, useTranslate } from '../chunk-PE2H3NAW.js';
|
|
4
|
+
export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
|
|
5
5
|
export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
|
|
6
|
+
export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
|
|
6
7
|
import '../chunk-PKBMQBKP.js';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Isometric Game Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for isometric grid rendering: tiles, units, features.
|
|
5
|
+
* Used by IsometricCanvas and game hooks.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/** A single isometric tile on the grid */
|
|
10
|
+
interface IsometricTile {
|
|
11
|
+
/** Optional unique identifier (required for 3D rendering) */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Grid x coordinate */
|
|
14
|
+
x: number;
|
|
15
|
+
/** Grid y coordinate (2D) */
|
|
16
|
+
y: number;
|
|
17
|
+
/** Grid z coordinate (3D alternative to y) */
|
|
18
|
+
z?: number;
|
|
19
|
+
/** Terrain type key (e.g., 'grass', 'stone', 'water') - 2D */
|
|
20
|
+
terrain?: string;
|
|
21
|
+
/** Tile type for visual rendering (3D) */
|
|
22
|
+
type?: string;
|
|
23
|
+
/** Direct sprite URL override (bypasses getTerrainSprite resolver) */
|
|
24
|
+
terrainSprite?: string;
|
|
25
|
+
/** Whether units can traverse this tile (default true) */
|
|
26
|
+
passable?: boolean;
|
|
27
|
+
/** Movement cost for pathfinding (default 1) */
|
|
28
|
+
movementCost?: number;
|
|
29
|
+
/** Optional tile type for visual variants */
|
|
30
|
+
tileType?: string;
|
|
31
|
+
/** Elevation offset for 3D rendering */
|
|
32
|
+
elevation?: number;
|
|
33
|
+
}
|
|
34
|
+
/** A unit positioned on the isometric grid */
|
|
35
|
+
interface IsometricUnit {
|
|
36
|
+
/** Unique unit identifier */
|
|
37
|
+
id: string;
|
|
38
|
+
/** Current grid position (2D format) */
|
|
39
|
+
position?: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
/** Grid x coordinate (3D format) */
|
|
44
|
+
x?: number;
|
|
45
|
+
/** Grid y coordinate (3D format) */
|
|
46
|
+
y?: number;
|
|
47
|
+
/** Grid z coordinate (3D format) */
|
|
48
|
+
z?: number;
|
|
49
|
+
/** Static sprite URL (used when no sprite sheet animation) */
|
|
50
|
+
sprite?: string;
|
|
51
|
+
/** Unit archetype key for sprite resolution */
|
|
52
|
+
unitType?: string;
|
|
53
|
+
/** Hero identifier for sprite sheet lookup */
|
|
54
|
+
heroId?: string;
|
|
55
|
+
/** Display name rendered below the unit */
|
|
56
|
+
name?: string;
|
|
57
|
+
/** Team affiliation for coloring */
|
|
58
|
+
team?: 'player' | 'enemy' | 'neutral';
|
|
59
|
+
/** Faction for 3D rendering (player/enemy/neutral) */
|
|
60
|
+
faction?: 'player' | 'enemy' | 'neutral';
|
|
61
|
+
/** Current health */
|
|
62
|
+
health?: number;
|
|
63
|
+
/** Maximum health */
|
|
64
|
+
maxHealth?: number;
|
|
65
|
+
/** Trait attachments for state display */
|
|
66
|
+
traits?: {
|
|
67
|
+
name: string;
|
|
68
|
+
currentState: string;
|
|
69
|
+
states: string[];
|
|
70
|
+
cooldown: number;
|
|
71
|
+
}[];
|
|
72
|
+
/** Previous position for movement trail ghost */
|
|
73
|
+
previousPosition?: {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
};
|
|
77
|
+
/** Elevation offset for 3D rendering */
|
|
78
|
+
elevation?: number;
|
|
79
|
+
}
|
|
80
|
+
/** A map feature (resource, building, portal, etc.) */
|
|
81
|
+
interface IsometricFeature {
|
|
82
|
+
/** Optional unique identifier (required for 3D rendering) */
|
|
83
|
+
id?: string;
|
|
84
|
+
/** Grid x coordinate */
|
|
85
|
+
x: number;
|
|
86
|
+
/** Grid y coordinate (2D) */
|
|
87
|
+
y: number;
|
|
88
|
+
/** Grid z coordinate (3D alternative to y) */
|
|
89
|
+
z?: number;
|
|
90
|
+
/** Feature type key (e.g., 'goldMine', 'castle', 'portal') */
|
|
91
|
+
type: string;
|
|
92
|
+
/** Direct sprite URL override (bypasses getFeatureSprite resolver) */
|
|
93
|
+
sprite?: string;
|
|
94
|
+
/** 3D model URL (GLB format) for GameCanvas3D */
|
|
95
|
+
assetUrl?: string;
|
|
96
|
+
/** Color override for 3D rendering */
|
|
97
|
+
color?: string;
|
|
98
|
+
/** Elevation offset for 3D rendering */
|
|
99
|
+
elevation?: number;
|
|
100
|
+
}
|
|
101
|
+
/** Camera state for pan/zoom */
|
|
102
|
+
interface CameraState {
|
|
103
|
+
/** Camera X offset in pixels */
|
|
104
|
+
x: number;
|
|
105
|
+
/** Camera Y offset in pixels */
|
|
106
|
+
y: number;
|
|
107
|
+
/** Zoom level (1.0 = 100%) */
|
|
108
|
+
zoom: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type { CameraState as C, IsometricTile as I, IsometricUnit as a, IsometricFeature as b };
|