@gengage/assistant-fe 0.6.40 → 0.6.42

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 (33) hide show
  1. package/dist/chat/catalog.d.ts +1 -1
  2. package/dist/chat/components/ChatDrawer.d.ts +9 -2
  3. package/dist/chat/history-storage.d.ts +3 -0
  4. package/dist/chat/panel-manager.d.ts +7 -0
  5. package/dist/chat/runtime.d.ts +3 -0
  6. package/dist/chat/session-persistence.d.ts +2 -0
  7. package/dist/chat/types.d.ts +1 -0
  8. package/dist/chat-runtime.js +1 -1
  9. package/dist/chat.iife.js +37 -37
  10. package/dist/chat.js +1 -1
  11. package/dist/common/indexed-db.d.ts +3 -0
  12. package/dist/{common-DfAGSY36.js → common-B9n_o9ki.js} +1 -1
  13. package/dist/common.js +5 -5
  14. package/dist/{connection-warning-CXGTkX7f.js → connection-warning-ByY3TKaG.js} +1 -1
  15. package/dist/{fastIntent-Cj9pb-XJ.js → fastIntent-BaNC2CJz.js} +1 -1
  16. package/dist/index.js +10 -10
  17. package/dist/native.iife.js +13 -13
  18. package/dist/qna-runtime.js +1 -1
  19. package/dist/qna.iife.js +1 -1
  20. package/dist/qna.js +1 -1
  21. package/dist/{request-response-cache-Bc0acP64.js → request-response-cache-DkilqELR.js} +1 -1
  22. package/dist/{runtime-BuEjhF-4.js → runtime-BkqUiRUi.js} +3 -3
  23. package/dist/{runtime-8xoIKpil.js → runtime-CmpEARET.js} +3 -3
  24. package/dist/{runtime-BIMNnYje.js → runtime-_ly8XVXC.js} +2252 -2184
  25. package/dist/{simbut-DMd--dzI.js → simbut-CltMk2OF.js} +1 -1
  26. package/dist/simbut.iife.js +1 -1
  27. package/dist/simbut.js +1 -1
  28. package/dist/{simrel-C4X5Yp32.js → simrel-BuCc53Pw.js} +1 -1
  29. package/dist/simrel-runtime.js +1 -1
  30. package/dist/simrel.iife.js +1 -1
  31. package/dist/simrel.js +2 -2
  32. package/dist/{widget-base-C5udoWCy.js → widget-base-vDXD27_n.js} +1 -1
  33. package/package.json +1 -1
@@ -127,9 +127,9 @@ export declare const chatCatalog: {
127
127
  labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
128
128
  label: z.ZodString;
129
129
  sentiment: z.ZodOptional<z.ZodEnum<{
130
+ neutral: "neutral";
130
131
  positive: "positive";
131
132
  negative: "negative";
132
- neutral: "neutral";
133
133
  }>>;
134
134
  }, z.core.$strip>>>;
135
135
  expertQualityScore: z.ZodOptional<z.ZodNumber>;
@@ -75,6 +75,10 @@ export interface ChatDrawerOptions {
75
75
  type SetPanelContentOptions = {
76
76
  preserveAiZone?: boolean;
77
77
  };
78
+ type CartToastOptions = {
79
+ autoHideMs?: number | null;
80
+ tone?: 'neutral' | 'success';
81
+ };
78
82
  type TypingIndicatorMode = 'full' | 'presence';
79
83
  export declare class ChatDrawer {
80
84
  private root;
@@ -140,6 +144,8 @@ export declare class ChatDrawer {
140
144
  private _panelLoadingBinding;
141
145
  private _panelAiZoneLoadingBinding;
142
146
  private _beautyPhotoStepEl;
147
+ private _cartToastEl;
148
+ private _cartToastTimerId;
143
149
  private _renderPhotoAnalysisCard;
144
150
  constructor(container: HTMLElement, options: ChatDrawerOptions);
145
151
  addMessage(message: ChatMessage): void;
@@ -355,8 +361,9 @@ export declare class ChatDrawer {
355
361
  releaseFocus(): void;
356
362
  /** Briefly animate the cart icon button to signal a successful add-to-cart. */
357
363
  flashCartBadge(): void;
358
- /** Show a temporary success toast inside the shadow root. */
359
- showCartToast(message: string): void;
364
+ hideCartToast(): void;
365
+ /** Show a cart-status toast inside the shadow root. */
366
+ showCartToast(message: string, options?: CartToastOptions): void;
360
367
  /** Clean up event listeners and child resources (VoiceInput, timers). */
361
368
  destroy(): void;
362
369
  }
@@ -1,5 +1,6 @@
1
1
  import type { BackendContext, UISpec } from '../common/types.js';
2
2
  import type { ChatMessage } from './types.js';
3
+ import type { PanelSource } from './panel-manager.js';
3
4
  type LegacyThumbnailEntry = {
4
5
  sku: string;
5
6
  imageUrl: string;
@@ -48,6 +49,7 @@ export interface ChatHistorySessionRecord extends ChatHistoryIndexEntry {
48
49
  thumbnailEntries?: LegacyThumbnailEntry[] | undefined;
49
50
  panelSnapshotHtml?: Record<string, string> | undefined;
50
51
  panelSnapshotTypes?: Record<string, string> | undefined;
52
+ panelSnapshotSources?: Record<string, PanelSource> | undefined;
51
53
  panelAiSpecByThread?: Record<string, UISpec> | undefined;
52
54
  lastBackendContext: BackendContext | null;
53
55
  }
@@ -62,6 +64,7 @@ export interface SaveHistorySessionParams {
62
64
  chatCreatedAt: string;
63
65
  panelSnapshots: Map<string, HTMLElement>;
64
66
  panelSnapshotTypes: Map<string, string>;
67
+ panelSnapshotSources: ReadonlyMap<string, PanelSource>;
65
68
  panelThreads: string[];
66
69
  panelAiSpecByThread?: Map<string, UISpec> | undefined;
67
70
  lastBackendContext: BackendContext | null;
@@ -43,6 +43,11 @@ export type PanelSnapshotOptions = {
43
43
  source?: PanelSource | undefined;
44
44
  threadId?: string | undefined;
45
45
  };
46
+ export type PanelSnapshotSourceRegistration = {
47
+ rebuild?: (() => HTMLElement) | undefined;
48
+ source: PanelSource;
49
+ threadId?: string | undefined;
50
+ };
46
51
  export declare class PanelManager {
47
52
  private readonly deps;
48
53
  /** Panel content snapshots keyed by bot message ID for history navigation. */
@@ -73,6 +78,8 @@ export declare class PanelManager {
73
78
  pruneThreadsAfter(threadId: string): void;
74
79
  sourceForMessage(messageId: string): PanelSource | null;
75
80
  sourceForThread(threadId: string): PanelSource | null;
81
+ snapshotSourceMap(): ReadonlyMap<string, PanelSource>;
82
+ registerSnapshotSource(messageId: string, options: PanelSnapshotSourceRegistration): void;
76
83
  componentTypeForSource(source: PanelSource): string;
77
84
  /**
78
85
  * Snapshot the current panel state for a message. Stores a rebuild function
@@ -368,6 +368,7 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
368
368
  private _resolveCurrentProductAddToCartParams;
369
369
  private _extractAddToCartParamsFromRecord;
370
370
  private _hasAddToCartConfirmationHandler;
371
+ private _maybeHidePreservedMobilePanel;
371
372
  private _addToCartRequestKey;
372
373
  private _runChatAddToCartFlow;
373
374
  /**
@@ -388,6 +389,8 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
388
389
  private _isMessageHostedUISpec;
389
390
  private _isPanelAiSpec;
390
391
  private _rememberPanelAiSpec;
392
+ private _panelThreadIdByMessageId;
393
+ private _restorePanelSnapshotSources;
391
394
  private _restorePanelAiSpecMap;
392
395
  private _hydrateRestoredUISpecMetadata;
393
396
  private _renderMessageUISpec;
@@ -10,6 +10,7 @@ import type { GengageIndexedDB, FavoriteData } from '../common/indexed-db.js';
10
10
  import type { CommunicationBridge } from '../common/communication-bridge.js';
11
11
  import type { BackendContext, UISpec } from '../common/types.js';
12
12
  import type { ChatMessage } from './types.js';
13
+ import type { PanelSource } from './panel-manager.js';
13
14
  export type { FavoriteData };
14
15
  type NavigateFn = (url: string) => void;
15
16
  export interface PersistSessionParams {
@@ -22,6 +23,7 @@ export interface PersistSessionParams {
22
23
  chatCreatedAt: string;
23
24
  panelSnapshots: Map<string, HTMLElement>;
24
25
  panelSnapshotTypes?: Map<string, string> | undefined;
26
+ panelSnapshotSources?: ReadonlyMap<string, PanelSource> | undefined;
25
27
  panelThreads: string[];
26
28
  panelAiSpecByThread?: Map<string, UISpec> | undefined;
27
29
  lastBackendContext: BackendContext | null;
@@ -313,6 +313,7 @@ export interface ChatI18n {
313
313
  viewMoreLabel: string;
314
314
  similarProductsLabel: string;
315
315
  addToCartButton: string;
316
+ addingToCartToast: string;
316
317
  addedToCartToast: string;
317
318
  shareButton: string;
318
319
  productInfoTab: string;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t, f as r, i as s, l as n, n as i, r as l, s as C, t as c, u as d } from "./runtime-BIMNnYje.js";
1
+ import { c as e, d as t, f as r, i as s, l as n, n as i, r as l, s as C, t as c, u as d } from "./runtime-_ly8XVXC.js";
2
2
  export {
3
3
  d as CHAT_SCROLL_ELEMENT_ID,
4
4
  s as ChatPresentationState,