@pushwoosh/websdk-common 6.29.0 → 6.30.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.29.0",
3
+ "version": "6.30.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",
@@ -1,8 +1,8 @@
1
1
  import { type WebPopupInlineProps } from './types';
2
2
  /**
3
3
  * An Inline (EMBEDDED) block: one page box at its container's full width (the page width is ignored),
4
- * without close-action buttons or ✕. Only a subscribe answer removes it, through onRequestRemove; a 'hide-popup' timer does not.
4
+ * without ✕ and, unless the host passes onRequestClose, without close-action buttons. A subscribe answer removes it through onRequestRemove.
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, products, onRequestSubscribe, onRequestRemove, }: WebPopupInlineProps): import("react").JSX.Element | null;
8
+ export declare function WebPopupInline({ params, mode, colorScheme, logger, onSubmitForm, onSubmitFormValues, onSubmitChoice, onSubmitRating, products, onRequestSubscribe, onRequestRemove, onRequestClose, }: WebPopupInlineProps): import("react").JSX.Element | null;
@@ -7,7 +7,7 @@ import { WEB_POPUP_INLINE_IMAGE_CAP_CSS, WEB_POPUP_INLINE_SCOPE_ATTRIBUTE, WEB_P
7
7
  import { WebPopupBox } from './WebPopupReader';
8
8
  /**
9
9
  * An Inline (EMBEDDED) block: one page box at its container's full width (the page width is ignored),
10
- * without close-action buttons or ✕. Only a subscribe answer removes it, through onRequestRemove; a 'hide-popup' timer does not.
10
+ * without ✕ and, unless the host passes onRequestClose, without close-action buttons. A subscribe answer removes it through onRequestRemove.
11
11
  * `<img>` is capped by a `<style>` scoped to the wrapper's attribute, so the rule never reaches
12
12
  * the host page, in a shadow root or in the light DOM. Page navigation is internal.
13
13
  */
@@ -22,10 +22,11 @@ export function WebPopupInline({
22
22
  onSubmitRating,
23
23
  products,
24
24
  onRequestSubscribe,
25
- onRequestRemove
25
+ onRequestRemove,
26
+ onRequestClose
26
27
  }) {
27
28
  const [pageKey, setPageKey] = useState(null);
28
- const shown = useMemo(() => webPopupParamsWithoutCloseButtons(params), [params]);
29
+ const shown = useMemo(() => onRequestClose ? params : webPopupParamsWithoutCloseButtons(params), [params, onRequestClose]);
29
30
  const scheme = useColorScheme(colorScheme, webPopupDarkEnabled(shown));
30
31
  const pages = resolveWebPopupPages(shown);
31
32
  if (pages.length === 0) return null;
@@ -40,6 +41,7 @@ export function WebPopupInline({
40
41
  params: shown,
41
42
  mode: mode,
42
43
  colorScheme: scheme,
44
+ onRequestClose: onRequestClose,
43
45
  onPageChange: setPageKey,
44
46
  onSubmitForm: onSubmitForm,
45
47
  onSubmitFormValues: onSubmitFormValues,
@@ -805,6 +805,8 @@ export type WebPopupInlineProps = {
805
805
  onRequestSubscribe?: () => Promise<WebPopupSubscribeResult>;
806
806
  /** Removal asked by a subscribe answer only; a 'hide-popup' timer never calls it. */
807
807
  onRequestRemove?: () => void;
808
+ /** A block the visitor may close: keeps close-action buttons and gets their clicks and a 'hide-popup' timer; absent = they are dropped. */
809
+ onRequestClose?: () => void;
808
810
  /** Reports of what the renderer could not do; absent = silent. */
809
811
  logger?: WebPopupLogger;
810
812
  };