@everymatrix/nuts-inbox-widget 1.45.10 → 1.45.13
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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-ae4a5047.js +1329 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/nuts-inbox-widget.cjs.js +25 -0
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +40953 -0
- package/dist/collection/api/methods/index.js +144 -0
- package/dist/collection/api/methods/types.js +1 -0
- package/dist/collection/collection-manifest.json +14 -0
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.css +21 -0
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +505 -0
- package/dist/collection/components/nuts-notification/constants.js +1 -0
- package/dist/collection/components/nuts-notification/nuts-notification.css +167 -0
- package/dist/collection/components/nuts-notification/nuts-notification.js +596 -0
- package/dist/collection/components/nuts-popover/nuts-popover.css +129 -0
- package/dist/collection/components/nuts-popover/nuts-popover.js +383 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/types/nuts-inbox-widget.types.js +39 -0
- package/dist/collection/utils/locale.utils.js +52 -0
- package/dist/collection/utils/utils.js +6 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-64960aae.js +1301 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/nuts-inbox-widget.js +20 -0
- package/dist/esm/nuts-inbox-widget_3.entry.js +40947 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/nuts-inbox-widget/index.esm.js +0 -0
- package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -0
- package/dist/nuts-inbox-widget/p-80fb2012.js +2 -0
- package/dist/nuts-inbox-widget/p-a97eb392.entry.js +1 -0
- package/dist/nuts-inbox-widget/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +15 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/nuts-inbox-widget/.stencil/packages/stencil/nuts-inbox-widget/stencil.config.dev.d.ts +2 -0
- package/dist/types/api/methods/index.d.ts +7 -0
- package/dist/types/api/methods/types.d.ts +66 -0
- package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +91 -0
- package/dist/types/components/nuts-notification/constants.d.ts +1 -0
- package/dist/types/components/nuts-notification/nuts-notification.d.ts +102 -0
- package/dist/types/components/nuts-popover/nuts-popover.d.ts +69 -0
- package/dist/types/components.d.ts +477 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/types/nuts-inbox-widget.types.d.ts +97 -0
- package/dist/types/utils/locale.utils.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o=()=>{};export{o as g}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sass } from "@stencil/sass";
|
|
2
|
+
export const config = {
|
|
3
|
+
namespace: 'nuts-inbox-widget',
|
|
4
|
+
taskQueue: 'async',
|
|
5
|
+
sourceMap: false,
|
|
6
|
+
minifyJs: true,
|
|
7
|
+
extras: {
|
|
8
|
+
experimentalImportInjection: true
|
|
9
|
+
},
|
|
10
|
+
plugins: [sass()],
|
|
11
|
+
outputTargets: [
|
|
12
|
+
{
|
|
13
|
+
type: 'dist',
|
|
14
|
+
esmLoaderPath: '../loader'
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeleteMessageParams, GetNotificationsParams, GetNotificationsReturnData, MarkAllMessagesParams, MarkMessageParams, MarkMessageReturnData, InitializeSessionParams, InitializeSessionReturnData, UnseenCountParams } from './types';
|
|
2
|
+
export declare const initializeSession: ({ baseUrl, body, sessionId }: InitializeSessionParams) => Promise<InitializeSessionReturnData>;
|
|
3
|
+
export declare const getUnseenCount: ({ baseUrl, token, }: UnseenCountParams) => Promise<number>;
|
|
4
|
+
export declare const deleteMessage: ({ baseUrl, token, messageId, }: DeleteMessageParams) => Promise<boolean>;
|
|
5
|
+
export declare const markAsRead: ({ baseUrl, body, token, unread, }: MarkMessageParams) => Promise<MarkMessageReturnData>;
|
|
6
|
+
export declare const getNotifications: ({ baseUrl, page, token }: GetNotificationsParams) => Promise<GetNotificationsReturnData>;
|
|
7
|
+
export declare const markAllAsRead: ({ baseUrl, token, }: MarkAllMessagesParams) => Promise<boolean>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Notification, InitializeSessionBodyContent } from '../../types/nuts-inbox-widget.types';
|
|
2
|
+
export interface BaseMethodParams {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
token?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface InitializeSessionParams extends BaseMethodParams {
|
|
7
|
+
body: InitializeSessionBodyContent;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface InitializeSessionResponseData {
|
|
11
|
+
data: {
|
|
12
|
+
profile: {
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string;
|
|
15
|
+
_id: string;
|
|
16
|
+
};
|
|
17
|
+
token: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface InitializeSessionReturnData {
|
|
21
|
+
token: string;
|
|
22
|
+
unseenCounter: number;
|
|
23
|
+
}
|
|
24
|
+
export interface UnseenCountParams extends BaseMethodParams {
|
|
25
|
+
}
|
|
26
|
+
export interface UnseenCountResponseData {
|
|
27
|
+
data: {
|
|
28
|
+
count: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface DeleteMessageParams extends BaseMethodParams {
|
|
32
|
+
messageId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface MarkMessageBodyParams {
|
|
35
|
+
messageId: string;
|
|
36
|
+
mark: {
|
|
37
|
+
seen: boolean;
|
|
38
|
+
read: boolean;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface MarkMessageParams extends BaseMethodParams {
|
|
42
|
+
body: MarkMessageBodyParams;
|
|
43
|
+
unread: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface MarkMessageResponseData {
|
|
46
|
+
data: Notification[];
|
|
47
|
+
}
|
|
48
|
+
export interface MarkMessageReturnData {
|
|
49
|
+
messageSeen: boolean;
|
|
50
|
+
messageRead: boolean;
|
|
51
|
+
showSettingsModal: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface GetNotificationsParams extends BaseMethodParams {
|
|
54
|
+
page: number;
|
|
55
|
+
}
|
|
56
|
+
export interface GetNotificationsResponseData {
|
|
57
|
+
totalCount: number;
|
|
58
|
+
data: Notification[];
|
|
59
|
+
}
|
|
60
|
+
export interface GetNotificationsReturnData {
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
numberOfNotifications: number;
|
|
63
|
+
notifications: Notification[];
|
|
64
|
+
}
|
|
65
|
+
export interface MarkAllMessagesParams extends BaseMethodParams {
|
|
66
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { Notification } from '../../types/nuts-inbox-widget.types';
|
|
3
|
+
export declare class NutsInboxWidget {
|
|
4
|
+
/**
|
|
5
|
+
* HTTP Endpoint URL for NuTS
|
|
6
|
+
*/
|
|
7
|
+
backendUrl: string;
|
|
8
|
+
/**
|
|
9
|
+
* Socket Endpoint URL for NuTS
|
|
10
|
+
*/
|
|
11
|
+
socketUrl: string;
|
|
12
|
+
/**
|
|
13
|
+
* The ID of the user
|
|
14
|
+
*/
|
|
15
|
+
userId: string;
|
|
16
|
+
/**
|
|
17
|
+
* The sessionID of the user
|
|
18
|
+
*/
|
|
19
|
+
sessionId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The operatorID on which we can find the user
|
|
22
|
+
*/
|
|
23
|
+
operatorId: string;
|
|
24
|
+
/**
|
|
25
|
+
* The subscriberID
|
|
26
|
+
*/
|
|
27
|
+
subscriberId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The deviceID from which the user access the website
|
|
30
|
+
*/
|
|
31
|
+
deviceId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Language of the widget
|
|
34
|
+
*/
|
|
35
|
+
language: string;
|
|
36
|
+
/**
|
|
37
|
+
* Environment on which the widget is used (possible values: `stage`, `prod`)
|
|
38
|
+
*/
|
|
39
|
+
environment: string;
|
|
40
|
+
/**
|
|
41
|
+
* Novu application identifier
|
|
42
|
+
*/
|
|
43
|
+
applicationIdentifier: string;
|
|
44
|
+
/**
|
|
45
|
+
* Client custom styling via inline styles
|
|
46
|
+
*/
|
|
47
|
+
clientStyling: string;
|
|
48
|
+
/**
|
|
49
|
+
* Client styling url for a css file
|
|
50
|
+
*/
|
|
51
|
+
clientStylingUrl: string;
|
|
52
|
+
/**
|
|
53
|
+
* Position of the widget (possible values: `left` and `right`) - this changes the `justify-content` property of the `.BellIconWrapper` class
|
|
54
|
+
*/
|
|
55
|
+
bellIconPosition: string;
|
|
56
|
+
/**
|
|
57
|
+
* Clicking on the notification will automatically redirect you to the redirectURL attached to the notification (`default` behaviour). It can be changed to `postMessage` and instead of the redirect it will emit a postMessage with the redirectURL and the parent website can take actions
|
|
58
|
+
*/
|
|
59
|
+
notificationAction: string;
|
|
60
|
+
/**
|
|
61
|
+
* Translations via URL
|
|
62
|
+
*/
|
|
63
|
+
translationUrl: string;
|
|
64
|
+
private stylingContainer;
|
|
65
|
+
private isLoading;
|
|
66
|
+
private popoverVisible;
|
|
67
|
+
private unseenCount;
|
|
68
|
+
private socketRef;
|
|
69
|
+
private bellIconRef;
|
|
70
|
+
private token;
|
|
71
|
+
private baseUrl;
|
|
72
|
+
private initializeSessionBody;
|
|
73
|
+
notificationFeed: EventEmitter<Notification[]>;
|
|
74
|
+
newNotification: EventEmitter<any>;
|
|
75
|
+
initializeHandler(newValue: string, oldValue: string): void;
|
|
76
|
+
el: HTMLElement;
|
|
77
|
+
clickOutsideHandle(ev: MouseEvent): void;
|
|
78
|
+
positionIcon(): void;
|
|
79
|
+
setupSocket(): void;
|
|
80
|
+
togglePopover: () => void;
|
|
81
|
+
setClientStyling: () => void;
|
|
82
|
+
setClientStylingURL: () => void;
|
|
83
|
+
connectedCallback(): Promise<void>;
|
|
84
|
+
handleNewTranslations(): void;
|
|
85
|
+
componentWillLoad(): Promise<void>;
|
|
86
|
+
componentDidRender(): void;
|
|
87
|
+
assignRefToStylingContainer: (ref: HTMLElement) => void;
|
|
88
|
+
assignRefToBell: (ref: HTMLElement) => void;
|
|
89
|
+
renderBellIcon(): HTMLElement;
|
|
90
|
+
render(): any;
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MAX_NOTIFICATION_TEXT_LENGTH = 150;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class NutsNotification {
|
|
3
|
+
/**
|
|
4
|
+
* Src for badge / avatar
|
|
5
|
+
*/
|
|
6
|
+
badge: string;
|
|
7
|
+
/**
|
|
8
|
+
* Text content of the notification
|
|
9
|
+
*/
|
|
10
|
+
content: string;
|
|
11
|
+
/**
|
|
12
|
+
* Date of the notification
|
|
13
|
+
*/
|
|
14
|
+
date: string;
|
|
15
|
+
/**
|
|
16
|
+
* Wether or not to show notification settings
|
|
17
|
+
*/
|
|
18
|
+
showSettings: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Wether or not the item has been read
|
|
21
|
+
*/
|
|
22
|
+
read: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Wether or not the item has been seen
|
|
25
|
+
*/
|
|
26
|
+
seen: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Language code of the content
|
|
29
|
+
*/
|
|
30
|
+
language: string;
|
|
31
|
+
/**
|
|
32
|
+
* The sessionID of the user
|
|
33
|
+
*/
|
|
34
|
+
sessionId: string;
|
|
35
|
+
/**
|
|
36
|
+
* The subscriberID
|
|
37
|
+
*/
|
|
38
|
+
subscriberId?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Unique ID of the user who receives the notification
|
|
41
|
+
*/
|
|
42
|
+
userId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Unique ID of the notification content
|
|
45
|
+
*/
|
|
46
|
+
messageId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Unique ID of the operator domain
|
|
49
|
+
*/
|
|
50
|
+
operatorId: string;
|
|
51
|
+
/**
|
|
52
|
+
* Token used in authorization of notification transactions
|
|
53
|
+
*/
|
|
54
|
+
token: string;
|
|
55
|
+
/**
|
|
56
|
+
* Endpoint for notification transactions
|
|
57
|
+
*/
|
|
58
|
+
backendUrl: string;
|
|
59
|
+
/**
|
|
60
|
+
* Redirect address in case of external url
|
|
61
|
+
*/
|
|
62
|
+
redirectUrl: string;
|
|
63
|
+
/**
|
|
64
|
+
* Determines notification behaviour onClick
|
|
65
|
+
*/
|
|
66
|
+
notificationAction: string;
|
|
67
|
+
/**
|
|
68
|
+
* Custom styling passed as a URL
|
|
69
|
+
*/
|
|
70
|
+
clientStylingUrl: string;
|
|
71
|
+
/**
|
|
72
|
+
* Translations via URL
|
|
73
|
+
*/
|
|
74
|
+
translationUrl: string;
|
|
75
|
+
/**
|
|
76
|
+
* Clienty styling passed as a string
|
|
77
|
+
*/
|
|
78
|
+
clientStyling: string;
|
|
79
|
+
showSettingsModal: boolean;
|
|
80
|
+
messageSeen: boolean;
|
|
81
|
+
messageRead: boolean;
|
|
82
|
+
displayedContent: string;
|
|
83
|
+
private stylingContainer;
|
|
84
|
+
private dropdownArrowRef;
|
|
85
|
+
private baseUrl;
|
|
86
|
+
messageDeteled: EventEmitter<any>;
|
|
87
|
+
settingsOpened: EventEmitter<any>;
|
|
88
|
+
allNotificationsReadHandler(): void;
|
|
89
|
+
settingsOpenedHandler(event: CustomEvent<any>): void;
|
|
90
|
+
handleNewTranslations(): void;
|
|
91
|
+
componentWillLoad(): Promise<void>;
|
|
92
|
+
connectedCallback(): void;
|
|
93
|
+
toggleSettingsModal: (e: MouseEvent) => void;
|
|
94
|
+
toggleNotificationRead: (event?: MouseEvent) => Promise<void>;
|
|
95
|
+
deleteNotification: () => Promise<void>;
|
|
96
|
+
notificationActionHandler: () => void;
|
|
97
|
+
setClientStyling: () => void;
|
|
98
|
+
setClientStylingURL: () => void;
|
|
99
|
+
assignRefToStylingContainer: (ref: HTMLElement) => void;
|
|
100
|
+
assignRefToDropdownArrow: (ref: HTMLElement) => void;
|
|
101
|
+
render(): any;
|
|
102
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { GetNotificationsReturnData } from '../../api/methods/types';
|
|
3
|
+
export declare class NutsPopover {
|
|
4
|
+
/**
|
|
5
|
+
* Language code of the content
|
|
6
|
+
*/
|
|
7
|
+
language: string;
|
|
8
|
+
/**
|
|
9
|
+
* Unique ID of the user receiving notifications
|
|
10
|
+
*/
|
|
11
|
+
userId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Unique ID of the operator domain
|
|
14
|
+
*/
|
|
15
|
+
operatorId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Token used to authenticate notification transactions
|
|
18
|
+
*/
|
|
19
|
+
token: string;
|
|
20
|
+
/**
|
|
21
|
+
* The sessionID of the user
|
|
22
|
+
*/
|
|
23
|
+
sessionId: string;
|
|
24
|
+
/**
|
|
25
|
+
* Endpoint used for notification transactions
|
|
26
|
+
*/
|
|
27
|
+
backendUrl: string;
|
|
28
|
+
/**
|
|
29
|
+
* The count of unseen notifications
|
|
30
|
+
*/
|
|
31
|
+
unseenCount: number;
|
|
32
|
+
/**
|
|
33
|
+
* Custom styling URL
|
|
34
|
+
*/
|
|
35
|
+
clientStylingUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Decides the behaviour of the notification onClick
|
|
38
|
+
*/
|
|
39
|
+
notificationAction: string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom styling string
|
|
42
|
+
*/
|
|
43
|
+
clientStyling: string;
|
|
44
|
+
/**
|
|
45
|
+
* Translations via URL
|
|
46
|
+
*/
|
|
47
|
+
translationUrl: string;
|
|
48
|
+
private notifications;
|
|
49
|
+
private isLoading;
|
|
50
|
+
private showMarkAll;
|
|
51
|
+
private currentPage;
|
|
52
|
+
private stylingContainer;
|
|
53
|
+
private baseUrl;
|
|
54
|
+
allNotificationsRead: EventEmitter<any>;
|
|
55
|
+
messageDeteledHandler(event: CustomEvent<any>): void;
|
|
56
|
+
newNotificationHandler(event: CustomEvent<any>): void;
|
|
57
|
+
unseenCountHandler(newValue: number): void;
|
|
58
|
+
handleNewTranslations(): void;
|
|
59
|
+
componentWillLoad(): Promise<void>;
|
|
60
|
+
updateNotificationsDataAfterPageChange: (getNotificationsData: GetNotificationsReturnData) => void;
|
|
61
|
+
nextPage: () => Promise<void>;
|
|
62
|
+
prevPage: () => void;
|
|
63
|
+
setClientStyling: () => void;
|
|
64
|
+
setClientStylingURL: () => void;
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
markAllNotificationsAsRead: () => Promise<void>;
|
|
67
|
+
assignRefToStylingContainer: (ref: HTMLElement) => void;
|
|
68
|
+
render(): any;
|
|
69
|
+
}
|