@almadar/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +72 -0
- package/README.md +335 -0
- package/dist/ThemeContext-lI5bo85E.d.ts +103 -0
- package/dist/components/index.d.ts +4789 -0
- package/dist/components/index.js +21566 -0
- package/dist/components/index.js.map +1 -0
- package/dist/context/index.d.ts +208 -0
- package/dist/context/index.js +443 -0
- package/dist/context/index.js.map +1 -0
- package/dist/event-bus-types-8-cjyMxw.d.ts +65 -0
- package/dist/hooks/index.d.ts +1006 -0
- package/dist/hooks/index.js +2262 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/lib/index.d.ts +291 -0
- package/dist/lib/index.js +431 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/offline-executor-CHr4uAhf.d.ts +401 -0
- package/dist/providers/index.d.ts +386 -0
- package/dist/providers/index.js +1111 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/renderer/index.d.ts +382 -0
- package/dist/renderer/index.js +808 -0
- package/dist/renderer/index.js.map +1 -0
- package/dist/stores/index.d.ts +151 -0
- package/dist/stores/index.js +196 -0
- package/dist/stores/index.js.map +1 -0
- package/dist/useUISlots-mnggE9X9.d.ts +105 -0
- package/package.json +121 -0
- package/themes/almadar.css +196 -0
- package/themes/index.css +11 -0
- package/themes/minimalist.css +193 -0
- package/themes/wireframe.css +188 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../lib/cn.ts","../../lib/api-client.ts","../../lib/debug.ts","../../lib/debugUtils.ts","../../lib/entityDebug.ts","../../lib/debugRegistry.ts","../../lib/guardRegistry.ts","../../lib/tickRegistry.ts","../../lib/traitRegistry.ts"],"names":["isDebugEnabled","listeners","notifyListeners"],"mappings":";;;;AAOO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;;;ACAA,IAAM,Y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,CAAI,OAAO,CAAA;AAChC,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,MAAM,QAAQ,KAAA,CAAM,MAAA,CAAO,KAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,SAAS,CAAA;AACzD,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,KAAA,CAAM,UAAA,GAAa,MAAA;AACnB,MAAAA,gBAAAA,EAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEO,SAAS,gBAAgB,EAAA,EAAkB;AAChD,EAAA,MAAA,CAAO,OAAO,EAAE,CAAA;AAChB,EAAAA,gBAAAA,EAAgB;AAClB;AAEO,SAAS,YAAA,GAAiC;AAC/C,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,CAAA;AACnC;AAEO,SAAS,SAAS,EAAA,EAAwC;AAC/D,EAAA,OAAO,MAAA,CAAO,IAAI,EAAE,CAAA;AACtB;AAEO,SAAS,wBAAwB,QAAA,EAAsC;AAC5E,EAAAD,UAAAA,CAAU,IAAI,QAAQ,CAAA;AACtB,EAAA,OAAO,MAAMA,UAAAA,CAAU,MAAA,CAAO,QAAQ,CAAA;AACxC;AAEO,SAAS,WAAA,GAAoB;AAClC,EAAA,MAAA,CAAO,KAAA,EAAM;AACb,EAAAC,gBAAAA,EAAgB;AAClB","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Utility function to merge Tailwind CSS classes\n * Combines clsx for conditional classes with tailwind-merge to handle conflicts\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","/**\n * API Client - HTTP client for backend API calls\n *\n * Provides typed methods for making API requests.\n * All requests go through the backend server, NOT directly to Firestore.\n *\n * @packageDocumentation\n */\n\nconst API_BASE_URL = typeof import.meta !== 'undefined' && import.meta.env?.VITE_API_URL\n ? import.meta.env.VITE_API_URL\n : '/api';\n\n/**\n * API Error class for handling HTTP errors\n */\nexport class ApiError extends Error {\n constructor(\n public status: number,\n public statusText: string,\n message?: string\n ) {\n super(message || `API Error: ${status} ${statusText}`);\n this.name = 'ApiError';\n }\n}\n\n/**\n * Handle response and parse JSON\n */\nasync function handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n let message: string | undefined;\n try {\n const errorData = await response.json();\n message = errorData.message || errorData.error;\n } catch {\n // Ignore JSON parse errors\n }\n throw new ApiError(response.status, response.statusText, message);\n }\n\n // Handle empty responses (e.g., 204 No Content)\n const text = await response.text();\n if (!text) {\n return undefined as T;\n }\n\n return JSON.parse(text) as T;\n}\n\n/**\n * Get default headers for requests\n */\nfunction getHeaders(): HeadersInit {\n const headers: HeadersInit = {\n 'Content-Type': 'application/json',\n };\n\n // Add auth token if available (from localStorage or session)\n const token = typeof localStorage !== 'undefined'\n ? localStorage.getItem('authToken')\n : null;\n if (token) {\n headers['Authorization'] = `Bearer ${token}`;\n }\n\n return headers;\n}\n\n/**\n * API client with typed methods\n */\nexport const apiClient = {\n /**\n * GET request\n */\n async get<T>(endpoint: string): Promise<T> {\n const response = await fetch(`${API_BASE_URL}${endpoint}`, {\n method: 'GET',\n headers: getHeaders(),\n });\n return handleResponse<T>(response);\n },\n\n /**\n * POST request\n */\n async post<T>(endpoint: string, data?: unknown): Promise<T> {\n const response = await fetch(`${API_BASE_URL}${endpoint}`, {\n method: 'POST',\n headers: getHeaders(),\n body: data ? JSON.stringify(data) : undefined,\n });\n return handleResponse<T>(response);\n },\n\n /**\n * PUT request\n */\n async put<T>(endpoint: string, data?: unknown): Promise<T> {\n const response = await fetch(`${API_BASE_URL}${endpoint}`, {\n method: 'PUT',\n headers: getHeaders(),\n body: data ? JSON.stringify(data) : undefined,\n });\n return handleResponse<T>(response);\n },\n\n /**\n * PATCH request\n */\n async patch<T>(endpoint: string, data?: unknown): Promise<T> {\n const response = await fetch(`${API_BASE_URL}${endpoint}`, {\n method: 'PATCH',\n headers: getHeaders(),\n body: data ? JSON.stringify(data) : undefined,\n });\n return handleResponse<T>(response);\n },\n\n /**\n * DELETE request\n */\n async delete<T = void>(endpoint: string): Promise<T> {\n const response = await fetch(`${API_BASE_URL}${endpoint}`, {\n method: 'DELETE',\n headers: getHeaders(),\n });\n return handleResponse<T>(response);\n },\n};\n\nexport default apiClient;\n","/**\n * Debug utilities for development\n */\n\nconst DEBUG_ENABLED = typeof window !== 'undefined' &&\n (localStorage.getItem('debug') === 'true' || process.env.NODE_ENV === 'development');\n\nexport function isDebugEnabled(): boolean {\n return DEBUG_ENABLED;\n}\n\nexport function debug(...args: unknown[]): void {\n if (DEBUG_ENABLED) {\n console.log('[DEBUG]', ...args);\n }\n}\n\nexport function debugGroup(label: string): void {\n if (DEBUG_ENABLED) {\n console.group(`[DEBUG] ${label}`);\n }\n}\n\nexport function debugGroupEnd(): void {\n if (DEBUG_ENABLED) {\n console.groupEnd();\n }\n}\n\nexport function debugWarn(...args: unknown[]): void {\n if (DEBUG_ENABLED) {\n console.warn('[DEBUG]', ...args);\n }\n}\n\nexport function debugError(...args: unknown[]): void {\n if (DEBUG_ENABLED) {\n console.error('[DEBUG]', ...args);\n }\n}\n\nexport function debugTable(data: unknown): void {\n if (DEBUG_ENABLED) {\n console.table(data);\n }\n}\n\nexport function debugTime(label: string): void {\n if (DEBUG_ENABLED) {\n console.time(`[DEBUG] ${label}`);\n }\n}\n\nexport function debugTimeEnd(label: string): void {\n if (DEBUG_ENABLED) {\n console.timeEnd(`[DEBUG] ${label}`);\n }\n}\n\n// =============================================================================\n// Game-specific debug utilities\n// =============================================================================\n\n/**\n * Debug input events (keyboard, mouse, touch)\n * @param inputType - Type of input (e.g., 'keydown', 'keyup', 'mouse')\n * @param data - Input data to log\n */\nexport function debugInput(inputType: string, data: unknown): void {\n if (DEBUG_ENABLED) {\n console.log(`[DEBUG:INPUT] ${inputType}:`, data);\n }\n}\n\n/**\n * Debug collision events between entities\n * @param entityA - First entity in collision\n * @param entityB - Second entity in collision\n * @param details - Additional collision details\n */\nexport function debugCollision(\n entityA: { id?: string; type?: string },\n entityB: { id?: string; type?: string },\n details?: unknown\n): void {\n if (DEBUG_ENABLED) {\n console.log(\n `[DEBUG:COLLISION] ${entityA.type || entityA.id} <-> ${entityB.type || entityB.id}`,\n details ?? ''\n );\n }\n}\n\n/**\n * Debug physics updates (position, velocity)\n * @param entityId - Entity identifier\n * @param physics - Physics data to log\n */\nexport function debugPhysics(entityId: string, physics: unknown): void {\n if (DEBUG_ENABLED) {\n console.log(`[DEBUG:PHYSICS] ${entityId}:`, physics);\n }\n}\n\n/**\n * Debug game state changes\n * @param stateName - Name of the state that changed\n * @param value - New state value\n */\nexport function debugGameState(stateName: string, value: unknown): void {\n if (DEBUG_ENABLED) {\n console.log(`[DEBUG:GAME_STATE] ${stateName}:`, value);\n }\n}\n","/**\n * Debug Utilities - Functions for toggling and checking debug mode\n *\n * @packageDocumentation\n */\n\nconst DEBUG_STORAGE_KEY = 'orbital-debug';\n\ntype DebugToggleListener = (enabled: boolean) => void;\n\nconst listeners = new Set<DebugToggleListener>();\n\n/**\n * Check if debug mode is enabled\n */\nexport function isDebugEnabled(): boolean {\n if (typeof window === 'undefined') return false;\n return localStorage.getItem(DEBUG_STORAGE_KEY) === 'true';\n}\n\n/**\n * Enable or disable debug mode\n */\nexport function setDebugEnabled(enabled: boolean): void {\n if (typeof window === 'undefined') return;\n localStorage.setItem(DEBUG_STORAGE_KEY, String(enabled));\n listeners.forEach(listener => listener(enabled));\n}\n\n/**\n * Toggle debug mode\n */\nexport function toggleDebug(): boolean {\n const newValue = !isDebugEnabled();\n setDebugEnabled(newValue);\n return newValue;\n}\n\n/**\n * Subscribe to debug mode changes\n */\nexport function onDebugToggle(listener: DebugToggleListener): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\n/**\n * Initialize debug mode from keyboard shortcut (Ctrl+Shift+D)\n */\nexport function initDebugShortcut(): () => void {\n if (typeof window === 'undefined') return () => {};\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.ctrlKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n toggleDebug();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n}\n","/**\n * Entity Debug - Provides entity state snapshots for debugging\n *\n * @packageDocumentation\n */\n\nexport interface EntityState {\n id: string;\n type: string;\n fields: Record<string, unknown>;\n lastUpdated: number;\n}\n\nexport interface RuntimeEntity {\n id: string;\n type: string;\n data: Record<string, unknown>;\n}\n\nexport interface PersistentEntityInfo {\n loaded: boolean;\n count: number;\n}\n\nexport interface EntitySnapshot {\n entities: EntityState[];\n timestamp: number;\n totalCount: number;\n /** Singleton entities by name */\n singletons: Record<string, unknown>;\n /** Runtime entities (in-memory) */\n runtime: RuntimeEntity[];\n /** Persistent entities info by type */\n persistent: Record<string, PersistentEntityInfo>;\n}\n\ntype EntityProvider = () => EntityState[];\n\nlet entityProvider: EntityProvider | null = null;\n\nexport function setEntityProvider(provider: EntityProvider): void {\n entityProvider = provider;\n}\n\nexport function clearEntityProvider(): void {\n entityProvider = null;\n}\n\nexport function getEntitySnapshot(): EntitySnapshot | null {\n if (!entityProvider) {\n return null;\n }\n\n const entities = entityProvider();\n return {\n entities,\n timestamp: Date.now(),\n totalCount: entities.length,\n singletons: {},\n runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),\n persistent: {},\n };\n}\n\nexport function getEntityById(id: string): EntityState | undefined {\n if (!entityProvider) {\n return undefined;\n }\n\n return entityProvider().find((e) => e.id === id);\n}\n\nexport function getEntitiesByType(type: string): EntityState[] {\n if (!entityProvider) {\n return [];\n }\n\n return entityProvider().filter((e) => e.type === type);\n}\n","/**\n * Debug Registry - Central event log for debugging\n *\n * @packageDocumentation\n */\n\nexport type DebugEventType =\n | 'state-change'\n | 'event-fired'\n | 'effect-executed'\n | 'guard-evaluated'\n | 'error'\n | 'warning'\n | 'info';\n\nexport interface DebugEvent {\n id: string;\n type: DebugEventType;\n source: string;\n message: string;\n data?: Record<string, unknown>;\n timestamp: number;\n}\n\ntype ChangeListener = () => void;\n\nconst events: DebugEvent[] = [];\nconst listeners = new Set<ChangeListener>();\nconst MAX_EVENTS = 500;\n\nfunction notifyListeners(): void {\n listeners.forEach(listener => listener());\n}\n\nexport function logDebugEvent(\n type: DebugEventType,\n source: string,\n message: string,\n data?: Record<string, unknown>\n): void {\n const event: DebugEvent = {\n id: `event-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,\n type,\n source,\n message,\n data,\n timestamp: Date.now(),\n };\n\n events.unshift(event);\n\n // Keep events bounded\n if (events.length > MAX_EVENTS) {\n events.pop();\n }\n\n notifyListeners();\n}\n\nexport function logStateChange(source: string, from: string, to: string, event?: string): void {\n logDebugEvent('state-change', source, `${from} → ${to}`, { from, to, event });\n}\n\nexport function logEventFired(source: string, eventName: string, payload?: unknown): void {\n logDebugEvent('event-fired', source, eventName, { eventName, payload });\n}\n\nexport function logEffectExecuted(source: string, effectType: string, details?: unknown): void {\n logDebugEvent('effect-executed', source, effectType, { effectType, details });\n}\n\nexport function logError(source: string, message: string, error?: unknown): void {\n logDebugEvent('error', source, message, { error });\n}\n\nexport function logWarning(source: string, message: string, data?: Record<string, unknown>): void {\n logDebugEvent('warning', source, message, data);\n}\n\nexport function logInfo(source: string, message: string, data?: Record<string, unknown>): void {\n logDebugEvent('info', source, message, data);\n}\n\nexport function getDebugEvents(): DebugEvent[] {\n return [...events];\n}\n\nexport function getRecentEvents(count: number): DebugEvent[] {\n return events.slice(0, count);\n}\n\nexport function getEventsByType(type: DebugEventType): DebugEvent[] {\n return events.filter(e => e.type === type);\n}\n\nexport function getEventsBySource(source: string): DebugEvent[] {\n return events.filter(e => e.source === source);\n}\n\nexport function subscribeToDebugEvents(listener: ChangeListener): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nexport function clearDebugEvents(): void {\n events.length = 0;\n notifyListeners();\n}\n","/**\n * Guard Registry - Tracks guard evaluations for debugging\n *\n * @packageDocumentation\n */\n\nexport interface GuardContext {\n traitName?: string;\n type?: \"transition\" | \"tick\";\n transitionFrom?: string;\n transitionTo?: string;\n tickName?: string;\n [key: string]: unknown;\n}\n\nexport interface GuardEvaluation {\n id: string;\n traitName: string;\n guardName: string;\n expression: string;\n result: boolean;\n context: GuardContext;\n timestamp: number;\n /** Input values used in guard evaluation */\n inputs: Record<string, unknown>;\n}\n\ntype ChangeListener = () => void;\n\nconst guardHistory: GuardEvaluation[] = [];\nconst listeners = new Set<ChangeListener>();\nconst MAX_HISTORY = 100;\n\nfunction notifyListeners(): void {\n listeners.forEach((listener) => listener());\n}\n\nexport function recordGuardEvaluation(\n evaluation: Omit<GuardEvaluation, \"id\" | \"timestamp\">,\n): void {\n const entry: GuardEvaluation = {\n ...evaluation,\n id: `guard-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,\n timestamp: Date.now(),\n };\n\n guardHistory.unshift(entry);\n\n // Keep history bounded\n if (guardHistory.length > MAX_HISTORY) {\n guardHistory.pop();\n }\n\n notifyListeners();\n}\n\nexport function getGuardHistory(): GuardEvaluation[] {\n return [...guardHistory];\n}\n\nexport function getRecentGuardEvaluations(count: number): GuardEvaluation[] {\n return guardHistory.slice(0, count);\n}\n\nexport function getGuardEvaluationsForTrait(\n traitName: string,\n): GuardEvaluation[] {\n return guardHistory.filter((g) => g.traitName === traitName);\n}\n\nexport function subscribeToGuardChanges(listener: ChangeListener): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nexport function clearGuardHistory(): void {\n guardHistory.length = 0;\n notifyListeners();\n}\n","/**\n * Tick Registry - Tracks scheduled tick executions for debugging\n *\n * @packageDocumentation\n */\n\nexport interface TickExecution {\n id: string;\n traitName: string;\n /** Tick name (display name) */\n name: string;\n /** Tick identifier */\n tickName: string;\n interval: number;\n /** Last execution timestamp */\n lastRun: number;\n lastExecuted: number | null;\n nextExecution: number | null;\n /** Number of times this tick has run */\n runCount: number;\n executionCount: number;\n /** Average execution time in ms */\n executionTime: number;\n /** Whether the tick is currently active */\n active: boolean;\n isActive: boolean;\n /** Guard name if this tick has a guard */\n guardName?: string;\n /** Whether the guard passed on last evaluation */\n guardPassed?: boolean;\n}\n\ntype ChangeListener = () => void;\n\nconst ticks = new Map<string, TickExecution>();\nconst listeners = new Set<ChangeListener>();\n\nfunction notifyListeners(): void {\n listeners.forEach((listener) => listener());\n}\n\nexport function registerTick(tick: TickExecution): void {\n ticks.set(tick.id, tick);\n notifyListeners();\n}\n\nexport function updateTickExecution(id: string, timestamp: number): void {\n const tick = ticks.get(id);\n if (tick) {\n tick.lastExecuted = timestamp;\n tick.nextExecution = timestamp + tick.interval;\n tick.executionCount++;\n notifyListeners();\n }\n}\n\nexport function setTickActive(id: string, isActive: boolean): void {\n const tick = ticks.get(id);\n if (tick) {\n tick.isActive = isActive;\n notifyListeners();\n }\n}\n\nexport function unregisterTick(id: string): void {\n ticks.delete(id);\n notifyListeners();\n}\n\nexport function getAllTicks(): TickExecution[] {\n return Array.from(ticks.values());\n}\n\nexport function getTick(id: string): TickExecution | undefined {\n return ticks.get(id);\n}\n\nexport function subscribeToTickChanges(listener: ChangeListener): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nexport function clearTicks(): void {\n ticks.clear();\n notifyListeners();\n}\n","/**\n * Trait Registry - Tracks active traits and their state machines for debugging\n *\n * @packageDocumentation\n */\n\nexport interface TraitTransition {\n from: string;\n to: string;\n event: string;\n guard?: string;\n}\n\nexport interface TraitGuard {\n name: string;\n lastResult?: boolean;\n}\n\nexport interface TraitDebugInfo {\n id: string;\n name: string;\n currentState: string;\n states: string[];\n transitions: TraitTransition[];\n guards: TraitGuard[];\n transitionCount: number;\n}\n\ntype ChangeListener = () => void;\n\nconst traits = new Map<string, TraitDebugInfo>();\nconst listeners = new Set<ChangeListener>();\n\nfunction notifyListeners(): void {\n listeners.forEach(listener => listener());\n}\n\nexport function registerTrait(info: TraitDebugInfo): void {\n traits.set(info.id, info);\n notifyListeners();\n}\n\nexport function updateTraitState(id: string, newState: string): void {\n const trait = traits.get(id);\n if (trait) {\n trait.currentState = newState;\n trait.transitionCount++;\n notifyListeners();\n }\n}\n\nexport function updateGuardResult(traitId: string, guardName: string, result: boolean): void {\n const trait = traits.get(traitId);\n if (trait) {\n const guard = trait.guards.find(g => g.name === guardName);\n if (guard) {\n guard.lastResult = result;\n notifyListeners();\n }\n }\n}\n\nexport function unregisterTrait(id: string): void {\n traits.delete(id);\n notifyListeners();\n}\n\nexport function getAllTraits(): TraitDebugInfo[] {\n return Array.from(traits.values());\n}\n\nexport function getTrait(id: string): TraitDebugInfo | undefined {\n return traits.get(id);\n}\n\nexport function subscribeToTraitChanges(listener: ChangeListener): () => void {\n listeners.add(listener);\n return () => listeners.delete(listener);\n}\n\nexport function clearTraits(): void {\n traits.clear();\n notifyListeners();\n}\n"]}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Renderer Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions used by both Builder and compiled shells for
|
|
5
|
+
* the dual execution model. These types define the contract between
|
|
6
|
+
* server and client for effect execution.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* A client effect is a tuple where the first element is the effect type
|
|
12
|
+
* and the remaining elements are the arguments.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ['render-ui', 'main', { type: 'entity-table', ... }]
|
|
16
|
+
* ['navigate', '/tasks/123']
|
|
17
|
+
* ['notify', 'Task created!', { type: 'success' }]
|
|
18
|
+
* ['emit', 'TASK_CREATED', { id: '123' }]
|
|
19
|
+
*/
|
|
20
|
+
type ClientEffect = ['render-ui', string, PatternConfig | null] | ['navigate', string, Record<string, unknown>?] | ['notify', string, NotifyOptions?] | ['emit', string, unknown?];
|
|
21
|
+
/**
|
|
22
|
+
* Options for notify effect
|
|
23
|
+
*/
|
|
24
|
+
interface NotifyOptions {
|
|
25
|
+
type?: 'success' | 'error' | 'info' | 'warning';
|
|
26
|
+
duration?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Configuration for a pattern to render in a slot.
|
|
30
|
+
* This is what render-ui effects carry as their payload.
|
|
31
|
+
*/
|
|
32
|
+
interface PatternConfig {
|
|
33
|
+
/** Pattern type from registry (e.g., 'entity-table', 'form-section') */
|
|
34
|
+
type: string;
|
|
35
|
+
/** Entity name for data binding */
|
|
36
|
+
entity?: string;
|
|
37
|
+
/** Additional props for the pattern component */
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolved pattern with component information from component-mapping.json
|
|
42
|
+
*/
|
|
43
|
+
interface ResolvedPattern {
|
|
44
|
+
/** Component name (e.g., 'DataTable') */
|
|
45
|
+
component: string;
|
|
46
|
+
/** Import path for the component */
|
|
47
|
+
importPath: string;
|
|
48
|
+
/** Pattern category (e.g., 'display', 'form') */
|
|
49
|
+
category: string;
|
|
50
|
+
/** Validated and normalized props */
|
|
51
|
+
validatedProps: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Response from server after processing an event.
|
|
55
|
+
* This is the unified response format for both Builder and compiled shells.
|
|
56
|
+
*/
|
|
57
|
+
interface EventResponse {
|
|
58
|
+
/** Whether the event was processed successfully */
|
|
59
|
+
success: boolean;
|
|
60
|
+
/** New state after transition (if transition occurred) */
|
|
61
|
+
newState?: string;
|
|
62
|
+
/** Data fetched by server effects (e.g., { Task: [...] }) */
|
|
63
|
+
data?: Record<string, unknown[]>;
|
|
64
|
+
/** Client effects to execute (render-ui, navigate, notify, emit) */
|
|
65
|
+
clientEffects?: ClientEffect[];
|
|
66
|
+
/** Results of individual effect executions (for debugging) */
|
|
67
|
+
effectResults?: Array<{
|
|
68
|
+
effect: string;
|
|
69
|
+
success: boolean;
|
|
70
|
+
data?: unknown;
|
|
71
|
+
error?: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** Error message if success is false */
|
|
74
|
+
error?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Configuration for the client effect executor.
|
|
78
|
+
* Provides implementations for each effect type.
|
|
79
|
+
*/
|
|
80
|
+
interface ClientEffectExecutorConfig {
|
|
81
|
+
/**
|
|
82
|
+
* Render a pattern to a slot.
|
|
83
|
+
* Called for 'render-ui' effects.
|
|
84
|
+
*/
|
|
85
|
+
renderToSlot: (slot: string, pattern: PatternConfig | null) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Navigate to a route.
|
|
88
|
+
* Called for 'navigate' effects.
|
|
89
|
+
*/
|
|
90
|
+
navigate: (path: string, params?: Record<string, unknown>) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Show a notification.
|
|
93
|
+
* Called for 'notify' effects.
|
|
94
|
+
*/
|
|
95
|
+
notify: (message: string, options?: NotifyOptions) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Emit an event to the event bus.
|
|
98
|
+
* Called for 'emit' effects.
|
|
99
|
+
*/
|
|
100
|
+
eventBus: {
|
|
101
|
+
emit: (event: string, payload?: unknown) => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Optional: Data from server response for render-ui.
|
|
105
|
+
* Components can use this to access fetched entity data.
|
|
106
|
+
*/
|
|
107
|
+
data?: Record<string, unknown[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Optional: Callback when all effects have been executed.
|
|
110
|
+
*/
|
|
111
|
+
onComplete?: () => void;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Valid UI slot names
|
|
115
|
+
*/
|
|
116
|
+
type UISlot = 'main' | 'sidebar' | 'modal' | 'drawer' | 'overlay' | 'center' | 'toast' | 'hud-top' | 'hud-bottom' | 'floating';
|
|
117
|
+
/**
|
|
118
|
+
* Slot type classification
|
|
119
|
+
*/
|
|
120
|
+
type SlotType = 'inline' | 'portal';
|
|
121
|
+
/**
|
|
122
|
+
* Definition of a slot including its rendering behavior
|
|
123
|
+
*/
|
|
124
|
+
interface SlotDefinition {
|
|
125
|
+
/** Slot name */
|
|
126
|
+
name: UISlot;
|
|
127
|
+
/** Whether to render inline or via portal */
|
|
128
|
+
type: SlotType;
|
|
129
|
+
/** For portal slots: where to render (default: document.body) */
|
|
130
|
+
portalTarget?: string;
|
|
131
|
+
/** Z-index for portal slots */
|
|
132
|
+
zIndex?: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Context for resolving entity data.
|
|
136
|
+
* Supports multiple data sources with priority.
|
|
137
|
+
*/
|
|
138
|
+
interface DataContext {
|
|
139
|
+
/** Server-provided data (highest priority) */
|
|
140
|
+
fetchedData?: Record<string, unknown[]>;
|
|
141
|
+
/** In-memory mock data (for Builder preview) */
|
|
142
|
+
entityStore?: {
|
|
143
|
+
getRecords: (entityName: string) => unknown[];
|
|
144
|
+
};
|
|
145
|
+
/** Query singleton for filtering */
|
|
146
|
+
querySingleton?: {
|
|
147
|
+
getFilters: (queryRef: string) => Record<string, unknown>;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Result of data resolution
|
|
152
|
+
*/
|
|
153
|
+
interface DataResolution {
|
|
154
|
+
/** Resolved data array */
|
|
155
|
+
data: unknown[];
|
|
156
|
+
/** Whether data is still loading */
|
|
157
|
+
loading: boolean;
|
|
158
|
+
/** Error if resolution failed */
|
|
159
|
+
error?: Error;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Offline Effect Executor
|
|
164
|
+
*
|
|
165
|
+
* Enables client-only mode for applications that need to work without
|
|
166
|
+
* server connectivity. Provides:
|
|
167
|
+
* - Mock data providers for simulating server responses
|
|
168
|
+
* - Local effect execution without server round-trip
|
|
169
|
+
* - Sync queue for effects that need server persistence when back online
|
|
170
|
+
*
|
|
171
|
+
* Used by both Builder preview (offline mode) and compiled shells (PWA mode).
|
|
172
|
+
*
|
|
173
|
+
* @packageDocumentation
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Effect that needs to be synced to server when online
|
|
178
|
+
*/
|
|
179
|
+
interface PendingSyncEffect {
|
|
180
|
+
/** Unique ID for this effect */
|
|
181
|
+
id: string;
|
|
182
|
+
/** Timestamp when effect was queued */
|
|
183
|
+
timestamp: number;
|
|
184
|
+
/** Effect type (persist, call-service, etc.) */
|
|
185
|
+
type: string;
|
|
186
|
+
/** Effect payload */
|
|
187
|
+
payload: unknown;
|
|
188
|
+
/** Number of retry attempts */
|
|
189
|
+
retries: number;
|
|
190
|
+
/** Maximum retries before giving up */
|
|
191
|
+
maxRetries: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Configuration for offline executor
|
|
195
|
+
*/
|
|
196
|
+
interface OfflineExecutorConfig extends ClientEffectExecutorConfig {
|
|
197
|
+
/**
|
|
198
|
+
* Mock data provider for simulating fetch responses.
|
|
199
|
+
* Returns data for a given entity name.
|
|
200
|
+
*/
|
|
201
|
+
mockDataProvider?: (entityName: string) => unknown[];
|
|
202
|
+
/**
|
|
203
|
+
* Whether to queue server effects for sync when online.
|
|
204
|
+
* Default: true
|
|
205
|
+
*/
|
|
206
|
+
enableSyncQueue?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Maximum number of effects to queue before dropping oldest.
|
|
209
|
+
* Default: 100
|
|
210
|
+
*/
|
|
211
|
+
maxQueueSize?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Callback when an effect is added to sync queue.
|
|
214
|
+
*/
|
|
215
|
+
onEffectQueued?: (effect: PendingSyncEffect) => void;
|
|
216
|
+
/**
|
|
217
|
+
* Callback when sync queue changes.
|
|
218
|
+
*/
|
|
219
|
+
onQueueChange?: (queue: PendingSyncEffect[]) => void;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Offline executor state
|
|
223
|
+
*/
|
|
224
|
+
interface OfflineExecutorState {
|
|
225
|
+
/** Whether we're in offline mode */
|
|
226
|
+
isOffline: boolean;
|
|
227
|
+
/** Pending effects waiting for sync */
|
|
228
|
+
syncQueue: PendingSyncEffect[];
|
|
229
|
+
/** Number of effects processed locally */
|
|
230
|
+
localEffectsProcessed: number;
|
|
231
|
+
/** Number of effects synced to server */
|
|
232
|
+
effectsSynced: number;
|
|
233
|
+
/** Last sync attempt timestamp */
|
|
234
|
+
lastSyncAttempt?: number;
|
|
235
|
+
/** Last successful sync timestamp */
|
|
236
|
+
lastSuccessfulSync?: number;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* OfflineExecutor - Handles effects in offline/client-only mode.
|
|
240
|
+
*
|
|
241
|
+
* Features:
|
|
242
|
+
* - Executes client effects immediately (render-ui, navigate, notify, emit)
|
|
243
|
+
* - Queues server effects (persist, fetch, call-service) for later sync
|
|
244
|
+
* - Provides mock data for fetch effects when offline
|
|
245
|
+
* - Syncs queued effects when connection is restored
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* const executor = new OfflineExecutor({
|
|
250
|
+
* renderToSlot: (slot, pattern) => slotManager.render(slot, pattern),
|
|
251
|
+
* navigate: (path) => router.push(path),
|
|
252
|
+
* notify: (message, opts) => toast.show(message, opts),
|
|
253
|
+
* eventBus: { emit: (event, payload) => bus.emit(event, payload) },
|
|
254
|
+
* mockDataProvider: (entityName) => mockStore.getAll(entityName),
|
|
255
|
+
* });
|
|
256
|
+
*
|
|
257
|
+
* // Process effects locally
|
|
258
|
+
* const response = executor.processEventOffline('LOAD', { id: '123' });
|
|
259
|
+
*
|
|
260
|
+
* // When back online
|
|
261
|
+
* await executor.syncPendingEffects(serverUrl);
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
declare class OfflineExecutor {
|
|
265
|
+
private config;
|
|
266
|
+
private state;
|
|
267
|
+
private storage;
|
|
268
|
+
constructor(config: OfflineExecutorConfig);
|
|
269
|
+
/**
|
|
270
|
+
* Check if we're online (browser API)
|
|
271
|
+
*/
|
|
272
|
+
private checkOnline;
|
|
273
|
+
/**
|
|
274
|
+
* Handle going online
|
|
275
|
+
*/
|
|
276
|
+
private handleOnline;
|
|
277
|
+
/**
|
|
278
|
+
* Handle going offline
|
|
279
|
+
*/
|
|
280
|
+
private handleOffline;
|
|
281
|
+
/**
|
|
282
|
+
* Load sync queue from localStorage
|
|
283
|
+
*/
|
|
284
|
+
private loadSyncQueue;
|
|
285
|
+
/**
|
|
286
|
+
* Save sync queue to localStorage
|
|
287
|
+
*/
|
|
288
|
+
private saveSyncQueue;
|
|
289
|
+
/**
|
|
290
|
+
* Add an effect to the sync queue
|
|
291
|
+
*/
|
|
292
|
+
private queueForSync;
|
|
293
|
+
/**
|
|
294
|
+
* Execute client effects immediately.
|
|
295
|
+
*/
|
|
296
|
+
executeClientEffects(effects: ClientEffect[]): void;
|
|
297
|
+
/**
|
|
298
|
+
* Process an event in offline mode.
|
|
299
|
+
*
|
|
300
|
+
* Returns a simulated EventResponse with mock data.
|
|
301
|
+
* Client effects are executed immediately.
|
|
302
|
+
* Server effects are queued for sync.
|
|
303
|
+
*/
|
|
304
|
+
processEventOffline(event: string, payload?: Record<string, unknown>, effects?: Array<unknown[]>): EventResponse;
|
|
305
|
+
/**
|
|
306
|
+
* Sync pending effects to server.
|
|
307
|
+
*
|
|
308
|
+
* @param serverUrl - Base URL for the orbital server
|
|
309
|
+
* @param authToken - Optional auth token for requests
|
|
310
|
+
* @returns Number of successfully synced effects
|
|
311
|
+
*/
|
|
312
|
+
syncPendingEffects(serverUrl: string, authToken?: string): Promise<number>;
|
|
313
|
+
/**
|
|
314
|
+
* Get current executor state
|
|
315
|
+
*/
|
|
316
|
+
getState(): OfflineExecutorState;
|
|
317
|
+
/**
|
|
318
|
+
* Get number of pending effects
|
|
319
|
+
*/
|
|
320
|
+
getPendingCount(): number;
|
|
321
|
+
/**
|
|
322
|
+
* Clear the sync queue
|
|
323
|
+
*/
|
|
324
|
+
clearQueue(): void;
|
|
325
|
+
/**
|
|
326
|
+
* Dispose the executor and clean up listeners
|
|
327
|
+
*/
|
|
328
|
+
dispose(): void;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Create an offline executor with sensible defaults.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* const executor = createOfflineExecutor({
|
|
336
|
+
* renderToSlot: slotManager.render,
|
|
337
|
+
* navigate: router.push,
|
|
338
|
+
* notify: toast.show,
|
|
339
|
+
* eventBus: { emit: bus.emit },
|
|
340
|
+
* mockDataProvider: (entity) => store.getAll(entity),
|
|
341
|
+
* });
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare function createOfflineExecutor(config: OfflineExecutorConfig): OfflineExecutor;
|
|
345
|
+
/**
|
|
346
|
+
* Options for useOfflineExecutor hook
|
|
347
|
+
*/
|
|
348
|
+
interface UseOfflineExecutorOptions extends OfflineExecutorConfig {
|
|
349
|
+
/** Server URL for syncing */
|
|
350
|
+
serverUrl?: string;
|
|
351
|
+
/** Auth token for server requests */
|
|
352
|
+
authToken?: string;
|
|
353
|
+
/** Auto-sync when coming back online */
|
|
354
|
+
autoSync?: boolean;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Result of useOfflineExecutor hook
|
|
358
|
+
*/
|
|
359
|
+
interface UseOfflineExecutorResult {
|
|
360
|
+
/** Current executor state */
|
|
361
|
+
state: OfflineExecutorState;
|
|
362
|
+
/** Whether we're offline */
|
|
363
|
+
isOffline: boolean;
|
|
364
|
+
/** Number of pending effects */
|
|
365
|
+
pendingCount: number;
|
|
366
|
+
/** Execute client effects */
|
|
367
|
+
executeClientEffects: (effects: ClientEffect[]) => void;
|
|
368
|
+
/** Process event offline */
|
|
369
|
+
processEventOffline: (event: string, payload?: Record<string, unknown>, effects?: Array<unknown[]>) => EventResponse;
|
|
370
|
+
/** Manually trigger sync */
|
|
371
|
+
sync: () => Promise<number>;
|
|
372
|
+
/** Clear the queue */
|
|
373
|
+
clearQueue: () => void;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* React hook for offline effect execution.
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* ```tsx
|
|
380
|
+
* function MyComponent() {
|
|
381
|
+
* const { isOffline, pendingCount, processEventOffline, sync } = useOfflineExecutor({
|
|
382
|
+
* renderToSlot: slotManager.render,
|
|
383
|
+
* navigate: router.push,
|
|
384
|
+
* notify: toast.show,
|
|
385
|
+
* eventBus: { emit: bus.emit },
|
|
386
|
+
* serverUrl: '/api/orbitals',
|
|
387
|
+
* autoSync: true,
|
|
388
|
+
* });
|
|
389
|
+
*
|
|
390
|
+
* return (
|
|
391
|
+
* <div>
|
|
392
|
+
* {isOffline && <Banner>Offline - {pendingCount} changes pending</Banner>}
|
|
393
|
+
* <button onClick={() => processEventOffline('SAVE', data)}>Save</button>
|
|
394
|
+
* </div>
|
|
395
|
+
* );
|
|
396
|
+
* }
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
declare function useOfflineExecutor(options: UseOfflineExecutorOptions): UseOfflineExecutorResult;
|
|
400
|
+
|
|
401
|
+
export { type ClientEffect as C, type DataContext as D, type EventResponse as E, type NotifyOptions as N, OfflineExecutor as O, type PatternConfig as P, type ResolvedPattern as R, type SlotDefinition as S, type UseOfflineExecutorResult as U, type UseOfflineExecutorOptions as a, type ClientEffectExecutorConfig as b, type DataResolution as c, type UISlot as d, type SlotType as e, type OfflineExecutorConfig as f, type OfflineExecutorState as g, type PendingSyncEffect as h, createOfflineExecutor as i, useOfflineExecutor as u };
|