@gooddata/sdk-ui-gen-ai 10.13.0-alpha.3 → 10.13.0-alpha.30
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 +37 -3
- package/esm/components/EmptyState.d.ts +3 -3
- package/esm/components/EmptyState.d.ts.map +1 -1
- package/esm/components/EmptyState.js +10 -8
- package/esm/components/EmptyState.js.map +1 -1
- package/esm/components/ErrorBoundary.d.ts +11 -3
- package/esm/components/ErrorBoundary.d.ts.map +1 -1
- package/esm/components/ErrorBoundary.js +26 -7
- package/esm/components/ErrorBoundary.js.map +1 -1
- package/esm/components/GenAIChatOverlay.d.ts +3 -3
- package/esm/components/GenAIChatOverlay.d.ts.map +1 -1
- package/esm/components/GenAIChatOverlay.js +4 -4
- package/esm/components/GenAIChatOverlay.js.map +1 -1
- package/esm/components/GenAIChatWrapper.d.ts +7 -5
- package/esm/components/GenAIChatWrapper.d.ts.map +1 -1
- package/esm/components/GenAIChatWrapper.js +14 -1
- package/esm/components/GenAIChatWrapper.js.map +1 -1
- package/esm/components/GlobalError.d.ts +6 -15
- package/esm/components/GlobalError.d.ts.map +1 -1
- package/esm/components/GlobalError.js +12 -18
- package/esm/components/GlobalError.js.map +1 -1
- package/esm/components/Input.d.ts +2 -1
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +15 -13
- package/esm/components/Input.js.map +1 -1
- package/esm/components/Messages.d.ts +3 -3
- package/esm/components/Messages.d.ts.map +1 -1
- package/esm/components/Messages.js +21 -33
- package/esm/components/Messages.js.map +1 -1
- package/esm/components/messages/AgentIcon.d.ts.map +1 -1
- package/esm/components/messages/AgentIcon.js +10 -4
- package/esm/components/messages/AgentIcon.js.map +1 -1
- package/esm/components/messages/AssistantMessage.d.ts +8 -0
- package/esm/components/messages/AssistantMessage.d.ts.map +1 -0
- package/esm/components/messages/AssistantMessage.js +14 -0
- package/esm/components/messages/AssistantMessage.js.map +1 -0
- package/esm/components/messages/MessageContents.d.ts +11 -0
- package/esm/components/messages/MessageContents.d.ts.map +1 -0
- package/esm/components/messages/MessageContents.js +37 -0
- package/esm/components/messages/MessageContents.js.map +1 -0
- package/esm/components/messages/UserMessage.d.ts +8 -0
- package/esm/components/messages/UserMessage.d.ts.map +1 -0
- package/esm/components/messages/UserMessage.js +10 -0
- package/esm/components/messages/UserMessage.js.map +1 -0
- package/esm/components/messages/contents/ErrorContents.d.ts +8 -0
- package/esm/components/messages/contents/ErrorContents.d.ts.map +1 -0
- package/esm/components/messages/contents/ErrorContents.js +10 -0
- package/esm/components/messages/contents/ErrorContents.js.map +1 -0
- package/esm/components/messages/contents/Markdown.d.ts +8 -0
- package/esm/components/messages/contents/Markdown.d.ts.map +1 -0
- package/esm/components/messages/contents/Markdown.js +18 -0
- package/esm/components/messages/contents/Markdown.js.map +1 -0
- package/esm/components/messages/contents/RoutingContents.d.ts +8 -0
- package/esm/components/messages/contents/RoutingContents.d.ts.map +1 -0
- package/esm/components/messages/contents/RoutingContents.js +10 -0
- package/esm/components/messages/contents/RoutingContents.js.map +1 -0
- package/esm/components/messages/contents/SearchContents.d.ts +8 -0
- package/esm/components/messages/contents/SearchContents.d.ts.map +1 -0
- package/esm/components/messages/contents/SearchContents.js +14 -0
- package/esm/components/messages/contents/SearchContents.js.map +1 -0
- package/esm/components/messages/contents/TextContents.d.ts +8 -0
- package/esm/components/messages/contents/TextContents.d.ts.map +1 -0
- package/esm/components/messages/contents/TextContents.js +10 -0
- package/esm/components/messages/contents/TextContents.js.map +1 -0
- package/esm/components/messages/contents/VisualizationContents.d.ts +8 -0
- package/esm/components/messages/contents/VisualizationContents.d.ts.map +1 -0
- package/esm/components/messages/contents/VisualizationContents.js +53 -0
- package/esm/components/messages/contents/VisualizationContents.js.map +1 -0
- package/esm/components/messages/contents/VisualizationErrorBoundary.d.ts +10 -0
- package/esm/components/messages/contents/VisualizationErrorBoundary.d.ts.map +1 -0
- package/esm/components/messages/contents/VisualizationErrorBoundary.js +22 -0
- package/esm/components/messages/contents/VisualizationErrorBoundary.js.map +1 -0
- package/esm/components/messages/contents/replaceLinks.d.ts +3 -0
- package/esm/components/messages/contents/replaceLinks.d.ts.map +1 -0
- package/esm/components/messages/contents/replaceLinks.js +30 -0
- package/esm/components/messages/contents/replaceLinks.js.map +1 -0
- package/esm/components/messages/contents/useExecution.d.ts +6 -0
- package/esm/components/messages/contents/useExecution.d.ts.map +1 -0
- package/esm/components/messages/{useExecution.js → contents/useExecution.js} +9 -4
- package/esm/components/messages/contents/useExecution.js.map +1 -0
- package/esm/components/messages/index.d.ts +2 -4
- package/esm/components/messages/index.d.ts.map +1 -1
- package/esm/components/messages/index.js +2 -4
- package/esm/components/messages/index.js.map +1 -1
- package/esm/hooks/useGenAIStore.d.ts +8 -10
- package/esm/hooks/useGenAIStore.d.ts.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/localization/bundles/de-DE.json +22 -1
- package/esm/localization/bundles/en-AU.json +22 -1
- package/esm/localization/bundles/en-GB.json +22 -1
- package/esm/localization/bundles/en-US.json +11 -11
- package/esm/localization/bundles/es-419.json +22 -1
- package/esm/localization/bundles/es-ES.json +22 -1
- package/esm/localization/bundles/fi-FI.json +22 -1
- package/esm/localization/bundles/fr-CA.json +22 -1
- package/esm/localization/bundles/fr-FR.json +22 -1
- package/esm/localization/bundles/it-IT.json +22 -1
- package/esm/localization/bundles/ja-JP.json +22 -1
- package/esm/localization/bundles/nl-NL.json +22 -1
- package/esm/localization/bundles/pt-BR.json +22 -1
- package/esm/localization/bundles/pt-PT.json +22 -1
- package/esm/localization/bundles/zh-HK.json +22 -1
- package/esm/localization/bundles/zh-Hans.json +22 -1
- package/esm/localization/bundles/zh-Hant.json +22 -1
- package/esm/model.d.ts +70 -53
- package/esm/model.d.ts.map +1 -1
- package/esm/model.js +46 -43
- package/esm/model.js.map +1 -1
- package/esm/sdk-ui-gen-ai.d.ts +59 -46
- package/esm/store/index.d.ts +2 -4
- package/esm/store/index.d.ts.map +1 -1
- package/esm/store/index.js +2 -4
- package/esm/store/index.js.map +1 -1
- package/esm/store/messages/messagesSelectors.d.ts +6 -3
- package/esm/store/messages/messagesSelectors.d.ts.map +1 -1
- package/esm/store/messages/messagesSelectors.js +6 -12
- package/esm/store/messages/messagesSelectors.js.map +1 -1
- package/esm/store/messages/messagesSlice.d.ts +48 -4
- package/esm/store/messages/messagesSlice.d.ts.map +1 -1
- package/esm/store/messages/messagesSlice.js +85 -23
- package/esm/store/messages/messagesSlice.js.map +1 -1
- package/esm/store/sideEffects/converters/interactionsToMessages.d.ts +9 -0
- package/esm/store/sideEffects/converters/interactionsToMessages.d.ts.map +1 -0
- package/esm/store/sideEffects/converters/interactionsToMessages.js +36 -0
- package/esm/store/sideEffects/converters/interactionsToMessages.js.map +1 -0
- package/esm/store/sideEffects/index.d.ts.map +1 -1
- package/esm/store/sideEffects/index.js +10 -5
- package/esm/store/sideEffects/index.js.map +1 -1
- package/esm/store/sideEffects/onThreadClear.d.ts +18 -0
- package/esm/store/sideEffects/onThreadClear.d.ts.map +1 -0
- package/esm/store/sideEffects/onThreadClear.js +31 -0
- package/esm/store/sideEffects/onThreadClear.js.map +1 -0
- package/esm/store/sideEffects/onThreadLoad.d.ts +20 -0
- package/esm/store/sideEffects/onThreadLoad.d.ts.map +1 -0
- package/esm/store/sideEffects/onThreadLoad.js +41 -0
- package/esm/store/sideEffects/onThreadLoad.js.map +1 -0
- package/esm/store/sideEffects/onUserMessage.d.ts +20 -0
- package/esm/store/sideEffects/onUserMessage.d.ts.map +1 -0
- package/esm/store/sideEffects/onUserMessage.js +52 -0
- package/esm/store/sideEffects/onUserMessage.js.map +1 -0
- package/esm/store/sideEffects/threadPolling.d.ts +16 -0
- package/esm/store/sideEffects/threadPolling.d.ts.map +1 -0
- package/esm/store/sideEffects/threadPolling.js +86 -0
- package/esm/store/sideEffects/threadPolling.js.map +1 -0
- package/esm/store/store.d.ts +8 -10
- package/esm/store/store.d.ts.map +1 -1
- package/esm/store/store.js +2 -4
- package/esm/store/store.js.map +1 -1
- package/esm/store/types.d.ts +0 -2
- package/esm/store/types.d.ts.map +1 -1
- package/esm/store/types.js +0 -1
- package/esm/store/types.js.map +1 -1
- package/package.json +15 -12
- package/styles/css/main.css +112 -43
- package/styles/css/main.css.map +1 -1
- package/styles/css/messages.css +55 -26
- package/styles/css/messages.css.map +1 -1
- package/styles/scss/main.scss +25 -6
- package/styles/scss/messages.scss +126 -97
- package/esm/components/messages/AgentState.d.ts +0 -3
- package/esm/components/messages/AgentState.d.ts.map +0 -1
- package/esm/components/messages/AgentState.js +0 -12
- package/esm/components/messages/AgentState.js.map +0 -1
- package/esm/components/messages/AssistantCancelledMessage.d.ts +0 -8
- package/esm/components/messages/AssistantCancelledMessage.d.ts.map +0 -1
- package/esm/components/messages/AssistantCancelledMessage.js +0 -12
- package/esm/components/messages/AssistantCancelledMessage.js.map +0 -1
- package/esm/components/messages/AssistantErrorMessage.d.ts +0 -11
- package/esm/components/messages/AssistantErrorMessage.d.ts.map +0 -1
- package/esm/components/messages/AssistantErrorMessage.js +0 -14
- package/esm/components/messages/AssistantErrorMessage.js.map +0 -1
- package/esm/components/messages/AssistantSearchCreateMessage.d.ts +0 -8
- package/esm/components/messages/AssistantSearchCreateMessage.d.ts.map +0 -1
- package/esm/components/messages/AssistantSearchCreateMessage.js +0 -16
- package/esm/components/messages/AssistantSearchCreateMessage.js.map +0 -1
- package/esm/components/messages/AssistantTextMessage.d.ts +0 -8
- package/esm/components/messages/AssistantTextMessage.d.ts.map +0 -1
- package/esm/components/messages/AssistantTextMessage.js +0 -10
- package/esm/components/messages/AssistantTextMessage.js.map +0 -1
- package/esm/components/messages/FoundObjects.d.ts +0 -8
- package/esm/components/messages/FoundObjects.d.ts.map +0 -1
- package/esm/components/messages/FoundObjects.js +0 -28
- package/esm/components/messages/FoundObjects.js.map +0 -1
- package/esm/components/messages/SystemMessage.d.ts +0 -8
- package/esm/components/messages/SystemMessage.d.ts.map +0 -1
- package/esm/components/messages/SystemMessage.js +0 -7
- package/esm/components/messages/SystemMessage.js.map +0 -1
- package/esm/components/messages/UserTextMessage.d.ts +0 -8
- package/esm/components/messages/UserTextMessage.d.ts.map +0 -1
- package/esm/components/messages/UserTextMessage.js +0 -10
- package/esm/components/messages/UserTextMessage.js.map +0 -1
- package/esm/components/messages/Visualization.d.ts +0 -8
- package/esm/components/messages/Visualization.d.ts.map +0 -1
- package/esm/components/messages/Visualization.js +0 -39
- package/esm/components/messages/Visualization.js.map +0 -1
- package/esm/components/messages/useExecution.d.ts +0 -6
- package/esm/components/messages/useExecution.d.ts.map +0 -1
- package/esm/components/messages/useExecution.js.map +0 -1
- package/esm/store/agent/agentSelectors.d.ts +0 -3
- package/esm/store/agent/agentSelectors.d.ts.map +0 -1
- package/esm/store/agent/agentSelectors.js +0 -6
- package/esm/store/agent/agentSelectors.js.map +0 -1
- package/esm/store/agent/agentSlice.d.ts +0 -8
- package/esm/store/agent/agentSlice.d.ts.map +0 -1
- package/esm/store/agent/agentSlice.js +0 -21
- package/esm/store/agent/agentSlice.js.map +0 -1
- package/esm/store/sideEffects/converters/evalToMessage.d.ts +0 -7
- package/esm/store/sideEffects/converters/evalToMessage.d.ts.map +0 -1
- package/esm/store/sideEffects/converters/evalToMessage.js +0 -14
- package/esm/store/sideEffects/converters/evalToMessage.js.map +0 -1
- package/esm/store/sideEffects/converters/messagesToHistory.d.ts +0 -4
- package/esm/store/sideEffects/converters/messagesToHistory.d.ts.map +0 -1
- package/esm/store/sideEffects/converters/messagesToHistory.js +0 -83
- package/esm/store/sideEffects/converters/messagesToHistory.js.map +0 -1
- package/esm/store/sideEffects/onNewMessage.d.ts +0 -13
- package/esm/store/sideEffects/onNewMessage.d.ts.map +0 -1
- package/esm/store/sideEffects/onNewMessage.js +0 -81
- package/esm/store/sideEffects/onNewMessage.js.map +0 -1
- package/styles/css/agentState.css +0 -29
- package/styles/css/agentState.css.map +0 -1
- package/styles/scss/agentState.scss +0 -31
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: 2024-10-
|
|
10
|
+
Date generated: 2024-10-9
|
|
11
11
|
|
|
12
|
-
Revision ID:
|
|
12
|
+
Revision ID: 8c41756eaf8657f30c1424ad3a65cb0edbfeab33
|
|
13
13
|
|
|
14
14
|
================================================================================
|
|
15
15
|
================================================================================
|
|
@@ -393,6 +393,7 @@ Revision ID: 266145b7f290dd306974971535b2271c242c1c38
|
|
|
393
393
|
- debounce-promise (3.1.2) [MIT]
|
|
394
394
|
- debug (2.6.9) [MIT]
|
|
395
395
|
- debug (4.3.4) [MIT]
|
|
396
|
+
- debug (4.3.7) [MIT]
|
|
396
397
|
- decimal.js (10.4.3) [MIT]
|
|
397
398
|
- decode-named-character-reference (1.0.2) [MIT]
|
|
398
399
|
- deep-eql (4.1.3) [MIT]
|
|
@@ -14307,6 +14308,39 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
14307
14308
|
|
|
14308
14309
|
|
|
14309
14310
|
|
|
14311
|
+
--------------------------------------------------------------------------------
|
|
14312
|
+
Package Title: debug (4.3.7)
|
|
14313
|
+
|
|
14314
|
+
Package Locator: npm+debug$4.3.7
|
|
14315
|
+
--------------------------------------------------------------------------------
|
|
14316
|
+
|
|
14317
|
+
* Declared Licenses *
|
|
14318
|
+
MIT
|
|
14319
|
+
|
|
14320
|
+
|
|
14321
|
+
(The MIT License)
|
|
14322
|
+
|
|
14323
|
+
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
|
14324
|
+
Copyright (c) 2018-2021 Josh Junon
|
|
14325
|
+
|
|
14326
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14327
|
+
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
|
14328
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
14329
|
+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
14330
|
+
subject to the following conditions:
|
|
14331
|
+
|
|
14332
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
14333
|
+
portions of the Software.
|
|
14334
|
+
|
|
14335
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
14336
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
14337
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
14338
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
14339
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14340
|
+
|
|
14341
|
+
|
|
14342
|
+
|
|
14343
|
+
|
|
14310
14344
|
--------------------------------------------------------------------------------
|
|
14311
14345
|
Package Title: decimal.js (10.4.3)
|
|
14312
14346
|
|
|
@@ -69186,4 +69220,4 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
|
69186
69220
|
--------------------------------------------------------------------------------
|
|
69187
69221
|
--------------------------------------------------------------------------------
|
|
69188
69222
|
|
|
69189
|
-
Report Generated by FOSSA on 2024-10-
|
|
69223
|
+
Report Generated by FOSSA on 2024-10-9
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { setMessagesAction } from "../store/index.js";
|
|
3
3
|
import { WrappedComponentProps } from "react-intl";
|
|
4
4
|
type EmptyStateDispatchProps = {
|
|
5
|
-
|
|
5
|
+
setMessagesAction: typeof setMessagesAction;
|
|
6
6
|
};
|
|
7
7
|
export declare const EmptyState: import("react-redux").ConnectedComponent<React.FC<import("react-intl").WithIntlProps<EmptyStateDispatchProps & WrappedComponentProps>> & {
|
|
8
8
|
WrappedComponent: React.ComponentType<EmptyStateDispatchProps & WrappedComponentProps>;
|
|
9
9
|
}, import("react-redux").Omit<Omit<EmptyStateDispatchProps & WrappedComponentProps, "intl"> & {
|
|
10
10
|
forwardedRef?: React.Ref<any> | undefined;
|
|
11
|
-
}, "
|
|
11
|
+
}, "setMessagesAction">>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=EmptyState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA+C,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAuBhG,KAAK,uBAAuB,GAAG;IAC3B,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;CAC/C,CAAC;AA0CF,eAAO,MAAM,UAAU;;;;wBAAqE,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Button, Icon, Typography } from "@gooddata/sdk-ui-kit";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { makeAssistantMessage, makeTextContents, makeUserMessage } from "../model.js";
|
|
6
|
+
import { setMessagesAction } from "../store/index.js";
|
|
7
7
|
import { defineMessage, FormattedMessage, injectIntl } from "react-intl";
|
|
8
8
|
const quickOptions = [
|
|
9
9
|
{
|
|
@@ -25,21 +25,23 @@ const quickOptions = [
|
|
|
25
25
|
Icon: Icon.ChatBubble,
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
|
-
const EmptyStateComponent = ({
|
|
28
|
+
const EmptyStateComponent = ({ setMessagesAction, intl, }) => {
|
|
29
29
|
return (React.createElement("div", { className: "gd-gen-ai-chat__messages__empty" },
|
|
30
30
|
React.createElement(Typography, { tagName: "h1", className: "gd-gen-ai-chat__messages__empty__h1--accent" },
|
|
31
31
|
React.createElement(FormattedMessage, { id: "gd.gen-ai.welcome.line-1" })),
|
|
32
32
|
React.createElement(Typography, { tagName: "h1" },
|
|
33
33
|
React.createElement(FormattedMessage, { id: "gd.gen-ai.welcome.line-2" })),
|
|
34
|
-
quickOptions.map((option) => (React.createElement(Button, { key: option.title.id, onClick: () =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
quickOptions.map((option) => (React.createElement(Button, { key: option.title.id, onClick: () => setMessagesAction({
|
|
35
|
+
messages: [
|
|
36
|
+
makeUserMessage([makeTextContents(intl.formatMessage(option.question))]),
|
|
37
|
+
makeAssistantMessage([makeTextContents(intl.formatMessage(option.answer))], true),
|
|
38
|
+
],
|
|
39
|
+
}), variant: "secondary" },
|
|
38
40
|
React.createElement(option.Icon, { width: 18, height: 18 }),
|
|
39
41
|
React.createElement(FormattedMessage, { tagName: "span", id: option.title.id }))))));
|
|
40
42
|
};
|
|
41
43
|
const mapDispatchToProps = {
|
|
42
|
-
|
|
44
|
+
setMessagesAction,
|
|
43
45
|
};
|
|
44
46
|
export const EmptyState = connect(null, mapDispatchToProps)(injectIntl(EmptyStateComponent));
|
|
45
47
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,E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AkB,GAA4B;IAChD,iBAAiB;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { setGlobalErrorAction } from "../store/index.js";
|
|
2
3
|
type ErrorBoundaryProps = {
|
|
3
4
|
children: React.ReactNode;
|
|
5
|
+
globalError?: string;
|
|
6
|
+
isClearing: boolean;
|
|
7
|
+
setGlobalError: typeof setGlobalErrorAction;
|
|
8
|
+
clearThread: () => void;
|
|
4
9
|
};
|
|
5
10
|
type ErrorBoundaryState = {
|
|
6
|
-
|
|
11
|
+
ownError?: string;
|
|
7
12
|
};
|
|
8
|
-
|
|
13
|
+
declare class ErrorBoundaryComponent extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
9
14
|
constructor(props: ErrorBoundaryProps);
|
|
10
15
|
static getDerivedStateFromError(error: unknown): {
|
|
11
|
-
|
|
16
|
+
ownError: string;
|
|
12
17
|
};
|
|
18
|
+
componentDidCatch(error: Error, _errorInfo: React.ErrorInfo): void;
|
|
19
|
+
clearError(): void;
|
|
13
20
|
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
|
|
14
21
|
}
|
|
22
|
+
export declare const ErrorBoundary: import("react-redux").ConnectedComponent<typeof ErrorBoundaryComponent, import("react-redux").Omit<React.ClassAttributes<ErrorBoundaryComponent> & ErrorBoundaryProps, "globalError" | "isClearing" | "setGlobalError" | "clearThread">>;
|
|
15
23
|
export {};
|
|
16
24
|
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,kBAAkB,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAGH,oBAAoB,EAGvB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,kBAAkB,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,oBAAoB,CAAC;IAC5C,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,cAAM,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;gBAC5E,KAAK,EAAE,kBAAkB;IAKrC,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,OAAO;;;IAI9C,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS;IAI3D,UAAU;IAKV,MAAM;CAgBT;AAYD,eAAO,MAAM,aAAa,0OAAuE,CAAC"}
|
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
// (C) 2024 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { connect } from "react-redux";
|
|
3
4
|
import { GlobalError } from "./GlobalError.js";
|
|
4
5
|
import { extractError } from "../store/sideEffects/utils.js";
|
|
5
|
-
|
|
6
|
+
import { globalErrorSelector, setGlobalErrorAction, clearThreadAction, asyncProcessSelector, } from "../store/index.js";
|
|
7
|
+
class ErrorBoundaryComponent extends React.Component {
|
|
6
8
|
constructor(props) {
|
|
7
9
|
super(props);
|
|
8
|
-
this.state = {
|
|
10
|
+
this.state = { ownError: "" };
|
|
9
11
|
}
|
|
10
12
|
static getDerivedStateFromError(error) {
|
|
11
|
-
return {
|
|
13
|
+
return { ownError: extractError(error) };
|
|
14
|
+
}
|
|
15
|
+
componentDidCatch(error, _errorInfo) {
|
|
16
|
+
this.props.setGlobalError({ error: extractError(error) });
|
|
17
|
+
}
|
|
18
|
+
clearError() {
|
|
19
|
+
this.props.clearThread();
|
|
20
|
+
this.setState({ ownError: "" });
|
|
12
21
|
}
|
|
13
22
|
render() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
// Catch both global error from store or local React error
|
|
24
|
+
// And treat them the same
|
|
25
|
+
const error = this.props.globalError || this.state.ownError;
|
|
26
|
+
if (error) {
|
|
27
|
+
return (React.createElement(GlobalError, { errorDetails: error, clearError: this.clearError.bind(this), clearing: this.props.isClearing }));
|
|
18
28
|
}
|
|
19
29
|
return this.props.children;
|
|
20
30
|
}
|
|
21
31
|
}
|
|
32
|
+
const mapStateToProps = (state) => ({
|
|
33
|
+
globalError: globalErrorSelector(state),
|
|
34
|
+
isClearing: asyncProcessSelector(state) === "clearing",
|
|
35
|
+
});
|
|
36
|
+
const mapDispatchToProps = {
|
|
37
|
+
setGlobalError: setGlobalErrorAction,
|
|
38
|
+
clearThread: clearThreadAction,
|
|
39
|
+
};
|
|
40
|
+
export const ErrorBoundary = connect(mapStateToProps, mapDispatchToProps)(ErrorBoundaryComponent);
|
|
22
41
|
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,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,IAAI,CAAC,IAAI,CAAC,EACtC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,GACjC,CACL,CAAC;QACN,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACJ;AAED,MAAM,eAAe,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,CAAC;IAC3C,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC;IACvC,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,UAAU;CACzD,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG;IACvB,cAAc,EAAE,oBAAoB;IACpC,WAAW,EAAE,iBAAiB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { clearThreadAction } from "../store/index.js";
|
|
3
3
|
import { WrappedComponentProps } from "react-intl";
|
|
4
4
|
type GenAIChatOverlayOwnProps = {
|
|
5
5
|
onClose: () => void;
|
|
@@ -8,13 +8,13 @@ type GenAIChatOverlayStateProps = {
|
|
|
8
8
|
hasMessages: boolean;
|
|
9
9
|
};
|
|
10
10
|
type GenAIChatOverlayDispatchProps = {
|
|
11
|
-
|
|
11
|
+
clearThread: typeof clearThreadAction;
|
|
12
12
|
};
|
|
13
13
|
export type GenAIChatOverlayProps = GenAIChatOverlayOwnProps & GenAIChatOverlayStateProps & GenAIChatOverlayDispatchProps;
|
|
14
14
|
export declare const GenAIChatOverlay: import("react-redux").ConnectedComponent<React.FC<import("react-intl").WithIntlProps<GenAIChatOverlayOwnProps & GenAIChatOverlayStateProps & GenAIChatOverlayDispatchProps & WrappedComponentProps>> & {
|
|
15
15
|
WrappedComponent: React.ComponentType<GenAIChatOverlayOwnProps & GenAIChatOverlayStateProps & GenAIChatOverlayDispatchProps & WrappedComponentProps>;
|
|
16
16
|
}, import("react-redux").Omit<Omit<GenAIChatOverlayOwnProps & GenAIChatOverlayStateProps & GenAIChatOverlayDispatchProps & WrappedComponentProps, "intl"> & {
|
|
17
17
|
forwardedRef?: React.Ref<any> | undefined;
|
|
18
|
-
}, "
|
|
18
|
+
}, "clearThread" | "hasMessages">>;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=GenAIChatOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatOverlay.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GenAIChatOverlay.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAkC,MAAM,mBAAmB,CAAC;AAItF,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE/D,KAAK,wBAAwB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,0BAA0B,GAAG;IAC9B,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACjC,WAAW,EAAE,OAAO,iBAAiB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GACxD,0BAA0B,GAC1B,6BAA6B,CAAC;AAsElC,eAAO,MAAM,gBAAgB;;;;kCAGW,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { GenAIChatWrapper } from "./GenAIChatWrapper.js";
|
|
4
4
|
import { Icon, Overlay } from "@gooddata/sdk-ui-kit";
|
|
5
|
-
import {
|
|
5
|
+
import { clearThreadAction, hasMessagesSelector } from "../store/index.js";
|
|
6
6
|
import cx from "classnames";
|
|
7
7
|
import { HeaderIcon } from "./HeaderIcon.js";
|
|
8
8
|
import { connect } from "react-redux";
|
|
9
9
|
import { injectIntl } from "react-intl";
|
|
10
|
-
const GenAIChatOverlayComponent = ({ onClose, hasMessages,
|
|
10
|
+
const GenAIChatOverlayComponent = ({ onClose, hasMessages, clearThread, intl, }) => {
|
|
11
11
|
const [isFullScreen, setIsFullScreen] = React.useState(false);
|
|
12
12
|
const isModal = isFullScreen;
|
|
13
13
|
const classNames = cx("gd-gen-ai-chat__window", {
|
|
@@ -16,7 +16,7 @@ const GenAIChatOverlayComponent = ({ onClose, hasMessages, clearMessages, intl,
|
|
|
16
16
|
return (React.createElement(Overlay, { isModal: isModal, positionType: "fixed", alignPoints: [{ align: isModal ? "cc cc" : "br br" }], closeOnEscape: true, closeOnParentScroll: false, closeOnOutsideClick: false, closeOnMouseDrag: false, zIndex: 6000, onClose: onClose },
|
|
17
17
|
React.createElement("div", { className: classNames },
|
|
18
18
|
React.createElement("div", { className: "gd-gen-ai-chat__window__header" },
|
|
19
|
-
React.createElement(HeaderIcon, { Icon: Icon.Undo, className: "gd-gen-ai-chat__window__header__icon--reset", tooltip: intl.formatMessage({ id: "gd.gen-ai.header.reset-tooltip" }), onClick: () =>
|
|
19
|
+
React.createElement(HeaderIcon, { Icon: Icon.Undo, className: "gd-gen-ai-chat__window__header__icon--reset", tooltip: intl.formatMessage({ id: "gd.gen-ai.header.reset-tooltip" }), onClick: () => clearThread(), disabled: !hasMessages }),
|
|
20
20
|
React.createElement("div", { className: "gd-gen-ai-chat__window__header__gap" }),
|
|
21
21
|
React.createElement(HeaderIcon, { Icon: isFullScreen ? Icon.Contract : Icon.Expand, className: "gd-gen-ai-chat__window__header__icon--fullscreen", tooltip: isFullScreen
|
|
22
22
|
? intl.formatMessage({ id: "gd.gen-ai.header.contract-tooltip" })
|
|
@@ -29,7 +29,7 @@ const mapStateToProps = (state) => ({
|
|
|
29
29
|
hasMessages: hasMessagesSelector(state),
|
|
30
30
|
});
|
|
31
31
|
const mapDispatchToProps = {
|
|
32
|
-
|
|
32
|
+
clearThread: clearThreadAction,
|
|
33
33
|
};
|
|
34
34
|
export const GenAIChatOverlay = connect(mapStateToProps, mapDispatchToProps)(injectIntl(GenAIChatOverlayComponent));
|
|
35
35
|
//# sourceMappingURL=GenAIChatOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatOverlay.js","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GenAIChatOverlay.js","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAa,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,UAAU,EAAyB,MAAM,YAAY,CAAC;AAkB/D,MAAM,yBAAyB,GAA4D,CAAC,EACxF,OAAO,EACP,WAAW,EACX,WAAW,EACX,IAAI,GACP,EAAE,EAAE;IACD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK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AAC,eAAe,CAAC,CAAC,YAAY,CAAC,GAC/C;gBACF,6BAAK,SAAS,EAAC,yCAAyC,GAAO;gBAC/D,oBAAC,UAAU,IACP,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,SAAS,EAAC,6CAA6C,EACvD,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,gCAAgC,EAAE,CAAC,EACrE,OAAO,EAAE,OAAO,GAClB,CACA;YACN,oBAAC,gBAAgB,OAAG,CAClB,CACA,CACb,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAgB,EAA8B,EAAE,CAAC,CAAC;IACvE,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAkC;IACtD,WAAW,EAAE,iBAAiB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CACnC,eAAe,EACf,kBAAkB,CACrB,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { loadThreadAction, cancelAsyncAction } from "../store/index.js";
|
|
3
|
+
type GenAIChatWrapperProps = {
|
|
4
|
+
loadThread: typeof loadThreadAction;
|
|
5
|
+
cancelLoading: typeof cancelAsyncAction;
|
|
6
|
+
};
|
|
7
|
+
export declare const GenAIChatWrapper: import("react-redux").ConnectedComponent<React.FC<GenAIChatWrapperProps>, import("react-redux").Omit<GenAIChatWrapperProps, "loadThread" | "cancelLoading">>;
|
|
8
|
+
export {};
|
|
7
9
|
//# sourceMappingURL=GenAIChatWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatWrapper.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B
|
|
1
|
+
{"version":3,"file":"GenAIChatWrapper.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAExE,KAAK,qBAAqB,GAAG;IACzB,UAAU,EAAE,OAAO,gBAAgB,CAAC;IACpC,aAAa,EAAE,OAAO,iBAAiB,CAAC;CAC3C,CAAC;AAiCF,eAAO,MAAM,gBAAgB,8JAA+D,CAAC"}
|
|
@@ -5,11 +5,19 @@ import { Messages } from "./Messages.js";
|
|
|
5
5
|
import { Typography } from "@gooddata/sdk-ui-kit";
|
|
6
6
|
import { ErrorBoundary } from "./ErrorBoundary.js";
|
|
7
7
|
import { FormattedMessage } from "react-intl";
|
|
8
|
+
import { connect } from "react-redux";
|
|
9
|
+
import { loadThreadAction, cancelAsyncAction } from "../store/index.js";
|
|
8
10
|
/**
|
|
9
11
|
* UI component that renders the Gen AI chat.
|
|
10
12
|
* @internal
|
|
11
13
|
*/
|
|
12
|
-
|
|
14
|
+
const GenAIChatWrapperComponent = ({ loadThread, cancelLoading }) => {
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
loadThread();
|
|
17
|
+
return () => {
|
|
18
|
+
cancelLoading();
|
|
19
|
+
};
|
|
20
|
+
}, [loadThread, cancelLoading]);
|
|
13
21
|
return (React.createElement(ErrorBoundary, null,
|
|
14
22
|
React.createElement("div", { className: "gd-gen-ai-chat" },
|
|
15
23
|
React.createElement(Messages, null),
|
|
@@ -17,4 +25,9 @@ export const GenAIChatWrapper = () => {
|
|
|
17
25
|
React.createElement(Typography, { tagName: "p", className: "gd-gen-ai-chat__disclaimer" },
|
|
18
26
|
React.createElement(FormattedMessage, { id: "gd.gen-ai.disclaimer" })))));
|
|
19
27
|
};
|
|
28
|
+
const mapDispatchToProps = {
|
|
29
|
+
loadThread: loadThreadAction,
|
|
30
|
+
cancelLoading: cancelAsyncAction,
|
|
31
|
+
};
|
|
32
|
+
export const GenAIChatWrapper = connect(null, mapDispatchToProps)(GenAIChatWrapperComponent);
|
|
20
33
|
//# sourceMappingURL=GenAIChatWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatWrapper.js","sourceRoot":"","sources":["../../src/components/GenAIChatWrapper.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAIChatWrapper.js","sourceRoot":"","sources":["../../src/components/GenAIChatWrapper.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOxE;;;GAGG;AACH,MAAM,yBAAyB,GAAoC,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,EAAE;IACjG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,UAAU,EAAE,CAAC;QAEb,OAAO,GAAG,EAAE;YACR,aAAa,EAAE,CAAC;QACpB,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAEhC,OAAO,CACH,oBAAC,aAAa;QACV,6BAAK,SAAS,EAAC,gBAAgB;YAC3B,oBAAC,QAAQ,OAAG;YACZ,oBAAC,KAAK,OAAG;YACT,oBAAC,UAAU,IAAC,OAAO,EAAC,GAAG,EAAC,SAAS,EAAC,4BAA4B;gBAC1D,oBAAC,gBAAgB,IAAC,EAAE,EAAC,sBAAsB,GAAG,CACrC,CACX,CACM,CACnB,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACvB,UAAU,EAAE,gBAAgB;IAC5B,aAAa,EAAE,iBAAiB;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { WrappedComponentProps } from "react-intl";
|
|
3
|
-
type
|
|
4
|
-
clearMessagesAction: () => void;
|
|
5
|
-
};
|
|
6
|
-
export declare const GlobalError: import("react-redux").ConnectedComponent<React.FC<import("react-intl").WithIntlProps<GlobalErrorDispatchProps & {
|
|
7
|
-
errorDetails: string;
|
|
8
|
-
clearError: () => void;
|
|
9
|
-
} & WrappedComponentProps>> & {
|
|
10
|
-
WrappedComponent: React.ComponentType<GlobalErrorDispatchProps & {
|
|
11
|
-
errorDetails: string;
|
|
12
|
-
clearError: () => void;
|
|
13
|
-
} & WrappedComponentProps>;
|
|
14
|
-
}, import("react-redux").Omit<Omit<GlobalErrorDispatchProps & {
|
|
3
|
+
type GlobalErrorProps = {
|
|
15
4
|
errorDetails: string;
|
|
5
|
+
clearing: boolean;
|
|
16
6
|
clearError: () => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
};
|
|
8
|
+
export declare const GlobalError: React.FC<import("react-intl").WithIntlProps<GlobalErrorProps & WrappedComponentProps>> & {
|
|
9
|
+
WrappedComponent: React.ComponentType<GlobalErrorProps & WrappedComponentProps>;
|
|
10
|
+
};
|
|
20
11
|
export {};
|
|
21
12
|
//# sourceMappingURL=GlobalError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalError.d.ts","sourceRoot":"","sources":["../../src/components/GlobalError.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalError.d.ts","sourceRoot":"","sources":["../../src/components/GlobalError.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAG/D,KAAK,gBAAgB,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AA4CF,eAAO,MAAM,WAAW;;CAAmC,CAAC"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
// (C) 2024 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Button, Typography } from "@gooddata/sdk-ui-kit";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const GlobalErrorComponent = ({ errorDetails, clearMessagesAction, clearError, intl, }) => {
|
|
4
|
+
import { injectIntl } from "react-intl";
|
|
5
|
+
import { ErrorComponent } from "@gooddata/sdk-ui";
|
|
6
|
+
const GlobalErrorComponent = ({ errorDetails, clearing, clearError, intl, }) => {
|
|
8
7
|
const [showMore, setShowMore] = React.useState(false);
|
|
9
|
-
const
|
|
10
|
-
const clearCallback = () => {
|
|
11
|
-
clearMessagesAction();
|
|
12
|
-
clearError();
|
|
13
|
-
};
|
|
8
|
+
const hasShowMoreButton = Boolean(errorDetails && !showMore);
|
|
14
9
|
return (React.createElement("div", { className: "gd-gen-ai-chat__global_error" },
|
|
15
|
-
React.createElement(
|
|
16
|
-
React.createElement(
|
|
17
|
-
React.createElement(
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
React.createElement("div", null,
|
|
11
|
+
React.createElement(ErrorComponent, { message: intl.formatMessage({ id: "gd.gen-ai.global-error" }), description: intl.formatMessage({ id: "gd.gen-ai.global-error.description" }) })),
|
|
12
|
+
React.createElement("div", { className: "gd-gen-ai-chat__global_error__buttons" },
|
|
13
|
+
React.createElement(Button, { className: "gd-button-link", value: intl.formatMessage({ id: "gd.gen-ai.global-error.button-clear" }), onClick: clearError, disabled: clearing }),
|
|
14
|
+
hasShowMoreButton ? (React.createElement(Button, { className: "gd-button-link", value: intl.formatMessage({ id: "gd.gen-ai.global-error.button-details" }), onClick: () => setShowMore(true), disabled: clearing })) : null),
|
|
15
|
+
showMore ? (React.createElement(Typography, { tagName: "p", className: "gd-gen-ai-chat__global_error__details" },
|
|
16
|
+
React.createElement("pre", null, errorDetails))) : null));
|
|
20
17
|
};
|
|
21
|
-
const
|
|
22
|
-
clearMessagesAction,
|
|
23
|
-
};
|
|
24
|
-
export const GlobalError = connect(null, mapDispatchToProps)(injectIntl(GlobalErrorComponent));
|
|
18
|
+
export const GlobalError = injectIntl(GlobalErrorComponent);
|
|
25
19
|
//# sourceMappingURL=GlobalError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalError.js","sourceRoot":"","sources":["../../src/components/GlobalError.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GlobalError.js","sourceRoot":"","sources":["../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CAAC,CAAC,CAAC,IAAI,CACN;QACL,QAAQ,CAAC,CAAC,CAAC,CACR,oBAAC,UAAU,IAAC,OAAO,EAAC,GAAG,EAAC,SAAS,EAAC,uCAAuC;YACrE,iCAAM,YAAY,CAAO,CAChB,CAChB,CAAC,CAAC,CAAC,IAAI,CACN,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { newMessageAction } from "../store/index.js";
|
|
|
3
3
|
import { WrappedComponentProps } from "react-intl/src/components/injectIntl.js";
|
|
4
4
|
type InputStateProps = {
|
|
5
5
|
isBusy: boolean;
|
|
6
|
+
isEvaluating: boolean;
|
|
6
7
|
};
|
|
7
8
|
type InputDispatchProps = {
|
|
8
9
|
newMessage: typeof newMessageAction;
|
|
@@ -11,6 +12,6 @@ export declare const Input: import("react-redux").ConnectedComponent<React.FC<im
|
|
|
11
12
|
WrappedComponent: React.ComponentType<InputStateProps & InputDispatchProps & WrappedComponentProps>;
|
|
12
13
|
}, import("react-redux").Omit<Omit<InputStateProps & InputDispatchProps & WrappedComponentProps, "intl"> & {
|
|
13
14
|
forwardedRef?: React.Ref<any> | undefined;
|
|
14
|
-
}, "isBusy" | "newMessage">>;
|
|
15
|
+
}, "isBusy" | "isEvaluating" | "newMessage">>;
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAwB,gBAAgB,EAAa,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAwB,gBAAgB,EAAa,MAAM,mBAAmB,CAAC;AAEtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAOhF,KAAK,eAAe,GAAG;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,UAAU,EAAE,OAAO,gBAAgB,CAAC;CACvC,CAAC;AA4EF,eAAO,MAAM,KAAK;;;;6CAA2E,CAAC"}
|
package/esm/components/Input.js
CHANGED
|
@@ -5,15 +5,14 @@ import { defaultImport } from "default-import";
|
|
|
5
5
|
import cx from "classnames";
|
|
6
6
|
import { SendIcon } from "./SendIcon.js";
|
|
7
7
|
import { connect } from "react-redux";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { StopIcon } from "./StopIcon.js";
|
|
8
|
+
import { makeTextContents, makeUserMessage } from "../model.js";
|
|
9
|
+
import { asyncProcessSelector, newMessageAction } from "../store/index.js";
|
|
11
10
|
import { injectIntl } from "react-intl";
|
|
12
11
|
// There are known compatibility issues between CommonJS (CJS) and ECMAScript modules (ESM).
|
|
13
12
|
// In ESM, default exports of CJS modules are wrapped in default properties instead of being exposed directly.
|
|
14
13
|
// https://github.com/microsoft/TypeScript/issues/52086#issuecomment-1385978414
|
|
15
14
|
const TextareaAutosize = defaultImport(DefaultTextArea);
|
|
16
|
-
const InputComponent = ({ isBusy, newMessage, intl, }) => {
|
|
15
|
+
const InputComponent = ({ isBusy, isEvaluating, newMessage, intl, }) => {
|
|
17
16
|
const [value, setValue] = React.useState("");
|
|
18
17
|
const textareaRef = React.useRef(null);
|
|
19
18
|
React.useEffect(() => {
|
|
@@ -25,12 +24,9 @@ const InputComponent = ({ isBusy, newMessage, intl, }) => {
|
|
|
25
24
|
}
|
|
26
25
|
}, [isBusy]);
|
|
27
26
|
const handleSubmit = () => {
|
|
28
|
-
newMessage(
|
|
27
|
+
newMessage(makeUserMessage([makeTextContents(value)]));
|
|
29
28
|
setValue("");
|
|
30
29
|
};
|
|
31
|
-
const handleCancel = () => {
|
|
32
|
-
newMessage(makeAssistantCancelledMessage());
|
|
33
|
-
};
|
|
34
30
|
const handleKeyDown = (e) => {
|
|
35
31
|
if (e.key === "Enter" && !e.shiftKey && !isBusy && value) {
|
|
36
32
|
e.preventDefault();
|
|
@@ -40,16 +36,22 @@ const InputComponent = ({ isBusy, newMessage, intl, }) => {
|
|
|
40
36
|
const handleChange = (e) => {
|
|
41
37
|
setValue(e.target.value);
|
|
42
38
|
};
|
|
39
|
+
const buttonDisabled = !value || isBusy || isEvaluating;
|
|
43
40
|
const buttonClasses = cx("gd-gen-ai-chat__input__send_button", {
|
|
44
|
-
"gd-gen-ai-chat__input__send_button--disabled":
|
|
41
|
+
"gd-gen-ai-chat__input__send_button--disabled": buttonDisabled,
|
|
45
42
|
});
|
|
46
43
|
return (React.createElement("div", { className: "gd-gen-ai-chat__input" },
|
|
47
44
|
React.createElement(TextareaAutosize, { ref: textareaRef, className: "gd-gen-ai-chat__input__textarea", placeholder: intl.formatMessage({ id: "gd.gen-ai.input-placeholder" }), value: value, onChange: handleChange, onKeyDown: handleKeyDown, disabled: isBusy }),
|
|
48
|
-
React.createElement("div", {
|
|
45
|
+
React.createElement("div", { role: "button", "aria-label": intl.formatMessage({ id: "gd.gen-ai.button.send" }), onClick: !buttonDisabled ? handleSubmit : undefined },
|
|
46
|
+
React.createElement(SendIcon, { className: buttonClasses }))));
|
|
47
|
+
};
|
|
48
|
+
const mapStateToProps = (state) => {
|
|
49
|
+
const asyncState = asyncProcessSelector(state);
|
|
50
|
+
return {
|
|
51
|
+
isBusy: !!asyncState,
|
|
52
|
+
isEvaluating: asyncState === "evaluating",
|
|
53
|
+
};
|
|
49
54
|
};
|
|
50
|
-
const mapStateToProps = (state) => ({
|
|
51
|
-
isBusy: agentLoadingSelector(state),
|
|
52
|
-
});
|
|
53
55
|
const mapDispatchToProps = {
|
|
54
56
|
newMessage: newMessageAction,
|
|
55
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAa,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,4FAA4F;AAC5F,8GAA8G;AAC9G,+EAA+E;AAC/E,MAAM,gBAAgB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAWxD,MAAM,cAAc,GAA2E,CAAC,EAC5F,MAAM,EACN,YAAY,EACZ,UAAU,EACV,IAAI,GACP,EAAE,EAAE;IACD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAA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AC,EAAE,EAAE,EAAE,6BAA6B,EAAE,CAAC,EACtE,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,MAAM,GAClB;QACF,6BACI,IAAI,EAAC,QAAQ,gBACD,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,CAAC,EAC/D,OAAO,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;YAEnD,oBAAC,QAAQ,IAAC,SAAS,EAAE,aAAa,GAAI,CACpC,CACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAgB,EAAmB,EAAE;IAC1D,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE/C,OAAO;QACH,MAAM,EAAE,CAAC,CAAC,UAAU;QACpB,YAAY,EAAE,UAAU,KAAK,YAAY;KAC5C,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACvB,UAAU,EAAE,gBAAgB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { asyncProcessSelector, messagesSelector } from "../store/index.js";
|
|
3
3
|
type MessagesComponentProps = {
|
|
4
|
-
messages: ReturnType<typeof
|
|
5
|
-
loading: ReturnType<typeof
|
|
4
|
+
messages: ReturnType<typeof messagesSelector>;
|
|
5
|
+
loading: ReturnType<typeof asyncProcessSelector>;
|
|
6
6
|
};
|
|
7
7
|
export declare const Messages: import("react-redux").ConnectedComponent<React.FC<MessagesComponentProps>, import("react-redux").Omit<MessagesComponentProps, "loading" | "messages">>;
|
|
8
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAa,
|
|
1
|
+
{"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../src/components/Messages.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAMtF,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC9C,OAAO,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;CACpD,CAAC;AA8CF,eAAO,MAAM,QAAQ,wJAA8C,CAAC"}
|