@admin-layout/tailwind-ui 12.2.4-alpha.4 → 12.2.4-alpha.42
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/lib/components/AIToolbar/components/AIToolBar.d.ts +22 -0
- package/lib/components/AIToolbar/components/AIToolBar.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/AIToolBar.js +83 -0
- package/lib/components/AIToolbar/components/AIToolBar.js.map +1 -0
- package/lib/components/AIToolbar/components/AIToolbarPrimitives.d.ts +14 -0
- package/lib/components/AIToolbar/components/AIToolbarPrimitives.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/AIToolbarPrimitives.js +60 -0
- package/lib/components/AIToolbar/components/AIToolbarPrimitives.js.map +1 -0
- package/lib/components/AIToolbar/components/CustomCursor.d.ts +2 -0
- package/lib/components/AIToolbar/components/CustomCursor.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/CustomCursor.js +66 -0
- package/lib/components/AIToolbar/components/CustomCursor.js.map +1 -0
- package/lib/components/AIToolbar/components/DragButton.d.ts +9 -0
- package/lib/components/AIToolbar/components/DragButton.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/DragButton.js +57 -0
- package/lib/components/AIToolbar/components/DragButton.js.map +1 -0
- package/lib/components/AIToolbar/components/Markdown/copy-button.d.ts +7 -0
- package/lib/components/AIToolbar/components/Markdown/copy-button.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/Markdown/copy-button.js +30 -0
- package/lib/components/AIToolbar/components/Markdown/copy-button.js.map +1 -0
- package/lib/components/AIToolbar/components/Markdown/index.d.ts +7 -0
- package/lib/components/AIToolbar/components/Markdown/index.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/Markdown/index.js +46 -0
- package/lib/components/AIToolbar/components/Markdown/index.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/AssistantMessageActions.d.ts +28 -0
- package/lib/components/AIToolbar/components/completion/AssistantMessageActions.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/AssistantMessageActions.js +209 -0
- package/lib/components/AIToolbar/components/completion/AssistantMessageActions.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/Audio.d.ts +3 -0
- package/lib/components/AIToolbar/components/completion/Audio.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/Audio.js +65 -0
- package/lib/components/AIToolbar/components/completion/Audio.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/AutoSpeechVad.d.ts +11 -0
- package/lib/components/AIToolbar/components/completion/AutoSpeechVad.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/AutoSpeechVad.js +66 -0
- package/lib/components/AIToolbar/components/completion/AutoSpeechVad.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/Files.d.ts +6 -0
- package/lib/components/AIToolbar/components/completion/Files.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/Files.js +134 -0
- package/lib/components/AIToolbar/components/completion/Files.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/Input.d.ts +5 -0
- package/lib/components/AIToolbar/components/completion/Input.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/Input.js +202 -0
- package/lib/components/AIToolbar/components/completion/Input.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/MessageHistory.d.ts +11 -0
- package/lib/components/AIToolbar/components/completion/MessageHistory.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/MessageHistory.js +90 -0
- package/lib/components/AIToolbar/components/completion/MessageHistory.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/Screenshot.d.ts +6 -0
- package/lib/components/AIToolbar/components/completion/Screenshot.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/Screenshot.js +28 -0
- package/lib/components/AIToolbar/components/completion/Screenshot.js.map +1 -0
- package/lib/components/AIToolbar/components/completion/index.d.ts +11 -0
- package/lib/components/AIToolbar/components/completion/index.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/completion/index.js +20 -0
- package/lib/components/AIToolbar/components/completion/index.js.map +1 -0
- package/lib/components/AIToolbar/components/index.d.ts +17 -0
- package/lib/components/AIToolbar/components/index.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/Header.d.ts +14 -0
- package/lib/components/AIToolbar/components/speech/Header.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/Header.js +82 -0
- package/lib/components/AIToolbar/components/speech/Header.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/ModeSwitcher.d.ts +8 -0
- package/lib/components/AIToolbar/components/speech/ModeSwitcher.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/ModeSwitcher.js +44 -0
- package/lib/components/AIToolbar/components/speech/ModeSwitcher.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.d.ts +13 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.js +168 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/QuickActions.d.ts +13 -0
- package/lib/components/AIToolbar/components/speech/QuickActions.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/QuickActions.js +100 -0
- package/lib/components/AIToolbar/components/speech/QuickActions.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/RecordingPanel.d.ts +14 -0
- package/lib/components/AIToolbar/components/speech/RecordingPanel.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/RecordingPanel.js +101 -0
- package/lib/components/AIToolbar/components/speech/RecordingPanel.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/ResultsSection.d.ts +12 -0
- package/lib/components/AIToolbar/components/speech/ResultsSection.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/ResultsSection.js +132 -0
- package/lib/components/AIToolbar/components/speech/ResultsSection.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/SettingsPanel.d.ts +12 -0
- package/lib/components/AIToolbar/components/speech/SettingsPanel.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/SettingsPanel.js +289 -0
- package/lib/components/AIToolbar/components/speech/SettingsPanel.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/StatusIndicator.d.ts +10 -0
- package/lib/components/AIToolbar/components/speech/StatusIndicator.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/StatusIndicator.js +48 -0
- package/lib/components/AIToolbar/components/speech/StatusIndicator.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/Warning.d.ts +6 -0
- package/lib/components/AIToolbar/components/speech/Warning.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/Warning.js +154 -0
- package/lib/components/AIToolbar/components/speech/Warning.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/audio-visualizer.d.ts +7 -0
- package/lib/components/AIToolbar/components/speech/audio-visualizer.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/audio-visualizer.js +194 -0
- package/lib/components/AIToolbar/components/speech/audio-visualizer.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/floatArrayToWav.d.ts +2 -0
- package/lib/components/AIToolbar/components/speech/floatArrayToWav.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/floatArrayToWav.js +32 -0
- package/lib/components/AIToolbar/components/speech/floatArrayToWav.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/index.d.ts +4 -0
- package/lib/components/AIToolbar/components/speech/index.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/index.js +292 -0
- package/lib/components/AIToolbar/components/speech/index.js.map +1 -0
- package/lib/components/AIToolbar/components/speech/promptTemplates.d.ts +12 -0
- package/lib/components/AIToolbar/components/speech/promptTemplates.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/promptTemplates.js +114 -0
- package/lib/components/AIToolbar/components/speech/promptTemplates.js.map +1 -0
- package/lib/components/AIToolbar/components/types.d.ts +182 -0
- package/lib/components/AIToolbar/components/types.d.ts.map +1 -0
- package/lib/components/AIToolbar/index.d.ts +5 -0
- package/lib/components/AIToolbar/index.d.ts.map +1 -0
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +7 -6
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/DatePicker/DatePicker.js +158 -140
- package/lib/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +20 -0
- package/lib/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/components/Dialog/Dialog.js +111 -0
- package/lib/components/Dialog/Dialog.js.map +1 -0
- package/lib/components/Dialog/index.d.ts +3 -0
- package/lib/components/Dialog/index.d.ts.map +1 -0
- package/lib/components/ErrorHandlers/ApplicationErrorHandler.d.ts +1 -2
- package/lib/components/ErrorHandlers/ApplicationErrorHandler.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/ApplicationErrorHandler.js +2 -2
- package/lib/components/ErrorHandlers/ErrorBoundary.d.ts +1 -2
- package/lib/components/ErrorHandlers/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/ErrorBoundary.js +35 -28
- package/lib/components/ErrorHandlers/ErrorBoundary.js.map +1 -1
- package/lib/components/ErrorHandlers/LayoutErrorBoundary.d.ts +1 -2
- package/lib/components/ErrorHandlers/LayoutErrorBoundary.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/LayoutErrorBoundary.js +20 -15
- package/lib/components/ErrorHandlers/LayoutErrorBoundary.js.map +1 -1
- package/lib/components/ErrorHandlers/RemixErrorBoundary.d.ts +4 -2
- package/lib/components/ErrorHandlers/RemixErrorBoundary.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/RemixErrorBoundary.js +222 -100
- package/lib/components/ErrorHandlers/RemixErrorBoundary.js.map +1 -1
- package/lib/components/ErrorHandlers/SPAErrorBoundary.d.ts +4 -2
- package/lib/components/ErrorHandlers/SPAErrorBoundary.d.ts.map +1 -1
- package/lib/components/ErrorHandlers/SPAErrorBoundary.js +247 -82
- package/lib/components/ErrorHandlers/SPAErrorBoundary.js.map +1 -1
- package/lib/components/ErrorPages/403.d.ts +1 -2
- package/lib/components/ErrorPages/403.d.ts.map +1 -1
- package/lib/components/ErrorPages/403.js +26 -18
- package/lib/components/ErrorPages/403.js.map +1 -1
- package/lib/components/ErrorPages/404.d.ts +1 -2
- package/lib/components/ErrorPages/404.d.ts.map +1 -1
- package/lib/components/ErrorPages/404.js +26 -18
- package/lib/components/ErrorPages/404.js.map +1 -1
- package/lib/components/ErrorPages/500.d.ts +1 -2
- package/lib/components/ErrorPages/500.d.ts.map +1 -1
- package/lib/components/ErrorPages/500.js +26 -18
- package/lib/components/ErrorPages/500.js.map +1 -1
- package/lib/components/InputToolBar/InputToolBar.d.ts +8 -0
- package/lib/components/InputToolBar/InputToolBar.d.ts.map +1 -0
- package/lib/components/InputToolBar/InputToolBar.js +469 -0
- package/lib/components/InputToolBar/InputToolBar.js.map +1 -0
- package/lib/components/InputToolBar/defaults.d.ts +15 -0
- package/lib/components/InputToolBar/defaults.d.ts.map +1 -0
- package/lib/components/InputToolBar/defaults.js +59 -0
- package/lib/components/InputToolBar/defaults.js.map +1 -0
- package/lib/components/InputToolBar/index.d.ts +5 -0
- package/lib/components/InputToolBar/index.d.ts.map +1 -0
- package/lib/components/InputToolBar/types.d.ts +153 -0
- package/lib/components/InputToolBar/types.d.ts.map +1 -0
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.d.ts +1 -2
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.d.ts.map +1 -1
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.js +24 -19
- package/lib/components/LanguageMenuDropdown/LanguageMenuDropdown.js.map +1 -1
- package/lib/components/Markdown/MarkdownBreadcrumbs.d.ts +13 -0
- package/lib/components/Markdown/MarkdownBreadcrumbs.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownBreadcrumbs.js +34 -0
- package/lib/components/Markdown/MarkdownBreadcrumbs.js.map +1 -0
- package/lib/components/Markdown/MarkdownCopyButton.d.ts +10 -0
- package/lib/components/Markdown/MarkdownCopyButton.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownCopyButton.js +229 -0
- package/lib/components/Markdown/MarkdownCopyButton.js.map +1 -0
- package/lib/components/Markdown/MarkdownHeader.d.ts +13 -0
- package/lib/components/Markdown/MarkdownHeader.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownHeader.js +44 -0
- package/lib/components/Markdown/MarkdownHeader.js.map +1 -0
- package/lib/components/Markdown/MarkdownNavigation.d.ts +15 -0
- package/lib/components/Markdown/MarkdownNavigation.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownNavigation.js +38 -0
- package/lib/components/Markdown/MarkdownNavigation.js.map +1 -0
- package/lib/components/Markdown/MarkdownPage.d.ts +41 -0
- package/lib/components/Markdown/MarkdownPage.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownPage.js +238 -0
- package/lib/components/Markdown/MarkdownPage.js.map +1 -0
- package/lib/components/Markdown/MarkdownTableOfContents.d.ts +15 -0
- package/lib/components/Markdown/MarkdownTableOfContents.d.ts.map +1 -0
- package/lib/components/Markdown/MarkdownTableOfContents.js +57 -0
- package/lib/components/Markdown/MarkdownTableOfContents.js.map +1 -0
- package/lib/components/Markdown/index.d.ts +7 -0
- package/lib/components/Markdown/index.d.ts.map +1 -0
- package/lib/components/OTP/OTPInput.js +32 -30
- package/lib/components/OTP/OTPInput.js.map +1 -1
- package/lib/components/OTP/OTPVerification.js +75 -55
- package/lib/components/OTP/OTPVerification.js.map +1 -1
- package/lib/components/OTP/SingleInput.js +2 -2
- package/lib/components/OTP/SingleInput.js.map +1 -1
- package/lib/components/PageContainer/PageContainer.js +29 -22
- package/lib/components/PageContainer/PageContainer.js.map +1 -1
- package/lib/components/PageLoading/index.js +8 -7
- package/lib/components/PageLoading/index.js.map +1 -1
- package/lib/components/RJSFPreview/PreviewAsyncDropdown.d.ts +1 -2
- package/lib/components/RJSFPreview/PreviewAsyncDropdown.d.ts.map +1 -1
- package/lib/components/ReactTable/Table.d.ts +1 -2
- package/lib/components/ReactTable/Table.d.ts.map +1 -1
- package/lib/components/ReactTable/Table.js +92 -71
- package/lib/components/ReactTable/Table.js.map +1 -1
- package/lib/components/ReactTable/TableFilters.d.ts +2 -3
- package/lib/components/ReactTable/TableFilters.d.ts.map +1 -1
- package/lib/components/ReactTable/TableFilters.js +40 -34
- package/lib/components/ReactTable/TableFilters.js.map +1 -1
- package/lib/components/Search/SearchInput.d.ts +1 -2
- package/lib/components/Search/SearchInput.d.ts.map +1 -1
- package/lib/components/Search/SearchInput.js +14 -13
- package/lib/components/Search/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.d.ts +6 -6
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +60 -45
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Spin/index.js +14 -11
- package/lib/components/Spin/index.js.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.js +29 -17
- package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/lib/components/ThemeProvider/ThemeToggle.js +28 -25
- package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -1
- package/lib/components/ThemeProvider/types.d.ts +3 -3
- package/lib/components/ThemeProvider/types.d.ts.map +1 -1
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/hooks/useToast.d.ts +1 -1
- package/lib/hooks/useToast.d.ts.map +1 -1
- package/lib/hooks/useToast.js +46 -37
- package/lib/hooks/useToast.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/shardui/accordion.js +20 -16
- package/lib/shardui/accordion.js.map +1 -1
- package/lib/shardui/alert-dialog.d.ts +2 -2
- package/lib/shardui/alert-dialog.js +15 -13
- package/lib/shardui/alert-dialog.js.map +1 -1
- package/lib/shardui/alert.js +4 -4
- package/lib/shardui/alert.js.map +1 -1
- package/lib/shardui/avatar.js +4 -4
- package/lib/shardui/avatar.js.map +1 -1
- package/lib/shardui/badge.d.ts +1 -1
- package/lib/shardui/badge.d.ts.map +1 -1
- package/lib/shardui/badge.js +2 -2
- package/lib/shardui/badge.js.map +1 -1
- package/lib/shardui/breadcrumb.d.ts +2 -2
- package/lib/shardui/breadcrumb.js +19 -16
- package/lib/shardui/breadcrumb.js.map +1 -1
- package/lib/shardui/button.js +2 -2
- package/lib/shardui/button.js.map +1 -1
- package/lib/shardui/calendar.d.ts +1 -1
- package/lib/shardui/calendar.d.ts.map +1 -1
- package/lib/shardui/calendar.js +4 -4
- package/lib/shardui/card.js +7 -7
- package/lib/shardui/card.js.map +1 -1
- package/lib/shardui/carousel.js +40 -33
- package/lib/shardui/carousel.js.map +1 -1
- package/lib/shardui/chart.d.ts +1 -1
- package/lib/shardui/chart.d.ts.map +1 -1
- package/lib/shardui/chart.js +81 -66
- package/lib/shardui/chart.js.map +1 -1
- package/lib/shardui/checkbox.js +10 -8
- package/lib/shardui/checkbox.js.map +1 -1
- package/lib/shardui/command.d.ts +2 -2
- package/lib/shardui/command.d.ts.map +1 -1
- package/lib/shardui/command.js +28 -24
- package/lib/shardui/command.js.map +1 -1
- package/lib/shardui/context-menu.d.ts +1 -1
- package/lib/shardui/context-menu.js +41 -30
- package/lib/shardui/context-menu.js.map +1 -1
- package/lib/shardui/dialog.d.ts +2 -2
- package/lib/shardui/dialog.js +22 -17
- package/lib/shardui/dialog.js.map +1 -1
- package/lib/shardui/drawer.d.ts +3 -3
- package/lib/shardui/drawer.js +17 -14
- package/lib/shardui/drawer.js.map +1 -1
- package/lib/shardui/dropdown-menu.d.ts +1 -1
- package/lib/shardui/dropdown-menu.js +42 -31
- package/lib/shardui/dropdown-menu.js.map +1 -1
- package/lib/shardui/form.d.ts +1 -1
- package/lib/shardui/form.d.ts.map +1 -1
- package/lib/shardui/form.js +22 -19
- package/lib/shardui/form.js.map +1 -1
- package/lib/shardui/hover-card.js +2 -2
- package/lib/shardui/hover-card.js.map +1 -1
- package/lib/shardui/input-otp.js +16 -13
- package/lib/shardui/input-otp.js.map +1 -1
- package/lib/shardui/input.js +2 -2
- package/lib/shardui/input.js.map +1 -1
- package/lib/shardui/label.js +2 -2
- package/lib/shardui/label.js.map +1 -1
- package/lib/shardui/menubar.d.ts +1 -1
- package/lib/shardui/menubar.js +46 -35
- package/lib/shardui/menubar.js.map +1 -1
- package/lib/shardui/navigation-menu.js +28 -24
- package/lib/shardui/navigation-menu.js.map +1 -1
- package/lib/shardui/pagination.d.ts +5 -5
- package/lib/shardui/pagination.js +30 -22
- package/lib/shardui/pagination.js.map +1 -1
- package/lib/shardui/popover.js +10 -8
- package/lib/shardui/popover.js.map +1 -1
- package/lib/shardui/progress.js +10 -9
- package/lib/shardui/progress.js.map +1 -1
- package/lib/shardui/radio-group.js +11 -9
- package/lib/shardui/radio-group.js.map +1 -1
- package/lib/shardui/resizable.d.ts +3 -3
- package/lib/shardui/resizable.d.ts.map +1 -1
- package/lib/shardui/resizable.js +11 -9
- package/lib/shardui/resizable.js.map +1 -1
- package/lib/shardui/scroll-area.js +14 -11
- package/lib/shardui/scroll-area.js.map +1 -1
- package/lib/shardui/select.js +49 -35
- package/lib/shardui/select.js.map +1 -1
- package/lib/shardui/separator.js +2 -2
- package/lib/shardui/separator.js.map +1 -1
- package/lib/shardui/sheet.d.ts +2 -2
- package/lib/shardui/sheet.js +24 -19
- package/lib/shardui/sheet.js.map +1 -1
- package/lib/shardui/sidebar.js +104 -88
- package/lib/shardui/sidebar.js.map +1 -1
- package/lib/shardui/skeleton.d.ts +1 -1
- package/lib/shardui/skeleton.d.ts.map +1 -1
- package/lib/shardui/skeleton.js +2 -2
- package/lib/shardui/skeleton.js.map +1 -1
- package/lib/shardui/slider.js +12 -10
- package/lib/shardui/slider.js.map +1 -1
- package/lib/shardui/sonner.d.ts +1 -1
- package/lib/shardui/sonner.d.ts.map +1 -1
- package/lib/shardui/sonner.js +2 -2
- package/lib/shardui/sonner.js.map +1 -1
- package/lib/shardui/switch.js +7 -6
- package/lib/shardui/switch.js.map +1 -1
- package/lib/shardui/table.js +16 -15
- package/lib/shardui/table.js.map +1 -1
- package/lib/shardui/tabs.js +4 -4
- package/lib/shardui/tabs.js.map +1 -1
- package/lib/shardui/textarea.js +2 -2
- package/lib/shardui/textarea.js.map +1 -1
- package/lib/shardui/toast.js +12 -11
- package/lib/shardui/toast.js.map +1 -1
- package/lib/shardui/toaster.d.ts +1 -2
- package/lib/shardui/toaster.d.ts.map +1 -1
- package/lib/shardui/toaster.js +21 -14
- package/lib/shardui/toaster.js.map +1 -1
- package/lib/shardui/toggle-group.js +15 -12
- package/lib/shardui/toggle-group.js.map +1 -1
- package/lib/shardui/toggle.js +2 -2
- package/lib/shardui/toggle.js.map +1 -1
- package/lib/shardui/tooltip.js +2 -2
- package/lib/shardui/tooltip.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {useRef,useEffect}from'react';// Configuration constants for the audio analyzer
|
|
2
|
+
const AUDIO_CONFIG = {
|
|
3
|
+
FFT_SIZE: 512,
|
|
4
|
+
SMOOTHING: 0.8,
|
|
5
|
+
MIN_BAR_HEIGHT: 2,
|
|
6
|
+
MIN_BAR_WIDTH: 2,
|
|
7
|
+
BAR_SPACING: 4,
|
|
8
|
+
COLOR: {
|
|
9
|
+
MIN_INTENSITY: 100,
|
|
10
|
+
// Minimum gray value (darker)
|
|
11
|
+
MAX_INTENSITY: 255,
|
|
12
|
+
// Maximum gray value (brighter)
|
|
13
|
+
INTENSITY_RANGE: 155 // MAX_INTENSITY - MIN_INTENSITY
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function AudioVisualizer({
|
|
17
|
+
stream,
|
|
18
|
+
isRecording
|
|
19
|
+
}) {
|
|
20
|
+
// Refs for managing audio context and animation
|
|
21
|
+
const canvasRef = useRef(null);
|
|
22
|
+
const audioContextRef = useRef(null);
|
|
23
|
+
const analyserRef = useRef(null);
|
|
24
|
+
const animationFrameRef = useRef(0);
|
|
25
|
+
const containerRef = useRef(null);
|
|
26
|
+
const oscillatorsRef = useRef([]);
|
|
27
|
+
const gainNodesRef = useRef([]);
|
|
28
|
+
// Cleanup function to stop visualization and close audio context
|
|
29
|
+
const cleanup = () => {
|
|
30
|
+
if (animationFrameRef.current) {
|
|
31
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
32
|
+
}
|
|
33
|
+
// Stop all oscillators
|
|
34
|
+
oscillatorsRef.current.forEach(osc => {
|
|
35
|
+
try {
|
|
36
|
+
osc.stop();
|
|
37
|
+
} catch {
|
|
38
|
+
// Oscillator may already be stopped
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
oscillatorsRef.current = [];
|
|
42
|
+
gainNodesRef.current = [];
|
|
43
|
+
if (audioContextRef.current) {
|
|
44
|
+
audioContextRef.current.close();
|
|
45
|
+
audioContextRef.current = null;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Cleanup on unmount
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
return cleanup;
|
|
51
|
+
}, []);
|
|
52
|
+
// Start or stop visualization based on recording state
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (isRecording) {
|
|
55
|
+
startVisualization();
|
|
56
|
+
} else {
|
|
57
|
+
cleanup();
|
|
58
|
+
}
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
+
}, [stream, isRecording]);
|
|
61
|
+
// Handle window resize
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const handleResize = () => {
|
|
64
|
+
if (canvasRef.current && containerRef.current) {
|
|
65
|
+
const container = containerRef.current;
|
|
66
|
+
const canvas = canvasRef.current;
|
|
67
|
+
const dpr = window.devicePixelRatio || 1;
|
|
68
|
+
// Set canvas size based on container and device pixel ratio
|
|
69
|
+
const rect = container.getBoundingClientRect();
|
|
70
|
+
// Account for the 2px total margin (1px on each side)
|
|
71
|
+
canvas.width = (rect.width - 2) * dpr;
|
|
72
|
+
canvas.height = (rect.height - 2) * dpr;
|
|
73
|
+
// Scale canvas CSS size to match container minus margins
|
|
74
|
+
canvas.style.width = `${rect.width - 2}px`;
|
|
75
|
+
canvas.style.height = `${rect.height - 2}px`;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
window.addEventListener('resize', handleResize);
|
|
79
|
+
// Initial setup
|
|
80
|
+
handleResize();
|
|
81
|
+
return () => window.removeEventListener('resize', handleResize);
|
|
82
|
+
}, []);
|
|
83
|
+
// Create a fake audio stream using oscillators that mimic speech patterns
|
|
84
|
+
const createFakeStream = (audioContext, analyser) => {
|
|
85
|
+
// Create multiple oscillators with different frequencies to simulate speech
|
|
86
|
+
const frequencies = [120, 240, 350, 500, 800, 1200, 2000, 3500];
|
|
87
|
+
const oscillators = [];
|
|
88
|
+
const gainNodes = [];
|
|
89
|
+
frequencies.forEach((freq, index) => {
|
|
90
|
+
const oscillator = audioContext.createOscillator();
|
|
91
|
+
const gainNode = audioContext.createGain();
|
|
92
|
+
// Use different wave types for variety
|
|
93
|
+
oscillator.type = index % 2 === 0 ? 'sine' : 'triangle';
|
|
94
|
+
oscillator.frequency.setValueAtTime(freq, audioContext.currentTime);
|
|
95
|
+
// Set initial gain (very low to simulate quiet speech)
|
|
96
|
+
gainNode.gain.setValueAtTime(0.01, audioContext.currentTime);
|
|
97
|
+
oscillator.connect(gainNode);
|
|
98
|
+
gainNode.connect(analyser);
|
|
99
|
+
oscillator.start();
|
|
100
|
+
oscillators.push(oscillator);
|
|
101
|
+
gainNodes.push(gainNode);
|
|
102
|
+
});
|
|
103
|
+
oscillatorsRef.current = oscillators;
|
|
104
|
+
gainNodesRef.current = gainNodes;
|
|
105
|
+
// Animate the gain to simulate speech patterns
|
|
106
|
+
const animateGain = () => {
|
|
107
|
+
if (!isRecording || !audioContextRef.current) return;
|
|
108
|
+
gainNodes.forEach((gainNode, index) => {
|
|
109
|
+
// Create random fluctuations to simulate speech
|
|
110
|
+
const baseGain = 0.02 + Math.random() * 0.08;
|
|
111
|
+
const speechPattern = Math.sin(Date.now() / (200 + index * 50)) * 0.5 + 0.5;
|
|
112
|
+
const randomBurst = Math.random() > 0.7 ? Math.random() * 0.1 : 0;
|
|
113
|
+
const targetGain = baseGain * speechPattern + randomBurst;
|
|
114
|
+
gainNode.gain.linearRampToValueAtTime(targetGain, audioContextRef.current.currentTime + 0.05);
|
|
115
|
+
});
|
|
116
|
+
setTimeout(animateGain, 100);
|
|
117
|
+
};
|
|
118
|
+
animateGain();
|
|
119
|
+
};
|
|
120
|
+
// Initialize audio context and start visualization
|
|
121
|
+
const startVisualization = async () => {
|
|
122
|
+
try {
|
|
123
|
+
const audioContext = new AudioContext();
|
|
124
|
+
audioContextRef.current = audioContext;
|
|
125
|
+
const analyser = audioContext.createAnalyser();
|
|
126
|
+
analyser.fftSize = AUDIO_CONFIG.FFT_SIZE;
|
|
127
|
+
analyser.smoothingTimeConstant = AUDIO_CONFIG.SMOOTHING;
|
|
128
|
+
analyserRef.current = analyser;
|
|
129
|
+
if (stream) {
|
|
130
|
+
// Use real stream if available
|
|
131
|
+
const source = audioContext.createMediaStreamSource(stream);
|
|
132
|
+
source.connect(analyser);
|
|
133
|
+
} else {
|
|
134
|
+
// Create fake stream for visualization
|
|
135
|
+
createFakeStream(audioContext, analyser);
|
|
136
|
+
}
|
|
137
|
+
draw();
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error('Error starting visualization:', error);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
// Calculate the color intensity based on bar height
|
|
143
|
+
const getBarColor = normalizedHeight => {
|
|
144
|
+
const intensity = Math.floor(normalizedHeight * AUDIO_CONFIG.COLOR.INTENSITY_RANGE) + AUDIO_CONFIG.COLOR.MIN_INTENSITY;
|
|
145
|
+
return `rgb(${intensity}, ${intensity}, ${intensity})`;
|
|
146
|
+
};
|
|
147
|
+
// Draw a single bar of the visualizer
|
|
148
|
+
const drawBar = (ctx, x, centerY, width, height, color) => {
|
|
149
|
+
ctx.fillStyle = color;
|
|
150
|
+
// Draw upper bar (above center)
|
|
151
|
+
ctx.fillRect(x, centerY - height, width, height);
|
|
152
|
+
// Draw lower bar (below center)
|
|
153
|
+
ctx.fillRect(x, centerY, width, height);
|
|
154
|
+
};
|
|
155
|
+
// Main drawing function
|
|
156
|
+
const draw = () => {
|
|
157
|
+
if (!isRecording) return;
|
|
158
|
+
const canvas = canvasRef.current;
|
|
159
|
+
const ctx = canvas?.getContext('2d');
|
|
160
|
+
if (!canvas || !ctx || !analyserRef.current) return;
|
|
161
|
+
const dpr = window.devicePixelRatio || 1;
|
|
162
|
+
ctx.scale(dpr, dpr);
|
|
163
|
+
const analyser = analyserRef.current;
|
|
164
|
+
const bufferLength = analyser.frequencyBinCount;
|
|
165
|
+
const frequencyData = new Uint8Array(bufferLength);
|
|
166
|
+
const drawFrame = () => {
|
|
167
|
+
animationFrameRef.current = requestAnimationFrame(drawFrame);
|
|
168
|
+
// Get current frequency data
|
|
169
|
+
analyser.getByteFrequencyData(frequencyData);
|
|
170
|
+
// Clear canvas - use CSS pixels for clearing
|
|
171
|
+
ctx.clearRect(0, 0, canvas.width / dpr, canvas.height / dpr);
|
|
172
|
+
// Calculate dimensions in CSS pixels
|
|
173
|
+
const barWidth = Math.max(AUDIO_CONFIG.MIN_BAR_WIDTH, canvas.width / dpr / bufferLength - AUDIO_CONFIG.BAR_SPACING);
|
|
174
|
+
const centerY = canvas.height / dpr / 2;
|
|
175
|
+
let x = 0;
|
|
176
|
+
// Draw each frequency bar
|
|
177
|
+
for (let i = 0; i < bufferLength; i++) {
|
|
178
|
+
const normalizedHeight = frequencyData[i] / 255; // Convert to 0-1 range
|
|
179
|
+
const barHeight = Math.max(AUDIO_CONFIG.MIN_BAR_HEIGHT, normalizedHeight * centerY);
|
|
180
|
+
drawBar(ctx, x, centerY, barWidth, barHeight, getBarColor(normalizedHeight));
|
|
181
|
+
x += barWidth + AUDIO_CONFIG.BAR_SPACING;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
drawFrame();
|
|
185
|
+
};
|
|
186
|
+
return jsx("div", {
|
|
187
|
+
ref: containerRef,
|
|
188
|
+
className: "!h-[32px] !w-full pl-4 pt-2",
|
|
189
|
+
children: jsx("canvas", {
|
|
190
|
+
ref: canvasRef,
|
|
191
|
+
className: "h-full !w-full"
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}export{AudioVisualizer};//# sourceMappingURL=audio-visualizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-visualizer.js","sources":["../../../../../src/components/AIToolbar/components/speech/audio-visualizer.tsx"],"sourcesContent":[null],"names":[],"mappings":"yEAkBI;AACH,MAAA,YAAA,GAAA;AAED,EAAA,QAAA,EAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floatArrayToWav.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/floatArrayToWav.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GACxB,WAAW,YAAY,EACvB,aAAY,MAAc,EAC1B,SAAQ,KAAK,GAAG,KAAK,GAAG,KAAa,KACtC,IAiCF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const floatArrayToWav = (audioData, sampleRate = 16000, format = 'wav') => {
|
|
2
|
+
const buffer = new ArrayBuffer(44 + audioData.length * 2);
|
|
3
|
+
const view = new DataView(buffer);
|
|
4
|
+
const writeString = (offset, string) => {
|
|
5
|
+
for (let i = 0; i < string.length; i++) {
|
|
6
|
+
view.setUint8(offset + i, string.charCodeAt(i));
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
writeString(0, 'RIFF');
|
|
10
|
+
const dataSize = format === 'wav' ? 36 + audioData.length * 2 : 44 + audioData.length * 2;
|
|
11
|
+
view.setUint32(4, dataSize, true);
|
|
12
|
+
writeString(8, format === 'wav' ? 'WAVE' : 'FORM');
|
|
13
|
+
writeString(12, 'fmt ');
|
|
14
|
+
view.setUint32(16, 16, true);
|
|
15
|
+
view.setUint16(20, 1, true);
|
|
16
|
+
view.setUint16(22, 1, true);
|
|
17
|
+
view.setUint32(24, sampleRate, true);
|
|
18
|
+
view.setUint32(28, sampleRate * 2, true);
|
|
19
|
+
view.setUint16(32, 2, true);
|
|
20
|
+
view.setUint16(34, 16, true);
|
|
21
|
+
writeString(36, 'data');
|
|
22
|
+
view.setUint32(40, audioData.length * 2, true);
|
|
23
|
+
let offset = 44;
|
|
24
|
+
for (let i = 0; i < audioData.length; i++) {
|
|
25
|
+
const sample = Math.max(-1, Math.min(1, audioData[i]));
|
|
26
|
+
view.setInt16(offset, sample < 0 ? sample * 0x8000 : sample * 0x7fff, true);
|
|
27
|
+
offset += 2;
|
|
28
|
+
}
|
|
29
|
+
return new Blob([buffer], {
|
|
30
|
+
type: `audio/${format}`
|
|
31
|
+
});
|
|
32
|
+
};export{floatArrayToWav};//# sourceMappingURL=floatArrayToWav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floatArrayToWav.js","sources":["../../../../../src/components/AIToolbar/components/speech/floatArrayToWav.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAA,eAAa,GAAA,CAAA,SACT,EAAA,UAAW,GAAA,KAAA,QACX,GAAA,KAAY,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGzE,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAEpD,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAyVlD,CAAC"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useEffect,useCallback}from'react';import'../../../../shardui/accordion.js';import'../../../../shardui/alert.js';import'../../../../shardui/alert-dialog.js';import'@radix-ui/react-aspect-ratio';import'../../../../shardui/avatar.js';import'../../../../shardui/badge.js';import'../../../../shardui/breadcrumb.js';import {Button}from'../../../../shardui/button.js';import'../../../../shardui/calendar.js';import'../../../../shardui/card.js';import'../../../../shardui/carousel.js';import'../../../../shardui/chart.js';import'../../../../shardui/checkbox.js';import'@radix-ui/react-collapsible';import'../../../../shardui/command.js';import'../../../../shardui/context-menu.js';import'../../../../shardui/dialog.js';import'../../../../shardui/drawer.js';import'../../../../shardui/dropdown-menu.js';import'../../../../shardui/form.js';import'../../../../shardui/hover-card.js';import'../../../../shardui/input.js';import'../../../../shardui/input-otp.js';import'../../../../shardui/label.js';import'../../../../shardui/menubar.js';import'../../../../shardui/navigation-menu.js';import'../../../../shardui/pagination.js';import {Popover,PopoverTrigger,PopoverContent}from'../../../../shardui/popover.js';import'../../../../shardui/progress.js';import'../../../../shardui/radio-group.js';import {LoaderIcon,CameraIcon,PlusIcon,XIcon,AlertCircleIcon,AudioLinesIcon,HeadphonesIcon}from'lucide-react';import'react-resizable-panels';import'../../../../utils/isBrowser/index.js';import {cn}from'../../../../utils/util.js';import'fast-deep-equal/react.js';import {ScrollArea}from'../../../../shardui/scroll-area.js';import'../../../../shardui/select.js';import'../../../../shardui/separator.js';import'../../../../shardui/sheet.js';import'../../../../shardui/sidebar.js';import'../../../../shardui/slider.js';import'../../../ThemeProvider/ThemeProvider.js';import'sonner';import'../../../../shardui/switch.js';import'../../../../shardui/table.js';import'../../../../shardui/tabs.js';import'../../../../shardui/textarea.js';import'../../../../shardui/toast.js';import'../../../../shardui/toggle.js';import'../../../../shardui/toggle-group.js';import'../../../../shardui/tooltip.js';import {ModeSwitcher}from'./ModeSwitcher.js';import {RecordingPanel}from'./RecordingPanel.js';import {ResultsSection}from'./ResultsSection.js';import {SettingsPanel}from'./SettingsPanel.js';import {PermissionFlow}from'./PermissionFlow.js';import {QuickActions}from'./QuickActions.js';import {Warning}from'./Warning.js';const SystemAudio = props => {
|
|
2
|
+
const {
|
|
3
|
+
hasActiveLicense = true,
|
|
4
|
+
supportsImages = true,
|
|
5
|
+
checkSystemAudioAccess,
|
|
6
|
+
requestSystemAudioAccess,
|
|
7
|
+
captureSystemScreenshot,
|
|
8
|
+
capturing,
|
|
9
|
+
isProcessing,
|
|
10
|
+
isAIProcessing,
|
|
11
|
+
lastTranscription,
|
|
12
|
+
lastAIResponse,
|
|
13
|
+
error,
|
|
14
|
+
setupRequired,
|
|
15
|
+
startCapture,
|
|
16
|
+
stopCapture,
|
|
17
|
+
isPopoverOpen,
|
|
18
|
+
setIsPopoverOpen,
|
|
19
|
+
useSystemPrompt,
|
|
20
|
+
setUseSystemPrompt,
|
|
21
|
+
contextContent,
|
|
22
|
+
setContextContent,
|
|
23
|
+
startNewConversation,
|
|
24
|
+
conversation,
|
|
25
|
+
resizeWindow,
|
|
26
|
+
quickActions,
|
|
27
|
+
addQuickAction,
|
|
28
|
+
removeQuickAction,
|
|
29
|
+
isManagingQuickActions,
|
|
30
|
+
setIsManagingQuickActions,
|
|
31
|
+
showQuickActions,
|
|
32
|
+
setShowQuickActions,
|
|
33
|
+
handleQuickActionClick,
|
|
34
|
+
vadConfig,
|
|
35
|
+
updateVadConfiguration,
|
|
36
|
+
isRecordingInContinuousMode,
|
|
37
|
+
recordingProgress,
|
|
38
|
+
manualStopAndSend,
|
|
39
|
+
startContinuousRecording,
|
|
40
|
+
ignoreContinuousRecording,
|
|
41
|
+
scrollAreaRef
|
|
42
|
+
} = props;
|
|
43
|
+
// View mode toggle
|
|
44
|
+
const [conversationMode, setConversationMode] = useState(false);
|
|
45
|
+
// Screenshot state
|
|
46
|
+
const [screenshotImage, setScreenshotImage] = useState(null);
|
|
47
|
+
const [isCapturingScreenshot, setIsCapturingScreenshot] = useState(false);
|
|
48
|
+
const isVadMode = vadConfig.enabled;
|
|
49
|
+
const hasResponse = lastAIResponse || isAIProcessing;
|
|
50
|
+
// Keyboard shortcut for Cmd+K to toggle view mode
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const handleKeyDown = e => {
|
|
53
|
+
if (!isPopoverOpen) return;
|
|
54
|
+
// Cmd+K or Ctrl+K to toggle view mode
|
|
55
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
setConversationMode(prev => !prev);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
61
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
62
|
+
}, [isPopoverOpen]);
|
|
63
|
+
// Reset screenshot when processing starts (message is being sent)
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (isProcessing && screenshotImage) {
|
|
66
|
+
setScreenshotImage(null);
|
|
67
|
+
}
|
|
68
|
+
}, [isProcessing, screenshotImage]);
|
|
69
|
+
const handleToggleCapture = async () => {
|
|
70
|
+
if (capturing) {
|
|
71
|
+
await stopCapture();
|
|
72
|
+
} else {
|
|
73
|
+
await startCapture();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const handleModeChange = vadEnabled => {
|
|
77
|
+
updateVadConfiguration({
|
|
78
|
+
...vadConfig,
|
|
79
|
+
enabled: vadEnabled
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
// Capture screenshot functionality
|
|
83
|
+
const handleCaptureScreenshot = useCallback(async () => {
|
|
84
|
+
if (!captureSystemScreenshot || isCapturingScreenshot) return;
|
|
85
|
+
setIsCapturingScreenshot(true);
|
|
86
|
+
try {
|
|
87
|
+
const base64 = await captureSystemScreenshot();
|
|
88
|
+
if (base64) {
|
|
89
|
+
setScreenshotImage(base64);
|
|
90
|
+
}
|
|
91
|
+
} catch (err) {
|
|
92
|
+
console.error('Failed to capture screenshot:', err);
|
|
93
|
+
} finally {
|
|
94
|
+
setIsCapturingScreenshot(false);
|
|
95
|
+
}
|
|
96
|
+
}, [captureSystemScreenshot, isCapturingScreenshot]);
|
|
97
|
+
const handleRemoveScreenshot = useCallback(() => {
|
|
98
|
+
setScreenshotImage(null);
|
|
99
|
+
}, []);
|
|
100
|
+
const getButtonIcon = () => {
|
|
101
|
+
if (setupRequired) return jsx(AlertCircleIcon, {
|
|
102
|
+
className: "text-orange-500"
|
|
103
|
+
});
|
|
104
|
+
if (error && !setupRequired) return jsx(AlertCircleIcon, {
|
|
105
|
+
className: "text-red-500"
|
|
106
|
+
});
|
|
107
|
+
if (isProcessing) return jsx(LoaderIcon, {
|
|
108
|
+
className: "animate-spin"
|
|
109
|
+
});
|
|
110
|
+
if (capturing) return jsx(AudioLinesIcon, {
|
|
111
|
+
className: "text-green-500 animate-pulse"
|
|
112
|
+
});
|
|
113
|
+
return jsx(HeadphonesIcon, {});
|
|
114
|
+
};
|
|
115
|
+
const getButtonTitle = () => {
|
|
116
|
+
if (setupRequired) return 'Setup required - Click for instructions';
|
|
117
|
+
if (error && !setupRequired) return `Error: ${error}`;
|
|
118
|
+
if (isProcessing) return 'Transcribing audio...';
|
|
119
|
+
if (capturing) return 'Stop system audio capture';
|
|
120
|
+
return 'Start system audio capture';
|
|
121
|
+
};
|
|
122
|
+
return jsxs(Popover, {
|
|
123
|
+
open: isPopoverOpen,
|
|
124
|
+
onOpenChange: open => {
|
|
125
|
+
if (capturing && !open) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
setIsPopoverOpen(open);
|
|
129
|
+
},
|
|
130
|
+
children: [jsx(PopoverTrigger, {
|
|
131
|
+
asChild: true,
|
|
132
|
+
children: jsx(Button, {
|
|
133
|
+
size: "icon",
|
|
134
|
+
title: getButtonTitle(),
|
|
135
|
+
onClick: handleToggleCapture,
|
|
136
|
+
className: cn(capturing && 'bg-green-50 hover:bg-green-100', error && 'bg-red-100 hover:bg-red-200'),
|
|
137
|
+
children: getButtonIcon()
|
|
138
|
+
})
|
|
139
|
+
}), (capturing || setupRequired || error) && jsx(PopoverContent, {
|
|
140
|
+
align: "end",
|
|
141
|
+
side: "bottom",
|
|
142
|
+
className: "z-[200] select-none w-screen max-h-[min(92vh,calc(100vh-1rem))] p-0 border shadow-lg overflow-hidden border-input/50",
|
|
143
|
+
sideOffset: 8,
|
|
144
|
+
children: jsxs("div", {
|
|
145
|
+
className: "flex flex-col h-[calc(100vh-4rem)] overflow-hidden",
|
|
146
|
+
children: [jsx("div", {
|
|
147
|
+
className: "flex-shrink-0 p-3 border-b border-border/50",
|
|
148
|
+
children: jsxs("div", {
|
|
149
|
+
className: "flex items-center justify-between gap-2",
|
|
150
|
+
children: [!setupRequired && jsx(ModeSwitcher, {
|
|
151
|
+
isVadMode: isVadMode,
|
|
152
|
+
onModeChange: handleModeChange,
|
|
153
|
+
disabled: isRecordingInContinuousMode || isProcessing || isAIProcessing
|
|
154
|
+
}), setupRequired && jsx("h2", {
|
|
155
|
+
className: "font-semibold text-sm",
|
|
156
|
+
children: "Setup Required"
|
|
157
|
+
}), jsxs("div", {
|
|
158
|
+
className: "flex items-center gap-1.5 flex-shrink-0",
|
|
159
|
+
children: [hasActiveLicense && !setupRequired && supportsImages && captureSystemScreenshot && jsxs(Button, {
|
|
160
|
+
size: "sm",
|
|
161
|
+
variant: screenshotImage ? 'default' : 'outline',
|
|
162
|
+
onClick: handleCaptureScreenshot,
|
|
163
|
+
disabled: isCapturingScreenshot,
|
|
164
|
+
className: cn('h-6 text-[10px] gap-1 px-2', screenshotImage && 'bg-primary text-primary-foreground'),
|
|
165
|
+
title: "Capture screenshot to include with transcription",
|
|
166
|
+
children: [isCapturingScreenshot ? jsx(LoaderIcon, {
|
|
167
|
+
className: "w-3 h-3 animate-spin"
|
|
168
|
+
}) : jsx(CameraIcon, {
|
|
169
|
+
className: "w-3 h-3"
|
|
170
|
+
}), "Screenshot"]
|
|
171
|
+
}), !setupRequired && jsxs(Button, {
|
|
172
|
+
size: "sm",
|
|
173
|
+
variant: "ghost",
|
|
174
|
+
onClick: startNewConversation,
|
|
175
|
+
className: "h-6 text-[10px] gap-1 px-2",
|
|
176
|
+
title: "Start a new conversation",
|
|
177
|
+
children: [jsx(PlusIcon, {
|
|
178
|
+
className: "w-3 h-3"
|
|
179
|
+
}), "New"]
|
|
180
|
+
}), !capturing && jsx(Button, {
|
|
181
|
+
size: "icon",
|
|
182
|
+
variant: "ghost",
|
|
183
|
+
className: "h-6 w-6",
|
|
184
|
+
title: "Close",
|
|
185
|
+
onClick: () => {
|
|
186
|
+
setIsPopoverOpen(false);
|
|
187
|
+
resizeWindow(false);
|
|
188
|
+
},
|
|
189
|
+
children: jsx(XIcon, {
|
|
190
|
+
className: "h-3.5 w-3.5"
|
|
191
|
+
})
|
|
192
|
+
})]
|
|
193
|
+
})]
|
|
194
|
+
})
|
|
195
|
+
}), jsx(ScrollArea, {
|
|
196
|
+
className: "flex-1 min-h-0",
|
|
197
|
+
ref: scrollAreaRef,
|
|
198
|
+
children: jsxs("div", {
|
|
199
|
+
className: "p-2 space-y-2",
|
|
200
|
+
children: [screenshotImage && jsxs("div", {
|
|
201
|
+
className: "flex items-center gap-2 p-2 rounded-lg bg-primary/5 border border-primary/20",
|
|
202
|
+
children: [jsx("img", {
|
|
203
|
+
src: `data:image/png;base64,${screenshotImage}`,
|
|
204
|
+
alt: "Screenshot",
|
|
205
|
+
className: "h-12 w-20 object-cover rounded"
|
|
206
|
+
}), jsxs("div", {
|
|
207
|
+
className: "flex-1 min-w-0",
|
|
208
|
+
children: [jsx("p", {
|
|
209
|
+
className: "text-[10px] font-medium",
|
|
210
|
+
children: "Screenshot attached"
|
|
211
|
+
}), jsx("p", {
|
|
212
|
+
className: "text-[9px] text-muted-foreground",
|
|
213
|
+
children: "Will be sent with next transcription"
|
|
214
|
+
})]
|
|
215
|
+
}), jsx(Button, {
|
|
216
|
+
size: "icon",
|
|
217
|
+
variant: "ghost",
|
|
218
|
+
className: "h-5 w-5",
|
|
219
|
+
onClick: handleRemoveScreenshot,
|
|
220
|
+
children: jsx(XIcon, {
|
|
221
|
+
className: "h-3 w-3"
|
|
222
|
+
})
|
|
223
|
+
})]
|
|
224
|
+
}), error && !setupRequired && jsxs("div", {
|
|
225
|
+
className: "flex items-start gap-2 p-2.5 rounded-lg bg-red-50 border border-red-200",
|
|
226
|
+
children: [jsx(AlertCircleIcon, {
|
|
227
|
+
className: "w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"
|
|
228
|
+
}), jsxs("div", {
|
|
229
|
+
children: [jsx("p", {
|
|
230
|
+
className: "text-[10px] font-medium text-red-800",
|
|
231
|
+
children: "Error"
|
|
232
|
+
}), jsx("p", {
|
|
233
|
+
className: "text-[10px] text-red-700",
|
|
234
|
+
children: error
|
|
235
|
+
})]
|
|
236
|
+
})]
|
|
237
|
+
}), setupRequired ? jsx(PermissionFlow, {
|
|
238
|
+
checkAccess: checkSystemAudioAccess,
|
|
239
|
+
requestAccess: requestSystemAudioAccess,
|
|
240
|
+
onPermissionGranted: () => {
|
|
241
|
+
void startCapture();
|
|
242
|
+
},
|
|
243
|
+
onPermissionDenied: () => {
|
|
244
|
+
// Keep showing setup instructions
|
|
245
|
+
}
|
|
246
|
+
}) : jsxs(Fragment, {
|
|
247
|
+
children: [jsx(RecordingPanel, {
|
|
248
|
+
isVadMode: isVadMode,
|
|
249
|
+
isRecording: isRecordingInContinuousMode,
|
|
250
|
+
isProcessing: isProcessing,
|
|
251
|
+
isAIProcessing: isAIProcessing,
|
|
252
|
+
recordingProgress: recordingProgress,
|
|
253
|
+
maxDuration: vadConfig.max_recording_duration_secs,
|
|
254
|
+
onStartRecording: startContinuousRecording,
|
|
255
|
+
onStopAndSend: manualStopAndSend,
|
|
256
|
+
onIgnore: ignoreContinuousRecording
|
|
257
|
+
}), jsx(ResultsSection, {
|
|
258
|
+
lastTranscription: lastTranscription,
|
|
259
|
+
lastAIResponse: lastAIResponse,
|
|
260
|
+
isAIProcessing: isAIProcessing,
|
|
261
|
+
conversation: conversation,
|
|
262
|
+
conversationMode: conversationMode,
|
|
263
|
+
setConversationMode: setConversationMode
|
|
264
|
+
}), jsx(SettingsPanel, {
|
|
265
|
+
vadConfig: vadConfig,
|
|
266
|
+
onUpdateVadConfig: updateVadConfiguration,
|
|
267
|
+
useSystemPrompt: useSystemPrompt,
|
|
268
|
+
setUseSystemPrompt: setUseSystemPrompt,
|
|
269
|
+
contextContent: contextContent,
|
|
270
|
+
setContextContent: setContextContent
|
|
271
|
+
}), jsx(Warning, {
|
|
272
|
+
isVadMode: isVadMode
|
|
273
|
+
})]
|
|
274
|
+
})]
|
|
275
|
+
})
|
|
276
|
+
}), !setupRequired && hasResponse && jsx("div", {
|
|
277
|
+
className: "flex-shrink-0 border-t border-border/50 p-2",
|
|
278
|
+
children: jsx(QuickActions, {
|
|
279
|
+
actions: quickActions,
|
|
280
|
+
onActionClick: handleQuickActionClick,
|
|
281
|
+
onAddAction: addQuickAction,
|
|
282
|
+
onRemoveAction: removeQuickAction,
|
|
283
|
+
isManaging: isManagingQuickActions,
|
|
284
|
+
setIsManaging: setIsManagingQuickActions,
|
|
285
|
+
show: showQuickActions,
|
|
286
|
+
setShow: setShowQuickActions
|
|
287
|
+
})
|
|
288
|
+
})]
|
|
289
|
+
})
|
|
290
|
+
})]
|
|
291
|
+
});
|
|
292
|
+
};export{SystemAudio};//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PromptTemplate {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const PROMPT_TEMPLATES: PromptTemplate[];
|
|
7
|
+
export declare const getPromptTemplateById: (id: string) => PromptTemplate | undefined;
|
|
8
|
+
export declare const getPromptTemplateNames: () => {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
//# sourceMappingURL=promptTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptTemplates.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/promptTemplates.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAuH5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,KAAG,cAAc,GAAG,SAEnE,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAKrE,CAAC"}
|