@mx-cartographer/experiences 9.7.98 → 9.7.100
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 +8 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +40 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/index.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/layout.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/layout.es.js +13 -0
- package/dist/insights-v2/actionBlocks/HelpBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +51 -36
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHelpHeader.d.ts +13 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHelpHeader.es.js +51 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHelpHeader.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.d.ts +28 -7
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js +46 -23
- package/dist/insights-v2/actionBlocks/TransactionListBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +2 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +60 -55
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.7.100] - 11-04-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - Weekend Spending Summary's drawers on Insights 2.0: the Transaction List drawer's `help_header` variant and a `help_block` for "Learn More" (WEC-2211)
|
|
4
|
+
|
|
5
|
+
## [9.7.99] - 11-04-2026
|
|
6
|
+
|
|
7
|
+
- **CHANGED** - The `transaction_list_block` drilldown title is driven by the CTA variant (via a variant-to-title map): the `generic_list` variant drawer is titled "Transactions" (`copy.transactions.transactions_title`), while `summary_header`, `standard` and variant-less drawers keep the beat's own title. Weekly New Merchants V3's drawer (CTA variant `generic_list`) now reads "Transactions" instead of the card's "Purchases for Review" (WEC-2189)
|
|
8
|
+
|
|
1
9
|
## [9.7.98] - 11-04-2026
|
|
2
10
|
|
|
3
11
|
- **FIXED** - Celebrate Credit Card Payoff card spacing matches Figma (WEC-2170)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Beat } from '../../../core';
|
|
2
|
+
export interface HelpBlockProps {
|
|
3
|
+
beat: Beat;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The "How was this calculated?" drawer: the beat's pre-localized help title and body, read from
|
|
7
|
+
* the payload's `drilldown_data` (`help_title`, `help_html`). Opened by a CTA naming `help_block`
|
|
8
|
+
* and by the Transaction List drawer's "Learn More" link.
|
|
9
|
+
*/
|
|
10
|
+
export declare const HelpBlock: (({ beat }: HelpBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { sanitizeHtml as n } from "../../../core/utils/SanitizeHtml.es.js";
|
|
2
|
+
import { useGlobalCopyStore as p } from "../../../common/context/hooks.es.js";
|
|
3
|
+
import { readHelp as i } from "./layout.es.js";
|
|
4
|
+
import { observer as a } from "mobx-react-lite";
|
|
5
|
+
import e from "@mui/material/Stack";
|
|
6
|
+
import { Text as t } from "@mxenabled/mxui";
|
|
7
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
var s = {
|
|
9
|
+
"& > *": { m: 0 },
|
|
10
|
+
"& > * + *": { mt: 24 },
|
|
11
|
+
"& ul, & ol": { pl: 24 }
|
|
12
|
+
}, g = a(function({ beat: m }) {
|
|
13
|
+
const { common: l } = p(), r = i(m.insights_payload?.drilldown_data);
|
|
14
|
+
return r ? /* @__PURE__ */ c(e, {
|
|
15
|
+
sx: {
|
|
16
|
+
bgcolor: "background.paper",
|
|
17
|
+
gap: 8,
|
|
18
|
+
p: 24
|
|
19
|
+
},
|
|
20
|
+
children: [/* @__PURE__ */ o(t, {
|
|
21
|
+
bold: !0,
|
|
22
|
+
component: "h3",
|
|
23
|
+
variant: "h3",
|
|
24
|
+
children: r.title
|
|
25
|
+
}), /* @__PURE__ */ o(t, {
|
|
26
|
+
component: "div",
|
|
27
|
+
dangerouslySetInnerHTML: { __html: n(r.html) },
|
|
28
|
+
sx: s,
|
|
29
|
+
variant: "body1"
|
|
30
|
+
})]
|
|
31
|
+
}) : /* @__PURE__ */ o(e, {
|
|
32
|
+
sx: { p: 24 },
|
|
33
|
+
children: /* @__PURE__ */ o(t, { children: l.error_message })
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
g as HelpBlock
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=HelpBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/HelpBlock/HelpBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../../common'\nimport type { Beat } from '../../../core'\nimport { sanitizeHtml } from '../../../core/utils/SanitizeHtml'\nimport { readHelp } from './layout'\n\nconst HELP_HTML_SX = {\n '& > *': { m: 0 },\n '& > * + *': { mt: 24 },\n '& ul, & ol': { pl: 24 },\n} as const\n\nexport interface HelpBlockProps {\n beat: Beat\n}\n\n/**\n * The \"How was this calculated?\" drawer: the beat's pre-localized help title and body, read from\n * the payload's `drilldown_data` (`help_title`, `help_html`). Opened by a CTA naming `help_block`\n * and by the Transaction List drawer's \"Learn More\" link.\n */\nexport const HelpBlock = observer(function HelpBlock({ beat }: HelpBlockProps) {\n const { common: commonCopy } = useGlobalCopyStore()\n const help = readHelp(beat.insights_payload?.drilldown_data)\n\n if (!help) {\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy.error_message}</Text>\n </Stack>\n )\n }\n\n return (\n <Stack sx={{ bgcolor: 'background.paper', gap: 8, p: 24 }}>\n <Text bold={true} component=\"h3\" variant=\"h3\">\n {help.title}\n </Text>\n <Text\n component=\"div\"\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(help.html) }}\n sx={HELP_HTML_SX}\n variant=\"body1\"\n />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;AAUA,IAAM,IAAe;AAAA,EACnB,SAAS,EAAE,GAAG,EAAE;AAAA,EAChB,aAAa,EAAE,IAAI,GAAG;AAAA,EACtB,cAAc,EAAE,IAAI,GAAG;AACzB,GAWa,IAAY,EAAS,SAAmB,EAAE,MAAA,EAAA,GAAwB;AAC7E,QAAM,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,IAAO,EAAS,EAAK,kBAAkB,cAAc;AAE3D,SAAK,IASH,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,SAAS;AAAA,MAAoB,KAAK;AAAA,MAAG,GAAG;AAAA,IAAG;AAAA,IAAxD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM;AAAA,MAAM,WAAU;AAAA,MAAK,SAAQ;AAAA,MACtC,UAAA,EAAK;AAAA,IACF,CAAA,GACN,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,EAAa,EAAK,IAAI,EAAE;AAAA,MAC3D,IAAI;AAAA,MACJ,SAAQ;AAAA,IACT,CAAA,CACI;AAAA,OAjBL,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,EACjC,CAAA;AAiBb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DrilldownData } from '../../../core';
|
|
2
|
+
export interface HelpContent {
|
|
3
|
+
title: string;
|
|
4
|
+
html: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const toText: (value: unknown) => string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* A beat's "How was this calculated?" content: pre-localized `help_title` and `help_html` on the
|
|
9
|
+
* payload's `drilldown_data`, shared by every CTA of the card. Absent either, there is nothing to
|
|
10
|
+
* open.
|
|
11
|
+
*/
|
|
12
|
+
export declare const readHelp: (drilldown: DrilldownData | undefined) => HelpContent | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var o = (t) => typeof t == "string" && t.trim() !== "" ? t : void 0, i = (t) => {
|
|
2
|
+
const e = o(t?.help_title), r = o(t?.help_html);
|
|
3
|
+
return e && r ? {
|
|
4
|
+
title: e,
|
|
5
|
+
html: r
|
|
6
|
+
} : void 0;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
i as readHelp,
|
|
10
|
+
o as toText
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/HelpBlock/layout.ts"],"sourcesContent":["import type { DrilldownData } from '../../../core'\n\nexport interface HelpContent {\n title: string\n html: string\n}\n\nexport const toText = (value: unknown): string | undefined =>\n typeof value === 'string' && value.trim() !== '' ? value : undefined\n\n/**\n * A beat's \"How was this calculated?\" content: pre-localized `help_title` and `help_html` on the\n * payload's `drilldown_data`, shared by every CTA of the card. Absent either, there is nothing to\n * open.\n */\nexport const readHelp = (drilldown: DrilldownData | undefined): HelpContent | undefined => {\n const title = toText(drilldown?.help_title)\n const html = toText(drilldown?.help_html)\n return title && html ? { title, html } : undefined\n}\n"],"mappings":"AAOA,IAAa,IAAA,CAAU,MACrB,OAAO,KAAU,YAAY,EAAM,KAAK,MAAM,KAAK,IAAQ,QAOhD,IAAA,CAAY,MAAkE;AACzF,QAAM,IAAQ,EAAO,GAAW,UAAU,GACpC,IAAO,EAAO,GAAW,SAAS;AACxC,SAAO,KAAS,IAAO;AAAA,IAAE,OAAA;AAAA,IAAO,MAAA;AAAA,EAAK,IAAI;AAC3C"}
|
|
@@ -1,47 +1,62 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { selectTransactionsByGuids as
|
|
5
|
-
import { getDynamicCtaBasedOnTriggers as
|
|
6
|
-
import { TransactionDetailsBlock as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { useGlobalCopyStore as M, useInsightsV2Store as b, useTransactionStore as x } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import u from "../../../common/components/drawer/Drawer.es.js";
|
|
3
|
+
import A from "../../../transactions/components/shared/TransactionList.es.js";
|
|
4
|
+
import { selectTransactionsByGuids as j } from "../../CommonUtils.es.js";
|
|
5
|
+
import { getDynamicCtaBasedOnTriggers as G } from "../util.es.js";
|
|
6
|
+
import { TransactionDetailsBlock as I } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
7
|
+
import { HelpBlock as F } from "../HelpBlock/HelpBlock.es.js";
|
|
8
|
+
import { readHelpHeader as R, readSummary as $ } from "./layout.es.js";
|
|
9
|
+
import { TransactionListHelpHeader as z } from "./TransactionListHelpHeader.es.js";
|
|
10
|
+
import { TransactionListSummaryCard as V } from "./TransactionListSummaryCard.es.js";
|
|
11
|
+
import _ from "react";
|
|
12
|
+
import { observer as q } from "mobx-react-lite";
|
|
13
|
+
import { Fragment as E, jsx as o, jsxs as J } from "react/jsx-runtime";
|
|
14
|
+
var K = (a) => Array.isArray(a) && a.every((t) => typeof t == "string"), N = (a) => {
|
|
15
|
+
const t = a.insights_payload?.drilldown_data, r = a.insights_payload?.instance_slot_data ?? {}, [i, n] = t && Object.hasOwn(t, "transaction_guids") ? ["drilldown_data", t.transaction_guids] : ["instance_slot_data", r.transaction_guids];
|
|
16
|
+
if (n != null) {
|
|
17
|
+
if (K(n)) return n;
|
|
18
|
+
console.warn(`[TransactionListBlock] ${i}.transaction_guids is not a list of guids — listing no transactions.`);
|
|
17
19
|
}
|
|
18
|
-
},
|
|
19
|
-
const { common:
|
|
20
|
-
c({ transaction_guid:
|
|
21
|
-
},
|
|
22
|
-
|
|
20
|
+
}, it = q(function({ beat: t }) {
|
|
21
|
+
const { common: r, insights_feed: i } = M(), { actionDrawer: n, setActionContext: c } = b(), g = x(), [f, d] = _.useState(!1), [y, m] = _.useState(!1), e = N(t), h = j(g.detailedTransactions, e), { primary_cta: C, secondary_cta: T, in_description_cta: w, is_zero_state: H, drilldown_data: L, title: S } = t.insights_payload ?? {}, p = G(n, C, T, w), l = $(p), v = l?.count ?? e?.length ?? 0, O = l !== void 0 && !H && (e?.length ?? 0) > 0, s = R(p, L), D = (B) => {
|
|
22
|
+
c({ transaction_guid: B }), d(!0);
|
|
23
|
+
}, k = () => {
|
|
24
|
+
d(!1), c({ transaction_guid: void 0 });
|
|
23
25
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
copy:
|
|
27
|
-
count:
|
|
28
|
-
summary:
|
|
26
|
+
return /* @__PURE__ */ J(E, { children: [
|
|
27
|
+
O && /* @__PURE__ */ o(V, {
|
|
28
|
+
copy: i.general,
|
|
29
|
+
count: v,
|
|
30
|
+
summary: l
|
|
29
31
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
s && /* @__PURE__ */ o(z, {
|
|
33
|
+
descriptionHtml: s.descriptionHtml,
|
|
34
|
+
learnMoreLabel: s.learnMore?.label,
|
|
35
|
+
onLearnMore: () => m(!0),
|
|
36
|
+
title: S ?? ""
|
|
33
37
|
}),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
/* @__PURE__ */ o(A, {
|
|
39
|
+
onClick: D,
|
|
40
|
+
transaction: h
|
|
41
|
+
}),
|
|
42
|
+
s?.learnMore && /* @__PURE__ */ o(u, {
|
|
43
|
+
ariaLabelClose: r.close_aria,
|
|
44
|
+
isOpen: y,
|
|
45
|
+
onClose: () => m(!1),
|
|
46
|
+
title: s.learnMore.label,
|
|
47
|
+
children: /* @__PURE__ */ o(F, { beat: t })
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ o(u, {
|
|
50
|
+
ariaLabelClose: r.close_aria,
|
|
51
|
+
isOpen: f,
|
|
52
|
+
onClose: k,
|
|
53
|
+
title: i.general.transaction_details_title,
|
|
54
|
+
children: /* @__PURE__ */ o(I, { beat: t })
|
|
40
55
|
})
|
|
41
56
|
] });
|
|
42
57
|
});
|
|
43
58
|
export {
|
|
44
|
-
|
|
59
|
+
it as TransactionListBlock
|
|
45
60
|
};
|
|
46
61
|
|
|
47
62
|
//# sourceMappingURL=TransactionListBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { readSummary } from './layout'\nimport { TransactionListSummaryCard } from './TransactionListSummaryCard'\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string')\n\n/**\n * The guids the drawer lists. V2 envelopes send them on `drilldown_data`, V1 on\n * `instance_slot_data`, which is read only when the V2 key is absent. The payload is untrusted, so\n * a present but malformed list fails closed (no rows, and a warning) rather than showing the other\n * source's rows; a non-array would otherwise reach new Set() inside selectTransactionsByGuids and\n * match per-character.\n */\nconst resolveTransactionGuids = (beat: Beat): string[] | undefined => {\n const drilldown = beat.insights_payload?.drilldown_data\n const slotData = (beat.insights_payload?.instance_slot_data ?? {}) as InsightsInstanceSlotData\n const [source, value]: [string, unknown] =\n drilldown && Object.hasOwn(drilldown, 'transaction_guids')\n ? ['drilldown_data', drilldown.transaction_guids]\n : ['instance_slot_data', slotData.transaction_guids]\n\n if (value == null) return undefined\n if (isStringArray(value)) return value\n\n console.warn(\n `[TransactionListBlock] ${source}.transaction_guids is not a list of guids — listing no transactions.`,\n )\n return undefined\n}\n\nexport interface TransactionListBlockProps {\n beat: Beat\n}\n\n/**\n * Opens a date-grouped list of the transactions a beat points at. Tapping a row stacks\n * the Transaction Details drawer over the list.\n *\n * ActionBlockLayer owns the outer Drawer (title, close button, copy-loaded gate).\n */\nexport const TransactionListBlock = observer(function TransactionListBlock({\n beat,\n}: TransactionListBlockProps) {\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n const transactionStore = useTransactionStore()\n\n const [isDetailsOpen, setIsDetailsOpen] = React.useState(false)\n\n const guids = resolveTransactionGuids(beat)\n const transactions = selectTransactionsByGuids(transactionStore.detailedTransactions, guids)\n\n // Summary figures live on the clicked CTA's `drilldown_data`, so resolve which CTA opened this\n // drawer. `readSummary` fails closed (no finite `amount` -> undefined), so a plain list renders no\n // card. A zero-state envelope, or one naming no transactions, has no figures to head.\n const { primary_cta, secondary_cta, in_description_cta, is_zero_state } =\n beat.insights_payload ?? {}\n const currentCta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\n const summary = readSummary(currentCta)\n // Count comes from the CTA's `drilldown_data`; fall back to the named guid count so the pill never\n // flashes \"0 transactions\" if the payload omits it.\n const count = summary?.count ?? guids?.length ?? 0\n const showSummary = summary !== undefined && !is_zero_state && (guids?.length ?? 0) > 0\n\n const handleRowClick = (guid: string) => {\n setActionContext({ transaction_guid: guid })\n setIsDetailsOpen(true)\n }\n\n const handleDetailsClose = () => {\n setIsDetailsOpen(false)\n // Clear only the key this nested drawer owns — same convention as TransactionHistoryBlock.\n // `setActionContext` merges, so an explicit `{}` would be a no-op; naming the key keeps the\n // outer drawer's own context intact.\n setActionContext({ transaction_guid: undefined })\n }\n\n return (\n <>\n {showSummary && (\n <TransactionListSummaryCard copy={insightsCopy.general} count={count} summary={summary} />\n )}\n <TransactionList onClick={handleRowClick} transaction={transactions} />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isDetailsOpen}\n onClose={handleDetailsClose}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TransactionListBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.tsx"],"sourcesContent":["import React from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n useGlobalCopyStore,\n useInsightsV2Store,\n useTransactionStore,\n} from '../../../common'\nimport type { Beat } from '../../../core'\nimport type { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { TransactionList } from '../../../transactions'\nimport { selectTransactionsByGuids } from '../../CommonUtils'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\nimport { HelpBlock } from '../HelpBlock'\nimport { readHelpHeader, readSummary } from './layout'\nimport { TransactionListHelpHeader } from './TransactionListHelpHeader'\nimport { TransactionListSummaryCard } from './TransactionListSummaryCard'\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string')\n\n/**\n * The guids the drawer lists. V2 envelopes send them on `drilldown_data`, V1 on\n * `instance_slot_data`, which is read only when the V2 key is absent. The payload is untrusted, so\n * a present but malformed list fails closed (no rows, and a warning) rather than showing the other\n * source's rows; a non-array would otherwise reach new Set() inside selectTransactionsByGuids and\n * match per-character.\n */\nconst resolveTransactionGuids = (beat: Beat): string[] | undefined => {\n const drilldown = beat.insights_payload?.drilldown_data\n const slotData = (beat.insights_payload?.instance_slot_data ?? {}) as InsightsInstanceSlotData\n const [source, value]: [string, unknown] =\n drilldown && Object.hasOwn(drilldown, 'transaction_guids')\n ? ['drilldown_data', drilldown.transaction_guids]\n : ['instance_slot_data', slotData.transaction_guids]\n\n if (value == null) return undefined\n if (isStringArray(value)) return value\n\n console.warn(\n `[TransactionListBlock] ${source}.transaction_guids is not a list of guids — listing no transactions.`,\n )\n return undefined\n}\n\nexport interface TransactionListBlockProps {\n beat: Beat\n}\n\n/**\n * Opens a date-grouped list of the transactions a beat points at. Tapping a row stacks\n * the Transaction Details drawer over the list.\n *\n * ActionBlockLayer owns the outer Drawer (title, close button, copy-loaded gate).\n */\nexport const TransactionListBlock = observer(function TransactionListBlock({\n beat,\n}: TransactionListBlockProps) {\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n const transactionStore = useTransactionStore()\n\n const [isDetailsOpen, setIsDetailsOpen] = React.useState(false)\n const [isHelpOpen, setIsHelpOpen] = React.useState(false)\n\n const guids = resolveTransactionGuids(beat)\n const transactions = selectTransactionsByGuids(transactionStore.detailedTransactions, guids)\n\n // Summary figures live on the clicked CTA's `drilldown_data`, so resolve which CTA opened this\n // drawer. `readSummary` fails closed (no finite `amount` -> undefined), so a plain list renders no\n // card. A zero-state envelope, or one naming no transactions, has no figures to head.\n const { primary_cta, secondary_cta, in_description_cta, is_zero_state, drilldown_data, title } =\n beat.insights_payload ?? {}\n const currentCta = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n primary_cta,\n secondary_cta,\n in_description_cta,\n )\n const summary = readSummary(currentCta)\n // Count comes from the CTA's `drilldown_data`; fall back to the named guid count so the pill never\n // flashes \"0 transactions\" if the payload omits it.\n const count = summary?.count ?? guids?.length ?? 0\n const showSummary = summary !== undefined && !is_zero_state && (guids?.length ?? 0) > 0\n const helpHeader = readHelpHeader(currentCta, drilldown_data)\n\n const handleRowClick = (guid: string) => {\n setActionContext({ transaction_guid: guid })\n setIsDetailsOpen(true)\n }\n\n const handleDetailsClose = () => {\n setIsDetailsOpen(false)\n // Clear only the key this nested drawer owns — same convention as TransactionHistoryBlock.\n // `setActionContext` merges, so an explicit `{}` would be a no-op; naming the key keeps the\n // outer drawer's own context intact.\n setActionContext({ transaction_guid: undefined })\n }\n\n return (\n <>\n {showSummary && (\n <TransactionListSummaryCard copy={insightsCopy.general} count={count} summary={summary} />\n )}\n {helpHeader && (\n <TransactionListHelpHeader\n descriptionHtml={helpHeader.descriptionHtml}\n learnMoreLabel={helpHeader.learnMore?.label}\n onLearnMore={() => setIsHelpOpen(true)}\n title={title ?? ''}\n />\n )}\n <TransactionList onClick={handleRowClick} transaction={transactions} />\n {helpHeader?.learnMore && (\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isHelpOpen}\n onClose={() => setIsHelpOpen(false)}\n title={helpHeader.learnMore.label}\n >\n <HelpBlock beat={beat} />\n </Drawer>\n )}\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isDetailsOpen}\n onClose={handleDetailsClose}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,IAAA,CAAiB,MACrB,MAAM,QAAQ,CAAK,KAAK,EAAM,MAAA,CAAO,MAAS,OAAO,KAAS,QAAQ,GASlE,IAAA,CAA2B,MAAqC;AACpE,QAAM,IAAY,EAAK,kBAAkB,gBACnC,IAAY,EAAK,kBAAkB,sBAAsB,CAAC,GAC1D,CAAC,GAAQ,CAAA,IACb,KAAa,OAAO,OAAO,GAAW,mBAAmB,IACrD,CAAC,kBAAkB,EAAU,iBAAiB,IAC9C,CAAC,sBAAsB,EAAS,iBAAiB;AAEvD,MAAI,KAAS,MACb;AAAA,QAAI,EAAc,CAAK,EAAG,QAAO;AAEjC,YAAQ,KACN,0BAA0B,CAAA,sEAC5B;AAAA;AAEF,GAYa,KAAuB,EAAS,SAA8B,EACzE,MAAA,EAAA,GAC4B;AAC5B,QAAM,EAAE,QAAQ,GAAY,eAAe,EAAA,IAAiB,EAAmB,GACzE,EAAE,cAAA,GAAc,kBAAA,EAAA,IAAqB,EAAmB,GACxD,IAAmB,EAAoB,GAEvC,CAAC,GAAe,CAAA,IAAoB,EAAM,SAAS,EAAK,GACxD,CAAC,GAAY,CAAA,IAAiB,EAAM,SAAS,EAAK,GAElD,IAAQ,EAAwB,CAAI,GACpC,IAAe,EAA0B,EAAiB,sBAAsB,CAAK,GAKrF,EAAE,aAAA,GAAa,eAAA,GAAe,oBAAA,GAAoB,eAAA,GAAe,gBAAA,GAAgB,OAAA,EAAA,IACrF,EAAK,oBAAoB,CAAC,GACtB,IAAa,EACjB,GACA,GACA,GACA,CACF,GACM,IAAU,EAAY,CAAU,GAGhC,IAAQ,GAAS,SAAS,GAAO,UAAU,GAC3C,IAAc,MAAY,UAAa,CAAC,MAAkB,GAAO,UAAU,KAAK,GAChF,IAA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|
4
|
+
learnMoreLabel?: string;
|
|
5
|
+
onLearnMore?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The `help_header` variant's text block above the Transaction List: the beat's title, its
|
|
9
|
+
* pre-localized description and a "Learn More" link that opens the beat's help drawer.
|
|
10
|
+
* Figma: Drilldown | Weekend Spending Summary V2 ("Transactions").
|
|
11
|
+
*/
|
|
12
|
+
export declare const TransactionListHelpHeader: ({ title, descriptionHtml, learnMoreLabel, onLearnMore, }: TransactionListHelpHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default TransactionListHelpHeader;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { sanitizeHtml as m } from "../../../core/utils/SanitizeHtml.es.js";
|
|
2
|
+
import e from "@mui/material/Stack";
|
|
3
|
+
import { Text as n } from "@mxenabled/mxui";
|
|
4
|
+
import d from "@mui/material/Button";
|
|
5
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
var l = {
|
|
7
|
+
alignSelf: "flex-start",
|
|
8
|
+
fontSize: 13,
|
|
9
|
+
fontWeight: 600,
|
|
10
|
+
height: "auto",
|
|
11
|
+
lineHeight: "16px",
|
|
12
|
+
minHeight: 24,
|
|
13
|
+
minWidth: 0,
|
|
14
|
+
px: 8,
|
|
15
|
+
py: 4
|
|
16
|
+
}, g = ({ title: p, descriptionHtml: r, learnMoreLabel: o, onLearnMore: i }) => /* @__PURE__ */ a(e, {
|
|
17
|
+
sx: {
|
|
18
|
+
bgcolor: "background.paper",
|
|
19
|
+
borderBottom: 1,
|
|
20
|
+
borderColor: "divider",
|
|
21
|
+
gap: 8,
|
|
22
|
+
p: 24
|
|
23
|
+
},
|
|
24
|
+
children: [/* @__PURE__ */ a(e, {
|
|
25
|
+
sx: {
|
|
26
|
+
gap: 8,
|
|
27
|
+
pl: 8
|
|
28
|
+
},
|
|
29
|
+
children: [/* @__PURE__ */ t(n, {
|
|
30
|
+
bold: !0,
|
|
31
|
+
component: "h3",
|
|
32
|
+
variant: "h3",
|
|
33
|
+
children: p
|
|
34
|
+
}), r && /* @__PURE__ */ t(n, {
|
|
35
|
+
component: "div",
|
|
36
|
+
dangerouslySetInnerHTML: { __html: m(r) },
|
|
37
|
+
variant: "body1"
|
|
38
|
+
})]
|
|
39
|
+
}), o && i && /* @__PURE__ */ t(d, {
|
|
40
|
+
onClick: i,
|
|
41
|
+
sx: l,
|
|
42
|
+
variant: "text",
|
|
43
|
+
children: o
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
g as TransactionListHelpHeader,
|
|
48
|
+
g as default
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=TransactionListHelpHeader.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHelpHeader.es.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionListHelpHeader.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListHelpHeader.tsx"],"sourcesContent":["import Button from '@mui/material/Button'\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { sanitizeHtml } from '../../../core/utils/SanitizeHtml'\n\nexport interface TransactionListHelpHeaderProps {\n title: string\n descriptionHtml?: string\n learnMoreLabel?: string\n onLearnMore?: () => void\n}\n\nconst LEARN_MORE_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 8,\n py: 4,\n} as const\n\n/**\n * The `help_header` variant's text block above the Transaction List: the beat's title, its\n * pre-localized description and a \"Learn More\" link that opens the beat's help drawer.\n * Figma: Drilldown | Weekend Spending Summary V2 (\"Transactions\").\n */\nexport const TransactionListHelpHeader = ({\n title,\n descriptionHtml,\n learnMoreLabel,\n onLearnMore,\n}: TransactionListHelpHeaderProps) => (\n <Stack\n sx={{ bgcolor: 'background.paper', borderBottom: 1, borderColor: 'divider', gap: 8, p: 24 }}\n >\n <Stack sx={{ gap: 8, pl: 8 }}>\n <Text bold={true} component=\"h3\" variant=\"h3\">\n {title}\n </Text>\n {descriptionHtml && (\n <Text\n component=\"div\"\n dangerouslySetInnerHTML={{ __html: sanitizeHtml(descriptionHtml) }}\n variant=\"body1\"\n />\n )}\n </Stack>\n {learnMoreLabel && onLearnMore && (\n <Button onClick={onLearnMore} sx={LEARN_MORE_SX} variant=\"text\">\n {learnMoreLabel}\n </Button>\n )}\n </Stack>\n)\n\nexport default TransactionListHelpHeader\n"],"mappings":";;;;;AAcA,IAAM,IAAgB;AAAA,EACpB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AACN,GAOa,IAAA,CAA6B,EACxC,OAAA,GACA,iBAAA,GACA,gBAAA,GACA,aAAA,EAAA,MAEA,gBAAA,EAAC,GAAD;AAAA,EACE,IAAI;AAAA,IAAE,SAAS;AAAA,IAAoB,cAAc;AAAA,IAAG,aAAa;AAAA,IAAW,KAAK;AAAA,IAAG,GAAG;AAAA,EAAG;AAAA,EAD5F,UAAA,CAGE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAG,IAAI;AAAA,IAAE;AAAA,IAA3B,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MAAM,MAAM;AAAA,MAAM,WAAU;AAAA,MAAK,SAAQ;AAAA,MACtC,UAAA;AAAA,IACG,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,yBAAyB,EAAE,QAAQ,EAAa,CAAe,EAAE;AAAA,MACjE,SAAQ;AAAA,IACT,CAAA,CAEE;AAAA,EACN,CAAA,GAAA,KAAkB,KACjB,gBAAA,EAAC,GAAD;AAAA,IAAQ,SAAS;AAAA,IAAa,IAAI;AAAA,IAAe,SAAQ;AAAA,IACtD,UAAA;AAAA,EACK,CAAA,CAEL"}
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import { Beat, GlobalCopy, InDescriptionCTA, PrimaryCTA, SecondaryCTA } from '../../../core';
|
|
1
|
+
import { Beat, DrilldownData, GlobalCopy, InDescriptionCTA, PrimaryCTA, SecondaryCTA } from '../../../core';
|
|
2
|
+
import { HelpContent } from '../HelpBlock/layout';
|
|
2
3
|
type DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA;
|
|
3
|
-
/** The CTA
|
|
4
|
-
export declare const
|
|
4
|
+
/** The transaction_list_block CTA variants. */
|
|
5
|
+
export declare const TRANSACTION_LIST_VARIANTS: {
|
|
6
|
+
readonly SUMMARY_HEADER: "summary_header";
|
|
7
|
+
readonly GENERIC_LIST: "generic_list";
|
|
8
|
+
/** Opens the list under the beat's title, description and "Learn More". */
|
|
9
|
+
readonly HELP_HEADER: "help_header";
|
|
10
|
+
};
|
|
11
|
+
export declare const HELP_HEADER_VARIANT: "help_header";
|
|
5
12
|
/**
|
|
6
|
-
* Drawer title: the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
13
|
+
* Drawer title: the variant's title when it has one (`generic_list` and `help_header` ->
|
|
14
|
+
* "Transactions"; the help header repeats the beat's title inside the drawer), otherwise the
|
|
15
|
+
* beat's own localized title (`summary_header`, `standard`, or no variant).
|
|
9
16
|
*/
|
|
10
|
-
export declare const getTransactionListDrawerTitle: (
|
|
17
|
+
export declare const getTransactionListDrawerTitle: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string;
|
|
18
|
+
export interface HelpHeaderContent {
|
|
19
|
+
/** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */
|
|
20
|
+
descriptionHtml?: string;
|
|
21
|
+
/** The "Learn More" link and the help drawer it opens; absent when the beat carries no help. */
|
|
22
|
+
learnMore?: HelpContent & {
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA
|
|
28
|
+
* of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that
|
|
29
|
+
* `readHelp` reads. Only the `help_header` variant renders the block.
|
|
30
|
+
*/
|
|
31
|
+
export declare const readHelpHeader: (cta: DrilldownCta | undefined, drilldown: DrilldownData | undefined) => HelpHeaderContent | undefined;
|
|
11
32
|
export interface TransactionListSummary {
|
|
12
33
|
/** Headline figure (e.g. total withdrawn). */
|
|
13
34
|
amount: number;
|
|
@@ -1,39 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { readHelp as m, toText as o } from "../HelpBlock/layout.es.js";
|
|
2
|
+
import { parseISO as c } from "date-fns/parseISO";
|
|
3
|
+
var a = {
|
|
4
|
+
SUMMARY_HEADER: "summary_header",
|
|
5
|
+
GENERIC_LIST: "generic_list",
|
|
6
|
+
HELP_HEADER: "help_header"
|
|
7
|
+
}, E = a.HELP_HEADER, f = (t) => ({
|
|
8
|
+
[a.GENERIC_LIST]: t.transactions?.transactions_title ?? "",
|
|
9
|
+
[a.HELP_HEADER]: t.transactions?.transactions_title ?? ""
|
|
10
|
+
}), N = (t, r, n) => {
|
|
11
|
+
const e = f(r);
|
|
12
|
+
return t && Object.hasOwn(e, t) ? e[t] ?? "" : n?.insights_payload?.title ?? "";
|
|
13
|
+
}, b = (t, r) => {
|
|
14
|
+
if (t?.variant !== E) return;
|
|
15
|
+
const n = o(r?.help_label), e = m(r);
|
|
16
|
+
return {
|
|
17
|
+
descriptionHtml: o(r?.description_html),
|
|
18
|
+
...n && e && { learnMore: {
|
|
19
|
+
...e,
|
|
20
|
+
label: n
|
|
21
|
+
} }
|
|
22
|
+
};
|
|
23
|
+
}, l = (t) => typeof t == "number" && Number.isFinite(t) ? t : void 0, p = (t) => typeof t == "number" && Number.isInteger(t) && t > 0 ? t : void 0, u = Date.UTC(2e3, 0, 1), H = Date.UTC(2100, 0, 1), s = /* @__PURE__ */ new WeakSet(), _ = (t, r) => {
|
|
24
|
+
s.has(t) || (s.add(t), console.warn(r));
|
|
25
|
+
}, d = (t, r, n) => {
|
|
5
26
|
if (t == null || t === "") return;
|
|
6
|
-
let
|
|
7
|
-
if (typeof t == "number" && Number.isFinite(t))
|
|
27
|
+
let e;
|
|
28
|
+
if (typeof t == "number" && Number.isFinite(t)) e = t < 1e12 ? t * 1e3 : t;
|
|
8
29
|
else if (typeof t == "string") {
|
|
9
|
-
const
|
|
10
|
-
|
|
30
|
+
const i = c(t).getTime();
|
|
31
|
+
e = Number.isNaN(i) ? void 0 : i;
|
|
11
32
|
}
|
|
12
|
-
if (
|
|
13
|
-
|
|
33
|
+
if (e === void 0 || e < u || e > H) {
|
|
34
|
+
_(n, `[TransactionListBlock] drilldown_data.${r} is unparseable or out of range (${typeof t})`);
|
|
14
35
|
return;
|
|
15
36
|
}
|
|
16
|
-
return new Date(
|
|
17
|
-
},
|
|
18
|
-
if (t?.variant !==
|
|
37
|
+
return new Date(e);
|
|
38
|
+
}, D = (t) => {
|
|
39
|
+
if (t?.variant !== a.SUMMARY_HEADER) return;
|
|
19
40
|
const r = t?.drilldown_data;
|
|
20
41
|
if (!r) return;
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
Object.keys(r).length > 0 &&
|
|
42
|
+
const n = l(r.amount);
|
|
43
|
+
if (n === void 0) {
|
|
44
|
+
Object.keys(r).length > 0 && _(r, "[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.");
|
|
24
45
|
return;
|
|
25
46
|
}
|
|
26
47
|
return {
|
|
27
|
-
amount:
|
|
28
|
-
startDate:
|
|
29
|
-
endDate:
|
|
30
|
-
count:
|
|
48
|
+
amount: n,
|
|
49
|
+
startDate: d(r.start_date, "start_date", r),
|
|
50
|
+
endDate: d(r.end_date, "end_date", r),
|
|
51
|
+
count: p(r.count)
|
|
31
52
|
};
|
|
32
53
|
};
|
|
33
54
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
E as HELP_HEADER_VARIANT,
|
|
56
|
+
a as TRANSACTION_LIST_VARIANTS,
|
|
57
|
+
N as getTransactionListDrawerTitle,
|
|
58
|
+
b as readHelpHeader,
|
|
59
|
+
D as readSummary
|
|
37
60
|
};
|
|
38
61
|
|
|
39
62
|
//# sourceMappingURL=layout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/layout.ts"],"sourcesContent":["import { parseISO } from 'date-fns/parseISO'\n\nimport type {\n Beat,\n DrilldownData,\n GlobalCopy,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../../core'\nimport { readHelp, toText, type HelpContent } from '../HelpBlock/layout'\n\ntype DrilldownCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA\n\n/** The transaction_list_block CTA variants. */\nexport const TRANSACTION_LIST_VARIANTS = {\n SUMMARY_HEADER: 'summary_header',\n GENERIC_LIST: 'generic_list',\n /** Opens the list under the beat's title, description and \"Learn More\". */\n HELP_HEADER: 'help_header',\n} as const\n\nexport const HELP_HEADER_VARIANT = TRANSACTION_LIST_VARIANTS.HELP_HEADER\n\n/** Drawer titles for variants that don't use the beat's own title. Add new variants here. */\nconst variantTitles = (copy: GlobalCopy): Record<string, string> => ({\n [TRANSACTION_LIST_VARIANTS.GENERIC_LIST]: copy.transactions?.transactions_title ?? '',\n [TRANSACTION_LIST_VARIANTS.HELP_HEADER]: copy.transactions?.transactions_title ?? '',\n})\n\n/**\n * Drawer title: the variant's title when it has one (`generic_list` and `help_header` ->\n * \"Transactions\"; the help header repeats the beat's title inside the drawer), otherwise the\n * beat's own localized title (`summary_header`, `standard`, or no variant).\n */\nexport const getTransactionListDrawerTitle = (\n variant: string | null | undefined,\n copy: GlobalCopy,\n beat?: Beat,\n): string => {\n const titles = variantTitles(copy)\n if (variant && Object.hasOwn(titles, variant)) return titles[variant] ?? ''\n\n return beat?.insights_payload?.title ?? ''\n}\n\nexport interface HelpHeaderContent {\n /** Pre-localized HTML under the title, from the payload's `drilldown_data.description_html`. */\n descriptionHtml?: string\n /** The \"Learn More\" link and the help drawer it opens; absent when the beat carries no help. */\n learnMore?: HelpContent & { label: string }\n}\n\n/**\n * The help-header variant's text, read from the payload's `drilldown_data` (shared by every CTA\n * of the card): `description_html`, and `help_label` with the `help_title` / `help_html` that\n * `readHelp` reads. Only the `help_header` variant renders the block.\n */\nexport const readHelpHeader = (\n cta: DrilldownCta | undefined,\n drilldown: DrilldownData | undefined,\n): HelpHeaderContent | undefined => {\n if (cta?.variant !== HELP_HEADER_VARIANT) return undefined\n\n const label = toText(drilldown?.help_label)\n const help = readHelp(drilldown)\n\n return {\n descriptionHtml: toText(drilldown?.description_html),\n ...(label && help && { learnMore: { ...help, label } }),\n }\n}\n\nexport interface TransactionListSummary {\n /** Headline figure (e.g. total withdrawn). */\n amount: number\n /** Validated range endpoints; rendered as `{start} – {end}`. Omitted when the payload value is\n * missing or unparseable (so the drawer never crashes on an Invalid Date). */\n startDate?: Date\n endDate?: Date\n /** Number of transactions for the pill, from the CTA's `drilldown_data.count`. */\n count?: number\n}\n\nconst toFiniteNumber = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isFinite(value) ? value : undefined\n\n// `> 0`: the card only shows with >= 1 guid, so a `count` of 0 is dropped and falls back to the\n// guid count rather than rendering \"0 transactions\".\nconst toCount = (value: unknown): number | undefined =>\n typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined\n\n// Sane epoch window so a bad/typo payload can't render a far-past/future date.\nconst EPOCH_MIN = Date.UTC(2000, 0, 1)\nconst EPOCH_MAX = Date.UTC(2100, 0, 1)\n\n// `readSummary` runs on every observer re-render (no `useMemo` by design), so warn at most once per\n// distinct payload object instead of on every render. Keyed on the `drilldown_data` object, which is\n// a stable reference across re-renders of the same beat.\nconst warnedPayloads = new WeakSet<object>()\nconst warnOncePerPayload = (source: object, message: string): void => {\n if (warnedPayloads.has(source)) return\n warnedPayloads.add(source)\n console.warn(message)\n}\n\n/**\n * Parse a payload date value to a validated `Date`, or `undefined`. Accepts unix seconds or\n * milliseconds (auto-detected) and ISO strings. Fails closed (no throw): an unparseable or\n * out-of-range value returns undefined and warns, so `formatDate`/`intlFormat` never sees an Invalid\n * Date (which throws `RangeError` and takes down the whole drawer render).\n */\nconst toDate = (value: unknown, field: string, source: object): Date | undefined => {\n // Missing/empty is a normal \"no range\" case — return quietly, don't warn.\n if (value === undefined || value === null || value === '') return undefined\n\n let ms: number | undefined\n if (typeof value === 'number' && Number.isFinite(value)) {\n // < 1e12 is treated as seconds (1e12 ms is year 33658). Trade-off: genuine ms timestamps from\n // ~2000-2001 would be misread as seconds and fall outside the window below (dropped, not shown).\n ms = value < 1e12 ? value * 1000 : value\n } else if (typeof value === 'string') {\n const parsed = parseISO(value).getTime()\n ms = Number.isNaN(parsed) ? undefined : parsed\n }\n\n if (ms === undefined || ms < EPOCH_MIN || ms > EPOCH_MAX) {\n warnOncePerPayload(\n source,\n `[TransactionListBlock] drilldown_data.${field} is unparseable or out of range (${typeof value})`,\n )\n return undefined\n }\n return new Date(ms)\n}\n\n/**\n * Summary-header figures for the drawer, read from the clicked CTA's `drilldown_data` (the backend\n * hangs a drilldown's own data off the CTA that opens it). Fails closed throughout: only the\n * `summary_header` variant renders a header (so figures from a different CTA that `getDynamicCta…`\n * fell back to can't be misattributed), then without a finite `amount` there is still no header, and\n * each date is validated to a real `Date` or dropped — an unparseable value never reaches\n * `formatDate` (which throws on an Invalid Date).\n *\n * `drilldown_data` fields: `amount` (number), `start_date`/`end_date` (unix seconds|ms or ISO),\n * `count` (number of transactions).\n */\nexport const readSummary = (cta: DrilldownCta | undefined): TransactionListSummary | undefined => {\n // Defense-in-depth on financial figures: only the summary-header variant shows the card.\n if (cta?.variant !== TRANSACTION_LIST_VARIANTS.SUMMARY_HEADER) return undefined\n\n const source = cta?.drilldown_data\n if (!source) return undefined\n\n const amount = toFiniteNumber(source.amount)\n if (amount === undefined) {\n // `drilldown_data` present but no usable amount -> surface the likely contract drift (field\n // rename) instead of a silently missing header.\n if (Object.keys(source).length > 0) {\n warnOncePerPayload(\n source,\n '[TransactionListBlock] drilldown_data has no finite `amount` — no summary header.',\n )\n }\n return undefined\n }\n\n return {\n amount,\n startDate: toDate(source.start_date, 'start_date', source),\n endDate: toDate(source.end_date, 'end_date', source),\n count: toCount(source.count),\n }\n}\n"],"mappings":";;AAeA,IAAa,IAA4B;AAAA,EACvC,gBAAgB;AAAA,EAChB,cAAc;AAAA,EAEd,aAAa;AACf,GAEa,IAAsB,EAA0B,aAGvD,IAAA,CAAiB,OAA8C;AAAA,EAClE,CAAA,EAA0B,YAAA,GAAe,EAAK,cAAc,sBAAsB;AAAA,EAClF,CAAA,EAA0B,WAAA,GAAc,EAAK,cAAc,sBAAsB;AACpF,IAOa,IAAA,CACX,GACA,GACA,MACW;AACX,QAAM,IAAS,EAAc,CAAI;AACjC,SAAI,KAAW,OAAO,OAAO,GAAQ,CAAO,IAAU,EAAO,CAAA,KAAY,KAElE,GAAM,kBAAkB,SAAS;AAC1C,GAca,IAAA,CACX,GACA,MACkC;AAClC,MAAI,GAAK,YAAY,EAAqB;AAE1C,QAAM,IAAQ,EAAO,GAAW,UAAU,GACpC,IAAO,EAAS,CAAS;AAE/B,SAAO;AAAA,IACL,iBAAiB,EAAO,GAAW,gBAAgB;AAAA,IACnD,GAAI,KAAS,KAAQ,EAAE,WAAW;AAAA,MAAE,GAAG;AAAA,MAAM,OAAA;AAAA,IAAM,EAAE;AAAA,EACvD;AACF,GAaM,IAAA,CAAkB,MACtB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,CAAM;AAAA,IACnD,OAAO,EAAQ,EAAO,KAAK;AAAA,EAC7B;AACF"}
|
|
@@ -20,7 +20,8 @@ var _ = {
|
|
|
20
20
|
PAYOFF_CALCULATOR_ACTION_BLOCK: "payoff_calculator_block",
|
|
21
21
|
BUDGET_DETAILS_ACTION_BLOCK: "budget_details_block",
|
|
22
22
|
ACCOUNT_DETAILS_ACTION_BLOCK: "account_details_block",
|
|
23
|
-
ACCOUNT_LIST_ACTION_BLOCK: "account_list_block"
|
|
23
|
+
ACCOUNT_LIST_ACTION_BLOCK: "account_list_block",
|
|
24
|
+
HELP_ACTION_BLOCK: "help_block"
|
|
24
25
|
};
|
|
25
26
|
export {
|
|
26
27
|
_ as actionBlocksKey
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK: 'subscription_status_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n SAFETY_NET_ACTION_BLOCK: 'safety_net_block',\n OVERDRAFT_ACTION_BLOCK: 'transparent_overdraft_block',\n CREDIT_UTILIZATION_ACTION_BLOCK: 'credit_utilization_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n BUDGET_DETAILS_ACTION_BLOCK: 'budget_details_block',\n ACCOUNT_DETAILS_ACTION_BLOCK: 'account_details_block',\n ACCOUNT_LIST_ACTION_BLOCK: 'account_list_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,wCAAwC;AAAA,EACxC,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,2BAA2B;
|
|
1
|
+
{"version":3,"file":"actionBlocksKey.es.js","names":[],"sources":["../../../src/insights-v2/mappings/actionBlocksKey.ts"],"sourcesContent":["// Keys for the drawer drilldown registry in `blocks.ts`, extracted into their own module.\n//\n// Why: chart blocks (e.g. BarchartBlock, DoubleBarChartBlock) need\n// `TRANSCATION_HISTORY_ACTION_BLOCK` to tag a chart bar's drilldown context, but they are\n// themselves re-exported through `../blocks` -> `mappings/blocks.ts` imports from that same\n// barrel to build its `blocks` registry. Importing the key straight from `mappings/blocks.ts`\n// closed that loop into a circular import: evaluating `mappings/blocks.ts` pulled in the\n// `blocks` barrel, which (before it got to `ComponentBlocks`/`AccountBlock`) loaded\n// `BarchartBlock`, which imported back into the still-initializing `mappings/blocks.ts` —\n// tripping a \"Cannot access 'AccountBlock' before initialization\" TDZ error in Storybook/Vite.\n//\n// Keeping the keys here (no dependency on `mappings/blocks.ts`) lets chart blocks reference\n// them without re-entering that module.\n//\n// Names follow ditto: its registry ends every CTA block in `_block` and the V2 envelope copies those\n// names verbatim (`transaction_details_block`, `contact_support_block`, `make_transfer_block`).\nexport const actionBlocksKey = {\n PLACEHOLDER_ACTION_BLOCK: 'placeholder_block',\n MAKE_TRANSFER_ACTION_BLOCK: 'make_transfer_block',\n TRANSCATION_HISTORY_ACTION_BLOCK: 'transaction_history_block',\n TRANSACTION_DETAILS_ACTION_BLOCK: 'transaction_details_block',\n CONTACT_SUPPORT_ACTION_BLOCK: 'contact_support_block',\n FEEDBACK_MODAL_ACTION_BLOCK: 'feedback_modal_block',\n CONNECTION_DETAIL_ACTION_BLOCK: 'connection_detail_block',\n CONNECT_WIDGET_ACTION_BLOCK: 'connect_widget_block',\n SURVEY_MODAL_ACTION_BLOCK: 'survey_modal_block',\n SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK: 'subscription_status_modal_block',\n RECURRING_TRANSACTION_ACTION_BLOCK: 'recurring_transaction_block',\n TRANSACTION_LIST_ACTION_BLOCK: 'transaction_list_block',\n REMAINING_CASH_ACTION_BLOCK: 'remaining_cash_block',\n AMOUNT_INPUT_MODAL_ACTION_BLOCK: 'amount_input_modal_block',\n SAFETY_NET_ACTION_BLOCK: 'safety_net_block',\n OVERDRAFT_ACTION_BLOCK: 'transparent_overdraft_block',\n CREDIT_UTILIZATION_ACTION_BLOCK: 'credit_utilization_block',\n EMERGENCY_SAVINGS_ACTION_BLOCK: 'emergency_savings_block',\n PAYOFF_CALCULATOR_ACTION_BLOCK: 'payoff_calculator_block',\n BUDGET_DETAILS_ACTION_BLOCK: 'budget_details_block',\n ACCOUNT_DETAILS_ACTION_BLOCK: 'account_details_block',\n ACCOUNT_LIST_ACTION_BLOCK: 'account_list_block',\n HELP_ACTION_BLOCK: 'help_block',\n}\n"],"mappings":"AAgBA,IAAa,IAAkB;AAAA,EAC7B,0BAA0B;AAAA,EAC1B,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAAA,EAC9B,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAAA,EAC3B,wCAAwC;AAAA,EACxC,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,2BAA2B;AAAA,EAC3B,mBAAmB;AACrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContactSupportActionBlock as
|
|
2
|
-
import { hasDrawerBlock as
|
|
1
|
+
import { ContactSupportActionBlock as l } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
2
|
+
import { hasDrawerBlock as mo } from "./hasDrawerBlock.es.js";
|
|
3
3
|
import { actionBlocksKey as o } from "./actionBlocksKey.es.js";
|
|
4
4
|
import { BarchartBlock as _ } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
5
5
|
import { DoubleBarChartBlock as s } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
@@ -12,17 +12,17 @@ import A from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.e
|
|
|
12
12
|
import { BudgetBlock as O } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
13
13
|
import f from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
14
14
|
import N from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
15
|
+
import I from "../blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js";
|
|
16
|
+
import d from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
17
17
|
import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
18
18
|
import L from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
19
|
-
import
|
|
20
|
-
import { TransactionBlock as
|
|
19
|
+
import P from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
20
|
+
import { TransactionBlock as g } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
21
21
|
import b from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
22
22
|
import S from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
23
23
|
import D from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
24
|
-
import { SVGImageBlock as
|
|
25
|
-
import { FeedbackModalActionBlock as
|
|
24
|
+
import { SVGImageBlock as E } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
25
|
+
import { FeedbackModalActionBlock as h } from "../actionBlocks/FeedbackModalActionBlock.es.js";
|
|
26
26
|
import { ConnectionDetailActionBlock as K } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
|
|
27
27
|
import { ConnectWidgetActionBlock as R } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
|
|
28
28
|
import { SurveyModalActionBlock as v } from "../actionBlocks/SurveyModalActionBlock.es.js";
|
|
@@ -31,26 +31,27 @@ import { PlaceholderActionBlock as M } from "../actionBlocks/PlaceholderActionBl
|
|
|
31
31
|
import { getMakeTransferDrawerTitle as U } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
32
32
|
import { MakeTransferActionBlockLayer as w } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
33
33
|
import { getDrawerHeaderTitle as G } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
34
|
-
import { TransactionDetailsBlock as
|
|
34
|
+
import { TransactionDetailsBlock as H } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
35
35
|
import { useTransactionDetailsPrepare as c } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
36
|
-
import { TransactionHistoryBlock as
|
|
36
|
+
import { TransactionHistoryBlock as F } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
37
37
|
import { useTransactionHistoryPrepare as Y } from "../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js";
|
|
38
38
|
import { useRecurringTransactionPrepare as m } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
39
39
|
import { RecurringTransactionBlock as x } from "../actionBlocks/RecurringTransactionBlock/RecurringTransactionBlock.es.js";
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
40
|
+
import { HelpBlock as V } from "../actionBlocks/HelpBlock/HelpBlock.es.js";
|
|
41
|
+
import { getTransactionListDrawerTitle as z } from "../actionBlocks/TransactionListBlock/layout.es.js";
|
|
42
|
+
import { TransactionListBlock as W } from "../actionBlocks/TransactionListBlock/TransactionListBlock.es.js";
|
|
43
|
+
import { RemainingCashBlock as q } from "../actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js";
|
|
44
|
+
import { AmountInputModalBlock as p } from "../actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js";
|
|
45
|
+
import { OverdraftBlock as Z, useOverdraftPrepare as j } from "../actionBlocks/OverdraftBlock/OverdraftBlock.es.js";
|
|
46
|
+
import { AccountListBlock as J } from "../actionBlocks/AccountListBlock/AccountListBlock.es.js";
|
|
47
|
+
import { useAccountListPrepare as Q } from "../actionBlocks/AccountListBlock/useAccountListPrepare.es.js";
|
|
48
|
+
import { EmergencySavingsBlock as X } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
|
|
49
|
+
import { CreditUtilizationBlock as $ } from "../actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js";
|
|
50
|
+
import { useCreditUtilizationPrepare as oo } from "../actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js";
|
|
51
|
+
import { PayoffCalculatorBlock as to, usePayoffCalculatorPrepare as ro } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
|
|
52
|
+
import { BudgetDetailsBlock as eo } from "../actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js";
|
|
53
|
+
import { AccountDetailsBlock as io } from "../actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js";
|
|
54
|
+
import { useAccountDetailsPrepare as ao } from "../actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js";
|
|
54
55
|
var i = (e) => {
|
|
55
56
|
}, t = (e) => ({
|
|
56
57
|
get Component() {
|
|
@@ -65,7 +66,7 @@ var i = (e) => {
|
|
|
65
66
|
get presentation() {
|
|
66
67
|
return e().presentation;
|
|
67
68
|
}
|
|
68
|
-
}),
|
|
69
|
+
}), mt = {
|
|
69
70
|
[o.PLACEHOLDER_ACTION_BLOCK]: t(() => ({
|
|
70
71
|
Component: M,
|
|
71
72
|
usePrepare: i,
|
|
@@ -77,12 +78,12 @@ var i = (e) => {
|
|
|
77
78
|
title: U
|
|
78
79
|
})),
|
|
79
80
|
[o.TRANSCATION_HISTORY_ACTION_BLOCK]: t(() => ({
|
|
80
|
-
Component:
|
|
81
|
+
Component: F,
|
|
81
82
|
usePrepare: Y,
|
|
82
83
|
title: G
|
|
83
84
|
})),
|
|
84
85
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: t(() => ({
|
|
85
|
-
Component:
|
|
86
|
+
Component: H,
|
|
86
87
|
usePrepare: c,
|
|
87
88
|
title: () => "Transaction Details"
|
|
88
89
|
})),
|
|
@@ -92,17 +93,17 @@ var i = (e) => {
|
|
|
92
93
|
title: (e, r) => r.recurring?.expense_details ?? ""
|
|
93
94
|
})),
|
|
94
95
|
[o.REMAINING_CASH_ACTION_BLOCK]: t(() => ({
|
|
95
|
-
Component:
|
|
96
|
+
Component: q,
|
|
96
97
|
usePrepare: m,
|
|
97
98
|
title: (e, r) => r.insights_feed?.remaining_cash?.title ?? ""
|
|
98
99
|
})),
|
|
99
100
|
[o.CONTACT_SUPPORT_ACTION_BLOCK]: t(() => ({
|
|
100
|
-
Component:
|
|
101
|
+
Component: l,
|
|
101
102
|
usePrepare: i,
|
|
102
103
|
title: (e, r) => r.help?.request_support ?? ""
|
|
103
104
|
})),
|
|
104
105
|
[o.FEEDBACK_MODAL_ACTION_BLOCK]: t(() => ({
|
|
105
|
-
Component:
|
|
106
|
+
Component: h,
|
|
106
107
|
usePrepare: i,
|
|
107
108
|
presentation: "modal"
|
|
108
109
|
})),
|
|
@@ -126,56 +127,60 @@ var i = (e) => {
|
|
|
126
127
|
presentation: "modal"
|
|
127
128
|
})),
|
|
128
129
|
[o.TRANSACTION_LIST_ACTION_BLOCK]: t(() => ({
|
|
129
|
-
Component:
|
|
130
|
+
Component: W,
|
|
130
131
|
usePrepare: c,
|
|
131
|
-
title:
|
|
132
|
+
title: z
|
|
132
133
|
})),
|
|
133
134
|
[o.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: t(() => ({
|
|
134
|
-
Component:
|
|
135
|
+
Component: p,
|
|
135
136
|
presentation: "modal",
|
|
136
137
|
usePrepare: i
|
|
137
138
|
})),
|
|
138
139
|
[o.SAFETY_NET_ACTION_BLOCK]: t(() => ({
|
|
139
|
-
Component:
|
|
140
|
+
Component: p,
|
|
140
141
|
presentation: "modal",
|
|
141
142
|
usePrepare: i
|
|
142
143
|
})),
|
|
143
144
|
[o.OVERDRAFT_ACTION_BLOCK]: t(() => ({
|
|
144
|
-
Component:
|
|
145
|
-
usePrepare:
|
|
145
|
+
Component: Z,
|
|
146
|
+
usePrepare: j,
|
|
146
147
|
title: (e, r, a) => a?.insights_payload?.title ?? ""
|
|
147
148
|
})),
|
|
148
149
|
[o.CREDIT_UTILIZATION_ACTION_BLOCK]: t(() => ({
|
|
149
|
-
Component:
|
|
150
|
-
usePrepare:
|
|
150
|
+
Component: $,
|
|
151
|
+
usePrepare: oo,
|
|
151
152
|
title: (e, r) => r.insights_feed?.credit_utilization?.title ?? ""
|
|
152
153
|
})),
|
|
153
154
|
[o.EMERGENCY_SAVINGS_ACTION_BLOCK]: t(() => ({
|
|
154
|
-
Component:
|
|
155
|
+
Component: X,
|
|
155
156
|
usePrepare: i,
|
|
156
157
|
title: (e, r, a) => a?.insights_payload?.title ?? ""
|
|
157
158
|
})),
|
|
158
159
|
[o.PAYOFF_CALCULATOR_ACTION_BLOCK]: t(() => ({
|
|
159
|
-
Component:
|
|
160
|
-
usePrepare:
|
|
160
|
+
Component: to,
|
|
161
|
+
usePrepare: ro,
|
|
161
162
|
title: (e, r) => r.insights_feed?.payoff_calculator?.title ?? ""
|
|
162
163
|
})),
|
|
163
164
|
[o.BUDGET_DETAILS_ACTION_BLOCK]: t(() => ({
|
|
164
|
-
Component:
|
|
165
|
+
Component: eo,
|
|
165
166
|
usePrepare: i,
|
|
166
167
|
title: (e, r, a) => a?.insights_payload?.title || r.budgets?.details_title || ""
|
|
167
168
|
})),
|
|
168
169
|
[o.ACCOUNT_DETAILS_ACTION_BLOCK]: t(() => ({
|
|
169
|
-
Component:
|
|
170
|
-
usePrepare:
|
|
170
|
+
Component: io,
|
|
171
|
+
usePrepare: ao,
|
|
171
172
|
title: (e, r) => r.accounts?.account_details ?? ""
|
|
172
173
|
})),
|
|
173
174
|
[o.ACCOUNT_LIST_ACTION_BLOCK]: t(() => ({
|
|
174
|
-
Component:
|
|
175
|
-
usePrepare:
|
|
175
|
+
Component: J,
|
|
176
|
+
usePrepare: Q,
|
|
176
177
|
title: (e, r) => r.insights_feed?.account_list?.title ?? ""
|
|
178
|
+
})),
|
|
179
|
+
[o.HELP_ACTION_BLOCK]: t(() => ({
|
|
180
|
+
Component: V,
|
|
181
|
+
usePrepare: i
|
|
177
182
|
}))
|
|
178
|
-
},
|
|
183
|
+
}, pt = {
|
|
179
184
|
account_block: k,
|
|
180
185
|
account_switch_block: A,
|
|
181
186
|
direct_deposit_block: T,
|
|
@@ -187,22 +192,22 @@ var i = (e) => {
|
|
|
187
192
|
double_progress_bar_block: B,
|
|
188
193
|
goals_block: N,
|
|
189
194
|
image_block: D,
|
|
190
|
-
merchant_block:
|
|
191
|
-
no_spend_days_block:
|
|
195
|
+
merchant_block: I,
|
|
196
|
+
no_spend_days_block: d,
|
|
192
197
|
repeating_transaction_block: n,
|
|
193
198
|
save_extra_block: L,
|
|
194
|
-
savings_amount_block:
|
|
199
|
+
savings_amount_block: P,
|
|
195
200
|
step_chart_block: C,
|
|
196
|
-
svg_image_block:
|
|
201
|
+
svg_image_block: E,
|
|
197
202
|
upcoming_bill_block: n,
|
|
198
203
|
upcoming_subscription_block: b,
|
|
199
204
|
withdrawal_block: S,
|
|
200
|
-
transaction_block:
|
|
205
|
+
transaction_block: g
|
|
201
206
|
};
|
|
202
207
|
export {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
208
|
+
mt as actionBlocks,
|
|
209
|
+
pt as blocks,
|
|
210
|
+
mo as hasDrawerBlock
|
|
206
211
|
};
|
|
207
212
|
|
|
208
213
|
//# sourceMappingURL=blocks.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport { OverdraftBlock, useOverdraftPrepare } from '../actionBlocks/OverdraftBlock'\nimport { AccountListBlock, useAccountListPrepare } from '../actionBlocks/AccountListBlock'\nimport { EmergencySavingsBlock } from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock } from '../actionBlocks/BudgetDetailsBlock'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety-net reminder (secondary CTA). ditto names a dedicated\n // `safety_net_block` with no CTA variant, so it opens the same amount-input modal, which reads the\n // safety_net variant from the block name (see resolveAmountInputVariant).\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": donut summary, legend and the per-card list. Loads accounts\n // for the institution logos; the rows themselves ride on the beat.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => copy.insights_feed?.credit_utilization?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n usePrepare: noop,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n usePrepare: usePayoffCalculatorPrepare,\n title: (_variant, copy) => copy.insights_feed?.payoff_calculator?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n usePrepare: noop,\n title: (_variant, copy, beat) =>\n beat?.insights_payload?.title || copy.budgets?.details_title || '',\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n usePrepare: useAccountListPrepare,\n title: (_variant, copy) => copy.insights_feed?.account_list?.title ?? '',\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,aAAa;AACf,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AACF,IAEa,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B,EAAA,OAAiB;AAAA,IAC3D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf,EAAE;AAAA,EACD,CAAA,EAAgB,0BAAA,GAA6B,EAAA,OAAiB;AAAA,IAC7D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT,EAAE;AAAA,EACD,CAAA,EAAgB,gCAAA,GAAmC,EAAA,OAAiB;AAAA,IACnE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT,EAAE;AAAA,EACD,CAAA,EAAgB,gCAAA,GAAmC,EAAA,OAAiB;AAAA,IACnE,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAA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WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,UAAU,mBAAmB;AAAA,EAC/D,EAAE;AAAA,EAED,CAAA,EAAgB,yBAAA,GAA4B,EAAA,OAAiB;AAAA,IAC5D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,cAAc,SAAS;AAAA,EACxE,EAAE;AACJ,GAEa,KAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
|
|
1
|
+
{"version":3,"file":"blocks.es.js","names":[],"sources":["../../../src/insights-v2/mappings/blocks.ts"],"sourcesContent":["import {\n AccountBlock,\n AccountSwitchBlock,\n BarchartBlock,\n BudgetBlock,\n DebtsBlock,\n DetailedAccountBlock,\n DonutChartBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WithdrawalBlock,\n TransactionBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport { TransactionHistoryBlock } from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport { RemainingCashBlock } from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport { OverdraftBlock, useOverdraftPrepare } from '../actionBlocks/OverdraftBlock'\nimport { AccountListBlock, useAccountListPrepare } from '../actionBlocks/AccountListBlock'\nimport { EmergencySavingsBlock } from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock } from '../actionBlocks/BudgetDetailsBlock'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\nimport { HelpBlock } from '../actionBlocks/HelpBlock'\n// Keys live in ./actionBlocksKey (imported directly by chart blocks/tests too) to avoid a\n// circular import between this module and the chart blocks — see that file for details.\nimport { actionBlocksKey } from './actionBlocksKey'\n\n// Drilldown indexes are not passed down: action blocks read them from\n// InsightsV2Store (useInsightsV2Store().actionDrawer).\nexport interface ActionBlockProps {\n beat: Beat\n}\n\nconst noop = (_: ActionBlockProps) => {}\n\n// Re-exported so existing `hasDrawerBlock` imports from this module keep working.\nexport { hasDrawerBlock } from './hasDrawerBlock'\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // Resolves the drawer title from the clicked CTA's variant + copy, with the beat available\n // for blocks that title from beat fields (e.g. transaction-list reads insights_payload.title).\n // Falls back to the CTA label when the resolver returns an empty string / is absent.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends Add\n// `usePrepare` when the block needs to load data before rendering.\n\n/**\n * A registry entry whose fields read their imports when used, not when this module loads. Some\n * registered blocks render `TransactionDetails`, whose embedded card mounts `ActionBlockLayer`,\n * which imports this registry: when one of those blocks loads first, its own import is not\n * initialised yet while this module evaluates, so a value copied at load would be `undefined`\n * (or throw under native ES modules). Reading on access sees the finished import.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get title() {\n return resolve().title\n },\n get presentation() {\n return resolve().presentation\n },\n})\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: liveEntry(() => ({\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n })),\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: liveEntry(() => ({\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n })),\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionHistoryBlock,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.insights_feed?.remaining_cash?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety-net reminder (secondary CTA). ditto names a dedicated\n // `safety_net_block` with no CTA variant, so it opens the same amount-input modal, which reads the\n // safety_net variant from the block name (see resolveAmountInputVariant).\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": donut summary, legend and the per-card list. Loads accounts\n // for the institution logos; the rows themselves ride on the beat.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => copy.insights_feed?.credit_utilization?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n usePrepare: noop,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Monthly Credit Card Interest Summary's \"Learn how to save\": the credit card payoff calculator.\n [actionBlocksKey.PAYOFF_CALCULATOR_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffCalculatorBlock,\n usePrepare: usePayoffCalculatorPrepare,\n title: (_variant, copy) => copy.insights_feed?.payoff_calculator?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n usePrepare: noop,\n title: (_variant, copy, beat) =>\n beat?.insights_payload?.title || copy.budgets?.details_title || '',\n })),\n // The accounts widget's account details (header, trend chart, tabs, connection, actions) for the\n // beat's primary account. Shared by every beat that opens an account.\n [actionBlocksKey.ACCOUNT_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountDetailsBlock,\n usePrepare: useAccountDetailsPrepare,\n title: (_variant, copy) => copy.accounts?.account_details ?? '',\n })),\n // Monthly Obligations Status's account list: the beat's calculation and the accounts behind it.\n [actionBlocksKey.ACCOUNT_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: AccountListBlock,\n usePrepare: useAccountListPrepare,\n title: (_variant, copy) => copy.insights_feed?.account_list?.title ?? '',\n })),\n // A beat's \"Learn More\": its pre-localized help title and body from the payload's\n // `drilldown_data`. The drawer title is the CTA label.\n [actionBlocksKey.HELP_ACTION_BLOCK]: liveEntry(() => ({\n Component: HelpBlock,\n usePrepare: noop,\n })),\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n direct_deposit_block: DetailedAccountBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n debts_block: DebtsBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,aAAa;AACf,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AACF,IAEa,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B,EAAA,OAAiB;AAAA,IAC3D,WAAW;AAAA,IACX,YAAY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