@gengage/assistant-fe 0.3.26 → 0.3.28

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.
@@ -365,7 +365,6 @@ export declare const PhotoAnalysisCardSchema: z.ZodObject<{
365
365
  focus_points: z.ZodOptional<z.ZodArray<z.ZodString>>;
366
366
  celeb_style: z.ZodOptional<z.ZodString>;
367
367
  celeb_style_reason: z.ZodOptional<z.ZodString>;
368
- details: z.ZodArray<z.ZodString>;
369
368
  next_question: z.ZodOptional<z.ZodString>;
370
369
  style_images: z.ZodOptional<z.ZodArray<z.ZodString>>;
371
370
  }, z.core.$strip>;
@@ -765,11 +764,10 @@ export declare const chatCatalog: {
765
764
  focus_points: z.ZodOptional<z.ZodArray<z.ZodString>>;
766
765
  celeb_style: z.ZodOptional<z.ZodString>;
767
766
  celeb_style_reason: z.ZodOptional<z.ZodString>;
768
- details: z.ZodArray<z.ZodString>;
769
767
  next_question: z.ZodOptional<z.ZodString>;
770
768
  style_images: z.ZodOptional<z.ZodArray<z.ZodString>>;
771
769
  }, z.core.$strip>;
772
- readonly description: "Structured photo analysis card with strengths, focus points, celeb vibe, details, and follow-up question.";
770
+ readonly description: "Structured photo analysis card with strengths, focus points, celeb vibe, and follow-up question.";
773
771
  };
774
772
  readonly BeautyPhotoStep: {
775
773
  readonly schema: z.ZodObject<{
@@ -306,7 +306,6 @@ export declare class ChatDrawer {
306
306
  focusPoints?: string[];
307
307
  celebStyle?: string;
308
308
  celebStyleReason?: string;
309
- details: string[];
310
309
  nextQuestion?: string;
311
310
  }): void;
312
311
  /** Mark a message as the first bot message in its thread (for special styling). */
@@ -4,6 +4,7 @@ export type StyleVariation = {
4
4
  style_label?: string;
5
5
  style_mood?: string;
6
6
  image_url?: string;
7
+ status?: string;
7
8
  product_list?: StyleVariationProduct[];
8
9
  recommendation_groups?: Array<{
9
10
  label?: string;
@@ -6,23 +6,15 @@ export interface PhotoAnalysisData {
6
6
  focusPoints?: string[];
7
7
  celebStyle?: string;
8
8
  celebStyleReason?: string;
9
- details: string[];
10
9
  nextQuestion?: string;
11
10
  }
12
11
  /** Extract structured photo-analysis data from a UISpec element's props. */
13
12
  export declare function parsePhotoAnalysisProps(props: Record<string, unknown>): PhotoAnalysisData | null;
14
13
  export declare function renderPhotoAnalysisCard(element: UIElement, ctx: ChatUISpecRenderContext): HTMLElement;
15
- /**
16
- * Renders a photo analysis card into a chat message bubble.
17
- *
18
- * When structured data is available (from a PhotoAnalysisCard UISpec), it renders
19
- * the summary, sections, and follow-up question directly. Otherwise, falls back
20
- * to a sentence-splitting heuristic for old backends that don't send the UISpec.
21
- */
22
- export declare function renderPhotoAnalysisBubble(container: HTMLElement, content: string, labels: {
14
+ /** Renders the structured PhotoAnalysisCard data captured from the UISpec. */
15
+ export declare function renderPhotoAnalysisBubble(container: HTMLElement, labels: {
23
16
  badge: string;
24
17
  strengths: string;
25
18
  focus: string;
26
19
  celebStyle: string;
27
- seeMore: string;
28
20
  }, structured?: PhotoAnalysisData): void;
@@ -50,6 +50,8 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
50
50
  private _lastBackendContext;
51
51
  private _productSort;
52
52
  private _lastSku;
53
+ private _lastPageType;
54
+ private _lastSkuListKey;
53
55
  private _comparisonSelectMode;
54
56
  private _comparisonSelectedSkus;
55
57
  private _comparisonSelectionWarning;
@@ -62,10 +64,12 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
62
64
  private _mobileBreakpoint;
63
65
  private _isMobileViewport;
64
66
  private _pdpLaunched;
67
+ private _plpLaunched;
68
+ private _homepageLaunched;
65
69
  private _entryContextPrimed;
66
- /** True while the initial silent PDP launch request is in flight. */
67
- private _pdpPrimingInFlight;
68
- /** User messages queued until silent PDP priming completes. */
70
+ /** True while a silent context-prime launch (PDP/PLP/homepage) is in flight. */
71
+ private _contextPrimingInFlight;
72
+ /** User messages queued until context priming completes. */
69
73
  private _queuedUserMessages;
70
74
  private _productContextUnavailableSku;
71
75
  private _i18n;
@@ -181,6 +185,8 @@ export declare class GengageChat extends BaseWidget<ChatWidgetConfig> {
181
185
  private _readContextStringField;
182
186
  private _readContextStringListField;
183
187
  private _buildEntryOpeningPageDetails;
188
+ /** True when the current page type has a dedicated silent auto-launch that provides its own greeting. */
189
+ private _hasDedicatedContextLaunch;
184
190
  private _shouldPrimeContextualOpening;
185
191
  private _maybePrimeEntryContextOpening;
186
192
  private _hideDrawer;
@@ -194,6 +194,10 @@ export interface ChatI18n {
194
194
  watchStylesPreparedTitle: string;
195
195
  /** Label for products that were not included in a backend recommendation group. */
196
196
  consultingOtherCompatibleProductsLabel: string;
197
+ consultingStyleLoadingDescription: string;
198
+ consultingStyleUnavailableDescription: string;
199
+ consultingStyleLoadingBadge: string;
200
+ consultingStyleUnavailableBadge: string;
197
201
  choicePrompterHeading: string;
198
202
  choicePrompterSuggestion: string;
199
203
  choicePrompterCta: string;
@@ -266,8 +270,6 @@ export interface ChatI18n {
266
270
  photoAnalysisFocusLabel: string;
267
271
  /** Photo analysis section label: celeb style match. */
268
272
  photoAnalysisCelebStyleLabel: string;
269
- /** Photo analysis expander summary text. */
270
- photoAnalysisSeeMoreLabel: string;
271
273
  /** Beauty photo step card: title. */
272
274
  beautyPhotoStepTitle: string;
273
275
  /** Beauty photo step card: description. */
@@ -333,7 +335,7 @@ export interface ChatUISpecRenderContext {
333
335
  onProductSelect?: (product: Record<string, unknown>) => void;
334
336
  pricing?: import('../common/price-formatter.js').PriceFormatConfig | undefined;
335
337
  productPriceUi?: ProductPriceUiConfig | undefined;
336
- i18n?: Pick<ChatI18n, 'productCtaLabel' | 'viewOnSiteLabel' | 'aiTopPicksTitle' | 'roleWinner' | 'roleBestValue' | 'roleBestAlternative' | 'viewDetails' | 'groundingReviewCta' | 'groundingReviewSubtitle' | 'variantsLabel' | 'sortRelated' | 'sortPriceAsc' | 'sortPriceDesc' | 'sortToolbarAriaLabel' | 'compareSelected' | 'compareMinHint' | 'comparisonSelectLabel' | 'comparisonSelectedLabel' | 'comparisonSelectCardHint' | 'panelTitleProductDetails' | 'panelTitleSimilarProducts' | 'panelTitleComparisonResults' | 'panelTitleCategories' | 'panelTitleSearchResults' | 'inStockLabel' | 'outOfStockLabel' | 'findSimilarLabel' | 'galleryPrevAriaLabel' | 'galleryNextAriaLabel' | 'beautyStylesPreparedTitle' | 'watchStylesPreparedTitle' | 'consultingOtherCompatibleProductsLabel' | 'viewMoreLabel' | 'similarProductsLabel' | 'addToCartButton' | 'shareButton' | 'productInfoTab' | 'specificationsTab' | 'recommendedChoiceLabel' | 'highlightsLabel' | 'keyDifferencesLabel' | 'specialCasesLabel' | 'emptyReviewsMessage' | 'closeAriaLabel' | 'dismissAriaLabel' | 'startChatLabel' | 'handoffHeading' | 'customerReviewsTitle' | 'addToFavoritesLabel' | 'reviewFilterPositive' | 'reviewFilterNegative' | 'decreaseLabel' | 'increaseLabel' | 'reviewCustomersMentionSingular' | 'reviewCustomersMentionPlural' | 'reviewSubjectsHeading' | 'aiBrowseCategoriesTitle' | 'photoAnalysisBadge' | 'photoAnalysisStrengthsLabel' | 'photoAnalysisFocusLabel' | 'photoAnalysisCelebStyleLabel' | 'photoAnalysisSeeMoreLabel' | 'beautyPhotoStepTitle' | 'beautyPhotoStepDescription' | 'beautyPhotoStepUpload' | 'beautyPhotoStepProcessing' | 'beautyPhotoStepSkip'>;
338
+ i18n?: Pick<ChatI18n, 'productCtaLabel' | 'viewOnSiteLabel' | 'aiTopPicksTitle' | 'roleWinner' | 'roleBestValue' | 'roleBestAlternative' | 'viewDetails' | 'groundingReviewCta' | 'groundingReviewSubtitle' | 'variantsLabel' | 'sortRelated' | 'sortPriceAsc' | 'sortPriceDesc' | 'sortToolbarAriaLabel' | 'compareSelected' | 'compareMinHint' | 'comparisonSelectLabel' | 'comparisonSelectedLabel' | 'comparisonSelectCardHint' | 'panelTitleProductDetails' | 'panelTitleSimilarProducts' | 'panelTitleComparisonResults' | 'panelTitleCategories' | 'panelTitleSearchResults' | 'inStockLabel' | 'outOfStockLabel' | 'findSimilarLabel' | 'galleryPrevAriaLabel' | 'galleryNextAriaLabel' | 'beautyStylesPreparedTitle' | 'watchStylesPreparedTitle' | 'consultingOtherCompatibleProductsLabel' | 'consultingStyleLoadingDescription' | 'consultingStyleUnavailableDescription' | 'consultingStyleLoadingBadge' | 'consultingStyleUnavailableBadge' | 'viewMoreLabel' | 'similarProductsLabel' | 'addToCartButton' | 'shareButton' | 'productInfoTab' | 'specificationsTab' | 'recommendedChoiceLabel' | 'highlightsLabel' | 'keyDifferencesLabel' | 'specialCasesLabel' | 'emptyReviewsMessage' | 'closeAriaLabel' | 'dismissAriaLabel' | 'startChatLabel' | 'handoffHeading' | 'customerReviewsTitle' | 'addToFavoritesLabel' | 'reviewFilterPositive' | 'reviewFilterNegative' | 'decreaseLabel' | 'increaseLabel' | 'reviewCustomersMentionSingular' | 'reviewCustomersMentionPlural' | 'reviewSubjectsHeading' | 'aiBrowseCategoriesTitle' | 'photoAnalysisBadge' | 'photoAnalysisStrengthsLabel' | 'photoAnalysisFocusLabel' | 'photoAnalysisCelebStyleLabel' | 'beautyPhotoStepTitle' | 'beautyPhotoStepDescription' | 'beautyPhotoStepUpload' | 'beautyPhotoStepProcessing' | 'beautyPhotoStepSkip'>;
337
339
  productSort?: ProductSortState | undefined;
338
340
  onSortChange?: ((sort: ProductSortState) => void) | undefined;
339
341
  comparisonSelectMode?: boolean | undefined;
@@ -373,14 +375,13 @@ export interface ChatMessage {
373
375
  silent?: boolean;
374
376
  /** Backend render hint for special rendering (e.g. "photo_analysis"). */
375
377
  renderHint?: string;
376
- /** Structured photo analysis data from PhotoAnalysisCard UISpec (preferred over sentence-splitting). */
378
+ /** Structured photo analysis data from PhotoAnalysisCard UISpec. */
377
379
  photoAnalysis?: {
378
380
  summary: string;
379
381
  strengths?: string[];
380
382
  focusPoints?: string[];
381
383
  celebStyle?: string;
382
384
  celebStyleReason?: string;
383
- details: string[];
384
385
  nextQuestion?: string;
385
386
  };
386
387
  timestamp: number;