@chatsdk-dev/ui 0.1.2 → 0.2.0
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/atoms/accordion.d.ts +4 -4
- package/dist/atoms/accordion.d.ts.map +1 -1
- package/dist/atoms/alert-dialog.d.ts +22 -14
- package/dist/atoms/alert-dialog.d.ts.map +1 -1
- package/dist/atoms/alert-dialog.js +13 -8
- package/dist/atoms/alert.d.ts +4 -4
- package/dist/atoms/alert.d.ts.map +1 -1
- package/dist/atoms/attachment.d.ts +24 -0
- package/dist/atoms/attachment.d.ts.map +1 -0
- package/dist/atoms/attachment.js +76 -0
- package/dist/atoms/avatar.d.ts +6 -6
- package/dist/atoms/avatar.d.ts.map +1 -1
- package/dist/atoms/badge.d.ts +1 -1
- package/dist/atoms/bubble.d.ts +17 -0
- package/dist/atoms/bubble.d.ts.map +1 -0
- package/dist/atoms/bubble.js +59 -0
- package/dist/atoms/button-group.d.ts +2 -2
- package/dist/atoms/button-group.d.ts.map +1 -1
- package/dist/atoms/button-loader.d.ts +2 -2
- package/dist/atoms/button-loader.d.ts.map +1 -1
- package/dist/atoms/button.d.ts +2 -2
- package/dist/atoms/button.d.ts.map +1 -1
- package/dist/atoms/button.js +2 -1
- package/dist/atoms/card.d.ts +7 -7
- package/dist/atoms/card.d.ts.map +1 -1
- package/dist/atoms/carousel.d.ts +5 -5
- package/dist/atoms/carousel.d.ts.map +1 -1
- package/dist/atoms/carousel.js +1 -0
- package/dist/atoms/collapsible.d.ts +3 -3
- package/dist/atoms/collapsible.d.ts.map +1 -1
- package/dist/atoms/command.d.ts +9 -9
- package/dist/atoms/command.d.ts.map +1 -1
- package/dist/atoms/container.d.ts +1 -1
- package/dist/atoms/container.d.ts.map +1 -1
- package/dist/atoms/dialog.d.ts +10 -10
- package/dist/atoms/dialog.d.ts.map +1 -1
- package/dist/atoms/dialog.js +4 -2
- package/dist/atoms/dots-loader.d.ts +1 -1
- package/dist/atoms/dots-loader.d.ts.map +1 -1
- package/dist/atoms/drawer.d.ts +10 -10
- package/dist/atoms/drawer.d.ts.map +1 -1
- package/dist/atoms/drawer.js +6 -4
- package/dist/atoms/dropdown-menu.d.ts +15 -15
- package/dist/atoms/dropdown-menu.d.ts.map +1 -1
- package/dist/atoms/dropdown-menu.js +8 -5
- package/dist/atoms/empty.d.ts +6 -6
- package/dist/atoms/empty.d.ts.map +1 -1
- package/dist/atoms/field.d.ts +10 -10
- package/dist/atoms/field.d.ts.map +1 -1
- package/dist/atoms/form.d.ts +6 -6
- package/dist/atoms/form.d.ts.map +1 -1
- package/dist/atoms/form.js +4 -2
- package/dist/atoms/header.d.ts +1 -1
- package/dist/atoms/header.d.ts.map +1 -1
- package/dist/atoms/hover-card.d.ts +3 -3
- package/dist/atoms/hover-card.d.ts.map +1 -1
- package/dist/atoms/hover-card.js +3 -1
- package/dist/atoms/input-group.d.ts +7 -7
- package/dist/atoms/input-group.d.ts.map +1 -1
- package/dist/atoms/input.d.ts +1 -1
- package/dist/atoms/input.d.ts.map +1 -1
- package/dist/atoms/input.js +1 -1
- package/dist/atoms/label.d.ts +1 -1
- package/dist/atoms/label.d.ts.map +1 -1
- package/dist/atoms/logo.d.ts +1 -1
- package/dist/atoms/logo.d.ts.map +1 -1
- package/dist/atoms/marker.d.ts +11 -0
- package/dist/atoms/marker.d.ts.map +1 -0
- package/dist/atoms/marker.js +34 -0
- package/dist/atoms/message-scroller.d.ts +11 -0
- package/dist/atoms/message-scroller.d.ts.map +1 -0
- package/dist/atoms/message-scroller.js +25 -0
- package/dist/atoms/message.d.ts +11 -0
- package/dist/atoms/message.d.ts.map +1 -0
- package/dist/atoms/message.js +21 -0
- package/dist/atoms/number-flow.d.ts +1 -1
- package/dist/atoms/number-flow.d.ts.map +1 -1
- package/dist/atoms/popover.d.ts +6 -6
- package/dist/atoms/popover.d.ts.map +1 -1
- package/dist/atoms/popover.js +3 -1
- package/dist/atoms/progress.d.ts +5 -5
- package/dist/atoms/progress.d.ts.map +1 -1
- package/dist/atoms/radio-group.d.ts +2 -2
- package/dist/atoms/radio-group.d.ts.map +1 -1
- package/dist/atoms/scroll-area.d.ts +2 -2
- package/dist/atoms/scroll-area.d.ts.map +1 -1
- package/dist/atoms/select.d.ts +9 -9
- package/dist/atoms/select.d.ts.map +1 -1
- package/dist/atoms/select.js +5 -3
- package/dist/atoms/separator.d.ts +1 -1
- package/dist/atoms/separator.d.ts.map +1 -1
- package/dist/atoms/sheet.d.ts +8 -8
- package/dist/atoms/sheet.d.ts.map +1 -1
- package/dist/atoms/sheet.js +5 -3
- package/dist/atoms/sidebar.d.ts +19 -19
- package/dist/atoms/sidebar.d.ts.map +1 -1
- package/dist/atoms/sidebar.js +1 -1
- package/dist/atoms/skeleton.d.ts +1 -1
- package/dist/atoms/skeleton.d.ts.map +1 -1
- package/dist/atoms/spinner.d.ts +1 -1
- package/dist/atoms/spinner.d.ts.map +1 -1
- package/dist/atoms/switch.d.ts +1 -1
- package/dist/atoms/switch.d.ts.map +1 -1
- package/dist/atoms/table.d.ts +8 -8
- package/dist/atoms/table.d.ts.map +1 -1
- package/dist/atoms/table.js +1 -1
- package/dist/atoms/tabs.d.ts +8 -5
- package/dist/atoms/tabs.d.ts.map +1 -1
- package/dist/atoms/tabs.js +10 -6
- package/dist/atoms/textarea.d.ts +1 -1
- package/dist/atoms/textarea.d.ts.map +1 -1
- package/dist/atoms/toggle.d.ts +2 -2
- package/dist/atoms/toggle.d.ts.map +1 -1
- package/dist/atoms/toggle.js +1 -0
- package/dist/atoms/tooltip.d.ts +7 -5
- package/dist/atoms/tooltip.d.ts.map +1 -1
- package/dist/atoms/tooltip.js +6 -4
- package/dist/atoms/typography/h1.d.ts +1 -1
- package/dist/atoms/typography/h1.d.ts.map +1 -1
- package/dist/atoms/typography/paragraph.d.ts +1 -1
- package/dist/atoms/typography/paragraph.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-controllable-state.js +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +9 -6
- package/dist/index.css +1693 -996
- package/dist/lib/portal-container.d.ts +12 -0
- package/dist/lib/portal-container.d.ts.map +1 -0
- package/dist/lib/portal-container.js +15 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +27 -0
- package/dist/molecules/ai/action.d.ts +7 -0
- package/dist/molecules/ai/action.d.ts.map +1 -0
- package/dist/molecules/ai/action.js +13 -0
- package/dist/molecules/ai/agent.d.ts +7 -7
- package/dist/molecules/ai/agent.d.ts.map +1 -1
- package/dist/molecules/ai/artifact.d.ts +8 -8
- package/dist/molecules/ai/artifact.d.ts.map +1 -1
- package/dist/molecules/ai/artifact.js +2 -2
- package/dist/molecules/ai/audio-player.d.ts +11 -11
- package/dist/molecules/ai/audio-player.d.ts.map +1 -1
- package/dist/molecules/ai/audio-player.js +1 -3
- package/dist/molecules/ai/canvas.d.ts +1 -2
- package/dist/molecules/ai/canvas.d.ts.map +1 -1
- package/dist/molecules/ai/canvas.js +0 -1
- package/dist/molecules/ai/chain-of-thought.d.ts +7 -7
- package/dist/molecules/ai/chain-of-thought.d.ts.map +1 -1
- package/dist/molecules/ai/checkpoint.d.ts +3 -3
- package/dist/molecules/ai/checkpoint.d.ts.map +1 -1
- package/dist/molecules/ai/code-block.d.ts +13 -13
- package/dist/molecules/ai/code-block.d.ts.map +1 -1
- package/dist/molecules/ai/commit.d.ts +22 -22
- package/dist/molecules/ai/commit.d.ts.map +1 -1
- package/dist/molecules/ai/confirmation.d.ts +4 -12
- package/dist/molecules/ai/confirmation.d.ts.map +1 -1
- package/dist/molecules/ai/context.d.ts +10 -10
- package/dist/molecules/ai/context.d.ts.map +1 -1
- package/dist/molecules/ai/controls.d.ts +1 -1
- package/dist/molecules/ai/controls.d.ts.map +1 -1
- package/dist/molecules/ai/edge.d.ts +2 -2
- package/dist/molecules/ai/environment-variables.d.ts +11 -11
- package/dist/molecules/ai/environment-variables.d.ts.map +1 -1
- package/dist/molecules/ai/file-tree.d.ts +6 -6
- package/dist/molecules/ai/file-tree.d.ts.map +1 -1
- package/dist/molecules/ai/image.d.ts +1 -1
- package/dist/molecules/ai/image.d.ts.map +1 -1
- package/dist/molecules/ai/inline-citation.d.ts +14 -14
- package/dist/molecules/ai/inline-citation.d.ts.map +1 -1
- package/dist/molecules/ai/jsx-preview.d.ts +3 -3
- package/dist/molecules/ai/jsx-preview.d.ts.map +1 -1
- package/dist/molecules/ai/loader.d.ts +1 -1
- package/dist/molecules/ai/loader.d.ts.map +1 -1
- package/dist/molecules/ai/mic-selector.d.ts +9 -9
- package/dist/molecules/ai/mic-selector.d.ts.map +1 -1
- package/dist/molecules/ai/model-selector.d.ts +14 -14
- package/dist/molecules/ai/model-selector.d.ts.map +1 -1
- package/dist/molecules/ai/node.d.ts +7 -7
- package/dist/molecules/ai/node.d.ts.map +1 -1
- package/dist/molecules/ai/open-in-chat.d.ts +12 -12
- package/dist/molecules/ai/open-in-chat.d.ts.map +1 -1
- package/dist/molecules/ai/package-info.d.ts +9 -9
- package/dist/molecules/ai/package-info.d.ts.map +1 -1
- package/dist/molecules/ai/panel.d.ts +1 -1
- package/dist/molecules/ai/panel.d.ts.map +1 -1
- package/dist/molecules/ai/persona.d.ts.map +1 -1
- package/dist/molecules/ai/plan.d.ts +8 -8
- package/dist/molecules/ai/plan.d.ts.map +1 -1
- package/dist/molecules/ai/plan.js +3 -4
- package/dist/molecules/ai/prompt-input.d.ts +35 -35
- package/dist/molecules/ai/prompt-input.d.ts.map +1 -1
- package/dist/molecules/ai/prompt-input.js +5 -15
- package/dist/molecules/ai/queue.d.ts +15 -15
- package/dist/molecules/ai/queue.d.ts.map +1 -1
- package/dist/molecules/ai/reasoning.d.ts +3 -3
- package/dist/molecules/ai/reasoning.d.ts.map +1 -1
- package/dist/molecules/ai/reasoning.js +7 -34
- package/dist/molecules/ai/response.d.ts +3 -4
- package/dist/molecules/ai/response.d.ts.map +1 -1
- package/dist/molecules/ai/response.js +10 -14
- package/dist/molecules/ai/sandbox.d.ts +8 -8
- package/dist/molecules/ai/sandbox.d.ts.map +1 -1
- package/dist/molecules/ai/sandbox.js +1 -1
- package/dist/molecules/ai/schema-display.d.ts +13 -13
- package/dist/molecules/ai/schema-display.d.ts.map +1 -1
- package/dist/molecules/ai/snippet.d.ts +5 -5
- package/dist/molecules/ai/snippet.d.ts.map +1 -1
- package/dist/molecules/ai/sources.d.ts +6 -5
- package/dist/molecules/ai/sources.d.ts.map +1 -1
- package/dist/molecules/ai/sources.js +2 -2
- package/dist/molecules/ai/speech-input.d.ts +1 -1
- package/dist/molecules/ai/speech-input.d.ts.map +1 -1
- package/dist/molecules/ai/stack-trace.d.ts +10 -10
- package/dist/molecules/ai/stack-trace.d.ts.map +1 -1
- package/dist/molecules/ai/stack-trace.js +1 -1
- package/dist/molecules/ai/suggestion.d.ts +2 -2
- package/dist/molecules/ai/suggestion.d.ts.map +1 -1
- package/dist/molecules/ai/task.d.ts +5 -5
- package/dist/molecules/ai/task.d.ts.map +1 -1
- package/dist/molecules/ai/terminal.d.ts +8 -8
- package/dist/molecules/ai/terminal.d.ts.map +1 -1
- package/dist/molecules/ai/test-results.d.ts +17 -17
- package/dist/molecules/ai/test-results.d.ts.map +1 -1
- package/dist/molecules/ai/tool.d.ts +21 -8
- package/dist/molecules/ai/tool.d.ts.map +1 -1
- package/dist/molecules/ai/tool.js +15 -11
- package/dist/molecules/ai/toolbar.d.ts +1 -1
- package/dist/molecules/ai/toolbar.d.ts.map +1 -1
- package/dist/molecules/ai/transcription.d.ts +2 -2
- package/dist/molecules/ai/transcription.d.ts.map +1 -1
- package/dist/molecules/ai/voice-selector.d.ts +19 -19
- package/dist/molecules/ai/voice-selector.d.ts.map +1 -1
- package/dist/molecules/ai/web-preview.d.ts +6 -6
- package/dist/molecules/ai/web-preview.d.ts.map +1 -1
- package/dist/molecules/ai/web-preview.js +2 -2
- package/package.json +27 -27
- package/dist/components/accordion.d.ts +0 -7
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -18
- package/dist/components/alert-dialog.d.ts +0 -19
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -42
- package/dist/components/alert.d.ts +0 -11
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -27
- package/dist/components/avatar.d.ts +0 -12
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -23
- package/dist/components/badge.d.ts +0 -8
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -44
- package/dist/components/button-group.d.ts +0 -11
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -36
- package/dist/components/button-loader.d.ts +0 -9
- package/dist/components/button-loader.d.ts.map +0 -1
- package/dist/components/button-loader.js +0 -10
- package/dist/components/button.d.ts +0 -9
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -32
- package/dist/components/card.d.ts +0 -12
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -25
- package/dist/components/carousel.d.ts +0 -29
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -91
- package/dist/components/collapsible.d.ts +0 -6
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -13
- package/dist/components/command.d.ts +0 -20
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -35
- package/dist/components/container.d.ts +0 -8
- package/dist/components/container.d.ts.map +0 -1
- package/dist/components/container.js +0 -5
- package/dist/components/dialog.d.ts +0 -19
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -38
- package/dist/components/dots-loader.d.ts +0 -15
- package/dist/components/dots-loader.d.ts.map +0 -1
- package/dist/components/dots-loader.js +0 -21
- package/dist/components/drawer.d.ts +0 -14
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -35
- package/dist/components/dropdown-menu.d.ts +0 -26
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -51
- package/dist/components/empty.d.ts +0 -12
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -33
- package/dist/components/field.d.ts +0 -25
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -68
- package/dist/components/form.d.ts +0 -23
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -68
- package/dist/components/header.d.ts +0 -6
- package/dist/components/header.d.ts.map +0 -1
- package/dist/components/header.js +0 -6
- package/dist/components/hover-card.d.ts +0 -6
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -14
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -5
- package/dist/components/input-group.d.ts +0 -19
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -57
- package/dist/components/input.d.ts +0 -7
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -6
- package/dist/components/label.d.ts +0 -3
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -7
- package/dist/components/logo.d.ts +0 -7
- package/dist/components/logo.d.ts.map +0 -1
- package/dist/components/logo.js +0 -6
- package/dist/components/number-flow.d.ts +0 -3
- package/dist/components/number-flow.d.ts.map +0 -1
- package/dist/components/number-flow.js +0 -6
- package/dist/components/popover.d.ts +0 -10
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress.d.ts +0 -8
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -20
- package/dist/components/radio-group.d.ts +0 -6
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -13
- package/dist/components/responsive-alert-dialog.d.ts +0 -16
- package/dist/components/responsive-alert-dialog.d.ts.map +0 -1
- package/dist/components/responsive-alert-dialog.js +0 -20
- package/dist/components/responsive-dialog.d.ts +0 -11
- package/dist/components/responsive-dialog.d.ts.map +0 -1
- package/dist/components/responsive-dialog.js +0 -21
- package/dist/components/scroll-area.d.ts +0 -5
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -11
- package/dist/components/select.d.ts +0 -17
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -34
- package/dist/components/separator.d.ts +0 -3
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -7
- package/dist/components/sheet.d.ts +0 -15
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -37
- package/dist/components/sidebar.d.ts +0 -65
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -258
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -5
- package/dist/components/spinner.d.ts +0 -3
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -7
- package/dist/components/switch.d.ts +0 -5
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -7
- package/dist/components/table.d.ts +0 -13
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -28
- package/dist/components/tabs.d.ts +0 -12
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -32
- package/dist/components/textarea.d.ts +0 -3
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -5
- package/dist/components/toggle.d.ts +0 -9
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -26
- package/dist/components/tooltip.d.ts +0 -7
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -17
- package/dist/components/typography/h1.d.ts +0 -10
- package/dist/components/typography/h1.d.ts.map +0 -1
- package/dist/components/typography/h1.js +0 -6
- package/dist/components/typography/paragraph.d.ts +0 -6
- package/dist/components/typography/paragraph.d.ts.map +0 -1
- package/dist/components/typography/paragraph.js +0 -6
- package/dist/components/typography/text.d.ts +0 -14
- package/dist/components/typography/text.d.ts.map +0 -1
- package/dist/components/typography/text.js +0 -41
- package/dist/molecules/actions.d.ts +0 -10
- package/dist/molecules/actions.d.ts.map +0 -1
- package/dist/molecules/actions.js +0 -13
- package/dist/molecules/agent.d.ts +0 -27
- package/dist/molecules/agent.d.ts.map +0 -1
- package/dist/molecules/agent.js +0 -27
- package/dist/molecules/ai/actions.d.ts +0 -10
- package/dist/molecules/ai/actions.d.ts.map +0 -1
- package/dist/molecules/ai/actions.js +0 -13
- package/dist/molecules/ai/attachments.d.ts +0 -55
- package/dist/molecules/ai/attachments.d.ts.map +0 -1
- package/dist/molecules/ai/attachments.js +0 -125
- package/dist/molecules/ai/conversation.d.ts +0 -24
- package/dist/molecules/ai/conversation.d.ts.map +0 -1
- package/dist/molecules/ai/conversation.js +0 -41
- package/dist/molecules/ai/message.d.ts +0 -38
- package/dist/molecules/ai/message.d.ts.map +0 -1
- package/dist/molecules/ai/message.js +0 -92
- package/dist/molecules/ai/shimmer.d.ts +0 -10
- package/dist/molecules/ai/shimmer.d.ts.map +0 -1
- package/dist/molecules/ai/shimmer.js +0 -28
- package/dist/molecules/artifact.d.ts +0 -24
- package/dist/molecules/artifact.d.ts.map +0 -1
- package/dist/molecules/artifact.js +0 -20
- package/dist/molecules/attachments.d.ts +0 -55
- package/dist/molecules/attachments.d.ts.map +0 -1
- package/dist/molecules/attachments.js +0 -125
- package/dist/molecules/audio-player.d.ts +0 -30
- package/dist/molecules/audio-player.d.ts.map +0 -1
- package/dist/molecules/audio-player.js +0 -43
- package/dist/molecules/canvas.d.ts +0 -9
- package/dist/molecules/canvas.d.ts.map +0 -1
- package/dist/molecules/canvas.js +0 -5
- package/dist/molecules/chain-of-thought.d.ts +0 -30
- package/dist/molecules/chain-of-thought.d.ts.map +0 -1
- package/dist/molecules/chain-of-thought.js +0 -49
- package/dist/molecules/chat-message.d.ts +0 -10
- package/dist/molecules/chat-message.d.ts.map +0 -1
- package/dist/molecules/chat-message.js +0 -53
- package/dist/molecules/checkpoint.d.ts +0 -12
- package/dist/molecules/checkpoint.d.ts.map +0 -1
- package/dist/molecules/checkpoint.js +0 -10
- package/dist/molecules/code-block.d.ts +0 -46
- package/dist/molecules/code-block.d.ts.map +0 -1
- package/dist/molecules/code-block.js +0 -216
- package/dist/molecules/commit.d.ts +0 -65
- package/dist/molecules/commit.d.ts.map +0 -1
- package/dist/molecules/commit.js +0 -95
- package/dist/molecules/confirmation.d.ts +0 -50
- package/dist/molecules/confirmation.d.ts.map +0 -1
- package/dist/molecules/confirmation.js +0 -61
- package/dist/molecules/connection.d.ts +0 -3
- package/dist/molecules/connection.d.ts.map +0 -1
- package/dist/molecules/connection.js +0 -3
- package/dist/molecules/context.d.ts +0 -33
- package/dist/molecules/context.d.ts.map +0 -1
- package/dist/molecules/context.js +0 -164
- package/dist/molecules/controls.d.ts +0 -5
- package/dist/molecules/controls.d.ts.map +0 -1
- package/dist/molecules/controls.js +0 -5
- package/dist/molecules/conversation.d.ts +0 -24
- package/dist/molecules/conversation.d.ts.map +0 -1
- package/dist/molecules/conversation.js +0 -41
- package/dist/molecules/edge.d.ts +0 -6
- package/dist/molecules/edge.d.ts.map +0 -1
- package/dist/molecules/edge.js +0 -87
- package/dist/molecules/environment-variables.d.ts +0 -39
- package/dist/molecules/environment-variables.d.ts.map +0 -1
- package/dist/molecules/environment-variables.js +0 -87
- package/dist/molecules/file-tree.d.ts +0 -27
- package/dist/molecules/file-tree.d.ts.map +0 -1
- package/dist/molecules/file-tree.js +0 -71
- package/dist/molecules/image.d.ts +0 -7
- package/dist/molecules/image.d.ts.map +0 -1
- package/dist/molecules/image.js +0 -3
- package/dist/molecules/inline-citation.d.ts +0 -39
- package/dist/molecules/inline-citation.d.ts.map +0 -1
- package/dist/molecules/inline-citation.js +0 -68
- package/dist/molecules/jsx-preview.d.ts +0 -30
- package/dist/molecules/jsx-preview.d.ts.map +0 -1
- package/dist/molecules/jsx-preview.js +0 -167
- package/dist/molecules/loader.d.ts +0 -6
- package/dist/molecules/loader.d.ts.map +0 -1
- package/dist/molecules/loader.js +0 -4
- package/dist/molecules/message.d.ts +0 -38
- package/dist/molecules/message.d.ts.map +0 -1
- package/dist/molecules/message.js +0 -92
- package/dist/molecules/mic-selector.d.ts +0 -46
- package/dist/molecules/mic-selector.d.ts.map +0 -1
- package/dist/molecules/mic-selector.js +0 -184
- package/dist/molecules/model-selector.d.ts +0 -36
- package/dist/molecules/model-selector.d.ts.map +0 -1
- package/dist/molecules/model-selector.js +0 -18
- package/dist/molecules/node.d.ts +0 -22
- package/dist/molecules/node.d.ts.map +0 -1
- package/dist/molecules/node.js +0 -11
- package/dist/molecules/open-in-chat.d.ts +0 -29
- package/dist/molecules/open-in-chat.d.ts.map +0 -1
- package/dist/molecules/open-in-chat.js +0 -100
- package/dist/molecules/package-info.d.ts +0 -30
- package/dist/molecules/package-info.d.ts.map +0 -1
- package/dist/molecules/package-info.js +0 -50
- package/dist/molecules/panel.d.ts +0 -6
- package/dist/molecules/panel.d.ts.map +0 -1
- package/dist/molecules/panel.js +0 -4
- package/dist/molecules/persona.d.ts +0 -49
- package/dist/molecules/persona.d.ts.map +0 -1
- package/dist/molecules/persona.js +0 -189
- package/dist/molecules/plan.d.ts +0 -26
- package/dist/molecules/plan.d.ts.map +0 -1
- package/dist/molecules/plan.js +0 -34
- package/dist/molecules/prompt-input.d.ts +0 -149
- package/dist/molecules/prompt-input.d.ts.map +0 -1
- package/dist/molecules/prompt-input.js +0 -702
- package/dist/molecules/queue.d.ts +0 -62
- package/dist/molecules/queue.d.ts.map +0 -1
- package/dist/molecules/queue.js +0 -28
- package/dist/molecules/reasoning.d.ts +0 -27
- package/dist/molecules/reasoning.d.ts.map +0 -1
- package/dist/molecules/reasoning.js +0 -95
- package/dist/molecules/response.d.ts +0 -6
- package/dist/molecules/response.d.ts.map +0 -1
- package/dist/molecules/response.js +0 -18
- package/dist/molecules/responsive-alert-dialog.d.ts +0 -16
- package/dist/molecules/responsive-alert-dialog.d.ts.map +0 -1
- package/dist/molecules/responsive-alert-dialog.js +0 -20
- package/dist/molecules/responsive-dialog.d.ts +0 -11
- package/dist/molecules/responsive-dialog.d.ts.map +0 -1
- package/dist/molecules/responsive-dialog.js +0 -21
- package/dist/molecules/sandbox.d.ts +0 -25
- package/dist/molecules/sandbox.d.ts.map +0 -1
- package/dist/molecules/sandbox.js +0 -15
- package/dist/molecules/schema-display.d.ts +0 -56
- package/dist/molecules/schema-display.d.ts.map +0 -1
- package/dist/molecules/schema-display.js +0 -73
- package/dist/molecules/shimmer.d.ts +0 -10
- package/dist/molecules/shimmer.d.ts.map +0 -1
- package/dist/molecules/shimmer.js +0 -28
- package/dist/molecules/snippet.d.ts +0 -19
- package/dist/molecules/snippet.d.ts.map +0 -1
- package/dist/molecules/snippet.js +0 -46
- package/dist/molecules/sources.d.ts +0 -13
- package/dist/molecules/sources.d.ts.map +0 -1
- package/dist/molecules/sources.js +0 -9
- package/dist/molecules/speech-input.d.ts +0 -55
- package/dist/molecules/speech-input.d.ts.map +0 -1
- package/dist/molecules/speech-input.js +0 -187
- package/dist/molecules/stack-trace.d.ts +0 -38
- package/dist/molecules/stack-trace.d.ts.map +0 -1
- package/dist/molecules/stack-trace.js +0 -194
- package/dist/molecules/suggestion.d.ts +0 -11
- package/dist/molecules/suggestion.d.ts.map +0 -1
- package/dist/molecules/suggestion.js +0 -13
- package/dist/molecules/task.d.ts +0 -15
- package/dist/molecules/task.d.ts.map +0 -1
- package/dist/molecules/task.js +0 -10
- package/dist/molecules/terminal.d.ts +0 -28
- package/dist/molecules/terminal.d.ts.map +0 -1
- package/dist/molecules/terminal.js +0 -68
- package/dist/molecules/test-results.d.ts +0 -59
- package/dist/molecules/test-results.d.ts.map +0 -1
- package/dist/molecules/test-results.js +0 -97
- package/dist/molecules/tool.d.ts +0 -32
- package/dist/molecules/tool.d.ts.map +0 -1
- package/dist/molecules/tool.js +0 -49
- package/dist/molecules/toolbar.d.ts +0 -6
- package/dist/molecules/toolbar.d.ts.map +0 -1
- package/dist/molecules/toolbar.js +0 -4
- package/dist/molecules/transcription.d.ts +0 -17
- package/dist/molecules/transcription.d.ts.map +0 -1
- package/dist/molecules/transcription.js +0 -36
- package/dist/molecules/voice-selector.d.ts +0 -64
- package/dist/molecules/voice-selector.d.ts.map +0 -1
- package/dist/molecules/voice-selector.js +0 -224
- package/dist/molecules/web-preview.d.ts +0 -35
- package/dist/molecules/web-preview.d.ts.map +0 -1
- package/dist/molecules/web-preview.js +0 -65
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "@chatsdk-dev/ui/components/input-group";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
export type SnippetProps = ComponentProps<typeof InputGroup> & {
|
|
4
|
-
code: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const Snippet: ({ code, className, children, ...props }: SnippetProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type SnippetAddonProps = ComponentProps<typeof InputGroupAddon>;
|
|
8
|
-
export declare const SnippetAddon: (props: SnippetAddonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type SnippetTextProps = ComponentProps<typeof InputGroupText>;
|
|
10
|
-
export declare const SnippetText: ({ className, ...props }: SnippetTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type SnippetInputProps = Omit<ComponentProps<typeof InputGroupInput>, "readOnly" | "value">;
|
|
12
|
-
export declare const SnippetInput: ({ className, ...props }: SnippetInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export type SnippetCopyButtonProps = ComponentProps<typeof InputGroupButton> & {
|
|
14
|
-
onCopy?: () => void;
|
|
15
|
-
onError?: (error: Error) => void;
|
|
16
|
-
timeout?: number;
|
|
17
|
-
};
|
|
18
|
-
export declare const SnippetCopyButton: ({ onCopy, onError, timeout, children, className, ...props }: SnippetCopyButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
//# sourceMappingURL=snippet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/molecules/snippet.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAmB5C,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,yCAKrB,YAAY,4CAUd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC;AAEvE,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAEpD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC;AAErE,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,4CAKpE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,cAAc,CAAC,OAAO,eAAe,CAAC,EACtC,UAAU,GAAG,OAAO,CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,yBAAyB,iBAAiB,4CAWtE,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,GAAG;IAC7E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,6DAO/B,sBAAsB,4CA+CxB,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, } from "@chatsdk-dev/ui/components/input-group";
|
|
4
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
5
|
-
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
6
|
-
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
7
|
-
const SnippetContext = createContext({
|
|
8
|
-
code: "",
|
|
9
|
-
});
|
|
10
|
-
export const Snippet = ({ code, className, children, ...props }) => {
|
|
11
|
-
const contextValue = useMemo(() => ({ code }), [code]);
|
|
12
|
-
return (_jsx(SnippetContext.Provider, { value: contextValue, children: _jsx(InputGroup, { className: cn("font-mono", className), ...props, children: children }) }));
|
|
13
|
-
};
|
|
14
|
-
export const SnippetAddon = (props) => (_jsx(InputGroupAddon, { ...props }));
|
|
15
|
-
export const SnippetText = ({ className, ...props }) => (_jsx(InputGroupText, { className: cn("pl-2 font-normal text-muted-foreground", className), ...props }));
|
|
16
|
-
export const SnippetInput = ({ className, ...props }) => {
|
|
17
|
-
const { code } = useContext(SnippetContext);
|
|
18
|
-
return (_jsx(InputGroupInput, { className: cn("text-foreground", className), readOnly: true, value: code, ...props }));
|
|
19
|
-
};
|
|
20
|
-
export const SnippetCopyButton = ({ onCopy, onError, timeout = 2000, children, className, ...props }) => {
|
|
21
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
22
|
-
const timeoutRef = useRef(0);
|
|
23
|
-
const { code } = useContext(SnippetContext);
|
|
24
|
-
const copyToClipboard = useCallback(async () => {
|
|
25
|
-
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
26
|
-
onError?.(new Error("Clipboard API not available"));
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
if (!isCopied) {
|
|
31
|
-
await navigator.clipboard.writeText(code);
|
|
32
|
-
setIsCopied(true);
|
|
33
|
-
onCopy?.();
|
|
34
|
-
timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
onError?.(error);
|
|
39
|
-
}
|
|
40
|
-
}, [code, onCopy, onError, timeout, isCopied]);
|
|
41
|
-
useEffect(() => () => {
|
|
42
|
-
window.clearTimeout(timeoutRef.current);
|
|
43
|
-
}, []);
|
|
44
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
45
|
-
return (_jsx(InputGroupButton, { "aria-label": "Copy", className: className, onClick: copyToClipboard, size: "icon-sm", title: "Copy", ...props, children: children ?? _jsx(Icon, { className: "size-3.5", size: 14 }) }));
|
|
46
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CollapsibleContent, CollapsibleTrigger } from "@chatsdk-dev/ui/components/collapsible";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
export type SourcesProps = ComponentProps<"div">;
|
|
4
|
-
export declare const Sources: ({ className, ...props }: SourcesProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export type SourcesTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
6
|
-
count: number;
|
|
7
|
-
};
|
|
8
|
-
export declare const SourcesTrigger: ({ className, count, children, ...props }: SourcesTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type SourcesContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
10
|
-
export declare const SourcesContent: ({ className, ...props }: SourcesContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type SourceProps = ComponentProps<"a">;
|
|
12
|
-
export declare const Source: ({ href, title, children, ...props }: SourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../src/molecules/sources.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjD,eAAO,MAAM,OAAO,GAAI,yBAAyB,YAAY,4CAK5D,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAC5E,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,0CAK5B,mBAAmB,4CAYrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE5E,eAAO,MAAM,cAAc,GAAI,yBAG5B,mBAAmB,4CASrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAE9C,eAAO,MAAM,MAAM,GAAI,qCAAqC,WAAW,4CAetE,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/components/collapsible";
|
|
4
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
5
|
-
import { BookIcon, ChevronDownIcon } from "lucide-react";
|
|
6
|
-
export const Sources = ({ className, ...props }) => (_jsx(Collapsible, { className: cn("not-prose mb-4 text-primary text-xs", className), ...props }));
|
|
7
|
-
export const SourcesTrigger = ({ className, count, children, ...props }) => (_jsx(CollapsibleTrigger, { className: cn("flex items-center gap-2", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsxs("p", { className: "font-medium", children: ["Used ", count, " sources"] }), _jsx(ChevronDownIcon, { className: "h-4 w-4" })] })) }));
|
|
8
|
-
export const SourcesContent = ({ className, ...props }) => (_jsx(CollapsibleContent, { className: cn("mt-3 flex w-fit flex-col gap-2", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", className), ...props }));
|
|
9
|
-
export const Source = ({ href, title, children, ...props }) => (_jsx("a", { className: "flex items-center gap-2", href: href, rel: "noreferrer", target: "_blank", ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(BookIcon, { className: "h-4 w-4" }), _jsx("span", { className: "block font-medium", children: title })] })) }));
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
interface SpeechRecognition extends EventTarget {
|
|
4
|
-
continuous: boolean;
|
|
5
|
-
interimResults: boolean;
|
|
6
|
-
lang: string;
|
|
7
|
-
start(): void;
|
|
8
|
-
stop(): void;
|
|
9
|
-
onstart: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
10
|
-
onend: ((this: SpeechRecognition, ev: Event) => void) | null;
|
|
11
|
-
onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => void) | null;
|
|
12
|
-
onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => void) | null;
|
|
13
|
-
}
|
|
14
|
-
interface SpeechRecognitionEvent extends Event {
|
|
15
|
-
results: SpeechRecognitionResultList;
|
|
16
|
-
resultIndex: number;
|
|
17
|
-
}
|
|
18
|
-
interface SpeechRecognitionResultList {
|
|
19
|
-
readonly length: number;
|
|
20
|
-
item(index: number): SpeechRecognitionResult;
|
|
21
|
-
[index: number]: SpeechRecognitionResult;
|
|
22
|
-
}
|
|
23
|
-
interface SpeechRecognitionResult {
|
|
24
|
-
readonly length: number;
|
|
25
|
-
item(index: number): SpeechRecognitionAlternative;
|
|
26
|
-
[index: number]: SpeechRecognitionAlternative;
|
|
27
|
-
isFinal: boolean;
|
|
28
|
-
}
|
|
29
|
-
interface SpeechRecognitionAlternative {
|
|
30
|
-
transcript: string;
|
|
31
|
-
confidence: number;
|
|
32
|
-
}
|
|
33
|
-
interface SpeechRecognitionErrorEvent extends Event {
|
|
34
|
-
error: string;
|
|
35
|
-
}
|
|
36
|
-
declare global {
|
|
37
|
-
interface Window {
|
|
38
|
-
SpeechRecognition: new () => SpeechRecognition;
|
|
39
|
-
webkitSpeechRecognition: new () => SpeechRecognition;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export type SpeechInputProps = ComponentProps<typeof Button> & {
|
|
43
|
-
onTranscriptionChange?: (text: string) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Callback for when audio is recorded using MediaRecorder fallback.
|
|
46
|
-
* This is called in browsers that don't support the Web Speech API (Firefox, Safari).
|
|
47
|
-
* The callback receives an audio Blob that should be sent to a transcription service.
|
|
48
|
-
* Return the transcribed text, which will be passed to onTranscriptionChange.
|
|
49
|
-
*/
|
|
50
|
-
onAudioRecorded?: (audioBlob: Blob) => Promise<string>;
|
|
51
|
-
lang?: string;
|
|
52
|
-
};
|
|
53
|
-
export declare const SpeechInput: ({ className, onTranscriptionChange, onAudioRecorded, lang, ...props }: SpeechInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=speech-input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"speech-input.d.ts","sourceRoot":"","sources":["../../src/molecules/speech-input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAI3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,UAAU,iBAAkB,SAAQ,WAAW;IAC7C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/D,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7D,QAAQ,EACJ,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,sBAAsB,KAAK,IAAI,CAAC,GAC/D,IAAI,CAAC;IACT,OAAO,EACH,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,2BAA2B,KAAK,IAAI,CAAC,GACpE,IAAI,CAAC;CACV;AAED,UAAU,sBAAuB,SAAQ,KAAK;IAC5C,OAAO,EAAE,2BAA2B,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,2BAA2B;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAC7C,CAAC,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAAC;CAC1C;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,4BAA4B,CAAC;IAClD,CAAC,KAAK,EAAE,MAAM,GAAG,4BAA4B,CAAC;IAC9C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,4BAA4B;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,2BAA4B,SAAQ,KAAK;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,EAAE,UAAU,iBAAiB,CAAC;QAC/C,uBAAuB,EAAE,UAAU,iBAAiB,CAAC;KACtD;CACF;AAID,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC7D,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAkBF,eAAO,MAAM,WAAW,GAAI,uEAMzB,gBAAgB,4CAmOlB,CAAC"}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
4
|
-
import { Spinner } from "@chatsdk-dev/ui/components/spinner";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { MicIcon, SquareIcon } from "lucide-react";
|
|
7
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
|
-
const detectSpeechInputMode = () => {
|
|
9
|
-
if (typeof window === "undefined") {
|
|
10
|
-
return "none";
|
|
11
|
-
}
|
|
12
|
-
if ("SpeechRecognition" in window || "webkitSpeechRecognition" in window) {
|
|
13
|
-
return "speech-recognition";
|
|
14
|
-
}
|
|
15
|
-
if ("MediaRecorder" in window && "mediaDevices" in navigator) {
|
|
16
|
-
return "media-recorder";
|
|
17
|
-
}
|
|
18
|
-
return "none";
|
|
19
|
-
};
|
|
20
|
-
export const SpeechInput = ({ className, onTranscriptionChange, onAudioRecorded, lang = "en-US", ...props }) => {
|
|
21
|
-
const [isListening, setIsListening] = useState(false);
|
|
22
|
-
const [isProcessing, setIsProcessing] = useState(false);
|
|
23
|
-
const [mode] = useState(detectSpeechInputMode);
|
|
24
|
-
const [isRecognitionReady, setIsRecognitionReady] = useState(false);
|
|
25
|
-
const recognitionRef = useRef(null);
|
|
26
|
-
const mediaRecorderRef = useRef(null);
|
|
27
|
-
const streamRef = useRef(null);
|
|
28
|
-
const audioChunksRef = useRef([]);
|
|
29
|
-
const onTranscriptionChangeRef = useRef(onTranscriptionChange);
|
|
30
|
-
const onAudioRecordedRef = useRef(onAudioRecorded);
|
|
31
|
-
// Keep refs in sync
|
|
32
|
-
onTranscriptionChangeRef.current = onTranscriptionChange;
|
|
33
|
-
onAudioRecordedRef.current = onAudioRecorded;
|
|
34
|
-
// Initialize Speech Recognition when mode is speech-recognition
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (mode !== "speech-recognition") {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
40
|
-
const speechRecognition = new SpeechRecognition();
|
|
41
|
-
speechRecognition.continuous = true;
|
|
42
|
-
speechRecognition.interimResults = true;
|
|
43
|
-
speechRecognition.lang = lang;
|
|
44
|
-
const handleStart = () => {
|
|
45
|
-
setIsListening(true);
|
|
46
|
-
};
|
|
47
|
-
const handleEnd = () => {
|
|
48
|
-
setIsListening(false);
|
|
49
|
-
};
|
|
50
|
-
const handleResult = (event) => {
|
|
51
|
-
const speechEvent = event;
|
|
52
|
-
let finalTranscript = "";
|
|
53
|
-
for (let i = speechEvent.resultIndex; i < speechEvent.results.length; i += 1) {
|
|
54
|
-
const result = speechEvent.results[i];
|
|
55
|
-
if (result?.isFinal) {
|
|
56
|
-
finalTranscript += result[0]?.transcript ?? "";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (finalTranscript) {
|
|
60
|
-
onTranscriptionChangeRef.current?.(finalTranscript);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const handleError = () => {
|
|
64
|
-
setIsListening(false);
|
|
65
|
-
};
|
|
66
|
-
speechRecognition.addEventListener("start", handleStart);
|
|
67
|
-
speechRecognition.addEventListener("end", handleEnd);
|
|
68
|
-
speechRecognition.addEventListener("result", handleResult);
|
|
69
|
-
speechRecognition.addEventListener("error", handleError);
|
|
70
|
-
recognitionRef.current = speechRecognition;
|
|
71
|
-
setIsRecognitionReady(true);
|
|
72
|
-
return () => {
|
|
73
|
-
speechRecognition.removeEventListener("start", handleStart);
|
|
74
|
-
speechRecognition.removeEventListener("end", handleEnd);
|
|
75
|
-
speechRecognition.removeEventListener("result", handleResult);
|
|
76
|
-
speechRecognition.removeEventListener("error", handleError);
|
|
77
|
-
speechRecognition.stop();
|
|
78
|
-
recognitionRef.current = null;
|
|
79
|
-
setIsRecognitionReady(false);
|
|
80
|
-
};
|
|
81
|
-
}, [mode, lang]);
|
|
82
|
-
// Cleanup MediaRecorder and stream on unmount
|
|
83
|
-
useEffect(() => () => {
|
|
84
|
-
if (mediaRecorderRef.current?.state === "recording") {
|
|
85
|
-
mediaRecorderRef.current.stop();
|
|
86
|
-
}
|
|
87
|
-
if (streamRef.current) {
|
|
88
|
-
for (const track of streamRef.current.getTracks()) {
|
|
89
|
-
track.stop();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}, []);
|
|
93
|
-
// Start MediaRecorder recording
|
|
94
|
-
const startMediaRecorder = useCallback(async () => {
|
|
95
|
-
if (!onAudioRecordedRef.current) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
100
|
-
streamRef.current = stream;
|
|
101
|
-
const mediaRecorder = new MediaRecorder(stream);
|
|
102
|
-
audioChunksRef.current = [];
|
|
103
|
-
const handleDataAvailable = (event) => {
|
|
104
|
-
if (event.data.size > 0) {
|
|
105
|
-
audioChunksRef.current.push(event.data);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const handleStop = async () => {
|
|
109
|
-
for (const track of stream.getTracks()) {
|
|
110
|
-
track.stop();
|
|
111
|
-
}
|
|
112
|
-
streamRef.current = null;
|
|
113
|
-
const audioBlob = new Blob(audioChunksRef.current, {
|
|
114
|
-
type: "audio/webm",
|
|
115
|
-
});
|
|
116
|
-
if (audioBlob.size > 0 && onAudioRecordedRef.current) {
|
|
117
|
-
setIsProcessing(true);
|
|
118
|
-
try {
|
|
119
|
-
const transcript = await onAudioRecordedRef.current(audioBlob);
|
|
120
|
-
if (transcript) {
|
|
121
|
-
onTranscriptionChangeRef.current?.(transcript);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
// Error handling delegated to the onAudioRecorded caller
|
|
126
|
-
}
|
|
127
|
-
finally {
|
|
128
|
-
setIsProcessing(false);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const handleError = () => {
|
|
133
|
-
setIsListening(false);
|
|
134
|
-
for (const track of stream.getTracks()) {
|
|
135
|
-
track.stop();
|
|
136
|
-
}
|
|
137
|
-
streamRef.current = null;
|
|
138
|
-
};
|
|
139
|
-
mediaRecorder.addEventListener("dataavailable", handleDataAvailable);
|
|
140
|
-
mediaRecorder.addEventListener("stop", handleStop);
|
|
141
|
-
mediaRecorder.addEventListener("error", handleError);
|
|
142
|
-
mediaRecorderRef.current = mediaRecorder;
|
|
143
|
-
mediaRecorder.start();
|
|
144
|
-
setIsListening(true);
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
setIsListening(false);
|
|
148
|
-
}
|
|
149
|
-
}, []);
|
|
150
|
-
// Stop MediaRecorder recording
|
|
151
|
-
const stopMediaRecorder = useCallback(() => {
|
|
152
|
-
if (mediaRecorderRef.current?.state === "recording") {
|
|
153
|
-
mediaRecorderRef.current.stop();
|
|
154
|
-
}
|
|
155
|
-
setIsListening(false);
|
|
156
|
-
}, []);
|
|
157
|
-
const toggleListening = useCallback(() => {
|
|
158
|
-
if (mode === "speech-recognition" && recognitionRef.current) {
|
|
159
|
-
if (isListening) {
|
|
160
|
-
recognitionRef.current.stop();
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
recognitionRef.current.start();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else if (mode === "media-recorder") {
|
|
167
|
-
if (isListening) {
|
|
168
|
-
stopMediaRecorder();
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
startMediaRecorder();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}, [mode, isListening, startMediaRecorder, stopMediaRecorder]);
|
|
175
|
-
// Determine if button should be disabled
|
|
176
|
-
const isDisabled = mode === "none" ||
|
|
177
|
-
(mode === "speech-recognition" && !isRecognitionReady) ||
|
|
178
|
-
(mode === "media-recorder" && !onAudioRecorded) ||
|
|
179
|
-
isProcessing;
|
|
180
|
-
return (_jsxs("div", { className: "relative inline-flex items-center justify-center", children: [isListening &&
|
|
181
|
-
[0, 1, 2].map((index) => (_jsx("div", { className: "absolute inset-0 animate-ping rounded-full border-2 border-red-400/30", style: {
|
|
182
|
-
animationDelay: `${index * 0.3}s`,
|
|
183
|
-
animationDuration: "2s",
|
|
184
|
-
} }, index))), _jsxs(Button, { className: cn("relative z-10 rounded-full transition-all duration-300", isListening
|
|
185
|
-
? "bg-destructive text-white hover:bg-destructive/80 hover:text-white"
|
|
186
|
-
: "bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground", className), disabled: isDisabled, onClick: toggleListening, ...props, children: [isProcessing && _jsx(Spinner, {}), !isProcessing && isListening && _jsx(SquareIcon, { className: "size-4" }), !(isProcessing || isListening) && _jsx(MicIcon, { className: "size-4" })] })] }));
|
|
187
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import { CollapsibleContent, CollapsibleTrigger } from "@chatsdk-dev/ui/components/collapsible";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
-
export type StackTraceProps = ComponentProps<"div"> & {
|
|
5
|
-
trace: string;
|
|
6
|
-
open?: boolean;
|
|
7
|
-
defaultOpen?: boolean;
|
|
8
|
-
onOpenChange?: (open: boolean) => void;
|
|
9
|
-
onFilePathClick?: (filePath: string, line?: number, column?: number) => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const StackTrace: import("react").MemoExoticComponent<({ trace, className, open, defaultOpen, onOpenChange, onFilePathClick, children, ...props }: StackTraceProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
-
export type StackTraceHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
13
|
-
export declare const StackTraceHeader: import("react").MemoExoticComponent<({ className, children, ...props }: StackTraceHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
-
export type StackTraceErrorProps = ComponentProps<"div">;
|
|
15
|
-
export declare const StackTraceError: import("react").MemoExoticComponent<({ className, children, ...props }: StackTraceErrorProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
-
export type StackTraceErrorTypeProps = ComponentProps<"span">;
|
|
17
|
-
export declare const StackTraceErrorType: import("react").MemoExoticComponent<({ className, children, ...props }: StackTraceErrorTypeProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
-
export type StackTraceErrorMessageProps = ComponentProps<"span">;
|
|
19
|
-
export declare const StackTraceErrorMessage: import("react").MemoExoticComponent<({ className, children, ...props }: StackTraceErrorMessageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
|
-
export type StackTraceActionsProps = ComponentProps<"div">;
|
|
21
|
-
export declare const StackTraceActions: import("react").MemoExoticComponent<({ className, children, ...props }: StackTraceActionsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
-
export type StackTraceCopyButtonProps = ComponentProps<typeof Button> & {
|
|
23
|
-
onCopy?: () => void;
|
|
24
|
-
onError?: (error: Error) => void;
|
|
25
|
-
timeout?: number;
|
|
26
|
-
};
|
|
27
|
-
export declare const StackTraceCopyButton: import("react").MemoExoticComponent<({ onCopy, onError, timeout, className, children, ...props }: StackTraceCopyButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
28
|
-
export type StackTraceExpandButtonProps = ComponentProps<"div">;
|
|
29
|
-
export declare const StackTraceExpandButton: import("react").MemoExoticComponent<({ className, ...props }: StackTraceExpandButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
30
|
-
export type StackTraceContentProps = ComponentProps<typeof CollapsibleContent> & {
|
|
31
|
-
maxHeight?: number;
|
|
32
|
-
};
|
|
33
|
-
export declare const StackTraceContent: import("react").MemoExoticComponent<({ className, maxHeight, children, ...props }: StackTraceContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
34
|
-
export type StackTraceFramesProps = ComponentProps<"div"> & {
|
|
35
|
-
showInternalFrames?: boolean;
|
|
36
|
-
};
|
|
37
|
-
export declare const StackTraceFrames: import("react").MemoExoticComponent<({ className, showInternalFrames, ...props }: StackTraceFramesProps) => import("react/jsx-runtime").JSX.Element>;
|
|
38
|
-
//# sourceMappingURL=stack-trace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stack-trace.d.ts","sourceRoot":"","sources":["../../src/molecules/stack-trace.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAEL,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAQhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AA4I5C,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9E,CAAC;AAEF,eAAO,MAAM,UAAU,mIAUlB,eAAe,6CAkCnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9E,eAAO,MAAM,gBAAgB,0EACS,qBAAqB,6CAqB1D,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzD,eAAO,MAAM,eAAe,0EACU,oBAAoB,6CAYzD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,mBAAmB,0EACM,wBAAwB,6CAY7D,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,sBAAsB,0EACG,2BAA2B,6CAShE,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAS3D,eAAO,MAAM,iBAAiB,0EACQ,sBAAsB,6CAW3D,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACtE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,oBAAoB,oGAQ5B,yBAAyB,6CA6C7B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB,gEACP,2BAA2B,6CAiBtD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CACjD,OAAO,kBAAkB,CAC1B,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,iBAAiB,qFAMzB,sBAAsB,6CAmB1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC1D,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA2CF,eAAO,MAAM,gBAAgB,oFAKxB,qBAAqB,6CA8CzB,CAAC"}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
4
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
5
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/components/collapsible";
|
|
6
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
7
|
-
import { AlertTriangleIcon, CheckIcon, ChevronDownIcon, CopyIcon, } from "lucide-react";
|
|
8
|
-
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
9
|
-
// Regex patterns for parsing stack traces
|
|
10
|
-
const STACK_FRAME_WITH_PARENS_REGEX = /^at\s+(.+?)\s+\((.+):(\d+):(\d+)\)$/;
|
|
11
|
-
const STACK_FRAME_WITHOUT_FN_REGEX = /^at\s+(.+):(\d+):(\d+)$/;
|
|
12
|
-
const ERROR_TYPE_REGEX = /^(\w+Error|Error):\s*(.*)$/;
|
|
13
|
-
const AT_PREFIX_REGEX = /^at\s+/;
|
|
14
|
-
const StackTraceContext = createContext(null);
|
|
15
|
-
const useStackTrace = () => {
|
|
16
|
-
const context = useContext(StackTraceContext);
|
|
17
|
-
if (!context) {
|
|
18
|
-
throw new Error("StackTrace components must be used within StackTrace");
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
};
|
|
22
|
-
const parseStackFrame = (line) => {
|
|
23
|
-
const trimmed = line.trim();
|
|
24
|
-
// Pattern: at functionName (filePath:line:column)
|
|
25
|
-
const withParensMatch = trimmed.match(STACK_FRAME_WITH_PARENS_REGEX);
|
|
26
|
-
if (withParensMatch) {
|
|
27
|
-
const [, functionName, filePath, lineNum, colNum] = withParensMatch;
|
|
28
|
-
const isInternal = filePath?.includes("node_modules") ||
|
|
29
|
-
filePath?.startsWith("node:") ||
|
|
30
|
-
!!filePath?.includes("internal/");
|
|
31
|
-
return {
|
|
32
|
-
columnNumber: colNum ? Number.parseInt(colNum, 10) : null,
|
|
33
|
-
filePath: filePath ?? null,
|
|
34
|
-
functionName: functionName ?? null,
|
|
35
|
-
isInternal,
|
|
36
|
-
lineNumber: lineNum ? Number.parseInt(lineNum, 10) : null,
|
|
37
|
-
raw: trimmed,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
// Pattern: at filePath:line:column (no function name)
|
|
41
|
-
const withoutFnMatch = trimmed.match(STACK_FRAME_WITHOUT_FN_REGEX);
|
|
42
|
-
if (withoutFnMatch) {
|
|
43
|
-
const [, filePath, lineNum, colNum] = withoutFnMatch;
|
|
44
|
-
const isInternal = (filePath?.includes("node_modules") ?? false) ||
|
|
45
|
-
(filePath?.startsWith("node:") ?? false) ||
|
|
46
|
-
(filePath?.includes("internal/") ?? false);
|
|
47
|
-
return {
|
|
48
|
-
columnNumber: colNum ? Number.parseInt(colNum, 10) : null,
|
|
49
|
-
filePath: filePath ?? null,
|
|
50
|
-
functionName: null,
|
|
51
|
-
isInternal,
|
|
52
|
-
lineNumber: lineNum ? Number.parseInt(lineNum, 10) : null,
|
|
53
|
-
raw: trimmed,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Fallback: unparseable line
|
|
57
|
-
return {
|
|
58
|
-
columnNumber: null,
|
|
59
|
-
filePath: null,
|
|
60
|
-
functionName: null,
|
|
61
|
-
isInternal: trimmed.includes("node_modules") || trimmed.includes("node:"),
|
|
62
|
-
lineNumber: null,
|
|
63
|
-
raw: trimmed,
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
const parseStackTrace = (trace) => {
|
|
67
|
-
const lines = trace.split("\n").filter((line) => line.trim());
|
|
68
|
-
if (lines.length === 0) {
|
|
69
|
-
return {
|
|
70
|
-
errorMessage: trace,
|
|
71
|
-
errorType: null,
|
|
72
|
-
frames: [],
|
|
73
|
-
raw: trace,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const firstLine = lines[0]?.trim() ?? "";
|
|
77
|
-
let errorType = null;
|
|
78
|
-
let errorMessage = firstLine;
|
|
79
|
-
// Try to extract error type from "ErrorType: message" format
|
|
80
|
-
const errorMatch = firstLine.match(ERROR_TYPE_REGEX);
|
|
81
|
-
if (errorMatch) {
|
|
82
|
-
const [, type, msg] = errorMatch;
|
|
83
|
-
errorType = type ?? null;
|
|
84
|
-
errorMessage = msg || "";
|
|
85
|
-
}
|
|
86
|
-
// Parse stack frames (lines starting with "at")
|
|
87
|
-
const frames = lines
|
|
88
|
-
.slice(1)
|
|
89
|
-
.filter((line) => line.trim().startsWith("at "))
|
|
90
|
-
.map(parseStackFrame);
|
|
91
|
-
return {
|
|
92
|
-
errorMessage,
|
|
93
|
-
errorType,
|
|
94
|
-
frames,
|
|
95
|
-
raw: trace,
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
export const StackTrace = memo(({ trace, className, open, defaultOpen = false, onOpenChange, onFilePathClick, children, ...props }) => {
|
|
99
|
-
const [isOpen, setIsOpen] = useControllableState({
|
|
100
|
-
defaultProp: defaultOpen,
|
|
101
|
-
onChange: onOpenChange,
|
|
102
|
-
prop: open,
|
|
103
|
-
});
|
|
104
|
-
const parsedTrace = useMemo(() => parseStackTrace(trace), [trace]);
|
|
105
|
-
const contextValue = useMemo(() => ({
|
|
106
|
-
isOpen,
|
|
107
|
-
onFilePathClick,
|
|
108
|
-
raw: trace,
|
|
109
|
-
setIsOpen,
|
|
110
|
-
trace: parsedTrace,
|
|
111
|
-
}), [parsedTrace, trace, isOpen, setIsOpen, onFilePathClick]);
|
|
112
|
-
return (_jsx(StackTraceContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("not-prose w-full overflow-hidden rounded-lg border bg-background font-mono text-sm", className), ...props, children: children }) }));
|
|
113
|
-
});
|
|
114
|
-
export const StackTraceHeader = memo(({ className, children, ...props }) => {
|
|
115
|
-
const { isOpen, setIsOpen } = useStackTrace();
|
|
116
|
-
return (_jsx(Collapsible, { onOpenChange: setIsOpen, open: isOpen, children: _jsx(CollapsibleTrigger, { render: () => (_jsx("button", { className: cn("flex w-full cursor-pointer items-center gap-3 p-3 text-left transition-colors hover:bg-muted/50", className), ...props, children: children })) }) }));
|
|
117
|
-
});
|
|
118
|
-
export const StackTraceError = memo(({ className, children, ...props }) => (_jsxs("div", { className: cn("flex flex-1 items-center gap-2 overflow-hidden", className), ...props, children: [_jsx(AlertTriangleIcon, { className: "size-4 shrink-0 text-destructive" }), children] })));
|
|
119
|
-
export const StackTraceErrorType = memo(({ className, children, ...props }) => {
|
|
120
|
-
const { trace } = useStackTrace();
|
|
121
|
-
return (_jsx("span", { className: cn("shrink-0 font-semibold text-destructive", className), ...props, children: children ?? trace.errorType }));
|
|
122
|
-
});
|
|
123
|
-
export const StackTraceErrorMessage = memo(({ className, children, ...props }) => {
|
|
124
|
-
const { trace } = useStackTrace();
|
|
125
|
-
return (_jsx("span", { className: cn("truncate text-foreground", className), ...props, children: children ?? trace.errorMessage }));
|
|
126
|
-
});
|
|
127
|
-
const handleActionsClick = (e) => e.stopPropagation();
|
|
128
|
-
const handleActionsKeyDown = (e) => {
|
|
129
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
130
|
-
e.stopPropagation();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
export const StackTraceActions = memo(({ className, children, ...props }) => (_jsx("div", { className: cn("flex shrink-0 items-center gap-1", className), onClick: handleActionsClick, onKeyDown: handleActionsKeyDown, role: "group", ...props, children: children })));
|
|
134
|
-
export const StackTraceCopyButton = memo(({ onCopy, onError, timeout = 2000, className, children, ...props }) => {
|
|
135
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
136
|
-
const timeoutRef = useRef(0);
|
|
137
|
-
const { raw } = useStackTrace();
|
|
138
|
-
const copyToClipboard = useCallback(async () => {
|
|
139
|
-
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
140
|
-
onError?.(new Error("Clipboard API not available"));
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
await navigator.clipboard.writeText(raw);
|
|
145
|
-
setIsCopied(true);
|
|
146
|
-
onCopy?.();
|
|
147
|
-
timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
onError?.(error);
|
|
151
|
-
}
|
|
152
|
-
}, [raw, onCopy, onError, timeout]);
|
|
153
|
-
useEffect(() => () => {
|
|
154
|
-
window.clearTimeout(timeoutRef.current);
|
|
155
|
-
}, []);
|
|
156
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
157
|
-
return (_jsx(Button, { className: cn("size-7", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 14 }) }));
|
|
158
|
-
});
|
|
159
|
-
export const StackTraceExpandButton = memo(({ className, ...props }) => {
|
|
160
|
-
const { isOpen } = useStackTrace();
|
|
161
|
-
return (_jsx("div", { className: cn("flex size-7 items-center justify-center", className), ...props, children: _jsx(ChevronDownIcon, { className: cn("size-4 text-muted-foreground transition-transform", isOpen ? "rotate-180" : "rotate-0") }) }));
|
|
162
|
-
});
|
|
163
|
-
export const StackTraceContent = memo(({ className, maxHeight = 400, children, ...props }) => {
|
|
164
|
-
const { isOpen } = useStackTrace();
|
|
165
|
-
return (_jsx(Collapsible, { open: isOpen, children: _jsx(CollapsibleContent, { className: cn("overflow-auto border-t bg-muted/30", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=open]:animate-in", className), style: { maxHeight }, ...props, children: children }) }));
|
|
166
|
-
});
|
|
167
|
-
const FilePathButton = memo(({ frame, onFilePathClick }) => {
|
|
168
|
-
const handleClick = useCallback(() => {
|
|
169
|
-
if (frame.filePath) {
|
|
170
|
-
onFilePathClick?.(frame.filePath, frame.lineNumber ?? undefined, frame.columnNumber ?? undefined);
|
|
171
|
-
}
|
|
172
|
-
}, [frame, onFilePathClick]);
|
|
173
|
-
return (_jsxs("button", { className: cn("underline decoration-dotted hover:text-primary", onFilePathClick && "cursor-pointer"), disabled: !onFilePathClick, onClick: handleClick, type: "button", children: [frame.filePath, frame.lineNumber !== null && `:${frame.lineNumber}`, frame.columnNumber !== null && `:${frame.columnNumber}`] }));
|
|
174
|
-
});
|
|
175
|
-
FilePathButton.displayName = "FilePathButton";
|
|
176
|
-
export const StackTraceFrames = memo(({ className, showInternalFrames = true, ...props }) => {
|
|
177
|
-
const { trace, onFilePathClick } = useStackTrace();
|
|
178
|
-
const framesToShow = showInternalFrames
|
|
179
|
-
? trace.frames
|
|
180
|
-
: trace.frames.filter((f) => !f.isInternal);
|
|
181
|
-
return (_jsxs("div", { className: cn("space-y-1 p-3", className), ...props, children: [framesToShow.map((frame) => (_jsxs("div", { className: cn("text-xs", frame.isInternal
|
|
182
|
-
? "text-muted-foreground/50"
|
|
183
|
-
: "text-foreground/90"), children: [_jsx("span", { className: "text-muted-foreground", children: "at " }), frame.functionName && (_jsxs("span", { className: frame.isInternal ? "" : "text-foreground", children: [frame.functionName, " "] })), frame.filePath && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", children: "(" }), _jsx(FilePathButton, { frame: frame, onFilePathClick: onFilePathClick }), _jsx("span", { className: "text-muted-foreground", children: ")" })] })), !(frame.filePath || frame.functionName) && (_jsx("span", { children: frame.raw.replace(AT_PREFIX_REGEX, "") }))] }, frame.raw))), framesToShow.length === 0 && (_jsx("div", { className: "text-muted-foreground text-xs", children: "No stack frames" }))] }));
|
|
184
|
-
});
|
|
185
|
-
StackTrace.displayName = "StackTrace";
|
|
186
|
-
StackTraceHeader.displayName = "StackTraceHeader";
|
|
187
|
-
StackTraceError.displayName = "StackTraceError";
|
|
188
|
-
StackTraceErrorType.displayName = "StackTraceErrorType";
|
|
189
|
-
StackTraceErrorMessage.displayName = "StackTraceErrorMessage";
|
|
190
|
-
StackTraceActions.displayName = "StackTraceActions";
|
|
191
|
-
StackTraceCopyButton.displayName = "StackTraceCopyButton";
|
|
192
|
-
StackTraceExpandButton.displayName = "StackTraceExpandButton";
|
|
193
|
-
StackTraceContent.displayName = "StackTraceContent";
|
|
194
|
-
StackTraceFrames.displayName = "StackTraceFrames";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import { ScrollArea } from "@chatsdk-dev/ui/components/scroll-area";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
-
export type SuggestionsProps = ComponentProps<typeof ScrollArea>;
|
|
5
|
-
export declare const Suggestions: ({ className, children, ...props }: SuggestionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export type SuggestionProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
|
|
7
|
-
suggestion: string;
|
|
8
|
-
onClick?: (suggestion: string) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const Suggestion: ({ suggestion, onClick, className, variant, size, children, ...props }: SuggestionProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
//# sourceMappingURL=suggestion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../src/molecules/suggestion.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAa,MAAM,wCAAwC,CAAC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEjE,eAAO,MAAM,WAAW,GAAI,mCAIzB,gBAAgB,4CAOlB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,uEAQxB,eAAe,4CAiBjB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
4
|
-
import { ScrollArea, ScrollBar } from "@chatsdk-dev/ui/components/scroll-area";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { useCallback } from "react";
|
|
7
|
-
export const Suggestions = ({ className, children, ...props }) => (_jsxs(ScrollArea, { className: "w-full overflow-x-auto whitespace-nowrap", ...props, children: [_jsx("div", { className: cn("flex w-max flex-nowrap items-center gap-2", className), children: children }), _jsx(ScrollBar, { className: "hidden", orientation: "horizontal" })] }));
|
|
8
|
-
export const Suggestion = ({ suggestion, onClick, className, variant = "outline", size = "sm", children, ...props }) => {
|
|
9
|
-
const handleClick = useCallback(() => {
|
|
10
|
-
onClick?.(suggestion);
|
|
11
|
-
}, [onClick, suggestion]);
|
|
12
|
-
return (_jsx(Button, { className: cn("cursor-pointer rounded-full px-4", className), onClick: handleClick, size: size, type: "button", variant: variant, ...props, children: children || suggestion }));
|
|
13
|
-
};
|
package/dist/molecules/task.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@chatsdk-dev/ui/components/collapsible";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
3
|
-
export type TaskItemFileProps = ComponentProps<"div">;
|
|
4
|
-
export declare const TaskItemFile: ({ children, className, ...props }: TaskItemFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export type TaskItemProps = ComponentProps<"div">;
|
|
6
|
-
export declare const TaskItem: ({ children, className, ...props }: TaskItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type TaskProps = ComponentProps<typeof Collapsible>;
|
|
8
|
-
export declare const Task: ({ defaultOpen, className, ...props }: TaskProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type TaskTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
|
|
10
|
-
title: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const TaskTrigger: ({ children, className, title, ...props }: TaskTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export type TaskContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
14
|
-
export declare const TaskContent: ({ children, className, ...props }: TaskContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
//# sourceMappingURL=task.d.ts.map
|