@gooddata/sdk-ui-gen-ai 11.50.0-alpha.2 → 11.50.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.
Files changed (38) hide show
  1. package/NOTICE +3 -3
  2. package/esm/components/GenAIChatContextIndicator.d.ts.map +1 -1
  3. package/esm/components/GenAIChatContextIndicator.js +3 -2
  4. package/esm/components/GenAIChatDialog.d.ts +6 -1
  5. package/esm/components/GenAIChatDialog.d.ts.map +1 -1
  6. package/esm/components/GenAIChatDialog.js +4 -4
  7. package/esm/components/GenAIChatOverlay.d.ts +7 -0
  8. package/esm/components/GenAIChatOverlay.d.ts.map +1 -1
  9. package/esm/components/GenAIChatOverlay.js +22 -4
  10. package/esm/components/chatOverlayEscapeGuard.d.ts +14 -0
  11. package/esm/components/chatOverlayEscapeGuard.d.ts.map +1 -0
  12. package/esm/components/chatOverlayEscapeGuard.js +23 -0
  13. package/esm/components/completion/plugins/reference-placeholder.d.ts +21 -0
  14. package/esm/components/completion/plugins/reference-placeholder.d.ts.map +1 -0
  15. package/esm/components/completion/plugins/reference-placeholder.js +33 -0
  16. package/esm/components/completion/plugins/rehype-references.d.ts +5 -1
  17. package/esm/components/completion/plugins/rehype-references.d.ts.map +1 -1
  18. package/esm/components/completion/plugins/rehype-references.js +40 -18
  19. package/esm/components/completion/plugins/remark-references.d.ts.map +1 -1
  20. package/esm/components/completion/plugins/remark-references.js +2 -5
  21. package/esm/components/completion/utils.d.ts +1 -1
  22. package/esm/components/completion/utils.d.ts.map +1 -1
  23. package/esm/components/completion/utils.js +1 -4
  24. package/esm/components/customized/LandingScreen.js +1 -1
  25. package/esm/components/messages/contents/Markdown.d.ts.map +1 -1
  26. package/esm/components/messages/contents/Markdown.js +4 -1
  27. package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts +0 -1
  28. package/esm/components/messages/conversationContents/ConversationVisualizationContent.d.ts.map +1 -1
  29. package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts +0 -1
  30. package/esm/components/messages/conversationContents/SaveVisualizationDialog.d.ts.map +1 -1
  31. package/esm/store/chatWindow/chatWindowSelectors.d.ts +1 -0
  32. package/esm/store/chatWindow/chatWindowSelectors.d.ts.map +1 -1
  33. package/esm/store/chatWindow/chatWindowSelectors.js +1 -0
  34. package/esm/store/sideEffects/onChatOpenSync.d.ts.map +1 -1
  35. package/esm/store/sideEffects/onChatOpenSync.js +14 -4
  36. package/esm/store/sideEffects/onVisualizationSave.d.ts +0 -1
  37. package/esm/store/sideEffects/onVisualizationSave.d.ts.map +1 -1
  38. package/package.json +20 -20
package/NOTICE CHANGED
@@ -7,9 +7,9 @@
7
7
 
8
8
  The following 3rd-party software packages may be used by or distributed with gooddata-ui-sdk. Any information relevant to third-party vendors listed below are collected using common, reasonable means.
9
9
 
10
- Date generated: 2026-7-27
10
+ Date generated: 2026-7-30
11
11
 
12
- Revision ID: 8409fe979ded6f97ece873ef163dc792102e2b62
12
+ Revision ID: d888e6fac3deae0511e0a86bfb269a788f76f3e1
13
13
 
14
14
  ================================================================================
15
15
  ================================================================================
@@ -29285,4 +29285,4 @@ POSSIBILITY OF SUCH DAMAGE.
29285
29285
  --------------------------------------------------------------------------------
29286
29286
  --------------------------------------------------------------------------------
29287
29287
 
29288
- Report Generated by FOSSA on 2026-7-27
29288
+ Report Generated by FOSSA on 2026-7-30
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAe,MAAM,OAAO,CAAC;AAc7C,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AA2DF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,iCAAiC,CAG5C,CAAC"}
1
+ {"version":3,"file":"GenAIChatContextIndicator.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatContextIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAe,MAAM,OAAO,CAAC;AAc7C,KAAK,iCAAiC,GAAG;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AA4DF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,iCAAiC,CAG5C,CAAC"}
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
5
5
  import { connect, useSelector } from "react-redux";
6
6
  import { UiChip } from "@gooddata/sdk-ui-kit";
7
7
  import { collectContextReferences } from "../context/collectContextReferences.js";
8
- import { userContextSelector } from "../store/chatWindow/chatWindowSelectors.js";
8
+ import { contextSetupEnabledSelector, userContextSelector } from "../store/chatWindow/chatWindowSelectors.js";
9
9
  import { removeContextReferenceAction } from "../store/chatWindow/chatWindowSlice.js";
10
10
  import { getIconByType } from "./utils/icons.js";
11
11
  /**
@@ -19,6 +19,7 @@ import { getIconByType } from "./utils/icons.js";
19
19
  function GenAIChatContextIndicatorCore({ removeContextReference, onDelete, }) {
20
20
  const intl = useIntl();
21
21
  const emptyReferenceLabel = intl.formatMessage({ id: "gd.gen-ai.context.untitled" });
22
+ const isContextSetupEnabled = useSelector(contextSetupEnabledSelector);
22
23
  const context = useSelector(userContextSelector);
23
24
  const references = collectContextReferences(context, emptyReferenceLabel);
24
25
  const onDeleteHandler = useCallback((reference) => {
@@ -27,7 +28,7 @@ function GenAIChatContextIndicatorCore({ removeContextReference, onDelete, }) {
27
28
  onDelete?.();
28
29
  };
29
30
  }, [removeContextReference, onDelete]);
30
- if (references.length === 0) {
31
+ if (!isContextSetupEnabled || references.length === 0) {
31
32
  return null;
32
33
  }
33
34
  return (_jsx("div", { className: "gd-gen-ai-chat__context-indicator", "aria-live": "polite", children: references.map((reference, index) => (_jsx(UiChip, { isDisabled: true, isDeletable: true, ...getIconByType(reference.type), label: reference.title, isExpandable: false, onDelete: onDeleteHandler(reference) }, index))) }));
@@ -15,6 +15,11 @@ export type GenAIChatDialogProps = Omit<GenAiStoreProps, "children"> & {
15
15
  returnFocusTo?: RefObject<HTMLElement | null> | string;
16
16
  onLinkClick?: (linkClickEvent: LinkHandlerEvent) => string | undefined;
17
17
  LandingScreenComponentProvider?: () => ComponentType;
18
+ /**
19
+ * Set to false while the host renders its own overlay above the chat, so that Escape aimed at
20
+ * that overlay does not also close the chat (see GenAIChatOverlayExternalProps.closeOnEscape).
21
+ */
22
+ closeOnEscape?: boolean;
18
23
  };
19
- 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, LandingScreenComponentProvider }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
24
+ 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, LandingScreenComponentProvider, closeOnEscape }: GenAIChatDialogProps): import("react/jsx-runtime").JSX.Element;
20
25
  //# 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,aAAa,EAAE,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAC;AAcpG,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3E,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGnE,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IACnE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,C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AG;IACnE,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;IACvD,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,KAAK,MAAM,GAAG,SAAS,CAAC;IACvE,8BAA8B,CAAC,EAAE,MAAM,aAAa,CAAC;IACrD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AASF,wBAAgB,eAAe,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAuB,EACvB,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAiB,EACjB,UAAkB,EAClB,cAAsB,EACtB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,8BAA8B,EAC9B,aAAa,EAChB,EAAE,oBAAoB,2CA6CtB"}
@@ -18,12 +18,12 @@ import { KeyDriverAnalysis } from "./KeyDriverAnalysis.js";
18
18
  const DEFAULT_CHAT_Z_INDEX = 3000;
19
19
  // - Must be more than DEFAULT_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, LandingScreenComponentProvider, }) {
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, LandingScreenComponentProvider, 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, children: (genAIStore) => (_jsx(GenAIChatDialogContent, { genAIStore: genAIStore, backend: effectiveBackend, workspace: effectiveWorkspace, className: className, dialogPosition: dialogPosition, disabled: disabled, isOpen: isOpen, onOpen: onOpen, onClose: onClose, returnFocusTo: returnFocusTo, allowNativeLinks: allowNativeLinks, onLinkClick: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, LandingScreenComponentProvider: LandingScreenComponentProvider })) }) }));
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, 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, onLinkClick: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, LandingScreenComponentProvider: LandingScreenComponentProvider })) }) }));
25
25
  }
26
- function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, onLinkClick, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, LandingScreenComponentProvider, }) {
26
+ function GenAIChatDialogContent({ genAIStore, backend, workspace, className, dialogPosition, disabled, isOpen, onOpen, onClose, returnFocusTo, onLinkClick, allowNativeLinks, catalogItems, canManage, canAnalyze, canFullControl, LandingScreenComponentProvider, closeOnEscape, }) {
27
27
  const open = useRef(onOpen);
28
28
  open.current = onOpen;
29
29
  const close = useRef(onClose);
@@ -63,6 +63,6 @@ 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, linkHandler: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(KeyDriverAnalysis, {}) })
66
+ return (_jsx(BackendProvider, { backend: backend, children: _jsx(WorkspaceProvider, { workspace: workspace, children: _jsxs(OverlayControllerProvider, { overlayController: chatOverlayController, children: [isOpen && !disabled ? (_jsx(ConfigProvider, { allowNativeLinks: allowNativeLinks, linkHandler: onLinkClick, catalogItems: catalogItems, canManage: canManage, canAnalyze: canAnalyze, canFullControl: canFullControl, children: _jsx(CustomizationProvider, { landingScreenComponentProvider: LandingScreenComponentProvider, children: _jsx(GenAIChatOverlay, { className: className, dialogPosition: dialogPosition, returnFocusTo: returnFocusTo, closeOnEscape: closeOnEscape, onClose: onCloseHandler }) }) })) : null, _jsx(OverlayControllerProvider, { overlayController: kdaOverlayController, children: _jsx(KeyDriverAnalysis, {}) })
67
67
  ] }) }) }));
68
68
  }
@@ -14,6 +14,13 @@ export type GenAIChatOverlayExternalProps = {
14
14
  returnFocusTo?: RefObject<HTMLElement | null> | string;
15
15
  className?: string;
16
16
  dialogPosition?: "left" | "right";
17
+ /**
18
+ * Host-side gate for Escape-to-close, on top of the built-in guard that already keeps the
19
+ * chat open while it is visually covered by another overlay (see chatOverlayEscapeGuard).
20
+ * Set to false to suppress Escape-to-close entirely, e.g. while the host runs UI whose
21
+ * Escape handling must win even though it does not cover the chat window.
22
+ */
23
+ closeOnEscape?: boolean;
17
24
  onClose: () => void;
18
25
  };
19
26
  export type GenAIChatOverlayProps = GenAIChatOverlayExternalProps & GenAIChatOverlayDispatchProps & GenAIChatOverlayStateProps;
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIChatOverlay.d.ts","sourceRoot":"","sources":["../../src/components/GenAIChatOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAQjE,OAAO,EAAE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AAC,EAAE,cAAc,CAAC;IACnC,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,aAAa,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,6BAA6B,GAC7D,6BAA6B,GAC7B,0BAA0B,CAAC;AAoG/B,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,6BAA6B,CAGnC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2024-2026 GoodData Corporation
3
- import { useCallback, useMemo } from "react";
3
+ import { useCallback, useEffect, useMemo } from "react";
4
4
  import cx from "classnames";
5
5
  import { useIntl } from "react-intl";
6
6
  import { connect } from "react-redux";
@@ -8,11 +8,12 @@ import { Dialog } from "@gooddata/sdk-ui-kit";
8
8
  import { keyDriverAnalysisMinimizedSelector, keyDriverAnalysisSelector, } from "../store/chatWindow/chatWindowSelectors.js";
9
9
  import { setHistoryAction } from "../store/chatWindow/chatWindowSlice.js";
10
10
  import { setCurrentConversationAction } from "../store/messages/messagesSlice.js";
11
+ import { isChatWindowCovered } from "./chatOverlayEscapeGuard.js";
11
12
  import { GenAIChatConversations } from "./GenAIChatConversations.js";
12
13
  import { GenAIChatHeader } from "./GenAIChatHeader.js";
13
14
  import { GenAIChatWrapper } from "./GenAIChatWrapper.js";
14
15
  import { useFullscreenCheck } from "./hooks/useFullscreenCheck.js";
15
- function GenAIChatOverlayComponent({ onClose, returnFocusTo, setHistory, loadConversation, dialogPosition, keyDriverAnalysis, keyDriverAnalysisMinimized, className, }) {
16
+ function GenAIChatOverlayComponent({ onClose, returnFocusTo, setHistory, loadConversation, dialogPosition, keyDriverAnalysis, keyDriverAnalysisMinimized, className, closeOnEscape: closeOnEscapeProp = true, }) {
16
17
  const intl = useIntl();
17
18
  const { isFullscreen } = useFullscreenCheck();
18
19
  const classNames = cx("gd-gen-ai-chat__window", className, {
@@ -36,8 +37,25 @@ function GenAIChatOverlayComponent({ onClose, returnFocusTo, setHistory, loadCon
36
37
  }
37
38
  return "br br";
38
39
  }, [dialogPosition, isFullscreen]);
39
- const closeOnEscape = !keyDriverAnalysis || keyDriverAnalysisMinimized;
40
- return (_jsxs(Dialog, { isModal: isFullscreen, returnFocusTo: returnFocusTo, returnFocusAfterClose: !!returnFocusTo, alignPoints: [{ align: position }], closeOnEscape: closeOnEscape, submitOnEnterKey: false, closeOnParentScroll: false, closeOnMouseDrag: false, onClose: onClose, className: classNames, accessibilityConfig: {
40
+ const closeOnEscape = closeOnEscapeProp && (!keyDriverAnalysis || keyDriverAnalysisMinimized);
41
+ // Escape handling is ours, not the Dialog's: its closeOnEscape listens on window with no
42
+ // overlay stack awareness, so an Escape aimed at an overlay covering the chat (e.g.
43
+ // Dashboards' insight editing overlay) would close the chat with the very same press. Close
44
+ // only when the chat window is not covered — Escape then peels one layer per press, the
45
+ // covering layer closing itself through its own listener.
46
+ useEffect(() => {
47
+ if (!closeOnEscape) {
48
+ return undefined;
49
+ }
50
+ const onKeyDown = (e) => {
51
+ if (e.key === "Escape" && !isChatWindowCovered()) {
52
+ onClose();
53
+ }
54
+ };
55
+ window.addEventListener("keydown", onKeyDown);
56
+ return () => window.removeEventListener("keydown", onKeyDown);
57
+ }, [closeOnEscape, onClose]);
58
+ return (_jsxs(Dialog, { isModal: isFullscreen, returnFocusTo: returnFocusTo, returnFocusAfterClose: !!returnFocusTo, alignPoints: [{ align: position }], closeOnEscape: false, submitOnEnterKey: false, closeOnParentScroll: false, closeOnMouseDrag: false, onClose: onClose, className: classNames, accessibilityConfig: {
41
59
  title: intl.formatMessage({ id: "gd.gen-ai.dialog.label" }),
42
60
  isModal: isFullscreen,
43
61
  }, children: [
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Tells whether the chat window is visually covered by other UI (e.g. Dashboards' insight editing
3
+ * overlay opened over the chat).
4
+ *
5
+ * The chat handles Escape itself on window level with no overlay stack awareness, and the covering
6
+ * overlay may be rendered by a different application layer (host shell vs. dashboards remote), so
7
+ * neither props nor a shared overlay controller can carry the "something is above you" signal
8
+ * reliably. Hit-testing the chat window's center answers exactly the question that matters — what
9
+ * would the user's click land on — regardless of who rendered the covering layer and how its
10
+ * z-index came to be. When covered, Escape must be left to the covering layer; the chat may only
11
+ * close itself when it is on top.
12
+ */
13
+ export declare function isChatWindowCovered(doc?: Document): boolean;
14
+ //# sourceMappingURL=chatOverlayEscapeGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatOverlayEscapeGuard.d.ts","sourceRoot":"","sources":["../../src/components/chatOverlayEscapeGuard.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,QAAmB,GAAG,OAAO,CAQrE"}
@@ -0,0 +1,23 @@
1
+ // (C) 2026 GoodData Corporation
2
+ const CHAT_WINDOW_SELECTOR = ".gd-gen-ai-chat__window";
3
+ /**
4
+ * Tells whether the chat window is visually covered by other UI (e.g. Dashboards' insight editing
5
+ * overlay opened over the chat).
6
+ *
7
+ * The chat handles Escape itself on window level with no overlay stack awareness, and the covering
8
+ * overlay may be rendered by a different application layer (host shell vs. dashboards remote), so
9
+ * neither props nor a shared overlay controller can carry the "something is above you" signal
10
+ * reliably. Hit-testing the chat window's center answers exactly the question that matters — what
11
+ * would the user's click land on — regardless of who rendered the covering layer and how its
12
+ * z-index came to be. When covered, Escape must be left to the covering layer; the chat may only
13
+ * close itself when it is on top.
14
+ */
15
+ export function isChatWindowCovered(doc = document) {
16
+ const chatWindow = doc.querySelector(CHAT_WINDOW_SELECTOR);
17
+ if (!chatWindow) {
18
+ return false;
19
+ }
20
+ const rect = chatWindow.getBoundingClientRect();
21
+ const hit = doc.elementFromPoint(rect.left + rect.width / 2, rect.top + rect.height / 2);
22
+ return !!hit && !chatWindow.contains(hit);
23
+ }
@@ -0,0 +1,21 @@
1
+ export declare const PLACEHOLDER_START = "\uE000";
2
+ export interface IExtractedReferences {
3
+ /** Original text with every `{type/id}` token replaced by a placeholder. */
4
+ text: string;
5
+ /** Original `{type/id}` tokens, indexed by the number embedded in their placeholder. */
6
+ tokens: string[];
7
+ }
8
+ /**
9
+ * `split`'s capture group wraps the whole placeholder, for use with `String.split`
10
+ * so the placeholder survives as its own array entry. The default form's capture
11
+ * group is just the numeric index, for an `exec()` loop that resolves it against
12
+ * `tokens`.
13
+ */
14
+ export declare function getPlaceholderRegex(split?: boolean): RegExp;
15
+ /**
16
+ * Replaces `{type/id}` reference tokens with placeholders before Markdown parsing.
17
+ * CommonMark's emphasis rule treats `_word_`-shaped substrings inside an id as
18
+ * legal italic markup and strips the underscores — extracting first avoids that.
19
+ */
20
+ export declare function extractReferences(text: string): IExtractedReferences;
21
+ //# sourceMappingURL=reference-placeholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-placeholder.d.ts","sourceRoot":"","sources":["../../../../src/components/completion/plugins/reference-placeholder.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAG1C,MAAM,WAAW,oBAAoB;IACjC,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAK3D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAQpE"}
@@ -0,0 +1,33 @@
1
+ // (C) 2026 GoodData Corporation
2
+ import { getReferenceRegex } from "../utils.js";
3
+ // Private-use-area sentinels: never produced by normal chat text, and contain
4
+ // none of the characters (`_`, `*`, backtick, ...) CommonMark treats as inline
5
+ // syntax, so a placeholder can never be mis-tokenized as Markdown.
6
+ export const PLACEHOLDER_START = "\ue000";
7
+ const PLACEHOLDER_END = "\ue001";
8
+ /**
9
+ * `split`'s capture group wraps the whole placeholder, for use with `String.split`
10
+ * so the placeholder survives as its own array entry. The default form's capture
11
+ * group is just the numeric index, for an `exec()` loop that resolves it against
12
+ * `tokens`.
13
+ */
14
+ export function getPlaceholderRegex(split) {
15
+ if (split) {
16
+ return new RegExp(`(${PLACEHOLDER_START}\\d+${PLACEHOLDER_END})`, "g");
17
+ }
18
+ return new RegExp(`${PLACEHOLDER_START}(\\d+)${PLACEHOLDER_END}`, "g");
19
+ }
20
+ /**
21
+ * Replaces `{type/id}` reference tokens with placeholders before Markdown parsing.
22
+ * CommonMark's emphasis rule treats `_word_`-shaped substrings inside an id as
23
+ * legal italic markup and strips the underscores — extracting first avoids that.
24
+ */
25
+ export function extractReferences(text) {
26
+ const tokens = [];
27
+ const replacedText = text.replace(getReferenceRegex(), (match) => {
28
+ const index = tokens.length;
29
+ tokens.push(match);
30
+ return `${PLACEHOLDER_START}${index}${PLACEHOLDER_END}`;
31
+ });
32
+ return { text: replacedText, tokens };
33
+ }
@@ -1,4 +1,8 @@
1
1
  import { type Root } from "mdast";
2
2
  import { type TextContentObject } from "../../../model.js";
3
- export declare function rehypeReferences(references: TextContentObject[]): () => (tree: Root) => Root;
3
+ /**
4
+ * `tokens` must be the `tokens` array `extractReferences()` returned for the same
5
+ * Markdown text — placeholders are resolved by looking up their embedded index in it.
6
+ */
7
+ export declare function rehypeReferences(references: TextContentObject[], tokens: string[]): () => (tree: Root) => Root;
4
8
  //# sourceMappingURL=rehype-references.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rehype-references.d.ts","sourceRoot":"","sources":["../../../../src/components/completion/plugins/rehype-references.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK3D,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,EAAE,8BAyC/D"}
1
+ {"version":3,"file":"rehype-references.d.ts","sourceRoot":"","sources":["../../../../src/components/completion/plugins/rehype-references.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK3D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,8BAyCjF"}
@@ -1,10 +1,14 @@
1
1
  // (C) 2022-2026 GoodData Corporation
2
2
  import cx from "classnames";
3
- import { getReferenceRegex } from "../utils.js";
4
- export function rehypeReferences(references) {
3
+ import { PLACEHOLDER_START, getPlaceholderRegex } from "./reference-placeholder.js";
4
+ /**
5
+ * `tokens` must be the `tokens` array `extractReferences()` returned for the same
6
+ * Markdown text — placeholders are resolved by looking up their embedded index in it.
7
+ */
8
+ export function rehypeReferences(references, tokens) {
5
9
  return function () {
6
10
  return function (tree) {
7
- iterateTree(tree, references, {
11
+ iterateTree(tree, references, tokens, {
8
12
  onTextNodeReference: (text, obj) => {
9
13
  return [
10
14
  {
@@ -43,35 +47,53 @@ export function rehypeReferences(references) {
43
47
  };
44
48
  };
45
49
  }
46
- function iterateTree(node, references, callbacks) {
47
- //Text type
50
+ function iterateTree(node, references, tokens, callbacks) {
48
51
  if (node.type === "text") {
49
- const res = iterateReferenceMatch(node.value, references, (ref) => {
52
+ const value = node.value;
53
+ if (!value.includes(PLACEHOLDER_START)) {
54
+ return [node];
55
+ }
56
+ const res = iterateReferenceMatch(value, references, tokens, (ref) => {
50
57
  return callbacks.onTextNodeReference(node, ref);
51
58
  });
52
- return res.length ? res : [node];
59
+ if (res.length) {
60
+ return res;
61
+ }
62
+ node.value = restoreUnresolvedPlaceholders(value, tokens);
63
+ return [node];
53
64
  }
54
65
  if (node.children) {
55
- // has children
56
66
  node.children = node.children.reduce((acc, child) => {
57
- return [...acc, ...iterateTree(child, references, callbacks)];
67
+ return [...acc, ...iterateTree(child, references, tokens, callbacks)];
58
68
  }, []);
59
69
  return [node];
60
70
  }
61
- // no children
62
71
  return [node];
63
72
  }
64
- function iterateReferenceMatch(value, references, onMatch) {
73
+ /**
74
+ * Replaces any placeholder occurrences left in a text node (i.e. ones that did not
75
+ * resolve to a reference chip) with their original `{type/id}` token text, so the
76
+ * output never leaks a raw placeholder sentinel (an invisible PUA-wrapped digit)
77
+ * as visible text.
78
+ */
79
+ function restoreUnresolvedPlaceholders(value, tokens) {
80
+ return value.replace(getPlaceholderRegex(), (match, indexStr) => {
81
+ const originalToken = tokens[Number(indexStr)];
82
+ return originalToken ?? match;
83
+ });
84
+ }
85
+ function iterateReferenceMatch(value, references, tokens, onMatch) {
65
86
  const items = [];
66
- const regex = getReferenceRegex();
87
+ const regex = getPlaceholderRegex();
67
88
  let match = regex.exec(value);
68
89
  while (match) {
69
- const [type, id] = match[1].split("/");
70
- const ref = references.find((ref) => {
71
- return ref.id === id && ref.type === type;
72
- });
73
- if (ref) {
74
- items.push(...onMatch(ref));
90
+ const originalToken = tokens[Number(match[1])];
91
+ if (originalToken) {
92
+ const [type, id] = originalToken.slice(1, -1).split("/");
93
+ const ref = references.find((ref) => ref.id === id && ref.type === type);
94
+ if (ref) {
95
+ items.push(...onMatch(ref));
96
+ }
75
97
  }
76
98
  match = regex.exec(value);
77
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"remark-references.d.ts","sourceRoot":"","sources":["../../../../src/components/completion/plugins/remark-references.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,MAAM,EAAc,MAAM,OAAO,CAAC;AAM3D,wBAAgB,gBAAgB,mCAiC/B"}
1
+ {"version":3,"file":"remark-references.d.ts","sourceRoot":"","sources":["../../../../src/components/completion/plugins/remark-references.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,MAAM,EAAc,MAAM,OAAO,CAAC;AAK3D,wBAAgB,gBAAgB,mCAiC/B"}
@@ -1,12 +1,12 @@
1
1
  // (C) 2022-2026 GoodData Corporation
2
- import { getReferenceRegex } from "../utils.js";
2
+ import { getPlaceholderRegex } from "./reference-placeholder.js";
3
3
  export function remarkReferences() {
4
4
  return function () {
5
5
  return function (tree) {
6
6
  iterateTree(tree, {
7
7
  onText: (text) => {
8
8
  const nodes = [];
9
- const parts = text.value.split(getReferenceRegex(true));
9
+ const parts = text.value.split(getPlaceholderRegex(true));
10
10
  let start = text.position?.start ?? { line: 0, column: 0, offset: 0 };
11
11
  parts.forEach((part) => {
12
12
  const end = {
@@ -32,17 +32,14 @@ export function remarkReferences() {
32
32
  };
33
33
  }
34
34
  function iterateTree(node, callbacks) {
35
- //Text type
36
35
  if (node.type === "text") {
37
36
  return callbacks.onText(node);
38
37
  }
39
- // has children
40
38
  if (node.children) {
41
39
  node.children = node.children.reduce((acc, child) => {
42
40
  return [...acc, ...iterateTree(child, callbacks)];
43
41
  }, []);
44
42
  return [node];
45
43
  }
46
- // no children
47
44
  return [node];
48
45
  }
@@ -16,7 +16,7 @@ export declare function getOptions(intl: IntlShape, { items, search, canManage,
16
16
  excludeTags?: string[];
17
17
  }): ICompletionItem[];
18
18
  declare const SupportedReferenceTypes: readonly ["fact", "metric", "date", "attribute", "label", "dashboard", "visualization"];
19
- export declare function getReferenceRegex(split?: boolean): RegExp;
19
+ export declare function getReferenceRegex(): RegExp;
20
20
  export declare function getItems(intl: IntlShape, item: CatalogItem, { canManage, canAnalyze, onCompletionSelected }: {
21
21
  canManage?: boolean;
22
22
  canAnalyze?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["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AmB,CAC/B,IAAI,EAAE,WAAW,GAAG,qBAAqB,GAAG,mCAAmC,UAqBlF;AAGD,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,WAAW,GAAG,qBAAqB,GAAG,mCAAmC,GAChF,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAoBjD;AAsBD,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WA0B1F"}
@@ -39,10 +39,7 @@ const SupportedReferenceTypes = [
39
39
  "visualization",
40
40
  ];
41
41
  // Utility: Get regex for references
42
- export function getReferenceRegex(split) {
43
- if (split) {
44
- return new RegExp(`(\\{(?:${SupportedReferenceTypes.join("|")})\\/[.A-Za-z0-9_-]{1,255}\\})`, "g");
45
- }
42
+ export function getReferenceRegex() {
46
43
  return new RegExp(`\\{((?:${SupportedReferenceTypes.join("|")})\\/(?!\\.)[.A-Za-z0-9_-]{1,255})\\}`, "g");
47
44
  }
48
45
  // Utility: Get item for completion
@@ -26,7 +26,7 @@ const quickOptions = [
26
26
  ];
27
27
  function LandingScreenComponent({ LandingScreen, isBigScreen, isSmallScreen, isFullscreen, }) {
28
28
  const intl = useIntl();
29
- return (_jsx("div", { className: "gd-gen-ai-chat__messages__empty", children: LandingScreen ? (_jsx(LandingScreen, {})) : (_jsxs(DefaultLandingContainer, { isFullscreen: isFullscreen, isBigScreen: isBigScreen, isSmallScreen: isSmallScreen, children: [
29
+ return (_jsx("div", { className: "gd-gen-ai-chat__messages__empty", "data-testid": "gen-ai-chat-landing-screen", children: LandingScreen ? (_jsx(LandingScreen, {})) : (_jsxs(DefaultLandingContainer, { isFullscreen: isFullscreen, isBigScreen: isBigScreen, isSmallScreen: isSmallScreen, children: [
30
30
  _jsxs(DefaultLandingTitle, { children: [
31
31
  _jsx(DefaultLandingTitleAscent, { children: _jsx(FormattedMessage, { id: "gd.gen-ai.welcome.line-1" }) }), _jsx("br", {}), _jsx(FormattedMessage, { id: "gd.gen-ai.welcome.line-2" })
32
32
  ] }), _jsx(DefaultLandingQuestions, { isFullscreen: isFullscreen, isBigScreen: isBigScreen, isSmallScreen: isSmallScreen, children: quickOptions.map((option) => (_jsx(DefaultLandingQuestion, { icon: option.icon, title: intl.formatMessage(option.title), question: intl.formatMessage(option.question), answer: intl.formatMessage(option.answer) }, option.title.id))) })
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/Markdown.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAsB3D,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAqB,EAAE,EAAE,sBAAsB,2CAexG"}
1
+ {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/contents/Markdown.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAuB3D,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAqB,EAAE,EAAE,sBAAsB,2CAiBxG"}
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // (C) 2024-2026 GoodData Corporation
3
+ import { useMemo } from "react";
3
4
  import Markdown from "react-markdown";
4
5
  import remarkEmoji from "remark-emoji";
5
6
  import remarkGfm from "remark-gfm";
6
7
  import { Typography } from "@gooddata/sdk-ui-kit";
8
+ import { extractReferences } from "../../completion/plugins/reference-placeholder.js";
7
9
  import { rehypeReferences } from "../../completion/plugins/rehype-references.js";
8
10
  import { remarkReferences } from "../../completion/plugins/remark-references.js";
9
11
  import { CustomHyperlink } from "./CustomHyperlink.js";
@@ -22,8 +24,9 @@ const customUrlTransform = (url) => {
22
24
  return /^http|https|mailto|tel|gooddata:/i.test(url) ? url : "";
23
25
  };
24
26
  export function MarkdownComponent({ children, references, allowMarkdown = false }) {
27
+ const { text, tokens } = useMemo(() => extractReferences(children), [children]);
25
28
  if (allowMarkdown) {
26
- return (_jsx(Markdown, { remarkPlugins: [remarkEmoji, remarkGfm, remarkReferences()], rehypePlugins: [rehypeReferences(references ?? [])], components: componentMap, urlTransform: customUrlTransform, children: children }));
29
+ return (_jsx(Markdown, { remarkPlugins: [remarkEmoji, remarkGfm, remarkReferences()], rehypePlugins: [rehypeReferences(references ?? [], tokens)], components: componentMap, urlTransform: customUrlTransform, children: text }));
27
30
  }
28
31
  return _jsx(Typography, { tagName: "p", children: children });
29
32
  }
@@ -32,7 +32,6 @@ export declare const ConversationVisualizationContent: import("react-redux").Con
32
32
  uri: string;
33
33
  ref: import("@gooddata/sdk-model").ObjRef;
34
34
  isLocked?: boolean | undefined;
35
- isHidden?: boolean | undefined;
36
35
  certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
37
36
  };
38
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,KAAK,aAAa,EAAgD,MAAM,qBAAqB,CAAC;AAwBvG,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAM9G,OAAO,EAEH,0BAA0B,EAC7B,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAwBlF,MAAM,MAAM,qCAAqC,GAAG;IAChD,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,OAAO,0BAA0B,CAAC;IACzD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C,CAAC;AAEF,iBAAS,oCAAoC,CAAC,EAC1C,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,4BAA4B,EAC/B,EAAE,qCAAqC,2CAmGvC;AAmnBD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;EAGN,CAAC"}
1
+ {"version":3,"file":"ConversationVisualizationContent.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/ConversationVisualizationContent.tsx"],"names":[],"mappings":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ConnectedCom
24
24
  uri: string;
25
25
  ref: import("@gooddata/sdk-model").ObjRef;
26
26
  isLocked?: boolean | undefined;
27
- isHidden?: boolean | undefined;
28
27
  certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
29
28
  };
30
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAE7G,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IAC/C,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC7D,CAAC;AAEF,iBAAS,2BAA2B,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EAC3B,EAAE,4BAA4B,GAAG,oCAAoC,2CAkDrE;AA8DD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;EAAiE,CAAC"}
1
+ {"version":3,"file":"SaveVisualizationDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/messages/conversationContents/SaveVisualizationDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,qCAAqC,EAAE,MAAM,2BAA2B,CAAC;AAGvF,OAAO,EAAE,KAAK,0BAA0B,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAE7G,MAAM,MAAM,4BAA4B,GAAG;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,aAAa,EAAE,WAAW,CAAC,qCAAqC,CAAC,eAAe,CAAC,CAAC,CAAC;IACnF,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IAC/C,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,wBAAwB,EAAE,OAAO,wBAAwB,CAAC;CAC7D,CAAC;AAEF,iBAAS,2BAA2B,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,aAAa,EACb,OAAO,EACP,uBAAuB,EACvB,wBAAwB,EAC3B,EAAE,4BAA4B,GAAG,oCAAoC,2CAkDrE;AA8DD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;EAAiE,CAAC"}
@@ -9,6 +9,7 @@ export declare const colorPaletteSelector: (state: RootState) => IColorPalette |
9
9
  export declare const settingsSelector: (state: RootState) => IUserWorkspaceSettings | undefined;
10
10
  export declare const isPreviewSelector: (state: RootState) => boolean;
11
11
  export declare const agentSwitchingEnabledSelector: (state: RootState) => boolean;
12
+ export declare const contextSetupEnabledSelector: (state: RootState) => boolean;
12
13
  export declare const agentSwitchingActiveSelector: (state: RootState) => boolean;
13
14
  export declare const objectTypesSelector: (state: RootState) => GenAIObjectType[] | undefined;
14
15
  export declare const allowedRelationshipTypesSelector: (state: RootState) => IAllowedRelationshipType[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"chatWindowSelectors.d.ts","sourceRoot":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AC"}
@@ -9,6 +9,7 @@ export const colorPaletteSelector = createSelector(chatWindowSliceSelector, (sta
9
9
  export const settingsSelector = createSelector(chatWindowSliceSelector, (state) => state.settings);
10
10
  export const isPreviewSelector = createSelector(chatWindowSliceSelector, (state) => state.isPreview === true);
11
11
  export const agentSwitchingEnabledSelector = createSelector(settingsSelector, (settings) => settings?.["enableGenAiAgentSwitching"] === true);
12
+ export const contextSetupEnabledSelector = createSelector(settingsSelector, (settings) => settings?.enableAiContextSetup === true);
12
13
  // Whether the agent switcher is usable in the current chat context. It is never usable in preview
13
14
  // mode: the assistant is pinned to the single preview agent being built, so the switcher stays
14
15
  // hidden and the legacy input is used.
@@ -1 +1 @@
1
- {"version":3,"file":"onChatOpenSync.d.ts","sourceRoot":"","sources":["../../../src/store/sideEffects/onChatOpenSync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUtD,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAElC,MAAM,gBAAgB,CAAC;AAgBxB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAiB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;;;;;;;;;;;6DA4F1F"}
1
+ {"version":3,"file":"onChatOpenSync.d.ts","sourceRoot":"","sources":["../../../src/store/sideEffects/onChatOpenSync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUtD,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAElC,MAAM,gBAAgB,CAAC;AAiBxB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAiB,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,CAAC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;;;;;;;;;;;6DAyG1F"}
@@ -2,7 +2,7 @@
2
2
  import { call, getContext, put, select } from "redux-saga/effects";
3
3
  import { makeConversationItem, } from "../../model.js";
4
4
  import { settingsSelector } from "../chatWindow/chatWindowSelectors.js";
5
- import { asyncProcessSelector, conversationSelector, conversationsLoadedSelector, } from "../messages/messagesSelectors.js";
5
+ import { asyncProcessSelector, conversationMessagesSelector, conversationSelector, conversationsLoadedSelector, } from "../messages/messagesSelectors.js";
6
6
  import { loadConversationsSuccessAction, setCurrentConversationAction, setMessagesAction, } from "../messages/messagesSlice.js";
7
7
  import { convertToLocalContent } from "./converters/toLocalContent.js";
8
8
  import { notifyDefinitionReceived } from "./onDefinitionReceivedTrigger.js";
@@ -52,6 +52,7 @@ export function* onChatOpenSync({ payload: { isOpen } }) {
52
52
  return;
53
53
  }
54
54
  const current = yield select(conversationSelector);
55
+ const currentItems = yield select(conversationMessagesSelector);
55
56
  // Keep a brand-new, not-yet-persisted draft conversation as-is.
56
57
  if (current && !current.id) {
57
58
  return;
@@ -98,11 +99,20 @@ export function* onChatOpenSync({ payload: { isOpen } }) {
98
99
  // writes into whatever currentConversation points at, so the switch must come first - and
99
100
  // both puts are dispatched synchronously (no yield between them) so the UI never observes the
100
101
  // intermediate empty/unloaded state.
101
- if (latest.id !== currentNow?.id) {
102
+ const isDifferentConversation = latest.id !== currentNow?.id;
103
+ if (isDifferentConversation) {
102
104
  yield put(setCurrentConversationAction({ conversation: latest }));
103
105
  }
104
- yield put(setMessagesAction({ items }));
105
- yield call(notifyDefinitionReceived, items, latest.localId);
106
+ // Check if new items are different from the current ones. If so, replace the whole list.
107
+ // If the conversation was just switched above, we always replace because the currentItems
108
+ // we have in hand belong to the previous conversation.
109
+ const sameItems = !isDifferentConversation &&
110
+ items.length === currentItems.length &&
111
+ items.every((item, i) => item.id === currentItems[i]?.id);
112
+ if (!sameItems) {
113
+ yield put(setMessagesAction({ items }));
114
+ yield call(notifyDefinitionReceived, items, latest.localId);
115
+ }
106
116
  }
107
117
  catch {
108
118
  // Fail silently - keep showing whatever is currently loaded.
@@ -37,7 +37,6 @@ export declare function onVisualizationSave({ payload }: PayloadAction<{
37
37
  uri: string;
38
38
  ref: import("@gooddata/sdk-model").ObjRef;
39
39
  isLocked?: boolean | undefined;
40
- isHidden?: boolean | undefined;
41
40
  certification?: import("@gooddata/sdk-model").IObjectCertification | undefined;
42
41
  };
43
42
  } & Message[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"onVisualizationSave.d.ts","sourceRoot":"","sources":["../../../src/store/sideEffects/onVisualizationSave.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAGH,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAG1B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAEH,KAAK,0BAA0B,EAE/B,KAAK,OAAO,EAEf,MAAM,gBAAgB,CAAC;AASxB,wBAAiB,mBAAmB,CAAC,EACjC,OAAO,EACV,EAAE,aAAa,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgHD;AAoGD,eAAO,MAAM,cAAc,+FA0C1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+FAoC5B,CAAC"}
1
+ {"version":3,"file":"onVisualizationSave.d.ts","sourceRoot":"","sources":["../../../src/store/sideEffects/onVisualizationSave.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAGH,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAG1B,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAEH,KAAK,0BAA0B,EAE/B,KAAK,OAAO,EAEf,MAAM,gBAAgB,CAAC;AASxB,wBAAiB,mBAAmB,CAAC,EACjC,OAAO,EACV,EAAE,aAAa,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgHD;AAoGD,eAAO,MAAM,cAAc,+FA0C1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,+FAoC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-gen-ai",
3
- "version": "11.50.0-alpha.2",
3
+ "version": "11.50.0-alpha.4",
4
4
  "description": "GoodData GenAI SDK",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -57,18 +57,18 @@
57
57
  "reselect": "5.1.1",
58
58
  "tslib": "2.8.1",
59
59
  "uuid": "11.1.1",
60
- "@gooddata/api-client-tiger": "11.50.0-alpha.2",
61
- "@gooddata/sdk-backend-spi": "11.50.0-alpha.2",
62
- "@gooddata/sdk-ui": "11.50.0-alpha.2",
63
- "@gooddata/sdk-model": "11.50.0-alpha.2",
64
- "@gooddata/sdk-ui-charts": "11.50.0-alpha.2",
65
- "@gooddata/sdk-ui-filters": "11.50.0-alpha.2",
66
- "@gooddata/sdk-ui-dashboard": "11.50.0-alpha.2",
67
- "@gooddata/sdk-ui-kit": "11.50.0-alpha.2",
68
- "@gooddata/sdk-ui-pivot": "11.50.0-alpha.2",
69
- "@gooddata/sdk-ui-semantic-search": "11.50.0-alpha.2",
70
- "@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.2",
71
- "@gooddata/util": "11.50.0-alpha.2"
60
+ "@gooddata/api-client-tiger": "11.50.0-alpha.4",
61
+ "@gooddata/sdk-backend-spi": "11.50.0-alpha.4",
62
+ "@gooddata/sdk-model": "11.50.0-alpha.4",
63
+ "@gooddata/sdk-ui": "11.50.0-alpha.4",
64
+ "@gooddata/sdk-ui-charts": "11.50.0-alpha.4",
65
+ "@gooddata/sdk-ui-dashboard": "11.50.0-alpha.4",
66
+ "@gooddata/sdk-ui-filters": "11.50.0-alpha.4",
67
+ "@gooddata/sdk-ui-kit": "11.50.0-alpha.4",
68
+ "@gooddata/sdk-ui-pivot": "11.50.0-alpha.4",
69
+ "@gooddata/sdk-ui-semantic-search": "11.50.0-alpha.4",
70
+ "@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.4",
71
+ "@gooddata/util": "11.50.0-alpha.4"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@microsoft/api-documenter": "^7.17.0",
@@ -111,13 +111,13 @@
111
111
  "typescript": "5.9.3",
112
112
  "vitest": "4.1.8",
113
113
  "vitest-dom": "0.1.1",
114
- "@gooddata/eslint-config": "11.50.0-alpha.2",
115
- "@gooddata/reference-workspace": "11.50.0-alpha.2",
116
- "@gooddata/i18n-toolkit": "11.50.0-alpha.2",
117
- "@gooddata/oxlint-config": "11.50.0-alpha.2",
118
- "@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.2",
119
- "@gooddata/stylelint-config": "11.50.0-alpha.2",
120
- "@gooddata/sdk-backend-mockingbird": "11.50.0-alpha.2"
114
+ "@gooddata/eslint-config": "11.50.0-alpha.4",
115
+ "@gooddata/i18n-toolkit": "11.50.0-alpha.4",
116
+ "@gooddata/oxlint-config": "11.50.0-alpha.4",
117
+ "@gooddata/reference-workspace": "11.50.0-alpha.4",
118
+ "@gooddata/sdk-backend-mockingbird": "11.50.0-alpha.4",
119
+ "@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.4",
120
+ "@gooddata/stylelint-config": "11.50.0-alpha.4"
121
121
  },
122
122
  "peerDependencies": {
123
123
  "react": "^18.0.0 || ^19.0.0",