@asanchez-sa/abby 0.0.0-stage → 0.1.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/README.md +217 -2
- package/dist/_virtual/_rolldown/runtime.js +26 -0
- package/dist/agents/approvals.d.ts +46 -0
- package/dist/agents/approvals.js +58 -0
- package/dist/agents/changes.d.ts +21 -0
- package/dist/agents/changes.js +21 -0
- package/dist/agents/hooks.d.ts +20 -0
- package/dist/agents/hooks.js +58 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.js +9 -0
- package/dist/agents/run-tool.d.ts +44 -0
- package/dist/agents/run-tool.js +79 -0
- package/dist/agents/ui-sdk.d.ts +5 -0
- package/dist/agents/ui-sdk.js +3 -0
- package/dist/behaviors/canvas/index.d.ts +2 -0
- package/dist/behaviors/canvas/index.js +1 -0
- package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
- package/dist/behaviors/canvas/ui-sdk.js +1 -0
- package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/index.js +1 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
- package/dist/behaviors/dragging/index.d.ts +2 -0
- package/dist/behaviors/dragging/index.js +1 -0
- package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
- package/dist/behaviors/dragging/ui-sdk.js +1 -0
- package/dist/behaviors/focus/index.d.ts +2 -0
- package/dist/behaviors/focus/index.js +1 -0
- package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
- package/dist/behaviors/focus/ui-sdk.js +1 -0
- package/dist/behaviors/lists/index.d.ts +3 -0
- package/dist/behaviors/lists/index.js +3 -0
- package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
- package/dist/behaviors/lists/ui-sdk.js +3 -0
- package/dist/behaviors/popups/index.d.ts +3 -0
- package/dist/behaviors/popups/index.js +3 -0
- package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
- package/dist/behaviors/popups/ui-sdk.js +3 -0
- package/dist/behaviors/preferences/index.d.ts +3 -0
- package/dist/behaviors/preferences/index.js +3 -0
- package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
- package/dist/behaviors/preferences/ui-sdk.js +3 -0
- package/dist/behaviors/selection/index.d.ts +3 -0
- package/dist/behaviors/selection/index.js +3 -0
- package/dist/behaviors/selection/indicator.d.ts +13 -0
- package/dist/behaviors/selection/indicator.js +20 -0
- package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
- package/dist/behaviors/selection/ui-sdk.js +1 -0
- package/dist/behaviors/transitions/index.d.ts +3 -0
- package/dist/behaviors/transitions/index.js +3 -0
- package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
- package/dist/behaviors/transitions/ui-sdk.js +3 -0
- package/dist/behaviors/trees/index.d.ts +2 -0
- package/dist/behaviors/trees/index.js +1 -0
- package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
- package/dist/behaviors/trees/ui-sdk.js +1 -0
- package/dist/components/accordion/accordion.d.ts +13 -0
- package/dist/components/accordion/accordion.js +165 -0
- package/dist/components/alert/alert.d.ts +13 -0
- package/dist/components/alert/alert.js +131 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
- package/dist/components/alert-dialog/alert-dialog.js +257 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
- package/dist/components/attachment/attachment.d.ts +48 -0
- package/dist/components/attachment/attachment.js +372 -0
- package/dist/components/autocomplete/autocomplete.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.js +466 -0
- package/dist/components/avatar/avatar.d.ts +6 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar-group/avatar-group.d.ts +9 -0
- package/dist/components/avatar-group/avatar-group.js +75 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +31 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb.js +279 -0
- package/dist/components/bubble/bubble.d.ts +26 -0
- package/dist/components/bubble/bubble.js +173 -0
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button-group/button-group.d.ts +15 -0
- package/dist/components/button-group/button-group.js +71 -0
- package/dist/components/calendar/calendar.d.ts +29 -0
- package/dist/components/calendar/calendar.js +453 -0
- package/dist/components/card/card.d.ts +14 -0
- package/dist/components/card/card.js +213 -0
- package/dist/components/carousel/carousel.d.ts +16 -0
- package/dist/components/carousel/carousel.js +364 -0
- package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
- package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
- package/dist/components/chat/chat.d.ts +48 -0
- package/dist/components/chat/chat.js +207 -0
- package/dist/components/checkbox/checkbox.d.ts +10 -0
- package/dist/components/checkbox/checkbox.js +118 -0
- package/dist/components/checkpoint/checkpoint.d.ts +24 -0
- package/dist/components/checkpoint/checkpoint.js +178 -0
- package/dist/components/choice-cards/choice-cards.d.ts +38 -0
- package/dist/components/choice-cards/choice-cards.js +255 -0
- package/dist/components/code-block/code-block.d.ts +58 -0
- package/dist/components/code-block/code-block.js +506 -0
- package/dist/components/code-block/highlighter.js +96 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
- package/dist/components/code-block/use-highlighted-code.js +54 -0
- package/dist/components/collapsible/collapsible.d.ts +10 -0
- package/dist/components/collapsible/collapsible.js +92 -0
- package/dist/components/color-picker/color-picker.d.ts +17 -0
- package/dist/components/color-picker/color-picker.js +395 -0
- package/dist/components/combobox/combobox.d.ts +54 -0
- package/dist/components/combobox/combobox.js +683 -0
- package/dist/components/command/command.d.ts +23 -0
- package/dist/components/command/command.js +373 -0
- package/dist/components/command-dock/command-dock.d.ts +118 -0
- package/dist/components/command-dock/command-dock.js +944 -0
- package/dist/components/confirmation/confirmation.d.ts +58 -0
- package/dist/components/confirmation/confirmation.js +181 -0
- package/dist/components/context/context.d.ts +82 -0
- package/dist/components/context/context.js +490 -0
- package/dist/components/date-input/date-input.d.ts +16 -0
- package/dist/components/date-input/date-input.js +89 -0
- package/dist/components/date-picker/date-picker.d.ts +28 -0
- package/dist/components/date-picker/date-picker.js +361 -0
- package/dist/components/dialog/dialog.d.ts +14 -0
- package/dist/components/dialog/dialog.js +261 -0
- package/dist/components/drawer/drawer.d.ts +16 -0
- package/dist/components/drawer/drawer.js +309 -0
- package/dist/components/empty/empty.d.ts +18 -0
- package/dist/components/empty/empty.js +192 -0
- package/dist/components/field/field.d.ts +15 -0
- package/dist/components/field/field.js +261 -0
- package/dist/components/file-input/file-input.d.ts +12 -0
- package/dist/components/file-input/file-input.js +216 -0
- package/dist/components/file-tree/file-tree.d.ts +45 -0
- package/dist/components/file-tree/file-tree.js +283 -0
- package/dist/components/hover-card/hover-card.d.ts +10 -0
- package/dist/components/hover-card/hover-card.js +118 -0
- package/dist/components/icon/icon.d.ts +14 -0
- package/dist/components/icon/icon.js +60 -0
- package/dist/components/image-cropper/image-cropper.d.ts +15 -0
- package/dist/components/image-cropper/image-cropper.js +334 -0
- package/dist/components/inline-citation/inline-citation.d.ts +46 -0
- package/dist/components/inline-citation/inline-citation.js +269 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +43 -0
- package/dist/components/input-group/input-group.d.ts +42 -0
- package/dist/components/input-group/input-group.js +192 -0
- package/dist/components/item/item.d.ts +32 -0
- package/dist/components/item/item.js +394 -0
- package/dist/components/kbd/kbd.d.ts +9 -0
- package/dist/components/kbd/kbd.js +75 -0
- package/dist/components/label/label.d.ts +6 -0
- package/dist/components/label/label.js +40 -0
- package/dist/components/link/link.d.ts +21 -0
- package/dist/components/link/link.js +126 -0
- package/dist/components/listbox/listbox.d.ts +20 -0
- package/dist/components/listbox/listbox.js +199 -0
- package/dist/components/marker/marker.d.ts +11 -0
- package/dist/components/marker/marker.js +88 -0
- package/dist/components/menu/menu.d.ts +38 -0
- package/dist/components/menu/menu.js +553 -0
- package/dist/components/menubar/menubar.d.ts +9 -0
- package/dist/components/menubar/menubar.js +47 -0
- package/dist/components/message/message.d.ts +44 -0
- package/dist/components/message/message.js +328 -0
- package/dist/components/message-scroller/message-scroller.d.ts +111 -0
- package/dist/components/message-scroller/message-scroller.js +957 -0
- package/dist/components/meter/meter.d.ts +8 -0
- package/dist/components/meter/meter.js +162 -0
- package/dist/components/model-selector/model-selector.d.ts +155 -0
- package/dist/components/model-selector/model-selector.js +905 -0
- package/dist/components/native-select/native-select.d.ts +27 -0
- package/dist/components/native-select/native-select.js +226 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
- package/dist/components/navigation-menu/navigation-menu.js +318 -0
- package/dist/components/not-label.js +9 -0
- package/dist/components/note-editor/blocks.d.ts +22 -0
- package/dist/components/note-editor/blocks.js +245 -0
- package/dist/components/note-editor/diff.d.ts +19 -0
- package/dist/components/note-editor/diff.js +64 -0
- package/dist/components/note-editor/editor.js +249 -0
- package/dist/components/note-editor/note-editor.d.ts +109 -0
- package/dist/components/note-editor/note-editor.js +954 -0
- package/dist/components/note-editor/parts/comments.d.ts +24 -0
- package/dist/components/note-editor/parts/comments.js +336 -0
- package/dist/components/note-editor/parts/header.d.ts +25 -0
- package/dist/components/note-editor/parts/header.js +263 -0
- package/dist/components/note-editor/parts/history.d.ts +56 -0
- package/dist/components/note-editor/parts/history.js +409 -0
- package/dist/components/note-editor/parts/presence.d.ts +31 -0
- package/dist/components/note-editor/parts/presence.js +140 -0
- package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
- package/dist/components/note-editor/parts/suggestions.js +316 -0
- package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
- package/dist/components/note-editor/parts/toolbar.js +683 -0
- package/dist/components/note-editor/people.d.ts +84 -0
- package/dist/components/note-editor/people.js +276 -0
- package/dist/components/note-editor/person.d.ts +11 -0
- package/dist/components/note-editor/person.js +15 -0
- package/dist/components/note-place/note-place.d.ts +42 -0
- package/dist/components/note-place/note-place.js +256 -0
- package/dist/components/note-status/note-status.d.ts +59 -0
- package/dist/components/note-status/note-status.js +380 -0
- package/dist/components/number-input/number-input.d.ts +12 -0
- package/dist/components/number-input/number-input.js +252 -0
- package/dist/components/otp-input/otp-input.d.ts +12 -0
- package/dist/components/otp-input/otp-input.js +136 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/pagination.js +218 -0
- package/dist/components/password-input/password-input.d.ts +11 -0
- package/dist/components/password-input/password-input.js +117 -0
- package/dist/components/plan/plan.d.ts +51 -0
- package/dist/components/plan/plan.js +320 -0
- package/dist/components/popover/popover.d.ts +16 -0
- package/dist/components/popover/popover.js +268 -0
- package/dist/components/preferences/preferences.d.ts +5 -0
- package/dist/components/preferences/preferences.js +18 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +162 -0
- package/dist/components/prompt-input/prompt-input.d.ts +247 -0
- package/dist/components/prompt-input/prompt-input.js +1367 -0
- package/dist/components/questionnaire/questionnaire.d.ts +174 -0
- package/dist/components/questionnaire/questionnaire.js +1628 -0
- package/dist/components/queue/queue.d.ts +82 -0
- package/dist/components/queue/queue.js +471 -0
- package/dist/components/radio/radio.d.ts +7 -0
- package/dist/components/radio/radio.js +101 -0
- package/dist/components/rating/rating.d.ts +10 -0
- package/dist/components/rating/rating.js +95 -0
- package/dist/components/reasoning/reasoning.d.ts +50 -0
- package/dist/components/reasoning/reasoning.js +233 -0
- package/dist/components/resizable/resizable.d.ts +6 -0
- package/dist/components/resizable/resizable.js +100 -0
- package/dist/components/scroll-area/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area/scroll-area.js +211 -0
- package/dist/components/segmented-control/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control/segmented-control.js +142 -0
- package/dist/components/select/select.d.ts +43 -0
- package/dist/components/select/select.js +577 -0
- package/dist/components/separator/separator.d.ts +4 -0
- package/dist/components/separator/separator.js +38 -0
- package/dist/components/sheet/sheet.d.ts +24 -0
- package/dist/components/sheet/sheet.js +330 -0
- package/dist/components/sidebar/sidebar.d.ts +138 -0
- package/dist/components/sidebar/sidebar.js +1374 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.js +40 -0
- package/dist/components/slider/slider.d.ts +9 -0
- package/dist/components/slider/slider.js +193 -0
- package/dist/components/sources/sources.d.ts +35 -0
- package/dist/components/sources/sources.js +209 -0
- package/dist/components/spinner/spinner.d.ts +11 -0
- package/dist/components/spinner/spinner.js +59 -0
- package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
- package/dist/components/stack-trace/parse-stack-trace.js +61 -0
- package/dist/components/stack-trace/stack-trace.d.ts +79 -0
- package/dist/components/stack-trace/stack-trace.js +434 -0
- package/dist/components/subagent/subagent.d.ts +71 -0
- package/dist/components/subagent/subagent.js +450 -0
- package/dist/components/suggestion/suggestion.d.ts +21 -0
- package/dist/components/suggestion/suggestion.js +130 -0
- package/dist/components/switch/switch.d.ts +6 -0
- package/dist/components/switch/switch.js +70 -0
- package/dist/components/table/table.d.ts +19 -0
- package/dist/components/table/table.js +284 -0
- package/dist/components/table-of-contents/spy.js +84 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
- package/dist/components/table-of-contents/table-of-contents.js +787 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +273 -0
- package/dist/components/task/task.d.ts +40 -0
- package/dist/components/task/task.js +262 -0
- package/dist/components/terminal/terminal.d.ts +82 -0
- package/dist/components/terminal/terminal.js +457 -0
- package/dist/components/test-results/test-results.d.ts +127 -0
- package/dist/components/test-results/test-results.js +687 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +43 -0
- package/dist/components/time-input/time-input.d.ts +7 -0
- package/dist/components/time-input/time-input.js +82 -0
- package/dist/components/timeline/timeline.d.ts +19 -0
- package/dist/components/timeline/timeline.js +247 -0
- package/dist/components/toast/toast.d.ts +12 -0
- package/dist/components/toast/toast.js +285 -0
- package/dist/components/toggle/toggle.d.ts +15 -0
- package/dist/components/toggle/toggle.js +137 -0
- package/dist/components/token-input/token-input.d.ts +7 -0
- package/dist/components/token-input/token-input.js +117 -0
- package/dist/components/tool/tool.d.ts +66 -0
- package/dist/components/tool/tool.js +413 -0
- package/dist/components/toolbar/toolbar.d.ts +91 -0
- package/dist/components/toolbar/toolbar.js +655 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +97 -0
- package/dist/components/trace/trace.d.ts +31 -0
- package/dist/components/trace/trace.js +309 -0
- package/dist/components/tree/tree.d.ts +13 -0
- package/dist/components/tree/tree.js +258 -0
- package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
- package/dist/components/trigger-menu/trigger-menu.js +352 -0
- package/dist/components/usage/usage.d.ts +132 -0
- package/dist/components/usage/usage.js +1368 -0
- package/dist/components/waterfall/waterfall.d.ts +20 -0
- package/dist/components/waterfall/waterfall.js +360 -0
- package/dist/components/week-strip/week-strip.d.ts +177 -0
- package/dist/components/week-strip/week-strip.js +1081 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +27 -0
- package/dist/core/ui-sdk.d.ts +3 -0
- package/dist/core/ui-sdk.js +3 -0
- package/dist/core/use-primitive-state.d.ts +14 -0
- package/dist/core/use-primitive-state.js +25 -0
- package/dist/styles/LICENSE-shadcn.md +21 -0
- package/dist/styles/color-scheme.css +32 -0
- package/dist/styles/components.css +303 -0
- package/dist/styles/index.css +41 -0
- package/dist/styles/tokens.css +474 -0
- package/dist/styles/typeset/shadcn.css +506 -0
- package/dist/styles/typeset.css +70 -0
- package/dist/styles/utilities.css +555 -0
- package/dist/tools/observe/index.d.ts +2 -0
- package/dist/tools/observe/index.js +3 -0
- package/dist/tools/observe/ui-sdk.d.ts +1 -0
- package/dist/tools/observe/ui-sdk.js +2 -0
- package/dist/tools/testing/check-agent.d.ts +28 -0
- package/dist/tools/testing/check-agent.js +42 -0
- package/dist/tools/testing/index.d.ts +4 -0
- package/dist/tools/testing/index.js +4 -0
- package/dist/tools/testing/ui-sdk.d.ts +1 -0
- package/dist/tools/testing/ui-sdk.js +2 -0
- package/dist/utilities/cn/index.d.ts +12 -0
- package/dist/utilities/cn/index.js +47 -0
- package/dist/utilities/color/index.d.ts +2 -0
- package/dist/utilities/color/index.js +3 -0
- package/dist/utilities/color/ui-sdk.d.ts +1 -0
- package/dist/utilities/color/ui-sdk.js +2 -0
- package/dist/utilities/date/index.d.ts +2 -0
- package/dist/utilities/date/index.js +6 -0
- package/dist/utilities/date/ui-sdk.d.ts +1 -0
- package/dist/utilities/date/ui-sdk.js +2 -0
- package/dist/utilities/image/index.d.ts +2 -0
- package/dist/utilities/image/index.js +3 -0
- package/dist/utilities/image/ui-sdk.d.ts +1 -0
- package/dist/utilities/image/ui-sdk.js +2 -0
- package/dist/utilities/mobile/index.d.ts +2 -0
- package/dist/utilities/mobile/index.js +1 -0
- package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
- package/dist/utilities/mobile/ui-sdk.js +1 -0
- package/dist/utilities/number/index.d.ts +2 -0
- package/dist/utilities/number/index.js +3 -0
- package/dist/utilities/number/ui-sdk.d.ts +1 -0
- package/dist/utilities/number/ui-sdk.js +2 -0
- package/dist/utilities/platform/index.d.ts +3 -0
- package/dist/utilities/platform/index.js +14 -0
- package/dist/utilities/platform/ui-sdk.d.ts +3 -0
- package/dist/utilities/platform/ui-sdk.js +3 -0
- package/dist/utilities/storage/index.d.ts +2 -0
- package/dist/utilities/storage/index.js +1 -0
- package/dist/utilities/storage/ui-sdk.d.ts +2 -0
- package/dist/utilities/storage/ui-sdk.js +1 -0
- package/dist/utilities/text/index.d.ts +3 -0
- package/dist/utilities/text/index.js +3 -0
- package/dist/utilities/text/ui-sdk.d.ts +3 -0
- package/dist/utilities/text/ui-sdk.js +3 -0
- package/package.json +192 -4
- package/skills/agent-ready-ui/SKILL.md +229 -0
- package/skills/blocks/SKILL.md +262 -0
- package/skills/compose-screens/SKILL.md +354 -0
- package/skills/note-editor/SKILL.md +493 -0
- package/skills/note-status/SKILL.md +295 -0
- package/skills/setup/SKILL.md +136 -0
- package/skills/theming/SKILL.md +216 -0
- package/src/blocks/notes/adapters.ts +77 -0
- package/src/blocks/notes/data.ts +508 -0
- package/src/blocks/notes/notes-block.tsx +244 -0
- package/src/blocks/notes/parts/home.tsx +219 -0
- package/src/blocks/notes/parts/no-access.tsx +84 -0
- package/src/blocks/notes/parts/note-screen.tsx +412 -0
- package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
- package/src/blocks/notes/parts/panels.tsx +393 -0
- package/src/blocks/notes/parts/place.ts +15 -0
- package/src/blocks/notes/parts/review-dialog.tsx +159 -0
- package/src/blocks/notes/parts/share.tsx +172 -0
- package/src/blocks/notes/texts.ts +135 -0
- package/src/blocks/shell/adapters.ts +69 -0
- package/src/blocks/shell/data.ts +281 -0
- package/src/blocks/shell/parts/compose.tsx +292 -0
- package/src/blocks/shell/parts/home.tsx +203 -0
- package/src/blocks/shell/parts/marks.tsx +144 -0
- package/src/blocks/shell/parts/rail.tsx +166 -0
- package/src/blocks/shell/parts/rooms-column.tsx +326 -0
- package/src/blocks/shell/shell-block.tsx +210 -0
- package/src/blocks/shell/texts.ts +80 -0
|
@@ -0,0 +1,1367 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { Attachment, AttachmentActions, AttachmentContent, AttachmentMedia, AttachmentTitle } from "../attachment/attachment.js";
|
|
4
|
+
import { FileInput, FileInputDropzone, FileInputItem, FileInputItemRemove, FileInputList, FileInputTrigger, createFileInputController } from "../file-input/file-input.js";
|
|
5
|
+
import { Icon } from "../icon/icon.js";
|
|
6
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, inputGroupButtonVariants } from "../input-group/input-group.js";
|
|
7
|
+
import { Menu, MenuContent, MenuItem, MenuTrigger } from "../menu/menu.js";
|
|
8
|
+
import { Toggle } from "../toggle/toggle.js";
|
|
9
|
+
import { c } from "react/compiler-runtime";
|
|
10
|
+
import { createContext, use, useContext, useEffect, useRef, useState } from "react";
|
|
11
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { ArrowUp02Icon, Attachment01Icon, Camera01Icon, Cancel01Icon, File02Icon, Loading03Icon, Mic01Icon, PlusSignIcon, StopIcon, Tick02Icon } from "@hugeicons/core-free-icons";
|
|
13
|
+
// src/components/prompt-input/prompt-input.tsx
|
|
14
|
+
const PromptInputContext = createContext(null);
|
|
15
|
+
const FilesLabelContext = createContext("Attach files");
|
|
16
|
+
const TextareaContext = createContext(null);
|
|
17
|
+
const ActionMenuContext = createContext(false);
|
|
18
|
+
/** The form's text, files and status. Call it inside a `PromptInput`. */
|
|
19
|
+
function usePromptInput() {
|
|
20
|
+
const context = useContext(PromptInputContext);
|
|
21
|
+
if (!context) throw new Error("PromptInput's parts must be used within PromptInput.");
|
|
22
|
+
return context;
|
|
23
|
+
}
|
|
24
|
+
const composerClasses = [
|
|
25
|
+
"border-border shadow-sm has-[>textarea]:rounded-full in-data-drag-accept:border-primary in-data-drag-reject:border-destructive",
|
|
26
|
+
"[&>[data-align=inline-start]]:ms-0 [&>[data-align=inline-start]]:self-end [&>[data-align=inline-start]]:py-0.75 [&>[data-align=inline-start]]:ps-0.75",
|
|
27
|
+
"[&>[data-align=inline-end]]:me-0 [&>[data-align=inline-end]]:self-end [&>[data-align=inline-end]]:py-0.75 [&>[data-align=inline-end]]:pe-0.75"
|
|
28
|
+
].join(" ");
|
|
29
|
+
const roundIconClasses = "rounded-full [&>[data-slot=icon]]:size-4.5";
|
|
30
|
+
/**
|
|
31
|
+
* The form. It holds the text and the files, and submits both: empty or
|
|
32
|
+
* blank text sends nothing. Its children are the parts of the box, in the
|
|
33
|
+
* order they read: `PromptInputHeader`, `PromptInputTextarea` (or a
|
|
34
|
+
* `PromptInputRecorder` while recording), `PromptInputFooter`.
|
|
35
|
+
*/
|
|
36
|
+
function PromptInput(t0) {
|
|
37
|
+
const $ = c(88);
|
|
38
|
+
let accept;
|
|
39
|
+
let children;
|
|
40
|
+
let className;
|
|
41
|
+
let files;
|
|
42
|
+
let maxFiles;
|
|
43
|
+
let maxSize;
|
|
44
|
+
let minSize;
|
|
45
|
+
let onFilesChange;
|
|
46
|
+
let onReject;
|
|
47
|
+
let onSubmit;
|
|
48
|
+
let onValueChange;
|
|
49
|
+
let props;
|
|
50
|
+
let t1;
|
|
51
|
+
let t2;
|
|
52
|
+
let t3;
|
|
53
|
+
let t4;
|
|
54
|
+
let t5;
|
|
55
|
+
let t6;
|
|
56
|
+
let validate;
|
|
57
|
+
let value;
|
|
58
|
+
if ($[0] !== t0) {
|
|
59
|
+
({onSubmit, value, defaultValue: t1, onValueChange, files, defaultFiles: t2, onFilesChange, status: t3, filesLabel: t4, disabled: t5, multiple: t6, accept, maxFiles, maxSize, minSize, validate, onReject, className, children, ...props} = t0);
|
|
60
|
+
$[0] = t0;
|
|
61
|
+
$[1] = accept;
|
|
62
|
+
$[2] = children;
|
|
63
|
+
$[3] = className;
|
|
64
|
+
$[4] = files;
|
|
65
|
+
$[5] = maxFiles;
|
|
66
|
+
$[6] = maxSize;
|
|
67
|
+
$[7] = minSize;
|
|
68
|
+
$[8] = onFilesChange;
|
|
69
|
+
$[9] = onReject;
|
|
70
|
+
$[10] = onSubmit;
|
|
71
|
+
$[11] = onValueChange;
|
|
72
|
+
$[12] = props;
|
|
73
|
+
$[13] = t1;
|
|
74
|
+
$[14] = t2;
|
|
75
|
+
$[15] = t3;
|
|
76
|
+
$[16] = t4;
|
|
77
|
+
$[17] = t5;
|
|
78
|
+
$[18] = t6;
|
|
79
|
+
$[19] = validate;
|
|
80
|
+
$[20] = value;
|
|
81
|
+
} else {
|
|
82
|
+
accept = $[1];
|
|
83
|
+
children = $[2];
|
|
84
|
+
className = $[3];
|
|
85
|
+
files = $[4];
|
|
86
|
+
maxFiles = $[5];
|
|
87
|
+
maxSize = $[6];
|
|
88
|
+
minSize = $[7];
|
|
89
|
+
onFilesChange = $[8];
|
|
90
|
+
onReject = $[9];
|
|
91
|
+
onSubmit = $[10];
|
|
92
|
+
onValueChange = $[11];
|
|
93
|
+
props = $[12];
|
|
94
|
+
t1 = $[13];
|
|
95
|
+
t2 = $[14];
|
|
96
|
+
t3 = $[15];
|
|
97
|
+
t4 = $[16];
|
|
98
|
+
t5 = $[17];
|
|
99
|
+
t6 = $[18];
|
|
100
|
+
validate = $[19];
|
|
101
|
+
value = $[20];
|
|
102
|
+
}
|
|
103
|
+
const defaultValue = t1 === void 0 ? "" : t1;
|
|
104
|
+
let t7;
|
|
105
|
+
if ($[21] !== t2) {
|
|
106
|
+
t7 = t2 === void 0 ? [] : t2;
|
|
107
|
+
$[21] = t2;
|
|
108
|
+
$[22] = t7;
|
|
109
|
+
} else t7 = $[22];
|
|
110
|
+
const defaultFiles = t7;
|
|
111
|
+
const status = t3 === void 0 ? "ready" : t3;
|
|
112
|
+
const filesLabel = t4 === void 0 ? "Attach files" : t4;
|
|
113
|
+
const disabled = t5 === void 0 ? false : t5;
|
|
114
|
+
const multiple = t6 === void 0 ? true : t6;
|
|
115
|
+
const [innerText, setInnerText] = useState(defaultValue);
|
|
116
|
+
const [innerFiles, setInnerFiles] = useState(defaultFiles);
|
|
117
|
+
const [picker] = useState(createFileInputController);
|
|
118
|
+
const textarea = useRef(null);
|
|
119
|
+
const text = value ?? innerText;
|
|
120
|
+
const attached = files ?? innerFiles;
|
|
121
|
+
const busy = status === "submitted" || status === "streaming";
|
|
122
|
+
let t8;
|
|
123
|
+
if ($[23] !== busy || $[24] !== disabled || $[25] !== text) {
|
|
124
|
+
t8 = !disabled && !busy && text.trim().length > 0;
|
|
125
|
+
$[23] = busy;
|
|
126
|
+
$[24] = disabled;
|
|
127
|
+
$[25] = text;
|
|
128
|
+
$[26] = t8;
|
|
129
|
+
} else t8 = $[26];
|
|
130
|
+
const canSubmit = t8;
|
|
131
|
+
let t9;
|
|
132
|
+
if ($[27] !== onValueChange) {
|
|
133
|
+
t9 = function setText(next) {
|
|
134
|
+
onValueChange?.(next);
|
|
135
|
+
setInnerText(next);
|
|
136
|
+
};
|
|
137
|
+
$[27] = onValueChange;
|
|
138
|
+
$[28] = t9;
|
|
139
|
+
} else t9 = $[28];
|
|
140
|
+
const setText = t9;
|
|
141
|
+
let t10;
|
|
142
|
+
if ($[29] !== onFilesChange) {
|
|
143
|
+
t10 = function setFiles(next_0) {
|
|
144
|
+
onFilesChange?.(next_0);
|
|
145
|
+
setInnerFiles(next_0);
|
|
146
|
+
};
|
|
147
|
+
$[29] = onFilesChange;
|
|
148
|
+
$[30] = t10;
|
|
149
|
+
} else t10 = $[30];
|
|
150
|
+
const setFiles = t10;
|
|
151
|
+
let t11;
|
|
152
|
+
if ($[31] !== setFiles || $[32] !== setText) {
|
|
153
|
+
t11 = function clear() {
|
|
154
|
+
setText("");
|
|
155
|
+
setFiles([]);
|
|
156
|
+
};
|
|
157
|
+
$[31] = setFiles;
|
|
158
|
+
$[32] = setText;
|
|
159
|
+
$[33] = t11;
|
|
160
|
+
} else t11 = $[33];
|
|
161
|
+
const clear = t11;
|
|
162
|
+
let t12;
|
|
163
|
+
if ($[34] !== attached || $[35] !== canSubmit || $[36] !== clear || $[37] !== onSubmit || $[38] !== text) {
|
|
164
|
+
t12 = function submit(event) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
if (!canSubmit) return;
|
|
167
|
+
const result = onSubmit?.({
|
|
168
|
+
text,
|
|
169
|
+
files: attached
|
|
170
|
+
}, event);
|
|
171
|
+
if (result instanceof Promise) result.then(clear, _temp);
|
|
172
|
+
else clear();
|
|
173
|
+
};
|
|
174
|
+
$[34] = attached;
|
|
175
|
+
$[35] = canSubmit;
|
|
176
|
+
$[36] = clear;
|
|
177
|
+
$[37] = onSubmit;
|
|
178
|
+
$[38] = text;
|
|
179
|
+
$[39] = t12;
|
|
180
|
+
} else t12 = $[39];
|
|
181
|
+
const submit = t12;
|
|
182
|
+
let t13;
|
|
183
|
+
let t14;
|
|
184
|
+
if ($[40] !== picker) {
|
|
185
|
+
t13 = (next_1) => {
|
|
186
|
+
picker.addFiles(next_1);
|
|
187
|
+
};
|
|
188
|
+
t14 = () => picker.open();
|
|
189
|
+
$[40] = picker;
|
|
190
|
+
$[41] = t13;
|
|
191
|
+
$[42] = t14;
|
|
192
|
+
} else {
|
|
193
|
+
t13 = $[41];
|
|
194
|
+
t14 = $[42];
|
|
195
|
+
}
|
|
196
|
+
let t15;
|
|
197
|
+
if ($[43] !== attached || $[44] !== canSubmit || $[45] !== disabled || $[46] !== setFiles || $[47] !== setText || $[48] !== status || $[49] !== t13 || $[50] !== t14 || $[51] !== text) {
|
|
198
|
+
t15 = {
|
|
199
|
+
text,
|
|
200
|
+
setText,
|
|
201
|
+
files: attached,
|
|
202
|
+
setFiles,
|
|
203
|
+
addFiles: t13,
|
|
204
|
+
openFileDialog: t14,
|
|
205
|
+
status,
|
|
206
|
+
disabled,
|
|
207
|
+
canSubmit
|
|
208
|
+
};
|
|
209
|
+
$[43] = attached;
|
|
210
|
+
$[44] = canSubmit;
|
|
211
|
+
$[45] = disabled;
|
|
212
|
+
$[46] = setFiles;
|
|
213
|
+
$[47] = setText;
|
|
214
|
+
$[48] = status;
|
|
215
|
+
$[49] = t13;
|
|
216
|
+
$[50] = t14;
|
|
217
|
+
$[51] = text;
|
|
218
|
+
$[52] = t15;
|
|
219
|
+
} else t15 = $[52];
|
|
220
|
+
const context = t15;
|
|
221
|
+
let t16;
|
|
222
|
+
if ($[53] !== className) {
|
|
223
|
+
t16 = cn("w-full", className);
|
|
224
|
+
$[53] = className;
|
|
225
|
+
$[54] = t16;
|
|
226
|
+
} else t16 = $[54];
|
|
227
|
+
let t17;
|
|
228
|
+
if ($[55] !== onFilesChange) {
|
|
229
|
+
t17 = (next_2, details) => {
|
|
230
|
+
onFilesChange?.(next_2);
|
|
231
|
+
if (!details.canceled) setInnerFiles(next_2);
|
|
232
|
+
};
|
|
233
|
+
$[55] = onFilesChange;
|
|
234
|
+
$[56] = t17;
|
|
235
|
+
} else t17 = $[56];
|
|
236
|
+
let t18;
|
|
237
|
+
if ($[57] !== attached || $[58] !== validate) {
|
|
238
|
+
t18 = (file) => attached.some((item) => item.name === file.name) ? "duplicate" : validate?.(file);
|
|
239
|
+
$[57] = attached;
|
|
240
|
+
$[58] = validate;
|
|
241
|
+
$[59] = t18;
|
|
242
|
+
} else t18 = $[59];
|
|
243
|
+
let t19;
|
|
244
|
+
if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
|
|
245
|
+
t19 = () => textarea.current;
|
|
246
|
+
$[60] = t19;
|
|
247
|
+
} else t19 = $[60];
|
|
248
|
+
let t20;
|
|
249
|
+
if ($[61] !== children) {
|
|
250
|
+
t20 = /* @__PURE__ */ jsx(FileInputDropzone, {
|
|
251
|
+
pasteTarget: t19,
|
|
252
|
+
className: "block border-0 p-0 text-start",
|
|
253
|
+
children: /* @__PURE__ */ jsx(InputGroup, {
|
|
254
|
+
className: composerClasses,
|
|
255
|
+
children
|
|
256
|
+
})
|
|
257
|
+
});
|
|
258
|
+
$[61] = children;
|
|
259
|
+
$[62] = t20;
|
|
260
|
+
} else t20 = $[62];
|
|
261
|
+
let t21;
|
|
262
|
+
if ($[63] !== accept || $[64] !== attached || $[65] !== disabled || $[66] !== filesLabel || $[67] !== maxFiles || $[68] !== maxSize || $[69] !== minSize || $[70] !== multiple || $[71] !== onReject || $[72] !== picker || $[73] !== t17 || $[74] !== t18 || $[75] !== t20) {
|
|
263
|
+
t21 = /* @__PURE__ */ jsx(FileInput, {
|
|
264
|
+
"aria-label": filesLabel,
|
|
265
|
+
controller: picker,
|
|
266
|
+
multiple,
|
|
267
|
+
disabled,
|
|
268
|
+
accept,
|
|
269
|
+
maxFiles,
|
|
270
|
+
maxSize,
|
|
271
|
+
minSize,
|
|
272
|
+
onReject,
|
|
273
|
+
value: attached,
|
|
274
|
+
onValueChange: t17,
|
|
275
|
+
validate: t18,
|
|
276
|
+
children: t20
|
|
277
|
+
});
|
|
278
|
+
$[63] = accept;
|
|
279
|
+
$[64] = attached;
|
|
280
|
+
$[65] = disabled;
|
|
281
|
+
$[66] = filesLabel;
|
|
282
|
+
$[67] = maxFiles;
|
|
283
|
+
$[68] = maxSize;
|
|
284
|
+
$[69] = minSize;
|
|
285
|
+
$[70] = multiple;
|
|
286
|
+
$[71] = onReject;
|
|
287
|
+
$[72] = picker;
|
|
288
|
+
$[73] = t17;
|
|
289
|
+
$[74] = t18;
|
|
290
|
+
$[75] = t20;
|
|
291
|
+
$[76] = t21;
|
|
292
|
+
} else t21 = $[76];
|
|
293
|
+
let t22;
|
|
294
|
+
if ($[77] !== props || $[78] !== submit || $[79] !== t16 || $[80] !== t21) {
|
|
295
|
+
t22 = /* @__PURE__ */ jsx(TextareaContext.Provider, {
|
|
296
|
+
value: textarea,
|
|
297
|
+
children: /* @__PURE__ */ jsx("form", {
|
|
298
|
+
"data-slot": "prompt-input",
|
|
299
|
+
className: t16,
|
|
300
|
+
onSubmit: submit,
|
|
301
|
+
...props,
|
|
302
|
+
children: t21
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
$[77] = props;
|
|
306
|
+
$[78] = submit;
|
|
307
|
+
$[79] = t16;
|
|
308
|
+
$[80] = t21;
|
|
309
|
+
$[81] = t22;
|
|
310
|
+
} else t22 = $[81];
|
|
311
|
+
let t23;
|
|
312
|
+
if ($[82] !== filesLabel || $[83] !== t22) {
|
|
313
|
+
t23 = /* @__PURE__ */ jsx(FilesLabelContext.Provider, {
|
|
314
|
+
value: filesLabel,
|
|
315
|
+
children: t22
|
|
316
|
+
});
|
|
317
|
+
$[82] = filesLabel;
|
|
318
|
+
$[83] = t22;
|
|
319
|
+
$[84] = t23;
|
|
320
|
+
} else t23 = $[84];
|
|
321
|
+
let t24;
|
|
322
|
+
if ($[85] !== context || $[86] !== t23) {
|
|
323
|
+
t24 = /* @__PURE__ */ jsx(PromptInputContext.Provider, {
|
|
324
|
+
value: context,
|
|
325
|
+
children: t23
|
|
326
|
+
});
|
|
327
|
+
$[85] = context;
|
|
328
|
+
$[86] = t23;
|
|
329
|
+
$[87] = t24;
|
|
330
|
+
} else t24 = $[87];
|
|
331
|
+
return t24;
|
|
332
|
+
}
|
|
333
|
+
function _temp() {}
|
|
334
|
+
const stackedTextareaClasses = "group-has-[>[data-align=block-end]]/input-group:min-h-0 group-has-[>[data-align=block-end]]/input-group:px-4 group-has-[>[data-align=block-end]]/input-group:pt-4 group-has-[>[data-align=block-end]]/input-group:pb-0";
|
|
335
|
+
/**
|
|
336
|
+
* The message. Enter sends it, Shift+Enter adds a line, and Enter that
|
|
337
|
+
* confirms an input method's composition does neither; `submitShortcut`
|
|
338
|
+
* changes the keys. It grows with its text. Translate its name with `aria-label`.
|
|
339
|
+
*/
|
|
340
|
+
function PromptInputTextarea({ ref, onValueChange, className, "aria-label": ariaLabel = "Message", placeholder = "What would you like to know?", submitShortcut = "enter", autoResize = true, rows = 1, disabled, ...props }) {
|
|
341
|
+
const context = usePromptInput();
|
|
342
|
+
const textarea = useContext(TextareaContext);
|
|
343
|
+
return /* @__PURE__ */ jsx(InputGroupTextarea, {
|
|
344
|
+
ref: (node) => {
|
|
345
|
+
if (textarea) textarea.current = node;
|
|
346
|
+
if (typeof ref === "function") ref(node);
|
|
347
|
+
else if (ref) ref.current = node;
|
|
348
|
+
},
|
|
349
|
+
name: "message",
|
|
350
|
+
"aria-label": ariaLabel,
|
|
351
|
+
placeholder,
|
|
352
|
+
submitShortcut,
|
|
353
|
+
autoResize,
|
|
354
|
+
rows,
|
|
355
|
+
disabled: disabled ?? context.disabled,
|
|
356
|
+
className: cnState(["max-h-48 p-3 text-composer md:text-composer group-has-[>[data-align=inline-end]]/input-group:min-h-0 group-has-[>[data-align=inline-end]]/input-group:py-1.25", stackedTextareaClasses], className),
|
|
357
|
+
...props,
|
|
358
|
+
value: context.text,
|
|
359
|
+
onValueChange: (next, details) => {
|
|
360
|
+
onValueChange?.(next, details);
|
|
361
|
+
context.setText(next);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* The row above the text. With no children it lists the attached files, and
|
|
367
|
+
* draws nothing while there are none.
|
|
368
|
+
*/
|
|
369
|
+
function PromptInputHeader(t0) {
|
|
370
|
+
const $ = c(8);
|
|
371
|
+
let children;
|
|
372
|
+
let props;
|
|
373
|
+
if ($[0] !== t0) {
|
|
374
|
+
({children, ...props} = t0);
|
|
375
|
+
$[0] = t0;
|
|
376
|
+
$[1] = children;
|
|
377
|
+
$[2] = props;
|
|
378
|
+
} else {
|
|
379
|
+
children = $[1];
|
|
380
|
+
props = $[2];
|
|
381
|
+
}
|
|
382
|
+
const { files } = usePromptInput();
|
|
383
|
+
if (children === void 0 && files.length === 0) return null;
|
|
384
|
+
let t1;
|
|
385
|
+
if ($[3] !== children) {
|
|
386
|
+
t1 = children ?? /* @__PURE__ */ jsx(PromptInputAttachments, {});
|
|
387
|
+
$[3] = children;
|
|
388
|
+
$[4] = t1;
|
|
389
|
+
} else t1 = $[4];
|
|
390
|
+
let t2;
|
|
391
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
392
|
+
t2 = /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
393
|
+
align: "block-start",
|
|
394
|
+
...props,
|
|
395
|
+
children: t1
|
|
396
|
+
});
|
|
397
|
+
$[5] = props;
|
|
398
|
+
$[6] = t1;
|
|
399
|
+
$[7] = t2;
|
|
400
|
+
} else t2 = $[7];
|
|
401
|
+
return t2;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* The attached files, as a list with one Tab stop: arrows move between them,
|
|
405
|
+
* and Delete or Backspace removes the focused one. Its children render once
|
|
406
|
+
* for each file; with none, each file is a `PromptInputAttachment`.
|
|
407
|
+
*/
|
|
408
|
+
function PromptInputAttachments({ "aria-label": ariaLabel = "Attachments", className, children = /* @__PURE__ */ jsx(PromptInputAttachment, {}), ...props }) {
|
|
409
|
+
return /* @__PURE__ */ jsx(FileInputList, {
|
|
410
|
+
"aria-label": ariaLabel,
|
|
411
|
+
className: cnState("flex-row flex-wrap gap-2", className),
|
|
412
|
+
...props,
|
|
413
|
+
children
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/** One attached file: a small Attachment with its name and a button that removes it. */
|
|
417
|
+
function PromptInputAttachment({ icon = /* @__PURE__ */ jsx(Icon, { icon: File02Icon }), removeLabel, className, ...props }) {
|
|
418
|
+
return /* @__PURE__ */ jsx(FileInputItem, {
|
|
419
|
+
className: cnState("rounded-xl border-0 p-0 text-xs", className),
|
|
420
|
+
...props,
|
|
421
|
+
children: ({ file }) => /* @__PURE__ */ jsxs(Attachment, {
|
|
422
|
+
size: "sm",
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ jsx(AttachmentMedia, { children: icon }),
|
|
425
|
+
/* @__PURE__ */ jsx(AttachmentContent, { children: /* @__PURE__ */ jsx(AttachmentTitle, { children: file.name }) }),
|
|
426
|
+
/* @__PURE__ */ jsx(AttachmentActions, { children: /* @__PURE__ */ jsx(FileInputItemRemove, {
|
|
427
|
+
"aria-label": removeLabel?.(file),
|
|
428
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Cancel01Icon })
|
|
429
|
+
}) })
|
|
430
|
+
]
|
|
431
|
+
})
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* The row under the text: `PromptInputTools` at the start and at the end.
|
|
436
|
+
* Its controls are 28px, 10px from the box's edge and 4px apart, so a ghost
|
|
437
|
+
* button's icon lines up with the text above.
|
|
438
|
+
*/
|
|
439
|
+
function PromptInputFooter(t0) {
|
|
440
|
+
const $ = c(8);
|
|
441
|
+
let className;
|
|
442
|
+
let props;
|
|
443
|
+
if ($[0] !== t0) {
|
|
444
|
+
({className, ...props} = t0);
|
|
445
|
+
$[0] = t0;
|
|
446
|
+
$[1] = className;
|
|
447
|
+
$[2] = props;
|
|
448
|
+
} else {
|
|
449
|
+
className = $[1];
|
|
450
|
+
props = $[2];
|
|
451
|
+
}
|
|
452
|
+
let t1;
|
|
453
|
+
if ($[3] !== className) {
|
|
454
|
+
t1 = cnState("cursor-default justify-between gap-1 px-2.5 pt-2.5 pb-2.5", className);
|
|
455
|
+
$[3] = className;
|
|
456
|
+
$[4] = t1;
|
|
457
|
+
} else t1 = $[4];
|
|
458
|
+
let t2;
|
|
459
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
460
|
+
t2 = /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
461
|
+
align: "block-end",
|
|
462
|
+
className: t1,
|
|
463
|
+
...props
|
|
464
|
+
});
|
|
465
|
+
$[5] = props;
|
|
466
|
+
$[6] = t1;
|
|
467
|
+
$[7] = t2;
|
|
468
|
+
} else t2 = $[7];
|
|
469
|
+
return t2;
|
|
470
|
+
}
|
|
471
|
+
/** A group of controls in the footer: the action menu and the toggles, or the model, the microphone and Send. */
|
|
472
|
+
function PromptInputTools(t0) {
|
|
473
|
+
const $ = c(8);
|
|
474
|
+
let className;
|
|
475
|
+
let props;
|
|
476
|
+
if ($[0] !== t0) {
|
|
477
|
+
({className, ...props} = t0);
|
|
478
|
+
$[0] = t0;
|
|
479
|
+
$[1] = className;
|
|
480
|
+
$[2] = props;
|
|
481
|
+
} else {
|
|
482
|
+
className = $[1];
|
|
483
|
+
props = $[2];
|
|
484
|
+
}
|
|
485
|
+
let t1;
|
|
486
|
+
if ($[3] !== className) {
|
|
487
|
+
t1 = cn("flex min-w-0 items-center gap-1", className);
|
|
488
|
+
$[3] = className;
|
|
489
|
+
$[4] = t1;
|
|
490
|
+
} else t1 = $[4];
|
|
491
|
+
let t2;
|
|
492
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
493
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
494
|
+
"data-slot": "prompt-input-tools",
|
|
495
|
+
className: t1,
|
|
496
|
+
...props
|
|
497
|
+
});
|
|
498
|
+
$[5] = props;
|
|
499
|
+
$[6] = t1;
|
|
500
|
+
$[7] = t2;
|
|
501
|
+
} else t2 = $[7];
|
|
502
|
+
return t2;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* A button in the footer: a quiet pill with an icon and a label, or a round
|
|
506
|
+
* button with only an icon (`size="icon-sm"`, and an `aria-label`).
|
|
507
|
+
*/
|
|
508
|
+
function PromptInputButton(t0) {
|
|
509
|
+
const $ = c(12);
|
|
510
|
+
let className;
|
|
511
|
+
let props;
|
|
512
|
+
let t1;
|
|
513
|
+
let t2;
|
|
514
|
+
if ($[0] !== t0) {
|
|
515
|
+
({variant: t1, size: t2, className, ...props} = t0);
|
|
516
|
+
$[0] = t0;
|
|
517
|
+
$[1] = className;
|
|
518
|
+
$[2] = props;
|
|
519
|
+
$[3] = t1;
|
|
520
|
+
$[4] = t2;
|
|
521
|
+
} else {
|
|
522
|
+
className = $[1];
|
|
523
|
+
props = $[2];
|
|
524
|
+
t1 = $[3];
|
|
525
|
+
t2 = $[4];
|
|
526
|
+
}
|
|
527
|
+
const variant = t1 === void 0 ? "ghost" : t1;
|
|
528
|
+
const size = t2 === void 0 ? "sm" : t2;
|
|
529
|
+
let t3;
|
|
530
|
+
if ($[5] !== className) {
|
|
531
|
+
t3 = cnState(["rounded-full font-normal", roundIconClasses], className);
|
|
532
|
+
$[5] = className;
|
|
533
|
+
$[6] = t3;
|
|
534
|
+
} else t3 = $[6];
|
|
535
|
+
let t4;
|
|
536
|
+
if ($[7] !== props || $[8] !== size || $[9] !== t3 || $[10] !== variant) {
|
|
537
|
+
t4 = /* @__PURE__ */ jsx(InputGroupButton, {
|
|
538
|
+
variant,
|
|
539
|
+
size,
|
|
540
|
+
className: t3,
|
|
541
|
+
...props
|
|
542
|
+
});
|
|
543
|
+
$[7] = props;
|
|
544
|
+
$[8] = size;
|
|
545
|
+
$[9] = t3;
|
|
546
|
+
$[10] = variant;
|
|
547
|
+
$[11] = t4;
|
|
548
|
+
} else t4 = $[11];
|
|
549
|
+
return t4;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* An option that goes with the message, like "Web search": a pill with an
|
|
553
|
+
* icon and a label that is on or off. Off, it is an outline in the quiet
|
|
554
|
+
* gray; on, it takes a fill, a firmer edge and the text color, so the state
|
|
555
|
+
* reads by more than a tint.
|
|
556
|
+
*/
|
|
557
|
+
function PromptInputToggle(t0) {
|
|
558
|
+
const $ = c(9);
|
|
559
|
+
let className;
|
|
560
|
+
let props;
|
|
561
|
+
if ($[0] !== t0) {
|
|
562
|
+
({className, ...props} = t0);
|
|
563
|
+
$[0] = t0;
|
|
564
|
+
$[1] = className;
|
|
565
|
+
$[2] = props;
|
|
566
|
+
} else {
|
|
567
|
+
className = $[1];
|
|
568
|
+
props = $[2];
|
|
569
|
+
}
|
|
570
|
+
const context = usePromptInput();
|
|
571
|
+
const t1 = props.disabled ?? context.disabled;
|
|
572
|
+
let t2;
|
|
573
|
+
if ($[3] !== className) {
|
|
574
|
+
t2 = cnState("rounded-full border border-border px-3 font-normal text-muted-foreground hover:bg-accent hover:text-foreground data-pressed:border-input data-pressed:bg-accent data-pressed:text-foreground data-pressed:hover:bg-accent", className);
|
|
575
|
+
$[3] = className;
|
|
576
|
+
$[4] = t2;
|
|
577
|
+
} else t2 = $[4];
|
|
578
|
+
let t3;
|
|
579
|
+
if ($[5] !== props || $[6] !== t1 || $[7] !== t2) {
|
|
580
|
+
t3 = /* @__PURE__ */ jsx(Toggle, {
|
|
581
|
+
size: "sm",
|
|
582
|
+
disabled: t1,
|
|
583
|
+
className: t2,
|
|
584
|
+
...props
|
|
585
|
+
});
|
|
586
|
+
$[5] = props;
|
|
587
|
+
$[6] = t1;
|
|
588
|
+
$[7] = t2;
|
|
589
|
+
$[8] = t3;
|
|
590
|
+
} else t3 = $[8];
|
|
591
|
+
return t3;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* The menu of things to add to the message, opened from the footer's plus
|
|
595
|
+
* button: upload a file, take a screenshot, connect a source. It takes Menu's props.
|
|
596
|
+
*/
|
|
597
|
+
function PromptInputActionMenu(props) {
|
|
598
|
+
const $ = c(2);
|
|
599
|
+
let t0;
|
|
600
|
+
if ($[0] !== props) {
|
|
601
|
+
t0 = /* @__PURE__ */ jsx(ActionMenuContext, {
|
|
602
|
+
value: true,
|
|
603
|
+
children: /* @__PURE__ */ jsx(Menu, { ...props })
|
|
604
|
+
});
|
|
605
|
+
$[0] = props;
|
|
606
|
+
$[1] = t0;
|
|
607
|
+
} else t0 = $[1];
|
|
608
|
+
return t0;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* The round plus button that opens the action menu. Its name is "Add
|
|
612
|
+
* context" by default, to translate with `aria-label`: not "Attach files",
|
|
613
|
+
* which is the file input's, nor a word an item's name holds whole, or an
|
|
614
|
+
* agent can't tell them apart.
|
|
615
|
+
*/
|
|
616
|
+
function PromptInputActionMenuTrigger({ "aria-label": ariaLabel = "Add context", className, children = /* @__PURE__ */ jsx(Icon, { icon: PlusSignIcon }), ...props }) {
|
|
617
|
+
const context = usePromptInput();
|
|
618
|
+
return /* @__PURE__ */ jsx(MenuTrigger, {
|
|
619
|
+
"aria-label": ariaLabel,
|
|
620
|
+
disabled: props.disabled ?? context.disabled,
|
|
621
|
+
className: cnState([inputGroupButtonVariants({
|
|
622
|
+
variant: "ghost",
|
|
623
|
+
size: "icon-sm"
|
|
624
|
+
}), roundIconClasses], className),
|
|
625
|
+
...props,
|
|
626
|
+
children
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
/** The popup of the action menu. It opens above the plus button, from its start. */
|
|
630
|
+
function PromptInputActionMenuContent(t0) {
|
|
631
|
+
const $ = c(12);
|
|
632
|
+
let className;
|
|
633
|
+
let props;
|
|
634
|
+
let t1;
|
|
635
|
+
let t2;
|
|
636
|
+
if ($[0] !== t0) {
|
|
637
|
+
({side: t1, align: t2, className, ...props} = t0);
|
|
638
|
+
$[0] = t0;
|
|
639
|
+
$[1] = className;
|
|
640
|
+
$[2] = props;
|
|
641
|
+
$[3] = t1;
|
|
642
|
+
$[4] = t2;
|
|
643
|
+
} else {
|
|
644
|
+
className = $[1];
|
|
645
|
+
props = $[2];
|
|
646
|
+
t1 = $[3];
|
|
647
|
+
t2 = $[4];
|
|
648
|
+
}
|
|
649
|
+
const side = t1 === void 0 ? "top" : t1;
|
|
650
|
+
const align = t2 === void 0 ? "start" : t2;
|
|
651
|
+
let t3;
|
|
652
|
+
if ($[5] !== className) {
|
|
653
|
+
t3 = cnState("min-w-52", className);
|
|
654
|
+
$[5] = className;
|
|
655
|
+
$[6] = t3;
|
|
656
|
+
} else t3 = $[6];
|
|
657
|
+
let t4;
|
|
658
|
+
if ($[7] !== align || $[8] !== props || $[9] !== side || $[10] !== t3) {
|
|
659
|
+
t4 = /* @__PURE__ */ jsx(MenuContent, {
|
|
660
|
+
side,
|
|
661
|
+
align,
|
|
662
|
+
className: t3,
|
|
663
|
+
...props
|
|
664
|
+
});
|
|
665
|
+
$[7] = align;
|
|
666
|
+
$[8] = props;
|
|
667
|
+
$[9] = side;
|
|
668
|
+
$[10] = t3;
|
|
669
|
+
$[11] = t4;
|
|
670
|
+
} else t4 = $[11];
|
|
671
|
+
return t4;
|
|
672
|
+
}
|
|
673
|
+
/** One action. Start it with an `Icon`, which takes the quiet gray. */
|
|
674
|
+
function PromptInputActionMenuItem(t0) {
|
|
675
|
+
const $ = c(8);
|
|
676
|
+
let className;
|
|
677
|
+
let props;
|
|
678
|
+
if ($[0] !== t0) {
|
|
679
|
+
({className, ...props} = t0);
|
|
680
|
+
$[0] = t0;
|
|
681
|
+
$[1] = className;
|
|
682
|
+
$[2] = props;
|
|
683
|
+
} else {
|
|
684
|
+
className = $[1];
|
|
685
|
+
props = $[2];
|
|
686
|
+
}
|
|
687
|
+
let t1;
|
|
688
|
+
if ($[3] !== className) {
|
|
689
|
+
t1 = cnState("gap-3 [&_[data-slot=icon]]:size-4.5 [&_[data-slot=icon]]:text-muted-foreground", className);
|
|
690
|
+
$[3] = className;
|
|
691
|
+
$[4] = t1;
|
|
692
|
+
} else t1 = $[4];
|
|
693
|
+
let t2;
|
|
694
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
695
|
+
t2 = /* @__PURE__ */ jsx(MenuItem, {
|
|
696
|
+
className: t1,
|
|
697
|
+
...props
|
|
698
|
+
});
|
|
699
|
+
$[5] = props;
|
|
700
|
+
$[6] = t1;
|
|
701
|
+
$[7] = t2;
|
|
702
|
+
} else t2 = $[7];
|
|
703
|
+
return t2;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* The action that opens the file picker. Inside a `PromptInputActionMenu` it
|
|
707
|
+
* is one of its items, "Upload file" with a paperclip. Anywhere else it is a
|
|
708
|
+
* round plus button named by `label`, or by its children.
|
|
709
|
+
*/
|
|
710
|
+
function PromptInputActionAddAttachments(t0) {
|
|
711
|
+
const $ = c(26);
|
|
712
|
+
let children;
|
|
713
|
+
let className;
|
|
714
|
+
let label;
|
|
715
|
+
let props;
|
|
716
|
+
let t1;
|
|
717
|
+
if ($[0] !== t0) {
|
|
718
|
+
({label, variant: t1, className, children, ...props} = t0);
|
|
719
|
+
$[0] = t0;
|
|
720
|
+
$[1] = children;
|
|
721
|
+
$[2] = className;
|
|
722
|
+
$[3] = label;
|
|
723
|
+
$[4] = props;
|
|
724
|
+
$[5] = t1;
|
|
725
|
+
} else {
|
|
726
|
+
children = $[1];
|
|
727
|
+
className = $[2];
|
|
728
|
+
label = $[3];
|
|
729
|
+
props = $[4];
|
|
730
|
+
t1 = $[5];
|
|
731
|
+
}
|
|
732
|
+
const variant = t1 === void 0 ? "outline" : t1;
|
|
733
|
+
const filesLabel = useContext(FilesLabelContext);
|
|
734
|
+
const inMenu = use(ActionMenuContext);
|
|
735
|
+
const context = usePromptInput();
|
|
736
|
+
if (inMenu) {
|
|
737
|
+
const t2 = props.disabled ?? context.disabled;
|
|
738
|
+
const t3 = typeof className === "string" ? className : void 0;
|
|
739
|
+
let t4;
|
|
740
|
+
if ($[6] !== context) {
|
|
741
|
+
t4 = () => context.openFileDialog();
|
|
742
|
+
$[6] = context;
|
|
743
|
+
$[7] = t4;
|
|
744
|
+
} else t4 = $[7];
|
|
745
|
+
let t5;
|
|
746
|
+
if ($[8] !== children || $[9] !== label) {
|
|
747
|
+
t5 = (typeof children === "function" ? void 0 : children) ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, { icon: Attachment01Icon }), label ?? "Upload file"] });
|
|
748
|
+
$[8] = children;
|
|
749
|
+
$[9] = label;
|
|
750
|
+
$[10] = t5;
|
|
751
|
+
} else t5 = $[10];
|
|
752
|
+
let t6;
|
|
753
|
+
if ($[11] !== t2 || $[12] !== t3 || $[13] !== t4 || $[14] !== t5) {
|
|
754
|
+
t6 = /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
|
|
755
|
+
disabled: t2,
|
|
756
|
+
className: t3,
|
|
757
|
+
onSelect: t4,
|
|
758
|
+
children: t5
|
|
759
|
+
});
|
|
760
|
+
$[11] = t2;
|
|
761
|
+
$[12] = t3;
|
|
762
|
+
$[13] = t4;
|
|
763
|
+
$[14] = t5;
|
|
764
|
+
$[15] = t6;
|
|
765
|
+
} else t6 = $[15];
|
|
766
|
+
return t6;
|
|
767
|
+
}
|
|
768
|
+
const t2 = label ?? filesLabel;
|
|
769
|
+
let t3;
|
|
770
|
+
if ($[16] !== className || $[17] !== variant) {
|
|
771
|
+
t3 = cnState([inputGroupButtonVariants({
|
|
772
|
+
variant,
|
|
773
|
+
size: "icon-sm"
|
|
774
|
+
}), "rounded-full"], className);
|
|
775
|
+
$[16] = className;
|
|
776
|
+
$[17] = variant;
|
|
777
|
+
$[18] = t3;
|
|
778
|
+
} else t3 = $[18];
|
|
779
|
+
let t4;
|
|
780
|
+
if ($[19] !== children) {
|
|
781
|
+
t4 = children ?? /* @__PURE__ */ jsx(Icon, { icon: PlusSignIcon });
|
|
782
|
+
$[19] = children;
|
|
783
|
+
$[20] = t4;
|
|
784
|
+
} else t4 = $[20];
|
|
785
|
+
let t5;
|
|
786
|
+
if ($[21] !== props || $[22] !== t2 || $[23] !== t3 || $[24] !== t4) {
|
|
787
|
+
t5 = /* @__PURE__ */ jsx(FileInputTrigger, {
|
|
788
|
+
"aria-label": t2,
|
|
789
|
+
className: t3,
|
|
790
|
+
...props,
|
|
791
|
+
children: t4
|
|
792
|
+
});
|
|
793
|
+
$[21] = props;
|
|
794
|
+
$[22] = t2;
|
|
795
|
+
$[23] = t3;
|
|
796
|
+
$[24] = t4;
|
|
797
|
+
$[25] = t5;
|
|
798
|
+
} else t5 = $[25];
|
|
799
|
+
return t5;
|
|
800
|
+
}
|
|
801
|
+
/** A capture's file name, unique to the second, so a second capture isn't refused as a duplicate. */
|
|
802
|
+
function stampedName(prefix, extension) {
|
|
803
|
+
const now = /* @__PURE__ */ new Date();
|
|
804
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
805
|
+
return `${prefix} ${`${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`} ${`${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`}.${extension}`;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Asks the browser to share a screen, window or tab, draws one frame of it
|
|
809
|
+
* into a PNG and stops sharing. Resolves with null when the person cancels or
|
|
810
|
+
* the browser can't share a screen.
|
|
811
|
+
*/
|
|
812
|
+
async function captureScreen() {
|
|
813
|
+
if (!navigator.mediaDevices?.getDisplayMedia) return null;
|
|
814
|
+
let stream;
|
|
815
|
+
try {
|
|
816
|
+
stream = await navigator.mediaDevices.getDisplayMedia({
|
|
817
|
+
video: true,
|
|
818
|
+
audio: false
|
|
819
|
+
});
|
|
820
|
+
} catch {
|
|
821
|
+
return null;
|
|
822
|
+
}
|
|
823
|
+
try {
|
|
824
|
+
const video = document.createElement("video");
|
|
825
|
+
video.muted = true;
|
|
826
|
+
video.srcObject = stream;
|
|
827
|
+
await video.play();
|
|
828
|
+
const canvas = document.createElement("canvas");
|
|
829
|
+
canvas.width = video.videoWidth;
|
|
830
|
+
canvas.height = video.videoHeight;
|
|
831
|
+
canvas.getContext("2d")?.drawImage(video, 0, 0);
|
|
832
|
+
const blob = await new Promise((resolve) => canvas.toBlob(resolve, "image/png"));
|
|
833
|
+
return blob && new File([blob], stampedName("Screenshot", "png"), { type: "image/png" });
|
|
834
|
+
} finally {
|
|
835
|
+
for (const track of stream.getTracks()) track.stop();
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* An item of the action menu that attaches a screenshot: the browser asks
|
|
840
|
+
* which screen, window or tab to share, and one frame of it is attached as a PNG.
|
|
841
|
+
*/
|
|
842
|
+
function PromptInputActionAddScreenshot(t0) {
|
|
843
|
+
const $ = c(15);
|
|
844
|
+
let children;
|
|
845
|
+
let disabled;
|
|
846
|
+
let props;
|
|
847
|
+
let t1;
|
|
848
|
+
if ($[0] !== t0) {
|
|
849
|
+
({label: t1, disabled, children, ...props} = t0);
|
|
850
|
+
$[0] = t0;
|
|
851
|
+
$[1] = children;
|
|
852
|
+
$[2] = disabled;
|
|
853
|
+
$[3] = props;
|
|
854
|
+
$[4] = t1;
|
|
855
|
+
} else {
|
|
856
|
+
children = $[1];
|
|
857
|
+
disabled = $[2];
|
|
858
|
+
props = $[3];
|
|
859
|
+
t1 = $[4];
|
|
860
|
+
}
|
|
861
|
+
const label = t1 === void 0 ? "Take a screenshot" : t1;
|
|
862
|
+
const context = usePromptInput();
|
|
863
|
+
const t2 = disabled ?? context.disabled;
|
|
864
|
+
let t3;
|
|
865
|
+
if ($[5] !== context) {
|
|
866
|
+
t3 = async () => {
|
|
867
|
+
const file = await captureScreen();
|
|
868
|
+
if (file) context.addFiles([file]);
|
|
869
|
+
};
|
|
870
|
+
$[5] = context;
|
|
871
|
+
$[6] = t3;
|
|
872
|
+
} else t3 = $[6];
|
|
873
|
+
let t4;
|
|
874
|
+
if ($[7] !== children || $[8] !== label) {
|
|
875
|
+
t4 = children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, { icon: Camera01Icon }), label] });
|
|
876
|
+
$[7] = children;
|
|
877
|
+
$[8] = label;
|
|
878
|
+
$[9] = t4;
|
|
879
|
+
} else t4 = $[9];
|
|
880
|
+
let t5;
|
|
881
|
+
if ($[10] !== props || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
|
|
882
|
+
t5 = /* @__PURE__ */ jsx(PromptInputActionMenuItem, {
|
|
883
|
+
disabled: t2,
|
|
884
|
+
onSelect: t3,
|
|
885
|
+
...props,
|
|
886
|
+
children: t4
|
|
887
|
+
});
|
|
888
|
+
$[10] = props;
|
|
889
|
+
$[11] = t2;
|
|
890
|
+
$[12] = t3;
|
|
891
|
+
$[13] = t4;
|
|
892
|
+
$[14] = t5;
|
|
893
|
+
} else t5 = $[14];
|
|
894
|
+
return t5;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Send, which is Stop during a run: one button for both, so focus stays on it
|
|
898
|
+
* when a run starts or ends. While there is nothing to send it is disabled
|
|
899
|
+
* and quiet, a gray circle; with text it takes the primary fill. Children
|
|
900
|
+
* replace its icon.
|
|
901
|
+
*/
|
|
902
|
+
function PromptInputSubmit(t0) {
|
|
903
|
+
const $ = c(32);
|
|
904
|
+
let children;
|
|
905
|
+
let className;
|
|
906
|
+
let disabled;
|
|
907
|
+
let onClick;
|
|
908
|
+
let onStop;
|
|
909
|
+
let ownStatus;
|
|
910
|
+
let props;
|
|
911
|
+
let t1;
|
|
912
|
+
let t2;
|
|
913
|
+
let t3;
|
|
914
|
+
let t4;
|
|
915
|
+
if ($[0] !== t0) {
|
|
916
|
+
({status: ownStatus, onStop, label: t1, stopLabel: t2, variant: t3, size: t4, disabled, className, onClick, children, ...props} = t0);
|
|
917
|
+
$[0] = t0;
|
|
918
|
+
$[1] = children;
|
|
919
|
+
$[2] = className;
|
|
920
|
+
$[3] = disabled;
|
|
921
|
+
$[4] = onClick;
|
|
922
|
+
$[5] = onStop;
|
|
923
|
+
$[6] = ownStatus;
|
|
924
|
+
$[7] = props;
|
|
925
|
+
$[8] = t1;
|
|
926
|
+
$[9] = t2;
|
|
927
|
+
$[10] = t3;
|
|
928
|
+
$[11] = t4;
|
|
929
|
+
} else {
|
|
930
|
+
children = $[1];
|
|
931
|
+
className = $[2];
|
|
932
|
+
disabled = $[3];
|
|
933
|
+
onClick = $[4];
|
|
934
|
+
onStop = $[5];
|
|
935
|
+
ownStatus = $[6];
|
|
936
|
+
props = $[7];
|
|
937
|
+
t1 = $[8];
|
|
938
|
+
t2 = $[9];
|
|
939
|
+
t3 = $[10];
|
|
940
|
+
t4 = $[11];
|
|
941
|
+
}
|
|
942
|
+
const label = t1 === void 0 ? "Send" : t1;
|
|
943
|
+
const stopLabel = t2 === void 0 ? "Stop" : t2;
|
|
944
|
+
const variant = t3 === void 0 ? "default" : t3;
|
|
945
|
+
const size = t4 === void 0 ? "icon-sm" : t4;
|
|
946
|
+
const context = usePromptInput();
|
|
947
|
+
const status = ownStatus ?? context.status;
|
|
948
|
+
const busy = status === "submitted" || status === "streaming";
|
|
949
|
+
const waiting = disabled === void 0 && !busy && !context.disabled && !context.canSubmit;
|
|
950
|
+
const t5 = busy ? "button" : "submit";
|
|
951
|
+
const t6 = busy ? stopLabel : label;
|
|
952
|
+
const t7 = disabled ?? (busy ? context.disabled : !context.canSubmit);
|
|
953
|
+
const t8 = waiting && "data-disabled:bg-accent data-disabled:text-muted-foreground data-disabled:opacity-100";
|
|
954
|
+
let t9;
|
|
955
|
+
if ($[12] !== className || $[13] !== t8) {
|
|
956
|
+
t9 = cnState([roundIconClasses, t8], className);
|
|
957
|
+
$[12] = className;
|
|
958
|
+
$[13] = t8;
|
|
959
|
+
$[14] = t9;
|
|
960
|
+
} else t9 = $[14];
|
|
961
|
+
let t10;
|
|
962
|
+
if ($[15] !== busy || $[16] !== onClick || $[17] !== onStop) {
|
|
963
|
+
t10 = (event, ...t11) => {
|
|
964
|
+
const rest = t11;
|
|
965
|
+
if (!busy) return onClick?.(event, ...rest);
|
|
966
|
+
event.preventDefault();
|
|
967
|
+
onStop?.();
|
|
968
|
+
};
|
|
969
|
+
$[15] = busy;
|
|
970
|
+
$[16] = onClick;
|
|
971
|
+
$[17] = onStop;
|
|
972
|
+
$[18] = t10;
|
|
973
|
+
} else t10 = $[18];
|
|
974
|
+
let t11;
|
|
975
|
+
if ($[19] !== children || $[20] !== status) {
|
|
976
|
+
t11 = children ?? /* @__PURE__ */ jsx(SubmitIcon, { status });
|
|
977
|
+
$[19] = children;
|
|
978
|
+
$[20] = status;
|
|
979
|
+
$[21] = t11;
|
|
980
|
+
} else t11 = $[21];
|
|
981
|
+
let t12;
|
|
982
|
+
if ($[22] !== props || $[23] !== size || $[24] !== t10 || $[25] !== t11 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7 || $[29] !== t9 || $[30] !== variant) {
|
|
983
|
+
t12 = /* @__PURE__ */ jsx(InputGroupButton, {
|
|
984
|
+
type: t5,
|
|
985
|
+
variant,
|
|
986
|
+
size,
|
|
987
|
+
"aria-label": t6,
|
|
988
|
+
disabled: t7,
|
|
989
|
+
className: t9,
|
|
990
|
+
onClick: t10,
|
|
991
|
+
...props,
|
|
992
|
+
children: t11
|
|
993
|
+
});
|
|
994
|
+
$[22] = props;
|
|
995
|
+
$[23] = size;
|
|
996
|
+
$[24] = t10;
|
|
997
|
+
$[25] = t11;
|
|
998
|
+
$[26] = t5;
|
|
999
|
+
$[27] = t6;
|
|
1000
|
+
$[28] = t7;
|
|
1001
|
+
$[29] = t9;
|
|
1002
|
+
$[30] = variant;
|
|
1003
|
+
$[31] = t12;
|
|
1004
|
+
} else t12 = $[31];
|
|
1005
|
+
return t12;
|
|
1006
|
+
}
|
|
1007
|
+
function SubmitIcon(t0) {
|
|
1008
|
+
const $ = c(3);
|
|
1009
|
+
const { status } = t0;
|
|
1010
|
+
if (status === "submitted") {
|
|
1011
|
+
let t1;
|
|
1012
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1013
|
+
t1 = /* @__PURE__ */ jsx(Icon, {
|
|
1014
|
+
icon: Loading03Icon,
|
|
1015
|
+
className: "animate-spin motion-reduce:animate-none"
|
|
1016
|
+
});
|
|
1017
|
+
$[0] = t1;
|
|
1018
|
+
} else t1 = $[0];
|
|
1019
|
+
return t1;
|
|
1020
|
+
}
|
|
1021
|
+
const t1 = status === "streaming" ? StopIcon : ArrowUp02Icon;
|
|
1022
|
+
let t2;
|
|
1023
|
+
if ($[1] !== t1) {
|
|
1024
|
+
t2 = /* @__PURE__ */ jsx(Icon, { icon: t1 });
|
|
1025
|
+
$[1] = t1;
|
|
1026
|
+
$[2] = t2;
|
|
1027
|
+
} else t2 = $[2];
|
|
1028
|
+
return t2;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* The microphone: a toggle that is pressed while a voice note records. It
|
|
1032
|
+
* takes a fill and a ring 2px off its edge then, so the recording reads from
|
|
1033
|
+
* across the screen. Translate its name with `aria-label`.
|
|
1034
|
+
*/
|
|
1035
|
+
function PromptInputSpeechButton({ "aria-label": ariaLabel = "Record voice", className, children = /* @__PURE__ */ jsx(Icon, { icon: Mic01Icon }), ...props }) {
|
|
1036
|
+
const context = usePromptInput();
|
|
1037
|
+
return /* @__PURE__ */ jsx(Toggle, {
|
|
1038
|
+
size: "sm",
|
|
1039
|
+
"aria-label": ariaLabel,
|
|
1040
|
+
disabled: props.disabled ?? context.disabled,
|
|
1041
|
+
className: cnState([roundIconClasses, "size-7 p-0 text-muted-foreground hover:bg-accent hover:text-foreground data-pressed:bg-accent data-pressed:text-foreground data-pressed:outline-muted-foreground data-pressed:hover:bg-accent"], className),
|
|
1042
|
+
...props,
|
|
1043
|
+
children
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* The row that takes the textarea's place while a voice note records:
|
|
1048
|
+
* `PromptInputRecorderCancel` at the start, then `PromptInputWaveform`,
|
|
1049
|
+
* `PromptInputRecorderTime` and `PromptInputRecorderConfirm`. Render it
|
|
1050
|
+
* instead of `PromptInputTextarea`; the text typed so far stays in the form.
|
|
1051
|
+
*/
|
|
1052
|
+
function PromptInputRecorder(t0) {
|
|
1053
|
+
const $ = c(10);
|
|
1054
|
+
let className;
|
|
1055
|
+
let props;
|
|
1056
|
+
let t1;
|
|
1057
|
+
if ($[0] !== t0) {
|
|
1058
|
+
({"aria-label": t1, className, ...props} = t0);
|
|
1059
|
+
$[0] = t0;
|
|
1060
|
+
$[1] = className;
|
|
1061
|
+
$[2] = props;
|
|
1062
|
+
$[3] = t1;
|
|
1063
|
+
} else {
|
|
1064
|
+
className = $[1];
|
|
1065
|
+
props = $[2];
|
|
1066
|
+
t1 = $[3];
|
|
1067
|
+
}
|
|
1068
|
+
const ariaLabel = t1 === void 0 ? "Voice recording" : t1;
|
|
1069
|
+
let t2;
|
|
1070
|
+
if ($[4] !== className) {
|
|
1071
|
+
t2 = cn("flex w-full min-w-0 items-center gap-2 px-2.5 pt-2.5", className);
|
|
1072
|
+
$[4] = className;
|
|
1073
|
+
$[5] = t2;
|
|
1074
|
+
} else t2 = $[5];
|
|
1075
|
+
let t3;
|
|
1076
|
+
if ($[6] !== ariaLabel || $[7] !== props || $[8] !== t2) {
|
|
1077
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
1078
|
+
"data-slot": "prompt-input-recorder",
|
|
1079
|
+
role: "group",
|
|
1080
|
+
"aria-label": ariaLabel,
|
|
1081
|
+
className: t2,
|
|
1082
|
+
...props
|
|
1083
|
+
});
|
|
1084
|
+
$[6] = ariaLabel;
|
|
1085
|
+
$[7] = props;
|
|
1086
|
+
$[8] = t2;
|
|
1087
|
+
$[9] = t3;
|
|
1088
|
+
} else t3 = $[9];
|
|
1089
|
+
return t3;
|
|
1090
|
+
}
|
|
1091
|
+
/** Stops the recording and throws it away. */
|
|
1092
|
+
function PromptInputRecorderCancel({ "aria-label": ariaLabel = "Cancel recording", className, children = /* @__PURE__ */ jsx(Icon, { icon: Cancel01Icon }), ...props }) {
|
|
1093
|
+
return /* @__PURE__ */ jsx(InputGroupButton, {
|
|
1094
|
+
variant: "ghost",
|
|
1095
|
+
size: "icon-sm",
|
|
1096
|
+
"aria-label": ariaLabel,
|
|
1097
|
+
className: cnState(["me-auto", roundIconClasses], className),
|
|
1098
|
+
...props,
|
|
1099
|
+
children
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
/** Stops the recording and keeps it: the row's main action. */
|
|
1103
|
+
function PromptInputRecorderConfirm({ "aria-label": ariaLabel = "Finish recording", className, children = /* @__PURE__ */ jsx(Icon, { icon: Tick02Icon }), ...props }) {
|
|
1104
|
+
return /* @__PURE__ */ jsx(InputGroupButton, {
|
|
1105
|
+
variant: "secondary",
|
|
1106
|
+
size: "icon-sm",
|
|
1107
|
+
"aria-label": ariaLabel,
|
|
1108
|
+
className: cnState([roundIconClasses, "bg-accent text-foreground hover:bg-accent/70"], className),
|
|
1109
|
+
...props,
|
|
1110
|
+
children
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
const WAVEFORM_HEIGHT = 28;
|
|
1114
|
+
/**
|
|
1115
|
+
* The recording's loudness as bars, 2px wide and 2px apart. It is drawn for
|
|
1116
|
+
* the eye only: the time says the recording is going.
|
|
1117
|
+
*/
|
|
1118
|
+
function PromptInputWaveform(t0) {
|
|
1119
|
+
const $ = c(12);
|
|
1120
|
+
let className;
|
|
1121
|
+
let levels;
|
|
1122
|
+
let props;
|
|
1123
|
+
if ($[0] !== t0) {
|
|
1124
|
+
({levels, className, ...props} = t0);
|
|
1125
|
+
$[0] = t0;
|
|
1126
|
+
$[1] = className;
|
|
1127
|
+
$[2] = levels;
|
|
1128
|
+
$[3] = props;
|
|
1129
|
+
} else {
|
|
1130
|
+
className = $[1];
|
|
1131
|
+
levels = $[2];
|
|
1132
|
+
props = $[3];
|
|
1133
|
+
}
|
|
1134
|
+
let t1;
|
|
1135
|
+
if ($[4] !== className) {
|
|
1136
|
+
t1 = cn("flex h-7 min-w-0 flex-1 items-center justify-end gap-0.5 overflow-hidden", className);
|
|
1137
|
+
$[4] = className;
|
|
1138
|
+
$[5] = t1;
|
|
1139
|
+
} else t1 = $[5];
|
|
1140
|
+
let t2;
|
|
1141
|
+
if ($[6] !== levels) {
|
|
1142
|
+
t2 = levels.map(_temp2);
|
|
1143
|
+
$[6] = levels;
|
|
1144
|
+
$[7] = t2;
|
|
1145
|
+
} else t2 = $[7];
|
|
1146
|
+
let t3;
|
|
1147
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
1148
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
1149
|
+
"data-slot": "prompt-input-waveform",
|
|
1150
|
+
"aria-hidden": true,
|
|
1151
|
+
className: t1,
|
|
1152
|
+
...props,
|
|
1153
|
+
children: t2
|
|
1154
|
+
});
|
|
1155
|
+
$[8] = props;
|
|
1156
|
+
$[9] = t1;
|
|
1157
|
+
$[10] = t2;
|
|
1158
|
+
$[11] = t3;
|
|
1159
|
+
} else t3 = $[11];
|
|
1160
|
+
return t3;
|
|
1161
|
+
}
|
|
1162
|
+
function _temp2(level, index) {
|
|
1163
|
+
return /* @__PURE__ */ jsx("span", {
|
|
1164
|
+
className: "w-0.5 shrink-0 rounded-full bg-foreground",
|
|
1165
|
+
style: { height: `${Math.max(2, Math.round(Math.min(1, Math.max(0, level)) * WAVEFORM_HEIGHT))}px` }
|
|
1166
|
+
}, index);
|
|
1167
|
+
}
|
|
1168
|
+
/** `m:ss`, the way a recording's length is read. */
|
|
1169
|
+
function formatDuration(seconds) {
|
|
1170
|
+
const whole = Math.max(0, Math.floor(seconds));
|
|
1171
|
+
return `${Math.floor(whole / 60)}:${String(whole % 60).padStart(2, "0")}`;
|
|
1172
|
+
}
|
|
1173
|
+
/** How long the voice note has recorded, as `0:05`. */
|
|
1174
|
+
function PromptInputRecorderTime(t0) {
|
|
1175
|
+
const $ = c(12);
|
|
1176
|
+
let className;
|
|
1177
|
+
let props;
|
|
1178
|
+
let seconds;
|
|
1179
|
+
if ($[0] !== t0) {
|
|
1180
|
+
({seconds, className, ...props} = t0);
|
|
1181
|
+
$[0] = t0;
|
|
1182
|
+
$[1] = className;
|
|
1183
|
+
$[2] = props;
|
|
1184
|
+
$[3] = seconds;
|
|
1185
|
+
} else {
|
|
1186
|
+
className = $[1];
|
|
1187
|
+
props = $[2];
|
|
1188
|
+
seconds = $[3];
|
|
1189
|
+
}
|
|
1190
|
+
let t1;
|
|
1191
|
+
if ($[4] !== className) {
|
|
1192
|
+
t1 = cn("shrink-0 text-sm text-muted-foreground tabular-nums", className);
|
|
1193
|
+
$[4] = className;
|
|
1194
|
+
$[5] = t1;
|
|
1195
|
+
} else t1 = $[5];
|
|
1196
|
+
let t2;
|
|
1197
|
+
if ($[6] !== seconds) {
|
|
1198
|
+
t2 = formatDuration(seconds);
|
|
1199
|
+
$[6] = seconds;
|
|
1200
|
+
$[7] = t2;
|
|
1201
|
+
} else t2 = $[7];
|
|
1202
|
+
let t3;
|
|
1203
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
1204
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
1205
|
+
"data-slot": "prompt-input-recorder-time",
|
|
1206
|
+
role: "timer",
|
|
1207
|
+
className: t1,
|
|
1208
|
+
...props,
|
|
1209
|
+
children: t2
|
|
1210
|
+
});
|
|
1211
|
+
$[8] = props;
|
|
1212
|
+
$[9] = t1;
|
|
1213
|
+
$[10] = t2;
|
|
1214
|
+
$[11] = t3;
|
|
1215
|
+
} else t3 = $[11];
|
|
1216
|
+
return t3;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Records a voice note from the microphone, with the levels and the time the
|
|
1220
|
+
* recorder's parts draw. Nothing is asked of the browser until `start()`,
|
|
1221
|
+
* and the microphone is released on `stop()`, `cancel()` or unmount.
|
|
1222
|
+
*/
|
|
1223
|
+
function usePromptInputRecorder(t0) {
|
|
1224
|
+
const $ = c(16);
|
|
1225
|
+
let t1;
|
|
1226
|
+
if ($[0] !== t0) {
|
|
1227
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
1228
|
+
$[0] = t0;
|
|
1229
|
+
$[1] = t1;
|
|
1230
|
+
} else t1 = $[1];
|
|
1231
|
+
const { bars: t2, interval: t3 } = t1;
|
|
1232
|
+
const bars = t2 === void 0 ? 64 : t2;
|
|
1233
|
+
const interval = t3 === void 0 ? 60 : t3;
|
|
1234
|
+
const [recording, setRecording] = useState(false);
|
|
1235
|
+
let t4;
|
|
1236
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1237
|
+
t4 = [];
|
|
1238
|
+
$[2] = t4;
|
|
1239
|
+
} else t4 = $[2];
|
|
1240
|
+
const [levels, setLevels] = useState(t4);
|
|
1241
|
+
const [seconds, setSeconds] = useState(0);
|
|
1242
|
+
const [error, setError] = useState(null);
|
|
1243
|
+
const session = useRef(null);
|
|
1244
|
+
let t5;
|
|
1245
|
+
let t6;
|
|
1246
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1247
|
+
t5 = () => () => void session.current?.end(false);
|
|
1248
|
+
t6 = [];
|
|
1249
|
+
$[3] = t5;
|
|
1250
|
+
$[4] = t6;
|
|
1251
|
+
} else {
|
|
1252
|
+
t5 = $[3];
|
|
1253
|
+
t6 = $[4];
|
|
1254
|
+
}
|
|
1255
|
+
useEffect(t5, t6);
|
|
1256
|
+
let t7;
|
|
1257
|
+
if ($[5] !== bars || $[6] !== interval) {
|
|
1258
|
+
t7 = async function start() {
|
|
1259
|
+
if (session.current) return;
|
|
1260
|
+
setError(null);
|
|
1261
|
+
setRecording(true);
|
|
1262
|
+
let cancelled = false;
|
|
1263
|
+
session.current = { end: async () => {
|
|
1264
|
+
cancelled = true;
|
|
1265
|
+
session.current = null;
|
|
1266
|
+
setRecording(false);
|
|
1267
|
+
return null;
|
|
1268
|
+
} };
|
|
1269
|
+
let stream;
|
|
1270
|
+
try {
|
|
1271
|
+
stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
1272
|
+
} catch (t8) {
|
|
1273
|
+
const reason = t8;
|
|
1274
|
+
session.current = null;
|
|
1275
|
+
setRecording(false);
|
|
1276
|
+
setError(reason instanceof Error ? reason : new Error(String(reason)));
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1279
|
+
if (cancelled) {
|
|
1280
|
+
for (const track of stream.getTracks()) track.stop();
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
const recorder = new MediaRecorder(stream);
|
|
1284
|
+
const chunks = [];
|
|
1285
|
+
recorder.addEventListener("dataavailable", (event) => {
|
|
1286
|
+
if (event.data.size > 0) chunks.push(event.data);
|
|
1287
|
+
});
|
|
1288
|
+
const audio = new AudioContext();
|
|
1289
|
+
const analyser = audio.createAnalyser();
|
|
1290
|
+
analyser.fftSize = 1024;
|
|
1291
|
+
audio.createMediaStreamSource(stream).connect(analyser);
|
|
1292
|
+
const samples = new Uint8Array(analyser.fftSize);
|
|
1293
|
+
const startedAt = performance.now();
|
|
1294
|
+
let last = 0;
|
|
1295
|
+
let frame = 0;
|
|
1296
|
+
const sample = (now) => {
|
|
1297
|
+
if (now - last >= interval) {
|
|
1298
|
+
last = now;
|
|
1299
|
+
analyser.getByteTimeDomainData(samples);
|
|
1300
|
+
let sum = 0;
|
|
1301
|
+
for (const value of samples) {
|
|
1302
|
+
const centered = (value - 128) / 128;
|
|
1303
|
+
sum = sum + centered * centered;
|
|
1304
|
+
}
|
|
1305
|
+
const level = Math.min(1, Math.sqrt(sum / samples.length) * 5);
|
|
1306
|
+
setLevels((current) => [...current, level].slice(-bars));
|
|
1307
|
+
setSeconds((now - startedAt) / 1e3);
|
|
1308
|
+
}
|
|
1309
|
+
frame = requestAnimationFrame(sample);
|
|
1310
|
+
};
|
|
1311
|
+
frame = requestAnimationFrame(sample);
|
|
1312
|
+
recorder.start();
|
|
1313
|
+
session.current = { end: (keep) => {
|
|
1314
|
+
session.current = null;
|
|
1315
|
+
cancelAnimationFrame(frame);
|
|
1316
|
+
setRecording(false);
|
|
1317
|
+
setLevels([]);
|
|
1318
|
+
setSeconds(0);
|
|
1319
|
+
return new Promise((resolve) => {
|
|
1320
|
+
recorder.addEventListener("stop", () => {
|
|
1321
|
+
for (const track_0 of stream.getTracks()) track_0.stop();
|
|
1322
|
+
audio.close();
|
|
1323
|
+
const type = recorder.mimeType || "audio/webm";
|
|
1324
|
+
const extension = type.includes("mp4") ? "m4a" : type.includes("ogg") ? "ogg" : "webm";
|
|
1325
|
+
resolve(keep && chunks.length > 0 ? new File(chunks, stampedName("Voice note", extension), { type }) : null);
|
|
1326
|
+
}, { once: true });
|
|
1327
|
+
recorder.stop();
|
|
1328
|
+
});
|
|
1329
|
+
} };
|
|
1330
|
+
};
|
|
1331
|
+
$[5] = bars;
|
|
1332
|
+
$[6] = interval;
|
|
1333
|
+
$[7] = t7;
|
|
1334
|
+
} else t7 = $[7];
|
|
1335
|
+
const start = t7;
|
|
1336
|
+
let t8;
|
|
1337
|
+
let t9;
|
|
1338
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1339
|
+
t8 = () => session.current?.end(true) ?? Promise.resolve(null);
|
|
1340
|
+
t9 = () => void session.current?.end(false);
|
|
1341
|
+
$[8] = t8;
|
|
1342
|
+
$[9] = t9;
|
|
1343
|
+
} else {
|
|
1344
|
+
t8 = $[8];
|
|
1345
|
+
t9 = $[9];
|
|
1346
|
+
}
|
|
1347
|
+
let t10;
|
|
1348
|
+
if ($[10] !== error || $[11] !== levels || $[12] !== recording || $[13] !== seconds || $[14] !== start) {
|
|
1349
|
+
t10 = {
|
|
1350
|
+
recording,
|
|
1351
|
+
levels,
|
|
1352
|
+
seconds,
|
|
1353
|
+
error,
|
|
1354
|
+
start,
|
|
1355
|
+
stop: t8,
|
|
1356
|
+
cancel: t9
|
|
1357
|
+
};
|
|
1358
|
+
$[10] = error;
|
|
1359
|
+
$[11] = levels;
|
|
1360
|
+
$[12] = recording;
|
|
1361
|
+
$[13] = seconds;
|
|
1362
|
+
$[14] = start;
|
|
1363
|
+
$[15] = t10;
|
|
1364
|
+
} else t10 = $[15];
|
|
1365
|
+
return t10;
|
|
1366
|
+
}
|
|
1367
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputButton, PromptInputFooter, PromptInputHeader, PromptInputRecorder, PromptInputRecorderCancel, PromptInputRecorderConfirm, PromptInputRecorderTime, PromptInputSpeechButton, PromptInputSubmit, PromptInputTextarea, PromptInputToggle, PromptInputTools, PromptInputWaveform, usePromptInput, usePromptInputRecorder };
|