@mx-cartographer/experiences 7.2.17 → 7.2.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [7.2.18] - 12-02-2025
2
+
3
+ - **UPDATED** - Insights app bell icon has_been_viewed fixed
4
+
1
5
  ## [7.2.17] - 12-01-2025
2
6
 
3
7
  - **ADDED** - Load time tracking for full standalone widgets
@@ -1,30 +1,30 @@
1
1
  import { makeAutoObservable as c, observable as f, runInAction as h } from "mobx";
2
2
  import { fromUnixTime as o, isSameDay as d } from "date-fns";
3
- import { F as l, A as n } from "./Fetch-87LIQbEA.mjs";
3
+ import { F as l, A as a } from "./Fetch-87LIQbEA.mjs";
4
4
  class s {
5
5
  fetchInstance;
6
- constructor(t, i, a) {
7
- this.fetchInstance = new l(t, i, void 0, a);
6
+ constructor(t, i, n) {
7
+ this.fetchInstance = new l(t, i, void 0, n);
8
8
  }
9
- getNotifications = () => this.fetchInstance.get(n.NOTIFICATIONS).then(
9
+ getNotifications = () => this.fetchInstance.get(a.NOTIFICATIONS).then(
10
10
  (t) => t.notifications.map((i) => i.notification)
11
11
  ).finally();
12
- updateNotification = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/${t.guid}`, {
12
+ updateNotification = (t) => this.fetchInstance.put(`${a.NOTIFICATIONS}/${t.guid}`, {
13
13
  guid: t.guid,
14
14
  has_been_viewed: t.has_been_viewed
15
15
  }).then((i) => i.notification).finally();
16
16
  // Note: The notifications/mark_all_as_viewed endpoint is broken, but still returns 202.
17
17
  // A bug ticket has been filed to fix it, but should not require any changes here.
18
- markAllAsViewed = (t) => this.fetchInstance.put(`${n.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
18
+ markAllAsViewed = (t) => this.fetchInstance.put(`${a.NOTIFICATIONS}/mark_all_as_viewed`, { channel: t }).finally();
19
19
  }
20
20
  const w = (e, t) => {
21
- const i = o(t[e].delivered_at), a = o(t[e - 1]?.delivered_at);
22
- return !d(i, a);
21
+ const i = o(t[e].delivered_at), n = o(t[e - 1]?.delivered_at);
22
+ return !d(i, n);
23
23
  };
24
24
  function u(e) {
25
25
  const i = Math.floor(Date.now() / 1e3);
26
- return e.filter((a) => {
27
- const r = a.delivered_at;
26
+ return e.filter((n) => {
27
+ const r = n.delivered_at;
28
28
  return i - r <= 604800;
29
29
  });
30
30
  }
@@ -57,7 +57,7 @@ class A {
57
57
  }
58
58
  };
59
59
  markAllAsViewed = async () => {
60
- this.notifications.forEach((t) => t.has_been_viewed = !0), await this.api.markAllAsViewed(), await this.loadNotifications();
60
+ this.notifications.forEach((t) => t.has_been_viewed = !0), await this.api.markAllAsViewed();
61
61
  };
62
62
  updateNotification = async (t) => {
63
63
  t.has_been_viewed = !0, await this.api.updateNotification(t);
@@ -4,8 +4,8 @@ import { F as S, A as h } from "../Fetch-87LIQbEA.mjs";
4
4
  import { B as is } from "../BeatApi-DhJpgCLz.mjs";
5
5
  import { C as et } from "../CategoryStore-BCcpI3oJ.mjs";
6
6
  import { a as ds } from "../CategoryStore-BCcpI3oJ.mjs";
7
- import { N as st } from "../NotificationStore-C6PH6MKm.mjs";
8
- import { a as us } from "../NotificationStore-C6PH6MKm.mjs";
7
+ import { N as st } from "../NotificationStore-86g0bKKR.mjs";
8
+ import { a as us } from "../NotificationStore-86g0bKKR.mjs";
9
9
  import { T as rt } from "../User-BQUxBeZV.mjs";
10
10
  import { C as gs, b as ps, L as ms, a as _s } from "../User-BQUxBeZV.mjs";
11
11
  import { H as ot } from "../Help-DhcC-C05.mjs";
@@ -1,7 +1,7 @@
1
1
  import { A as f, B as b } from "../ToggleListItem-r0Kx56wF.mjs";
2
2
  import { A as _ } from "../Fetch-87LIQbEA.mjs";
3
- import { s as L } from "../NotificationStore-C6PH6MKm.mjs";
4
- import { N as Nt, f as St } from "../NotificationStore-C6PH6MKm.mjs";
3
+ import { s as L } from "../NotificationStore-86g0bKKR.mjs";
4
+ import { N as Nt, f as St } from "../NotificationStore-86g0bKKR.mjs";
5
5
  import { jsx as t, jsxs as d, Fragment as x } from "react/jsx-runtime";
6
6
  import k, { useEffect as A } from "react";
7
7
  import { observer as p } from "mobx-react-lite";
@@ -19,8 +19,8 @@ import { L as w } from "../Loader-DUaFpDGv.mjs";
19
19
  import $ from "@mui/material/IconButton";
20
20
  import { N as H } from "../NotificationSettings-5i3IywCi.mjs";
21
21
  import { D as C } from "../Drawer-kEE73B87.mjs";
22
- const yt = (e) => {
23
- switch (e) {
22
+ const yt = (i) => {
23
+ switch (i) {
24
24
  case b.BudgetExceeded:
25
25
  case b.BudgetOffTarget:
26
26
  return _.BUDGETS;
@@ -35,8 +35,8 @@ const yt = (e) => {
35
35
  default:
36
36
  return null;
37
37
  }
38
- }, M = ({ date: e }) => /* @__PURE__ */ t(y, { sx: { display: "flex", justifyContent: "center", mt: 12, py: 8 }, children: /* @__PURE__ */ t(m, { bold: !0, variant: "Small", children: I(e) }) }), V = ({ notification: e }) => {
39
- const { accounts: o } = E(), { budgets: a } = j(), { accounts: s } = g(), i = o.find((l) => l.guid === e.entity_guid), r = a.find((l) => l.guid === e.entity_guid), u = e.entity_guid.includes("GOL"), c = {
38
+ }, M = ({ date: i }) => /* @__PURE__ */ t(y, { sx: { display: "flex", justifyContent: "center", mt: 12, py: 8 }, children: /* @__PURE__ */ t(m, { bold: !0, variant: "Small", children: I(i) }) }), V = ({ notification: i }) => {
39
+ const { accounts: o } = E(), { budgets: s } = j(), { accounts: a } = g(), e = o.find((l) => l.guid === i.entity_guid), r = s.find((l) => l.guid === i.entity_guid), u = i.entity_guid.includes("GOL"), c = {
40
40
  badge: {
41
41
  display: "flex",
42
42
  alignItems: "center",
@@ -45,16 +45,16 @@ const yt = (e) => {
45
45
  marginRight: 12
46
46
  }
47
47
  };
48
- return i || u ? /* @__PURE__ */ t("div", { style: c.badge, children: /* @__PURE__ */ t(
48
+ return e || u ? /* @__PURE__ */ t("div", { style: c.badge, children: /* @__PURE__ */ t(
49
49
  T,
50
50
  {
51
- alt: i?.institutionName || s.institution_logo_alt,
52
- institutionGuid: i?.institution_guid ?? "",
51
+ alt: e?.institutionName || a.institution_logo_alt,
52
+ institutionGuid: e?.institution_guid ?? "",
53
53
  size: 33
54
54
  }
55
55
  ) }) : /* @__PURE__ */ t("div", { style: c.badge, children: /* @__PURE__ */ t(R, { categoryGuid: r?.category_guid, size: 36 }) });
56
- }, X = p(V), Y = ({ notification: e, onClick: o }) => {
57
- const { updateNotification: a } = N(), s = O(), i = {
56
+ }, X = p(V), Y = ({ notification: i, onClick: o }) => {
57
+ const { updateNotification: s } = N(), a = O(), e = {
58
58
  card: {
59
59
  alignItems: "center",
60
60
  cursor: "pointer",
@@ -63,14 +63,14 @@ const yt = (e) => {
63
63
  paddingX: 24,
64
64
  paddingY: 12,
65
65
  "&:focus": {
66
- backgroundColor: s.palette.background.default
66
+ backgroundColor: a.palette.background.default
67
67
  },
68
68
  "&:hover": {
69
- backgroundColor: s.palette.background.default
69
+ backgroundColor: a.palette.background.default
70
70
  }
71
71
  },
72
72
  dot: {
73
- backgroundColor: s.palette.primary.main,
73
+ backgroundColor: a.palette.primary.main,
74
74
  borderRadius: "100%",
75
75
  flex: "0 0 auto",
76
76
  marginLeft: -8,
@@ -80,14 +80,14 @@ const yt = (e) => {
80
80
  }
81
81
  };
82
82
  return /* @__PURE__ */ d(G, { onClick: () => {
83
- o(e), a({ ...e, has_been_viewed: !0 }).finally();
84
- }, sx: i.card, children: [
85
- e.has_been_viewed ? null : /* @__PURE__ */ t("div", { "data-testid": "new-message-dot", style: i.dot }),
86
- /* @__PURE__ */ t(X, { notification: e }),
87
- /* @__PURE__ */ t(m, { bold: !e.has_been_viewed, truncate: !1, variant: "Small", children: e.content })
83
+ o(i), s({ ...i, has_been_viewed: !0 }).finally();
84
+ }, sx: e.card, children: [
85
+ i.has_been_viewed ? null : /* @__PURE__ */ t("div", { "data-testid": "new-message-dot", style: e.dot }),
86
+ /* @__PURE__ */ t(X, { notification: i }),
87
+ /* @__PURE__ */ t(m, { bold: !i.has_been_viewed, truncate: !1, variant: "Small", children: i.content })
88
88
  ] });
89
89
  }, q = p(
90
- ({ onManageNotifications: e }) => {
90
+ ({ onManageNotifications: i }) => {
91
91
  const { notifications: o } = g();
92
92
  return /* @__PURE__ */ d(W, { sx: { alignItems: "center", height: "95%", justifyContent: "center" }, children: [
93
93
  /* @__PURE__ */ t(U, { name: "notifications", size: 32 }),
@@ -106,20 +106,20 @@ const yt = (e) => {
106
106
  children: o.notification_empty_state.notification_description
107
107
  }
108
108
  ),
109
- /* @__PURE__ */ t(P, { onClick: e, sx: { p: "12px 16px" }, variant: "outlined", children: o.notification_empty_state.manage_notifications })
109
+ /* @__PURE__ */ t(P, { onClick: i, sx: { p: "12px 16px" }, variant: "outlined", children: o.notification_empty_state.manage_notifications })
110
110
  ] });
111
111
  }
112
- ), J = ({ onClick: e, onManageNotifications: o }) => {
113
- const { isLoading: a, loadNotifications: s, recentNotifications: i, markAllAsViewed: r } = N(), { notifications: u } = g(), { isCopyLoaded: c } = S(), l = (n) => {
114
- e?.(n);
112
+ ), J = ({ onClick: i, onManageNotifications: o }) => {
113
+ const { isLoading: s, loadNotifications: a, newNotifications: e, markAllAsViewed: r } = N(), { notifications: u } = g(), { isCopyLoaded: c } = S(), l = (n) => {
114
+ i?.(n);
115
115
  };
116
- return A(() => (s().finally(), () => {
117
- r().finally();
118
- }), []), /* @__PURE__ */ d(x, { children: [
119
- (!c || a) && /* @__PURE__ */ t(w, { label: u?.loading, size: 40 }),
120
- c && !a && i.length === 0 && /* @__PURE__ */ t(q, { onManageNotifications: o }),
121
- /* @__PURE__ */ t(B, { sx: { p: 16 }, children: c && !a && i.slice().sort((n, h) => h.delivered_at - n.delivered_at).map((n, h) => {
122
- const v = L(h, i);
116
+ return A(() => {
117
+ a().finally(), r().finally();
118
+ }, [a, r]), /* @__PURE__ */ d(x, { children: [
119
+ (!c || s) && /* @__PURE__ */ t(w, { label: u?.loading, size: 40 }),
120
+ c && !s && e.length === 0 && /* @__PURE__ */ t(q, { onManageNotifications: o }),
121
+ /* @__PURE__ */ t(B, { sx: { p: 16 }, children: c && !s && e.slice().sort((n, h) => h.delivered_at - n.delivered_at).map((n, h) => {
122
+ const v = L(h, e);
123
123
  return /* @__PURE__ */ d(y, { sx: { mb: 12 }, children: [
124
124
  v && /* @__PURE__ */ d(y, { sx: { mb: 12 }, children: [
125
125
  /* @__PURE__ */ t(M, { date: n.delivered_at }),
@@ -130,15 +130,15 @@ const yt = (e) => {
130
130
  }) })
131
131
  ] });
132
132
  }, K = p(J), bt = p(
133
- ({ notificationTypes: e, isOpen: o, onClose: a, onNotificationClick: s }) => {
134
- const { config: i } = z(), { notifications: r, settings: u } = g(), { isCopyLoaded: c } = S(), [l, n] = k.useState(!1);
133
+ ({ notificationTypes: i, isOpen: o, onClose: s, onNotificationClick: a }) => {
134
+ const { config: e } = z(), { notifications: r, settings: u } = g(), { isCopyLoaded: c } = S(), [l, n] = k.useState(!1);
135
135
  return c ? /* @__PURE__ */ d(x, { children: [
136
136
  /* @__PURE__ */ d(
137
137
  C,
138
138
  {
139
139
  ariaLabelClose: r.close_notifications,
140
140
  isOpen: o,
141
- onClose: a,
141
+ onClose: s,
142
142
  title: r.notifications_title,
143
143
  children: [
144
144
  /* @__PURE__ */ t(
@@ -157,7 +157,7 @@ const yt = (e) => {
157
157
  /* @__PURE__ */ t(
158
158
  K,
159
159
  {
160
- onClick: s,
160
+ onClick: a,
161
161
  onManageNotifications: () => n(!0)
162
162
  }
163
163
  )
@@ -174,8 +174,8 @@ const yt = (e) => {
174
174
  children: /* @__PURE__ */ t(
175
175
  H,
176
176
  {
177
- notificationTypes: e,
178
- showPersonalDetails: !i.display_user_profile_in_settings
177
+ notificationTypes: i,
178
+ showPersonalDetails: !e.display_user_profile_in_settings
179
179
  }
180
180
  )
181
181
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.2.17",
3
+ "version": "7.2.18",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",