@telia-ace/knowledge-widget-components-related-guide-list 1.0.16 → 1.0.19
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
CHANGED
|
@@ -1,75 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
container.getAsync("router").then((router) => {
|
|
41
|
-
const { params } = router.getRouteData();
|
|
42
|
-
fetch(params);
|
|
43
|
-
});
|
|
44
|
-
subscribe("router:changed", (_, { current }) => {
|
|
45
|
-
fetch(current.routeData.params);
|
|
46
|
-
});
|
|
47
|
-
return () => {
|
|
48
|
-
unsubscribe();
|
|
49
|
-
};
|
|
50
|
-
}).then(() => {
|
|
51
|
-
return extendComponent(container, "related-guide-list", (component) => {
|
|
52
|
-
component.actions.watch("related-guide-list.fetch", (input, next) => {
|
|
53
|
-
const {
|
|
54
|
-
params: { guide, connection }
|
|
55
|
-
} = input;
|
|
56
|
-
if (!guide) {
|
|
57
|
-
return next(input);
|
|
58
|
-
}
|
|
59
|
-
component.properties();
|
|
60
|
-
return container.getAsync("dataClient").then((dataClient) => {
|
|
61
|
-
return dataClient.fetch(DataType.Guide, {
|
|
62
|
-
connection,
|
|
63
|
-
guideId: guide
|
|
64
|
-
}).then(({ related }) => {
|
|
65
|
-
return next(__spreadProps(__spreadValues({}, input), { items: related || [] }));
|
|
66
|
-
}).catch((e) => {
|
|
67
|
-
return next(input);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
});
|
|
1
|
+
var g = Object.defineProperty, f = Object.defineProperties;
|
|
2
|
+
var l = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var n = Object.getOwnPropertySymbols;
|
|
4
|
+
var p = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (r, e, t) => e in r ? g(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, u = (r, e) => {
|
|
6
|
+
for (var t in e || (e = {}))
|
|
7
|
+
p.call(e, t) && h(r, t, e[t]);
|
|
8
|
+
if (n)
|
|
9
|
+
for (var t of n(e))
|
|
10
|
+
m.call(e, t) && h(r, t, e[t]);
|
|
11
|
+
return r;
|
|
12
|
+
}, o = (r, e) => f(r, l(e));
|
|
13
|
+
import { createEventSubscriber as b, extendComponent as w } from "@telia-ace/knowledge-widget-core";
|
|
14
|
+
import { DataType as C } from "@telia-ace/knowledge-widget-types-grid";
|
|
15
|
+
import { createReactComponent as v } from "@telia-ace/knowledge-widget-ui";
|
|
16
|
+
const G = (r) => v(r, "related-guide-list", import("./related-guide-list.cf209a10.js"), (e) => {
|
|
17
|
+
const { events: t } = r.get("$widget"), [i, c] = b(t), d = (a) => {
|
|
18
|
+
e.writeProperties({ loading: !0, error: void 0 }), e.actions.dispatch("fetch", { params: a });
|
|
19
|
+
};
|
|
20
|
+
return e.actions.create("fetch", ({ items: a = [] }) => e.actions.dispatch("fetched", {
|
|
21
|
+
items: a,
|
|
22
|
+
loading: !0
|
|
23
|
+
})), e.actions.create("fetched", (a) => e.writeProperties(o(u({}, a), { loading: !1 }))), r.getAsync("router").then((a) => {
|
|
24
|
+
const { params: s } = a.getRouteData();
|
|
25
|
+
d(s);
|
|
26
|
+
}), i("router:changed", (a, { current: s }) => {
|
|
27
|
+
d(s.routeData.params);
|
|
28
|
+
}), () => {
|
|
29
|
+
c();
|
|
30
|
+
};
|
|
31
|
+
}).then(() => w(r, "related-guide-list", (e) => {
|
|
32
|
+
e.actions.watch("related-guide-list.fetch", (t, i) => {
|
|
33
|
+
const {
|
|
34
|
+
params: { guide: c, connection: d }
|
|
35
|
+
} = t;
|
|
36
|
+
return c ? (e.properties(), r.getAsync("dataClient").then((a) => a.fetch(C.Guide, {
|
|
37
|
+
connection: d,
|
|
38
|
+
guideId: c
|
|
39
|
+
}).then(({ related: s }) => i(o(u({}, t), { items: s || [] }))).catch((s) => i(t)))) : i(t);
|
|
72
40
|
});
|
|
41
|
+
}));
|
|
42
|
+
export {
|
|
43
|
+
G as default
|
|
73
44
|
};
|
|
74
|
-
export { RelatedGuideListComponent as default };
|
|
75
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/related-guide-list-component.ts"],"sourcesContent":["import {\r\n FavoriteProperties,\r\n MetaDataProperties,\r\n} from '@telia-ace/knowledge-widget-component-utilities';\r\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\r\nimport { DataClient, DataType } from '@telia-ace/knowledge-widget-types-grid';\r\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type RelatedGuideListComponentProps = {\r\n header: string;\r\n items?: any[]; // internal\r\n showFavoriteToggle?: boolean;\r\n tags?: boolean;\r\n} & FavoriteProperties &\r\n MetaDataProperties;\r\n\r\nconst RelatedGuideListComponent = (container: Container) => {\r\n return createReactComponent(\r\n container,\r\n 'related-guide-list',\r\n import('./related-guide-list'),\r\n (component) => {\r\n const { events } = container.get('$widget');\r\n const [subscribe, unsubscribe] = createEventSubscriber(events);\r\n\r\n const fetch = (params: { [key: string]: string }) => {\r\n component.writeProperties({ loading: true, error: undefined });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create('fetch', ({ items = [] }) => {\r\n return component.actions.dispatch('fetched', {\r\n items,\r\n loading: true,\r\n });\r\n });\r\n\r\n component.actions.create('fetched', (input) => {\r\n return component.writeProperties({ ...input, loading: false });\r\n });\r\n\r\n container.getAsync('router').then((router) => {\r\n const { params } = router.getRouteData();\r\n fetch(params);\r\n });\r\n subscribe('router:changed', (_, { current }) => {\r\n fetch(current.routeData.params);\r\n });\r\n return () => {\r\n unsubscribe();\r\n };\r\n }\r\n ).then(() => {\r\n return extendComponent(container, 'related-guide-list', (component) => {\r\n component.actions.watch('related-guide-list.fetch', (input, next) => {\r\n const {\r\n params: { guide, connection },\r\n } = input;\r\n if (!guide) {\r\n return next(input);\r\n }\r\n const { header } = component.properties() as RelatedGuideListComponentProps;\r\n\r\n return container.getAsync('dataClient').then((dataClient: DataClient) => {\r\n return dataClient\r\n .fetch(DataType.Guide, {\r\n connection,\r\n guideId: guide,\r\n })\r\n .then(({ related }) => {\r\n return next({ ...input, items: related || [] });\r\n })\r\n .catch((e: any) => {\r\n return next(input);\r\n });\r\n });\r\n });\r\n });\r\n });\r\n};\r\n\r\nexport default RelatedGuideListComponent;\r\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/related-guide-list-component.ts"],"sourcesContent":["import {\r\n FavoriteProperties,\r\n MetaDataProperties,\r\n} from '@telia-ace/knowledge-widget-component-utilities';\r\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\r\nimport { DataClient, DataType } from '@telia-ace/knowledge-widget-types-grid';\r\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type RelatedGuideListComponentProps = {\r\n header: string;\r\n items?: any[]; // internal\r\n showFavoriteToggle?: boolean;\r\n tags?: boolean;\r\n} & FavoriteProperties &\r\n MetaDataProperties;\r\n\r\nconst RelatedGuideListComponent = (container: Container) => {\r\n return createReactComponent(\r\n container,\r\n 'related-guide-list',\r\n import('./related-guide-list'),\r\n (component) => {\r\n const { events } = container.get('$widget');\r\n const [subscribe, unsubscribe] = createEventSubscriber(events);\r\n\r\n const fetch = (params: { [key: string]: string }) => {\r\n component.writeProperties({ loading: true, error: undefined });\r\n component.actions.dispatch('fetch', { params });\r\n };\r\n\r\n component.actions.create('fetch', ({ items = [] }) => {\r\n return component.actions.dispatch('fetched', {\r\n items,\r\n loading: true,\r\n });\r\n });\r\n\r\n component.actions.create('fetched', (input) => {\r\n return component.writeProperties({ ...input, loading: false });\r\n });\r\n\r\n container.getAsync('router').then((router) => {\r\n const { params } = router.getRouteData();\r\n fetch(params);\r\n });\r\n subscribe('router:changed', (_, { current }) => {\r\n fetch(current.routeData.params);\r\n });\r\n return () => {\r\n unsubscribe();\r\n };\r\n }\r\n ).then(() => {\r\n return extendComponent(container, 'related-guide-list', (component) => {\r\n component.actions.watch('related-guide-list.fetch', (input, next) => {\r\n const {\r\n params: { guide, connection },\r\n } = input;\r\n if (!guide) {\r\n return next(input);\r\n }\r\n const { header } = component.properties() as RelatedGuideListComponentProps;\r\n\r\n return container.getAsync('dataClient').then((dataClient: DataClient) => {\r\n return dataClient\r\n .fetch(DataType.Guide, {\r\n connection,\r\n guideId: guide,\r\n })\r\n .then(({ related }) => {\r\n return next({ ...input, items: related || [] });\r\n })\r\n .catch((e: any) => {\r\n return next(input);\r\n });\r\n });\r\n });\r\n });\r\n });\r\n};\r\n\r\nexport default RelatedGuideListComponent;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiBM,MAAA,IAA4B,CAAC,MACxB,EACH,GACA,sBACA,OAAO,qCACP,CAAC,MAAc;AACX,QAAM,EAAE,cAAW,EAAU,IAAI,SAAS,GACpC,CAAC,GAAW,KAAe,EAAsB,CAAM,GAEvD,IAAQ,CAAC,MAAsC;AACjD,MAAU,gBAAgB,EAAE,SAAS,IAAM,OAAO,QAAW,GAC7D,EAAU,QAAQ,SAAS,SAAS,EAAE,UAAQ,CAAA;AAAA,EAAA;AAGlD,WAAU,QAAQ,OAAO,SAAS,CAAC,EAAE,WAAQ,CAAA,QAClC,EAAU,QAAQ,SAAS,WAAW;AAAA,IACzC;AAAA,IACA,SAAS;AAAA,EAAA,CACZ,CACJ,GAED,EAAU,QAAQ,OAAO,WAAW,CAAC,MAC1B,EAAU,gBAAgB,QAAK,IAAL,EAAY,SAAS,KAAO,CAChE,GAED,EAAU,SAAS,QAAQ,EAAE,KAAK,CAAC,MAAW;AACpC,UAAA,EAAE,cAAW,EAAO,aAAa;AACvC,MAAM,CAAM;AAAA,EAAA,CACf,GACD,EAAU,kBAAkB,CAAC,GAAG,EAAE,iBAAc;AACtC,MAAA,EAAQ,UAAU,MAAM;AAAA,EAAA,CACjC,GACM,MAAM;AACG;EAAA;AAChB,CAER,EAAE,KAAK,MACI,EAAgB,GAAW,sBAAsB,CAAC,MAAc;AACnE,IAAU,QAAQ,MAAM,4BAA4B,CAAC,GAAO,MAAS;AAC3D,UAAA;AAAA,MACF,QAAQ,EAAE,UAAO;AAAA,QACjB;AACJ,WAAK,IAGc,GAAU,WAAW,GAEjC,EAAU,SAAS,YAAY,EAAE,KAAK,CAAC,MACnC,EACF,MAAM,EAAS,OAAO;AAAA,MACnB;AAAA,MACA,SAAS;AAAA,IACZ,CAAA,EACA,KAAK,CAAC,EAAE,iBACE,EAAK,QAAK,IAAL,EAAY,OAAO,KAAW,KAAI,CACjD,EACA,MAAM,CAAC,MACG,EAAK,CAAK,CACpB,CACR,KAhBU,EAAK,CAAK;AAAA,EAgBpB,CACJ;AAAA,CACJ,CACJ;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var E = Object.defineProperty, M = Object.defineProperties;
|
|
2
|
+
var D = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var l = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var d = (e, a, t) => a in e ? E(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, i = (e, a) => {
|
|
6
|
+
for (var t in a || (a = {}))
|
|
7
|
+
l.call(a, t) && d(e, t, a[t]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var t of m(a))
|
|
10
|
+
n.call(a, t) && d(e, t, a[t]);
|
|
11
|
+
return e;
|
|
12
|
+
}, r = (e, a) => M(e, D(a));
|
|
13
|
+
var u = (e, a) => {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var o in e)
|
|
16
|
+
l.call(e, o) && a.indexOf(o) < 0 && (t[o] = e[o]);
|
|
17
|
+
if (e != null && m)
|
|
18
|
+
for (var o of m(e))
|
|
19
|
+
a.indexOf(o) < 0 && n.call(e, o) && (t[o] = e[o]);
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { useRouteData as H, useContainer as S, useProperties as U, createEmptyComponent as $, GuideList as j, contentBox as k } from "@telia-ace/knowledge-widget-ui";
|
|
23
|
+
import { appendClassNames as p, createParams as q, formatUrl as z } from "@telia-ace/widget-utilities";
|
|
24
|
+
import A from "react";
|
|
25
|
+
import I from "styled-components";
|
|
26
|
+
const X = (t) => {
|
|
27
|
+
var o = t, { className: e } = o, a = u(o, ["className"]);
|
|
28
|
+
const { name: c, params: v } = H(), b = S(), {
|
|
29
|
+
showFavoriteToggle: g = !1,
|
|
30
|
+
items: s,
|
|
31
|
+
header: L,
|
|
32
|
+
metadata: f,
|
|
33
|
+
tags: h,
|
|
34
|
+
addFavoriteTooltip: y,
|
|
35
|
+
removeFavoriteCancelLabel: F,
|
|
36
|
+
removeFavoriteConfirmLabel: C,
|
|
37
|
+
removeFavoriteHeader: T,
|
|
38
|
+
removeFavoriteLabel: G,
|
|
39
|
+
removeFavoriteTooltip: N,
|
|
40
|
+
metadataByLabel: P,
|
|
41
|
+
metadataModifiedLabel: R,
|
|
42
|
+
metadataPublishedLabel: w
|
|
43
|
+
} = U();
|
|
44
|
+
return !s || !s.length ? $(b, r(i({}, a), {
|
|
45
|
+
className: p(e, "humany-related-guide-list")
|
|
46
|
+
})) : /* @__PURE__ */ A.createElement(J, r(i({}, a), {
|
|
47
|
+
className: p(e, "humany-related-guide-list"),
|
|
48
|
+
header: L,
|
|
49
|
+
items: s,
|
|
50
|
+
paramMappers: {
|
|
51
|
+
guide: ({ id: x, title: B }) => q(r(i({}, v), {
|
|
52
|
+
guide: x,
|
|
53
|
+
uriName: z(B),
|
|
54
|
+
connection: void 0
|
|
55
|
+
}))
|
|
56
|
+
},
|
|
57
|
+
showTags: h,
|
|
58
|
+
showFavoriteToggle: g,
|
|
59
|
+
addFavoriteTooltip: y,
|
|
60
|
+
removeFavoriteCancelLabel: F,
|
|
61
|
+
removeFavoriteConfirmLabel: C,
|
|
62
|
+
removeFavoriteHeader: T,
|
|
63
|
+
removeFavoriteLabel: G,
|
|
64
|
+
removeFavoriteTooltip: N,
|
|
65
|
+
metadata: r(i({}, f), {
|
|
66
|
+
modifiedLabel: R,
|
|
67
|
+
publishedLabel: w,
|
|
68
|
+
byLabel: P
|
|
69
|
+
}),
|
|
70
|
+
routing: {
|
|
71
|
+
guide: c
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
}, J = I(j)`
|
|
75
|
+
${k}
|
|
76
|
+
li:last-child {
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
export {
|
|
81
|
+
X as default
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=related-guide-list.cf209a10.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-guide-list.cf209a10.js","sources":["../src/related-guide-list.tsx"],"sourcesContent":["import { Guide } from '@telia-ace/knowledge-widget-core';\r\nimport {\r\n contentBox,\r\n createEmptyComponent,\r\n GuideList,\r\n useContainer,\r\n useProperties,\r\n useRouteData,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames, createParams, formatUrl } from '@telia-ace/widget-utilities';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { RelatedGuideListComponentProps } from './related-guide-list-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst RelatedGuideList: React.SFC<Props> = ({ className, ...other }) => {\r\n const { name, params } = useRouteData();\r\n const container = useContainer();\r\n const {\r\n showFavoriteToggle = false,\r\n items,\r\n header,\r\n metadata,\r\n tags,\r\n addFavoriteTooltip,\r\n removeFavoriteCancelLabel,\r\n removeFavoriteConfirmLabel,\r\n removeFavoriteHeader,\r\n removeFavoriteLabel,\r\n removeFavoriteTooltip,\r\n metadataByLabel,\r\n metadataModifiedLabel,\r\n metadataPublishedLabel,\r\n } = useProperties<RelatedGuideListComponentProps>();\r\n\r\n if (!items || !items.length) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-related-guide-list'),\r\n });\r\n }\r\n\r\n return (\r\n <StyledGuideList\r\n {...other}\r\n className={appendClassNames(className, 'humany-related-guide-list')}\r\n header={header}\r\n items={items}\r\n paramMappers={{\r\n guide: ({ id, title }: Guide) =>\r\n createParams({\r\n ...params,\r\n guide: id,\r\n uriName: formatUrl(title),\r\n connection: undefined,\r\n }),\r\n }}\r\n showTags={tags}\r\n showFavoriteToggle={showFavoriteToggle}\r\n addFavoriteTooltip={addFavoriteTooltip}\r\n removeFavoriteCancelLabel={removeFavoriteCancelLabel}\r\n removeFavoriteConfirmLabel={removeFavoriteConfirmLabel}\r\n removeFavoriteHeader={removeFavoriteHeader}\r\n removeFavoriteLabel={removeFavoriteLabel}\r\n removeFavoriteTooltip={removeFavoriteTooltip}\r\n metadata={{\r\n ...metadata,\r\n modifiedLabel: metadataModifiedLabel,\r\n publishedLabel: metadataPublishedLabel,\r\n byLabel: metadataByLabel,\r\n }}\r\n routing={{\r\n guide: name,\r\n }}\r\n />\r\n );\r\n};\r\n\r\nexport default RelatedGuideList;\r\n\r\nconst StyledGuideList = styled(GuideList)<any>`\r\n ${contentBox}\r\n li:last-child {\r\n margin: 0;\r\n }\r\n`;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,IAAqC,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AACpC,QAAA,EAAE,SAAM,cAAW,EAAa,GAChC,IAAY,KACZ;AAAA,IACF,wBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACA,EAA8C;AAElD,SAAI,CAAC,KAAS,CAAC,EAAM,SACV,EAAqB,GAAW,QAChC,IADgC;AAAA,IAEnC,WAAW,EAAiB,GAAW,2BAA2B;AAAA,EAAA,EACrE,IAIA,kBAAA,cAAA,GAAA,QACO,IADP;AAAA,IAEG,WAAW,EAAiB,GAAW,2BAA2B;AAAA,IAClE;AAAA,IACA;AAAA,IACA,cAAc;AAAA,MACV,OAAO,CAAC,EAAE,OAAI,eACV,EAAa,QACN,IADM;AAAA,QAET,OAAO;AAAA,QACP,SAAS,EAAU,CAAK;AAAA,QACxB,YAAY;AAAA,MAAA,EACf;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,QACH,IADG;AAAA,MAEN,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,SAAS;AAAA,IACb;AAAA,IACA,SAAS;AAAA,MACL,OAAO;AAAA,IACX;AAAA,EAAA,EACJ;AAER,GAIM,IAAkB,EAAO,CAAS;AAAA,MAClC;AAAA;AAAA;AAAA;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-related-guide-list",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "Related guide list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"type": "module",
|
|
12
12
|
"types": "dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"LICENSE.txt",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@telia-ace/knowledge-widget-component-utilities": "^1.0.
|
|
29
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
30
|
-
"@telia-ace/knowledge-widget-types-grid": "^1.0.
|
|
31
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
28
|
+
"@telia-ace/knowledge-widget-component-utilities": "^1.0.19",
|
|
29
|
+
"@telia-ace/knowledge-widget-core": "^1.0.17",
|
|
30
|
+
"@telia-ace/knowledge-widget-types-grid": "^1.0.26",
|
|
31
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.23",
|
|
32
32
|
"@telia-ace/widget-utilities": "^1.0.2",
|
|
33
33
|
"@webprovisions/platform": "^1.1.2"
|
|
34
34
|
},
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@types/react-dom": "^16.8.0",
|
|
43
43
|
"@types/styled-components": "^5.1.7"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "44efbdca7f57d6997132792020922c89b013c44d"
|
|
46
46
|
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import { useRouteData, useContainer, useProperties, createEmptyComponent, GuideList, contentBox } from "@telia-ace/knowledge-widget-ui";
|
|
33
|
-
import { appendClassNames, createParams, formatUrl } from "@telia-ace/widget-utilities";
|
|
34
|
-
import React from "react";
|
|
35
|
-
import styled from "styled-components";
|
|
36
|
-
const RelatedGuideList = (_a) => {
|
|
37
|
-
var _b = _a, { className } = _b, other = __objRest(_b, ["className"]);
|
|
38
|
-
const { name, params } = useRouteData();
|
|
39
|
-
const container = useContainer();
|
|
40
|
-
const {
|
|
41
|
-
showFavoriteToggle = false,
|
|
42
|
-
items,
|
|
43
|
-
header,
|
|
44
|
-
metadata,
|
|
45
|
-
tags,
|
|
46
|
-
addFavoriteTooltip,
|
|
47
|
-
removeFavoriteCancelLabel,
|
|
48
|
-
removeFavoriteConfirmLabel,
|
|
49
|
-
removeFavoriteHeader,
|
|
50
|
-
removeFavoriteLabel,
|
|
51
|
-
removeFavoriteTooltip,
|
|
52
|
-
metadataByLabel,
|
|
53
|
-
metadataModifiedLabel,
|
|
54
|
-
metadataPublishedLabel
|
|
55
|
-
} = useProperties();
|
|
56
|
-
if (!items || !items.length) {
|
|
57
|
-
return createEmptyComponent(container, __spreadProps(__spreadValues({}, other), {
|
|
58
|
-
className: appendClassNames(className, "humany-related-guide-list")
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
return /* @__PURE__ */ React.createElement(StyledGuideList, __spreadProps(__spreadValues({}, other), {
|
|
62
|
-
className: appendClassNames(className, "humany-related-guide-list"),
|
|
63
|
-
header,
|
|
64
|
-
items,
|
|
65
|
-
paramMappers: {
|
|
66
|
-
guide: ({ id, title }) => createParams(__spreadProps(__spreadValues({}, params), {
|
|
67
|
-
guide: id,
|
|
68
|
-
uriName: formatUrl(title),
|
|
69
|
-
connection: void 0
|
|
70
|
-
}))
|
|
71
|
-
},
|
|
72
|
-
showTags: tags,
|
|
73
|
-
showFavoriteToggle,
|
|
74
|
-
addFavoriteTooltip,
|
|
75
|
-
removeFavoriteCancelLabel,
|
|
76
|
-
removeFavoriteConfirmLabel,
|
|
77
|
-
removeFavoriteHeader,
|
|
78
|
-
removeFavoriteLabel,
|
|
79
|
-
removeFavoriteTooltip,
|
|
80
|
-
metadata: __spreadProps(__spreadValues({}, metadata), {
|
|
81
|
-
modifiedLabel: metadataModifiedLabel,
|
|
82
|
-
publishedLabel: metadataPublishedLabel,
|
|
83
|
-
byLabel: metadataByLabel
|
|
84
|
-
}),
|
|
85
|
-
routing: {
|
|
86
|
-
guide: name
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
};
|
|
90
|
-
const StyledGuideList = styled(GuideList)`
|
|
91
|
-
${contentBox}
|
|
92
|
-
li:last-child {
|
|
93
|
-
margin: 0;
|
|
94
|
-
}
|
|
95
|
-
`;
|
|
96
|
-
export { RelatedGuideList as default };
|
|
97
|
-
//# sourceMappingURL=related-guide-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"related-guide-list.js","sources":["../src/related-guide-list.tsx"],"sourcesContent":["import { Guide } from '@telia-ace/knowledge-widget-core';\r\nimport {\r\n contentBox,\r\n createEmptyComponent,\r\n GuideList,\r\n useContainer,\r\n useProperties,\r\n useRouteData,\r\n} from '@telia-ace/knowledge-widget-ui';\r\nimport { appendClassNames, createParams, formatUrl } from '@telia-ace/widget-utilities';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { RelatedGuideListComponentProps } from './related-guide-list-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst RelatedGuideList: React.SFC<Props> = ({ className, ...other }) => {\r\n const { name, params } = useRouteData();\r\n const container = useContainer();\r\n const {\r\n showFavoriteToggle = false,\r\n items,\r\n header,\r\n metadata,\r\n tags,\r\n addFavoriteTooltip,\r\n removeFavoriteCancelLabel,\r\n removeFavoriteConfirmLabel,\r\n removeFavoriteHeader,\r\n removeFavoriteLabel,\r\n removeFavoriteTooltip,\r\n metadataByLabel,\r\n metadataModifiedLabel,\r\n metadataPublishedLabel,\r\n } = useProperties<RelatedGuideListComponentProps>();\r\n\r\n if (!items || !items.length) {\r\n return createEmptyComponent(container, {\r\n ...other,\r\n className: appendClassNames(className, 'humany-related-guide-list'),\r\n });\r\n }\r\n\r\n return (\r\n <StyledGuideList\r\n {...other}\r\n className={appendClassNames(className, 'humany-related-guide-list')}\r\n header={header}\r\n items={items}\r\n paramMappers={{\r\n guide: ({ id, title }: Guide) =>\r\n createParams({\r\n ...params,\r\n guide: id,\r\n uriName: formatUrl(title),\r\n connection: undefined,\r\n }),\r\n }}\r\n showTags={tags}\r\n showFavoriteToggle={showFavoriteToggle}\r\n addFavoriteTooltip={addFavoriteTooltip}\r\n removeFavoriteCancelLabel={removeFavoriteCancelLabel}\r\n removeFavoriteConfirmLabel={removeFavoriteConfirmLabel}\r\n removeFavoriteHeader={removeFavoriteHeader}\r\n removeFavoriteLabel={removeFavoriteLabel}\r\n removeFavoriteTooltip={removeFavoriteTooltip}\r\n metadata={{\r\n ...metadata,\r\n modifiedLabel: metadataModifiedLabel,\r\n publishedLabel: metadataPublishedLabel,\r\n byLabel: metadataByLabel,\r\n }}\r\n routing={{\r\n guide: name,\r\n }}\r\n />\r\n );\r\n};\r\n\r\nexport default RelatedGuideList;\r\n\r\nconst StyledGuideList = styled(GuideList)<any>`\r\n ${contentBox}\r\n li:last-child {\r\n margin: 0;\r\n }\r\n`;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,mBAAqC,CAAC,OAA4B;AAA5B,eAAE,gBAAF,IAAgB,kBAAhB,IAAgB,CAAd;AACpC,QAAA,EAAE,MAAM,WAAW,aAAa;AACtC,QAAM,YAAY;AACZ,QAAA;AAAA,IACF,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACA,cAA8C;AAElD,MAAI,CAAC,SAAS,CAAC,MAAM,QAAQ;AACzB,WAAO,qBAAqB,WAAW,iCAChC,QADgC;AAAA,MAEnC,WAAW,iBAAiB,WAAW,2BAA2B;AAAA,IAAA,EACrE;AAAA,EACL;AAEA,SACK,sBAAA,cAAA,iBAAA,iCACO,QADP;AAAA,IAEG,WAAW,iBAAiB,WAAW,2BAA2B;AAAA,IAClE;AAAA,IACA;AAAA,IACA,cAAc;AAAA,MACV,OAAO,CAAC,EAAE,IAAI,YACV,aAAa,iCACN,SADM;AAAA,QAET,OAAO;AAAA,QACP,SAAS,UAAU,KAAK;AAAA,QACxB,YAAY;AAAA,MAAA,EACf;AAAA,IACT;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,iCACH,WADG;AAAA,MAEN,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,SAAS;AAAA,IACb;AAAA,IACA,SAAS;AAAA,MACL,OAAO;AAAA,IACX;AAAA,EAAA,EACJ;AAER;AAIA,MAAM,kBAAkB,OAAO,SAAS;AAAA,MAClC;AAAA;AAAA;AAAA;AAAA;;"}
|