@gooddata/sdk-ui-gen-ai 11.36.0-alpha.2 → 11.36.0-alpha.3
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/NOTICE +3 -3
- package/esm/components/ConversationRenameDialog.d.ts +8 -0
- package/esm/components/ConversationRenameDialog.js +24 -0
- package/esm/components/GenAIChatConversations.d.ts +2 -1
- package/esm/components/GenAIChatConversations.js +50 -7
- package/esm/components/messages/AssistantItem.js +1 -1
- package/esm/components/messages/AssistantItemSuggestions.d.ts +3 -3
- package/esm/components/messages/AssistantItemSuggestions.js +11 -4
- package/esm/components/messages/ConversationItemContents.js +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts +1 -3
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +4 -5
- package/esm/components/messages/conversationContents/ConversationWhatIfContent.js +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +20 -0
- package/esm/localization/bundles/en-US.localization-bundle.js +23 -3
- package/esm/model.d.ts +2 -2
- package/esm/sdk-ui-gen-ai.d.ts +36 -3
- package/esm/store/events.d.ts +30 -1
- package/esm/store/events.js +14 -0
- package/esm/store/messages/messagesSlice.d.ts +13 -7
- package/esm/store/messages/messagesSlice.js +30 -7
- package/esm/store/sideEffects/index.js +3 -1
- package/esm/store/sideEffects/onConversationRename.d.ts +19 -0
- package/esm/store/sideEffects/onConversationRename.js +30 -0
- package/esm/store/sideEffects/onEvent.js +24 -1
- package/esm/store/sideEffects/onUserMessage.js +6 -11
- package/package.json +20 -20
- package/styles/css/conversations.css +12 -0
- package/styles/css/conversations.css.map +1 -1
- package/styles/css/main.css +12 -0
- package/styles/css/main.css.map +1 -1
- package/styles/scss/conversations.scss +13 -0
package/NOTICE
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
The following 3rd-party software packages may be used by or distributed with gooddata-ui-sdk. Any information relevant to third-party vendors listed below are collected using common, reasonable means.
|
|
9
9
|
|
|
10
|
-
Date generated: 2026-5-
|
|
10
|
+
Date generated: 2026-5-18
|
|
11
11
|
|
|
12
|
-
Revision ID:
|
|
12
|
+
Revision ID: 92b445a16b77d7d9543b67d63221a8bc155c1615
|
|
13
13
|
|
|
14
14
|
================================================================================
|
|
15
15
|
================================================================================
|
|
@@ -38277,4 +38277,4 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
38277
38277
|
--------------------------------------------------------------------------------
|
|
38278
38278
|
--------------------------------------------------------------------------------
|
|
38279
38279
|
|
|
38280
|
-
Report Generated by FOSSA on 2026-5-
|
|
38280
|
+
Report Generated by FOSSA on 2026-5-18
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IChatConversationLocal } from "../model.js";
|
|
2
|
+
type ConversationRenameDialogProps = {
|
|
3
|
+
conversation: IChatConversationLocal;
|
|
4
|
+
onRename: (name: string) => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function ConversationRenameDialog({ conversation, onRename, onClose }: ConversationRenameDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { defineMessages, useIntl } from "react-intl";
|
|
5
|
+
import { useSelector } from "react-redux";
|
|
6
|
+
import { ConfirmDialog, Input } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { catalogItemsSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
8
|
+
import { generateTemporaryTitle } from "../utils.js";
|
|
9
|
+
import { collectReferences, replaceReferences } from "./completion/references.js";
|
|
10
|
+
const messages = defineMessages({
|
|
11
|
+
title: { id: "gd.gen-ai.conversations.rename-dialog.title" },
|
|
12
|
+
label: { id: "gd.gen-ai.conversations.rename-dialog.label" },
|
|
13
|
+
submit: { id: "gd.gen-ai.conversations.rename-dialog.submit" },
|
|
14
|
+
cancel: { id: "gd.gen-ai.conversations.rename-dialog.cancel" },
|
|
15
|
+
});
|
|
16
|
+
export function ConversationRenameDialog({ conversation, onRename, onClose }) {
|
|
17
|
+
const intl = useIntl();
|
|
18
|
+
const catalogItems = useSelector(catalogItemsSelector);
|
|
19
|
+
const currentTitle = useMemo(() => {
|
|
20
|
+
return (replaceReferences(conversation.title ?? "", collectReferences(conversation.title ?? "", catalogItems)) || generateTemporaryTitle(intl, conversation));
|
|
21
|
+
}, [catalogItems, conversation, intl]);
|
|
22
|
+
const [value, setValue] = useState(currentTitle);
|
|
23
|
+
return (_jsx(ConfirmDialog, { headline: intl.formatMessage(messages.title), cancelButtonText: intl.formatMessage(messages.cancel), submitButtonText: intl.formatMessage(messages.submit), isPositive: true, autofocusOnOpen: false, submitOnEnterKey: true, isSubmitDisabled: !value.trim(), onCancel: onClose, onClose: onClose, onSubmit: () => onRename(value.trim()), className: "gd-gen-ai-chat__rename-dialog", children: _jsx(Input, { autofocus: true, label: intl.formatMessage(messages.label), className: "gd-gen-ai-chat__rename-dialog__input", labelPositionTop: true, value: value, onChange: (newValue) => setValue(String(newValue)) }) }));
|
|
24
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FC } from "react";
|
|
2
2
|
import { setHistoryAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
3
3
|
import { conversationSelector, conversationsSelector } from "../store/messages/messagesSelectors.js";
|
|
4
|
-
import { deleteConversationAction, pinConversationAction, setCurrentConversationAction } from "../store/messages/messagesSlice.js";
|
|
4
|
+
import { deleteConversationAction, pinConversationAction, renameConversationAction, setCurrentConversationAction } from "../store/messages/messagesSlice.js";
|
|
5
5
|
type GenAIChatConversationsStateProps = {
|
|
6
6
|
conversation: ReturnType<typeof conversationSelector>;
|
|
7
7
|
conversations: ReturnType<typeof conversationsSelector>;
|
|
@@ -11,6 +11,7 @@ type GenAIChatConversationsDispatchProps = {
|
|
|
11
11
|
loadConversation: typeof setCurrentConversationAction;
|
|
12
12
|
deleteConversation: typeof deleteConversationAction;
|
|
13
13
|
pinConversation: typeof pinConversationAction;
|
|
14
|
+
renameConversation: typeof renameConversationAction;
|
|
14
15
|
};
|
|
15
16
|
export type GenAIChatConversationsProps = GenAIChatConversationsStateProps & GenAIChatConversationsDispatchProps;
|
|
16
17
|
export declare const GenAIChatConversations: FC;
|
|
@@ -8,20 +8,22 @@ import { DefaultUiMenuInteractiveItemWrapper, Dropdown, UiDrawer, UiIcon, UiIcon
|
|
|
8
8
|
import { catalogItemsSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
9
9
|
import { setHistoryAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
10
10
|
import { conversationSelector, conversationsSelector } from "../store/messages/messagesSelectors.js";
|
|
11
|
-
import { deleteConversationAction, pinConversationAction, setCurrentConversationAction, } from "../store/messages/messagesSlice.js";
|
|
11
|
+
import { deleteConversationAction, pinConversationAction, renameConversationAction, setCurrentConversationAction, } from "../store/messages/messagesSlice.js";
|
|
12
12
|
import { isConversationWithLocalId } from "../store/utils.js";
|
|
13
13
|
import { generateTemporaryTitle } from "../utils.js";
|
|
14
14
|
import { collectReferences, replaceReferences } from "./completion/references.js";
|
|
15
15
|
import { ConversationDeleteDialog } from "./ConversationDeleteDialog.js";
|
|
16
|
+
import { ConversationRenameDialog } from "./ConversationRenameDialog.js";
|
|
16
17
|
import { useFullscreenCheck } from "./hooks/useFullscreenCheck.js";
|
|
17
18
|
import { useHistoryCheck } from "./hooks/useHistoryCheck.js";
|
|
18
19
|
import { ConversationDateGroup, groupConversationsByDate } from "./utils/conversationGrouper.js";
|
|
19
|
-
function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinConversation, loadConversation, conversations, conversation: currentConversation, }) {
|
|
20
|
+
function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinConversation, renameConversation, loadConversation, conversations, conversation: currentConversation, }) {
|
|
20
21
|
const ref = useRef(undefined);
|
|
21
22
|
const intl = useIntl();
|
|
22
23
|
const { isFullscreen, isSmallScreen } = useFullscreenCheck();
|
|
23
24
|
const { isHistory } = useHistoryCheck();
|
|
24
25
|
const [conversationToDelete, setConversationToDelete] = useState();
|
|
26
|
+
const [conversationToRename, setConversationToRename] = useState();
|
|
25
27
|
const [openedId, setOpenedId] = useState();
|
|
26
28
|
const [draggedConversationId, setDraggedConversationId] = useState();
|
|
27
29
|
const [activeDropZone, setActiveDropZone] = useState();
|
|
@@ -49,10 +51,26 @@ function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinCo
|
|
|
49
51
|
toggleDropdown();
|
|
50
52
|
}, accessibilityConfig: {
|
|
51
53
|
...accessibilityConfig,
|
|
54
|
+
ariaLabel: intl.formatMessage({
|
|
55
|
+
id: "gd.gen-ai.conversations.menu.aria-label",
|
|
56
|
+
}),
|
|
52
57
|
ariaExpanded: ariaAttributes["aria-expanded"],
|
|
53
|
-
ariaHaspopup:
|
|
58
|
+
ariaHaspopup: "menu",
|
|
54
59
|
ariaControls: ariaAttributes["aria-controls"],
|
|
55
60
|
}, tabIndex: -1, icon: "ellipsis" })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(UiMenu, { shouldCloseOnSelect: true, items: [
|
|
61
|
+
{
|
|
62
|
+
type: "interactive",
|
|
63
|
+
id: "rename",
|
|
64
|
+
stringTitle: intl.formatMessage({
|
|
65
|
+
id: "gd.gen-ai.conversations.menu.rename",
|
|
66
|
+
}),
|
|
67
|
+
isDisabled: conversation.generatingTitle,
|
|
68
|
+
iconLeft: _jsx(UiIcon, { type: "pencil", size: 14 }),
|
|
69
|
+
data: {
|
|
70
|
+
...conversation,
|
|
71
|
+
action: "rename",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
56
74
|
{
|
|
57
75
|
type: "interactive",
|
|
58
76
|
id: conversation.pinned ? "unpin" : "pin",
|
|
@@ -89,6 +107,9 @@ function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinCo
|
|
|
89
107
|
if (selectedConversation.action === "delete") {
|
|
90
108
|
setConversationToDelete(conversation);
|
|
91
109
|
}
|
|
110
|
+
else if (selectedConversation.action === "rename") {
|
|
111
|
+
setConversationToRename(conversation);
|
|
112
|
+
}
|
|
92
113
|
else {
|
|
93
114
|
pinConversation({
|
|
94
115
|
conversationId: selectedConversation.localId,
|
|
@@ -100,11 +121,22 @@ function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinCo
|
|
|
100
121
|
}, onClose: closeDropdown, ariaAttributes: ariaAttributes })), closeOnEscape: true, autofocusOnOpen: true }) })),
|
|
101
122
|
isSelected: isConversationWithLocalId(currentConversation, conversation.localId),
|
|
102
123
|
})),
|
|
103
|
-
})), [
|
|
124
|
+
})), [
|
|
125
|
+
groupedConversations,
|
|
126
|
+
intl,
|
|
127
|
+
catalogItems,
|
|
128
|
+
openedId,
|
|
129
|
+
currentConversation,
|
|
130
|
+
pinConversation,
|
|
131
|
+
setConversationToRename,
|
|
132
|
+
]);
|
|
104
133
|
const draggedConversation = useMemo(() => conversations?.find((conversation) => conversation.localId === draggedConversationId), [conversations, draggedConversationId]);
|
|
105
134
|
const handleDeleteCancel = useCallback(() => {
|
|
106
135
|
setConversationToDelete(undefined);
|
|
107
136
|
}, []);
|
|
137
|
+
const handleRenameCancel = useCallback(() => {
|
|
138
|
+
setConversationToRename(undefined);
|
|
139
|
+
}, []);
|
|
108
140
|
const handleSelect = useCallback((conversation) => {
|
|
109
141
|
loadConversation({ conversation });
|
|
110
142
|
setHistory({ isHistory: false });
|
|
@@ -115,6 +147,15 @@ function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinCo
|
|
|
115
147
|
}
|
|
116
148
|
setConversationToDelete(undefined);
|
|
117
149
|
}, [conversationToDelete, deleteConversation]);
|
|
150
|
+
const handleRenameSubmit = useCallback((title) => {
|
|
151
|
+
if (conversationToRename) {
|
|
152
|
+
renameConversation({
|
|
153
|
+
conversationId: conversationToRename.localId,
|
|
154
|
+
title,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
setConversationToRename(undefined);
|
|
158
|
+
}, [conversationToRename, renameConversation]);
|
|
118
159
|
const handleDragStart = useCallback((conversationId, event) => {
|
|
119
160
|
event.dataTransfer.effectAllowed = "move";
|
|
120
161
|
event.dataTransfer.setData("text/plain", conversationId);
|
|
@@ -172,7 +213,7 @@ function GenAIChatConversationsComponent({ setHistory, deleteConversation, pinCo
|
|
|
172
213
|
] }), closeLabel: intl.formatMessage({ id: "gd.gen-ai.conversations.close-label" }), onClickClose: () => setHistory({ isHistory: false }), onClickOutside: () => setHistory({ isHistory: false }), children: _jsx("div", { className: cx("gd-gen-ai-chat__window__conversations", {
|
|
173
214
|
"gd-gen-ai-chat__window__conversations--isFullscreen": isFullscreen,
|
|
174
215
|
"gd-gen-ai-chat__window__conversations--isSmallScreen": isSmallScreen,
|
|
175
|
-
}), children: _jsx(DrawerContent, { openedId: openedId, menuItems: menuItems, conversations: conversations ?? [], handleSelect: handleSelect, draggedConversation: draggedConversation, activeDropZone: activeDropZone, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDropZoneDragOver: handleDropZoneDragOver, onDropZoneDragLeave: handleDropZoneDragLeave, onDropZoneDrop: handleDropZoneDrop, onMenuUnhandledKeyDown: handleMenuUnhandledKeyDown }) }) }), conversationToDelete ? (_jsx(ConversationDeleteDialog, { conversation: conversationToDelete, onClose: handleDeleteCancel, onDelete: handleDeleteSubmit })) : null] }));
|
|
216
|
+
}), children: _jsx(DrawerContent, { openedId: openedId, menuItems: menuItems, conversations: conversations ?? [], handleSelect: handleSelect, draggedConversation: draggedConversation, activeDropZone: activeDropZone, onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDropZoneDragOver: handleDropZoneDragOver, onDropZoneDragLeave: handleDropZoneDragLeave, onDropZoneDrop: handleDropZoneDrop, onMenuUnhandledKeyDown: handleMenuUnhandledKeyDown }) }) }), conversationToDelete ? (_jsx(ConversationDeleteDialog, { conversation: conversationToDelete, onClose: handleDeleteCancel, onDelete: handleDeleteSubmit })) : null, conversationToRename ? (_jsx(ConversationRenameDialog, { conversation: conversationToRename, onClose: handleRenameCancel, onRename: handleRenameSubmit })) : null] }));
|
|
176
217
|
}
|
|
177
218
|
function DrawerContent({ openedId, conversations, menuItems, handleSelect, draggedConversation, activeDropZone, onDragStart, onDragEnd, onDropZoneDragOver, onDropZoneDragLeave, onDropZoneDrop, onMenuUnhandledKeyDown, }) {
|
|
178
219
|
const intl = useIntl();
|
|
@@ -221,7 +262,8 @@ function ConversationsList({ id, openedId, listItems, handleSelect, onDragStart,
|
|
|
221
262
|
}
|
|
222
263
|
function DraggableConversationItem(props) {
|
|
223
264
|
const data = props.item.data;
|
|
224
|
-
|
|
265
|
+
const itemTitle = props.item.stringTitle || generateTemporaryTitle(props.intl, data);
|
|
266
|
+
return (_jsx("div", { draggable: true, title: itemTitle, className: cx("gd-gen-ai-chat__window__conversations__list__item", {
|
|
225
267
|
generatingTitle: data.generatingTitle,
|
|
226
268
|
inProgress: data.inProgress,
|
|
227
269
|
openedMenu: props.openedId === props.item.id,
|
|
@@ -233,7 +275,7 @@ function DraggableConversationItem(props) {
|
|
|
233
275
|
props.onDragEnd();
|
|
234
276
|
}, children: _jsx(DefaultUiMenuInteractiveItemWrapper, { ...props, item: {
|
|
235
277
|
...props.item,
|
|
236
|
-
stringTitle:
|
|
278
|
+
stringTitle: itemTitle,
|
|
237
279
|
} }) }));
|
|
238
280
|
}
|
|
239
281
|
const mapStateToProps = (state) => ({
|
|
@@ -244,6 +286,7 @@ const mapDispatchToProps = {
|
|
|
244
286
|
setHistory: setHistoryAction,
|
|
245
287
|
deleteConversation: deleteConversationAction,
|
|
246
288
|
pinConversation: pinConversationAction,
|
|
289
|
+
renameConversation: renameConversationAction,
|
|
247
290
|
loadConversation: setCurrentConversationAction,
|
|
248
291
|
};
|
|
249
292
|
export const GenAIChatConversations = connect(mapStateToProps, mapDispatchToProps)(GenAIChatConversationsComponent);
|
|
@@ -12,6 +12,6 @@ export function AssistantItemComponent({ message, group, isLast }) {
|
|
|
12
12
|
const messageState = getItemState(message);
|
|
13
13
|
const classNames = cx("gd-gen-ai-chat__messages__conversation", "gd-gen-ai-chat__messages__conversation--assistant", `gd-gen-ai-chat__messages__conversation--${message.content.type}`, messageState === "cancelled" && "gd-gen-ai-chat__messages__conversation--cancelled", isLast && "gd-gen-ai-chat__messages__conversation--isLast");
|
|
14
14
|
return (_jsxs("div", { className: classNames, "data-state": messageState, "data-testid": "gen-ai-conversation-assistant-message", children: [
|
|
15
|
-
_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsx(ReasoningIcon, { content: message.content }), _jsx(ConversationItemContents, { role: "assistant", message: message, isLoading: messageState === "loading", isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "followUp",
|
|
15
|
+
_jsx("span", { className: "gd-gen-ai-chat__visually__hidden", children: intl.formatMessage({ id: "gd.gen-ai.message.label.assistant" }) }), _jsx(ReasoningIcon, { content: message.content }), _jsx(ConversationItemContents, { role: "assistant", message: message, isLoading: messageState === "loading", isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "followUp", content: message.content, showSuggestions: isLast }), _jsx(AssistantItemFeedback, { group: group, message: message, isLast: isLast }), _jsx(AssistantItemSuggestions, { type: "actions", content: message.content, showSuggestions: isLast })
|
|
16
16
|
] }));
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IChatConversationErrorContent, type IChatConversationLocalContent } from "../../model.js";
|
|
2
2
|
export interface IAssistantItemSuggestionsProps {
|
|
3
3
|
showSuggestions?: boolean;
|
|
4
|
-
|
|
4
|
+
content: IChatConversationLocalContent | IChatConversationErrorContent;
|
|
5
5
|
type: "followUp" | "actions";
|
|
6
6
|
}
|
|
7
|
-
export declare function AssistantItemSuggestions({ type,
|
|
7
|
+
export declare function AssistantItemSuggestions({ type, content, showSuggestions }: IAssistantItemSuggestionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,16 +2,23 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
3
|
import { useDispatch, useSelector } from "react-redux";
|
|
4
4
|
import { UiButton } from "@gooddata/sdk-ui-kit";
|
|
5
|
-
import { makeUserItem } from "../../model.js";
|
|
5
|
+
import { makeUserItem, } from "../../model.js";
|
|
6
6
|
import { settingsSelector } from "../../store/chatWindow/chatWindowSelectors.js";
|
|
7
7
|
import { newMessageAction } from "../../store/messages/messagesSlice.js";
|
|
8
|
-
export function AssistantItemSuggestions({ type,
|
|
8
|
+
export function AssistantItemSuggestions({ type, content, showSuggestions }) {
|
|
9
9
|
const dispatch = useDispatch();
|
|
10
10
|
const settings = useSelector(settingsSelector);
|
|
11
|
-
if (!
|
|
11
|
+
if (!showSuggestions || !settings?.enableAiAgenticSuggestions) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (content.type !== "multipart") {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const suggestions = content.suggestions;
|
|
18
|
+
if (!suggestions) {
|
|
12
19
|
return null;
|
|
13
20
|
}
|
|
14
21
|
return (_jsxs(_Fragment, { children: [suggestions.actions && type === "actions" ? (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__suggestions", children: suggestions.actions?.map((suggestion) => (_jsx(UiButton, { label: suggestion.label, variant: "secondary", size: "small", onClick: () => {
|
|
15
22
|
dispatch(newMessageAction(makeUserItem({ type: "text", text: suggestion.query })));
|
|
16
|
-
}, tooltip: suggestion.query }, suggestion.label))) })) : null, suggestions.
|
|
23
|
+
}, tooltip: suggestion.query }, suggestion.label))) })) : null, suggestions.followUpQuestion && type === "followUp" ? (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__followUp", children: suggestions.followUpQuestion })) : null] }));
|
|
17
24
|
}
|
|
@@ -27,7 +27,7 @@ export function ConversationItemContents({ message, isLoading }) {
|
|
|
27
27
|
return (_jsx(ConversationTextContent, { useMarkdown: true, text: part.text, objects: part.objects }, index));
|
|
28
28
|
}
|
|
29
29
|
if (part.type === "visualization" && !whatIf) {
|
|
30
|
-
return (_jsx(ConversationVisualizationContent, {
|
|
30
|
+
return (_jsx(ConversationVisualizationContent, { message: message, part: part, visualization: part.visualization }, index));
|
|
31
31
|
}
|
|
32
32
|
if (part.type === "searchResults") {
|
|
33
33
|
return (_jsx(ConversationSearchContent, { results: part.searchResults, relationships: part.relationships, keywords: part.keywords }, index));
|
|
@@ -11,7 +11,6 @@ export type ConversationVisualizationContentProps = {
|
|
|
11
11
|
colorPalette?: IColorPalette;
|
|
12
12
|
className?: string;
|
|
13
13
|
agGridToken?: string;
|
|
14
|
-
useMarkdown?: boolean;
|
|
15
14
|
onCopyToClipboard?: (data: {
|
|
16
15
|
content: string;
|
|
17
16
|
}) => void;
|
|
@@ -20,7 +19,7 @@ export type ConversationVisualizationContentProps = {
|
|
|
20
19
|
enableNewPivotTable?: boolean;
|
|
21
20
|
enableAccessibleChartTooltip?: boolean;
|
|
22
21
|
};
|
|
23
|
-
declare function ConversationVisualizationContentCore({ message, part, scenario, visualization, className,
|
|
22
|
+
declare function ConversationVisualizationContentCore({ message, part, scenario, visualization, className, onCopyToClipboard, setKeyDriverAnalysis, colorPalette, agGridToken, enableChangeAnalysis, enableNewPivotTable, enableAccessibleChartTooltip }: ConversationVisualizationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
24
23
|
export declare const ConversationVisualizationContent: import("react-redux").ConnectedComponent<typeof ConversationVisualizationContentCore, {
|
|
25
24
|
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
26
25
|
store?: import("redux").Store<any, import("redux").UnknownAction, unknown> | undefined;
|
|
@@ -29,6 +28,5 @@ export declare const ConversationVisualizationContent: import("react-redux").Con
|
|
|
29
28
|
scenario?: IWhatIfRenderableScenario | undefined;
|
|
30
29
|
visualization: import("@gooddata/sdk-model").IInsight;
|
|
31
30
|
className?: string | undefined;
|
|
32
|
-
useMarkdown?: boolean | undefined;
|
|
33
31
|
}>;
|
|
34
32
|
export {};
|
|
@@ -14,14 +14,13 @@ import { useConfig } from "../../ConfigContext.js";
|
|
|
14
14
|
import { convertIntersectionToAttributeFilters, mergeFilters } from "../../utils/intersectionUtils.js";
|
|
15
15
|
import { VisualizationErrorBoundary } from "../components/VisualizationErrorBoundary.js";
|
|
16
16
|
import { DrillSelectDropdownMenu } from "../contents/drill/DrillSelectDropdownMenu.js";
|
|
17
|
-
import { MarkdownComponent } from "../contents/Markdown.js";
|
|
18
17
|
import { ConversationVisualisation, } from "./ConversationVisualisation.js";
|
|
19
18
|
import { SaveVisualizationDialog } from "./SaveVisualizationDialog.js";
|
|
20
19
|
import { createKdaDefinitionFromDrill, getDashboardAttributeFilter } from "./useKdaDefinition.js";
|
|
21
20
|
import { useSaveCheck } from "./useSaveCheck.js";
|
|
22
21
|
const MORE_MENU_BUTTON_ID = "gd-gen-ai-chat__visualization__save__more-menu-button";
|
|
23
22
|
const overlayAlignPoints = [{ align: "br tr" }];
|
|
24
|
-
function ConversationVisualizationContentCore({ message, part, scenario, visualization, className,
|
|
23
|
+
function ConversationVisualizationContentCore({ message, part, scenario, visualization, className, onCopyToClipboard, setKeyDriverAnalysis, colorPalette, agGridToken, enableChangeAnalysis, enableNewPivotTable, enableAccessibleChartTooltip, }) {
|
|
25
24
|
const containerRef = useRef(null);
|
|
26
25
|
const [hasVisFatal, setVisFatal] = useState(false);
|
|
27
26
|
const [visError, setVisError] = useState(null);
|
|
@@ -52,15 +51,15 @@ function ConversationVisualizationContentCore({ message, part, scenario, visuali
|
|
|
52
51
|
const classNames = cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--visualization", className);
|
|
53
52
|
return (_jsxs("div", { className: classNames, children: [
|
|
54
53
|
_jsx(DrillState, { drillState: drillState, setDrillState: setDrillState, containerRef: containerRef, setKeyDriverAnalysis: setKeyDriverAnalysis, children: _jsxs(Wrapper, { containerRef: containerRef, visualization: visualization, children: [
|
|
55
|
-
_jsx(VisualisationMenu, { visualization: visualization, scenario: scenario, isVisualisationSaved: visualisationSaved, isVisualisationCheckLoading: visualisationCheckLoading, isTable: isTable, onTable: setIsTable, hasError: hasVisFatal, moreButtonId: moreButtonDescId, onSave: onSave, onOpen: onOpen, onCopy: onCopy, isLoading: part.reporting ?? false }), _jsx(Title, { id: moreButtonDescId, visualization: visualization, scenario: scenario
|
|
54
|
+
_jsx(VisualisationMenu, { visualization: visualization, scenario: scenario, isVisualisationSaved: visualisationSaved, isVisualisationCheckLoading: visualisationCheckLoading, isTable: isTable, onTable: setIsTable, hasError: hasVisFatal, moreButtonId: moreButtonDescId, onSave: onSave, onOpen: onOpen, onCopy: onCopy, isLoading: part.reporting ?? false }), _jsx(Title, { id: moreButtonDescId, visualization: visualization, scenario: scenario }), _jsx(VisualisationWrapper, { message: message, colorPalette: colorPalette, isTable: isTable, visualization: visualization, agGridToken: agGridToken, execConfig: scenario?.execConfig, enableChangeAnalysis: enableChangeAnalysis, enableNewPivotTable: enableNewPivotTable, enableAccessibleChartTooltip: enableAccessibleChartTooltip, enableDrilling: !scenario || scenario.isBaseline, onDrillFired: setDrillState, onVisualisationError: onVisualizationError }), _jsx(SaveDialog, {})
|
|
56
55
|
] }) }), _jsx(VisualizationErrorReport, { error: visError })
|
|
57
56
|
] }));
|
|
58
57
|
}
|
|
59
58
|
function Wrapper({ containerRef, visualization, children }) {
|
|
60
59
|
return (_jsx("div", { ref: containerRef, "data-testid": "gen-ai-conversation-visualization", "data-visualization-type": visualization?.insight.visualizationUrl.replace("local:", "").toLowerCase() ?? "unknown", className: cx("gd-gen-ai-chat__conversation__visualization", `gd-gen-ai-chat__conversation__visualization--${visualization?.insight.visualizationUrl.replace("local:", "").toLowerCase() ?? "unknown"}`), children: children }));
|
|
61
60
|
}
|
|
62
|
-
function Title({ id, visualization, scenario
|
|
63
|
-
return (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__title", id: id, children:
|
|
61
|
+
function Title({ id, visualization, scenario }) {
|
|
62
|
+
return (_jsx("div", { className: "gd-gen-ai-chat__conversation__visualization__title", id: id, children: scenario?.label ?? visualization?.insight.title ?? "" }));
|
|
64
63
|
}
|
|
65
64
|
function VisualisationMenu({ visualization, scenario, isVisualisationSaved, isVisualisationCheckLoading, hasError, isLoading, isTable, onTable, moreButtonId, onSave, onOpen, onCopy, }) {
|
|
66
65
|
const [isMenuButtonOpen, setMenuButtonOpen] = useState(false);
|
|
@@ -7,5 +7,5 @@ export function ConversationWhatIfContent({ className, part, message, whatIf, })
|
|
|
7
7
|
if (!whatIf) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
return (_jsx("div", { className: classNames, children: whatIf.scenarios.map((scenario, index) => (_jsx(ConversationVisualizationContent, {
|
|
10
|
+
return (_jsx("div", { className: classNames, children: whatIf.scenarios.map((scenario, index) => (_jsx(ConversationVisualizationContent, { message: message, part: part, scenario: scenario, visualization: whatIf.insight }, index))) }));
|
|
11
11
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { GenAIChat, GenAIAssistant, type GenAIChatProps, type GenAIAssistantProps, } from "./components/GenAIChat.js";
|
|
7
7
|
export { makeUserMessage, makeTextContents, makeUserItem, makeAssistantItem, type Message, type BaseMessage, type UserMessage, type AssistantMessage, type Contents, type TextContents, type SearchContents, type SemanticSearchContents, type RoutingContents, type ReasoningContents, type ReasoningStep, type ReasoningThought, type VisualizationContents, type ChangeAnalysisContents, type ErrorContents, type TextContentObject, type IChatConversationLocalContent, type IChatConversationLocalItem, type IChatConversationErrorContent, type IChatConversationMultipartLocalPart, } from "./model.js";
|
|
8
|
-
export { type ChatEventHandler, type BaseEvent, type ChatAssistantMessageEvent, type ChatUserMessageEvent, type ChatClosedEvent, type ChatOpenedEvent, type ChatResetEvent, type ChatFeedbackEvent, type ChatFeedbackErrorEvent, type ChatEvent, type ChatVisualizationErrorEvent, type ChatSaveVisualizationErrorEvent, type ChatSaveVisualizationSuccessEvent, type ChatCopyToClipboardEvent, type ChatConversationPinnedEvent, type ChatConversationDeletedEvent, type ChatConversationPinErrorEvent, type ChatConversationDeletedErrorEvent, isChatAssistantMessageEvent, isChatUserMessageEvent, isChatClosedEvent, isChatOpenedEvent, isChatResetEvent, isChatFeedbackEvent, isChatFeedbackErrorEvent, isChatVisualizationErrorEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatCopyToClipboardEvent, isChatConversationDeletedEvent, isChatConversationPinnedEvent, isChatConversationPinErrorEvent, isChatConversationDeletedErrorEvent, } from "./store/events.js";
|
|
8
|
+
export { type ChatEventHandler, type BaseEvent, type ChatAssistantMessageEvent, type ChatUserMessageEvent, type ChatClosedEvent, type ChatOpenedEvent, type ChatResetEvent, type ChatFeedbackEvent, type ChatFeedbackErrorEvent, type ChatEvent, type ChatVisualizationErrorEvent, type ChatSaveVisualizationErrorEvent, type ChatSaveVisualizationSuccessEvent, type ChatCopyToClipboardEvent, type ChatConversationPinnedEvent, type ChatConversationDeletedEvent, type ChatConversationPinErrorEvent, type ChatConversationDeletedErrorEvent, type ChatConversationRenamedEvent, type ChatConversationRenamedErrorEvent, isChatAssistantMessageEvent, isChatUserMessageEvent, isChatClosedEvent, isChatOpenedEvent, isChatResetEvent, isChatFeedbackEvent, isChatFeedbackErrorEvent, isChatVisualizationErrorEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatCopyToClipboardEvent, isChatConversationDeletedEvent, isChatConversationPinnedEvent, isChatConversationPinErrorEvent, isChatConversationDeletedErrorEvent, isChatConversationRenamedEvent, isChatConversationRenamedErrorEvent, } from "./store/events.js";
|
|
9
9
|
export { clearThreadAction, newMessageAction } from "./store/messages/messagesSlice.js";
|
|
10
10
|
export { type LinkHandlerEvent } from "./components/ConfigContext.js";
|
|
11
11
|
export { useGenAiChatAvailability } from "./hooks/useGenAiChatAvailability.js";
|
package/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { GenAIChat, GenAIAssistant, } from "./components/GenAIChat.js";
|
|
9
9
|
export { makeUserMessage, makeTextContents, makeUserItem, makeAssistantItem, } from "./model.js";
|
|
10
|
-
export { isChatAssistantMessageEvent, isChatUserMessageEvent, isChatClosedEvent, isChatOpenedEvent, isChatResetEvent, isChatFeedbackEvent, isChatFeedbackErrorEvent, isChatVisualizationErrorEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatCopyToClipboardEvent, isChatConversationDeletedEvent, isChatConversationPinnedEvent, isChatConversationPinErrorEvent, isChatConversationDeletedErrorEvent, } from "./store/events.js";
|
|
10
|
+
export { isChatAssistantMessageEvent, isChatUserMessageEvent, isChatClosedEvent, isChatOpenedEvent, isChatResetEvent, isChatFeedbackEvent, isChatFeedbackErrorEvent, isChatVisualizationErrorEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatCopyToClipboardEvent, isChatConversationDeletedEvent, isChatConversationPinnedEvent, isChatConversationPinErrorEvent, isChatConversationDeletedErrorEvent, isChatConversationRenamedEvent, isChatConversationRenamedErrorEvent, } from "./store/events.js";
|
|
11
11
|
export { clearThreadAction, newMessageAction } from "./store/messages/messagesSlice.js";
|
|
12
12
|
export { useGenAiChatAvailability } from "./hooks/useGenAiChatAvailability.js";
|
|
13
13
|
//customization
|
|
@@ -255,6 +255,10 @@ export declare const en_US: {
|
|
|
255
255
|
text: string;
|
|
256
256
|
crowdinContext: string;
|
|
257
257
|
};
|
|
258
|
+
"gd.gen-ai.conversations.menu.rename": {
|
|
259
|
+
text: string;
|
|
260
|
+
crowdinContext: string;
|
|
261
|
+
};
|
|
258
262
|
"gd.gen-ai.conversations.menu.aria-label": {
|
|
259
263
|
text: string;
|
|
260
264
|
crowdinContext: string;
|
|
@@ -283,6 +287,22 @@ export declare const en_US: {
|
|
|
283
287
|
text: string;
|
|
284
288
|
crowdinContext: string;
|
|
285
289
|
};
|
|
290
|
+
"gd.gen-ai.conversations.rename-dialog.title": {
|
|
291
|
+
text: string;
|
|
292
|
+
crowdinContext: string;
|
|
293
|
+
};
|
|
294
|
+
"gd.gen-ai.conversations.rename-dialog.label": {
|
|
295
|
+
text: string;
|
|
296
|
+
crowdinContext: string;
|
|
297
|
+
};
|
|
298
|
+
"gd.gen-ai.conversations.rename-dialog.submit": {
|
|
299
|
+
text: string;
|
|
300
|
+
crowdinContext: string;
|
|
301
|
+
};
|
|
302
|
+
"gd.gen-ai.conversations.rename-dialog.cancel": {
|
|
303
|
+
text: string;
|
|
304
|
+
crowdinContext: string;
|
|
305
|
+
};
|
|
286
306
|
"gd.chat.conversation.generating-title": {
|
|
287
307
|
text: string;
|
|
288
308
|
crowdinContext: string;
|
|
@@ -166,7 +166,7 @@ export const en_US = {
|
|
|
166
166
|
"crowdinContext": "Tooltip for button that resets the AI chatbot conversation"
|
|
167
167
|
},
|
|
168
168
|
"gd.gen-ai.header.conversations-tooltip": {
|
|
169
|
-
"text": "
|
|
169
|
+
"text": "Recent conversations",
|
|
170
170
|
"crowdinContext": "Tooltip for button that opens the conversation history list"
|
|
171
171
|
},
|
|
172
172
|
"gd.gen-ai.header.new-conversation-tooltip": {
|
|
@@ -226,7 +226,7 @@ export const en_US = {
|
|
|
226
226
|
"crowdinContext": "Tooltip for button that closes the conversation history list"
|
|
227
227
|
},
|
|
228
228
|
"gd.gen-ai.conversations.title": {
|
|
229
|
-
"text": "Recent
|
|
229
|
+
"text": "Recent conversations",
|
|
230
230
|
"crowdinContext": "Title shown above the conversation history list"
|
|
231
231
|
},
|
|
232
232
|
"gd.gen-ai.conversations.empty": {
|
|
@@ -257,8 +257,12 @@ export const en_US = {
|
|
|
257
257
|
"text": "Unpin",
|
|
258
258
|
"crowdinContext": "Menu option to unpin a conversation from the top of the conversation history list"
|
|
259
259
|
},
|
|
260
|
+
"gd.gen-ai.conversations.menu.rename": {
|
|
261
|
+
"text": "Rename",
|
|
262
|
+
"crowdinContext": "Menu option to rename an existing conversation"
|
|
263
|
+
},
|
|
260
264
|
"gd.gen-ai.conversations.menu.aria-label": {
|
|
261
|
-
"text": "
|
|
265
|
+
"text": "More options",
|
|
262
266
|
"crowdinContext": "Accessibility label for the conversation menu"
|
|
263
267
|
},
|
|
264
268
|
"gd.gen-ai.conversations.dnd.pin-placeholder": {
|
|
@@ -285,6 +289,22 @@ export const en_US = {
|
|
|
285
289
|
"text": "Cancel",
|
|
286
290
|
"crowdinContext": "Cancel button label in conversation delete confirmation dialog"
|
|
287
291
|
},
|
|
292
|
+
"gd.gen-ai.conversations.rename-dialog.title": {
|
|
293
|
+
"text": "Rename conversation",
|
|
294
|
+
"crowdinContext": "Title of the dialog for renaming a conversation"
|
|
295
|
+
},
|
|
296
|
+
"gd.gen-ai.conversations.rename-dialog.label": {
|
|
297
|
+
"text": "Conversation name",
|
|
298
|
+
"crowdinContext": "Label for the input field used to rename a conversation"
|
|
299
|
+
},
|
|
300
|
+
"gd.gen-ai.conversations.rename-dialog.submit": {
|
|
301
|
+
"text": "Rename",
|
|
302
|
+
"crowdinContext": "Submit button label in conversation rename dialog"
|
|
303
|
+
},
|
|
304
|
+
"gd.gen-ai.conversations.rename-dialog.cancel": {
|
|
305
|
+
"text": "Cancel",
|
|
306
|
+
"crowdinContext": "Cancel button label in conversation rename dialog"
|
|
307
|
+
},
|
|
288
308
|
"gd.chat.conversation.generating-title": {
|
|
289
309
|
"text": "Conversation {date}",
|
|
290
310
|
"crowdinContext": "Title shown for a conversation that has not title generated yet"
|
package/esm/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IChatConversation, type IChatConversationContent, type IChatConversationError, type IChatConversationItem, type IChatConversationMultipartPart, type
|
|
1
|
+
import { type IChatConversation, type IChatConversationContent, type IChatConversationError, type IChatConversationItem, type IChatConversationMultipartPart, type IChatSuggestions } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import type { GenAIChatInteractionUserFeedback, GenAIChatRoutingUseCase, IGenAIChangeAnalysisParams, IGenAIVisualization, ISemanticSearchRelationship, ISemanticSearchResult, ISemanticSearchResultItem } from "@gooddata/sdk-model";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
@@ -235,7 +235,6 @@ export type IChatConversationLocalItem = Omit<IChatConversationItem, "content">
|
|
|
235
235
|
streaming?: boolean;
|
|
236
236
|
localId: string;
|
|
237
237
|
content: IChatConversationLocalContent | IChatConversationErrorContent;
|
|
238
|
-
suggestions?: IChatSuggestionsItem;
|
|
239
238
|
};
|
|
240
239
|
/**
|
|
241
240
|
* Type guard for the IChatConversationLocalItem.
|
|
@@ -276,6 +275,7 @@ export type IChatConversationMultipartLocalPart = IChatConversationMultipartPart
|
|
|
276
275
|
message: string;
|
|
277
276
|
};
|
|
278
277
|
objects?: TextContentObject[];
|
|
278
|
+
suggestions?: IChatSuggestions;
|
|
279
279
|
};
|
|
280
280
|
/**
|
|
281
281
|
* Make a new conversation item with local ID.
|
package/esm/sdk-ui-gen-ai.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { IChatConversationContent } from '@gooddata/sdk-backend-spi';
|
|
|
18
18
|
import { IChatConversationError } from '@gooddata/sdk-backend-spi';
|
|
19
19
|
import { IChatConversationItem } from '@gooddata/sdk-backend-spi';
|
|
20
20
|
import { IChatConversationMultipartPart } from '@gooddata/sdk-backend-spi';
|
|
21
|
-
import {
|
|
21
|
+
import { IChatSuggestions } from '@gooddata/sdk-backend-spi';
|
|
22
22
|
import { IColorPalette } from '@gooddata/sdk-model';
|
|
23
23
|
import type { IGenAIChangeAnalysisParams } from '@gooddata/sdk-model';
|
|
24
24
|
import type { IGenAIVisualization } from '@gooddata/sdk-model';
|
|
@@ -141,6 +141,27 @@ export declare type ChatConversationPinnedEvent = BaseEvent & {
|
|
|
141
141
|
pinned: boolean;
|
|
142
142
|
};
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* A chat conversation renamed error event.
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
export declare type ChatConversationRenamedErrorEvent = BaseEvent & {
|
|
149
|
+
type: "chatConversationRenamedError";
|
|
150
|
+
conversationId: string;
|
|
151
|
+
title: string;
|
|
152
|
+
error: Error;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A chat conversation renamed event.
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
export declare type ChatConversationRenamedEvent = BaseEvent & {
|
|
160
|
+
type: "chatConversationRenamed";
|
|
161
|
+
conversationId: string;
|
|
162
|
+
title: string;
|
|
163
|
+
};
|
|
164
|
+
|
|
144
165
|
/**
|
|
145
166
|
* A chat copy to clipboard event.
|
|
146
167
|
* @public
|
|
@@ -154,7 +175,7 @@ export declare type ChatCopyToClipboardEvent = BaseEvent & {
|
|
|
154
175
|
* A union type for all chat events.
|
|
155
176
|
* @public
|
|
156
177
|
*/
|
|
157
|
-
export declare type ChatEvent = ChatOpenedEvent | ChatClosedEvent | ChatResetEvent | ChatConversationPinnedEvent | ChatConversationPinErrorEvent | ChatConversationDeletedEvent | ChatConversationDeletedErrorEvent | ChatUserMessageEvent | ChatAssistantMessageEvent | ChatFeedbackEvent | ChatFeedbackErrorEvent | ChatCopyToClipboardEvent | ChatVisualizationErrorEvent | ChatSaveVisualizationErrorEvent | ChatSaveVisualizationSuccessEvent;
|
|
178
|
+
export declare type ChatEvent = ChatOpenedEvent | ChatClosedEvent | ChatResetEvent | ChatConversationPinnedEvent | ChatConversationPinErrorEvent | ChatConversationDeletedEvent | ChatConversationDeletedErrorEvent | ChatConversationRenamedEvent | ChatConversationRenamedErrorEvent | ChatUserMessageEvent | ChatAssistantMessageEvent | ChatFeedbackEvent | ChatFeedbackErrorEvent | ChatCopyToClipboardEvent | ChatVisualizationErrorEvent | ChatSaveVisualizationErrorEvent | ChatSaveVisualizationSuccessEvent;
|
|
158
179
|
|
|
159
180
|
/**
|
|
160
181
|
* An event handler for the Chat component.
|
|
@@ -450,7 +471,6 @@ export declare type IChatConversationLocalItem = Omit<IChatConversationItem, "co
|
|
|
450
471
|
streaming?: boolean;
|
|
451
472
|
localId: string;
|
|
452
473
|
content: IChatConversationLocalContent | IChatConversationErrorContent;
|
|
453
|
-
suggestions?: IChatSuggestionsItem;
|
|
454
474
|
};
|
|
455
475
|
|
|
456
476
|
/**
|
|
@@ -468,6 +488,7 @@ export declare type IChatConversationMultipartLocalPart = IChatConversationMulti
|
|
|
468
488
|
message: string;
|
|
469
489
|
};
|
|
470
490
|
objects?: TextContentObject[];
|
|
491
|
+
suggestions?: IChatSuggestions;
|
|
471
492
|
};
|
|
472
493
|
|
|
473
494
|
/**
|
|
@@ -533,6 +554,18 @@ export declare const isChatConversationPinErrorEvent: (event: ChatEvent) => even
|
|
|
533
554
|
*/
|
|
534
555
|
export declare const isChatConversationPinnedEvent: (event: ChatEvent) => event is ChatConversationPinnedEvent;
|
|
535
556
|
|
|
557
|
+
/**
|
|
558
|
+
* Type guard for the ChatConversationRenamedErrorEvent.
|
|
559
|
+
* @public
|
|
560
|
+
*/
|
|
561
|
+
export declare const isChatConversationRenamedErrorEvent: (event: ChatEvent) => event is ChatConversationRenamedErrorEvent;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Type guard for the ChatConversationRenamedEvent.
|
|
565
|
+
* @public
|
|
566
|
+
*/
|
|
567
|
+
export declare const isChatConversationRenamedEvent: (event: ChatEvent) => event is ChatConversationRenamedEvent;
|
|
568
|
+
|
|
536
569
|
/**
|
|
537
570
|
* Type guard for the ChatCopyToClipboardEvent.
|
|
538
571
|
* @public
|
package/esm/store/events.d.ts
CHANGED
|
@@ -99,6 +99,35 @@ export type ChatConversationDeletedErrorEvent = BaseEvent & {
|
|
|
99
99
|
* @public
|
|
100
100
|
*/
|
|
101
101
|
export declare const isChatConversationDeletedErrorEvent: (event: ChatEvent) => event is ChatConversationDeletedErrorEvent;
|
|
102
|
+
/**
|
|
103
|
+
* A chat conversation renamed event.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export type ChatConversationRenamedEvent = BaseEvent & {
|
|
107
|
+
type: "chatConversationRenamed";
|
|
108
|
+
conversationId: string;
|
|
109
|
+
title: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Type guard for the ChatConversationRenamedEvent.
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export declare const isChatConversationRenamedEvent: (event: ChatEvent) => event is ChatConversationRenamedEvent;
|
|
116
|
+
/**
|
|
117
|
+
* A chat conversation renamed error event.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
export type ChatConversationRenamedErrorEvent = BaseEvent & {
|
|
121
|
+
type: "chatConversationRenamedError";
|
|
122
|
+
conversationId: string;
|
|
123
|
+
title: string;
|
|
124
|
+
error: Error;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Type guard for the ChatConversationRenamedErrorEvent.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
export declare const isChatConversationRenamedErrorEvent: (event: ChatEvent) => event is ChatConversationRenamedErrorEvent;
|
|
102
131
|
/**
|
|
103
132
|
* A chat user message event.
|
|
104
133
|
* @public
|
|
@@ -214,7 +243,7 @@ export declare const isChatCopyToClipboardEvent: (event: ChatEvent) => event is
|
|
|
214
243
|
* A union type for all chat events.
|
|
215
244
|
* @public
|
|
216
245
|
*/
|
|
217
|
-
export type ChatEvent = ChatOpenedEvent | ChatClosedEvent | ChatResetEvent | ChatConversationPinnedEvent | ChatConversationPinErrorEvent | ChatConversationDeletedEvent | ChatConversationDeletedErrorEvent | ChatUserMessageEvent | ChatAssistantMessageEvent | ChatFeedbackEvent | ChatFeedbackErrorEvent | ChatCopyToClipboardEvent | ChatVisualizationErrorEvent | ChatSaveVisualizationErrorEvent | ChatSaveVisualizationSuccessEvent;
|
|
246
|
+
export type ChatEvent = ChatOpenedEvent | ChatClosedEvent | ChatResetEvent | ChatConversationPinnedEvent | ChatConversationPinErrorEvent | ChatConversationDeletedEvent | ChatConversationDeletedErrorEvent | ChatConversationRenamedEvent | ChatConversationRenamedErrorEvent | ChatUserMessageEvent | ChatAssistantMessageEvent | ChatFeedbackEvent | ChatFeedbackErrorEvent | ChatCopyToClipboardEvent | ChatVisualizationErrorEvent | ChatSaveVisualizationErrorEvent | ChatSaveVisualizationSuccessEvent;
|
|
218
247
|
/**
|
|
219
248
|
* An event handler for the Chat component.
|
|
220
249
|
* @public
|
package/esm/store/events.js
CHANGED
|
@@ -48,6 +48,20 @@ export const isChatConversationDeletedEvent = (event) => {
|
|
|
48
48
|
export const isChatConversationDeletedErrorEvent = (event) => {
|
|
49
49
|
return event.type === "chatConversationDeletedError";
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* Type guard for the ChatConversationRenamedEvent.
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export const isChatConversationRenamedEvent = (event) => {
|
|
56
|
+
return event.type === "chatConversationRenamed";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Type guard for the ChatConversationRenamedErrorEvent.
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export const isChatConversationRenamedErrorEvent = (event) => {
|
|
63
|
+
return event.type === "chatConversationRenamedError";
|
|
64
|
+
};
|
|
51
65
|
/**
|
|
52
66
|
* Type guard for the ChatUserMessageEvent.
|
|
53
67
|
* @public
|