@telia-ace/knowledge-widget-components-related-tag-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 +5 -6
package/dist/index.js
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h = Object.defineProperty, f = Object.defineProperties;
|
|
2
2
|
var l = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var u = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var p = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var g = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, o = (r, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
p.call(t, e) && g(r, e, t[e]);
|
|
8
8
|
if (u)
|
|
9
9
|
for (var e of u(t))
|
|
10
|
-
|
|
10
|
+
m.call(t, e) && g(r, e, t[e]);
|
|
11
11
|
return r;
|
|
12
|
-
}, d = (r, t) =>
|
|
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
|
+
}, d = (r, t) => f(r, l(t));
|
|
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-tag-list",
|
|
20
19
|
import("./related-tag-list.b154a33c.js"),
|
|
21
20
|
(t) => {
|
|
22
|
-
const { events: e } = r.get("$widget"), [i,
|
|
21
|
+
const { events: e } = r.get("$widget"), [i, n] = w(e), c = (a) => {
|
|
23
22
|
t.writeProperties({ loading: !0, error: void 0 }), t.actions.dispatch("fetch", { params: a });
|
|
24
23
|
};
|
|
25
24
|
return t.actions.create("fetch", ({ items: a = [] }) => t.actions.dispatch("fetched", {
|
|
26
25
|
items: a,
|
|
27
26
|
loading: !0
|
|
28
|
-
})), t.actions.create("fetched", (a) => t.writeProperties(d(
|
|
27
|
+
})), t.actions.create("fetched", (a) => t.writeProperties(d(o({}, a), { loading: !1 }))), r.getAsync("router").then((a) => {
|
|
29
28
|
const { params: s } = a.getRouteData();
|
|
30
|
-
|
|
29
|
+
c(s);
|
|
31
30
|
}), i("router:changed", (a, { current: s }) => {
|
|
32
|
-
|
|
31
|
+
c(s.routeData.params);
|
|
33
32
|
}), () => {
|
|
34
|
-
|
|
33
|
+
n();
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
).then(() =>
|
|
36
|
+
).then(() => D(r, "related-tag-list", (t) => {
|
|
38
37
|
t.actions.watch("related-tag-list.fetch", (e, i) => {
|
|
39
38
|
const {
|
|
40
|
-
params: { guide:
|
|
39
|
+
params: { guide: n, connection: c }
|
|
41
40
|
} = e;
|
|
42
|
-
if (typeof
|
|
43
|
-
return b.getInstance(r).then((a) => a.fetch(
|
|
44
|
-
connection:
|
|
45
|
-
guideId:
|
|
46
|
-
}).then(({ tags: s }) => i(d(
|
|
41
|
+
if (typeof n != "undefined")
|
|
42
|
+
return b.getInstance(r).then((a) => a.fetch(C.Guide, {
|
|
43
|
+
connection: c,
|
|
44
|
+
guideId: n
|
|
45
|
+
}).then(({ tags: s }) => i(d(o({}, e), { items: s || [] }))).catch((s) => i(e)));
|
|
47
46
|
});
|
|
48
|
-
})),
|
|
47
|
+
})), P = v;
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
P as default
|
|
51
50
|
};
|
|
52
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/related-tag-list-component.ts"],"sourcesContent":["import { DataClient } from '@telia-ace/knowledge-data-client';\nimport { createEventSubscriber, extendComponent } from '@telia-ace/knowledge-widget-core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/related-tag-list-component.ts"],"sourcesContent":["import { DataClient, DataType } from '@telia-ace/knowledge-data-client';\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 RelatedTagListComponentProps = {\n header: string;\n route?: string;\n items?: any[]; // internal\n showIcons?: boolean;\n};\n\nconst RelatedTagListComponent = (container: Container) => {\n return createReactComponent(\n container,\n 'related-tag-list',\n import('./related-tag-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-tag-list', (component) => {\n component.actions.watch('related-tag-list.fetch', (input, next) => {\n const {\n params: { guide, connection },\n } = input;\n\n if (typeof guide !== 'undefined') {\n return DataClient.getInstance(container).then((dataClient) => {\n return dataClient\n .fetch(DataType.Guide, {\n connection,\n guideId: guide,\n })\n .then(({ tags }) => {\n return next({ ...input, items: tags || [] });\n })\n .catch((e: any) => {\n return next(input);\n });\n });\n }\n });\n });\n });\n};\nexport default RelatedTagListComponent;\n"],"names":["RelatedTagListComponent","container","createReactComponent","component","events","subscribe","unsubscribe","createEventSubscriber","fetch","params","items","input","__spreadProps","__spreadValues","router","_","current","extendComponent","next","guide","connection","DataClient","dataClient","DataType","tags","e","RelatedTagListComponent$1"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAMA,IAA0B,CAACC,MACtBC;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,oBAAoB,CAACE,MAAc;AACjE,EAAAA,EAAU,QAAQ,MAAM,0BAA0B,CAACQ,GAAOO,MAAS;AACzD,UAAA;AAAA,MACF,QAAQ,EAAE,OAAAC,GAAO,YAAAC,EAAW;AAAA,IAC5B,IAAAT;AAEA,QAAA,OAAOQ,KAAU;AACjB,aAAOE,EAAW,YAAYpB,CAAS,EAAE,KAAK,CAACqB,MACpCA,EACF,MAAMC,EAAS,OAAO;AAAA,QACnB,YAAAH;AAAA,QACA,SAASD;AAAA,MACZ,CAAA,EACA,KAAK,CAAC,EAAE,MAAAK,QACEN,EAAKN,EAAAC,EAAA,IAAKF,IAAL,EAAY,OAAOa,KAAQ,KAAI,CAC9C,EACA,MAAM,CAACC,MACGP,EAAKP,CAAK,CACpB,CACR;AAAA,EACL,CACH;AAAA,CACJ,CACJ,GAELe,IAAe1B;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-related-tag-list",
|
|
3
|
-
"version": "1.0.39
|
|
3
|
+
"version": "1.0.39",
|
|
4
4
|
"description": "Related tag list component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-data-client": "1.0.2
|
|
25
|
-
"@telia-ace/knowledge-widget-core": "1.0.35
|
|
26
|
-
"@telia-ace/knowledge-widget-
|
|
27
|
-
"@telia-ace/
|
|
28
|
-
"@telia-ace/widget-utilities": "^1.0.10-next.0",
|
|
24
|
+
"@telia-ace/knowledge-data-client": "1.0.2",
|
|
25
|
+
"@telia-ace/knowledge-widget-core": "1.0.35",
|
|
26
|
+
"@telia-ace/knowledge-widget-ui": "1.0.41",
|
|
27
|
+
"@telia-ace/widget-utilities": "^1.0.10",
|
|
29
28
|
"@webprovisions/platform": "^1.1.2"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|