@almadar/ui 1.0.0 → 1.0.10
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/chunk-4FRUCUO5.js +14 -0
- package/dist/chunk-7NEWMNNU.js +147 -0
- package/dist/chunk-AQREMI4N.js +426 -0
- package/dist/chunk-BCERHHKU.js +2834 -0
- package/dist/chunk-I5RSZIOE.js +190 -0
- package/dist/chunk-KKCVDUK7.js +104 -0
- package/dist/chunk-N7MVUW4R.js +194 -0
- package/dist/chunk-S7EYY36U.js +13 -0
- package/dist/chunk-TTXKOHDO.js +270 -0
- package/dist/chunk-XSEDIUM6.js +93 -0
- package/dist/cn-mqkxz8Sd.d.ts +9 -0
- package/dist/components/index.d.ts +175 -4
- package/dist/components/index.js +701 -7595
- package/dist/context/index.js +6 -342
- package/dist/hooks/index.d.ts +70 -1
- package/dist/hooks/index.js +6 -2262
- package/dist/lib/index.d.ts +180 -8
- package/dist/lib/index.js +685 -171
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +8 -905
- package/dist/renderer/index.d.ts +144 -1
- package/dist/renderer/index.js +209 -402
- package/dist/stores/index.js +2 -196
- package/package.json +11 -13
- package/themes/almadar.css +8 -0
- package/themes/index.css +1 -0
- package/themes/minimalist.css +8 -0
- package/themes/trait-wars.css +176 -0
- package/themes/wireframe.css +8 -0
- package/dist/components/index.js.map +0 -1
- package/dist/context/index.js.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/providers/index.js.map +0 -1
- package/dist/renderer/index.js.map +0 -1
- package/dist/stores/index.js.map +0 -1
package/dist/renderer/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { P as PatternConfig, R as ResolvedPattern, C as ClientEffect, b as ClientEffectExecutorConfig, N as NotifyOptions, D as DataContext, c as DataResolution, d as UISlot, S as SlotDefinition, e as SlotType } from '../offline-executor-CHr4uAhf.js';
|
|
2
2
|
export { E as EventResponse, O as OfflineExecutor, f as OfflineExecutorConfig, g as OfflineExecutorState, h as PendingSyncEffect, a as UseOfflineExecutorOptions, U as UseOfflineExecutorResult, i as createOfflineExecutor, u as useOfflineExecutor } from '../offline-executor-CHr4uAhf.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { OrbitalSchema, OrbitalPage } from '@almadar/core';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Pattern Resolver
|
|
@@ -364,6 +366,147 @@ declare function getPortalSlots(): UISlot[];
|
|
|
364
366
|
*/
|
|
365
367
|
declare const ALL_SLOTS: UISlot[];
|
|
366
368
|
|
|
369
|
+
/**
|
|
370
|
+
* NavigationContext - Schema-Driven Navigation for Orbital Runtime
|
|
371
|
+
*
|
|
372
|
+
* Provides navigation within the orbital schema without react-router dependency.
|
|
373
|
+
* Navigation works by:
|
|
374
|
+
* 1. Matching path to a page in the schema
|
|
375
|
+
* 2. Extracting route params (e.g., /inspection/:id → { id: "123" })
|
|
376
|
+
* 3. Switching active page
|
|
377
|
+
* 4. Triggering INIT with merged payload
|
|
378
|
+
*
|
|
379
|
+
* This approach works whether OrbitalRuntime is standalone or embedded in another app.
|
|
380
|
+
*
|
|
381
|
+
* Used by both:
|
|
382
|
+
* - Builder runtime (interpreted execution)
|
|
383
|
+
* - Compiled shells (generated applications)
|
|
384
|
+
*
|
|
385
|
+
* @packageDocumentation
|
|
386
|
+
*/
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Match a concrete path against a pattern with :param placeholders.
|
|
390
|
+
* Returns null if no match, or the extracted params if match.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* matchPath('/inspection/:id', '/inspection/123') // { id: '123' }
|
|
394
|
+
* matchPath('/users/:userId/posts/:postId', '/users/42/posts/7') // { userId: '42', postId: '7' }
|
|
395
|
+
* matchPath('/about', '/about') // {}
|
|
396
|
+
* matchPath('/about', '/contact') // null
|
|
397
|
+
*/
|
|
398
|
+
declare function matchPath(pattern: string, path: string): Record<string, string> | null;
|
|
399
|
+
/**
|
|
400
|
+
* Extract route params from a path given its pattern.
|
|
401
|
+
* Wrapper around matchPath for explicit use.
|
|
402
|
+
*/
|
|
403
|
+
declare function extractRouteParams(pattern: string, path: string): Record<string, string>;
|
|
404
|
+
/**
|
|
405
|
+
* Check if a path matches a pattern.
|
|
406
|
+
*/
|
|
407
|
+
declare function pathMatches(pattern: string, path: string): boolean;
|
|
408
|
+
/**
|
|
409
|
+
* Find a page in the schema by matching its path pattern against a concrete path.
|
|
410
|
+
* Returns the page and extracted route params.
|
|
411
|
+
*/
|
|
412
|
+
declare function findPageByPath(schema: OrbitalSchema, path: string): {
|
|
413
|
+
page: OrbitalPage;
|
|
414
|
+
params: Record<string, string>;
|
|
415
|
+
orbitalName: string;
|
|
416
|
+
} | null;
|
|
417
|
+
/**
|
|
418
|
+
* Find a page by name.
|
|
419
|
+
*/
|
|
420
|
+
declare function findPageByName(schema: OrbitalSchema, pageName: string): {
|
|
421
|
+
page: OrbitalPage;
|
|
422
|
+
orbitalName: string;
|
|
423
|
+
} | null;
|
|
424
|
+
/**
|
|
425
|
+
* Get the first page in the schema (default page).
|
|
426
|
+
*/
|
|
427
|
+
declare function getDefaultPage(schema: OrbitalSchema): {
|
|
428
|
+
page: OrbitalPage;
|
|
429
|
+
orbitalName: string;
|
|
430
|
+
} | null;
|
|
431
|
+
/**
|
|
432
|
+
* Get all pages from the schema.
|
|
433
|
+
*/
|
|
434
|
+
declare function getAllPages(schema: OrbitalSchema): Array<{
|
|
435
|
+
page: OrbitalPage;
|
|
436
|
+
orbitalName: string;
|
|
437
|
+
}>;
|
|
438
|
+
interface NavigationState {
|
|
439
|
+
/** Current active page name */
|
|
440
|
+
activePage: string;
|
|
441
|
+
/** Current path (for URL sync) */
|
|
442
|
+
currentPath: string;
|
|
443
|
+
/** Payload to pass to INIT when page loads */
|
|
444
|
+
initPayload: Record<string, unknown>;
|
|
445
|
+
/** Navigation counter (increments on each navigation) */
|
|
446
|
+
navigationId: number;
|
|
447
|
+
}
|
|
448
|
+
interface NavigationContextValue {
|
|
449
|
+
/** Current navigation state */
|
|
450
|
+
state: NavigationState;
|
|
451
|
+
/** Navigate to a path with optional payload */
|
|
452
|
+
navigateTo: (path: string, payload?: Record<string, unknown>) => void;
|
|
453
|
+
/** Navigate to a page by name with optional payload */
|
|
454
|
+
navigateToPage: (pageName: string, payload?: Record<string, unknown>) => void;
|
|
455
|
+
/** The schema being navigated */
|
|
456
|
+
schema: OrbitalSchema;
|
|
457
|
+
/** Whether navigation is ready (schema loaded) */
|
|
458
|
+
isReady: boolean;
|
|
459
|
+
}
|
|
460
|
+
interface NavigationProviderProps {
|
|
461
|
+
/** The schema to navigate within */
|
|
462
|
+
schema: OrbitalSchema;
|
|
463
|
+
/** Initial page name (optional, defaults to first page) */
|
|
464
|
+
initialPage?: string;
|
|
465
|
+
/** Whether to update browser URL on navigation (default: true) */
|
|
466
|
+
updateUrl?: boolean;
|
|
467
|
+
/** Callback when navigation occurs */
|
|
468
|
+
onNavigate?: (pageName: string, path: string, payload: Record<string, unknown>) => void;
|
|
469
|
+
/** Children */
|
|
470
|
+
children: React__default.ReactNode;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* NavigationProvider - Provides schema-driven navigation context
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```tsx
|
|
477
|
+
* <NavigationProvider schema={mySchema}>
|
|
478
|
+
* <OrbitalRuntimeContent />
|
|
479
|
+
* </NavigationProvider>
|
|
480
|
+
* ```
|
|
481
|
+
*/
|
|
482
|
+
declare function NavigationProvider({ schema, initialPage, updateUrl, onNavigate, children, }: NavigationProviderProps): React__default.ReactElement;
|
|
483
|
+
/**
|
|
484
|
+
* Hook to access navigation context.
|
|
485
|
+
* Returns null if not within NavigationProvider.
|
|
486
|
+
*/
|
|
487
|
+
declare function useNavigation(): NavigationContextValue | null;
|
|
488
|
+
/**
|
|
489
|
+
* Hook to get the navigateTo function.
|
|
490
|
+
* Returns a no-op function if not within NavigationProvider.
|
|
491
|
+
*/
|
|
492
|
+
declare function useNavigateTo(): (path: string, payload?: Record<string, unknown>) => void;
|
|
493
|
+
/**
|
|
494
|
+
* Hook to get current navigation state.
|
|
495
|
+
*/
|
|
496
|
+
declare function useNavigationState(): NavigationState | null;
|
|
497
|
+
/**
|
|
498
|
+
* Hook to get the current INIT payload (for passing to trait INIT events).
|
|
499
|
+
*/
|
|
500
|
+
declare function useInitPayload(): Record<string, unknown>;
|
|
501
|
+
/**
|
|
502
|
+
* Hook to get current active page name.
|
|
503
|
+
*/
|
|
504
|
+
declare function useActivePage(): string | null;
|
|
505
|
+
/**
|
|
506
|
+
* Hook to get navigation ID (changes on each navigation, useful for triggering effects).
|
|
507
|
+
*/
|
|
508
|
+
declare function useNavigationId(): number;
|
|
509
|
+
|
|
367
510
|
/**
|
|
368
511
|
* Pattern Resolver Initialization
|
|
369
512
|
*
|
|
@@ -379,4 +522,4 @@ declare const ALL_SLOTS: UISlot[];
|
|
|
379
522
|
*/
|
|
380
523
|
declare function initializePatterns(): number;
|
|
381
524
|
|
|
382
|
-
export { ALL_SLOTS, ClientEffect, ClientEffectConfigContext, ClientEffectConfigProvider, ClientEffectExecutorConfig, DataContext, DataResolution, NotifyOptions, PatternConfig, ResolvedPattern, SLOT_DEFINITIONS, SlotDefinition, SlotType, UISlot, type UseClientEffectsOptions, type UseClientEffectsResult, createFetchedDataContext, executeClientEffects, filterEffectsByType, getEmitEffects, getInlineSlots, getKnownPatterns, getNavigateEffects, getNotifyEffects, getPatternDefinition, getPatternMapping, getPatternsByCategory, getPortalSlots, getRenderUIEffects, getSlotDefinition, getSlotsByType, hasEntities, initializePatternResolver, initializePatterns, isInlineSlot, isKnownPattern, isPortalSlot, mergeDataContexts, parseClientEffect, parseClientEffects, resolveEntityById, resolveEntityCount, resolveEntityData, resolveEntityDataWithQuery, resolvePattern, setComponentMapping, setPatternRegistry, useClientEffectConfig, useClientEffectConfigOptional, useClientEffects };
|
|
525
|
+
export { ALL_SLOTS, ClientEffect, ClientEffectConfigContext, ClientEffectConfigProvider, ClientEffectExecutorConfig, DataContext, DataResolution, type NavigationContextValue, NavigationProvider, type NavigationProviderProps, type NavigationState, NotifyOptions, PatternConfig, ResolvedPattern, SLOT_DEFINITIONS, SlotDefinition, SlotType, UISlot, type UseClientEffectsOptions, type UseClientEffectsResult, createFetchedDataContext, executeClientEffects, extractRouteParams, filterEffectsByType, findPageByName, findPageByPath, getAllPages, getDefaultPage, getEmitEffects, getInlineSlots, getKnownPatterns, getNavigateEffects, getNotifyEffects, getPatternDefinition, getPatternMapping, getPatternsByCategory, getPortalSlots, getRenderUIEffects, getSlotDefinition, getSlotsByType, hasEntities, initializePatternResolver, initializePatterns, isInlineSlot, isKnownPattern, isPortalSlot, matchPath, mergeDataContexts, parseClientEffect, parseClientEffects, pathMatches, resolveEntityById, resolveEntityCount, resolveEntityData, resolveEntityDataWithQuery, resolvePattern, setComponentMapping, setPatternRegistry, useActivePage, useClientEffectConfig, useClientEffectConfigOptional, useClientEffects, useInitPayload, useNavigateTo, useNavigation, useNavigationId, useNavigationState };
|