@gooddata/sdk-ui-gen-ai 11.52.0-alpha.3 → 11.52.0-alpha.4
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 +84 -12
- package/esm/components/GenAIChatConversations.d.ts +3 -15
- package/esm/components/GenAIChatConversations.d.ts.map +1 -1
- package/esm/components/GenAIChatConversations.js +16 -23
- package/esm/components/GenAIChatOverlay.d.ts +2 -14
- package/esm/components/GenAIChatOverlay.d.ts.map +1 -1
- package/esm/components/GenAIChatOverlay.js +10 -18
- package/esm/components/GenAiChatContextChooser.d.ts +1 -2
- package/esm/components/GenAiChatContextChooser.d.ts.map +1 -1
- package/esm/components/GenAiChatContextChooser.js +7 -15
- package/esm/components/GenAiConversations.d.ts.map +1 -1
- package/esm/components/GenAiConversations.js +14 -14
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +14 -22
- package/esm/components/hooks/useThreadLoading.d.ts +2 -3
- package/esm/components/hooks/useThreadLoading.d.ts.map +1 -1
- package/esm/components/messages/AssistantMessage.d.ts +7 -1
- package/esm/components/messages/AssistantMessage.d.ts.map +1 -1
- package/esm/components/messages/AssistantMessage.js +8 -7
- package/esm/components/messages/conversationContents/ConversationKdaContent.d.ts +1 -11
- package/esm/components/messages/conversationContents/ConversationKdaContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationKdaContent.js +11 -18
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts +1 -30
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationVisualizationContent.js +16 -25
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts +1 -24
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/SaveVisualizationDialog.js +11 -29
- package/esm/components/messages/useUserFeedback.d.ts +8 -1
- package/esm/components/messages/useUserFeedback.d.ts.map +1 -1
- package/package.json +20 -20
package/NOTICE
CHANGED
|
@@ -9,7 +9,7 @@ The following 3rd-party software packages may be used by or distributed with goo
|
|
|
9
9
|
|
|
10
10
|
Date generated: 2026-8-7
|
|
11
11
|
|
|
12
|
-
Revision ID:
|
|
12
|
+
Revision ID: 81ef8e705df7e83197c71d5bca4ff1d157c580f3
|
|
13
13
|
|
|
14
14
|
================================================================================
|
|
15
15
|
================================================================================
|
|
@@ -251,7 +251,7 @@ Revision ID: 15e463243a78a55661d527ee35ed2c14c2d70169
|
|
|
251
251
|
- @peculiar/asn1-x509-attr (2.8.0) [MIT]
|
|
252
252
|
- @peculiar/utils (2.0.3) [MIT]
|
|
253
253
|
- @peculiar/x509 (1.14.3) [MIT]
|
|
254
|
-
- @playwright/test (1.
|
|
254
|
+
- @playwright/test (1.62.1) [Apache-2.0]
|
|
255
255
|
- @react-aria/interactions (3.28.1) [Apache-2.0]
|
|
256
256
|
- @react-dnd/asap (4.0.1) [MIT]
|
|
257
257
|
- @react-dnd/asap (5.0.2) [MIT]
|
|
@@ -815,8 +815,8 @@ Revision ID: 15e463243a78a55661d527ee35ed2c14c2d70169
|
|
|
815
815
|
- pify (4.0.1) [MIT]
|
|
816
816
|
- pkg-dir (4.2.0) [MIT]
|
|
817
817
|
- pkijs (3.4.0) [BSD-3-Clause]
|
|
818
|
-
- playwright (1.
|
|
819
|
-
- playwright-core (1.
|
|
818
|
+
- playwright (1.62.1) [Apache-2.0, MIT, BSD-3-Clause, blueoak-1.0.0, ISC, CC-BY-4.0]
|
|
819
|
+
- playwright-core (1.62.1) [Apache-2.0, MIT, ISC, BSD-2-Clause, BSD-3-Clause, blueoak-1.0.0, NCSA]
|
|
820
820
|
- polished (3.7.2) [MIT, OFL-1.1]
|
|
821
821
|
- possible-typed-array-names (1.1.0) [MIT]
|
|
822
822
|
- postcss (8.5.10) [MIT]
|
|
@@ -3801,9 +3801,9 @@ MIT
|
|
|
3801
3801
|
|
|
3802
3802
|
|
|
3803
3803
|
--------------------------------------------------------------------------------
|
|
3804
|
-
Package Title: @playwright/test (1.
|
|
3804
|
+
Package Title: @playwright/test (1.62.1)
|
|
3805
3805
|
|
|
3806
|
-
Package Locator: npm+@playwright/test$1.
|
|
3806
|
+
Package Locator: npm+@playwright/test$1.62.1
|
|
3807
3807
|
|
|
3808
3808
|
Package Depth: Direct
|
|
3809
3809
|
--------------------------------------------------------------------------------
|
|
@@ -10613,9 +10613,9 @@ BSD-3-Clause
|
|
|
10613
10613
|
|
|
10614
10614
|
|
|
10615
10615
|
--------------------------------------------------------------------------------
|
|
10616
|
-
Package Title: playwright (1.
|
|
10616
|
+
Package Title: playwright (1.62.1)
|
|
10617
10617
|
|
|
10618
|
-
Package Locator: npm+playwright$1.
|
|
10618
|
+
Package Locator: npm+playwright$1.62.1
|
|
10619
10619
|
|
|
10620
10620
|
Package Depth: Transitive
|
|
10621
10621
|
--------------------------------------------------------------------------------
|
|
@@ -10625,13 +10625,13 @@ Apache-2.0
|
|
|
10625
10625
|
|
|
10626
10626
|
|
|
10627
10627
|
* Other Licenses *
|
|
10628
|
-
MIT, ISC, CC-BY-4.0
|
|
10628
|
+
MIT, BSD-3-Clause, blueoak-1.0.0, ISC, CC-BY-4.0
|
|
10629
10629
|
|
|
10630
10630
|
|
|
10631
10631
|
--------------------------------------------------------------------------------
|
|
10632
|
-
Package Title: playwright-core (1.
|
|
10632
|
+
Package Title: playwright-core (1.62.1)
|
|
10633
10633
|
|
|
10634
|
-
Package Locator: npm+playwright-core$1.
|
|
10634
|
+
Package Locator: npm+playwright-core$1.62.1
|
|
10635
10635
|
|
|
10636
10636
|
Package Depth: Transitive
|
|
10637
10637
|
--------------------------------------------------------------------------------
|
|
@@ -10641,7 +10641,7 @@ Apache-2.0
|
|
|
10641
10641
|
|
|
10642
10642
|
|
|
10643
10643
|
* Other Licenses *
|
|
10644
|
-
MIT, ISC, BSD-2-Clause, BSD-3-Clause
|
|
10644
|
+
MIT, ISC, BSD-2-Clause, BSD-3-Clause, blueoak-1.0.0, NCSA
|
|
10645
10645
|
|
|
10646
10646
|
|
|
10647
10647
|
--------------------------------------------------------------------------------
|
|
@@ -25103,6 +25103,20 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
25103
25103
|
"""
|
|
25104
25104
|
|
|
25105
25105
|
|
|
25106
|
+
* NCSA *
|
|
25107
|
+
|
|
25108
|
+
University of Illinois/NCSA Open Source License
|
|
25109
|
+
Copyright (c) <Year> <Owner Organization Name> . All rights reserved.
|
|
25110
|
+
Developed by:
|
|
25111
|
+
<Name of Development Group>
|
|
25112
|
+
<Name of Institution>
|
|
25113
|
+
<URL for Development Group/Institution>
|
|
25114
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
25115
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
|
25116
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
|
|
25117
|
+
* Neither the names of <Name of Development Group, Name of Institution> , nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
|
|
25118
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
|
25119
|
+
|
|
25106
25120
|
* MIT *
|
|
25107
25121
|
|
|
25108
25122
|
Node.js is licensed for use as follows:
|
|
@@ -29220,6 +29234,64 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
|
29220
29234
|
|
|
29221
29235
|
\n\n UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE\n\n See Terms of Use for definitions of Unicode Inc.'s\n Data Files and Software.\n\n NOTICE TO USER: Carefully read the following legal agreement.\n BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S\n DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),\n YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE\n TERMS AND CONDITIONS OF THIS AGREEMENT.\n IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE\n THE DATA FILES OR SOFTWARE.\n\n COPYRIGHT AND PERMISSION NOTICE\n\n Copyright © 1991-2020 Unicode, Inc. All rights reserved.\n Distributed under the Terms of Use in https://www.unicode.org/copyright.html.\n\n Permission is hereby granted, free of charge, to any person obtaining\n a copy of the Unicode data files and any associated documentation\n (the "Data Files") or Unicode software and any associated documentation\n (the "Software") to deal in the Data Files or Software\n without restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, and/or sell copies of\n the Data Files or Software, and to permit persons to whom the Data Files\n or Software are furnished to do so, provided that either\n (a) this copyright and permission notice appear with all copies\n of the Data Files or Software, or\n (b) this copyright and permission notice appear in associated\n Documentation.\n\n THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF\n ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT OF THIRD PARTY RIGHTS.\n IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS\n NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL\n DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,\n DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THE DATA FILES OR SOFTWARE.\n\n Except as contained in this notice, the name of a copyright holder\n shall not be used in advertising or otherwise to promote the sale,\n use or other dealings in these Data Files or Software without prior\n written authorization of the copyright holder.\n\n
|
|
29222
29236
|
|
|
29237
|
+
* blueoak-1.0.0 *
|
|
29238
|
+
|
|
29239
|
+
# Blue Oak Model License
|
|
29240
|
+
|
|
29241
|
+
Version 1.0.0
|
|
29242
|
+
|
|
29243
|
+
## Purpose
|
|
29244
|
+
|
|
29245
|
+
This license gives everyone as much permission to work with
|
|
29246
|
+
this software as possible, while protecting contributors
|
|
29247
|
+
from liability.
|
|
29248
|
+
|
|
29249
|
+
## Acceptance
|
|
29250
|
+
|
|
29251
|
+
In order to receive this license, you must agree to its
|
|
29252
|
+
rules. The rules of this license are both obligations
|
|
29253
|
+
under that agreement and conditions to your license.
|
|
29254
|
+
You must not do anything with this software that triggers
|
|
29255
|
+
a rule that you cannot or will not follow.
|
|
29256
|
+
|
|
29257
|
+
## Copyright
|
|
29258
|
+
|
|
29259
|
+
Each contributor licenses you to do everything with this
|
|
29260
|
+
software that would otherwise infringe that contributor's
|
|
29261
|
+
copyright in it.
|
|
29262
|
+
|
|
29263
|
+
## Notices
|
|
29264
|
+
|
|
29265
|
+
You must ensure that everyone who gets a copy of
|
|
29266
|
+
any part of this software from you, with or without
|
|
29267
|
+
changes, also gets the text of this license or a link to
|
|
29268
|
+
<https://blueoakcouncil.org/license/1.0.0>.
|
|
29269
|
+
|
|
29270
|
+
## Excuse
|
|
29271
|
+
|
|
29272
|
+
If anyone notifies you in writing that you have not
|
|
29273
|
+
complied with [Notices](#notices), you can keep your
|
|
29274
|
+
license by taking all practical steps to comply within 30
|
|
29275
|
+
days after the notice. If you do not do so, your license
|
|
29276
|
+
ends immediately.
|
|
29277
|
+
|
|
29278
|
+
## Patent
|
|
29279
|
+
|
|
29280
|
+
Each contributor licenses you to do everything with this
|
|
29281
|
+
software that would otherwise infringe any patent claims
|
|
29282
|
+
they can license or become able to license.
|
|
29283
|
+
|
|
29284
|
+
## Reliability
|
|
29285
|
+
|
|
29286
|
+
No contributor can revoke this license.
|
|
29287
|
+
|
|
29288
|
+
## No Liability
|
|
29289
|
+
|
|
29290
|
+
***As far as the law allows, this software comes as is,
|
|
29291
|
+
without any warranty or condition, and no contributor
|
|
29292
|
+
will be liable to anyone for any damages related to this
|
|
29293
|
+
software or this license, under any kind of legal claim.***
|
|
29294
|
+
|
|
29223
29295
|
* MIT *
|
|
29224
29296
|
|
|
29225
29297
|
jsonschema is licensed under MIT license.
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
2
|
import { type IChatConversationLocal } from "../model.js";
|
|
3
|
-
|
|
4
|
-
import { deleteConversationAction, pinConversationAction, renameConversationAction } from "../store/messages/messagesSlice.js";
|
|
5
|
-
type GenAIChatConversationsStateProps = {
|
|
6
|
-
conversation: ReturnType<typeof conversationSelector>;
|
|
7
|
-
conversations: ReturnType<typeof conversationsSelector>;
|
|
8
|
-
};
|
|
9
|
-
type GenAIChatConversationsDispatchProps = {
|
|
10
|
-
deleteConversation: typeof deleteConversationAction;
|
|
11
|
-
pinConversation: typeof pinConversationAction;
|
|
12
|
-
renameConversation: typeof renameConversationAction;
|
|
13
|
-
};
|
|
14
|
-
type GenAIChatConversationsExternalProps = {
|
|
3
|
+
type GenAIChatConversationsProps = {
|
|
15
4
|
wrapper?: ReactElement;
|
|
16
5
|
onClose?: () => void;
|
|
17
6
|
onSelect: (conversation: IChatConversationLocal) => void;
|
|
18
7
|
};
|
|
19
|
-
export
|
|
20
|
-
export declare const GenAIChatConversations: FC<GenAIChatConversationsExternalProps>;
|
|
8
|
+
export declare function GenAIChatConversations({ onClose, onSelect, wrapper }: GenAIChatConversationsProps): import("react/jsx-runtime").JSX.Element;
|
|
21
9
|
export {};
|
|
22
10
|
//# sourceMappingURL=GenAIChatConversations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatConversations.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"GenAIChatConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatConversations.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,YAAY,EASpB,MAAM,OAAO,CAAC;AAkBf,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAuB1D,KAAK,2BAA2B,GAAG;IAC/B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC5D,CAAC;AAIF,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,2BAA2B,2CA6VjG"}
|
|
@@ -3,7 +3,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { cloneElement, useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
7
|
import { DefaultUiMenuInteractiveItemWrapper, Dropdown, UiDrawer, UiIcon, UiIconButton, UiMenu, UiSkeleton, } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { catalogItemsSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
9
9
|
import { conversationSelector, conversationsLoadedSelector, conversationsSelector, } from "../store/messages/messagesSelectors.js";
|
|
@@ -16,9 +16,10 @@ import { ConversationRenameDialog } from "./ConversationRenameDialog.js";
|
|
|
16
16
|
import { useFullscreenCheck } from "./hooks/useFullscreenCheck.js";
|
|
17
17
|
import { useHistoryCheck } from "./hooks/useHistoryCheck.js";
|
|
18
18
|
import { ConversationDateGroup, groupConversationsByDate } from "./utils/conversationGrouper.js";
|
|
19
|
-
function
|
|
19
|
+
export function GenAIChatConversations({ onClose, onSelect, wrapper }) {
|
|
20
20
|
const menuRef = useRef(undefined);
|
|
21
21
|
const intl = useIntl();
|
|
22
|
+
const dispatch = useDispatch();
|
|
22
23
|
const { isFullscreen, isSmallScreen } = useFullscreenCheck();
|
|
23
24
|
const { isHistory } = useHistoryCheck();
|
|
24
25
|
const [conversationToDelete, setConversationToDelete] = useState();
|
|
@@ -28,6 +29,8 @@ function GenAIChatConversationsComponent({ onClose, onSelect, wrapper, deleteCon
|
|
|
28
29
|
const [activeDropZone, setActiveDropZone] = useState();
|
|
29
30
|
const catalogItems = useSelector(catalogItemsSelector);
|
|
30
31
|
const conversationLoaded = useSelector(conversationsLoadedSelector);
|
|
32
|
+
const currentConversation = useSelector((state) => conversationSelector(state));
|
|
33
|
+
const conversations = useSelector((state) => conversationsSelector(state));
|
|
31
34
|
const groupedConversations = useMemo(() => groupConversationsByDate(conversations), [conversations]);
|
|
32
35
|
const menuItems = useMemo(() => groupedConversations.map((group) => ({
|
|
33
36
|
type: "group",
|
|
@@ -115,10 +118,10 @@ function GenAIChatConversationsComponent({ onClose, onSelect, wrapper, deleteCon
|
|
|
115
118
|
setConversationToRename(conversation);
|
|
116
119
|
}
|
|
117
120
|
else {
|
|
118
|
-
|
|
121
|
+
dispatch(pinConversationAction({
|
|
119
122
|
conversation: selectedConversation,
|
|
120
123
|
pinned: !selectedConversation.pinned,
|
|
121
|
-
});
|
|
124
|
+
}));
|
|
122
125
|
}
|
|
123
126
|
event.preventDefault();
|
|
124
127
|
event.stopPropagation();
|
|
@@ -131,7 +134,7 @@ function GenAIChatConversationsComponent({ onClose, onSelect, wrapper, deleteCon
|
|
|
131
134
|
catalogItems,
|
|
132
135
|
openedId,
|
|
133
136
|
currentConversation,
|
|
134
|
-
|
|
137
|
+
dispatch,
|
|
135
138
|
setConversationToRename,
|
|
136
139
|
]);
|
|
137
140
|
const draggedConversation = useMemo(() => conversations?.find((conversation) => conversation.localId === draggedConversationId), [conversations, draggedConversationId]);
|
|
@@ -149,21 +152,21 @@ function GenAIChatConversationsComponent({ onClose, onSelect, wrapper, deleteCon
|
|
|
149
152
|
}, [onSelect, onClose]);
|
|
150
153
|
const handleDeleteSubmit = useCallback(() => {
|
|
151
154
|
if (conversationToDelete) {
|
|
152
|
-
|
|
155
|
+
dispatch(deleteConversationAction({ conversation: conversationToDelete }));
|
|
153
156
|
}
|
|
154
157
|
setConversationToDelete(undefined);
|
|
155
158
|
menuRef.current?.focus();
|
|
156
|
-
}, [conversationToDelete,
|
|
159
|
+
}, [conversationToDelete, dispatch]);
|
|
157
160
|
const handleRenameSubmit = useCallback((title) => {
|
|
158
161
|
if (conversationToRename) {
|
|
159
|
-
|
|
162
|
+
dispatch(renameConversationAction({
|
|
160
163
|
conversation: conversationToRename,
|
|
161
164
|
title,
|
|
162
|
-
});
|
|
165
|
+
}));
|
|
163
166
|
}
|
|
164
167
|
setConversationToRename(undefined);
|
|
165
168
|
menuRef.current?.focus();
|
|
166
|
-
}, [conversationToRename,
|
|
169
|
+
}, [conversationToRename, dispatch]);
|
|
167
170
|
const handleDragStart = useCallback((conversationId, event) => {
|
|
168
171
|
event.dataTransfer.effectAllowed = "move";
|
|
169
172
|
event.dataTransfer.setData("text/plain", conversationId);
|
|
@@ -200,14 +203,14 @@ function GenAIChatConversationsComponent({ onClose, onSelect, wrapper, deleteCon
|
|
|
200
203
|
}
|
|
201
204
|
const shouldBePinned = dropZone === "pin";
|
|
202
205
|
if (draggedConversation.pinned !== shouldBePinned) {
|
|
203
|
-
|
|
206
|
+
dispatch(pinConversationAction({
|
|
204
207
|
conversation: draggedConversation,
|
|
205
208
|
pinned: shouldBePinned,
|
|
206
|
-
});
|
|
209
|
+
}));
|
|
207
210
|
}
|
|
208
211
|
setDraggedConversationId(undefined);
|
|
209
212
|
setActiveDropZone(undefined);
|
|
210
|
-
}, [draggedConversation,
|
|
213
|
+
}, [draggedConversation, dispatch]);
|
|
211
214
|
const handleMenuUnhandledKeyDown = useCallback((event, { focusedItem }) => {
|
|
212
215
|
if (event.key === "Delete" && focusedItem?.type === "interactive") {
|
|
213
216
|
event.preventDefault();
|
|
@@ -337,16 +340,6 @@ function toggleInConversationItems(menuRef, item, event) {
|
|
|
337
340
|
}
|
|
338
341
|
menuRef.current = target;
|
|
339
342
|
}
|
|
340
|
-
const mapStateToProps = (state) => ({
|
|
341
|
-
conversation: conversationSelector(state),
|
|
342
|
-
conversations: conversationsSelector(state),
|
|
343
|
-
});
|
|
344
|
-
const mapDispatchToProps = {
|
|
345
|
-
deleteConversation: deleteConversationAction,
|
|
346
|
-
pinConversation: pinConversationAction,
|
|
347
|
-
renameConversation: renameConversationAction,
|
|
348
|
-
};
|
|
349
|
-
export const GenAIChatConversations = connect(mapStateToProps, mapDispatchToProps)(GenAIChatConversationsComponent);
|
|
350
343
|
function getConversationGroupLabel(group, intl) {
|
|
351
344
|
switch (group) {
|
|
352
345
|
case ConversationDateGroup.PINNED:
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type IKdaDefinition } from "@gooddata/sdk-ui-dashboard";
|
|
3
|
-
import { setHistoryAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
4
|
-
import { setCurrentConversationAction } from "../store/messages/messagesSlice.js";
|
|
5
|
-
export type GenAIChatOverlayDispatchProps = {
|
|
6
|
-
setHistory: typeof setHistoryAction;
|
|
7
|
-
loadConversation: typeof setCurrentConversationAction;
|
|
8
|
-
};
|
|
9
|
-
export type GenAIChatOverlayStateProps = {
|
|
10
|
-
keyDriverAnalysis?: IKdaDefinition;
|
|
11
|
-
keyDriverAnalysisMinimized?: boolean;
|
|
12
|
-
};
|
|
1
|
+
import { type RefObject } from "react";
|
|
13
2
|
export type GenAIChatOverlayExternalProps = {
|
|
14
3
|
returnFocusTo?: RefObject<HTMLElement | null> | string;
|
|
15
4
|
className?: string;
|
|
@@ -23,6 +12,5 @@ export type GenAIChatOverlayExternalProps = {
|
|
|
23
12
|
closeOnEscape?: boolean;
|
|
24
13
|
onClose: () => void;
|
|
25
14
|
};
|
|
26
|
-
export
|
|
27
|
-
export declare const GenAIChatOverlay: FC<GenAIChatOverlayExternalProps>;
|
|
15
|
+
export declare function GenAIChatOverlay({ onClose, returnFocusTo, dialogPosition, className, closeOnEscape: closeOnEscapeProp }: GenAIChatOverlayExternalProps): import("react/jsx-runtime").JSX.Element;
|
|
28
16
|
//# sourceMappingURL=GenAIChatOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatOverlay.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"GenAIChatOverlay.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAmC,MAAM,OAAO,CAAC;AAuBxE,MAAM,MAAM,6BAA6B,GAAG;IACxC,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC7B,OAAO,EACP,aAAa,EACb,cAAc,EACd,SAAS,EACT,aAAa,EAAE,iBAAwB,EAC1C,EAAE,6BAA6B,2CAgF/B"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback, useEffect, useMemo } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
7
|
import { Dialog } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { keyDriverAnalysisMinimizedSelector, keyDriverAnalysisSelector, } from "../store/chatWindow/chatWindowSelectors.js";
|
|
9
9
|
import { setHistoryAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
@@ -13,21 +13,24 @@ import { GenAIChatConversations } from "./GenAIChatConversations.js";
|
|
|
13
13
|
import { GenAIChatHeader } from "./GenAIChatHeader.js";
|
|
14
14
|
import { GenAIChatWrapper } from "./GenAIChatWrapper.js";
|
|
15
15
|
import { useFullscreenCheck } from "./hooks/useFullscreenCheck.js";
|
|
16
|
-
function
|
|
16
|
+
export function GenAIChatOverlay({ onClose, returnFocusTo, dialogPosition, className, closeOnEscape: closeOnEscapeProp = true, }) {
|
|
17
17
|
const intl = useIntl();
|
|
18
18
|
const { isFullscreen } = useFullscreenCheck();
|
|
19
|
+
const dispatch = useDispatch();
|
|
20
|
+
const keyDriverAnalysis = useSelector((state) => keyDriverAnalysisSelector(state));
|
|
21
|
+
const keyDriverAnalysisMinimized = useSelector((state) => keyDriverAnalysisMinimizedSelector(state));
|
|
19
22
|
const classNames = cx("gd-gen-ai-chat__window", className, {
|
|
20
23
|
"gd-gen-ai-chat__window--fullscreen": isFullscreen,
|
|
21
24
|
"gd-gen-ai-chat__window--left": !isFullscreen && dialogPosition === "left",
|
|
22
25
|
"gd-gen-ai-chat__window--right": !isFullscreen && dialogPosition !== "left",
|
|
23
26
|
});
|
|
24
27
|
const onHistoryClose = useCallback(() => {
|
|
25
|
-
|
|
26
|
-
}, [
|
|
28
|
+
dispatch(setHistoryAction({ isHistory: false }));
|
|
29
|
+
}, [dispatch]);
|
|
27
30
|
const onSelectConversation = useCallback((conversation) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
+
dispatch(setCurrentConversationAction({ conversation }));
|
|
32
|
+
dispatch(setHistoryAction({ isHistory: false }));
|
|
33
|
+
}, [dispatch]);
|
|
31
34
|
const position = useMemo(() => {
|
|
32
35
|
if (isFullscreen) {
|
|
33
36
|
return "cc cc";
|
|
@@ -62,14 +65,3 @@ function GenAIChatOverlayComponent({ onClose, returnFocusTo, setHistory, loadCon
|
|
|
62
65
|
_jsx(GenAIChatHeader, { onClose: onClose }), _jsx(GenAIChatConversations, { onClose: onHistoryClose, onSelect: onSelectConversation }), _jsx(GenAIChatWrapper, { autofocus: true })
|
|
63
66
|
] }));
|
|
64
67
|
}
|
|
65
|
-
const mapDispatchToProps = {
|
|
66
|
-
setHistory: setHistoryAction,
|
|
67
|
-
loadConversation: setCurrentConversationAction,
|
|
68
|
-
};
|
|
69
|
-
const mapStateToProps = (state) => {
|
|
70
|
-
return {
|
|
71
|
-
keyDriverAnalysis: keyDriverAnalysisSelector(state),
|
|
72
|
-
keyDriverAnalysisMinimized: keyDriverAnalysisMinimizedSelector(state),
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
export const GenAIChatOverlay = connect(mapStateToProps, mapDispatchToProps)(GenAIChatOverlayComponent);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type FC } from "react";
|
|
2
1
|
import { type IGenAIContextObject } from "../types.js";
|
|
3
2
|
type GenAiChatContextChooserOwnProps = {
|
|
4
3
|
onAddContext?: (context: IGenAIContextObject) => void;
|
|
5
4
|
};
|
|
6
|
-
export declare
|
|
5
|
+
export declare function GenAiChatContextChooser({ onAddContext }: GenAiChatContextChooserOwnProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=GenAiChatContextChooser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenAiChatContextChooser.d.ts","sourceRoot":"","sources":["../../src/components/GenAiChatContextChooser.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,KAAK,+BAA+B,GAAG;IACnC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD,CAAC;AAQF,wBAAgB,uBAAuB,CAAC,EAAE,YAAY,EAAE,EAAE,+BAA+B,kDAuDxF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
2
3
|
import { defineMessages, useIntl } from "react-intl";
|
|
3
|
-
import {
|
|
4
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
4
5
|
import { Dropdown, UiIconButton, UiMenu, UiSubmenuHeader } from "@gooddata/sdk-ui-kit";
|
|
5
6
|
import { ambientContextSelector, userContextSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
6
7
|
import { addContextReferenceAction } from "../store/chatWindow/chatWindowSlice.js";
|
|
@@ -10,8 +11,11 @@ const msgs = defineMessages({
|
|
|
10
11
|
id: "gd.gen-ai.context.add_context",
|
|
11
12
|
},
|
|
12
13
|
});
|
|
13
|
-
function
|
|
14
|
+
export function GenAiChatContextChooser({ onAddContext }) {
|
|
14
15
|
const intl = useIntl();
|
|
16
|
+
const dispatch = useDispatch();
|
|
17
|
+
const ambient = useSelector((state) => ambientContextSelector(state));
|
|
18
|
+
const active = useSelector((state) => userContextSelector(state));
|
|
15
19
|
const items = useContextItems(ambient, active);
|
|
16
20
|
if (!ambient) {
|
|
17
21
|
return null;
|
|
@@ -20,23 +24,11 @@ function GenAiChatContextChooserCore({ active, ambient, addContextReference, onA
|
|
|
20
24
|
...accessibilityConfig,
|
|
21
25
|
ariaLabel: intl.formatMessage(msgs.add),
|
|
22
26
|
}, onClick: toggleDropdown, isDisabled: !items.length })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(UiMenu, { dataTestId: "agent_dropdown_menu", items: items, size: "medium", minWidth: 245, maxWidth: 245, containerTopPadding: "none", containerBottomPadding: "none", MenuHeader: ContextMenuHeader, ariaAttributes: ariaAttributes, onSelect: (item) => {
|
|
23
|
-
|
|
27
|
+
dispatch(addContextReferenceAction({ object: item.data }));
|
|
24
28
|
onAddContext?.(item.data);
|
|
25
29
|
closeDropdown();
|
|
26
30
|
} })) }) }));
|
|
27
31
|
}
|
|
28
|
-
const mapStateToProps = (state) => {
|
|
29
|
-
const ambient = ambientContextSelector(state);
|
|
30
|
-
const active = userContextSelector(state);
|
|
31
|
-
return {
|
|
32
|
-
active,
|
|
33
|
-
ambient,
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
const mapDispatchToProps = {
|
|
37
|
-
addContextReference: addContextReferenceAction,
|
|
38
|
-
};
|
|
39
|
-
export const GenAiChatContextChooser = connect(mapStateToProps, mapDispatchToProps)(GenAiChatContextChooserCore);
|
|
40
32
|
function ContextMenuHeader() {
|
|
41
33
|
const intl = useIntl();
|
|
42
34
|
return _jsx(UiSubmenuHeader, { title: intl.formatMessage(msgs.add), height: "medium" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAiConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAiConversations.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenAiConversations.d.ts","sourceRoot":"","sources":["../../src/components/GenAiConversations.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAa1D,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnE;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACtE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACtE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAiDhE"}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import noop from "lodash-es/noop.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
7
|
import { BackendProvider, WorkspaceProvider, useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
8
8
|
import { IntlWrapper } from "../localization/IntlWrapper.js";
|
|
9
9
|
import { PermissionsProvider } from "../permissions/PermissionsContext.js";
|
|
@@ -25,26 +25,26 @@ export function GenAIConversations(props) {
|
|
|
25
25
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
26
26
|
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { providedStore: providedStore, backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, eventHandlers: eventHandlers, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, catalogItems: catalogItems, isPreview: isPreview, excludeTags: excludeTags, includeTags: includeTags, colorPalette: colorPalette, objectTypes: objectTypes, children: _jsx(BackendProvider, { backend: effectiveBackend, children: _jsx(WorkspaceProvider, { workspace: effectiveWorkspace, children: _jsx(PermissionsProvider, { children: _jsx(GenAIConversationsContent, { ...props }) }) }) }) }) }));
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
const mapStateToProps = (state) => ({
|
|
34
|
-
settings: settingsSelector(state),
|
|
35
|
-
});
|
|
36
|
-
const GenAIConversationsContent = connect(mapStateToProps, mapDispatchToProps)(function GenAIConversationsContent(props) {
|
|
37
|
-
const { catalogItems, className, onConversationSelect = noop, loadThread, cancelLoading, loadConversation, settings, } = props;
|
|
28
|
+
function GenAIConversationsContent(props) {
|
|
29
|
+
const { catalogItems, className, onConversationSelect = noop } = props;
|
|
30
|
+
const dispatch = useDispatch();
|
|
31
|
+
const settings = useSelector(settingsSelector);
|
|
38
32
|
const { loading } = usePermissions();
|
|
39
33
|
const classNames = cx("gd-gen-ai-chat__embed__conversations", className);
|
|
34
|
+
const loadThread = useCallback(() => {
|
|
35
|
+
dispatch(loadThreadAction());
|
|
36
|
+
}, [dispatch]);
|
|
37
|
+
const cancelLoading = useCallback(() => {
|
|
38
|
+
dispatch(cancelAsyncAction());
|
|
39
|
+
}, [dispatch]);
|
|
40
40
|
useThreadLoading({
|
|
41
41
|
initializing: loading || !settings,
|
|
42
42
|
loadThread,
|
|
43
43
|
cancelLoading,
|
|
44
44
|
});
|
|
45
45
|
const onSelectConversation = useCallback((conversation) => {
|
|
46
|
-
|
|
46
|
+
dispatch(setCurrentConversationAction({ conversation }));
|
|
47
47
|
onConversationSelect(conversation);
|
|
48
|
-
}, [
|
|
48
|
+
}, [dispatch, onConversationSelect]);
|
|
49
49
|
return (_jsx(ConfigProvider, { catalogItems: catalogItems, allowNativeLinks: false, canFullControl: false, canManage: false, canAnalyze: false, children: _jsx(CustomizationProvider, { children: _jsx(GenAIChatConversations, { wrapper: _jsx("div", { className: classNames }), onSelect: onSelectConversation }) }) }));
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAsD,MAAM,OAAO,CAAC;AAqCpG,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAsD,MAAM,OAAO,CAAC;AAqCpG,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACzC,CAAC;AAuKF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,aAAa,CAAkB,CAAC"}
|
package/esm/components/Input.js
CHANGED
|
@@ -3,12 +3,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { FormattedMessage, defineMessages, useIntl } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
7
|
import { SyntaxHighlightingInput } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { makeTextContents, makeUserItem, makeUserMessage, } from "../model.js";
|
|
9
9
|
import { agentSwitchingEnabledSelector } from "../store/chatWindow/chatWindowSelectors.js";
|
|
10
10
|
import { asyncProcessSelector, conversationMessagesSelector, conversationSelector, conversationsLoadedSelector, messagesSelector, } from "../store/messages/messagesSelectors.js";
|
|
11
|
-
import { newMessageAction
|
|
11
|
+
import { newMessageAction } from "../store/messages/messagesSlice.js";
|
|
12
12
|
import { collectReferences } from "./completion/references.js";
|
|
13
13
|
import { useCompletion } from "./completion/useCompletion.js";
|
|
14
14
|
import { GenAiChatAgentSwitching } from "./GenAiChatAgentSwitching.js";
|
|
@@ -31,9 +31,18 @@ const msgs = defineMessages({
|
|
|
31
31
|
});
|
|
32
32
|
const isMac = typeof navigator !== "undefined" &&
|
|
33
33
|
(navigator.platform.toUpperCase().indexOf("MAC") >= 0 || navigator.userAgent.includes("Macintosh"));
|
|
34
|
-
function InputComponent({
|
|
34
|
+
function InputComponent({ autofocus = false, canManage, canAnalyze, targetRef }) {
|
|
35
35
|
const intl = useIntl();
|
|
36
|
+
const dispatch = useDispatch();
|
|
36
37
|
const { isBigScreen, isSmallScreen, isFullscreen } = useFullscreenCheck();
|
|
38
|
+
const conversation = useSelector((state) => conversationSelector(state));
|
|
39
|
+
const conversationsLoaded = useSelector((state) => conversationsLoadedSelector(state));
|
|
40
|
+
const items = useSelector((state) => conversationMessagesSelector(state));
|
|
41
|
+
const messages = useSelector((state) => messagesSelector(state));
|
|
42
|
+
const loading = useSelector((state) => asyncProcessSelector(state));
|
|
43
|
+
const agentSwitchingEnabled = useSelector((state) => agentSwitchingEnabledSelector(state));
|
|
44
|
+
const isBusy = !!loading;
|
|
45
|
+
const isEvaluating = loading === "evaluating";
|
|
37
46
|
const isLoading = loading === "loading" || loading === "clearing";
|
|
38
47
|
const isAssistantLoading = isLoading || loading === "restoring";
|
|
39
48
|
const isEmpty = conversation ? !items?.length && !isLoading : !messages?.length && !isLoading;
|
|
@@ -62,7 +71,7 @@ function InputComponent({ isBusy, isEvaluating, newMessage, autofocus = false, c
|
|
|
62
71
|
makeTextContents(escapeMarkdown(value), collectReferences(value, used.current)),
|
|
63
72
|
]);
|
|
64
73
|
}
|
|
65
|
-
|
|
74
|
+
dispatch(newMessageAction(item));
|
|
66
75
|
setValue("");
|
|
67
76
|
};
|
|
68
77
|
const handleKeyDown = (e) => {
|
|
@@ -116,6 +125,7 @@ function InputComponent({ isBusy, isEvaluating, newMessage, autofocus = false, c
|
|
|
116
125
|
] }), _jsx(HintText, { focused: focused, where: "bottom" })
|
|
117
126
|
] }) }));
|
|
118
127
|
}
|
|
128
|
+
export const Input = InputComponent;
|
|
119
129
|
function HintText({ where, focused }) {
|
|
120
130
|
return (_jsx("div", { "aria-hidden": !focused, className: cx("gd-gen-ai-chat__input__info", {
|
|
121
131
|
hidden: !focused,
|
|
@@ -127,21 +137,3 @@ function HintText({ where, focused }) {
|
|
|
127
137
|
code: (chunks) => _jsx("code", { children: chunks }),
|
|
128
138
|
} })) }));
|
|
129
139
|
}
|
|
130
|
-
const mapStateToProps = (state) => {
|
|
131
|
-
const asyncState = asyncProcessSelector(state);
|
|
132
|
-
return {
|
|
133
|
-
conversation: conversationSelector(state),
|
|
134
|
-
conversationsLoaded: conversationsLoadedSelector(state),
|
|
135
|
-
items: conversationMessagesSelector(state),
|
|
136
|
-
messages: messagesSelector(state),
|
|
137
|
-
loading: asyncState,
|
|
138
|
-
agentSwitchingEnabled: agentSwitchingEnabledSelector(state),
|
|
139
|
-
isBusy: !!asyncState,
|
|
140
|
-
isEvaluating: asyncState === "evaluating",
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
const mapDispatchToProps = {
|
|
144
|
-
newMessage: newMessageAction,
|
|
145
|
-
setSelectedAgent: setSelectedAgentAction,
|
|
146
|
-
};
|
|
147
|
-
export const Input = connect(mapStateToProps, mapDispatchToProps)(InputComponent);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type cancelAsyncAction, type loadThreadAction } from "../../store/messages/messagesSlice.js";
|
|
2
1
|
type ThreadLoadingProps = {
|
|
3
2
|
initializing?: boolean;
|
|
4
|
-
loadThread:
|
|
5
|
-
cancelLoading:
|
|
3
|
+
loadThread: () => void;
|
|
4
|
+
cancelLoading: () => void;
|
|
6
5
|
};
|
|
7
6
|
export declare function useThreadLoading({ initializing, cancelLoading, loadThread }: ThreadLoadingProps): void;
|
|
8
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThreadLoading.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useThreadLoading.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useThreadLoading.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useThreadLoading.ts"],"names":[],"mappings":"AASA,KAAK,kBAAkB,GAAG;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,kBAAkB,QAe/F"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { type AssistantMessage } from "../../model.js";
|
|
2
|
+
type AssistantMessageProps = {
|
|
3
|
+
message: AssistantMessage;
|
|
4
|
+
isLast?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function AssistantMessageComponent({ message, isLast }: AssistantMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
2
8
|
//# sourceMappingURL=AssistantMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssistantMessage.d.ts","sourceRoot":"","sources":["../../../src/components/messages/AssistantMessage.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQvD,KAAK,qBAAqB,GAAG;IACzB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,qBAAqB,2CA+FnF"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
|
+
import { useCallback } from "react";
|
|
3
4
|
import cx from "classnames";
|
|
4
5
|
import { useIntl } from "react-intl";
|
|
5
|
-
import {
|
|
6
|
+
import { useDispatch } from "react-redux";
|
|
6
7
|
import { UiIconButton, UiTooltip } from "@gooddata/sdk-ui-kit";
|
|
7
8
|
import { setUserFeedback } from "../../store/messages/messagesSlice.js";
|
|
8
9
|
import { FeedbackPopup } from "./FeedbackPopup.js";
|
|
9
10
|
import { MessageContents } from "./MessageContents.js";
|
|
10
11
|
import { getAssistantMessageState } from "./messageState.js";
|
|
11
12
|
import { useUserFeedback } from "./useUserFeedback.js";
|
|
12
|
-
function
|
|
13
|
+
export function AssistantMessageComponent({ message, isLast }) {
|
|
13
14
|
const intl = useIntl();
|
|
14
|
-
const
|
|
15
|
+
const dispatch = useDispatch();
|
|
16
|
+
const setUserFeedbackAction = useCallback((payload) => {
|
|
17
|
+
dispatch(setUserFeedback(payload));
|
|
18
|
+
}, [dispatch]);
|
|
19
|
+
const { handlePositiveFeedbackClick, handleNegativeFeedbackClick, handleFeedbackSubmit } = useUserFeedback({ message, setUserFeedback: setUserFeedbackAction });
|
|
15
20
|
const messageState = getAssistantMessageState(message);
|
|
16
21
|
const thumbsUpLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.like" });
|
|
17
22
|
const thumbsDownLabel = intl.formatMessage({ id: "gd.gen-ai.feedback.dislike" });
|
|
@@ -32,7 +37,3 @@ function AssistantMessageComponentCore({ message, setUserFeedback, isLast }) {
|
|
|
32
37
|
}, onSubmit: handleFeedbackSubmit })] })) : null] })
|
|
33
38
|
] }));
|
|
34
39
|
}
|
|
35
|
-
const mapDispatchToProps = {
|
|
36
|
-
setUserFeedback,
|
|
37
|
-
};
|
|
38
|
-
export const AssistantMessageComponent = connect(null, mapDispatchToProps)(AssistantMessageComponentCore);
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { type IChatKdaDefinition } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { setKeyDriverAnalysisAction } from "../../../store/chatWindow/chatWindowSlice.js";
|
|
3
2
|
export type ConversationKdaContentProps = {
|
|
4
3
|
kda: IChatKdaDefinition;
|
|
5
4
|
className?: string;
|
|
6
|
-
locale?: string;
|
|
7
|
-
format?: string;
|
|
8
|
-
setKeyDriverAnalysis?: typeof setKeyDriverAnalysisAction;
|
|
9
5
|
};
|
|
10
|
-
export declare function
|
|
11
|
-
export declare const ConversationKdaContent: import("react-redux").ConnectedComponent<typeof ConversationKdaContentCore, {
|
|
12
|
-
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
13
|
-
store?: import("redux").Store<any, import("redux").UnknownAction, unknown> | undefined;
|
|
14
|
-
kda: IChatKdaDefinition;
|
|
15
|
-
className?: string | undefined;
|
|
16
|
-
}>;
|
|
6
|
+
export declare function ConversationKdaContent({ className, kda }: ConversationKdaContentProps): import("react/jsx-runtime").JSX.Element;
|
|
17
7
|
//# sourceMappingURL=ConversationKdaContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationKdaContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationKdaContent.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationKdaContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationKdaContent.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAYpE,MAAM,MAAM,2BAA2B,GAAG;IACtC,GAAG,EAAE,kBAAkB,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,2BAA2B,2CA0CrF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
|
-
import { useMemo } from "react";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
|
-
import {
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
7
|
import { UiButton } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { catalogItemsSelector, settingsSelector } from "../../../store/chatWindow/chatWindowSelectors.js";
|
|
9
9
|
import { setKeyDriverAnalysisAction } from "../../../store/chatWindow/chatWindowSlice.js";
|
|
@@ -11,10 +11,13 @@ import { storeKdaReturnFocusFromActiveElement } from "../../../utils/kdaReturnFo
|
|
|
11
11
|
import { collectReferences } from "../../completion/references.js";
|
|
12
12
|
import { MarkdownComponent } from "../contents/Markdown.js";
|
|
13
13
|
import { useKdaDefinition, useKdaInfo } from "./useKdaDefinition.js";
|
|
14
|
-
export function
|
|
14
|
+
export function ConversationKdaContent({ className, kda }) {
|
|
15
15
|
const intl = useIntl();
|
|
16
|
+
const dispatch = useDispatch();
|
|
16
17
|
const classNames = cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--kda", className);
|
|
17
18
|
const catalogItems = useSelector(catalogItemsSelector);
|
|
19
|
+
const locale = useSelector((state) => settingsSelector(state)?.locale);
|
|
20
|
+
const format = useSelector((state) => settingsSelector(state)?.responsiveUiDateFormat);
|
|
18
21
|
const splitter = intl.formatMessage({ id: "gd.gen-ai.changeAnalysis.splitter" });
|
|
19
22
|
const definition = useKdaDefinition(kda, format, locale);
|
|
20
23
|
const { range, title } = useKdaInfo(catalogItems, definition, splitter);
|
|
@@ -22,21 +25,11 @@ export function ConversationKdaContentCore({ className, kda, format, locale, set
|
|
|
22
25
|
const references = useMemo(() => {
|
|
23
26
|
return collectReferences(text, catalogItems);
|
|
24
27
|
}, [text, catalogItems]);
|
|
28
|
+
const handleExplainTheChange = useCallback(() => {
|
|
29
|
+
storeKdaReturnFocusFromActiveElement();
|
|
30
|
+
dispatch(setKeyDriverAnalysisAction({ keyDriverAnalysis: definition }));
|
|
31
|
+
}, [dispatch, definition]);
|
|
25
32
|
return (_jsxs("div", { className: classNames, children: [
|
|
26
|
-
_jsx(MarkdownComponent, { allowMarkdown: true, references: references, children: intl.formatMessage({ id: "gd.gen-ai.kda.default_message" }, { range, title }) }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content--kda__button", children: _jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.changeAnalysis.explain_the_change" }), variant: "secondary", iconBefore: "explainai", onClick:
|
|
27
|
-
storeKdaReturnFocusFromActiveElement();
|
|
28
|
-
setKeyDriverAnalysis?.({ keyDriverAnalysis: definition });
|
|
29
|
-
} }) })
|
|
33
|
+
_jsx(MarkdownComponent, { allowMarkdown: true, references: references, children: intl.formatMessage({ id: "gd.gen-ai.kda.default_message" }, { range, title }) }), _jsx("div", { className: "gd-gen-ai-chat__conversation__item__content--kda__button", children: _jsx(UiButton, { label: intl.formatMessage({ id: "gd.gen-ai.changeAnalysis.explain_the_change" }), variant: "secondary", iconBefore: "explainai", onClick: handleExplainTheChange }) })
|
|
30
34
|
] }));
|
|
31
35
|
}
|
|
32
|
-
const mapDispatchToProps = {
|
|
33
|
-
setKeyDriverAnalysis: setKeyDriverAnalysisAction,
|
|
34
|
-
};
|
|
35
|
-
const mapStateToProps = (state) => {
|
|
36
|
-
const settings = settingsSelector(state);
|
|
37
|
-
return {
|
|
38
|
-
locale: settings?.locale,
|
|
39
|
-
format: settings?.responsiveUiDateFormat,
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export const ConversationKdaContent = connect(mapStateToProps, mapDispatchToProps)(ConversationKdaContentCore);
|
|
@@ -1,41 +1,12 @@
|
|
|
1
1
|
import { type IChatConversationVisualisationContent } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type IColorPalette } from "@gooddata/sdk-model";
|
|
3
2
|
import { type IChatConversationLocalItem, type IChatConversationMultipartLocalPart } from "../../../model.js";
|
|
4
|
-
import { setKeyDriverAnalysisAction } from "../../../store/chatWindow/chatWindowSlice.js";
|
|
5
3
|
import { type IWhatIfRenderableScenario } from "../../../whatIf/whatIfMapping.js";
|
|
6
4
|
export type ConversationVisualizationContentProps = {
|
|
7
5
|
message: IChatConversationLocalItem;
|
|
8
6
|
part: IChatConversationMultipartLocalPart;
|
|
9
7
|
scenario?: IWhatIfRenderableScenario;
|
|
10
8
|
visualization: NonNullable<IChatConversationVisualisationContent["visualization"]>;
|
|
11
|
-
colorPalette?: IColorPalette;
|
|
12
9
|
className?: string;
|
|
13
|
-
agGridToken?: string;
|
|
14
|
-
onCopyToClipboard?: (data: {
|
|
15
|
-
content: string;
|
|
16
|
-
}) => void;
|
|
17
|
-
setKeyDriverAnalysis?: typeof setKeyDriverAnalysisAction;
|
|
18
|
-
enableChangeAnalysis?: boolean;
|
|
19
|
-
enableNewPivotTable?: boolean;
|
|
20
|
-
enableAccessibleChartTooltip?: boolean;
|
|
21
10
|
};
|
|
22
|
-
declare function
|
|
23
|
-
export declare const ConversationVisualizationContent: import("react-redux").ConnectedComponent<typeof ConversationVisualizationContentCore, {
|
|
24
|
-
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
25
|
-
store?: import("redux").Store<any, import("redux").UnknownAction, unknown> | undefined;
|
|
26
|
-
message: IChatConversationLocalItem;
|
|
27
|
-
part: IChatConversationMultipartLocalPart;
|
|
28
|
-
scenario?: IWhatIfRenderableScenario | undefined;
|
|
29
|
-
visualization: import("@gooddata/sdk-model").IInsightDefinition & {
|
|
30
|
-
insight: import("@gooddata/sdk-model").IAuditableDates & import("@gooddata/sdk-model").IAuditableUsers & {
|
|
31
|
-
identifier: string;
|
|
32
|
-
uri: string;
|
|
33
|
-
ref: import("@gooddata/sdk-model").ObjRef;
|
|
34
|
-
isLocked?: boolean | undefined;
|
|
35
|
-
certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
className?: string | undefined;
|
|
39
|
-
}>;
|
|
40
|
-
export {};
|
|
11
|
+
export declare function ConversationVisualizationContent({ message, part, scenario, visualization, className }: ConversationVisualizationContentProps): import("react/jsx-runtime").JSX.Element;
|
|
41
12
|
//# sourceMappingURL=ConversationVisualizationContent.d.ts.map
|
package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAyBvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAY9G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAwBlF,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,EAC7C,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACZ,EAAE,qCAAqC,2CA8GvC"}
|
|
@@ -4,7 +4,7 @@ import { useCallback, useId, useMemo, useRef, useState, } from "react";
|
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import copy from "copy-to-clipboard";
|
|
6
6
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
7
|
-
import {
|
|
7
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
8
8
|
import { isClusteringNotReceived, isDataTooLargeToCompute, isDataTooLargeToDisplay, isForecastNotReceived, isNoDataSdkError, useWorkspaceStrict, } from "@gooddata/sdk-ui";
|
|
9
9
|
import { Dropdown, IconCopy, IconExternalLink, IconSave, Overlay, UiFocusManager, UiIconButton, UiMenu, UiTooltip, } from "@gooddata/sdk-ui-kit";
|
|
10
10
|
import { catalogItemsSelector, colorPaletteSelector, settingsSelector, } from "../../../store/chatWindow/chatWindowSelectors.js";
|
|
@@ -20,7 +20,12 @@ import { createKdaDefinitionFromDrill, getDashboardAttributeFilter } from "./use
|
|
|
20
20
|
import { useSaveCheck } from "./useSaveCheck.js";
|
|
21
21
|
const MORE_MENU_BUTTON_ID = "gd-gen-ai-chat__visualization__save__more-menu-button";
|
|
22
22
|
const overlayAlignPoints = [{ align: "br tr" }];
|
|
23
|
-
function
|
|
23
|
+
export function ConversationVisualizationContent({ message, part, scenario, visualization, className, }) {
|
|
24
|
+
const colorPalette = useSelector((state) => colorPaletteSelector(state));
|
|
25
|
+
const agGridToken = useSelector((state) => settingsSelector(state)?.agGridToken);
|
|
26
|
+
const enableNewPivotTable = useSelector((state) => settingsSelector(state)?.enableNewPivotTable);
|
|
27
|
+
const enableAccessibleChartTooltip = useSelector((state) => settingsSelector(state)?.enableAccessibleChartTooltip);
|
|
28
|
+
const enableChangeAnalysis = useSelector((state) => settingsSelector(state)?.enableChangeAnalysis);
|
|
24
29
|
const containerRef = useRef(null);
|
|
25
30
|
const [hasVisFatal, setVisFatal] = useState(false);
|
|
26
31
|
const [visError, setVisError] = useState(null);
|
|
@@ -33,7 +38,7 @@ function ConversationVisualizationContentCore({ message, part, scenario, visuali
|
|
|
33
38
|
visualization,
|
|
34
39
|
});
|
|
35
40
|
const { visualisationCheckLoading, visualisationSaved } = useSaveCheck(part, visualization, !scenario || scenario.isBaseline);
|
|
36
|
-
const { onCopy, onOpen, onSave } = useHandlers({ visualization, setSaveDialogOpen
|
|
41
|
+
const { onCopy, onOpen, onSave } = useHandlers({ visualization, setSaveDialogOpen });
|
|
37
42
|
const onVisualizationError = useCallback((error) => {
|
|
38
43
|
// Already have error
|
|
39
44
|
if (visError) {
|
|
@@ -50,7 +55,7 @@ function ConversationVisualizationContentCore({ message, part, scenario, visuali
|
|
|
50
55
|
}, [visError]);
|
|
51
56
|
const classNames = cx("gd-gen-ai-chat__conversation__item__content", "gd-gen-ai-chat__conversation__item__content--visualization", className);
|
|
52
57
|
return (_jsxs("div", { className: classNames, children: [
|
|
53
|
-
_jsx(DrillState, { drillState: drillState, setDrillState: setDrillState, containerRef: containerRef,
|
|
58
|
+
_jsx(DrillState, { drillState: drillState, setDrillState: setDrillState, containerRef: containerRef, filters: visualization.insight.filters, children: _jsxs(Wrapper, { containerRef: containerRef, visualization: visualization, children: [
|
|
54
59
|
_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, {})
|
|
55
60
|
] }) }), _jsx(VisualizationErrorReport, { error: visError })
|
|
56
61
|
] }));
|
|
@@ -209,8 +214,9 @@ function VisualizationErrorReport({ error }) {
|
|
|
209
214
|
error: error.message,
|
|
210
215
|
} }) })) : null] }));
|
|
211
216
|
}
|
|
212
|
-
function DrillState({ containerRef, filters,
|
|
217
|
+
function DrillState({ containerRef, filters, children, drillState, setDrillState }) {
|
|
213
218
|
const intl = useIntl();
|
|
219
|
+
const dispatch = useDispatch();
|
|
214
220
|
const catalogItems = useSelector(catalogItemsSelector);
|
|
215
221
|
return (_jsx(Dropdown, { enableAutoToggle: false, isOpen: Boolean(drillState), onToggle: (state) => {
|
|
216
222
|
if (!state) {
|
|
@@ -235,7 +241,7 @@ function DrillState({ containerRef, filters, setKeyDriverAnalysis, children, dri
|
|
|
235
241
|
const allFilters = mergeFilters(convertIntersectionToAttributeFilters(event.drillContext.intersection ?? []), (filters?.map(getDashboardAttributeFilter).filter(Boolean) ??
|
|
236
242
|
[]));
|
|
237
243
|
const definition = createKdaDefinitionFromDrill(catalogItems, intl.locale, data, event, allFilters);
|
|
238
|
-
|
|
244
|
+
dispatch(setKeyDriverAnalysisAction({ keyDriverAnalysis: definition }));
|
|
239
245
|
}, onClose: () => {
|
|
240
246
|
setDrillState(null);
|
|
241
247
|
} }));
|
|
@@ -271,8 +277,9 @@ function useSaveDialog({ message, part, visualization }) {
|
|
|
271
277
|
setSaveDialogOpen,
|
|
272
278
|
};
|
|
273
279
|
}
|
|
274
|
-
function useHandlers({ visualization, setSaveDialogOpen
|
|
280
|
+
function useHandlers({ visualization, setSaveDialogOpen }) {
|
|
275
281
|
const config = useConfig();
|
|
282
|
+
const dispatch = useDispatch();
|
|
276
283
|
const workspaceId = useWorkspaceStrict();
|
|
277
284
|
const useHostedAnalyticalDesigner = Boolean(useSelector(settingsSelector)?.enableShellApplication_analyticalDesigner);
|
|
278
285
|
const onSave = useCallback(() => {
|
|
@@ -328,28 +335,12 @@ function useHandlers({ visualization, setSaveDialogOpen, onCopyToClipboard }) {
|
|
|
328
335
|
}
|
|
329
336
|
if (link) {
|
|
330
337
|
copy(link);
|
|
331
|
-
|
|
338
|
+
dispatch(copyToClipboardAction({ content: link }));
|
|
332
339
|
}
|
|
333
|
-
}, [visualization, config, workspaceId, useHostedAnalyticalDesigner,
|
|
340
|
+
}, [visualization, config, workspaceId, useHostedAnalyticalDesigner, dispatch]);
|
|
334
341
|
return {
|
|
335
342
|
onSave,
|
|
336
343
|
onOpen,
|
|
337
344
|
onCopy,
|
|
338
345
|
};
|
|
339
346
|
}
|
|
340
|
-
//CORE
|
|
341
|
-
const mapDispatchToProps = {
|
|
342
|
-
onCopyToClipboard: copyToClipboardAction,
|
|
343
|
-
setKeyDriverAnalysis: setKeyDriverAnalysisAction,
|
|
344
|
-
};
|
|
345
|
-
const mapStateToProps = (state) => {
|
|
346
|
-
const settings = settingsSelector(state);
|
|
347
|
-
return {
|
|
348
|
-
colorPalette: colorPaletteSelector(state),
|
|
349
|
-
agGridToken: settings?.agGridToken,
|
|
350
|
-
enableNewPivotTable: settings?.enableNewPivotTable,
|
|
351
|
-
enableAccessibleChartTooltip: settings?.enableAccessibleChartTooltip,
|
|
352
|
-
enableChangeAnalysis: settings?.enableChangeAnalysis,
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
export const ConversationVisualizationContent = connect(mapStateToProps, mapDispatchToProps)(ConversationVisualizationContentCore);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type IChatConversationVisualisationContent } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import { type IChatConversationLocalItem, type IChatConversationMultipartLocalPart } from "../../../model.js";
|
|
3
|
-
import { saveVisualizationAction, savedVisualizationAction } from "../../../store/messages/messagesSlice.js";
|
|
4
3
|
export type SaveVisualizationDialogProps = {
|
|
5
4
|
message: IChatConversationLocalItem;
|
|
6
5
|
part: IChatConversationMultipartLocalPart;
|
|
@@ -8,27 +7,5 @@ export type SaveVisualizationDialogProps = {
|
|
|
8
7
|
type: "save" | "explore";
|
|
9
8
|
onClose: () => void;
|
|
10
9
|
};
|
|
11
|
-
export type
|
|
12
|
-
saveVisualizationAction: typeof saveVisualizationAction;
|
|
13
|
-
savedVisualizationAction: typeof savedVisualizationAction;
|
|
14
|
-
};
|
|
15
|
-
declare function SaveVisualizationDialogCore({ type, message, part, visualization, onClose, saveVisualizationAction, savedVisualizationAction }: SaveVisualizationDialogProps & SaveVisualizationDialogDispatchProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const SaveVisualizationDialog: import("react-redux").ConnectedComponent<typeof SaveVisualizationDialogCore, {
|
|
17
|
-
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction> | null> | undefined;
|
|
18
|
-
store?: import("redux").Store<any, import("redux").UnknownAction, unknown> | undefined;
|
|
19
|
-
message: IChatConversationLocalItem;
|
|
20
|
-
part: IChatConversationMultipartLocalPart;
|
|
21
|
-
visualization: import("@gooddata/sdk-model").IInsightDefinition & {
|
|
22
|
-
insight: import("@gooddata/sdk-model").IAuditableDates & import("@gooddata/sdk-model").IAuditableUsers & {
|
|
23
|
-
identifier: string;
|
|
24
|
-
uri: string;
|
|
25
|
-
ref: import("@gooddata/sdk-model").ObjRef;
|
|
26
|
-
isLocked?: boolean | undefined;
|
|
27
|
-
certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
type: "explore" | "save";
|
|
31
|
-
onClose: () => void;
|
|
32
|
-
}>;
|
|
33
|
-
export {};
|
|
10
|
+
export declare function SaveVisualizationDialog({ type, message, part, visualization, onClose }: SaveVisualizationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
34
11
|
//# sourceMappingURL=SaveVisualizationDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAG9G,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACpC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,OAAO,EACV,EAAE,4BAA4B,2CA0C9B"}
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
|
-
import {
|
|
5
|
+
import { useDispatch } from "react-redux";
|
|
6
6
|
import { ConfirmDialog, Input, Typography } from "@gooddata/sdk-ui-kit";
|
|
7
7
|
import { saveVisualizationAction, savedVisualizationAction } from "../../../store/messages/messagesSlice.js";
|
|
8
|
-
function
|
|
8
|
+
export function SaveVisualizationDialog({ type, message, part, visualization, onClose, }) {
|
|
9
9
|
const intl = useIntl();
|
|
10
10
|
const [value, setValue] = useState(visualization.insight.title);
|
|
11
|
-
const { onSubmit } = useVisualisationSaving(type, message, part, visualization,
|
|
11
|
+
const { onSubmit } = useVisualisationSaving(type, message, part, visualization, onClose);
|
|
12
12
|
return (_jsxs(ConfirmDialog, { onClose: onClose, onCancel: onClose, onSubmit: () => onSubmit(value), isPositive: true, autofocusOnOpen: false, submitOnEnterKey: true, headline: intl.formatMessage({ id: "gd.gen-ai.save-dialog.title" }), cancelButtonText: intl.formatMessage({ id: "gd.gen-ai.button.cancel" }), submitButtonText: type === "save"
|
|
13
13
|
? intl.formatMessage({ id: "gd.gen-ai.button.save" })
|
|
14
14
|
: intl.formatMessage({ id: "gd.gen-ai.button.save_and_explore" }), showProgressIndicator: part.saving?.started, isSubmitDisabled: part.saving?.started, isCancelDisabled: part.saving?.started, className: "gd-gen-ai-chat__visualization__save-dialog", children: [
|
|
@@ -18,47 +18,29 @@ function SaveVisualizationDialogCore({ type, message, part, visualization, onClo
|
|
|
18
18
|
] }));
|
|
19
19
|
}
|
|
20
20
|
//hooks
|
|
21
|
-
function useVisualisationSaving(type, message, part, visualization,
|
|
21
|
+
function useVisualisationSaving(type, message, part, visualization, onClose) {
|
|
22
|
+
const dispatch = useDispatch();
|
|
22
23
|
// Close the dialog automatically once the item is saved
|
|
23
24
|
const isStarted = part.saving?.started;
|
|
24
25
|
const isComplete = part.saving?.completed;
|
|
25
26
|
useEffect(() => {
|
|
26
27
|
if (isStarted && isComplete) {
|
|
27
28
|
onClose();
|
|
28
|
-
|
|
29
|
+
dispatch(savedVisualizationAction({
|
|
29
30
|
visualizationId: visualization.insight.identifier,
|
|
30
31
|
assistantMessageId: message.localId,
|
|
31
|
-
});
|
|
32
|
+
}));
|
|
32
33
|
}
|
|
33
|
-
}, [
|
|
34
|
-
isStarted,
|
|
35
|
-
isComplete,
|
|
36
|
-
onClose,
|
|
37
|
-
part,
|
|
38
|
-
savedVisualization,
|
|
39
|
-
visualization.insight.identifier,
|
|
40
|
-
message.localId,
|
|
41
|
-
]);
|
|
34
|
+
}, [isStarted, isComplete, onClose, part, dispatch, visualization.insight.identifier, message.localId]);
|
|
42
35
|
const onSubmit = useCallback(async (title) => {
|
|
43
|
-
|
|
36
|
+
dispatch(saveVisualizationAction({
|
|
44
37
|
visualizationId: visualization.insight.identifier,
|
|
45
38
|
visualizationTitle: title || visualization.insight.title,
|
|
46
39
|
assistantMessageId: message.localId,
|
|
47
40
|
explore: type === "explore",
|
|
48
|
-
});
|
|
49
|
-
}, [
|
|
50
|
-
type,
|
|
51
|
-
message.localId,
|
|
52
|
-
saveVisualization,
|
|
53
|
-
visualization.insight.identifier,
|
|
54
|
-
visualization.insight.title,
|
|
55
|
-
]);
|
|
41
|
+
}));
|
|
42
|
+
}, [type, message.localId, dispatch, visualization.insight.identifier, visualization.insight.title]);
|
|
56
43
|
return {
|
|
57
44
|
onSubmit,
|
|
58
45
|
};
|
|
59
46
|
}
|
|
60
|
-
const mapDispatchToProps = {
|
|
61
|
-
saveVisualizationAction,
|
|
62
|
-
savedVisualizationAction,
|
|
63
|
-
};
|
|
64
|
-
export const SaveVisualizationDialog = connect(null, mapDispatchToProps)(SaveVisualizationDialogCore);
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { type AssistantMessage, type IChatConversationLocalItem } from "../../model.js";
|
|
2
2
|
import { type setUserFeedback } from "../../store/messages/messagesSlice.js";
|
|
3
3
|
import { type IFeedbackData } from "./FeedbackPopup.js";
|
|
4
|
+
/**
|
|
5
|
+
* Dispatches the {@link setUserFeedback} action. Satisfied both by the action creator bound to the store
|
|
6
|
+
* dispatch and by a plain callback wrapping `dispatch(setUserFeedback(payload))`.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export type SetUserFeedbackHandler = (payload: Parameters<typeof setUserFeedback>[0]) => void;
|
|
4
11
|
/**
|
|
5
12
|
* @internal
|
|
6
13
|
*/
|
|
7
14
|
export interface IUseUserFeedbackProps {
|
|
8
15
|
message: AssistantMessage | IChatConversationLocalItem;
|
|
9
|
-
setUserFeedback:
|
|
16
|
+
setUserFeedback: SetUserFeedbackHandler;
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
12
19
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUserFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/useUserFeedback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,gBAAgB,GAAG,0BAA0B,CAAC;IACvD,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"useUserFeedback.d.ts","sourceRoot":"","sources":["../../../src/components/messages/useUserFeedback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,gBAAgB,GAAG,0BAA0B,CAAC;IACvD,eAAe,EAAE,sBAAsB,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,2BAA2B,EAAE,MAAM,IAAI,CAAC;IACxC,2BAA2B,EAAE,MAAM,IAAI,CAAC;IACxC,oBAAoB,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,IAAI,CAAC;CAC/D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,qBAAqB,GAAG,sBAAsB,CAyE3G"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-gen-ai",
|
|
3
|
-
"version": "11.52.0-alpha.
|
|
3
|
+
"version": "11.52.0-alpha.4",
|
|
4
4
|
"description": "GoodData GenAI SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"reselect": "5.1.1",
|
|
58
58
|
"tslib": "2.8.1",
|
|
59
59
|
"uuid": "11.1.1",
|
|
60
|
-
"@gooddata/
|
|
61
|
-
"@gooddata/sdk-
|
|
62
|
-
"@gooddata/sdk-ui": "11.52.0-alpha.
|
|
63
|
-
"@gooddata/
|
|
64
|
-
"@gooddata/sdk-ui-charts": "11.52.0-alpha.
|
|
65
|
-
"@gooddata/sdk-ui-dashboard": "11.52.0-alpha.
|
|
66
|
-
"@gooddata/sdk-ui-filters": "11.52.0-alpha.
|
|
67
|
-
"@gooddata/sdk-ui-
|
|
68
|
-
"@gooddata/sdk-ui-
|
|
69
|
-
"@gooddata/sdk-ui-
|
|
70
|
-
"@gooddata/sdk-ui-
|
|
71
|
-
"@gooddata/util": "11.52.0-alpha.
|
|
60
|
+
"@gooddata/api-client-tiger": "11.52.0-alpha.4",
|
|
61
|
+
"@gooddata/sdk-backend-spi": "11.52.0-alpha.4",
|
|
62
|
+
"@gooddata/sdk-ui": "11.52.0-alpha.4",
|
|
63
|
+
"@gooddata/sdk-model": "11.52.0-alpha.4",
|
|
64
|
+
"@gooddata/sdk-ui-charts": "11.52.0-alpha.4",
|
|
65
|
+
"@gooddata/sdk-ui-dashboard": "11.52.0-alpha.4",
|
|
66
|
+
"@gooddata/sdk-ui-filters": "11.52.0-alpha.4",
|
|
67
|
+
"@gooddata/sdk-ui-pivot": "11.52.0-alpha.4",
|
|
68
|
+
"@gooddata/sdk-ui-kit": "11.52.0-alpha.4",
|
|
69
|
+
"@gooddata/sdk-ui-semantic-search": "11.52.0-alpha.4",
|
|
70
|
+
"@gooddata/sdk-ui-theme-provider": "11.52.0-alpha.4",
|
|
71
|
+
"@gooddata/util": "11.52.0-alpha.4"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -111,13 +111,13 @@
|
|
|
111
111
|
"typescript": "5.9.3",
|
|
112
112
|
"vitest": "4.1.8",
|
|
113
113
|
"vitest-dom": "0.1.1",
|
|
114
|
-
"@gooddata/eslint-config": "11.52.0-alpha.
|
|
115
|
-
"@gooddata/
|
|
116
|
-
"@gooddata/
|
|
117
|
-
"@gooddata/
|
|
118
|
-
"@gooddata/sdk-ui-theme-provider": "11.52.0-alpha.
|
|
119
|
-
"@gooddata/
|
|
120
|
-
"@gooddata/
|
|
114
|
+
"@gooddata/eslint-config": "11.52.0-alpha.4",
|
|
115
|
+
"@gooddata/oxlint-config": "11.52.0-alpha.4",
|
|
116
|
+
"@gooddata/reference-workspace": "11.52.0-alpha.4",
|
|
117
|
+
"@gooddata/i18n-toolkit": "11.52.0-alpha.4",
|
|
118
|
+
"@gooddata/sdk-ui-theme-provider": "11.52.0-alpha.4",
|
|
119
|
+
"@gooddata/sdk-backend-mockingbird": "11.52.0-alpha.4",
|
|
120
|
+
"@gooddata/stylelint-config": "11.52.0-alpha.4"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"react": "^18.0.0 || ^19.0.0",
|