@telia-ace/knowledge-widget-components-notification-row 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 CHANGED
@@ -1,21 +1,20 @@
1
- var w = Object.defineProperty, b = Object.defineProperties;
1
+ var m = Object.defineProperty, b = Object.defineProperties;
2
2
  var C = Object.getOwnPropertyDescriptors;
3
- var p = Object.getOwnPropertySymbols;
3
+ var g = Object.getOwnPropertySymbols;
4
4
  var y = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
5
- var g = (t, e, i) => e in t ? w(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, h = (t, e) => {
5
+ var p = (t, e, i) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, h = (t, e) => {
6
6
  for (var i in e || (e = {}))
7
- y.call(e, i) && g(t, i, e[i]);
8
- if (p)
9
- for (var i of p(e))
10
- R.call(e, i) && g(t, i, e[i]);
7
+ y.call(e, i) && p(t, i, e[i]);
8
+ if (g)
9
+ for (var i of g(e))
10
+ R.call(e, i) && p(t, i, e[i]);
11
11
  return t;
12
12
  }, d = (t, e) => b(t, C(e));
13
- import { DataClient as v } from "@telia-ace/knowledge-data-client";
14
- import { createEventSubscriber as x, extendComponent as D } from "@telia-ace/knowledge-widget-core";
15
- import { DataType as N } from "@telia-ace/knowledge-widget-types-grid";
13
+ import { DataClient as v, DataType as x } from "@telia-ace/knowledge-data-client";
14
+ import { createEventSubscriber as D, extendComponent as N } from "@telia-ace/knowledge-widget-core";
16
15
  import { createReactComponent as O } from "@telia-ace/knowledge-widget-ui";
17
16
  const P = (t) => {
18
- const { events: e } = t.get("$widget"), [i, u] = x(e);
17
+ const { events: e } = t.get("$widget"), [i, u] = D(e);
19
18
  return O(
20
19
  t,
21
20
  "notification-row",
@@ -43,9 +42,9 @@ const P = (t) => {
43
42
  notifications: []
44
43
  });
45
44
  let n = [];
46
- const { notifications: m, types: c = [] } = r.properties();
45
+ const { notifications: w, types: c = [] } = r.properties();
47
46
  return c.length ? (c.indexOf("top") > -1 && (n = n.concat(o)), c.indexOf("middle") > -1 && (n = n.concat(l)), c.indexOf("bottom") > -1 && (n = n.concat(f))) : n = o, r.actions.dispatch("fetched", {
48
- notifications: n.length ? n : m,
47
+ notifications: n.length ? n : w,
49
48
  loading: !1
50
49
  });
51
50
  }
@@ -58,9 +57,9 @@ const P = (t) => {
58
57
  u();
59
58
  };
60
59
  }
61
- ).then(() => D(t, "notification-row", (r) => {
60
+ ).then(() => N(t, "notification-row", (r) => {
62
61
  r.actions.watch("notification-row.fetch", (s, a) => v.getInstance(t).then(
63
- (o) => o.fetch(N.RowNotifications, {
62
+ (o) => o.fetch(x.RowNotifications, {
64
63
  categories: [
65
64
  s.params.guideCategory,
66
65
  s.params.contactCategory
@@ -74,8 +73,8 @@ const P = (t) => {
74
73
  })).then(() => {
75
74
  u();
76
75
  });
77
- }, T = P;
76
+ }, S = P;
78
77
  export {
79
- T as default
78
+ S as default
80
79
  };
81
80
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/notification-row-component.ts"],"sourcesContent":["import { DataClient } from '@telia-ace/knowledge-data-client';\nimport {\n createEventSubscriber,\n extendComponent,\n Notification,\n} from '@telia-ace/knowledge-widget-core';\nimport { DataType, NotificationResults } from '@telia-ace/knowledge-widget-types-grid';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container, Widget } from '@webprovisions/platform';\n\ntype NotificationType = 'top' | 'middle' | 'bottom';\nexport type NotificationRowComponentProps = {\n types: NotificationType[];\n allowPaging?: boolean;\n notifications?: Notification[]; // internal\n expandable?: boolean;\n pageNextAriaLabel?: string;\n pagePreviousAriaLabel?: string;\n closeAriaLabel?: string;\n expandAriaLabel?: string;\n};\n\ntype FetchResults = NotificationResults & { error: any };\n\nexport const NotificationRowComponent = (container: Container) => {\n const { events }: Widget = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(\n container,\n 'notification-row',\n import('./notification-row'),\n (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({\n ...component.properties<NotificationRowComponentProps>(),\n loading: true,\n error: undefined,\n notifications: [],\n });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create(\n 'fetch',\n ({\n error,\n topNotifications,\n bottomNotifications,\n middleNotifications,\n }: FetchResults) => {\n if (error) {\n return component.actions.dispatch('fetched', {\n error,\n loading: true,\n notifications: [],\n });\n }\n\n let newNotifications: Notification[] = [];\n const { notifications, types = [] } =\n component.properties<NotificationRowComponentProps>();\n if (types.length) {\n if (types.indexOf('top') > -1) {\n newNotifications = newNotifications.concat(topNotifications);\n }\n if (types.indexOf('middle') > -1) {\n newNotifications = newNotifications.concat(middleNotifications);\n }\n if (types.indexOf('bottom') > -1) {\n newNotifications = newNotifications.concat(bottomNotifications);\n }\n } else {\n newNotifications = topNotifications;\n }\n\n return component.actions.dispatch('fetched', {\n notifications: newNotifications.length ? newNotifications : notifications,\n loading: false,\n });\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\n subscribe('router:changed', (event: any, { current }: any) => {\n fetch(current.routeData.params);\n });\n\n return () => {\n unsubscribe();\n };\n }\n )\n .then(() => {\n return extendComponent(container, 'notification-row', (component) => {\n component.actions.watch('notification-row.fetch', (input, next) => {\n return DataClient.getInstance(container)\n .then((dataClient: DataClient) =>\n dataClient.fetch(DataType.RowNotifications, {\n categories: [\n input.params.guideCategory,\n input.params.contactCategory,\n ].filter((c) => !!c),\n searchPhrase: input.params.phrase,\n })\n )\n .then(next)\n .catch((error) => {\n if (error) {\n return next(error);\n }\n });\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default NotificationRowComponent;\n"],"names":["NotificationRowComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","__spreadProps","__spreadValues","error","topNotifications","bottomNotifications","middleNotifications","newNotifications","notifications","types","input","router","event","current","extendComponent","next","DataClient","dataClient","DataType","c","NotificationRowComponent$1"],"mappings":";;;;;;;;;;;;;;;;AAwBa,MAAAA,IAA2B,CAACC,MAAyB;AAC9D,QAAM,EAAE,QAAAC,EAAmB,IAAAD,EAAU,IAAI,SAAS,GAC5C,CAACE,GAAWC,CAAW,IAAIC,EAAsBH,CAAM;AAEtD,SAAAI;AAAA,IACHL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,CAACM,MAAc;AACL,YAAAC,IAAQ,CAACC,MAAmC;AAC9C,QAAAF,EAAU,gBAAgBG,EAAAC,EAAA,IACnBJ,EAAU,WAA0C,IADjC;AAAA,UAEtB,SAAS;AAAA,UACT,OAAO;AAAA,UACP,eAAe,CAAC;AAAA,QAAA,EACnB,GACDA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAE,EAAQ,CAAA;AAAA,MAAA;AAGlD,aAAAF,EAAU,QAAQ;AAAA,QACd;AAAA,QACA,CAAC;AAAA,UACG,OAAAK;AAAA,UACA,kBAAAC;AAAA,UACA,qBAAAC;AAAA,UACA,qBAAAC;AAAA,QAAA,MACgB;AAChB,cAAIH;AACO,mBAAAL,EAAU,QAAQ,SAAS,WAAW;AAAA,cACzC,OAAAK;AAAA,cACA,SAAS;AAAA,cACT,eAAe,CAAC;AAAA,YAAA,CACnB;AAGL,cAAII,IAAmC,CAAA;AACvC,gBAAM,EAAE,eAAAC,GAAe,OAAAC,IAAQ,CAAG,EAAA,IAC9BX,EAAU;AACd,iBAAIW,EAAM,UACFA,EAAM,QAAQ,KAAK,IAAI,OACJF,IAAAA,EAAiB,OAAOH,CAAgB,IAE3DK,EAAM,QAAQ,QAAQ,IAAI,OACPF,IAAAA,EAAiB,OAAOD,CAAmB,IAE9DG,EAAM,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-row-component.ts"],"sourcesContent":["import { DataClient, DataType, NotificationResults } from '@telia-ace/knowledge-data-client';\nimport {\n createEventSubscriber,\n extendComponent,\n Notification,\n} from '@telia-ace/knowledge-widget-core';\nimport { createReactComponent } from '@telia-ace/knowledge-widget-ui';\nimport { Container, Widget } from '@webprovisions/platform';\n\ntype NotificationType = 'top' | 'middle' | 'bottom';\nexport type NotificationRowComponentProps = {\n types: NotificationType[];\n allowPaging?: boolean;\n notifications?: Notification[]; // internal\n expandable?: boolean;\n pageNextAriaLabel?: string;\n pagePreviousAriaLabel?: string;\n closeAriaLabel?: string;\n expandAriaLabel?: string;\n};\n\ntype FetchResults = NotificationResults & { error: any };\n\nexport const NotificationRowComponent = (container: Container) => {\n const { events }: Widget = container.get('$widget');\n const [subscribe, unsubscribe] = createEventSubscriber(events);\n\n return createReactComponent(\n container,\n 'notification-row',\n import('./notification-row'),\n (component) => {\n const fetch = (params: { [key: string]: any }) => {\n component.writeProperties({\n ...component.properties<NotificationRowComponentProps>(),\n loading: true,\n error: undefined,\n notifications: [],\n });\n component.actions.dispatch('fetch', { params });\n };\n\n component.actions.create(\n 'fetch',\n ({\n error,\n topNotifications,\n bottomNotifications,\n middleNotifications,\n }: FetchResults) => {\n if (error) {\n return component.actions.dispatch('fetched', {\n error,\n loading: true,\n notifications: [],\n });\n }\n\n let newNotifications: Notification[] = [];\n const { notifications, types = [] } =\n component.properties<NotificationRowComponentProps>();\n if (types.length) {\n if (types.indexOf('top') > -1) {\n newNotifications = newNotifications.concat(topNotifications);\n }\n if (types.indexOf('middle') > -1) {\n newNotifications = newNotifications.concat(middleNotifications);\n }\n if (types.indexOf('bottom') > -1) {\n newNotifications = newNotifications.concat(bottomNotifications);\n }\n } else {\n newNotifications = topNotifications;\n }\n\n return component.actions.dispatch('fetched', {\n notifications: newNotifications.length ? newNotifications : notifications,\n loading: false,\n });\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\n subscribe('router:changed', (event: any, { current }: any) => {\n fetch(current.routeData.params);\n });\n\n return () => {\n unsubscribe();\n };\n }\n )\n .then(() => {\n return extendComponent(container, 'notification-row', (component) => {\n component.actions.watch('notification-row.fetch', (input, next) => {\n return DataClient.getInstance(container)\n .then((dataClient: DataClient) =>\n dataClient.fetch(DataType.RowNotifications, {\n categories: [\n input.params.guideCategory,\n input.params.contactCategory,\n ].filter((c) => !!c),\n searchPhrase: input.params.phrase,\n })\n )\n .then(next)\n .catch((error) => {\n if (error) {\n return next(error);\n }\n });\n });\n });\n })\n .then(() => {\n unsubscribe();\n });\n};\n\nexport default NotificationRowComponent;\n"],"names":["NotificationRowComponent","container","events","subscribe","unsubscribe","createEventSubscriber","createReactComponent","component","fetch","params","__spreadProps","__spreadValues","error","topNotifications","bottomNotifications","middleNotifications","newNotifications","notifications","types","input","router","event","current","extendComponent","next","DataClient","dataClient","DataType","c","NotificationRowComponent$1"],"mappings":";;;;;;;;;;;;;;;AAuBa,MAAAA,IAA2B,CAACC,MAAyB;AAC9D,QAAM,EAAE,QAAAC,EAAmB,IAAAD,EAAU,IAAI,SAAS,GAC5C,CAACE,GAAWC,CAAW,IAAIC,EAAsBH,CAAM;AAEtD,SAAAI;AAAA,IACHL;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,CAACM,MAAc;AACL,YAAAC,IAAQ,CAACC,MAAmC;AAC9C,QAAAF,EAAU,gBAAgBG,EAAAC,EAAA,IACnBJ,EAAU,WAA0C,IADjC;AAAA,UAEtB,SAAS;AAAA,UACT,OAAO;AAAA,UACP,eAAe,CAAC;AAAA,QAAA,EACnB,GACDA,EAAU,QAAQ,SAAS,SAAS,EAAE,QAAAE,EAAQ,CAAA;AAAA,MAAA;AAGlD,aAAAF,EAAU,QAAQ;AAAA,QACd;AAAA,QACA,CAAC;AAAA,UACG,OAAAK;AAAA,UACA,kBAAAC;AAAA,UACA,qBAAAC;AAA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,MACHA,EAAW,MAAMC,EAAS,kBAAkB;AAAA,QACxC,YAAY;AAAA,UACRR,EAAM,OAAO;AAAA,UACbA,EAAM,OAAO;AAAA,UACf,OAAO,CAACS,MAAM,CAAC,CAACA,CAAC;AAAA,QACnB,cAAcT,EAAM,OAAO;AAAA,MAAA,CAC9B;AAAA,MAEJ,KAAKK,CAAI,EACT,MAAM,CAACZ,MAAU;AACd,UAAIA;AACA,eAAOY,EAAKZ,CAAK;AAAA,IACrB,CACH,CACR;AAAA,EAAA,CACJ,CACJ,EACA,KAAK,MAAM;AACI,IAAAR;EAAA,CACf;AACT,GAEAyB,IAAe7B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/knowledge-widget-components-notification-row",
3
- "version": "1.0.39-next.5",
3
+ "version": "1.0.39",
4
4
  "description": "Notification row 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-next.1",
25
- "@telia-ace/knowledge-widget-core": "1.0.35-next.5",
26
- "@telia-ace/knowledge-widget-types-grid": "1.0.46-next.5",
27
- "@telia-ace/knowledge-widget-ui": "1.0.41-next.5",
28
- "@telia-ace/widget-services": "^1.0.21-next.0",
29
- "@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-services": "^1.0.21",
28
+ "@telia-ace/widget-utilities": "^1.0.10",
30
29
  "@webprovisions/platform": "^1.1.2"
31
30
  },
32
31
  "peerDependencies": {