diff --git a/client/src/components/Chat/ChatView.tsx b/client/src/components/Chat/ChatView.tsx index 417d017228..42bf58264c 100644 --- a/client/src/components/Chat/ChatView.tsx +++ b/client/src/components/Chat/ChatView.tsx @@ -5,19 +5,22 @@ import { useForm } from 'react-hook-form'; import { Spinner } from '@librechat/client'; import { useParams } from 'react-router-dom'; import { Constants, buildTree } from 'librechat-data-provider'; -import { submissionByIndex, ComposerRestoreProvider } from '@librechat/chat/react'; +import { QueuedTurnPortalProvider } from '@librechat/chat/components'; +import { + submissionByIndex, + ComposerRestoreProvider, + composerLiftFamily, +} from '@librechat/chat/react'; import type { TChatProject, TMessage } from 'librechat-data-provider'; import type { ChatFormValues } from '~/common'; import { AddedChatContext, ChatFormProvider, useChatContext, useFileMapContext } from '~/Providers'; import { useScrollbarGutterSeed, useAddedResponse, useLocalize } from '~/hooks'; import Footer, { useLandingFooter, useConfiguredFooter } from './Footer'; -import { QueuedTurnPortalProvider } from './Steering/QueuedTurnPortal'; import { useChatSettings } from '~/Providers/ChatSettingsContext'; import ApprovalProvider from './Messages/Content/ApprovalContext'; import ConversationStarters from './Input/ConversationStarters'; import { pendingApprovalActionFamily } from './approval/state'; import ProjectBadge from '~/components/Projects/ProjectBadge'; -import { composerLiftFamily } from './Input/Composer/state'; import { ChatSessionProvider } from '~/hooks/Chat/provider'; import { OwnerTextProvider } from './Messages/PrivateText'; import { AskAnswerHostProvider } from './ask/state'; diff --git a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx index 2f469e3791..2285020b82 100644 --- a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx +++ b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx @@ -1,13 +1,13 @@ import { memo, useCallback, useEffect, useRef } from 'react'; import { useWatch } from 'react-hook-form'; import { Button, TooltipAnchor } from '@librechat/client'; +import { useComposerOverlay } from '@librechat/chat/react'; import { ChevronDown, CornerDownLeft, TriangleAlert } from 'lucide-react'; import AskUserQuestions from '~/components/Chat/Messages/Content/AskUserQuestions'; import useAskAnswerMode from '~/hooks/Input/useAskAnswerMode'; import AskOptions from '~/components/Chat/ask/options'; import { useChatFormContext } from '~/Providers'; import { isCancelKey } from '~/utils/shortcuts'; -import { useComposerOverlay } from './overlay'; import { useLocalize } from '~/hooks'; /** diff --git a/client/src/components/Chat/Input/ChatForm.tsx b/client/src/components/Chat/Input/ChatForm.tsx index 11aa8e135a..0555e73e9d 100644 --- a/client/src/components/Chat/Input/ChatForm.tsx +++ b/client/src/components/Chat/Input/ChatForm.tsx @@ -5,6 +5,12 @@ import { useAtom, useAtomValue } from 'jotai'; import { useNavigate } from 'react-router-dom'; import { useDirection } from '@radix-ui/react-direction'; import { useSteering, showStopButtonByIndex, useComposerRestoreHost } from '@librechat/chat/react'; +import { + submitFromComposer, + composerClearance, + CollapseChat, + StopButton, +} from '@librechat/chat/components'; import { composerSurfaceClasses, composerSurfaceShadow, @@ -74,16 +80,12 @@ import CodeWorkspaceMenu from './CodeWorkspaceMenu'; import CodeApprovalMenu from './CodeApprovalMenu'; import TextareaHeader from './TextareaHeader'; import PromptsCommand from './PromptsCommand'; -import { submitFromComposer } from './submit'; import SkillsCommand from './SkillsCommand'; import AutoPlayAudio from './AutoPlayAudio'; -import composerClearance from './clearance'; import Waveform from './Composer/Waveform'; import { mainTextareaId } from '~/common'; -import CollapseChat from './CollapseChat'; import QuoteButton from './QuoteButton'; import ToolDialogs from './ToolDialogs'; -import StopButton from './StopButton'; import SendButton from './SendButton'; import Queue from './Composer/Queue'; import Tray from './Composer/Tray'; diff --git a/client/src/components/Chat/Input/Composer/Bar.tsx b/client/src/components/Chat/Input/Composer/Bar.tsx index 7df732d6fb..705527b2a1 100644 --- a/client/src/components/Chat/Input/Composer/Bar.tsx +++ b/client/src/components/Chat/Input/Composer/Bar.tsx @@ -1,5 +1,6 @@ import React, { memo, useMemo, useState, useCallback } from 'react'; import * as Ariakit from '@ariakit/react'; +import { ComposerChip as Chip } from '@librechat/chat/components'; import { Mic, Plus, Check, Square, ChevronDown } from 'lucide-react'; import { IconButton, TooltipAnchor, SendIcon } from '@librechat/client'; import type { TConversation, EModelEndpoint, EndpointFileConfig } from 'librechat-data-provider'; @@ -17,7 +18,6 @@ import { useLocalize } from '~/hooks'; import Thinking from './Thinking'; import Palette from './Palette'; import { cn } from '~/utils'; -import Chip from './Chip'; /** Stable identity so the memo below is not defeated when tools are hidden. */ const EMPTY_ENTRIES: PaletteEntry[] = []; diff --git a/client/src/components/Chat/Input/Composer/Palette.tsx b/client/src/components/Chat/Input/Composer/Palette.tsx index ed6bbac80d..30a0e47ed5 100644 --- a/client/src/components/Chat/Input/Composer/Palette.tsx +++ b/client/src/components/Chat/Input/Composer/Palette.tsx @@ -10,6 +10,7 @@ import React, { import { useSetAtom } from 'jotai'; import * as Ariakit from '@ariakit/react'; import { AutoSizer, List } from 'react-virtualized'; +import { composerLiftFamily } from '@librechat/chat/react'; import { Star, Plus, Search, ChevronDown } from 'lucide-react'; import { Button, FileUpload, IconButton, TooltipAnchor, useMediaQuery } from '@librechat/client'; import type { @@ -34,7 +35,6 @@ import useAttachItems from '~/hooks/Input/useAttachItems'; import { useMCPRefresh } from '~/hooks/MCP/useMCPRefresh'; import { isMacPlatform } from '~/utils/shortcuts'; import { useBadgeRowContext } from '~/Providers'; -import { composerLiftFamily } from './state'; import { useLocalize } from '~/hooks'; import Catalog from './Catalog'; diff --git a/client/src/components/Chat/Input/Composer/Queue.tsx b/client/src/components/Chat/Input/Composer/Queue.tsx index 53dbacec89..4eb1be24c3 100644 --- a/client/src/components/Chat/Input/Composer/Queue.tsx +++ b/client/src/components/Chat/Input/Composer/Queue.tsx @@ -4,6 +4,7 @@ import { createPortal } from 'react-dom'; import * as Ariakit from '@ariakit/react'; import { useDrag, useDrop } from 'react-dnd'; import { queuedMessagesByConvoId } from '@librechat/chat/react'; +import { useQueuedTurnPortal } from '@librechat/chat/components'; import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'; import { claimQueuedIntent, releaseQueuedIntent, hasQueuedIntent } from '@librechat/chat'; import { @@ -35,7 +36,6 @@ import type { RestoreToComposer } from '@librechat/chat/react'; import type { SteeringControls } from '@librechat/chat/react'; import type { MenuItemProps } from '@librechat/client'; import type { QueuedMessage } from '@librechat/chat'; -import { useQueuedTurnPortal } from '~/components/Chat/Steering/QueuedTurnPortal'; import EscalateNowButton from '~/components/Chat/Input/EscalateNowButton'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils'; diff --git a/client/src/components/Chat/Input/Composer/Tray.tsx b/client/src/components/Chat/Input/Composer/Tray.tsx index c39ba79184..8e5ebd98df 100644 --- a/client/src/components/Chat/Input/Composer/Tray.tsx +++ b/client/src/components/Chat/Input/Composer/Tray.tsx @@ -1,11 +1,11 @@ import { memo, useCallback, useEffect, useRef } from 'react'; import { TextQuote, WandSparkles } from 'lucide-react'; +import { ComposerChip as Chip } from '@librechat/chat/components'; import type { TConversation } from 'librechat-data-provider'; import type { ComposerItem, ComposerItemKind } from '~/hooks/Input/useComposerItems'; import type { ExtendedFile, FileSetter } from '~/common'; import { useFileHandlingNoChatContext, useLocalize } from '~/hooks'; import FileRow from '../Files/FileRow'; -import Chip from './Chip'; const KIND_ICON: Record = { quote: