@gengage/assistant-fe 0.4.17 → 0.4.19
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/runtime.d.ts +10 -0
- package/dist/chat/types.d.ts +65 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +37 -37
- package/dist/chat.js +1 -1
- package/dist/common/overlay.d.ts +2 -0
- package/dist/{common-Bxy1FrAk.js → common-Bpp43wr0.js} +1 -1
- package/dist/common.js +3 -3
- package/dist/index.js +4 -4
- package/dist/{native-webview-BsRcv49q.js → native-webview-Bbcvvi_5.js} +1 -1
- package/dist/native.iife.js +11 -11
- package/dist/native.js +1 -1
- package/dist/{overlay-CfnBuj7M.js → overlay-O4nlUrzw.js} +1 -1
- package/dist/overlay.js +1 -1
- package/dist/{runtime-NJI0NPN6.js → runtime-DhdfOJEN.js} +1815 -1699
- package/package.json +1 -1
package/dist/chat/runtime.d.ts
CHANGED
|
@@ -115,6 +115,8 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
115
115
|
private static readonly _MAX_PANEL_HISTORY;
|
|
116
116
|
/** Tracks how the current panel content was produced, for history/error-recovery rebuild. */
|
|
117
117
|
private _currentPanelSource;
|
|
118
|
+
/** Latest inline PDP summary product, used when productDetailsExtended keeps PDP details out of the panel. */
|
|
119
|
+
private _currentInlineProductSummaryRecord;
|
|
118
120
|
/** IndexedDB session persistence manager. */
|
|
119
121
|
private _session;
|
|
120
122
|
/** LocalStorage-backed chat history manager. */
|
|
@@ -131,6 +133,7 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
131
133
|
private _consecutiveErrorCount;
|
|
132
134
|
/** Last error message text for deduplication. */
|
|
133
135
|
private _lastErrorMessage;
|
|
136
|
+
private _launcherAnchorCleanup;
|
|
134
137
|
private _modeController;
|
|
135
138
|
/** @deprecated Alias for backward compat in tests. Use _modeController.mode. */
|
|
136
139
|
get _assistantMode(): AssistantMode;
|
|
@@ -142,6 +145,9 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
142
145
|
protected onUpdate(context: Partial<PageContext>): void;
|
|
143
146
|
protected onShow(): void;
|
|
144
147
|
protected onHide(): void;
|
|
148
|
+
private _setupLauncherAnchor;
|
|
149
|
+
syncLauncherAnchor(): void;
|
|
150
|
+
private _syncLauncherAnchor;
|
|
145
151
|
protected onDestroy(): void;
|
|
146
152
|
open(options?: {
|
|
147
153
|
state?: 'full' | 'half';
|
|
@@ -252,9 +258,13 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
252
258
|
private _productSkuKey;
|
|
253
259
|
private _pdpPageContextSkuKey;
|
|
254
260
|
private _productDetailsRecordFromSpec;
|
|
261
|
+
private _productGridRecordFromSpec;
|
|
262
|
+
private _productRecordMatchesSku;
|
|
255
263
|
private _getCurrentPanelProductRecord;
|
|
264
|
+
private _getCurrentPanelProductGridRecord;
|
|
256
265
|
private _panelSourceFromMessage;
|
|
257
266
|
private _getLatestProductDetailsRecord;
|
|
267
|
+
private _getLatestProductGridRecord;
|
|
258
268
|
/**
|
|
259
269
|
* Returns the SKU of the product currently rendered in the side panel, if any.
|
|
260
270
|
*
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -82,6 +82,71 @@ export interface ChatWidgetConfig extends BaseWidgetConfig {
|
|
|
82
82
|
hideMobileLauncher?: boolean;
|
|
83
83
|
/** Mobile breakpoint in px (default: 768). */
|
|
84
84
|
mobileBreakpoint?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Dynamically positions the launcher relative to a page element per viewport.
|
|
87
|
+
* ResizeObserver tracks the element and updates the launcher CSS variables on
|
|
88
|
+
* every resize — no static overrides needed. Call `syncLauncherAnchor()` from
|
|
89
|
+
* SPA navigation handlers to re-query anchors after page transitions.
|
|
90
|
+
*
|
|
91
|
+
* Offset semantics:
|
|
92
|
+
* - `0` → launcher edge aligns with the element's same edge (overlap, no gap)
|
|
93
|
+
* - `N>0` → launcher is N px outside the element's far edge
|
|
94
|
+
*
|
|
95
|
+
* `bottomOffset`: 0 = align with el.bottom, N = N px above el.top
|
|
96
|
+
* `rightOffset`: 0 = align with el.right, N = N px left of el.left
|
|
97
|
+
*/
|
|
98
|
+
launcherAnchor?: {
|
|
99
|
+
mobile?: {
|
|
100
|
+
/**
|
|
101
|
+
* Anchor source element selector. If omitted, `bottom` / `right` offsets are
|
|
102
|
+
* applied directly from viewport edges (without element tracking).
|
|
103
|
+
*/
|
|
104
|
+
selector?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Vertical anchor. `offset` is the distance in px; `type` controls the reference:
|
|
107
|
+
* - `'gap'` (default): offset=0 → launcher bottom = element bottom;
|
|
108
|
+
* offset>0 → launcher sits N px above the element's top edge.
|
|
109
|
+
* - `'root'`: offset always measured from the element's bottom edge;
|
|
110
|
+
* offset=0 → launcher bottom = element bottom; N > 0 → N px above element's bottom.
|
|
111
|
+
*/
|
|
112
|
+
bottom?: {
|
|
113
|
+
offset: number;
|
|
114
|
+
type?: 'gap' | 'root';
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Horizontal anchor. `offset` is the distance in px; `type` controls the reference:
|
|
118
|
+
* - `'gap'` (default): offset=0 → launcher right = element right;
|
|
119
|
+
* offset>0 → launcher sits N px to the left of the element's left edge.
|
|
120
|
+
* - `'root'`: offset always measured from the element's right edge;
|
|
121
|
+
* offset=0 → launcher right = element right; N > 0 → N px inward from element's right.
|
|
122
|
+
*/
|
|
123
|
+
right?: {
|
|
124
|
+
offset: number;
|
|
125
|
+
type?: 'gap' | 'root';
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* When true, launcher animates to the anchored position when the element
|
|
129
|
+
* scrolls into view, and returns to default when it scrolls out.
|
|
130
|
+
*/
|
|
131
|
+
dynamicRelocate?: boolean;
|
|
132
|
+
};
|
|
133
|
+
desktop?: {
|
|
134
|
+
/**
|
|
135
|
+
* Anchor source element selector. If omitted, `bottom` / `right` offsets are
|
|
136
|
+
* applied directly from viewport edges (without element tracking).
|
|
137
|
+
*/
|
|
138
|
+
selector?: string;
|
|
139
|
+
bottom?: {
|
|
140
|
+
offset: number;
|
|
141
|
+
type?: 'gap' | 'root';
|
|
142
|
+
};
|
|
143
|
+
right?: {
|
|
144
|
+
offset: number;
|
|
145
|
+
type?: 'gap' | 'root';
|
|
146
|
+
};
|
|
147
|
+
dynamicRelocate?: boolean;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
85
150
|
/**
|
|
86
151
|
* Panel display mode:
|
|
87
152
|
* - 'auto' : Panel appears/hides with content; user can toggle (default)
|
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-DhdfOJEN.js";
|
|
2
2
|
export {
|
|
3
3
|
s as CHAT_SCROLL_ELEMENT_ID,
|
|
4
4
|
r as ChatPresentationState,
|