@gravity-ui/aikit 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -53,17 +53,10 @@ export function ChatContainer(props) {
|
|
|
53
53
|
} });
|
|
54
54
|
}, [welcomeConfig, i18nConfig.emptyState, emptyContainerProps, onSendMessage]);
|
|
55
55
|
// Build props for MessageList
|
|
56
|
-
const messageListProps = useMemo(() => ({
|
|
57
|
-
|
|
58
|
-
status,
|
|
59
|
-
errorMessage: error ? { text: error.message } : undefined,
|
|
60
|
-
onRetry,
|
|
56
|
+
const messageListProps = useMemo(() => (Object.assign(Object.assign({}, messageListConfig), { messages,
|
|
57
|
+
status, errorMessage: error ? { text: error.message } : undefined, onRetry,
|
|
61
58
|
showActionsOnHover,
|
|
62
|
-
transformOptions,
|
|
63
|
-
userActions: messageListConfig === null || messageListConfig === void 0 ? void 0 : messageListConfig.userActions,
|
|
64
|
-
assistantActions: messageListConfig === null || messageListConfig === void 0 ? void 0 : messageListConfig.assistantActions,
|
|
65
|
-
loaderStatuses: messageListConfig === null || messageListConfig === void 0 ? void 0 : messageListConfig.loaderStatuses,
|
|
66
|
-
}), [messages, status, error, onRetry, showActionsOnHover, transformOptions, messageListConfig]);
|
|
59
|
+
transformOptions })), [messages, status, error, onRetry, showActionsOnHover, transformOptions, messageListConfig]);
|
|
67
60
|
// Build props for PromptInput
|
|
68
61
|
const finalPromptInputProps = useMemo(() => {
|
|
69
62
|
var _a, _b;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OptionsType } from '@diplodoc/transform/lib/typings';
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
2
|
+
import { MessageListProps } from 'src/components/organisms/MessageList';
|
|
3
|
+
import type { ChatStatus, ChatType, TChatMessage, TSubmitData } from '../../../types';
|
|
4
4
|
import type { ContextItemConfig } from '../../molecules/PromptInputHeader';
|
|
5
5
|
import type { SuggestionsItem } from '../../molecules/Suggestions';
|
|
6
6
|
import type { HeaderProps } from '../../organisms/Header';
|
|
@@ -84,14 +84,7 @@ export interface WelcomeConfig {
|
|
|
84
84
|
/**
|
|
85
85
|
* MessageList configuration
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
88
|
-
/** Default actions for user messages */
|
|
89
|
-
userActions?: DefaultMessageAction<TUserMessage<TMessageMetadata>>[];
|
|
90
|
-
/** Default actions for assistant messages */
|
|
91
|
-
assistantActions?: DefaultMessageAction<TAssistantMessage<TMessageContent, TMessageMetadata>>[];
|
|
92
|
-
/** Array of chat statuses that should display the loader */
|
|
93
|
-
loaderStatuses?: ChatStatus[];
|
|
94
|
-
}
|
|
87
|
+
export type MessageListConfig = Omit<MessageListProps, 'messages' | 'status' | 'errorMessage' | 'onRetry' | 'showActionsOnHover' | 'transformOptions'>;
|
|
95
88
|
/**
|
|
96
89
|
* Props for ChatContainer component
|
|
97
90
|
*/
|