@djangocfg/ui-tools 2.1.374 → 2.1.375

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/index.d.cts CHANGED
@@ -1859,6 +1859,12 @@ interface UseChatLayoutReturn {
1859
1859
  }
1860
1860
  declare function useChatLayout(config?: UseChatLayoutConfig): UseChatLayoutReturn;
1861
1861
 
1862
+ /** Minimal handle a composer (built-in or custom) registers so other
1863
+ * parts of the chat tree can drive it imperatively — `.focus()` is
1864
+ * enough today; expand the surface as new needs arise. */
1865
+ interface ComposerHandle {
1866
+ focus: () => void;
1867
+ }
1862
1868
  interface ChatContextValue extends UseChatReturn {
1863
1869
  layout: UseChatLayoutReturn;
1864
1870
  config: ChatConfig;
@@ -1868,6 +1874,13 @@ interface ChatContextValue extends UseChatReturn {
1868
1874
  * Components like ``AudioToggle`` use this to auto-hide when there
1869
1875
  * is nothing to mute. */
1870
1876
  hasAudio: boolean;
1877
+ /** Composer registry. The built-in `<Composer>` calls
1878
+ * `registerComposer({ focus })` on mount; custom composers (e.g.
1879
+ * cmdop's MarkdownEditor wrapper) do the same via the
1880
+ * `useRegisterComposer` helper. Read it via `composer?.focus()` —
1881
+ * null until any composer has mounted. Plan64 follow-up. */
1882
+ composer: ComposerHandle | null;
1883
+ registerComposer: (handle: ComposerHandle | null) => void;
1871
1884
  }
1872
1885
  interface ChatProviderProps {
1873
1886
  transport: ChatTransport;
@@ -2294,6 +2307,78 @@ interface UseChatLightboxReturn {
2294
2307
  * `<LazyImageViewer>` mount; we just track which gallery to show. */
2295
2308
  declare function useChatLightbox(): UseChatLightboxReturn;
2296
2309
 
2310
+ /** Anything with a `.focus()` method — covers HTMLElement, the
2311
+ * composer's textareaRef from `useChatComposer`, and any custom
2312
+ * imperative handle exposing the same shape. */
2313
+ interface Focusable {
2314
+ focus: () => void;
2315
+ }
2316
+ interface UseAutoFocusOnStreamEndOptions {
2317
+ /** True while an assistant reply is streaming. The hook fires the
2318
+ * focus() call on the true → false transition.
2319
+ *
2320
+ * When omitted, the hook reads `isStreaming` from `useChatContext`.
2321
+ * Pass it explicitly only if you're driving stream state from your
2322
+ * own store (cmdop's Wails event bus, for example). */
2323
+ isStreaming?: boolean;
2324
+ /** Ref / handle to focus when the reply lands.
2325
+ *
2326
+ * When omitted, the hook uses the composer handle registered in
2327
+ * the chat context — the built-in `<Composer>` registers itself
2328
+ * automatically, custom composers can opt in via
2329
+ * `useRegisterComposer`. Pass `targetRef` only when you need to
2330
+ * focus something other than the composer (e.g. an "approve"
2331
+ * button, a quick-reply chip). */
2332
+ targetRef?: RefObject<Focusable | HTMLElement | null>;
2333
+ /** Opt-out. Default true. Pass false to disable without unmounting
2334
+ * the hook (e.g. user preference). */
2335
+ enabled?: boolean;
2336
+ /** Delay the focus call by this many ms. Default 0 = next animation
2337
+ * frame, which lets the streaming bubble's final commit settle
2338
+ * before focus pulls scroll. Bump to 50-150ms for layouts that
2339
+ * re-mount the composer after the final chunk. */
2340
+ delayMs?: number;
2341
+ }
2342
+ /**
2343
+ * Refocus the chat composer the moment the assistant reply finishes
2344
+ * streaming. Standard chat UX: the user types → sends → reads the
2345
+ * reply → starts typing again without reaching for the mouse.
2346
+ *
2347
+ * Default (zero-config) usage — works the moment a `<Composer>` is
2348
+ * mounted inside a `<ChatProvider>`:
2349
+ *
2350
+ * useAutoFocusOnStreamEnd();
2351
+ *
2352
+ * Custom composer / advanced wiring:
2353
+ *
2354
+ * const ref = useRef<{ focus: () => void } | null>(null);
2355
+ * useAutoFocusOnStreamEnd({ targetRef: ref });
2356
+ *
2357
+ * Driving stream state yourself:
2358
+ *
2359
+ * useAutoFocusOnStreamEnd({ isStreaming: myExternalStreaming });
2360
+ *
2361
+ * Only the true → false transition fires focus — toggling `enabled`
2362
+ * mid-stream won't steal focus while the user is reading.
2363
+ */
2364
+ declare function useAutoFocusOnStreamEnd(options?: UseAutoFocusOnStreamEndOptions): void;
2365
+ /**
2366
+ * Helper for custom composers (anything that's NOT the built-in
2367
+ * `<Composer>`) to register their focus() with the chat context so
2368
+ * `useAutoFocusOnStreamEnd()` and other consumers work without
2369
+ * prop-drilling.
2370
+ *
2371
+ * Usage inside your custom composer:
2372
+ *
2373
+ * const focus = useCallback(() => {
2374
+ * myEditorRef.current?.commands.focus();
2375
+ * }, []);
2376
+ * useRegisterComposer(focus);
2377
+ *
2378
+ * No-op when called outside a `<ChatProvider>`.
2379
+ */
2380
+ declare function useRegisterComposer(focus: () => void): void;
2381
+
2297
2382
  interface ChatAudioPrefsState {
2298
2383
  /** 0..1 master volume. */
2299
2384
  volume: number;
@@ -3591,4 +3676,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
3591
3676
  */
3592
3677
  declare function generateContentKey(content: ArrayBuffer): string;
3593
3678
 
3594
- export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, AudioToggle, type AudioToggleProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListHandle, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
3679
+ export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, AudioToggle, type AudioToggleProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type Focusable, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListHandle, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseAutoFocusOnStreamEndOptions, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useAutoFocusOnStreamEnd, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useRegisterComposer, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
package/dist/index.d.ts CHANGED
@@ -1859,6 +1859,12 @@ interface UseChatLayoutReturn {
1859
1859
  }
1860
1860
  declare function useChatLayout(config?: UseChatLayoutConfig): UseChatLayoutReturn;
1861
1861
 
1862
+ /** Minimal handle a composer (built-in or custom) registers so other
1863
+ * parts of the chat tree can drive it imperatively — `.focus()` is
1864
+ * enough today; expand the surface as new needs arise. */
1865
+ interface ComposerHandle {
1866
+ focus: () => void;
1867
+ }
1862
1868
  interface ChatContextValue extends UseChatReturn {
1863
1869
  layout: UseChatLayoutReturn;
1864
1870
  config: ChatConfig;
@@ -1868,6 +1874,13 @@ interface ChatContextValue extends UseChatReturn {
1868
1874
  * Components like ``AudioToggle`` use this to auto-hide when there
1869
1875
  * is nothing to mute. */
1870
1876
  hasAudio: boolean;
1877
+ /** Composer registry. The built-in `<Composer>` calls
1878
+ * `registerComposer({ focus })` on mount; custom composers (e.g.
1879
+ * cmdop's MarkdownEditor wrapper) do the same via the
1880
+ * `useRegisterComposer` helper. Read it via `composer?.focus()` —
1881
+ * null until any composer has mounted. Plan64 follow-up. */
1882
+ composer: ComposerHandle | null;
1883
+ registerComposer: (handle: ComposerHandle | null) => void;
1871
1884
  }
1872
1885
  interface ChatProviderProps {
1873
1886
  transport: ChatTransport;
@@ -2294,6 +2307,78 @@ interface UseChatLightboxReturn {
2294
2307
  * `<LazyImageViewer>` mount; we just track which gallery to show. */
2295
2308
  declare function useChatLightbox(): UseChatLightboxReturn;
2296
2309
 
2310
+ /** Anything with a `.focus()` method — covers HTMLElement, the
2311
+ * composer's textareaRef from `useChatComposer`, and any custom
2312
+ * imperative handle exposing the same shape. */
2313
+ interface Focusable {
2314
+ focus: () => void;
2315
+ }
2316
+ interface UseAutoFocusOnStreamEndOptions {
2317
+ /** True while an assistant reply is streaming. The hook fires the
2318
+ * focus() call on the true → false transition.
2319
+ *
2320
+ * When omitted, the hook reads `isStreaming` from `useChatContext`.
2321
+ * Pass it explicitly only if you're driving stream state from your
2322
+ * own store (cmdop's Wails event bus, for example). */
2323
+ isStreaming?: boolean;
2324
+ /** Ref / handle to focus when the reply lands.
2325
+ *
2326
+ * When omitted, the hook uses the composer handle registered in
2327
+ * the chat context — the built-in `<Composer>` registers itself
2328
+ * automatically, custom composers can opt in via
2329
+ * `useRegisterComposer`. Pass `targetRef` only when you need to
2330
+ * focus something other than the composer (e.g. an "approve"
2331
+ * button, a quick-reply chip). */
2332
+ targetRef?: RefObject<Focusable | HTMLElement | null>;
2333
+ /** Opt-out. Default true. Pass false to disable without unmounting
2334
+ * the hook (e.g. user preference). */
2335
+ enabled?: boolean;
2336
+ /** Delay the focus call by this many ms. Default 0 = next animation
2337
+ * frame, which lets the streaming bubble's final commit settle
2338
+ * before focus pulls scroll. Bump to 50-150ms for layouts that
2339
+ * re-mount the composer after the final chunk. */
2340
+ delayMs?: number;
2341
+ }
2342
+ /**
2343
+ * Refocus the chat composer the moment the assistant reply finishes
2344
+ * streaming. Standard chat UX: the user types → sends → reads the
2345
+ * reply → starts typing again without reaching for the mouse.
2346
+ *
2347
+ * Default (zero-config) usage — works the moment a `<Composer>` is
2348
+ * mounted inside a `<ChatProvider>`:
2349
+ *
2350
+ * useAutoFocusOnStreamEnd();
2351
+ *
2352
+ * Custom composer / advanced wiring:
2353
+ *
2354
+ * const ref = useRef<{ focus: () => void } | null>(null);
2355
+ * useAutoFocusOnStreamEnd({ targetRef: ref });
2356
+ *
2357
+ * Driving stream state yourself:
2358
+ *
2359
+ * useAutoFocusOnStreamEnd({ isStreaming: myExternalStreaming });
2360
+ *
2361
+ * Only the true → false transition fires focus — toggling `enabled`
2362
+ * mid-stream won't steal focus while the user is reading.
2363
+ */
2364
+ declare function useAutoFocusOnStreamEnd(options?: UseAutoFocusOnStreamEndOptions): void;
2365
+ /**
2366
+ * Helper for custom composers (anything that's NOT the built-in
2367
+ * `<Composer>`) to register their focus() with the chat context so
2368
+ * `useAutoFocusOnStreamEnd()` and other consumers work without
2369
+ * prop-drilling.
2370
+ *
2371
+ * Usage inside your custom composer:
2372
+ *
2373
+ * const focus = useCallback(() => {
2374
+ * myEditorRef.current?.commands.focus();
2375
+ * }, []);
2376
+ * useRegisterComposer(focus);
2377
+ *
2378
+ * No-op when called outside a `<ChatProvider>`.
2379
+ */
2380
+ declare function useRegisterComposer(focus: () => void): void;
2381
+
2297
2382
  interface ChatAudioPrefsState {
2298
2383
  /** 0..1 master volume. */
2299
2384
  volume: number;
@@ -3591,4 +3676,4 @@ declare function useBlobUrlCleanup(key: string | null): void;
3591
3676
  */
3592
3677
  declare function generateContentKey(content: ArrayBuffer): string;
3593
3678
 
3594
- export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, AudioToggle, type AudioToggleProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListHandle, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
3679
+ export { type ApiKey, ArrayFieldItemTemplate, ArrayFieldTemplate, type AspectRatioValue, type AttachmentRenderer, type AttachmentRendererArgs, type AttachmentRendererMap, Attachments, AttachmentsGrid, type AttachmentsGridProps, AttachmentsList, type AttachmentsListProps, type AttachmentsProps, Player as AudioPlayer, type PlayerProps as AudioPlayerProps, AudioToggle, type AudioToggleProps, BaseInputTemplate, type BlobSource, CHAT_EVENT_NAME, CSS_VARS, CardLoadingFallback, type ChatAction, type ChatAssistantContext, type ChatAttachment, type ChatAudioConfig, type ChatAudioEvent, type ChatAudioSounds, type ChatConfig, type ChatContextValue, type ChatDisplayMode, type ChatEventDetail, type ChatLabels, type ChatLightboxState, type ChatLogScope, type ChatLogger, type ChatMessage, type ChatPersona, type ChatPrefs, ChatProvider, type ChatProviderProps, type ChatRole, ChatRoot, type ChatRootProps, type ChatSource, type ChatState, type ChatStreamEvent, type ChatToolCall, type ChatTransport, type ChatUserContext, CheckboxWidget, ColorWidget, Composer, type ComposerProps, type CreateLazyComponentOptions, type CreateSessionOptions, type CreateVideoErrorFallbackOptions, CronScheduler, type CronSchedulerContextValue, type CronSchedulerProps, CronSchedulerProvider, type CronSchedulerState, CustomInput, type DASHSource, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, type DataUrlSource, DayChips, DiffEditor, type DiffEditorProps, type DisabledWhenRule, Editor, type EditorContextValue, type EditorFile, type EditorOptions, type EditorProps, EditorProvider, type EditorRef, EmptyState, type EmptyStateProps, ErrorBanner, type ErrorBannerProps, type ErrorFallbackProps, ErrorListTemplate, FieldTemplate, type Focusable, type HLSSource, HOTKEYS, type HistoryPage, type HttpTransportConfig, type ImageFile, ImageViewer, type ImageViewerProps, type JsonFormContext, type JsonFormDensity, JsonSchemaForm, type JsonSchemaFormProps, JsonTreeComponent as JsonTree, type JsonTreeConfig, type JsonTreeProps, JumpToLatest, type JumpToLatestProps, LIMITS, LazyPlayer as LazyAudioPlayer, LazyChat, type ChatRootProps as LazyChatProps, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, TreeRootProps as LazyTreeProps, LazyVideoPlayer, LazyWrapper, type LazyWrapperProps, type LinkRule, LoadingFallback, type LoadingFallbackProps, type LottieDirection, LottiePlayer, type LottiePlayerProps, type LottieSize, type LottieSpeed, type MapContainerProps, MapLoadingFallback, type MapStyleKey, type MapViewport, MarkdownEditor, type MarkdownEditorProps, MarkdownMessage, type MarkdownMessageProps, type MarkerData, type MentionAttrs, type MentionConfig, type MentionItem, type MentionMarkdownRenderer, Mermaid, type MermaidProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageList, type MessageListHandle, type MessageListProps, type MockTransportOptions, type MonthDay, MonthDayGrid, NativeProvider, NumberWidget, ObjectFieldTemplate, Playground as OpenapiViewer, type ParseSSEOptions, type PlayerMode, type PlaygroundConfig, type PlaygroundProps$1 as PlaygroundProps, PrettyCode, type PrettyCodeProps$1 as PrettyCodeProps, type ResolveFileSourceOptions, STORAGE_KEYS, SchedulePreview, type ScheduleType, ScheduleTypeSelector, type SchemaSource, SelectWidget, type SendOptions, type SessionInfo, type SimpleStreamSource, SliderWidget, Sources, type SourcesProps, Spinner, type StreamOptions, StreamProvider, type StreamSource, StreamingIndicator, type StreamingIndicatorProps, SwitchWidget, TextWidget, TimeSelector, type TokenBuffer, ToolCalls, type ToolCallsProps, type ToolPayloadFallback, type ToolPayloadKind, type ToolPayloadMatcher, TransportError, TreeRootProps, type UiGroup, type UrlSource, type UseAutoFocusOnStreamEndOptions, type UseChatAudioReturn, type UseChatComposerOptions, type UseChatComposerReturn, type UseChatConfig, type UseChatHistoryOptions, type UseChatLayoutConfig, type UseChatLayoutReturn, type UseChatLightboxReturn, type UseChatReturn, type UseChatScrollOptions, type UseChatScrollReturn, type UseCollapsibleContentOptions, type UseCollapsibleContentResult, type UseEditorReturn, type UseLottieOptions, type UseLottieReturn, type UseMonacoReturn, VideoControls, VideoErrorFallback, type VideoErrorFallbackProps, VideoPlayer, type VideoPlayerContextValue, type VideoPlayerProps, VideoPlayerProvider, type VideoPlayerProviderProps, type VideoPlayerRef, type VideoSourceUnion, VidstackProvider, type VimeoSource, type WeekDay, type YouTubeSource, buildCron, collectImageAttachments, createHttpTransport, createId, createLazyComponent, createMockTransport, createTokenBuffer, createVideoErrorFallback, deriveInitials, dispatchToolPayload, evaluateDisabledWhen, extractTextFromChildren, generateContentKey, getChatLogger, getRequiredFields, hasRequiredFields, humanizeCron, initialState, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isSimpleStreamSource, isStringValue, isValidCron, mentionPresets, mergeDefaults, normalizeFormData, parseCron, parseSSE, reducer, resolveFileSource, resolvePersona, resolvePlayerMode, resolveStreamSource, safeJsonParse, safeJsonStringify, useAudioCache, useAutoFocusOnStreamEnd, useBlobUrlCleanup, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatHistory, useChatLayout, useChatLightbox, useChatScroll, useCollapsibleContent, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays, useEditor, useEditorContext, useImageCache, useLanguage, useLottie, useMediaCacheStore, useMonaco, useRegisterComposer, useVideoCache, useVideoPlayerContext, useVideoPlayerSettings, validateRequiredFields, validateSchema };
package/dist/index.mjs CHANGED
@@ -5,8 +5,8 @@ export { NativeProvider, StreamProvider, VideoControls, VideoErrorFallback, Vide
5
5
  export { ImageViewer } from './chunk-OBRSGM64.mjs';
6
6
  export { generateContentKey, useAudioCache, useBlobUrlCleanup, useImageCache, useMediaCacheStore, useVideoCache, useVideoPlayerSettings } from './chunk-C6GXVH5J.mjs';
7
7
  export { CronSchedulerProvider, CustomInput, DayChips, MonthDayGrid, SchedulePreview, ScheduleTypeSelector, TimeSelector, buildCron, humanizeCron, isValidCron, parseCron, useCronCustom, useCronMonthDays, useCronPreview, useCronScheduler, useCronSchedulerContext, useCronTime, useCronType, useCronWeekDays } from './chunk-PVAX67JG.mjs';
8
- import { LIMITS, createId, useChatAudioPrefs, useChatContextOptional } from './chunk-PSM3DUTC.mjs';
9
- export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, getChatLogger, initialState, reducer, resolvePersona, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatLayout } from './chunk-PSM3DUTC.mjs';
8
+ import { LIMITS, createId, useChatContextOptional, useChatAudioPrefs } from './chunk-JXBEKSNT.mjs';
9
+ export { Attachments, AttachmentsGrid, AttachmentsList, CHAT_EVENT_NAME, CSS_VARS, ChatProvider, ChatRoot, Composer, DEFAULT_LABELS, DEFAULT_SIDEBAR, DEFAULT_Z_INDEX, EmptyState, ErrorBanner, HOTKEYS, JumpToLatest, LIMITS, MessageActions, MessageBubble, MessageList, STORAGE_KEYS, Sources, StreamingIndicator, ToolCalls, createId, createTokenBuffer, deriveInitials, getChatLogger, initialState, reducer, resolvePersona, useChat, useChatAudio, useChatAudioPrefs, useChatComposer, useChatContext, useChatContextOptional, useChatLayout } from './chunk-JXBEKSNT.mjs';
10
10
  export { TreeError, TreeSkeleton, createDemoTree } from './chunk-B6IR5KSC.mjs';
11
11
  export { DEFAULT_TREE_APPEARANCE, DEFAULT_TREE_LABELS, TreeRoot as Tree, TreeChevron, TreeContent, TreeEmpty, TreeIcon, TreeIndentGuides, TreeLabel, TreeProvider, TreeRoot, TreeRow, TreeSearchInput, appearanceToStyle, clearTreeState, createChildCache, flattenTree, loadTreeState, resolveAppearance, resolveChildren, saveTreeState, useTreeActions, useTreeContext, useTreeExpansion, useTreeFocus, useTreeKeyboard, useTreeLabels, useTreeRows, useTreeSearch, useTreeSelection, useTreeTypeAhead } from './chunk-ZL7FH4NW.mjs';
12
12
  import { PlaygroundProvider } from './chunk-Y6UTOBF6.mjs';
@@ -348,7 +348,7 @@ var LazyTree = createLazyComponent(
348
348
  }
349
349
  );
350
350
  var LazyChat = createLazyComponent(
351
- () => import('./ChatRoot-RIETBE55.mjs').then((m) => ({ default: m.ChatRoot })),
351
+ () => import('./ChatRoot-T7D7QRCH.mjs').then((m) => ({ default: m.ChatRoot })),
352
352
  {
353
353
  displayName: "LazyChat",
354
354
  fallback: /* @__PURE__ */ jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
@@ -793,6 +793,42 @@ function useChatLightbox() {
793
793
  return { state, open, close };
794
794
  }
795
795
  __name(useChatLightbox, "useChatLightbox");
796
+ function useAutoFocusOnStreamEnd(options = {}) {
797
+ const { isStreaming: isStreamingProp, targetRef, enabled = true, delayMs = 0 } = options;
798
+ const ctx = useChatContextOptional();
799
+ const isStreaming = isStreamingProp ?? ctx?.isStreaming ?? false;
800
+ const composerHandleRef = useRef(null);
801
+ composerHandleRef.current = ctx?.composer ?? null;
802
+ const prevStreamingRef = useRef(isStreaming);
803
+ useEffect(() => {
804
+ const wasStreaming = prevStreamingRef.current;
805
+ prevStreamingRef.current = isStreaming;
806
+ if (!enabled) return;
807
+ if (!(wasStreaming && !isStreaming)) return;
808
+ const focusNow = /* @__PURE__ */ __name(() => {
809
+ const explicit = targetRef?.current;
810
+ const target = explicit ?? composerHandleRef.current;
811
+ target?.focus();
812
+ }, "focusNow");
813
+ if (delayMs > 0) {
814
+ const id = window.setTimeout(focusNow, delayMs);
815
+ return () => window.clearTimeout(id);
816
+ }
817
+ const raf = requestAnimationFrame(focusNow);
818
+ return () => cancelAnimationFrame(raf);
819
+ }, [isStreaming, enabled, delayMs, targetRef]);
820
+ }
821
+ __name(useAutoFocusOnStreamEnd, "useAutoFocusOnStreamEnd");
822
+ function useRegisterComposer(focus) {
823
+ const ctx = useChatContextOptional();
824
+ const register = ctx?.registerComposer;
825
+ useEffect(() => {
826
+ if (!register) return;
827
+ register({ focus });
828
+ return () => register(null);
829
+ }, [register, focus]);
830
+ }
831
+ __name(useRegisterComposer, "useRegisterComposer");
796
832
 
797
833
  // src/tools/Chat/core/payload-dispatch.ts
798
834
  function dispatchToolPayload(matchers, fallback) {
@@ -1893,6 +1929,6 @@ function MarkdownToolbar({ editor }) {
1893
1929
  }
1894
1930
  __name(MarkdownToolbar, "MarkdownToolbar");
1895
1931
 
1896
- export { AudioToggle, CardLoadingFallback, CronScheduler, DiffEditor, Editor, EditorProvider, LazyPlayer as LazyAudioPlayer, LazyChat, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, LazyVideoPlayer, LazyWrapper, LoadingFallback, LottiePlayer, MapLoadingFallback, MarkdownEditor, OpenapiViewer_default as OpenapiViewer, Spinner, TransportError, collectImageAttachments, createHttpTransport, createLazyComponent, createMockTransport, dispatchToolPayload, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isStringValue, mentionPresets, parseSSE, useChatHistory, useChatLightbox, useChatScroll, useEditor, useEditorContext, useLanguage, useMonaco };
1932
+ export { AudioToggle, CardLoadingFallback, CronScheduler, DiffEditor, Editor, EditorProvider, LazyPlayer as LazyAudioPlayer, LazyChat, LazyCronScheduler, LazyImageViewer, LazyJsonSchemaForm, LazyJsonTree, LazyLottiePlayer, LazyMapContainer, LazyMapView, LazyMermaid, LazyOpenapiViewer, LazyPrettyCode, LazyTree, LazyVideoPlayer, LazyWrapper, LoadingFallback, LottiePlayer, MapLoadingFallback, MarkdownEditor, OpenapiViewer_default as OpenapiViewer, Spinner, TransportError, collectImageAttachments, createHttpTransport, createLazyComponent, createMockTransport, dispatchToolPayload, isGeoJSONFeatureCollection, isLatLng, isPlainObject, isStringValue, mentionPresets, parseSSE, useAutoFocusOnStreamEnd, useChatHistory, useChatLightbox, useChatScroll, useEditor, useEditorContext, useLanguage, useMonaco, useRegisterComposer };
1897
1933
  //# sourceMappingURL=index.mjs.map
1898
1934
  //# sourceMappingURL=index.mjs.map