@telia-ace/knowledge-widget-components-notification-row 1.0.39-next.4 → 1.0.39-next.6
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/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -10,12 +10,12 @@ var p = (t, e, i) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
R.call(e, i) && p(t, i, e[i]);
|
|
11
11
|
return t;
|
|
12
12
|
}, d = (t, e) => b(t, C(e));
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { createReactComponent as
|
|
16
|
-
const
|
|
17
|
-
const { events: e } = t.get("$widget"), [i, u] =
|
|
18
|
-
return
|
|
13
|
+
import { DataClient as v, DataType as x } from "@telia-ace/knowledge-data-client";
|
|
14
|
+
import { createEventSubscriber as D, extendComponent as N } from "@telia-ace/knowledge-widget-core";
|
|
15
|
+
import { createReactComponent as O } from "@telia-ace/knowledge-widget-ui";
|
|
16
|
+
const P = (t) => {
|
|
17
|
+
const { events: e } = t.get("$widget"), [i, u] = D(e);
|
|
18
|
+
return O(
|
|
19
19
|
t,
|
|
20
20
|
"notification-row",
|
|
21
21
|
import("./notification-row.5162cdbf.js"),
|
|
@@ -57,9 +57,9 @@ const O = (t) => {
|
|
|
57
57
|
u();
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
).then(() =>
|
|
61
|
-
r.actions.watch("notification-row.fetch", (s, a) =>
|
|
62
|
-
(o) => o.fetch(
|
|
60
|
+
).then(() => N(t, "notification-row", (r) => {
|
|
61
|
+
r.actions.watch("notification-row.fetch", (s, a) => v.getInstance(t).then(
|
|
62
|
+
(o) => o.fetch(x.RowNotifications, {
|
|
63
63
|
categories: [
|
|
64
64
|
s.params.guideCategory,
|
|
65
65
|
s.params.contactCategory
|
|
@@ -73,7 +73,7 @@ const O = (t) => {
|
|
|
73
73
|
})).then(() => {
|
|
74
74
|
u();
|
|
75
75
|
});
|
|
76
|
-
}, S =
|
|
76
|
+
}, S = P;
|
|
77
77
|
export {
|
|
78
78
|
S as default
|
|
79
79
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/notification-row-component.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/notification-row-component.ts"],"sourcesContent":["import { DataClient, DataType, NotificationResults } from '@telia-ace/knowledge-data-client';\nimport {\n createEventSubscriber,\n extendComponent,\n Notification,\n} from '@telia-ace/knowledge-widget-core';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container, Widget } from '@webprovisions/platform';\n\ntype NotificationType = 'top' | 'middle' | 'bottom';\nexport type NotificationRowComponentProps = {\n types: NotificationType[];\n allowPaging?: boolean;\n notifications?: Notification[]; // internal\n expandable?: boolean;\n pageNextAriaLabel?: string;\n pagePreviousAriaLabel?: string;\n closeAriaLabel?: string;\n expandAriaLabel?: string;\n};\n\ntype FetchResults = NotificationResults & { error: any };\n\nexport const NotificationRowComponent = (container: Container) => {\n const { events }: Widget = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(\n container,\n 'notification-row',\n import('./notification-row'),\n (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({\n ...component.properties<NotificationRowComponentProps>(),\n loading: true,\n error: undefined,\n notifications: [],\n });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create(\n 'fetch',\n ({\n error,\n topNotifications,\n bottomNotifications,\n middleNotifications,\n }: FetchResults) => {\n if (error) {\n return component.actions.dispatch('fetched', {\n error,\n loading: true,\n notifications: [],\n });\n }\n\n let newNotifications: Notification[] = [];\n const { notifications, types = [] } =\n component.properties<NotificationRowComponentProps>();\n if (types.length) {\n if (types.indexOf('top') > -1) {\n newNotifications = newNotifications.concat(topNotifications);\n }\n if (types.indexOf('middle') > -1) {\n newNotifications = newNotifications.concat(middleNotifications);\n }\n if (types.indexOf('bottom') > -1) {\n newNotifications = newNotifications.concat(bottomNotifications);\n }\n } else {\n newNotifications = topNotifications;\n }\n\n return component.actions.dispatch('fetched', {\n notifications: newNotifications.length ? newNotifications : notifications,\n loading: false,\n });\n }\n );\n\n component.actions.create('fetched', (input) => {\n return component.writeProperties({ ...input, loading: false });\n });\n\n container.getAsync('router').then((router) => {\n const { params } = router.getRouteData();\n fetch(params);\n });\n\n subscribe('router:changed', (event: any, { current }: any) => {\n fetch(current.routeData.params);\n });\n\n return () => {\n unsubscribe();\n };\n }\n )\n .then(() => {\n return extendComponent(container, 'notification-row', (component) => {\n component.actions.watch('notification-row.fetch', (input, next) => {\n return DataClient.getInstance(container)\n .then((dataClient: DataClient) =>\n dataClient.fetch(DataType.RowNotifications, {\n categories: [\n input.params.guideCategory,\n input.params.contactCategory,\n ].filter((c) => !!c),\n searchPhrase: input.params.phrase,\n })\n )\n .then(next)\n .catch((error) => {\n if (error) {\n return next(error);\n }\n });\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default NotificationRowComponent;\n"],"names":["NotificationRowComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","__spreadProps","__spreadValues","error","topNotifications","bottomNotifications","middleNotifications","newNotifications","notifications","types","input","router","event","current","extendComponent","next","DataClient","dataClient","DataType","c","NotificationRowComponent$1"],"mappings":";;;;;;;;;;;;;;;AAuBa,MAAAA,IAA2B,CAACC,MAAyB;AAC9D,QAAM,EAAE,QAAAC,EAAmB,IAAAD,EAAU,IAAI,SAAS,GAC5C,CAACE,GAAWC,CAAW,IAAIC,EAAsBH,CAAM;AAEtD,SAAAI;AAAA,IACHL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,CAACM,MAAc;AACL,YAAAC,IAAQ,CAACC,MAAmC;AAC9C,QAAAF,EAAU,gBAAgBG,EAAAC,EAAA,IACnBJ,EAAU,WAA0C,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AAAd,EAAAc,EAAQ,UAAU,MAAM;AAAA,MAAA,CACjC,GAEM,MAAM;AACG,QAAAlB;MAAA;AAAA,IAEpB;AAAA,EACJ,EACK,KAAK,MACKmB,EAAgBtB,GAAW,oBAAoB,CAACM,MAAc;AACjE,IAAAA,EAAU,QAAQ,MAAM,0BAA0B,CAACY,GAAOK,MAC/CC,EAAW,YAAYxB,CAAS,EAClC;AAAA,MAAK,CAACyB,MACHA,EAAW,MAAMC,EAAS,kBAAkB;AAAA,QACxC,YAAY;AAAA,UACRR,EAAM,OAAO;AAAA,UACbA,EAAM,OAAO;AAAA,UACf,OAAO,CAACS,MAAM,CAAC,CAACA,CAAC;AAAA,QACnB,cAAcT,EAAM,OAAO;AAAA,MAAA,CAC9B;AAAA,MAEJ,KAAKK,CAAI,EACT,MAAM,CAACZ,MAAU;AACd,UAAIA;AACA,eAAOY,EAAKZ,CAAK;AAAA,IACrB,CACH,CACR;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAAR;EAAA,CACf;AACT,GAEAyB,IAAe7B;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-row",
|
|
3
|
-
"version": "1.0.39-next.
|
|
3
|
+
"version": "1.0.39-next.6",
|
|
4
4
|
"description": "Notification row component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-
|
|
25
|
-
"@telia-ace/knowledge-widget-
|
|
26
|
-
"@telia-ace/knowledge-widget-ui": "1.0.41-next.
|
|
24
|
+
"@telia-ace/knowledge-data-client": "1.0.2-next.2",
|
|
25
|
+
"@telia-ace/knowledge-widget-core": "1.0.35-next.6",
|
|
26
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41-next.6",
|
|
27
27
|
"@telia-ace/widget-services": "^1.0.21-next.0",
|
|
28
28
|
"@telia-ace/widget-utilities": "^1.0.10-next.0",
|
|
29
29
|
"@webprovisions/platform": "^1.1.2"
|