@gravity-ui/aikit 2.19.2 → 2.19.3-beta.af9c6fb1cce2b60fd6c198cca08d00a762b16671.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/build/cjs/components/molecules/ButtonGroup/ButtonGroup.css +1 -1
- package/build/cjs/components/molecules/Suggestions/Suggestions.css +4 -0
- package/build/cjs/components/molecules/Suggestions/Suggestions.js +1 -1
- package/build/cjs/components/molecules/Suggestions/Suggestions.js.map +1 -1
- package/build/cjs/components/organisms/Header/Header.css +23 -1
- package/build/cjs/components/organisms/Header/Header.js +6 -3
- package/build/cjs/components/organisms/Header/Header.js.map +1 -1
- package/build/cjs/components/organisms/Header/types.d.ts +2 -0
- package/build/cjs/components/organisms/Header/types.js.map +1 -1
- package/build/cjs/components/organisms/Header/useHeader.d.ts +1 -0
- package/build/cjs/components/organisms/Header/useHeader.js +2 -1
- package/build/cjs/components/organisms/Header/useHeader.js.map +1 -1
- package/build/cjs/components/organisms/PromptInput/PromptInput.css +2 -2
- package/build/cjs/components/pages/ChatContainer/ChatContainer.css +67 -5
- package/build/cjs/components/pages/ChatContainer/ChatContainer.js +6 -2
- package/build/cjs/components/pages/ChatContainer/ChatContainer.js.map +1 -1
- package/build/cjs/components/pages/ChatContainer/types.d.ts +18 -0
- package/build/cjs/components/pages/ChatContainer/types.js.map +1 -1
- package/build/cjs/components/templates/ChatContent/ChatContent.css +1 -1
- package/build/cjs/components/templates/History/ChatItem.d.ts +4 -1
- package/build/cjs/components/templates/History/ChatItem.js +10 -3
- package/build/cjs/components/templates/History/ChatItem.js.map +1 -1
- package/build/cjs/components/templates/History/History.css +22 -0
- package/build/cjs/components/templates/History/History.d.ts +2 -0
- package/build/cjs/components/templates/History/History.js +2 -2
- package/build/cjs/components/templates/History/History.js.map +1 -1
- package/build/cjs/components/templates/History/HistoryList.js +4 -2
- package/build/cjs/components/templates/History/HistoryList.js.map +1 -1
- package/build/cjs/package.json +1 -1
- package/build/cjs/themes/common.css +38 -2
- package/build/cjs/themes/variables.css +38 -2
- package/build/docs/components/molecules/ButtonGroup.md +3 -3
- package/build/docs/components/organisms/Header.md +15 -0
- package/build/docs/components/organisms/PromptInput.md +12 -10
- package/build/docs/components/pages/ChatContainer.md +120 -66
- package/build/docs/components/templates/ChatContent.md +5 -4
- package/build/docs/components/templates/History.md +59 -26
- package/build/docs/guides/THEMING.md +70 -19
- package/build/esm/components/molecules/ButtonGroup/ButtonGroup.css +1 -1
- package/build/esm/components/molecules/Suggestions/Suggestions.css +4 -0
- package/build/esm/components/molecules/Suggestions/Suggestions.js +1 -1
- package/build/esm/components/molecules/Suggestions/Suggestions.js.map +1 -1
- package/build/esm/components/organisms/Header/Header.css +23 -1
- package/build/esm/components/organisms/Header/Header.js +6 -3
- package/build/esm/components/organisms/Header/Header.js.map +1 -1
- package/build/esm/components/organisms/Header/types.d.ts +2 -0
- package/build/esm/components/organisms/Header/types.js.map +1 -1
- package/build/esm/components/organisms/Header/useHeader.d.ts +1 -0
- package/build/esm/components/organisms/Header/useHeader.js +2 -1
- package/build/esm/components/organisms/Header/useHeader.js.map +1 -1
- package/build/esm/components/organisms/PromptInput/PromptInput.css +2 -2
- package/build/esm/components/pages/ChatContainer/ChatContainer.css +67 -5
- package/build/esm/components/pages/ChatContainer/ChatContainer.js +6 -2
- package/build/esm/components/pages/ChatContainer/ChatContainer.js.map +1 -1
- package/build/esm/components/pages/ChatContainer/types.d.ts +18 -0
- package/build/esm/components/pages/ChatContainer/types.js.map +1 -1
- package/build/esm/components/templates/ChatContent/ChatContent.css +1 -1
- package/build/esm/components/templates/History/ChatItem.d.ts +4 -1
- package/build/esm/components/templates/History/ChatItem.js +10 -3
- package/build/esm/components/templates/History/ChatItem.js.map +1 -1
- package/build/esm/components/templates/History/History.css +22 -0
- package/build/esm/components/templates/History/History.d.ts +2 -0
- package/build/esm/components/templates/History/History.js +2 -2
- package/build/esm/components/templates/History/History.js.map +1 -1
- package/build/esm/components/templates/History/HistoryList.js +4 -2
- package/build/esm/components/templates/History/HistoryList.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/themes/common.css +38 -2
- package/build/esm/themes/variables.css +38 -2
- package/docs/THEMING.md +70 -19
- package/llms-full.txt +77 -25
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainer.js","sourceRoot":"../../../../../src","sources":["components/pages/ChatContainer/ChatContainer.tsx"],"names":[],"mappings":";;AAsLA,sCA4eC;;;AAlqBD,iCAA6E;AAE7E,6CAA4D;AAE5D,mDAA8E;AAE9E,6CAAwC;AACxC,qDAAkG;AAClG,gEAAkD;AAClD,4DAA8E;AAC9E,sEAA+E;AAC/E,sEAAwD;AACxD,8DAAgD;AAEhD,0DAK2B;AAC3B,0CAA4B;AAE5B,4DAAoD;AACpD,wEAAgE;AAEhE,+BAA8B;AAE9B,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,gBAAgB,CAAC,CAAC;AAIlC,SAAS,mBAAmB,CACxB,EAAW,EACX,IAA8B;IAE9B,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,uCACO,CAAC,EAAE,IAAI,EAAC,EAAE,EAAC,CAAC,GACZ,CAAC,IAAI,IAAI,EAAC,IAAI,EAAC,CAAC,EACrB;AACN,CAAC;AAED,SAAS,gCAAgC,CACrC,SAA2D,EAC3D,iBAAwC;IAExC,MAAM,uBAAuB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,wBAAwB,GAAG,iBAAiB,KAAK,SAAS,CAAC;IACjE,IAAI,CAAC,uBAAuB,IAAI,CAAC,wBAAwB,EAAE,CAAC;QACxD,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,uCACO,SAAS,KACZ,YAAY,EAAE,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,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AC/D,CACT,EAED,uBAAC,iBAAO,oBAAK,iBAAiB,EAAI,IAChC,GACO,CACpB,CAAC;AACN,CAAC","sourcesContent":["import {Fragment, type ReactNode, useCallback, useMemo, useRef} from 'react';\n\nimport {MobileProvider, useMobile} from '@gravity-ui/uikit';\n\nimport {getMascotAnimationType, useKeyboardViewportFit} from '../../../hooks';\nimport type {TSuggestionContext} from '../../../types/messages';\nimport {block} from '../../../utils/cn';\nimport {getMascotNode, resolveMascotAssets, resolveMascotCollection} from '../../../utils/mascot';\nimport {Disclaimer} from '../../atoms/Disclaimer';\nimport {Header, HeaderAction, type HeaderProps} from '../../organisms/Header';\nimport {PromptInput, type PromptInputProps} from '../../organisms/PromptInput';\nimport {ChatContent} from '../../templates/ChatContent';\nimport {History} from '../../templates/History';\n\nimport {\n normalizeChatContainerQa,\n resolveChatContainerQa,\n resolveChatContainerRootQa,\n resolveHeaderMenuItemQa,\n} from './chatContainerQa';\nimport {i18n} from './i18n';\nimport type {ChatContainerProps, ChatContainerTexts} from './types';\nimport {useChatContainer} from './useChatContainer';\nimport {useChatContainerMascot} from './useChatContainerMascot';\n\nimport './ChatContainer.scss';\n\nconst b = block('chat-container');\n\ntype NormalizedChatContainerQa = ReturnType<typeof normalizeChatContainerQa>;\n\nfunction toSuggestionContext(\n id?: string,\n data?: Record<string, unknown>,\n): TSuggestionContext | undefined {\n if (!id && !data) {\n return undefined;\n }\n\n return {\n ...(id && {id}),\n ...(data && {data}),\n };\n}\n\nfunction mergePromptInputSuggestionsProps(\n fromProps: PromptInputProps['suggestionsProps'] | undefined,\n textsSuggestTitle: ReactNode | undefined,\n): PromptInputProps['suggestionsProps'] | undefined {\n const hasSuggestionsFromProps = Boolean(fromProps);\n const hasSuggestTitleFromTexts = textsSuggestTitle !== undefined;\n if (!hasSuggestionsFromProps && !hasSuggestTitleFromTexts) {\n return undefined;\n }\n return {\n ...fromProps,\n suggestTitle: textsSuggestTitle ?? fromProps?.suggestTitle,\n };\n}\n\nfunction buildFinalPromptInputHeaderProps(args: {\n headerProps: NonNullable<ChatContainerProps['promptInputProps']>['headerProps'];\n contextItems: ChatContainerProps['contextItems'];\n showContextIndicator: ChatContainerProps['showContextIndicator'];\n contextIndicatorProps: ChatContainerProps['contextIndicatorProps'];\n qa: string | undefined;\n}): NonNullable<ChatContainerProps['promptInputProps']>['headerProps'] {\n const {headerProps, contextItems, showContextIndicator, contextIndicatorProps, qa} = args;\n\n // topContent replaces the default header entirely, so context-related\n // props are not allowed (and would be ignored) alongside it\n if (headerProps?.topContent) {\n return {topContent: headerProps.topContent, qa};\n }\n\n return {\n contextItems,\n showContextIndicator: showContextIndicator ?? headerProps?.showContextIndicator,\n contextIndicatorProps: contextIndicatorProps ?? headerProps?.contextIndicatorProps,\n qa,\n };\n}\n\nfunction buildFinalPromptInputProps(args: {\n promptInputProps: ChatContainerProps['promptInputProps'];\n onSendMessage: ChatContainerProps['onSendMessage'];\n onCancel: ChatContainerProps['onCancel'];\n status: ChatContainerProps['status'];\n contextItems: ChatContainerProps['contextItems'];\n showContextIndicator: ChatContainerProps['showContextIndicator'];\n contextIndicatorProps: ChatContainerProps['contextIndicatorProps'];\n texts: ChatContainerTexts;\n promptInputKey: number;\n qaMap: NormalizedChatContainerQa;\n onValueChange?: (value: string) => void;\n}) {\n const {\n promptInputProps,\n onSendMessage,\n onCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n texts: textsArg,\n promptInputKey,\n qaMap,\n onValueChange,\n } = args;\n\n const texts = textsArg ?? {};\n\n const {\n autoFocusOnNewChat: _autoFocusOnNewChat,\n autoFocusOnChatSelect: _autoFocusOnChatSelect,\n ...restBodyProps\n } = promptInputProps?.bodyProps ?? {};\n\n const suggestionsProps = mergePromptInputSuggestionsProps(\n promptInputProps?.suggestionsProps,\n texts.promptSuggestTitle,\n );\n\n return {\n ...promptInputProps,\n onValueChange:\n onValueChange || promptInputProps?.onValueChange\n ? (value: string) => {\n onValueChange?.(value);\n promptInputProps?.onValueChange?.(value);\n }\n : undefined,\n qa: resolveChatContainerQa(qaMap, 'promptInput', 'prompt-input') ?? promptInputProps?.qa,\n onSend: onSendMessage,\n onCancel,\n status,\n suggestionsProps,\n headerProps: buildFinalPromptInputHeaderProps({\n headerProps: promptInputProps?.headerProps,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputHeader', 'prompt-input-header') ??\n promptInputProps?.headerProps?.qa,\n }),\n bodyProps: {\n ...restBodyProps,\n placeholder:\n texts.promptPlaceholder || restBodyProps?.placeholder || i18n('prompt-placeholder'),\n autoFocus: promptInputKey > 0 || restBodyProps?.autoFocus,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputBody', 'prompt-input-body') ??\n restBodyProps?.qa,\n },\n footerProps: {\n ...promptInputProps?.footerProps,\n submitButtonTooltipSend:\n texts?.submitSendTooltip ?? promptInputProps?.footerProps?.submitButtonTooltipSend,\n submitButtonTooltipCancel:\n texts?.submitCancelTooltip ??\n promptInputProps?.footerProps?.submitButtonTooltipCancel,\n submitButtonCancelableText:\n texts?.submitButtonCancelableText ??\n promptInputProps?.footerProps?.submitButtonCancelableText,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputFooter', 'prompt-input-footer') ??\n promptInputProps?.footerProps?.qa,\n submitButtonQa:\n resolveChatContainerQa(qaMap, 'submitButton', 'submit-button') ??\n promptInputProps?.footerProps?.submitButtonQa,\n },\n };\n}\n\n/**\n * ChatContainer - fully assembled chat component, the main exportable component of the library.\n * Integrates Header, ChatContent, History and manages their state.\n *\n * @param props - component props\n * @returns React component\n */\nexport function ChatContainer(props: ChatContainerProps) {\n const {\n chats = [],\n messages = [],\n onSendMessage,\n onDeleteChat,\n onCancel,\n onRetry,\n status = 'ready',\n error = null,\n showActionsOnHover = false,\n contextItems = [],\n showContextIndicator,\n contextIndicatorProps,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n messageListConfig,\n mascotConfig,\n headerProps = {},\n contentProps = {},\n emptyContainerProps = {},\n promptInputProps = {},\n disclaimerProps = {},\n historyProps = {},\n welcomeConfig,\n texts = {},\n hideTitleOnEmptyChat = false,\n isMobile: isMobileProp,\n adjustToKeyboard = true,\n className,\n headerClassName,\n contentClassName,\n footerClassName,\n qa,\n } = props;\n\n const isMobileContext = useMobile();\n const isMobile = isMobileProp ?? isMobileContext;\n\n const rootRef = useRef<HTMLDivElement>(null);\n // Keeps the footer (prompt input + disclaimer) above the on-screen keyboard on iOS Safari,\n // where the layout viewport stays full-height while the keyboard is open.\n const {isKeyboardOpen, maxHeight} = useKeyboardViewportFit(\n rootRef,\n isMobile && adjustToKeyboard,\n );\n\n const hookState = useChatContainer(props);\n\n const mascotState = useChatContainerMascot({\n config: mascotConfig,\n view: hookState.chatContentView === 'empty' ? 'hero' : 'chat',\n status,\n messagesCount: messages.length,\n activeChatId: hookState.activeChat?.id,\n promptInputKey: hookState.promptInputKey,\n });\n\n const wrappedOnSendMessage = useCallback(\n async (...args: Parameters<typeof onSendMessage>) => {\n mascotState.notifyActivity();\n return onSendMessage(...args);\n },\n [mascotState.notifyActivity, onSendMessage],\n );\n const wrappedOnCancel = useMemo(() => {\n if (!onCancel) {\n return undefined;\n }\n return async () => {\n await onCancel();\n mascotState.handleCancelResolved();\n };\n }, [mascotState.handleCancelResolved, onCancel]);\n const wrappedOnRetry = useMemo(() => {\n if (!onRetry) {\n return undefined;\n }\n return () => {\n mascotState.notifyActivity();\n onRetry();\n };\n }, [mascotState.notifyActivity, onRetry]);\n\n const resolvedMascotAssets = useMemo(\n () => resolveMascotAssets(mascotConfig?.defaultAssets, mascotConfig?.assets),\n [mascotConfig?.assets, mascotConfig?.defaultAssets],\n );\n const resolvedMascots = useMemo(\n () => resolveMascotCollection(mascotConfig?.defaultMascots, mascotConfig?.mascots),\n [mascotConfig?.defaultMascots, mascotConfig?.mascots],\n );\n const mascotView = hookState.chatContentView === 'empty' ? 'hero' : 'chat';\n const mascotNode = useMemo(() => {\n if (!mascotConfig) {\n return undefined;\n }\n if (mascotView === 'hero' && mascotConfig.showOnWelcome === false) {\n return undefined;\n }\n if (mascotView === 'chat' && mascotConfig.showInChat === false) {\n return undefined;\n }\n const node = mascotConfig.renderMascot\n ? mascotConfig.renderMascot({\n view: mascotView,\n state: mascotState.state,\n animationType: getMascotAnimationType(mascotState.state),\n assets: resolvedMascotAssets,\n })\n : getMascotNode(resolvedMascots, mascotView, mascotState.state);\n if (node === undefined || node === null) {\n return undefined;\n }\n return <div className={b('mascot', {view: mascotView})}>{node}</div>;\n }, [mascotConfig, mascotState.state, mascotView, resolvedMascotAssets, resolvedMascots]);\n\n const qaMap = useMemo(() => normalizeChatContainerQa(qa), [qa]);\n\n // Collect i18n texts with overrides\n const headerTitle = useMemo(\n () =>\n texts.headerTitle ||\n headerProps.title ||\n hookState.activeChat?.name ||\n i18n('header-default-title'),\n [texts.headerTitle, headerProps.title, hookState.activeChat?.name],\n );\n\n // Determine if chat is empty\n const isChatEmpty = hookState.chatContentView === 'empty';\n\n // Calculate showTitle based on hideTitleOnEmptyChat option\n const showTitle = useMemo(() => {\n // If explicit showTitle is provided in headerProps, use it\n if (headerProps.showTitle !== undefined) {\n return headerProps.showTitle;\n }\n // If hideTitleOnEmptyChat is enabled, show title only when chat has messages\n if (hideTitleOnEmptyChat && isChatEmpty) {\n return false;\n }\n return true;\n }, [hideTitleOnEmptyChat, isChatEmpty, headerProps.showTitle]);\n\n // Build props for Header\n const finalHeaderProps = useMemo(() => {\n const actionQa: Partial<Record<HeaderAction, string>> = {\n ...headerProps.actionQa,\n };\n const setHeaderActionQa = (\n action: HeaderAction,\n key: 'headerNewChat' | 'headerHistory' | 'headerFolding' | 'headerClose',\n suffix: string,\n ) => {\n const resolved = resolveChatContainerQa(qaMap, key, suffix);\n if (resolved !== undefined) {\n actionQa[action] = resolved;\n }\n };\n setHeaderActionQa(HeaderAction.NewChat, 'headerNewChat', 'header-action-newChat');\n setHeaderActionQa(HeaderAction.History, 'headerHistory', 'header-action-history');\n setHeaderActionQa(HeaderAction.Folding, 'headerFolding', 'header-action-folding');\n setHeaderActionQa(HeaderAction.Close, 'headerClose', 'header-action-close');\n\n const actionTooltipTexts: NonNullable<HeaderProps['actionTooltipTexts']> = {\n [HeaderAction.NewChat]:\n texts.headerNewChatTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.NewChat],\n [HeaderAction.History]:\n texts.headerHistoryTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.History],\n [HeaderAction.Close]:\n texts.headerCloseTooltip ?? headerProps.actionTooltipTexts?.[HeaderAction.Close],\n [HeaderAction.Folding]: {\n collapsed:\n texts.headerFoldingCollapsedTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.Folding]?.collapsed,\n opened:\n texts.headerFoldingOpenedTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.Folding]?.opened,\n },\n };\n\n return {\n ...headerProps,\n title: headerTitle,\n showTitle,\n baseActions: hookState.baseActions,\n handleNewChat: hookState.handleNewChat,\n handleHistoryToggle: hookState.handleHistoryToggle,\n handleFolding: hookState.handleFolding,\n handleClose: hookState.handleClose,\n historyButtonRef: hookState.historyButtonRef,\n qa: resolveChatContainerQa(qaMap, 'header', 'header') ?? headerProps.qa,\n actionQa,\n actionTooltipTexts,\n menuButtonQa:\n resolveChatContainerQa(qaMap, 'headerMenuButton', 'header-menu-button') ??\n headerProps.menuButtonQa,\n menuButtonTooltip: texts.headerMenuTooltip ?? headerProps.menuButtonTooltip,\n menuItemQa: resolveHeaderMenuItemQa(\n qaMap,\n headerProps.menuItems,\n headerProps.menuItemQa,\n ),\n };\n }, [\n headerTitle,\n showTitle,\n hookState.baseActions,\n hookState.handleNewChat,\n hookState.handleHistoryToggle,\n hookState.handleFolding,\n hookState.handleClose,\n hookState.historyButtonRef,\n headerProps,\n qaMap,\n texts.headerNewChatTooltip,\n texts.headerHistoryTooltip,\n texts.headerCloseTooltip,\n texts.headerFoldingCollapsedTooltip,\n texts.headerFoldingOpenedTooltip,\n texts.headerMenuTooltip,\n ]);\n\n // Build props for EmptyContainer\n const finalEmptyContainerProps = useMemo(() => {\n const {showDefaultTitle = true, showDefaultDescription = true} = welcomeConfig || {};\n\n return {\n ...emptyContainerProps,\n qa:\n resolveChatContainerQa(qaMap, 'emptyState', 'empty-state') ??\n emptyContainerProps.qa,\n image: welcomeConfig?.image,\n title:\n texts.emptyStateTitle ??\n welcomeConfig?.title ??\n emptyContainerProps.title ??\n (showDefaultTitle ? i18n('empty-state-title') : undefined),\n description:\n texts.emptyStateDescription ??\n welcomeConfig?.description ??\n emptyContainerProps.description ??\n (showDefaultDescription ? i18n('empty-state-description') : undefined),\n suggestionTitle:\n texts.emptyStateSuggestionsTitle ??\n welcomeConfig?.suggestionTitle ??\n emptyContainerProps.suggestionTitle,\n suggestions: welcomeConfig?.suggestions,\n alignment: {\n ...emptyContainerProps.alignment,\n ...welcomeConfig?.alignment,\n ...(mascotView === 'hero' &&\n mascotNode &&\n emptyContainerProps.alignment?.hero === undefined &&\n welcomeConfig?.alignment?.hero === undefined\n ? {hero: 'center' as const}\n : {}),\n },\n heroContent:\n emptyContainerProps.heroContent ?? (mascotView === 'hero' ? mascotNode : undefined),\n layout: welcomeConfig?.layout ?? emptyContainerProps.layout,\n wrapText: welcomeConfig?.wrapText ?? emptyContainerProps.wrapText,\n showMore: welcomeConfig?.showMore,\n showMoreText:\n texts.emptyStateShowMoreText ??\n welcomeConfig?.showMoreText ??\n emptyContainerProps.showMoreText ??\n i18n('empty-state-show-more'),\n onSuggestionClick: async (\n content: string,\n suggestionId?: string,\n suggestionData?: Record<string, unknown>,\n ) => {\n const suggestion = toSuggestionContext(suggestionId, suggestionData);\n\n await wrappedOnSendMessage({\n content,\n ...(suggestion && {suggestion}),\n });\n },\n };\n }, [\n welcomeConfig,\n emptyContainerProps,\n wrappedOnSendMessage,\n qaMap,\n texts.emptyStateTitle,\n texts.emptyStateDescription,\n texts.emptyStateSuggestionsTitle,\n texts.emptyStateShowMoreText,\n mascotNode,\n mascotView,\n ]);\n\n // Build props for MessageList\n const messageListProps = useMemo(\n () => ({\n ...messageListConfig,\n messages,\n status,\n errorMessage: texts.errorText\n ? {...(messageListConfig?.errorMessage ?? {}), text: texts.errorText}\n : messageListConfig?.errorMessage || (error ? {text: error.message} : undefined),\n onRetry: wrappedOnRetry,\n showActionsOnHover,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n qa:\n resolveChatContainerQa(qaMap, 'messageList', 'message-list') ??\n messageListConfig?.qa,\n actionPopupProps: {\n ...messageListConfig?.actionPopupProps,\n qa:\n resolveChatContainerQa(qaMap, 'actionPopup', 'action-popup') ??\n messageListConfig?.actionPopupProps?.qa,\n },\n footerContent:\n mascotView === 'chat' && mascotNode !== undefined && mascotNode !== null ? (\n <Fragment>\n {messageListConfig?.footerContent}\n {mascotNode}\n </Fragment>\n ) : (\n messageListConfig?.footerContent\n ),\n }),\n [\n messages,\n status,\n error,\n wrappedOnRetry,\n showActionsOnHover,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n messageListConfig,\n qaMap,\n texts.errorText,\n mascotNode,\n mascotView,\n ],\n );\n\n // Build props for PromptInput\n const finalPromptInputProps = useMemo(\n () =>\n buildFinalPromptInputProps({\n promptInputProps,\n onSendMessage: wrappedOnSendMessage,\n onCancel: wrappedOnCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n texts,\n promptInputKey: hookState.promptInputKey,\n qaMap,\n onValueChange: mascotConfig ? mascotState.handleValueChange : undefined,\n }),\n [\n wrappedOnSendMessage,\n wrappedOnCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n promptInputProps,\n hookState.promptInputKey,\n qaMap,\n texts.promptPlaceholder,\n texts.promptSuggestTitle,\n texts.submitSendTooltip,\n texts.submitCancelTooltip,\n texts.submitButtonCancelableText,\n mascotState.handleValueChange,\n mascotConfig,\n ],\n );\n\n // Build props for Disclaimer\n const finalDisclaimerProps = useMemo(() => {\n const disclaimerText =\n texts.disclaimerText ?? disclaimerProps.text ?? i18n('disclaimer-text');\n\n return {\n ...disclaimerProps,\n text: disclaimerText,\n qa: resolveChatContainerQa(qaMap, 'disclaimer', 'disclaimer') ?? disclaimerProps.qa,\n };\n }, [disclaimerProps, qaMap, texts.disclaimerText]);\n\n // Build props for ChatContent\n const finalContentProps = useMemo(\n () => ({\n ...contentProps,\n qa: resolveChatContainerQa(qaMap, 'content', 'content') ?? contentProps.qa,\n view: hookState.chatContentView as 'empty' | 'chat',\n emptyContainerProps: finalEmptyContainerProps,\n messageListProps,\n }),\n [\n hookState.chatContentView,\n finalEmptyContainerProps,\n messageListProps,\n contentProps,\n qaMap,\n ],\n );\n\n // Build props for History\n const finalHistoryProps = useMemo(\n () => ({\n ...historyProps,\n qa: resolveChatContainerQa(qaMap, 'history', 'history') ?? historyProps.qa,\n chats,\n selectedChat: hookState.activeChat,\n onSelectChat: hookState.handleSelectChat,\n onDeleteChat,\n open: hookState.isHistoryOpen,\n onOpenChange: (open: boolean) => {\n historyProps.onOpenChange?.(open);\n hookState.handleHistoryOpenChange(open);\n },\n anchorElement: hookState.historyButtonRef.current,\n emptyPlaceholder:\n texts.historyEmptyPlaceholder ??\n historyProps.emptyPlaceholder ??\n i18n('history-empty'),\n emptyFilteredPlaceholder:\n texts.historyEmptyFilteredPlaceholder ??\n historyProps.emptyFilteredPlaceholder ??\n i18n('history-empty-filtered'),\n searchPlaceholder: texts.historySearchPlaceholder ?? historyProps.searchPlaceholder,\n }),\n [\n chats,\n hookState.activeChat,\n hookState.handleSelectChat,\n onDeleteChat,\n hookState.isHistoryOpen,\n hookState.handleHistoryOpenChange,\n hookState.historyButtonRef,\n historyProps,\n qaMap,\n texts.historyEmptyPlaceholder,\n texts.historyEmptyFilteredPlaceholder,\n texts.historySearchPlaceholder,\n ],\n );\n\n const showFooter = finalPromptInputProps || finalDisclaimerProps;\n\n return (\n <MobileProvider mobile={isMobile}>\n <div\n ref={rootRef}\n className={b({mobile: isMobile, 'keyboard-open': isKeyboardOpen}, className)}\n style={maxHeight === undefined ? undefined : {maxHeight}}\n data-qa={resolveChatContainerRootQa(qaMap)}\n >\n <div className={b('header', headerClassName)}>\n <Header {...finalHeaderProps} />\n </div>\n <div className={b('content', {view: hookState.chatContentView}, contentClassName)}>\n <ChatContent {...finalContentProps} />\n </div>\n {showFooter && (\n <div\n className={b('footer', {view: hookState.chatContentView}, footerClassName)}\n >\n {finalPromptInputProps && (\n <PromptInput\n key={hookState.promptInputKey}\n {...finalPromptInputProps}\n />\n )}\n {finalDisclaimerProps && <Disclaimer {...finalDisclaimerProps} />}\n </div>\n )}\n {/* History is integrated via popup anchored to button in Header */}\n <History {...finalHistoryProps} />\n </div>\n </MobileProvider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ChatContainer.js","sourceRoot":"../../../../../src","sources":["components/pages/ChatContainer/ChatContainer.tsx"],"names":[],"mappings":";;AAsLA,sCAofC;;;AA1qBD,iCAA6E;AAE7E,6CAA4D;AAE5D,mDAA8E;AAE9E,6CAAwC;AACxC,qDAAkG;AAClG,gEAAkD;AAClD,4DAA8E;AAC9E,sEAA+E;AAC/E,sEAAwD;AACxD,8DAAgD;AAEhD,0DAK2B;AAC3B,0CAA4B;AAE5B,4DAAoD;AACpD,wEAAgE;AAEhE,+BAA8B;AAE9B,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,gBAAgB,CAAC,CAAC;AAIlC,SAAS,mBAAmB,CACxB,EAAW,EACX,IAA8B;IAE9B,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,uCACO,CAAC,EAAE,IAAI,EAAC,EAAE,EAAC,CAAC,GACZ,CAAC,IAAI,IAAI,EAAC,IAAI,EAAC,CAAC,EACrB;AACN,CAAC;AAED,SAAS,gCAAgC,CACrC,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EAAC,IAAI,EAAE,SAAS,CAAC,eAAe,EAAC,EAAE,gBAAgB,CAAC,YAC7E,uBAAC,yBAAW,oBAAK,iBAAiB,EAAI,GACpC,EACL,UAAU,IAAI,CACX,iCACI,SAAS,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,CAAC,eAAe,EAAC,EAAE,eAAe,CAAC,aAEzE,qBAAqB,IAAI,CACtB,uBAAC,yBAAW,oBAEJ,qBAAqB,GADpB,SAAS,CAAC,cAAc,CAE/B,CACL,EACA,oBAAoB,IAAI,uBAAC,uBAAU,oBAAK,oBAAoB,EAAI,IAC/D,CACT,EAED,uBAAC,iBAAO,oBAAK,iBAAiB,EAAI,IAChC,GACO,CACpB,CAAC;AACN,CAAC","sourcesContent":["import {Fragment, type ReactNode, useCallback, useMemo, useRef} from 'react';\n\nimport {MobileProvider, useMobile} from '@gravity-ui/uikit';\n\nimport {getMascotAnimationType, useKeyboardViewportFit} from '../../../hooks';\nimport type {TSuggestionContext} from '../../../types/messages';\nimport {block} from '../../../utils/cn';\nimport {getMascotNode, resolveMascotAssets, resolveMascotCollection} from '../../../utils/mascot';\nimport {Disclaimer} from '../../atoms/Disclaimer';\nimport {Header, HeaderAction, type HeaderProps} from '../../organisms/Header';\nimport {PromptInput, type PromptInputProps} from '../../organisms/PromptInput';\nimport {ChatContent} from '../../templates/ChatContent';\nimport {History} from '../../templates/History';\n\nimport {\n normalizeChatContainerQa,\n resolveChatContainerQa,\n resolveChatContainerRootQa,\n resolveHeaderMenuItemQa,\n} from './chatContainerQa';\nimport {i18n} from './i18n';\nimport type {ChatContainerProps, ChatContainerTexts} from './types';\nimport {useChatContainer} from './useChatContainer';\nimport {useChatContainerMascot} from './useChatContainerMascot';\n\nimport './ChatContainer.scss';\n\nconst b = block('chat-container');\n\ntype NormalizedChatContainerQa = ReturnType<typeof normalizeChatContainerQa>;\n\nfunction toSuggestionContext(\n id?: string,\n data?: Record<string, unknown>,\n): TSuggestionContext | undefined {\n if (!id && !data) {\n return undefined;\n }\n\n return {\n ...(id && {id}),\n ...(data && {data}),\n };\n}\n\nfunction mergePromptInputSuggestionsProps(\n fromProps: PromptInputProps['suggestionsProps'] | undefined,\n textsSuggestTitle: ReactNode | undefined,\n): PromptInputProps['suggestionsProps'] | undefined {\n const hasSuggestionsFromProps = Boolean(fromProps);\n const hasSuggestTitleFromTexts = textsSuggestTitle !== undefined;\n if (!hasSuggestionsFromProps && !hasSuggestTitleFromTexts) {\n return undefined;\n }\n return {\n ...fromProps,\n suggestTitle: textsSuggestTitle ?? fromProps?.suggestTitle,\n };\n}\n\nfunction buildFinalPromptInputHeaderProps(args: {\n headerProps: NonNullable<ChatContainerProps['promptInputProps']>['headerProps'];\n contextItems: ChatContainerProps['contextItems'];\n showContextIndicator: ChatContainerProps['showContextIndicator'];\n contextIndicatorProps: ChatContainerProps['contextIndicatorProps'];\n qa: string | undefined;\n}): NonNullable<ChatContainerProps['promptInputProps']>['headerProps'] {\n const {headerProps, contextItems, showContextIndicator, contextIndicatorProps, qa} = args;\n\n // topContent replaces the default header entirely, so context-related\n // props are not allowed (and would be ignored) alongside it\n if (headerProps?.topContent) {\n return {topContent: headerProps.topContent, qa};\n }\n\n return {\n contextItems,\n showContextIndicator: showContextIndicator ?? headerProps?.showContextIndicator,\n contextIndicatorProps: contextIndicatorProps ?? headerProps?.contextIndicatorProps,\n qa,\n };\n}\n\nfunction buildFinalPromptInputProps(args: {\n promptInputProps: ChatContainerProps['promptInputProps'];\n onSendMessage: ChatContainerProps['onSendMessage'];\n onCancel: ChatContainerProps['onCancel'];\n status: ChatContainerProps['status'];\n contextItems: ChatContainerProps['contextItems'];\n showContextIndicator: ChatContainerProps['showContextIndicator'];\n contextIndicatorProps: ChatContainerProps['contextIndicatorProps'];\n texts: ChatContainerTexts;\n promptInputKey: number;\n qaMap: NormalizedChatContainerQa;\n onValueChange?: (value: string) => void;\n}) {\n const {\n promptInputProps,\n onSendMessage,\n onCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n texts: textsArg,\n promptInputKey,\n qaMap,\n onValueChange,\n } = args;\n\n const texts = textsArg ?? {};\n\n const {\n autoFocusOnNewChat: _autoFocusOnNewChat,\n autoFocusOnChatSelect: _autoFocusOnChatSelect,\n ...restBodyProps\n } = promptInputProps?.bodyProps ?? {};\n\n const suggestionsProps = mergePromptInputSuggestionsProps(\n promptInputProps?.suggestionsProps,\n texts.promptSuggestTitle,\n );\n\n return {\n ...promptInputProps,\n onValueChange:\n onValueChange || promptInputProps?.onValueChange\n ? (value: string) => {\n onValueChange?.(value);\n promptInputProps?.onValueChange?.(value);\n }\n : undefined,\n qa: resolveChatContainerQa(qaMap, 'promptInput', 'prompt-input') ?? promptInputProps?.qa,\n onSend: onSendMessage,\n onCancel,\n status,\n suggestionsProps,\n headerProps: buildFinalPromptInputHeaderProps({\n headerProps: promptInputProps?.headerProps,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputHeader', 'prompt-input-header') ??\n promptInputProps?.headerProps?.qa,\n }),\n bodyProps: {\n ...restBodyProps,\n placeholder:\n texts.promptPlaceholder || restBodyProps?.placeholder || i18n('prompt-placeholder'),\n autoFocus: promptInputKey > 0 || restBodyProps?.autoFocus,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputBody', 'prompt-input-body') ??\n restBodyProps?.qa,\n },\n footerProps: {\n ...promptInputProps?.footerProps,\n submitButtonTooltipSend:\n texts?.submitSendTooltip ?? promptInputProps?.footerProps?.submitButtonTooltipSend,\n submitButtonTooltipCancel:\n texts?.submitCancelTooltip ??\n promptInputProps?.footerProps?.submitButtonTooltipCancel,\n submitButtonCancelableText:\n texts?.submitButtonCancelableText ??\n promptInputProps?.footerProps?.submitButtonCancelableText,\n qa:\n resolveChatContainerQa(qaMap, 'promptInputFooter', 'prompt-input-footer') ??\n promptInputProps?.footerProps?.qa,\n submitButtonQa:\n resolveChatContainerQa(qaMap, 'submitButton', 'submit-button') ??\n promptInputProps?.footerProps?.submitButtonQa,\n },\n };\n}\n\n/**\n * ChatContainer - fully assembled chat component, the main exportable component of the library.\n * Integrates Header, ChatContent, History and manages their state.\n *\n * @param props - component props\n * @returns React component\n */\nexport function ChatContainer(props: ChatContainerProps) {\n const {\n chats = [],\n messages = [],\n onSendMessage,\n onDeleteChat,\n onCancel,\n onRetry,\n status = 'ready',\n error = null,\n showActionsOnHover = false,\n contextItems = [],\n showContextIndicator,\n contextIndicatorProps,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n messageListConfig,\n mascotConfig,\n headerProps = {},\n contentProps = {},\n emptyContainerProps = {},\n promptInputProps = {},\n disclaimerProps = {},\n historyProps = {},\n welcomeConfig,\n texts = {},\n hideTitleOnEmptyChat = false,\n isMobile: isMobileProp,\n adjustToKeyboard = true,\n floatingHeader = false,\n className,\n headerClassName,\n contentClassName,\n footerClassName,\n qa,\n } = props;\n\n const isMobileContext = useMobile();\n const isMobile = isMobileProp ?? isMobileContext;\n\n const rootRef = useRef<HTMLDivElement>(null);\n // Keeps the footer (prompt input + disclaimer) above the on-screen keyboard on iOS Safari,\n // where the layout viewport stays full-height while the keyboard is open.\n const {isKeyboardOpen, maxHeight} = useKeyboardViewportFit(\n rootRef,\n isMobile && adjustToKeyboard,\n );\n\n const hookState = useChatContainer(props);\n\n const mascotState = useChatContainerMascot({\n config: mascotConfig,\n view: hookState.chatContentView === 'empty' ? 'hero' : 'chat',\n status,\n messagesCount: messages.length,\n activeChatId: hookState.activeChat?.id,\n promptInputKey: hookState.promptInputKey,\n });\n\n const wrappedOnSendMessage = useCallback(\n async (...args: Parameters<typeof onSendMessage>) => {\n mascotState.notifyActivity();\n return onSendMessage(...args);\n },\n [mascotState.notifyActivity, onSendMessage],\n );\n const wrappedOnCancel = useMemo(() => {\n if (!onCancel) {\n return undefined;\n }\n return async () => {\n await onCancel();\n mascotState.handleCancelResolved();\n };\n }, [mascotState.handleCancelResolved, onCancel]);\n const wrappedOnRetry = useMemo(() => {\n if (!onRetry) {\n return undefined;\n }\n return () => {\n mascotState.notifyActivity();\n onRetry();\n };\n }, [mascotState.notifyActivity, onRetry]);\n\n const resolvedMascotAssets = useMemo(\n () => resolveMascotAssets(mascotConfig?.defaultAssets, mascotConfig?.assets),\n [mascotConfig?.assets, mascotConfig?.defaultAssets],\n );\n const resolvedMascots = useMemo(\n () => resolveMascotCollection(mascotConfig?.defaultMascots, mascotConfig?.mascots),\n [mascotConfig?.defaultMascots, mascotConfig?.mascots],\n );\n const mascotView = hookState.chatContentView === 'empty' ? 'hero' : 'chat';\n const mascotNode = useMemo(() => {\n if (!mascotConfig) {\n return undefined;\n }\n if (mascotView === 'hero' && mascotConfig.showOnWelcome === false) {\n return undefined;\n }\n if (mascotView === 'chat' && mascotConfig.showInChat === false) {\n return undefined;\n }\n const node = mascotConfig.renderMascot\n ? mascotConfig.renderMascot({\n view: mascotView,\n state: mascotState.state,\n animationType: getMascotAnimationType(mascotState.state),\n assets: resolvedMascotAssets,\n })\n : getMascotNode(resolvedMascots, mascotView, mascotState.state);\n if (node === undefined || node === null) {\n return undefined;\n }\n return <div className={b('mascot', {view: mascotView})}>{node}</div>;\n }, [mascotConfig, mascotState.state, mascotView, resolvedMascotAssets, resolvedMascots]);\n\n const qaMap = useMemo(() => normalizeChatContainerQa(qa), [qa]);\n\n // Collect i18n texts with overrides\n const headerTitle = useMemo(\n () =>\n texts.headerTitle ||\n headerProps.title ||\n hookState.activeChat?.name ||\n i18n('header-default-title'),\n [texts.headerTitle, headerProps.title, hookState.activeChat?.name],\n );\n\n // Determine if chat is empty\n const isChatEmpty = hookState.chatContentView === 'empty';\n\n // Calculate showTitle based on hideTitleOnEmptyChat option\n const showTitle = useMemo(() => {\n // If explicit showTitle is provided in headerProps, use it\n if (headerProps.showTitle !== undefined) {\n return headerProps.showTitle;\n }\n // If hideTitleOnEmptyChat is enabled, show title only when chat has messages\n if (hideTitleOnEmptyChat && isChatEmpty) {\n return false;\n }\n return true;\n }, [hideTitleOnEmptyChat, isChatEmpty, headerProps.showTitle]);\n\n // Build props for Header\n const finalHeaderProps = useMemo(() => {\n const actionQa: Partial<Record<HeaderAction, string>> = {\n ...headerProps.actionQa,\n };\n const setHeaderActionQa = (\n action: HeaderAction,\n key: 'headerNewChat' | 'headerHistory' | 'headerFolding' | 'headerClose',\n suffix: string,\n ) => {\n const resolved = resolveChatContainerQa(qaMap, key, suffix);\n if (resolved !== undefined) {\n actionQa[action] = resolved;\n }\n };\n setHeaderActionQa(HeaderAction.NewChat, 'headerNewChat', 'header-action-newChat');\n setHeaderActionQa(HeaderAction.History, 'headerHistory', 'header-action-history');\n setHeaderActionQa(HeaderAction.Folding, 'headerFolding', 'header-action-folding');\n setHeaderActionQa(HeaderAction.Close, 'headerClose', 'header-action-close');\n\n const actionTooltipTexts: NonNullable<HeaderProps['actionTooltipTexts']> = {\n [HeaderAction.NewChat]:\n texts.headerNewChatTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.NewChat],\n [HeaderAction.History]:\n texts.headerHistoryTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.History],\n [HeaderAction.Close]:\n texts.headerCloseTooltip ?? headerProps.actionTooltipTexts?.[HeaderAction.Close],\n [HeaderAction.Folding]: {\n collapsed:\n texts.headerFoldingCollapsedTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.Folding]?.collapsed,\n opened:\n texts.headerFoldingOpenedTooltip ??\n headerProps.actionTooltipTexts?.[HeaderAction.Folding]?.opened,\n },\n };\n\n return {\n ...headerProps,\n title: headerTitle,\n showTitle,\n baseActions: hookState.baseActions,\n handleNewChat: hookState.handleNewChat,\n handleHistoryToggle: hookState.handleHistoryToggle,\n handleFolding: hookState.handleFolding,\n handleClose: hookState.handleClose,\n historyButtonRef: hookState.historyButtonRef,\n qa: resolveChatContainerQa(qaMap, 'header', 'header') ?? headerProps.qa,\n actionQa,\n actionTooltipTexts,\n menuButtonQa:\n resolveChatContainerQa(qaMap, 'headerMenuButton', 'header-menu-button') ??\n headerProps.menuButtonQa,\n menuButtonTooltip: texts.headerMenuTooltip ?? headerProps.menuButtonTooltip,\n menuItemQa: resolveHeaderMenuItemQa(\n qaMap,\n headerProps.menuItems,\n headerProps.menuItemQa,\n ),\n };\n }, [\n headerTitle,\n showTitle,\n hookState.baseActions,\n hookState.handleNewChat,\n hookState.handleHistoryToggle,\n hookState.handleFolding,\n hookState.handleClose,\n hookState.historyButtonRef,\n headerProps,\n qaMap,\n texts.headerNewChatTooltip,\n texts.headerHistoryTooltip,\n texts.headerCloseTooltip,\n texts.headerFoldingCollapsedTooltip,\n texts.headerFoldingOpenedTooltip,\n texts.headerMenuTooltip,\n ]);\n\n // Build props for EmptyContainer\n const finalEmptyContainerProps = useMemo(() => {\n const {showDefaultTitle = true, showDefaultDescription = true} = welcomeConfig || {};\n\n return {\n ...emptyContainerProps,\n qa:\n resolveChatContainerQa(qaMap, 'emptyState', 'empty-state') ??\n emptyContainerProps.qa,\n image: welcomeConfig?.image,\n title:\n texts.emptyStateTitle ??\n welcomeConfig?.title ??\n emptyContainerProps.title ??\n (showDefaultTitle ? i18n('empty-state-title') : undefined),\n description:\n texts.emptyStateDescription ??\n welcomeConfig?.description ??\n emptyContainerProps.description ??\n (showDefaultDescription ? i18n('empty-state-description') : undefined),\n suggestionTitle:\n texts.emptyStateSuggestionsTitle ??\n welcomeConfig?.suggestionTitle ??\n emptyContainerProps.suggestionTitle,\n suggestions: welcomeConfig?.suggestions,\n alignment: {\n ...emptyContainerProps.alignment,\n ...welcomeConfig?.alignment,\n ...(mascotView === 'hero' &&\n mascotNode &&\n emptyContainerProps.alignment?.hero === undefined &&\n welcomeConfig?.alignment?.hero === undefined\n ? {hero: 'center' as const}\n : {}),\n },\n heroContent:\n emptyContainerProps.heroContent ?? (mascotView === 'hero' ? mascotNode : undefined),\n layout: welcomeConfig?.layout ?? emptyContainerProps.layout,\n wrapText: welcomeConfig?.wrapText ?? emptyContainerProps.wrapText,\n showMore: welcomeConfig?.showMore,\n showMoreText:\n texts.emptyStateShowMoreText ??\n welcomeConfig?.showMoreText ??\n emptyContainerProps.showMoreText ??\n i18n('empty-state-show-more'),\n onSuggestionClick: async (\n content: string,\n suggestionId?: string,\n suggestionData?: Record<string, unknown>,\n ) => {\n const suggestion = toSuggestionContext(suggestionId, suggestionData);\n\n await wrappedOnSendMessage({\n content,\n ...(suggestion && {suggestion}),\n });\n },\n };\n }, [\n welcomeConfig,\n emptyContainerProps,\n wrappedOnSendMessage,\n qaMap,\n texts.emptyStateTitle,\n texts.emptyStateDescription,\n texts.emptyStateSuggestionsTitle,\n texts.emptyStateShowMoreText,\n mascotNode,\n mascotView,\n ]);\n\n // Build props for MessageList\n const messageListProps = useMemo(\n () => ({\n ...messageListConfig,\n messages,\n status,\n errorMessage: texts.errorText\n ? {...(messageListConfig?.errorMessage ?? {}), text: texts.errorText}\n : messageListConfig?.errorMessage || (error ? {text: error.message} : undefined),\n onRetry: wrappedOnRetry,\n showActionsOnHover,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n qa:\n resolveChatContainerQa(qaMap, 'messageList', 'message-list') ??\n messageListConfig?.qa,\n actionPopupProps: {\n ...messageListConfig?.actionPopupProps,\n qa:\n resolveChatContainerQa(qaMap, 'actionPopup', 'action-popup') ??\n messageListConfig?.actionPopupProps?.qa,\n },\n footerContent:\n mascotView === 'chat' && mascotNode !== undefined && mascotNode !== null ? (\n <Fragment>\n {messageListConfig?.footerContent}\n {mascotNode}\n </Fragment>\n ) : (\n messageListConfig?.footerContent\n ),\n }),\n [\n messages,\n status,\n error,\n wrappedOnRetry,\n showActionsOnHover,\n transformOptions,\n shouldParseIncompleteMarkdown,\n openMarkdownLinksInNewTab,\n mdxProps,\n messageListConfig,\n qaMap,\n texts.errorText,\n mascotNode,\n mascotView,\n ],\n );\n\n // Build props for PromptInput\n const finalPromptInputProps = useMemo(\n () =>\n buildFinalPromptInputProps({\n promptInputProps,\n onSendMessage: wrappedOnSendMessage,\n onCancel: wrappedOnCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n texts,\n promptInputKey: hookState.promptInputKey,\n qaMap,\n onValueChange: mascotConfig ? mascotState.handleValueChange : undefined,\n }),\n [\n wrappedOnSendMessage,\n wrappedOnCancel,\n status,\n contextItems,\n showContextIndicator,\n contextIndicatorProps,\n promptInputProps,\n hookState.promptInputKey,\n qaMap,\n texts.promptPlaceholder,\n texts.promptSuggestTitle,\n texts.submitSendTooltip,\n texts.submitCancelTooltip,\n texts.submitButtonCancelableText,\n mascotState.handleValueChange,\n mascotConfig,\n ],\n );\n\n // Build props for Disclaimer\n const finalDisclaimerProps = useMemo(() => {\n const disclaimerText =\n texts.disclaimerText ?? disclaimerProps.text ?? i18n('disclaimer-text');\n\n return {\n ...disclaimerProps,\n text: disclaimerText,\n qa: resolveChatContainerQa(qaMap, 'disclaimer', 'disclaimer') ?? disclaimerProps.qa,\n };\n }, [disclaimerProps, qaMap, texts.disclaimerText]);\n\n // Build props for ChatContent\n const finalContentProps = useMemo(\n () => ({\n ...contentProps,\n qa: resolveChatContainerQa(qaMap, 'content', 'content') ?? contentProps.qa,\n view: hookState.chatContentView as 'empty' | 'chat',\n emptyContainerProps: finalEmptyContainerProps,\n messageListProps,\n }),\n [\n hookState.chatContentView,\n finalEmptyContainerProps,\n messageListProps,\n contentProps,\n qaMap,\n ],\n );\n\n // Build props for History\n const finalHistoryProps = useMemo(\n () => ({\n ...historyProps,\n qa: resolveChatContainerQa(qaMap, 'history', 'history') ?? historyProps.qa,\n chats,\n selectedChat: hookState.activeChat,\n onSelectChat: hookState.handleSelectChat,\n onDeleteChat,\n open: hookState.isHistoryOpen,\n onOpenChange: (open: boolean) => {\n historyProps.onOpenChange?.(open);\n hookState.handleHistoryOpenChange(open);\n },\n anchorElement: hookState.historyButtonRef.current,\n emptyPlaceholder:\n texts.historyEmptyPlaceholder ??\n historyProps.emptyPlaceholder ??\n i18n('history-empty'),\n emptyFilteredPlaceholder:\n texts.historyEmptyFilteredPlaceholder ??\n historyProps.emptyFilteredPlaceholder ??\n i18n('history-empty-filtered'),\n searchPlaceholder: texts.historySearchPlaceholder ?? historyProps.searchPlaceholder,\n }),\n [\n chats,\n hookState.activeChat,\n hookState.handleSelectChat,\n onDeleteChat,\n hookState.isHistoryOpen,\n hookState.handleHistoryOpenChange,\n hookState.historyButtonRef,\n historyProps,\n qaMap,\n texts.historyEmptyPlaceholder,\n texts.historyEmptyFilteredPlaceholder,\n texts.historySearchPlaceholder,\n ],\n );\n\n const showFooter = finalPromptInputProps || finalDisclaimerProps;\n\n return (\n <MobileProvider mobile={isMobile}>\n <div\n ref={rootRef}\n className={b(\n {\n mobile: isMobile,\n 'keyboard-open': isKeyboardOpen,\n 'floating-header': floatingHeader,\n },\n className,\n )}\n style={maxHeight === undefined ? undefined : {maxHeight}}\n data-qa={resolveChatContainerRootQa(qaMap)}\n >\n <div className={b('header', headerClassName)}>\n <Header {...finalHeaderProps} />\n </div>\n <div className={b('content', {view: hookState.chatContentView}, contentClassName)}>\n <ChatContent {...finalContentProps} />\n </div>\n {showFooter && (\n <div\n className={b('footer', {view: hookState.chatContentView}, footerClassName)}\n >\n {finalPromptInputProps && (\n <PromptInput\n key={hookState.promptInputKey}\n {...finalPromptInputProps}\n />\n )}\n {finalDisclaimerProps && <Disclaimer {...finalDisclaimerProps} />}\n </div>\n )}\n {/* History is integrated via popup anchored to button in Header */}\n <History {...finalHistoryProps} />\n </div>\n </MobileProvider>\n );\n}\n"]}
|
|
@@ -194,6 +194,24 @@ export interface ChatContainerProps {
|
|
|
194
194
|
* @default true
|
|
195
195
|
*/
|
|
196
196
|
adjustToKeyboard?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Renders the header above the content instead of stacking it on top: the message list and
|
|
199
|
+
* the welcome screen scroll underneath. The header is taken out of the flow, so the content
|
|
200
|
+
* has to be offset by its height manually — the offset depends on the layout. Set an explicit
|
|
201
|
+
* height first: `--g-aikit-chat-container-header-height` is `auto` by default and
|
|
202
|
+
* `--g-aikit-chat-container-mobile-header-height` is `60px` in mobile mode. Pair it with a
|
|
203
|
+
* transparent `--g-aikit-chat-container-header-background` to let the content show through.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* .my-chat {
|
|
207
|
+
* --g-aikit-chat-container-header-height: 60px;
|
|
208
|
+
* --g-aikit-chat-container-header-background: transparent;
|
|
209
|
+
* }
|
|
210
|
+
* .my-chat .g-aikit-chat-container__content {
|
|
211
|
+
* padding-top: var(--g-aikit-chat-container-header-height);
|
|
212
|
+
* }
|
|
213
|
+
*/
|
|
214
|
+
floatingHeader?: boolean;
|
|
197
215
|
/** Chat status: submitted, streaming, ready, error */
|
|
198
216
|
status?: ChatStatus;
|
|
199
217
|
/** Error state */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"../../../../../src","sources":["components/pages/ChatContainer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {OptionsType} from '@diplodoc/transform/lib/typings';\n\nimport {MdxProps, MessageListProps} from 'src/components/organisms/MessageList';\n\nimport type {\n ChatStatus,\n ChatType,\n MascotAssets,\n MascotCollection,\n MascotRenderContext,\n MascotState,\n TChatMessage,\n TSubmitData,\n} from '../../../types';\nimport type {SuggestionsItem} from '../../../types/common';\nimport type {ContextIndicatorProps} from '../../atoms/ContextIndicator';\nimport type {DisclaimerProps} from '../../atoms/Disclaimer';\nimport type {ContextItemConfig} from '../../molecules/PromptInputHeader';\nimport type {HeaderProps} from '../../organisms/Header';\nimport type {PromptInputProps} from '../../organisms/PromptInput';\nimport type {ChatContentProps} from '../../templates/ChatContent';\nimport type {AlignmentConfig, EmptyContainerProps} from '../../templates/EmptyContainer';\nimport type {HistoryProps} from '../../templates/History';\n\n/**\n * Welcome screen configuration\n */\nexport interface WelcomeConfig {\n /** Image or icon to display */\n image?: React.ReactNode;\n /** Title text or custom React element */\n title?: React.ReactNode;\n /** Description text or custom React element */\n description?: React.ReactNode;\n /** Suggestions section title - can be string or custom React element */\n suggestionTitle?: React.ReactNode;\n /** Array of suggestions (title will be used as message content) */\n suggestions?: SuggestionsItem[];\n /** Alignment configuration for image, title, and description */\n alignment?: AlignmentConfig;\n /** Layout orientation for suggestions: 'grid' for horizontal, 'list' for vertical */\n layout?: 'grid' | 'list';\n /** Enable text wrapping inside suggestion buttons instead of ellipsis */\n wrapText?: boolean;\n /** Show default title when neither title nor `texts.emptyStateTitle` / `emptyContainerProps.title` are provided */\n showDefaultTitle?: boolean;\n /** Show default description when neither description nor `texts.emptyStateDescription` / `emptyContainerProps.description` are provided */\n showDefaultDescription?: boolean;\n /** Show more suggestions callback */\n showMore?: () => void;\n /** Show more button text */\n showMoreText?: string;\n}\n\nexport interface MascotConfig<TAsset = string> {\n /** External state override, primarily for audio states or full consumer control. */\n stateOverride?: MascotState;\n assets?: MascotAssets<TAsset>;\n defaultAssets?: MascotAssets<TAsset>;\n /** Ready-to-render animated mascots grouped by welcome/chat surface and state. */\n mascots?: MascotCollection;\n /** Product-wide fallback mascots merged underneath `mascots`. */\n defaultMascots?: MascotCollection;\n /** Advanced renderer. Takes precedence over `mascots` when provided. */\n renderMascot?: (context: MascotRenderContext<TAsset>) => React.ReactNode;\n showOnWelcome?: boolean;\n showInChat?: boolean;\n sleepDelayMs?: number | null;\n onceDurations?: Partial<Record<'reveal' | 'done' | 'error' | 'stopped', number>>;\n onStateChange?: (state: MascotState) => void;\n}\n\n/**\n * MessageList configuration\n */\nexport type MessageListConfig = Omit<\n MessageListProps,\n | 'messages'\n | 'status'\n | 'onRetry'\n | 'showActionsOnHover'\n | 'transformOptions'\n | 'openMarkdownLinksInNewTab'\n | 'mdxProps'\n>;\n\n/**\n * Unified visible strings for ChatContainer and its subtree.\n *\n * `texts.*` always wins. Below that, each area uses `welcomeConfig`, per-section `*Props` text fields,\n * then built-in defaults from `i18n()`.\n */\nexport interface ChatContainerTexts {\n /** Default header title when not using `headerProps.title` or active chat name */\n headerTitle?: string;\n /** Tooltip for the \"new chat\" header button */\n headerNewChatTooltip?: string;\n /** Tooltip for the \"history\" header button */\n headerHistoryTooltip?: string;\n /** Tooltip for the \"close\" header button */\n headerCloseTooltip?: string;\n /** Tooltip for the folding header button when collapsed (expand action) */\n headerFoldingCollapsedTooltip?: string;\n /** Tooltip for the folding header button when opened (collapse action) */\n headerFoldingOpenedTooltip?: string;\n /** Tooltip for the header menu button */\n headerMenuTooltip?: string;\n /** Empty state / welcome title */\n emptyStateTitle?: React.ReactNode;\n /** Empty state / welcome description */\n emptyStateDescription?: React.ReactNode;\n /** Title above suggestions on welcome screen */\n emptyStateSuggestionsTitle?: React.ReactNode;\n /** \"Show more\" button label on welcome screen */\n emptyStateShowMoreText?: string;\n /** Prompt textarea placeholder */\n promptPlaceholder?: string;\n /** Title above suggestions rendered inside PromptInput (`promptInputProps.suggestionsProps.suggestTitle`) */\n promptSuggestTitle?: React.ReactNode;\n /** Submit button tooltip (send / ready state) */\n submitSendTooltip?: string;\n /** Submit button tooltip (cancel / streaming state) */\n submitCancelTooltip?: string;\n /** Label rendered next to the submit button in cancelable state (`submitButtonCancelableText`) */\n submitButtonCancelableText?: string;\n /** Message list error alert main text */\n errorText?: string;\n /** History search/filter placeholder */\n historySearchPlaceholder?: string;\n /** History panel empty state when there are no chats */\n historyEmptyPlaceholder?: React.ReactNode;\n /** History panel empty state when search has no results */\n historyEmptyFilteredPlaceholder?: React.ReactNode;\n /** Disclaimer body text (must be a string; use `disclaimerProps.children` for custom nodes) */\n disclaimerText?: string;\n}\n\n/**\n * Unified test identifiers (`data-qa`) for ChatContainer and its subtree.\n *\n * - Pass a **string** for backward compatibility: only the root container gets `data-qa`.\n * - Pass **`{ prefix: 'x' }`** to opt in to `${prefix}-${suffix}` for every slot below (see README).\n * - Pass **explicit keys** to override individual elements; they win over `prefix` and nested `*Props.qa`.\n */\nexport interface ChatContainerQa {\n /** Applied to child slots when explicit keys are omitted; also used as root if `root` is omitted */\n prefix?: string;\n /** Root chat container */\n root?: string;\n /** Header root */\n header?: string;\n /** Overrides default `header-action-newChat` */\n headerNewChat?: string;\n /** Overrides default `header-action-history` */\n headerHistory?: string;\n /** Overrides default `header-action-folding` */\n headerFolding?: string;\n /** Overrides default `header-action-close` */\n headerClose?: string;\n /** Overrides default `header-menu-button` */\n headerMenuButton?: string;\n /** ChatContent root */\n content?: string;\n /** Empty state (EmptyContainer) */\n emptyState?: string;\n /** MessageList scroll area */\n messageList?: string;\n /** Action popup in MessageList */\n actionPopup?: string;\n /** PromptInput root */\n promptInput?: string;\n promptInputHeader?: string;\n promptInputBody?: string;\n promptInputFooter?: string;\n /** Submit button in prompt footer */\n submitButton?: string;\n /** Disclaimer text block */\n disclaimer?: string;\n /** History list (inside popup) */\n history?: string;\n}\n\n/**\n * Props for ChatContainer component\n */\nexport interface ChatContainerProps {\n // Chat data\n /** Array of chats for history */\n chats?: ChatType[];\n /** Currently active chat */\n activeChat?: ChatType | null;\n /** Array of messages in current chat */\n messages?: TChatMessage[];\n\n // Main callbacks\n /** Callback when user sends a message */\n onSendMessage: (data: TSubmitData) => Promise<void>;\n /** Callback when user selects a chat from history */\n onSelectChat?: (chat: ChatType) => void;\n /** Callback when user creates a new chat */\n onCreateChat?: () => void;\n /** Callback when user deletes a chat */\n onDeleteChat?: (chat: ChatType) => Promise<void>;\n /** Callback when user deletes all chats */\n onDeleteAllChats?: () => Promise<void>;\n /** Callback when user folds or unfolds the chat */\n onFold?: (value: 'collapsed' | 'opened') => void;\n /** Callback when user closes the chat */\n onClose?: () => void;\n /** Callback when user cancels streaming */\n onCancel?: () => Promise<void>;\n\n // Layout\n /**\n * Enables mobile mode for the chat and all inner components.\n * When omitted, falls back to the `useMobile()` value from the\n * `@gravity-ui/uikit` `MobileProvider` context.\n */\n isMobile?: boolean;\n /**\n * In mobile mode, shrinks the container to the visible part of the viewport while the\n * on-screen keyboard is open, so the prompt input and the disclaimer stay above it.\n * Set to `false` when the host application handles the keyboard itself.\n *\n * @default true\n */\n adjustToKeyboard?: boolean;\n\n // States\n /** Chat status: submitted, streaming, ready, error */\n status?: ChatStatus;\n /** Error state */\n error?: Error | null;\n /** Show message actions on hover */\n showActionsOnHover?: boolean;\n /** Callback to retry after error */\n onRetry?: () => void;\n\n // Context\n /** Array of context items to display in prompt input header */\n contextItems?: ContextItemConfig[];\n /** Show context indicator in prompt input header */\n showContextIndicator?: boolean;\n /** Props for the context indicator */\n contextIndicatorProps?: ContextIndicatorProps;\n /** Transform options for markdown rendering */\n transformOptions?: OptionsType;\n /** Should parse incomplete markdown (e.g., during streaming) */\n shouldParseIncompleteMarkdown?: boolean;\n /** Open all markdown links rendered by the default message renderers in a new tab */\n openMarkdownLinksInNewTab?: boolean;\n /**\n * Grouped MDX/markdown rendering props forwarded to the message list:\n * `mdxOptions`, `getMarkdownExtraProps` and `getMdxContext`.\n */\n mdxProps?: MdxProps;\n\n // Configuration\n /** MessageList configuration for actions and loader behavior */\n messageListConfig?: MessageListConfig;\n /** Mascot renderer, assets and lifecycle configuration. */\n mascotConfig?: MascotConfig;\n\n // Component props overrides\n /** Props override for Header component */\n headerProps?: Partial<\n Omit<HeaderProps, 'handleNewChat' | 'handleHistoryToggle' | 'handleFolding' | 'handleClose'>\n >;\n /** Props override for ChatContent component */\n contentProps?: Partial<Omit<ChatContentProps, 'view' | 'messageListProps'>>;\n /** Props override for EmptyContainer (welcome screen) */\n emptyContainerProps?: Partial<EmptyContainerProps>;\n /** Props override for PromptInput component */\n promptInputProps?: Partial<Omit<PromptInputProps, 'onSend' | 'onCancel'>>;\n /** Props override for Disclaimer component */\n disclaimerProps?: Partial<DisclaimerProps>;\n /** Props override for History component */\n historyProps?: Partial<\n Omit<\n HistoryProps,\n 'chats' | 'selectedChat' | 'onSelectChat' | 'onDeleteChat' | 'anchorElement'\n >\n >;\n\n // Configuration\n /** Welcome screen configuration for empty state */\n welcomeConfig?: WelcomeConfig;\n /** Unified flat text overrides for ChatContainer subtree */\n texts?: ChatContainerTexts;\n /** Show chat history feature */\n showHistory?: boolean;\n /** Show new chat button */\n showNewChat?: boolean;\n /** Show folding button */\n showFolding?: boolean;\n /** Show close button */\n showClose?: boolean;\n /** Hide header title when chat is empty */\n hideTitleOnEmptyChat?: boolean;\n\n // Styling\n /** Additional CSS class */\n className?: string;\n /** Additional CSS class for header section */\n headerClassName?: string;\n /** Additional CSS class for content section */\n contentClassName?: string;\n /** Additional CSS class for footer section */\n footerClassName?: string;\n /**\n * QA/test identifiers. A string sets only the root `data-qa`. Use {@link ChatContainerQa} for a full map or `prefix`.\n */\n qa?: string | ChatContainerQa;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"../../../../../src","sources":["components/pages/ChatContainer/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {OptionsType} from '@diplodoc/transform/lib/typings';\n\nimport {MdxProps, MessageListProps} from 'src/components/organisms/MessageList';\n\nimport type {\n ChatStatus,\n ChatType,\n MascotAssets,\n MascotCollection,\n MascotRenderContext,\n MascotState,\n TChatMessage,\n TSubmitData,\n} from '../../../types';\nimport type {SuggestionsItem} from '../../../types/common';\nimport type {ContextIndicatorProps} from '../../atoms/ContextIndicator';\nimport type {DisclaimerProps} from '../../atoms/Disclaimer';\nimport type {ContextItemConfig} from '../../molecules/PromptInputHeader';\nimport type {HeaderProps} from '../../organisms/Header';\nimport type {PromptInputProps} from '../../organisms/PromptInput';\nimport type {ChatContentProps} from '../../templates/ChatContent';\nimport type {AlignmentConfig, EmptyContainerProps} from '../../templates/EmptyContainer';\nimport type {HistoryProps} from '../../templates/History';\n\n/**\n * Welcome screen configuration\n */\nexport interface WelcomeConfig {\n /** Image or icon to display */\n image?: React.ReactNode;\n /** Title text or custom React element */\n title?: React.ReactNode;\n /** Description text or custom React element */\n description?: React.ReactNode;\n /** Suggestions section title - can be string or custom React element */\n suggestionTitle?: React.ReactNode;\n /** Array of suggestions (title will be used as message content) */\n suggestions?: SuggestionsItem[];\n /** Alignment configuration for image, title, and description */\n alignment?: AlignmentConfig;\n /** Layout orientation for suggestions: 'grid' for horizontal, 'list' for vertical */\n layout?: 'grid' | 'list';\n /** Enable text wrapping inside suggestion buttons instead of ellipsis */\n wrapText?: boolean;\n /** Show default title when neither title nor `texts.emptyStateTitle` / `emptyContainerProps.title` are provided */\n showDefaultTitle?: boolean;\n /** Show default description when neither description nor `texts.emptyStateDescription` / `emptyContainerProps.description` are provided */\n showDefaultDescription?: boolean;\n /** Show more suggestions callback */\n showMore?: () => void;\n /** Show more button text */\n showMoreText?: string;\n}\n\nexport interface MascotConfig<TAsset = string> {\n /** External state override, primarily for audio states or full consumer control. */\n stateOverride?: MascotState;\n assets?: MascotAssets<TAsset>;\n defaultAssets?: MascotAssets<TAsset>;\n /** Ready-to-render animated mascots grouped by welcome/chat surface and state. */\n mascots?: MascotCollection;\n /** Product-wide fallback mascots merged underneath `mascots`. */\n defaultMascots?: MascotCollection;\n /** Advanced renderer. Takes precedence over `mascots` when provided. */\n renderMascot?: (context: MascotRenderContext<TAsset>) => React.ReactNode;\n showOnWelcome?: boolean;\n showInChat?: boolean;\n sleepDelayMs?: number | null;\n onceDurations?: Partial<Record<'reveal' | 'done' | 'error' | 'stopped', number>>;\n onStateChange?: (state: MascotState) => void;\n}\n\n/**\n * MessageList configuration\n */\nexport type MessageListConfig = Omit<\n MessageListProps,\n | 'messages'\n | 'status'\n | 'onRetry'\n | 'showActionsOnHover'\n | 'transformOptions'\n | 'openMarkdownLinksInNewTab'\n | 'mdxProps'\n>;\n\n/**\n * Unified visible strings for ChatContainer and its subtree.\n *\n * `texts.*` always wins. Below that, each area uses `welcomeConfig`, per-section `*Props` text fields,\n * then built-in defaults from `i18n()`.\n */\nexport interface ChatContainerTexts {\n /** Default header title when not using `headerProps.title` or active chat name */\n headerTitle?: string;\n /** Tooltip for the \"new chat\" header button */\n headerNewChatTooltip?: string;\n /** Tooltip for the \"history\" header button */\n headerHistoryTooltip?: string;\n /** Tooltip for the \"close\" header button */\n headerCloseTooltip?: string;\n /** Tooltip for the folding header button when collapsed (expand action) */\n headerFoldingCollapsedTooltip?: string;\n /** Tooltip for the folding header button when opened (collapse action) */\n headerFoldingOpenedTooltip?: string;\n /** Tooltip for the header menu button */\n headerMenuTooltip?: string;\n /** Empty state / welcome title */\n emptyStateTitle?: React.ReactNode;\n /** Empty state / welcome description */\n emptyStateDescription?: React.ReactNode;\n /** Title above suggestions on welcome screen */\n emptyStateSuggestionsTitle?: React.ReactNode;\n /** \"Show more\" button label on welcome screen */\n emptyStateShowMoreText?: string;\n /** Prompt textarea placeholder */\n promptPlaceholder?: string;\n /** Title above suggestions rendered inside PromptInput (`promptInputProps.suggestionsProps.suggestTitle`) */\n promptSuggestTitle?: React.ReactNode;\n /** Submit button tooltip (send / ready state) */\n submitSendTooltip?: string;\n /** Submit button tooltip (cancel / streaming state) */\n submitCancelTooltip?: string;\n /** Label rendered next to the submit button in cancelable state (`submitButtonCancelableText`) */\n submitButtonCancelableText?: string;\n /** Message list error alert main text */\n errorText?: string;\n /** History search/filter placeholder */\n historySearchPlaceholder?: string;\n /** History panel empty state when there are no chats */\n historyEmptyPlaceholder?: React.ReactNode;\n /** History panel empty state when search has no results */\n historyEmptyFilteredPlaceholder?: React.ReactNode;\n /** Disclaimer body text (must be a string; use `disclaimerProps.children` for custom nodes) */\n disclaimerText?: string;\n}\n\n/**\n * Unified test identifiers (`data-qa`) for ChatContainer and its subtree.\n *\n * - Pass a **string** for backward compatibility: only the root container gets `data-qa`.\n * - Pass **`{ prefix: 'x' }`** to opt in to `${prefix}-${suffix}` for every slot below (see README).\n * - Pass **explicit keys** to override individual elements; they win over `prefix` and nested `*Props.qa`.\n */\nexport interface ChatContainerQa {\n /** Applied to child slots when explicit keys are omitted; also used as root if `root` is omitted */\n prefix?: string;\n /** Root chat container */\n root?: string;\n /** Header root */\n header?: string;\n /** Overrides default `header-action-newChat` */\n headerNewChat?: string;\n /** Overrides default `header-action-history` */\n headerHistory?: string;\n /** Overrides default `header-action-folding` */\n headerFolding?: string;\n /** Overrides default `header-action-close` */\n headerClose?: string;\n /** Overrides default `header-menu-button` */\n headerMenuButton?: string;\n /** ChatContent root */\n content?: string;\n /** Empty state (EmptyContainer) */\n emptyState?: string;\n /** MessageList scroll area */\n messageList?: string;\n /** Action popup in MessageList */\n actionPopup?: string;\n /** PromptInput root */\n promptInput?: string;\n promptInputHeader?: string;\n promptInputBody?: string;\n promptInputFooter?: string;\n /** Submit button in prompt footer */\n submitButton?: string;\n /** Disclaimer text block */\n disclaimer?: string;\n /** History list (inside popup) */\n history?: string;\n}\n\n/**\n * Props for ChatContainer component\n */\nexport interface ChatContainerProps {\n // Chat data\n /** Array of chats for history */\n chats?: ChatType[];\n /** Currently active chat */\n activeChat?: ChatType | null;\n /** Array of messages in current chat */\n messages?: TChatMessage[];\n\n // Main callbacks\n /** Callback when user sends a message */\n onSendMessage: (data: TSubmitData) => Promise<void>;\n /** Callback when user selects a chat from history */\n onSelectChat?: (chat: ChatType) => void;\n /** Callback when user creates a new chat */\n onCreateChat?: () => void;\n /** Callback when user deletes a chat */\n onDeleteChat?: (chat: ChatType) => Promise<void>;\n /** Callback when user deletes all chats */\n onDeleteAllChats?: () => Promise<void>;\n /** Callback when user folds or unfolds the chat */\n onFold?: (value: 'collapsed' | 'opened') => void;\n /** Callback when user closes the chat */\n onClose?: () => void;\n /** Callback when user cancels streaming */\n onCancel?: () => Promise<void>;\n\n // Layout\n /**\n * Enables mobile mode for the chat and all inner components.\n * When omitted, falls back to the `useMobile()` value from the\n * `@gravity-ui/uikit` `MobileProvider` context.\n */\n isMobile?: boolean;\n /**\n * In mobile mode, shrinks the container to the visible part of the viewport while the\n * on-screen keyboard is open, so the prompt input and the disclaimer stay above it.\n * Set to `false` when the host application handles the keyboard itself.\n *\n * @default true\n */\n adjustToKeyboard?: boolean;\n /**\n * Renders the header above the content instead of stacking it on top: the message list and\n * the welcome screen scroll underneath. The header is taken out of the flow, so the content\n * has to be offset by its height manually — the offset depends on the layout. Set an explicit\n * height first: `--g-aikit-chat-container-header-height` is `auto` by default and\n * `--g-aikit-chat-container-mobile-header-height` is `60px` in mobile mode. Pair it with a\n * transparent `--g-aikit-chat-container-header-background` to let the content show through.\n *\n * @example\n * .my-chat {\n * --g-aikit-chat-container-header-height: 60px;\n * --g-aikit-chat-container-header-background: transparent;\n * }\n * .my-chat .g-aikit-chat-container__content {\n * padding-top: var(--g-aikit-chat-container-header-height);\n * }\n */\n floatingHeader?: boolean;\n\n // States\n /** Chat status: submitted, streaming, ready, error */\n status?: ChatStatus;\n /** Error state */\n error?: Error | null;\n /** Show message actions on hover */\n showActionsOnHover?: boolean;\n /** Callback to retry after error */\n onRetry?: () => void;\n\n // Context\n /** Array of context items to display in prompt input header */\n contextItems?: ContextItemConfig[];\n /** Show context indicator in prompt input header */\n showContextIndicator?: boolean;\n /** Props for the context indicator */\n contextIndicatorProps?: ContextIndicatorProps;\n /** Transform options for markdown rendering */\n transformOptions?: OptionsType;\n /** Should parse incomplete markdown (e.g., during streaming) */\n shouldParseIncompleteMarkdown?: boolean;\n /** Open all markdown links rendered by the default message renderers in a new tab */\n openMarkdownLinksInNewTab?: boolean;\n /**\n * Grouped MDX/markdown rendering props forwarded to the message list:\n * `mdxOptions`, `getMarkdownExtraProps` and `getMdxContext`.\n */\n mdxProps?: MdxProps;\n\n // Configuration\n /** MessageList configuration for actions and loader behavior */\n messageListConfig?: MessageListConfig;\n /** Mascot renderer, assets and lifecycle configuration. */\n mascotConfig?: MascotConfig;\n\n // Component props overrides\n /** Props override for Header component */\n headerProps?: Partial<\n Omit<HeaderProps, 'handleNewChat' | 'handleHistoryToggle' | 'handleFolding' | 'handleClose'>\n >;\n /** Props override for ChatContent component */\n contentProps?: Partial<Omit<ChatContentProps, 'view' | 'messageListProps'>>;\n /** Props override for EmptyContainer (welcome screen) */\n emptyContainerProps?: Partial<EmptyContainerProps>;\n /** Props override for PromptInput component */\n promptInputProps?: Partial<Omit<PromptInputProps, 'onSend' | 'onCancel'>>;\n /** Props override for Disclaimer component */\n disclaimerProps?: Partial<DisclaimerProps>;\n /** Props override for History component */\n historyProps?: Partial<\n Omit<\n HistoryProps,\n 'chats' | 'selectedChat' | 'onSelectChat' | 'onDeleteChat' | 'anchorElement'\n >\n >;\n\n // Configuration\n /** Welcome screen configuration for empty state */\n welcomeConfig?: WelcomeConfig;\n /** Unified flat text overrides for ChatContainer subtree */\n texts?: ChatContainerTexts;\n /** Show chat history feature */\n showHistory?: boolean;\n /** Show new chat button */\n showNewChat?: boolean;\n /** Show folding button */\n showFolding?: boolean;\n /** Show close button */\n showClose?: boolean;\n /** Hide header title when chat is empty */\n hideTitleOnEmptyChat?: boolean;\n\n // Styling\n /** Additional CSS class */\n className?: string;\n /** Additional CSS class for header section */\n headerClassName?: string;\n /** Additional CSS class for content section */\n contentClassName?: string;\n /** Additional CSS class for footer section */\n footerClassName?: string;\n /**\n * QA/test identifiers. A string sets only the root `data-qa`. Use {@link ChatContainerQa} for a full map or `prefix`.\n */\n qa?: string | ChatContainerQa;\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { InputControlSize } from '@gravity-ui/uikit';
|
|
2
3
|
import { ChatType } from "../../../types/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* Props for ChatItem component
|
|
@@ -8,6 +9,8 @@ export interface ChatItemProps {
|
|
|
8
9
|
showActions: boolean;
|
|
9
10
|
isActive?: boolean;
|
|
10
11
|
onDeleteClick?: (e: React.MouseEvent, chat: ChatType) => Promise<void>;
|
|
12
|
+
/** Size of the row actions (default: `s`, `xl` in mobile mode) */
|
|
13
|
+
size?: InputControlSize;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Chat item component with hover state for actions.
|
|
@@ -15,4 +18,4 @@ export interface ChatItemProps {
|
|
|
15
18
|
*
|
|
16
19
|
* @returns React element
|
|
17
20
|
*/
|
|
18
|
-
export declare function ChatItem({ chat, showActions, isActive, onDeleteClick }: ChatItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function ChatItem({ chat, showActions, isActive, onDeleteClick, size }: ChatItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const icons_1 = require("@gravity-ui/icons");
|
|
7
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const useMobileControlSize_1 = require("../../../hooks/useMobileControlSize.js");
|
|
8
9
|
const cn_1 = require("../../../utils/cn.js");
|
|
9
10
|
const ActionButton_1 = require("../../atoms/ActionButton/index.js");
|
|
10
11
|
const i18n_1 = require("./i18n/index.js");
|
|
@@ -15,13 +16,19 @@ const b = (0, cn_1.block)('history');
|
|
|
15
16
|
*
|
|
16
17
|
* @returns React element
|
|
17
18
|
*/
|
|
18
|
-
function ChatItem({ chat, showActions, isActive, onDeleteClick }) {
|
|
19
|
+
function ChatItem({ chat, showActions, isActive, onDeleteClick, size }) {
|
|
19
20
|
const [isDeleteProccesing, setIsDeleteProcessing] = (0, react_1.useState)(false);
|
|
20
21
|
const [hasOverflow, setHasOverflow] = (0, react_1.useState)(false);
|
|
21
22
|
const labelRef = (0, react_1.useRef)(null);
|
|
22
23
|
const chatLabel = chat.lastMessage || chat.name;
|
|
23
24
|
const isMobile = (0, uikit_1.useMobile)();
|
|
24
|
-
const deleteButtonSize =
|
|
25
|
+
const deleteButtonSize = (0, useMobileControlSize_1.resolveMobileControlSize)({
|
|
26
|
+
size,
|
|
27
|
+
desktopDefault: 's',
|
|
28
|
+
mobileDefault: 'xl',
|
|
29
|
+
isMobile,
|
|
30
|
+
});
|
|
31
|
+
const deleteIconSize = (0, useMobileControlSize_1.getControlIconSize)(deleteButtonSize);
|
|
25
32
|
(0, react_1.useEffect)(() => {
|
|
26
33
|
const label = labelRef.current;
|
|
27
34
|
setHasOverflow(Boolean(label && label.scrollWidth > label.clientWidth));
|
|
@@ -46,6 +53,6 @@ function ChatItem({ chat, showActions, isActive, onDeleteClick }) {
|
|
|
46
53
|
active: isActive,
|
|
47
54
|
mobile: isMobile,
|
|
48
55
|
['is-delete-processing']: isDeleteProccesing,
|
|
49
|
-
}), onClick: handleClick, children: [hasOverflow ? ((0, jsx_runtime_1.jsx)(uikit_1.Tooltip, { content: chatLabel, openDelay: 300, children: label })) : (label), showDeleteAction ? ((0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { view: "flat", size: deleteButtonSize, color: "secondary", loading: isDeleteProccesing, className: b('delete-button'), onClick: handleDeleteChat, tooltipTitle: (0, i18n_1.i18n)('tooltip-delete'), children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { className: b('icon-button'), data: icons_1.TrashBin, size:
|
|
56
|
+
}), onClick: handleClick, children: [hasOverflow ? ((0, jsx_runtime_1.jsx)(uikit_1.Tooltip, { content: chatLabel, openDelay: 300, children: label })) : (label), showDeleteAction ? ((0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { view: "flat", size: deleteButtonSize, color: "secondary", loading: isDeleteProccesing, className: b('delete-button'), onClick: handleDeleteChat, tooltipTitle: (0, i18n_1.i18n)('tooltip-delete'), children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { className: b('icon-button'), data: icons_1.TrashBin, size: deleteIconSize }) })) : null] }));
|
|
50
57
|
}
|
|
51
58
|
//# sourceMappingURL=ChatItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatItem.js","sourceRoot":"../../../../../src","sources":["components/templates/History/ChatItem.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ChatItem.js","sourceRoot":"../../../../../src","sources":["components/templates/History/ChatItem.tsx"],"names":[],"mappings":";;AAgCA,4BA4EC;;AA5GD,iCAAyD;AAEzD,6CAA2C;AAC3C,6CAAmF;AAEnF,iFAAiG;AAEjG,6CAAwC;AACxC,oEAAsD;AAEtD,0CAA4B;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AACN,CAAC","sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\n\nimport {TrashBin} from '@gravity-ui/icons';\nimport {Icon, InputControlSize, Text, Tooltip, useMobile} from '@gravity-ui/uikit';\n\nimport {getControlIconSize, resolveMobileControlSize} from '../../../hooks/useMobileControlSize';\nimport {ChatType} from '../../../types';\nimport {block} from '../../../utils/cn';\nimport {ActionButton} from '../../atoms/ActionButton';\n\nimport {i18n} from './i18n';\n\nconst b = block('history');\n\n/**\n * Props for ChatItem component\n */\nexport interface ChatItemProps {\n chat: ChatType;\n showActions: boolean;\n isActive?: boolean;\n onDeleteClick?: (e: React.MouseEvent, chat: ChatType) => Promise<void>;\n /** Size of the row actions (default: `s`, `xl` in mobile mode) */\n size?: InputControlSize;\n}\n\n/**\n * Chat item component with hover state for actions.\n * In mobile mode there is no hover, so actions are always visible.\n *\n * @returns React element\n */\nexport function ChatItem({chat, showActions, isActive, onDeleteClick, size}: ChatItemProps) {\n const [isDeleteProccesing, setIsDeleteProcessing] = useState(false);\n const [hasOverflow, setHasOverflow] = useState(false);\n const labelRef = useRef<HTMLDivElement>(null);\n const chatLabel = chat.lastMessage || chat.name;\n const isMobile = useMobile();\n const deleteButtonSize = resolveMobileControlSize({\n size,\n desktopDefault: 's',\n mobileDefault: 'xl',\n isMobile,\n });\n const deleteIconSize = getControlIconSize(deleteButtonSize);\n\n useEffect(() => {\n const label = labelRef.current;\n setHasOverflow(Boolean(label && label.scrollWidth > label.clientWidth));\n }, [chatLabel]);\n\n const handleClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (isDeleteProccesing) {\n e.stopPropagation();\n }\n };\n\n const handleDeleteChat = async (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n try {\n setIsDeleteProcessing(true);\n await onDeleteClick?.(e, chat);\n } finally {\n setIsDeleteProcessing(false);\n }\n };\n\n const showDeleteAction = isDeleteProccesing || (showActions && onDeleteClick);\n\n const label = (\n <div className={b('chat-content')}>\n <Text variant=\"body-1\" ref={labelRef}>\n {chatLabel}\n </Text>\n </div>\n );\n\n return (\n <div\n className={b('chat-item', {\n active: isActive,\n mobile: isMobile,\n ['is-delete-processing']: isDeleteProccesing,\n })}\n onClick={handleClick}\n >\n {hasOverflow ? (\n <Tooltip content={chatLabel} openDelay={300}>\n {label}\n </Tooltip>\n ) : (\n label\n )}\n\n {showDeleteAction ? (\n <ActionButton\n view=\"flat\"\n size={deleteButtonSize}\n color=\"secondary\"\n loading={isDeleteProccesing}\n className={b('delete-button')}\n onClick={handleDeleteChat}\n tooltipTitle={i18n('tooltip-delete')}\n >\n <Icon className={b('icon-button')} data={TrashBin} size={deleteIconSize} />\n </ActionButton>\n ) : null}\n </div>\n );\n}\n"]}
|
|
@@ -92,10 +92,32 @@
|
|
|
92
92
|
justify-content: center;
|
|
93
93
|
padding: calc(var(--g-spacing-base) * 2) calc(var(--g-spacing-base) * 4);
|
|
94
94
|
}
|
|
95
|
+
.g-aikit-history__sheet-content {
|
|
96
|
+
--g-sheet-content-padding: 0 max(var(--g-aikit-history-sheet-inline-padding), env(safe-area-inset-right, 0px))
|
|
97
|
+
calc(var(--g-aikit-history-sheet-bottom-padding) + env(safe-area-inset-bottom, 0px))
|
|
98
|
+
max(var(--g-aikit-history-sheet-inline-padding), env(safe-area-inset-left, 0px));
|
|
99
|
+
}
|
|
100
|
+
.g-aikit-history__sheet-content_without-title > .g-sheet__sheet-content-title {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
95
103
|
.g-aikit-history__sheet-content .g-aikit-history__container {
|
|
96
104
|
width: 100%;
|
|
97
105
|
}
|
|
98
106
|
.g-aikit-history__sheet-content .g-aikit-history__list-wrapper {
|
|
99
107
|
max-height: none;
|
|
100
108
|
overflow: visible;
|
|
109
|
+
}
|
|
110
|
+
.g-aikit-history__sheet-content .g-aikit-history__list {
|
|
111
|
+
padding: var(--g-aikit-history-sheet-list-padding);
|
|
112
|
+
}
|
|
113
|
+
.g-aikit-history__sheet-content .g-aikit-history__filter {
|
|
114
|
+
padding-inline: var(--g-aikit-history-sheet-filter-inline-padding);
|
|
115
|
+
border-bottom: var(--g-aikit-history-sheet-filter-border-bottom);
|
|
116
|
+
}
|
|
117
|
+
.g-aikit-history__sheet-content .g-aikit-history__chat-item {
|
|
118
|
+
padding-inline-end: var(--g-aikit-history-sheet-item-inline-end-padding);
|
|
119
|
+
}
|
|
120
|
+
.g-aikit-history__sheet-content .g-aikit-history__chat-content {
|
|
121
|
+
--g-text-body-1-font-size: var(--g-aikit-history-mobile-item-font-size);
|
|
122
|
+
--g-text-body-1-line-height: var(--g-aikit-history-mobile-item-line-height);
|
|
101
123
|
}
|
|
@@ -10,6 +10,8 @@ export interface HistoryProps extends Omit<HistoryListProps, 'onChatClick'> {
|
|
|
10
10
|
onOpenChange?: (open: boolean) => void;
|
|
11
11
|
/** Anchor element for the popup */
|
|
12
12
|
anchorElement: HTMLElement | null;
|
|
13
|
+
/** Show the mobile sheet title (default: `true`); it stays in `aria-label` either way */
|
|
14
|
+
showSheetTitle?: boolean;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
17
|
* History component - wraps HistoryList in a Popup, and in a bottom Sheet in mobile mode
|
|
@@ -16,7 +16,7 @@ const b = (0, cn_1.block)('history');
|
|
|
16
16
|
* @returns React component
|
|
17
17
|
*/
|
|
18
18
|
function History(props) {
|
|
19
|
-
const { open = false, onOpenChange, anchorElement } = props, listProps = tslib_1.__rest(props, ["open", "onOpenChange", "anchorElement"]);
|
|
19
|
+
const { open = false, onOpenChange, anchorElement, showSheetTitle = true } = props, listProps = tslib_1.__rest(props, ["open", "onOpenChange", "anchorElement", "showSheetTitle"]);
|
|
20
20
|
const isMobile = (0, uikit_1.useMobile)();
|
|
21
21
|
const sheetId = (0, uikit_1.useUniqId)();
|
|
22
22
|
const handleChatClick = () => {
|
|
@@ -24,7 +24,7 @@ function History(props) {
|
|
|
24
24
|
};
|
|
25
25
|
const list = (0, jsx_runtime_1.jsx)(HistoryList_1.HistoryList, Object.assign({}, listProps, { onChatClick: handleChatClick }));
|
|
26
26
|
if (isMobile) {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(uikit_1.Sheet, { id: sheetId, title: (0, i18n_1.i18n)('sheet-title'), visible: open, onClose: () => onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false), contentClassName: b('sheet-content'), qa: "history-sheet", allowHideOnContentScroll: true, children: list }));
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(uikit_1.Sheet, { id: sheetId, title: (0, i18n_1.i18n)('sheet-title'), visible: open, onClose: () => onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false), contentClassName: b('sheet-content', { 'without-title': !showSheetTitle }), qa: "history-sheet", allowHideOnContentScroll: true, children: list }));
|
|
28
28
|
}
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)(uikit_1.Popup, { anchorElement: anchorElement, placement: "bottom-end", open: open, onOpenChange: onOpenChange, children: list }));
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"History.js","sourceRoot":"../../../../../src","sources":["components/templates/History/History.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"History.js","sourceRoot":"../../../../../src","sources":["components/templates/History/History.tsx"],"names":[],"mappings":";;AA+BA,0BAqCC;;;AApED,6CAAqE;AAErE,6CAAwC;AAExC,kDAAiE;AACjE,0CAA4B;AAE5B,yBAAwB;AAExB,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,SAAS,CAAC,CAAC;AAgB3B;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,KAAmB;IACvC,MAAM,EAAC,IAAI,GAAG,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,GAAG,IAAI,KAAkB,KAAK,EAAlB,SAAS,kBAAI,KAAK,EAAxF,2DAAgF,CAAQ,CAAC;IAC/F,MAAM,QAAQ,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE5B,MAAM,eAAe,GAAG,GAAG,EAAE;QACzB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,uBAAC,yBAAW,oBAAK,SAAS,IAAE,WAAW,EAAE,eAAe,IAAI,CAAC;IAE1E,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CACH,uBAAC,aAAK,IACF,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,EAC1B,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,KAAK,CAAC,EACpC,gBAAgB,EAAE,CAAC,CAAC,eAAe,EAAE,EAAC,eAAe,EAAE,CAAC,cAAc,EAAC,CAAC,EACxE,EAAE,EAAC,eAAe,EAClB,wBAAwB,kBAEvB,IAAI,GACD,CACX,CAAC;IACN,CAAC;IAED,OAAO,CACH,uBAAC,aAAK,IACF,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAC,YAAY,EACtB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,YAEzB,IAAI,GACD,CACX,CAAC;AACN,CAAC","sourcesContent":["import {Popup, Sheet, useMobile, useUniqId} from '@gravity-ui/uikit';\n\nimport {block} from '../../../utils/cn';\n\nimport {HistoryList, type HistoryListProps} from './HistoryList';\nimport {i18n} from './i18n';\n\nimport './History.scss';\n\nconst b = block('history');\n\n/**\n * Props for the History component\n */\nexport interface HistoryProps extends Omit<HistoryListProps, 'onChatClick'> {\n /** Control popup open state */\n open?: boolean;\n /** Callback when popup open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Anchor element for the popup */\n anchorElement: HTMLElement | null;\n /** Show the mobile sheet title (default: `true`); it stays in `aria-label` either way */\n showSheetTitle?: boolean;\n}\n\n/**\n * History component - wraps HistoryList in a Popup, and in a bottom Sheet in mobile mode\n *\n * @param props - Component props\n * @returns React component\n */\nexport function History(props: HistoryProps) {\n const {open = false, onOpenChange, anchorElement, showSheetTitle = true, ...listProps} = props;\n const isMobile = useMobile();\n const sheetId = useUniqId();\n\n const handleChatClick = () => {\n onOpenChange?.(false);\n };\n\n const list = <HistoryList {...listProps} onChatClick={handleChatClick} />;\n\n if (isMobile) {\n return (\n <Sheet\n id={sheetId}\n title={i18n('sheet-title')}\n visible={open}\n onClose={() => onOpenChange?.(false)}\n contentClassName={b('sheet-content', {'without-title': !showSheetTitle})}\n qa=\"history-sheet\"\n allowHideOnContentScroll\n >\n {list}\n </Sheet>\n );\n }\n\n return (\n <Popup\n anchorElement={anchorElement}\n placement=\"bottom-end\"\n open={open}\n onOpenChange={onOpenChange}\n >\n {list}\n </Popup>\n );\n}\n"]}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
7
7
|
const uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const useMobileControlSize_1 = require("../../../hooks/useMobileControlSize.js");
|
|
8
9
|
const chatUtils_1 = require("../../../utils/chatUtils.js");
|
|
9
10
|
const cn_1 = require("../../../utils/cn.js");
|
|
10
11
|
const IntersectionContainer_1 = require("../../atoms/IntersectionContainer/index.js");
|
|
@@ -21,7 +22,8 @@ const b = (0, cn_1.block)('history');
|
|
|
21
22
|
* @returns Rendered history list (search, grouping, lazy/full load, chat rows).
|
|
22
23
|
*/
|
|
23
24
|
function HistoryList(props) {
|
|
24
|
-
const { chats, selectedChat, onSelectChat, onDeleteChat, onLoadMore, hasMore = false, loadMode = 'full', searchable = true, groupBy = 'date', dateFormat, dateLocale, dateLocaleConfig, showActions = true, emptyPlaceholder, emptyFilteredPlaceholder, searchPlaceholder, className, qa, style, filterFunction = chatUtils_1.defaultChatFilter, loading = false, onChatClick, size
|
|
25
|
+
const { chats, selectedChat, onSelectChat, onDeleteChat, onLoadMore, hasMore = false, loadMode = 'full', searchable = true, groupBy = 'date', dateFormat, dateLocale, dateLocaleConfig, showActions = true, emptyPlaceholder, emptyFilteredPlaceholder, searchPlaceholder, className, qa, style, filterFunction = chatUtils_1.defaultChatFilter, loading = false, onChatClick, size: sizeProp, } = props;
|
|
26
|
+
const size = (0, useMobileControlSize_1.useMobileControlSize)(sizeProp, 'm', 'xl');
|
|
25
27
|
const [filteredItemCount, setFilteredItemCount] = (0, react_1.useState)(null);
|
|
26
28
|
const [loadedChats, setLoadedChats] = (0, react_1.useState)([]);
|
|
27
29
|
const [lazyHasMore, setLazyHasMore] = (0, react_1.useState)(hasMore);
|
|
@@ -142,7 +144,7 @@ function HistoryList(props) {
|
|
|
142
144
|
if (item.type === 'date-header') {
|
|
143
145
|
return ((0, jsx_runtime_1.jsx)(DateHeaderItem_1.DateHeaderItem, { date: item.date, format: dateFormat, locale: dateLocale, localeConfig: dateLocaleConfig }, `date-${item.date}`));
|
|
144
146
|
}
|
|
145
|
-
return ((0, jsx_runtime_1.jsx)(ChatItem_1.ChatItem, { chat: item, showActions: showActions, onDeleteClick: onDeleteChat ? handleDeleteClick : undefined, isActive: isActive }, item.id));
|
|
147
|
+
return ((0, jsx_runtime_1.jsx)(ChatItem_1.ChatItem, { chat: item, showActions: showActions, onDeleteClick: onDeleteChat ? handleDeleteClick : undefined, isActive: isActive, size: sizeProp }, item.id));
|
|
146
148
|
};
|
|
147
149
|
const emptyState = emptyPlaceholder || (0, jsx_runtime_1.jsx)("div", { className: b('empty'), children: (0, i18n_1.i18n)('empty-state') });
|
|
148
150
|
const emptyFilteredState = emptyFilteredPlaceholder || ((0, jsx_runtime_1.jsx)("div", { className: b('empty'), children: (0, i18n_1.i18n)('empty-filtered-state') }));
|