@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.
Files changed (56) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-ae4a5047.js +1329 -0
  3. package/dist/cjs/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/nuts-inbox-widget.cjs.js +25 -0
  6. package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +40953 -0
  7. package/dist/collection/api/methods/index.js +144 -0
  8. package/dist/collection/api/methods/types.js +1 -0
  9. package/dist/collection/collection-manifest.json +14 -0
  10. package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.css +21 -0
  11. package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +505 -0
  12. package/dist/collection/components/nuts-notification/constants.js +1 -0
  13. package/dist/collection/components/nuts-notification/nuts-notification.css +167 -0
  14. package/dist/collection/components/nuts-notification/nuts-notification.js +596 -0
  15. package/dist/collection/components/nuts-popover/nuts-popover.css +129 -0
  16. package/dist/collection/components/nuts-popover/nuts-popover.js +383 -0
  17. package/dist/collection/index.js +1 -0
  18. package/dist/collection/types/nuts-inbox-widget.types.js +39 -0
  19. package/dist/collection/utils/locale.utils.js +52 -0
  20. package/dist/collection/utils/utils.js +6 -0
  21. package/dist/esm/app-globals-0f993ce5.js +3 -0
  22. package/dist/esm/index-64960aae.js +1301 -0
  23. package/dist/esm/index.js +1 -0
  24. package/dist/esm/loader.js +11 -0
  25. package/dist/esm/nuts-inbox-widget.js +20 -0
  26. package/dist/esm/nuts-inbox-widget_3.entry.js +40947 -0
  27. package/dist/index.cjs.js +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/nuts-inbox-widget/index.esm.js +0 -0
  30. package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -0
  31. package/dist/nuts-inbox-widget/p-80fb2012.js +2 -0
  32. package/dist/nuts-inbox-widget/p-a97eb392.entry.js +1 -0
  33. package/dist/nuts-inbox-widget/p-e1255160.js +1 -0
  34. package/dist/stencil.config.dev.js +15 -0
  35. package/dist/stencil.config.js +17 -0
  36. 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
  37. 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
  38. package/dist/types/api/methods/index.d.ts +7 -0
  39. package/dist/types/api/methods/types.d.ts +66 -0
  40. package/dist/types/components/nuts-inbox-widget/nuts-inbox-widget.d.ts +91 -0
  41. package/dist/types/components/nuts-notification/constants.d.ts +1 -0
  42. package/dist/types/components/nuts-notification/nuts-notification.d.ts +102 -0
  43. package/dist/types/components/nuts-popover/nuts-popover.d.ts +69 -0
  44. package/dist/types/components.d.ts +477 -0
  45. package/dist/types/index.d.ts +1 -0
  46. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  47. package/dist/types/types/nuts-inbox-widget.types.d.ts +97 -0
  48. package/dist/types/utils/locale.utils.d.ts +2 -0
  49. package/dist/types/utils/utils.d.ts +1 -0
  50. package/loader/cdn.js +1 -0
  51. package/loader/index.cjs.js +1 -0
  52. package/loader/index.d.ts +24 -0
  53. package/loader/index.es2017.js +1 -0
  54. package/loader/index.js +2 -0
  55. package/loader/package.json +11 -0
  56. package/package.json +4 -1
@@ -0,0 +1,129 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .Popover {
6
+ padding: 15px 0px;
7
+ border-radius: 7px;
8
+ box-shadow: var(--emfe-w-color-gray-400, rgba(0, 0, 0, 0.2)) 0px 5px 20px;
9
+ background: var(--emfe-w-color-gray-300, rgb(30, 30, 38));
10
+ margin: 0px;
11
+ font-family: inherit;
12
+ color: var(--emfe-w-color-gray-200, rgb(51, 55, 55));
13
+ direction: ltr;
14
+ width: 420px;
15
+ z-index: 999;
16
+ position: absolute;
17
+ right: 0;
18
+ }
19
+ .Popover .Header {
20
+ display: flex;
21
+ justify-content: space-between;
22
+ padding: 0 20px 10px 20px;
23
+ box-shadow: var(--emfe-w-color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 5px -5px;
24
+ }
25
+ .Popover .Header .Title {
26
+ color: var(--emfe-w-color-white, rgb(255, 255, 255));
27
+ font-size: 20px;
28
+ font-style: normal;
29
+ font-weight: 700;
30
+ line-height: 24px;
31
+ text-align: center;
32
+ padding-left: 10px;
33
+ }
34
+ .Popover .Header .Title .UnseenCounter {
35
+ text-decoration: none;
36
+ box-sizing: border-box;
37
+ display: inline-flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ text-transform: uppercase;
41
+ border-radius: 10px;
42
+ letter-spacing: 0.25px;
43
+ text-overflow: ellipsis;
44
+ overflow: hidden;
45
+ padding: 0px;
46
+ margin-left: 10px;
47
+ width: 25px;
48
+ height: 20px;
49
+ pointer-events: none;
50
+ border: none;
51
+ background: linear-gradient(0deg, var(--emfe-w-color-secondary-20, rgb(255, 81, 47)) 0%, var(--emfe-w-color-secondary, rgb(221, 36, 118)) 100%);
52
+ font-family: inherit;
53
+ line-height: 14px;
54
+ color: var(--emfe-w-color-white, rgb(255, 255, 255));
55
+ font-weight: bold;
56
+ font-size: 12px;
57
+ }
58
+ .Popover .Header .MarkAsRead {
59
+ margin-top: 5px;
60
+ margin-right: 10px;
61
+ font-size: 14px;
62
+ font-style: normal;
63
+ font-weight: 400;
64
+ line-height: 17px;
65
+ color: var(--emfe-w-color-gray-150, rgb(130, 130, 153));
66
+ cursor: pointer;
67
+ pointer-events: auto;
68
+ opacity: 0.5;
69
+ }
70
+ .Popover .Header .MarkAsRead:hover {
71
+ opacity: 0.7;
72
+ transition: 250ms;
73
+ }
74
+ .Popover .NotificationList {
75
+ height: 400px;
76
+ overflow: auto;
77
+ box-shadow: 0px 20px 10px -20px rgba(0, 0, 0, 0.45) inset, 0px -20px 10px -20px rgba(0, 0, 0, 0.45) inset;
78
+ }
79
+ .Popover .NotificationList .NoMessages {
80
+ display: flex;
81
+ justify-content: center;
82
+ flex-direction: column;
83
+ align-items: center;
84
+ height: 100%;
85
+ }
86
+ .Popover .NotificationList .NoMessages p {
87
+ color: var(--emfe-w-color-white, #fff);
88
+ opacity: 0.7;
89
+ }
90
+ .Popover .Pagination {
91
+ display: flex;
92
+ justify-content: space-around;
93
+ margin-top: 13px;
94
+ }
95
+ .Popover .Pagination .Button {
96
+ width: 43%;
97
+ }
98
+ .Popover .Pagination .Button button {
99
+ font-family: inherit;
100
+ border: 0px;
101
+ background-color: transparent;
102
+ outline: 0px;
103
+ width: 100%;
104
+ text-align: left;
105
+ text-decoration: none;
106
+ box-sizing: border-box;
107
+ padding: 10px 12px;
108
+ cursor: pointer;
109
+ border-radius: 7px;
110
+ display: flex;
111
+ align-items: center;
112
+ color: var(--emfe-w-color-white, rgb(255, 255, 255));
113
+ font-weight: 400;
114
+ font-size: 14px;
115
+ justify-content: center;
116
+ }
117
+ .Popover .Pagination .Button button svg {
118
+ width: 15px;
119
+ height: 15px;
120
+ fill: white;
121
+ }
122
+ .Popover .Pagination .Button button:disabled {
123
+ cursor: default;
124
+ opacity: 0.5;
125
+ }
126
+ .Popover .Pagination .Button button:hover:enabled {
127
+ background: var(--emfe-w-color-gray-300, rgb(61, 61, 77));
128
+ transition: 300ms;
129
+ }
@@ -0,0 +1,383 @@
1
+ import { h, } from "@stencil/core";
2
+ import { translate, getTranslations } from "../../utils/locale.utils";
3
+ import { getNotifications, markAllAsRead } from "../../api/methods";
4
+ export class NutsPopover {
5
+ constructor() {
6
+ this.currentPage = 0;
7
+ this.updateNotificationsDataAfterPageChange = (getNotificationsData) => {
8
+ this.isLoading = getNotificationsData.isLoading;
9
+ this.notifications = getNotificationsData.notifications;
10
+ };
11
+ this.nextPage = async () => {
12
+ getNotifications({
13
+ baseUrl: this.baseUrl,
14
+ token: this.token,
15
+ page: ++this.currentPage,
16
+ }).then((data) => {
17
+ console.log(data);
18
+ return this.updateNotificationsDataAfterPageChange(data);
19
+ });
20
+ };
21
+ this.prevPage = () => {
22
+ getNotifications({
23
+ baseUrl: this.baseUrl,
24
+ token: this.token,
25
+ page: --this.currentPage,
26
+ }).then((data) => this.updateNotificationsDataAfterPageChange(data));
27
+ };
28
+ this.setClientStyling = () => {
29
+ let sheet = document.createElement('style');
30
+ sheet.innerHTML = this.clientStyling;
31
+ this.stylingContainer.prepend(sheet);
32
+ };
33
+ this.setClientStylingURL = () => {
34
+ let url = new URL(this.clientStylingUrl);
35
+ let cssFile = document.createElement('style');
36
+ fetch(url.href)
37
+ .then((res) => res.text())
38
+ .then((data) => {
39
+ cssFile.innerHTML = data;
40
+ setTimeout(() => {
41
+ this.stylingContainer.prepend(cssFile);
42
+ }, 1);
43
+ })
44
+ .catch((err) => {
45
+ console.log('error ', err);
46
+ });
47
+ };
48
+ this.markAllNotificationsAsRead = async () => {
49
+ const markedAllNotificationsAsRead = await markAllAsRead({
50
+ baseUrl: this.baseUrl,
51
+ token: this.token
52
+ });
53
+ if (markedAllNotificationsAsRead) {
54
+ this.allNotificationsRead.emit();
55
+ }
56
+ };
57
+ this.assignRefToStylingContainer = (ref) => {
58
+ this.stylingContainer = ref;
59
+ };
60
+ this.language = undefined;
61
+ this.userId = undefined;
62
+ this.operatorId = undefined;
63
+ this.token = undefined;
64
+ this.sessionId = undefined;
65
+ this.backendUrl = undefined;
66
+ this.unseenCount = undefined;
67
+ this.clientStylingUrl = undefined;
68
+ this.notificationAction = undefined;
69
+ this.clientStyling = '';
70
+ this.translationUrl = '';
71
+ this.notifications = undefined;
72
+ this.isLoading = true;
73
+ this.showMarkAll = false;
74
+ }
75
+ messageDeteledHandler(event) {
76
+ this.notifications = this.notifications.filter((item) => {
77
+ return item._id != event.detail;
78
+ });
79
+ getNotifications({
80
+ baseUrl: this.baseUrl,
81
+ token: this.token,
82
+ page: this.currentPage,
83
+ }).then((data) => this.updateNotificationsDataAfterPageChange(data));
84
+ }
85
+ newNotificationHandler(event) {
86
+ if (Array.isArray(this.notifications)) {
87
+ this.notifications = [event.detail, ...this.notifications];
88
+ return;
89
+ }
90
+ this.notifications = [event.detail];
91
+ }
92
+ unseenCountHandler(newValue) {
93
+ if (newValue == 0) {
94
+ this.showMarkAll = false;
95
+ }
96
+ else {
97
+ this.showMarkAll = true;
98
+ }
99
+ }
100
+ handleNewTranslations() {
101
+ this.isLoading = true;
102
+ getTranslations(this.translationUrl).then(() => {
103
+ this.isLoading = false;
104
+ });
105
+ }
106
+ async componentWillLoad() {
107
+ if (this.translationUrl.length > 2) {
108
+ await getTranslations(this.translationUrl);
109
+ }
110
+ }
111
+ connectedCallback() {
112
+ this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
113
+ getNotifications({
114
+ baseUrl: this.baseUrl,
115
+ token: this.token,
116
+ page: this.currentPage
117
+ }).then((data) => this.updateNotificationsDataAfterPageChange(data));
118
+ if (this.unseenCount != 0) {
119
+ this.showMarkAll = true;
120
+ }
121
+ }
122
+ render() {
123
+ return (h("div", { key: '2e42c5ae8afff37e6d56ca1b93f0f3d843d4d67a', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: 'd7ce4f97990f82dc98c93d6d74e7e6c7d5690e53', class: "Header" }, h("div", { key: '4a8244be4f0baf90fc9512ae8affd8c65c0016ac', class: "Title" }, translate('notifications', this.language), this.unseenCount > 0 ? (h("div", { class: "UnseenCounter" }, this.unseenCount)) : ('')), this.showMarkAll ? (h("div", { class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate('markAllAsRead', this.language))) : ('')), h("div", { key: '86d069f546034520bc312311e208e257278e8e35', class: "NotificationList" }, !this.isLoading &&
124
+ (this.notifications.length > 0 ? (this.notifications.map((item) => {
125
+ var _a;
126
+ return (h("nuts-notification", { "client-styling": this.clientStyling, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.actor) === null || _a === void 0 ? void 0 : _a.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl }));
127
+ })) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate('noMessages', this.language)))))), !this.isLoading &&
128
+ (this.notifications.length >= 10 || this.currentPage !== 0) ? (h("div", { class: "Pagination" }, h("div", { class: "Button" }, h("button", { disabled: this.currentPage <= 0, onClick: this.prevPage }, h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate('prev', this.language))), h("div", { class: "Button" }, h("button", { disabled: this.notifications.length < 10, onClick: this.nextPage }, translate('next', this.language), h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" })))))) : ('')));
129
+ }
130
+ static get is() { return "nuts-popover"; }
131
+ static get originalStyleUrls() {
132
+ return {
133
+ "$": ["nuts-popover.scss"]
134
+ };
135
+ }
136
+ static get styleUrls() {
137
+ return {
138
+ "$": ["nuts-popover.css"]
139
+ };
140
+ }
141
+ static get properties() {
142
+ return {
143
+ "language": {
144
+ "type": "string",
145
+ "mutable": false,
146
+ "complexType": {
147
+ "original": "string",
148
+ "resolved": "string",
149
+ "references": {}
150
+ },
151
+ "required": false,
152
+ "optional": false,
153
+ "docs": {
154
+ "tags": [],
155
+ "text": "Language code of the content"
156
+ },
157
+ "attribute": "language",
158
+ "reflect": true
159
+ },
160
+ "userId": {
161
+ "type": "string",
162
+ "mutable": false,
163
+ "complexType": {
164
+ "original": "string",
165
+ "resolved": "string",
166
+ "references": {}
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": "Unique ID of the user receiving notifications"
173
+ },
174
+ "attribute": "user-id",
175
+ "reflect": true
176
+ },
177
+ "operatorId": {
178
+ "type": "string",
179
+ "mutable": false,
180
+ "complexType": {
181
+ "original": "string",
182
+ "resolved": "string",
183
+ "references": {}
184
+ },
185
+ "required": false,
186
+ "optional": false,
187
+ "docs": {
188
+ "tags": [],
189
+ "text": "Unique ID of the operator domain"
190
+ },
191
+ "attribute": "operator-id",
192
+ "reflect": true
193
+ },
194
+ "token": {
195
+ "type": "string",
196
+ "mutable": false,
197
+ "complexType": {
198
+ "original": "string",
199
+ "resolved": "string",
200
+ "references": {}
201
+ },
202
+ "required": false,
203
+ "optional": false,
204
+ "docs": {
205
+ "tags": [],
206
+ "text": "Token used to authenticate notification transactions"
207
+ },
208
+ "attribute": "token",
209
+ "reflect": true
210
+ },
211
+ "sessionId": {
212
+ "type": "string",
213
+ "mutable": false,
214
+ "complexType": {
215
+ "original": "string",
216
+ "resolved": "string",
217
+ "references": {}
218
+ },
219
+ "required": true,
220
+ "optional": false,
221
+ "docs": {
222
+ "tags": [],
223
+ "text": "The sessionID of the user"
224
+ },
225
+ "attribute": "session-id",
226
+ "reflect": true
227
+ },
228
+ "backendUrl": {
229
+ "type": "string",
230
+ "mutable": false,
231
+ "complexType": {
232
+ "original": "string",
233
+ "resolved": "string",
234
+ "references": {}
235
+ },
236
+ "required": false,
237
+ "optional": false,
238
+ "docs": {
239
+ "tags": [],
240
+ "text": "Endpoint used for notification transactions"
241
+ },
242
+ "attribute": "backend-url",
243
+ "reflect": true
244
+ },
245
+ "unseenCount": {
246
+ "type": "number",
247
+ "mutable": false,
248
+ "complexType": {
249
+ "original": "number",
250
+ "resolved": "number",
251
+ "references": {}
252
+ },
253
+ "required": false,
254
+ "optional": false,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": "The count of unseen notifications"
258
+ },
259
+ "attribute": "unseen-count",
260
+ "reflect": true
261
+ },
262
+ "clientStylingUrl": {
263
+ "type": "string",
264
+ "mutable": false,
265
+ "complexType": {
266
+ "original": "string",
267
+ "resolved": "string",
268
+ "references": {}
269
+ },
270
+ "required": false,
271
+ "optional": false,
272
+ "docs": {
273
+ "tags": [],
274
+ "text": "Custom styling URL"
275
+ },
276
+ "attribute": "client-styling-url",
277
+ "reflect": true
278
+ },
279
+ "notificationAction": {
280
+ "type": "string",
281
+ "mutable": false,
282
+ "complexType": {
283
+ "original": "string",
284
+ "resolved": "string",
285
+ "references": {}
286
+ },
287
+ "required": false,
288
+ "optional": false,
289
+ "docs": {
290
+ "tags": [],
291
+ "text": "Decides the behaviour of the notification onClick"
292
+ },
293
+ "attribute": "notification-action",
294
+ "reflect": true
295
+ },
296
+ "clientStyling": {
297
+ "type": "string",
298
+ "mutable": true,
299
+ "complexType": {
300
+ "original": "string",
301
+ "resolved": "string",
302
+ "references": {}
303
+ },
304
+ "required": false,
305
+ "optional": false,
306
+ "docs": {
307
+ "tags": [],
308
+ "text": "Custom styling string"
309
+ },
310
+ "attribute": "client-styling",
311
+ "reflect": true,
312
+ "defaultValue": "''"
313
+ },
314
+ "translationUrl": {
315
+ "type": "string",
316
+ "mutable": false,
317
+ "complexType": {
318
+ "original": "string",
319
+ "resolved": "string",
320
+ "references": {}
321
+ },
322
+ "required": false,
323
+ "optional": false,
324
+ "docs": {
325
+ "tags": [],
326
+ "text": "Translations via URL"
327
+ },
328
+ "attribute": "translation-url",
329
+ "reflect": true,
330
+ "defaultValue": "''"
331
+ }
332
+ };
333
+ }
334
+ static get states() {
335
+ return {
336
+ "notifications": {},
337
+ "isLoading": {},
338
+ "showMarkAll": {}
339
+ };
340
+ }
341
+ static get events() {
342
+ return [{
343
+ "method": "allNotificationsRead",
344
+ "name": "allNotificationsRead",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": ""
351
+ },
352
+ "complexType": {
353
+ "original": "any",
354
+ "resolved": "any",
355
+ "references": {}
356
+ }
357
+ }];
358
+ }
359
+ static get watchers() {
360
+ return [{
361
+ "propName": "unseenCount",
362
+ "methodName": "unseenCountHandler"
363
+ }, {
364
+ "propName": "translationUrl",
365
+ "methodName": "handleNewTranslations"
366
+ }];
367
+ }
368
+ static get listeners() {
369
+ return [{
370
+ "name": "messageDeleted",
371
+ "method": "messageDeteledHandler",
372
+ "target": "window",
373
+ "capture": false,
374
+ "passive": false
375
+ }, {
376
+ "name": "newNotification",
377
+ "method": "newNotificationHandler",
378
+ "target": "window",
379
+ "capture": false,
380
+ "passive": false
381
+ }];
382
+ }
383
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,39 @@
1
+ export var StepTypeEnum;
2
+ (function (StepTypeEnum) {
3
+ StepTypeEnum["IN_APP"] = "in_app";
4
+ StepTypeEnum["EMAIL"] = "email";
5
+ StepTypeEnum["SMS"] = "sms";
6
+ StepTypeEnum["CHAT"] = "chat";
7
+ StepTypeEnum["PUSH"] = "push";
8
+ StepTypeEnum["DIGEST"] = "digest";
9
+ StepTypeEnum["TRIGGER"] = "trigger";
10
+ StepTypeEnum["DELAY"] = "delay";
11
+ })(StepTypeEnum || (StepTypeEnum = {}));
12
+ export var EmailBlockTypeEnum;
13
+ (function (EmailBlockTypeEnum) {
14
+ EmailBlockTypeEnum["BUTTON"] = "button";
15
+ EmailBlockTypeEnum["TEXT"] = "text";
16
+ })(EmailBlockTypeEnum || (EmailBlockTypeEnum = {}));
17
+ export var TextAlignEnum;
18
+ (function (TextAlignEnum) {
19
+ TextAlignEnum["CENTER"] = "center";
20
+ TextAlignEnum["LEFT"] = "left";
21
+ TextAlignEnum["RIGHT"] = "right";
22
+ })(TextAlignEnum || (TextAlignEnum = {}));
23
+ export var TemplateVariableTypeEnum;
24
+ (function (TemplateVariableTypeEnum) {
25
+ TemplateVariableTypeEnum["STRING"] = "String";
26
+ TemplateVariableTypeEnum["ARRAY"] = "Array";
27
+ TemplateVariableTypeEnum["BOOLEAN"] = "Boolean";
28
+ })(TemplateVariableTypeEnum || (TemplateVariableTypeEnum = {}));
29
+ export var ChannelCTATypeEnum;
30
+ (function (ChannelCTATypeEnum) {
31
+ ChannelCTATypeEnum["REDIRECT"] = "redirect";
32
+ })(ChannelCTATypeEnum || (ChannelCTATypeEnum = {}));
33
+ export var ActorTypeEnum;
34
+ (function (ActorTypeEnum) {
35
+ ActorTypeEnum["NONE"] = "none";
36
+ ActorTypeEnum["USER"] = "user";
37
+ ActorTypeEnum["SYSTEM_ICON"] = "system_icon";
38
+ ActorTypeEnum["SYSTEM_CUSTOM"] = "system_custom";
39
+ })(ActorTypeEnum || (ActorTypeEnum = {}));
@@ -0,0 +1,52 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['hu', 'en'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ notifications: 'Notifications',
6
+ noMessages: 'Nothing new to see here yet',
7
+ markAllAsRead: 'Mark all as read',
8
+ markAsRead: 'Mark as read',
9
+ markAsUnread: 'Mark as unread',
10
+ removeMessage: 'Remove the message',
11
+ next: 'Next',
12
+ prev: 'Previous',
13
+ },
14
+ hu: {
15
+ notifications: 'értesítéseket',
16
+ noMessages: 'Itt még semmi újat nem látni',
17
+ markAllAsRead: 'összes megjelölése olvasottként',
18
+ markAsRead: 'Jelöld olvasottként',
19
+ markAsUnread: 'Megjelölés olvasatlanként',
20
+ removeMessage: 'Távolítsa el az üzenetet',
21
+ next: 'Következő',
22
+ prev: 'Előző',
23
+ },
24
+ };
25
+ export const translate = (key, customLang, values) => {
26
+ const lang = customLang;
27
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang)
28
+ ? lang
29
+ : DEFAULT_LANGUAGE][key];
30
+ if (values !== undefined) {
31
+ for (const [key, value] of Object.entries(values.values)) {
32
+ const regex = new RegExp(`{${key}}`, 'g');
33
+ translation = translation.replace(regex, value);
34
+ }
35
+ }
36
+ return translation;
37
+ };
38
+ export const getTranslations = (url) => {
39
+ // fetch url, get the data, replace the TRANSLATIONS content
40
+ return new Promise((resolve) => {
41
+ fetch(url)
42
+ .then((res) => res.json())
43
+ .then((data) => {
44
+ Object.keys(data).forEach((item) => {
45
+ for (let key in data[item]) {
46
+ TRANSLATIONS[item][key] = data[item][key];
47
+ }
48
+ });
49
+ resolve(true);
50
+ });
51
+ });
52
+ };
@@ -0,0 +1,6 @@
1
+ export const truncate = (str, n) => {
2
+ if (!str || n < 0) {
3
+ return;
4
+ }
5
+ return str.length > n ? str.slice(0, n - 1) + '...' : str;
6
+ };
@@ -0,0 +1,3 @@
1
+ const globalScripts = () => {};
2
+
3
+ export { globalScripts as g };