@telia-ace/knowledge-widget-components-notification-list 1.1.2-rc.1 → 1.1.2-rc.2
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/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("@telia-ace/knowledge-data-client"),c=require("@telia-ace/knowledge-widget-core"),l=require("@telia-ace/knowledge-widget-ui"),p=s=>{const{events:n}=s.get("$widget"),[d,h]=c.createEventSubscriber(n);return l.createReactComponent(s,"notification-list",Promise.resolve().then(()=>require("./notification-list-
|
|
1
|
+
"use strict";const o=require("@telia-ace/knowledge-data-client"),c=require("@telia-ace/knowledge-widget-core"),l=require("@telia-ace/knowledge-widget-ui"),p=s=>{const{events:n}=s.get("$widget"),[d,h]=c.createEventSubscriber(n);return l.createReactComponent(s,"notification-list",Promise.resolve().then(()=>require("./notification-list-e52d1994.js")),e=>{const r=t=>{e.writeProperties({...e.properties(),loading:!0,error:void 0,notificationList:void 0}),e.actions.dispatch("fetch",{params:t})};e.actions.create("fetch",({error:t,notificationLists:i})=>{if(t)return e.actions.dispatch("fetched",{error:t,loading:!0,notificationList:void 0});const{category:a,notificationList:f}=e.properties(),u={notificationList:i.find(g=>g.id===a)||f};return e.actions.dispatch("fetched",{...u,loading:!0})}),e.actions.create("fetched",t=>e.writeProperties({...t,loading:!1})),s.getAsync("router").then(t=>{const{params:i}=t.getRouteData();r(i)}),d("router:changed",(t,{current:i})=>{r(i.routeData.params)})}).then(()=>c.extendComponent(s,"notification-list",e=>{e.actions.watch("notification-list.fetch",(r,t)=>o.DataClient.getInstance(s).then(i=>i.fetch(o.DataType.NotificationLists,{categories:[r.params.guideCategory,r.params.contactCategory].filter(a=>!!a),searchPhrase:r.params.phrase})).then(t).catch(i=>{if(i)return t(i)}))})).then(()=>{h()})};module.exports=p;
|
package/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ const L = (r) => {
|
|
|
6
6
|
return m(
|
|
7
7
|
r,
|
|
8
8
|
"notification-list",
|
|
9
|
-
import("./notification-list-
|
|
9
|
+
import("./notification-list-43e7cd19.mjs"),
|
|
10
10
|
(e) => {
|
|
11
11
|
const a = (t) => {
|
|
12
12
|
e.writeProperties({
|
|
@@ -16,21 +16,24 @@ const L = (r) => {
|
|
|
16
16
|
notificationList: void 0
|
|
17
17
|
}), e.actions.dispatch("fetch", { params: t });
|
|
18
18
|
};
|
|
19
|
-
e.actions.create(
|
|
20
|
-
|
|
19
|
+
e.actions.create(
|
|
20
|
+
"fetch",
|
|
21
|
+
({ error: t, notificationLists: i }) => {
|
|
22
|
+
if (t)
|
|
23
|
+
return e.actions.dispatch("fetched", {
|
|
24
|
+
error: t,
|
|
25
|
+
loading: !0,
|
|
26
|
+
notificationList: void 0
|
|
27
|
+
});
|
|
28
|
+
const { category: s, notificationList: f } = e.properties(), h = {
|
|
29
|
+
notificationList: i.find((d) => d.id === s) || f
|
|
30
|
+
};
|
|
21
31
|
return e.actions.dispatch("fetched", {
|
|
22
|
-
|
|
23
|
-
loading: !0
|
|
24
|
-
notificationList: void 0
|
|
32
|
+
...h,
|
|
33
|
+
loading: !0
|
|
25
34
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
return e.actions.dispatch("fetched", {
|
|
30
|
-
...h,
|
|
31
|
-
loading: !0
|
|
32
|
-
});
|
|
33
|
-
}), e.actions.create("fetched", (t) => e.writeProperties({ ...t, loading: !1 })), r.getAsync("router").then((t) => {
|
|
35
|
+
}
|
|
36
|
+
), e.actions.create("fetched", (t) => e.writeProperties({ ...t, loading: !1 })), r.getAsync("router").then((t) => {
|
|
34
37
|
const { params: i } = t.getRouteData();
|
|
35
38
|
a(i);
|
|
36
39
|
}), c("router:changed", (t, { current: i }) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("@emotion/styled"),t=require("@telia-ace/knowledge-widget-ui"),u=require("@telia-ace/widget-utilities"),l=({className:e,...n})=>{const s=t.useContainer(),{showHeader:r,notificationList:i,loading:o=!1}=t.useProperties();return!(i!=null&&i.notifications.length)&&!o?t.createEmptyComponent(s,{...n,className:u.appendClassNames(e,"humany-notification-list")}):a.jsx(d,{...n,className:e,notificationList:i,loading:o,showHeader:r})},d=c(t.NotificationList)`
|
|
2
|
-
|
|
2
|
+
${e=>t.contentBox(e)}
|
|
3
3
|
`;exports.default=l;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-notification-list",
|
|
3
|
-
"version": "1.1.2-rc.
|
|
3
|
+
"version": "1.1.2-rc.2",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/knowledge-widget-core": "^1.1.2-rc.
|
|
14
|
-
"@telia-ace/knowledge-widget-ui": "^1.1.2-rc.
|
|
15
|
-
"@telia-ace/widget-utilities": "^1.1.2-rc.
|
|
16
|
-
"@telia-ace/knowledge-data-client": "^1.1.2-rc.
|
|
13
|
+
"@telia-ace/knowledge-widget-core": "^1.1.2-rc.2",
|
|
14
|
+
"@telia-ace/knowledge-widget-ui": "^1.1.2-rc.2",
|
|
15
|
+
"@telia-ace/widget-utilities": "^1.1.2-rc.2",
|
|
16
|
+
"@telia-ace/knowledge-data-client": "^1.1.2-rc.2",
|
|
17
17
|
"@webprovisions/platform": "^1.1.4"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|