@gooddata/sdk-ui-gen-ai 11.67.0-alpha.2 → 11.67.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 +798 -2473
- package/README.md +58 -1
- package/esm/components/ConfigContext.d.ts +3 -1
- package/esm/components/ConfigContext.d.ts.map +1 -1
- package/esm/components/ConfigContext.js +14 -2
- package/esm/components/GenAIChat.d.ts +5 -0
- package/esm/components/GenAIChat.d.ts.map +1 -1
- package/esm/components/GenAIChat.js +2 -1
- package/esm/components/GenAIChatDialog.d.ts +2 -1
- package/esm/components/GenAIChatDialog.d.ts.map +1 -1
- package/esm/components/GenAIChatDialog.js +4 -4
- package/esm/components/GenAIChatDialogConnected.d.ts +6 -8
- package/esm/components/GenAIChatDialogConnected.d.ts.map +1 -1
- package/esm/components/GenAIChatDialogConnected.js +5 -6
- package/esm/components/GenAIChatWrapper.js +1 -1
- package/esm/components/GenAIStandaloneInput.d.ts +6 -1
- package/esm/components/GenAIStandaloneInput.d.ts.map +1 -1
- package/esm/components/GenAIStandaloneInput.js +2 -2
- package/esm/components/GenAiConversations.js +1 -1
- package/esm/components/Input.d.ts.map +1 -1
- package/esm/components/Input.js +3 -1
- package/esm/components/customized/types.d.ts +22 -0
- package/esm/components/customized/types.d.ts.map +1 -1
- package/esm/components/hooks/useAppEventSync.d.ts +18 -0
- package/esm/components/hooks/useAppEventSync.d.ts.map +1 -0
- package/esm/components/hooks/useAppEventSync.js +35 -0
- package/esm/components/hooks/useSettingsClick.d.ts +1 -2
- package/esm/components/hooks/useSettingsClick.d.ts.map +1 -1
- package/esm/components/hooks/useSettingsClick.js +7 -20
- package/esm/components/intelligence/data/constants.d.ts +1 -1
- package/esm/components/intelligence/data/constants.js +1 -1
- package/esm/components/intelligence/detail/IntelligenceStepCarousel.d.ts +1 -1
- package/esm/components/intelligence/detail/IntelligenceStepCarousel.js +1 -1
- package/esm/components/intelligence/panel/IntelligenceDurationTokens.d.ts +1 -1
- package/esm/components/intelligence/panel/IntelligenceDurationTokens.js +1 -1
- package/esm/components/messages/ConversationItemContents.d.ts +1 -1
- package/esm/components/messages/ConversationItemContents.d.ts.map +1 -1
- package/esm/components/messages/ConversationItemContents.js +10 -1
- package/esm/components/messages/ItemsGroup.d.ts.map +1 -1
- package/esm/components/messages/ItemsGroup.js +4 -11
- package/esm/components/messages/contents/CustomHyperlink.js +2 -2
- package/esm/components/messages/conversationContents/ConversationErrorContent.d.ts.map +1 -1
- package/esm/components/messages/conversationContents/ConversationErrorContent.js +1 -4
- package/esm/components/messages/conversationContents/ConversationPublisherDocumentContent.js +2 -2
- package/esm/components/messages/conversationContents/utils/errors.d.ts +4 -4
- package/esm/components/messages/conversationContents/utils/errors.js +4 -4
- package/esm/components/utils/groupUtility.d.ts +1 -0
- package/esm/components/utils/groupUtility.d.ts.map +1 -1
- package/esm/components/utils/groupUtility.js +11 -0
- package/esm/copilot/CopilotComposingOverlay.d.ts +4 -0
- package/esm/copilot/CopilotComposingOverlay.d.ts.map +1 -0
- package/esm/copilot/CopilotComposingOverlay.js +151 -0
- package/esm/copilot/CopilotInteractionComposing.d.ts +29 -0
- package/esm/copilot/CopilotInteractionComposing.d.ts.map +1 -0
- package/esm/copilot/CopilotInteractionComposing.js +39 -0
- package/esm/copilot/CopilotInteractionComposingWithHandler.d.ts +15 -0
- package/esm/copilot/CopilotInteractionComposingWithHandler.d.ts.map +1 -0
- package/esm/copilot/CopilotInteractionComposingWithHandler.js +11 -0
- package/esm/copilot/selectors.d.ts +4 -2
- package/esm/copilot/selectors.d.ts.map +1 -1
- package/esm/copilot/selectors.js +73 -14
- package/esm/copilot/transitions.d.ts.map +1 -1
- package/esm/copilot/transitions.js +264 -81
- package/esm/copilot/types.d.ts +10 -4
- package/esm/copilot/types.d.ts.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -0
- package/esm/internal.d.ts +1 -2
- package/esm/internal.d.ts.map +1 -1
- package/esm/localization/bundles/de-DE.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/de-DE.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/de-DE.localization-bundle.js +4 -2
- package/esm/localization/bundles/en-AU.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/en-AU.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-AU.localization-bundle.js +4 -2
- package/esm/localization/bundles/en-GB.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/en-GB.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-GB.localization-bundle.js +4 -2
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +8 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +12 -4
- package/esm/localization/bundles/es-419.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/es-419.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/es-419.localization-bundle.js +4 -2
- package/esm/localization/bundles/es-ES.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/es-ES.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/es-ES.localization-bundle.js +4 -2
- package/esm/localization/bundles/fi-FI.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/fi-FI.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fi-FI.localization-bundle.js +4 -2
- package/esm/localization/bundles/fr-CA.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/fr-CA.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fr-CA.localization-bundle.js +4 -2
- package/esm/localization/bundles/fr-FR.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/fr-FR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/fr-FR.localization-bundle.js +4 -2
- package/esm/localization/bundles/id-ID.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/id-ID.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/id-ID.localization-bundle.js +4 -2
- package/esm/localization/bundles/it-IT.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/it-IT.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/it-IT.localization-bundle.js +4 -2
- package/esm/localization/bundles/ja-JP.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/ja-JP.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ja-JP.localization-bundle.js +4 -2
- package/esm/localization/bundles/ko-KR.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/ko-KR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ko-KR.localization-bundle.js +4 -2
- package/esm/localization/bundles/nl-NL.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/nl-NL.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/nl-NL.localization-bundle.js +4 -2
- package/esm/localization/bundles/pl-PL.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/pl-PL.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pl-PL.localization-bundle.js +4 -2
- package/esm/localization/bundles/pt-BR.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/pt-BR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pt-BR.localization-bundle.js +4 -2
- package/esm/localization/bundles/pt-PT.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/pt-PT.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/pt-PT.localization-bundle.js +4 -2
- package/esm/localization/bundles/ru-RU.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/ru-RU.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/ru-RU.localization-bundle.js +4 -2
- package/esm/localization/bundles/sl-SI.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/sl-SI.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/sl-SI.localization-bundle.js +4 -2
- package/esm/localization/bundles/th-TH.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/th-TH.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/th-TH.localization-bundle.js +4 -2
- package/esm/localization/bundles/tr-TR.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/tr-TR.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/tr-TR.localization-bundle.js +4 -2
- package/esm/localization/bundles/uk-UA.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/uk-UA.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/uk-UA.localization-bundle.js +4 -2
- package/esm/localization/bundles/vi-VN.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/vi-VN.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/vi-VN.localization-bundle.js +4 -2
- package/esm/localization/bundles/zh-HK.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/zh-HK.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-HK.localization-bundle.js +4 -2
- package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/zh-Hans.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-Hans.localization-bundle.js +4 -2
- package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts +2 -0
- package/esm/localization/bundles/zh-Hant.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/zh-Hant.localization-bundle.js +4 -2
- package/esm/sdk-ui-gen-ai.d.ts +85 -51
- package/esm/store/events.d.ts +6 -45
- package/esm/store/events.d.ts.map +1 -1
- package/esm/store/messages/messagesSlice.d.ts.map +1 -1
- package/esm/store/messages/messagesSlice.js +2 -0
- package/esm/store/sideEffects/onEvent.d.ts +11 -3
- package/esm/store/sideEffects/onEvent.d.ts.map +1 -1
- package/esm/store/sideEffects/onEvent.js +32 -25
- package/esm/utils.d.ts +0 -4
- package/esm/utils.d.ts.map +1 -1
- package/esm/utils.js +3 -23
- package/package.json +28 -29
- package/styles/css/copilotInteractionComposing.css +94 -0
- package/styles/css/copilotInteractionComposing.css.map +1 -0
- package/styles/css/input.css +4 -4
- package/styles/css/main.css +97 -4
- package/styles/css/main.css.map +1 -1
- package/styles/scss/copilotInteractionComposing.scss +106 -0
- package/styles/scss/input.scss +1 -1
- package/styles/scss/main.scss +1 -0
- package/esm/components/hooks/useDashboardSavedSync.d.ts +0 -13
- package/esm/components/hooks/useDashboardSavedSync.d.ts.map +0 -1
- package/esm/components/hooks/useDashboardSavedSync.js +0 -14
- package/esm/components/hooks/usePublisherDocumentSavedSync.d.ts +0 -20
- package/esm/components/hooks/usePublisherDocumentSavedSync.d.ts.map +0 -1
- package/esm/components/hooks/usePublisherDocumentSavedSync.js +0 -18
package/README.md
CHANGED
|
@@ -20,6 +20,20 @@ const App = () => {
|
|
|
20
20
|
};
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
## Custom input placeholder
|
|
24
|
+
|
|
25
|
+
Set `inputPlaceholder` on `GenAIAssistant` to override the chat input placeholder:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<GenAIAssistant backend={backend} workspace="your-workspace-id" inputPlaceholder="Ask about your data…" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`GenAIStandaloneInput` (available from `@gooddata/sdk-ui-gen-ai/internal`) accepts the same prop.
|
|
32
|
+
Custom text is displayed as-is; the embedding application is responsible for translating it.
|
|
33
|
+
Omitting the prop keeps the bundled localized placeholder ("Ask here…" in English).
|
|
34
|
+
An empty string hides the placeholder. The standalone input's existing `placeholder` prop remains
|
|
35
|
+
supported, with `inputPlaceholder` taking precedence when both are supplied.
|
|
36
|
+
|
|
23
37
|
## Headless copilot workflow (alpha)
|
|
24
38
|
|
|
25
39
|
`CopilotHandler` owns plain immutable workflow state; it requires no Redux setup.
|
|
@@ -27,7 +41,7 @@ Register each build type with its reacting skills, pure definition acceptance po
|
|
|
27
41
|
and host application callback. Create one instance per editor/runtime, not a singleton.
|
|
28
42
|
|
|
29
43
|
```typescript
|
|
30
|
-
import { CopilotBuildType, CopilotHandler } from "@gooddata/sdk-ui-gen-ai
|
|
44
|
+
import { CopilotBuildType, CopilotHandler } from "@gooddata/sdk-ui-gen-ai";
|
|
31
45
|
|
|
32
46
|
const copilot = new CopilotHandler({
|
|
33
47
|
registrations: [
|
|
@@ -64,6 +78,49 @@ copilot.dispose();
|
|
|
64
78
|
`useCopilotSnapshot(copilot)`; the hook adds no workflow owner. Application-owned string enums
|
|
65
79
|
can replace the built-in `CopilotBuildType` without changing the lifecycle algorithm.
|
|
66
80
|
|
|
81
|
+
Switching conversations clears foreground reasoning, not outstanding workflow ownership.
|
|
82
|
+
Activated creation requests continue to contribute progress across chats; edit and builder
|
|
83
|
+
scopes also include their matching background requests. Unanswered clarification questions keep
|
|
84
|
+
waiting across conversation switches, as do creation/builder workflows awaiting a general follow-up
|
|
85
|
+
reply. Ordinary completed edits without pending questions still release their lock.
|
|
86
|
+
Replying resumes the same workflow; failure, cancellation, target reset, or definition
|
|
87
|
+
application acknowledgement releases it. In-progress applications stay building until acknowledgement.
|
|
88
|
+
Clarifications can be answered through the form or by typing in chat. A clarification event with
|
|
89
|
+
`responses: null` dismisses the form before a typed reply; it does not cancel the workflow or release its lock.
|
|
90
|
+
The originating conversation owns its loader: ordinary messages, reasoning, completion, or failure in
|
|
91
|
+
another chat cannot replace its progress or release its lock. Ownership transfers only when another
|
|
92
|
+
conversation activates a configured skill for the same workflow and target. Superseded responses cannot
|
|
93
|
+
reclaim ownership or restore an old wait after the new workflow finishes; other targets remain independent.
|
|
94
|
+
|
|
95
|
+
## Composing overlay (alpha)
|
|
96
|
+
|
|
97
|
+
Wrap any editor with loading, reasoning, and waiting-for-reply presentation. No dashboard
|
|
98
|
+
configuration or Redux store is needed. The visibility predicate controls only composing UI;
|
|
99
|
+
wrapped content stays mounted. It is evaluated during rendering, so rerender when its inputs change.
|
|
100
|
+
The wrapper fills its host and positions the overlay relative to that host.
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { CopilotInteractionComposing } from "@gooddata/sdk-ui-gen-ai";
|
|
104
|
+
import "@gooddata/sdk-ui-gen-ai/styles/css/copilotInteractionComposing.css";
|
|
105
|
+
|
|
106
|
+
<CopilotInteractionComposing
|
|
107
|
+
status="building"
|
|
108
|
+
reasoningTitle="Arranging visualizations"
|
|
109
|
+
isVisible={() => !isExporting}
|
|
110
|
+
onReplyInChat={openChat}
|
|
111
|
+
>
|
|
112
|
+
<Editor />
|
|
113
|
+
</CopilotInteractionComposing>;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Use `generating` or `building` for loading (optionally with a reasoning heading), `waiting`
|
|
117
|
+
for the reply banner, and `idle` for no composing UI. Supply `locale` for localized labels.
|
|
118
|
+
`CopilotInteractionComposingWithHandler` accepts `copilot` and `scope` instead of `status`
|
|
119
|
+
and `reasoningTitle` and subscribes directly to the same runtime-owned handler. Its optional
|
|
120
|
+
`onReplyInChat(threadId)` receives the owning waiting workflow's thread, not whichever
|
|
121
|
+
chat is currently selected. It does not dispose that handler when unmounted. Both variants also
|
|
122
|
+
ship in `styles/css/main.css`.
|
|
123
|
+
|
|
67
124
|
## License
|
|
68
125
|
|
|
69
126
|
(C) 2017-2026 GoodData Corporation
|
|
@@ -5,8 +5,10 @@ export type ConfigContext = {
|
|
|
5
5
|
canManage?: boolean;
|
|
6
6
|
canAnalyze?: boolean;
|
|
7
7
|
canFullControl?: boolean;
|
|
8
|
+
canCreateDocument?: boolean;
|
|
8
9
|
linkHandler?: (linkClickEvent: LinkHandlerEvent) => string | undefined;
|
|
9
10
|
catalogItems?: CatalogItem[];
|
|
11
|
+
inputPlaceholder?: string;
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* @public
|
|
@@ -37,6 +39,6 @@ export type GenAIAssistantMode = "docked" | "fullscreen";
|
|
|
37
39
|
* @public
|
|
38
40
|
*/
|
|
39
41
|
export type GenAIAssistantDisplayMode = "inline" | "modal";
|
|
40
|
-
export declare function ConfigProvider({ children, allowNativeLinks, linkHandler, catalogItems, canManage, canAnalyze, canFullControl, }: PropsWithChildren<ConfigContext>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function ConfigProvider({ children, allowNativeLinks, linkHandler, catalogItems, canManage, canAnalyze, canFullControl, canCreateDocument, inputPlaceholder, }: PropsWithChildren<ConfigContext>): import("react/jsx-runtime").JSX.Element;
|
|
41
43
|
export declare const useConfig: () => ConfigContext;
|
|
42
44
|
//# sourceMappingURL=ConfigContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigContext.d.ts","sourceRoot":"","sources":["../../src/components/ConfigContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAsC,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE7G,MAAM,MAAM,aAAa,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigContext.d.ts","sourceRoot":"","sources":["../../src/components/ConfigContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAsC,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE7G,MAAM,MAAM,aAAa,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SA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CAAC,2CAkClC;AAED,eAAO,MAAM,SAAS,QAAO,aAE5B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2024-2026 GoodData Corporation
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
4
|
const configContext = createContext({});
|
|
5
|
-
export function ConfigProvider({ children, allowNativeLinks, linkHandler, catalogItems, canManage, canAnalyze, canFullControl, }) {
|
|
5
|
+
export function ConfigProvider({ children, allowNativeLinks, linkHandler, catalogItems, canManage, canAnalyze, canFullControl, canCreateDocument, inputPlaceholder, }) {
|
|
6
6
|
const parentConfig = useConfig();
|
|
7
7
|
const value = useMemo(() => ({
|
|
8
8
|
allowNativeLinks: allowNativeLinks ?? parentConfig.allowNativeLinks,
|
|
@@ -17,7 +17,19 @@ export function ConfigProvider({ children, allowNativeLinks, linkHandler, catalo
|
|
|
17
17
|
canManage: canManage ?? parentConfig.canManage,
|
|
18
18
|
canAnalyze: canAnalyze ?? parentConfig.canAnalyze,
|
|
19
19
|
canFullControl: canFullControl ?? parentConfig.canFullControl,
|
|
20
|
-
|
|
20
|
+
canCreateDocument: canCreateDocument ?? parentConfig.canCreateDocument,
|
|
21
|
+
inputPlaceholder: inputPlaceholder ?? parentConfig.inputPlaceholder,
|
|
22
|
+
}), [
|
|
23
|
+
allowNativeLinks,
|
|
24
|
+
parentConfig,
|
|
25
|
+
linkHandler,
|
|
26
|
+
catalogItems,
|
|
27
|
+
canManage,
|
|
28
|
+
canAnalyze,
|
|
29
|
+
canFullControl,
|
|
30
|
+
canCreateDocument,
|
|
31
|
+
inputPlaceholder,
|
|
32
|
+
]);
|
|
21
33
|
return _jsx(configContext.Provider, { value: value, children: children });
|
|
22
34
|
}
|
|
23
35
|
export const useConfig = () => {
|
|
@@ -11,6 +11,11 @@ export type GenAIAssistantProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
11
11
|
* The locale to use for the chat UI.
|
|
12
12
|
*/
|
|
13
13
|
locale?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Placeholder text for the chat input. Defaults to the bundled localized placeholder when omitted.
|
|
16
|
+
* The supplied text is used as-is and is not translated.
|
|
17
|
+
*/
|
|
18
|
+
inputPlaceholder?: string;
|
|
14
19
|
/**
|
|
15
20
|
* When provided, references to the metadata objects will be rendered as clickable links.
|
|
16
21
|
* Otherwise, the metadata objects will be rendered as plain text (using object title).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChat.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAQ7E,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEpG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnE;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IAEvE;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAEtD;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MA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G,IAAI,CAAC;IAEtD;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAyDxD;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,uBAAiB,CAAC"}
|
|
@@ -32,5 +32,6 @@ function GenAIContent(props) {
|
|
|
32
32
|
const { permissions, loading } = usePermissions();
|
|
33
33
|
useDashboardAmbientContext(dashboardSelector);
|
|
34
34
|
useDataLoad();
|
|
35
|
-
|
|
35
|
+
const canManage = props.disableManage ? false : (permissions.canManageProject ?? false);
|
|
36
|
+
return (_jsx(ConfigProvider, { catalogItems: catalogItems, inputPlaceholder: props.inputPlaceholder, canFullControl: props.disableFullControl ? false : (permissions.canManageProject ?? false), canManage: canManage, canAnalyze: props.disableAnalyze ? false : (permissions.canAnalyzeWorkspace ?? false), canCreateDocument: permissions.canCreateDocument ?? canManage, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(OverlayAlignOnParentScrollProvider, { children: _jsx(GenAIChatWrapper, { initializing: loading, className: className, autofocus: true }) }) }) }));
|
|
36
37
|
}
|
|
@@ -11,6 +11,7 @@ export type GenAIChatDialogProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
11
11
|
canManage?: boolean;
|
|
12
12
|
canAnalyze?: boolean;
|
|
13
13
|
canFullControl?: boolean;
|
|
14
|
+
canCreateDocument?: boolean;
|
|
14
15
|
onOpen: () => void;
|
|
15
16
|
onClose: () => void;
|
|
16
17
|
returnFocusTo?: RefObject<HTMLElement | null> | string;
|
|
@@ -25,5 +26,5 @@ export type GenAIChatDialogProps = Omit<GenAiStoreProps, "children"> & {
|
|
|
25
26
|
*/
|
|
26
27
|
closeOnEscape?: boolean;
|
|
27
28
|
};
|
|
28
|
-
export declare function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks, returnFocusTo, objectTypes, includeTags, excludeTags, canManage, canAnalyze, canFullControl, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, displayMode, slots, closeOnEscape, }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks, returnFocusTo, objectTypes, includeTags, excludeTags, canManage, canAnalyze, canFullControl, canCreateDocument, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, displayMode, slots, closeOnEscape, }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
//# sourceMappingURL=GenAIChatDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatDialog.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;AAchF,OAAO,EAAkD,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3G,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACnE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MA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EFAULT_CHAT_Z_INDEX
|
|
20
20
|
const DEFAULT_KDA_Z_INDEX = 3050;
|
|
21
|
-
export function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks = true, returnFocusTo, objectTypes, includeTags, excludeTags, canManage = false, canAnalyze = false, canFullControl = false, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, displayMode, slots, closeOnEscape, }) {
|
|
21
|
+
export function GenAIChatDialog({ backend, workspace, locale, disabled, isOpen, onOpen, onClose, settings, className, dialogPosition, allowNativeLinks = true, returnFocusTo, objectTypes, includeTags, excludeTags, canManage = false, canAnalyze = false, canFullControl = false, canCreateDocument = canManage, eventHandlers, catalogItems, colorPalette, onLinkClick, onDispatcher, mode, displayMode, slots, closeOnEscape, }) {
|
|
22
22
|
const effectiveBackend = useBackendStrict(backend);
|
|
23
23
|
const effectiveWorkspace = useWorkspaceStrict(workspace);
|
|
24
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, eventHandlers: eventHandlers, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, mode: mode, children: (genAIStore) => (_jsx(GenAIChatDialogContent, { genAIStore: genAIStore, backend: effectiveBackend, workspace: effectiveWorkspace, className: className, dialogPosition: dialogPosition, disabled: disabled, isOpen: isOpen, onOpen: onOpen, onClose: onClose, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, allowNativeLinks: allowNativeLinks, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, slots: slots, displayMode: displayMode })) }) }));
|
|
24
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(GenAiStore, { backend: effectiveBackend, workspace: effectiveWorkspace, onDispatcher: onDispatcher, eventHandlers: eventHandlers, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, catalogItems: catalogItems, mode: mode, children: (genAIStore) => (_jsx(GenAIChatDialogContent, { genAIStore: genAIStore, backend: effectiveBackend, workspace: effectiveWorkspace, className: className, dialogPosition: dialogPosition, disabled: disabled, isOpen: isOpen, onOpen: onOpen, onClose: onClose, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, allowNativeLinks: allowNativeLinks, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, canCreateDocument: canCreateDocument, slots: slots, displayMode: displayMode })) }) }));
|
|
25
25
|
}
|
|
26
|
-
function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, slots, displayMode, closeOnEscape, }) {
|
|
26
|
+
function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, canCreateDocument, slots, displayMode, closeOnEscape, }) {
|
|
27
27
|
const open = useRef(onOpen);
|
|
28
28
|
open.current = onOpen;
|
|
29
29
|
const close = useRef(onClose);
|
|
@@ -63,5 +63,5 @@ function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dia
|
|
|
63
63
|
const parentOverlayController = useOverlayController();
|
|
64
64
|
const chatOverlayController = useMemo(() => parentOverlayController ?? OverlayController.getInstance(DEFAULT_CHAT_Z_INDEX), [parentOverlayController]);
|
|
65
65
|
const kdaOverlayController = useMemo(() => parentOverlayController ?? OverlayController.getInstance(DEFAULT_KDA_Z_INDEX), [parentOverlayController]);
|
|
66
|
-
return (_jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProvider, { workspace: workspace, children: _jsxs(OverlayControllerProvider, { overlayController: chatOverlayController, children: [isOpen && !disabled ? (_jsx(ConfigProvider, { allowNativeLinks: allowNativeLinks, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, displayMode: displayMode, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(GenAiKeyDriverAnalysis, {}) })] }) }) }));
|
|
66
|
+
return (_jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProvider, { workspace: workspace, children: _jsxs(OverlayControllerProvider, { overlayController: chatOverlayController, children: [isOpen && !disabled ? (_jsx(ConfigProvider, { allowNativeLinks: allowNativeLinks, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, canCreateDocument: canCreateDocument, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, displayMode: displayMode, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(GenAiKeyDriverAnalysis, {}) })] }) }) }));
|
|
67
67
|
}
|
|
@@ -4,8 +4,7 @@ import type { GenAIChatEffort, GenAIObjectType, IColorPalette, IGenAIUserContext
|
|
|
4
4
|
import { type ChatAssistantMessageEvent, type ChatClarificationQuestionsEvent, type ChatClosedEvent, type ChatConversationChangedEvent, type ChatCopyToClipboardEvent, type ChatDefinitionReceivedEvent, type ChatEvent, type ChatFeedbackErrorEvent, type ChatFeedbackEvent, type ChatModeChangeEvent, type ChatOpenedEvent, type ChatReasoningEvent, type ChatResetEvent, type ChatSaveVisualizationErrorEvent, type ChatSaveVisualizationSuccessEvent, type ChatUserAnswersEvent, type ChatUserMessageEvent } from "../store/events.js";
|
|
5
5
|
import { type GenAIAssistantDisplayMode, type LinkHandlerEvent } from "./ConfigContext.js";
|
|
6
6
|
import { type GenAIChatDialogProps } from "./GenAIChatDialog.js";
|
|
7
|
-
import { type
|
|
8
|
-
import { type IPublisherDocumentSaved } from "./hooks/usePublisherDocumentSavedSync.js";
|
|
7
|
+
import { type ISequencedAppEvent } from "./hooks/useAppEventSync.js";
|
|
9
8
|
/**
|
|
10
9
|
* Discriminated union of GenAI chat events surfaced to a caller via {@link IGenAIChatDialogConnectedProps.onEvent}.
|
|
11
10
|
*
|
|
@@ -108,6 +107,7 @@ export interface IGenAIChatDialogConnectedProps {
|
|
|
108
107
|
canManage?: boolean;
|
|
109
108
|
canAnalyze?: boolean;
|
|
110
109
|
canFullControl?: boolean;
|
|
110
|
+
canCreateDocument?: boolean;
|
|
111
111
|
settings?: IUserWorkspaceSettings;
|
|
112
112
|
/** Open-state is fully controlled by the caller (props, not redux). */
|
|
113
113
|
isOpen: boolean;
|
|
@@ -152,12 +152,10 @@ export interface IGenAIChatDialogConnectedProps {
|
|
|
152
152
|
*/
|
|
153
153
|
ambientUserContextLoading?: boolean;
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
155
|
+
* Recent events of the application the chat runs beside, such as a save of an object the chat
|
|
156
|
+
* drafted, oldest first. Each delivery carries a new `seq`. Events the chat does not know are ignored.
|
|
157
157
|
*/
|
|
158
|
-
|
|
159
|
-
/** A dashboard save reported by an application. Each save carries a new `seq`. */
|
|
160
|
-
dashboardSaved?: IDashboardSaved;
|
|
158
|
+
appEvents?: ReadonlyArray<ISequencedAppEvent>;
|
|
161
159
|
/**
|
|
162
160
|
* Agent ID to use for the seeded question. If not provided, the default agent will be used.
|
|
163
161
|
*/
|
|
@@ -199,6 +197,6 @@ export interface IGenAIChatDialogConnectedProps {
|
|
|
199
197
|
*
|
|
200
198
|
* @internal
|
|
201
199
|
*/
|
|
202
|
-
export declare function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading,
|
|
200
|
+
export declare function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, canCreateDocument, settings, agentId, effort, isOpen, isDisabled, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading, appEvents, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks, onLinkClick, returnFocusTo, }: IGenAIChatDialogConnectedProps): import("react/jsx-runtime").JSX.Element;
|
|
203
201
|
export {};
|
|
204
202
|
//# sourceMappingURL=GenAIChatDialogConnected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChatDialogConnected.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatDialogConnected.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAE1F,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQ9G,OAAO,EACH,KAAK,yBAAyB,EAC9B,KAAK,+BAA+B,EACpC,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,+BAA+B,EACpC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAiB5B,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EAA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AAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;CAC1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,EACrC,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,UAAiB,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,cAAc,EACd,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,yBAAyB,EACzB,SAAyB,EACzB,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,WAAW,EAAE,mBAAmB,EAChC,OAAO,EACP,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAuB,EACvB,WAAW,EACX,aAAa,GAChB,EAAE,8BAA8B,2CAgJhC"}
|
|
@@ -6,8 +6,8 @@ import { setAmbientUserContextAction, setHistoryAction, setUserContextAction, }
|
|
|
6
6
|
import { isChatAssistantMessageEvent, isChatClarificationQuestionsEvent, isChatClosedEvent, isChatConversationChangedEvent, isChatCopyToClipboardEvent, isChatDefinitionReceivedEvent, isChatFeedbackErrorEvent, isChatFeedbackEvent, isChatModeChangeEvent, isChatOpenedEvent, isChatReasoningEvent, isChatResetEvent, isChatSaveVisualizationErrorEvent, isChatSaveVisualizationSuccessEvent, isChatUserAnswersEvent, isChatUserMessageEvent, } from "../store/events.js";
|
|
7
7
|
import { activateConversationAction, clearThreadAction, newMessageAction, setSelectedAgentAction, setSelectedEffortAction, } from "../store/messages/messagesSlice.js";
|
|
8
8
|
import { GenAIChatDialog } from "./GenAIChatDialog.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import { useAppEventSync } from "./hooks/useAppEventSync.js";
|
|
10
|
+
const NO_APP_EVENTS = [];
|
|
11
11
|
import { sanitizeEffort } from "./utils/effortSelection.js";
|
|
12
12
|
export function toGenAIChatConnectedEvent(event) {
|
|
13
13
|
if (isChatOpenedEvent(event)) {
|
|
@@ -105,7 +105,7 @@ export function buildSeedActions({ conversationId, agentId, effort, askedQuestio
|
|
|
105
105
|
*
|
|
106
106
|
* @internal
|
|
107
107
|
*/
|
|
108
|
-
export function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, settings, agentId, effort, isOpen, isDisabled = true, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading,
|
|
108
|
+
export function GenAIChatDialogConnected({ backend, workspace, locale, canManage, canAnalyze, canFullControl, canCreateDocument, settings, agentId, effort, isOpen, isDisabled = true, displayMode, onOpen, onClose, askedQuestion, conversationId, askSeq, userContext, ambientUserContext, ambientUserContextLoading, appEvents = NO_APP_EVENTS, appendToChat, replaceUserContext, includeTags, excludeTags, objectTypes: objectTypesOverride, onEvent, onAnyEvent, dialogPosition, className, colorPalette, allowNativeLinks = true, onLinkClick, returnFocusTo, }) {
|
|
109
109
|
const defaultLinkClick = useCallback(({ itemUrl, newTab, preventDefault, type, dashboardStatus, }) => {
|
|
110
110
|
// NOTE: If dashboard is draft, do nothing for now
|
|
111
111
|
if (type === "dashboard" && dashboardStatus === "draft") {
|
|
@@ -160,8 +160,7 @@ export function GenAIChatDialogConnected({ backend, workspace, locale, canManage
|
|
|
160
160
|
loading: ambientUserContextLoading,
|
|
161
161
|
}));
|
|
162
162
|
}, [chatDispatcher, ambientUserContext, ambientUserContextLoading]);
|
|
163
|
-
|
|
164
|
-
useDashboardSavedSync(chatDispatcher, dashboardSaved);
|
|
163
|
+
useAppEventSync(chatDispatcher, appEvents);
|
|
165
164
|
// The token of the last seed we applied. Each ask is identified by `askSeq` (bumped on every ask,
|
|
166
165
|
// so even a repeated identical question re-seeds); we seed once per token. Without this guard the
|
|
167
166
|
// effect would replay the question whenever `settings`/`userContext` merely change object identity.
|
|
@@ -198,5 +197,5 @@ export function GenAIChatDialogConnected({ backend, workspace, locale, canManage
|
|
|
198
197
|
settings,
|
|
199
198
|
replaceUserContext,
|
|
200
199
|
]);
|
|
201
|
-
return (_jsx(GenAIChatDialog, { isOpen: isOpen, disabled: isDisabled, locale: locale, backend: backend, displayMode: displayMode, workspace: workspace, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, className: className, dialogPosition: dialogPosition, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick ?? defaultLinkClick, onOpen: onOpen, onClose: onClose, eventHandlers: eventHandlers, onDispatcher: onDispatcher, returnFocusTo: returnFocusTo }));
|
|
200
|
+
return (_jsx(GenAIChatDialog, { isOpen: isOpen, disabled: isDisabled, locale: locale, backend: backend, displayMode: displayMode, workspace: workspace, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, canCreateDocument: canCreateDocument, settings: settings, objectTypes: objectTypes, includeTags: includeTags, excludeTags: excludeTags, className: className, dialogPosition: dialogPosition, colorPalette: colorPalette, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick ?? defaultLinkClick, onOpen: onOpen, onClose: onClose, eventHandlers: eventHandlers, onDispatcher: onDispatcher, returnFocusTo: returnFocusTo }));
|
|
202
201
|
}
|
|
@@ -43,7 +43,7 @@ function GenAIChatWrapperComponent({ loadThread, clearThread, cancelLoading, set
|
|
|
43
43
|
navigationId: GEN_AI_INPUT_ANCHOR_ID,
|
|
44
44
|
tabIndex: -1,
|
|
45
45
|
});
|
|
46
|
-
const onSettingClick = useSettingsClick(
|
|
46
|
+
const onSettingClick = useSettingsClick();
|
|
47
47
|
if (evaluated && hasUnsupportedOpenAiModel) {
|
|
48
48
|
return (_jsx(GlobalError, { errorMessage: intl.formatMessage({ id: "gd.gen-ai.global-unsupported-model" }), errorDescription: intl.formatMessage({
|
|
49
49
|
id: "gd.gen-ai.global-unsupported-model.description",
|
|
@@ -7,7 +7,12 @@ import { type GenAiStoreProps } from "./GenAiStore.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export type GenAIStandaloneInputProps = Omit<GenAiStoreProps, "children"> & {
|
|
9
9
|
/**
|
|
10
|
-
* Placeholder text for the input.
|
|
10
|
+
* Placeholder text for the input. Defaults to the bundled localized placeholder when omitted.
|
|
11
|
+
* The supplied text is used as-is and is not translated. Takes precedence over `placeholder`.
|
|
12
|
+
*/
|
|
13
|
+
inputPlaceholder?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Alias for `inputPlaceholder`. Used when `inputPlaceholder` is not provided.
|
|
11
16
|
*/
|
|
12
17
|
placeholder?: string;
|
|
13
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIStandaloneInput.d.ts","sourceRoot":"","sources":["../../src/components/GenAIStandaloneInput.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMlF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAYnE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/E;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,SAAS,C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OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AA0GF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAcpE"}
|
|
@@ -22,7 +22,7 @@ const msgs = defineMessages({
|
|
|
22
22
|
id: "gd.gen-ai.input-placeholder",
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
-
function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className, canManage, canAnalyze, placeholder, autofocus = true, requiredSkills, }) {
|
|
25
|
+
function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className, canManage, canAnalyze, inputPlaceholder, placeholder, autofocus = true, requiredSkills, }) {
|
|
26
26
|
const intl = useIntl();
|
|
27
27
|
const [value, setValue] = useState("");
|
|
28
28
|
const [editorApi, setApi] = useState(null);
|
|
@@ -70,7 +70,7 @@ function StandaloneInputContent({ onStart, onAgentSet, onAgentsLoaded, className
|
|
|
70
70
|
"gd-gen-ai-chat__input--fullscreen": isFullscreen,
|
|
71
71
|
"gd-gen-ai-chat__input--big-screen": isBigScreen,
|
|
72
72
|
"gd-gen-ai-chat__input--small-screen": isSmallScreen,
|
|
73
|
-
}), children: _jsx("div", { className: "gd-gen-ai-chat__input__content", children: _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(DefaultSyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: placeholder ?? intl.formatMessage(msgs.placeholder), value: value, onApi: setApi, onChange: setValue, onKeyDown: handleKeyDown, beforeExtensions: beforeExtensions, extensions: extensions, onCompletion: onCompletion }) }), _jsx(GenAiChatAgentSwitching, { agentsOverride: agents, disabled: !value.trim(), agentDropdownDisabled: false, isAssistantLoading: false, isConversationsLoading: false, handleSubmit: handleSubmit })] }) }) }));
|
|
73
|
+
}), children: _jsx("div", { className: "gd-gen-ai-chat__input__content", children: _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(DefaultSyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: inputPlaceholder ?? placeholder ?? intl.formatMessage(msgs.placeholder), value: value, onApi: setApi, onChange: setValue, onKeyDown: handleKeyDown, beforeExtensions: beforeExtensions, extensions: extensions, onCompletion: onCompletion }) }), _jsx(GenAiChatAgentSwitching, { agentsOverride: agents, disabled: !value.trim(), agentDropdownDisabled: false, isAssistantLoading: false, isConversationsLoading: false, handleSubmit: handleSubmit })] }) }) }));
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* @internal
|
|
@@ -49,5 +49,5 @@ function GenAIConversationsContent(props) {
|
|
|
49
49
|
dispatch(setCurrentConversationAction({ conversation }));
|
|
50
50
|
onConversationSelect(conversation);
|
|
51
51
|
}, [dispatch, onConversationSelect]);
|
|
52
|
-
return (_jsx(ConfigProvider, { catalogItems: catalogItems, allowNativeLinks: false, canFullControl: false, canManage: false, canAnalyze: false, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(OverlayAlignOnParentScrollProvider, { children: _jsx(GenAIChatConversations, { wrapper: _jsx("div", { className: classNames }), onSelect: onSelectConversation }) }) }) }));
|
|
52
|
+
return (_jsx(ConfigProvider, { catalogItems: catalogItems, allowNativeLinks: false, canFullControl: false, canManage: false, canAnalyze: false, canCreateDocument: false, children: _jsx(CustomizationProvider, { slots: slots, children: _jsx(OverlayAlignOnParentScrollProvider, { children: _jsx(GenAIChatConversations, { wrapper: _jsx("div", { className: classNames }), onSelect: onSelectConversation }) }) }) }));
|
|
53
53
|
}
|
|
@@ -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;
|
|
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;AAiCpG,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;AAqKF,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,aAAa,CAAkB,CAAC"}
|
package/esm/components/Input.js
CHANGED
|
@@ -13,6 +13,7 @@ import { newMessageAction } from "../store/messages/messagesSlice.js";
|
|
|
13
13
|
import { isClarificationQuestionsItem } from "../utils.js";
|
|
14
14
|
import { collectReferences } from "./completion/references.js";
|
|
15
15
|
import { useCompletion } from "./completion/useCompletion.js";
|
|
16
|
+
import { useConfig } from "./ConfigContext.js";
|
|
16
17
|
import { GenAiChatAgentSwitching } from "./GenAiChatAgentSwitching.js";
|
|
17
18
|
import { GenAiChatContextChooser } from "./GenAiChatContextChooser.js";
|
|
18
19
|
import { GenAIChatContextIndicator } from "./GenAIChatContextIndicator.js";
|
|
@@ -33,6 +34,7 @@ const isMac = typeof navigator !== "undefined" &&
|
|
|
33
34
|
function InputComponent({ autofocus = false, canManage, canAnalyze, targetRef }) {
|
|
34
35
|
const intl = useIntl();
|
|
35
36
|
const dispatch = useDispatch();
|
|
37
|
+
const { inputPlaceholder } = useConfig();
|
|
36
38
|
const { isBigScreen, isSmallScreen, isFullscreen } = useFullscreenCheck();
|
|
37
39
|
const conversationsLoaded = useSelector((state) => conversationsLoadedSelector(state));
|
|
38
40
|
const items = useSelector((state) => conversationMessagesSelector(state));
|
|
@@ -105,7 +107,7 @@ function InputComponent({ autofocus = false, canManage, canAnalyze, targetRef })
|
|
|
105
107
|
"gd-gen-ai-chat__input--small-screen": isSmallScreen,
|
|
106
108
|
"gd-gen-ai-chat__input--empty": isEmpty,
|
|
107
109
|
"gd-gen-ai-chat__input--no-agents": hasNoAgents,
|
|
108
|
-
}), children: _jsxs("div", { className: "gd-gen-ai-chat__input__content", children: [_jsx(HintText, { focused: focused, where: "top" }), _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__context", onMouseDown: handleContextMouseDown, children: _jsx(GenAIChatContextIndicator, { onUpdate: handleOnFocus }) }), _jsx("div", { ref: targetRef, onFocus: handleOnFocus }), _jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(DefaultSyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: intl.formatMessage(msgs.placeholder), label: intl.formatMessage(msgs.label), value: value, autocompletion: {
|
|
110
|
+
}), children: _jsxs("div", { className: "gd-gen-ai-chat__input__content", children: [_jsx(HintText, { focused: focused, where: "top" }), _jsxs("div", { className: "gd-gen-ai-chat__input__container", children: [_jsx("div", { className: "gd-gen-ai-chat__input__context", onMouseDown: handleContextMouseDown, children: _jsx(GenAIChatContextIndicator, { onUpdate: handleOnFocus }) }), _jsx("div", { ref: targetRef, onFocus: handleOnFocus }), _jsx("div", { className: "gd-gen-ai-chat__input__text", ...ref, children: _jsx(DefaultSyntaxHighlightingInput, { className: "gd-gen-ai-chat__input__mc", placeholder: inputPlaceholder ?? intl.formatMessage(msgs.placeholder), label: intl.formatMessage(msgs.label), value: value, autocompletion: {
|
|
109
111
|
aboveCursor: true,
|
|
110
112
|
whenTyping: true,
|
|
111
113
|
whenTypingDelay: 300,
|
|
@@ -189,6 +189,28 @@ export type IGenAIAssistantMessageReasoningContentProps = {
|
|
|
189
189
|
* The objects to render as links in the reasoning.
|
|
190
190
|
*/
|
|
191
191
|
objects: TextContentObject[];
|
|
192
|
+
/**
|
|
193
|
+
* Reasoning-group duration in milliseconds, matching the reasoning header. Calculated from
|
|
194
|
+
* the last message timestamps of this group and the preceding group, including grouped tool
|
|
195
|
+
* activity but excluding answer generation. Available during streaming and after reloading
|
|
196
|
+
* conversation history; undefined when the required group timestamps are unavailable.
|
|
197
|
+
*/
|
|
198
|
+
durationMs?: number;
|
|
199
|
+
/**
|
|
200
|
+
* The user-selected agent recorded for this message, not an internally routed sub-agent.
|
|
201
|
+
* Undefined when the message does not carry an agent ID; independent of the conversation's
|
|
202
|
+
* current agent selection.
|
|
203
|
+
*/
|
|
204
|
+
agent?: {
|
|
205
|
+
/**
|
|
206
|
+
* The agent ID recorded on the message.
|
|
207
|
+
*/
|
|
208
|
+
id: string;
|
|
209
|
+
/**
|
|
210
|
+
* The agent's current display name, resolved from the loaded agent list when available.
|
|
211
|
+
*/
|
|
212
|
+
name?: string;
|
|
213
|
+
};
|
|
192
214
|
/**
|
|
193
215
|
* Whether the message is still loading.
|
|
194
216
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/customized/types.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACH,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK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U,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC,CAAC;IAEnF;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC,CAAC;CAC9E"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/customized/types.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACH,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EACvC,KAAK,WAAW,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACH,KAAK,UAAU,EACf,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EACxC,KAAK,iBAAiB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,MA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gBAAgB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC,CAAC;IAEnF;;;OAGG;IACH,kBAAkB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC,CAAC;IAEvF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,uCAAuC,CAAC,CAAC,CAAC;IAEzF;;;OAGG;IACH,uBAAuB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAEjG;;;OAGG;IACH,uBAAuB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,2CAA2C,CAAC,CAAC,CAAC;IAEjG;;;OAGG;IACH,gCAAgC,CAAC,EAAE,aAAa,CAC5C,UAAU,CAAC,oDAAoD,CAAC,CACnE,CAAC;IAEF;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAErF;;;OAGG;IACH,sBAAsB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAE/F;;;OAGG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAEjF;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC,CAAC;IAEnF;;;OAGG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC,CAAC;CAC9E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type IAiAssistantAppEvent } from "@gooddata/sdk-pluggable-application-model";
|
|
2
|
+
import { dashboardSavedAction, publisherDocumentSavedAction } from "../../store/messages/messagesSlice.js";
|
|
3
|
+
/**
|
|
4
|
+
* An application event delivered to the chat. `seq` grows with every delivery, so the same event sent
|
|
5
|
+
* again is acted on again and the chat knows which deliveries it has seen.
|
|
6
|
+
*/
|
|
7
|
+
export interface ISequencedAppEvent {
|
|
8
|
+
seq: number;
|
|
9
|
+
event: IAiAssistantAppEvent;
|
|
10
|
+
}
|
|
11
|
+
type AppEventAction = ReturnType<typeof publisherDocumentSavedAction> | ReturnType<typeof dashboardSavedAction>;
|
|
12
|
+
/**
|
|
13
|
+
* Tells the chat store about the events of the application the chat runs beside, once per delivery
|
|
14
|
+
* and in delivery order. Events the chat does not know are ignored.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAppEventSync(dispatch: ((action: AppEventAction) => void) | null, appEvents: ReadonlyArray<ISequencedAppEvent>): void;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useAppEventSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAppEventSync.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useAppEventSync.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,oBAAoB,EAG5B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE3G;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,oBAAoB,CAAC;CAC/B;AAED,KAAK,cAAc,GACb,UAAU,CAAC,OAAO,4BAA4B,CAAC,GAC/C,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAY9C;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,IAAI,EACnD,SAAS,EAAE,aAAa,CAAC,kBAAkB,CAAC,QAmB/C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { isAiAssistantDashboardSavedAppEvent, isAiAssistantPublisherDocumentSavedAppEvent, } from "@gooddata/sdk-pluggable-application-model";
|
|
4
|
+
import { dashboardSavedAction, publisherDocumentSavedAction } from "../../store/messages/messagesSlice.js";
|
|
5
|
+
function toAction(event) {
|
|
6
|
+
if (isAiAssistantPublisherDocumentSavedAppEvent(event)) {
|
|
7
|
+
return publisherDocumentSavedAction(event.payload);
|
|
8
|
+
}
|
|
9
|
+
if (isAiAssistantDashboardSavedAppEvent(event)) {
|
|
10
|
+
return dashboardSavedAction(event.payload);
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tells the chat store about the events of the application the chat runs beside, once per delivery
|
|
16
|
+
* and in delivery order. Events the chat does not know are ignored.
|
|
17
|
+
*/
|
|
18
|
+
export function useAppEventSync(dispatch, appEvents) {
|
|
19
|
+
const lastSeq = useRef(0);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!dispatch) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
for (const { seq, event } of appEvents) {
|
|
25
|
+
if (seq <= lastSeq.current) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
lastSeq.current = seq;
|
|
29
|
+
const action = toAction(event);
|
|
30
|
+
if (action) {
|
|
31
|
+
dispatch(action);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, [dispatch, appEvents]);
|
|
35
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type MouseEvent } from "react";
|
|
2
|
-
|
|
3
|
-
export declare function useSettingsClick(settings: ISettings | undefined): (type: "change-model" | "create") => (e: MouseEvent) => void;
|
|
2
|
+
export declare function useSettingsClick(): (type: "change-model" | "create") => (e: MouseEvent) => void;
|
|
4
3
|
//# sourceMappingURL=useSettingsClick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSettingsClick.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSettingsClick.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSettingsClick.d.ts","sourceRoot":"","sources":["../../../src/components/hooks/useSettingsClick.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,OAAO,CAAC;AAgBrD,wBAAgB,gBAAgB,WAKjB,cAAc,GAAG,QAAQ,SAAS,UAAU,UAmD1D"}
|