@almadar/ui 1.0.18 → 1.0.20
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-QFAKJLOK.js → chunk-4FRUCUO5.js} +1 -1
- package/dist/{chunk-DTKTZ3UR.js → chunk-I5RSZIOE.js} +24 -24
- package/dist/components/index.js +4 -4
- package/dist/context/index.js +2 -2
- package/dist/hooks/index.d.ts +71 -71
- package/dist/hooks/index.js +1 -1
- package/dist/providers/index.js +1 -1
- package/package.json +4 -6
- /package/dist/{chunk-MLS5KU5U.js → chunk-VE4ZELYZ.js} +0 -0
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { useUISlotManager } from './chunk-7NEWMNNU.js';
|
|
2
|
-
import { createContext, useMemo, useState, useEffect, useCallback
|
|
2
|
+
import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
var UISlotContext = createContext(null);
|
|
6
|
+
function UISlotProvider({ children }) {
|
|
7
|
+
const slotManager = useUISlotManager();
|
|
8
|
+
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
9
|
+
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
10
|
+
}
|
|
11
|
+
function useUISlots() {
|
|
12
|
+
const context = useContext(UISlotContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function useSlotContent(slot) {
|
|
21
|
+
const { getContent } = useUISlots();
|
|
22
|
+
return getContent(slot);
|
|
23
|
+
}
|
|
24
|
+
function useSlotHasContent(slot) {
|
|
25
|
+
const { hasContent } = useUISlots();
|
|
26
|
+
return hasContent(slot);
|
|
27
|
+
}
|
|
5
28
|
var BUILT_IN_THEMES = [
|
|
6
29
|
{
|
|
7
30
|
name: "wireframe",
|
|
@@ -163,28 +186,5 @@ function useTheme() {
|
|
|
163
186
|
return context;
|
|
164
187
|
}
|
|
165
188
|
var ThemeContext_default = ThemeContext;
|
|
166
|
-
var UISlotContext = createContext(null);
|
|
167
|
-
function UISlotProvider({ children }) {
|
|
168
|
-
const slotManager = useUISlotManager();
|
|
169
|
-
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
170
|
-
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
171
|
-
}
|
|
172
|
-
function useUISlots() {
|
|
173
|
-
const context = useContext(UISlotContext);
|
|
174
|
-
if (!context) {
|
|
175
|
-
throw new Error(
|
|
176
|
-
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
return context;
|
|
180
|
-
}
|
|
181
|
-
function useSlotContent(slot) {
|
|
182
|
-
const { getContent } = useUISlots();
|
|
183
|
-
return getContent(slot);
|
|
184
|
-
}
|
|
185
|
-
function useSlotHasContent(slot) {
|
|
186
|
-
const { hasContent } = useUISlots();
|
|
187
|
-
return hasContent(slot);
|
|
188
|
-
}
|
|
189
189
|
|
|
190
190
|
export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };
|
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useDesignTheme } from '../chunk-
|
|
2
|
-
import { useQuerySingleton, usePaginatedEntityList, useEntityList, useSelectedEntity, useEntityDetail, useAuthContext } from '../chunk-
|
|
3
|
-
export { ENTITY_EVENTS, entityDataKeys, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDetail, useEntityList, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-
|
|
1
|
+
import { useDesignTheme } from '../chunk-4FRUCUO5.js';
|
|
2
|
+
import { useQuerySingleton, usePaginatedEntityList, useEntityList, useSelectedEntity, useEntityDetail, useAuthContext } from '../chunk-VE4ZELYZ.js';
|
|
3
|
+
export { ENTITY_EVENTS, entityDataKeys, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDetail, useEntityList, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-VE4ZELYZ.js';
|
|
4
4
|
import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from '../chunk-KKCVDUK7.js';
|
|
5
5
|
export { cn } from '../chunk-KKCVDUK7.js';
|
|
6
6
|
import '../chunk-XSEDIUM6.js';
|
|
7
|
-
import { useTheme, useUISlots } from '../chunk-
|
|
7
|
+
import { useTheme, useUISlots } from '../chunk-I5RSZIOE.js';
|
|
8
8
|
import { useEventBus } from '../chunk-TTXKOHDO.js';
|
|
9
9
|
export { useEmitEvent, useEventBus, useEventListener } from '../chunk-TTXKOHDO.js';
|
|
10
10
|
export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
|
package/dist/context/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DesignThemeProvider, useDesignTheme } from '../chunk-
|
|
2
|
-
export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-
|
|
1
|
+
export { DesignThemeProvider, useDesignTheme } from '../chunk-4FRUCUO5.js';
|
|
2
|
+
export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-I5RSZIOE.js';
|
|
3
3
|
import '../chunk-7NEWMNNU.js';
|
|
4
4
|
import '../chunk-PKBMQBKP.js';
|
|
5
5
|
import { createContext, useCallback, useMemo, useContext } from 'react';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -5,77 +5,6 @@ export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotC
|
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { Entity, getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/index.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* useEventBus Hook
|
|
10
|
-
*
|
|
11
|
-
* Provides event bus utilities for component communication.
|
|
12
|
-
* This connects to the EventBusProvider for real applications
|
|
13
|
-
* or provides a simple in-memory bus for design system / Storybook.
|
|
14
|
-
*
|
|
15
|
-
* @packageDocumentation
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
declare global {
|
|
19
|
-
interface Window {
|
|
20
|
-
__kflowEventBus?: EventBusContextType | null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Hook for accessing the event bus.
|
|
25
|
-
*
|
|
26
|
-
* Uses EventBusProvider context if available, otherwise falls back to
|
|
27
|
-
* a simple in-memory event bus (for design system / Storybook).
|
|
28
|
-
*
|
|
29
|
-
* @returns Event bus instance with emit, on, once, and hasListeners methods
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* const eventBus = useEventBus();
|
|
34
|
-
*
|
|
35
|
-
* // Emit an event
|
|
36
|
-
* eventBus.emit('UI:CLICK', { id: '123' });
|
|
37
|
-
*
|
|
38
|
-
* // Subscribe to an event
|
|
39
|
-
* useEffect(() => {
|
|
40
|
-
* return eventBus.on('UI:CLICK', (event) => {
|
|
41
|
-
* console.log('Clicked:', event.payload);
|
|
42
|
-
* });
|
|
43
|
-
* }, []);
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
declare function useEventBus(): EventBusContextType;
|
|
47
|
-
/**
|
|
48
|
-
* Hook for subscribing to a specific event.
|
|
49
|
-
* Automatically cleans up subscription on unmount.
|
|
50
|
-
*
|
|
51
|
-
* @param event - Event name to subscribe to
|
|
52
|
-
* @param handler - Event handler function
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```tsx
|
|
56
|
-
* useEventListener('UI:CLICK', (event) => {
|
|
57
|
-
* console.log('Clicked:', event.payload);
|
|
58
|
-
* });
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
declare function useEventListener(event: string, handler: EventListener): void;
|
|
62
|
-
/**
|
|
63
|
-
* Hook for emitting events.
|
|
64
|
-
* Returns a memoized emit function.
|
|
65
|
-
*
|
|
66
|
-
* @returns Function to emit events
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```tsx
|
|
70
|
-
* const emit = useEmitEvent();
|
|
71
|
-
*
|
|
72
|
-
* const handleClick = () => {
|
|
73
|
-
* emit('UI:CLICK', { id: '123' });
|
|
74
|
-
* };
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
|
|
78
|
-
|
|
79
8
|
/**
|
|
80
9
|
* useOrbitalHistory Hook
|
|
81
10
|
*
|
|
@@ -549,6 +478,77 @@ interface UseValidationResult {
|
|
|
549
478
|
}
|
|
550
479
|
declare function useValidation(): UseValidationResult;
|
|
551
480
|
|
|
481
|
+
/**
|
|
482
|
+
* useEventBus Hook
|
|
483
|
+
*
|
|
484
|
+
* Provides event bus utilities for component communication.
|
|
485
|
+
* This connects to the EventBusProvider for real applications
|
|
486
|
+
* or provides a simple in-memory bus for design system / Storybook.
|
|
487
|
+
*
|
|
488
|
+
* @packageDocumentation
|
|
489
|
+
*/
|
|
490
|
+
|
|
491
|
+
declare global {
|
|
492
|
+
interface Window {
|
|
493
|
+
__kflowEventBus?: EventBusContextType | null;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Hook for accessing the event bus.
|
|
498
|
+
*
|
|
499
|
+
* Uses EventBusProvider context if available, otherwise falls back to
|
|
500
|
+
* a simple in-memory event bus (for design system / Storybook).
|
|
501
|
+
*
|
|
502
|
+
* @returns Event bus instance with emit, on, once, and hasListeners methods
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* ```tsx
|
|
506
|
+
* const eventBus = useEventBus();
|
|
507
|
+
*
|
|
508
|
+
* // Emit an event
|
|
509
|
+
* eventBus.emit('UI:CLICK', { id: '123' });
|
|
510
|
+
*
|
|
511
|
+
* // Subscribe to an event
|
|
512
|
+
* useEffect(() => {
|
|
513
|
+
* return eventBus.on('UI:CLICK', (event) => {
|
|
514
|
+
* console.log('Clicked:', event.payload);
|
|
515
|
+
* });
|
|
516
|
+
* }, []);
|
|
517
|
+
* ```
|
|
518
|
+
*/
|
|
519
|
+
declare function useEventBus(): EventBusContextType;
|
|
520
|
+
/**
|
|
521
|
+
* Hook for subscribing to a specific event.
|
|
522
|
+
* Automatically cleans up subscription on unmount.
|
|
523
|
+
*
|
|
524
|
+
* @param event - Event name to subscribe to
|
|
525
|
+
* @param handler - Event handler function
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```tsx
|
|
529
|
+
* useEventListener('UI:CLICK', (event) => {
|
|
530
|
+
* console.log('Clicked:', event.payload);
|
|
531
|
+
* });
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
declare function useEventListener(event: string, handler: EventListener): void;
|
|
535
|
+
/**
|
|
536
|
+
* Hook for emitting events.
|
|
537
|
+
* Returns a memoized emit function.
|
|
538
|
+
*
|
|
539
|
+
* @returns Function to emit events
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* ```tsx
|
|
543
|
+
* const emit = useEmitEvent();
|
|
544
|
+
*
|
|
545
|
+
* const handleClick = () => {
|
|
546
|
+
* emit('UI:CLICK', { id: '123' });
|
|
547
|
+
* };
|
|
548
|
+
* ```
|
|
549
|
+
*/
|
|
550
|
+
declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
|
|
551
|
+
|
|
552
552
|
/**
|
|
553
553
|
* useUIEvents - UI Event to State Machine Bridge
|
|
554
554
|
*
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ENTITY_EVENTS, entityDataKeys, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDetail, useEntityList, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-
|
|
1
|
+
export { ENTITY_EVENTS, entityDataKeys, parseQueryBinding, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity, useEntity2 as useEntityById, useEntityDetail, useEntityList, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePlayer, usePreview, useQuerySingleton, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-VE4ZELYZ.js';
|
|
2
2
|
import '../chunk-XSEDIUM6.js';
|
|
3
3
|
export { useEmitEvent, useEventBus, useEventListener } from '../chunk-TTXKOHDO.js';
|
|
4
4
|
export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-7NEWMNNU.js';
|
package/dist/providers/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThemeProvider, UISlotProvider } from '../chunk-
|
|
1
|
+
import { ThemeProvider, UISlotProvider } from '../chunk-I5RSZIOE.js';
|
|
2
2
|
import { EventBusProvider, SelectionProvider } from '../chunk-TTXKOHDO.js';
|
|
3
3
|
export { EventBusContext, EventBusProvider, SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-TTXKOHDO.js';
|
|
4
4
|
import '../chunk-7NEWMNNU.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -55,15 +55,14 @@
|
|
|
55
55
|
"lucide-react": "^0.344.0",
|
|
56
56
|
"katex": "^0.16.9",
|
|
57
57
|
"react-markdown": "^9.0.3",
|
|
58
|
-
"react-syntax-highlighter": "^15.5.0",
|
|
59
58
|
"rehype-katex": "^7.0.0",
|
|
60
59
|
"rehype-raw": "^7.0.0",
|
|
61
60
|
"remark-gfm": "^4.0.1",
|
|
62
61
|
"remark-math": "^6.0.0",
|
|
63
62
|
"react-force-graph-2d": "^1.28.0",
|
|
64
|
-
"@almadar/core": "1.0.
|
|
65
|
-
"@almadar/
|
|
66
|
-
"@almadar/
|
|
63
|
+
"@almadar/core": "1.0.15",
|
|
64
|
+
"@almadar/patterns": "1.1.0",
|
|
65
|
+
"@almadar/evaluator": "1.0.13"
|
|
67
66
|
},
|
|
68
67
|
"peerDependencies": {
|
|
69
68
|
"react": "^18.0.0",
|
|
@@ -78,7 +77,6 @@
|
|
|
78
77
|
"@tanstack/react-query": "^5.0.0",
|
|
79
78
|
"@types/react": "^18.3.0",
|
|
80
79
|
"@types/react-dom": "^18.3.0",
|
|
81
|
-
"@types/react-syntax-highlighter": "^15.5.11",
|
|
82
80
|
"@storybook/addon-links": "^10.2.6",
|
|
83
81
|
"@storybook/addon-themes": "^10.2.6",
|
|
84
82
|
"@storybook/react": "^10.2.6",
|
|
File without changes
|