@devalok/shilp-sutra 0.56.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +198 -0
- package/dist/_chunks/badge-group.js +75 -174
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/chat.js +270 -253
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +1 -1
- package/dist/_chunks/document-preview.js.map +1 -1
- package/dist/_chunks/emoji-suggestion.js +1 -1
- package/dist/_chunks/emoji-suggestion.js.map +1 -1
- package/dist/_chunks/image-preview.js +71 -70
- package/dist/_chunks/image-preview.js.map +1 -1
- package/dist/_chunks/mention-suggestion.js +2 -2
- package/dist/_chunks/mention-suggestion.js.map +1 -1
- package/dist/_chunks/motion-preference.js +15 -0
- package/dist/_chunks/motion-preference.js.map +1 -0
- package/dist/_chunks/motion-provider.js +1 -1
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/oauth-button.js +1 -1
- package/dist/_chunks/oauth-button.js.map +1 -1
- package/dist/_chunks/popover.js +50 -49
- package/dist/_chunks/popover.js.map +1 -1
- package/dist/_chunks/primitives-internal.js +29 -29
- package/dist/_chunks/primitives-internal.js.map +1 -1
- package/dist/_chunks/shared.js +48 -47
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +36 -36
- package/dist/_chunks/success.js.map +1 -1
- package/dist/_chunks/tree-view.js +1 -1
- package/dist/_chunks/tree-view.js.map +1 -1
- package/dist/_chunks/use-calendar.js +4 -4
- package/dist/_chunks/use-calendar.js.map +1 -1
- package/dist/ai/block-renderer.js +8 -8
- package/dist/ai/blocks/text.js +1 -1
- package/dist/ai/blocks/text.js.map +1 -1
- package/dist/ai/command-bar.js +67 -67
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +35 -35
- package/dist/ai/conversation.js.map +1 -1
- package/dist/ai/index.js +4 -4
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +109 -108
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/avatar-group.d.ts +7 -2
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +3 -3
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/command-palette.js +137 -137
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/content-card.js +2 -2
- package/dist/composed/content-card.js.map +1 -1
- package/dist/composed/date-picker/index.js +9 -9
- package/dist/composed/date-picker/index.js.map +1 -1
- package/dist/composed/diff.d.ts +23 -2
- package/dist/composed/diff.d.ts.map +1 -1
- package/dist/composed/diff.js +341 -260
- package/dist/composed/diff.js.map +1 -1
- package/dist/composed/emoji-picker.js +3 -3
- package/dist/composed/emoji-picker.js.map +1 -1
- package/dist/composed/empty-state.js +4 -4
- package/dist/composed/error-boundary.js +2 -2
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +152 -151
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +53 -52
- package/dist/composed/filter-bar.js.map +1 -1
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +38 -37
- package/dist/composed/form-section.js.map +1 -1
- package/dist/composed/inline-edit.js +1 -1
- package/dist/composed/inline-edit.js.map +1 -1
- package/dist/composed/loading-skeleton.js +3 -3
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +1 -1
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/member-picker.js +1 -1
- package/dist/composed/member-picker.js.map +1 -1
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +109 -108
- package/dist/composed/multi-select-popover.js.map +1 -1
- package/dist/composed/page-skeletons.js +4 -4
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/responsive-modal.js +1 -1
- package/dist/composed/responsive-modal.js.map +1 -1
- 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-chat-input.js +473 -472
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.js +6 -6
- package/dist/composed/rich-text-editor.js.map +1 -1
- package/dist/composed/schedule-view.js +5 -5
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +29 -28
- package/dist/composed/status-badge.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -3
- package/dist/hooks/use-container-size.d.ts +18 -0
- package/dist/hooks/use-container-size.d.ts.map +1 -0
- package/dist/hooks/use-container-size.js +28 -0
- package/dist/hooks/use-container-size.js.map +1 -0
- package/dist/motion/index.d.ts +1 -0
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/index.js +2 -15
- package/dist/motion/motion-preference.d.ts +36 -0
- package/dist/motion/motion-preference.d.ts.map +1 -0
- package/dist/motion/motion-provider.d.ts +2 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/motion/primitives-index.js +103 -102
- package/dist/motion/primitives-index.js.map +1 -1
- package/dist/motion/primitives.d.ts.map +1 -1
- package/dist/shell/app-shell.d.ts +101 -0
- package/dist/shell/app-shell.d.ts.map +1 -0
- package/dist/shell/app-shell.js +76 -0
- package/dist/shell/app-shell.js.map +1 -0
- package/dist/shell/bottom-navbar.js +21 -21
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/index.d.ts +2 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +6 -5
- package/dist/shell/notification-center.d.ts +17 -0
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +110 -105
- package/dist/shell/notification-center.js.map +1 -1
- package/dist/shell/notification-preferences.js +1 -1
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/shell/top-bar.js +7 -7
- package/dist/shell/top-bar.js.map +1 -1
- package/dist/tokens/generate-scale.d.ts +49 -0
- package/dist/tokens/generate-scale.d.ts.map +1 -1
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/palettes.css +292 -0
- package/dist/tokens/primitives.css +29 -26
- package/dist/tokens/semantic.css +170 -47
- package/dist/tokens/shilp-sutra.css +1 -0
- package/dist/tokens/utilities.css +10 -7
- package/dist/tokens/variants.css +1 -1
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +27 -26
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +60 -59
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +55 -113
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/autocomplete.js +80 -80
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +71 -70
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge-indicator.d.ts +4 -8
- package/dist/ui/badge-indicator.d.ts.map +1 -1
- package/dist/ui/badge-indicator.js +3 -8
- package/dist/ui/badge-indicator.js.map +1 -1
- package/dist/ui/badge.d.ts +55 -34
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +43 -41
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +3 -23
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +10 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +79 -212
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +78 -75
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/charts/radar-chart.d.ts.map +1 -1
- package/dist/ui/charts/radar-chart.js +1 -1
- package/dist/ui/charts/radar-chart.js.map +1 -1
- package/dist/ui/chat/date-separator.d.ts +8 -1
- package/dist/ui/chat/date-separator.d.ts.map +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/typing-indicator.d.ts.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code.js +2 -2
- package/dist/ui/code.js.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +151 -150
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/combobox.d.ts +14 -0
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +156 -152
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +70 -69
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/data-table-body.d.ts +3 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +93 -92
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-bulk-actions.d.ts +7 -1
- package/dist/ui/data-table-bulk-actions.d.ts.map +1 -1
- package/dist/ui/data-table-bulk-actions.js +14 -8
- package/dist/ui/data-table-bulk-actions.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +66 -47
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +4 -0
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js +2 -2
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.map +1 -1
- package/dist/ui/data-table-header.js +50 -46
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table-pagination.js +3 -3
- package/dist/ui/data-table-pagination.js.map +1 -1
- package/dist/ui/data-table-toolbar.d.ts +11 -1
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +7 -7
- package/dist/ui/data-table-toolbar.js.map +1 -1
- package/dist/ui/data-table.d.ts +52 -5
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +181 -169
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +62 -61
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dot.d.ts.map +1 -1
- package/dist/ui/dot.js +10 -41
- package/dist/ui/dot.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +79 -78
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +117 -116
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +27 -26
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/hover-card.js +26 -25
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/icon.js +7 -7
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.js +8 -8
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +73 -72
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +80 -79
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/number-input.js +3 -3
- package/dist/ui/number-input.js.map +1 -1
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts.map +1 -1
- package/dist/ui/progress-ring.js +2 -2
- package/dist/ui/progress-ring.js.map +1 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +82 -74
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/radio.js +32 -31
- package/dist/ui/radio.js.map +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +28 -27
- package/dist/ui/search-input.js.map +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +67 -66
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +14 -14
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/slider.d.ts +63 -9
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +75 -33
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/split-button.d.ts +8 -2
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +49 -95
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +89 -88
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/stat-flash.js +16 -16
- package/dist/ui/stepper.d.ts.map +1 -1
- package/dist/ui/stepper.js +63 -62
- package/dist/ui/stepper.js.map +1 -1
- package/dist/ui/surface.d.ts.map +1 -1
- package/dist/ui/surface.js +2 -2
- package/dist/ui/surface.js.map +1 -1
- package/dist/ui/switch.js +1 -1
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.js +3 -3
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +68 -67
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.js +5 -5
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +196 -195
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +26 -24
- package/dist/ui/toggle.js.map +1 -1
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +37 -36
- package/dist/ui/tooltip.js.map +1 -1
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/docs/components/composed/avatar-group.md +4 -4
- package/docs/components/composed/diff.md +10 -2
- package/docs/components/composed/schedule-view.md +1 -1
- package/docs/components/shell/app-shell.md +132 -0
- package/docs/components/ui/avatar.md +1 -1
- package/docs/components/ui/button.md +1 -1
- package/docs/components/ui/chat.md +7 -1
- package/docs/components/ui/color-swatch.md +1 -1
- package/docs/components/ui/data-table-toolbar.md +6 -2
- package/docs/components/ui/data-table.md +41 -7
- package/docs/components/ui/dot.md +1 -1
- package/docs/components/ui/progress.md +1 -0
- package/docs/components/ui/surface.md +3 -3
- package/docs/components/ui/table.md +2 -2
- package/docs/recipes/customize-brand.md +58 -0
- package/docs/recipes/install-astro.md +1 -0
- package/docs/recipes/install-next-app-router.md +1 -0
- package/docs/recipes/install-next-pages.md +22 -1
- package/docs/recipes/install-remix.md +1 -0
- package/docs/recipes/install-tanstack-start.md +1 -0
- package/docs/recipes/install-vite.md +2 -0
- package/docs/recipes/server-components.md +7 -4
- package/docs/recipes/troubleshoot.md +1 -0
- package/llms.txt +2 -1
- package/make-kit/Guidelines.md +2 -2
- package/make-kit/components/button.md +1 -1
- package/make-kit/components/card.md +6 -6
- package/make-kit/components/surface.md +4 -4
- package/make-kit/foundations/color.md +4 -4
- package/make-kit/foundations/dark-mode.md +1 -1
- package/make-kit/foundations/radius.md +1 -1
- package/make-kit/foundations/surfaces.md +9 -9
- package/mcp-manifest.json +358 -35
- package/package.json +8 -4
- package/skill/SKILL.md +12 -6
- package/skill/references/components.md +2 -1
- package/skill/references/customize-brand.md +58 -0
- package/skill/references/server-components.md +7 -4
- package/skill/references/setup-astro.md +1 -0
- package/skill/references/setup-next-app-router.md +1 -0
- package/skill/references/setup-next-pages.md +22 -1
- package/skill/references/setup-remix.md +1 -0
- package/skill/references/setup-tanstack-start.md +1 -0
- package/skill/references/setup-vite.md +2 -0
- package/skill/references/troubleshoot.md +1 -0
- package/dist/motion/check-motion-provider.d.ts +0 -2
- package/dist/motion/check-motion-provider.d.ts.map +0 -1
- package/dist/motion/index.js.map +0 -1
- package/dist/primitives/react-toast.d.ts +0 -120
- package/dist/ui/charts/_internal/scales.d.ts +0 -5
- package/dist/ui/charts/_internal/scales.d.ts.map +0 -1
- package/dist/ui/lib/slot.d.ts +0 -8
- package/dist/ui/lib/slot.d.ts.map +0 -1
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { computePosition as e, flip$1 as t, offset$1 as n, shift$1 as r } from "../_chunks/primitives-internal.js";
|
|
3
3
|
import { durations as i } from "../ui/lib/motion.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
4
|
+
import { MotionPreference as a } from "../_chunks/motion-preference.js";
|
|
5
|
+
import { cn as o } from "../ui/lib/utils.js";
|
|
6
|
+
import { Spinner as s } from "../ui/spinner.js";
|
|
7
|
+
import { Icon as c } from "../ui/icon.js";
|
|
8
|
+
import { useIsMobile as l } from "../hooks/use-mobile.js";
|
|
9
|
+
import { Button as u } from "../ui/button.js";
|
|
10
|
+
import { Dialog as d, DialogContent as f, DialogFooter as p, DialogHeader as m, DialogTitle as h } from "../ui/dialog.js";
|
|
11
|
+
import { SplitButton as g } from "../ui/split-button.js";
|
|
12
|
+
import { ToggleGroup as _, ToggleGroupItem as v } from "../ui/toggle-group.js";
|
|
13
|
+
import { TruncatedText as y } from "../ui/truncated-text.js";
|
|
14
|
+
import { MENTION_TOKEN_CLASS as b } from "../_chunks/mention.js";
|
|
15
|
+
import { EmojiNode as x } from "./extensions/emoji-node.js";
|
|
16
|
+
import { createEmojiSuggestion as ee } from "../_chunks/emoji-suggestion.js";
|
|
17
|
+
import { FileAttachment as S, createSuggestionRenderer as C } from "../_chunks/mention-suggestion.js";
|
|
18
|
+
import { CalendarGrid as te, useCalendar as w } from "../_chunks/use-calendar.js";
|
|
18
19
|
import * as T from "react";
|
|
19
20
|
import { useCallback as E, useEffect as D, useRef as O, useState as k } from "react";
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import * as
|
|
22
|
-
import { IconAt as
|
|
23
|
-
import { AnimatePresence as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { CharacterCount as
|
|
28
|
-
import { EditorContent as
|
|
29
|
-
import { BubbleMenu as
|
|
30
|
-
import
|
|
31
|
-
import { Extension as
|
|
32
|
-
import
|
|
33
|
-
import { PluginKey as
|
|
34
|
-
import { createRoot as
|
|
21
|
+
import { Fragment as ne, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
22
|
+
import * as re from "react-dom";
|
|
23
|
+
import { IconAt as ie, IconBlockquote as M, IconBold as ae, IconCalendarEvent as N, IconChevronDown as oe, IconClock as se, IconCode as ce, IconFile as le, IconHighlight as ue, IconItalic as de, IconLink as fe, IconList as P, IconListNumbers as pe, IconMicrophone as me, IconMoodSmile as he, IconPencil as ge, IconPlayerPause as _e, IconPlayerPlay as ve, IconPlus as ye, IconSend as be, IconSlash as xe, IconSquare as Se, IconStrikethrough as F, IconTextSize as Ce, IconTrash as we, IconUnderline as I, IconX as L } from "@tabler/icons-react";
|
|
24
|
+
import { AnimatePresence as Te, motion as R, useReducedMotion as Ee } from "framer-motion";
|
|
25
|
+
import De from "@tiptap/extension-highlight";
|
|
26
|
+
import Oe from "@tiptap/extension-image";
|
|
27
|
+
import ke from "@tiptap/extension-mention";
|
|
28
|
+
import { CharacterCount as Ae, Placeholder as je } from "@tiptap/extensions";
|
|
29
|
+
import { EditorContent as Me, Extension as Ne, useEditor as Pe, useEditorState as z } from "@tiptap/react";
|
|
30
|
+
import { BubbleMenu as Fe } from "@tiptap/react/menus";
|
|
31
|
+
import Ie from "@tiptap/starter-kit";
|
|
32
|
+
import { Extension as Le } from "@tiptap/core";
|
|
33
|
+
import B from "@tiptap/suggestion";
|
|
34
|
+
import { PluginKey as Re } from "@tiptap/pm/state";
|
|
35
|
+
import { createRoot as ze } from "react-dom/client";
|
|
35
36
|
//#region src/composed/extensions/slash-command.tsx
|
|
36
|
-
var
|
|
37
|
-
let [i,
|
|
37
|
+
var V = T.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
38
|
+
let [i, a] = T.useState(0), s = T.useMemo(() => {
|
|
38
39
|
let n = t.toLowerCase(), r = [];
|
|
39
40
|
return e.forEach((e, t) => {
|
|
40
41
|
e.commands.forEach((e) => {
|
|
@@ -45,7 +46,7 @@ var H = T.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
|
45
46
|
});
|
|
46
47
|
}), r;
|
|
47
48
|
}, [e, t]);
|
|
48
|
-
if (T.useEffect(() =>
|
|
49
|
+
if (T.useEffect(() => a(0), [s]), T.useImperativeHandle(r, () => ({ onKeyDown: ({ event: e }) => e.key === "ArrowUp" ? (a((e) => (e + s.length - 1) % s.length), !0) : e.key === "ArrowDown" ? (a((e) => (e + 1) % s.length), !0) : e.key === "Enter" ? (s[i] && n(s[i].command), !0) : !1 })), !s.length) return null;
|
|
49
50
|
let c = [], l = 0;
|
|
50
51
|
for (let t of s) {
|
|
51
52
|
let n = e[t.groupIndex].label, r = c[c.length - 1];
|
|
@@ -77,7 +78,7 @@ var H = T.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
|
77
78
|
role: "option",
|
|
78
79
|
"aria-selected": t === i,
|
|
79
80
|
onClick: () => n(e),
|
|
80
|
-
className:
|
|
81
|
+
className: o("flex w-full items-center gap-ds-03 rounded-control px-ds-03 py-ds-02 text-left cursor-pointer", t === i ? "bg-surface-panel-hover" : "hover:bg-surface-panel-hover"),
|
|
81
82
|
children: [r && /* @__PURE__ */ A("span", {
|
|
82
83
|
className: "flex h-4 w-4 shrink-0 items-center justify-center text-surface-fg-muted",
|
|
83
84
|
children: /* @__PURE__ */ A(r, { className: "h-4 w-4" })
|
|
@@ -97,15 +98,15 @@ var H = T.forwardRef(({ groups: e, query: t, command: n }, r) => {
|
|
|
97
98
|
}, e.label))
|
|
98
99
|
});
|
|
99
100
|
});
|
|
100
|
-
|
|
101
|
-
function
|
|
101
|
+
V.displayName = "SlashCommandList";
|
|
102
|
+
function Be(e) {
|
|
102
103
|
return () => {
|
|
103
104
|
let t = null, n = null, r = null;
|
|
104
105
|
return {
|
|
105
106
|
onStart: (i) => {
|
|
106
107
|
n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
|
|
107
108
|
let a = i.clientRect?.();
|
|
108
|
-
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t =
|
|
109
|
+
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t = ze(n), t.render(/* @__PURE__ */ A(V, {
|
|
109
110
|
ref: (e) => {
|
|
110
111
|
r = e;
|
|
111
112
|
},
|
|
@@ -117,7 +118,7 @@ function Re(e) {
|
|
|
117
118
|
onUpdate: (i) => {
|
|
118
119
|
if (!t || !n) return;
|
|
119
120
|
let a = i.clientRect?.();
|
|
120
|
-
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ A(
|
|
121
|
+
a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ A(V, {
|
|
121
122
|
ref: (e) => {
|
|
122
123
|
r = e;
|
|
123
124
|
},
|
|
@@ -133,13 +134,13 @@ function Re(e) {
|
|
|
133
134
|
};
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function Ve(e) {
|
|
137
138
|
let t = e.flatMap((e) => e.commands);
|
|
138
|
-
return
|
|
139
|
+
return Le.create({
|
|
139
140
|
name: "slashCommand",
|
|
140
141
|
addProseMirrorPlugins() {
|
|
141
|
-
return [
|
|
142
|
-
pluginKey: new
|
|
142
|
+
return [B({
|
|
143
|
+
pluginKey: new Re("slashCommand"),
|
|
143
144
|
editor: this.editor,
|
|
144
145
|
char: "/",
|
|
145
146
|
startOfLine: !0,
|
|
@@ -152,18 +153,18 @@ function ze(e) {
|
|
|
152
153
|
command: ({ editor: e, range: t, props: n }) => {
|
|
153
154
|
e.chain().focus().deleteRange(t).run(), n.action(e);
|
|
154
155
|
},
|
|
155
|
-
render:
|
|
156
|
+
render: Be(e)
|
|
156
157
|
})];
|
|
157
158
|
}
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
161
|
//#endregion
|
|
161
162
|
//#region src/composed/rich-chat-input/attachment-strip.tsx
|
|
162
|
-
function
|
|
163
|
+
function He(e) {
|
|
163
164
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
164
165
|
}
|
|
165
|
-
function
|
|
166
|
-
return /* @__PURE__ */ A(
|
|
166
|
+
function Ue({ attachments: e, onRemoveAttachment: t }) {
|
|
167
|
+
return /* @__PURE__ */ A(a, { children: /* @__PURE__ */ A(R.div, {
|
|
167
168
|
initial: {
|
|
168
169
|
height: 0,
|
|
169
170
|
opacity: 0
|
|
@@ -190,9 +191,9 @@ function Ve({ attachments: e, onRemoveAttachment: t }) {
|
|
|
190
191
|
role: "list",
|
|
191
192
|
"aria-label": "Attachments",
|
|
192
193
|
className: "flex gap-ds-02 overflow-x-auto px-ds-04 py-ds-02b border-b border-surface-border",
|
|
193
|
-
children: /* @__PURE__ */ A(
|
|
194
|
+
children: /* @__PURE__ */ A(Te, {
|
|
194
195
|
initial: !1,
|
|
195
|
-
children: e.map((e) => e.type === "image" ? /* @__PURE__ */ j(
|
|
196
|
+
children: e.map((e) => e.type === "image" ? /* @__PURE__ */ j(R.div, {
|
|
196
197
|
role: "listitem",
|
|
197
198
|
"aria-label": `Image: ${e.name}`,
|
|
198
199
|
layout: !0,
|
|
@@ -233,19 +234,19 @@ function Ve({ attachments: e, onRemoveAttachment: t }) {
|
|
|
233
234
|
className: "absolute -top-1 -right-1 h-ico-sm w-ico-sm rounded-pill bg-error-9 text-error-fg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
|
|
234
235
|
"aria-label": `Remove ${e.name}`,
|
|
235
236
|
title: "Remove",
|
|
236
|
-
children: /* @__PURE__ */ A(
|
|
237
|
+
children: /* @__PURE__ */ A(c, {
|
|
237
238
|
icon: L,
|
|
238
239
|
size: "xs"
|
|
239
240
|
})
|
|
240
241
|
}),
|
|
241
242
|
e.uploading && /* @__PURE__ */ A("div", {
|
|
242
243
|
className: "absolute inset-0 rounded-control bg-surface-overlay/50 flex items-center justify-center",
|
|
243
|
-
children: /* @__PURE__ */ A(
|
|
244
|
+
children: /* @__PURE__ */ A(s, { size: "sm" })
|
|
244
245
|
})
|
|
245
246
|
]
|
|
246
|
-
}, e.id) : /* @__PURE__ */ j(
|
|
247
|
+
}, e.id) : /* @__PURE__ */ j(R.div, {
|
|
247
248
|
role: "listitem",
|
|
248
|
-
"aria-label": `File: ${e.name}, ${
|
|
249
|
+
"aria-label": `File: ${e.name}, ${He(e.size)}`,
|
|
249
250
|
layout: !0,
|
|
250
251
|
initial: {
|
|
251
252
|
scale: 0,
|
|
@@ -272,28 +273,28 @@ function Ve({ attachments: e, onRemoveAttachment: t }) {
|
|
|
272
273
|
},
|
|
273
274
|
opacity: { duration: i.fast02 }
|
|
274
275
|
},
|
|
275
|
-
className: "flex items-center gap-ds-02 shrink-0 rounded-control bg-surface-
|
|
276
|
+
className: "flex items-center gap-ds-02 shrink-0 rounded-control bg-surface-panel px-ds-03 py-ds-01 group",
|
|
276
277
|
children: [
|
|
277
|
-
/* @__PURE__ */ A(
|
|
278
|
-
icon:
|
|
278
|
+
/* @__PURE__ */ A(c, {
|
|
279
|
+
icon: le,
|
|
279
280
|
size: "xs",
|
|
280
281
|
className: "text-surface-fg-muted"
|
|
281
282
|
}),
|
|
282
|
-
/* @__PURE__ */ A(
|
|
283
|
+
/* @__PURE__ */ A(y, {
|
|
283
284
|
mode: "middle",
|
|
284
285
|
className: "max-w-[120px] text-caption text-surface-fg-muted",
|
|
285
286
|
children: e.name
|
|
286
287
|
}),
|
|
287
288
|
/* @__PURE__ */ A("span", {
|
|
288
289
|
className: "text-caption text-surface-fg-subtle",
|
|
289
|
-
children:
|
|
290
|
+
children: He(e.size)
|
|
290
291
|
}),
|
|
291
292
|
/* @__PURE__ */ A("button", {
|
|
292
293
|
onClick: () => t(e.id),
|
|
293
294
|
className: "text-surface-fg-subtle hover:text-error-11 opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
|
|
294
295
|
"aria-label": `Remove ${e.name}`,
|
|
295
296
|
title: "Remove",
|
|
296
|
-
children: /* @__PURE__ */ A(
|
|
297
|
+
children: /* @__PURE__ */ A(c, {
|
|
297
298
|
icon: L,
|
|
298
299
|
size: "xs"
|
|
299
300
|
})
|
|
@@ -302,11 +303,11 @@ function Ve({ attachments: e, onRemoveAttachment: t }) {
|
|
|
302
303
|
}, e.id))
|
|
303
304
|
})
|
|
304
305
|
})
|
|
305
|
-
});
|
|
306
|
+
}) });
|
|
306
307
|
}
|
|
307
308
|
//#endregion
|
|
308
309
|
//#region src/composed/rich-chat-input/audio-waveform.tsx
|
|
309
|
-
var
|
|
310
|
+
var H = T.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r = 0, barWidth: i = 3, barGap: a = 2, barCount: s = 40, height: c = 32, className: l, ...u }, d) {
|
|
310
311
|
let [f, p] = T.useState(() => Array(s).fill(.05)), m = T.useRef(0), h = T.useRef(f);
|
|
311
312
|
T.useEffect(() => {
|
|
312
313
|
if (e !== "live" || !t) return;
|
|
@@ -341,13 +342,13 @@ var U = T.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
341
342
|
n,
|
|
342
343
|
s
|
|
343
344
|
]);
|
|
344
|
-
let g = s * (i +
|
|
345
|
-
let
|
|
345
|
+
let g = s * (i + a) - a, _ = T.useMemo(() => f.map((t, n) => {
|
|
346
|
+
let o = Math.max(2, t * c), l = n * (i + a), u = (c - o) / 2, d = e === "static" && r > 0 && n / s <= r;
|
|
346
347
|
return /* @__PURE__ */ A("rect", {
|
|
347
348
|
x: l,
|
|
348
349
|
y: u,
|
|
349
350
|
width: i,
|
|
350
|
-
height:
|
|
351
|
+
height: o,
|
|
351
352
|
rx: i / 2,
|
|
352
353
|
fill: d ? "var(--color-accent-9)" : "var(--color-surface-border)"
|
|
353
354
|
}, n);
|
|
@@ -356,7 +357,7 @@ var U = T.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
356
357
|
r,
|
|
357
358
|
e,
|
|
358
359
|
i,
|
|
359
|
-
|
|
360
|
+
a,
|
|
360
361
|
s,
|
|
361
362
|
c
|
|
362
363
|
]);
|
|
@@ -366,24 +367,24 @@ var U = T.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r =
|
|
|
366
367
|
viewBox: `0 0 ${g} ${c}`,
|
|
367
368
|
preserveAspectRatio: "none",
|
|
368
369
|
"aria-hidden": "true",
|
|
369
|
-
className:
|
|
370
|
+
className: o("shrink-0", l),
|
|
370
371
|
...u,
|
|
371
372
|
children: _
|
|
372
373
|
});
|
|
373
374
|
});
|
|
374
|
-
|
|
375
|
+
H.displayName = "AudioWaveform";
|
|
375
376
|
//#endregion
|
|
376
377
|
//#region src/composed/rich-chat-input/audio-player.tsx
|
|
377
|
-
var
|
|
378
|
+
var We = [
|
|
378
379
|
1,
|
|
379
380
|
1.5,
|
|
380
381
|
2
|
|
381
382
|
];
|
|
382
|
-
function
|
|
383
|
+
function Ge(e) {
|
|
383
384
|
return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
384
385
|
}
|
|
385
|
-
var
|
|
386
|
-
let s = T.useRef(null), c = T.useRef(null), [
|
|
386
|
+
var Ke = T.forwardRef(function({ src: e, duration: t, waveformData: n, className: r, ...i }, a) {
|
|
387
|
+
let s = T.useRef(null), c = T.useRef(null), [l, d] = T.useState(!1), [f, p] = T.useState(0), [m, h] = T.useState(0), [g, _] = T.useState(null), v = T.useMemo(() => {
|
|
387
388
|
if (typeof e == "string") return e;
|
|
388
389
|
let t = URL.createObjectURL(e);
|
|
389
390
|
return _(t), t;
|
|
@@ -402,8 +403,8 @@ var We = T.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
402
403
|
}, []);
|
|
403
404
|
let y = T.useCallback(() => {
|
|
404
405
|
let e = s.current;
|
|
405
|
-
e && (
|
|
406
|
-
}, [
|
|
406
|
+
e && (l ? (e.pause(), d(!1)) : (e.play(), d(!0)));
|
|
407
|
+
}, [l]), b = T.useCallback((e) => {
|
|
407
408
|
(e.key === " " || e.key === "Enter") && (e.preventDefault(), y());
|
|
408
409
|
}, [y]), x = T.useCallback((e) => {
|
|
409
410
|
let n = s.current, r = c.current;
|
|
@@ -411,14 +412,14 @@ var We = T.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
411
412
|
let i = r.getBoundingClientRect(), a = e.clientX - i.left;
|
|
412
413
|
n.currentTime = Math.max(0, Math.min(1, a / i.width)) * t, p(n.currentTime);
|
|
413
414
|
}, [t]), ee = T.useCallback(() => {
|
|
414
|
-
let e = (m + 1) %
|
|
415
|
-
h(e), s.current && (s.current.playbackRate =
|
|
416
|
-
}, [m]), S = t > 0 ? f / t : 0, C =
|
|
415
|
+
let e = (m + 1) % We.length;
|
|
416
|
+
h(e), s.current && (s.current.playbackRate = We[e]);
|
|
417
|
+
}, [m]), S = t > 0 ? f / t : 0, C = We[m];
|
|
417
418
|
return /* @__PURE__ */ j("div", {
|
|
418
|
-
ref:
|
|
419
|
+
ref: a,
|
|
419
420
|
role: "group",
|
|
420
421
|
"aria-label": "Voice message player",
|
|
421
|
-
className:
|
|
422
|
+
className: o("flex items-center gap-ds-03", r),
|
|
422
423
|
...i,
|
|
423
424
|
children: [
|
|
424
425
|
/* @__PURE__ */ A("audio", {
|
|
@@ -426,22 +427,22 @@ var We = T.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
426
427
|
src: v,
|
|
427
428
|
preload: "metadata"
|
|
428
429
|
}),
|
|
429
|
-
/* @__PURE__ */ A(
|
|
430
|
+
/* @__PURE__ */ A(u, {
|
|
430
431
|
type: "button",
|
|
431
432
|
variant: "solid",
|
|
432
433
|
shape: "pill",
|
|
433
434
|
size: "icon-sm",
|
|
434
435
|
onClick: y,
|
|
435
436
|
onKeyDown: b,
|
|
436
|
-
"aria-label":
|
|
437
|
+
"aria-label": l ? "Pause voice message" : "Play voice message",
|
|
437
438
|
className: "shrink-0 active:scale-95",
|
|
438
|
-
children: A(
|
|
439
|
+
children: A(l ? _e : ve, {
|
|
439
440
|
size: 16,
|
|
440
441
|
stroke: 2,
|
|
441
442
|
"aria-hidden": "true"
|
|
442
443
|
})
|
|
443
444
|
}),
|
|
444
|
-
/* @__PURE__ */ A(
|
|
445
|
+
/* @__PURE__ */ A(H, {
|
|
445
446
|
ref: c,
|
|
446
447
|
mode: "static",
|
|
447
448
|
data: n,
|
|
@@ -452,32 +453,32 @@ var We = T.forwardRef(function({ src: e, duration: t, waveformData: n, className
|
|
|
452
453
|
/* @__PURE__ */ j("span", {
|
|
453
454
|
className: "text-caption tabular-nums text-surface-fg-subtle whitespace-nowrap",
|
|
454
455
|
children: [
|
|
455
|
-
|
|
456
|
+
Ge(f),
|
|
456
457
|
" / ",
|
|
457
|
-
|
|
458
|
+
Ge(t)
|
|
458
459
|
]
|
|
459
460
|
}),
|
|
460
461
|
/* @__PURE__ */ j("button", {
|
|
461
462
|
type: "button",
|
|
462
463
|
onClick: ee,
|
|
463
464
|
"aria-label": `Playback speed ${C}x`,
|
|
464
|
-
className: "shrink-0 text-body-xs bg-surface-
|
|
465
|
+
className: "shrink-0 text-body-xs bg-surface-panel rounded-pill px-ds-02 py-[1px] hover:bg-surface-panel-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",
|
|
465
466
|
children: [C, "x"]
|
|
466
467
|
})
|
|
467
468
|
]
|
|
468
469
|
});
|
|
469
470
|
});
|
|
470
|
-
|
|
471
|
+
Ke.displayName = "AudioPlayer";
|
|
471
472
|
//#endregion
|
|
472
473
|
//#region src/composed/rich-chat-input/chat-toolbar.tsx
|
|
473
|
-
var
|
|
474
|
-
function
|
|
475
|
-
let e = T.useContext(
|
|
474
|
+
var qe = T.createContext(null);
|
|
475
|
+
function U() {
|
|
476
|
+
let e = T.useContext(qe);
|
|
476
477
|
if (!e) throw Error("Toolbar primitives must be used inside <ChatToolbar>");
|
|
477
478
|
return e;
|
|
478
479
|
}
|
|
479
|
-
function
|
|
480
|
-
let { disabled: s } =
|
|
480
|
+
function W({ onClick: e, isActive: t, disabled: n, title: r, children: i, className: a }) {
|
|
481
|
+
let { disabled: s } = U();
|
|
481
482
|
return /* @__PURE__ */ A("button", {
|
|
482
483
|
type: "button",
|
|
483
484
|
onClick: e,
|
|
@@ -485,235 +486,235 @@ function G({ onClick: e, isActive: t, disabled: n, title: r, children: i, classN
|
|
|
485
486
|
title: r,
|
|
486
487
|
"aria-label": r,
|
|
487
488
|
"aria-pressed": t,
|
|
488
|
-
className:
|
|
489
|
+
className: o("inline-flex h-ds-xs-plus items-center justify-center rounded-control touch-target", !a?.includes("w-") && "w-ds-xs-plus", "transition-[color,background-color,transform] duration-fast-01 ease-productive-standard", "hover:bg-surface-panel-hover hover:text-surface-fg", "active:scale-95", "disabled:pointer-events-none disabled:opacity-action-disabled", t ? "bg-surface-panel-hover text-accent-11" : "text-surface-fg-subtle", a),
|
|
489
490
|
children: i
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
+
function G() {
|
|
493
494
|
return /* @__PURE__ */ A("div", { className: "h-4 w-px bg-surface-border-subtle mx-ds-01" });
|
|
494
495
|
}
|
|
495
|
-
function
|
|
496
|
+
function K({ children: e, className: t }) {
|
|
496
497
|
return /* @__PURE__ */ A("div", {
|
|
497
|
-
className:
|
|
498
|
+
className: o("flex items-center gap-ds-01", t),
|
|
498
499
|
children: e
|
|
499
500
|
});
|
|
500
501
|
}
|
|
501
|
-
function
|
|
502
|
-
let { editor: e } =
|
|
502
|
+
function Je() {
|
|
503
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
503
504
|
editor: e,
|
|
504
505
|
selector: ({ editor: e }) => ({ isActive: e.isActive("bold") })
|
|
505
506
|
});
|
|
506
|
-
return /* @__PURE__ */ A(
|
|
507
|
+
return /* @__PURE__ */ A(W, {
|
|
507
508
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
508
509
|
isActive: t,
|
|
509
510
|
title: "Bold",
|
|
510
|
-
children: /* @__PURE__ */ A(
|
|
511
|
-
icon:
|
|
511
|
+
children: /* @__PURE__ */ A(c, {
|
|
512
|
+
icon: ae,
|
|
512
513
|
size: "xs"
|
|
513
514
|
})
|
|
514
515
|
});
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
-
let { editor: e } =
|
|
517
|
+
function Ye() {
|
|
518
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
518
519
|
editor: e,
|
|
519
520
|
selector: ({ editor: e }) => ({ isActive: e.isActive("italic") })
|
|
520
521
|
});
|
|
521
|
-
return /* @__PURE__ */ A(
|
|
522
|
+
return /* @__PURE__ */ A(W, {
|
|
522
523
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
523
524
|
isActive: t,
|
|
524
525
|
title: "Italic",
|
|
525
|
-
children: /* @__PURE__ */ A(
|
|
526
|
-
icon:
|
|
526
|
+
children: /* @__PURE__ */ A(c, {
|
|
527
|
+
icon: de,
|
|
527
528
|
size: "xs"
|
|
528
529
|
})
|
|
529
530
|
});
|
|
530
531
|
}
|
|
531
|
-
function
|
|
532
|
-
let { editor: e } =
|
|
532
|
+
function Xe() {
|
|
533
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
533
534
|
editor: e,
|
|
534
535
|
selector: ({ editor: e }) => ({ isActive: e.isActive("underline") })
|
|
535
536
|
});
|
|
536
|
-
return /* @__PURE__ */ A(
|
|
537
|
+
return /* @__PURE__ */ A(W, {
|
|
537
538
|
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
538
539
|
isActive: t,
|
|
539
540
|
title: "Underline",
|
|
540
|
-
children: /* @__PURE__ */ A(
|
|
541
|
+
children: /* @__PURE__ */ A(c, {
|
|
541
542
|
icon: I,
|
|
542
543
|
size: "xs"
|
|
543
544
|
})
|
|
544
545
|
});
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
-
let { editor: e } =
|
|
547
|
+
function Ze() {
|
|
548
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
548
549
|
editor: e,
|
|
549
550
|
selector: ({ editor: e }) => ({ isActive: e.isActive("strike") })
|
|
550
551
|
});
|
|
551
|
-
return /* @__PURE__ */ A(
|
|
552
|
+
return /* @__PURE__ */ A(W, {
|
|
552
553
|
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
553
554
|
isActive: t,
|
|
554
555
|
title: "Strikethrough",
|
|
555
|
-
children: /* @__PURE__ */ A(
|
|
556
|
+
children: /* @__PURE__ */ A(c, {
|
|
556
557
|
icon: F,
|
|
557
558
|
size: "xs"
|
|
558
559
|
})
|
|
559
560
|
});
|
|
560
561
|
}
|
|
561
|
-
function
|
|
562
|
-
let { editor: e } =
|
|
562
|
+
function Qe() {
|
|
563
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
563
564
|
editor: e,
|
|
564
565
|
selector: ({ editor: e }) => ({ isActive: e.isActive("highlight") })
|
|
565
566
|
});
|
|
566
|
-
return /* @__PURE__ */ A(
|
|
567
|
+
return /* @__PURE__ */ A(W, {
|
|
567
568
|
onClick: () => e.chain().focus().toggleHighlight().run(),
|
|
568
569
|
isActive: t,
|
|
569
570
|
title: "Highlight",
|
|
570
|
-
children: /* @__PURE__ */ A(
|
|
571
|
-
icon:
|
|
571
|
+
children: /* @__PURE__ */ A(c, {
|
|
572
|
+
icon: ue,
|
|
572
573
|
size: "xs"
|
|
573
574
|
})
|
|
574
575
|
});
|
|
575
576
|
}
|
|
576
|
-
function
|
|
577
|
-
let { editor: e } =
|
|
577
|
+
function $e() {
|
|
578
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
578
579
|
editor: e,
|
|
579
580
|
selector: ({ editor: e }) => ({ isActive: e.isActive("code") })
|
|
580
581
|
});
|
|
581
|
-
return /* @__PURE__ */ A(
|
|
582
|
+
return /* @__PURE__ */ A(W, {
|
|
582
583
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
583
584
|
isActive: t,
|
|
584
585
|
title: "Inline code",
|
|
585
|
-
children: /* @__PURE__ */ A(
|
|
586
|
-
icon:
|
|
586
|
+
children: /* @__PURE__ */ A(c, {
|
|
587
|
+
icon: ce,
|
|
587
588
|
size: "xs"
|
|
588
589
|
})
|
|
589
590
|
});
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
-
let { editor: e } =
|
|
592
|
+
function et() {
|
|
593
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
593
594
|
editor: e,
|
|
594
595
|
selector: ({ editor: e }) => ({ isActive: e.isActive("bulletList") })
|
|
595
596
|
});
|
|
596
|
-
return /* @__PURE__ */ A(
|
|
597
|
+
return /* @__PURE__ */ A(W, {
|
|
597
598
|
onClick: () => e.chain().focus().toggleBulletList().run(),
|
|
598
599
|
isActive: t,
|
|
599
600
|
title: "Bullet list",
|
|
600
|
-
children: /* @__PURE__ */ A(
|
|
601
|
+
children: /* @__PURE__ */ A(c, {
|
|
601
602
|
icon: P,
|
|
602
603
|
size: "xs"
|
|
603
604
|
})
|
|
604
605
|
});
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
let { editor: e } =
|
|
607
|
+
function tt() {
|
|
608
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
608
609
|
editor: e,
|
|
609
610
|
selector: ({ editor: e }) => ({ isActive: e.isActive("orderedList") })
|
|
610
611
|
});
|
|
611
|
-
return /* @__PURE__ */ A(
|
|
612
|
+
return /* @__PURE__ */ A(W, {
|
|
612
613
|
onClick: () => e.chain().focus().toggleOrderedList().run(),
|
|
613
614
|
isActive: t,
|
|
614
615
|
title: "Ordered list",
|
|
615
|
-
children: /* @__PURE__ */ A(
|
|
616
|
-
icon:
|
|
616
|
+
children: /* @__PURE__ */ A(c, {
|
|
617
|
+
icon: pe,
|
|
617
618
|
size: "xs"
|
|
618
619
|
})
|
|
619
620
|
});
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
-
let { editor: e } =
|
|
622
|
+
function nt() {
|
|
623
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
623
624
|
editor: e,
|
|
624
625
|
selector: ({ editor: e }) => ({ isActive: e.isActive("blockquote") })
|
|
625
626
|
});
|
|
626
|
-
return /* @__PURE__ */ A(
|
|
627
|
+
return /* @__PURE__ */ A(W, {
|
|
627
628
|
onClick: () => e.chain().focus().toggleBlockquote().run(),
|
|
628
629
|
isActive: t,
|
|
629
630
|
title: "Quote",
|
|
630
|
-
children: /* @__PURE__ */ A(
|
|
631
|
-
icon:
|
|
631
|
+
children: /* @__PURE__ */ A(c, {
|
|
632
|
+
icon: M,
|
|
632
633
|
size: "xs"
|
|
633
634
|
})
|
|
634
635
|
});
|
|
635
636
|
}
|
|
636
|
-
function
|
|
637
|
-
let { editor: e } =
|
|
637
|
+
function q() {
|
|
638
|
+
let { editor: e } = U(), { isActive: t } = z({
|
|
638
639
|
editor: e,
|
|
639
640
|
selector: ({ editor: e }) => ({ isActive: e.isActive("link") })
|
|
640
641
|
});
|
|
641
|
-
return /* @__PURE__ */ A(
|
|
642
|
+
return /* @__PURE__ */ A(W, {
|
|
642
643
|
onClick: () => {
|
|
643
644
|
let t = window.prompt("URL");
|
|
644
645
|
t && e.chain().focus().setLink({ href: t }).run();
|
|
645
646
|
},
|
|
646
647
|
isActive: t,
|
|
647
648
|
title: "Link",
|
|
648
|
-
children: /* @__PURE__ */ A(
|
|
649
|
-
icon:
|
|
649
|
+
children: /* @__PURE__ */ A(c, {
|
|
650
|
+
icon: fe,
|
|
650
651
|
size: "xs"
|
|
651
652
|
})
|
|
652
653
|
});
|
|
653
654
|
}
|
|
654
|
-
function
|
|
655
|
-
let { editor: e } =
|
|
656
|
-
return /* @__PURE__ */ A(
|
|
655
|
+
function rt() {
|
|
656
|
+
let { editor: e } = U();
|
|
657
|
+
return /* @__PURE__ */ A(W, {
|
|
657
658
|
onClick: () => e.chain().focus().insertContent("@").run(),
|
|
658
659
|
title: "Mention",
|
|
659
|
-
children: /* @__PURE__ */ A(
|
|
660
|
-
icon:
|
|
660
|
+
children: /* @__PURE__ */ A(c, {
|
|
661
|
+
icon: ie,
|
|
661
662
|
size: "xs"
|
|
662
663
|
})
|
|
663
664
|
});
|
|
664
665
|
}
|
|
665
666
|
function J() {
|
|
666
|
-
let { editor: e } =
|
|
667
|
-
return /* @__PURE__ */ A(
|
|
667
|
+
let { editor: e } = U();
|
|
668
|
+
return /* @__PURE__ */ A(W, {
|
|
668
669
|
onClick: () => e.chain().focus().insertContent(":").run(),
|
|
669
670
|
title: "Emoji",
|
|
670
|
-
children: /* @__PURE__ */ A(
|
|
671
|
-
icon:
|
|
671
|
+
children: /* @__PURE__ */ A(c, {
|
|
672
|
+
icon: he,
|
|
672
673
|
size: "xs"
|
|
673
674
|
})
|
|
674
675
|
});
|
|
675
676
|
}
|
|
676
|
-
function
|
|
677
|
-
let { editor: e } =
|
|
678
|
-
return /* @__PURE__ */ A(
|
|
677
|
+
function it() {
|
|
678
|
+
let { editor: e } = U();
|
|
679
|
+
return /* @__PURE__ */ A(W, {
|
|
679
680
|
onClick: () => e.chain().focus().insertContent("/").run(),
|
|
680
681
|
title: "Slash command",
|
|
681
|
-
children: /* @__PURE__ */ A(
|
|
682
|
-
icon:
|
|
682
|
+
children: /* @__PURE__ */ A(c, {
|
|
683
|
+
icon: xe,
|
|
683
684
|
size: "xs"
|
|
684
685
|
})
|
|
685
686
|
});
|
|
686
687
|
}
|
|
687
688
|
function Y({ items: e, isMobile: t, hasMentions: n, hasSlashCommands: r }) {
|
|
688
689
|
let i = (t) => !e || e.includes(t);
|
|
689
|
-
return /* @__PURE__ */ j(
|
|
690
|
-
!t && /* @__PURE__ */ j(
|
|
691
|
-
i("bold") && /* @__PURE__ */ A(
|
|
692
|
-
i("italic") && /* @__PURE__ */ A(
|
|
693
|
-
i("underline") && /* @__PURE__ */ A(
|
|
694
|
-
i("strike") && /* @__PURE__ */ A(
|
|
695
|
-
i("highlight") && /* @__PURE__ */ A(
|
|
690
|
+
return /* @__PURE__ */ j(ne, { children: [
|
|
691
|
+
!t && /* @__PURE__ */ j(K, { children: [
|
|
692
|
+
i("bold") && /* @__PURE__ */ A(Je, {}),
|
|
693
|
+
i("italic") && /* @__PURE__ */ A(Ye, {}),
|
|
694
|
+
i("underline") && /* @__PURE__ */ A(Xe, {}),
|
|
695
|
+
i("strike") && /* @__PURE__ */ A(Ze, {}),
|
|
696
|
+
i("highlight") && /* @__PURE__ */ A(Qe, {})
|
|
696
697
|
] }),
|
|
697
|
-
!t && /* @__PURE__ */ A(
|
|
698
|
-
!t && /* @__PURE__ */ j(
|
|
699
|
-
!t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ A(
|
|
700
|
-
!t && /* @__PURE__ */ j(
|
|
701
|
-
i("blockquote") && /* @__PURE__ */ A(
|
|
702
|
-
i("link") && /* @__PURE__ */ A(
|
|
703
|
-
i("code") && /* @__PURE__ */ A(
|
|
698
|
+
!t && /* @__PURE__ */ A(G, {}),
|
|
699
|
+
!t && /* @__PURE__ */ j(K, { children: [i("bulletList") && /* @__PURE__ */ A(et, {}), i("orderedList") && /* @__PURE__ */ A(tt, {})] }),
|
|
700
|
+
!t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ A(G, {}),
|
|
701
|
+
!t && /* @__PURE__ */ j(K, { children: [
|
|
702
|
+
i("blockquote") && /* @__PURE__ */ A(nt, {}),
|
|
703
|
+
i("link") && /* @__PURE__ */ A(q, {}),
|
|
704
|
+
i("code") && /* @__PURE__ */ A($e, {})
|
|
704
705
|
] }),
|
|
705
|
-
!t && (n || r) && /* @__PURE__ */ A(
|
|
706
|
-
/* @__PURE__ */ j(
|
|
707
|
-
n && i("mention") && /* @__PURE__ */ A(
|
|
706
|
+
!t && (n || r) && /* @__PURE__ */ A(G, {}),
|
|
707
|
+
/* @__PURE__ */ j(K, { children: [
|
|
708
|
+
n && i("mention") && /* @__PURE__ */ A(rt, {}),
|
|
708
709
|
i("emoji") && /* @__PURE__ */ A(J, {}),
|
|
709
|
-
r && i("slash") && /* @__PURE__ */ A(
|
|
710
|
+
r && i("slash") && /* @__PURE__ */ A(it, {})
|
|
710
711
|
] })
|
|
711
712
|
] });
|
|
712
713
|
}
|
|
713
|
-
function
|
|
714
|
+
function at({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashCommands: i, disabled: a }) {
|
|
714
715
|
if (t === !1) return null;
|
|
715
716
|
let o = typeof t != "boolean" && !Array.isArray(t), s = Array.isArray(t) ? t : null;
|
|
716
|
-
return /* @__PURE__ */ A(
|
|
717
|
+
return /* @__PURE__ */ A(qe.Provider, {
|
|
717
718
|
value: {
|
|
718
719
|
editor: e,
|
|
719
720
|
disabled: a
|
|
@@ -733,7 +734,7 @@ function it({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashComman
|
|
|
733
734
|
}
|
|
734
735
|
//#endregion
|
|
735
736
|
//#region src/composed/rich-chat-input/recording-overlay.tsx
|
|
736
|
-
function
|
|
737
|
+
function ot(e) {
|
|
737
738
|
let t = Math.floor(e / 60), n = Math.floor(e % 60);
|
|
738
739
|
return {
|
|
739
740
|
minutes: String(t),
|
|
@@ -741,27 +742,27 @@ function at(e) {
|
|
|
741
742
|
secs: n.toString().padStart(2, "0")
|
|
742
743
|
};
|
|
743
744
|
}
|
|
744
|
-
function
|
|
745
|
-
let i =
|
|
745
|
+
function st({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
746
|
+
let i = Ee();
|
|
746
747
|
T.useEffect(() => {
|
|
747
748
|
let e = (e) => {
|
|
748
749
|
e.key === "Escape" && r();
|
|
749
750
|
};
|
|
750
751
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
751
752
|
}, [r]);
|
|
752
|
-
let
|
|
753
|
+
let a = n != null && n > 0 && e >= n - 10, s = n != null && n > 0 && e >= n - 5, c = s ? "animate-[pulse_500ms_ease-in-out_infinite]" : "animate-[pulse_1s_ease-in-out_infinite]", l = ot(e), u = s ? "text-error-11" : a ? "text-warning-11" : "text-surface-fg";
|
|
753
754
|
return /* @__PURE__ */ j("div", {
|
|
754
755
|
role: "status",
|
|
755
756
|
"aria-live": "polite",
|
|
756
757
|
"aria-label": "Recording voice message",
|
|
757
|
-
className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-
|
|
758
|
+
className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-panel-hover rounded-surface z-10",
|
|
758
759
|
children: [
|
|
759
760
|
/* @__PURE__ */ A("span", {
|
|
760
|
-
className:
|
|
761
|
+
className: o("w-ds-02b h-ds-02b shrink-0 rounded-pill bg-error-9", i ? "opacity-100" : c),
|
|
761
762
|
"aria-hidden": "true"
|
|
762
763
|
}),
|
|
763
764
|
/* @__PURE__ */ j("span", {
|
|
764
|
-
className:
|
|
765
|
+
className: o("text-body-sm font-mono tabular-nums whitespace-nowrap", u),
|
|
765
766
|
"aria-label": `${l.minutes} minutes ${l.secs} seconds`,
|
|
766
767
|
children: [
|
|
767
768
|
l.minutes,
|
|
@@ -775,7 +776,7 @@ function ot({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
|
775
776
|
}),
|
|
776
777
|
/* @__PURE__ */ A("div", {
|
|
777
778
|
className: "flex-1 min-w-0 overflow-hidden",
|
|
778
|
-
children: /* @__PURE__ */ A(
|
|
779
|
+
children: /* @__PURE__ */ A(H, {
|
|
779
780
|
mode: "live",
|
|
780
781
|
analyserNode: t,
|
|
781
782
|
height: 24,
|
|
@@ -786,11 +787,11 @@ function ot({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
|
|
|
786
787
|
]
|
|
787
788
|
});
|
|
788
789
|
}
|
|
789
|
-
|
|
790
|
+
st.displayName = "RecordingOverlay";
|
|
790
791
|
//#endregion
|
|
791
792
|
//#region src/composed/rich-chat-input/reply-banner.tsx
|
|
792
|
-
function
|
|
793
|
-
return /* @__PURE__ */ A(
|
|
793
|
+
function ct({ author: e, preview: t, onDismiss: n }) {
|
|
794
|
+
return /* @__PURE__ */ A(a, { children: /* @__PURE__ */ A(R.div, {
|
|
794
795
|
initial: {
|
|
795
796
|
height: 0,
|
|
796
797
|
opacity: 0
|
|
@@ -836,20 +837,20 @@ function st({ author: e, preview: t, onDismiss: n }) {
|
|
|
836
837
|
}), /* @__PURE__ */ A("button", {
|
|
837
838
|
type: "button",
|
|
838
839
|
onClick: n,
|
|
839
|
-
className:
|
|
840
|
+
className: o("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-control touch-target", "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-panel-hover", "transition-colors duration-fast-01 ease-productive-standard", "active:scale-95"),
|
|
840
841
|
"aria-label": "Cancel reply",
|
|
841
842
|
title: "Cancel reply",
|
|
842
|
-
children: /* @__PURE__ */ A(
|
|
843
|
+
children: /* @__PURE__ */ A(c, {
|
|
843
844
|
icon: L,
|
|
844
845
|
size: "xs"
|
|
845
846
|
})
|
|
846
847
|
})]
|
|
847
848
|
})
|
|
848
|
-
});
|
|
849
|
+
}) });
|
|
849
850
|
}
|
|
850
851
|
//#endregion
|
|
851
852
|
//#region src/composed/rich-chat-input/schedule-send.tsx
|
|
852
|
-
function
|
|
853
|
+
function lt() {
|
|
853
854
|
let e = /* @__PURE__ */ new Date(), t = e.getHours(), n = [], r = (t, n = 0) => {
|
|
854
855
|
let r = new Date(e);
|
|
855
856
|
return r.setDate(r.getDate() + n), r.setHours(t, 0, 0, 0), r;
|
|
@@ -897,7 +898,7 @@ function ct() {
|
|
|
897
898
|
date: a
|
|
898
899
|
}), n;
|
|
899
900
|
}
|
|
900
|
-
function
|
|
901
|
+
function ut({ value: e, onChange: t }) {
|
|
901
902
|
let n = e.getHours() % 12 || 12, r = e.getMinutes(), i = e.getHours() >= 12, a = (n) => {
|
|
902
903
|
let r = new Date(e);
|
|
903
904
|
r.setHours(i ? n % 12 + 12 : n % 12), t(r);
|
|
@@ -914,7 +915,7 @@ function lt({ value: e, onChange: t }) {
|
|
|
914
915
|
/* @__PURE__ */ A("select", {
|
|
915
916
|
value: n,
|
|
916
917
|
onChange: (e) => a(Number(e.target.value)),
|
|
917
|
-
className: "h-ds-sm rounded-control border border-surface-border-
|
|
918
|
+
className: "h-ds-sm rounded-control border border-surface-border-interactive bg-surface-panel-hover px-ds-02 text-body-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
|
|
918
919
|
"aria-label": "Hour",
|
|
919
920
|
children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ A("option", {
|
|
920
921
|
value: e,
|
|
@@ -928,24 +929,24 @@ function lt({ value: e, onChange: t }) {
|
|
|
928
929
|
/* @__PURE__ */ A("select", {
|
|
929
930
|
value: r - r % 5,
|
|
930
931
|
onChange: (e) => o(Number(e.target.value)),
|
|
931
|
-
className: "h-ds-sm rounded-control border border-surface-border-
|
|
932
|
+
className: "h-ds-sm rounded-control border border-surface-border-interactive bg-surface-panel-hover px-ds-02 text-body-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
|
|
932
933
|
"aria-label": "Minute",
|
|
933
934
|
children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */ A("option", {
|
|
934
935
|
value: e,
|
|
935
936
|
children: String(e).padStart(2, "0")
|
|
936
937
|
}, e))
|
|
937
938
|
}),
|
|
938
|
-
/* @__PURE__ */ j(
|
|
939
|
+
/* @__PURE__ */ j(_, {
|
|
939
940
|
type: "single",
|
|
940
941
|
value: i ? "PM" : "AM",
|
|
941
942
|
onValueChange: (e) => {
|
|
942
943
|
e === "AM" ? s(!1) : e === "PM" && s(!0);
|
|
943
944
|
},
|
|
944
945
|
size: "sm",
|
|
945
|
-
children: [/* @__PURE__ */ A(
|
|
946
|
+
children: [/* @__PURE__ */ A(v, {
|
|
946
947
|
value: "AM",
|
|
947
948
|
children: "AM"
|
|
948
|
-
}), /* @__PURE__ */ A(
|
|
949
|
+
}), /* @__PURE__ */ A(v, {
|
|
949
950
|
value: "PM",
|
|
950
951
|
children: "PM"
|
|
951
952
|
})]
|
|
@@ -975,28 +976,28 @@ function X({ value: e, onChange: t, minDate: n }) {
|
|
|
975
976
|
value: a,
|
|
976
977
|
min: s,
|
|
977
978
|
onChange: o,
|
|
978
|
-
className: "h-ds-sm rounded-control border border-surface-border-
|
|
979
|
+
className: "h-ds-sm rounded-control border border-surface-border-interactive bg-surface-panel-hover px-ds-03 text-body-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9"
|
|
979
980
|
})]
|
|
980
981
|
}), /* @__PURE__ */ j("div", {
|
|
981
982
|
className: "flex items-center justify-between",
|
|
982
983
|
children: [/* @__PURE__ */ A("span", {
|
|
983
984
|
className: "text-caption font-medium text-surface-fg-subtle",
|
|
984
985
|
children: "Time"
|
|
985
|
-
}), /* @__PURE__ */ A(
|
|
986
|
+
}), /* @__PURE__ */ A(ut, {
|
|
986
987
|
value: i,
|
|
987
988
|
onChange: t
|
|
988
989
|
})]
|
|
989
990
|
})]
|
|
990
991
|
});
|
|
991
992
|
}
|
|
992
|
-
function
|
|
993
|
+
function dt({ value: e, onChange: t, minDate: n }) {
|
|
993
994
|
let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
|
|
994
995
|
let e = new Date(r);
|
|
995
996
|
return e.setHours(e.getHours() + 1, 0, 0, 0), e;
|
|
996
997
|
})(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } = w(i);
|
|
997
998
|
return /* @__PURE__ */ j("div", {
|
|
998
999
|
className: "space-y-ds-03",
|
|
999
|
-
children: [/* @__PURE__ */ A(
|
|
1000
|
+
children: [/* @__PURE__ */ A(te, {
|
|
1000
1001
|
currentMonth: a,
|
|
1001
1002
|
selected: i,
|
|
1002
1003
|
onSelect: (e) => {
|
|
@@ -1013,15 +1014,15 @@ function ut({ value: e, onChange: t, minDate: n }) {
|
|
|
1013
1014
|
children: [/* @__PURE__ */ A("span", {
|
|
1014
1015
|
className: "text-caption font-medium text-surface-fg-subtle",
|
|
1015
1016
|
children: "Time"
|
|
1016
|
-
}), /* @__PURE__ */ A(
|
|
1017
|
+
}), /* @__PURE__ */ A(ut, {
|
|
1017
1018
|
value: i,
|
|
1018
1019
|
onChange: t
|
|
1019
1020
|
})]
|
|
1020
1021
|
})]
|
|
1021
1022
|
});
|
|
1022
1023
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let [r, i] = T.useState(!1), [a, o] = T.useState(null),
|
|
1024
|
+
function ft({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
1025
|
+
let [r, i] = T.useState(!1), [a, o] = T.useState(null), s = T.useMemo(() => lt(), []), l = (n) => {
|
|
1025
1026
|
e(n), t();
|
|
1026
1027
|
};
|
|
1027
1028
|
return r ? /* @__PURE__ */ j("div", {
|
|
@@ -1033,12 +1034,12 @@ function dt({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
1033
1034
|
children: [/* @__PURE__ */ A("p", {
|
|
1034
1035
|
className: "text-body-sm font-medium text-surface-fg",
|
|
1035
1036
|
children: "Pick date & time"
|
|
1036
|
-
}), /* @__PURE__ */ A(
|
|
1037
|
+
}), /* @__PURE__ */ A(u, {
|
|
1037
1038
|
variant: "ghost",
|
|
1038
1039
|
size: "icon-xs",
|
|
1039
1040
|
onClick: () => i(!1),
|
|
1040
1041
|
"aria-label": "Back to presets",
|
|
1041
|
-
children: /* @__PURE__ */ A(
|
|
1042
|
+
children: /* @__PURE__ */ A(c, {
|
|
1042
1043
|
icon: L,
|
|
1043
1044
|
size: "sm"
|
|
1044
1045
|
})
|
|
@@ -1051,7 +1052,7 @@ function dt({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
1051
1052
|
}),
|
|
1052
1053
|
/* @__PURE__ */ A("div", {
|
|
1053
1054
|
className: "mt-ds-03 flex justify-end",
|
|
1054
|
-
children: /* @__PURE__ */ A(
|
|
1055
|
+
children: /* @__PURE__ */ A(u, {
|
|
1055
1056
|
variant: "solid",
|
|
1056
1057
|
size: "sm",
|
|
1057
1058
|
onClick: () => {
|
|
@@ -1070,34 +1071,34 @@ function dt({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
1070
1071
|
className: "px-ds-03 py-ds-01 text-caption font-medium text-surface-fg-subtle",
|
|
1071
1072
|
children: "Schedule send"
|
|
1072
1073
|
}),
|
|
1073
|
-
|
|
1074
|
+
s.map((e, t) => /* @__PURE__ */ j(u, {
|
|
1074
1075
|
variant: "ghost",
|
|
1075
1076
|
fullWidth: !0,
|
|
1076
|
-
onClick: () =>
|
|
1077
|
-
children: [/* @__PURE__ */ A(
|
|
1078
|
-
icon:
|
|
1077
|
+
onClick: () => l(e.date),
|
|
1078
|
+
children: [/* @__PURE__ */ A(c, {
|
|
1079
|
+
icon: se,
|
|
1079
1080
|
size: "sm",
|
|
1080
1081
|
className: "shrink-0 text-surface-fg-muted"
|
|
1081
1082
|
}), e.label]
|
|
1082
1083
|
}, t)),
|
|
1083
1084
|
/* @__PURE__ */ A("div", { className: "mx-ds-02 my-ds-02 h-px bg-surface-border" }),
|
|
1084
|
-
/* @__PURE__ */ j(
|
|
1085
|
+
/* @__PURE__ */ j(u, {
|
|
1085
1086
|
variant: "ghost",
|
|
1086
1087
|
fullWidth: !0,
|
|
1087
1088
|
onClick: () => i(!0),
|
|
1088
|
-
children: [/* @__PURE__ */ A(
|
|
1089
|
+
children: [/* @__PURE__ */ A(c, {
|
|
1089
1090
|
icon: N,
|
|
1090
1091
|
size: "sm",
|
|
1091
1092
|
className: "shrink-0 text-accent-11"
|
|
1092
1093
|
}), "Pick date & time..."]
|
|
1093
1094
|
}),
|
|
1094
|
-
n && /* @__PURE__ */ j(
|
|
1095
|
+
n && /* @__PURE__ */ j(u, {
|
|
1095
1096
|
variant: "ghost",
|
|
1096
1097
|
fullWidth: !0,
|
|
1097
1098
|
onClick: () => {
|
|
1098
1099
|
n(), t();
|
|
1099
1100
|
},
|
|
1100
|
-
children: [/* @__PURE__ */ A(
|
|
1101
|
+
children: [/* @__PURE__ */ A(c, {
|
|
1101
1102
|
icon: N,
|
|
1102
1103
|
size: "sm",
|
|
1103
1104
|
className: "shrink-0 text-surface-fg-muted"
|
|
@@ -1106,29 +1107,29 @@ function dt({ onSchedule: e, onClose: t, onOpenDialog: n }) {
|
|
|
1106
1107
|
]
|
|
1107
1108
|
});
|
|
1108
1109
|
}
|
|
1109
|
-
function
|
|
1110
|
+
function pt({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
|
|
1110
1111
|
let [i, a] = T.useState(r ?? null);
|
|
1111
1112
|
return T.useEffect(() => {
|
|
1112
1113
|
e && a(r ?? null);
|
|
1113
|
-
}, [e, r]), /* @__PURE__ */ A(
|
|
1114
|
+
}, [e, r]), /* @__PURE__ */ A(d, {
|
|
1114
1115
|
open: e,
|
|
1115
1116
|
onOpenChange: t,
|
|
1116
|
-
children: /* @__PURE__ */ j(
|
|
1117
|
+
children: /* @__PURE__ */ j(f, {
|
|
1117
1118
|
className: "sm:max-w-[380px]",
|
|
1118
1119
|
children: [
|
|
1119
|
-
/* @__PURE__ */ A(
|
|
1120
|
-
/* @__PURE__ */ A(
|
|
1120
|
+
/* @__PURE__ */ A(m, { children: /* @__PURE__ */ A(h, { children: r ? "Reschedule message" : "Schedule send" }) }),
|
|
1121
|
+
/* @__PURE__ */ A(dt, {
|
|
1121
1122
|
value: i,
|
|
1122
1123
|
onChange: a,
|
|
1123
1124
|
minDate: /* @__PURE__ */ new Date()
|
|
1124
1125
|
}),
|
|
1125
|
-
/* @__PURE__ */ j(
|
|
1126
|
+
/* @__PURE__ */ j(p, {
|
|
1126
1127
|
className: "gap-ds-02",
|
|
1127
|
-
children: [/* @__PURE__ */ A(
|
|
1128
|
+
children: [/* @__PURE__ */ A(u, {
|
|
1128
1129
|
variant: "soft",
|
|
1129
1130
|
onClick: () => t(!1),
|
|
1130
1131
|
children: "Cancel"
|
|
1131
|
-
}), /* @__PURE__ */ A(
|
|
1132
|
+
}), /* @__PURE__ */ A(u, {
|
|
1132
1133
|
variant: "solid",
|
|
1133
1134
|
onClick: () => {
|
|
1134
1135
|
i && i > /* @__PURE__ */ new Date() && (n(i), t(!1));
|
|
@@ -1154,8 +1155,8 @@ function Z(e) {
|
|
|
1154
1155
|
day: "numeric"
|
|
1155
1156
|
})} at ${a}`;
|
|
1156
1157
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return /* @__PURE__ */ A(
|
|
1158
|
+
function mt({ date: e, onClear: t, onEdit: n }) {
|
|
1159
|
+
return /* @__PURE__ */ A(a, { children: /* @__PURE__ */ A(R.div, {
|
|
1159
1160
|
initial: {
|
|
1160
1161
|
height: 0,
|
|
1161
1162
|
opacity: 0
|
|
@@ -1173,8 +1174,8 @@ function pt({ date: e, onClear: t, onEdit: n }) {
|
|
|
1173
1174
|
children: /* @__PURE__ */ j("div", {
|
|
1174
1175
|
className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b text-body-xs text-accent-11 bg-accent-2 border-b border-accent-4",
|
|
1175
1176
|
children: [
|
|
1176
|
-
/* @__PURE__ */ A(
|
|
1177
|
-
icon:
|
|
1177
|
+
/* @__PURE__ */ A(c, {
|
|
1178
|
+
icon: se,
|
|
1178
1179
|
size: "xs",
|
|
1179
1180
|
className: "shrink-0"
|
|
1180
1181
|
}),
|
|
@@ -1182,38 +1183,38 @@ function pt({ date: e, onClear: t, onEdit: n }) {
|
|
|
1182
1183
|
className: "min-w-0 flex-1 truncate",
|
|
1183
1184
|
children: ["Scheduled for ", Z(e)]
|
|
1184
1185
|
}),
|
|
1185
|
-
n && /* @__PURE__ */ A(
|
|
1186
|
+
n && /* @__PURE__ */ A(u, {
|
|
1186
1187
|
variant: "soft",
|
|
1187
1188
|
size: "icon-xs",
|
|
1188
1189
|
className: "shrink-0",
|
|
1189
1190
|
onClick: n,
|
|
1190
1191
|
"aria-label": "Edit schedule",
|
|
1191
|
-
children: /* @__PURE__ */ A(
|
|
1192
|
-
icon:
|
|
1192
|
+
children: /* @__PURE__ */ A(c, {
|
|
1193
|
+
icon: ge,
|
|
1193
1194
|
size: "xs"
|
|
1194
1195
|
})
|
|
1195
1196
|
}),
|
|
1196
|
-
/* @__PURE__ */ A(
|
|
1197
|
+
/* @__PURE__ */ A(u, {
|
|
1197
1198
|
variant: "soft",
|
|
1198
1199
|
size: "icon-xs",
|
|
1199
1200
|
className: "shrink-0",
|
|
1200
1201
|
onClick: t,
|
|
1201
1202
|
"aria-label": "Cancel schedule",
|
|
1202
|
-
children: /* @__PURE__ */ A(
|
|
1203
|
+
children: /* @__PURE__ */ A(c, {
|
|
1203
1204
|
icon: L,
|
|
1204
1205
|
size: "xs"
|
|
1205
1206
|
})
|
|
1206
1207
|
})
|
|
1207
1208
|
]
|
|
1208
1209
|
})
|
|
1209
|
-
});
|
|
1210
|
+
}) });
|
|
1210
1211
|
}
|
|
1211
1212
|
//#endregion
|
|
1212
1213
|
//#region src/composed/rich-chat-input/use-voice-recorder.ts
|
|
1213
|
-
function
|
|
1214
|
+
function ht() {
|
|
1214
1215
|
return typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "";
|
|
1215
1216
|
}
|
|
1216
|
-
function
|
|
1217
|
+
function gt(e) {
|
|
1217
1218
|
let { maxDuration: t, onComplete: n } = e, [r, i] = k("idle"), [a, o] = k(0), [s, c] = k(null), [l, u] = k([]), d = O(null), f = O(null), p = O(null), m = O([]), h = O(null), g = O(null), _ = O(null), v = O(null), y = O(0), b = O([]), x = O(!1), ee = O(n);
|
|
1218
1219
|
ee.current = n;
|
|
1219
1220
|
let S = E(() => {
|
|
@@ -1222,7 +1223,7 @@ function ht(e) {
|
|
|
1222
1223
|
if (typeof MediaRecorder > "u") throw Error("MediaRecorder is not supported in this browser. Voice recording requires a modern browser with MediaRecorder support.");
|
|
1223
1224
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
1224
1225
|
p.current = e;
|
|
1225
|
-
let n =
|
|
1226
|
+
let n = ht(), r = n ? new MediaRecorder(e, { mimeType: n }) : new MediaRecorder(e);
|
|
1226
1227
|
d.current = r, m.current = [], x.current = !1;
|
|
1227
1228
|
let a = new AudioContext();
|
|
1228
1229
|
f.current = a;
|
|
@@ -1250,13 +1251,13 @@ function ht(e) {
|
|
|
1250
1251
|
}, 100), t !== void 0 && t > 0 && (_.current = setTimeout(() => {
|
|
1251
1252
|
d.current && d.current.state !== "inactive" && d.current.stop();
|
|
1252
1253
|
}, t * 1e3)), i("recording");
|
|
1253
|
-
}, [t, S]),
|
|
1254
|
+
}, [t, S]), te = E(() => {
|
|
1254
1255
|
d.current && d.current.state !== "inactive" && (x.current = !1, d.current.stop());
|
|
1255
|
-
}, []),
|
|
1256
|
+
}, []), w = E(() => {
|
|
1256
1257
|
d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (S(), i("idle"), o(0), u([]));
|
|
1257
|
-
}, [S]),
|
|
1258
|
+
}, [S]), T = E(() => {
|
|
1258
1259
|
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"));
|
|
1259
|
-
}, []),
|
|
1260
|
+
}, []), ne = E(() => {
|
|
1260
1261
|
if (d.current && d.current.state === "paused") {
|
|
1261
1262
|
d.current.resume(), h.current = setInterval(() => {
|
|
1262
1263
|
y.current += 1, o((e) => e + 1);
|
|
@@ -1281,15 +1282,15 @@ function ht(e) {
|
|
|
1281
1282
|
analyserNode: s,
|
|
1282
1283
|
waveformData: l,
|
|
1283
1284
|
start: C,
|
|
1284
|
-
stop:
|
|
1285
|
-
cancel:
|
|
1286
|
-
pause:
|
|
1287
|
-
resume:
|
|
1285
|
+
stop: te,
|
|
1286
|
+
cancel: w,
|
|
1287
|
+
pause: T,
|
|
1288
|
+
resume: ne
|
|
1288
1289
|
};
|
|
1289
1290
|
}
|
|
1290
1291
|
//#endregion
|
|
1291
1292
|
//#region src/composed/rich-chat-input.tsx
|
|
1292
|
-
var
|
|
1293
|
+
var _t = {
|
|
1293
1294
|
compact: {
|
|
1294
1295
|
minHeight: 44,
|
|
1295
1296
|
maxHeight: 256,
|
|
@@ -1314,7 +1315,7 @@ var gt = {
|
|
|
1314
1315
|
showToolbar: !1,
|
|
1315
1316
|
toolbarPosition: "top"
|
|
1316
1317
|
}
|
|
1317
|
-
},
|
|
1318
|
+
}, vt = [
|
|
1318
1319
|
"prose prose-sm max-w-none focus:outline-hidden",
|
|
1319
1320
|
"font-body text-body-md leading-relaxed text-surface-fg",
|
|
1320
1321
|
"[&_p.is-editor-empty:first-child]:relative",
|
|
@@ -1323,13 +1324,13 @@ var gt = {
|
|
|
1323
1324
|
"[&_p:last-child]:mb-0",
|
|
1324
1325
|
"[&_ul]:ml-ds-04 [&_ul]:list-disc [&_ol]:ml-ds-04 [&_ol]:list-decimal",
|
|
1325
1326
|
"[&_li]:text-surface-fg",
|
|
1326
|
-
"[&_code]:rounded [&_code]:bg-surface-
|
|
1327
|
+
"[&_code]:rounded [&_code]:bg-surface-panel [&_code]:px-ds-02 [&_code]:py-[1px] [&_code]:text-body-md [&_code]:text-accent-11",
|
|
1327
1328
|
"[&_strong]:font-semibold [&_strong]:text-surface-fg",
|
|
1328
1329
|
"[&_mark]:rounded-xs [&_mark]:bg-warning-3 [&_mark]:px-[2px]",
|
|
1329
1330
|
"[&_a]:text-accent-11 [&_a]:underline",
|
|
1330
|
-
|
|
1331
|
+
b
|
|
1331
1332
|
].join(" ");
|
|
1332
|
-
function
|
|
1333
|
+
function yt({ options: e }) {
|
|
1333
1334
|
let [t, n] = T.useState(!1), r = T.useRef(null);
|
|
1334
1335
|
return T.useEffect(() => {
|
|
1335
1336
|
if (!t) return;
|
|
@@ -1346,9 +1347,9 @@ function vt({ options: e }) {
|
|
|
1346
1347
|
title: "More send options",
|
|
1347
1348
|
"aria-label": "More send options",
|
|
1348
1349
|
"aria-expanded": t,
|
|
1349
|
-
className:
|
|
1350
|
-
children: /* @__PURE__ */ A(
|
|
1351
|
-
icon:
|
|
1350
|
+
className: o("inline-flex h-ds-xs-plus w-5 items-center justify-center rounded-control touch-target", "text-surface-fg-subtle hover:bg-surface-panel-hover hover:text-surface-fg", "transition-colors duration-fast-01 ease-productive-standard", t && "bg-surface-panel-hover text-surface-fg"),
|
|
1351
|
+
children: /* @__PURE__ */ A(c, {
|
|
1352
|
+
icon: oe,
|
|
1352
1353
|
size: "xs"
|
|
1353
1354
|
})
|
|
1354
1355
|
}), t && /* @__PURE__ */ j("div", {
|
|
@@ -1361,14 +1362,14 @@ function vt({ options: e }) {
|
|
|
1361
1362
|
onClick: () => {
|
|
1362
1363
|
e.onSelect(), n(!1);
|
|
1363
1364
|
},
|
|
1364
|
-
className: "flex w-full items-center gap-ds-03 rounded-control px-ds-03 py-ds-02 text-body-sm text-surface-fg hover:bg-surface-
|
|
1365
|
+
className: "flex w-full items-center gap-ds-03 rounded-control px-ds-03 py-ds-02 text-body-sm text-surface-fg hover:bg-surface-panel-hover transition-colors duration-fast-01",
|
|
1365
1366
|
children: [e.icon && /* @__PURE__ */ A(e.icon, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }), e.label]
|
|
1366
1367
|
}, t))]
|
|
1367
1368
|
})]
|
|
1368
1369
|
});
|
|
1369
1370
|
}
|
|
1370
|
-
var
|
|
1371
|
-
function
|
|
1371
|
+
var bt = T.lazy(() => import("./emoji-picker.js").then((e) => ({ default: e.EmojiPicker })));
|
|
1372
|
+
function xt({ onSelect: e, onClose: t }) {
|
|
1372
1373
|
let n = T.useRef(null);
|
|
1373
1374
|
T.useEffect(() => {
|
|
1374
1375
|
let e = (e) => {
|
|
@@ -1392,7 +1393,7 @@ function bt({ onSelect: e, onClose: t }) {
|
|
|
1392
1393
|
ref: n,
|
|
1393
1394
|
children: /* @__PURE__ */ A(T.Suspense, {
|
|
1394
1395
|
fallback: r,
|
|
1395
|
-
children: /* @__PURE__ */ A(
|
|
1396
|
+
children: /* @__PURE__ */ A(bt, { onSelect: e })
|
|
1396
1397
|
})
|
|
1397
1398
|
});
|
|
1398
1399
|
}
|
|
@@ -1403,12 +1404,12 @@ function Q({ onClick: e, isActive: t = !1, title: n, children: r }) {
|
|
|
1403
1404
|
title: n,
|
|
1404
1405
|
"aria-label": n,
|
|
1405
1406
|
"aria-pressed": t,
|
|
1406
|
-
className:
|
|
1407
|
+
className: o("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-control touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-panel-hover", t ? "bg-surface-panel-hover text-accent-11" : "text-surface-fg-subtle"),
|
|
1407
1408
|
children: r
|
|
1408
1409
|
});
|
|
1409
1410
|
}
|
|
1410
|
-
function
|
|
1411
|
-
let t =
|
|
1411
|
+
function St({ editor: e }) {
|
|
1412
|
+
let t = z({
|
|
1412
1413
|
editor: e,
|
|
1413
1414
|
selector: ({ editor: e }) => ({
|
|
1414
1415
|
isBold: e.isActive("bold"),
|
|
@@ -1419,7 +1420,7 @@ function xt({ editor: e }) {
|
|
|
1419
1420
|
isCode: e.isActive("code")
|
|
1420
1421
|
})
|
|
1421
1422
|
});
|
|
1422
|
-
return /* @__PURE__ */ j(
|
|
1423
|
+
return /* @__PURE__ */ j(Fe, {
|
|
1423
1424
|
editor: e,
|
|
1424
1425
|
className: "flex gap-ds-01 rounded-surface bg-surface-overlay p-ds-02 shadow-floating",
|
|
1425
1426
|
children: [
|
|
@@ -1427,8 +1428,8 @@ function xt({ editor: e }) {
|
|
|
1427
1428
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
1428
1429
|
isActive: t.isBold,
|
|
1429
1430
|
title: "Bold",
|
|
1430
|
-
children: /* @__PURE__ */ A(
|
|
1431
|
-
icon:
|
|
1431
|
+
children: /* @__PURE__ */ A(c, {
|
|
1432
|
+
icon: ae,
|
|
1432
1433
|
size: "xs"
|
|
1433
1434
|
})
|
|
1434
1435
|
}),
|
|
@@ -1436,8 +1437,8 @@ function xt({ editor: e }) {
|
|
|
1436
1437
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
1437
1438
|
isActive: t.isItalic,
|
|
1438
1439
|
title: "Italic",
|
|
1439
|
-
children: /* @__PURE__ */ A(
|
|
1440
|
-
icon:
|
|
1440
|
+
children: /* @__PURE__ */ A(c, {
|
|
1441
|
+
icon: de,
|
|
1441
1442
|
size: "xs"
|
|
1442
1443
|
})
|
|
1443
1444
|
}),
|
|
@@ -1445,7 +1446,7 @@ function xt({ editor: e }) {
|
|
|
1445
1446
|
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
1446
1447
|
isActive: t.isUnderline,
|
|
1447
1448
|
title: "Underline",
|
|
1448
|
-
children: /* @__PURE__ */ A(
|
|
1449
|
+
children: /* @__PURE__ */ A(c, {
|
|
1449
1450
|
icon: I,
|
|
1450
1451
|
size: "xs"
|
|
1451
1452
|
})
|
|
@@ -1454,7 +1455,7 @@ function xt({ editor: e }) {
|
|
|
1454
1455
|
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
1455
1456
|
isActive: t.isStrike,
|
|
1456
1457
|
title: "Strikethrough",
|
|
1457
|
-
children: /* @__PURE__ */ A(
|
|
1458
|
+
children: /* @__PURE__ */ A(c, {
|
|
1458
1459
|
icon: F,
|
|
1459
1460
|
size: "xs"
|
|
1460
1461
|
})
|
|
@@ -1463,8 +1464,8 @@ function xt({ editor: e }) {
|
|
|
1463
1464
|
onClick: () => e.chain().focus().toggleHighlight().run(),
|
|
1464
1465
|
isActive: t.isHighlight,
|
|
1465
1466
|
title: "Highlight",
|
|
1466
|
-
children: /* @__PURE__ */ A(
|
|
1467
|
-
icon:
|
|
1467
|
+
children: /* @__PURE__ */ A(c, {
|
|
1468
|
+
icon: ue,
|
|
1468
1469
|
size: "xs"
|
|
1469
1470
|
})
|
|
1470
1471
|
}),
|
|
@@ -1472,19 +1473,19 @@ function xt({ editor: e }) {
|
|
|
1472
1473
|
onClick: () => e.chain().focus().toggleCode().run(),
|
|
1473
1474
|
isActive: t.isCode,
|
|
1474
1475
|
title: "Code",
|
|
1475
|
-
children: /* @__PURE__ */ A(
|
|
1476
|
-
icon:
|
|
1476
|
+
children: /* @__PURE__ */ A(c, {
|
|
1477
|
+
icon: ce,
|
|
1477
1478
|
size: "xs"
|
|
1478
1479
|
})
|
|
1479
1480
|
})
|
|
1480
1481
|
]
|
|
1481
1482
|
});
|
|
1482
1483
|
}
|
|
1483
|
-
var
|
|
1484
|
-
let [F, I] = T.useState("idle"), [L,
|
|
1484
|
+
var Ct = T.forwardRef(function({ onSubmit: s, placeholder: d = "Type a message...", disabled: f = !1, content: p = "", variant: m = "compact", enterBehavior: h = "send", maxLength: _, charCountDisplay: v = "near-limit", mentions: y, onMentionSearch: b, onMentionSelect: te, onFileUpload: w, onImageUpload: E, slashCommands: D, onVoiceRecord: O, onTranscribe: k, maxDuration: ne, replyTo: ie, onTyping: M, onEmpty: ae, isStreaming: N = !1, onCancel: oe, leadingSlot: ce, trailingSlot: le, disclaimer: ue, toolbar: de = !0, sendOptions: fe, onSchedule: P, actionButton: pe, emojiSet: ge = "native", className: _e, ...ve }, xe) {
|
|
1485
|
+
let [F, I] = T.useState("idle"), [L, Ee] = T.useState(!1), [Fe, Le] = T.useState(!1), [B, Re] = T.useState(null), [ze, V] = T.useState(!1), [Be, He] = T.useState(!1), [H, We] = T.useState(0), Ge = T.useRef(null), qe = T.useRef(null);
|
|
1485
1486
|
T.useEffect(() => {
|
|
1486
|
-
if (!
|
|
1487
|
-
let i =
|
|
1487
|
+
if (!Fe || !Ge.current || !qe.current) return;
|
|
1488
|
+
let i = Ge.current, a = qe.current, o = () => {
|
|
1488
1489
|
e(i, a, {
|
|
1489
1490
|
placement: "top-end",
|
|
1490
1491
|
middleware: [
|
|
@@ -1502,17 +1503,17 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1502
1503
|
return o(), window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
|
|
1503
1504
|
window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
|
|
1504
1505
|
};
|
|
1505
|
-
}, [
|
|
1506
|
-
let [
|
|
1507
|
-
|
|
1508
|
-
let
|
|
1509
|
-
|
|
1510
|
-
let
|
|
1511
|
-
|
|
1512
|
-
let
|
|
1513
|
-
|
|
1514
|
-
let
|
|
1515
|
-
maxDuration:
|
|
1506
|
+
}, [Fe]);
|
|
1507
|
+
let [U, W] = T.useState([]), [G, K] = T.useState(null), [Je, Ye] = T.useState(!1), Xe = T.useRef(null), Ze = T.useRef(null), Qe = T.useRef(void 0), $e = T.useRef(void 0), et = T.useRef(h);
|
|
1508
|
+
et.current = h;
|
|
1509
|
+
let tt = T.useRef(te);
|
|
1510
|
+
tt.current = te;
|
|
1511
|
+
let nt = T.useRef(y);
|
|
1512
|
+
nt.current = y;
|
|
1513
|
+
let q = T.useRef(b);
|
|
1514
|
+
q.current = b;
|
|
1515
|
+
let rt = l(), J = _t[m], it = J.maxHeight, Y = gt({
|
|
1516
|
+
maxDuration: ne,
|
|
1516
1517
|
onComplete: async (e, t, n) => {
|
|
1517
1518
|
if (O?.(e, t), k) {
|
|
1518
1519
|
let n = await k(e, t);
|
|
@@ -1521,23 +1522,23 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1521
1522
|
return;
|
|
1522
1523
|
}
|
|
1523
1524
|
}
|
|
1524
|
-
|
|
1525
|
+
K({
|
|
1525
1526
|
blob: e,
|
|
1526
1527
|
duration: t,
|
|
1527
1528
|
waveformData: n
|
|
1528
1529
|
}), I("review");
|
|
1529
1530
|
}
|
|
1530
|
-
}),
|
|
1531
|
+
}), ot = T.useCallback(() => {
|
|
1531
1532
|
Y.start(), I("recording");
|
|
1532
|
-
}, [Y]), ct = T.useCallback(() => {
|
|
1533
|
-
Y.stop();
|
|
1534
1533
|
}, [Y]), lt = T.useCallback(() => {
|
|
1534
|
+
Y.stop();
|
|
1535
|
+
}, [Y]), ut = T.useCallback(() => {
|
|
1535
1536
|
Y.cancel(), I("idle");
|
|
1536
|
-
}, [Y]), X =
|
|
1537
|
+
}, [Y]), X = Pe({
|
|
1537
1538
|
immediatelyRender: !1,
|
|
1538
1539
|
extensions: T.useMemo(() => {
|
|
1539
1540
|
let e = [
|
|
1540
|
-
|
|
1541
|
+
Ie.configure({
|
|
1541
1542
|
heading: !1,
|
|
1542
1543
|
horizontalRule: !1,
|
|
1543
1544
|
codeBlock: !1,
|
|
@@ -1547,98 +1548,98 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1547
1548
|
HTMLAttributes: { class: "text-accent-11 underline" }
|
|
1548
1549
|
}
|
|
1549
1550
|
}),
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1551
|
+
je.configure({ placeholder: d }),
|
|
1552
|
+
De.configure({ multicolor: !1 }),
|
|
1553
|
+
Oe,
|
|
1554
|
+
Ae.configure({ limit: _ || void 0 }),
|
|
1555
|
+
S,
|
|
1556
|
+
x,
|
|
1557
|
+
ee(),
|
|
1558
|
+
Ne.create({
|
|
1558
1559
|
name: "enterToSend",
|
|
1559
1560
|
addKeyboardShortcuts() {
|
|
1560
1561
|
return {
|
|
1561
|
-
Enter: () =>
|
|
1562
|
-
"Shift-Enter": () =>
|
|
1563
|
-
"Mod-Enter": () => (
|
|
1562
|
+
Enter: () => et.current === "send" ? ($e.current?.(), !0) : !1,
|
|
1563
|
+
"Shift-Enter": () => et.current === "send" ? (this.editor.commands.splitBlock(), !0) : !1,
|
|
1564
|
+
"Mod-Enter": () => ($e.current?.(), !0)
|
|
1564
1565
|
};
|
|
1565
1566
|
}
|
|
1566
1567
|
})
|
|
1567
1568
|
];
|
|
1568
|
-
return (
|
|
1569
|
+
return (y || b) && e.push(ke.configure({
|
|
1569
1570
|
HTMLAttributes: { class: "mention" },
|
|
1570
1571
|
suggestion: {
|
|
1571
1572
|
items: async ({ query: e }) => {
|
|
1572
|
-
if (
|
|
1573
|
-
let t =
|
|
1573
|
+
if (q.current) return await q.current(e);
|
|
1574
|
+
let t = nt.current;
|
|
1574
1575
|
return t ? t.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [];
|
|
1575
1576
|
},
|
|
1576
|
-
render:
|
|
1577
|
+
render: C((e) => tt.current?.(e))
|
|
1577
1578
|
}
|
|
1578
|
-
})), D && e.push(
|
|
1579
|
+
})), D && e.push(Ve(D)), e;
|
|
1579
1580
|
}, [
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
!!v,
|
|
1581
|
+
d,
|
|
1582
|
+
_,
|
|
1583
|
+
ge,
|
|
1584
1584
|
!!y,
|
|
1585
|
+
!!b,
|
|
1585
1586
|
!!D
|
|
1586
1587
|
]),
|
|
1587
|
-
content:
|
|
1588
|
-
editable: !
|
|
1588
|
+
content: p || void 0,
|
|
1589
|
+
editable: !f,
|
|
1589
1590
|
editorProps: {
|
|
1590
|
-
attributes: { class:
|
|
1591
|
+
attributes: { class: vt },
|
|
1591
1592
|
handlePaste: (e, t) => {
|
|
1592
1593
|
let n = Array.from(t.clipboardData?.files ?? []);
|
|
1593
1594
|
return n.length > 0 ? (n.forEach(Z), !0) : !1;
|
|
1594
1595
|
}
|
|
1595
1596
|
}
|
|
1596
|
-
}),
|
|
1597
|
+
}), dt = T.useCallback(() => {
|
|
1597
1598
|
if (!X) return;
|
|
1598
|
-
let e = !X.isEmpty, t =
|
|
1599
|
+
let e = !X.isEmpty, t = U.length > 0, n = !!G;
|
|
1599
1600
|
if (!e && !t && !n || N) return;
|
|
1600
1601
|
let r = {
|
|
1601
1602
|
html: e ? X.getHTML() : "",
|
|
1602
1603
|
plainText: e ? X.getText() : ""
|
|
1603
1604
|
};
|
|
1604
|
-
t && (r.attachments =
|
|
1605
|
+
t && (r.attachments = U.filter((e) => !e.uploading && e.url).map((e) => ({
|
|
1605
1606
|
url: e.url,
|
|
1606
1607
|
name: e.name,
|
|
1607
1608
|
size: e.size,
|
|
1608
1609
|
type: e.type
|
|
1609
1610
|
}))), n && (r.voiceNote = {
|
|
1610
|
-
blob:
|
|
1611
|
-
duration:
|
|
1612
|
-
}),
|
|
1611
|
+
blob: G.blob,
|
|
1612
|
+
duration: G.duration
|
|
1613
|
+
}), B && P ? P(r, B) : s(r), X.commands.clearContent(), W([]), K(null), Re(null), I("idle");
|
|
1613
1614
|
}, [
|
|
1614
1615
|
X,
|
|
1615
|
-
|
|
1616
|
-
|
|
1616
|
+
U,
|
|
1617
|
+
G,
|
|
1617
1618
|
N,
|
|
1618
|
-
|
|
1619
|
+
s,
|
|
1619
1620
|
P,
|
|
1620
|
-
|
|
1621
|
+
B
|
|
1621
1622
|
]);
|
|
1622
|
-
|
|
1623
|
-
if (!X || !
|
|
1623
|
+
$e.current = dt, T.useEffect(() => {
|
|
1624
|
+
if (!X || !M) return;
|
|
1624
1625
|
let e = () => {
|
|
1625
|
-
|
|
1626
|
+
M(!0), clearTimeout(Qe.current), Qe.current = setTimeout(() => M(!1), 2e3);
|
|
1626
1627
|
};
|
|
1627
1628
|
return X.on("update", e), () => {
|
|
1628
|
-
X.off("update", e), clearTimeout(
|
|
1629
|
+
X.off("update", e), clearTimeout(Qe.current);
|
|
1629
1630
|
};
|
|
1630
|
-
}, [X,
|
|
1631
|
-
if (!X || !
|
|
1631
|
+
}, [X, M]), T.useEffect(() => {
|
|
1632
|
+
if (!X || !ae) return;
|
|
1632
1633
|
let e = () => {
|
|
1633
|
-
|
|
1634
|
+
ae(X.isEmpty);
|
|
1634
1635
|
};
|
|
1635
1636
|
return X.on("update", e), e(), () => {
|
|
1636
1637
|
X.off("update", e);
|
|
1637
1638
|
};
|
|
1638
|
-
}, [X,
|
|
1639
|
+
}, [X, ae]);
|
|
1639
1640
|
let Z = T.useCallback(async (e) => {
|
|
1640
1641
|
let t = Math.random().toString(36).slice(2), n = e.type.startsWith("image/");
|
|
1641
|
-
|
|
1642
|
+
W((r) => [...r, {
|
|
1642
1643
|
id: t,
|
|
1643
1644
|
name: e.name,
|
|
1644
1645
|
size: e.size,
|
|
@@ -1648,14 +1649,14 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1648
1649
|
try {
|
|
1649
1650
|
if (n && E) {
|
|
1650
1651
|
let n = await E(e);
|
|
1651
|
-
|
|
1652
|
+
W((e) => e.map((e) => e.id === t ? {
|
|
1652
1653
|
...e,
|
|
1653
1654
|
url: n,
|
|
1654
1655
|
uploading: !1
|
|
1655
1656
|
} : e));
|
|
1656
1657
|
} else if (w) {
|
|
1657
1658
|
let n = await w(e);
|
|
1658
|
-
|
|
1659
|
+
W((e) => e.map((e) => e.id === t ? {
|
|
1659
1660
|
...e,
|
|
1660
1661
|
url: n.url,
|
|
1661
1662
|
name: n.name,
|
|
@@ -1664,24 +1665,24 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1664
1665
|
} : e));
|
|
1665
1666
|
} else if (n) {
|
|
1666
1667
|
let n = URL.createObjectURL(e);
|
|
1667
|
-
|
|
1668
|
+
W((e) => e.map((e) => e.id === t ? {
|
|
1668
1669
|
...e,
|
|
1669
1670
|
url: n,
|
|
1670
1671
|
uploading: !1
|
|
1671
1672
|
} : e));
|
|
1672
|
-
} else
|
|
1673
|
+
} else W((e) => e.filter((e) => e.id !== t));
|
|
1673
1674
|
} catch {
|
|
1674
|
-
|
|
1675
|
+
W((e) => e.filter((e) => e.id !== t));
|
|
1675
1676
|
}
|
|
1676
|
-
}, [w, E]),
|
|
1677
|
-
|
|
1678
|
-
}, []),
|
|
1679
|
-
e.preventDefault(),
|
|
1677
|
+
}, [w, E]), ht = T.useCallback((e) => {
|
|
1678
|
+
W((t) => t.filter((t) => t.id !== e));
|
|
1679
|
+
}, []), bt = T.useCallback((e) => {
|
|
1680
|
+
e.preventDefault(), Ye(!1), Array.from(e.dataTransfer.files).forEach(Z);
|
|
1680
1681
|
}, [Z]), Q = T.useCallback((e) => {
|
|
1681
1682
|
Array.from(e.target.files || []).forEach(Z), e.target.value = "";
|
|
1682
|
-
}, [Z]),
|
|
1683
|
-
|
|
1684
|
-
}, []),
|
|
1683
|
+
}, [Z]), Ct = T.useCallback(() => {
|
|
1684
|
+
K(null), I("idle");
|
|
1685
|
+
}, []), wt = z({
|
|
1685
1686
|
editor: X,
|
|
1686
1687
|
selector: ({ editor: e }) => e ? { editorIsEmpty: e.isEmpty } : null
|
|
1687
1688
|
})?.editorIsEmpty ?? !0;
|
|
@@ -1689,126 +1690,126 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1689
1690
|
if (!X) return;
|
|
1690
1691
|
let e = () => {
|
|
1691
1692
|
let e = X.state.doc.textBetween(0, X.state.doc.content.size, void 0, " ");
|
|
1692
|
-
|
|
1693
|
+
We(e.length);
|
|
1693
1694
|
};
|
|
1694
1695
|
return e(), X.on("update", e), () => {
|
|
1695
1696
|
X.off("update", e);
|
|
1696
1697
|
};
|
|
1697
1698
|
}, [X]);
|
|
1698
|
-
let
|
|
1699
|
-
return /* @__PURE__ */ j("div", {
|
|
1700
|
-
ref:
|
|
1701
|
-
className:
|
|
1702
|
-
...
|
|
1699
|
+
let Tt = !wt || U.length > 0 || !!G, Et = L || F === "review" || m === "expanded", $ = "icon-md";
|
|
1700
|
+
return /* @__PURE__ */ A(a, { children: /* @__PURE__ */ j("div", {
|
|
1701
|
+
ref: xe,
|
|
1702
|
+
className: o("border-t border-surface-border-subtle px-ds-05 py-ds-04", "flex items-center gap-ds-03", _e),
|
|
1703
|
+
...ve,
|
|
1703
1704
|
children: [
|
|
1704
|
-
|
|
1705
|
+
pe !== !1 && (pe ?? (w || E ? /* @__PURE__ */ A(u, {
|
|
1705
1706
|
variant: "solid",
|
|
1706
1707
|
size: "icon-md",
|
|
1707
|
-
onClick: () =>
|
|
1708
|
+
onClick: () => Xe.current?.click(),
|
|
1708
1709
|
title: "Attach",
|
|
1709
1710
|
"aria-label": "Attach file",
|
|
1710
1711
|
className: "shrink-0",
|
|
1711
|
-
children: /* @__PURE__ */ A(
|
|
1712
|
-
icon:
|
|
1712
|
+
children: /* @__PURE__ */ A(c, {
|
|
1713
|
+
icon: ye,
|
|
1713
1714
|
size: "md"
|
|
1714
1715
|
})
|
|
1715
1716
|
}) : null)),
|
|
1716
1717
|
/* @__PURE__ */ j("div", {
|
|
1717
1718
|
role: "region",
|
|
1718
1719
|
"aria-label": "Message composer",
|
|
1719
|
-
className:
|
|
1720
|
-
onFocus: () =>
|
|
1720
|
+
className: o("flex-1 min-w-0 overflow-hidden rounded-surface border border-surface-border-interactive bg-surface-panel-hover", "transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard", "hover:bg-surface-panel-active", "focus-within:ring-2 focus-within:ring-accent-9 focus-within:ring-offset-2 focus-within:border-accent-9", F === "recording" && "border-error-7/30", Je && "border-dashed border-accent-7 bg-accent-2", f && "opacity-action-disabled cursor-not-allowed"),
|
|
1721
|
+
onFocus: () => He(!0),
|
|
1721
1722
|
onBlur: (e) => {
|
|
1722
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
1723
|
+
e.currentTarget.contains(e.relatedTarget) || He(!1);
|
|
1723
1724
|
},
|
|
1724
1725
|
onDragOver: (e) => {
|
|
1725
|
-
e.preventDefault(),
|
|
1726
|
+
e.preventDefault(), Ye(!0);
|
|
1726
1727
|
},
|
|
1727
|
-
onDragLeave: () =>
|
|
1728
|
-
onDrop:
|
|
1728
|
+
onDragLeave: () => Ye(!1),
|
|
1729
|
+
onDrop: bt,
|
|
1729
1730
|
children: [
|
|
1730
|
-
|
|
1731
|
-
/* @__PURE__ */ A(
|
|
1732
|
-
author:
|
|
1733
|
-
preview:
|
|
1734
|
-
onDismiss:
|
|
1731
|
+
ce,
|
|
1732
|
+
/* @__PURE__ */ A(Te, { children: ie && /* @__PURE__ */ A(ct, {
|
|
1733
|
+
author: ie.author,
|
|
1734
|
+
preview: ie.preview,
|
|
1735
|
+
onDismiss: ie.onDismiss
|
|
1735
1736
|
}, "reply") }),
|
|
1736
|
-
/* @__PURE__ */ A(
|
|
1737
|
-
date:
|
|
1738
|
-
onEdit: () =>
|
|
1739
|
-
onClear: () =>
|
|
1737
|
+
/* @__PURE__ */ A(Te, { children: B && /* @__PURE__ */ A(mt, {
|
|
1738
|
+
date: B,
|
|
1739
|
+
onEdit: () => V(!0),
|
|
1740
|
+
onClear: () => Re(null)
|
|
1740
1741
|
}, "schedule") }),
|
|
1741
|
-
/* @__PURE__ */ A(
|
|
1742
|
-
attachments:
|
|
1743
|
-
onRemoveAttachment:
|
|
1742
|
+
/* @__PURE__ */ A(Te, { children: U.length > 0 && /* @__PURE__ */ A(Ue, {
|
|
1743
|
+
attachments: U,
|
|
1744
|
+
onRemoveAttachment: ht
|
|
1744
1745
|
}, "attachments") }),
|
|
1745
1746
|
J.toolbarPosition === "top" && X && /* @__PURE__ */ A("div", {
|
|
1746
|
-
className:
|
|
1747
|
+
className: o("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", L ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
|
|
1747
1748
|
children: /* @__PURE__ */ A("div", {
|
|
1748
1749
|
className: "overflow-hidden",
|
|
1749
|
-
children: /* @__PURE__ */ A(
|
|
1750
|
+
children: /* @__PURE__ */ A(at, {
|
|
1750
1751
|
editor: X,
|
|
1751
|
-
toolbar:
|
|
1752
|
+
toolbar: de,
|
|
1752
1753
|
isMobile: !1,
|
|
1753
|
-
hasMentions: !!(
|
|
1754
|
+
hasMentions: !!(y || b),
|
|
1754
1755
|
hasSlashCommands: !!D,
|
|
1755
|
-
disabled:
|
|
1756
|
+
disabled: f
|
|
1756
1757
|
})
|
|
1757
1758
|
})
|
|
1758
1759
|
}),
|
|
1759
1760
|
/* @__PURE__ */ j("div", {
|
|
1760
1761
|
className: "relative",
|
|
1761
|
-
children: [F === "recording" && /* @__PURE__ */ A(
|
|
1762
|
+
children: [F === "recording" && /* @__PURE__ */ A(st, {
|
|
1762
1763
|
duration: Y.duration,
|
|
1763
1764
|
analyserNode: Y.analyserNode,
|
|
1764
|
-
maxDuration:
|
|
1765
|
-
onCancel:
|
|
1765
|
+
maxDuration: ne,
|
|
1766
|
+
onCancel: ut
|
|
1766
1767
|
}), /* @__PURE__ */ j("div", {
|
|
1767
|
-
ref:
|
|
1768
|
-
className:
|
|
1768
|
+
ref: Ze,
|
|
1769
|
+
className: o("flex items-center px-ds-04 py-ds-03 cursor-text [&_.tiptap]:w-full [&_.tiptap]:outline-hidden", F === "recording" && "invisible"),
|
|
1769
1770
|
style: {
|
|
1770
1771
|
minHeight: J.minHeight,
|
|
1771
|
-
maxHeight:
|
|
1772
|
+
maxHeight: it,
|
|
1772
1773
|
overflowY: "auto"
|
|
1773
1774
|
},
|
|
1774
1775
|
onClick: () => X?.commands.focus(),
|
|
1775
1776
|
children: [/* @__PURE__ */ A("div", {
|
|
1776
1777
|
className: "flex-1 min-w-0",
|
|
1777
|
-
children: /* @__PURE__ */ A(
|
|
1778
|
+
children: /* @__PURE__ */ A(Me, { editor: X })
|
|
1778
1779
|
}), X && F !== "recording" && /* @__PURE__ */ j("div", {
|
|
1779
1780
|
className: "flex items-center gap-ds-01 shrink-0 ml-ds-03",
|
|
1780
1781
|
children: [/* @__PURE__ */ A("button", {
|
|
1781
1782
|
type: "button",
|
|
1782
|
-
onClick: () =>
|
|
1783
|
+
onClick: () => Ee((e) => !e),
|
|
1783
1784
|
title: L ? "Hide formatting" : "Show formatting",
|
|
1784
1785
|
"aria-label": L ? "Hide formatting" : "Show formatting",
|
|
1785
1786
|
"aria-pressed": L,
|
|
1786
|
-
className:
|
|
1787
|
-
children: /* @__PURE__ */ A(
|
|
1788
|
-
icon:
|
|
1787
|
+
className: o("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-control touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-panel-hover", L ? "bg-surface-panel-hover text-accent-11" : "text-surface-fg-subtle"),
|
|
1788
|
+
children: /* @__PURE__ */ A(c, {
|
|
1789
|
+
icon: Ce,
|
|
1789
1790
|
size: "xs"
|
|
1790
1791
|
})
|
|
1791
1792
|
}), /* @__PURE__ */ j("div", {
|
|
1792
1793
|
className: "relative",
|
|
1793
1794
|
children: [/* @__PURE__ */ A("button", {
|
|
1794
|
-
ref:
|
|
1795
|
+
ref: Ge,
|
|
1795
1796
|
type: "button",
|
|
1796
|
-
onClick: () =>
|
|
1797
|
+
onClick: () => Le((e) => !e),
|
|
1797
1798
|
title: "Emoji",
|
|
1798
1799
|
"aria-label": "Emoji",
|
|
1799
|
-
className:
|
|
1800
|
-
children: /* @__PURE__ */ A(
|
|
1801
|
-
icon:
|
|
1800
|
+
className: o("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-control touch-target transition-colors duration-fast-01", Fe ? "bg-surface-panel-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-panel-hover hover:text-surface-fg"),
|
|
1801
|
+
children: /* @__PURE__ */ A(c, {
|
|
1802
|
+
icon: he,
|
|
1802
1803
|
size: "xs"
|
|
1803
1804
|
})
|
|
1804
|
-
}),
|
|
1805
|
-
ref:
|
|
1805
|
+
}), Fe && re.createPortal(/* @__PURE__ */ A("div", {
|
|
1806
|
+
ref: qe,
|
|
1806
1807
|
className: "absolute z-popover",
|
|
1807
1808
|
style: {
|
|
1808
1809
|
top: 0,
|
|
1809
1810
|
left: 0
|
|
1810
1811
|
},
|
|
1811
|
-
children: /* @__PURE__ */ A(
|
|
1812
|
+
children: /* @__PURE__ */ A(xt, {
|
|
1812
1813
|
onSelect: ({ id: e, native: t }) => {
|
|
1813
1814
|
X.chain().focus().insertContent({
|
|
1814
1815
|
type: "emojiNode",
|
|
@@ -1816,64 +1817,64 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1816
1817
|
id: e,
|
|
1817
1818
|
native: t
|
|
1818
1819
|
}
|
|
1819
|
-
}).run(),
|
|
1820
|
+
}).run(), Le(!1);
|
|
1820
1821
|
},
|
|
1821
|
-
onClose: () =>
|
|
1822
|
+
onClose: () => Le(!1)
|
|
1822
1823
|
})
|
|
1823
1824
|
}), document.body)]
|
|
1824
1825
|
})]
|
|
1825
1826
|
})]
|
|
1826
1827
|
})]
|
|
1827
1828
|
}),
|
|
1828
|
-
F === "review" &&
|
|
1829
|
+
F === "review" && G && /* @__PURE__ */ j("div", {
|
|
1829
1830
|
className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b border-b border-surface-border",
|
|
1830
|
-
children: [/* @__PURE__ */ A(
|
|
1831
|
-
src:
|
|
1832
|
-
duration:
|
|
1833
|
-
waveformData:
|
|
1831
|
+
children: [/* @__PURE__ */ A(Ke, {
|
|
1832
|
+
src: G.blob,
|
|
1833
|
+
duration: G.duration,
|
|
1834
|
+
waveformData: G.waveformData,
|
|
1834
1835
|
className: "flex-1"
|
|
1835
|
-
}), /* @__PURE__ */ A(
|
|
1836
|
+
}), /* @__PURE__ */ A(u, {
|
|
1836
1837
|
variant: "ghost",
|
|
1837
1838
|
size: "icon-sm",
|
|
1838
|
-
onClick:
|
|
1839
|
+
onClick: Ct,
|
|
1839
1840
|
"aria-label": "Discard voice note",
|
|
1840
1841
|
title: "Discard voice note",
|
|
1841
1842
|
className: "text-surface-fg-subtle hover:text-error-11",
|
|
1842
|
-
children: /* @__PURE__ */ A(
|
|
1843
|
-
icon:
|
|
1843
|
+
children: /* @__PURE__ */ A(c, {
|
|
1844
|
+
icon: we,
|
|
1844
1845
|
size: "sm"
|
|
1845
1846
|
})
|
|
1846
1847
|
})]
|
|
1847
1848
|
}),
|
|
1848
|
-
|
|
1849
|
+
rt && X && !wt && /* @__PURE__ */ A(St, { editor: X }),
|
|
1849
1850
|
J.toolbarPosition === "bottom" && X && /* @__PURE__ */ A("div", {
|
|
1850
|
-
className:
|
|
1851
|
+
className: o("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", Et ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
|
|
1851
1852
|
children: /* @__PURE__ */ A("div", {
|
|
1852
1853
|
className: "overflow-hidden",
|
|
1853
|
-
children: /* @__PURE__ */ A(
|
|
1854
|
+
children: /* @__PURE__ */ A(at, {
|
|
1854
1855
|
editor: X,
|
|
1855
|
-
toolbar:
|
|
1856
|
-
isMobile:
|
|
1857
|
-
hasMentions: !!(
|
|
1856
|
+
toolbar: de,
|
|
1857
|
+
isMobile: rt,
|
|
1858
|
+
hasMentions: !!(y || b),
|
|
1858
1859
|
hasSlashCommands: !!D,
|
|
1859
|
-
disabled:
|
|
1860
|
+
disabled: f
|
|
1860
1861
|
})
|
|
1861
1862
|
})
|
|
1862
1863
|
}),
|
|
1863
|
-
|
|
1864
|
-
let e =
|
|
1865
|
-
return
|
|
1866
|
-
className:
|
|
1864
|
+
_ && v !== "hidden" && (() => {
|
|
1865
|
+
let e = H / _;
|
|
1866
|
+
return v === "always" || v === "focus" && Be || (v === "near-limit" || !v) && e >= .8 || e >= 1 ? /* @__PURE__ */ j("div", {
|
|
1867
|
+
className: o("flex justify-end px-ds-04 pb-ds-02 text-body-xs tabular-nums transition-opacity duration-fast-01", e >= 1 ? "text-error-11 font-medium" : e >= .9 ? "text-warning-11" : "text-surface-fg-subtle"),
|
|
1867
1868
|
children: [
|
|
1868
|
-
|
|
1869
|
+
H,
|
|
1869
1870
|
"/",
|
|
1870
|
-
|
|
1871
|
+
_
|
|
1871
1872
|
]
|
|
1872
1873
|
}) : null;
|
|
1873
1874
|
})(),
|
|
1874
|
-
|
|
1875
|
+
le,
|
|
1875
1876
|
/* @__PURE__ */ A("input", {
|
|
1876
|
-
ref:
|
|
1877
|
+
ref: Xe,
|
|
1877
1878
|
type: "file",
|
|
1878
1879
|
multiple: !0,
|
|
1879
1880
|
className: "hidden",
|
|
@@ -1883,11 +1884,11 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1883
1884
|
}),
|
|
1884
1885
|
/* @__PURE__ */ j("div", {
|
|
1885
1886
|
className: "flex items-center gap-ds-02 shrink-0",
|
|
1886
|
-
children: [
|
|
1887
|
+
children: [fe && fe.length > 0 && F !== "recording" && /* @__PURE__ */ A(yt, { options: fe }), /* @__PURE__ */ j(Te, {
|
|
1887
1888
|
mode: "popLayout",
|
|
1888
1889
|
initial: !1,
|
|
1889
1890
|
children: [
|
|
1890
|
-
F === "recording" && /* @__PURE__ */ j(
|
|
1891
|
+
F === "recording" && /* @__PURE__ */ j(R.div, {
|
|
1891
1892
|
initial: {
|
|
1892
1893
|
scale: .8,
|
|
1893
1894
|
opacity: 0
|
|
@@ -1902,31 +1903,31 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1902
1903
|
},
|
|
1903
1904
|
transition: { duration: i.moderate01 },
|
|
1904
1905
|
className: "flex items-center gap-ds-02",
|
|
1905
|
-
children: [/* @__PURE__ */ A(
|
|
1906
|
+
children: [/* @__PURE__ */ A(u, {
|
|
1906
1907
|
variant: "soft",
|
|
1907
1908
|
size: $,
|
|
1908
|
-
onClick:
|
|
1909
|
+
onClick: ut,
|
|
1909
1910
|
"aria-label": "Cancel recording",
|
|
1910
1911
|
title: "Cancel recording",
|
|
1911
1912
|
className: "text-surface-fg-subtle hover:text-error-11",
|
|
1912
|
-
children: /* @__PURE__ */ A(
|
|
1913
|
-
icon:
|
|
1913
|
+
children: /* @__PURE__ */ A(c, {
|
|
1914
|
+
icon: we,
|
|
1914
1915
|
size: "md"
|
|
1915
1916
|
})
|
|
1916
|
-
}), /* @__PURE__ */ A(
|
|
1917
|
+
}), /* @__PURE__ */ A(u, {
|
|
1917
1918
|
variant: "solid",
|
|
1918
1919
|
size: $,
|
|
1919
1920
|
color: "error",
|
|
1920
|
-
onClick:
|
|
1921
|
+
onClick: lt,
|
|
1921
1922
|
"aria-label": "Stop recording",
|
|
1922
1923
|
title: "Stop recording",
|
|
1923
|
-
children: /* @__PURE__ */ A(
|
|
1924
|
-
icon:
|
|
1924
|
+
children: /* @__PURE__ */ A(c, {
|
|
1925
|
+
icon: Se,
|
|
1925
1926
|
size: "md"
|
|
1926
1927
|
})
|
|
1927
1928
|
})]
|
|
1928
1929
|
}, "recording"),
|
|
1929
|
-
N && F !== "recording" && /* @__PURE__ */ A(
|
|
1930
|
+
N && F !== "recording" && /* @__PURE__ */ A(R.div, {
|
|
1930
1931
|
initial: {
|
|
1931
1932
|
scale: .8,
|
|
1932
1933
|
opacity: 0
|
|
@@ -1940,20 +1941,20 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1940
1941
|
opacity: 0
|
|
1941
1942
|
},
|
|
1942
1943
|
transition: { duration: i.moderate01 },
|
|
1943
|
-
children: /* @__PURE__ */ A(
|
|
1944
|
+
children: /* @__PURE__ */ A(u, {
|
|
1944
1945
|
variant: "solid",
|
|
1945
1946
|
size: $,
|
|
1946
1947
|
color: "error",
|
|
1947
|
-
onClick:
|
|
1948
|
+
onClick: oe,
|
|
1948
1949
|
"aria-label": "Stop",
|
|
1949
1950
|
title: "Stop",
|
|
1950
|
-
children: /* @__PURE__ */ A(
|
|
1951
|
-
icon:
|
|
1951
|
+
children: /* @__PURE__ */ A(c, {
|
|
1952
|
+
icon: Se,
|
|
1952
1953
|
size: "md"
|
|
1953
1954
|
})
|
|
1954
1955
|
})
|
|
1955
1956
|
}, "streaming"),
|
|
1956
|
-
!N && F !== "recording" &&
|
|
1957
|
+
!N && F !== "recording" && Tt && P && /* @__PURE__ */ A(R.div, {
|
|
1957
1958
|
initial: {
|
|
1958
1959
|
scale: .8,
|
|
1959
1960
|
opacity: 0
|
|
@@ -1967,23 +1968,23 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1967
1968
|
opacity: 0
|
|
1968
1969
|
},
|
|
1969
1970
|
transition: { duration: i.moderate01 },
|
|
1970
|
-
children: /* @__PURE__ */ A(
|
|
1971
|
-
onClick:
|
|
1972
|
-
disabled:
|
|
1973
|
-
"aria-label":
|
|
1971
|
+
children: /* @__PURE__ */ A(g, {
|
|
1972
|
+
onClick: dt,
|
|
1973
|
+
disabled: f,
|
|
1974
|
+
"aria-label": B ? "Schedule send" : "Send",
|
|
1974
1975
|
size: $,
|
|
1975
|
-
dropdownContent: /* @__PURE__ */ A(
|
|
1976
|
-
onSchedule: (e) =>
|
|
1976
|
+
dropdownContent: /* @__PURE__ */ A(ft, {
|
|
1977
|
+
onSchedule: (e) => Re(e),
|
|
1977
1978
|
onClose: () => {},
|
|
1978
|
-
onOpenDialog: () =>
|
|
1979
|
+
onOpenDialog: () => V(!0)
|
|
1979
1980
|
}),
|
|
1980
|
-
children: /* @__PURE__ */ A(
|
|
1981
|
-
icon:
|
|
1981
|
+
children: /* @__PURE__ */ A(c, {
|
|
1982
|
+
icon: B ? se : be,
|
|
1982
1983
|
size: "md"
|
|
1983
1984
|
})
|
|
1984
1985
|
})
|
|
1985
1986
|
}, "split-send"),
|
|
1986
|
-
!N && F !== "recording" &&
|
|
1987
|
+
!N && F !== "recording" && Tt && !P && /* @__PURE__ */ A(R.div, {
|
|
1987
1988
|
initial: {
|
|
1988
1989
|
scale: .8,
|
|
1989
1990
|
opacity: 0
|
|
@@ -1997,20 +1998,20 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
1997
1998
|
opacity: 0
|
|
1998
1999
|
},
|
|
1999
2000
|
transition: { duration: i.moderate01 },
|
|
2000
|
-
children: /* @__PURE__ */ A(
|
|
2001
|
+
children: /* @__PURE__ */ A(u, {
|
|
2001
2002
|
variant: "solid",
|
|
2002
2003
|
size: $,
|
|
2003
|
-
onClick:
|
|
2004
|
-
disabled:
|
|
2004
|
+
onClick: dt,
|
|
2005
|
+
disabled: f,
|
|
2005
2006
|
"aria-label": "Send",
|
|
2006
2007
|
title: "Send",
|
|
2007
|
-
children: /* @__PURE__ */ A(
|
|
2008
|
-
icon:
|
|
2008
|
+
children: /* @__PURE__ */ A(c, {
|
|
2009
|
+
icon: be,
|
|
2009
2010
|
size: "md"
|
|
2010
2011
|
})
|
|
2011
2012
|
})
|
|
2012
2013
|
}, "send"),
|
|
2013
|
-
!N && F !== "recording" && !
|
|
2014
|
+
!N && F !== "recording" && !Tt && O && /* @__PURE__ */ A(R.div, {
|
|
2014
2015
|
initial: {
|
|
2015
2016
|
scale: .8,
|
|
2016
2017
|
opacity: 0
|
|
@@ -2024,19 +2025,19 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
2024
2025
|
opacity: 0
|
|
2025
2026
|
},
|
|
2026
2027
|
transition: { duration: i.moderate01 },
|
|
2027
|
-
children: /* @__PURE__ */ A(
|
|
2028
|
+
children: /* @__PURE__ */ A(u, {
|
|
2028
2029
|
variant: "soft",
|
|
2029
2030
|
size: $,
|
|
2030
|
-
onClick:
|
|
2031
|
+
onClick: ot,
|
|
2031
2032
|
"aria-label": "Record voice message",
|
|
2032
2033
|
title: "Record voice message",
|
|
2033
|
-
children: /* @__PURE__ */ A(
|
|
2034
|
-
icon:
|
|
2034
|
+
children: /* @__PURE__ */ A(c, {
|
|
2035
|
+
icon: me,
|
|
2035
2036
|
size: "md"
|
|
2036
2037
|
})
|
|
2037
2038
|
})
|
|
2038
2039
|
}, "mic"),
|
|
2039
|
-
!N && F !== "recording" && !
|
|
2040
|
+
!N && F !== "recording" && !Tt && !O && /* @__PURE__ */ A(R.div, {
|
|
2040
2041
|
initial: {
|
|
2041
2042
|
scale: .8,
|
|
2042
2043
|
opacity: 0
|
|
@@ -2050,14 +2051,14 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
2050
2051
|
opacity: 0
|
|
2051
2052
|
},
|
|
2052
2053
|
transition: { duration: i.moderate01 },
|
|
2053
|
-
children: /* @__PURE__ */ A(
|
|
2054
|
+
children: /* @__PURE__ */ A(u, {
|
|
2054
2055
|
variant: "solid",
|
|
2055
2056
|
size: $,
|
|
2056
2057
|
disabled: !0,
|
|
2057
2058
|
"aria-label": "Send",
|
|
2058
2059
|
title: "Send",
|
|
2059
|
-
children: /* @__PURE__ */ A(
|
|
2060
|
-
icon:
|
|
2060
|
+
children: /* @__PURE__ */ A(c, {
|
|
2061
|
+
icon: be,
|
|
2061
2062
|
size: "md"
|
|
2062
2063
|
})
|
|
2063
2064
|
})
|
|
@@ -2065,19 +2066,19 @@ var St = T.forwardRef(function({ onSubmit: o, placeholder: u = "Type a message..
|
|
|
2065
2066
|
]
|
|
2066
2067
|
})]
|
|
2067
2068
|
}),
|
|
2068
|
-
|
|
2069
|
-
className: "mt-ds-02 text-center text-caption text-surface-fg-subtle
|
|
2070
|
-
children:
|
|
2069
|
+
ue && /* @__PURE__ */ A("p", {
|
|
2070
|
+
className: "mt-ds-02 text-center text-caption text-surface-fg-subtle",
|
|
2071
|
+
children: ue
|
|
2071
2072
|
}),
|
|
2072
|
-
P && /* @__PURE__ */ A(
|
|
2073
|
-
open:
|
|
2074
|
-
onOpenChange:
|
|
2075
|
-
onSchedule: (e) =>
|
|
2076
|
-
initialDate:
|
|
2073
|
+
P && /* @__PURE__ */ A(pt, {
|
|
2074
|
+
open: ze,
|
|
2075
|
+
onOpenChange: V,
|
|
2076
|
+
onSchedule: (e) => Re(e),
|
|
2077
|
+
initialDate: B
|
|
2077
2078
|
})
|
|
2078
2079
|
]
|
|
2079
|
-
});
|
|
2080
|
+
}) });
|
|
2080
2081
|
});
|
|
2081
|
-
|
|
2082
|
+
Ct.displayName = "RichChatInput";
|
|
2082
2083
|
//#endregion
|
|
2083
|
-
export {
|
|
2084
|
+
export { Ke as AudioPlayer, H as AudioWaveform, nt as BlockquoteButton, Je as BoldButton, et as BulletListButton, $e as CodeButton, J as EmojiButton, Qe as HighlightButton, Ye as ItalicButton, q as LinkButton, rt as MentionButton, tt as OrderedListButton, Ct as RichChatInput, it as SlashCommandButton, Ze as StrikeButton, W as ToolbarButton, G as ToolbarDivider, K as ToolbarGroup, Xe as UnderlineButton, gt as useVoiceRecorder };
|