@gooddata/sdk-ui-pluggable-host 11.61.0 → 11.62.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/HostUiContainer.d.ts.map +1 -1
- package/esm/components/HostUiContainer.js +7 -7
- package/esm/platformContext/backend.d.ts +1 -0
- package/esm/platformContext/backend.d.ts.map +1 -1
- package/esm/platformContext/backend.js +24 -2
- package/esm/ui/GenAIChat.d.ts +4 -4
- package/esm/ui/GenAIChat.d.ts.map +1 -1
- package/esm/ui/GenAIChat.js +2 -2
- package/esm/ui/HostChat.d.ts +4 -4
- package/esm/ui/HostChat.d.ts.map +1 -1
- package/esm/ui/HostChat.js +2 -2
- package/esm/ui/PluggableApplicationRenderer.d.ts +5 -5
- package/esm/ui/PluggableApplicationRenderer.d.ts.map +1 -1
- package/esm/ui/PluggableApplicationRenderer.js +8 -8
- package/esm/ui/useHostChromeChat.d.ts +4 -4
- package/esm/ui/useHostChromeChat.d.ts.map +1 -1
- package/esm/ui/useHostChromeChat.js +2 -2
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostUiContainer.d.ts","sourceRoot":"","sources":["../../src/components/HostUiContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA0B,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAGH,KAAK,gBAAgB,EAExB,MAAM,2CAA2C,CAAC;AAkBnD,OAAO,wBAAwB,CAAC;AAOhC,MAAM,WAAW,qBAAqB;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gCAAgC,EAAE,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"HostUiContainer.d.ts","sourceRoot":"","sources":["../../src/components/HostUiContainer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAA0B,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAGH,KAAK,gBAAgB,EAExB,MAAM,2CAA2C,CAAC;AAkBnD,OAAO,wBAAwB,CAAC;AAOhC,MAAM,WAAW,qBAAqB;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,gCAAgC,EAAE,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,gBAAgB,CAAC;IACjC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,qBAAqB,2CAkXtG"}
|
|
@@ -70,10 +70,10 @@ export function HostUiContainer({ ctx, apps, pathname, routerNavigate, onError }
|
|
|
70
70
|
const [aiVisibility, setAiVisibility] = useState(null);
|
|
71
71
|
const [aiContext, setAiContext] = useState(null);
|
|
72
72
|
const aiVisibilitySeqRef = useRef(0);
|
|
73
|
-
const [
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
73
|
+
const [aiPublisherDocumentSaved, setAiPublisherDocumentSaved] = useState(undefined);
|
|
74
|
+
const aiPublisherDocumentSavedSeqRef = useRef(0);
|
|
75
|
+
const reportAiAssistantPublisherDocumentSaved = useCallback((saved) => {
|
|
76
|
+
setAiPublisherDocumentSaved({ ...saved, seq: ++aiPublisherDocumentSavedSeqRef.current });
|
|
77
77
|
}, []);
|
|
78
78
|
const requestOpenAi = useCallback((question, agentId, userContext, appendToChat, replaceUserContext) => {
|
|
79
79
|
setAiVisibility({
|
|
@@ -254,7 +254,7 @@ export function HostUiContainer({ ctx, apps, pathname, routerNavigate, onError }
|
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
256
|
if (activeInternalApplication) {
|
|
257
|
-
appRootRef.current.render(_jsx(HostErrorBoundary, { resetKey: pathname, onError: reportError, locale: resolveLocale(ctx.preferredLocale), children: _jsx(HostIntlProvider, { locale: resolveLocale(ctx.preferredLocale), children: _jsx(PluggableApplicationRenderer, { app: activeInternalApplication, ctx: ctx, pathname: pathname, aiAssistantOpen: aiAssistantOpen, onOpenAiAssistant: requestOpenAi, onCloseAiAssistant: requestCloseAi, onAiAssistantContext: setAiAssistantContext,
|
|
257
|
+
appRootRef.current.render(_jsx(HostErrorBoundary, { resetKey: pathname, onError: reportError, locale: resolveLocale(ctx.preferredLocale), children: _jsx(HostIntlProvider, { locale: resolveLocale(ctx.preferredLocale), children: _jsx(PluggableApplicationRenderer, { app: activeInternalApplication, ctx: ctx, pathname: pathname, aiAssistantOpen: aiAssistantOpen, onOpenAiAssistant: requestOpenAi, onCloseAiAssistant: requestCloseAi, onAiAssistantContext: setAiAssistantContext, onAiAssistantPublisherDocumentSaved: reportAiAssistantPublisherDocumentSaved, aiLinkClickHandlerRef: appAiLinkClickRef, navigationRequestRef: appNavigationRequestRef, aiEventReceiveRef: appEventReceiveRef, onHeaderChange: onHeaderChange, onDocumentTitleChange: onDocumentTitleChange }, activeInternalApplication.id) }) }, `${activeInternalApplication.id}:${appContextEpoch}`));
|
|
258
258
|
}
|
|
259
259
|
else {
|
|
260
260
|
appRootRef.current.render(null);
|
|
@@ -272,7 +272,7 @@ export function HostUiContainer({ ctx, apps, pathname, routerNavigate, onError }
|
|
|
272
272
|
requestOpenAi,
|
|
273
273
|
requestCloseAi,
|
|
274
274
|
setAiAssistantContext,
|
|
275
|
-
|
|
275
|
+
reportAiAssistantPublisherDocumentSaved,
|
|
276
276
|
]);
|
|
277
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: containerRef, className: "gd-host-ui-container" }), hostReady && !ctx.isExportMode ? (_jsx(HostChat, { ctx: ctx, resolvedApplications: apps, pathname: pathname, activeAppId: activeInternalApplication?.id, visibility: aiVisibility, context: aiContext,
|
|
277
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: containerRef, className: "gd-host-ui-container" }), hostReady && !ctx.isExportMode ? (_jsx(HostChat, { ctx: ctx, resolvedApplications: apps, pathname: pathname, activeAppId: activeInternalApplication?.id, visibility: aiVisibility, context: aiContext, publisherDocumentSaved: aiPublisherDocumentSaved, onOpenChange: setAiAssistantOpen, onChatStateChange: onChatStateChange, onAppLinkClick: onAppLinkClick, onAppEventReceive: onAppEventReceive })) : null] }));
|
|
278
278
|
}
|
|
@@ -22,6 +22,7 @@ export interface IBackendFactory {
|
|
|
22
22
|
setApiToken: (token: string) => void;
|
|
23
23
|
setJwt: (jwt: string, secondsBeforeTokenExpirationToCallReminder?: number) => void;
|
|
24
24
|
}
|
|
25
|
+
export declare const wrapWithCustomWorkspaceSettings: (backend: IAnalyticalBackend) => IAnalyticalBackend;
|
|
25
26
|
export declare function createBackendFactory(options?: ICreateBackendOptions): IBackendFactory;
|
|
26
27
|
/**
|
|
27
28
|
* Sets the package name reported to the backend for telemetry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/platformContext/backend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/platformContext/backend.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAUlG,OAAO,EAAE,KAAK,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RecommendedCachingConfiguration, withCaching } from "@gooddata/sdk-backend-base";
|
|
2
|
+
import { RecommendedCachingConfiguration, withCaching, withCustomWorkspaceSettings, } from "@gooddata/sdk-backend-base";
|
|
3
3
|
import { ContextDeferredAuthProvider, TigerJwtAuthProvider, TigerTokenAuthProvider, tigerFactory, } from "@gooddata/sdk-backend-tiger";
|
|
4
4
|
import { notifyContractExpired } from "./contractExpired.js";
|
|
5
5
|
import { createNotAuthenticatedHandler } from "./tigerNotAuthenticatedHandler.js";
|
|
6
|
+
/**
|
|
7
|
+
* E2E tests set `window.customWorkspaceSettings` before the page loads. They win over the
|
|
8
|
+
* workspace settings from the backend, so `ctx.settings`, `ctx.workspaceSettings` and the host
|
|
9
|
+
* UI (for example the AI chat) see the same values as the pluggable applications.
|
|
10
|
+
*/
|
|
11
|
+
const getCustomWorkspaceSettings = () => {
|
|
12
|
+
if (typeof window === "undefined") {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return window.customWorkspaceSettings;
|
|
16
|
+
};
|
|
17
|
+
export const wrapWithCustomWorkspaceSettings = (backend) => {
|
|
18
|
+
if (!getCustomWorkspaceSettings()) {
|
|
19
|
+
return backend;
|
|
20
|
+
}
|
|
21
|
+
return withCustomWorkspaceSettings(backend, {
|
|
22
|
+
commonSettingsWrapper: (originalSettings) => ({
|
|
23
|
+
...originalSettings,
|
|
24
|
+
...getCustomWorkspaceSettings(),
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
};
|
|
6
28
|
const decorateBackend = (backend) => {
|
|
7
|
-
return withCaching(backend, RecommendedCachingConfiguration);
|
|
29
|
+
return withCaching(wrapWithCustomWorkspaceSettings(backend), RecommendedCachingConfiguration);
|
|
8
30
|
};
|
|
9
31
|
const EMBEDDED_PATH_PREFIX = "/embedded/";
|
|
10
32
|
const EXTERNAL_PROVIDER_ID_PARAM = "externalproviderid";
|
package/esm/ui/GenAIChat.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IUserWorkspaceSettings } from "@gooddata/sdk-backend-spi";
|
|
2
2
|
import type { IGenAIUserContext } from "@gooddata/sdk-model";
|
|
3
3
|
import { type ChatDefinitionReceivedEvent, type ChatAssistantMessageEvent, type ChatClosedEvent, type ChatFeedbackEvent, type ChatOpenedEvent, type ChatResetEvent, type ChatUserMessageEvent, type ChatModeChangeEvent } from "@gooddata/sdk-ui-gen-ai";
|
|
4
|
-
import { type
|
|
4
|
+
import { type IPublisherDocumentSaved } from "@gooddata/sdk-ui-gen-ai/internal";
|
|
5
5
|
/**
|
|
6
6
|
* Discriminated union of GenAI chat events that are forwarded to the host
|
|
7
7
|
* caller via the `onEvent` callback.
|
|
@@ -74,8 +74,8 @@ export interface IGenAIChatProps {
|
|
|
74
74
|
* Whether the ambient user context is currently loading.
|
|
75
75
|
*/
|
|
76
76
|
ambientUserContextLoading?: boolean;
|
|
77
|
-
/** The latest
|
|
78
|
-
|
|
77
|
+
/** The latest document of the conversation that the active application saved. */
|
|
78
|
+
publisherDocumentSaved: IPublisherDocumentSaved | undefined;
|
|
79
79
|
/**
|
|
80
80
|
* Tag identifiers the assistant's object search/autocomplete should be restricted to,
|
|
81
81
|
* reflecting the active hosted application's current view.
|
|
@@ -108,5 +108,5 @@ export interface IGenAIChatProps {
|
|
|
108
108
|
* (`@gooddata/sdk-ui-gen-ai/internal`); this adapter only supplies the host's data sources, renders the
|
|
109
109
|
* host's own save-visualization / copy toasts, and forwards telemetry events through `onEvent`.
|
|
110
110
|
*/
|
|
111
|
-
export declare function GenAIChat({ workspaceId, open, disabled, onOpen, onClose, askedQuestion, askSeq, appendToChat, agentId, userContext, replaceUserContext, ambientUserContext, ambientUserContextLoading,
|
|
111
|
+
export declare function GenAIChat({ workspaceId, open, disabled, onOpen, onClose, askedQuestion, askSeq, appendToChat, agentId, userContext, replaceUserContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, includeTags, excludeTags, canManageProject, canAnalyzeProject, canFullControl, settings, dialogPosition, embedded, onAppLinkClick, onEvent, }: IGenAIChatProps): import("react/jsx-runtime").JSX.Element;
|
|
112
112
|
//# sourceMappingURL=GenAIChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/ui/GenAIChat.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGH,KAAK,
|
|
1
|
+
{"version":3,"file":"GenAIChat.d.ts","sourceRoot":"","sources":["../../src/ui/GenAIChat.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EACH,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGH,KAAK,uBAAuB,EAC/B,MAAM,kCAAkC,CAAC;AAY1C;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GACpB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,GACjD;IAAE,IAAI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,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC;IACvG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACtB,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,aAAa,EACb,MAAM,EACN,YAAY,EACZ,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAc,EACd,OAAO,GACV,EAAE,eAAe,2CAsGjB"}
|
package/esm/ui/GenAIChat.js
CHANGED
|
@@ -18,7 +18,7 @@ const EMBEDDED_CHAT_CLASS = "gd-gen-ai-chat-embedded";
|
|
|
18
18
|
* (`@gooddata/sdk-ui-gen-ai/internal`); this adapter only supplies the host's data sources, renders the
|
|
19
19
|
* host's own save-visualization / copy toasts, and forwards telemetry events through `onEvent`.
|
|
20
20
|
*/
|
|
21
|
-
export function GenAIChat({ workspaceId, open, disabled, onOpen, onClose, askedQuestion, askSeq, appendToChat, agentId, userContext, replaceUserContext, ambientUserContext, ambientUserContextLoading,
|
|
21
|
+
export function GenAIChat({ workspaceId, open, disabled, onOpen, onClose, askedQuestion, askSeq, appendToChat, agentId, userContext, replaceUserContext, ambientUserContext, ambientUserContextLoading, publisherDocumentSaved, includeTags, excludeTags, canManageProject, canAnalyzeProject, canFullControl, settings, dialogPosition, embedded, onAppLinkClick, onEvent, }) {
|
|
22
22
|
const { addSuccess, addError } = useToastMessage();
|
|
23
23
|
const intl = useIntl();
|
|
24
24
|
const backend = useBackendStrict();
|
|
@@ -74,5 +74,5 @@ export function GenAIChat({ workspaceId, open, disabled, onOpen, onClose, askedQ
|
|
|
74
74
|
}
|
|
75
75
|
}, [addError, addSuccess, intl, onEvent]);
|
|
76
76
|
const enableRightPanel = useGenAiRightPanel(settings?.["enableGenAiRightPanel"], embedded);
|
|
77
|
-
return (_jsx(GenAIChatDialogConnected, { backend: backend, workspace: workspaceId, locale: intl.locale, isOpen: open, isDisabled: disabled, onOpen: onOpen, onClose: onClose, askedQuestion: askedQuestion, askSeq: askSeq, userContext: userContext, appendToChat: appendToChat, agentId: agentId, replaceUserContext: replaceUserContext, ambientUserContext: ambientUserContext,
|
|
77
|
+
return (_jsx(GenAIChatDialogConnected, { backend: backend, workspace: workspaceId, locale: intl.locale, isOpen: open, isDisabled: disabled, onOpen: onOpen, onClose: onClose, askedQuestion: askedQuestion, askSeq: askSeq, userContext: userContext, appendToChat: appendToChat, agentId: agentId, replaceUserContext: replaceUserContext, ambientUserContext: ambientUserContext, publisherDocumentSaved: publisherDocumentSaved, ambientUserContextLoading: ambientUserContextLoading, includeTags: includeTags, excludeTags: excludeTags, canManage: canManageProject, canAnalyze: canAnalyzeProject, canFullControl: canFullControl, settings: settings, dialogPosition: dialogPosition, className: embedded ? EMBEDDED_CHAT_CLASS : undefined, allowNativeLinks: false, onLinkClick: onLinkClick, onEvent: handleEvent, displayMode: enableRightPanel ? "inline" : "modal", returnFocusTo: embedded ? EMBEDDED_AI_TRIGGER_ID : HEADER_CHAT_BUTTON_ID }));
|
|
78
78
|
}
|
package/esm/ui/HostChat.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IGenAIUserContext, type PluggableApplicationRegistryItem } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model";
|
|
3
3
|
import { GenAIAssistantMode } from "@gooddata/sdk-ui-gen-ai";
|
|
4
|
-
import { type
|
|
4
|
+
import { type IPublisherDocumentSaved } from "@gooddata/sdk-ui-gen-ai/internal";
|
|
5
5
|
import { GenAIChatEvent } from "./GenAIChat.js";
|
|
6
6
|
import "./HostChat.scss";
|
|
7
7
|
import "@gooddata/sdk-ui-gen-ai/styles/css/main.css";
|
|
@@ -69,8 +69,8 @@ export interface IHostChatProps {
|
|
|
69
69
|
* Delegates a chat event receive to the active application.
|
|
70
70
|
*/
|
|
71
71
|
onAppEventReceive?: (event: GenAIChatEvent) => void;
|
|
72
|
-
/** The latest
|
|
73
|
-
|
|
72
|
+
/** The latest document of the conversation that the active application saved. */
|
|
73
|
+
publisherDocumentSaved: IPublisherDocumentSaved | undefined;
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Owns and renders the host's single GenAI chat, decoupled from the host UI module.
|
|
@@ -81,5 +81,5 @@ export interface IHostChatProps {
|
|
|
81
81
|
* (embedded/export). The header chat button and app-side controls drive it through the `visibility`
|
|
82
82
|
* and `context` props; it reports its open-state and button state back via callbacks.
|
|
83
83
|
*/
|
|
84
|
-
export declare function HostChat({ ctx, resolvedApplications, pathname, activeAppId, visibility, context, onOpenChange, onChatStateChange, onAppLinkClick, onAppEventReceive,
|
|
84
|
+
export declare function HostChat({ ctx, resolvedApplications, pathname, activeAppId, visibility, context, onOpenChange, onChatStateChange, onAppLinkClick, onAppEventReceive, publisherDocumentSaved, }: IHostChatProps): import("react/jsx-runtime").JSX.Element;
|
|
85
85
|
//# sourceMappingURL=HostChat.d.ts.map
|
package/esm/ui/HostChat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostChat.d.ts","sourceRoot":"","sources":["../../src/ui/HostChat.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"HostChat.d.ts","sourceRoot":"","sources":["../../src/ui/HostChat.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAMhF,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,iBAAiB,CAAC;AACzB,OAAO,6CAA6C,CAAC;AAMrD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;CACf;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,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,QAAQ,CAAC,EACrB,GAAG,EACH,oBAAoB,EACpB,QAAQ,EACR,WAAW,EACX,UAAiB,EACjB,OAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,GACzB,EAAE,cAAc,2CAmIhB"}
|
package/esm/ui/HostChat.js
CHANGED
|
@@ -21,7 +21,7 @@ import { useHostChromeWorkspaceFeatures } from "./useHostChromeWorkspaceFeatures
|
|
|
21
21
|
* (embedded/export). The header chat button and app-side controls drive it through the `visibility`
|
|
22
22
|
* and `context` props; it reports its open-state and button state back via callbacks.
|
|
23
23
|
*/
|
|
24
|
-
export function HostChat({ ctx, resolvedApplications, pathname, activeAppId, visibility = null, context = null, onOpenChange, onChatStateChange, onAppLinkClick, onAppEventReceive,
|
|
24
|
+
export function HostChat({ ctx, resolvedApplications, pathname, activeAppId, visibility = null, context = null, onOpenChange, onChatStateChange, onAppLinkClick, onAppEventReceive, publisherDocumentSaved, }) {
|
|
25
25
|
const features = useHostChromeWorkspaceFeatures(resolvedApplications, ctx, pathname);
|
|
26
26
|
const shellTelemetry = useMemo(() => getAppLifecycleCallbacks()?.createTelemetryCallbacks?.("host-ui"), []);
|
|
27
27
|
const chat = useHostChromeChat({
|
|
@@ -33,7 +33,7 @@ export function HostChat({ ctx, resolvedApplications, pathname, activeAppId, vis
|
|
|
33
33
|
disabled: context?.disabled,
|
|
34
34
|
onAppLinkClick,
|
|
35
35
|
onAppEventReceive,
|
|
36
|
-
|
|
36
|
+
publisherDocumentSaved,
|
|
37
37
|
});
|
|
38
38
|
const { askAiAssistant: chatAskAiAssistant, openAiAssistant: chatOpenAiAssistant, open: chatOpen, close: chatClose, toggle: chatToggle, setTags: chatSetTags, setAmbientUserContext: chatSetAmbientUserContext, setAmbientUserContextLoading: chatSetAmbientUserContextLoading, isOpen: chatIsOpen, showChatItem, } = chat;
|
|
39
39
|
// Report the chat open-state outward so the runtime can forward it to the active pluggable
|
|
@@ -23,12 +23,12 @@ export interface IPluggableApplicationRendererProps {
|
|
|
23
23
|
userContext?: IGenAIUserContext;
|
|
24
24
|
userContextLoading?: boolean;
|
|
25
25
|
}) => void;
|
|
26
|
-
/** Tell the host-owned chat that the active app saved a
|
|
27
|
-
|
|
26
|
+
/** Tell the host-owned chat that the active app saved a document the chat had drafted. */
|
|
27
|
+
onAiAssistantPublisherDocumentSaved?: (saved: {
|
|
28
28
|
conversationId: string;
|
|
29
29
|
itemId: string;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
documentRef?: string;
|
|
31
|
+
savedDocumentId: string;
|
|
32
32
|
}) => void;
|
|
33
33
|
/**
|
|
34
34
|
* Ref the renderer populates with a handler that delegates a host-chat link click to the active
|
|
@@ -54,5 +54,5 @@ export interface IPluggableApplicationRendererProps {
|
|
|
54
54
|
onHeaderChange?: (appId: string, header: IAppHeaderOptions) => void;
|
|
55
55
|
onDocumentTitleChange?: (appId: string, pageTitle: string | undefined) => void;
|
|
56
56
|
}
|
|
57
|
-
export declare function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOpen, onOpenAiAssistant, onCloseAiAssistant, onAiAssistantContext,
|
|
57
|
+
export declare function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOpen, onOpenAiAssistant, onCloseAiAssistant, onAiAssistantContext, onAiAssistantPublisherDocumentSaved, aiLinkClickHandlerRef, aiEventReceiveRef, navigationRequestRef, onHeaderChange, onDocumentTitleChange, }: IPluggableApplicationRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
58
58
|
//# sourceMappingURL=PluggableApplicationRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluggableApplicationRenderer.d.ts","sourceRoot":"","sources":["../../src/ui/PluggableApplicationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAsE,MAAM,OAAO,CAAC;AAI3G,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gCAAgC,EAAE,MAAM,qBAA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K,IAAI,CAAC;IACX;;;OAGG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAC7B,CAAC,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,SAAS,CACtG,CAAC;IACF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAC7E;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IAC7F,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACpE,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAClF;AAED,wBAAgB,4BAA4B,CAAC,EACzC,GAAG,EACH,GAAG,EACH,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mCAAmC,EACnC,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,GACxB,EAAE,kCAAkC,2CAwUpC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { FormattedMessage, defineMessage, useIntl } from "react-intl";
|
|
5
|
-
import { isAiAssistantContextChangedEvent,
|
|
5
|
+
import { isAiAssistantContextChangedEvent, isAiAssistantPublisherDocumentSavedEvent, isCloseAiAssistantRequestedEvent, isDocumentTitleChangedEvent, isOpenAiAssistantRequestedEvent, isReloadPlatformContextRequestedEvent, } from "@gooddata/sdk-pluggable-application-model";
|
|
6
6
|
import { LoadingComponent, useAutoupdateRef } from "@gooddata/sdk-ui";
|
|
7
7
|
import { bemFactory } from "@gooddata/sdk-ui-kit";
|
|
8
8
|
import { now } from "../debug.js";
|
|
@@ -22,7 +22,7 @@ const SECURITY_FAILURE_MESSAGES = {
|
|
|
22
22
|
"build-expired": defineMessage({ id: "gs.host.error.appBuildExpired" }),
|
|
23
23
|
"metadata-missing": defineMessage({ id: "gs.host.error.appSecurityMetadataMissing" }),
|
|
24
24
|
};
|
|
25
|
-
export function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOpen, onOpenAiAssistant, onCloseAiAssistant, onAiAssistantContext,
|
|
25
|
+
export function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOpen, onOpenAiAssistant, onCloseAiAssistant, onAiAssistantContext, onAiAssistantPublisherDocumentSaved, aiLinkClickHandlerRef, aiEventReceiveRef, navigationRequestRef, onHeaderChange, onDocumentTitleChange, }) {
|
|
26
26
|
const intl = useIntl();
|
|
27
27
|
const intlRef = useAutoupdateRef(intl);
|
|
28
28
|
const ctxRef = useAutoupdateRef(ctx);
|
|
@@ -31,7 +31,7 @@ export function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOp
|
|
|
31
31
|
const onOpenAiAssistantRef = useAutoupdateRef(onOpenAiAssistant);
|
|
32
32
|
const onCloseAiAssistantRef = useAutoupdateRef(onCloseAiAssistant);
|
|
33
33
|
const onAiAssistantContextRef = useAutoupdateRef(onAiAssistantContext);
|
|
34
|
-
const
|
|
34
|
+
const onAiAssistantPublisherDocumentSavedRef = useAutoupdateRef(onAiAssistantPublisherDocumentSaved);
|
|
35
35
|
const containerRef = useRef(null);
|
|
36
36
|
const mountHandleRef = useRef(undefined);
|
|
37
37
|
// The app/module pair currently mounted. Held so the context-change effect can
|
|
@@ -74,12 +74,12 @@ export function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOp
|
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (isAiAssistantPublisherDocumentSavedEvent(event)) {
|
|
78
|
+
onAiAssistantPublisherDocumentSavedRef.current?.({
|
|
79
79
|
conversationId: event.payload.conversationId,
|
|
80
80
|
itemId: event.payload.itemId,
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
documentRef: event.payload.documentRef,
|
|
82
|
+
savedDocumentId: event.payload.savedDocumentId,
|
|
83
83
|
});
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
@@ -92,7 +92,7 @@ export function PluggableApplicationRenderer({ app, ctx, pathname, aiAssistantOp
|
|
|
92
92
|
onOpenAiAssistantRef,
|
|
93
93
|
onCloseAiAssistantRef,
|
|
94
94
|
onAiAssistantContextRef,
|
|
95
|
-
|
|
95
|
+
onAiAssistantPublisherDocumentSavedRef,
|
|
96
96
|
]);
|
|
97
97
|
useEffect(() => {
|
|
98
98
|
let cancelled = false;
|
|
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type IGenAIUserContext } from "@gooddata/sdk-model";
|
|
3
3
|
import { type IPlatformContext, type IPluggableAppTelemetryCallbacks } from "@gooddata/sdk-pluggable-application-model";
|
|
4
4
|
import { GenAIAssistantMode } from "@gooddata/sdk-ui-gen-ai";
|
|
5
|
-
import { type
|
|
5
|
+
import { type IPublisherDocumentSaved } from "@gooddata/sdk-ui-gen-ai/internal";
|
|
6
6
|
import { type GenAIChatEvent } from "./GenAIChat.js";
|
|
7
7
|
import { type IHostChromeWorkspaceFeatures } from "./useHostChromeWorkspaceFeatures.js";
|
|
8
8
|
export interface IHostChromeChat {
|
|
@@ -71,8 +71,8 @@ export interface IUseHostChromeChatArgs {
|
|
|
71
71
|
}) => boolean;
|
|
72
72
|
/** Delegates a chat event receive to the active app. */
|
|
73
73
|
onAppEventReceive?: (event: GenAIChatEvent) => void;
|
|
74
|
-
/** The latest
|
|
75
|
-
|
|
74
|
+
/** The latest document of the conversation that the active app saved. */
|
|
75
|
+
publisherDocumentSaved: IPublisherDocumentSaved | undefined;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Owns the GenAI chat state and renders the `<GenAIChat>` element for the host chrome.
|
|
@@ -81,5 +81,5 @@ export interface IUseHostChromeChatArgs {
|
|
|
81
81
|
* points, the runtime availability probe (`useGenAiChatAvailability`) and forwarding chat
|
|
82
82
|
* events to the host telemetry callbacks.
|
|
83
83
|
*/
|
|
84
|
-
export declare function useHostChromeChat({ features, ctx, telemetry, dialogPosition, embedded, disabled, onAppLinkClick, onAppEventReceive,
|
|
84
|
+
export declare function useHostChromeChat({ features, ctx, telemetry, dialogPosition, embedded, disabled, onAppLinkClick, onAppEventReceive, publisherDocumentSaved, }: IUseHostChromeChatArgs): IHostChromeChat;
|
|
85
85
|
//# sourceMappingURL=useHostChromeChat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHostChromeChat.d.ts","sourceRoot":"","sources":["../../src/ui/useHostChromeChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACvC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAA4B,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"useHostChromeChat.d.ts","sourceRoot":"","sources":["../../src/ui/useHostChromeChat.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,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iBAAiB,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,4BAA4B,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,4BAA4B,CAAC;IACvC,GAAG,EAAE,gBAAgB,CAAC;IACtB,SAAS,EAAE,+BAA+B,GAAG,SAAS,CAAC;IACvD,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC;IACvG,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACpD,yEAAyE;IACzE,sBAAsB,EAAE,uBAAuB,GAAG,SAAS,CAAC;CAC/D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAC9B,QAAQ,EACR,GAAG,EACH,SAAS,EACT,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,sBAAsB,GACzB,EAAE,sBAAsB,GAAG,eAAe,CAmI1C"}
|
|
@@ -11,7 +11,7 @@ import { GenAIChat } from "./GenAIChat.js";
|
|
|
11
11
|
* points, the runtime availability probe (`useGenAiChatAvailability`) and forwarding chat
|
|
12
12
|
* events to the host telemetry callbacks.
|
|
13
13
|
*/
|
|
14
|
-
export function useHostChromeChat({ features, ctx, telemetry, dialogPosition, embedded, disabled, onAppLinkClick, onAppEventReceive,
|
|
14
|
+
export function useHostChromeChat({ features, ctx, telemetry, dialogPosition, embedded, disabled, onAppLinkClick, onAppEventReceive, publisherDocumentSaved, }) {
|
|
15
15
|
const [isChatOpen, setIsChatOpen] = useState(false);
|
|
16
16
|
const [askedQuestion, setAskedQuestion] = useState(null);
|
|
17
17
|
const [appendToChat, setAppendToChat] = useState(false);
|
|
@@ -69,7 +69,7 @@ export function useHostChromeChat({ features, ctx, telemetry, dialogPosition, em
|
|
|
69
69
|
onAppEventReceive?.(event);
|
|
70
70
|
}, [telemetry, onAppEventReceive]);
|
|
71
71
|
const showChatItem = useGenAiChatAvailability(getBackend(), features.workspaceId, features.showChat, features.canManageProject);
|
|
72
|
-
const element = features.showChat && features.workspaceId ? (_jsx(GenAIChat, { workspaceId: features.workspaceId, open: isChatOpen, disabled: disabled, onOpen: open, onClose: close, askedQuestion: askedQuestion, appendToChat: appendToChat, agentId: agentId, replaceUserContext: replaceUserContext, askSeq: askSeq, userContext: userContext, ambientUserContext: ambientUserContext, ambientUserContextLoading: ambientUserContextLoading,
|
|
72
|
+
const element = features.showChat && features.workspaceId ? (_jsx(GenAIChat, { workspaceId: features.workspaceId, open: isChatOpen, disabled: disabled, onOpen: open, onClose: close, askedQuestion: askedQuestion, appendToChat: appendToChat, agentId: agentId, replaceUserContext: replaceUserContext, askSeq: askSeq, userContext: userContext, ambientUserContext: ambientUserContext, ambientUserContextLoading: ambientUserContextLoading, publisherDocumentSaved: publisherDocumentSaved, includeTags: includeTags, excludeTags: excludeTags, canManageProject: features.canManageProject, canAnalyzeProject: features.canAnalyzeWorkspace, canFullControl: features.canFullControl, settings: ctx.workspaceSettings, dialogPosition: dialogPosition, embedded: embedded, onAppLinkClick: onAppLinkClick, onEvent: handleChatEvent })) : null;
|
|
73
73
|
return {
|
|
74
74
|
element,
|
|
75
75
|
isOpen: isChatOpen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-pluggable-host",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.62.0-alpha.1",
|
|
4
4
|
"description": "GoodData SDK runtime for hosting pluggable applications — registry, loader, routing, platform context, default UI chrome",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@module-federation/runtime": "2.6.0",
|
|
31
31
|
"lodash-es": "^4.17.23",
|
|
32
|
-
"@gooddata/sdk-backend-
|
|
33
|
-
"@gooddata/sdk-
|
|
34
|
-
"@gooddata/sdk-
|
|
35
|
-
"@gooddata/sdk-backend-
|
|
36
|
-
"@gooddata/sdk-
|
|
37
|
-
"@gooddata/sdk-pluggable-application-model": "11.
|
|
38
|
-
"@gooddata/sdk-ui": "11.
|
|
39
|
-
"@gooddata/sdk-ui-ext": "11.
|
|
40
|
-
"@gooddata/sdk-ui-
|
|
41
|
-
"@gooddata/sdk-ui-
|
|
42
|
-
"@gooddata/sdk-ui-kit": "11.
|
|
43
|
-
"@gooddata/sdk-ui-semantic-search": "11.
|
|
44
|
-
"@gooddata/sdk-ui-theme-provider": "11.
|
|
45
|
-
"@gooddata/util": "11.
|
|
32
|
+
"@gooddata/sdk-backend-base": "11.62.0-alpha.1",
|
|
33
|
+
"@gooddata/sdk-backend-tiger": "11.62.0-alpha.1",
|
|
34
|
+
"@gooddata/sdk-embedding": "11.62.0-alpha.1",
|
|
35
|
+
"@gooddata/sdk-backend-spi": "11.62.0-alpha.1",
|
|
36
|
+
"@gooddata/sdk-model": "11.62.0-alpha.1",
|
|
37
|
+
"@gooddata/sdk-pluggable-application-model": "11.62.0-alpha.1",
|
|
38
|
+
"@gooddata/sdk-ui": "11.62.0-alpha.1",
|
|
39
|
+
"@gooddata/sdk-ui-ext": "11.62.0-alpha.1",
|
|
40
|
+
"@gooddata/sdk-ui-application-header": "11.62.0-alpha.1",
|
|
41
|
+
"@gooddata/sdk-ui-gen-ai": "11.62.0-alpha.1",
|
|
42
|
+
"@gooddata/sdk-ui-kit": "11.62.0-alpha.1",
|
|
43
|
+
"@gooddata/sdk-ui-semantic-search": "11.62.0-alpha.1",
|
|
44
|
+
"@gooddata/sdk-ui-theme-provider": "11.62.0-alpha.1",
|
|
45
|
+
"@gooddata/util": "11.62.0-alpha.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@microsoft/api-documenter": "7.30.16",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"vite": "8.0.16",
|
|
82
82
|
"vitest": "4.1.11",
|
|
83
83
|
"vitest-dom": "0.1.1",
|
|
84
|
-
"@gooddata/eslint-config": "11.
|
|
85
|
-
"@gooddata/oxlint-config": "11.
|
|
84
|
+
"@gooddata/eslint-config": "11.62.0-alpha.1",
|
|
85
|
+
"@gooddata/oxlint-config": "11.62.0-alpha.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": ">=18.3.1",
|