@mx-cartographer/experiences 9.7.199 → 9.7.200
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 +6 -0
- package/dist/insights-v2/components/BaseLayout.es.js +39 -39
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/statusIcon.d.ts +5 -5
- package/dist/insights-v2/components/statusIcon.es.js +7 -6
- package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [9.7.200] - 11-23-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Account Discoverability Change sample cards, story and contract test (WELL-223)
|
|
4
|
+
- **FIXED** - Block-less insight cards no longer double the gap between the header and description (WELL-223)
|
|
5
|
+
- **CHANGED** - Micro insight status icon accepts action.active for a neutral grey tile (WELL-223)
|
|
6
|
+
|
|
1
7
|
## [9.7.199] - 11-20-2026
|
|
2
8
|
|
|
3
9
|
- **ADDED** - Monthly Spend to Income Comparison V2 Storybook QA page with every size and state (WEC-2101)
|
|
@@ -23,12 +23,12 @@ import { ObsolesceBanner as Bo } from "./ObsolesceBanner.es.js";
|
|
|
23
23
|
import { useBeatFeedbackFlow as Do } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
24
24
|
import { useEffect as Oo, useMemo as Io } from "react";
|
|
25
25
|
import { observer as Eo } from "mobx-react-lite";
|
|
26
|
-
import
|
|
26
|
+
import w from "@mui/material/Stack";
|
|
27
27
|
import { P as Fo } from "@mxenabled/mxui";
|
|
28
28
|
import f from "@mui/material/Button";
|
|
29
|
-
import { ChevronRight as
|
|
29
|
+
import { ChevronRight as H } from "@mxenabled/mx-icons";
|
|
30
30
|
import { Fragment as Ho, jsx as i, jsxs as C } from "react/jsx-runtime";
|
|
31
|
-
import
|
|
31
|
+
import N from "@mui/material/Box";
|
|
32
32
|
import No from "@mui/material/Card";
|
|
33
33
|
var Mo = {}, Po = {
|
|
34
34
|
position: "absolute",
|
|
@@ -39,7 +39,7 @@ var Mo = {}, Po = {
|
|
|
39
39
|
backgroundColor: "background.default",
|
|
40
40
|
opacity: 0.7,
|
|
41
41
|
zIndex: 3
|
|
42
|
-
},
|
|
42
|
+
}, A = {
|
|
43
43
|
alignSelf: "flex-start",
|
|
44
44
|
fontSize: 13,
|
|
45
45
|
fontWeight: 600,
|
|
@@ -52,7 +52,7 @@ var Mo = {}, Po = {
|
|
|
52
52
|
py: 4,
|
|
53
53
|
textAlign: "left"
|
|
54
54
|
}, Ro = {
|
|
55
|
-
...
|
|
55
|
+
...A,
|
|
56
56
|
alignItems: "center",
|
|
57
57
|
display: "flex",
|
|
58
58
|
textTransform: "none"
|
|
@@ -76,8 +76,8 @@ var Mo = {}, Po = {
|
|
|
76
76
|
px: 16,
|
|
77
77
|
py: 12,
|
|
78
78
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
79
|
-
}, yi = Eo(({ beat: t, beatActions: l = Mo, obsolete: _, isLoading:
|
|
80
|
-
const P = ro(), b = ao(), { config: R } = no(), o = Do(t, l), y = so(), { runCta: G, primary: v, secondary:
|
|
79
|
+
}, yi = Eo(({ beat: t, beatActions: l = Mo, obsolete: _, isLoading: L = !1, isError: M = !1 }) => {
|
|
80
|
+
const P = ro(), b = ao(), { config: R } = no(), o = Do(t, l), y = so(), { runCta: G, primary: v, secondary: B, linkPresentation: W } = ho(t, l, t.insights_payload?.primary_cta ?? void 0, t.insights_payload?.secondary_cta ?? void 0, t.insights_payload?.in_description_cta ?? void 0), c = t.insights_payload?.widget_type === "mini", h = t.active_at ?? t.insights_payload?.active_at;
|
|
81
81
|
Oo(() => {
|
|
82
82
|
h == null || h === "" || b.setBeatContext(t.guid, { [lo]: h });
|
|
83
83
|
}, [
|
|
@@ -92,10 +92,10 @@ var Mo = {}, Po = {
|
|
|
92
92
|
if (M) return /* @__PURE__ */ i(yo, {});
|
|
93
93
|
const e = t.insights_payload;
|
|
94
94
|
if (!e || o.cardState === "dismissed") return null;
|
|
95
|
-
const { instance_slot: V, primary_cta: r, secondary_cta: d, sub_title: j, title: z, guid:
|
|
95
|
+
const { instance_slot: V, primary_cta: r, secondary_cta: d, sub_title: j, title: z, guid: D, dismissed_at: K } = e, { block: U } = V, Y = j ?? (e.subtitle ? {
|
|
96
96
|
logo: _o(e.logo),
|
|
97
97
|
text: e.subtitle
|
|
98
|
-
} : void 0), p = (s) => mo(s, R, l.onContactSupport),
|
|
98
|
+
} : void 0), p = (s) => mo(s, R, l.onContactSupport), O = async (s, a) => {
|
|
99
99
|
if (!p(a.block)) {
|
|
100
100
|
if (a.block === go.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
101
101
|
Co({
|
|
@@ -108,14 +108,14 @@ var Mo = {}, Po = {
|
|
|
108
108
|
}
|
|
109
109
|
await G(s, a);
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, k = vo[U], m = e.in_description_cta, x = !c && m?.label && m.block ? m : void 0, $ = r?.label || (x ? void 0 : m?.label) || void 0, u = !c && !!r?.label, I = t.in_description_cta || t.html_in_description_cta, q = () => {
|
|
112
112
|
const { is_mobile_webview: s, clientConfig: a } = y.appDataStore.appConfig;
|
|
113
113
|
co(t.template, {
|
|
114
114
|
isMobileWebview: s,
|
|
115
115
|
webviewScheme: a?.master?.ui_message_webview_url_scheme,
|
|
116
116
|
userGuid: e.user_guid ?? t.user_guid
|
|
117
117
|
});
|
|
118
|
-
}, n = u ? v.presentation : void 0, J = n?.kind === "hidden" && !!n.hideAll,
|
|
118
|
+
}, n = u ? v.presentation : void 0, J = n?.kind === "hidden" && !!n.hideAll, E = !c && !!d?.label && !J, g = c ? W : void 0, Q = g?.kind === "status" ? g : void 0, F = g ? Q?.action?.label : $, Z = g?.title || z || "", oo = !!F && !u, io = u && n?.kind !== "hidden" || E, to = (s) => {
|
|
119
119
|
const { onCtaAction: a } = l;
|
|
120
120
|
a && (s.stopPropagation(), Promise.resolve().then(() => a({
|
|
121
121
|
beatGuid: t.guid,
|
|
@@ -125,49 +125,49 @@ var Mo = {}, Po = {
|
|
|
125
125
|
template: t.template,
|
|
126
126
|
handler: "cardClick"
|
|
127
127
|
})));
|
|
128
|
-
},
|
|
128
|
+
}, S = P.insights_feed?.general, T = _?.state === "not_refreshable" && !K && !!S;
|
|
129
129
|
return /* @__PURE__ */ i(po, {
|
|
130
130
|
value: X,
|
|
131
|
-
children: /* @__PURE__ */ C(
|
|
131
|
+
children: /* @__PURE__ */ C(w, {
|
|
132
132
|
sx: { mb: 16 },
|
|
133
133
|
children: [
|
|
134
134
|
o.cardState === "confirming" ? /* @__PURE__ */ i(Ao, {
|
|
135
135
|
onClose: o.collapseConfirmation,
|
|
136
136
|
onLeaveFeedback: o.openHideSurvey,
|
|
137
137
|
onUndo: o.undoDismiss
|
|
138
|
-
}) : /* @__PURE__ */ C(Ho, { children: [_ &&
|
|
138
|
+
}) : /* @__PURE__ */ C(Ho, { children: [_ && S && /* @__PURE__ */ i(Bo, {
|
|
139
139
|
..._,
|
|
140
|
-
copy:
|
|
140
|
+
copy: S
|
|
141
141
|
}), /* @__PURE__ */ C(No, {
|
|
142
|
-
inert:
|
|
142
|
+
inert: T,
|
|
143
143
|
sx: {
|
|
144
144
|
display: "flex",
|
|
145
145
|
flexDirection: "column",
|
|
146
|
-
...
|
|
146
|
+
...T && {
|
|
147
147
|
position: "relative",
|
|
148
148
|
zIndex: 2,
|
|
149
149
|
pointerEvents: "none"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
children: [
|
|
153
|
-
|
|
153
|
+
T && /* @__PURE__ */ i(N, { sx: Po }),
|
|
154
154
|
/* @__PURE__ */ i(So, {
|
|
155
155
|
isMini: c,
|
|
156
156
|
subtitle: Y,
|
|
157
157
|
title: Z
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */ i(
|
|
159
|
+
/* @__PURE__ */ i(N, {
|
|
160
160
|
sx: Go,
|
|
161
|
-
children:
|
|
162
|
-
beatGuid:
|
|
161
|
+
children: L ? /* @__PURE__ */ i(Lo, {}) : k && /* @__PURE__ */ i(k, {
|
|
162
|
+
beatGuid: D,
|
|
163
163
|
payload: e
|
|
164
164
|
})
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */ C(
|
|
166
|
+
/* @__PURE__ */ C(w, {
|
|
167
167
|
sx: {
|
|
168
168
|
gap: 6,
|
|
169
169
|
pb: 16,
|
|
170
|
-
pt: 12,
|
|
170
|
+
pt: L || k ? 12 : 0,
|
|
171
171
|
px: 16
|
|
172
172
|
},
|
|
173
173
|
children: [
|
|
@@ -176,30 +176,30 @@ var Mo = {}, Po = {
|
|
|
176
176
|
sx: { fontWeight: "fontWeightRegular" },
|
|
177
177
|
variant: "subtitle2"
|
|
178
178
|
}),
|
|
179
|
-
|
|
180
|
-
endIcon: /* @__PURE__ */ i(
|
|
179
|
+
x && /* @__PURE__ */ i(f, {
|
|
180
|
+
endIcon: /* @__PURE__ */ i(H, {}),
|
|
181
181
|
onClick: () => b.openActionDrawer({
|
|
182
|
-
guid:
|
|
182
|
+
guid: D,
|
|
183
183
|
trigger: "inDescriptionCta"
|
|
184
184
|
}),
|
|
185
|
-
sx:
|
|
186
|
-
children:
|
|
185
|
+
sx: A,
|
|
186
|
+
children: x.label
|
|
187
187
|
}),
|
|
188
188
|
oo && /* @__PURE__ */ i(f, {
|
|
189
189
|
onClick: c ? to : void 0,
|
|
190
190
|
sx: Ro,
|
|
191
191
|
variant: "text",
|
|
192
|
-
children:
|
|
192
|
+
children: F
|
|
193
193
|
}),
|
|
194
|
-
!m?.label &&
|
|
195
|
-
endIcon: /* @__PURE__ */ i(
|
|
194
|
+
!m?.label && I && /* @__PURE__ */ i(f, {
|
|
195
|
+
endIcon: /* @__PURE__ */ i(H, {}),
|
|
196
196
|
onClick: q,
|
|
197
|
-
sx:
|
|
198
|
-
children:
|
|
197
|
+
sx: A,
|
|
198
|
+
children: I
|
|
199
199
|
})
|
|
200
200
|
]
|
|
201
201
|
}),
|
|
202
|
-
io && /* @__PURE__ */ C(
|
|
202
|
+
io && /* @__PURE__ */ C(w, {
|
|
203
203
|
sx: {
|
|
204
204
|
gap: 8,
|
|
205
205
|
pb: 16,
|
|
@@ -216,16 +216,16 @@ var Mo = {}, Po = {
|
|
|
216
216
|
u && r && !n && /* @__PURE__ */ i(f, {
|
|
217
217
|
"aria-disabled": p(r.block) || v.disabled,
|
|
218
218
|
disabled: v.disabled,
|
|
219
|
-
onClick: () =>
|
|
219
|
+
onClick: () => O("primary", r),
|
|
220
220
|
sx: { ...p(r.block) && { color: "text.disabled" } },
|
|
221
221
|
variant: "outlined",
|
|
222
222
|
children: r.label
|
|
223
223
|
}),
|
|
224
|
-
|
|
225
|
-
"aria-disabled": p(d.block) ||
|
|
224
|
+
E && d && /* @__PURE__ */ i(f, {
|
|
225
|
+
"aria-disabled": p(d.block) || B.disabled,
|
|
226
226
|
color: "inherit",
|
|
227
|
-
disabled:
|
|
228
|
-
onClick: () =>
|
|
227
|
+
disabled: B.disabled,
|
|
228
|
+
onClick: () => O("secondary", d),
|
|
229
229
|
sx: {
|
|
230
230
|
...Wo,
|
|
231
231
|
...p(d.block) && { color: "text.disabled" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAA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AAI,EAAc,EAAc,KAAK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { HOST_ACTIONS, reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? linkPresentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n {/* Figma Template/Insight Card: with an empty slot, the description follows the header's 12px. */}\n <Stack sx={{ gap: 6, pb: 16, pt: isLoading || Block ? 12 : 0, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EAC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'success' | 'warning';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const statusIconPalette: (color?: string | null) => StatusIconPalette;
|
|
17
17
|
/**
|
|
18
|
-
* The accent colour a status icon's `color` names when it is not a status palette: `primary.main
|
|
19
|
-
* chart colour (`chart.chart2`), for an icon that isn't
|
|
20
|
-
* Savings Account Balances Summary's bar chart).
|
|
21
|
-
* `statusIconPalette`'s status colours and its error
|
|
22
|
-
* accepted: the value is server data.
|
|
18
|
+
* The accent colour a status icon's `color` names when it is not a status palette: `primary.main`,
|
|
19
|
+
* `action.active` (a neutral info glyph) or a chart colour (`chart.chart2`), for an icon that isn't
|
|
20
|
+
* a status (Weekly New Merchants' money bag, Savings Account Balances Summary's bar chart).
|
|
21
|
+
* Undefined otherwise, so the tile keeps `statusIconPalette`'s status colours and its error
|
|
22
|
+
* fallback. Only these exact theme paths are accepted: the value is server data.
|
|
23
23
|
*/
|
|
24
24
|
export declare const statusIconAccentColor: (palette: Theme["palette"], color?: string | null) => string | undefined;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { IconList as
|
|
2
|
-
var
|
|
1
|
+
import { IconList as c } from "@mxenabled/mx-icons";
|
|
2
|
+
var i = (r) => {
|
|
3
3
|
const a = /^ICO-([a-z0-9_]+)$/.exec(r ?? "")?.[1];
|
|
4
|
-
return a && Object.hasOwn(
|
|
4
|
+
return a && Object.hasOwn(c, a) ? a : void 0;
|
|
5
5
|
}, t = {
|
|
6
6
|
"error.main": "error",
|
|
7
7
|
"success.main": "success",
|
|
8
8
|
"warning.main": "warning"
|
|
9
|
-
},
|
|
9
|
+
}, s = (r) => r && Object.hasOwn(t, r) && t[r] || "error", m = (r, a) => {
|
|
10
10
|
if (a === "primary.main") return r.primary.main;
|
|
11
|
+
if (a === "action.active") return r.action.active;
|
|
11
12
|
const n = /^chart\.(chart[1-7])$/.exec(a ?? "")?.[1];
|
|
12
13
|
return n ? r.chart?.[n] : void 0;
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
16
|
m as statusIconAccentColor,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
i as statusIconName,
|
|
18
|
+
s as statusIconPalette
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
//# sourceMappingURL=statusIcon.es.js.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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`,\n * `action.active` (a neutral info glyph) or a chart colour (`chart.chart2`), for an icon that isn't\n * a status (Weekly New Merchants' money bag, Savings Account Balances Summary's bar chart).\n * Undefined otherwise, so the tile keeps `statusIconPalette`'s status colours and its error\n * fallback. Only these exact theme paths are 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 if (color === 'action.active') return palette.action.active\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,MAAI,MAAU,gBAAiB,QAAO,EAAQ,OAAO;AACrD,QAAM,IAAW,wBAAwB,KAAK,KAAS,EAAE,IAAI,CAAA;AAG7D,SAAO,IAAW,EAAQ,QAAQ,CAAA,IAAY;AAChD"}
|
|
@@ -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 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 { asLogoRef } from '../../insights-v2/blocks/slotReaders'\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid, { isLogoGuid } 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\n/**\n * A `budget_block` slot's micro tile is the tinted category tile (Figma 156:35121, Micro | Category\n * Budget: the glyph on a 25% tint of the category colour, bordered in it) instead of mxui's solid tile.\n */\nconst TINTED_CATEGORY_TILE_BLOCK = 'budget_block'\nconst CATEGORY_TILE_TINT = 0.25\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 usable row logo may name a status icon instead (account_block `minimal`:\n // `ICO-error`), 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 { data } = v2Payload.instance_slot\n const rowLogo = asLogoRef(slot(data, 'logo'))\n // The reviewed icon once answered, else the icon: whichever names a status icon first.\n const statusIcon = [answered ? slot(data, 'reviewed_icon') : undefined, slot(data, 'icon')]\n .map(asLogoRef)\n .find((ref) => statusIconName(ref?.guid))\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\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 (isLogoGuid(rowLogo?.guid) && !rowIconName ? (\n <LogoFromGuid\n categoryTint={\n v2Payload.instance_slot.block === TINTED_CATEGORY_TILE_BLOCK\n ? CATEGORY_TILE_TINT\n : undefined\n }\n logo={rowLogo}\n size={ICON_SIZE}\n />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : 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":";;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,KAA6B,gBAC7B,KAAqB,MAOd,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,GAAc,EAAK,QAAQ,GAAG,CAAU,KAb5C,EAAK,KAAK,WAAW,KAAK,IAC5B,EAAY;AAAA,MACV,GAAG;AAA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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"}
|
|
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 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 { asLogoRef } from '../../insights-v2/blocks/slotReaders'\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid, { isLogoGuid } 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\n/**\n * A `budget_block` slot's micro tile is the tinted category tile (Figma 156:35121, Micro | Category\n * Budget: the glyph on a 25% tint of the category colour, bordered in it) instead of mxui's solid tile.\n */\nconst TINTED_CATEGORY_TILE_BLOCK = 'budget_block'\nconst CATEGORY_TILE_TINT = 0.25\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 usable row logo may name a status icon instead (account_block `minimal`:\n // `ICO-error`), 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 { data } = v2Payload.instance_slot\n const rowLogo = asLogoRef(slot(data, 'logo'))\n // The reviewed icon once answered, else the icon: whichever names a status icon first.\n const statusIcon = [answered ? slot(data, 'reviewed_icon') : undefined, slot(data, 'icon')]\n .map(asLogoRef)\n .find((ref) => statusIconName(ref?.guid))\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `action.active`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\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 (isLogoGuid(rowLogo?.guid) && !rowIconName ? (\n <LogoFromGuid\n categoryTint={\n v2Payload.instance_slot.block === TINTED_CATEGORY_TILE_BLOCK\n ? CATEGORY_TILE_TINT\n : undefined\n }\n logo={rowLogo}\n size={ICON_SIZE}\n />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : 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":";;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,KAA6B,gBAC7B,KAAqB,MAOd,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;AA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