@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,144 @@
|
|
|
1
|
+
export const initializeSession = async ({ baseUrl, body, sessionId }) => {
|
|
2
|
+
var _a;
|
|
3
|
+
const url = new URL(`${baseUrl}/widgets/session/initialize`);
|
|
4
|
+
const headers = new Headers();
|
|
5
|
+
headers.append('Content-Type', 'application/json');
|
|
6
|
+
headers.append('Authorization', sessionId);
|
|
7
|
+
const options = {
|
|
8
|
+
method: 'POST',
|
|
9
|
+
body: JSON.stringify(body),
|
|
10
|
+
headers
|
|
11
|
+
};
|
|
12
|
+
try {
|
|
13
|
+
const res = await fetch(url.href, options);
|
|
14
|
+
const data = await res.json();
|
|
15
|
+
const newToken = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.token;
|
|
16
|
+
headers.append('Widget-Authorization', `Bearer ${newToken}`);
|
|
17
|
+
const unseenCounter = await getUnseenCount({
|
|
18
|
+
baseUrl,
|
|
19
|
+
token: newToken
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
token: newToken,
|
|
23
|
+
unseenCounter,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.log(error);
|
|
28
|
+
return {
|
|
29
|
+
token: null,
|
|
30
|
+
unseenCounter: 0,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const getUnseenCount = async ({ baseUrl, token, }) => {
|
|
35
|
+
var _a;
|
|
36
|
+
const url = new URL(`${baseUrl}/widgets/notifications/unseen?limit=100`);
|
|
37
|
+
const headers = new Headers();
|
|
38
|
+
headers.append('Widget-Authorization', `Bearer ${token}`);
|
|
39
|
+
const options = {
|
|
40
|
+
method: 'GET',
|
|
41
|
+
headers,
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
const res = await fetch(url.href, options);
|
|
45
|
+
const data = await res.json();
|
|
46
|
+
const unseenCount = ((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.count) || 0;
|
|
47
|
+
return unseenCount;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.log(error);
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export const deleteMessage = async ({ baseUrl, token, messageId, }) => {
|
|
55
|
+
const url = new URL(`${baseUrl}/widgets/messages/${messageId}`);
|
|
56
|
+
const headers = new Headers();
|
|
57
|
+
headers.append('Widget-Authorization', `Bearer ${token}`);
|
|
58
|
+
const options = {
|
|
59
|
+
method: 'DELETE',
|
|
60
|
+
headers,
|
|
61
|
+
};
|
|
62
|
+
try {
|
|
63
|
+
await fetch(url.href, options);
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.log(error);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
export const markAsRead = async ({ baseUrl, body, token, unread, }) => {
|
|
72
|
+
const url = new URL(`${baseUrl}/widgets/messages/markAs`);
|
|
73
|
+
const headers = new Headers();
|
|
74
|
+
headers.append('Widget-Authorization', `Bearer ${token}`);
|
|
75
|
+
headers.append('Content-Type', 'application/json');
|
|
76
|
+
const options = {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
headers,
|
|
79
|
+
body: JSON.stringify(body),
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
const res = await fetch(url.href, options);
|
|
83
|
+
const data = await res.json();
|
|
84
|
+
return {
|
|
85
|
+
messageSeen: data.data[0].seen,
|
|
86
|
+
messageRead: data.data[0].read,
|
|
87
|
+
showSettingsModal: false,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
console.error('err', err);
|
|
92
|
+
return {
|
|
93
|
+
messageSeen: unread,
|
|
94
|
+
messageRead: unread,
|
|
95
|
+
showSettingsModal: true,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
100
|
+
const url = new URL(`${baseUrl}/widgets/notifications/feed`);
|
|
101
|
+
const headers = new Headers();
|
|
102
|
+
url.searchParams.append('page', page.toString());
|
|
103
|
+
headers.append('Widget-Authorization', `Bearer ${token}`);
|
|
104
|
+
const options = {
|
|
105
|
+
method: 'GET',
|
|
106
|
+
headers,
|
|
107
|
+
};
|
|
108
|
+
try {
|
|
109
|
+
const res = await fetch(url.href, options);
|
|
110
|
+
const data = await res.json();
|
|
111
|
+
return {
|
|
112
|
+
isLoading: false,
|
|
113
|
+
numberOfNotifications: data.totalCount,
|
|
114
|
+
notifications: data.data,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
console.log(error);
|
|
119
|
+
return {
|
|
120
|
+
isLoading: false,
|
|
121
|
+
numberOfNotifications: 0,
|
|
122
|
+
notifications: [],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
export const markAllAsRead = async ({ baseUrl, token, }) => {
|
|
127
|
+
const url = new URL(`${baseUrl}/widgets/messages/read`);
|
|
128
|
+
const headers = new Headers();
|
|
129
|
+
headers.append('Widget-Authorization', `Bearer ${token}`);
|
|
130
|
+
headers.append('Content-Type', 'application/json');
|
|
131
|
+
const options = {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
body: JSON.stringify({}),
|
|
134
|
+
headers
|
|
135
|
+
};
|
|
136
|
+
try {
|
|
137
|
+
await fetch(url.href, options);
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
console.log(error);
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/nuts-inbox-widget/nuts-inbox-widget.js",
|
|
4
|
+
"components/nuts-notification/nuts-notification.js",
|
|
5
|
+
"components/nuts-popover/nuts-popover.js"
|
|
6
|
+
],
|
|
7
|
+
"compiler": {
|
|
8
|
+
"name": "@stencil/core",
|
|
9
|
+
"version": "4.20.0",
|
|
10
|
+
"typescriptVersion": "5.5.3"
|
|
11
|
+
},
|
|
12
|
+
"collections": [],
|
|
13
|
+
"bundles": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: "Roboto", "Arial", sans-serif;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.BellIconWrapper {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 40px;
|
|
9
|
+
display: flex;
|
|
10
|
+
}
|
|
11
|
+
.BellIconWrapper :hover {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.BellIcon {
|
|
16
|
+
width: 40px;
|
|
17
|
+
height: 40px;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
import { getTranslations } from "../../utils/locale.utils";
|
|
2
|
+
import { h, } from "@stencil/core";
|
|
3
|
+
import { io } from "socket.io-client";
|
|
4
|
+
import { initializeSession } from "../../api/methods";
|
|
5
|
+
export class NutsInboxWidget {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.token = null;
|
|
8
|
+
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
9
|
+
this.initializeSessionBody = {
|
|
10
|
+
applicationIdentifier: this.applicationIdentifier,
|
|
11
|
+
subscriberId: this.subscriberId || `${this.operatorId}-${this.userId}`,
|
|
12
|
+
hmacHash: null,
|
|
13
|
+
language: this.language,
|
|
14
|
+
deviceId: this.deviceId
|
|
15
|
+
};
|
|
16
|
+
this.togglePopover = () => {
|
|
17
|
+
this.popoverVisible = !this.popoverVisible;
|
|
18
|
+
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
19
|
+
};
|
|
20
|
+
this.setClientStyling = () => {
|
|
21
|
+
let sheet = document.createElement('style');
|
|
22
|
+
sheet.innerHTML = this.clientStyling;
|
|
23
|
+
this.stylingContainer.prepend(sheet);
|
|
24
|
+
};
|
|
25
|
+
this.setClientStylingURL = () => {
|
|
26
|
+
let url = new URL(this.clientStylingUrl);
|
|
27
|
+
let cssFile = document.createElement('style');
|
|
28
|
+
fetch(url.href)
|
|
29
|
+
.then((res) => res.text())
|
|
30
|
+
.then((data) => {
|
|
31
|
+
cssFile.innerHTML = data;
|
|
32
|
+
this.clientStyling = data;
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
this.stylingContainer.prepend(cssFile);
|
|
35
|
+
}, 1);
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.log('error ', err);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
this.assignRefToStylingContainer = (ref) => {
|
|
42
|
+
this.stylingContainer = ref;
|
|
43
|
+
};
|
|
44
|
+
this.assignRefToBell = (ref) => {
|
|
45
|
+
this.bellIconRef = ref;
|
|
46
|
+
};
|
|
47
|
+
this.backendUrl = undefined;
|
|
48
|
+
this.socketUrl = undefined;
|
|
49
|
+
this.userId = undefined;
|
|
50
|
+
this.sessionId = undefined;
|
|
51
|
+
this.operatorId = undefined;
|
|
52
|
+
this.subscriberId = undefined;
|
|
53
|
+
this.deviceId = undefined;
|
|
54
|
+
this.language = 'en';
|
|
55
|
+
this.environment = 'stage';
|
|
56
|
+
this.applicationIdentifier = undefined;
|
|
57
|
+
this.clientStyling = '';
|
|
58
|
+
this.clientStylingUrl = undefined;
|
|
59
|
+
this.bellIconPosition = 'left';
|
|
60
|
+
this.notificationAction = 'default';
|
|
61
|
+
this.translationUrl = '';
|
|
62
|
+
this.isLoading = false;
|
|
63
|
+
this.popoverVisible = false;
|
|
64
|
+
this.unseenCount = undefined;
|
|
65
|
+
}
|
|
66
|
+
initializeHandler(newValue, oldValue) {
|
|
67
|
+
if (newValue !== oldValue) {
|
|
68
|
+
if (this.subscriberId && this.operatorId && this.applicationIdentifier) {
|
|
69
|
+
initializeSession({
|
|
70
|
+
baseUrl: this.baseUrl,
|
|
71
|
+
body: this.initializeSessionBody,
|
|
72
|
+
sessionId: this.sessionId,
|
|
73
|
+
}).then((initializeSessionResult) => {
|
|
74
|
+
this.token = initializeSessionResult.token;
|
|
75
|
+
this.unseenCount = initializeSessionResult.unseenCounter;
|
|
76
|
+
this.setupSocket();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
clickOutsideHandle(ev) {
|
|
82
|
+
if (ev.composedPath().some((elem) => this.el === elem)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.popoverVisible = false;
|
|
86
|
+
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
87
|
+
}
|
|
88
|
+
positionIcon() {
|
|
89
|
+
if (this.bellIconPosition == 'left') {
|
|
90
|
+
this.bellIconRef.style.justifyContent = 'flex-start';
|
|
91
|
+
}
|
|
92
|
+
if (this.bellIconPosition == 'right') {
|
|
93
|
+
this.bellIconRef.style.justifyContent = 'flex-end';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
setupSocket() {
|
|
97
|
+
if (this.token) {
|
|
98
|
+
this.socketRef = io(this.socketUrl, {
|
|
99
|
+
reconnection: true,
|
|
100
|
+
reconnectionDelayMax: 10000,
|
|
101
|
+
transports: ['websocket'],
|
|
102
|
+
auth: {
|
|
103
|
+
token: `${this.token}`,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
this.socketRef.on('connect_error', (error) => {
|
|
107
|
+
console.error('WebSocket error', error);
|
|
108
|
+
});
|
|
109
|
+
this.socketRef.on('reconnect_attempt', (attemptNumber) => {
|
|
110
|
+
console.log('Reconnect attempt', attemptNumber);
|
|
111
|
+
});
|
|
112
|
+
this.socketRef.on('notification_received', (data) => {
|
|
113
|
+
this.newNotification.emit(data.message);
|
|
114
|
+
});
|
|
115
|
+
this.socketRef.on('unseen_count_changed', (data) => {
|
|
116
|
+
this.unseenCount = data.unseenCount;
|
|
117
|
+
this.unseenCount > 0 &&
|
|
118
|
+
window.postMessage({ type: 'nuts-new-notifications', value: this.unseenCount }, window.location.href);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async connectedCallback() {
|
|
123
|
+
if (this.subscriberId && this.operatorId && this.applicationIdentifier) {
|
|
124
|
+
const initializeSessionResult = await initializeSession({
|
|
125
|
+
baseUrl: this.baseUrl,
|
|
126
|
+
body: this.initializeSessionBody,
|
|
127
|
+
sessionId: this.sessionId
|
|
128
|
+
});
|
|
129
|
+
this.token = initializeSessionResult.token;
|
|
130
|
+
this.unseenCount = initializeSessionResult.unseenCounter;
|
|
131
|
+
this.setupSocket();
|
|
132
|
+
}
|
|
133
|
+
if (this.clientStylingUrl) {
|
|
134
|
+
this.setClientStylingURL();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
handleNewTranslations() {
|
|
138
|
+
this.isLoading = true;
|
|
139
|
+
getTranslations(this.translationUrl).then(() => {
|
|
140
|
+
this.isLoading = false;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
async componentWillLoad() {
|
|
144
|
+
if (this.translationUrl.length > 2) {
|
|
145
|
+
await getTranslations(this.translationUrl);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
componentDidRender() {
|
|
149
|
+
this.positionIcon();
|
|
150
|
+
}
|
|
151
|
+
renderBellIcon() {
|
|
152
|
+
return (h("div", { onClick: this.togglePopover, class: "BellIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), h("defs", null, h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, h("stop", { "stop-color": "#FF512F" }), h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
return (h("div", { key: '5ea55cb5f025af68656bed7bb12c00d65e8e1c8d', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: '6c708ce73c72822752b65167ce652d65cec6addc', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (h("nuts-popover", { key: 'b7ef3f8c55f1718452620107d20ce43ab765036c', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "translation-url": this.translationUrl }))));
|
|
156
|
+
}
|
|
157
|
+
static get is() { return "nuts-inbox-widget"; }
|
|
158
|
+
static get encapsulation() { return "shadow"; }
|
|
159
|
+
static get originalStyleUrls() {
|
|
160
|
+
return {
|
|
161
|
+
"$": ["nuts-inbox-widget.scss"]
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
static get styleUrls() {
|
|
165
|
+
return {
|
|
166
|
+
"$": ["nuts-inbox-widget.css"]
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
static get properties() {
|
|
170
|
+
return {
|
|
171
|
+
"backendUrl": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "string",
|
|
176
|
+
"resolved": "string",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": true,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "HTTP Endpoint URL for NuTS"
|
|
184
|
+
},
|
|
185
|
+
"attribute": "backend-url",
|
|
186
|
+
"reflect": true
|
|
187
|
+
},
|
|
188
|
+
"socketUrl": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "string",
|
|
193
|
+
"resolved": "string",
|
|
194
|
+
"references": {}
|
|
195
|
+
},
|
|
196
|
+
"required": true,
|
|
197
|
+
"optional": false,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "Socket Endpoint URL for NuTS"
|
|
201
|
+
},
|
|
202
|
+
"attribute": "socket-url",
|
|
203
|
+
"reflect": true
|
|
204
|
+
},
|
|
205
|
+
"userId": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"mutable": false,
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "string",
|
|
210
|
+
"resolved": "string",
|
|
211
|
+
"references": {}
|
|
212
|
+
},
|
|
213
|
+
"required": true,
|
|
214
|
+
"optional": false,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": "The ID of the user"
|
|
218
|
+
},
|
|
219
|
+
"attribute": "user-id",
|
|
220
|
+
"reflect": true
|
|
221
|
+
},
|
|
222
|
+
"sessionId": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": true,
|
|
231
|
+
"optional": false,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": "The sessionID of the user"
|
|
235
|
+
},
|
|
236
|
+
"attribute": "session-id",
|
|
237
|
+
"reflect": true
|
|
238
|
+
},
|
|
239
|
+
"operatorId": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"mutable": false,
|
|
242
|
+
"complexType": {
|
|
243
|
+
"original": "string",
|
|
244
|
+
"resolved": "string",
|
|
245
|
+
"references": {}
|
|
246
|
+
},
|
|
247
|
+
"required": true,
|
|
248
|
+
"optional": false,
|
|
249
|
+
"docs": {
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": "The operatorID on which we can find the user"
|
|
252
|
+
},
|
|
253
|
+
"attribute": "operator-id",
|
|
254
|
+
"reflect": true
|
|
255
|
+
},
|
|
256
|
+
"subscriberId": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"mutable": false,
|
|
259
|
+
"complexType": {
|
|
260
|
+
"original": "string",
|
|
261
|
+
"resolved": "string",
|
|
262
|
+
"references": {}
|
|
263
|
+
},
|
|
264
|
+
"required": false,
|
|
265
|
+
"optional": true,
|
|
266
|
+
"docs": {
|
|
267
|
+
"tags": [],
|
|
268
|
+
"text": "The subscriberID"
|
|
269
|
+
},
|
|
270
|
+
"attribute": "subscriber-id",
|
|
271
|
+
"reflect": true
|
|
272
|
+
},
|
|
273
|
+
"deviceId": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "string",
|
|
278
|
+
"resolved": "string",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": true,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [],
|
|
285
|
+
"text": "The deviceID from which the user access the website"
|
|
286
|
+
},
|
|
287
|
+
"attribute": "device-id",
|
|
288
|
+
"reflect": true
|
|
289
|
+
},
|
|
290
|
+
"language": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"mutable": false,
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "string",
|
|
295
|
+
"resolved": "string",
|
|
296
|
+
"references": {}
|
|
297
|
+
},
|
|
298
|
+
"required": false,
|
|
299
|
+
"optional": false,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": "Language of the widget"
|
|
303
|
+
},
|
|
304
|
+
"attribute": "language",
|
|
305
|
+
"reflect": true,
|
|
306
|
+
"defaultValue": "'en'"
|
|
307
|
+
},
|
|
308
|
+
"environment": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"mutable": false,
|
|
311
|
+
"complexType": {
|
|
312
|
+
"original": "string",
|
|
313
|
+
"resolved": "string",
|
|
314
|
+
"references": {}
|
|
315
|
+
},
|
|
316
|
+
"required": false,
|
|
317
|
+
"optional": false,
|
|
318
|
+
"docs": {
|
|
319
|
+
"tags": [],
|
|
320
|
+
"text": "Environment on which the widget is used (possible values: `stage`, `prod`)"
|
|
321
|
+
},
|
|
322
|
+
"attribute": "environment",
|
|
323
|
+
"reflect": true,
|
|
324
|
+
"defaultValue": "'stage'"
|
|
325
|
+
},
|
|
326
|
+
"applicationIdentifier": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"mutable": false,
|
|
329
|
+
"complexType": {
|
|
330
|
+
"original": "string",
|
|
331
|
+
"resolved": "string",
|
|
332
|
+
"references": {}
|
|
333
|
+
},
|
|
334
|
+
"required": true,
|
|
335
|
+
"optional": false,
|
|
336
|
+
"docs": {
|
|
337
|
+
"tags": [],
|
|
338
|
+
"text": "Novu application identifier"
|
|
339
|
+
},
|
|
340
|
+
"attribute": "application-identifier",
|
|
341
|
+
"reflect": true
|
|
342
|
+
},
|
|
343
|
+
"clientStyling": {
|
|
344
|
+
"type": "string",
|
|
345
|
+
"mutable": true,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "string",
|
|
348
|
+
"resolved": "string",
|
|
349
|
+
"references": {}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": false,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": "Client custom styling via inline styles"
|
|
356
|
+
},
|
|
357
|
+
"attribute": "client-styling",
|
|
358
|
+
"reflect": true,
|
|
359
|
+
"defaultValue": "''"
|
|
360
|
+
},
|
|
361
|
+
"clientStylingUrl": {
|
|
362
|
+
"type": "string",
|
|
363
|
+
"mutable": false,
|
|
364
|
+
"complexType": {
|
|
365
|
+
"original": "string",
|
|
366
|
+
"resolved": "string",
|
|
367
|
+
"references": {}
|
|
368
|
+
},
|
|
369
|
+
"required": false,
|
|
370
|
+
"optional": false,
|
|
371
|
+
"docs": {
|
|
372
|
+
"tags": [],
|
|
373
|
+
"text": "Client styling url for a css file"
|
|
374
|
+
},
|
|
375
|
+
"attribute": "client-styling-url",
|
|
376
|
+
"reflect": true
|
|
377
|
+
},
|
|
378
|
+
"bellIconPosition": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": false,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "Position of the widget (possible values: `left` and `right`) - this changes the `justify-content` property of the `.BellIconWrapper` class"
|
|
391
|
+
},
|
|
392
|
+
"attribute": "bell-icon-position",
|
|
393
|
+
"reflect": true,
|
|
394
|
+
"defaultValue": "'left'"
|
|
395
|
+
},
|
|
396
|
+
"notificationAction": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "string",
|
|
401
|
+
"resolved": "string",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": false,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": "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"
|
|
409
|
+
},
|
|
410
|
+
"attribute": "notification-action",
|
|
411
|
+
"reflect": true,
|
|
412
|
+
"defaultValue": "'default'"
|
|
413
|
+
},
|
|
414
|
+
"translationUrl": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"mutable": false,
|
|
417
|
+
"complexType": {
|
|
418
|
+
"original": "string",
|
|
419
|
+
"resolved": "string",
|
|
420
|
+
"references": {}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": false,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "Translations via URL"
|
|
427
|
+
},
|
|
428
|
+
"attribute": "translation-url",
|
|
429
|
+
"reflect": true,
|
|
430
|
+
"defaultValue": "''"
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
static get states() {
|
|
435
|
+
return {
|
|
436
|
+
"isLoading": {},
|
|
437
|
+
"popoverVisible": {},
|
|
438
|
+
"unseenCount": {}
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
static get events() {
|
|
442
|
+
return [{
|
|
443
|
+
"method": "notificationFeed",
|
|
444
|
+
"name": "notificationFeed",
|
|
445
|
+
"bubbles": true,
|
|
446
|
+
"cancelable": true,
|
|
447
|
+
"composed": true,
|
|
448
|
+
"docs": {
|
|
449
|
+
"tags": [],
|
|
450
|
+
"text": ""
|
|
451
|
+
},
|
|
452
|
+
"complexType": {
|
|
453
|
+
"original": "Notification[]",
|
|
454
|
+
"resolved": "Notification[]",
|
|
455
|
+
"references": {
|
|
456
|
+
"Notification": {
|
|
457
|
+
"location": "import",
|
|
458
|
+
"path": "../../types/nuts-inbox-widget.types",
|
|
459
|
+
"id": "../../../../packages/stencil/nuts-inbox-widget/src/types/nuts-inbox-widget.types.ts::Notification"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}, {
|
|
464
|
+
"method": "newNotification",
|
|
465
|
+
"name": "newNotification",
|
|
466
|
+
"bubbles": true,
|
|
467
|
+
"cancelable": true,
|
|
468
|
+
"composed": true,
|
|
469
|
+
"docs": {
|
|
470
|
+
"tags": [],
|
|
471
|
+
"text": ""
|
|
472
|
+
},
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "any",
|
|
475
|
+
"resolved": "any",
|
|
476
|
+
"references": {}
|
|
477
|
+
}
|
|
478
|
+
}];
|
|
479
|
+
}
|
|
480
|
+
static get elementRef() { return "el"; }
|
|
481
|
+
static get watchers() {
|
|
482
|
+
return [{
|
|
483
|
+
"propName": "subscriberId",
|
|
484
|
+
"methodName": "initializeHandler"
|
|
485
|
+
}, {
|
|
486
|
+
"propName": "operatorId",
|
|
487
|
+
"methodName": "initializeHandler"
|
|
488
|
+
}, {
|
|
489
|
+
"propName": "applicationIdentifier",
|
|
490
|
+
"methodName": "initializeHandler"
|
|
491
|
+
}, {
|
|
492
|
+
"propName": "translationUrl",
|
|
493
|
+
"methodName": "handleNewTranslations"
|
|
494
|
+
}];
|
|
495
|
+
}
|
|
496
|
+
static get listeners() {
|
|
497
|
+
return [{
|
|
498
|
+
"name": "click",
|
|
499
|
+
"method": "clickOutsideHandle",
|
|
500
|
+
"target": "window",
|
|
501
|
+
"capture": false,
|
|
502
|
+
"passive": false
|
|
503
|
+
}];
|
|
504
|
+
}
|
|
505
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MAX_NOTIFICATION_TEXT_LENGTH = 150;
|