@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,39 +0,0 @@
|
|
|
1
|
-
import { Badge } from "@chatsdk-dev/ui/components/badge";
|
|
2
|
-
import { Carousel } from "@chatsdk-dev/ui/components/carousel";
|
|
3
|
-
import { HoverCard } from "@chatsdk-dev/ui/components/hover-card";
|
|
4
|
-
import type { ComponentProps } from "react";
|
|
5
|
-
export type InlineCitationProps = ComponentProps<"span">;
|
|
6
|
-
export declare const InlineCitation: ({ className, ...props }: InlineCitationProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type InlineCitationTextProps = ComponentProps<"span">;
|
|
8
|
-
export declare const InlineCitationText: ({ className, ...props }: InlineCitationTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type InlineCitationCardProps = ComponentProps<typeof HoverCard>;
|
|
10
|
-
export declare const InlineCitationCard: (props: InlineCitationCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export type InlineCitationCardTriggerProps = ComponentProps<typeof Badge> & {
|
|
12
|
-
sources: string[];
|
|
13
|
-
};
|
|
14
|
-
export declare const InlineCitationCardTrigger: ({ sources, className, ...props }: InlineCitationCardTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export type InlineCitationCardBodyProps = ComponentProps<"div">;
|
|
16
|
-
export declare const InlineCitationCardBody: ({ className, ...props }: InlineCitationCardBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export type InlineCitationCarouselProps = ComponentProps<typeof Carousel>;
|
|
18
|
-
export declare const InlineCitationCarousel: ({ className, children, ...props }: InlineCitationCarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export type InlineCitationCarouselContentProps = ComponentProps<"div">;
|
|
20
|
-
export declare const InlineCitationCarouselContent: (props: InlineCitationCarouselContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export type InlineCitationCarouselItemProps = ComponentProps<"div">;
|
|
22
|
-
export declare const InlineCitationCarouselItem: ({ className, ...props }: InlineCitationCarouselItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export type InlineCitationCarouselHeaderProps = ComponentProps<"div">;
|
|
24
|
-
export declare const InlineCitationCarouselHeader: ({ className, ...props }: InlineCitationCarouselHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export type InlineCitationCarouselIndexProps = ComponentProps<"div">;
|
|
26
|
-
export declare const InlineCitationCarouselIndex: ({ children, className, ...props }: InlineCitationCarouselIndexProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export type InlineCitationCarouselPrevProps = ComponentProps<"button">;
|
|
28
|
-
export declare const InlineCitationCarouselPrev: ({ className, ...props }: InlineCitationCarouselPrevProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export type InlineCitationCarouselNextProps = ComponentProps<"button">;
|
|
30
|
-
export declare const InlineCitationCarouselNext: ({ className, ...props }: InlineCitationCarouselNextProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export type InlineCitationSourceProps = ComponentProps<"div"> & {
|
|
32
|
-
title?: string;
|
|
33
|
-
url?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
};
|
|
36
|
-
export declare const InlineCitationSource: ({ title, url, description, className, children, ...props }: InlineCitationSourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export type InlineCitationQuoteProps = ComponentProps<"blockquote">;
|
|
38
|
-
export declare const InlineCitationQuote: ({ children, className, ...props }: InlineCitationQuoteProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
//# sourceMappingURL=inline-citation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inline-citation.d.ts","sourceRoot":"","sources":["../../src/molecules/inline-citation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EACL,QAAQ,EAGT,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,SAAS,EAGV,MAAM,uCAAuC,CAAC;AAG/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAS5C,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,GAAI,yBAG5B,mBAAmB,4CAKrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,kBAAkB,GAAI,yBAGhC,uBAAuB,4CAKzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAEhE,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,GAAG;IAC1E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,kCAIvC,8BAA8B,4CAmBhC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB,GAAI,yBAGpC,2BAA2B,4CAE7B,CAAC;AASF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE1E,eAAO,MAAM,sBAAsB,GAAI,mCAIpC,2BAA2B,4CAU7B,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B,GACxC,OAAO,kCAAkC,4CACR,CAAC;AAEpC,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEpE,eAAO,MAAM,0BAA0B,GAAI,yBAGxC,+BAA+B,4CAKjC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtE,eAAO,MAAM,4BAA4B,GAAI,yBAG1C,iCAAiC,4CAQnC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAErE,eAAO,MAAM,2BAA2B,GAAI,mCAIzC,gCAAgC,4CAsClC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEvE,eAAO,MAAM,0BAA0B,GAAI,yBAGxC,+BAA+B,4CAoBjC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;AAEvE,eAAO,MAAM,0BAA0B,GAAI,yBAGxC,+BAA+B,4CAoBjC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,4DAOlC,yBAAyB,4CAe3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB,GAAI,mCAIjC,wBAAwB,4CAU1B,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Badge } from "@chatsdk-dev/ui/components/badge";
|
|
4
|
-
import { Carousel, CarouselContent, CarouselItem, } from "@chatsdk-dev/ui/components/carousel";
|
|
5
|
-
import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@chatsdk-dev/ui/components/hover-card";
|
|
6
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
7
|
-
import { ArrowLeftIcon, ArrowRightIcon } from "lucide-react";
|
|
8
|
-
import { createContext, useCallback, useContext, useEffect, useState, } from "react";
|
|
9
|
-
export const InlineCitation = ({ className, ...props }) => (_jsx("span", { className: cn("group inline items-center gap-1", className), ...props }));
|
|
10
|
-
export const InlineCitationText = ({ className, ...props }) => (_jsx("span", { className: cn("transition-colors group-hover:bg-accent", className), ...props }));
|
|
11
|
-
export const InlineCitationCard = (props) => (_jsx(HoverCard, { ...props }));
|
|
12
|
-
export const InlineCitationCardTrigger = ({ sources, className, ...props }) => (_jsx(HoverCardTrigger, { render: () => (_jsx(Badge, { className: cn("ml-1 rounded-full", className), variant: "secondary", ...props, children: sources[0] ? (_jsxs(_Fragment, { children: [new URL(sources[0]).hostname, " ", sources.length > 1 && `+${sources.length - 1}`] })) : ("unknown") })) }));
|
|
13
|
-
export const InlineCitationCardBody = ({ className, ...props }) => (_jsx(HoverCardContent, { className: cn("relative w-80 p-0", className), ...props }));
|
|
14
|
-
const CarouselApiContext = createContext(undefined);
|
|
15
|
-
const useCarouselApi = () => {
|
|
16
|
-
const context = useContext(CarouselApiContext);
|
|
17
|
-
return context;
|
|
18
|
-
};
|
|
19
|
-
export const InlineCitationCarousel = ({ className, children, ...props }) => {
|
|
20
|
-
const [api, setApi] = useState();
|
|
21
|
-
return (_jsx(CarouselApiContext.Provider, { value: api, children: _jsx(Carousel, { className: cn("w-full", className), setApi: setApi, ...props, children: children }) }));
|
|
22
|
-
};
|
|
23
|
-
export const InlineCitationCarouselContent = (props) => _jsx(CarouselContent, { ...props });
|
|
24
|
-
export const InlineCitationCarouselItem = ({ className, ...props }) => (_jsx(CarouselItem, { className: cn("w-full space-y-2 p-4 pl-8", className), ...props }));
|
|
25
|
-
export const InlineCitationCarouselHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between gap-2 rounded-t-md bg-secondary p-2", className), ...props }));
|
|
26
|
-
export const InlineCitationCarouselIndex = ({ children, className, ...props }) => {
|
|
27
|
-
const api = useCarouselApi();
|
|
28
|
-
const [current, setCurrent] = useState(0);
|
|
29
|
-
const [count, setCount] = useState(0);
|
|
30
|
-
const syncState = useCallback(() => {
|
|
31
|
-
if (!api) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
setCount(api.scrollSnapList().length);
|
|
35
|
-
setCurrent(api.selectedScrollSnap() + 1);
|
|
36
|
-
}, [api]);
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
if (!api) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
syncState();
|
|
42
|
-
api.on("select", syncState);
|
|
43
|
-
return () => {
|
|
44
|
-
api.off("select", syncState);
|
|
45
|
-
};
|
|
46
|
-
}, [api, syncState]);
|
|
47
|
-
return (_jsx("div", { className: cn("flex flex-1 items-center justify-end px-3 py-1 text-muted-foreground text-xs", className), ...props, children: children ?? `${current}/${count}` }));
|
|
48
|
-
};
|
|
49
|
-
export const InlineCitationCarouselPrev = ({ className, ...props }) => {
|
|
50
|
-
const api = useCarouselApi();
|
|
51
|
-
const handleClick = useCallback(() => {
|
|
52
|
-
if (api) {
|
|
53
|
-
api.scrollPrev();
|
|
54
|
-
}
|
|
55
|
-
}, [api]);
|
|
56
|
-
return (_jsx("button", { "aria-label": "Previous", className: cn("shrink-0", className), onClick: handleClick, type: "button", ...props, children: _jsx(ArrowLeftIcon, { className: "size-4 text-muted-foreground" }) }));
|
|
57
|
-
};
|
|
58
|
-
export const InlineCitationCarouselNext = ({ className, ...props }) => {
|
|
59
|
-
const api = useCarouselApi();
|
|
60
|
-
const handleClick = useCallback(() => {
|
|
61
|
-
if (api) {
|
|
62
|
-
api.scrollNext();
|
|
63
|
-
}
|
|
64
|
-
}, [api]);
|
|
65
|
-
return (_jsx("button", { "aria-label": "Next", className: cn("shrink-0", className), onClick: handleClick, type: "button", ...props, children: _jsx(ArrowRightIcon, { className: "size-4 text-muted-foreground" }) }));
|
|
66
|
-
};
|
|
67
|
-
export const InlineCitationSource = ({ title, url, description, className, children, ...props }) => (_jsxs("div", { className: cn("space-y-1", className), ...props, children: [title && (_jsx("h4", { className: "truncate font-medium text-sm leading-tight", children: title })), url && (_jsx("p", { className: "truncate break-all text-muted-foreground text-xs", children: url })), description && (_jsx("p", { className: "line-clamp-3 text-muted-foreground text-sm leading-relaxed", children: description })), children] }));
|
|
68
|
-
export const InlineCitationQuote = ({ children, className, ...props }) => (_jsx("blockquote", { className: cn("border-muted border-l-2 pl-3 text-muted-foreground text-sm italic", className), ...props, children: children }));
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
-
import type { TProps as JsxParserProps } from "react-jsx-parser";
|
|
3
|
-
interface JSXPreviewContextValue {
|
|
4
|
-
jsx: string;
|
|
5
|
-
processedJsx: string;
|
|
6
|
-
isStreaming: boolean;
|
|
7
|
-
error: Error | null;
|
|
8
|
-
setError: (error: Error | null) => void;
|
|
9
|
-
setLastGoodJsx: (jsx: string) => void;
|
|
10
|
-
components: JsxParserProps["components"];
|
|
11
|
-
bindings: JsxParserProps["bindings"];
|
|
12
|
-
onErrorProp?: (error: Error) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const useJSXPreview: () => JSXPreviewContextValue;
|
|
15
|
-
export type JSXPreviewProps = ComponentProps<"div"> & {
|
|
16
|
-
jsx: string;
|
|
17
|
-
isStreaming?: boolean;
|
|
18
|
-
components?: JsxParserProps["components"];
|
|
19
|
-
bindings?: JsxParserProps["bindings"];
|
|
20
|
-
onError?: (error: Error) => void;
|
|
21
|
-
};
|
|
22
|
-
export declare const JSXPreview: import("react").MemoExoticComponent<({ jsx, isStreaming, components, bindings, onError, className, children, ...props }: JSXPreviewProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
|
-
export type JSXPreviewContentProps = Omit<ComponentProps<"div">, "children">;
|
|
24
|
-
export declare const JSXPreviewContent: import("react").MemoExoticComponent<({ className, ...props }: JSXPreviewContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
25
|
-
export type JSXPreviewErrorProps = ComponentProps<"div"> & {
|
|
26
|
-
children?: ReactNode | ((error: Error) => ReactNode);
|
|
27
|
-
};
|
|
28
|
-
export declare const JSXPreviewError: import("react").MemoExoticComponent<({ className, children, ...props }: JSXPreviewErrorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=jsx-preview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-preview.d.ts","sourceRoot":"","sources":["../../src/molecules/jsx-preview.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvD,OAAO,KAAK,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGjE,UAAU,sBAAsB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACzC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACtC;AAMD,eAAO,MAAM,aAAa,8BAMzB,CAAC;AAqFF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,UAAU,2HAUlB,eAAe,6CAgDnB,CAAC;AAIF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;AAE7E,eAAO,MAAM,iBAAiB,gEACF,sBAAsB,6CAgEjD,CAAC;AAIF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC;CACtD,CAAC;AAYF,eAAO,MAAM,eAAe,0EACU,oBAAoB,oDA0BzD,CAAC"}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
4
|
-
import { AlertCircle } from "lucide-react";
|
|
5
|
-
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
6
|
-
import JsxParser from "react-jsx-parser";
|
|
7
|
-
const JSXPreviewContext = createContext(null);
|
|
8
|
-
const TAG_REGEX = /<\/?([a-zA-Z][a-zA-Z0-9]*)\s*([^>]*?)(\/)?>/;
|
|
9
|
-
export const useJSXPreview = () => {
|
|
10
|
-
const context = useContext(JSXPreviewContext);
|
|
11
|
-
if (!context) {
|
|
12
|
-
throw new Error("JSXPreview components must be used within JSXPreview");
|
|
13
|
-
}
|
|
14
|
-
return context;
|
|
15
|
-
};
|
|
16
|
-
const matchJsxTag = (code) => {
|
|
17
|
-
if (code.trim() === "") {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const match = code.match(TAG_REGEX);
|
|
21
|
-
if (!match || match.index === undefined) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
const [fullMatch, tagName, attributes, selfClosing] = match;
|
|
25
|
-
let type;
|
|
26
|
-
if (selfClosing) {
|
|
27
|
-
type = "self-closing";
|
|
28
|
-
}
|
|
29
|
-
else if (fullMatch.startsWith("</")) {
|
|
30
|
-
type = "closing";
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
type = "opening";
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
attributes: attributes?.trim(),
|
|
37
|
-
endIndex: match.index + fullMatch.length,
|
|
38
|
-
startIndex: match.index,
|
|
39
|
-
tag: fullMatch,
|
|
40
|
-
tagName,
|
|
41
|
-
type,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const stripIncompleteTag = (text) => {
|
|
45
|
-
// Find the last '<' that isn't part of a complete tag
|
|
46
|
-
const lastOpen = text.lastIndexOf("<");
|
|
47
|
-
if (lastOpen === -1) {
|
|
48
|
-
return text;
|
|
49
|
-
}
|
|
50
|
-
const afterOpen = text.slice(lastOpen);
|
|
51
|
-
// If there's no closing '>' after the last '<', it's an incomplete tag
|
|
52
|
-
if (!afterOpen.includes(">")) {
|
|
53
|
-
return text.slice(0, lastOpen);
|
|
54
|
-
}
|
|
55
|
-
return text;
|
|
56
|
-
};
|
|
57
|
-
const completeJsxTag = (code) => {
|
|
58
|
-
const stack = [];
|
|
59
|
-
let result = "";
|
|
60
|
-
let currentPosition = 0;
|
|
61
|
-
while (currentPosition < code.length) {
|
|
62
|
-
const match = matchJsxTag(code.slice(currentPosition));
|
|
63
|
-
if (!match) {
|
|
64
|
-
// No more tags found, strip any trailing incomplete tag
|
|
65
|
-
result += stripIncompleteTag(code.slice(currentPosition));
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
const { tagName, type, endIndex } = match;
|
|
69
|
-
// Include any text content before this tag
|
|
70
|
-
result += code.slice(currentPosition, currentPosition + endIndex);
|
|
71
|
-
if (type === "opening") {
|
|
72
|
-
stack.push(tagName ?? "");
|
|
73
|
-
}
|
|
74
|
-
else if (type === "closing") {
|
|
75
|
-
stack.pop();
|
|
76
|
-
}
|
|
77
|
-
currentPosition += endIndex;
|
|
78
|
-
}
|
|
79
|
-
return (result +
|
|
80
|
-
stack
|
|
81
|
-
.reverse()
|
|
82
|
-
.map((tag) => `</${tag}>`)
|
|
83
|
-
.join(""));
|
|
84
|
-
};
|
|
85
|
-
export const JSXPreview = memo(({ jsx, isStreaming = false, components, bindings, onError, className, children, ...props }) => {
|
|
86
|
-
const [prevJsx, setPrevJsx] = useState(jsx);
|
|
87
|
-
const [error, setError] = useState(null);
|
|
88
|
-
const [_lastGoodJsx, setLastGoodJsx] = useState("");
|
|
89
|
-
// Clear error when jsx changes (derived state pattern)
|
|
90
|
-
if (jsx !== prevJsx) {
|
|
91
|
-
setPrevJsx(jsx);
|
|
92
|
-
setError(null);
|
|
93
|
-
}
|
|
94
|
-
const processedJsx = useMemo(() => (isStreaming ? completeJsxTag(jsx) : jsx), [jsx, isStreaming]);
|
|
95
|
-
const contextValue = useMemo(() => ({
|
|
96
|
-
bindings,
|
|
97
|
-
components,
|
|
98
|
-
error,
|
|
99
|
-
isStreaming,
|
|
100
|
-
jsx,
|
|
101
|
-
onErrorProp: onError,
|
|
102
|
-
processedJsx,
|
|
103
|
-
setError,
|
|
104
|
-
setLastGoodJsx,
|
|
105
|
-
}), [
|
|
106
|
-
bindings,
|
|
107
|
-
components,
|
|
108
|
-
error,
|
|
109
|
-
isStreaming,
|
|
110
|
-
jsx,
|
|
111
|
-
onError,
|
|
112
|
-
processedJsx,
|
|
113
|
-
setError,
|
|
114
|
-
]);
|
|
115
|
-
return (_jsx(JSXPreviewContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("relative", className), ...props, children: children }) }));
|
|
116
|
-
});
|
|
117
|
-
JSXPreview.displayName = "JSXPreview";
|
|
118
|
-
export const JSXPreviewContent = memo(({ className, ...props }) => {
|
|
119
|
-
const { processedJsx, isStreaming, components, bindings, setError, setLastGoodJsx, onErrorProp, } = useJSXPreview();
|
|
120
|
-
const errorReportedRef = useRef(null);
|
|
121
|
-
const lastGoodJsxRef = useRef("");
|
|
122
|
-
const [hadError, setHadError] = useState(false);
|
|
123
|
-
// Reset error tracking when jsx changes
|
|
124
|
-
useEffect(() => {
|
|
125
|
-
errorReportedRef.current = null;
|
|
126
|
-
setHadError(false);
|
|
127
|
-
}, [processedJsx]);
|
|
128
|
-
const handleError = useCallback((err) => {
|
|
129
|
-
// Prevent duplicate error reports for the same jsx
|
|
130
|
-
if (errorReportedRef.current === processedJsx) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
errorReportedRef.current = processedJsx;
|
|
134
|
-
// During streaming, suppress errors and fall back to last good JSX
|
|
135
|
-
if (isStreaming) {
|
|
136
|
-
setHadError(true);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
setError(err);
|
|
140
|
-
onErrorProp?.(err);
|
|
141
|
-
}, [processedJsx, isStreaming, onErrorProp, setError]);
|
|
142
|
-
// Track the last JSX that rendered without error
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
if (!errorReportedRef.current) {
|
|
145
|
-
lastGoodJsxRef.current = processedJsx;
|
|
146
|
-
setLastGoodJsx(processedJsx);
|
|
147
|
-
}
|
|
148
|
-
}, [processedJsx, setLastGoodJsx]);
|
|
149
|
-
// During streaming, if the current JSX errored, re-render with last good version
|
|
150
|
-
const displayJsx = isStreaming && hadError ? lastGoodJsxRef.current : processedJsx;
|
|
151
|
-
return (_jsx("div", { className: cn("jsx-preview-content", className), ...props, children: _jsx(JsxParser, { bindings: bindings, components: components, jsx: displayJsx, onError: handleError, renderInWrapper: false }) }));
|
|
152
|
-
});
|
|
153
|
-
JSXPreviewContent.displayName = "JSXPreviewContent";
|
|
154
|
-
const renderChildren = (children, error) => {
|
|
155
|
-
if (typeof children === "function") {
|
|
156
|
-
return children(error);
|
|
157
|
-
}
|
|
158
|
-
return children;
|
|
159
|
-
};
|
|
160
|
-
export const JSXPreviewError = memo(({ className, children, ...props }) => {
|
|
161
|
-
const { error } = useJSXPreview();
|
|
162
|
-
if (!error) {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
return (_jsx("div", { className: cn("flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-destructive text-sm", className), ...props, children: children ? (renderChildren(children, error)) : (_jsxs(_Fragment, { children: [_jsx(AlertCircle, { className: "size-4 shrink-0" }), _jsx("span", { children: error.message })] })) }));
|
|
166
|
-
});
|
|
167
|
-
JSXPreviewError.displayName = "JSXPreviewError";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from "react";
|
|
2
|
-
export type LoaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
-
size?: number;
|
|
4
|
-
};
|
|
5
|
-
export declare const Loader: ({ className, size, ...props }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/molecules/loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAkF5C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,+BAAoC,WAAW,4CAUrE,CAAC"}
|
package/dist/molecules/loader.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
3
|
-
const LoaderIcon = ({ size = 16 }) => (_jsxs("svg", { height: size, strokeLinejoin: "round", style: { color: "currentcolor" }, viewBox: "0 0 16 16", width: size, children: [_jsx("title", { children: "Loader" }), _jsxs("g", { clipPath: "url(#clip0_2393_1490)", children: [_jsx("path", { d: "M8 0V4", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M8 16V12", opacity: "0.5", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M3.29773 1.52783L5.64887 4.7639", opacity: "0.9", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M12.7023 1.52783L10.3511 4.7639", opacity: "0.1", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M12.7023 14.472L10.3511 11.236", opacity: "0.4", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M3.29773 14.472L5.64887 11.236", opacity: "0.6", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M15.6085 5.52783L11.8043 6.7639", opacity: "0.2", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M0.391602 10.472L4.19583 9.23598", opacity: "0.7", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M15.6085 10.4722L11.8043 9.2361", opacity: "0.3", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M0.391602 5.52783L4.19583 6.7639", opacity: "0.8", stroke: "currentColor", strokeWidth: "1.5" })] }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_2393_1490", children: _jsx("rect", { fill: "white", height: "16", width: "16" }) }) })] }));
|
|
4
|
-
export const Loader = ({ className, size = 16, ...props }) => (_jsx("div", { className: cn("inline-flex animate-spin items-center justify-center", className), ...props, children: _jsx(LoaderIcon, { size: size }) }));
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import { ButtonGroup } from "@chatsdk-dev/ui/components/button-group";
|
|
3
|
-
import type { UIMessage } from "ai";
|
|
4
|
-
import type { ComponentProps, HTMLAttributes } from "react";
|
|
5
|
-
import { Streamdown } from "streamdown";
|
|
6
|
-
export type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
from: UIMessage["role"];
|
|
8
|
-
};
|
|
9
|
-
export declare const Message: ({ className, from, ...props }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
11
|
-
export declare const MessageContent: ({ children, className, ...props }: MessageContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export type MessageActionsProps = ComponentProps<"div">;
|
|
13
|
-
export declare const MessageActions: ({ className, children, ...props }: MessageActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export type MessageActionProps = ComponentProps<typeof Button> & {
|
|
15
|
-
tooltip?: string;
|
|
16
|
-
label?: string;
|
|
17
|
-
};
|
|
18
|
-
export declare const MessageAction: ({ tooltip, children, label, variant, size, ...props }: MessageActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
-
defaultBranch?: number;
|
|
21
|
-
onBranchChange?: (branchIndex: number) => void;
|
|
22
|
-
};
|
|
23
|
-
export declare const MessageBranch: ({ defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
|
|
25
|
-
export declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) => import("react/jsx-runtime").JSX.Element[];
|
|
26
|
-
export type MessageBranchSelectorProps = ComponentProps<typeof ButtonGroup>;
|
|
27
|
-
export declare const MessageBranchSelector: ({ className, ...props }: MessageBranchSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
-
export type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
29
|
-
export declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
31
|
-
export declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
33
|
-
export declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
export type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
35
|
-
export declare const MessageResponse: import("react").MemoExoticComponent<({ className, ...props }: MessageResponseProps) => import("react/jsx-runtime").JSX.Element>;
|
|
36
|
-
export type MessageToolbarProps = ComponentProps<"div">;
|
|
37
|
-
export declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/molecules/message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,WAAW,EAEZ,MAAM,yCAAyC,CAAC;AAYjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAgB,MAAM,OAAO,CAAC;AAU1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,+BAA+B,YAAY,4CASlE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAYrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAIrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uDAO3B,kBAAkB,4CAsBpB,CAAC;AA2BF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wDAK3B,kBAAkB,4CA4CpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEvE,eAAO,MAAM,oBAAoB,GAAI,wBAGlC,yBAAyB,8CA0B3B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,GAAI,yBAGnC,0BAA0B,mDAkB5B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEvE,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,0BAA0B,4CAgB5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,GAAI,wBAG/B,sBAAsB,4CAgBxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAErE,eAAO,MAAM,iBAAiB,GAAI,yBAG/B,sBAAsB,4CAcxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAIrE,eAAO,MAAM,eAAe,gEACA,oBAAoB,6CAa/C,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAUrB,CAAC"}
|
|
@@ -1,92 +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 { ButtonGroup, ButtonGroupText, } from "@chatsdk-dev/ui/components/button-group";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/components/tooltip";
|
|
6
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
7
|
-
import { cjk } from "@streamdown/cjk";
|
|
8
|
-
import { code } from "@streamdown/code";
|
|
9
|
-
import { math } from "@streamdown/math";
|
|
10
|
-
import { mermaid } from "@streamdown/mermaid";
|
|
11
|
-
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
12
|
-
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useState, } from "react";
|
|
13
|
-
import { Streamdown } from "streamdown";
|
|
14
|
-
export const Message = ({ className, from, ...props }) => (_jsx("div", { className: cn("group flex w-full max-w-[95%] flex-col gap-2", from === "user" ? "is-user ml-auto justify-end" : "is-assistant", className), ...props }));
|
|
15
|
-
export const MessageContent = ({ children, className, ...props }) => (_jsx("div", { className: cn("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", className), ...props, children: children }));
|
|
16
|
-
export const MessageActions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1", className), ...props, children: children }));
|
|
17
|
-
export const MessageAction = ({ tooltip, children, label, variant = "ghost", size = "icon", ...props }) => {
|
|
18
|
-
const button = (_jsxs(Button, { size: size, type: "button", variant: variant, ...props, children: [children, _jsx("span", { className: "sr-only", children: label || tooltip })] }));
|
|
19
|
-
if (tooltip) {
|
|
20
|
-
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: () => button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
|
|
21
|
-
}
|
|
22
|
-
return button;
|
|
23
|
-
};
|
|
24
|
-
const MessageBranchContext = createContext(null);
|
|
25
|
-
const useMessageBranch = () => {
|
|
26
|
-
const context = useContext(MessageBranchContext);
|
|
27
|
-
if (!context) {
|
|
28
|
-
throw new Error("MessageBranch components must be used within MessageBranch");
|
|
29
|
-
}
|
|
30
|
-
return context;
|
|
31
|
-
};
|
|
32
|
-
export const MessageBranch = ({ defaultBranch = 0, onBranchChange, className, ...props }) => {
|
|
33
|
-
const [currentBranch, setCurrentBranch] = useState(defaultBranch);
|
|
34
|
-
const [branches, setBranches] = useState([]);
|
|
35
|
-
const handleBranchChange = useCallback((newBranch) => {
|
|
36
|
-
setCurrentBranch(newBranch);
|
|
37
|
-
onBranchChange?.(newBranch);
|
|
38
|
-
}, [onBranchChange]);
|
|
39
|
-
const goToPrevious = useCallback(() => {
|
|
40
|
-
const newBranch = currentBranch > 0 ? currentBranch - 1 : branches.length - 1;
|
|
41
|
-
handleBranchChange(newBranch);
|
|
42
|
-
}, [currentBranch, branches.length, handleBranchChange]);
|
|
43
|
-
const goToNext = useCallback(() => {
|
|
44
|
-
const newBranch = currentBranch < branches.length - 1 ? currentBranch + 1 : 0;
|
|
45
|
-
handleBranchChange(newBranch);
|
|
46
|
-
}, [currentBranch, branches.length, handleBranchChange]);
|
|
47
|
-
const contextValue = useMemo(() => ({
|
|
48
|
-
branches,
|
|
49
|
-
currentBranch,
|
|
50
|
-
goToNext,
|
|
51
|
-
goToPrevious,
|
|
52
|
-
setBranches,
|
|
53
|
-
totalBranches: branches.length,
|
|
54
|
-
}), [branches, currentBranch, goToNext, goToPrevious]);
|
|
55
|
-
return (_jsx(MessageBranchContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("grid w-full gap-2 [&>div]:pb-0", className), ...props }) }));
|
|
56
|
-
};
|
|
57
|
-
export const MessageBranchContent = ({ children, ...props }) => {
|
|
58
|
-
const { currentBranch, setBranches, branches } = useMessageBranch();
|
|
59
|
-
const childrenArray = useMemo(() => (Array.isArray(children) ? children : [children]), [children]);
|
|
60
|
-
// Use useEffect to update branches when they change
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (branches.length !== childrenArray.length) {
|
|
63
|
-
setBranches(childrenArray);
|
|
64
|
-
}
|
|
65
|
-
}, [childrenArray, branches, setBranches]);
|
|
66
|
-
return childrenArray.map((branch, index) => (_jsx("div", { className: cn("grid gap-2 overflow-hidden [&>div]:pb-0", index === currentBranch ? "block" : "hidden"), ...props, children: branch }, branch.key)));
|
|
67
|
-
};
|
|
68
|
-
export const MessageBranchSelector = ({ className, ...props }) => {
|
|
69
|
-
const { totalBranches } = useMessageBranch();
|
|
70
|
-
// Don't render if there's only one branch
|
|
71
|
-
if (totalBranches <= 1) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
return (_jsx(ButtonGroup, { className: cn("[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md", className), orientation: "horizontal", ...props }));
|
|
75
|
-
};
|
|
76
|
-
export const MessageBranchPrevious = ({ children, ...props }) => {
|
|
77
|
-
const { goToPrevious, totalBranches } = useMessageBranch();
|
|
78
|
-
return (_jsx(Button, { "aria-label": "Previous branch", disabled: totalBranches <= 1, onClick: goToPrevious, size: "icon", type: "button", variant: "ghost", ...props, children: children ?? _jsx(ChevronLeftIcon, { size: 14 }) }));
|
|
79
|
-
};
|
|
80
|
-
export const MessageBranchNext = ({ children, ...props }) => {
|
|
81
|
-
const { goToNext, totalBranches } = useMessageBranch();
|
|
82
|
-
return (_jsx(Button, { "aria-label": "Next branch", disabled: totalBranches <= 1, onClick: goToNext, size: "icon", type: "button", variant: "ghost", ...props, children: children ?? _jsx(ChevronRightIcon, { size: 14 }) }));
|
|
83
|
-
};
|
|
84
|
-
export const MessageBranchPage = ({ className, ...props }) => {
|
|
85
|
-
const { currentBranch, totalBranches } = useMessageBranch();
|
|
86
|
-
return (_jsxs(ButtonGroupText, { className: cn("border-none bg-transparent text-muted-foreground shadow-none", className), ...props, children: [currentBranch + 1, " of ", totalBranches] }));
|
|
87
|
-
};
|
|
88
|
-
const streamdownPlugins = { cjk, code, math, mermaid };
|
|
89
|
-
export const MessageResponse = memo(({ className, ...props }) => (_jsx(Streamdown, { className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), plugins: streamdownPlugins, ...props })), (prevProps, nextProps) => prevProps.children === nextProps.children &&
|
|
90
|
-
nextProps.isAnimating === prevProps.isAnimating);
|
|
91
|
-
MessageResponse.displayName = "MessageResponse";
|
|
92
|
-
export const MessageToolbar = ({ className, children, ...props }) => (_jsx("div", { className: cn("mt-4 flex w-full items-center justify-between gap-4", className), ...props, children: children }));
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from "@chatsdk-dev/ui/components/command";
|
|
3
|
-
import { Popover, PopoverContent } from "@chatsdk-dev/ui/components/popover";
|
|
4
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
5
|
-
export declare const useAudioDevices: () => {
|
|
6
|
-
devices: MediaDeviceInfo[];
|
|
7
|
-
error: string | null;
|
|
8
|
-
hasPermission: boolean;
|
|
9
|
-
loadDevices: () => Promise<void>;
|
|
10
|
-
loading: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type MicSelectorProps = ComponentProps<typeof Popover> & {
|
|
13
|
-
defaultValue?: string;
|
|
14
|
-
value?: string | undefined;
|
|
15
|
-
onValueChange?: (value: string | undefined) => void;
|
|
16
|
-
open?: boolean;
|
|
17
|
-
onOpenChange?: (open: boolean) => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const MicSelector: ({ defaultValue, value: controlledValue, onValueChange: controlledOnValueChange, defaultOpen, open: controlledOpen, onOpenChange: controlledOnOpenChange, ...props }: MicSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export type MicSelectorTriggerProps = ComponentProps<typeof Button>;
|
|
21
|
-
export declare const MicSelectorTrigger: ({ children, ...props }: MicSelectorTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export type MicSelectorContentProps = ComponentProps<typeof Command> & {
|
|
23
|
-
popoverOptions?: ComponentProps<typeof PopoverContent>;
|
|
24
|
-
};
|
|
25
|
-
export declare const MicSelectorContent: ({ className, popoverOptions, ...props }: MicSelectorContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export type MicSelectorInputProps = ComponentProps<typeof CommandInput> & {
|
|
27
|
-
value?: string;
|
|
28
|
-
defaultValue?: string;
|
|
29
|
-
onValueChange?: (value: string) => void;
|
|
30
|
-
};
|
|
31
|
-
export declare const MicSelectorInput: ({ ...props }: MicSelectorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export type MicSelectorListProps = Omit<ComponentProps<typeof CommandList>, "children"> & {
|
|
33
|
-
children: (devices: MediaDeviceInfo[]) => ReactNode;
|
|
34
|
-
};
|
|
35
|
-
export declare const MicSelectorList: ({ children, ...props }: MicSelectorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
export type MicSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
37
|
-
export declare const MicSelectorEmpty: ({ children, ...props }: MicSelectorEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
export type MicSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
39
|
-
export declare const MicSelectorItem: (props: MicSelectorItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
export type MicSelectorLabelProps = ComponentProps<"span"> & {
|
|
41
|
-
device: MediaDeviceInfo;
|
|
42
|
-
};
|
|
43
|
-
export declare const MicSelectorLabel: ({ device, className, ...props }: MicSelectorLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
export type MicSelectorValueProps = ComponentProps<"span">;
|
|
45
|
-
export declare const MicSelectorValue: ({ className, ...props }: MicSelectorValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
//# sourceMappingURL=mic-selector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mic-selector.d.ts","sourceRoot":"","sources":["../../src/molecules/mic-selector.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,OAAO,EACP,cAAc,EAEf,MAAM,oCAAoC,CAAC;AAG5C,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAiCvD,eAAO,MAAM,eAAe;;;;;;CAiG3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,GAAG;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,qKAQzB,gBAAgB,4CAsClB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB,GAAI,wBAGhC,uBAAuB,4CAsCzB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,OAAO,OAAO,CAAC,GAAG;IACrE,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yCAIhC,uBAAuB,4CAYzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,GAAG;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,cAAc,qBAAqB,4CAEnE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,cAAc,CAAC,OAAO,WAAW,CAAC,EAClC,UAAU,CACX,GAAG;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wBAG7B,oBAAoB,4CAItB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB,GAAI,wBAG9B,qBAAqB,4CAAuD,CAAC;AAEhF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,4CAY1D,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC3D,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iCAI9B,qBAAqB,4CAoBvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,qBAAqB,4CAmBvB,CAAC"}
|