web-push-notifications 3.100.1 → 3.103.1
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/CHANGELOG.md +46 -0
- package/core/Pushwoosh.d.ts +12 -1
- package/core/__tests__/changePermissionEvent.test.d.ts +1 -0
- package/core/__tests__/siteOpenedEvent.test.d.ts +1 -0
- package/helpers/pagePath.d.ts +2 -0
- package/modules/Api/Api.d.ts +3 -1
- package/modules/ApiClient/ApiClient.d.ts +1 -0
- package/modules/ApiClient/ApiClient.types.d.ts +11 -2
- package/modules/SdkUsage/SdkUsage.d.ts +19 -0
- package/modules/SdkUsage/__tests__/SdkUsage.test.d.ts +1 -0
- package/npm.js +1 -1
- package/npm.js.map +1 -1
- package/package.json +2 -2
- package/service-worker.js +1 -1
- package/service-worker.js.map +1 -1
- package/widget-subscription.js +1 -1
- package/widget-subscription.js.map +1 -1
- package/widget-web-popups.js +1 -1
- package/widget-web-popups.js.map +1 -1
- package/widgets/WebPopups/EmbeddedWebPopups.d.ts +2 -0
- package/widgets/WebPopups/WebPopupsWidget.d.ts +9 -11
- package/widgets/WebPopups/__tests__/interactions.test.d.ts +1 -0
- package/widgets/WebPopups/__tests__/pageRules.test.d.ts +1 -0
- package/widgets/WebPopups/embeddedRenderer.d.ts +2 -2
- package/widgets/WebPopups/interactions.d.ts +2 -0
- package/widgets/WebPopups/pushPermissionCondition.d.ts +4 -0
- package/widgets/WebPopups/types.d.ts +1 -0
- package/widgets/WebPopups/webPopupLogger.d.ts +2 -0
|
@@ -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
|
|
30
|
-
*
|
|
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
|
-
*
|
|
78
|
-
*
|
|
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,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;
|