@pushwoosh/websdk-common 6.27.0 → 6.29.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/websdk-common",
3
- "version": "6.27.0",
3
+ "version": "6.29.0",
4
4
  "description": "Code shared by the Pushwoosh WebSDK and the Control Panel, one entry point per module (web-popups: web popup model and renderer; subscription-widget: push subscription widget model and renderer; inbox: web inbox widget and inbox cell previews)",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -5,4 +5,4 @@ import { type WebPopupInlineProps } from './types';
5
5
  * `<img>` is capped by a `<style>` scoped to the wrapper's attribute, so the rule never reaches
6
6
  * the host page, in a shadow root or in the light DOM. Page navigation is internal.
7
7
  */
8
- export declare function WebPopupInline({ params, mode, colorScheme, logger, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, onRequestSubscribe, onRequestRemove, }: WebPopupInlineProps): import("react").JSX.Element | null;
8
+ export declare function WebPopupInline({ params, mode, colorScheme, logger, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, products, onRequestSubscribe, onRequestRemove, }: WebPopupInlineProps): import("react").JSX.Element | null;
@@ -20,6 +20,7 @@ export function WebPopupInline({
20
20
  onSubmitFormValues,
21
21
  onSubmitChoice,
22
22
  onSubmitRating,
23
+ products,
23
24
  onRequestSubscribe,
24
25
  onRequestRemove
25
26
  }) {
@@ -44,6 +45,7 @@ export function WebPopupInline({
44
45
  onSubmitFormValues: onSubmitFormValues,
45
46
  onSubmitChoice: onSubmitChoice,
46
47
  onSubmitRating: onSubmitRating,
48
+ products: products,
47
49
  onRequestSubscribe: onRequestSubscribe,
48
50
  onSubscribeClose: onRequestRemove,
49
51
  logger: logger
@@ -1,4 +1,4 @@
1
1
  import { type WebPopupBoxProps, type WebPopupReaderProps, type WebPopupSlotViewProps } from './types';
2
2
  export declare function WebPopupSlotView({ slot, align, inverse, colors, mode, onRequestClose, onPageChange, onSubmitForm, onSubmitChoice, onSubmitRating, onRequestSubscribe, onSubscribeClose, logger, }: WebPopupSlotViewProps): import("react").JSX.Element;
3
- export declare function WebPopupBox({ page, params, mode, colorScheme, leafRenderers, animatePage, onRequestClose, onPageChange, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, onRequestSubscribe, onSubscribeClose, logger, }: WebPopupBoxProps): import("react").JSX.Element;
4
- export declare function WebPopupReader({ params, mode, colorScheme, onRequestClose, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, onRequestSubscribe, logger, leafRenderers, }: WebPopupReaderProps): import("react").JSX.Element | null;
3
+ export declare function WebPopupBox({ page, params, mode, colorScheme, leafRenderers, animatePage, onRequestClose, onPageChange, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, products, onRequestSubscribe, onSubscribeClose, logger, }: WebPopupBoxProps): import("react").JSX.Element;
4
+ export declare function WebPopupReader({ params, mode, colorScheme, onRequestClose, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, products, onRequestSubscribe, logger, leafRenderers, }: WebPopupReaderProps): import("react").JSX.Element | null;
@@ -8,6 +8,7 @@ import { WEB_POPUP_GLYPH_PATHS, WEB_POPUP_THUMB_UP_PATH } from './glyphs';
8
8
  import { applyWebPopupSubscribeOutcome, placementMaxSize, resolveWebPopupPages, safeUrl, sanitizeWebPopupHtml, startPageOf, webPopupLinkTargetAttrs } from './helpers';
9
9
  import { webPopupBackgroundImageStyle, webPopupContainerStyle, webPopupScrimGradient } from './layout';
10
10
  import { resolveWebPopupBoxChrome, resolveWebPopupColors, webPopupColorAlpha, webPopupDarkEnabled, webPopupImageSrc } from './palette';
11
+ import { ProductsSlotView, WebPopupProductsContext } from './productsSlot';
11
12
  import { WEB_POPUP_CLOSE_ATTRIBUTE } from './styles';
12
13
  import { webPopupTimerLabels, webPopupTimerRemaining } from './timer';
13
14
  // Renders a popup from its model by interpreting each page's embedded layout
@@ -886,6 +887,13 @@ export function WebPopupSlotView({
886
887
  inverse: inverse,
887
888
  colors: colors
888
889
  });
890
+ case 'products':
891
+ return _jsx(ProductsSlotView, {
892
+ slot: slot,
893
+ inverse: inverse,
894
+ colors: colors,
895
+ mode: mode
896
+ });
889
897
  case 'email-input':
890
898
  return _jsx(EmailInputSlotView, {
891
899
  slot: slot,
@@ -1219,6 +1227,7 @@ export function WebPopupBox({
1219
1227
  onSubmitFormValues,
1220
1228
  onSubmitChoice,
1221
1229
  onSubmitRating,
1230
+ products,
1222
1231
  onRequestSubscribe,
1223
1232
  onSubscribeClose,
1224
1233
  logger
@@ -1261,25 +1270,28 @@ export function WebPopupBox({
1261
1270
  style: style,
1262
1271
  children: _jsx(WebPopupFormSessionContext.Provider, {
1263
1272
  value: formSession,
1264
- children: _jsx("div", {
1265
- style: pageStyle,
1266
- children: _jsx(LayoutNodeView, {
1267
- node: page.layout,
1268
- page: page,
1269
- colors: colors,
1270
- mode: mode,
1271
- scheme: colors.scheme,
1272
- leaf: leafRenderers,
1273
- onRequestClose: onRequestClose,
1274
- onPageChange: onPageChange ?? (() => {}),
1275
- onSubmitForm: onSubmitForm,
1276
- onSubmitChoice: onSubmitChoice,
1277
- onSubmitRating: onSubmitRating,
1278
- onRequestSubscribe: onRequestSubscribe,
1279
- onSubscribeClose: onSubscribeClose,
1280
- logger: logger
1281
- })
1282
- }, page.key)
1273
+ children: _jsx(WebPopupProductsContext.Provider, {
1274
+ value: products,
1275
+ children: _jsx("div", {
1276
+ style: pageStyle,
1277
+ children: _jsx(LayoutNodeView, {
1278
+ node: page.layout,
1279
+ page: page,
1280
+ colors: colors,
1281
+ mode: mode,
1282
+ scheme: colors.scheme,
1283
+ leaf: leafRenderers,
1284
+ onRequestClose: onRequestClose,
1285
+ onPageChange: onPageChange ?? (() => {}),
1286
+ onSubmitForm: onSubmitForm,
1287
+ onSubmitChoice: onSubmitChoice,
1288
+ onSubmitRating: onSubmitRating,
1289
+ onRequestSubscribe: onRequestSubscribe,
1290
+ onSubscribeClose: onSubscribeClose,
1291
+ logger: logger
1292
+ })
1293
+ }, page.key)
1294
+ })
1283
1295
  })
1284
1296
  });
1285
1297
  }
@@ -1362,6 +1374,7 @@ export function WebPopupReader({
1362
1374
  onSubmitFormValues,
1363
1375
  onSubmitChoice,
1364
1376
  onSubmitRating,
1377
+ products,
1365
1378
  onRequestSubscribe,
1366
1379
  logger,
1367
1380
  leafRenderers
@@ -1411,6 +1424,7 @@ export function WebPopupReader({
1411
1424
  onSubmitFormValues: onSubmitFormValues,
1412
1425
  onSubmitChoice: onSubmitChoice,
1413
1426
  onSubmitRating: onSubmitRating,
1427
+ products: products,
1414
1428
  onRequestSubscribe: onRequestSubscribe,
1415
1429
  onSubscribeClose: onRequestClose,
1416
1430
  logger: logger
@@ -1448,6 +1462,7 @@ export function WebPopupReader({
1448
1462
  onSubmitFormValues: onSubmitFormValues,
1449
1463
  onSubmitChoice: onSubmitChoice,
1450
1464
  onSubmitRating: onSubmitRating,
1465
+ products: products,
1451
1466
  onRequestSubscribe: onRequestSubscribe,
1452
1467
  onSubscribeClose: onRequestClose,
1453
1468
  logger: logger
@@ -60,6 +60,15 @@ export declare const WEB_POPUP_CHOICE_DEFAULTS: {
60
60
  readonly submitLabel: "Save";
61
61
  readonly successMessage: "Thanks! Your choice is saved.";
62
62
  };
63
+ export declare const WEB_POPUP_PRODUCTS_DEFAULTS: {
64
+ readonly ctaText: "Shop now";
65
+ readonly limit: 4;
66
+ };
67
+ export declare const WEB_POPUP_PRODUCTS_MAX_LIMIT = 12;
68
+ /** Cards a products slot draws without a host: enough to read as a row, never the full limit. */
69
+ export declare const WEB_POPUP_PRODUCTS_PLACEHOLDERS = 3;
70
+ /** How long one products answer serves both the host's pre-show check and the render. */
71
+ export declare const WEB_POPUP_PRODUCTS_CACHE_MS: number;
63
72
  export declare const WEB_POPUP_RATING_DEFAULTS: {
64
73
  readonly submitLabel: "Send";
65
74
  readonly successMessage: "Thanks for the feedback!";
@@ -190,6 +190,15 @@ export const WEB_POPUP_CHOICE_DEFAULTS = {
190
190
  submitLabel: 'Save',
191
191
  successMessage: 'Thanks! Your choice is saved.'
192
192
  };
193
+ export const WEB_POPUP_PRODUCTS_DEFAULTS = {
194
+ ctaText: 'Shop now',
195
+ limit: 4
196
+ };
197
+ export const WEB_POPUP_PRODUCTS_MAX_LIMIT = 12;
198
+ /** Cards a products slot draws without a host: enough to read as a row, never the full limit. */
199
+ export const WEB_POPUP_PRODUCTS_PLACEHOLDERS = 3;
200
+ /** How long one products answer serves both the host's pre-show check and the render. */
201
+ export const WEB_POPUP_PRODUCTS_CACHE_MS = 60 * 1000;
193
202
  // Same, for a rating slot.
194
203
  export const WEB_POPUP_RATING_DEFAULTS = {
195
204
  submitLabel: 'Send',
@@ -1,4 +1,4 @@
1
- import { type WebPopupButtonAction, type WebPopupColors, type WebPopupDark, type WebPopupJson, type WebPopupLogger, type WebPopupPageParams, type WebPopupParams, type WebPopupPlacement, type WebPopupResolvedPage, type WebPopupValueParam } from './types';
1
+ import { type WebPopupButtonAction, type WebPopupColors, type WebPopupDark, type WebPopupJson, type WebPopupLogger, type WebPopupPageParams, type WebPopupParams, type WebPopupPlacement, type WebPopupProductsSlot, type WebPopupResolvedPage, type WebPopupValueParam } from './types';
2
2
  export declare function safeUrl(url: string | undefined): string | undefined;
3
3
  /**
4
4
  * The target/rel pair a popup link renders with: only an exact '_self' opts
@@ -55,6 +55,8 @@ export declare function webPopupValuesMap(values: WebPopupValueParam[]): Record<
55
55
  * json.
56
56
  */
57
57
  export declare function collectWebPopupFormCodes(params: WebPopupParams): string[];
58
+ /** Every products slot of the popup, normalized: the host's pre-show question for `hideWhenEmpty`. */
59
+ export declare function collectWebPopupProductSlots(params: WebPopupParams): WebPopupProductsSlot[];
58
60
  export declare function webPopupExpired(params: WebPopupParams, nowMs: number): boolean;
59
61
  /**
60
62
  * The popup box-size ceiling px, mirroring the layout tree's px clamp: the
@@ -1,4 +1,4 @@
1
- import { SAFE_URL_PROTOCOL, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_DEFAULT_COLORS, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_VERSION } from './constants';
1
+ import { SAFE_URL_PROTOCOL, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_DEFAULT_COLORS, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_PRODUCTS_DEFAULTS, WEB_POPUP_PRODUCTS_MAX_LIMIT, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_VERSION } from './constants';
2
2
  import { WEB_POPUP_GLYPH_NAMES, WEB_POPUP_GLYPH_SIZES } from './glyphs';
3
3
  import { normalizeWebPopupLayout, substituteWebPopupLayoutValues, WEB_POPUP_VALUE_KEY_PATTERN } from './layout';
4
4
  import { autoDarkWebPopupColors } from './palette';
@@ -415,6 +415,11 @@ function normalizeFormFields(raw) {
415
415
  return out.slice(0, MAX_FORM_FIELDS);
416
416
  }
417
417
  const CHOICE_CONTROLS = ['checkbox', 'chips'];
418
+ const PRODUCTS_STRATEGIES = ['viewed', 'bestsellers_30d', 'also_bought', 'cart'];
419
+ function productsStrategy(value) {
420
+ return PRODUCTS_STRATEGIES.includes(value) ? value : undefined;
421
+ }
422
+ const PRODUCTS_LAYOUTS = ['row', 'grid'];
418
423
  const RATING_SCALES = ['nps', 'stars', 'thumbs'];
419
424
  const RATING_SUBMIT_MODES = ['instant', 'button'];
420
425
  const TIMER_EXPIRE_ACTIONS = ['keep', 'hide-popup', 'page'];
@@ -572,6 +577,33 @@ function normalizeSlots(raw) {
572
577
  });
573
578
  continue;
574
579
  }
580
+ if (slot.type === 'products') {
581
+ const fields = typeof slot.fields === 'object' && slot.fields !== null ? slot.fields : {};
582
+ const limit = Number.isFinite(slot.limit) ? Math.round(slot.limit) : WEB_POPUP_PRODUCTS_DEFAULTS.limit;
583
+ // A strategy this build doesn't know would ask the feed for nothing — bestsellers always answer.
584
+ const strategy = productsStrategy(slot.strategy) ?? 'bestsellers_30d';
585
+ // The same as the strategy = no fallback: a second identical request finds nothing new.
586
+ const fallback = productsStrategy(slot.fallbackStrategy);
587
+ out.push({
588
+ type: 'products',
589
+ key: slot.key,
590
+ strategy,
591
+ ...(fallback && fallback !== strategy ? {
592
+ fallbackStrategy: fallback
593
+ } : {}),
594
+ limit: Math.min(Math.max(limit, 1), WEB_POPUP_PRODUCTS_MAX_LIMIT),
595
+ layout: PRODUCTS_LAYOUTS.includes(slot.layout) ? slot.layout : 'row',
596
+ fields: {
597
+ title: fields.title !== false,
598
+ price: fields.price !== false,
599
+ image: fields.image !== false,
600
+ cta: fields.cta !== false
601
+ },
602
+ ctaText: slotString(slot.ctaText),
603
+ hideWhenEmpty: slot.hideWhenEmpty === true
604
+ });
605
+ continue;
606
+ }
575
607
  if (slot.type === 'email-input') {
576
608
  out.push({
577
609
  type: 'email-input',
@@ -678,6 +710,20 @@ export function collectWebPopupFormCodes(params) {
678
710
  }
679
711
  return [...out];
680
712
  }
713
+ /** Every products slot of the popup, normalized: the host's pre-show question for `hideWhenEmpty`. */
714
+ export function collectWebPopupProductSlots(params) {
715
+ const out = [];
716
+ for (const page of params.pages) {
717
+ if (!Array.isArray(page?.contents)) continue;
718
+ for (const zone of page.contents) {
719
+ if (!Array.isArray(zone?.slots)) continue;
720
+ for (const slot of normalizeSlots(zone.slots)) {
721
+ if (slot.type === 'products') out.push(slot);
722
+ }
723
+ }
724
+ }
725
+ return out;
726
+ }
681
727
  // Has a 'hide-popup' countdown run out? The HOST asks before showing, at SHOW
682
728
  // time; any page counts, and a malformed timer reads as 'not expired'.
683
729
  export function webPopupExpired(params, nowMs) {
@@ -1,12 +1,13 @@
1
1
  export { WebPopupReader, WebPopupBox, WebPopupSlotView } from './WebPopupReader';
2
2
  export { WebPopupInline } from './WebPopupInline';
3
+ export { loadWebPopupProducts } from './productsSlot';
3
4
  export { WEB_POPUP_CLOSE_ATTRIBUTE, WEB_POPUP_SUBMIT_ATTRIBUTE } from './styles';
4
5
  export { WEB_POPUP_TEMPLATES, findWebPopupTemplate } from './templates';
5
- export { parseWebPopupJson, stringifyWebPopup, resolveWebPopupPages, resolveWebPopupPageSize, startPageOf, safeUrl, sanitizeWebPopupHtml, normalizeWebPopupColors, normalizeWebPopupValues, webPopupValuesMap, collectWebPopupFormCodes, webPopupExpired, normalizeWebPopupDark, WEB_POPUP_MAX_SIZE_PX, isWebPopupCloseButton, webPopupPageWithoutCloseButtons, webPopupParamsWithoutCloseButtons, } from './helpers';
6
+ export { parseWebPopupJson, stringifyWebPopup, resolveWebPopupPages, resolveWebPopupPageSize, startPageOf, safeUrl, sanitizeWebPopupHtml, normalizeWebPopupColors, normalizeWebPopupValues, webPopupValuesMap, collectWebPopupFormCodes, collectWebPopupProductSlots, webPopupExpired, normalizeWebPopupDark, WEB_POPUP_MAX_SIZE_PX, isWebPopupCloseButton, webPopupPageWithoutCloseButtons, webPopupParamsWithoutCloseButtons, } from './helpers';
6
7
  export { webPopupHasForm } from './form';
7
8
  export { webPopupTimerLabels, webPopupTimerRemaining, webPopupTimeZoneSupported, webPopupWallClockMs, type WebPopupTimerLabels, } from './timer';
8
9
  export { normalizeWebPopupLayout, substituteWebPopupLayoutValues, WEB_POPUP_VALUE_KEY_PATTERN, webPopupBackgroundImageStyle, webPopupContainerStyle, webPopupCssLength, webPopupPaddingValue, webPopupTracksValue, } from './layout';
9
- export { WEB_POPUP_VERSION, WEB_POPUP_FONT_STACK, WEB_POPUP_TEXT_COLOR, WEB_POPUP_TEXT_SECONDARY_COLOR, WEB_POPUP_ACCENT_COLOR, WEB_POPUP_BACKGROUND_COLOR, WEB_POPUP_DEFAULT_COLORS, webPopupTextColor, WEB_POPUP_TEXT_VARIANT_STYLES, WEB_POPUP_BG_SECTION_FALLBACK, WEB_POPUP_TEXT_SLOT_PADDING, WEB_POPUP_BUTTON_SLOT_PADDING, webPopupSlotGap, webPopupSlotRole, type WebPopupSlotRole, WEB_POPUP_DEFAULT_WIDTH, WEB_POPUP_INLINE_IMAGE_MAX_HEIGHT, WEB_POPUP_LAYOUT_MAX_DEPTH, WEB_POPUP_LAYOUT_MAX_NODES, webPopupButtonPillStyle, webPopupFormInputStyle, WEB_POPUP_FORM_INPUT_BORDER, WEB_POPUP_FORM_ERROR_COLOR, WEB_POPUP_FORM_ERROR_COLOR_DARK, WEB_POPUP_ON_ACCENT_COLOR, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_RETRY_ERROR, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, webPopupRatingScores, } from './constants';
10
+ export { WEB_POPUP_VERSION, WEB_POPUP_FONT_STACK, WEB_POPUP_TEXT_COLOR, WEB_POPUP_TEXT_SECONDARY_COLOR, WEB_POPUP_ACCENT_COLOR, WEB_POPUP_BACKGROUND_COLOR, WEB_POPUP_DEFAULT_COLORS, webPopupTextColor, WEB_POPUP_TEXT_VARIANT_STYLES, WEB_POPUP_BG_SECTION_FALLBACK, WEB_POPUP_TEXT_SLOT_PADDING, WEB_POPUP_BUTTON_SLOT_PADDING, webPopupSlotGap, webPopupSlotRole, type WebPopupSlotRole, WEB_POPUP_DEFAULT_WIDTH, WEB_POPUP_INLINE_IMAGE_MAX_HEIGHT, WEB_POPUP_LAYOUT_MAX_DEPTH, WEB_POPUP_LAYOUT_MAX_NODES, webPopupButtonPillStyle, webPopupFormInputStyle, WEB_POPUP_FORM_INPUT_BORDER, WEB_POPUP_FORM_ERROR_COLOR, WEB_POPUP_FORM_ERROR_COLOR_DARK, WEB_POPUP_ON_ACCENT_COLOR, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_PRODUCTS_DEFAULTS, WEB_POPUP_PRODUCTS_MAX_LIMIT, WEB_POPUP_PRODUCTS_CACHE_MS, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_RETRY_ERROR, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, webPopupRatingScores, } from './constants';
10
11
  export { resolveWebPopupBoxChrome, resolveWebPopupColors, autoDarkWebPopupColors, webPopupColorAlpha, webPopupDarkColors, webPopupDarkEnabled, webPopupEffectiveScheme, webPopupImageSrc, webPopupMixColor, webPopupShiftColor, } from './palette';
11
12
  export { WEB_POPUP_GLYPH_NAMES, WEB_POPUP_GLYPH_PATHS, WEB_POPUP_GLYPH_SIZES, WEB_POPUP_THUMB_UP_PATH, } from './glyphs';
12
- export { type WebPopupJson, type WebPopupKind, type WebPopupParams, type WebPopupColors, type WebPopupChrome, type WebPopupPageParams, type WebPopupResolvedPage, type WebPopupDark, type WebPopupResolvedColors, type WebPopupColorScheme, type WebPopupColorSchemePref, type WebPopupSlot, type WebPopupImage, type WebPopupVideo, type WebPopupPlacement, type WebPopupOverlay, type WebPopupAnimation, type WebPopupButtonAction, type WebPopupButtonVariant, type WebPopupTextVariant, type WebPopupTextAlign, type WebPopupVAnchor, type WebPopupHAnchor, type WebPopupReaderMode, type WebPopupReaderProps, type WebPopupLeafRenderers, type WebPopupBoxProps, type WebPopupInlineProps, type WebPopupLayoutNode, type WebPopupContainerNode, type WebPopupContentNode, type WebPopupImageNode, type WebPopupContainerType, type WebPopupContainerProps, type WebPopupContentZone, type WebPopupContentTone, type WebPopupCssLength, type WebPopupBoxSides, type WebPopupAlignItems, type WebPopupJustifyContent, type WebPopupValueParam, type WebPopupValueControl, type WebPopupLengthUnit, type WebPopupLengthRange, type WebPopupValueRef, type WebPopupTemplate, type WebPopupFormField, type WebPopupFormFieldKind, type WebPopupFormPrivacy, type WebPopupFormSubmitPayload, type WebPopupFormSubmitResult, type WebPopupFormSubmitHandler, type WebPopupEmailInputSlot, type WebPopupTagInputSlot, type WebPopupConsentSlot, type WebPopupSubmitSlot, type WebPopupFormValues, type WebPopupFormValuesSubmitResult, type WebPopupFormValuesSubmitHandler, type WebPopupTimerSlot, type WebPopupTimerExpireAction, type WebPopupTimerRemaining, type WebPopupChoiceSlot, type WebPopupChoiceOption, type WebPopupChoiceControl, type WebPopupChoiceSubmitPayload, type WebPopupChoiceSubmitHandler, type WebPopupRatingSlot, type WebPopupRatingScale, type WebPopupRatingSubmitMode, type WebPopupRatingSubmitPayload, type WebPopupRatingSubmitHandler, type WebPopupSubscribeResult, type WebPopupSubscribeOutcome, type WebPopupLogger, type WebPopupGlyphSlot, type WebPopupGlyphName, type WebPopupGlyphSize, type WebPopupSlotViewProps, } from './types';
13
+ export { type WebPopupJson, type WebPopupKind, type WebPopupParams, type WebPopupColors, type WebPopupChrome, type WebPopupPageParams, type WebPopupResolvedPage, type WebPopupDark, type WebPopupResolvedColors, type WebPopupColorScheme, type WebPopupColorSchemePref, type WebPopupSlot, type WebPopupImage, type WebPopupVideo, type WebPopupPlacement, type WebPopupOverlay, type WebPopupAnimation, type WebPopupButtonAction, type WebPopupButtonVariant, type WebPopupTextVariant, type WebPopupTextAlign, type WebPopupVAnchor, type WebPopupHAnchor, type WebPopupReaderMode, type WebPopupReaderProps, type WebPopupLeafRenderers, type WebPopupBoxProps, type WebPopupInlineProps, type WebPopupLayoutNode, type WebPopupContainerNode, type WebPopupContentNode, type WebPopupImageNode, type WebPopupContainerType, type WebPopupContainerProps, type WebPopupContentZone, type WebPopupContentTone, type WebPopupCssLength, type WebPopupBoxSides, type WebPopupAlignItems, type WebPopupJustifyContent, type WebPopupValueParam, type WebPopupValueControl, type WebPopupLengthUnit, type WebPopupLengthRange, type WebPopupValueRef, type WebPopupTemplate, type WebPopupFormField, type WebPopupFormFieldKind, type WebPopupFormPrivacy, type WebPopupFormSubmitPayload, type WebPopupFormSubmitResult, type WebPopupFormSubmitHandler, type WebPopupEmailInputSlot, type WebPopupTagInputSlot, type WebPopupConsentSlot, type WebPopupSubmitSlot, type WebPopupFormValues, type WebPopupFormValuesSubmitResult, type WebPopupFormValuesSubmitHandler, type WebPopupTimerSlot, type WebPopupTimerExpireAction, type WebPopupTimerRemaining, type WebPopupChoiceSlot, type WebPopupChoiceOption, type WebPopupChoiceControl, type WebPopupChoiceSubmitPayload, type WebPopupChoiceSubmitHandler, type WebPopupRatingSlot, type WebPopupRatingScale, type WebPopupRatingSubmitMode, type WebPopupRatingSubmitPayload, type WebPopupRatingSubmitHandler, type WebPopupSubscribeResult, type WebPopupSubscribeOutcome, type WebPopupLogger, type WebPopupGlyphSlot, type WebPopupGlyphName, type WebPopupGlyphSize, type WebPopupProductsSlot, type WebPopupProductsStrategy, type WebPopupProductsLayout, type WebPopupProductsFields, type WebPopupProduct, type WebPopupProductsHost, type WebPopupSlotViewProps, } from './types';
@@ -1,11 +1,12 @@
1
1
  export { WebPopupReader, WebPopupBox, WebPopupSlotView } from './WebPopupReader';
2
2
  export { WebPopupInline } from './WebPopupInline';
3
+ export { loadWebPopupProducts } from './productsSlot';
3
4
  export { WEB_POPUP_CLOSE_ATTRIBUTE, WEB_POPUP_SUBMIT_ATTRIBUTE } from './styles';
4
5
  export { WEB_POPUP_TEMPLATES, findWebPopupTemplate } from './templates';
5
- export { parseWebPopupJson, stringifyWebPopup, resolveWebPopupPages, resolveWebPopupPageSize, startPageOf, safeUrl, sanitizeWebPopupHtml, normalizeWebPopupColors, normalizeWebPopupValues, webPopupValuesMap, collectWebPopupFormCodes, webPopupExpired, normalizeWebPopupDark, WEB_POPUP_MAX_SIZE_PX, isWebPopupCloseButton, webPopupPageWithoutCloseButtons, webPopupParamsWithoutCloseButtons } from './helpers';
6
+ export { parseWebPopupJson, stringifyWebPopup, resolveWebPopupPages, resolveWebPopupPageSize, startPageOf, safeUrl, sanitizeWebPopupHtml, normalizeWebPopupColors, normalizeWebPopupValues, webPopupValuesMap, collectWebPopupFormCodes, collectWebPopupProductSlots, webPopupExpired, normalizeWebPopupDark, WEB_POPUP_MAX_SIZE_PX, isWebPopupCloseButton, webPopupPageWithoutCloseButtons, webPopupParamsWithoutCloseButtons } from './helpers';
6
7
  export { webPopupHasForm } from './form';
7
8
  export { webPopupTimerLabels, webPopupTimerRemaining, webPopupTimeZoneSupported, webPopupWallClockMs } from './timer';
8
9
  export { normalizeWebPopupLayout, substituteWebPopupLayoutValues, WEB_POPUP_VALUE_KEY_PATTERN, webPopupBackgroundImageStyle, webPopupContainerStyle, webPopupCssLength, webPopupPaddingValue, webPopupTracksValue } from './layout';
9
- export { WEB_POPUP_VERSION, WEB_POPUP_FONT_STACK, WEB_POPUP_TEXT_COLOR, WEB_POPUP_TEXT_SECONDARY_COLOR, WEB_POPUP_ACCENT_COLOR, WEB_POPUP_BACKGROUND_COLOR, WEB_POPUP_DEFAULT_COLORS, webPopupTextColor, WEB_POPUP_TEXT_VARIANT_STYLES, WEB_POPUP_BG_SECTION_FALLBACK, WEB_POPUP_TEXT_SLOT_PADDING, WEB_POPUP_BUTTON_SLOT_PADDING, webPopupSlotGap, webPopupSlotRole, WEB_POPUP_DEFAULT_WIDTH, WEB_POPUP_INLINE_IMAGE_MAX_HEIGHT, WEB_POPUP_LAYOUT_MAX_DEPTH, WEB_POPUP_LAYOUT_MAX_NODES, webPopupButtonPillStyle, webPopupFormInputStyle, WEB_POPUP_FORM_INPUT_BORDER, WEB_POPUP_FORM_ERROR_COLOR, WEB_POPUP_FORM_ERROR_COLOR_DARK, WEB_POPUP_ON_ACCENT_COLOR, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_RETRY_ERROR, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, webPopupRatingScores } from './constants';
10
+ export { WEB_POPUP_VERSION, WEB_POPUP_FONT_STACK, WEB_POPUP_TEXT_COLOR, WEB_POPUP_TEXT_SECONDARY_COLOR, WEB_POPUP_ACCENT_COLOR, WEB_POPUP_BACKGROUND_COLOR, WEB_POPUP_DEFAULT_COLORS, webPopupTextColor, WEB_POPUP_TEXT_VARIANT_STYLES, WEB_POPUP_BG_SECTION_FALLBACK, WEB_POPUP_TEXT_SLOT_PADDING, WEB_POPUP_BUTTON_SLOT_PADDING, webPopupSlotGap, webPopupSlotRole, WEB_POPUP_DEFAULT_WIDTH, WEB_POPUP_INLINE_IMAGE_MAX_HEIGHT, WEB_POPUP_LAYOUT_MAX_DEPTH, WEB_POPUP_LAYOUT_MAX_NODES, webPopupButtonPillStyle, webPopupFormInputStyle, WEB_POPUP_FORM_INPUT_BORDER, WEB_POPUP_FORM_ERROR_COLOR, WEB_POPUP_FORM_ERROR_COLOR_DARK, WEB_POPUP_ON_ACCENT_COLOR, WEB_POPUP_FORM_DEFAULTS, WEB_POPUP_PRODUCTS_DEFAULTS, WEB_POPUP_PRODUCTS_MAX_LIMIT, WEB_POPUP_PRODUCTS_CACHE_MS, WEB_POPUP_CHOICE_DEFAULTS, WEB_POPUP_MAX_CHOICE_OPTIONS, WEB_POPUP_RATING_DEFAULTS, WEB_POPUP_RETRY_ERROR, WEB_POPUP_EMAIL_INPUT_DEFAULTS, WEB_POPUP_TAG_INPUT_DEFAULTS, WEB_POPUP_CONSENT_DEFAULTS, WEB_POPUP_SUBMIT_DEFAULTS, webPopupRatingScores } from './constants';
10
11
  export { resolveWebPopupBoxChrome, resolveWebPopupColors, autoDarkWebPopupColors, webPopupColorAlpha, webPopupDarkColors, webPopupDarkEnabled, webPopupEffectiveScheme, webPopupImageSrc, webPopupMixColor, webPopupShiftColor } from './palette';
11
12
  export { WEB_POPUP_GLYPH_NAMES, WEB_POPUP_GLYPH_PATHS, WEB_POPUP_GLYPH_SIZES, WEB_POPUP_THUMB_UP_PATH } from './glyphs';
@@ -0,0 +1,14 @@
1
+ import { type WebPopupProduct, type WebPopupProductsHost, type WebPopupProductsSlot, type WebPopupReaderMode, type WebPopupResolvedColors } from './types';
2
+ /** The products host of the box being drawn; WebPopupBox provides it, so no prop threads through the tree. */
3
+ export declare const WebPopupProductsContext: import("react").Context<WebPopupProductsHost | undefined>;
4
+ /**
5
+ * One slot's items through the host, shared by the host's pre-show check and the render for WEB_POPUP_PRODUCTS_CACHE_MS,
6
+ * so both see the same answer from one request. Never rejects: a failure or a non-array is an empty slot.
7
+ */
8
+ export declare function loadWebPopupProducts(host: WebPopupProductsHost, slot: WebPopupProductsSlot, now?: number): Promise<WebPopupProduct[]>;
9
+ export declare function ProductsSlotView({ slot, inverse, colors, mode }: {
10
+ slot: WebPopupProductsSlot;
11
+ inverse: boolean;
12
+ colors: WebPopupResolvedColors;
13
+ mode: WebPopupReaderMode;
14
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,177 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useState } from 'react';
3
+ import { webPopupButtonPillStyle, webPopupTextColor, WEB_POPUP_PRODUCTS_CACHE_MS, WEB_POPUP_PRODUCTS_DEFAULTS, WEB_POPUP_PRODUCTS_PLACEHOLDERS, WEB_POPUP_TEXT_SLOT_PADDING, WEB_POPUP_TEXT_VARIANT_STYLES } from './constants';
4
+ import { safeUrl, webPopupLinkTargetAttrs } from './helpers';
5
+ /** The products host of the box being drawn; WebPopupBox provides it, so no prop threads through the tree. */
6
+ export const WebPopupProductsContext = createContext(undefined);
7
+ const productsCache = new WeakMap();
8
+ /**
9
+ * One slot's items through the host, shared by the host's pre-show check and the render for WEB_POPUP_PRODUCTS_CACHE_MS,
10
+ * so both see the same answer from one request. Never rejects: a failure or a non-array is an empty slot.
11
+ */
12
+ export function loadWebPopupProducts(host, slot, now = Date.now()) {
13
+ let cache = productsCache.get(host);
14
+ if (!cache) {
15
+ cache = new Map();
16
+ productsCache.set(host, cache);
17
+ }
18
+ const key = `${slot.key}|${slot.strategy}|${slot.fallbackStrategy ?? ''}|${slot.limit}`;
19
+ const hit = cache.get(key);
20
+ if (hit && now - hit.at < WEB_POPUP_PRODUCTS_CACHE_MS) return hit.items;
21
+ const entry = {
22
+ at: now,
23
+ items: Promise.resolve([])
24
+ };
25
+ entry.items = Promise.resolve().then(() => host.load(slot)).then(loaded => Array.isArray(loaded) ? loaded.slice(0, slot.limit) : []).catch(() => {
26
+ // a failed answer is not kept: the next showing asks again
27
+ if (cache.get(key) === entry) cache.delete(key);
28
+ return [];
29
+ });
30
+ cache.set(key, entry);
31
+ return entry.items;
32
+ }
33
+ const CARD_MIN_WIDTH = 120;
34
+ function formatPrice(price, currency) {
35
+ if (!currency) return String(price);
36
+ try {
37
+ return new Intl.NumberFormat(undefined, {
38
+ style: 'currency',
39
+ currency
40
+ }).format(price);
41
+ } catch {
42
+ return `${price} ${currency}`;
43
+ }
44
+ }
45
+ function placeholderProducts(count) {
46
+ return Array.from({
47
+ length: count
48
+ }, (_, i) => ({
49
+ id: `placeholder-${i}`,
50
+ title: 'Product name',
51
+ url: ''
52
+ }));
53
+ }
54
+ function ProductCard({
55
+ product,
56
+ slot,
57
+ colors,
58
+ inverse,
59
+ onClick
60
+ }) {
61
+ const href = safeUrl(product.url);
62
+ const image = safeUrl(product.image);
63
+ const titleColor = webPopupTextColor('body', colors, inverse);
64
+ const priceColor = webPopupTextColor('caption', colors, inverse);
65
+ const cardStyle = {
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ gap: 6,
69
+ minWidth: CARD_MIN_WIDTH,
70
+ color: 'inherit',
71
+ textDecoration: 'none',
72
+ ...(slot.layout === 'row' ? {
73
+ flex: `0 0 ${CARD_MIN_WIDTH}px`
74
+ } : {})
75
+ };
76
+ const body = _jsxs(_Fragment, {
77
+ children: [slot.fields.image ? _jsx("div", {
78
+ style: {
79
+ aspectRatio: '1 / 1',
80
+ borderRadius: 6,
81
+ backgroundColor: colors.surface,
82
+ border: `1px solid ${colors.border}`,
83
+ ...(image ? {
84
+ backgroundImage: `url("${image.replace(/"/g, '%22')}")`,
85
+ backgroundSize: 'cover',
86
+ backgroundPosition: 'center'
87
+ } : {})
88
+ }
89
+ }) : null, slot.fields.title ? _jsx("div", {
90
+ style: {
91
+ ...WEB_POPUP_TEXT_VARIANT_STYLES.body,
92
+ ...(titleColor ? {
93
+ color: titleColor
94
+ } : {})
95
+ },
96
+ children: product.title
97
+ }) : null, slot.fields.price && product.price !== undefined ? _jsx("div", {
98
+ style: {
99
+ ...WEB_POPUP_TEXT_VARIANT_STYLES.caption,
100
+ ...(priceColor ? {
101
+ color: priceColor
102
+ } : {})
103
+ },
104
+ children: formatPrice(product.price, product.currency)
105
+ }) : null, slot.fields.cta ? _jsx("span", {
106
+ style: {
107
+ ...webPopupButtonPillStyle('secondary', colors),
108
+ padding: '6px 10px',
109
+ fontSize: 13
110
+ },
111
+ children: slot.ctaText || WEB_POPUP_PRODUCTS_DEFAULTS.ctaText
112
+ }) : null]
113
+ });
114
+ if (!href) return _jsx("div", {
115
+ style: cardStyle,
116
+ children: body
117
+ });
118
+ return _jsx("a", {
119
+ href: href,
120
+ ...webPopupLinkTargetAttrs('_self'),
121
+ style: cardStyle,
122
+ onClick: onClick,
123
+ children: body
124
+ });
125
+ }
126
+ // With a host: its items; loading, failed or empty collapses the slot, never a spinner on a shop page.
127
+ // Without one: placeholder cards on the editor canvas and in previews, nothing on a live page.
128
+ export function ProductsSlotView({
129
+ slot,
130
+ inverse,
131
+ colors,
132
+ mode
133
+ }) {
134
+ const host = useContext(WebPopupProductsContext);
135
+ const [items, setItems] = useState(null);
136
+ // Pages are re-resolved on every render, so the slot object is new each time: keyed by what the request depends on.
137
+ const request = `${slot.key}|${slot.strategy}|${slot.fallbackStrategy ?? ''}|${slot.limit}`;
138
+ useEffect(() => {
139
+ if (!host) return undefined;
140
+ let cancelled = false;
141
+ void loadWebPopupProducts(host, slot).then(loaded => {
142
+ if (!cancelled) setItems(loaded);
143
+ });
144
+ return () => {
145
+ cancelled = true;
146
+ };
147
+ // eslint-disable-next-line react-hooks/exhaustive-deps
148
+ }, [host, request]);
149
+ if (!host && mode === 'live') return null;
150
+ const shown = host ? items : placeholderProducts(Math.min(slot.limit, WEB_POPUP_PRODUCTS_PLACEHOLDERS));
151
+ if (!shown || shown.length === 0) return null;
152
+ const listStyle = slot.layout === 'grid' ? {
153
+ display: 'grid',
154
+ gridTemplateColumns: `repeat(auto-fill, minmax(${CARD_MIN_WIDTH}px, 1fr))`,
155
+ gap: 12
156
+ } : {
157
+ display: 'flex',
158
+ gap: 12,
159
+ overflowX: 'auto'
160
+ };
161
+ return _jsx("div", {
162
+ style: {
163
+ padding: WEB_POPUP_TEXT_SLOT_PADDING
164
+ },
165
+ "data-pw-products": slot.key,
166
+ children: _jsx("div", {
167
+ style: listStyle,
168
+ children: shown.map(product => _jsx(ProductCard, {
169
+ product: product,
170
+ slot: slot,
171
+ colors: colors,
172
+ inverse: inverse,
173
+ onClick: mode === 'live' && host?.onClick ? () => host.onClick?.(product, slot) : undefined
174
+ }, product.id))
175
+ })
176
+ });
177
+ }
@@ -123,6 +123,52 @@ export type WebPopupRatingSlot = {
123
123
  /** Replaces the slot after a successful submit. */
124
124
  successMessage: string;
125
125
  };
126
+ /** Where a products slot's items come from: the onsite recommendations feed's strategies. */
127
+ export type WebPopupProductsStrategy = 'viewed' | 'bestsellers_30d' | 'also_bought' | 'cart';
128
+ /** 'row' scrolls sideways, 'grid' wraps into as many columns as fit. */
129
+ export type WebPopupProductsLayout = 'row' | 'grid';
130
+ /** Which parts of a product card are drawn. */
131
+ export type WebPopupProductsFields = {
132
+ title: boolean;
133
+ price: boolean;
134
+ image: boolean;
135
+ cta: boolean;
136
+ };
137
+ /** Product recommendations; the HOST loads the items (WebPopupProductsHost), no host = placeholder cards. */
138
+ export type WebPopupProductsSlot = {
139
+ type: 'products';
140
+ key: string;
141
+ strategy: WebPopupProductsStrategy;
142
+ /** Served when `strategy` has nothing; absent = none. Never equal to `strategy`. */
143
+ fallbackStrategy?: WebPopupProductsStrategy;
144
+ /** 1..12. */
145
+ limit: number;
146
+ layout: WebPopupProductsLayout;
147
+ fields: WebPopupProductsFields;
148
+ /** The card's button label; '' = the default. */
149
+ ctaText: string;
150
+ /** The host skips the whole popup when this slot has no items (see collectWebPopupProductSlots). */
151
+ hideWhenEmpty: boolean;
152
+ };
153
+ /** One product card's data, as the onsite feed serves it. */
154
+ export type WebPopupProduct = {
155
+ id: string;
156
+ title: string;
157
+ /** Absent = no price line. */
158
+ price?: number;
159
+ /** ISO 4217; absent = the number alone. */
160
+ currency?: string;
161
+ image?: string;
162
+ /** Rendered through safeUrl. */
163
+ url: string;
164
+ };
165
+ /** The host side of products slots; absent = placeholder cards (editor canvas, previews). */
166
+ export type WebPopupProductsHost = {
167
+ /** Items for one slot; a rejection or [] collapses the slot. Called through loadWebPopupProducts, which shares one answer. */
168
+ load: (slot: WebPopupProductsSlot) => Promise<WebPopupProduct[]>;
169
+ /** A card click, before the link opens. */
170
+ onClick?: (product: WebPopupProduct, slot: WebPopupProductsSlot) => void;
171
+ };
126
172
  /** The icon whitelist: inline svg only — no icon package in the widget bundle, no svg from json. */
127
173
  export type WebPopupGlyphName = 'bell' | 'gift' | 'cart' | 'chart' | 'lock' | 'calendar' | 'check' | 'star' | 'clock' | 'tag' | 'mail' | 'phone' | 'download' | 'play' | 'shield' | 'sparkle' | 'percent' | 'truck' | 'ticket' | 'user';
128
174
  export type WebPopupGlyphSize = 24 | 32 | 48;
@@ -210,7 +256,7 @@ export type WebPopupSlot = {
210
256
  successMessage: string;
211
257
  /** Replaces the form after the double-opt-in confirm-email result. */
212
258
  confirmEmailMessage: string;
213
- } | WebPopupTimerSlot | WebPopupChoiceSlot | WebPopupRatingSlot | WebPopupGlyphSlot | WebPopupEmailInputSlot | WebPopupTagInputSlot | WebPopupConsentSlot | WebPopupSubmitSlot;
259
+ } | WebPopupTimerSlot | WebPopupChoiceSlot | WebPopupRatingSlot | WebPopupGlyphSlot | WebPopupProductsSlot | WebPopupEmailInputSlot | WebPopupTagInputSlot | WebPopupConsentSlot | WebPopupSubmitSlot;
214
260
  /** What a media param plays instead of drawing its image; the param's `src` stays the poster, so engines predating video degrade to it. */
215
261
  export type WebPopupVideo = {
216
262
  /** Video url, rendered through safeUrl like every popup link. */
@@ -676,6 +722,8 @@ export type WebPopupReaderProps = {
676
722
  onSubmitChoice?: WebPopupChoiceSubmitHandler;
677
723
  /** Rating-slot submits; absent = rating slots render inert. */
678
724
  onSubmitRating?: WebPopupRatingSubmitHandler;
725
+ /** Products-slot data; absent = placeholder cards. */
726
+ products?: WebPopupProductsHost;
679
727
  /** `subscribe`-action buttons; absent = they render inert (previews, editor). */
680
728
  onRequestSubscribe?: () => Promise<WebPopupSubscribeResult>;
681
729
  /** Reports of what the renderer could not do; absent = silent (previews, editor). */
@@ -727,6 +775,8 @@ export type WebPopupBoxProps = {
727
775
  onSubmitChoice?: WebPopupChoiceSubmitHandler;
728
776
  /** Rating-slot submits; absent = rating slots render inert. */
729
777
  onSubmitRating?: WebPopupRatingSubmitHandler;
778
+ /** Products-slot data, handed to every slot in the box; absent = placeholder cards. */
779
+ products?: WebPopupProductsHost;
730
780
  /** `subscribe`-action buttons; absent = they render inert (previews, editor). */
731
781
  onRequestSubscribe?: () => Promise<WebPopupSubscribeResult>;
732
782
  /** Closes the content after a subscribe answer; absent = the answer closes nothing. */
@@ -749,6 +799,8 @@ export type WebPopupInlineProps = {
749
799
  onSubmitChoice?: WebPopupChoiceSubmitHandler;
750
800
  /** Rating-slot submits; absent = rating slots render inert. */
751
801
  onSubmitRating?: WebPopupRatingSubmitHandler;
802
+ /** Products-slot data; absent = placeholder cards. */
803
+ products?: WebPopupProductsHost;
752
804
  /** `subscribe`-action buttons; absent = they render inert. */
753
805
  onRequestSubscribe?: () => Promise<WebPopupSubscribeResult>;
754
806
  /** Removal asked by a subscribe answer only; a 'hide-popup' timer never calls it. */