web-push-notifications 3.100.1 → 3.103.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.
@@ -26,6 +26,8 @@ export declare class EmbeddedWebPopups {
26
26
  syncWithPage(entries: Iterable<WebPopupEntry>, canAutoShow: (entry: WebPopupEntry) => boolean): void;
27
27
  /** Render on demand; false when there is no element to render into. */
28
28
  show(entry: WebPopupEntry, content: WebPopupParams): boolean;
29
+ /** Remove the blocks the predicate picks, show() ones included; places nothing. */
30
+ removeWhere(shouldRemove: (entry: WebPopupEntry) => boolean): void;
29
31
  private place;
30
32
  private firstBlockAfter;
31
33
  private remove;
@@ -26,14 +26,8 @@ export declare class WebPopupsWidget implements IWebPopupsPublicApi {
26
26
  constructor(pw: Pushwoosh);
27
27
  run(): Promise<void>;
28
28
  /**
29
- * Show a popup immediately, ignoring EVERY display condition: delay, page
30
- * rules, device_type, visitors_type, frequency capping and trigger_type.
31
- * An already visible popup is closed to make room.
32
- *
33
- * `code` is a campaign code or, failing that, a content code, which records no stats or frequency.
34
- * EMBEDDED: renders into the first css_selector match (false when none), leaves the visible popup alone
35
- * and stays across SPA navigation until its element leaves the page; see public/index.d.ts.
36
- * Never rejects: resolves false and logs the reason on failure.
29
+ * Show a popup now past every display condition but the push permission status (and a POPUP's expired countdown).
30
+ * Never rejects: resolves false and logs why. The full contract is in public/index.d.ts.
37
31
  */
38
32
  show(code: string): Promise<boolean>;
39
33
  /**
@@ -64,6 +58,8 @@ export declare class WebPopupsWidget implements IWebPopupsPublicApi {
64
58
  private canAutoDisplay;
65
59
  /** What any kind needs to show by itself; kind-specific checks stay with the caller. */
66
60
  private isAutoEligible;
61
+ /** What a waiting or queued popup must still pass: the page, the push permission and the countdown. */
62
+ private isStillEligible;
67
63
  private isAutoTrigger;
68
64
  private armDelay;
69
65
  /**
@@ -74,9 +70,8 @@ export declare class WebPopupsWidget implements IWebPopupsPublicApi {
74
70
  /** Ordering: shorter delay first, then the order the server returned them. */
75
71
  private insertIntoQueue;
76
72
  /**
77
- * Release popups whose page rules stopped matching, both the ones still
78
- * waiting out their delay and the ones already queued. They return to `idle`
79
- * and are re-armed with a full delay if the visitor comes back.
73
+ * Return waiting and queued popups that stopped matching the page or the push permission, or whose countdown
74
+ * passed, to `idle`; a returning visitor re-arms them with a full delay.
80
75
  */
81
76
  private releaseUnmatchedPending;
82
77
  /** Clear an entry's armed timer and queue slot, leaving its state to the caller. */
@@ -91,6 +86,8 @@ export declare class WebPopupsWidget implements IWebPopupsPublicApi {
91
86
  private lockBodyScroll;
92
87
  private unlockBodyScroll;
93
88
  private subscribeToNavigation;
89
+ private subscribeToPushPermission;
90
+ private releaseByPushPermission;
94
91
  private checkStrongCondition;
95
92
  private checkSoftCondition;
96
93
  private checkNotExpired;
@@ -100,6 +97,7 @@ export declare class WebPopupsWidget implements IWebPopupsPublicApi {
100
97
  private matchPageRule;
101
98
  private checkCanBeShownByVisitorsTypeCondition;
102
99
  private recordPopupShownEvent;
100
+ private listenForInteractions;
103
101
  private markAsShown;
104
102
  private getSessionStorageKey;
105
103
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { type WebPopupColorSchemePref, type WebPopupParams } from '@pushwoosh/websdk-common/web-popups';
2
2
  import { type WebPopupSubmitHandlers } from './renderer';
3
- /** Mount an EMBEDDED campaign inline; unmount it with `unmountWebPopup`. */
4
- export declare const renderEmbeddedWebPopup: (container: HTMLElement, params: WebPopupParams, handlers: WebPopupSubmitHandlers, colorScheme?: WebPopupColorSchemePref) => void;
3
+ /** Mount an EMBEDDED campaign inline; unmount it with `unmountWebPopup`. `onRequestRemove` is the subscribe button's close. */
4
+ export declare const renderEmbeddedWebPopup: (container: HTMLElement, params: WebPopupParams, handlers: WebPopupSubmitHandlers, colorScheme?: WebPopupColorSchemePref, onRequestRemove?: () => void) => void;
@@ -0,0 +1,2 @@
1
+ /** One delegated listener per container: a click on any link or button of the content, except the ✕. */
2
+ export declare function listenForContentClicks(container: HTMLElement, onClick: () => void): void;
@@ -0,0 +1,4 @@
1
+ import { type WebPopup } from './types';
2
+ import { type Pushwoosh } from '../../core/Pushwoosh';
3
+ /** Absent, empty, unknown or ALL lets everyone through; a status that can't be read lets nothing else through. */
4
+ export declare function matchesPushPermission(pw: Pushwoosh, popup: WebPopup): boolean;
@@ -38,6 +38,7 @@ export type WebPopup = {
38
38
  trigger_type?: WebPopupTriggerType;
39
39
  kind?: WebPopupDisplayKind;
40
40
  css_selector?: string;
41
+ push_permission_status?: string;
41
42
  };
42
43
  /**
43
44
  * Where a popup is in the automatic display pipeline for the current page load.
@@ -0,0 +1,2 @@
1
+ import { type WebPopupLogger } from '@pushwoosh/websdk-common/web-popups';
2
+ export declare const webPopupLogger: WebPopupLogger;