@devalok/shilp-sutra 0.34.1 → 0.36.1
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/LICENSE +21 -21
- package/dist/_chunks/badge-group.js +95 -95
- package/dist/_chunks/badge-group.js.map +1 -0
- package/dist/_chunks/chat.js +7 -2
- package/dist/_chunks/chat.js.map +1 -0
- package/dist/_chunks/date-picker.js.map +1 -0
- package/dist/_chunks/document-preview.js.map +1 -0
- package/dist/_chunks/file-preview.js.map +1 -0
- package/dist/_chunks/framer.js +62 -62
- package/dist/_chunks/framer.js.map +1 -0
- package/dist/_chunks/image-preview.js +1 -1
- package/dist/_chunks/image-preview.js.map +1 -0
- package/dist/_chunks/keybinding.js.map +1 -0
- package/dist/_chunks/link-context.js.map +1 -0
- package/dist/_chunks/mention-suggestion.js.map +1 -0
- package/dist/_chunks/motion-provider.js.map +1 -0
- package/dist/_chunks/popover.js +32 -36
- package/dist/_chunks/popover.js.map +1 -0
- package/dist/_chunks/primitives.js +686 -686
- package/dist/_chunks/primitives.js.map +1 -0
- package/dist/_chunks/rich-chat-input.js +651 -650
- package/dist/_chunks/rich-chat-input.js.map +1 -0
- package/dist/_chunks/shared.js.map +1 -0
- package/dist/_chunks/sonner.js.map +1 -0
- package/dist/_chunks/stat-row.js +158 -158
- package/dist/_chunks/stat-row.js.map +1 -0
- package/dist/_chunks/tiptap.js +11 -11
- package/dist/_chunks/tiptap.js.map +1 -0
- package/dist/_chunks/tree-view.js +1 -1
- package/dist/_chunks/tree-view.js.map +1 -0
- package/dist/_chunks/use-calendar.js.map +1 -0
- package/dist/_chunks/vendor-client.js +1 -1
- package/dist/_chunks/vendor-client.js.map +1 -0
- package/dist/_chunks/vendor-utils.js.map +1 -0
- package/dist/ai/ai-command-provider.js.map +1 -0
- package/dist/ai/block-renderer.js.map +1 -0
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/command-bar.js.map +1 -0
- package/dist/ai/conversation.js +76 -76
- package/dist/ai/conversation.js.map +1 -0
- package/dist/ai/devadoot-icon.d.ts.map +1 -1
- package/dist/ai/index.js.map +1 -0
- package/dist/composed/activity-feed.js.map +1 -0
- package/dist/composed/avatar-group.js +1 -1
- package/dist/composed/avatar-group.js.map +1 -0
- package/dist/composed/bulk-action-bar.js +13 -21
- package/dist/composed/bulk-action-bar.js.map +1 -0
- package/dist/composed/command-palette.js.map +1 -0
- package/dist/composed/confirm-dialog.js.map +1 -0
- package/dist/composed/content-card.js.map +1 -0
- package/dist/composed/deadline-indicator.js.map +1 -0
- package/dist/composed/emoji-picker.js.map +1 -0
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +30 -30
- package/dist/composed/empty-state.js.map +1 -0
- package/dist/composed/error-boundary.js.map +1 -0
- package/dist/composed/filter-bar.js.map +1 -0
- package/dist/composed/form-section.js.map +1 -0
- package/dist/composed/global-loading.js.map +1 -0
- package/dist/composed/inline-edit.js.map +1 -0
- package/dist/composed/lib/string-utils.js.map +1 -0
- package/dist/composed/loading-skeleton.js.map +1 -0
- package/dist/composed/markdown-viewer.js.map +1 -0
- package/dist/composed/master-detail.js.map +1 -0
- package/dist/composed/member-picker.js.map +1 -0
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +4 -0
- package/dist/composed/multi-select-popover.js.map +1 -0
- package/dist/composed/page-header.js.map +1 -0
- package/dist/composed/page-skeletons.js.map +1 -0
- package/dist/composed/priority-indicator.js.map +1 -0
- package/dist/composed/responsive-overlay.js.map +1 -0
- package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
- package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +1 -1
- package/dist/composed/rich-text-editor.js.map +1 -0
- package/dist/composed/schedule-view.js.map +1 -0
- package/dist/composed/simple-tooltip.js.map +1 -0
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js.map +1 -0
- package/dist/hooks/use-color-mode.js.map +1 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-touch-device.js.map +1 -0
- package/dist/hooks/use-viewport-height.js.map +1 -0
- package/dist/motion/check-motion-provider.d.ts +3 -0
- package/dist/motion/check-motion-provider.d.ts.map +1 -0
- package/dist/motion/index.js +14 -0
- package/dist/motion/index.js.map +1 -0
- package/dist/motion/primitives-index.js.map +1 -0
- package/dist/primitives/react-accordion.d.ts +114 -114
- package/dist/primitives/react-alert-dialog.d.ts +51 -51
- package/dist/primitives/react-aspect-ratio.d.ts +11 -11
- package/dist/primitives/react-avatar.d.ts +24 -24
- package/dist/primitives/react-checkbox.d.ts +50 -50
- package/dist/primitives/react-collapsible.d.ts +33 -33
- package/dist/primitives/react-context-menu.d.ts +96 -96
- package/dist/primitives/react-dialog.d.ts +103 -103
- package/dist/primitives/react-dropdown-menu.d.ts +97 -97
- package/dist/primitives/react-hover-card.d.ts +79 -79
- package/dist/primitives/react-label.d.ts +10 -10
- package/dist/primitives/react-menu.d.ts +169 -169
- package/dist/primitives/react-menubar.d.ts +115 -115
- package/dist/primitives/react-navigation-menu.d.ts +126 -126
- package/dist/primitives/react-popover.d.ts +85 -85
- package/dist/primitives/react-progress.d.ts +19 -19
- package/dist/primitives/react-radio-group.d.ts +58 -58
- package/dist/primitives/react-roving-focus.d.ts +49 -49
- package/dist/primitives/react-select.d.ts +137 -137
- package/dist/primitives/react-separator.d.ts +21 -21
- package/dist/primitives/react-slider.d.ts +75 -75
- package/dist/primitives/react-switch.d.ts +21 -21
- package/dist/primitives/react-tabs.d.ts +56 -56
- package/dist/primitives/react-toast.d.ts +120 -120
- package/dist/primitives/react-toggle-group.d.ts +75 -75
- package/dist/primitives/react-toggle.d.ts +24 -24
- package/dist/primitives/react-tooltip.d.ts +101 -101
- package/dist/primitives/react-visually-hidden.d.ts +22 -22
- package/dist/shell/app-command-palette.d.ts +2 -0
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +42 -155
- package/dist/shell/app-command-palette.js.map +1 -0
- package/dist/shell/bottom-navbar.js +1 -1
- package/dist/shell/bottom-navbar.js.map +1 -0
- package/dist/shell/command-registry.js.map +1 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +194 -169
- package/dist/shell/notification-center.js.map +1 -0
- package/dist/shell/notification-preferences.js.map +1 -0
- package/dist/shell/sidebar.js.map +1 -0
- package/dist/shell/top-bar.js +1 -1
- package/dist/shell/top-bar.js.map +1 -0
- package/dist/tailwind/index.cjs +48 -1
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +48 -1
- package/dist/tailwind/preset.js.map +1 -0
- package/dist/tokens/index.css +4 -4
- package/dist/tokens/primitives.css +442 -442
- package/dist/tokens/semantic.css +742 -547
- package/dist/tokens/typography-semantic.css +123 -100
- package/dist/tokens/typography.css +422 -422
- package/dist/ui/accordion.js +13 -13
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +6 -2
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +43 -42
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +3 -2
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +31 -5
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +92 -67
- package/dist/ui/autocomplete.js.map +1 -0
- package/dist/ui/avatar.js +9 -9
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge-indicator.js.map +1 -0
- package/dist/ui/banner.js.map +1 -0
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button-group.js.map +1 -0
- package/dist/ui/button-processing.d.ts.map +1 -1
- package/dist/ui/button-processing.js +61 -40
- package/dist/ui/button-processing.js.map +1 -0
- package/dist/ui/button.js +8 -8
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/charts/bar-chart.d.ts.map +1 -1
- package/dist/ui/charts/chart-container.d.ts +2 -0
- package/dist/ui/charts/chart-container.d.ts.map +1 -1
- package/dist/ui/charts/index.js +88 -65
- package/dist/ui/charts/index.js.map +1 -0
- package/dist/ui/charts/line-chart.d.ts.map +1 -1
- package/dist/ui/chat/message-input.d.ts.map +1 -1
- package/dist/ui/chat/message-list.d.ts +1 -1
- package/dist/ui/chat/message-list.d.ts.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/chat/system-message.d.ts.map +1 -1
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +33 -28
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/code.js.map +1 -0
- package/dist/ui/collapsible.js +1 -1
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +165 -163
- package/dist/ui/color-input.js.map +1 -0
- package/dist/ui/color-swatch.js.map +1 -0
- package/dist/ui/combobox.d.ts +7 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +147 -113
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/container.js +1 -1
- package/dist/ui/container.js.map +1 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/data-table-body.js.map +1 -0
- package/dist/ui/data-table-bulk-actions.js +1 -1
- package/dist/ui/data-table-bulk-actions.js.map +1 -0
- package/dist/ui/data-table-card.js.map +1 -0
- package/dist/ui/data-table-context.js.map +1 -0
- package/dist/ui/data-table-header.js.map +1 -0
- package/dist/ui/data-table-pagination.js.map +1 -0
- package/dist/ui/data-table-toolbar.js.map +1 -0
- package/dist/ui/data-table.js +34 -31
- package/dist/ui/data-table.js.map +1 -0
- package/dist/ui/devalok-grain.js.map +1 -0
- package/dist/ui/dialog.js +31 -35
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/file-upload.js +120 -120
- package/dist/ui/file-upload.js.map +1 -0
- package/dist/ui/form.d.ts +8 -0
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +14 -12
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/icon-button.js.map +1 -0
- package/dist/ui/icon-context.js.map +1 -0
- package/dist/ui/icon-group.js.map +1 -0
- package/dist/ui/icon.js.map +1 -0
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +82 -66
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input-otp.d.ts +12 -3
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +41 -27
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +16 -15
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +19 -14
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/lib/check-tokens.d.ts +3 -0
- package/dist/ui/lib/check-tokens.d.ts.map +1 -0
- package/dist/ui/lib/date-utils.js.map +1 -0
- package/dist/ui/lib/motion.d.ts +15 -4
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +18 -9
- package/dist/ui/lib/motion.js.map +1 -0
- package/dist/ui/lib/utils.js.map +1 -0
- package/dist/ui/link.js +2 -2
- package/dist/ui/link.js.map +1 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/number-input.d.ts +16 -1
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +79 -49
- package/dist/ui/number-input.js.map +1 -0
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/progress-ring.d.ts.map +1 -1
- package/dist/ui/progress-ring.js.map +1 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +27 -20
- package/dist/ui/radio.js.map +1 -0
- package/dist/ui/search-input.js.map +1 -0
- package/dist/ui/segmented-control.d.ts +1 -1
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +3 -1
- package/dist/ui/segmented-control.js.map +1 -0
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +54 -48
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +10 -7
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.js +29 -29
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.js +9 -9
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +22 -3
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +57 -19
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +77 -76
- package/dist/ui/split-button.js.map +1 -0
- package/dist/ui/stack.js.map +1 -0
- package/dist/ui/stat-card.js.map +1 -0
- package/dist/ui/status-dot.js.map +1 -0
- package/dist/ui/stepper.d.ts +10 -0
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +80 -75
- package/dist/ui/stepper.js.map +1 -0
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +26 -22
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +3 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +68 -48
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/text.d.ts +1 -1
- package/dist/ui/text.d.ts.map +1 -1
- package/dist/ui/text.js +10 -2
- package/dist/ui/text.js.map +1 -0
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toast-registry.d.ts +8 -0
- package/dist/ui/toast-registry.d.ts.map +1 -0
- package/dist/ui/toast-registry.js +13 -0
- package/dist/ui/toast-registry.js.map +1 -0
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +141 -136
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts.map +1 -1
- package/dist/ui/toaster.js +15 -14
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +2 -0
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle-group.js +23 -16
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +2 -0
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +14 -6
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/visually-hidden.js.map +1 -0
- package/docs/components/_header.md +85 -85
- package/docs/components/composed/activity-feed.md +62 -62
- package/docs/components/composed/avatar-group.md +65 -65
- package/docs/components/composed/bulk-action-bar.md +40 -40
- package/docs/components/composed/command-palette.md +40 -40
- package/docs/components/composed/confirm-dialog.md +46 -46
- package/docs/components/composed/content-card.md +36 -36
- package/docs/components/composed/date-picker.md +130 -130
- package/docs/components/composed/deadline-indicator.md +27 -27
- package/docs/components/composed/emoji-picker.md +52 -52
- package/docs/components/composed/empty-state.md +53 -53
- package/docs/components/composed/error-boundary.md +29 -29
- package/docs/components/composed/file-preview.md +40 -40
- package/docs/components/composed/filter-bar.md +57 -57
- package/docs/components/composed/form-section.md +31 -31
- package/docs/components/composed/global-loading.md +27 -27
- package/docs/components/composed/inline-edit.md +35 -35
- package/docs/components/composed/loading-skeleton.md +51 -51
- package/docs/components/composed/markdown-viewer.md +27 -27
- package/docs/components/composed/master-detail.md +48 -48
- package/docs/components/composed/member-picker.md +35 -35
- package/docs/components/composed/multi-select-popover.md +62 -62
- package/docs/components/composed/page-header.md +41 -41
- package/docs/components/composed/page-skeletons.md +32 -32
- package/docs/components/composed/priority-indicator.md +32 -32
- package/docs/components/composed/responsive-overlay.md +34 -34
- package/docs/components/composed/rich-text-editor.md +82 -82
- package/docs/components/composed/schedule-view.md +39 -39
- package/docs/components/composed/simple-tooltip.md +33 -33
- package/docs/components/composed/status-badge.md +55 -55
- package/docs/components/shell/app-command-palette.md +44 -44
- package/docs/components/shell/bottom-navbar.md +52 -52
- package/docs/components/shell/command-registry.md +48 -48
- package/docs/components/shell/link-context.md +41 -41
- package/docs/components/shell/notification-center.md +63 -63
- package/docs/components/shell/notification-preferences.md +42 -42
- package/docs/components/shell/sidebar.md +92 -92
- package/docs/components/shell/top-bar.md +143 -143
- package/docs/components/ui/accordion.md +51 -51
- package/docs/components/ui/alert-dialog.md +61 -61
- package/docs/components/ui/alert.md +46 -46
- package/docs/components/ui/aspect-ratio.md +25 -25
- package/docs/components/ui/autocomplete.md +48 -48
- package/docs/components/ui/avatar.md +56 -56
- package/docs/components/ui/badge.md +83 -82
- package/docs/components/ui/banner.md +42 -42
- package/docs/components/ui/breadcrumb.md +37 -37
- package/docs/components/ui/button-group.md +41 -41
- package/docs/components/ui/button.md +94 -93
- package/docs/components/ui/card.md +52 -52
- package/docs/components/ui/charts.md +43 -43
- package/docs/components/ui/checkbox.md +36 -36
- package/docs/components/ui/chip.md +47 -47
- package/docs/components/ui/code.md +28 -28
- package/docs/components/ui/collapsible.md +40 -40
- package/docs/components/ui/color-input.md +91 -91
- package/docs/components/ui/color-swatch.md +25 -25
- package/docs/components/ui/combobox.md +54 -54
- package/docs/components/ui/container.md +26 -26
- package/docs/components/ui/context-menu.md +43 -43
- package/docs/components/ui/data-table-body.md +1 -1
- package/docs/components/ui/data-table-bulk-actions.md +1 -1
- package/docs/components/ui/data-table-card.md +1 -1
- package/docs/components/ui/data-table-context.md +1 -1
- package/docs/components/ui/data-table-header.md +1 -1
- package/docs/components/ui/data-table-pagination.md +1 -1
- package/docs/components/ui/data-table-toolbar.md +44 -44
- package/docs/components/ui/data-table.md +94 -94
- package/docs/components/ui/dialog.md +54 -54
- package/docs/components/ui/dropdown-menu.md +48 -48
- package/docs/components/ui/file-upload.md +41 -41
- package/docs/components/ui/form.md +51 -51
- package/docs/components/ui/hover-card.md +32 -32
- package/docs/components/ui/icon-button.md +40 -40
- package/docs/components/ui/input-otp.md +44 -44
- package/docs/components/ui/input.md +74 -74
- package/docs/components/ui/label.md +25 -25
- package/docs/components/ui/link.md +29 -29
- package/docs/components/ui/menubar.md +44 -44
- package/docs/components/ui/navigation-menu.md +46 -46
- package/docs/components/ui/number-input.md +44 -44
- package/docs/components/ui/pagination.md +48 -48
- package/docs/components/ui/popover.md +30 -30
- package/docs/components/ui/progress-ring.md +41 -41
- package/docs/components/ui/progress.md +34 -34
- package/docs/components/ui/radio.md +34 -34
- package/docs/components/ui/search-input.md +43 -43
- package/docs/components/ui/segmented-control.md +50 -50
- package/docs/components/ui/select.md +53 -53
- package/docs/components/ui/separator.md +32 -32
- package/docs/components/ui/sheet.md +47 -47
- package/docs/components/ui/sidebar.md +72 -72
- package/docs/components/ui/skeleton.md +77 -77
- package/docs/components/ui/slider.md +29 -29
- package/docs/components/ui/spinner.md +54 -54
- package/docs/components/ui/stack.md +39 -39
- package/docs/components/ui/stat-card.md +61 -61
- package/docs/components/ui/status-dot.md +26 -26
- package/docs/components/ui/stepper.md +49 -49
- package/docs/components/ui/switch.md +47 -47
- package/docs/components/ui/table.md +47 -47
- package/docs/components/ui/tabs.md +60 -60
- package/docs/components/ui/text.md +37 -37
- package/docs/components/ui/textarea.md +39 -39
- package/docs/components/ui/toast.md +65 -65
- package/docs/components/ui/toaster.md +47 -47
- package/docs/components/ui/toggle-group.md +43 -43
- package/docs/components/ui/toggle.md +37 -37
- package/docs/components/ui/tooltip.md +38 -38
- package/docs/components/ui/tree-view.md +65 -65
- package/docs/components/ui/visually-hidden.md +21 -21
- package/llms-full.txt +5266 -5264
- package/llms.txt +624 -580
- package/package.json +7 -8
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { ln as e, mn as t, pn as n, un as r } from "./primitives.js";
|
|
3
3
|
import { a as i, c as a, n as o } from "./framer.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { durations as s } from "../ui/lib/motion.js";
|
|
5
|
+
import { cn as c } from "../ui/lib/utils.js";
|
|
6
|
+
import { Spinner as l } from "../ui/spinner.js";
|
|
7
|
+
import { Icon as u } from "../ui/icon.js";
|
|
8
8
|
import { useIsMobile as d } from "../hooks/use-mobile.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
9
|
+
import { Button as f } from "../ui/button.js";
|
|
10
|
+
import { Dialog as p, DialogContent as m, DialogFooter as h, DialogHeader as g, DialogTitle as _ } from "../ui/dialog.js";
|
|
11
|
+
import { SplitButton as v } from "../ui/split-button.js";
|
|
12
|
+
import { emojiDataLoaders as y } from "../composed/emoji-picker.js";
|
|
13
|
+
import { c as b, d as x, g as ee, h as S, i as C, l as te, m as ne, n as re, o as ie, r as w, s as ae, t as T, y as oe } from "./tiptap.js";
|
|
14
|
+
import { a as se, i as ce, n as le, o as ue, r as de, t as fe } from "./mention-suggestion.js";
|
|
15
|
+
import { useColorMode as pe } from "../hooks/use-color-mode.js";
|
|
16
|
+
import { n as me, t as E } from "./use-calendar.js";
|
|
17
|
+
import * as D from "react";
|
|
18
|
+
import { useCallback as O, useEffect as he, useRef as k, useState as A } from "react";
|
|
19
|
+
import { Fragment as ge, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
20
|
+
import * as _e from "react-dom";
|
|
21
|
+
import { IconAt as ve, IconBlockquote as N, IconBold as ye, IconCalendarEvent as be, IconChevronDown as xe, IconClock as Se, IconCode as Ce, IconFile as we, IconHighlight as Te, IconItalic as P, IconLink as Ee, IconList as F, IconListNumbers as De, IconMicrophone as Oe, IconMoodSmile as ke, IconPencil as Ae, IconPlayerPause as je, IconPlayerPlay as I, IconPlus as Me, IconSend as Ne, IconSlash as L, IconSquare as Pe, IconStrikethrough as R, IconTextSize as Fe, IconTrash as Ie, IconUnderline as Le, IconX as z } from "@tabler/icons-react";
|
|
22
|
+
import { createRoot as Re } from "react-dom/client";
|
|
22
23
|
//#region src/composed/extensions/slash-command.tsx
|
|
23
|
-
var
|
|
24
|
-
let [i, a] =
|
|
24
|
+
var B = D.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
25
|
+
let [i, a] = D.useState(0), o = D.useMemo(() => {
|
|
25
26
|
let n = t.toLowerCase(), r = [];
|
|
26
27
|
return e.forEach((e, t) => {
|
|
27
28
|
e.commands.forEach((e) => {
|
|
@@ -32,48 +33,48 @@ var V = O.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
|
32
33
|
});
|
|
33
34
|
}), r;
|
|
34
35
|
}, [e, t]);
|
|
35
|
-
if (
|
|
36
|
-
let
|
|
36
|
+
if (D.useEffect(() => a(0), [o]), D.useImperativeHandle(r, () => ({ onKeyDown: ({ event: e }) => e.key === "ArrowUp" ? (a((e) => (e + o.length - 1) % o.length), !0) : e.key === "ArrowDown" ? (a((e) => (e + 1) % o.length), !0) : e.key === "Enter" ? (o[i] && n(o[i].command), !0) : !1 })), !o.length) return null;
|
|
37
|
+
let s = [], l = 0;
|
|
37
38
|
for (let t of o) {
|
|
38
|
-
let n = e[t.groupIndex].label, r =
|
|
39
|
+
let n = e[t.groupIndex].label, r = s[s.length - 1];
|
|
39
40
|
(!r || r.label !== n) && (r = {
|
|
40
41
|
label: n,
|
|
41
42
|
items: []
|
|
42
|
-
},
|
|
43
|
+
}, s.push(r)), r.items.push({
|
|
43
44
|
command: t.command,
|
|
44
45
|
flatIndex: l
|
|
45
46
|
}), l++;
|
|
46
47
|
}
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ j("div", {
|
|
48
49
|
role: "listbox",
|
|
49
50
|
"aria-label": "Slash commands",
|
|
50
51
|
className: "z-popover max-h-[320px] min-w-[220px] overflow-x-hidden overflow-y-auto rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
|
|
51
|
-
children:
|
|
52
|
+
children: s.map((e, t) => /* @__PURE__ */ M("div", {
|
|
52
53
|
role: "group",
|
|
53
54
|
"aria-label": e.label,
|
|
54
55
|
children: [
|
|
55
|
-
t > 0 && /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
t > 0 && /* @__PURE__ */ j("div", { className: "my-ds-01 border-t border-surface-border" }),
|
|
57
|
+
/* @__PURE__ */ j("div", {
|
|
57
58
|
className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
|
|
58
59
|
children: e.label
|
|
59
60
|
}),
|
|
60
61
|
e.items.map(({ command: e, flatIndex: t }) => {
|
|
61
62
|
let r = e.icon;
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ M("button", {
|
|
63
64
|
type: "button",
|
|
64
65
|
role: "option",
|
|
65
66
|
"aria-selected": t === i,
|
|
66
67
|
onClick: () => n(e),
|
|
67
|
-
className:
|
|
68
|
-
children: [r && /* @__PURE__ */
|
|
68
|
+
className: c("flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-left cursor-pointer", t === i ? "bg-surface-raised-hover" : "hover:bg-surface-raised-hover"),
|
|
69
|
+
children: [r && /* @__PURE__ */ j("span", {
|
|
69
70
|
className: "flex h-4 w-4 shrink-0 items-center justify-center text-surface-fg-muted",
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
}), /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ j(r, { className: "h-4 w-4" })
|
|
72
|
+
}), /* @__PURE__ */ M("div", {
|
|
72
73
|
className: "flex flex-col",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ j("span", {
|
|
74
75
|
className: "text-ds-sm text-surface-fg",
|
|
75
76
|
children: e.label
|
|
76
|
-
}), e.description && /* @__PURE__ */
|
|
77
|
+
}), e.description && /* @__PURE__ */ j("span", {
|
|
77
78
|
className: "text-ds-xs text-surface-fg-subtle",
|
|
78
79
|
children: e.description
|
|
79
80
|
})]
|
|
@@ -84,15 +85,15 @@ var V = O.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
|
84
85
|
}, e.label))
|
|
85
86
|
});
|
|
86
87
|
});
|
|
87
|
-
|
|
88
|
-
function
|
|
88
|
+
B.displayName = "SlashCommandList";
|
|
89
|
+
function ze(e) {
|
|
89
90
|
return () => {
|
|
90
91
|
let t = null, n = null, r = null;
|
|
91
92
|
return {
|
|
92
93
|
onStart: (i) => {
|
|
93
94
|
n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
|
|
94
95
|
let a = i.clientRect?.();
|
|
95
|
-
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t =
|
|
96
|
+
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t = Re(n), t.render(/* @__PURE__ */ j(B, {
|
|
96
97
|
ref: (e) => {
|
|
97
98
|
r = e;
|
|
98
99
|
},
|
|
@@ -104,7 +105,7 @@ function Le(e) {
|
|
|
104
105
|
onUpdate: (i) => {
|
|
105
106
|
if (!t || !n) return;
|
|
106
107
|
let a = i.clientRect?.();
|
|
107
|
-
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */
|
|
108
|
+
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ j(B, {
|
|
108
109
|
ref: (e) => {
|
|
109
110
|
r = e;
|
|
110
111
|
},
|
|
@@ -120,13 +121,13 @@ function Le(e) {
|
|
|
120
121
|
};
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function Be(e) {
|
|
124
125
|
let t = e.flatMap((e) => e.commands);
|
|
125
|
-
return
|
|
126
|
+
return ee.create({
|
|
126
127
|
name: "slashCommand",
|
|
127
128
|
addProseMirrorPlugins() {
|
|
128
|
-
return [
|
|
129
|
-
pluginKey: new
|
|
129
|
+
return [w({
|
|
130
|
+
pluginKey: new oe("slashCommand"),
|
|
130
131
|
editor: this.editor,
|
|
131
132
|
char: "/",
|
|
132
133
|
startOfLine: !0,
|
|
@@ -139,15 +140,15 @@ function Re(e) {
|
|
|
139
140
|
command: ({ editor: e, range: t, props: n }) => {
|
|
140
141
|
e.chain().focus().deleteRange(t).run(), n.action(e);
|
|
141
142
|
},
|
|
142
|
-
render:
|
|
143
|
+
render: ze(e)
|
|
143
144
|
})];
|
|
144
145
|
}
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
//#endregion
|
|
148
149
|
//#region src/composed/rich-chat-input/reply-banner.tsx
|
|
149
|
-
function
|
|
150
|
-
return /* @__PURE__ */
|
|
150
|
+
function Ve({ author: e, preview: t, onDismiss: n }) {
|
|
151
|
+
return /* @__PURE__ */ j(i.div, {
|
|
151
152
|
initial: {
|
|
152
153
|
height: 0,
|
|
153
154
|
opacity: 0
|
|
@@ -161,7 +162,7 @@ function ze({ author: e, preview: t, onDismiss: n }) {
|
|
|
161
162
|
opacity: 0
|
|
162
163
|
},
|
|
163
164
|
transition: {
|
|
164
|
-
duration: .
|
|
165
|
+
duration: s.moderate02,
|
|
165
166
|
ease: [
|
|
166
167
|
.2,
|
|
167
168
|
0,
|
|
@@ -170,34 +171,34 @@ function ze({ author: e, preview: t, onDismiss: n }) {
|
|
|
170
171
|
]
|
|
171
172
|
},
|
|
172
173
|
className: "overflow-hidden",
|
|
173
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ M("div", {
|
|
174
175
|
role: "status",
|
|
175
176
|
"aria-label": `Replying to ${e}`,
|
|
176
177
|
className: "flex items-center gap-ds-03 border-b border-surface-border px-ds-04 py-ds-02b",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ M("div", {
|
|
178
179
|
className: "flex-1 min-w-0",
|
|
179
180
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ M("span", {
|
|
181
182
|
className: "text-ds-sm font-semibold text-surface-fg",
|
|
182
183
|
children: ["Replying to ", e]
|
|
183
184
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ j("span", {
|
|
185
186
|
className: "mx-ds-02 text-surface-fg-subtle",
|
|
186
187
|
children: "·"
|
|
187
188
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ j("span", {
|
|
189
190
|
className: "text-ds-sm text-surface-fg-muted truncate",
|
|
190
191
|
children: t
|
|
191
192
|
})
|
|
192
193
|
]
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ j("button", {
|
|
194
195
|
type: "button",
|
|
195
196
|
onClick: n,
|
|
196
|
-
className:
|
|
197
|
+
className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", "transition-colors duration-fast-01 ease-productive-standard", "active:scale-95"),
|
|
197
198
|
"aria-label": "Cancel reply",
|
|
198
199
|
title: "Cancel reply",
|
|
199
|
-
children: /* @__PURE__ */
|
|
200
|
-
icon:
|
|
200
|
+
children: /* @__PURE__ */ j(u, {
|
|
201
|
+
icon: z,
|
|
201
202
|
size: "xs"
|
|
202
203
|
})
|
|
203
204
|
})]
|
|
@@ -206,7 +207,7 @@ function ze({ author: e, preview: t, onDismiss: n }) {
|
|
|
206
207
|
}
|
|
207
208
|
//#endregion
|
|
208
209
|
//#region src/composed/rich-chat-input/schedule-send.tsx
|
|
209
|
-
function
|
|
210
|
+
function He() {
|
|
210
211
|
let e = /* @__PURE__ */ new Date(), t = e.getHours(), n = [], r = (t, n = 0) => {
|
|
211
212
|
let r = new Date(e);
|
|
212
213
|
return r.setDate(r.getDate() + n), r.setHours(t, 0, 0, 0), r;
|
|
@@ -254,62 +255,62 @@ function Be() {
|
|
|
254
255
|
date: a
|
|
255
256
|
}), n;
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
+
function Ue({ value: e, onChange: t }) {
|
|
258
259
|
let n = e.getHours() % 12 || 12, r = e.getMinutes(), i = e.getHours() >= 12, a = (n) => {
|
|
259
260
|
let r = new Date(e);
|
|
260
261
|
r.setHours(i ? n % 12 + 12 : n % 12), t(r);
|
|
261
262
|
}, o = (n) => {
|
|
262
263
|
let r = new Date(e);
|
|
263
264
|
r.setMinutes(n), t(r);
|
|
264
|
-
},
|
|
265
|
+
}, s = (n) => {
|
|
265
266
|
let r = new Date(e), i = r.getHours();
|
|
266
267
|
n && i < 12 ? r.setHours(i + 12) : !n && i >= 12 && r.setHours(i - 12), t(r);
|
|
267
268
|
};
|
|
268
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ M("div", {
|
|
269
270
|
className: "flex items-center gap-ds-02",
|
|
270
271
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ j("select", {
|
|
272
273
|
value: n,
|
|
273
274
|
onChange: (e) => a(Number(e.target.value)),
|
|
274
275
|
className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
|
|
275
276
|
"aria-label": "Hour",
|
|
276
|
-
children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */
|
|
277
|
+
children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ j("option", {
|
|
277
278
|
value: e,
|
|
278
279
|
children: e
|
|
279
280
|
}, e))
|
|
280
281
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ j("span", {
|
|
282
283
|
className: "text-ds-sm text-surface-fg-subtle font-medium",
|
|
283
284
|
children: ":"
|
|
284
285
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ j("select", {
|
|
286
287
|
value: r - r % 5,
|
|
287
288
|
onChange: (e) => o(Number(e.target.value)),
|
|
288
289
|
className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
|
|
289
290
|
"aria-label": "Minute",
|
|
290
|
-
children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */
|
|
291
|
+
children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */ j("option", {
|
|
291
292
|
value: e,
|
|
292
293
|
children: String(e).padStart(2, "0")
|
|
293
294
|
}, e))
|
|
294
295
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ M("div", {
|
|
296
297
|
className: "inline-flex rounded-ds-md border border-surface-border-strong overflow-hidden",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ j("button", {
|
|
298
299
|
type: "button",
|
|
299
|
-
onClick: () =>
|
|
300
|
-
className:
|
|
300
|
+
onClick: () => s(!1),
|
|
301
|
+
className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover" : "bg-accent-9 text-white"),
|
|
301
302
|
children: "AM"
|
|
302
|
-
}), /* @__PURE__ */
|
|
303
|
+
}), /* @__PURE__ */ j("button", {
|
|
303
304
|
type: "button",
|
|
304
|
-
onClick: () =>
|
|
305
|
-
className:
|
|
305
|
+
onClick: () => s(!0),
|
|
306
|
+
className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-accent-9 text-white" : "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover"),
|
|
306
307
|
children: "PM"
|
|
307
308
|
})]
|
|
308
309
|
})
|
|
309
310
|
]
|
|
310
311
|
});
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
+
function We({ value: e, onChange: t, minDate: n }) {
|
|
313
314
|
let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
|
|
314
315
|
let e = new Date(r);
|
|
315
316
|
return e.setHours(e.getHours() + 1, 0, 0, 0), e;
|
|
@@ -319,40 +320,40 @@ function He({ value: e, onChange: t, minDate: n }) {
|
|
|
319
320
|
let r = new Date(i);
|
|
320
321
|
r.setFullYear(Number(n[0]), Number(n[1]) - 1, Number(n[2])), t(r);
|
|
321
322
|
}, s = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : void 0;
|
|
322
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ M("div", {
|
|
323
324
|
className: "space-y-ds-03",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ M("div", {
|
|
325
326
|
className: "flex items-center justify-between",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
327
|
+
children: [/* @__PURE__ */ j("span", {
|
|
327
328
|
className: "text-ds-xs font-medium text-surface-fg-subtle",
|
|
328
329
|
children: "Date"
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
+
}), /* @__PURE__ */ j("input", {
|
|
330
331
|
type: "date",
|
|
331
332
|
value: a,
|
|
332
333
|
min: s,
|
|
333
334
|
onChange: o,
|
|
334
335
|
className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-03 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9"
|
|
335
336
|
})]
|
|
336
|
-
}), /* @__PURE__ */
|
|
337
|
+
}), /* @__PURE__ */ M("div", {
|
|
337
338
|
className: "flex items-center justify-between",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ j("span", {
|
|
339
340
|
className: "text-ds-xs font-medium text-surface-fg-subtle",
|
|
340
341
|
children: "Time"
|
|
341
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ j(Ue, {
|
|
342
343
|
value: i,
|
|
343
344
|
onChange: t
|
|
344
345
|
})]
|
|
345
346
|
})]
|
|
346
347
|
});
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
+
function Ge({ value: e, onChange: t, minDate: n }) {
|
|
349
350
|
let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
|
|
350
351
|
let e = new Date(r);
|
|
351
352
|
return e.setHours(e.getHours() + 1, 0, 0, 0), e;
|
|
352
|
-
})(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } =
|
|
353
|
-
return /* @__PURE__ */
|
|
353
|
+
})(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } = E(i);
|
|
354
|
+
return /* @__PURE__ */ M("div", {
|
|
354
355
|
className: "space-y-ds-03",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ j(me, {
|
|
356
357
|
currentMonth: a,
|
|
357
358
|
selected: i,
|
|
358
359
|
onSelect: (e) => {
|
|
@@ -364,50 +365,50 @@ function Ue({ value: e, onChange: t, minDate: n }) {
|
|
|
364
365
|
},
|
|
365
366
|
minDate: n,
|
|
366
367
|
className: "w-full"
|
|
367
|
-
}), /* @__PURE__ */
|
|
368
|
+
}), /* @__PURE__ */ M("div", {
|
|
368
369
|
className: "flex items-center justify-between border-t border-surface-border pt-ds-03",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ j("span", {
|
|
370
371
|
className: "text-ds-xs font-medium text-surface-fg-subtle",
|
|
371
372
|
children: "Time"
|
|
372
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ j(Ue, {
|
|
373
374
|
value: i,
|
|
374
375
|
onChange: t
|
|
375
376
|
})]
|
|
376
377
|
})]
|
|
377
378
|
});
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
-
let [r, i] =
|
|
380
|
+
function Ke({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
381
|
+
let [r, i] = D.useState(!1), [a, o] = D.useState(null), s = D.useMemo(() => He(), []), c = (n) => {
|
|
381
382
|
e(n), t();
|
|
382
383
|
};
|
|
383
|
-
return r ? /* @__PURE__ */
|
|
384
|
+
return r ? /* @__PURE__ */ M("div", {
|
|
384
385
|
className: "p-ds-04",
|
|
385
386
|
style: { minWidth: 270 },
|
|
386
387
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ M("div", {
|
|
388
389
|
className: "mb-ds-03 flex items-center justify-between",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ j("p", {
|
|
390
391
|
className: "text-ds-sm font-medium text-surface-fg",
|
|
391
392
|
children: "Pick date & time"
|
|
392
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ j("button", {
|
|
393
394
|
type: "button",
|
|
394
395
|
onClick: () => i(!1),
|
|
395
396
|
className: "inline-flex items-center justify-center rounded-ds-md p-ds-01 text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg transition-colors",
|
|
396
397
|
"aria-label": "Back to presets",
|
|
397
|
-
children: /* @__PURE__ */
|
|
398
|
-
icon:
|
|
398
|
+
children: /* @__PURE__ */ j(u, {
|
|
399
|
+
icon: z,
|
|
399
400
|
size: "sm"
|
|
400
401
|
})
|
|
401
402
|
})]
|
|
402
403
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ j(We, {
|
|
404
405
|
value: a,
|
|
405
406
|
onChange: o,
|
|
406
407
|
minDate: /* @__PURE__ */ new Date()
|
|
407
408
|
}),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ j("div", {
|
|
409
410
|
className: "mt-ds-03 flex justify-end",
|
|
410
|
-
children: /* @__PURE__ */
|
|
411
|
+
children: /* @__PURE__ */ j(f, {
|
|
411
412
|
variant: "solid",
|
|
412
413
|
size: "sm",
|
|
413
414
|
onClick: () => {
|
|
@@ -418,43 +419,43 @@ function We({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
418
419
|
})
|
|
419
420
|
})
|
|
420
421
|
]
|
|
421
|
-
}) : /* @__PURE__ */
|
|
422
|
+
}) : /* @__PURE__ */ M("div", {
|
|
422
423
|
className: "p-ds-02",
|
|
423
424
|
style: { minWidth: 260 },
|
|
424
425
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ j("p", {
|
|
426
427
|
className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
|
|
427
428
|
children: "Schedule send"
|
|
428
429
|
}),
|
|
429
|
-
s.map((e, t) => /* @__PURE__ */
|
|
430
|
+
s.map((e, t) => /* @__PURE__ */ M("button", {
|
|
430
431
|
type: "button",
|
|
431
432
|
onClick: () => c(e.date),
|
|
432
433
|
className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
434
|
-
icon:
|
|
434
|
+
children: [/* @__PURE__ */ j(u, {
|
|
435
|
+
icon: Se,
|
|
435
436
|
size: "sm",
|
|
436
437
|
className: "shrink-0 text-surface-fg-muted"
|
|
437
438
|
}), e.label]
|
|
438
439
|
}, t)),
|
|
439
|
-
/* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ j("div", { className: "mx-ds-02 my-ds-02 h-px bg-surface-border" }),
|
|
441
|
+
/* @__PURE__ */ M("button", {
|
|
441
442
|
type: "button",
|
|
442
443
|
onClick: () => i(!0),
|
|
443
444
|
className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
445
|
-
icon:
|
|
445
|
+
children: [/* @__PURE__ */ j(u, {
|
|
446
|
+
icon: be,
|
|
446
447
|
size: "sm",
|
|
447
448
|
className: "shrink-0 text-accent-11"
|
|
448
449
|
}), "Pick date & time..."]
|
|
449
450
|
}),
|
|
450
|
-
n && /* @__PURE__ */
|
|
451
|
+
n && /* @__PURE__ */ M("button", {
|
|
451
452
|
type: "button",
|
|
452
453
|
onClick: () => {
|
|
453
454
|
n(), t();
|
|
454
455
|
},
|
|
455
456
|
className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
457
|
-
icon:
|
|
457
|
+
children: [/* @__PURE__ */ j(u, {
|
|
458
|
+
icon: be,
|
|
458
459
|
size: "sm",
|
|
459
460
|
className: "shrink-0 text-surface-fg-muted"
|
|
460
461
|
}), "Open full picker..."]
|
|
@@ -462,29 +463,29 @@ function We({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
462
463
|
]
|
|
463
464
|
});
|
|
464
465
|
}
|
|
465
|
-
function
|
|
466
|
-
let [i, a] =
|
|
467
|
-
return
|
|
466
|
+
function qe({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
|
|
467
|
+
let [i, a] = D.useState(r ?? null);
|
|
468
|
+
return D.useEffect(() => {
|
|
468
469
|
e && a(r ?? null);
|
|
469
|
-
}, [e, r]), /* @__PURE__ */
|
|
470
|
+
}, [e, r]), /* @__PURE__ */ j(p, {
|
|
470
471
|
open: e,
|
|
471
472
|
onOpenChange: t,
|
|
472
|
-
children: /* @__PURE__ */
|
|
473
|
+
children: /* @__PURE__ */ M(m, {
|
|
473
474
|
className: "sm:max-w-[380px]",
|
|
474
475
|
children: [
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ j(g, { children: /* @__PURE__ */ j(_, { children: r ? "Reschedule message" : "Schedule send" }) }),
|
|
477
|
+
/* @__PURE__ */ j(Ge, {
|
|
477
478
|
value: i,
|
|
478
479
|
onChange: a,
|
|
479
480
|
minDate: /* @__PURE__ */ new Date()
|
|
480
481
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ M(h, {
|
|
482
483
|
className: "gap-ds-02",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ j(f, {
|
|
484
485
|
variant: "soft",
|
|
485
486
|
onClick: () => t(!1),
|
|
486
487
|
children: "Cancel"
|
|
487
|
-
}), /* @__PURE__ */
|
|
488
|
+
}), /* @__PURE__ */ j(f, {
|
|
488
489
|
variant: "solid",
|
|
489
490
|
onClick: () => {
|
|
490
491
|
i && i > /* @__PURE__ */ new Date() && (n(i), t(!1));
|
|
@@ -497,7 +498,7 @@ function Ge({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
|
|
|
497
498
|
})
|
|
498
499
|
});
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
+
function Je(e) {
|
|
501
502
|
let t = /* @__PURE__ */ new Date(), n = new Date(t);
|
|
502
503
|
n.setDate(n.getDate() + 1);
|
|
503
504
|
let r = e.toDateString() === t.toDateString(), i = e.toDateString() === n.toDateString(), a = e.toLocaleTimeString(void 0, {
|
|
@@ -510,8 +511,8 @@ function Ke(e) {
|
|
|
510
511
|
day: "numeric"
|
|
511
512
|
})} at ${a}`;
|
|
512
513
|
}
|
|
513
|
-
function
|
|
514
|
-
return /* @__PURE__ */
|
|
514
|
+
function Ye({ date: e, onClear: t, onEdit: n }) {
|
|
515
|
+
return /* @__PURE__ */ j(i.div, {
|
|
515
516
|
initial: {
|
|
516
517
|
height: 0,
|
|
517
518
|
opacity: 0
|
|
@@ -524,37 +525,37 @@ function qe({ date: e, onClear: t, onEdit: n }) {
|
|
|
524
525
|
height: 0,
|
|
525
526
|
opacity: 0
|
|
526
527
|
},
|
|
527
|
-
transition: { duration: .
|
|
528
|
+
transition: { duration: s.moderate01 },
|
|
528
529
|
className: "overflow-hidden",
|
|
529
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ M("div", {
|
|
530
531
|
className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b text-ds-xs text-accent-11 bg-accent-2 border-b border-accent-4",
|
|
531
532
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
icon:
|
|
533
|
+
/* @__PURE__ */ j(u, {
|
|
534
|
+
icon: Se,
|
|
534
535
|
size: "xs",
|
|
535
536
|
className: "shrink-0"
|
|
536
537
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ M("span", {
|
|
538
539
|
className: "flex-1 truncate",
|
|
539
|
-
children: ["Scheduled for ",
|
|
540
|
+
children: ["Scheduled for ", Je(e)]
|
|
540
541
|
}),
|
|
541
|
-
n && /* @__PURE__ */
|
|
542
|
+
n && /* @__PURE__ */ j("button", {
|
|
542
543
|
type: "button",
|
|
543
544
|
onClick: n,
|
|
544
545
|
className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
|
|
545
546
|
"aria-label": "Edit schedule",
|
|
546
|
-
children: /* @__PURE__ */
|
|
547
|
-
icon:
|
|
547
|
+
children: /* @__PURE__ */ j(u, {
|
|
548
|
+
icon: Ae,
|
|
548
549
|
size: "xs"
|
|
549
550
|
})
|
|
550
551
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ j("button", {
|
|
552
553
|
type: "button",
|
|
553
554
|
onClick: t,
|
|
554
555
|
className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
|
|
555
556
|
"aria-label": "Cancel schedule",
|
|
556
|
-
children: /* @__PURE__ */
|
|
557
|
-
icon:
|
|
557
|
+
children: /* @__PURE__ */ j(u, {
|
|
558
|
+
icon: z,
|
|
558
559
|
size: "xs"
|
|
559
560
|
})
|
|
560
561
|
})
|
|
@@ -564,11 +565,11 @@ function qe({ date: e, onClear: t, onEdit: n }) {
|
|
|
564
565
|
}
|
|
565
566
|
//#endregion
|
|
566
567
|
//#region src/composed/rich-chat-input/attachment-strip.tsx
|
|
567
|
-
function
|
|
568
|
+
function Xe(e) {
|
|
568
569
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
569
570
|
}
|
|
570
|
-
function
|
|
571
|
-
return /* @__PURE__ */
|
|
571
|
+
function Ze({ attachments: e, onRemoveAttachment: t }) {
|
|
572
|
+
return /* @__PURE__ */ j(i.div, {
|
|
572
573
|
initial: {
|
|
573
574
|
height: 0,
|
|
574
575
|
opacity: 0
|
|
@@ -582,7 +583,7 @@ function Ye({ attachments: e, onRemoveAttachment: t }) {
|
|
|
582
583
|
opacity: 0
|
|
583
584
|
},
|
|
584
585
|
transition: {
|
|
585
|
-
duration: .
|
|
586
|
+
duration: s.moderate02,
|
|
586
587
|
ease: [
|
|
587
588
|
.2,
|
|
588
589
|
0,
|
|
@@ -591,13 +592,13 @@ function Ye({ attachments: e, onRemoveAttachment: t }) {
|
|
|
591
592
|
]
|
|
592
593
|
},
|
|
593
594
|
className: "overflow-hidden",
|
|
594
|
-
children: /* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ j("div", {
|
|
595
596
|
role: "list",
|
|
596
597
|
"aria-label": "Attachments",
|
|
597
598
|
className: "flex gap-ds-02 overflow-x-auto px-ds-04 py-ds-02b border-b border-surface-border",
|
|
598
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ j(a, {
|
|
599
600
|
initial: !1,
|
|
600
|
-
children: e.map((e) => e.type === "image" ? /* @__PURE__ */
|
|
601
|
+
children: e.map((e) => e.type === "image" ? /* @__PURE__ */ M(i.div, {
|
|
601
602
|
role: "listitem",
|
|
602
603
|
"aria-label": `Image: ${e.name}`,
|
|
603
604
|
layout: !0,
|
|
@@ -624,33 +625,33 @@ function Ye({ attachments: e, onRemoveAttachment: t }) {
|
|
|
624
625
|
stiffness: 400,
|
|
625
626
|
damping: 30
|
|
626
627
|
},
|
|
627
|
-
opacity: { duration: .
|
|
628
|
+
opacity: { duration: s.fast02 }
|
|
628
629
|
},
|
|
629
630
|
className: "relative h-12 w-12 shrink-0 group",
|
|
630
631
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ j("img", {
|
|
632
633
|
src: e.url,
|
|
633
634
|
alt: e.name,
|
|
634
635
|
className: "h-full w-full rounded-ds-md object-cover"
|
|
635
636
|
}),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ j("button", {
|
|
637
638
|
onClick: () => t(e.id),
|
|
638
639
|
className: "absolute -top-1 -right-1 h-ico-sm w-ico-sm rounded-full bg-error-9 text-error-fg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
|
|
639
640
|
"aria-label": `Remove ${e.name}`,
|
|
640
641
|
title: "Remove",
|
|
641
|
-
children: /* @__PURE__ */
|
|
642
|
-
icon:
|
|
642
|
+
children: /* @__PURE__ */ j(u, {
|
|
643
|
+
icon: z,
|
|
643
644
|
size: "xs"
|
|
644
645
|
})
|
|
645
646
|
}),
|
|
646
|
-
e.uploading && /* @__PURE__ */
|
|
647
|
+
e.uploading && /* @__PURE__ */ j("div", {
|
|
647
648
|
className: "absolute inset-0 rounded-ds-md bg-surface-overlay/50 flex items-center justify-center",
|
|
648
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ j(l, { size: "sm" })
|
|
649
650
|
})
|
|
650
651
|
]
|
|
651
|
-
}, e.id) : /* @__PURE__ */
|
|
652
|
+
}, e.id) : /* @__PURE__ */ M(i.div, {
|
|
652
653
|
role: "listitem",
|
|
653
|
-
"aria-label": `File: ${e.name}, ${
|
|
654
|
+
"aria-label": `File: ${e.name}, ${Xe(e.size)}`,
|
|
654
655
|
layout: !0,
|
|
655
656
|
initial: {
|
|
656
657
|
scale: 0,
|
|
@@ -675,30 +676,30 @@ function Ye({ attachments: e, onRemoveAttachment: t }) {
|
|
|
675
676
|
stiffness: 400,
|
|
676
677
|
damping: 30
|
|
677
678
|
},
|
|
678
|
-
opacity: { duration: .
|
|
679
|
+
opacity: { duration: s.fast02 }
|
|
679
680
|
},
|
|
680
681
|
className: "flex items-center gap-ds-02 shrink-0 rounded-ds-md bg-surface-raised px-ds-03 py-ds-01 group",
|
|
681
682
|
children: [
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
icon:
|
|
683
|
+
/* @__PURE__ */ j(u, {
|
|
684
|
+
icon: we,
|
|
684
685
|
size: "xs",
|
|
685
686
|
className: "text-surface-fg-muted"
|
|
686
687
|
}),
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ j("span", {
|
|
688
689
|
className: "text-ds-xs text-surface-fg-muted truncate max-w-[120px]",
|
|
689
690
|
children: e.name
|
|
690
691
|
}),
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ j("span", {
|
|
692
693
|
className: "text-ds-xs text-surface-fg-subtle",
|
|
693
|
-
children:
|
|
694
|
+
children: Xe(e.size)
|
|
694
695
|
}),
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ j("button", {
|
|
696
697
|
onClick: () => t(e.id),
|
|
697
698
|
className: "text-surface-fg-subtle hover:text-error-11 opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
|
|
698
699
|
"aria-label": `Remove ${e.name}`,
|
|
699
700
|
title: "Remove",
|
|
700
|
-
children: /* @__PURE__ */
|
|
701
|
-
icon:
|
|
701
|
+
children: /* @__PURE__ */ j(u, {
|
|
702
|
+
icon: z,
|
|
702
703
|
size: "xs"
|
|
703
704
|
})
|
|
704
705
|
})
|
|
@@ -710,9 +711,9 @@ function Ye({ attachments: e, onRemoveAttachment: t }) {
|
|
|
710
711
|
}
|
|
711
712
|
//#endregion
|
|
712
713
|
//#region src/composed/rich-chat-input/audio-waveform.tsx
|
|
713
|
-
var
|
|
714
|
-
let [f, p] =
|
|
715
|
-
|
|
714
|
+
var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r = 0, barWidth: i = 3, barGap: a = 2, barCount: o = 40, height: s = 32, className: l, ...u }, d) {
|
|
715
|
+
let [f, p] = D.useState(() => Array(o).fill(.05)), m = D.useRef(0), h = D.useRef(f);
|
|
716
|
+
D.useEffect(() => {
|
|
716
717
|
if (e !== "live" || !t) return;
|
|
717
718
|
let n = new Uint8Array(t.frequencyBinCount), r = () => {
|
|
718
719
|
t.getByteFrequencyData(n);
|
|
@@ -730,7 +731,7 @@ var H = O.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
730
731
|
e,
|
|
731
732
|
t,
|
|
732
733
|
o
|
|
733
|
-
]),
|
|
734
|
+
]), D.useEffect(() => {
|
|
734
735
|
if (!(e !== "static" || !n)) if (n.length === o) p(n);
|
|
735
736
|
else {
|
|
736
737
|
let e = Array(o), t = n.length / o;
|
|
@@ -745,13 +746,13 @@ var H = O.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
745
746
|
n,
|
|
746
747
|
o
|
|
747
748
|
]);
|
|
748
|
-
let g = o * (i + a) - a, _ =
|
|
749
|
-
let
|
|
750
|
-
return /* @__PURE__ */
|
|
749
|
+
let g = o * (i + a) - a, _ = D.useMemo(() => f.map((t, n) => {
|
|
750
|
+
let c = Math.max(2, t * s), l = n * (i + a), u = (s - c) / 2, d = e === "static" && r > 0 && n / o <= r;
|
|
751
|
+
return /* @__PURE__ */ j("rect", {
|
|
751
752
|
x: l,
|
|
752
753
|
y: u,
|
|
753
754
|
width: i,
|
|
754
|
-
height:
|
|
755
|
+
height: c,
|
|
755
756
|
rx: i / 2,
|
|
756
757
|
fill: d ? "var(--color-accent-9)" : "var(--color-surface-border)"
|
|
757
758
|
}, n);
|
|
@@ -762,23 +763,23 @@ var H = O.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
762
763
|
i,
|
|
763
764
|
a,
|
|
764
765
|
o,
|
|
765
|
-
|
|
766
|
+
s
|
|
766
767
|
]);
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ j("svg", {
|
|
768
769
|
ref: d,
|
|
769
|
-
height:
|
|
770
|
-
viewBox: `0 0 ${g} ${
|
|
770
|
+
height: s,
|
|
771
|
+
viewBox: `0 0 ${g} ${s}`,
|
|
771
772
|
preserveAspectRatio: "none",
|
|
772
773
|
"aria-hidden": "true",
|
|
773
|
-
className:
|
|
774
|
+
className: c("shrink-0", l),
|
|
774
775
|
...u,
|
|
775
776
|
children: _
|
|
776
777
|
});
|
|
777
778
|
});
|
|
778
|
-
|
|
779
|
+
V.displayName = "AudioWaveform";
|
|
779
780
|
//#endregion
|
|
780
781
|
//#region src/composed/rich-chat-input/recording-overlay.tsx
|
|
781
|
-
function
|
|
782
|
+
function Qe(e) {
|
|
782
783
|
let t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
783
784
|
return {
|
|
784
785
|
minutes: String(t),
|
|
@@ -786,31 +787,31 @@ function Xe(e) {
|
|
|
786
787
|
secs: n.toString().padStart(2, "0")
|
|
787
788
|
};
|
|
788
789
|
}
|
|
789
|
-
function
|
|
790
|
+
function $e({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
790
791
|
let i = o();
|
|
791
|
-
|
|
792
|
+
D.useEffect(() => {
|
|
792
793
|
let e = (e) => {
|
|
793
794
|
e.key === "Escape" && r();
|
|
794
795
|
};
|
|
795
796
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
796
797
|
}, [r]);
|
|
797
|
-
let a = n != null && n > 0 && e >= n - 10,
|
|
798
|
-
return /* @__PURE__ */
|
|
798
|
+
let a = n != null && n > 0 && e >= n - 10, s = n != null && n > 0 && e >= n - 5, l = s ? "animate-[pulse_500ms_ease-in-out_infinite]" : "animate-[pulse_1s_ease-in-out_infinite]", u = Qe(e), d = s ? "text-error-11" : a ? "text-warning-11" : "text-surface-fg";
|
|
799
|
+
return /* @__PURE__ */ M("div", {
|
|
799
800
|
role: "status",
|
|
800
801
|
"aria-live": "polite",
|
|
801
802
|
"aria-label": "Recording voice message",
|
|
802
803
|
className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-raised-hover rounded-ds-lg z-10",
|
|
803
804
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
className:
|
|
805
|
+
/* @__PURE__ */ j("span", {
|
|
806
|
+
className: c("w-ds-02b h-ds-02b shrink-0 rounded-ds-full bg-error-9", i ? "opacity-100" : l),
|
|
806
807
|
"aria-hidden": "true"
|
|
807
808
|
}),
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
className:
|
|
809
|
+
/* @__PURE__ */ M("span", {
|
|
810
|
+
className: c("text-ds-sm font-mono tabular-nums whitespace-nowrap", d),
|
|
810
811
|
"aria-label": `${u.minutes} minutes ${u.secs} seconds`,
|
|
811
812
|
children: [
|
|
812
813
|
u.minutes,
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ j("span", {
|
|
814
815
|
className: i ? void 0 : "animate-[blink_1s_step-end_infinite]",
|
|
815
816
|
"aria-hidden": "true",
|
|
816
817
|
children: u.separator
|
|
@@ -818,9 +819,9 @@ function Ze({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
|
818
819
|
u.secs
|
|
819
820
|
]
|
|
820
821
|
}),
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ j("div", {
|
|
822
823
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
823
|
-
children: /* @__PURE__ */
|
|
824
|
+
children: /* @__PURE__ */ j(V, {
|
|
824
825
|
mode: "live",
|
|
825
826
|
analyserNode: t,
|
|
826
827
|
height: 24,
|
|
@@ -831,262 +832,262 @@ function Ze({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
|
831
832
|
]
|
|
832
833
|
});
|
|
833
834
|
}
|
|
834
|
-
|
|
835
|
+
$e.displayName = "RecordingOverlay";
|
|
835
836
|
//#endregion
|
|
836
837
|
//#region src/composed/rich-chat-input/chat-toolbar.tsx
|
|
837
|
-
var
|
|
838
|
-
function
|
|
839
|
-
let e =
|
|
838
|
+
var H = D.createContext(null);
|
|
839
|
+
function U() {
|
|
840
|
+
let e = D.useContext(H);
|
|
840
841
|
if (!e) throw Error("Toolbar primitives must be used inside <ChatToolbar>");
|
|
841
842
|
return e;
|
|
842
843
|
}
|
|
843
|
-
function
|
|
844
|
-
let { disabled: o } =
|
|
845
|
-
return /* @__PURE__ */
|
|
844
|
+
function W({ onClick: e, isActive: t, disabled: n, title: r, children: i, className: a }) {
|
|
845
|
+
let { disabled: o } = U();
|
|
846
|
+
return /* @__PURE__ */ j("button", {
|
|
846
847
|
type: "button",
|
|
847
848
|
onClick: e,
|
|
848
849
|
disabled: n ?? o,
|
|
849
850
|
title: r,
|
|
850
851
|
"aria-label": r,
|
|
851
852
|
"aria-pressed": t,
|
|
852
|
-
className:
|
|
853
|
+
className: c("inline-flex h-ds-xs-plus items-center justify-center rounded-ds-md touch-target", !a?.includes("w-") && "w-ds-xs-plus", "transition-[color,background-color,transform] duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover hover:text-surface-fg", "active:scale-95", "disabled:pointer-events-none disabled:opacity-action-disabled", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle", a),
|
|
853
854
|
children: i
|
|
854
855
|
});
|
|
855
856
|
}
|
|
856
|
-
function
|
|
857
|
-
return /* @__PURE__ */
|
|
857
|
+
function G() {
|
|
858
|
+
return /* @__PURE__ */ j("div", { className: "h-4 w-px bg-surface-border-subtle mx-ds-01" });
|
|
858
859
|
}
|
|
859
|
-
function
|
|
860
|
-
return /* @__PURE__ */
|
|
861
|
-
className:
|
|
860
|
+
function K({ children: e, className: t }) {
|
|
861
|
+
return /* @__PURE__ */ j("div", {
|
|
862
|
+
className: c("flex items-center gap-ds-01", t),
|
|
862
863
|
children: e
|
|
863
864
|
});
|
|
864
865
|
}
|
|
865
|
-
function
|
|
866
|
-
let { editor: e } =
|
|
866
|
+
function et() {
|
|
867
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
867
868
|
editor: e,
|
|
868
869
|
selector: ({ editor: e }) => ({ isActive: e.isActive("bold") })
|
|
869
870
|
});
|
|
870
|
-
return /* @__PURE__ */
|
|
871
|
+
return /* @__PURE__ */ j(W, {
|
|
871
872
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
872
873
|
isActive: t,
|
|
873
874
|
title: "Bold",
|
|
874
|
-
children: /* @__PURE__ */
|
|
875
|
-
icon:
|
|
875
|
+
children: /* @__PURE__ */ j(u, {
|
|
876
|
+
icon: ye,
|
|
876
877
|
size: "xs"
|
|
877
878
|
})
|
|
878
879
|
});
|
|
879
880
|
}
|
|
880
|
-
function
|
|
881
|
-
let { editor: e } =
|
|
881
|
+
function tt() {
|
|
882
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
882
883
|
editor: e,
|
|
883
884
|
selector: ({ editor: e }) => ({ isActive: e.isActive("italic") })
|
|
884
885
|
});
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ j(W, {
|
|
886
887
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
887
888
|
isActive: t,
|
|
888
889
|
title: "Italic",
|
|
889
|
-
children: /* @__PURE__ */
|
|
890
|
-
icon:
|
|
890
|
+
children: /* @__PURE__ */ j(u, {
|
|
891
|
+
icon: P,
|
|
891
892
|
size: "xs"
|
|
892
893
|
})
|
|
893
894
|
});
|
|
894
895
|
}
|
|
895
|
-
function
|
|
896
|
-
let { editor: e } =
|
|
896
|
+
function nt() {
|
|
897
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
897
898
|
editor: e,
|
|
898
899
|
selector: ({ editor: e }) => ({ isActive: e.isActive("underline") })
|
|
899
900
|
});
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ j(W, {
|
|
901
902
|
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
902
903
|
isActive: t,
|
|
903
904
|
title: "Underline",
|
|
904
|
-
children: /* @__PURE__ */
|
|
905
|
-
icon:
|
|
905
|
+
children: /* @__PURE__ */ j(u, {
|
|
906
|
+
icon: Le,
|
|
906
907
|
size: "xs"
|
|
907
908
|
})
|
|
908
909
|
});
|
|
909
910
|
}
|
|
910
|
-
function
|
|
911
|
-
let { editor: e } =
|
|
911
|
+
function rt() {
|
|
912
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
912
913
|
editor: e,
|
|
913
914
|
selector: ({ editor: e }) => ({ isActive: e.isActive("strike") })
|
|
914
915
|
});
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ j(W, {
|
|
916
917
|
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
917
918
|
isActive: t,
|
|
918
919
|
title: "Strikethrough",
|
|
919
|
-
children: /* @__PURE__ */
|
|
920
|
-
icon:
|
|
920
|
+
children: /* @__PURE__ */ j(u, {
|
|
921
|
+
icon: R,
|
|
921
922
|
size: "xs"
|
|
922
923
|
})
|
|
923
924
|
});
|
|
924
925
|
}
|
|
925
|
-
function
|
|
926
|
-
let { editor: e } =
|
|
926
|
+
function it() {
|
|
927
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
927
928
|
editor: e,
|
|
928
929
|
selector: ({ editor: e }) => ({ isActive: e.isActive("highlight") })
|
|
929
930
|
});
|
|
930
|
-
return /* @__PURE__ */
|
|
931
|
+
return /* @__PURE__ */ j(W, {
|
|
931
932
|
onClick: () => e.chain().focus().toggleHighlight().run(),
|
|
932
933
|
isActive: t,
|
|
933
934
|
title: "Highlight",
|
|
934
|
-
children: /* @__PURE__ */
|
|
935
|
-
icon:
|
|
935
|
+
children: /* @__PURE__ */ j(u, {
|
|
936
|
+
icon: Te,
|
|
936
937
|
size: "xs"
|
|
937
938
|
})
|
|
938
939
|
});
|
|
939
940
|
}
|
|
940
|
-
function
|
|
941
|
-
let { editor: e } =
|
|
941
|
+
function at() {
|
|
942
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
942
943
|
editor: e,
|
|
943
944
|
selector: ({ editor: e }) => ({ isActive: e.isActive("code") })
|
|
944
945
|
});
|
|
945
|
-
return /* @__PURE__ */
|
|
946
|
+
return /* @__PURE__ */ j(W, {
|
|
946
947
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
947
948
|
isActive: t,
|
|
948
949
|
title: "Inline code",
|
|
949
|
-
children: /* @__PURE__ */
|
|
950
|
-
icon:
|
|
950
|
+
children: /* @__PURE__ */ j(u, {
|
|
951
|
+
icon: Ce,
|
|
951
952
|
size: "xs"
|
|
952
953
|
})
|
|
953
954
|
});
|
|
954
955
|
}
|
|
955
|
-
function
|
|
956
|
-
let { editor: e } =
|
|
956
|
+
function ot() {
|
|
957
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
957
958
|
editor: e,
|
|
958
959
|
selector: ({ editor: e }) => ({ isActive: e.isActive("bulletList") })
|
|
959
960
|
});
|
|
960
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ j(W, {
|
|
961
962
|
onClick: () => e.chain().focus().toggleBulletList().run(),
|
|
962
963
|
isActive: t,
|
|
963
964
|
title: "Bullet list",
|
|
964
|
-
children: /* @__PURE__ */
|
|
965
|
-
icon:
|
|
965
|
+
children: /* @__PURE__ */ j(u, {
|
|
966
|
+
icon: F,
|
|
966
967
|
size: "xs"
|
|
967
968
|
})
|
|
968
969
|
});
|
|
969
970
|
}
|
|
970
|
-
function
|
|
971
|
-
let { editor: e } =
|
|
971
|
+
function q() {
|
|
972
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
972
973
|
editor: e,
|
|
973
974
|
selector: ({ editor: e }) => ({ isActive: e.isActive("orderedList") })
|
|
974
975
|
});
|
|
975
|
-
return /* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ j(W, {
|
|
976
977
|
onClick: () => e.chain().focus().toggleOrderedList().run(),
|
|
977
978
|
isActive: t,
|
|
978
979
|
title: "Ordered list",
|
|
979
|
-
children: /* @__PURE__ */
|
|
980
|
-
icon:
|
|
980
|
+
children: /* @__PURE__ */ j(u, {
|
|
981
|
+
icon: De,
|
|
981
982
|
size: "xs"
|
|
982
983
|
})
|
|
983
984
|
});
|
|
984
985
|
}
|
|
985
|
-
function
|
|
986
|
-
let { editor: e } =
|
|
986
|
+
function st() {
|
|
987
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
987
988
|
editor: e,
|
|
988
989
|
selector: ({ editor: e }) => ({ isActive: e.isActive("blockquote") })
|
|
989
990
|
});
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ j(W, {
|
|
991
992
|
onClick: () => e.chain().focus().toggleBlockquote().run(),
|
|
992
993
|
isActive: t,
|
|
993
994
|
title: "Quote",
|
|
994
|
-
children: /* @__PURE__ */
|
|
995
|
-
icon:
|
|
995
|
+
children: /* @__PURE__ */ j(u, {
|
|
996
|
+
icon: N,
|
|
996
997
|
size: "xs"
|
|
997
998
|
})
|
|
998
999
|
});
|
|
999
1000
|
}
|
|
1000
|
-
function
|
|
1001
|
-
let { editor: e } =
|
|
1001
|
+
function J() {
|
|
1002
|
+
let { editor: e } = U(), { isActive: t } = S({
|
|
1002
1003
|
editor: e,
|
|
1003
1004
|
selector: ({ editor: e }) => ({ isActive: e.isActive("link") })
|
|
1004
1005
|
});
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ j(W, {
|
|
1006
1007
|
onClick: () => {
|
|
1007
1008
|
let t = window.prompt("URL");
|
|
1008
1009
|
t && e.chain().focus().setLink({ href: t }).run();
|
|
1009
1010
|
},
|
|
1010
1011
|
isActive: t,
|
|
1011
1012
|
title: "Link",
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1013
|
-
icon:
|
|
1013
|
+
children: /* @__PURE__ */ j(u, {
|
|
1014
|
+
icon: Ee,
|
|
1014
1015
|
size: "xs"
|
|
1015
1016
|
})
|
|
1016
1017
|
});
|
|
1017
1018
|
}
|
|
1018
|
-
function
|
|
1019
|
-
let { editor: e } =
|
|
1020
|
-
return /* @__PURE__ */
|
|
1019
|
+
function ct() {
|
|
1020
|
+
let { editor: e } = U();
|
|
1021
|
+
return /* @__PURE__ */ j(W, {
|
|
1021
1022
|
onClick: () => e.chain().focus().insertContent("@").run(),
|
|
1022
1023
|
title: "Mention",
|
|
1023
|
-
children: /* @__PURE__ */
|
|
1024
|
-
icon:
|
|
1024
|
+
children: /* @__PURE__ */ j(u, {
|
|
1025
|
+
icon: ve,
|
|
1025
1026
|
size: "xs"
|
|
1026
1027
|
})
|
|
1027
1028
|
});
|
|
1028
1029
|
}
|
|
1029
|
-
function
|
|
1030
|
-
let { editor: e } =
|
|
1031
|
-
return /* @__PURE__ */
|
|
1030
|
+
function lt() {
|
|
1031
|
+
let { editor: e } = U();
|
|
1032
|
+
return /* @__PURE__ */ j(W, {
|
|
1032
1033
|
onClick: () => e.chain().focus().insertContent(":").run(),
|
|
1033
1034
|
title: "Emoji",
|
|
1034
|
-
children: /* @__PURE__ */
|
|
1035
|
-
icon:
|
|
1035
|
+
children: /* @__PURE__ */ j(u, {
|
|
1036
|
+
icon: ke,
|
|
1036
1037
|
size: "xs"
|
|
1037
1038
|
})
|
|
1038
1039
|
});
|
|
1039
1040
|
}
|
|
1040
|
-
function
|
|
1041
|
-
let { editor: e } =
|
|
1042
|
-
return /* @__PURE__ */
|
|
1041
|
+
function ut() {
|
|
1042
|
+
let { editor: e } = U();
|
|
1043
|
+
return /* @__PURE__ */ j(W, {
|
|
1043
1044
|
onClick: () => e.chain().focus().insertContent("/").run(),
|
|
1044
1045
|
title: "Slash command",
|
|
1045
|
-
children: /* @__PURE__ */
|
|
1046
|
-
icon:
|
|
1046
|
+
children: /* @__PURE__ */ j(u, {
|
|
1047
|
+
icon: L,
|
|
1047
1048
|
size: "xs"
|
|
1048
1049
|
})
|
|
1049
1050
|
});
|
|
1050
1051
|
}
|
|
1051
|
-
function
|
|
1052
|
+
function Y({ items: e, isMobile: t, hasMentions: n, hasSlashCommands: r }) {
|
|
1052
1053
|
let i = (t) => !e || e.includes(t);
|
|
1053
|
-
return /* @__PURE__ */
|
|
1054
|
-
!t && /* @__PURE__ */
|
|
1055
|
-
i("bold") && /* @__PURE__ */
|
|
1056
|
-
i("italic") && /* @__PURE__ */
|
|
1057
|
-
i("underline") && /* @__PURE__ */
|
|
1058
|
-
i("strike") && /* @__PURE__ */
|
|
1059
|
-
i("highlight") && /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ M(ge, { children: [
|
|
1055
|
+
!t && /* @__PURE__ */ M(K, { children: [
|
|
1056
|
+
i("bold") && /* @__PURE__ */ j(et, {}),
|
|
1057
|
+
i("italic") && /* @__PURE__ */ j(tt, {}),
|
|
1058
|
+
i("underline") && /* @__PURE__ */ j(nt, {}),
|
|
1059
|
+
i("strike") && /* @__PURE__ */ j(rt, {}),
|
|
1060
|
+
i("highlight") && /* @__PURE__ */ j(it, {})
|
|
1060
1061
|
] }),
|
|
1061
|
-
!t && /* @__PURE__ */
|
|
1062
|
-
!t && /* @__PURE__ */
|
|
1063
|
-
!t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */
|
|
1064
|
-
!t && /* @__PURE__ */
|
|
1065
|
-
i("blockquote") && /* @__PURE__ */
|
|
1066
|
-
i("link") && /* @__PURE__ */
|
|
1067
|
-
i("code") && /* @__PURE__ */
|
|
1062
|
+
!t && /* @__PURE__ */ j(G, {}),
|
|
1063
|
+
!t && /* @__PURE__ */ M(K, { children: [i("bulletList") && /* @__PURE__ */ j(ot, {}), i("orderedList") && /* @__PURE__ */ j(q, {})] }),
|
|
1064
|
+
!t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ j(G, {}),
|
|
1065
|
+
!t && /* @__PURE__ */ M(K, { children: [
|
|
1066
|
+
i("blockquote") && /* @__PURE__ */ j(st, {}),
|
|
1067
|
+
i("link") && /* @__PURE__ */ j(J, {}),
|
|
1068
|
+
i("code") && /* @__PURE__ */ j(at, {})
|
|
1068
1069
|
] }),
|
|
1069
|
-
!t && (n || r) && /* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
n && i("mention") && /* @__PURE__ */
|
|
1072
|
-
i("emoji") && /* @__PURE__ */
|
|
1073
|
-
r && i("slash") && /* @__PURE__ */
|
|
1070
|
+
!t && (n || r) && /* @__PURE__ */ j(G, {}),
|
|
1071
|
+
/* @__PURE__ */ M(K, { children: [
|
|
1072
|
+
n && i("mention") && /* @__PURE__ */ j(ct, {}),
|
|
1073
|
+
i("emoji") && /* @__PURE__ */ j(lt, {}),
|
|
1074
|
+
r && i("slash") && /* @__PURE__ */ j(ut, {})
|
|
1074
1075
|
] })
|
|
1075
1076
|
] });
|
|
1076
1077
|
}
|
|
1077
|
-
function
|
|
1078
|
+
function dt({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashCommands: i, disabled: a }) {
|
|
1078
1079
|
if (t === !1) return null;
|
|
1079
1080
|
let o = typeof t != "boolean" && !Array.isArray(t), s = Array.isArray(t) ? t : null;
|
|
1080
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ j(H.Provider, {
|
|
1081
1082
|
value: {
|
|
1082
1083
|
editor: e,
|
|
1083
1084
|
disabled: a
|
|
1084
1085
|
},
|
|
1085
|
-
children: /* @__PURE__ */
|
|
1086
|
+
children: /* @__PURE__ */ j("div", {
|
|
1086
1087
|
role: "toolbar",
|
|
1087
1088
|
"aria-label": "Text formatting",
|
|
1088
1089
|
className: "flex flex-wrap items-center gap-ds-01 border-t border-surface-border px-ds-04 py-ds-02b",
|
|
1089
|
-
children: o ? t : /* @__PURE__ */
|
|
1090
|
+
children: o ? t : /* @__PURE__ */ j(Y, {
|
|
1090
1091
|
items: s,
|
|
1091
1092
|
isMobile: n,
|
|
1092
1093
|
hasMentions: r,
|
|
@@ -1097,7 +1098,7 @@ function lt({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashComman
|
|
|
1097
1098
|
}
|
|
1098
1099
|
//#endregion
|
|
1099
1100
|
//#region src/composed/rich-chat-input/audio-player.tsx
|
|
1100
|
-
var
|
|
1101
|
+
var X = [
|
|
1101
1102
|
1,
|
|
1102
1103
|
1.5,
|
|
1103
1104
|
2
|
|
@@ -1105,15 +1106,15 @@ var ut = [
|
|
|
1105
1106
|
function Z(e) {
|
|
1106
1107
|
return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
1107
1108
|
}
|
|
1108
|
-
var
|
|
1109
|
-
let o =
|
|
1109
|
+
var ft = D.forwardRef(function({ src: e, duration: t, waveformData: n, className: r, ...i }, a) {
|
|
1110
|
+
let o = D.useRef(null), s = D.useRef(null), [l, u] = D.useState(!1), [d, f] = D.useState(0), [p, m] = D.useState(0), [h, g] = D.useState(null), _ = D.useMemo(() => {
|
|
1110
1111
|
if (typeof e == "string") return e;
|
|
1111
1112
|
let t = URL.createObjectURL(e);
|
|
1112
1113
|
return g(t), t;
|
|
1113
1114
|
}, [e]);
|
|
1114
|
-
|
|
1115
|
+
D.useEffect(() => () => {
|
|
1115
1116
|
h && URL.revokeObjectURL(h);
|
|
1116
|
-
}, [h]),
|
|
1117
|
+
}, [h]), D.useEffect(() => {
|
|
1117
1118
|
let e = o.current;
|
|
1118
1119
|
if (!e) return;
|
|
1119
1120
|
let t = () => f(e.currentTime), n = () => {
|
|
@@ -1123,53 +1124,53 @@ var dt = O.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
1123
1124
|
e.removeEventListener("timeupdate", t), e.removeEventListener("ended", n);
|
|
1124
1125
|
};
|
|
1125
1126
|
}, []);
|
|
1126
|
-
let v =
|
|
1127
|
+
let v = D.useCallback(() => {
|
|
1127
1128
|
let e = o.current;
|
|
1128
1129
|
e && (l ? (e.pause(), u(!1)) : (e.play(), u(!0)));
|
|
1129
|
-
}, [l]), y =
|
|
1130
|
+
}, [l]), y = D.useCallback((e) => {
|
|
1130
1131
|
(e.key === " " || e.key === "Enter") && (e.preventDefault(), v());
|
|
1131
|
-
}, [v]), b =
|
|
1132
|
-
let n = o.current, r =
|
|
1132
|
+
}, [v]), b = D.useCallback((e) => {
|
|
1133
|
+
let n = o.current, r = s.current;
|
|
1133
1134
|
if (!n || !r || t <= 0) return;
|
|
1134
1135
|
let i = r.getBoundingClientRect(), a = e.clientX - i.left;
|
|
1135
1136
|
n.currentTime = Math.max(0, Math.min(1, a / i.width)) * t, f(n.currentTime);
|
|
1136
|
-
}, [t]), x =
|
|
1137
|
-
let e = (p + 1) %
|
|
1138
|
-
m(e), o.current && (o.current.playbackRate =
|
|
1139
|
-
}, [p]),
|
|
1140
|
-
return /* @__PURE__ */
|
|
1137
|
+
}, [t]), x = D.useCallback(() => {
|
|
1138
|
+
let e = (p + 1) % X.length;
|
|
1139
|
+
m(e), o.current && (o.current.playbackRate = X[e]);
|
|
1140
|
+
}, [p]), ee = t > 0 ? d / t : 0, S = X[p];
|
|
1141
|
+
return /* @__PURE__ */ M("div", {
|
|
1141
1142
|
ref: a,
|
|
1142
1143
|
role: "group",
|
|
1143
1144
|
"aria-label": "Voice message player",
|
|
1144
|
-
className:
|
|
1145
|
+
className: c("flex items-center gap-ds-03", r),
|
|
1145
1146
|
...i,
|
|
1146
1147
|
children: [
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ j("audio", {
|
|
1148
1149
|
ref: o,
|
|
1149
1150
|
src: _,
|
|
1150
1151
|
preload: "metadata"
|
|
1151
1152
|
}),
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ j("button", {
|
|
1153
1154
|
type: "button",
|
|
1154
1155
|
onClick: v,
|
|
1155
1156
|
onKeyDown: y,
|
|
1156
1157
|
"aria-label": l ? "Pause voice message" : "Play voice message",
|
|
1157
1158
|
className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-ds-full bg-accent-9 text-accent-fg hover:bg-accent-10 active:scale-95 transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
|
|
1158
|
-
children:
|
|
1159
|
+
children: j(l ? je : I, {
|
|
1159
1160
|
size: 16,
|
|
1160
1161
|
stroke: 2,
|
|
1161
1162
|
"aria-hidden": "true"
|
|
1162
1163
|
})
|
|
1163
1164
|
}),
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
ref:
|
|
1165
|
+
/* @__PURE__ */ j(V, {
|
|
1166
|
+
ref: s,
|
|
1166
1167
|
mode: "static",
|
|
1167
1168
|
data: n,
|
|
1168
|
-
progress:
|
|
1169
|
+
progress: ee,
|
|
1169
1170
|
className: "cursor-pointer",
|
|
1170
1171
|
onClick: b
|
|
1171
1172
|
}),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ M("span", {
|
|
1173
1174
|
className: "text-ds-xs tabular-nums text-surface-fg-subtle whitespace-nowrap",
|
|
1174
1175
|
children: [
|
|
1175
1176
|
Z(d),
|
|
@@ -1177,32 +1178,32 @@ var dt = O.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
1177
1178
|
Z(t)
|
|
1178
1179
|
]
|
|
1179
1180
|
}),
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
+
/* @__PURE__ */ M("button", {
|
|
1181
1182
|
type: "button",
|
|
1182
1183
|
onClick: x,
|
|
1183
|
-
"aria-label": `Playback speed ${
|
|
1184
|
+
"aria-label": `Playback speed ${S}x`,
|
|
1184
1185
|
className: "shrink-0 text-ds-xs bg-surface-raised rounded-ds-full px-ds-02 py-[1px] hover:bg-surface-raised-hover tabular-nums transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
|
|
1185
|
-
children: [
|
|
1186
|
+
children: [S, "x"]
|
|
1186
1187
|
})
|
|
1187
1188
|
]
|
|
1188
1189
|
});
|
|
1189
1190
|
});
|
|
1190
|
-
|
|
1191
|
+
ft.displayName = "AudioPlayer";
|
|
1191
1192
|
//#endregion
|
|
1192
1193
|
//#region src/composed/rich-chat-input/use-voice-recorder.ts
|
|
1193
|
-
function
|
|
1194
|
+
function pt() {
|
|
1194
1195
|
return typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "";
|
|
1195
1196
|
}
|
|
1196
|
-
function
|
|
1197
|
-
let { maxDuration: t, onComplete: n } = e, [r, i] =
|
|
1198
|
-
|
|
1199
|
-
let
|
|
1197
|
+
function mt(e) {
|
|
1198
|
+
let { maxDuration: t, onComplete: n } = e, [r, i] = A("idle"), [a, o] = A(0), [s, c] = A(null), [l, u] = A([]), d = k(null), f = k(null), p = k(null), m = k([]), h = k(null), g = k(null), _ = k(null), v = k(null), y = k(0), b = k([]), x = k(!1), ee = k(n);
|
|
1199
|
+
ee.current = n;
|
|
1200
|
+
let S = O(() => {
|
|
1200
1201
|
h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), _.current !== null && (clearTimeout(_.current), _.current = null), p.current &&= (p.current.getTracks().forEach((e) => e.stop()), null), f.current &&= (f.current.close().catch(() => {}), null), v.current = null, c(null), d.current = null, m.current = [];
|
|
1201
|
-
}, []),
|
|
1202
|
+
}, []), C = O(async () => {
|
|
1202
1203
|
if (typeof MediaRecorder > "u") throw Error("MediaRecorder is not supported in this browser. Voice recording requires a modern browser with MediaRecorder support.");
|
|
1203
1204
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
1204
1205
|
p.current = e;
|
|
1205
|
-
let n =
|
|
1206
|
+
let n = pt(), r = n ? new MediaRecorder(e, { mimeType: n }) : new MediaRecorder(e);
|
|
1206
1207
|
d.current = r, m.current = [], x.current = !1;
|
|
1207
1208
|
let a = new AudioContext();
|
|
1208
1209
|
f.current = a;
|
|
@@ -1210,33 +1211,33 @@ function pt(e) {
|
|
|
1210
1211
|
l.fftSize = 256, l.smoothingTimeConstant = .7, s.connect(l), v.current = l, c(l), r.ondataavailable = (e) => {
|
|
1211
1212
|
e.data.size > 0 && m.current.push(e.data);
|
|
1212
1213
|
}, r.onstop = () => {
|
|
1213
|
-
if (x.current)
|
|
1214
|
+
if (x.current) S(), i("idle"), o(0), u([]);
|
|
1214
1215
|
else {
|
|
1215
1216
|
let e = new Blob(m.current, { type: r.mimeType || "audio/webm" }), t = y.current, n = b.current;
|
|
1216
|
-
|
|
1217
|
+
S(), i("idle"), o(0), u([]), ee.current(e, t, n);
|
|
1217
1218
|
}
|
|
1218
1219
|
}, r.start(), o(0), y.current = 0, h.current = setInterval(() => {
|
|
1219
1220
|
y.current += 1, o((e) => e + 1);
|
|
1220
1221
|
}, 1e3);
|
|
1221
|
-
let
|
|
1222
|
+
let C = new Uint8Array(l.frequencyBinCount);
|
|
1222
1223
|
u([]), b.current = [], g.current = setInterval(() => {
|
|
1223
1224
|
if (v.current) {
|
|
1224
|
-
v.current.getByteFrequencyData(
|
|
1225
|
+
v.current.getByteFrequencyData(C);
|
|
1225
1226
|
let e = 0;
|
|
1226
|
-
for (let t = 0; t <
|
|
1227
|
-
let t = e /
|
|
1227
|
+
for (let t = 0; t < C.length; t++) e += C[t];
|
|
1228
|
+
let t = e / C.length / 255;
|
|
1228
1229
|
b.current = [...b.current, t], u((e) => [...e, t]);
|
|
1229
1230
|
}
|
|
1230
1231
|
}, 100), t !== void 0 && t > 0 && (_.current = setTimeout(() => {
|
|
1231
1232
|
d.current && d.current.state !== "inactive" && d.current.stop();
|
|
1232
1233
|
}, t * 1e3)), i("recording");
|
|
1233
|
-
}, [t,
|
|
1234
|
+
}, [t, S]), te = O(() => {
|
|
1234
1235
|
d.current && d.current.state !== "inactive" && (x.current = !1, d.current.stop());
|
|
1235
|
-
}, []),
|
|
1236
|
-
d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (
|
|
1237
|
-
}, [
|
|
1236
|
+
}, []), ne = O(() => {
|
|
1237
|
+
d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (S(), i("idle"), o(0), u([]));
|
|
1238
|
+
}, [S]), re = O(() => {
|
|
1238
1239
|
d.current && d.current.state === "recording" && (d.current.pause(), h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), i("paused"));
|
|
1239
|
-
}, []),
|
|
1240
|
+
}, []), ie = O(() => {
|
|
1240
1241
|
if (d.current && d.current.state === "paused") {
|
|
1241
1242
|
d.current.resume(), h.current = setInterval(() => {
|
|
1242
1243
|
y.current += 1, o((e) => e + 1);
|
|
@@ -1253,23 +1254,23 @@ function pt(e) {
|
|
|
1253
1254
|
}, 100), i("recording");
|
|
1254
1255
|
}
|
|
1255
1256
|
}, []);
|
|
1256
|
-
return
|
|
1257
|
+
return he(() => () => {
|
|
1257
1258
|
h.current !== null && clearInterval(h.current), g.current !== null && clearInterval(g.current), _.current !== null && clearTimeout(_.current), d.current && d.current.state !== "inactive" && d.current.stop(), p.current && p.current.getTracks().forEach((e) => e.stop()), f.current && f.current.close().catch(() => {});
|
|
1258
1259
|
}, []), {
|
|
1259
1260
|
state: r,
|
|
1260
1261
|
duration: a,
|
|
1261
1262
|
analyserNode: s,
|
|
1262
1263
|
waveformData: l,
|
|
1263
|
-
start:
|
|
1264
|
-
stop:
|
|
1265
|
-
cancel:
|
|
1266
|
-
pause:
|
|
1267
|
-
resume:
|
|
1264
|
+
start: C,
|
|
1265
|
+
stop: te,
|
|
1266
|
+
cancel: ne,
|
|
1267
|
+
pause: re,
|
|
1268
|
+
resume: ie
|
|
1268
1269
|
};
|
|
1269
1270
|
}
|
|
1270
1271
|
//#endregion
|
|
1271
1272
|
//#region src/composed/rich-chat-input.tsx
|
|
1272
|
-
var
|
|
1273
|
+
var ht = {
|
|
1273
1274
|
compact: {
|
|
1274
1275
|
minHeight: 44,
|
|
1275
1276
|
maxHeight: 256,
|
|
@@ -1294,7 +1295,7 @@ var mt = {
|
|
|
1294
1295
|
showToolbar: !1,
|
|
1295
1296
|
toolbarPosition: "top"
|
|
1296
1297
|
}
|
|
1297
|
-
},
|
|
1298
|
+
}, gt = [
|
|
1298
1299
|
"prose prose-sm max-w-none focus:outline-hidden",
|
|
1299
1300
|
"font-body text-ds-md leading-relaxed text-surface-fg",
|
|
1300
1301
|
"[&_p.is-editor-empty:first-child]:relative",
|
|
@@ -1305,77 +1306,77 @@ var mt = {
|
|
|
1305
1306
|
"[&_li]:text-surface-fg",
|
|
1306
1307
|
"[&_code]:rounded [&_code]:bg-surface-raised [&_code]:px-ds-02 [&_code]:py-[1px] [&_code]:text-ds-md [&_code]:text-accent-11",
|
|
1307
1308
|
"[&_strong]:font-semibold [&_strong]:text-surface-fg",
|
|
1308
|
-
"[
|
|
1309
|
+
"[&_mark]:rounded-xs [&_mark]:bg-warning-3 [&_mark]:px-[2px]",
|
|
1309
1310
|
"[&_a]:text-accent-11 [&_a]:underline",
|
|
1310
1311
|
"[&_.mention]:rounded-ds-sm [&_.mention]:bg-accent-2 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-accent-11"
|
|
1311
1312
|
].join(" ");
|
|
1312
|
-
function
|
|
1313
|
-
let [t, n] =
|
|
1314
|
-
return
|
|
1313
|
+
function _t({ options: e }) {
|
|
1314
|
+
let [t, n] = D.useState(!1), r = D.useRef(null);
|
|
1315
|
+
return D.useEffect(() => {
|
|
1315
1316
|
if (!t) return;
|
|
1316
1317
|
let e = (e) => {
|
|
1317
1318
|
r.current && !r.current.contains(e.target) && n(!1);
|
|
1318
1319
|
};
|
|
1319
1320
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1320
|
-
}, [t]), /* @__PURE__ */
|
|
1321
|
+
}, [t]), /* @__PURE__ */ M("div", {
|
|
1321
1322
|
ref: r,
|
|
1322
1323
|
className: "relative",
|
|
1323
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ j("button", {
|
|
1324
1325
|
type: "button",
|
|
1325
1326
|
onClick: () => n((e) => !e),
|
|
1326
1327
|
title: "More send options",
|
|
1327
1328
|
"aria-label": "More send options",
|
|
1328
1329
|
"aria-expanded": t,
|
|
1329
|
-
className:
|
|
1330
|
-
children: /* @__PURE__ */
|
|
1331
|
-
icon:
|
|
1330
|
+
className: c("inline-flex h-ds-xs-plus w-5 items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg", "transition-colors duration-fast-01 ease-productive-standard", t && "bg-surface-raised-hover text-surface-fg"),
|
|
1331
|
+
children: /* @__PURE__ */ j(u, {
|
|
1332
|
+
icon: xe,
|
|
1332
1333
|
size: "xs"
|
|
1333
1334
|
})
|
|
1334
|
-
}), t && /* @__PURE__ */
|
|
1335
|
+
}), t && /* @__PURE__ */ M("div", {
|
|
1335
1336
|
className: "absolute bottom-full right-0 mb-ds-02 min-w-[200px] rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating z-popover",
|
|
1336
|
-
children: [/* @__PURE__ */
|
|
1337
|
+
children: [/* @__PURE__ */ j("p", {
|
|
1337
1338
|
className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
|
|
1338
1339
|
children: "Send options"
|
|
1339
|
-
}), e.map((e, t) => /* @__PURE__ */
|
|
1340
|
+
}), e.map((e, t) => /* @__PURE__ */ M("button", {
|
|
1340
1341
|
type: "button",
|
|
1341
1342
|
onClick: () => {
|
|
1342
1343
|
e.onSelect(), n(!1);
|
|
1343
1344
|
},
|
|
1344
1345
|
className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
|
|
1345
|
-
children: [e.icon && /* @__PURE__ */
|
|
1346
|
+
children: [e.icon && /* @__PURE__ */ j(e.icon, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }), e.label]
|
|
1346
1347
|
}, t))]
|
|
1347
1348
|
})]
|
|
1348
1349
|
});
|
|
1349
1350
|
}
|
|
1350
|
-
var
|
|
1351
|
-
function
|
|
1352
|
-
let [r, i] =
|
|
1353
|
-
|
|
1354
|
-
(
|
|
1355
|
-
}, [e]),
|
|
1351
|
+
var vt = D.lazy(() => import("@emoji-mart/react"));
|
|
1352
|
+
function yt({ set: e = "native", onSelect: t, onClose: n }) {
|
|
1353
|
+
let [r, i] = D.useState(null), { colorMode: a } = pe(), o = D.useRef(null);
|
|
1354
|
+
D.useEffect(() => {
|
|
1355
|
+
(y[e] ?? y.native)().then((e) => i(e.default));
|
|
1356
|
+
}, [e]), D.useEffect(() => {
|
|
1356
1357
|
let e = (e) => {
|
|
1357
1358
|
o.current && !o.current.contains(e.target) && n();
|
|
1358
1359
|
};
|
|
1359
1360
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1360
|
-
}, [n]),
|
|
1361
|
+
}, [n]), D.useEffect(() => {
|
|
1361
1362
|
let e = (e) => {
|
|
1362
1363
|
e.key === "Escape" && n();
|
|
1363
1364
|
};
|
|
1364
1365
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1365
1366
|
}, [n]);
|
|
1366
|
-
let s = /* @__PURE__ */
|
|
1367
|
+
let s = /* @__PURE__ */ j("div", {
|
|
1367
1368
|
className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
|
|
1368
|
-
children: /* @__PURE__ */
|
|
1369
|
+
children: /* @__PURE__ */ j("span", {
|
|
1369
1370
|
className: "text-ds-sm text-surface-fg-subtle",
|
|
1370
1371
|
children: "Loading..."
|
|
1371
1372
|
})
|
|
1372
1373
|
});
|
|
1373
|
-
return /* @__PURE__ */
|
|
1374
|
+
return /* @__PURE__ */ j("div", {
|
|
1374
1375
|
ref: o,
|
|
1375
1376
|
className: "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating overflow-hidden",
|
|
1376
|
-
children: r ? /* @__PURE__ */
|
|
1377
|
+
children: r ? /* @__PURE__ */ j(D.Suspense, {
|
|
1377
1378
|
fallback: s,
|
|
1378
|
-
children: /* @__PURE__ */
|
|
1379
|
+
children: /* @__PURE__ */ j(vt, {
|
|
1379
1380
|
data: r,
|
|
1380
1381
|
set: e,
|
|
1381
1382
|
onEmojiSelect: (e) => t({
|
|
@@ -1390,17 +1391,17 @@ function vt({ set: e = "native", onSelect: t, onClose: n }) {
|
|
|
1390
1391
|
});
|
|
1391
1392
|
}
|
|
1392
1393
|
function Q({ onClick: e, isActive: t = !1, title: n, children: r }) {
|
|
1393
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ j("button", {
|
|
1394
1395
|
type: "button",
|
|
1395
1396
|
onClick: e,
|
|
1396
1397
|
title: n,
|
|
1397
1398
|
"aria-label": n,
|
|
1398
1399
|
"aria-pressed": t,
|
|
1399
|
-
className:
|
|
1400
|
+
className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
|
|
1400
1401
|
children: r
|
|
1401
1402
|
});
|
|
1402
1403
|
}
|
|
1403
|
-
function
|
|
1404
|
+
function bt({ editor: e }) {
|
|
1404
1405
|
let t = S({
|
|
1405
1406
|
editor: e,
|
|
1406
1407
|
selector: ({ editor: e }) => ({
|
|
@@ -1412,78 +1413,78 @@ function yt({ editor: e }) {
|
|
|
1412
1413
|
isCode: e.isActive("code")
|
|
1413
1414
|
})
|
|
1414
1415
|
});
|
|
1415
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ M(T, {
|
|
1416
1417
|
editor: e,
|
|
1417
1418
|
className: "flex gap-ds-01 rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
|
|
1418
1419
|
children: [
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ j(Q, {
|
|
1420
1421
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
1421
1422
|
isActive: t.isBold,
|
|
1422
1423
|
title: "Bold",
|
|
1423
|
-
children: /* @__PURE__ */
|
|
1424
|
-
icon:
|
|
1424
|
+
children: /* @__PURE__ */ j(u, {
|
|
1425
|
+
icon: ye,
|
|
1425
1426
|
size: "xs"
|
|
1426
1427
|
})
|
|
1427
1428
|
}),
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
+
/* @__PURE__ */ j(Q, {
|
|
1429
1430
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
1430
1431
|
isActive: t.isItalic,
|
|
1431
1432
|
title: "Italic",
|
|
1432
|
-
children: /* @__PURE__ */
|
|
1433
|
-
icon:
|
|
1433
|
+
children: /* @__PURE__ */ j(u, {
|
|
1434
|
+
icon: P,
|
|
1434
1435
|
size: "xs"
|
|
1435
1436
|
})
|
|
1436
1437
|
}),
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ j(Q, {
|
|
1438
1439
|
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
1439
1440
|
isActive: t.isUnderline,
|
|
1440
1441
|
title: "Underline",
|
|
1441
|
-
children: /* @__PURE__ */
|
|
1442
|
-
icon:
|
|
1442
|
+
children: /* @__PURE__ */ j(u, {
|
|
1443
|
+
icon: Le,
|
|
1443
1444
|
size: "xs"
|
|
1444
1445
|
})
|
|
1445
1446
|
}),
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ j(Q, {
|
|
1447
1448
|
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
1448
1449
|
isActive: t.isStrike,
|
|
1449
1450
|
title: "Strikethrough",
|
|
1450
|
-
children: /* @__PURE__ */
|
|
1451
|
-
icon:
|
|
1451
|
+
children: /* @__PURE__ */ j(u, {
|
|
1452
|
+
icon: R,
|
|
1452
1453
|
size: "xs"
|
|
1453
1454
|
})
|
|
1454
1455
|
}),
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ j(Q, {
|
|
1456
1457
|
onClick: () => e.chain().focus().toggleHighlight().run(),
|
|
1457
1458
|
isActive: t.isHighlight,
|
|
1458
1459
|
title: "Highlight",
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1460
|
-
icon:
|
|
1460
|
+
children: /* @__PURE__ */ j(u, {
|
|
1461
|
+
icon: Te,
|
|
1461
1462
|
size: "xs"
|
|
1462
1463
|
})
|
|
1463
1464
|
}),
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ j(Q, {
|
|
1465
1466
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
1466
1467
|
isActive: t.isCode,
|
|
1467
1468
|
title: "Code",
|
|
1468
|
-
children: /* @__PURE__ */
|
|
1469
|
-
icon:
|
|
1469
|
+
children: /* @__PURE__ */ j(u, {
|
|
1470
|
+
icon: Ce,
|
|
1470
1471
|
size: "xs"
|
|
1471
1472
|
})
|
|
1472
1473
|
})
|
|
1473
1474
|
]
|
|
1474
1475
|
});
|
|
1475
1476
|
}
|
|
1476
|
-
var
|
|
1477
|
-
let [
|
|
1478
|
-
|
|
1479
|
-
if (!
|
|
1480
|
-
let i =
|
|
1477
|
+
var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message...", disabled: p = !1, content: m = "", variant: h = "compact", enterBehavior: g = "send", maxLength: _, charCountDisplay: y = "near-limit", mentions: w, onMentionSearch: T, onMentionSelect: oe, onFileUpload: pe, onImageUpload: me, slashCommands: E, onVoiceRecord: O, onTranscribe: he, maxDuration: k, replyTo: A, onTyping: ge, onEmpty: ve, isStreaming: N = !1, onCancel: ye, leadingSlot: be, trailingSlot: xe, disclaimer: Ce, toolbar: we = !0, sendOptions: Te, onSchedule: P, actionButton: Ee, emojiSet: F = "native", className: De, ...Ae }, je) {
|
|
1478
|
+
let [I, L] = D.useState("idle"), [R, Le] = D.useState(!1), [z, Re] = D.useState(!1), [B, ze] = D.useState(null), [He, Ue] = D.useState(!1), [We, Ge] = D.useState(!1), [Je, Xe] = D.useState(0), V = D.useRef(null), Qe = D.useRef(null);
|
|
1479
|
+
D.useEffect(() => {
|
|
1480
|
+
if (!z || !V.current || !Qe.current) return;
|
|
1481
|
+
let i = V.current, a = Qe.current, o = () => {
|
|
1481
1482
|
e(i, a, {
|
|
1482
1483
|
placement: "top-end",
|
|
1483
1484
|
middleware: [
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1485
|
+
n(8),
|
|
1486
|
+
r(),
|
|
1487
|
+
t({ padding: 8 })
|
|
1487
1488
|
]
|
|
1488
1489
|
}).then(({ x: e, y: t }) => {
|
|
1489
1490
|
Object.assign(a.style, {
|
|
@@ -1495,36 +1496,36 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1495
1496
|
return o(), window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
|
|
1496
1497
|
window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
|
|
1497
1498
|
};
|
|
1498
|
-
}, [
|
|
1499
|
-
let [
|
|
1500
|
-
|
|
1501
|
-
let
|
|
1502
|
-
maxDuration:
|
|
1499
|
+
}, [z]);
|
|
1500
|
+
let [H, U] = D.useState([]), [W, G] = D.useState(null), [K, et] = D.useState(!1), tt = D.useRef(null), nt = D.useRef(null), rt = D.useRef(void 0), it = D.useRef(void 0), at = D.useRef(g);
|
|
1501
|
+
at.current = g;
|
|
1502
|
+
let ot = d(), q = ht[h], st = q.maxHeight, J = mt({
|
|
1503
|
+
maxDuration: k,
|
|
1503
1504
|
onComplete: async (e, t, n) => {
|
|
1504
|
-
if (
|
|
1505
|
-
let n = await
|
|
1505
|
+
if (O?.(e, t), he) {
|
|
1506
|
+
let n = await he(e, t);
|
|
1506
1507
|
if (n != null) {
|
|
1507
|
-
|
|
1508
|
+
Y?.chain().focus().insertContent(n).run(), L("idle");
|
|
1508
1509
|
return;
|
|
1509
1510
|
}
|
|
1510
1511
|
}
|
|
1511
|
-
|
|
1512
|
+
G({
|
|
1512
1513
|
blob: e,
|
|
1513
1514
|
duration: t,
|
|
1514
1515
|
waveformData: n
|
|
1515
|
-
}),
|
|
1516
|
+
}), L("review");
|
|
1516
1517
|
}
|
|
1517
|
-
}),
|
|
1518
|
-
|
|
1519
|
-
}, [
|
|
1520
|
-
|
|
1521
|
-
}, [
|
|
1522
|
-
|
|
1523
|
-
}, [
|
|
1518
|
+
}), ct = D.useCallback(() => {
|
|
1519
|
+
J.start(), L("recording");
|
|
1520
|
+
}, [J]), lt = D.useCallback(() => {
|
|
1521
|
+
J.stop();
|
|
1522
|
+
}, [J]), ut = D.useCallback(() => {
|
|
1523
|
+
J.cancel(), L("idle");
|
|
1524
|
+
}, [J]), Y = ne({
|
|
1524
1525
|
immediatelyRender: !1,
|
|
1525
|
-
extensions:
|
|
1526
|
+
extensions: D.useMemo(() => {
|
|
1526
1527
|
let e = [
|
|
1527
|
-
|
|
1528
|
+
ae.configure({
|
|
1528
1529
|
heading: !1,
|
|
1529
1530
|
horizontalRule: !1,
|
|
1530
1531
|
codeBlock: !1,
|
|
@@ -1534,94 +1535,94 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1534
1535
|
HTMLAttributes: { class: "text-accent-11 underline" }
|
|
1535
1536
|
}
|
|
1536
1537
|
}),
|
|
1537
|
-
|
|
1538
|
-
|
|
1538
|
+
te.configure({ placeholder: l }),
|
|
1539
|
+
ie.configure({ multicolor: !1 }),
|
|
1539
1540
|
C,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1541
|
+
b.configure({ limit: _ || void 0 }),
|
|
1542
|
+
ue,
|
|
1543
|
+
de,
|
|
1544
|
+
le(F),
|
|
1545
|
+
ee.create({
|
|
1545
1546
|
name: "enterToSend",
|
|
1546
1547
|
addKeyboardShortcuts() {
|
|
1547
1548
|
return {
|
|
1548
|
-
Enter: () =>
|
|
1549
|
-
"Shift-Enter": () =>
|
|
1550
|
-
"Mod-Enter": () => (
|
|
1549
|
+
Enter: () => at.current === "send" ? (it.current?.(), !0) : !1,
|
|
1550
|
+
"Shift-Enter": () => at.current === "send" ? (this.editor.commands.splitBlock(), !0) : !1,
|
|
1551
|
+
"Mod-Enter": () => (it.current?.(), !0)
|
|
1551
1552
|
};
|
|
1552
1553
|
}
|
|
1553
1554
|
})
|
|
1554
1555
|
];
|
|
1555
|
-
return (
|
|
1556
|
+
return (w || T) && e.push(re.configure({
|
|
1556
1557
|
HTMLAttributes: { class: "mention" },
|
|
1557
1558
|
suggestion: {
|
|
1558
|
-
items: async ({ query: e }) =>
|
|
1559
|
-
render:
|
|
1559
|
+
items: async ({ query: e }) => T ? await T(e) : w ? w.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
|
|
1560
|
+
render: fe(oe)
|
|
1560
1561
|
}
|
|
1561
|
-
})),
|
|
1562
|
+
})), E && e.push(Be(E)), e;
|
|
1562
1563
|
}, [
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1564
|
+
l,
|
|
1565
|
+
_,
|
|
1566
|
+
F,
|
|
1567
|
+
!!w,
|
|
1566
1568
|
!!T,
|
|
1567
|
-
!!E
|
|
1568
|
-
!!D
|
|
1569
|
+
!!E
|
|
1569
1570
|
]),
|
|
1570
|
-
content:
|
|
1571
|
-
editable: !
|
|
1571
|
+
content: m || void 0,
|
|
1572
|
+
editable: !p,
|
|
1572
1573
|
editorProps: {
|
|
1573
|
-
attributes: { class:
|
|
1574
|
+
attributes: { class: gt },
|
|
1574
1575
|
handlePaste: (e, t) => {
|
|
1575
1576
|
let n = Array.from(t.clipboardData?.files ?? []);
|
|
1576
1577
|
return n.length > 0 ? (n.forEach(Z), !0) : !1;
|
|
1577
1578
|
}
|
|
1578
1579
|
}
|
|
1579
|
-
}),
|
|
1580
|
-
if (!
|
|
1581
|
-
let e = !
|
|
1582
|
-
if (!e && !t && !n ||
|
|
1580
|
+
}), X = D.useCallback(() => {
|
|
1581
|
+
if (!Y) return;
|
|
1582
|
+
let e = !Y.isEmpty, t = H.length > 0, n = !!W;
|
|
1583
|
+
if (!e && !t && !n || N) return;
|
|
1583
1584
|
let r = {
|
|
1584
|
-
html: e ?
|
|
1585
|
-
plainText: e ?
|
|
1585
|
+
html: e ? Y.getHTML() : "",
|
|
1586
|
+
plainText: e ? Y.getText() : ""
|
|
1586
1587
|
};
|
|
1587
|
-
t && (r.attachments =
|
|
1588
|
+
t && (r.attachments = H.filter((e) => !e.uploading && e.url).map((e) => ({
|
|
1588
1589
|
url: e.url,
|
|
1589
1590
|
name: e.name,
|
|
1590
1591
|
size: e.size,
|
|
1591
1592
|
type: e.type
|
|
1592
1593
|
}))), n && (r.voiceNote = {
|
|
1593
|
-
blob:
|
|
1594
|
-
duration:
|
|
1595
|
-
}),
|
|
1594
|
+
blob: W.blob,
|
|
1595
|
+
duration: W.duration
|
|
1596
|
+
}), B && P ? P(r, B) : o(r), Y.commands.clearContent(), U([]), G(null), ze(null), L("idle");
|
|
1596
1597
|
}, [
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1598
|
+
Y,
|
|
1599
|
+
H,
|
|
1600
|
+
W,
|
|
1601
|
+
N,
|
|
1601
1602
|
o,
|
|
1602
|
-
|
|
1603
|
-
|
|
1603
|
+
P,
|
|
1604
|
+
B
|
|
1604
1605
|
]);
|
|
1605
|
-
|
|
1606
|
-
if (!
|
|
1606
|
+
it.current = X, D.useEffect(() => {
|
|
1607
|
+
if (!Y || !ge) return;
|
|
1607
1608
|
let e = () => {
|
|
1608
|
-
|
|
1609
|
+
ge(!0), clearTimeout(rt.current), rt.current = setTimeout(() => ge(!1), 2e3);
|
|
1609
1610
|
};
|
|
1610
|
-
return
|
|
1611
|
-
|
|
1611
|
+
return Y.on("update", e), () => {
|
|
1612
|
+
Y.off("update", e), clearTimeout(rt.current);
|
|
1612
1613
|
};
|
|
1613
|
-
}, [
|
|
1614
|
-
if (!
|
|
1614
|
+
}, [Y, ge]), D.useEffect(() => {
|
|
1615
|
+
if (!Y || !ve) return;
|
|
1615
1616
|
let e = () => {
|
|
1616
|
-
|
|
1617
|
+
ve(Y.isEmpty);
|
|
1617
1618
|
};
|
|
1618
|
-
return
|
|
1619
|
-
|
|
1619
|
+
return Y.on("update", e), e(), () => {
|
|
1620
|
+
Y.off("update", e);
|
|
1620
1621
|
};
|
|
1621
|
-
}, [
|
|
1622
|
-
let Z =
|
|
1622
|
+
}, [Y, ve]);
|
|
1623
|
+
let Z = D.useCallback(async (e) => {
|
|
1623
1624
|
let t = Math.random().toString(36).slice(2), n = e.type.startsWith("image/");
|
|
1624
|
-
|
|
1625
|
+
U((r) => [...r, {
|
|
1625
1626
|
id: t,
|
|
1626
1627
|
name: e.name,
|
|
1627
1628
|
size: e.size,
|
|
@@ -1629,16 +1630,16 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1629
1630
|
uploading: !0
|
|
1630
1631
|
}]);
|
|
1631
1632
|
try {
|
|
1632
|
-
if (n &&
|
|
1633
|
-
let n = await
|
|
1634
|
-
|
|
1633
|
+
if (n && me) {
|
|
1634
|
+
let n = await me(e);
|
|
1635
|
+
U((e) => e.map((e) => e.id === t ? {
|
|
1635
1636
|
...e,
|
|
1636
1637
|
url: n,
|
|
1637
1638
|
uploading: !1
|
|
1638
1639
|
} : e));
|
|
1639
|
-
} else if (
|
|
1640
|
-
let n = await
|
|
1641
|
-
|
|
1640
|
+
} else if (pe) {
|
|
1641
|
+
let n = await pe(e);
|
|
1642
|
+
U((e) => e.map((e) => e.id === t ? {
|
|
1642
1643
|
...e,
|
|
1643
1644
|
url: n.url,
|
|
1644
1645
|
name: n.name,
|
|
@@ -1647,220 +1648,220 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1647
1648
|
} : e));
|
|
1648
1649
|
} else if (n) {
|
|
1649
1650
|
let n = URL.createObjectURL(e);
|
|
1650
|
-
|
|
1651
|
+
U((e) => e.map((e) => e.id === t ? {
|
|
1651
1652
|
...e,
|
|
1652
1653
|
url: n,
|
|
1653
1654
|
uploading: !1
|
|
1654
1655
|
} : e));
|
|
1655
|
-
} else
|
|
1656
|
+
} else U((e) => e.filter((e) => e.id !== t));
|
|
1656
1657
|
} catch {
|
|
1657
|
-
|
|
1658
|
+
U((e) => e.filter((e) => e.id !== t));
|
|
1658
1659
|
}
|
|
1659
|
-
}, [
|
|
1660
|
-
|
|
1661
|
-
}, []),
|
|
1662
|
-
e.preventDefault(),
|
|
1663
|
-
}, [Z]), Q =
|
|
1660
|
+
}, [pe, me]), pt = D.useCallback((e) => {
|
|
1661
|
+
U((t) => t.filter((t) => t.id !== e));
|
|
1662
|
+
}, []), vt = D.useCallback((e) => {
|
|
1663
|
+
e.preventDefault(), et(!1), Array.from(e.dataTransfer.files).forEach(Z);
|
|
1664
|
+
}, [Z]), Q = D.useCallback((e) => {
|
|
1664
1665
|
Array.from(e.target.files || []).forEach(Z), e.target.value = "";
|
|
1665
|
-
}, [Z]),
|
|
1666
|
-
|
|
1667
|
-
}, []),
|
|
1668
|
-
editor:
|
|
1666
|
+
}, [Z]), xt = D.useCallback(() => {
|
|
1667
|
+
G(null), L("idle");
|
|
1668
|
+
}, []), St = S({
|
|
1669
|
+
editor: Y,
|
|
1669
1670
|
selector: ({ editor: e }) => e ? { editorIsEmpty: e.isEmpty } : null
|
|
1670
1671
|
})?.editorIsEmpty ?? !0;
|
|
1671
|
-
|
|
1672
|
-
if (!
|
|
1672
|
+
D.useEffect(() => {
|
|
1673
|
+
if (!Y) return;
|
|
1673
1674
|
let e = () => {
|
|
1674
|
-
|
|
1675
|
+
Xe(Y.state.doc.textBetween(0, Y.state.doc.content.size, void 0, " ").length);
|
|
1675
1676
|
};
|
|
1676
|
-
return e(),
|
|
1677
|
-
|
|
1677
|
+
return e(), Y.on("update", e), () => {
|
|
1678
|
+
Y.off("update", e);
|
|
1678
1679
|
};
|
|
1679
|
-
}, [
|
|
1680
|
-
let
|
|
1681
|
-
return /* @__PURE__ */
|
|
1682
|
-
ref:
|
|
1683
|
-
className:
|
|
1684
|
-
...
|
|
1680
|
+
}, [Y]);
|
|
1681
|
+
let Ct = !St || H.length > 0 || !!W, wt = R || I === "review" || h === "expanded", $ = "icon-md";
|
|
1682
|
+
return /* @__PURE__ */ M("div", {
|
|
1683
|
+
ref: je,
|
|
1684
|
+
className: c("border-t border-surface-border-subtle px-ds-05 py-ds-04", "flex items-center gap-ds-03", De),
|
|
1685
|
+
...Ae,
|
|
1685
1686
|
children: [
|
|
1686
|
-
|
|
1687
|
+
Ee !== !1 && (Ee ?? (pe || me ? /* @__PURE__ */ j(f, {
|
|
1687
1688
|
variant: "solid",
|
|
1688
1689
|
size: "icon-md",
|
|
1689
|
-
onClick: () =>
|
|
1690
|
+
onClick: () => tt.current?.click(),
|
|
1690
1691
|
title: "Attach",
|
|
1691
1692
|
"aria-label": "Attach file",
|
|
1692
1693
|
className: "shrink-0",
|
|
1693
|
-
children: /* @__PURE__ */
|
|
1694
|
-
icon:
|
|
1694
|
+
children: /* @__PURE__ */ j(u, {
|
|
1695
|
+
icon: Me,
|
|
1695
1696
|
size: "md"
|
|
1696
1697
|
})
|
|
1697
1698
|
}) : null)),
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
+
/* @__PURE__ */ M("div", {
|
|
1699
1700
|
role: "region",
|
|
1700
1701
|
"aria-label": "Message composer",
|
|
1701
|
-
className:
|
|
1702
|
-
onFocus: () =>
|
|
1702
|
+
className: c("flex-1 min-w-0 overflow-hidden rounded-ds-lg border border-surface-border-strong bg-surface-raised-hover", "transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard", "hover:bg-surface-raised-active", "focus-within:ring-2 focus-within:ring-accent-9 focus-within:ring-offset-2 focus-within:border-accent-9", I === "recording" && "border-error-7/30", K && "border-dashed border-accent-7 bg-accent-2", p && "opacity-action-disabled cursor-not-allowed"),
|
|
1703
|
+
onFocus: () => Ge(!0),
|
|
1703
1704
|
onBlur: (e) => {
|
|
1704
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
1705
|
+
e.currentTarget.contains(e.relatedTarget) || Ge(!1);
|
|
1705
1706
|
},
|
|
1706
1707
|
onDragOver: (e) => {
|
|
1707
|
-
e.preventDefault(),
|
|
1708
|
+
e.preventDefault(), et(!0);
|
|
1708
1709
|
},
|
|
1709
|
-
onDragLeave: () =>
|
|
1710
|
-
onDrop:
|
|
1710
|
+
onDragLeave: () => et(!1),
|
|
1711
|
+
onDrop: vt,
|
|
1711
1712
|
children: [
|
|
1712
|
-
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
author:
|
|
1715
|
-
preview:
|
|
1716
|
-
onDismiss:
|
|
1713
|
+
be,
|
|
1714
|
+
/* @__PURE__ */ j(a, { children: A && /* @__PURE__ */ j(Ve, {
|
|
1715
|
+
author: A.author,
|
|
1716
|
+
preview: A.preview,
|
|
1717
|
+
onDismiss: A.onDismiss
|
|
1717
1718
|
}, "reply") }),
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
date:
|
|
1720
|
-
onEdit: () =>
|
|
1721
|
-
onClear: () =>
|
|
1719
|
+
/* @__PURE__ */ j(a, { children: B && /* @__PURE__ */ j(Ye, {
|
|
1720
|
+
date: B,
|
|
1721
|
+
onEdit: () => Ue(!0),
|
|
1722
|
+
onClear: () => ze(null)
|
|
1722
1723
|
}, "schedule") }),
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
attachments:
|
|
1725
|
-
onRemoveAttachment:
|
|
1724
|
+
/* @__PURE__ */ j(a, { children: H.length > 0 && /* @__PURE__ */ j(Ze, {
|
|
1725
|
+
attachments: H,
|
|
1726
|
+
onRemoveAttachment: pt
|
|
1726
1727
|
}, "attachments") }),
|
|
1727
|
-
|
|
1728
|
-
className:
|
|
1729
|
-
children: /* @__PURE__ */
|
|
1728
|
+
q.toolbarPosition === "top" && Y && /* @__PURE__ */ j("div", {
|
|
1729
|
+
className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", R ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
|
|
1730
|
+
children: /* @__PURE__ */ j("div", {
|
|
1730
1731
|
className: "overflow-hidden",
|
|
1731
|
-
children: /* @__PURE__ */
|
|
1732
|
-
editor:
|
|
1733
|
-
toolbar:
|
|
1732
|
+
children: /* @__PURE__ */ j(dt, {
|
|
1733
|
+
editor: Y,
|
|
1734
|
+
toolbar: we,
|
|
1734
1735
|
isMobile: !1,
|
|
1735
|
-
hasMentions: !!(
|
|
1736
|
-
hasSlashCommands: !!
|
|
1737
|
-
disabled:
|
|
1736
|
+
hasMentions: !!(w || T),
|
|
1737
|
+
hasSlashCommands: !!E,
|
|
1738
|
+
disabled: p
|
|
1738
1739
|
})
|
|
1739
1740
|
})
|
|
1740
1741
|
}),
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
+
/* @__PURE__ */ M("div", {
|
|
1742
1743
|
className: "relative",
|
|
1743
|
-
children: [
|
|
1744
|
-
duration:
|
|
1745
|
-
analyserNode:
|
|
1746
|
-
maxDuration:
|
|
1747
|
-
onCancel:
|
|
1748
|
-
}), /* @__PURE__ */
|
|
1749
|
-
ref:
|
|
1750
|
-
className:
|
|
1744
|
+
children: [I === "recording" && /* @__PURE__ */ j($e, {
|
|
1745
|
+
duration: J.duration,
|
|
1746
|
+
analyserNode: J.analyserNode,
|
|
1747
|
+
maxDuration: k,
|
|
1748
|
+
onCancel: ut
|
|
1749
|
+
}), /* @__PURE__ */ M("div", {
|
|
1750
|
+
ref: nt,
|
|
1751
|
+
className: c("flex items-center px-ds-04 py-ds-03 cursor-text [&_.tiptap]:w-full [&_.tiptap]:outline-hidden", I === "recording" && "invisible"),
|
|
1751
1752
|
style: {
|
|
1752
|
-
minHeight:
|
|
1753
|
-
maxHeight:
|
|
1753
|
+
minHeight: q.minHeight,
|
|
1754
|
+
maxHeight: st,
|
|
1754
1755
|
overflowY: "auto"
|
|
1755
1756
|
},
|
|
1756
|
-
onClick: () =>
|
|
1757
|
-
children: [/* @__PURE__ */
|
|
1757
|
+
onClick: () => Y?.commands.focus(),
|
|
1758
|
+
children: [/* @__PURE__ */ j("div", {
|
|
1758
1759
|
className: "flex-1 min-w-0",
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1760
|
-
}),
|
|
1760
|
+
children: /* @__PURE__ */ j(x, { editor: Y })
|
|
1761
|
+
}), Y && I !== "recording" && /* @__PURE__ */ M("div", {
|
|
1761
1762
|
className: "flex items-center gap-ds-01 shrink-0 ml-ds-03",
|
|
1762
|
-
children: [/* @__PURE__ */
|
|
1763
|
+
children: [/* @__PURE__ */ j("button", {
|
|
1763
1764
|
type: "button",
|
|
1764
|
-
onClick: () =>
|
|
1765
|
-
title:
|
|
1766
|
-
"aria-label":
|
|
1767
|
-
"aria-pressed":
|
|
1768
|
-
className:
|
|
1769
|
-
children: /* @__PURE__ */
|
|
1770
|
-
icon:
|
|
1765
|
+
onClick: () => Le((e) => !e),
|
|
1766
|
+
title: R ? "Hide formatting" : "Show formatting",
|
|
1767
|
+
"aria-label": R ? "Hide formatting" : "Show formatting",
|
|
1768
|
+
"aria-pressed": R,
|
|
1769
|
+
className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", R ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
|
|
1770
|
+
children: /* @__PURE__ */ j(u, {
|
|
1771
|
+
icon: Fe,
|
|
1771
1772
|
size: "xs"
|
|
1772
1773
|
})
|
|
1773
|
-
}), /* @__PURE__ */
|
|
1774
|
+
}), /* @__PURE__ */ M("div", {
|
|
1774
1775
|
className: "relative",
|
|
1775
|
-
children: [/* @__PURE__ */
|
|
1776
|
-
ref:
|
|
1776
|
+
children: [/* @__PURE__ */ j("button", {
|
|
1777
|
+
ref: V,
|
|
1777
1778
|
type: "button",
|
|
1778
|
-
onClick: () =>
|
|
1779
|
+
onClick: () => Re((e) => !e),
|
|
1779
1780
|
title: "Emoji",
|
|
1780
1781
|
"aria-label": "Emoji",
|
|
1781
|
-
className:
|
|
1782
|
-
children: /* @__PURE__ */
|
|
1783
|
-
icon:
|
|
1782
|
+
className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target transition-colors duration-fast-01", z ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg"),
|
|
1783
|
+
children: /* @__PURE__ */ j(u, {
|
|
1784
|
+
icon: ke,
|
|
1784
1785
|
size: "xs"
|
|
1785
1786
|
})
|
|
1786
|
-
}),
|
|
1787
|
-
ref:
|
|
1787
|
+
}), z && _e.createPortal(/* @__PURE__ */ j("div", {
|
|
1788
|
+
ref: Qe,
|
|
1788
1789
|
className: "absolute z-popover",
|
|
1789
1790
|
style: {
|
|
1790
1791
|
top: 0,
|
|
1791
1792
|
left: 0
|
|
1792
1793
|
},
|
|
1793
|
-
children: /* @__PURE__ */
|
|
1794
|
-
set:
|
|
1794
|
+
children: /* @__PURE__ */ j(yt, {
|
|
1795
|
+
set: F,
|
|
1795
1796
|
onSelect: async ({ id: e, native: t }) => {
|
|
1796
|
-
let n =
|
|
1797
|
-
n ?
|
|
1797
|
+
let n = se(await ce(F), e);
|
|
1798
|
+
n ? Y.chain().focus().insertContent({
|
|
1798
1799
|
type: "emojiNode",
|
|
1799
1800
|
attrs: {
|
|
1800
1801
|
id: e,
|
|
1801
1802
|
native: n.native,
|
|
1802
|
-
set:
|
|
1803
|
+
set: F,
|
|
1803
1804
|
x: n.x,
|
|
1804
1805
|
y: n.y
|
|
1805
1806
|
}
|
|
1806
|
-
}).run() :
|
|
1807
|
+
}).run() : Y.chain().focus().insertContent(t).run(), Re(!1);
|
|
1807
1808
|
},
|
|
1808
|
-
onClose: () =>
|
|
1809
|
+
onClose: () => Re(!1)
|
|
1809
1810
|
})
|
|
1810
1811
|
}), document.body)]
|
|
1811
1812
|
})]
|
|
1812
1813
|
})]
|
|
1813
1814
|
})]
|
|
1814
1815
|
}),
|
|
1815
|
-
|
|
1816
|
+
I === "review" && W && /* @__PURE__ */ M("div", {
|
|
1816
1817
|
className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b border-b border-surface-border",
|
|
1817
|
-
children: [/* @__PURE__ */
|
|
1818
|
-
src:
|
|
1819
|
-
duration:
|
|
1820
|
-
waveformData:
|
|
1818
|
+
children: [/* @__PURE__ */ j(ft, {
|
|
1819
|
+
src: W.blob,
|
|
1820
|
+
duration: W.duration,
|
|
1821
|
+
waveformData: W.waveformData,
|
|
1821
1822
|
className: "flex-1"
|
|
1822
|
-
}), /* @__PURE__ */
|
|
1823
|
+
}), /* @__PURE__ */ j(f, {
|
|
1823
1824
|
variant: "ghost",
|
|
1824
1825
|
size: "icon-sm",
|
|
1825
|
-
onClick:
|
|
1826
|
+
onClick: xt,
|
|
1826
1827
|
"aria-label": "Discard voice note",
|
|
1827
1828
|
title: "Discard voice note",
|
|
1828
1829
|
className: "text-surface-fg-subtle hover:text-error-11",
|
|
1829
|
-
children: /* @__PURE__ */
|
|
1830
|
-
icon:
|
|
1830
|
+
children: /* @__PURE__ */ j(u, {
|
|
1831
|
+
icon: Ie,
|
|
1831
1832
|
size: "sm"
|
|
1832
1833
|
})
|
|
1833
1834
|
})]
|
|
1834
1835
|
}),
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
className:
|
|
1838
|
-
children: /* @__PURE__ */
|
|
1836
|
+
ot && Y && !St && /* @__PURE__ */ j(bt, { editor: Y }),
|
|
1837
|
+
q.toolbarPosition === "bottom" && Y && /* @__PURE__ */ j("div", {
|
|
1838
|
+
className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", wt ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
|
|
1839
|
+
children: /* @__PURE__ */ j("div", {
|
|
1839
1840
|
className: "overflow-hidden",
|
|
1840
|
-
children: /* @__PURE__ */
|
|
1841
|
-
editor:
|
|
1842
|
-
toolbar:
|
|
1843
|
-
isMobile:
|
|
1844
|
-
hasMentions: !!(
|
|
1845
|
-
hasSlashCommands: !!
|
|
1846
|
-
disabled:
|
|
1841
|
+
children: /* @__PURE__ */ j(dt, {
|
|
1842
|
+
editor: Y,
|
|
1843
|
+
toolbar: we,
|
|
1844
|
+
isMobile: ot,
|
|
1845
|
+
hasMentions: !!(w || T),
|
|
1846
|
+
hasSlashCommands: !!E,
|
|
1847
|
+
disabled: p
|
|
1847
1848
|
})
|
|
1848
1849
|
})
|
|
1849
1850
|
}),
|
|
1850
|
-
|
|
1851
|
-
let e =
|
|
1852
|
-
return
|
|
1853
|
-
className:
|
|
1851
|
+
_ && y !== "hidden" && (() => {
|
|
1852
|
+
let e = Je / _;
|
|
1853
|
+
return y === "always" || y === "focus" && We || (y === "near-limit" || !y) && e >= .8 || e >= 1 ? /* @__PURE__ */ M("div", {
|
|
1854
|
+
className: c("flex justify-end px-ds-04 pb-ds-02 text-ds-xs tabular-nums transition-opacity duration-fast-01", e >= 1 ? "text-error-11 font-medium" : e >= .9 ? "text-warning-11" : "text-surface-fg-subtle"),
|
|
1854
1855
|
children: [
|
|
1855
|
-
|
|
1856
|
+
Je,
|
|
1856
1857
|
"/",
|
|
1857
|
-
|
|
1858
|
+
_
|
|
1858
1859
|
]
|
|
1859
1860
|
}) : null;
|
|
1860
1861
|
})(),
|
|
1861
|
-
|
|
1862
|
-
/* @__PURE__ */
|
|
1863
|
-
ref:
|
|
1862
|
+
xe,
|
|
1863
|
+
/* @__PURE__ */ j("input", {
|
|
1864
|
+
ref: tt,
|
|
1864
1865
|
type: "file",
|
|
1865
1866
|
multiple: !0,
|
|
1866
1867
|
className: "hidden",
|
|
@@ -1868,13 +1869,13 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1868
1869
|
})
|
|
1869
1870
|
]
|
|
1870
1871
|
}),
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ M("div", {
|
|
1872
1873
|
className: "flex items-center gap-ds-02 shrink-0",
|
|
1873
|
-
children: [
|
|
1874
|
+
children: [Te && Te.length > 0 && I !== "recording" && /* @__PURE__ */ j(_t, { options: Te }), /* @__PURE__ */ M(a, {
|
|
1874
1875
|
mode: "popLayout",
|
|
1875
1876
|
initial: !1,
|
|
1876
1877
|
children: [
|
|
1877
|
-
|
|
1878
|
+
I === "recording" && /* @__PURE__ */ M(i.div, {
|
|
1878
1879
|
initial: {
|
|
1879
1880
|
scale: .8,
|
|
1880
1881
|
opacity: 0
|
|
@@ -1887,33 +1888,33 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1887
1888
|
scale: .8,
|
|
1888
1889
|
opacity: 0
|
|
1889
1890
|
},
|
|
1890
|
-
transition: { duration: .
|
|
1891
|
+
transition: { duration: s.moderate01 },
|
|
1891
1892
|
className: "flex items-center gap-ds-02",
|
|
1892
|
-
children: [/* @__PURE__ */
|
|
1893
|
+
children: [/* @__PURE__ */ j(f, {
|
|
1893
1894
|
variant: "soft",
|
|
1894
1895
|
size: $,
|
|
1895
|
-
onClick:
|
|
1896
|
+
onClick: ut,
|
|
1896
1897
|
"aria-label": "Cancel recording",
|
|
1897
1898
|
title: "Cancel recording",
|
|
1898
1899
|
className: "text-surface-fg-subtle hover:text-error-11",
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1900
|
-
icon:
|
|
1900
|
+
children: /* @__PURE__ */ j(u, {
|
|
1901
|
+
icon: Ie,
|
|
1901
1902
|
size: "md"
|
|
1902
1903
|
})
|
|
1903
|
-
}), /* @__PURE__ */
|
|
1904
|
+
}), /* @__PURE__ */ j(f, {
|
|
1904
1905
|
variant: "solid",
|
|
1905
1906
|
size: $,
|
|
1906
1907
|
color: "error",
|
|
1907
|
-
onClick:
|
|
1908
|
+
onClick: lt,
|
|
1908
1909
|
"aria-label": "Stop recording",
|
|
1909
1910
|
title: "Stop recording",
|
|
1910
|
-
children: /* @__PURE__ */
|
|
1911
|
-
icon:
|
|
1911
|
+
children: /* @__PURE__ */ j(u, {
|
|
1912
|
+
icon: Pe,
|
|
1912
1913
|
size: "md"
|
|
1913
1914
|
})
|
|
1914
1915
|
})]
|
|
1915
1916
|
}, "recording"),
|
|
1916
|
-
|
|
1917
|
+
N && I !== "recording" && /* @__PURE__ */ j(i.div, {
|
|
1917
1918
|
initial: {
|
|
1918
1919
|
scale: .8,
|
|
1919
1920
|
opacity: 0
|
|
@@ -1926,21 +1927,21 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1926
1927
|
scale: .8,
|
|
1927
1928
|
opacity: 0
|
|
1928
1929
|
},
|
|
1929
|
-
transition: { duration: .
|
|
1930
|
-
children: /* @__PURE__ */
|
|
1930
|
+
transition: { duration: s.moderate01 },
|
|
1931
|
+
children: /* @__PURE__ */ j(f, {
|
|
1931
1932
|
variant: "solid",
|
|
1932
1933
|
size: $,
|
|
1933
1934
|
color: "error",
|
|
1934
|
-
onClick:
|
|
1935
|
+
onClick: ye,
|
|
1935
1936
|
"aria-label": "Stop",
|
|
1936
1937
|
title: "Stop",
|
|
1937
|
-
children: /* @__PURE__ */
|
|
1938
|
-
icon:
|
|
1938
|
+
children: /* @__PURE__ */ j(u, {
|
|
1939
|
+
icon: Pe,
|
|
1939
1940
|
size: "md"
|
|
1940
1941
|
})
|
|
1941
1942
|
})
|
|
1942
1943
|
}, "streaming"),
|
|
1943
|
-
!
|
|
1944
|
+
!N && I !== "recording" && Ct && P && /* @__PURE__ */ j(i.div, {
|
|
1944
1945
|
initial: {
|
|
1945
1946
|
scale: .8,
|
|
1946
1947
|
opacity: 0
|
|
@@ -1953,24 +1954,24 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1953
1954
|
scale: .8,
|
|
1954
1955
|
opacity: 0
|
|
1955
1956
|
},
|
|
1956
|
-
transition: { duration: .
|
|
1957
|
-
children: /* @__PURE__ */
|
|
1958
|
-
onClick:
|
|
1959
|
-
disabled:
|
|
1960
|
-
"aria-label":
|
|
1957
|
+
transition: { duration: s.moderate01 },
|
|
1958
|
+
children: /* @__PURE__ */ j(v, {
|
|
1959
|
+
onClick: X,
|
|
1960
|
+
disabled: p,
|
|
1961
|
+
"aria-label": B ? "Schedule send" : "Send",
|
|
1961
1962
|
size: $,
|
|
1962
|
-
dropdownContent: /* @__PURE__ */
|
|
1963
|
-
onSchedule: (e) =>
|
|
1963
|
+
dropdownContent: /* @__PURE__ */ j(Ke, {
|
|
1964
|
+
onSchedule: (e) => ze(e),
|
|
1964
1965
|
onClose: () => {},
|
|
1965
|
-
onOpenDialog: () =>
|
|
1966
|
+
onOpenDialog: () => Ue(!0)
|
|
1966
1967
|
}),
|
|
1967
|
-
children: /* @__PURE__ */
|
|
1968
|
-
icon:
|
|
1968
|
+
children: /* @__PURE__ */ j(u, {
|
|
1969
|
+
icon: B ? Se : Ne,
|
|
1969
1970
|
size: "md"
|
|
1970
1971
|
})
|
|
1971
1972
|
})
|
|
1972
1973
|
}, "split-send"),
|
|
1973
|
-
!
|
|
1974
|
+
!N && I !== "recording" && Ct && !P && /* @__PURE__ */ j(i.div, {
|
|
1974
1975
|
initial: {
|
|
1975
1976
|
scale: .8,
|
|
1976
1977
|
opacity: 0
|
|
@@ -1983,21 +1984,21 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
1983
1984
|
scale: .8,
|
|
1984
1985
|
opacity: 0
|
|
1985
1986
|
},
|
|
1986
|
-
transition: { duration: .
|
|
1987
|
-
children: /* @__PURE__ */
|
|
1987
|
+
transition: { duration: s.moderate01 },
|
|
1988
|
+
children: /* @__PURE__ */ j(f, {
|
|
1988
1989
|
variant: "solid",
|
|
1989
1990
|
size: $,
|
|
1990
|
-
onClick:
|
|
1991
|
-
disabled:
|
|
1991
|
+
onClick: X,
|
|
1992
|
+
disabled: p,
|
|
1992
1993
|
"aria-label": "Send",
|
|
1993
1994
|
title: "Send",
|
|
1994
|
-
children: /* @__PURE__ */
|
|
1995
|
-
icon:
|
|
1995
|
+
children: /* @__PURE__ */ j(u, {
|
|
1996
|
+
icon: Ne,
|
|
1996
1997
|
size: "md"
|
|
1997
1998
|
})
|
|
1998
1999
|
})
|
|
1999
2000
|
}, "send"),
|
|
2000
|
-
!
|
|
2001
|
+
!N && I !== "recording" && !Ct && O && /* @__PURE__ */ j(i.div, {
|
|
2001
2002
|
initial: {
|
|
2002
2003
|
scale: .8,
|
|
2003
2004
|
opacity: 0
|
|
@@ -2010,20 +2011,20 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
2010
2011
|
scale: .8,
|
|
2011
2012
|
opacity: 0
|
|
2012
2013
|
},
|
|
2013
|
-
transition: { duration: .
|
|
2014
|
-
children: /* @__PURE__ */
|
|
2014
|
+
transition: { duration: s.moderate01 },
|
|
2015
|
+
children: /* @__PURE__ */ j(f, {
|
|
2015
2016
|
variant: "soft",
|
|
2016
2017
|
size: $,
|
|
2017
|
-
onClick:
|
|
2018
|
+
onClick: ct,
|
|
2018
2019
|
"aria-label": "Record voice message",
|
|
2019
2020
|
title: "Record voice message",
|
|
2020
|
-
children: /* @__PURE__ */
|
|
2021
|
-
icon:
|
|
2021
|
+
children: /* @__PURE__ */ j(u, {
|
|
2022
|
+
icon: Oe,
|
|
2022
2023
|
size: "md"
|
|
2023
2024
|
})
|
|
2024
2025
|
})
|
|
2025
2026
|
}, "mic"),
|
|
2026
|
-
!
|
|
2027
|
+
!N && I !== "recording" && !Ct && !O && /* @__PURE__ */ j(i.div, {
|
|
2027
2028
|
initial: {
|
|
2028
2029
|
scale: .8,
|
|
2029
2030
|
opacity: 0
|
|
@@ -2036,15 +2037,15 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
2036
2037
|
scale: .8,
|
|
2037
2038
|
opacity: 0
|
|
2038
2039
|
},
|
|
2039
|
-
transition: { duration: .
|
|
2040
|
-
children: /* @__PURE__ */
|
|
2040
|
+
transition: { duration: s.moderate01 },
|
|
2041
|
+
children: /* @__PURE__ */ j(f, {
|
|
2041
2042
|
variant: "solid",
|
|
2042
2043
|
size: $,
|
|
2043
2044
|
disabled: !0,
|
|
2044
2045
|
"aria-label": "Send",
|
|
2045
2046
|
title: "Send",
|
|
2046
|
-
children: /* @__PURE__ */
|
|
2047
|
-
icon:
|
|
2047
|
+
children: /* @__PURE__ */ j(u, {
|
|
2048
|
+
icon: Ne,
|
|
2048
2049
|
size: "md"
|
|
2049
2050
|
})
|
|
2050
2051
|
})
|
|
@@ -2052,19 +2053,19 @@ var bt = O.forwardRef(function({ onSubmit: o, placeholder: c = "Type a message..
|
|
|
2052
2053
|
]
|
|
2053
2054
|
})]
|
|
2054
2055
|
}),
|
|
2055
|
-
|
|
2056
|
+
Ce && /* @__PURE__ */ j("p", {
|
|
2056
2057
|
className: "mt-ds-02 text-center text-ds-xs text-surface-fg-subtle/50",
|
|
2057
|
-
children:
|
|
2058
|
+
children: Ce
|
|
2058
2059
|
}),
|
|
2059
|
-
|
|
2060
|
-
open:
|
|
2061
|
-
onOpenChange:
|
|
2062
|
-
onSchedule: (e) =>
|
|
2063
|
-
initialDate:
|
|
2060
|
+
P && /* @__PURE__ */ j(qe, {
|
|
2061
|
+
open: He,
|
|
2062
|
+
onOpenChange: Ue,
|
|
2063
|
+
onSchedule: (e) => ze(e),
|
|
2064
|
+
initialDate: B
|
|
2064
2065
|
})
|
|
2065
2066
|
]
|
|
2066
2067
|
});
|
|
2067
2068
|
});
|
|
2068
|
-
|
|
2069
|
+
xt.displayName = "RichChatInput";
|
|
2069
2070
|
//#endregion
|
|
2070
|
-
export {
|
|
2071
|
+
export { G as _, et as a, V as b, lt as c, J as d, ct as f, W as g, rt as h, st as i, it as l, ut as m, mt as n, ot as o, q as p, ft as r, at as s, xt as t, tt as u, K as v, nt as y };
|