web-push-notifications 3.74.0 → 3.76.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/CHANGELOG.md +46 -0
- package/core/Pushwoosh.types.d.ts +10 -0
- package/helpers/__tests__/cssColor.test.d.ts +1 -0
- package/helpers/__tests__/escape.test.d.ts +1 -0
- package/helpers/__tests__/url.test.d.ts +1 -0
- package/helpers/cssColor.d.ts +4 -0
- package/helpers/escape.d.ts +2 -0
- package/helpers/url.d.ts +4 -0
- package/models/InboxCell.d.ts +24 -0
- package/models/InboxCell.types.d.ts +27 -0
- package/models/InboxMessages.types.d.ts +16 -0
- package/models/__tests__/InboxCell.test.d.ts +1 -0
- package/modules/InboxMessagesPublic.d.ts +1 -0
- package/modules/__tests__/InboxMessagesPublic.test.d.ts +1 -0
- package/modules/__tests__/publicMessageBuilder.test.d.ts +1 -0
- package/npm.js +1 -1
- package/npm.js.map +1 -1
- package/package.json +9 -2
- package/service-worker.js +1 -1
- package/service-worker.js.map +1 -1
- package/widget-inbox.js +1 -1
- package/widget-inbox.js.map +1 -1
- package/widget-subscribe-popup.js +1 -1
- package/widget-subscribe-popup.js.map +1 -1
- package/widgets/Inbox/InboxWidget.d.ts +8 -0
- package/widgets/Inbox/__tests__/InboxWidget.test.d.ts +1 -0
- package/widgets/Inbox/__tests__/constants.test.d.ts +1 -0
- package/widgets/Inbox/__tests__/widgetTemplates.test.d.ts +1 -0
- package/widgets/Inbox/constants.d.ts +2 -1
- package/widgets/Inbox/helpers.d.ts +0 -1
- package/widgets/Inbox/inbox_widget.types.d.ts +12 -1
- package/widgets/Inbox/widgetTemplates.d.ts +1 -1
- package/widgets/SubscribePopup/constants.d.ts +0 -1
- package/widgets/SubscribePopup/helpers.d.ts +0 -1
|
@@ -10,11 +10,16 @@ export declare class PWInboxWidget {
|
|
|
10
10
|
count: number;
|
|
11
11
|
messages: Array<IInboxMessagePublic>;
|
|
12
12
|
messagesElements: TMessagesElementsType;
|
|
13
|
+
/** Visible slide per carousel message, kept across the widget's re-renders. */
|
|
14
|
+
activeSlides: {
|
|
15
|
+
[code: string]: number;
|
|
16
|
+
};
|
|
13
17
|
readItems: Array<string>;
|
|
14
18
|
isOpened: boolean;
|
|
15
19
|
config: IInboxWidgetConfig;
|
|
16
20
|
defaultMargin: number;
|
|
17
21
|
isFixed: boolean;
|
|
22
|
+
private lastSyncAt;
|
|
18
23
|
constructor(pw: Pushwoosh);
|
|
19
24
|
run(): Promise<void>;
|
|
20
25
|
toggle(isOpened?: boolean): void;
|
|
@@ -41,10 +46,13 @@ export declare class PWInboxWidget {
|
|
|
41
46
|
private addListeners;
|
|
42
47
|
private markVisibleItemsAsRead;
|
|
43
48
|
private updateReadStatus;
|
|
49
|
+
private syncMessages;
|
|
44
50
|
private updateInbox;
|
|
45
51
|
private performMessageAction;
|
|
46
52
|
private removeMessages;
|
|
47
53
|
private onTriggerClickHandler;
|
|
48
54
|
private onWidgetClickHandler;
|
|
55
|
+
/** Switch the visible slide of one carousel message and redraw just that cell. */
|
|
56
|
+
private showSlide;
|
|
49
57
|
private onWindowScrollHandler;
|
|
50
58
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type IConfigStyles, type IInboxWidgetConfig } from './inbox_widget.types';
|
|
2
|
+
/** Shortest gap between two server refreshes triggered by opening the widget. */
|
|
3
|
+
export declare const SYNC_INTERVAL: number;
|
|
2
4
|
export declare const MILLISECONDS_IN_DAY: number;
|
|
3
5
|
export declare const MILLISECONDS_IN_HOUR: number;
|
|
4
6
|
export declare const MONTHS: string[];
|
|
5
7
|
export declare const CONFIG_STYLES: Array<IConfigStyles>;
|
|
6
8
|
export declare const DEFAULT_CONFIG: IInboxWidgetConfig;
|
|
7
|
-
export declare const COLOR_TEST_REGEXP: RegExp;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare function isElementFixed(element: HTMLElement): boolean;
|
|
2
2
|
export declare function getMessageTime(date: string): string;
|
|
3
|
-
export declare function getValidColor(color: string): string;
|
|
4
3
|
export declare function compareBySendDate(dateOne: string, dateTwo: string): number;
|
|
@@ -5,7 +5,7 @@ export interface IConfigStyles {
|
|
|
5
5
|
name: TStylesNames;
|
|
6
6
|
type: TStylesTypes;
|
|
7
7
|
}
|
|
8
|
-
export type TStylesNames = 'bgColor' | 'textColor' | 'fontFamily' | 'borderRadius' | 'borderColor' | 'badgeBgColor' | 'badgeTextColor' | 'widgetWidth' | 'zIndex' | 'messageTitleColor' | 'timeTextColor' | 'emptyInboxTitleColor' | 'emptyInboxTextColor' | 'arrowBorderColor';
|
|
8
|
+
export type TStylesNames = 'bgColor' | 'textColor' | 'fontFamily' | 'borderRadius' | 'borderColor' | 'badgeBgColor' | 'badgeTextColor' | 'widgetWidth' | 'zIndex' | 'messageTitleColor' | 'timeTextColor' | 'emptyInboxTitleColor' | 'emptyInboxTextColor' | 'arrowBorderColor' | 'unreadDotColor' | 'avatarBgColor' | 'avatarTextColor' | 'avatarSize' | 'mediaRadius' | 'slideCaptionColor' | 'slideScrimColor' | 'pagerDotActiveColor' | 'pagerDotColor';
|
|
9
9
|
export type TStylesTypes = 'number' | 'color' | 'string' | 'size';
|
|
10
10
|
export type TWidgetPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
11
11
|
export interface IInboxWidgetConfig {
|
|
@@ -31,4 +31,15 @@ export interface IInboxWidgetConfig {
|
|
|
31
31
|
emptyInboxTitleColor: string;
|
|
32
32
|
emptyInboxTextColor: string;
|
|
33
33
|
arrowBorderColor: string;
|
|
34
|
+
/** Keep the pre-3.75 look of the classic cell. The new layouts are unaffected. */
|
|
35
|
+
legacyClassicCell: boolean;
|
|
36
|
+
unreadDotColor: string;
|
|
37
|
+
avatarBgColor: string;
|
|
38
|
+
avatarTextColor: string;
|
|
39
|
+
avatarSize: number;
|
|
40
|
+
mediaRadius: number;
|
|
41
|
+
slideCaptionColor: string;
|
|
42
|
+
slideScrimColor: string;
|
|
43
|
+
pagerDotActiveColor: string;
|
|
44
|
+
pagerDotColor: string;
|
|
34
45
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type IInboxMessagePublic } from '../../models/InboxMessages.types';
|
|
2
2
|
export declare const widgetTemplate: (title: string) => string;
|
|
3
3
|
export declare const widgetTemplateEmpty: (emptyInboxIconUrl: string, emptyInboxTitle: string, emptyInboxText: string) => string;
|
|
4
|
-
export declare const messageTemplate: (
|
|
4
|
+
export declare const messageTemplate: (message: IInboxMessagePublic, activeSlide?: number) => string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ISubscribePopupConfig, type ISubscribePopupConfigStyles } from './types/subscribe-popup';
|
|
2
2
|
export declare const DEFAULT_CONFIG: ISubscribePopupConfig;
|
|
3
|
-
export declare const COLOR_TEST_REGEXP: RegExp;
|
|
4
3
|
export declare const PERMISSION_DENIED = "denied";
|
|
5
4
|
export declare const PERMISSION_GRANTED = "granted";
|
|
6
5
|
export declare const CONFIG_STYLES: Array<ISubscribePopupConfigStyles>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getValidColor(color: string): string;
|