@gengage/assistant-fe 0.6.44 → 0.6.46

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.
@@ -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 dispatch a
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: (sku: string) => void;
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 {};
@@ -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;
@@ -250,6 +250,12 @@ export interface ChatWidgetConfig extends BaseWidgetConfig {
250
250
  export interface ChatI18n {
251
251
  headerTitle: string;
252
252
  inputPlaceholder: string;
253
+ /**
254
+ * Accessible name for the message input `<textarea>` (screen readers).
255
+ * Optional — falls back to `inputPlaceholder` when omitted, so existing
256
+ * consumers and locales need no change. Built-in locales set it.
257
+ */
258
+ inputAriaLabel?: string;
253
259
  sendButton: string;
254
260
  closeButton: string;
255
261
  openButton: 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-D39A30T-.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-DBmJg9TG.js";
2
2
  export {
3
3
  d as CHAT_SCROLL_ELEMENT_ID,
4
4
  s as ChatPresentationState,