@telia-ace/knowledge-widget-components-related-guide-list 1.3.41-rc.1 → 1.3.41
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 u=require("@telia-ace/knowledge-data-client"),
|
|
1
|
+
"use strict";const u=require("@telia-ace/knowledge-data-client"),o=require("@telia-ace/knowledge-widget-core"),g=require("@telia-ace/knowledge-widget-ui"),h=s=>g.createReactComponent(s,"related-guide-list",Promise.resolve().then(()=>require("./related-guide-list-ac6aAgbA.js")),e=>{const{events:r}=s.get("$widget"),[i,c]=o.createEventSubscriber(r),n=t=>{e.writeProperties({loading:!0,error:void 0}),e.actions.dispatch("fetch",{params:t})};return e.actions.create("fetch",({items:t=[]})=>e.actions.dispatch("fetched",{items:t,loading:!0})),e.actions.create("fetched",t=>e.writeProperties({...t,loading:!1})),s.getAsync("router").then(t=>{const{params:a}=t.getRouteData();n(a)}),i("router:changed",(t,{current:a})=>{n(a.routeData.params)}),()=>{c()}}).then(()=>o.extendComponent(s,"related-guide-list",e=>{e.actions.watch("related-guide-list.fetch",(r,i)=>{const{params:{guide:c,connection:n}}=r;if(!c)return i(r);const{header:t}=e.properties();return u.DataClient.getInstance(s).then(a=>a.fetch(u.DataType.Guide,{connection:n,guideId:c}).then(({related:d})=>i({...r,items:d||[]})).catch(d=>i(r)))})}));module.exports=h;
|
package/index.mjs
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import { DataClient as
|
|
2
|
-
import { createEventSubscriber as
|
|
3
|
-
import { createReactComponent as
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { DataClient as o, DataType as n } from "@telia-ace/knowledge-data-client";
|
|
2
|
+
import { createEventSubscriber as h, extendComponent as g } from "@telia-ace/knowledge-widget-core";
|
|
3
|
+
import { createReactComponent as f } from "@telia-ace/knowledge-widget-ui";
|
|
4
|
+
const b = (a) => f(
|
|
5
|
+
a,
|
|
6
6
|
"related-guide-list",
|
|
7
|
-
import("./related-guide-list-
|
|
8
|
-
(
|
|
9
|
-
const { events: r } =
|
|
10
|
-
|
|
7
|
+
import("./related-guide-list-DYFbUtre.mjs"),
|
|
8
|
+
(e) => {
|
|
9
|
+
const { events: r } = a.get("$widget"), [s, c] = h(r), d = (t) => {
|
|
10
|
+
e.writeProperties({ loading: !0, error: void 0 }), e.actions.dispatch("fetch", { params: t });
|
|
11
11
|
};
|
|
12
|
-
return
|
|
13
|
-
items:
|
|
12
|
+
return e.actions.create("fetch", ({ items: t = [] }) => e.actions.dispatch("fetched", {
|
|
13
|
+
items: t,
|
|
14
14
|
loading: !0
|
|
15
|
-
})),
|
|
16
|
-
const { params:
|
|
17
|
-
|
|
18
|
-
}),
|
|
19
|
-
|
|
15
|
+
})), e.actions.create("fetched", (t) => e.writeProperties({ ...t, loading: !1 })), a.getAsync("router").then((t) => {
|
|
16
|
+
const { params: i } = t.getRouteData();
|
|
17
|
+
d(i);
|
|
18
|
+
}), s("router:changed", (t, { current: i }) => {
|
|
19
|
+
d(i.routeData.params);
|
|
20
20
|
}), () => {
|
|
21
21
|
c();
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
).then(() =>
|
|
25
|
-
|
|
24
|
+
).then(() => g(a, "related-guide-list", (e) => {
|
|
25
|
+
e.actions.watch("related-guide-list.fetch", (r, s) => {
|
|
26
26
|
const {
|
|
27
|
-
params: { guide: c, connection:
|
|
27
|
+
params: { guide: c, connection: d }
|
|
28
28
|
} = r;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (!c)
|
|
30
|
+
return s(r);
|
|
31
|
+
const { header: t } = e.properties();
|
|
32
|
+
return o.getInstance(a).then((i) => i.fetch(n.Guide, {
|
|
33
|
+
connection: d,
|
|
31
34
|
guideId: c
|
|
32
|
-
}).then(({ related:
|
|
35
|
+
}).then(({ related: u }) => s({ ...r, items: u || [] })).catch((u) => s(r)));
|
|
33
36
|
});
|
|
34
37
|
}));
|
|
35
38
|
export {
|
|
36
|
-
|
|
39
|
+
b as default
|
|
37
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-related-guide-list",
|
|
3
|
-
"version": "1.3.41
|
|
3
|
+
"version": "1.3.41",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@telia-ace/knowledge-widget-core": "^1.3.41
|
|
14
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41
|
|
15
|
-
"@telia-ace/knowledge-widget-ui": "^1.3.41
|
|
16
|
-
"@telia-ace/widget-utilities": "^1.3.41
|
|
17
|
-
"@telia-ace/knowledge-data-client": "^1.3.41
|
|
13
|
+
"@telia-ace/knowledge-widget-core": "^1.3.41",
|
|
14
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41",
|
|
15
|
+
"@telia-ace/knowledge-widget-ui": "^1.3.41",
|
|
16
|
+
"@telia-ace/widget-utilities": "^1.3.41",
|
|
17
|
+
"@telia-ace/knowledge-data-client": "^1.3.41",
|
|
18
18
|
"@webprovisions/platform": "^1.1.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import w from "@emotion/styled";
|
|
3
|
-
import { useRouteData as x, useContainer as G, useProperties as N, createEmptyComponent as P,
|
|
3
|
+
import { useRouteData as x, useContainer as G, useProperties as N, createEmptyComponent as P, contentBox as B, GuideList as M } from "@telia-ace/knowledge-widget-ui";
|
|
4
4
|
import { appendClassNames as o, createParams as R, formatUrl as j } from "@telia-ace/widget-utilities";
|
|
5
5
|
const $ = ({ className: a, ...t }) => {
|
|
6
6
|
const { name: i, params: r } = x(), s = G(), {
|
|
@@ -58,8 +58,8 @@ const $ = ({ className: a, ...t }) => {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
|
-
}, D = w(
|
|
62
|
-
${
|
|
61
|
+
}, D = w(M)`
|
|
62
|
+
${B}
|
|
63
63
|
li:last-child {
|
|
64
64
|
margin: 0;
|
|
65
65
|
}
|
|
File without changes
|