@admin-layout/tailwind-ui 12.2.4-alpha.4 → 12.2.4-alpha.41
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/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 +169 -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 +10 -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 +8 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.d.ts.map +1 -0
- package/lib/components/AIToolbar/components/speech/PermissionFlow.js +161 -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 +175 -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,154 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState}from'react';import {InfoIcon,ChevronDownIcon,AudioWaveformIcon,MicIcon,KeyboardIcon,CameraIcon}from'lucide-react';import'../../../../utils/isBrowser/index.js';import {cn}from'../../../../utils/util.js';import'fast-deep-equal/react.js';const Warning = ({
|
|
2
|
+
isVadMode
|
|
3
|
+
}) => {
|
|
4
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
5
|
+
const isMac = navigator.platform.toLowerCase().includes('mac');
|
|
6
|
+
const modKey = isMac ? '⌘' : 'Ctrl';
|
|
7
|
+
return jsxs("div", {
|
|
8
|
+
className: "rounded-lg border border-border/50 bg-muted/30 overflow-hidden",
|
|
9
|
+
children: [jsxs("button", {
|
|
10
|
+
type: "button",
|
|
11
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
12
|
+
className: "w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors",
|
|
13
|
+
children: [jsxs("div", {
|
|
14
|
+
className: "flex items-center gap-2",
|
|
15
|
+
children: [jsx(InfoIcon, {
|
|
16
|
+
className: "w-3.5 h-3.5 text-muted-foreground"
|
|
17
|
+
}), jsx("span", {
|
|
18
|
+
className: "text-xs font-medium",
|
|
19
|
+
children: "Help & Keyboard Shortcuts"
|
|
20
|
+
})]
|
|
21
|
+
}), jsx(ChevronDownIcon, {
|
|
22
|
+
className: cn('w-4 h-4 text-muted-foreground transition-transform', isExpanded && 'rotate-180')
|
|
23
|
+
})]
|
|
24
|
+
}), isExpanded && jsxs("div", {
|
|
25
|
+
className: "px-3 pb-3 space-y-3",
|
|
26
|
+
children: [jsxs("div", {
|
|
27
|
+
className: "flex items-start gap-2 p-2 rounded-md bg-primary/5",
|
|
28
|
+
children: [isVadMode ? jsx(AudioWaveformIcon, {
|
|
29
|
+
className: "w-4 h-4 text-primary mt-0.5"
|
|
30
|
+
}) : jsx(MicIcon, {
|
|
31
|
+
className: "w-4 h-4 text-primary mt-0.5"
|
|
32
|
+
}), jsxs("div", {
|
|
33
|
+
children: [jsx("p", {
|
|
34
|
+
className: "text-xs font-medium",
|
|
35
|
+
children: isVadMode ? 'Auto-detect Mode' : 'Manual Mode'
|
|
36
|
+
}), jsx("p", {
|
|
37
|
+
className: "text-[10px] text-muted-foreground mt-0.5",
|
|
38
|
+
children: isVadMode ? 'Speech is automatically detected from system audio. When someone speaks, it will be captured and transcribed.' : 'Press the record button or use keyboard shortcuts to manually control recording.'
|
|
39
|
+
})]
|
|
40
|
+
})]
|
|
41
|
+
}), jsxs("div", {
|
|
42
|
+
className: "space-y-2",
|
|
43
|
+
children: [jsxs("div", {
|
|
44
|
+
className: "flex items-center gap-1.5",
|
|
45
|
+
children: [jsx(KeyboardIcon, {
|
|
46
|
+
className: "w-3 h-3 text-muted-foreground"
|
|
47
|
+
}), jsx("span", {
|
|
48
|
+
className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide",
|
|
49
|
+
children: "Keyboard Shortcuts"
|
|
50
|
+
})]
|
|
51
|
+
}), jsxs("div", {
|
|
52
|
+
className: "grid grid-cols-2 gap-2 text-[10px]",
|
|
53
|
+
children: [jsxs("div", {
|
|
54
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
55
|
+
children: [jsx("span", {
|
|
56
|
+
className: "text-muted-foreground",
|
|
57
|
+
children: "Scroll down"
|
|
58
|
+
}), jsx("kbd", {
|
|
59
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
60
|
+
children: "\u2193"
|
|
61
|
+
})]
|
|
62
|
+
}), jsxs("div", {
|
|
63
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
64
|
+
children: [jsx("span", {
|
|
65
|
+
className: "text-muted-foreground",
|
|
66
|
+
children: "Scroll up"
|
|
67
|
+
}), jsx("kbd", {
|
|
68
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
69
|
+
children: "\u2191"
|
|
70
|
+
})]
|
|
71
|
+
}), !isVadMode && jsxs(Fragment, {
|
|
72
|
+
children: [jsxs("div", {
|
|
73
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
74
|
+
children: [jsx("span", {
|
|
75
|
+
className: "text-muted-foreground",
|
|
76
|
+
children: "Start/Stop"
|
|
77
|
+
}), jsx("kbd", {
|
|
78
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
79
|
+
children: "Enter"
|
|
80
|
+
})]
|
|
81
|
+
}), jsxs("div", {
|
|
82
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
83
|
+
children: [jsx("span", {
|
|
84
|
+
className: "text-muted-foreground",
|
|
85
|
+
children: "Start record"
|
|
86
|
+
}), jsx("kbd", {
|
|
87
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
88
|
+
children: "Space"
|
|
89
|
+
})]
|
|
90
|
+
}), jsxs("div", {
|
|
91
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
92
|
+
children: [jsx("span", {
|
|
93
|
+
className: "text-muted-foreground",
|
|
94
|
+
children: "Discard"
|
|
95
|
+
}), jsx("kbd", {
|
|
96
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
97
|
+
children: "Esc"
|
|
98
|
+
})]
|
|
99
|
+
})]
|
|
100
|
+
}), jsxs("div", {
|
|
101
|
+
className: "flex items-center justify-between p-1.5 rounded bg-muted/50",
|
|
102
|
+
children: [jsx("span", {
|
|
103
|
+
className: "text-muted-foreground",
|
|
104
|
+
children: "Toggle view"
|
|
105
|
+
}), jsxs("kbd", {
|
|
106
|
+
className: "px-1.5 py-0.5 rounded bg-background border border-border font-mono",
|
|
107
|
+
children: [modKey, "+K"]
|
|
108
|
+
})]
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
}), jsxs("div", {
|
|
112
|
+
className: "space-y-2",
|
|
113
|
+
children: [jsxs("div", {
|
|
114
|
+
className: "flex items-center gap-1.5",
|
|
115
|
+
children: [jsx(CameraIcon, {
|
|
116
|
+
className: "w-3 h-3 text-muted-foreground"
|
|
117
|
+
}), jsx("span", {
|
|
118
|
+
className: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide",
|
|
119
|
+
children: "Screenshot Feature"
|
|
120
|
+
})]
|
|
121
|
+
}), jsxs("div", {
|
|
122
|
+
className: "p-2 rounded-md bg-primary/5 text-[10px] text-muted-foreground space-y-1",
|
|
123
|
+
children: [jsx("p", {
|
|
124
|
+
children: "Screenshot: Captures your current screen and attaches it to your next transcription."
|
|
125
|
+
}), jsx("p", {
|
|
126
|
+
children: "The AI will receive both the transcribed audio and the screenshot image, allowing it to provide context-aware responses based on what you're viewing."
|
|
127
|
+
}), jsx("p", {
|
|
128
|
+
className: "text-[9px] opacity-70",
|
|
129
|
+
children: "The screenshot is automatically cleared after each message is sent."
|
|
130
|
+
})]
|
|
131
|
+
})]
|
|
132
|
+
}), jsxs("div", {
|
|
133
|
+
className: "text-[10px] text-muted-foreground space-y-1 pt-2 border-t border-border/50",
|
|
134
|
+
children: [jsxs("p", {
|
|
135
|
+
children: [jsx("strong", {
|
|
136
|
+
children: "Tip:"
|
|
137
|
+
}), " Use Auto-detect for hands-free operation during interviews."]
|
|
138
|
+
}), jsxs("p", {
|
|
139
|
+
children: [jsx("strong", {
|
|
140
|
+
children: "Tip:"
|
|
141
|
+
}), " Use Manual mode when you need precise control over what gets transcribed."]
|
|
142
|
+
}), jsxs("p", {
|
|
143
|
+
children: [jsx("strong", {
|
|
144
|
+
children: "Tip:"
|
|
145
|
+
}), " Quick Actions let you send follow-up prompts with one click."]
|
|
146
|
+
}), jsxs("p", {
|
|
147
|
+
children: [jsx("strong", {
|
|
148
|
+
children: "Tip:"
|
|
149
|
+
}), " Use Screenshot to share your screen context with the AI for more relevant responses."]
|
|
150
|
+
})]
|
|
151
|
+
})]
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
};export{Warning};//# sourceMappingURL=Warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Warning.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface AudioVisualizerProps {
|
|
2
|
+
isRecording: boolean;
|
|
3
|
+
stream?: MediaStream | null;
|
|
4
|
+
}
|
|
5
|
+
export declare function AudioVisualizer({ stream, isRecording }: AudioVisualizerProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=audio-visualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-visualizer.d.ts","sourceRoot":"","sources":["../../../../../src/components/AIToolbar/components/speech/audio-visualizer.tsx"],"names":[],"mappings":"AAgBA,UAAU,oBAAoB;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,oBAAoB,2CA8N5E"}
|
|
@@ -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"}
|