@mx-cartographer/experiences 9.7.120 → 9.7.122

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,11 @@
1
+ ## [9.7.122] - 11-06-2026
2
+
3
+ - **FIXED** - A micro status icon whose colour is `primary.main` or a chart colour (`chart.chart1`–`chart.chart7`) draws its tile and glyph in that colour instead of the error red: Weekly New Merchants' money bag (chart-2) and Savings Account Balances Summary's bar chart (primary). Status colours and the error fallback are unchanged, and no other beat sends these colours (WEC-2236)
4
+
5
+ ## [9.7.121] - 11-06-2026
6
+
7
+ - **UPDATED** - Snyk dependency updates (WELL-155)
8
+
1
9
  ## [9.7.120] - 11-06-2026
2
10
 
3
11
  - **FIXED** - Merchantless Deposit Payroll paychecks are now eligible recurring income, so they can be added in the Add Income flow (MEW-4199)
@@ -1,3 +1,4 @@
1
+ import { Theme } from '@mui/material/styles';
1
2
  /**
2
3
  * The mx-icons name an `ICO-<name>` guid carries (`ICO-error` → `error`), or undefined for any other
3
4
  * guid, a malformed name, or a name mx-icons does not define — so a caller renders nothing rather
@@ -13,3 +14,11 @@ export type StatusIconPalette = 'error' | 'success' | 'warning';
13
14
  * break-out — is the error tint, the tile's original colour.
14
15
  */
15
16
  export declare const statusIconPalette: (color?: string | null) => StatusIconPalette;
17
+ /**
18
+ * The accent colour a status icon's `color` names when it is not a status palette: `primary.main` or a
19
+ * chart colour (`chart.chart2`), for an icon that isn't a status (Weekly New Merchants' money bag,
20
+ * Savings Account Balances Summary's bar chart). Undefined otherwise, so the tile keeps
21
+ * `statusIconPalette`'s status colours and its error fallback. Only these exact theme paths are
22
+ * accepted: the value is server data.
23
+ */
24
+ export declare const statusIconAccentColor: (palette: Theme["palette"], color?: string | null) => string | undefined;
@@ -1,15 +1,20 @@
1
- import { IconList as n } from "@mxenabled/mx-icons";
2
- var t = (r) => {
1
+ import { IconList as e } from "@mxenabled/mx-icons";
2
+ var s = (r) => {
3
3
  const a = /^ICO-([a-z0-9_]+)$/.exec(r ?? "")?.[1];
4
- return a && Object.hasOwn(n, a) ? a : void 0;
5
- }, e = {
4
+ return a && Object.hasOwn(e, a) ? a : void 0;
5
+ }, t = {
6
6
  "error.main": "error",
7
7
  "success.main": "success",
8
8
  "warning.main": "warning"
9
- }, c = (r) => r && Object.hasOwn(e, r) && e[r] || "error";
9
+ }, i = (r) => r && Object.hasOwn(t, r) && t[r] || "error", m = (r, a) => {
10
+ if (a === "primary.main") return r.primary.main;
11
+ const n = /^chart\.(chart[1-7])$/.exec(a ?? "")?.[1];
12
+ return n ? r.chart?.[n] : void 0;
13
+ };
10
14
  export {
11
- t as statusIconName,
12
- c as statusIconPalette
15
+ m as statusIconAccentColor,
16
+ s as statusIconName,
17
+ i as statusIconPalette
13
18
  };
14
19
 
15
20
  //# sourceMappingURL=statusIcon.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"statusIcon.es.js","names":[],"sources":["../../../src/insights-v2/components/statusIcon.ts"],"sourcesContent":["import { IconList } from '@mxenabled/mx-icons'\n\n/**\n * The mx-icons name an `ICO-<name>` guid carries (`ICO-error` → `error`), or undefined for any other\n * guid, a malformed name, or a name mx-icons does not define — so a caller renders nothing rather\n * than an empty box. ditto names a status icon this way where a block has no entity logo (account_block\n * `minimal`).\n */\nexport const statusIconName = (guid?: string | null): string | undefined => {\n const name = /^ICO-([a-z0-9_]+)$/.exec(guid ?? '')?.[1]\n\n // Own keys only: `in` would also accept inherited names such as `constructor`.\n return name && Object.hasOwn(IconList, name) ? name : undefined\n}\n\nexport type StatusIconPalette = 'error' | 'success' | 'warning'\n\nconst STATUS_PALETTES: Record<string, StatusIconPalette> = {\n 'error.main': 'error',\n 'success.main': 'success',\n 'warning.main': 'warning',\n}\n\n/**\n * The theme palette a status icon's `color` names (`success.main` → `success`), for the tinted tile\n * the micro card draws it in. The value is server data that becomes a palette key, so only these\n * three status palettes are accepted; anything else — another palette, a raw colour, a CSS\n * break-out — is the error tint, the tile's original colour.\n */\nexport const statusIconPalette = (color?: string | null): StatusIconPalette =>\n (color && Object.hasOwn(STATUS_PALETTES, color) && STATUS_PALETTES[color]) || 'error'\n"],"mappings":";AAQA,IAAa,IAAA,CAAkB,MAA6C;AAC1E,QAAM,IAAO,qBAAqB,KAAK,KAAQ,EAAE,IAAI,CAAA;AAGrD,SAAO,KAAQ,OAAO,OAAO,GAAU,CAAI,IAAI,IAAO;AACxD,GAIM,IAAqD;AAAA,EACzD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAClB,GAQa,IAAA,CAAqB,MAC/B,KAAS,OAAO,OAAO,GAAiB,CAAK,KAAK,EAAgB,CAAA,KAAW"}
1
+ {"version":3,"file":"statusIcon.es.js","names":[],"sources":["../../../src/insights-v2/components/statusIcon.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport { IconList } from '@mxenabled/mx-icons'\n\n/**\n * The mx-icons name an `ICO-<name>` guid carries (`ICO-error` → `error`), or undefined for any other\n * guid, a malformed name, or a name mx-icons does not define — so a caller renders nothing rather\n * than an empty box. ditto names a status icon this way where a block has no entity logo (account_block\n * `minimal`).\n */\nexport const statusIconName = (guid?: string | null): string | undefined => {\n const name = /^ICO-([a-z0-9_]+)$/.exec(guid ?? '')?.[1]\n\n // Own keys only: `in` would also accept inherited names such as `constructor`.\n return name && Object.hasOwn(IconList, name) ? name : undefined\n}\n\nexport type StatusIconPalette = 'error' | 'success' | 'warning'\n\nconst STATUS_PALETTES: Record<string, StatusIconPalette> = {\n 'error.main': 'error',\n 'success.main': 'success',\n 'warning.main': 'warning',\n}\n\n/**\n * The theme palette a status icon's `color` names (`success.main` → `success`), for the tinted tile\n * the micro card draws it in. The value is server data that becomes a palette key, so only these\n * three status palettes are accepted; anything else — another palette, a raw colour, a CSS\n * break-out — is the error tint, the tile's original colour.\n */\nexport const statusIconPalette = (color?: string | null): StatusIconPalette =>\n (color && Object.hasOwn(STATUS_PALETTES, color) && STATUS_PALETTES[color]) || 'error'\n\n/**\n * The accent colour a status icon's `color` names when it is not a status palette: `primary.main` or a\n * chart colour (`chart.chart2`), for an icon that isn't a status (Weekly New Merchants' money bag,\n * Savings Account Balances Summary's bar chart). Undefined otherwise, so the tile keeps\n * `statusIconPalette`'s status colours and its error fallback. Only these exact theme paths are\n * accepted: the value is server data.\n */\nexport const statusIconAccentColor = (\n palette: Theme['palette'],\n color?: string | null,\n): string | undefined => {\n if (color === 'primary.main') return palette.primary.main\n const chartKey = /^chart\\.(chart[1-7])$/.exec(color ?? '')?.[1] as\n | keyof Theme['palette']['chart']\n | undefined\n return chartKey ? palette.chart?.[chartKey] : undefined\n}\n"],"mappings":";AAUA,IAAa,IAAA,CAAkB,MAA6C;AAC1E,QAAM,IAAO,qBAAqB,KAAK,KAAQ,EAAE,IAAI,CAAA;AAGrD,SAAO,KAAQ,OAAO,OAAO,GAAU,CAAI,IAAI,IAAO;AACxD,GAIM,IAAqD;AAAA,EACzD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAClB,GAQa,IAAA,CAAqB,MAC/B,KAAS,OAAO,OAAO,GAAiB,CAAK,KAAK,EAAgB,CAAA,KAAW,SASnE,IAAA,CACX,GACA,MACuB;AACvB,MAAI,MAAU,eAAgB,QAAO,EAAQ,QAAQ;AACrD,QAAM,IAAW,wBAAwB,KAAK,KAAS,EAAE,IAAI,CAAA;AAG7D,SAAO,IAAW,EAAQ,QAAQ,CAAA,IAAY;AAChD"}
@@ -1,35 +1,35 @@
1
- import { GlobalDataContext as K } from "../../common/context/GlobalDataProvider.es.js";
2
- import { slot as I } from "../../core/types/Insights.es.js";
3
- import { resolveInsightRender as $ } from "../../insights-v2/resolveInsightRender.es.js";
4
- import { hasDrawerBlock as J } from "../../insights-v2/mappings/hasDrawerBlock.es.js";
5
- import Q from "../../insights-v2/components/LogoFromGuid.es.js";
6
- import { statusIconName as U, statusIconPalette as X } from "../../insights-v2/components/statusIcon.es.js";
7
- import { ON_CLICK_EVENT as W, ON_VIEW_EVENT as Y, ON_VIEW_FIRST_TIME_EVENT as Z } from "../constants/Analytics.es.js";
1
+ import { GlobalDataContext as $ } from "../../common/context/GlobalDataProvider.es.js";
2
+ import { slot as y } from "../../core/types/Insights.es.js";
3
+ import { resolveInsightRender as J } from "../../insights-v2/resolveInsightRender.es.js";
4
+ import { hasDrawerBlock as Q } from "../../insights-v2/mappings/hasDrawerBlock.es.js";
5
+ import U from "../../insights-v2/components/LogoFromGuid.es.js";
6
+ import { statusIconAccentColor as X, statusIconName as Y, statusIconPalette as Z } from "../../insights-v2/components/statusIcon.es.js";
7
+ import { ON_CLICK_EVENT as A, ON_VIEW_EVENT as b, ON_VIEW_FIRST_TIME_EVENT as ii } from "../constants/Analytics.es.js";
8
8
  import F from "../beaticons/BeatMaterialIcon.es.js";
9
- import { BeatIcon as b } from "../beaticons/BeatIcon.es.js";
10
- import { useCopyStore as ii, useEvent as ti, useInsightsMicroWidgetStore as ei } from "../context/hooks.es.js";
11
- import { microCardMinWidth as oi } from "../utils/cardWidth.es.js";
9
+ import { BeatIcon as ti } from "../beaticons/BeatIcon.es.js";
10
+ import { useCopyStore as ei, useEvent as oi, useInsightsMicroWidgetStore as ri } from "../context/hooks.es.js";
11
+ import { microCardMinWidth as ni } from "../utils/cardWidth.es.js";
12
12
  import O from "../MicroCardTemplate.es.js";
13
- import ri from "./InlineActionBlock.es.js";
14
- import { MicroCtaStatusGate as ni } from "./MicroCtaStatus.es.js";
15
- import si from "../../insights-v2/components/InsightErrorCard.es.js";
16
- import mi, { useEffect as S, useState as ci } from "react";
17
- import { Fragment as ai, jsx as e, jsxs as li } from "react/jsx-runtime";
18
- import { alpha as G, useTheme as _i } from "@mui/material/styles";
19
- import pi from "@mui/material/Box";
20
- import { useInView as di } from "react-intersection-observer";
21
- var Fi = ({ ariaLabel: d, beat: i, elevation: y, inDescriptionCtaBehavior: q = "external", index: s, isActiveCard: u, onCardClick: m, posthog: r, widthOverrides: g, variant: C, showIcon: v, heightOverrides: f }) => {
22
- const { ref: h, inView: c } = di({ threshold: 1 }), E = _i(), { cardsCopy: A } = ii(), { onEvent: a } = ti(), { updateBeat: D, updateOffer: j } = ei(), l = "is_insights_v2" in i && i.is_insights_v2, _ = l ? { metadata: { is_insights_v2: !0 } } : void 0;
13
+ import si from "./InlineActionBlock.es.js";
14
+ import { MicroCtaStatusGate as ci } from "./MicroCtaStatus.es.js";
15
+ import li from "../../insights-v2/components/InsightErrorCard.es.js";
16
+ import ai, { useEffect as S, useState as mi } from "react";
17
+ import { Fragment as pi, jsx as e, jsxs as _i } from "react/jsx-runtime";
18
+ import { alpha as G, useTheme as di } from "@mui/material/styles";
19
+ import ui from "@mui/material/Box";
20
+ import { useInView as gi } from "react-intersection-observer";
21
+ var Oi = ({ ariaLabel: u, beat: i, elevation: E, inDescriptionCtaBehavior: q = "external", index: s, isActiveCard: g, onCardClick: c, posthog: r, widthOverrides: f, variant: k, showIcon: x, heightOverrides: h }) => {
22
+ const { ref: I, inView: l } = gi({ threshold: 1 }), C = di(), { cardsCopy: D } = ei(), { onEvent: a } = oi(), { updateBeat: j, updateOffer: L } = ri(), m = "is_insights_v2" in i && i.is_insights_v2, p = m ? { metadata: { is_insights_v2: !0 } } : void 0;
23
23
  S(() => {
24
- c && (i.has_been_displayed ? a(Y(i.template), _) : (i.guid.startsWith("OFR") ? j({
24
+ l && (i.has_been_displayed ? a(b(i.template), p) : (i.guid.startsWith("OFR") ? L({
25
25
  ...i,
26
26
  has_been_displayed: !0
27
- }) : D({
27
+ }) : j({
28
28
  ...i,
29
29
  has_been_displayed: !0
30
- }), a(Z(i.template), _)));
31
- }, [c]), S(() => {
32
- if (c && i) if (i.template === "MarketingOffer") {
30
+ }), a(ii(i.template), p)));
31
+ }, [l]), S(() => {
32
+ if (l && i) if (i.template === "MarketingOffer") {
33
33
  const t = i;
34
34
  r?.capture("viewed_messaging_insight", {
35
35
  template: i.template,
@@ -42,15 +42,15 @@ var Fi = ({ ariaLabel: d, beat: i, elevation: y, inDescriptionCtaBehavior: q = "
42
42
  beat_guid: i.guid,
43
43
  template: i.template,
44
44
  position: s,
45
- ...l && { is_insights_v2: !0 }
45
+ ...m && { is_insights_v2: !0 }
46
46
  });
47
47
  }, [
48
48
  i,
49
49
  s,
50
- c
50
+ l
51
51
  ]);
52
- const k = $(i), o = k === "v2" ? i.insights_payload : void 0, L = mi.useContext(K) !== null, T = q === "internal" && L && J(o?.in_description_cta?.block), [V, z] = ci(0), p = () => {
53
- if (T ? z((t) => t + 1) : m && m(i), a(W(i.template), _), i.template === "MarketingOffer") {
52
+ const T = J(i), o = T === "v2" ? i.insights_payload : void 0, z = ai.useContext($) !== null, V = q === "internal" && z && Q(o?.in_description_cta?.block), [B, H] = mi(0), _ = () => {
53
+ if (V ? H((t) => t + 1) : c && c(i), a(A(i.template), p), i.template === "MarketingOffer") {
54
54
  const t = i;
55
55
  r?.capture("clicked_messaging_insight", {
56
56
  template: i.template,
@@ -63,84 +63,85 @@ var Fi = ({ ariaLabel: d, beat: i, elevation: y, inDescriptionCtaBehavior: q = "
63
63
  beat_guid: i.guid,
64
64
  template: i.template,
65
65
  position: s,
66
- ...l && { is_insights_v2: !0 }
66
+ ...m && { is_insights_v2: !0 }
67
67
  });
68
68
  };
69
- return k === "error" ? /* @__PURE__ */ e(pi, {
70
- "aria-hidden": !u,
71
- "aria-label": d,
69
+ return T === "error" ? /* @__PURE__ */ e(ui, {
70
+ "aria-hidden": !g,
71
+ "aria-label": u,
72
72
  "aria-roledescription": "slide",
73
- ref: h,
73
+ ref: I,
74
74
  role: "group",
75
75
  sx: {
76
- height: f ? "100%" : 120,
77
- minWidth: oi(g),
76
+ height: h ? "100%" : 120,
77
+ minWidth: ni(f),
78
78
  my: 1
79
79
  },
80
- children: /* @__PURE__ */ e(si, { beat: i })
81
- }) : o ? /* @__PURE__ */ e(ni, {
80
+ children: /* @__PURE__ */ e(li, { beat: i })
81
+ }) : o ? /* @__PURE__ */ e(ci, {
82
82
  beat: i,
83
83
  posthog: r,
84
84
  children: ({ presentation: n }) => {
85
- const x = n?.kind === "status" ? n : void 0, B = I(o.instance_slot.data, "logo"), M = I(o.instance_slot.data, x && I(o.instance_slot.data, "reviewed_icon") ? "reviewed_icon" : "icon"), N = U(M?.guid), R = X(M?.color), H = n ? x?.action?.label : o.primary_cta?.label || o.in_description_cta?.label || void 0, w = () => {
86
- m && m(i), a(W(i.template), _), r?.capture("clicked_insight", {
85
+ const M = n?.kind === "status" ? n : void 0, N = y(o.instance_slot.data, "logo"), v = y(o.instance_slot.data, M && y(o.instance_slot.data, "reviewed_icon") ? "reviewed_icon" : "icon"), R = Y(v?.guid), w = Z(v?.color), d = X(C.palette, v?.color), K = n ? M?.action?.label : o.primary_cta?.label || o.in_description_cta?.label || void 0, P = () => {
86
+ c && c(i), a(A(i.template), p), r?.capture("clicked_insight", {
87
87
  beat_guid: i.guid,
88
88
  template: i.template,
89
89
  position: s,
90
- ...l && { is_insights_v2: !0 }
90
+ ...m && { is_insights_v2: !0 }
91
91
  });
92
- }, P = /* @__PURE__ */ e(O, {
92
+ }, W = /* @__PURE__ */ e(O, {
93
93
  "aria-roledescription": "slide",
94
- ariaLabel: d,
94
+ ariaLabel: u,
95
95
  description: o.description.html_text,
96
- elevation: y,
97
- heightOverrides: f,
98
- icon: v && (B ? /* @__PURE__ */ e(Q, {
99
- logo: B,
96
+ elevation: E,
97
+ heightOverrides: h,
98
+ icon: x && (N ? /* @__PURE__ */ e(U, {
99
+ logo: N,
100
100
  size: 32
101
- }) : N ? /* @__PURE__ */ e(F, {
102
- bgColor: G(E.palette[R].main, 0.15),
103
- iconColor: R,
104
- name: N
101
+ }) : R ? /* @__PURE__ */ e(F, {
102
+ bgColor: G(d ?? C.palette[w].main, 0.15),
103
+ iconColor: d ? "inherit" : w,
104
+ name: R,
105
+ sx: d ? { color: d } : void 0
105
106
  }) : /* @__PURE__ */ e(F, {
106
- bgColor: G(E.palette.primary.main, 0.15),
107
+ bgColor: G(C.palette.primary.main, 0.15),
107
108
  name: "lightbulb"
108
109
  })),
109
- isActiveCard: u,
110
+ isActiveCard: g,
110
111
  isInsightsV2: !0,
111
- onCardClick: n ? w : p,
112
- onPrimaryAction: n ? w : p,
113
- primaryActionText: H,
114
- ref: h,
112
+ onCardClick: n ? P : _,
113
+ onPrimaryAction: n ? P : _,
114
+ primaryActionText: K,
115
+ ref: I,
115
116
  title: n?.title || o.title || "",
116
- variant: C,
117
- widthOverrides: g
117
+ variant: k,
118
+ widthOverrides: f
118
119
  });
119
- return T ? /* @__PURE__ */ li(ai, { children: [P, V > 0 && /* @__PURE__ */ e(ri, {
120
+ return V ? /* @__PURE__ */ _i(pi, { children: [W, B > 0 && /* @__PURE__ */ e(si, {
120
121
  beat: i,
121
- openRequest: V,
122
+ openRequest: B,
122
123
  posthog: r
123
- })] }) : P;
124
+ })] }) : W;
124
125
  }
125
126
  }) : /* @__PURE__ */ e(O, {
126
127
  "aria-roledescription": "slide",
127
- ariaLabel: d,
128
+ ariaLabel: u,
128
129
  description: i?.html_micro_description && i?.html_micro_description.length > 0 ? i.html_micro_description : i.html_description || "",
129
- elevation: y,
130
- heightOverrides: f,
131
- icon: v && /* @__PURE__ */ e(b, { beat: i }),
132
- isActiveCard: u,
133
- onCardClick: p,
134
- onPrimaryAction: p,
135
- primaryActionText: i.micro_call_to_action || A?.micro_card_cta,
136
- ref: h,
130
+ elevation: E,
131
+ heightOverrides: h,
132
+ icon: x && /* @__PURE__ */ e(ti, { beat: i }),
133
+ isActiveCard: g,
134
+ onCardClick: _,
135
+ onPrimaryAction: _,
136
+ primaryActionText: i.micro_call_to_action || D?.micro_card_cta,
137
+ ref: I,
137
138
  title: i.micro_title && i.micro_title.length > 0 ? i.micro_title : i.title,
138
- variant: C,
139
- widthOverrides: g
139
+ variant: k,
140
+ widthOverrides: f
140
141
  });
141
142
  };
142
143
  export {
143
- Fi as InsightCard
144
+ Oi as InsightCard
144
145
  };
145
146
 
146
147
  //# sourceMappingURL=InsightCard.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport type { LogoRef } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid from '../../insights-v2/components/LogoFromGuid'\nimport { statusIconName, statusIconPalette } from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no row logo may name a status icon instead (account_block `minimal`: `ICO-error`),\n // drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const rowLogo = slot<LogoRef>(v2Payload.instance_slot.data, 'logo')\n const statusIcon = slot<LogoRef>(\n v2Payload.instance_slot.data,\n answered && slot<LogoRef>(v2Payload.instance_slot.data, 'reviewed_icon')\n ? 'reviewed_icon'\n : 'icon',\n )\n const statusName = statusIconName(statusIcon?.guid)\n const statusPalette = statusIconPalette(statusIcon?.color)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (rowLogo ? (\n <LogoFromGuid logo={rowLogo} size={ICON_SIZE} />\n ) : statusName ? (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette[statusPalette].main, 0.15)}\n iconColor={statusPalette}\n name={statusName}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwCA,IAAa,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,GACA,SAAA,GACA,gBAAA,GACA,SAAA,GACA,UAAA,GACA,iBAAA,EAAA,MACI;AACJ,QAAM,EAAE,KAAA,GAAK,QAAA,EAAA,IAAW,GAAU,EAChC,WAAA,EACF,CAAC,GAEK,IAAQ,GAAS,GAGjB,EAAE,WAAA,EAAA,IAAc,GAAa,GAC7B,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,YAAA,GAAY,aAAA,EAAA,IAAgB,GAA4B,GAE1D,IAAO,oBAAoB,KAAQ,EAAK,gBACxC,IAAa,IAAO,EAAE,UAAU,EAAE,gBAAgB,GAAK,EAAE,IAAI;AAGnE,EAAA,EAAA,MAAgB;AACd,IAAI,MACG,EAAK,qBAcR,EAAQ,E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AAA,IACjB,MAAM,KAAY,gBAAA,EAAC,GAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
1
+ {"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport type { LogoRef } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid from '../../insights-v2/components/LogoFromGuid'\nimport {\n statusIconAccentColor,\n statusIconName,\n statusIconPalette,\n} from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no row logo may name a status icon instead (account_block `minimal`: `ICO-error`),\n // drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const rowLogo = slot<LogoRef>(v2Payload.instance_slot.data, 'logo')\n const statusIcon = slot<LogoRef>(\n v2Payload.instance_slot.data,\n answered && slot<LogoRef>(v2Payload.instance_slot.data, 'reviewed_icon')\n ? 'reviewed_icon'\n : 'icon',\n )\n const statusName = statusIconName(statusIcon?.guid)\n const statusPalette = statusIconPalette(statusIcon?.color)\n // A non-status icon (`primary.main`, `chart.*`) tints the tile in its own colour.\n const statusAccent = statusIconAccentColor(theme.palette, statusIcon?.color)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (rowLogo ? (\n <LogoFromGuid logo={rowLogo} size={ICON_SIZE} />\n ) : statusName ? (\n <BeatMaterialIcon\n bgColor={alpha(statusAccent ?? theme.palette[statusPalette].main, 0.15)}\n iconColor={statusAccent ? 'inherit' : statusPalette}\n name={statusName}\n sx={statusAccent ? { color: statusAccent } : undefined}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,IAAa,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,G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AC9C,iBAAiB,IAAe,IAAkB;AAAA,QAClD,mBAAmB;AAAA,QACd,KAAA;AAAA,QACL,OAAO,GAAc,SAAS,EAAU,SAAS;AAAA,QACxC,SAAA;AAAA,QACO,gBAAA;AAAA,MACjB,CAAA;AAGH,aAAK,IAGH,gBAAA,GAAA,IAAA,EAAA,UAAA,CACG,GAEA,IAAoB,KACnB,gBAAA,EAAC,IAAD;AAAA,QACQ,MAAA;AAAA,QACN,aAAa;AAAA,QACJ,SAAA;AAAA,MACV,CAAA,CAEH,EAAA,CAAA,IAbqB;AAAA,IAe3B;AAAA,EAKsB,CAAA,IAKtB,gBAAA,EAAC,GAAD;AAAA,IACE,wBAAqB;AAAA,IACV,WAAA;AAAA,IACX,aACE,GAAM,0BAA0B,GAAM,uBAAuB,SAAS,IAClE,EAAK,yBACL,EAAK,oBAAoB;AAAA,IAEpB,WAAA;AAAA,IACM,iBAAA;AAAA,IACjB,MAAM,KAAY,gBAAA,EAAC,IAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.7.120",
3
+ "version": "9.7.122",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -219,7 +219,7 @@
219
219
  "@mxenabled/mx-icons": "^2.3.0",
220
220
  "@mxenabled/mxui": "^2.13.0",
221
221
  "@mxenabled/web-widget-sdk": "^0.0.15",
222
- "@tanstack/react-virtual": "^3.14.9",
222
+ "@tanstack/react-virtual": "^3.14.14",
223
223
  "bowser": "^2.14.1",
224
224
  "d3": "^7.9.0",
225
225
  "d3-force": "^3.0.0",
@@ -228,12 +228,12 @@
228
228
  "mobx": "^6.16.1",
229
229
  "mobx-react-lite": "^4.1.1",
230
230
  "numeral": "^2.0.6",
231
- "posthog-js": "^1.409.5",
231
+ "posthog-js": "^1.438.7",
232
232
  "react": "^19",
233
233
  "react-confetti": "^6.4.0",
234
234
  "react-dom": "^19",
235
235
  "react-intersection-observer": "^10.1.0",
236
- "uuid": "^14.0.1"
236
+ "uuid": "^14.0.3"
237
237
  },
238
238
  "devDependencies": {
239
239
  "@babel/core": "^7.29.7",