@telia-ace/knowledge-widget-components-related-guide-list 1.0.39-next.5 → 1.0.39
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 +22 -23
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.js
CHANGED
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var g = Object.defineProperty, l = Object.defineProperties;
|
|
2
|
+
var f = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var n = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var h = (r, e, t) => e in r ?
|
|
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, o = (r, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
p.call(e, t) && h(r, t, e[t]);
|
|
8
8
|
if (n)
|
|
9
9
|
for (var t of n(e))
|
|
10
|
-
|
|
10
|
+
m.call(e, t) && h(r, t, e[t]);
|
|
11
11
|
return r;
|
|
12
|
-
}, u = (r, e) =>
|
|
13
|
-
import { DataClient as b } from "@telia-ace/knowledge-data-client";
|
|
14
|
-
import { createEventSubscriber as
|
|
15
|
-
import { DataType as D } from "@telia-ace/knowledge-widget-types-grid";
|
|
12
|
+
}, u = (r, e) => l(r, f(e));
|
|
13
|
+
import { DataClient as b, DataType as C } from "@telia-ace/knowledge-data-client";
|
|
14
|
+
import { createEventSubscriber as w, extendComponent as D } from "@telia-ace/knowledge-widget-core";
|
|
16
15
|
import { createReactComponent as R } from "@telia-ace/knowledge-widget-ui";
|
|
17
16
|
const v = (r) => R(
|
|
18
17
|
r,
|
|
19
18
|
"related-guide-list",
|
|
20
19
|
import("./related-guide-list.7ecfd11f.js"),
|
|
21
20
|
(e) => {
|
|
22
|
-
const { events: t } = r.get("$widget"), [i,
|
|
21
|
+
const { events: t } = r.get("$widget"), [i, c] = w(t), d = (a) => {
|
|
23
22
|
e.writeProperties({ loading: !0, error: void 0 }), e.actions.dispatch("fetch", { params: a });
|
|
24
23
|
};
|
|
25
24
|
return e.actions.create("fetch", ({ items: a = [] }) => e.actions.dispatch("fetched", {
|
|
26
25
|
items: a,
|
|
27
26
|
loading: !0
|
|
28
|
-
})), e.actions.create("fetched", (a) => e.writeProperties(u(
|
|
27
|
+
})), e.actions.create("fetched", (a) => e.writeProperties(u(o({}, a), { loading: !1 }))), r.getAsync("router").then((a) => {
|
|
29
28
|
const { params: s } = a.getRouteData();
|
|
30
|
-
|
|
29
|
+
d(s);
|
|
31
30
|
}), i("router:changed", (a, { current: s }) => {
|
|
32
|
-
|
|
31
|
+
d(s.routeData.params);
|
|
33
32
|
}), () => {
|
|
34
|
-
|
|
33
|
+
c();
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
).then(() =>
|
|
36
|
+
).then(() => D(r, "related-guide-list", (e) => {
|
|
38
37
|
e.actions.watch("related-guide-list.fetch", (t, i) => {
|
|
39
38
|
const {
|
|
40
|
-
params: { guide:
|
|
39
|
+
params: { guide: c, connection: d }
|
|
41
40
|
} = t;
|
|
42
|
-
return
|
|
43
|
-
connection:
|
|
44
|
-
guideId:
|
|
45
|
-
}).then(({ related: s }) => i(u(
|
|
41
|
+
return c ? (e.properties(), b.getInstance(r).then((a) => a.fetch(C.Guide, {
|
|
42
|
+
connection: d,
|
|
43
|
+
guideId: c
|
|
44
|
+
}).then(({ related: s }) => i(u(o({}, t), { items: s || [] }))).catch((s) => i(t)))) : i(t);
|
|
46
45
|
});
|
|
47
|
-
})),
|
|
46
|
+
})), P = v;
|
|
48
47
|
export {
|
|
49
|
-
|
|
48
|
+
P as default
|
|
50
49
|
};
|
|
51
50
|
//# 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 { DataClient } from '@telia-ace/knowledge-data-client';\nimport {\n FavoriteProperties,\n MetaDataProperties,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/related-guide-list-component.ts"],"sourcesContent":["import { DataClient, DataType } from '@telia-ace/knowledge-data-client';\nimport {\n FavoriteProperties,\n MetaDataProperties,\n} from '@telia-ace/knowledge-widget-component-utilities';\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container } from '@webprovisions/platform';\n\nexport type RelatedGuideListComponentProps = {\n header: string;\n items?: any[]; // internal\n showFavoriteToggle?: boolean;\n tags?: boolean;\n} & FavoriteProperties &\n MetaDataProperties;\n\nconst RelatedGuideListComponent = (container: Container) => {\n return createReactComponent(\n container,\n 'related-guide-list',\n import('./related-guide-list'),\n (component) => {\n const { events } = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n const fetch = (params: { [key: string]: string }) => {\n component.writeProperties({ loading: true, error: undefined });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create('fetch', ({ items = [] }) => {\n return component.actions.dispatch('fetched', {\n items,\n loading: true,\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 subscribe('router:changed', (_, { current }) => {\n fetch(current.routeData.params);\n });\n return () => {\n unsubscribe();\n };\n }\n ).then(() => {\n return extendComponent(container, 'related-guide-list', (component) => {\n component.actions.watch('related-guide-list.fetch', (input, next) => {\n const {\n params: { guide, connection },\n } = input;\n if (!guide) {\n return next(input);\n }\n const { header } = component.properties() as RelatedGuideListComponentProps;\n\n return DataClient.getInstance(container).then((dataClient) => {\n return dataClient\n .fetch(DataType.Guide, {\n connection,\n guideId: guide,\n })\n .then(({ related }) => {\n return next({ ...input, items: related || [] });\n })\n .catch((e: any) => {\n return next(input);\n });\n });\n });\n });\n });\n};\n\nexport default RelatedGuideListComponent;\n"],"names":["RelatedGuideListComponent","container","createReactComponent","component","events","subscribe","unsubscribe","createEventSubscriber","fetch","params","items","input","__spreadProps","__spreadValues","router","_","current","extendComponent","next","guide","connection","DataClient","dataClient","DataType","related","e","RelatedGuideListComponent$1"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAMA,IAA4B,CAACC,MACxBC;AAAA,EACHD;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,CAACE,MAAc;AACX,UAAM,EAAE,QAAAC,EAAW,IAAAH,EAAU,IAAI,SAAS,GACpC,CAACI,GAAWC,CAAW,IAAIC,EAAsBH,CAAM,GAEvDI,IAAQ,CAACC,MAAsC;AACjD,MAAAN,EAAU,gBAAgB,EAAE,SAAS,IAAM,OAAO,QAAW,GAC7DA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAM,EAAQ,CAAA;AAAA,IAAA;AAGxC,WAAAN,EAAA,QAAQ,OAAO,SAAS,CAAC,EAAE,OAAAO,IAAQ,CAAA,QAClCP,EAAU,QAAQ,SAAS,WAAW;AAAA,MACzC,OAAAO;AAAA,MACA,SAAS;AAAA,IAAA,CACZ,CACJ,GAEDP,EAAU,QAAQ,OAAO,WAAW,CAACQ,MAC1BR,EAAU,gBAAgBS,EAAAC,EAAA,IAAKF,IAAL,EAAY,SAAS,KAAO,CAChE,GAEDV,EAAU,SAAS,QAAQ,EAAE,KAAK,CAACa,MAAW;AAC1C,YAAM,EAAE,QAAAL,EAAA,IAAWK,EAAO,aAAa;AACvC,MAAAN,EAAMC,CAAM;AAAA,IAAA,CACf,GACDJ,EAAU,kBAAkB,CAACU,GAAG,EAAE,SAAAC,QAAc;AACtC,MAAAR,EAAAQ,EAAQ,UAAU,MAAM;AAAA,IAAA,CACjC,GACM,MAAM;AACG,MAAAV;IAAA;AAAA,EAEpB;AACJ,EAAE,KAAK,MACIW,EAAgBhB,GAAW,sBAAsB,CAACE,MAAc;AACnE,EAAAA,EAAU,QAAQ,MAAM,4BAA4B,CAACQ,GAAOO,MAAS;AAC3D,UAAA;AAAA,MACF,QAAQ,EAAE,OAAAC,GAAO,YAAAC,EAAW;AAAA,IAC5B,IAAAT;AACJ,WAAKQ,KAGchB,EAAU,WAAW,GAEjCkB,EAAW,YAAYpB,CAAS,EAAE,KAAK,CAACqB,MACpCA,EACF,MAAMC,EAAS,OAAO;AAAA,MACnB,YAAAH;AAAA,MACA,SAASD;AAAA,IACZ,CAAA,EACA,KAAK,CAAC,EAAE,SAAAK,QACEN,EAAKN,EAAAC,EAAA,IAAKF,IAAL,EAAY,OAAOa,KAAW,KAAI,CACjD,EACA,MAAM,CAACC,MACGP,EAAKP,CAAK,CACpB,CACR,KAhBUO,EAAKP,CAAK;AAAA,EAgBpB,CACJ;AAAA,CACJ,CACJ,GAGLe,IAAe1B;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-related-guide-list",
|
|
3
|
-
"version": "1.0.39
|
|
3
|
+
"version": "1.0.39",
|
|
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",
|
|
@@ -21,12 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-data-client": "1.0.2
|
|
25
|
-
"@telia-ace/knowledge-widget-component-utilities": "1.0.39
|
|
26
|
-
"@telia-ace/knowledge-widget-core": "1.0.35
|
|
27
|
-
"@telia-ace/knowledge-widget-
|
|
28
|
-
"@telia-ace/
|
|
29
|
-
"@telia-ace/widget-utilities": "^1.0.10-next.0",
|
|
24
|
+
"@telia-ace/knowledge-data-client": "1.0.2",
|
|
25
|
+
"@telia-ace/knowledge-widget-component-utilities": "1.0.39",
|
|
26
|
+
"@telia-ace/knowledge-widget-core": "1.0.35",
|
|
27
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41",
|
|
28
|
+
"@telia-ace/widget-utilities": "^1.0.10",
|
|
30
29
|
"@webprovisions/platform": "^1.1.2"
|
|
31
30
|
},
|
|
32
31
|
"peerDependencies": {
|