@gengage/assistant-fe 0.4.15 → 0.4.16
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/dist/chat/panel-manager.d.ts +29 -1
- package/dist/chat/runtime.d.ts +7 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +17 -17
- package/dist/chat.js +1 -1
- package/dist/common/fastIntent.d.ts +1 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common.js +46 -45
- package/dist/{pill-launcher-D9ITHv5w.js → fastIntent-CINRmM8r.js} +190 -131
- package/dist/index.js +6 -6
- package/dist/native.iife.js +14 -14
- package/dist/{runtime-EUhElpCX.js → runtime-DP_D5fV6.js} +2266 -2192
- package/package.json +1 -1
|
@@ -13,12 +13,36 @@ export interface PanelManagerDeps {
|
|
|
13
13
|
i18n: () => ChatI18n;
|
|
14
14
|
rollbackToThread: (threadId: string) => void;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Rebuild source for local drilldown history and stream-end snapshots.
|
|
18
|
+
* `productDetailsWithSimilars` keeps PDP + appended similar grid in sync when
|
|
19
|
+
* similars arrive in a second stream chunk (DOM append does not update `spec` alone).
|
|
20
|
+
*/
|
|
21
|
+
export type PanelSource = {
|
|
22
|
+
kind: 'spec';
|
|
23
|
+
spec: UISpec;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'productDetailsWithSimilars';
|
|
26
|
+
pdpSpec: UISpec;
|
|
27
|
+
similarsSpec: UISpec;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'favorites';
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'history';
|
|
32
|
+
};
|
|
33
|
+
export type PanelSnapshotOptions = {
|
|
34
|
+
rebuild?: (() => HTMLElement) | undefined;
|
|
35
|
+
source?: PanelSource | undefined;
|
|
36
|
+
threadId?: string | undefined;
|
|
37
|
+
};
|
|
16
38
|
export declare class PanelManager {
|
|
17
39
|
private readonly deps;
|
|
18
40
|
/** Panel content snapshots keyed by bot message ID for history navigation. */
|
|
19
41
|
readonly snapshots: Map<string, HTMLElement>;
|
|
20
42
|
/** Rebuild functions keyed by message ID — produce fresh DOM with live event listeners. */
|
|
21
43
|
private readonly _snapshotRebuilders;
|
|
44
|
+
private readonly _snapshotSources;
|
|
45
|
+
private readonly _threadSources;
|
|
22
46
|
/** Component type for each panel snapshot (for topbar title restoration). */
|
|
23
47
|
readonly snapshotTypes: Map<string, string>;
|
|
24
48
|
/** Currently active (highlighted) message ID in the chat pane. */
|
|
@@ -30,12 +54,16 @@ export declare class PanelManager {
|
|
|
30
54
|
/** Action type that triggered the current stream (for panel title disambiguation). */
|
|
31
55
|
lastActionType: string | null;
|
|
32
56
|
constructor(deps: PanelManagerDeps);
|
|
57
|
+
clearSnapshots(): void;
|
|
58
|
+
sourceForMessage(messageId: string): PanelSource | null;
|
|
59
|
+
sourceForThread(threadId: string): PanelSource | null;
|
|
60
|
+
componentTypeForSource(source: PanelSource): string;
|
|
33
61
|
/**
|
|
34
62
|
* Snapshot the current panel state for a message. Stores a rebuild function
|
|
35
63
|
* (preferred — produces fresh DOM with live event listeners) alongside a
|
|
36
64
|
* static DOM clone as fallback.
|
|
37
65
|
*/
|
|
38
|
-
snapshotForMessage(messageId: string,
|
|
66
|
+
snapshotForMessage(messageId: string, options?: PanelSnapshotOptions | (() => HTMLElement) | undefined): void;
|
|
39
67
|
/**
|
|
40
68
|
* Restore the panel content snapshot associated with a given message ID.
|
|
41
69
|
* Highlights the active message and de-highlights the previous one.
|
package/dist/chat/runtime.d.ts
CHANGED
|
@@ -251,6 +251,10 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
251
251
|
private _coerceSkuKey;
|
|
252
252
|
private _productSkuKey;
|
|
253
253
|
private _pdpPageContextSkuKey;
|
|
254
|
+
private _productDetailsRecordFromSpec;
|
|
255
|
+
private _getCurrentPanelProductRecord;
|
|
256
|
+
private _panelSourceFromMessage;
|
|
257
|
+
private _getLatestProductDetailsRecord;
|
|
254
258
|
/**
|
|
255
259
|
* Returns the SKU of the product currently rendered in the side panel, if any.
|
|
256
260
|
*
|
|
@@ -329,6 +333,9 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
329
333
|
private _mountChoicePrompter;
|
|
330
334
|
private _parseAddToCartActionPayload;
|
|
331
335
|
private _coerceAddToCartString;
|
|
336
|
+
private _maybeHandleDirectAddToCartCommand;
|
|
337
|
+
private _resolveCurrentProductAddToCartParams;
|
|
338
|
+
private _extractAddToCartParamsFromRecord;
|
|
332
339
|
private _runChatAddToCartFlow;
|
|
333
340
|
/**
|
|
334
341
|
* Build a ChatUISpecRenderContext with all callbacks wired up.
|
package/dist/chat-runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, d as t, i as r, l as s, n, o as i, r as l, s as C, t as c, u as d } from "./runtime-
|
|
1
|
+
import { c as e, d as t, i as r, l as s, n, o as i, r as l, s as C, t as c, u as d } from "./runtime-DP_D5fV6.js";
|
|
2
2
|
export {
|
|
3
3
|
s as CHAT_SCROLL_ELEMENT_ID,
|
|
4
4
|
r as ChatPresentationState,
|