@everymatrix/nuts-inbox-widget 0.0.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/dist/cjs/index-305bcf58.js +1349 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/nuts-inbox-widget.cjs.js +19 -0
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +39985 -0
- package/dist/collection/collection-manifest.json +14 -0
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.css +15 -0
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +450 -0
- package/dist/collection/components/nuts-notification/nuts-notification.css +147 -0
- package/dist/collection/components/nuts-notification/nuts-notification.js +426 -0
- package/dist/collection/components/nuts-popover/nuts-popover.css +75 -0
- package/dist/collection/components/nuts-popover/nuts-popover.js +265 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/types/nuts-inbox-widget.types.js +47 -0
- package/dist/collection/utils/utils.js +0 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/nuts-inbox-widget.d.ts +11 -0
- package/dist/components/nuts-inbox-widget.js +4216 -0
- package/dist/components/nuts-notification.d.ts +11 -0
- package/dist/components/nuts-notification.js +6 -0
- package/dist/components/nuts-notification2.js +35762 -0
- package/dist/components/nuts-popover.d.ts +11 -0
- package/dist/components/nuts-popover.js +6 -0
- package/dist/components/nuts-popover2.js +119 -0
- package/dist/esm/index-4e49d940.js +1322 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/nuts-inbox-widget.js +17 -0
- package/dist/esm/nuts-inbox-widget_3.entry.js +39979 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -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-2f19681b.entry.js +1 -0
- package/dist/nuts-inbox-widget/p-d5a07a94.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-stencil/packages/nuts-inbox-widget/.stencil/packages/nuts-inbox-widget/stencil.config.d.ts +2 -0
- package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +70 -0
- package/dist/types/components/nuts-notification/nuts-notification.d.ts +38 -0
- package/dist/types/components/nuts-popover/nuts-popover.d.ts +29 -0
- package/dist/types/components.d.ts +225 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/types/nuts-inbox-widget.types.d.ts +98 -0
- package/dist/types/utils/utils.d.ts +0 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -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": "2.15.2",
|
|
10
|
+
"typescriptVersion": "4.5.4"
|
|
11
|
+
},
|
|
12
|
+
"collections": [],
|
|
13
|
+
"bundles": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Component, h, Prop, State, Watch, Event } from '@stencil/core';
|
|
3
|
+
import { io } from 'socket.io-client';
|
|
4
|
+
import { ClickOutside } from "stencil-click-outside";
|
|
5
|
+
export class NutsInboxWidget {
|
|
6
|
+
constructor() {
|
|
7
|
+
/**
|
|
8
|
+
* Language of the widget
|
|
9
|
+
*/
|
|
10
|
+
this.language = 'en';
|
|
11
|
+
/**
|
|
12
|
+
* Environment on which the widget is used (possible values: `stage`, `prod`)
|
|
13
|
+
*/
|
|
14
|
+
this.environment = 'stage';
|
|
15
|
+
/**
|
|
16
|
+
* Client custom styling via inline styles
|
|
17
|
+
*/
|
|
18
|
+
this.clientStyling = '';
|
|
19
|
+
this.isLoading = true;
|
|
20
|
+
this.popoverVisible = false;
|
|
21
|
+
this.ntsEndpoint = 'https://nts.everymatrix.com/ss';
|
|
22
|
+
this.token = null;
|
|
23
|
+
this.setClientStyling = () => {
|
|
24
|
+
let sheet = document.createElement('style');
|
|
25
|
+
sheet.innerHTML = this.clientStyling;
|
|
26
|
+
this.stylingContainer.prepend(sheet);
|
|
27
|
+
};
|
|
28
|
+
this.setClientStylingURL = () => {
|
|
29
|
+
let url = new URL(this.clientStylingUrl);
|
|
30
|
+
let cssFile = document.createElement('style');
|
|
31
|
+
fetch(url.href)
|
|
32
|
+
.then((res) => res.text())
|
|
33
|
+
.then((data) => {
|
|
34
|
+
cssFile.innerHTML = data;
|
|
35
|
+
this.clientStyling = data;
|
|
36
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
37
|
+
})
|
|
38
|
+
.catch((err) => {
|
|
39
|
+
console.log('error ', err);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
paramChangeHandler(newValue, oldValue) {
|
|
44
|
+
if (newValue != oldValue) {
|
|
45
|
+
if (this.userId && this.sessionId && this.operatorId) {
|
|
46
|
+
this.callSS();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
initializeHandler(newValue, oldValue) {
|
|
51
|
+
if (newValue != oldValue) {
|
|
52
|
+
if (this.userId && this.operatorId && this.applicationIdentifier) {
|
|
53
|
+
this.initializeSession();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
clickOutsideHandle() {
|
|
58
|
+
this.popoverVisible = false;
|
|
59
|
+
}
|
|
60
|
+
callSS() {
|
|
61
|
+
const url = new URL(`${this.ntsEndpoint}/v1/${this.operatorId}/subscribers/${this.userId}`);
|
|
62
|
+
if (this.deviceId) {
|
|
63
|
+
url.searchParams.append('deviceToken', this.deviceId);
|
|
64
|
+
}
|
|
65
|
+
url.searchParams.append('language', this.language);
|
|
66
|
+
const headers = new Headers();
|
|
67
|
+
headers.append('authorization', this.sessionId);
|
|
68
|
+
headers.append('Content-Type', 'application/json');
|
|
69
|
+
const options = {
|
|
70
|
+
method: 'GET',
|
|
71
|
+
headers,
|
|
72
|
+
};
|
|
73
|
+
fetch(url.href, options)
|
|
74
|
+
.then((res) => {
|
|
75
|
+
if (res.status < 300) {
|
|
76
|
+
return res.json();
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.catch((err) => {
|
|
80
|
+
console.error('There was an error while trying to connect to the Notification System', err);
|
|
81
|
+
})
|
|
82
|
+
.finally(() => {
|
|
83
|
+
this.isLoading = false;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
setupSocket() {
|
|
87
|
+
if (this.token) {
|
|
88
|
+
this.socketRef = io(this.socketUrl, {
|
|
89
|
+
reconnectionDelayMax: 10000,
|
|
90
|
+
transports: ['websocket'],
|
|
91
|
+
auth: {
|
|
92
|
+
token: `${this.token}`,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
this.socketRef.on('connect_error', (error) => {
|
|
96
|
+
console.error('WebSocket error', error);
|
|
97
|
+
});
|
|
98
|
+
this.socketRef.on('notification_received', (data) => {
|
|
99
|
+
this.newNotification.emit(data.message);
|
|
100
|
+
});
|
|
101
|
+
this.socketRef.on('unseen_count_changed', (data) => {
|
|
102
|
+
this.unseenCount = data.unseenCount;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
getUnseenCounter() {
|
|
107
|
+
let url = new URL(`${this.backendUrl}/v1/widgets/notifications/unseen?limit=100`);
|
|
108
|
+
const headers = new Headers();
|
|
109
|
+
headers.append('Authorization', `Bearer ${this.token || ''}`);
|
|
110
|
+
const options = {
|
|
111
|
+
method: 'GET',
|
|
112
|
+
headers,
|
|
113
|
+
};
|
|
114
|
+
fetch(url.href, options)
|
|
115
|
+
.then((res) => res.json())
|
|
116
|
+
.then((data) => {
|
|
117
|
+
this.unseenCount = data.data.count;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async initializeSession() {
|
|
121
|
+
return new Promise((resolve, reject) => {
|
|
122
|
+
let url = new URL(`${this.backendUrl}/v1/widgets/session/initialize`);
|
|
123
|
+
const headers = new Headers();
|
|
124
|
+
headers.append('Authorization', `Bearer ${this.token || ''}`);
|
|
125
|
+
headers.append('Content-Type', 'application/json');
|
|
126
|
+
const body = {
|
|
127
|
+
applicationIdentifier: this.applicationIdentifier,
|
|
128
|
+
subscriberId: `${this.operatorId}-${this.userId}`,
|
|
129
|
+
hmacHash: null
|
|
130
|
+
};
|
|
131
|
+
const options = {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
body: JSON.stringify(body),
|
|
134
|
+
headers,
|
|
135
|
+
};
|
|
136
|
+
fetch(url.href, options)
|
|
137
|
+
.then(res => res.json())
|
|
138
|
+
.then((data) => {
|
|
139
|
+
this.token = data.data.token;
|
|
140
|
+
this.setupSocket();
|
|
141
|
+
this.getUnseenCounter();
|
|
142
|
+
resolve(data);
|
|
143
|
+
})
|
|
144
|
+
.catch((err) => {
|
|
145
|
+
reject(err);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
togglePopover() {
|
|
150
|
+
this.popoverVisible = !this.popoverVisible;
|
|
151
|
+
}
|
|
152
|
+
async connectedCallback() {
|
|
153
|
+
if (this.userId && this.operatorId && this.applicationIdentifier) {
|
|
154
|
+
this.initializeSession();
|
|
155
|
+
}
|
|
156
|
+
if (this.userId && this.operatorId && this.sessionId) {
|
|
157
|
+
this.callSS();
|
|
158
|
+
}
|
|
159
|
+
if (this.clientStylingUrl) {
|
|
160
|
+
this.setClientStylingURL();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
renderBellIcon() {
|
|
164
|
+
return (h("div", { onClick: () => this.togglePopover(), class: "BellIcon" },
|
|
165
|
+
h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" },
|
|
166
|
+
" ",
|
|
167
|
+
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" }),
|
|
168
|
+
" "),
|
|
169
|
+
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" },
|
|
170
|
+
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" }),
|
|
171
|
+
h("defs", null,
|
|
172
|
+
h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" },
|
|
173
|
+
h("stop", { "stop-color": "#FF512F" }),
|
|
174
|
+
h("stop", { offset: "1", "stop-color": "#DD2476" })))) : ''));
|
|
175
|
+
}
|
|
176
|
+
render() {
|
|
177
|
+
return (h("div", { class: "BellIconWrapper", ref: el => this.stylingContainer = el },
|
|
178
|
+
!this.isLoading && this.renderBellIcon(),
|
|
179
|
+
this.popoverVisible && h("nuts-popover", { "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 })));
|
|
180
|
+
}
|
|
181
|
+
static get is() { return "nuts-inbox-widget"; }
|
|
182
|
+
static get encapsulation() { return "shadow"; }
|
|
183
|
+
static get originalStyleUrls() { return {
|
|
184
|
+
"$": ["nuts-inbox-widget.scss"]
|
|
185
|
+
}; }
|
|
186
|
+
static get styleUrls() { return {
|
|
187
|
+
"$": ["nuts-inbox-widget.css"]
|
|
188
|
+
}; }
|
|
189
|
+
static get properties() { return {
|
|
190
|
+
"backendUrl": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "string",
|
|
195
|
+
"resolved": "string",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": true,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": "HTTP Endpoint URL for NuTS"
|
|
203
|
+
},
|
|
204
|
+
"attribute": "backend-url",
|
|
205
|
+
"reflect": true
|
|
206
|
+
},
|
|
207
|
+
"socketUrl": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "string",
|
|
212
|
+
"resolved": "string",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": true,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": "Socket Endpoint URL for NuTS"
|
|
220
|
+
},
|
|
221
|
+
"attribute": "socket-url",
|
|
222
|
+
"reflect": true
|
|
223
|
+
},
|
|
224
|
+
"userId": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"mutable": false,
|
|
227
|
+
"complexType": {
|
|
228
|
+
"original": "string",
|
|
229
|
+
"resolved": "string",
|
|
230
|
+
"references": {}
|
|
231
|
+
},
|
|
232
|
+
"required": true,
|
|
233
|
+
"optional": false,
|
|
234
|
+
"docs": {
|
|
235
|
+
"tags": [],
|
|
236
|
+
"text": "The ID of the user"
|
|
237
|
+
},
|
|
238
|
+
"attribute": "user-id",
|
|
239
|
+
"reflect": true
|
|
240
|
+
},
|
|
241
|
+
"sessionId": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"mutable": false,
|
|
244
|
+
"complexType": {
|
|
245
|
+
"original": "string",
|
|
246
|
+
"resolved": "string",
|
|
247
|
+
"references": {}
|
|
248
|
+
},
|
|
249
|
+
"required": true,
|
|
250
|
+
"optional": false,
|
|
251
|
+
"docs": {
|
|
252
|
+
"tags": [],
|
|
253
|
+
"text": "The sessionID of the user"
|
|
254
|
+
},
|
|
255
|
+
"attribute": "session-id",
|
|
256
|
+
"reflect": true
|
|
257
|
+
},
|
|
258
|
+
"operatorId": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"mutable": false,
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "string",
|
|
263
|
+
"resolved": "string",
|
|
264
|
+
"references": {}
|
|
265
|
+
},
|
|
266
|
+
"required": true,
|
|
267
|
+
"optional": false,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "The operatorID on which we can find the user"
|
|
271
|
+
},
|
|
272
|
+
"attribute": "operator-id",
|
|
273
|
+
"reflect": true
|
|
274
|
+
},
|
|
275
|
+
"deviceId": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"mutable": false,
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "string",
|
|
280
|
+
"resolved": "string",
|
|
281
|
+
"references": {}
|
|
282
|
+
},
|
|
283
|
+
"required": false,
|
|
284
|
+
"optional": true,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [],
|
|
287
|
+
"text": "The deviceID from which the user access the website"
|
|
288
|
+
},
|
|
289
|
+
"attribute": "device-id",
|
|
290
|
+
"reflect": true
|
|
291
|
+
},
|
|
292
|
+
"language": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"mutable": false,
|
|
295
|
+
"complexType": {
|
|
296
|
+
"original": "string",
|
|
297
|
+
"resolved": "string",
|
|
298
|
+
"references": {}
|
|
299
|
+
},
|
|
300
|
+
"required": false,
|
|
301
|
+
"optional": false,
|
|
302
|
+
"docs": {
|
|
303
|
+
"tags": [],
|
|
304
|
+
"text": "Language of the widget"
|
|
305
|
+
},
|
|
306
|
+
"attribute": "language",
|
|
307
|
+
"reflect": true,
|
|
308
|
+
"defaultValue": "'en'"
|
|
309
|
+
},
|
|
310
|
+
"environment": {
|
|
311
|
+
"type": "string",
|
|
312
|
+
"mutable": false,
|
|
313
|
+
"complexType": {
|
|
314
|
+
"original": "string",
|
|
315
|
+
"resolved": "string",
|
|
316
|
+
"references": {}
|
|
317
|
+
},
|
|
318
|
+
"required": false,
|
|
319
|
+
"optional": false,
|
|
320
|
+
"docs": {
|
|
321
|
+
"tags": [],
|
|
322
|
+
"text": "Environment on which the widget is used (possible values: `stage`, `prod`)"
|
|
323
|
+
},
|
|
324
|
+
"attribute": "environment",
|
|
325
|
+
"reflect": true,
|
|
326
|
+
"defaultValue": "'stage'"
|
|
327
|
+
},
|
|
328
|
+
"applicationIdentifier": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"mutable": false,
|
|
331
|
+
"complexType": {
|
|
332
|
+
"original": "string",
|
|
333
|
+
"resolved": "string",
|
|
334
|
+
"references": {}
|
|
335
|
+
},
|
|
336
|
+
"required": true,
|
|
337
|
+
"optional": false,
|
|
338
|
+
"docs": {
|
|
339
|
+
"tags": [],
|
|
340
|
+
"text": "Novu application identifier"
|
|
341
|
+
},
|
|
342
|
+
"attribute": "application-identifier",
|
|
343
|
+
"reflect": true
|
|
344
|
+
},
|
|
345
|
+
"clientStyling": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"mutable": true,
|
|
348
|
+
"complexType": {
|
|
349
|
+
"original": "string",
|
|
350
|
+
"resolved": "string",
|
|
351
|
+
"references": {}
|
|
352
|
+
},
|
|
353
|
+
"required": false,
|
|
354
|
+
"optional": false,
|
|
355
|
+
"docs": {
|
|
356
|
+
"tags": [],
|
|
357
|
+
"text": "Client custom styling via inline styles"
|
|
358
|
+
},
|
|
359
|
+
"attribute": "client-styling",
|
|
360
|
+
"reflect": true,
|
|
361
|
+
"defaultValue": "''"
|
|
362
|
+
},
|
|
363
|
+
"clientStylingUrl": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"mutable": false,
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "string",
|
|
368
|
+
"resolved": "string",
|
|
369
|
+
"references": {}
|
|
370
|
+
},
|
|
371
|
+
"required": false,
|
|
372
|
+
"optional": false,
|
|
373
|
+
"docs": {
|
|
374
|
+
"tags": [],
|
|
375
|
+
"text": "Custom styling url for the novu iFrame, formatted as a JSON object according to the documentation: https://docs.novu.co/notification-center/custom-styling/"
|
|
376
|
+
},
|
|
377
|
+
"attribute": "client-styling-url",
|
|
378
|
+
"reflect": true
|
|
379
|
+
}
|
|
380
|
+
}; }
|
|
381
|
+
static get states() { return {
|
|
382
|
+
"isLoading": {},
|
|
383
|
+
"popoverVisible": {},
|
|
384
|
+
"unseenCount": {}
|
|
385
|
+
}; }
|
|
386
|
+
static get events() { return [{
|
|
387
|
+
"method": "notificationFeed",
|
|
388
|
+
"name": "notificationFeed",
|
|
389
|
+
"bubbles": true,
|
|
390
|
+
"cancelable": true,
|
|
391
|
+
"composed": true,
|
|
392
|
+
"docs": {
|
|
393
|
+
"tags": [],
|
|
394
|
+
"text": ""
|
|
395
|
+
},
|
|
396
|
+
"complexType": {
|
|
397
|
+
"original": "Notifications[]",
|
|
398
|
+
"resolved": "Notifications[]",
|
|
399
|
+
"references": {
|
|
400
|
+
"Notifications": {
|
|
401
|
+
"location": "import",
|
|
402
|
+
"path": "../../types/nuts-inbox-widget.types"
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}, {
|
|
407
|
+
"method": "newNotification",
|
|
408
|
+
"name": "newNotification",
|
|
409
|
+
"bubbles": true,
|
|
410
|
+
"cancelable": true,
|
|
411
|
+
"composed": true,
|
|
412
|
+
"docs": {
|
|
413
|
+
"tags": [],
|
|
414
|
+
"text": ""
|
|
415
|
+
},
|
|
416
|
+
"complexType": {
|
|
417
|
+
"original": "any",
|
|
418
|
+
"resolved": "any",
|
|
419
|
+
"references": {}
|
|
420
|
+
}
|
|
421
|
+
}]; }
|
|
422
|
+
static get watchers() { return [{
|
|
423
|
+
"propName": "userId",
|
|
424
|
+
"methodName": "paramChangeHandler"
|
|
425
|
+
}, {
|
|
426
|
+
"propName": "sessionId",
|
|
427
|
+
"methodName": "paramChangeHandler"
|
|
428
|
+
}, {
|
|
429
|
+
"propName": "operatorId",
|
|
430
|
+
"methodName": "paramChangeHandler"
|
|
431
|
+
}, {
|
|
432
|
+
"propName": "deviceId",
|
|
433
|
+
"methodName": "paramChangeHandler"
|
|
434
|
+
}, {
|
|
435
|
+
"propName": "userId",
|
|
436
|
+
"methodName": "initializeHandler"
|
|
437
|
+
}, {
|
|
438
|
+
"propName": "operatorId",
|
|
439
|
+
"methodName": "initializeHandler"
|
|
440
|
+
}, {
|
|
441
|
+
"propName": "applicationIdentifier",
|
|
442
|
+
"methodName": "initializeHandler"
|
|
443
|
+
}]; }
|
|
444
|
+
}
|
|
445
|
+
__decorate([
|
|
446
|
+
ClickOutside(),
|
|
447
|
+
__metadata("design:type", Function),
|
|
448
|
+
__metadata("design:paramtypes", []),
|
|
449
|
+
__metadata("design:returntype", void 0)
|
|
450
|
+
], NutsInboxWidget.prototype, "clickOutsideHandle", null);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
p {
|
|
6
|
+
display: block;
|
|
7
|
+
margin-block-start: 0em;
|
|
8
|
+
margin-block-end: 0em;
|
|
9
|
+
margin-inline-start: 0px;
|
|
10
|
+
margin-inline-end: 0px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.NotificationContainer {
|
|
14
|
+
animation: show 600ms 100ms cubic-bezier(0.38, 0.97, 0.56, 0.76) forwards;
|
|
15
|
+
opacity: 0;
|
|
16
|
+
transform-origin: top center;
|
|
17
|
+
padding: 15px;
|
|
18
|
+
position: relative;
|
|
19
|
+
display: flex;
|
|
20
|
+
line-height: 20px;
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
align-items: center;
|
|
23
|
+
border-radius: 7px;
|
|
24
|
+
margin: 10px 15px;
|
|
25
|
+
color: white;
|
|
26
|
+
background: #23232b;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
}
|
|
30
|
+
@keyframes show {
|
|
31
|
+
100% {
|
|
32
|
+
opacity: 1;
|
|
33
|
+
transform: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.NotificationContainer .AvatarContainer {
|
|
37
|
+
margin-right: 10px;
|
|
38
|
+
width: 40px;
|
|
39
|
+
min-width: 40px;
|
|
40
|
+
height: 40px;
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
font-size: 40px;
|
|
46
|
+
border: 1px solid #525266;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
}
|
|
49
|
+
.NotificationContainer .AvatarContainer .Avatar {
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
position: relative;
|
|
52
|
+
display: block;
|
|
53
|
+
user-select: none;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
width: 38px;
|
|
56
|
+
min-width: 38px;
|
|
57
|
+
height: 38px;
|
|
58
|
+
border-radius: 32px;
|
|
59
|
+
text-decoration: none;
|
|
60
|
+
border: 0px;
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
padding: 0px;
|
|
63
|
+
}
|
|
64
|
+
.NotificationContainer .AvatarContainer .Avatar .AvatarImage {
|
|
65
|
+
object-fit: cover;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
display: block;
|
|
69
|
+
}
|
|
70
|
+
.NotificationContainer .ContentContainer {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
}
|
|
74
|
+
.NotificationContainer .Date {
|
|
75
|
+
min-width: 55px;
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
font-weight: 400;
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
line-height: 14.4px;
|
|
80
|
+
color: #525266;
|
|
81
|
+
}
|
|
82
|
+
.NotificationContainer .Settings {
|
|
83
|
+
opacity: 0;
|
|
84
|
+
margin-left: auto;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
.NotificationContainer .SettingsDropdown {
|
|
88
|
+
z-index: 999;
|
|
89
|
+
position: absolute;
|
|
90
|
+
background: #292933;
|
|
91
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 20px;
|
|
92
|
+
border-radius: 7px;
|
|
93
|
+
padding: 4px;
|
|
94
|
+
border: none;
|
|
95
|
+
left: 200px;
|
|
96
|
+
top: 40px;
|
|
97
|
+
transition-property: opacity;
|
|
98
|
+
transition-duration: 150ms;
|
|
99
|
+
transition-timing-function: ease;
|
|
100
|
+
opacity: 1;
|
|
101
|
+
z-index: 300;
|
|
102
|
+
width: max-content;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
}
|
|
106
|
+
.NotificationContainer .SettingsDropdown svg {
|
|
107
|
+
margin-right: 10px;
|
|
108
|
+
}
|
|
109
|
+
.NotificationContainer .SettingsDropdown button {
|
|
110
|
+
font-family: inherit;
|
|
111
|
+
border: 0px;
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
outline: 0px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
text-align: left;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
padding: 10px 12px;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
border-radius: 7px;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
color: white;
|
|
124
|
+
font-weight: 400;
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
}
|
|
127
|
+
.NotificationContainer .SettingsDropdown button:hover {
|
|
128
|
+
background: #3d3d4d;
|
|
129
|
+
transition: 300ms;
|
|
130
|
+
}
|
|
131
|
+
.NotificationContainer:hover .Settings {
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.Unseen::before {
|
|
136
|
+
content: "";
|
|
137
|
+
position: absolute;
|
|
138
|
+
inset: 0px;
|
|
139
|
+
width: 5px;
|
|
140
|
+
border-radius: 7px 0px 0px 7px;
|
|
141
|
+
background: linear-gradient(0deg, #ff512f 0%, #dd2476 100%);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.Unseen:hover .UnseenButton {
|
|
145
|
+
opacity: 0;
|
|
146
|
+
width: 0px;
|
|
147
|
+
}
|