@telia-ace/knowledge-widget-components-related-guide-list 1.3.41-rc.0 → 1.3.41-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 +1 -1
- package/index.mjs +26 -23
- package/package.json +6 -6
- package/related-guide-list-DYFbUtre.mjs +69 -0
- package/related-guide-list-ac6aAgbA.js +6 -0
- package/related-guide-list-component.d.ts +1 -0
- package/related-guide-list-b7e96ecc.js +0 -6
- package/related-guide-list-ffa77ba3.mjs +0 -67
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-rc.
|
|
3
|
+
"version": "1.3.41-rc.2",
|
|
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-rc.
|
|
14
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41-rc.
|
|
15
|
-
"@telia-ace/knowledge-widget-ui": "^1.3.41-rc.
|
|
16
|
-
"@telia-ace/widget-utilities": "^1.3.41-rc.
|
|
17
|
-
"@telia-ace/knowledge-data-client": "^1.3.41-rc.
|
|
13
|
+
"@telia-ace/knowledge-widget-core": "^1.3.41-rc.2",
|
|
14
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.3.41-rc.2",
|
|
15
|
+
"@telia-ace/knowledge-widget-ui": "^1.3.41-rc.2",
|
|
16
|
+
"@telia-ace/widget-utilities": "^1.3.41-rc.2",
|
|
17
|
+
"@telia-ace/knowledge-data-client": "^1.3.41-rc.2",
|
|
18
18
|
"@webprovisions/platform": "^1.1.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import w from "@emotion/styled";
|
|
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
|
+
import { appendClassNames as o, createParams as R, formatUrl as j } from "@telia-ace/widget-utilities";
|
|
5
|
+
const $ = ({ className: a, ...t }) => {
|
|
6
|
+
const { name: i, params: r } = x(), s = G(), {
|
|
7
|
+
showFavoriteToggle: l = !1,
|
|
8
|
+
showTitleTooltip: m = !1,
|
|
9
|
+
items: e,
|
|
10
|
+
header: d,
|
|
11
|
+
metadata: n,
|
|
12
|
+
tags: u,
|
|
13
|
+
addFavoriteTooltip: p,
|
|
14
|
+
removeFavoriteCancelLabel: c,
|
|
15
|
+
removeFavoriteConfirmLabel: v,
|
|
16
|
+
removeFavoriteHeader: b,
|
|
17
|
+
removeFavoriteLabel: f,
|
|
18
|
+
removeFavoriteTooltip: g,
|
|
19
|
+
metadataByLabel: L,
|
|
20
|
+
metadataModifiedLabel: h,
|
|
21
|
+
metadataPublishedLabel: y
|
|
22
|
+
} = N();
|
|
23
|
+
return !e || !e.length ? P(s, {
|
|
24
|
+
...t,
|
|
25
|
+
className: o(a, "humany-related-guide-list")
|
|
26
|
+
}) : /* @__PURE__ */ C(
|
|
27
|
+
D,
|
|
28
|
+
{
|
|
29
|
+
...t,
|
|
30
|
+
className: o(a, "humany-related-guide-list"),
|
|
31
|
+
header: d,
|
|
32
|
+
items: e,
|
|
33
|
+
paramMappers: {
|
|
34
|
+
guide: ({ id: F, title: T }) => R({
|
|
35
|
+
...r,
|
|
36
|
+
guide: F,
|
|
37
|
+
uriName: j(T),
|
|
38
|
+
connection: void 0
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
showTags: u,
|
|
42
|
+
showFavoriteToggle: l,
|
|
43
|
+
showTitleTooltip: m,
|
|
44
|
+
addFavoriteTooltip: p,
|
|
45
|
+
removeFavoriteCancelLabel: c,
|
|
46
|
+
removeFavoriteConfirmLabel: v,
|
|
47
|
+
removeFavoriteHeader: b,
|
|
48
|
+
removeFavoriteLabel: f,
|
|
49
|
+
removeFavoriteTooltip: g,
|
|
50
|
+
metadata: {
|
|
51
|
+
...n,
|
|
52
|
+
modifiedLabel: h,
|
|
53
|
+
publishedLabel: y,
|
|
54
|
+
byLabel: L
|
|
55
|
+
},
|
|
56
|
+
routing: {
|
|
57
|
+
guide: i
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}, D = w(M)`
|
|
62
|
+
${B}
|
|
63
|
+
li:last-child {
|
|
64
|
+
margin: 0;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
export {
|
|
68
|
+
$ as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),q=require("@emotion/styled"),e=require("@telia-ace/knowledge-widget-ui"),a=require("@telia-ace/widget-utilities"),N=({className:i,...o})=>{const{name:r,params:s}=e.useRouteData(),l=e.useContainer(),{showFavoriteToggle:d=!1,showTitleTooltip:n=!1,items:t,header:m,metadata:u,tags:c,addFavoriteTooltip:g,removeFavoriteCancelLabel:p,removeFavoriteConfirmLabel:b,removeFavoriteHeader:v,removeFavoriteLabel:L,removeFavoriteTooltip:f,metadataByLabel:h,metadataModifiedLabel:y,metadataPublishedLabel:F}=e.useProperties();return!t||!t.length?e.createEmptyComponent(l,{...o,className:a.appendClassNames(i,"humany-related-guide-list")}):w.jsx(P,{...o,className:a.appendClassNames(i,"humany-related-guide-list"),header:m,items:t,paramMappers:{guide:({id:T,title:C})=>a.createParams({...s,guide:T,uriName:a.formatUrl(C),connection:void 0})},showTags:c,showFavoriteToggle:d,showTitleTooltip:n,addFavoriteTooltip:g,removeFavoriteCancelLabel:p,removeFavoriteConfirmLabel:b,removeFavoriteHeader:v,removeFavoriteLabel:L,removeFavoriteTooltip:f,metadata:{...u,modifiedLabel:y,publishedLabel:F,byLabel:h},routing:{guide:r}})},P=q(e.GuideList)`
|
|
2
|
+
${e.contentBox}
|
|
3
|
+
li:last-child {
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
`;exports.default=N;
|
|
@@ -5,6 +5,7 @@ export type RelatedGuideListComponentProps = {
|
|
|
5
5
|
header: string;
|
|
6
6
|
items?: any[];
|
|
7
7
|
showFavoriteToggle?: boolean;
|
|
8
|
+
showTitleTooltip?: boolean;
|
|
8
9
|
tags?: boolean;
|
|
9
10
|
} & FavoriteProperties & MetaDataProperties;
|
|
10
11
|
declare const RelatedGuideListComponent: (container: Container) => Promise<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),q=require("@emotion/styled"),e=require("@telia-ace/knowledge-widget-ui"),a=require("@telia-ace/widget-utilities"),w=({className:i,...o})=>{const{name:r,params:s}=e.useRouteData(),d=e.useContainer(),{showFavoriteToggle:l=!1,items:t,header:n,metadata:m,tags:u,addFavoriteTooltip:c,removeFavoriteCancelLabel:g,removeFavoriteConfirmLabel:p,removeFavoriteHeader:b,removeFavoriteLabel:v,removeFavoriteTooltip:L,metadataByLabel:y,metadataModifiedLabel:f,metadataPublishedLabel:h}=e.useProperties();return!t||!t.length?e.createEmptyComponent(d,{...o,className:a.appendClassNames(i,"humany-related-guide-list")}):T.jsx(N,{...o,className:a.appendClassNames(i,"humany-related-guide-list"),header:n,items:t,paramMappers:{guide:({id:F,title:C})=>a.createParams({...s,guide:F,uriName:a.formatUrl(C),connection:void 0})},showTags:u,showFavoriteToggle:l,addFavoriteTooltip:c,removeFavoriteCancelLabel:g,removeFavoriteConfirmLabel:p,removeFavoriteHeader:b,removeFavoriteLabel:v,removeFavoriteTooltip:L,metadata:{...m,modifiedLabel:f,publishedLabel:h,byLabel:y},routing:{guide:r}})},N=q(e.GuideList)`
|
|
2
|
-
${e.contentBox}
|
|
3
|
-
li:last-child {
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
`;exports.default=w;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
-
import T from "@emotion/styled";
|
|
3
|
-
import { useRouteData as x, useContainer as G, useProperties as N, createEmptyComponent as P, GuideList as w, contentBox as B } from "@telia-ace/knowledge-widget-ui";
|
|
4
|
-
import { appendClassNames as o, createParams as M, formatUrl as R } from "@telia-ace/widget-utilities";
|
|
5
|
-
const U = ({ className: a, ...t }) => {
|
|
6
|
-
const { name: i, params: r } = x(), m = G(), {
|
|
7
|
-
showFavoriteToggle: s = !1,
|
|
8
|
-
items: e,
|
|
9
|
-
header: d,
|
|
10
|
-
metadata: l,
|
|
11
|
-
tags: n,
|
|
12
|
-
addFavoriteTooltip: u,
|
|
13
|
-
removeFavoriteCancelLabel: p,
|
|
14
|
-
removeFavoriteConfirmLabel: c,
|
|
15
|
-
removeFavoriteHeader: v,
|
|
16
|
-
removeFavoriteLabel: b,
|
|
17
|
-
removeFavoriteTooltip: g,
|
|
18
|
-
metadataByLabel: L,
|
|
19
|
-
metadataModifiedLabel: f,
|
|
20
|
-
metadataPublishedLabel: h
|
|
21
|
-
} = N();
|
|
22
|
-
return !e || !e.length ? P(m, {
|
|
23
|
-
...t,
|
|
24
|
-
className: o(a, "humany-related-guide-list")
|
|
25
|
-
}) : /* @__PURE__ */ C(
|
|
26
|
-
j,
|
|
27
|
-
{
|
|
28
|
-
...t,
|
|
29
|
-
className: o(a, "humany-related-guide-list"),
|
|
30
|
-
header: d,
|
|
31
|
-
items: e,
|
|
32
|
-
paramMappers: {
|
|
33
|
-
guide: ({ id: y, title: F }) => M({
|
|
34
|
-
...r,
|
|
35
|
-
guide: y,
|
|
36
|
-
uriName: R(F),
|
|
37
|
-
connection: void 0
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
|
-
showTags: n,
|
|
41
|
-
showFavoriteToggle: s,
|
|
42
|
-
addFavoriteTooltip: u,
|
|
43
|
-
removeFavoriteCancelLabel: p,
|
|
44
|
-
removeFavoriteConfirmLabel: c,
|
|
45
|
-
removeFavoriteHeader: v,
|
|
46
|
-
removeFavoriteLabel: b,
|
|
47
|
-
removeFavoriteTooltip: g,
|
|
48
|
-
metadata: {
|
|
49
|
-
...l,
|
|
50
|
-
modifiedLabel: f,
|
|
51
|
-
publishedLabel: h,
|
|
52
|
-
byLabel: L
|
|
53
|
-
},
|
|
54
|
-
routing: {
|
|
55
|
-
guide: i
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
}, j = T(w)`
|
|
60
|
-
${B}
|
|
61
|
-
li:last-child {
|
|
62
|
-
margin: 0;
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
export {
|
|
66
|
-
U as default
|
|
67
|
-
};
|