@gengage/assistant-fe 0.6.42 → 0.6.45
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/components/ChatDrawer.d.ts +5 -1
- package/dist/chat/components/productMentionLinker.d.ts +5 -5
- package/dist/chat/runtime.d.ts +4 -1
- package/dist/chat/types.d.ts +18 -0
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +12 -12
- package/dist/chat.js +1 -1
- package/dist/common/overlay.d.ts +1 -0
- package/dist/common/transport.d.ts +1 -0
- package/dist/common/types.d.ts +1 -0
- package/dist/{common-B9n_o9ki.js → common-BqApfsJV.js} +2 -2
- package/dist/common.js +7 -7
- package/dist/{connection-warning-ByY3TKaG.js → connection-warning-B829KlSR.js} +1 -1
- package/dist/{fastIntent-BaNC2CJz.js → fastIntent-DtopsdAD.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/{native-webview-Ch9lsx7E.js → native-webview-CYX30O3Q.js} +1 -1
- package/dist/native.iife.js +8 -8
- package/dist/native.js +1 -1
- package/dist/{overlay-CPLLn1eK.js → overlay-BPZEIyo_.js} +1 -1
- package/dist/overlay.js +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +8 -8
- package/dist/qna.js +1 -1
- package/dist/request-response-cache-DIu22gmN.js +1491 -0
- package/dist/{runtime-_ly8XVXC.js → runtime-5Iu4s-BA.js} +1206 -1153
- package/dist/{runtime-CmpEARET.js → runtime-BmIfwBR6.js} +3 -3
- package/dist/{runtime-BkqUiRUi.js → runtime-Dly7YrGI.js} +3 -3
- package/dist/{simbut-CltMk2OF.js → simbut-DN8UCH7t.js} +1 -1
- package/dist/simbut.iife.js +2 -2
- package/dist/simbut.js +1 -1
- package/dist/{simrel-BuCc53Pw.js → simrel-DGfunNnJ.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +3 -3
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-vDXD27_n.js → widget-base-DH9dsYIO.js} +4 -1
- package/package.json +1 -1
- package/dist/request-response-cache-DkilqELR.js +0 -1475
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatI18n, ChatMessage } from '../types.js';
|
|
1
|
+
import type { ChatFooterAttribution, ChatI18n, ChatMessage } from '../types.js';
|
|
2
2
|
/** SVG icon map for suggested action chips/pills. Keys match backend icon names. */
|
|
3
3
|
declare const SUGGESTED_ACTION_ICONS: Record<string, string>;
|
|
4
4
|
export { SUGGESTED_ACTION_ICONS };
|
|
@@ -55,6 +55,8 @@ export interface ChatDrawerOptions {
|
|
|
55
55
|
voiceEnabled?: boolean | undefined;
|
|
56
56
|
/** BCP 47 language for speech recognition. Default: 'tr-TR'. */
|
|
57
57
|
voiceLang?: string | undefined;
|
|
58
|
+
/** Optional footer attribution link/text. Falls back to legacy `i18n.poweredBy` when omitted. */
|
|
59
|
+
footerAttribution?: ChatFooterAttribution | undefined;
|
|
58
60
|
/** Callback fired when the "New Chat" button is clicked. */
|
|
59
61
|
onNewChat?: (() => void) | undefined;
|
|
60
62
|
/**
|
|
@@ -147,6 +149,8 @@ export declare class ChatDrawer {
|
|
|
147
149
|
private _cartToastEl;
|
|
148
150
|
private _cartToastTimerId;
|
|
149
151
|
private _renderPhotoAnalysisCard;
|
|
152
|
+
private _createLegacyHeaderPoweredBy;
|
|
153
|
+
private _createFooterAttribution;
|
|
150
154
|
constructor(container: HTMLElement, options: ChatDrawerOptions);
|
|
151
155
|
addMessage(message: ChatMessage): void;
|
|
152
156
|
/** Remove one transcript bubble (e.g. superseded empty assistant placeholder). */
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
* Product mention linker.
|
|
3
3
|
*
|
|
4
4
|
* After sanitiseHtml() renders bot text, this module walks text nodes and
|
|
5
|
-
* wraps product name occurrences with clickable links that
|
|
6
|
-
* `launchSingleProduct` action.
|
|
5
|
+
* wraps product name occurrences with clickable links that navigate to the
|
|
6
|
+
* product URL when available, otherwise dispatch a `launchSingleProduct` action.
|
|
7
7
|
*
|
|
8
8
|
* XSS safety: Uses DOM text-node manipulation only — no innerHTML.
|
|
9
9
|
*/
|
|
10
|
-
interface ProductMention {
|
|
10
|
+
export interface ProductMention {
|
|
11
11
|
sku: string;
|
|
12
12
|
short_name: string;
|
|
13
|
+
url?: string;
|
|
13
14
|
}
|
|
14
15
|
export interface ProductMentionLinkerOptions {
|
|
15
16
|
container: HTMLElement;
|
|
16
17
|
mentions: ProductMention[];
|
|
17
|
-
onProductClick: (
|
|
18
|
+
onProductClick: (mention: ProductMention) => void;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
21
|
* Walk text nodes in `container` and wrap occurrences of each mention's
|
|
@@ -23,4 +24,3 @@ export interface ProductMentionLinkerOptions {
|
|
|
23
24
|
* Only the first occurrence of each mention is linked to avoid visual clutter.
|
|
24
25
|
*/
|
|
25
26
|
export declare function linkProductMentions(options: ProductMentionLinkerOptions): void;
|
|
26
|
-
export {};
|
package/dist/chat/runtime.d.ts
CHANGED
|
@@ -331,6 +331,9 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
331
331
|
private _restoreFromHistoryRecord;
|
|
332
332
|
private _persistToIndexedDB;
|
|
333
333
|
private _isSameOriginUrl;
|
|
334
|
+
private _enrichProductMentionsWithUrls;
|
|
335
|
+
private _productMentionUrlForSku;
|
|
336
|
+
private _handleProductNavClick;
|
|
334
337
|
private _markUnavailableProductContext;
|
|
335
338
|
private _clearUnavailableProductContext;
|
|
336
339
|
private _hasUnavailableProductContext;
|
|
@@ -417,7 +420,7 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
|
|
|
417
420
|
private _renderUISpec;
|
|
418
421
|
}
|
|
419
422
|
export declare function createChatWidget(): GengageChat;
|
|
420
|
-
export type { ChatWidgetConfig, ChatMessage, ChatSession, ChatUIComponents, ChatI18n, ChatRendererConfig, ChatUISpecRenderContext, ChatUISpecRegistry, ProductSortState, SerializableChatMessage, } from './types.js';
|
|
423
|
+
export type { ChatFooterAttribution, ChatWidgetConfig, ChatMessage, ChatSession, ChatUIComponents, ChatI18n, ChatRendererConfig, ChatUISpecRenderContext, ChatUISpecRegistry, ProductSortState, SerializableChatMessage, } from './types.js';
|
|
421
424
|
export { renderUISpec, createDefaultChatUISpecRegistry, defaultChatUnknownUISpecRenderer, } from './components/renderUISpec.js';
|
|
422
425
|
export type { UISpecRenderContext } from './components/renderUISpec.js';
|
|
423
426
|
export { getChatScrollElement, invalidateChatScrollCache, CHAT_SCROLL_ELEMENT_ID, } from './utils/get-chat-scroll-element.js';
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -4,6 +4,18 @@ import type { PillLauncherOptions } from '../common/pill-launcher.js';
|
|
|
4
4
|
import type { FloatingLauncherOptions } from './components/FloatingLauncher.js';
|
|
5
5
|
import type { InlineLauncherOptions } from './components/InlineLauncher.js';
|
|
6
6
|
import type { UISpecDomRegistry, UISpecRendererOverrides } from '../common/renderer/index.js';
|
|
7
|
+
export interface ChatFooterAttribution {
|
|
8
|
+
/** Visible footer label. Falls back to legacy `i18n.poweredBy` when omitted. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Optional destination for the footer attribution. When omitted, footer stays plain text. */
|
|
11
|
+
href?: string;
|
|
12
|
+
/** Link target for footer attribution links. Defaults to `_blank`. */
|
|
13
|
+
target?: string;
|
|
14
|
+
/** Link rel for footer attribution links. Defaults to `noopener noreferrer`. */
|
|
15
|
+
rel?: string;
|
|
16
|
+
/** Optional accessible label for the footer attribution link. */
|
|
17
|
+
ariaLabel?: string;
|
|
18
|
+
}
|
|
7
19
|
export interface ChatWidgetConfig extends BaseWidgetConfig {
|
|
8
20
|
/**
|
|
9
21
|
* Widget display variant:
|
|
@@ -81,6 +93,11 @@ export interface ChatWidgetConfig extends BaseWidgetConfig {
|
|
|
81
93
|
* open the merchant's favorites page (same pattern as `onCartClick`). The built-in favorites panel is not opened.
|
|
82
94
|
*/
|
|
83
95
|
onFavoritesClick?: () => void;
|
|
96
|
+
/**
|
|
97
|
+
* Optional footer attribution. When omitted, the footer keeps the legacy `i18n.poweredBy` text.
|
|
98
|
+
* Provide `href` to render the footer attribution as a link.
|
|
99
|
+
*/
|
|
100
|
+
footerAttribution?: ChatFooterAttribution;
|
|
84
101
|
/** Callback fired when the cart icon button in the header is clicked (when headerCartUrl is not set). */
|
|
85
102
|
onCartClick?: () => void;
|
|
86
103
|
/** Hide the launcher on mobile viewports. */
|
|
@@ -237,6 +254,7 @@ export interface ChatI18n {
|
|
|
237
254
|
closeButton: string;
|
|
238
255
|
openButton: string;
|
|
239
256
|
newChatButton: string;
|
|
257
|
+
/** Legacy combined branding string used by the header link + footer text when newer branding config is absent. */
|
|
240
258
|
poweredBy: string;
|
|
241
259
|
errorMessage: string;
|
|
242
260
|
retryButton: string;
|
package/dist/chat-runtime.js
CHANGED
|
@@ -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-
|
|
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-5Iu4s-BA.js";
|
|
2
2
|
export {
|
|
3
3
|
d as CHAT_SCROLL_ELEMENT_ID,
|
|
4
4
|
s as ChatPresentationState,
|