@mx-cartographer/experiences 9.7.43 → 9.7.45
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/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js +3 -3
- package/dist/accounts/index.es.js +4 -4
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +32 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/index.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.d.ts +3 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.es.js +10 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.d.ts +2 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js +20 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js.map +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +73 -66
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionList.es.js +52 -52
- package/dist/transactions/components/shared/TransactionList.es.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [9.7.45] - 10-26-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - transaction lists that showed no rows (MEW-4023)
|
|
4
|
+
|
|
5
|
+
## [9.7.44] - 10-26-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - `account_details_block` action block: the accounts widget's account details (header with trend chart, Transactions / Account Details tabs, connection status, actions) in the action drawer for the beat's primary account, titled from `accounts.account_details`. An account the store cannot resolve shows the error message rather than an earlier selection. Missing Interest Rate fixture, stories, tests and `docs/action-blocks/account-details-block.md` (MEW2-2633)
|
|
8
|
+
|
|
1
9
|
## [9.7.43] - 10-26-2026
|
|
2
10
|
|
|
3
11
|
- **ADDED** - Monthly Spend to Income Comparison on Insights 2.0 (WEC-2101, Figma 1941:137446). `DoubleBarChartBlock` reads ditto's `instance_slot.data` slots only, as `BarchartBlock` does — `series` (the stored data_series, a Spend and an Income row per month) and `additional_data` (the legend, `{ label, value, value_type }`); a legend item with no `value` shows its label alone, never $0.00. The `DoubleBarChart` stories now feed `instance_slot.data`. `layout.ts` gains ditto's `spend_to_income` variant (the existing spend-to-income palette, now matched with `Object.hasOwn`). The drawer's double-bar view is built: `TransactionHistoryBlock` `monthly_spend_to_income` entry (`top: 'doubleBar'`) with one tab per month (`getDefaultSelection` counts the comparison columns), Spend / Income sub-tabs between the chart and the list (`TransactionDrillDown` `subTabs`), the selected month's totals in the legend, and `comparisonGuidsStrategy` — the selected month's spend or income transactions by the bar's stored guids, failing closed when the bar names none. `buildComparisonSeries` carries each bar's `mainGuids` / `comparisonGuids` and `DoubleBarChart` takes a `selectedIndex` and a `legendPosition` (as `BarChartV2`: below the chart on the card, above it in the drawer). `DoubleBarChart` stories per state from tupac's envelopes.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useGlobalCopyStore as e } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import c from "../../../../common/components/drawer/Drawer.es.js";
|
|
3
3
|
import l from "../../../../trends/components/TrendsChart.es.js";
|
|
4
|
-
import s from "./
|
|
5
|
-
import i from "./
|
|
4
|
+
import s from "./AccountDetailsHeader.es.js";
|
|
5
|
+
import i from "./AccountDetailsContent.es.js";
|
|
6
6
|
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
7
7
|
var _ = ({ isOpen: r, onClose: a }) => {
|
|
8
8
|
const { accounts: t } = e();
|
|
@@ -11,7 +11,7 @@ var _ = ({ isOpen: r, onClose: a }) => {
|
|
|
11
11
|
isOpen: r,
|
|
12
12
|
onClose: a,
|
|
13
13
|
title: t.account_details,
|
|
14
|
-
children: [/* @__PURE__ */ o(
|
|
14
|
+
children: [/* @__PURE__ */ o(s, { ChartComponent: l }), /* @__PURE__ */ o(i, {})]
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
@@ -3,16 +3,16 @@ import { useAccountUiStore as i } from "./hooks/useUiStore.es.js";
|
|
|
3
3
|
import { FieldType as r } from "./constants/Accounts.es.js";
|
|
4
4
|
import { getAccountBalanceDetails as a, getAccountDetailFields as m } from "./utils/AccountFields.es.js";
|
|
5
5
|
import { useGetMergeableAccounts as s } from "./hooks/useGetMergeableAccounts.es.js";
|
|
6
|
-
import l from "./components/detailsdrawer/Accounts/
|
|
7
|
-
import p from "./components/detailsdrawer/Accounts/
|
|
6
|
+
import l from "./components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
7
|
+
import p from "./components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
8
8
|
import g from "./components/detailsdrawer/Accounts/AccountDetailsDrawer.es.js";
|
|
9
9
|
import M from "./AccountsWidget.es.js";
|
|
10
10
|
import C from "./AccountsMiniWidget.es.js";
|
|
11
11
|
import b from "./ConnectMiniWidget.es.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
p as AccountDetailsContent,
|
|
14
14
|
g as AccountDetailsDrawer,
|
|
15
|
-
|
|
15
|
+
l as AccountDetailsHeader,
|
|
16
16
|
C as AccountsMiniWidget,
|
|
17
17
|
M as AccountsWidget,
|
|
18
18
|
b as ConnectMiniWidget,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionBlockProps } from '../../mappings/blocks';
|
|
2
|
+
/**
|
|
3
|
+
* Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,
|
|
4
|
+
* name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,
|
|
5
|
+
* actions) for the beat's account. Those components read the account store's selection, so the
|
|
6
|
+
* beat's account is selected here first and nothing renders until the selection matches and the
|
|
7
|
+
* members and institutions are in (the connection section reads the member's status): a guid the
|
|
8
|
+
* store cannot resolve shows the error message, never the previously selected account.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AccountDetailsBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useAccountStore as b, useGlobalCopyStore as S, useGlobalStore as A } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import r from "../../../common/components/Loader.es.js";
|
|
3
|
+
import g from "../../../trends/components/TrendsChart.es.js";
|
|
4
|
+
import x from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.es.js";
|
|
5
|
+
import { resolveAccount as C } from "./layout.es.js";
|
|
6
|
+
import h from "../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent.es.js";
|
|
7
|
+
import { useEffect as _ } from "react";
|
|
8
|
+
import { observer as k } from "mobx-react-lite";
|
|
9
|
+
import n from "@mui/material/Stack";
|
|
10
|
+
import { Text as D } from "@mxenabled/mxui";
|
|
11
|
+
import { jsx as e, jsxs as L } from "react/jsx-runtime";
|
|
12
|
+
var w = k(function({ beat: i }) {
|
|
13
|
+
const { copyStore: m } = A(), { common: s } = S(), { accounts: u, accountsLoaded: d, institutionsLoaded: a, members: c, membersLoaded: f, uiStore: t } = b(), o = C(i, u), l = !!o && t.selectedAccount.guid === o.guid;
|
|
14
|
+
return _(() => {
|
|
15
|
+
o && (t.setSelectedAccount(o), t.setSelectedMember(c.find((p) => p.guid === o.member_guid) ?? {}));
|
|
16
|
+
}, [
|
|
17
|
+
o,
|
|
18
|
+
c,
|
|
19
|
+
t
|
|
20
|
+
]), m.isInitialized ? o ? !l || !f || !a ? /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ L(n, {
|
|
21
|
+
sx: { bgcolor: "background.default" },
|
|
22
|
+
children: [/* @__PURE__ */ e(x, { ChartComponent: g }), /* @__PURE__ */ e(h, {})]
|
|
23
|
+
}) : d ? /* @__PURE__ */ e(n, {
|
|
24
|
+
sx: { p: 24 },
|
|
25
|
+
children: /* @__PURE__ */ e(D, { children: s.error_message })
|
|
26
|
+
}) : /* @__PURE__ */ e(r, {}) : /* @__PURE__ */ e(r, {});
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
w as AccountDetailsBlock
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=AccountDetailsBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountDetailsBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.tsx"],"sourcesContent":["import { useEffect } from 'react'\n\nimport Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport AccountDetailsContent from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsContent'\nimport AccountDetailsHeader from '../../../accounts/components/detailsdrawer/Accounts/AccountDetailsHeader'\nimport { Loader, useAccountStore, useGlobalCopyStore, useGlobalStore } from '../../../common'\nimport type { Member } from '../../../core'\nimport TrendsChart from '../../../trends/components/TrendsChart'\nimport type { ActionBlockProps } from '../../mappings/blocks'\n\nimport { resolveAccount } from './layout'\n\n/**\n * Account Details drawer (MEW2-2633): the accounts widget's details header (logo, institution,\n * name, balances, trend chart) and content (Transactions / Account Details tabs, connection status,\n * actions) for the beat's account. Those components read the account store's selection, so the\n * beat's account is selected here first and nothing renders until the selection matches and the\n * members and institutions are in (the connection section reads the member's status): a guid the\n * store cannot resolve shows the error message, never the previously selected account.\n */\nexport const AccountDetailsBlock = observer(function AccountDetailsBlock({\n beat,\n}: ActionBlockProps) {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const { accounts, accountsLoaded, institutionsLoaded, members, membersLoaded, uiStore } =\n useAccountStore()\n const account = resolveAccount(beat, accounts)\n const isSelected = !!account && uiStore.selectedAccount.guid === account.guid\n\n useEffect(() => {\n if (!account) return\n\n uiStore.setSelectedAccount(account)\n uiStore.setSelectedMember(\n members.find((member) => member.guid === account.member_guid) ?? ({} as Member),\n )\n }, [account, members, uiStore])\n\n if (!copyStore.isInitialized) return <Loader />\n\n if (!account) {\n if (!accountsLoaded) return <Loader />\n\n return (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy.error_message}</Text>\n </Stack>\n )\n }\n\n if (!isSelected || !membersLoaded || !institutionsLoaded) return <Loader />\n\n return (\n <Stack sx={{ bgcolor: 'background.default' }}>\n <AccountDetailsHeader ChartComponent={TrendsChart} />\n <AccountDetailsContent />\n </Stack>\n )\n})\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,IAAsB,EAAS,SAA6B,EACvE,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,WAAA,EAAA,IAAc,EAAe,GAC/B,EAAE,QAAQ,EAAA,IAAe,EAAmB,GAC5C,EAAE,UAAA,GAAU,gBAAA,GAAgB,oBAAA,GAAoB,SAAA,GAAS,eAAA,GAAe,SAAA,EAAA,IAC5E,EAAgB,GACZ,IAAU,EAAe,GAAM,CAAQ,GACvC,IAAa,CAAC,CAAC,KAAW,EAAQ,gBAAgB,SAAS,EAAQ;AAWzE,SATA,EAAA,MAAgB;AACd,IAAK,MAEL,EAAQ,mBAAmB,CAAO,GAClC,EAAQ,kBACN,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAQ,WAAW,KAAM,CAAC,CACrE;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAS;AAAA,IAAS;AAAA,EAAO,CAAC,GAEzB,EAAU,gBAEV,IAUD,CAAC,KAAc,CAAC,KAAiB,CAAC,IAA2B,gBAAA,EAAC,GAAD,CAAS,CAAA,IAGxE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,SAAS,qBAAqB;AAAA,IAA3C,UAAA,CACE,gBAAA,EAAC,GAAD,EAAsB,gBAAgB,EAAc,CAAA,GACpD,gBAAA,EAAC,GAAD,CAAwB,CAAA,CACnB;AAAA,OAfF,IAGH,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,GAAG,GAAG;AAAA,IACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,EACjC,CAAA,IALmB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAHF,gBAAA,EAAC,GAAD,CAAS,CAAA;AAoBhD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var n = (r, c) => {
|
|
2
|
+
if (r.primary_account) return r.primary_account;
|
|
3
|
+
const i = r.primary_account_guid ?? r.insights_payload?.primary_account_guid;
|
|
4
|
+
return i ? c.find((u) => u.guid === i) : void 0;
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
n as resolveAccount
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=layout.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/layout.ts"],"sourcesContent":["import type { Account, Beat } from '../../../core'\n\n/** The beat's account: from the beat when the host attached it, else the loaded accounts. */\nexport const resolveAccount = (beat: Beat, accounts: Account[]): Account | undefined => {\n if (beat.primary_account) return beat.primary_account\n\n const guid = beat.primary_account_guid ?? beat.insights_payload?.primary_account_guid\n\n return guid ? accounts.find((account) => account.guid === guid) : undefined\n}\n"],"mappings":"AAGA,IAAa,IAAA,CAAkB,GAAY,MAA6C;AACtF,MAAI,EAAK,gBAAiB,QAAO,EAAK;AAEtC,QAAM,IAAO,EAAK,wBAAwB,EAAK,kBAAkB;AAEjE,SAAO,IAAO,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,CAAI,IAAI;AACpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useAccountStore as a } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { useEffect as c } from "react";
|
|
3
|
+
var u = () => {
|
|
4
|
+
const { accountsLoaded: o, institutionsLoaded: t, loadAccounts: e, loadInstitutions: s, loadMembers: i, membersLoaded: r } = a();
|
|
5
|
+
c(() => {
|
|
6
|
+
o || e(), r || i(), t || s();
|
|
7
|
+
}, [
|
|
8
|
+
o,
|
|
9
|
+
t,
|
|
10
|
+
e,
|
|
11
|
+
s,
|
|
12
|
+
i,
|
|
13
|
+
r
|
|
14
|
+
]);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
u as useAccountDetailsPrepare
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=useAccountDetailsPrepare.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountDetailsPrepare.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.ts"],"sourcesContent":["import { useEffect } from 'react'\n\nimport { useAccountStore } from '../../../common'\n\n/** Loads accounts, members and institutions once per open: the header names the institution and the connection section reads the member. */\nexport const useAccountDetailsPrepare = () => {\n const {\n accountsLoaded,\n institutionsLoaded,\n loadAccounts,\n loadInstitutions,\n loadMembers,\n membersLoaded,\n } = useAccountStore()\n\n useEffect(() => {\n if (!accountsLoaded) void loadAccounts()\n if (!membersLoaded) void loadMembers()\n if (!institutionsLoaded) void loadInstitutions()\n }, [\n accountsLoaded,\n institutionsLoaded,\n loadAccounts,\n loadInstitutions,\n loadMembers,\n membersLoaded,\n ])\n}\n"],"mappings":";;AAKA,IAAa,IAAA,MAAiC;AAC5C,QAAM,EACJ,gBAAA,GACA,oBAAA,GACA,cAAA,GACA,kBAAA,GACA,aAAA,GACA,eAAA,EAAA,IACE,EAAgB;AAEpB,EAAA,EAAA,MAAgB;AACd,IAAK,KAAgB,EAAkB,GAClC,KAAe,EAAiB,GAChC,KAAoB,EAAsB;AAAA,EACjD,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH"}
|
|
@@ -17,6 +17,7 @@ var _ = {
|
|
|
17
17
|
EMERGENCY_SAVINGS_ACTION_BLOCK: "emergency_savings_block",
|
|
18
18
|
PAYOFF_CALCULATOR_ACTION_BLOCK: "payoff_calculator_block",
|
|
19
19
|
BUDGET_DETAILS_ACTION_BLOCK: "budget_details_block",
|
|
20
|
+
ACCOUNT_DETAILS_ACTION_BLOCK: "account_details_block",
|
|
20
21
|
ACCOUNT_LIST_ACTION_BLOCK: "account_list_block"
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
@@ -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 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 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_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,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,2BAA2B;AAC7B"}
|
|
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 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 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,oCAAoC;AAAA,EACpC,+BAA+B;AAAA,EAC/B,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,wBAAwB;AAAA,EACxB,iCAAiC;AAAA,EACjC,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,2BAA2B;AAC7B"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { ContactSupportActionBlock as p } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
2
|
-
import { hasDrawerBlock as
|
|
3
|
-
import { actionBlocksKey as
|
|
2
|
+
import { hasDrawerBlock as eo } from "./hasDrawerBlock.es.js";
|
|
3
|
+
import { actionBlocksKey as t } from "./actionBlocksKey.es.js";
|
|
4
4
|
import { BarchartBlock as m } from "../blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
5
5
|
import { DoubleBarChartBlock as _ } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
6
6
|
import s from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
7
7
|
import C from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { BudgetBlock as
|
|
13
|
-
import
|
|
8
|
+
import u from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
9
|
+
import B from "../blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
10
|
+
import k from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
11
|
+
import A from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
12
|
+
import { BudgetBlock as T } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
13
|
+
import f from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
14
14
|
import O from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
|
|
15
15
|
import d from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
16
16
|
import n from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
17
17
|
import N from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
18
18
|
import I from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
19
19
|
import { TransactionBlock as g } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
20
|
+
import L from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
21
|
+
import P from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
22
|
+
import b from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
23
23
|
import { SVGImageBlock as D } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
24
24
|
import { FeedbackModalActionBlock as h } from "../actionBlocks/FeedbackModalActionBlock.es.js";
|
|
25
25
|
import { ConnectionDetailActionBlock as S } from "../actionBlocks/ConnectionDetailActionBlock.es.js";
|
|
26
26
|
import { ConnectWidgetActionBlock as E } from "../actionBlocks/ConnectWidgetActionBlock.es.js";
|
|
27
|
-
import { SurveyModalActionBlock as
|
|
28
|
-
import { PlaceholderActionBlock as
|
|
29
|
-
import { getMakeTransferDrawerTitle as
|
|
27
|
+
import { SurveyModalActionBlock as v } from "../actionBlocks/SurveyModalActionBlock.es.js";
|
|
28
|
+
import { PlaceholderActionBlock as K } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
29
|
+
import { getMakeTransferDrawerTitle as R } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
30
30
|
import { MakeTransferActionBlockLayer as y } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
31
|
-
import { getDrawerHeaderTitle as
|
|
32
|
-
import { TransactionDetailsBlock as
|
|
31
|
+
import { getDrawerHeaderTitle as U } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
32
|
+
import { TransactionDetailsBlock as M } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
33
33
|
import { useTransactionDetailsPrepare as c } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
34
34
|
import { TransactionHistoryBlock as w } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
35
35
|
import { useRecurringTransactionPrepare as l } from "../actionBlocks/RecurringTransactionBlock/useRecurringTransactionPrepare.es.js";
|
|
@@ -45,8 +45,10 @@ import { CreditUtilizationBlock as Z } from "../actionBlocks/CreditUtilizationBl
|
|
|
45
45
|
import { useCreditUtilizationPrepare as j } from "../actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js";
|
|
46
46
|
import { PayoffCalculatorBlock as J, usePayoffCalculatorPrepare as Q } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
|
|
47
47
|
import { BudgetDetailsBlock as X } from "../actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js";
|
|
48
|
+
import { AccountDetailsBlock as $ } from "../actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js";
|
|
49
|
+
import { useAccountDetailsPrepare as oo } from "../actionBlocks/AccountDetailsBlock/useAccountDetailsPrepare.es.js";
|
|
48
50
|
var i = (e) => {
|
|
49
|
-
},
|
|
51
|
+
}, r = (e) => ({
|
|
50
52
|
get Component() {
|
|
51
53
|
return e().Component;
|
|
52
54
|
},
|
|
@@ -59,113 +61,118 @@ var i = (e) => {
|
|
|
59
61
|
get presentation() {
|
|
60
62
|
return e().presentation;
|
|
61
63
|
}
|
|
62
|
-
}),
|
|
63
|
-
[
|
|
64
|
-
Component:
|
|
64
|
+
}), Xo = {
|
|
65
|
+
[t.PLACEHOLDER_ACTION_BLOCK]: r(() => ({
|
|
66
|
+
Component: K,
|
|
65
67
|
usePrepare: i,
|
|
66
68
|
title: () => "Action Block Layer Drilldown"
|
|
67
69
|
})),
|
|
68
|
-
[
|
|
70
|
+
[t.MAKE_TRANSFER_ACTION_BLOCK]: r(() => ({
|
|
69
71
|
Component: y,
|
|
70
72
|
usePrepare: i,
|
|
71
|
-
title:
|
|
73
|
+
title: R
|
|
72
74
|
})),
|
|
73
|
-
[
|
|
75
|
+
[t.TRANSCATION_HISTORY_ACTION_BLOCK]: r(() => ({
|
|
74
76
|
Component: w,
|
|
75
77
|
usePrepare: i,
|
|
76
|
-
title:
|
|
78
|
+
title: U
|
|
77
79
|
})),
|
|
78
|
-
[
|
|
79
|
-
Component:
|
|
80
|
+
[t.TRANSACTION_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
81
|
+
Component: M,
|
|
80
82
|
usePrepare: c,
|
|
81
83
|
title: () => "Transaction Details"
|
|
82
84
|
})),
|
|
83
|
-
[
|
|
85
|
+
[t.RECURRING_TRANSACTION_ACTION_BLOCK]: r(() => ({
|
|
84
86
|
Component: G,
|
|
85
87
|
usePrepare: l,
|
|
86
|
-
title: (e,
|
|
88
|
+
title: (e, o) => o.recurring?.expense_details ?? ""
|
|
87
89
|
})),
|
|
88
|
-
[
|
|
90
|
+
[t.REMAINING_CASH_ACTION_BLOCK]: r(() => ({
|
|
89
91
|
Component: H,
|
|
90
92
|
usePrepare: l,
|
|
91
|
-
title: (e,
|
|
93
|
+
title: (e, o) => o.insights_feed?.remaining_cash?.title ?? ""
|
|
92
94
|
})),
|
|
93
|
-
[
|
|
95
|
+
[t.CONTACT_SUPPORT_ACTION_BLOCK]: r(() => ({
|
|
94
96
|
Component: p,
|
|
95
97
|
usePrepare: i,
|
|
96
|
-
title: (e,
|
|
98
|
+
title: (e, o) => o.help?.request_support ?? ""
|
|
97
99
|
})),
|
|
98
|
-
[
|
|
100
|
+
[t.FEEDBACK_MODAL_ACTION_BLOCK]: r(() => ({
|
|
99
101
|
Component: h,
|
|
100
102
|
usePrepare: i,
|
|
101
103
|
presentation: "modal"
|
|
102
104
|
})),
|
|
103
|
-
[
|
|
105
|
+
[t.CONNECTION_DETAIL_ACTION_BLOCK]: r(() => ({
|
|
104
106
|
Component: S,
|
|
105
107
|
usePrepare: i,
|
|
106
|
-
title: (e,
|
|
108
|
+
title: (e, o) => o.insights_feed?.connection_details?.connection_details_drawer_title ?? ""
|
|
107
109
|
})),
|
|
108
|
-
[
|
|
110
|
+
[t.CONNECT_WIDGET_ACTION_BLOCK]: r(() => ({
|
|
109
111
|
Component: E,
|
|
110
112
|
usePrepare: i
|
|
111
113
|
})),
|
|
112
|
-
[
|
|
113
|
-
Component:
|
|
114
|
+
[t.SURVEY_MODAL_ACTION_BLOCK]: r(() => ({
|
|
115
|
+
Component: v,
|
|
114
116
|
usePrepare: i,
|
|
115
117
|
presentation: "modal"
|
|
116
118
|
})),
|
|
117
|
-
[
|
|
119
|
+
[t.TRANSACTION_LIST_ACTION_BLOCK]: r(() => ({
|
|
118
120
|
Component: F,
|
|
119
121
|
usePrepare: c,
|
|
120
|
-
title: (e,
|
|
122
|
+
title: (e, o, a) => a?.insights_payload?.title ?? ""
|
|
121
123
|
})),
|
|
122
|
-
[
|
|
124
|
+
[t.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: r(() => ({
|
|
123
125
|
Component: x,
|
|
124
126
|
presentation: "modal",
|
|
125
127
|
usePrepare: i
|
|
126
128
|
})),
|
|
127
|
-
[
|
|
129
|
+
[t.OVERDRAFT_ACTION_BLOCK]: r(() => ({
|
|
128
130
|
Component: V,
|
|
129
131
|
usePrepare: Y,
|
|
130
|
-
title: (e,
|
|
132
|
+
title: (e, o, a) => a?.insights_payload?.title ?? ""
|
|
131
133
|
})),
|
|
132
|
-
[
|
|
134
|
+
[t.CREDIT_UTILIZATION_ACTION_BLOCK]: r(() => ({
|
|
133
135
|
Component: Z,
|
|
134
136
|
usePrepare: j,
|
|
135
|
-
title: (e,
|
|
137
|
+
title: (e, o) => o.insights_feed?.credit_utilization?.title ?? ""
|
|
136
138
|
})),
|
|
137
|
-
[
|
|
139
|
+
[t.EMERGENCY_SAVINGS_ACTION_BLOCK]: r(() => ({
|
|
138
140
|
Component: q,
|
|
139
141
|
usePrepare: i,
|
|
140
|
-
title: (e,
|
|
142
|
+
title: (e, o, a) => a?.insights_payload?.title ?? ""
|
|
141
143
|
})),
|
|
142
|
-
[
|
|
144
|
+
[t.PAYOFF_CALCULATOR_ACTION_BLOCK]: r(() => ({
|
|
143
145
|
Component: J,
|
|
144
146
|
usePrepare: Q,
|
|
145
|
-
title: (e,
|
|
147
|
+
title: (e, o) => o.insights_feed?.payoff_calculator?.title ?? ""
|
|
146
148
|
})),
|
|
147
|
-
[
|
|
149
|
+
[t.BUDGET_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
148
150
|
Component: X,
|
|
149
151
|
usePrepare: i,
|
|
150
|
-
title: (e,
|
|
152
|
+
title: (e, o, a) => a?.insights_payload?.title || o.budgets?.details_title || ""
|
|
153
|
+
})),
|
|
154
|
+
[t.ACCOUNT_DETAILS_ACTION_BLOCK]: r(() => ({
|
|
155
|
+
Component: $,
|
|
156
|
+
usePrepare: oo,
|
|
157
|
+
title: (e, o) => o.accounts?.account_details ?? ""
|
|
151
158
|
})),
|
|
152
|
-
[
|
|
159
|
+
[t.ACCOUNT_LIST_ACTION_BLOCK]: r(() => ({
|
|
153
160
|
Component: z,
|
|
154
161
|
usePrepare: W,
|
|
155
|
-
title: (e,
|
|
162
|
+
title: (e, o) => o.insights_feed?.account_list?.title ?? ""
|
|
156
163
|
}))
|
|
157
|
-
},
|
|
158
|
-
account_block:
|
|
159
|
-
account_switch_block:
|
|
160
|
-
direct_deposit_block:
|
|
164
|
+
}, $o = {
|
|
165
|
+
account_block: k,
|
|
166
|
+
account_switch_block: A,
|
|
167
|
+
direct_deposit_block: B,
|
|
161
168
|
bar_chart_block: m,
|
|
162
|
-
budget_block:
|
|
163
|
-
debts_block:
|
|
169
|
+
budget_block: T,
|
|
170
|
+
debts_block: f,
|
|
164
171
|
donut_chart_block: C,
|
|
165
172
|
double_bar_chart_block: _,
|
|
166
|
-
double_progress_bar_block:
|
|
173
|
+
double_progress_bar_block: u,
|
|
167
174
|
goals_block: O,
|
|
168
|
-
image_block:
|
|
175
|
+
image_block: b,
|
|
169
176
|
no_spend_days_block: d,
|
|
170
177
|
repeating_transaction_block: n,
|
|
171
178
|
save_extra_block: N,
|
|
@@ -173,14 +180,14 @@ var i = (e) => {
|
|
|
173
180
|
step_chart_block: s,
|
|
174
181
|
svg_image_block: D,
|
|
175
182
|
upcoming_bill_block: n,
|
|
176
|
-
upcoming_subscription_block:
|
|
177
|
-
withdrawal_block:
|
|
183
|
+
upcoming_subscription_block: L,
|
|
184
|
+
withdrawal_block: P,
|
|
178
185
|
transaction_block: g
|
|
179
186
|
};
|
|
180
187
|
export {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
188
|
+
Xo as actionBlocks,
|
|
189
|
+
$o as blocks,
|
|
190
|
+
eo as hasDrawerBlock
|
|
184
191
|
};
|
|
185
192
|
|
|
186
193
|
//# 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 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 { 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 {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\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'\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: noop,\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 [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\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 // 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 // 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 no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,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,gCAA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,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,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,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 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 { 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 {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\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: noop,\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 [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\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 // 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 no_spend_days_block: NoSpendDaysBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_opportunity_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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GA0BjC,IAAA,CAAa,OAAuD;AAAA,EACxE,IAAI,YAAY;AACd,WAAO,EA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64 +1,64 @@
|
|
|
1
|
-
import { useEvent as
|
|
2
|
-
import { fromUnixUTCToDayOfWeekAndDate as
|
|
3
|
-
import { VISUALLY_HIDDEN_SX as
|
|
4
|
-
import { ANALYTICS_EVENTS as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useTransactionsUiStore as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { hasInsetBorder as
|
|
1
|
+
import { useEvent as W, useGlobalCopyStore as ee, useTransactionStore as te } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { fromUnixUTCToDayOfWeekAndDate as oe } from "../../../core/utils/DateUtil.es.js";
|
|
3
|
+
import { VISUALLY_HIDDEN_SX as ne } from "../../../common/constants/Styles.es.js";
|
|
4
|
+
import { ANALYTICS_EVENTS as re } from "../../../common/constants/Analytics.es.js";
|
|
5
|
+
import se from "../../../common/components/Loader.es.js";
|
|
6
|
+
import ie from "../../../common/components/ZeroState.es.js";
|
|
7
|
+
import { useTransactionsUiStore as ae } from "../../context/hooks.es.js";
|
|
8
|
+
import ce from "./transactionlist/TransactionRow.es.js";
|
|
9
|
+
import le from "../../../common/components/SubheaderRow.es.js";
|
|
10
|
+
import { hasInsetBorder as ue, shouldShowDate as D } from "../../utils/Transactions.es.js";
|
|
11
11
|
import o from "react";
|
|
12
|
-
import { observer as
|
|
13
|
-
import { Fragment as
|
|
12
|
+
import { observer as de } from "mobx-react-lite";
|
|
13
|
+
import { Fragment as fe, jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
14
14
|
import u from "@mui/material/Box";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { useVirtualizer as
|
|
18
|
-
var z = 65, y = 32,
|
|
19
|
-
for (let r =
|
|
15
|
+
import me from "@mui/material/Divider";
|
|
16
|
+
import pe from "@mui/material/List";
|
|
17
|
+
import { useVirtualizer as ge } from "@tanstack/react-virtual";
|
|
18
|
+
var z = 65, y = 32, he = (g) => {
|
|
19
|
+
for (let r = g?.parentElement; r; r = r.parentElement) if (/(auto|scroll)/.test(getComputedStyle(r).overflowY)) return r;
|
|
20
20
|
return null;
|
|
21
|
-
},
|
|
21
|
+
}, xe = ({ bgcolor: g, filter: r, height: N = "calc(100dvh - 36px)", isRowDisabled: O, loader: B = /* @__PURE__ */ s(se, {
|
|
22
22
|
label: "Loading",
|
|
23
23
|
size: 40
|
|
24
|
-
}), onClick: E, scrollsWithParent: a = !1, showInsights: I = !1, showLoader:
|
|
25
|
-
const { isLoading: V, sortedTransactions:
|
|
26
|
-
const e = r ?
|
|
24
|
+
}), onClick: E, scrollsWithParent: a = !1, showInsights: I = !1, showLoader: k = !1, stickyHeader: h, transaction: _, width: x = "100%", zeroState: U = /* @__PURE__ */ s(ie, {}) }) => {
|
|
25
|
+
const { isLoading: V, sortedTransactions: S } = te(), n = o.useMemo(() => {
|
|
26
|
+
const e = r ? S.filter(r) : S;
|
|
27
27
|
return _ ?? e;
|
|
28
28
|
}, [
|
|
29
|
-
|
|
29
|
+
S,
|
|
30
30
|
r,
|
|
31
31
|
_
|
|
32
|
-
]), { clearExpandedSplits: $, setShowInsights: F, toggleSplit: M } =
|
|
32
|
+
]), { clearExpandedSplits: $, setShowInsights: F, toggleSplit: M } = ae(), { onEvent: Y } = W(), { common: G } = ee(), [d, C] = o.useState(null), j = (e) => {
|
|
33
33
|
const t = n.find((i) => i.guid === e);
|
|
34
34
|
if (t?.has_been_split) {
|
|
35
35
|
M(t.guid);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
Y(
|
|
38
|
+
Y(re.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
|
|
39
39
|
account_guid: t?.account_guid,
|
|
40
40
|
transaction_guid: e
|
|
41
41
|
}), E?.(e);
|
|
42
|
-
}, f = o.useRef(null), q = !!
|
|
42
|
+
}, f = o.useRef(null), q = !!h, [R, K] = o.useState(null), [L, X] = o.useState(0), m = o.useRef(null), [w, Z] = o.useState(0);
|
|
43
43
|
o.useLayoutEffect(() => {
|
|
44
44
|
if (!a) return;
|
|
45
45
|
const e = f.current;
|
|
46
46
|
if (!e) return;
|
|
47
|
-
const t =
|
|
47
|
+
const t = he(e) ?? e, i = () => {
|
|
48
48
|
X(e.getBoundingClientRect().top - t.getBoundingClientRect().top + t.scrollTop), Z(m.current?.offsetHeight ?? 0);
|
|
49
49
|
};
|
|
50
50
|
K(t), i();
|
|
51
51
|
const l = new ResizeObserver(i);
|
|
52
52
|
return l.observe(t.firstElementChild ?? t), m.current && l.observe(m.current), () => l.disconnect();
|
|
53
53
|
}, [a, q]);
|
|
54
|
-
const p =
|
|
54
|
+
const p = ge({
|
|
55
55
|
count: n.length,
|
|
56
56
|
getScrollElement: () => a ? R : f.current,
|
|
57
|
-
estimateSize: (e) => z + (
|
|
57
|
+
estimateSize: (e) => z + (D(e, n) ? y : 0),
|
|
58
58
|
overscan: 5,
|
|
59
59
|
scrollMargin: L,
|
|
60
60
|
scrollPaddingStart: w
|
|
61
|
-
}),
|
|
61
|
+
}), v = p.getVirtualItems(), c = v.at(-1)?.index ?? -1, H = n.length - (c + 1), T = !V && !k, A = T && v.length > 0, J = p.getTotalSize() || "auto", P = () => {
|
|
62
62
|
const e = c + 1;
|
|
63
63
|
p.scrollToIndex(e, { align: "start" }), C({
|
|
64
64
|
index: e,
|
|
@@ -69,38 +69,38 @@ var z = 65, y = 32, ge = (h) => {
|
|
|
69
69
|
if (!d) return;
|
|
70
70
|
const e = f.current?.querySelector(`[data-index="${d.index}"]`);
|
|
71
71
|
e?.focus(), (e || c !== d.from) && C(null);
|
|
72
|
-
}, [d, c]), o.useEffect(() => p.measure(), [n, R]), o.useEffect(() => F(I), [I]), o.useEffect(() => () => $(), []), /* @__PURE__ */ b(
|
|
73
|
-
|
|
72
|
+
}, [d, c]), o.useEffect(() => p.measure(), [n, R]), o.useEffect(() => F(I), [I]), o.useEffect(() => () => $(), []), /* @__PURE__ */ b(fe, { children: [
|
|
73
|
+
h && /* @__PURE__ */ s(u, {
|
|
74
74
|
ref: m,
|
|
75
75
|
sx: {
|
|
76
76
|
bgcolor: "background.paper",
|
|
77
77
|
position: a ? "sticky" : void 0,
|
|
78
78
|
top: 0,
|
|
79
|
-
width:
|
|
79
|
+
width: x,
|
|
80
80
|
zIndex: 1
|
|
81
81
|
},
|
|
82
|
-
children:
|
|
82
|
+
children: h
|
|
83
83
|
}),
|
|
84
|
-
/* @__PURE__ */ s(
|
|
84
|
+
/* @__PURE__ */ s(pe, {
|
|
85
85
|
component: "div",
|
|
86
86
|
role: "list",
|
|
87
|
-
sx: { width:
|
|
87
|
+
sx: { width: x },
|
|
88
88
|
children: /* @__PURE__ */ s(u, {
|
|
89
89
|
height: a ? void 0 : N,
|
|
90
90
|
overflow: a ? void 0 : "auto",
|
|
91
91
|
ref: f,
|
|
92
92
|
role: "presentation",
|
|
93
|
-
width:
|
|
93
|
+
width: x,
|
|
94
94
|
children: /* @__PURE__ */ b(u, {
|
|
95
|
-
height:
|
|
95
|
+
height: J,
|
|
96
96
|
position: "relative",
|
|
97
97
|
role: "presentation",
|
|
98
98
|
width: "100%",
|
|
99
99
|
children: [
|
|
100
|
-
!T &&
|
|
100
|
+
!T && B,
|
|
101
101
|
T && n.length === 0 && U,
|
|
102
|
-
|
|
103
|
-
const t = n[e.index], i =
|
|
102
|
+
A && v.map((e) => {
|
|
103
|
+
const t = n[e.index], i = D(e.index, n), l = ue(e.index, n), Q = z + (i ? y : 0);
|
|
104
104
|
return /* @__PURE__ */ b(u, {
|
|
105
105
|
"aria-posinset": e.index + 1,
|
|
106
106
|
"aria-setsize": n.length,
|
|
@@ -108,7 +108,7 @@ var z = 65, y = 32, ge = (h) => {
|
|
|
108
108
|
role: "listitem",
|
|
109
109
|
tabIndex: -1,
|
|
110
110
|
sx: {
|
|
111
|
-
height:
|
|
111
|
+
height: Q,
|
|
112
112
|
position: "absolute",
|
|
113
113
|
scrollMarginTop: w,
|
|
114
114
|
transform: `translateY(${e.start - L}px)`,
|
|
@@ -116,17 +116,17 @@ var z = 65, y = 32, ge = (h) => {
|
|
|
116
116
|
bgcolor: "background.paper"
|
|
117
117
|
},
|
|
118
118
|
children: [
|
|
119
|
-
i && /* @__PURE__ */ s(
|
|
120
|
-
bgcolor:
|
|
121
|
-
children:
|
|
119
|
+
i && /* @__PURE__ */ s(le, {
|
|
120
|
+
bgcolor: g,
|
|
121
|
+
children: oe(t.date)
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */ s(
|
|
123
|
+
/* @__PURE__ */ s(ce, {
|
|
124
124
|
component: "div",
|
|
125
125
|
disabled: O?.(t),
|
|
126
126
|
...E && { onClick: j },
|
|
127
127
|
transaction: t
|
|
128
128
|
}),
|
|
129
|
-
/* @__PURE__ */ s(
|
|
129
|
+
/* @__PURE__ */ s(me, { sx: { ml: l ? 68 : 0 } })
|
|
130
130
|
]
|
|
131
131
|
}, t.guid);
|
|
132
132
|
})
|
|
@@ -134,18 +134,18 @@ var z = 65, y = 32, ge = (h) => {
|
|
|
134
134
|
})
|
|
135
135
|
})
|
|
136
136
|
}),
|
|
137
|
-
|
|
137
|
+
A && H > 0 && /* @__PURE__ */ s(u, {
|
|
138
138
|
component: "button",
|
|
139
|
-
onClick:
|
|
140
|
-
sx:
|
|
139
|
+
onClick: P,
|
|
140
|
+
sx: ne,
|
|
141
141
|
tabIndex: -1,
|
|
142
142
|
type: "button",
|
|
143
|
-
children: `${G.view_more} (${
|
|
143
|
+
children: `${G.view_more} (${H})`
|
|
144
144
|
})
|
|
145
145
|
] });
|
|
146
|
-
},
|
|
146
|
+
}, Oe = de(xe);
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
Oe as default
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
//# sourceMappingURL=TransactionList.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionList.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionList.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { useVirtualizer } from '@tanstack/react-virtual'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useEvent,\n useGlobalCopyStore,\n VISUALLY_HIDDEN_SX,\n ZeroState,\n} from '../../../common'\nimport { type Transaction } from '../../../core'\n\nimport { useTransactionsUiStore } from '../../context/hooks'\nimport { useTransactionStore } from '../../../common'\n\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport TransactionRow from './transactionlist/TransactionRow'\n\nimport { hasInsetBorder, shouldShowDate } from '../../utils/Transactions'\nimport { fromUnixUTCToDayOfWeekAndDate } from '../../../core/utils/DateUtil'\n\nconst ROW_HEIGHT = 65\nconst DATE_ROW_HEIGHT = 32\n\nconst findScrollParent = (node: HTMLElement | null): HTMLElement | null => {\n for (let el = node?.parentElement; el; el = el.parentElement) {\n if (/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return el\n }\n return null\n}\n\nexport interface TransactionListProps {\n bgcolor?: string\n filter?: (t: Transaction) => boolean\n height?: number | string\n /**\n * Marks rows that stay in the list but cannot be acted on. Disabled rows are rendered greyed\n * out and inert instead of being removed, so list membership and ordering are unaffected.\n */\n isRowDisabled?: (t: Transaction) => boolean\n loader?: React.JSX.Element\n onClick?: (guid: string) => void\n /** Virtualize against the nearest scrolling ancestor instead of an own fixed-height scroll box. */\n scrollsWithParent?: boolean\n /** Rendered above the rows; stays at the top of the scroll area when used with scrollsWithParent. */\n stickyHeader?: React.ReactNode\n showInsights?: boolean\n showLoader?: boolean\n transaction?: Transaction[]\n width?: number | string\n zeroState?: React.JSX.Element\n}\n\nconst TransactionList: React.FC<TransactionListProps> = ({\n bgcolor,\n filter,\n height = 'calc(100dvh - 36px)',\n isRowDisabled,\n loader = <Loader label=\"Loading\" size={40} />,\n onClick,\n scrollsWithParent = false,\n showInsights = false,\n showLoader = false,\n stickyHeader,\n transaction,\n width = '100%',\n zeroState = <ZeroState />,\n}) => {\n const { isLoading, sortedTransactions: allTransactions } = useTransactionStore()\n const transactions = React.useMemo(() => {\n const updatedTransactions = filter ? allTransactions.filter(filter) : allTransactions\n return transaction ?? updatedTransactions\n }, [allTransactions, filter, transaction])\n\n const { clearExpandedSplits, setShowInsights, toggleSplit } = useTransactionsUiStore()\n const { onEvent } = useEvent()\n const { common: commonCopy } = useGlobalCopyStore()\n const [pendingFocus, setPendingFocus] = React.useState<{ index: number; from: number } | null>(\n null,\n )\n\n const handleClick = (guid: string) => {\n const transaction = transactions.find((t) => t.guid === guid)\n\n if (transaction?.has_been_split) {\n toggleSplit(transaction.guid)\n return\n }\n\n onEvent(ANALYTICS_EVENTS.ACCOUNT_DETAILS_CLICK_TRANSACTION, {\n account_guid: transaction?.account_guid,\n transaction_guid: guid,\n })\n onClick?.(guid)\n }\n\n const parentRef = React.useRef<HTMLDivElement>(null)\n const hasStickyHeader = Boolean(stickyHeader)\n const [scrollParent, setScrollParent] = React.useState<HTMLElement | null>(null)\n const [scrollMargin, setScrollMargin] = React.useState(0)\n const headerRef = React.useRef<HTMLDivElement>(null)\n const [headerHeight, setHeaderHeight] = React.useState(0)\n\n React.useLayoutEffect(() => {\n if (!scrollsWithParent) return\n const list = parentRef.current\n if (!list) return\n // With no scrolling ancestor the list itself is the viewport, so every row renders.\n const scroller = findScrollParent(list) ?? list\n\n const measureOffset = () => {\n setScrollMargin(\n list.getBoundingClientRect().top -\n scroller.getBoundingClientRect().top +\n scroller.scrollTop,\n )\n setHeaderHeight(headerRef.current?.offsetHeight ?? 0)\n }\n\n setScrollParent(scroller)\n measureOffset()\n const observer = new ResizeObserver(measureOffset)\n observer.observe(scroller.firstElementChild ?? scroller)\n if (headerRef.current) observer.observe(headerRef.current)\n return () => observer.disconnect()\n }, [scrollsWithParent, hasStickyHeader])\n\n const rowVirtualizer = useVirtualizer({\n count: transactions.length,\n getScrollElement: () => (scrollsWithParent ? scrollParent : parentRef.current),\n estimateSize: (i) => ROW_HEIGHT + (shouldShowDate(i, transactions) ? DATE_ROW_HEIGHT : 0),\n overscan: 5,\n scrollMargin,\n scrollPaddingStart: headerHeight,\n })\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n const lastRenderedIndex = virtualItems.at(-1)?.index ?? -1\n const unrenderedCount = transactions.length - (lastRenderedIndex + 1)\n const isSettled = !isLoading && !showLoader\n const showRows = isSettled && virtualItems.length > 0\n\n // Screen reader reading modes do not scroll the list, so rows past the rendered window\n // are unreachable without this control.\n const showNextRows = () => {\n const nextIndex = lastRenderedIndex + 1\n rowVirtualizer.scrollToIndex(nextIndex, { align: 'start' })\n setPendingFocus({ index: nextIndex, from: lastRenderedIndex })\n }\n\n React.useEffect(() => {\n if (!pendingFocus) return\n const row = parentRef.current?.querySelector<HTMLElement>(\n `[data-index=\"${pendingFocus.index}\"]`,\n )\n row?.focus()\n // Give up once the window moves, so a missed row cannot take focus later.\n if (row || lastRenderedIndex !== pendingFocus.from) setPendingFocus(null)\n }, [pendingFocus, lastRenderedIndex])\n\n React.useEffect(() => rowVirtualizer.measure(), [transactions, scrollParent])\n React.useEffect(() => setShowInsights(showInsights), [showInsights])\n\n React.useEffect(() => {\n return () => clearExpandedSplits()\n }, [])\n\n return (\n <>\n {stickyHeader && (\n <Box\n ref={headerRef}\n sx={{\n bgcolor: 'background.paper',\n position: scrollsWithParent ? 'sticky' : undefined,\n top: 0,\n width,\n zIndex: 1,\n }}\n >\n {stickyHeader}\n </Box>\n )}\n <List component=\"div\" role=\"list\" sx={{ width: width }}>\n <Box\n height={scrollsWithParent ? undefined : height}\n overflow={scrollsWithParent ? undefined : 'auto'}\n ref={parentRef}\n role=\"presentation\"\n width={width}\n >\n <Box\n height={\n // set the height to auto when there are no transactions so the zero state isn't set to 0\n virtualItems.length === 0 ? 'auto' : rowVirtualizer.getTotalSize()\n }\n position=\"relative\"\n role=\"presentation\"\n width=\"100%\"\n >\n {!isSettled && loader}\n {isSettled && transactions.length === 0 && zeroState}\n {showRows &&\n virtualItems.map((row) => {\n const transaction = transactions[row.index]\n const showDate = shouldShowDate(row.index, transactions)\n const isInset = hasInsetBorder(row.index, transactions)\n const rowHeight = ROW_HEIGHT + (showDate ? DATE_ROW_HEIGHT : 0)\n\n return (\n <Box\n aria-posinset={row.index + 1}\n aria-setsize={transactions.length}\n data-index={row.index}\n key={transaction.guid}\n role=\"listitem\"\n tabIndex={-1}\n sx={{\n height: rowHeight,\n position: 'absolute',\n // Keeps a focused row from scrolling under the sticky header.\n scrollMarginTop: headerHeight,\n transform: `translateY(${row.start - scrollMargin}px)`,\n width: '100%',\n bgcolor: 'background.paper',\n }}\n >\n {showDate && (\n <SubheaderRow bgcolor={bgcolor}>\n {fromUnixUTCToDayOfWeekAndDate(transaction.date)}\n </SubheaderRow>\n )}\n <TransactionRow\n component=\"div\"\n disabled={isRowDisabled?.(transaction)}\n {...(onClick && { onClick: handleClick })}\n transaction={transaction}\n />\n <Divider sx={{ ml: isInset ? 68 : 0 }} />\n </Box>\n )\n })}\n </Box>\n </Box>\n </List>\n {showRows && unrenderedCount > 0 && (\n <Box\n component=\"button\"\n onClick={showNextRows}\n sx={VISUALLY_HIDDEN_SX}\n tabIndex={-1}\n type=\"button\"\n >\n {`${commonCopy.view_more} (${unrenderedCount})`}\n </Box>\n )}\n </>\n )\n}\n\nexport default observer(TransactionList)\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,IAAa,IACb,IAAkB,IAElB,KAAA,CAAoB,MAAiD;AACzE,WAAS,IAAK,GAAM,eAAe,GAAI,IAAK,EAAG,cAC7C,KAAI,gBAAgB,KAAK,iBAAiB,CAAE,EAAE,SAAS,EAAG,QAAO;AAEnE,SAAO;AACT,GAwBM,KAAA,CAAmD,EACvD,SAAA,GACA,QAAA,GACA,QAAA,IAAS,uBACT,eAAA,GACA,QAAA,IAAS,gBAAA,EAAC,IAAD;AAAA,EAAQ,OAAM;AAAA,EAAU,MAAM;AAAK,CAAA,GAC5C,SAAA,GACA,mBAAA,IAAoB,IACpB,cAAA,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AAI;AAAA,kBACF,QAAQ;AAAA,kBACR,UAAU;AAAA,kBAEV,iBAAiB;AAAA,kBACjB,WAAW,cAAc,EAAI,QAAQ,CAAA;AAAA,kBACrC,OAAO;AAAA,kBACP,SAAS;AAAA,gBACX;AAAA,gBAfF,UAAA;AAAA,kBAiBG,KACC,gBAAA,EAAC,IAAD;AAAA,oBAAuB,SAAA;AAAA,oBACpB,UAAA,GAA8B,EAAY,IAAI;AAAA,kBACnC,CAAA;AAAA,kBAEhB,gBAAA,EAAC,IAAD;AAAA,oBACE,WAAU;AAAA,oBACV,UAAU,IAAgB,CAAW;AAAA,oBACrC,GAAK,KAAW,EAAE,SAAS,EAAY;AAAA,oBAC1B,aAAA;AAAA,kBACd,CAAA;AAAA,kBACD,gBAAA,EAAC,IAAD,EAAS,IAAI,EAAE,IAAI,IAAU,KAAK,EAAE,EAAI,CAAA;AAAA,gBACrC;AAAA,cAzBE,GAAA,EAAY,IAyBd;AAAA,YAET,CAAC;AAAA,UACA;AAAA;MACF,CAAA;AAAA,IACD,CAAA;AAAA,IACL,KAAY,IAAkB,KAC7B,gBAAA,EAAC,GAAD;AAAA,MACE,WAAU;AAAA,MACV,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,MAAK;AAAA,MAEJ,UAAA,GAAG,EAAW,SAAA,KAAc,CAAA;AAAA,IAC1B,CAAA;AAAA,EAEP,EAAA,CAAA;AAEN,GAEA,KAAe,GAAS,EAAe"}
|
|
1
|
+
{"version":3,"file":"TransactionList.es.js","names":[],"sources":["../../../../src/transactions/components/shared/TransactionList.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport { useVirtualizer } from '@tanstack/react-virtual'\n\nimport Box from '@mui/material/Box'\nimport Divider from '@mui/material/Divider'\nimport List from '@mui/material/List'\n\nimport {\n ANALYTICS_EVENTS,\n Loader,\n useEvent,\n useGlobalCopyStore,\n VISUALLY_HIDDEN_SX,\n ZeroState,\n} from '../../../common'\nimport { type Transaction } from '../../../core'\n\nimport { useTransactionsUiStore } from '../../context/hooks'\nimport { useTransactionStore } from '../../../common'\n\nimport SubheaderRow from '../../../common/components/SubheaderRow'\nimport TransactionRow from './transactionlist/TransactionRow'\n\nimport { hasInsetBorder, shouldShowDate } from '../../utils/Transactions'\nimport { fromUnixUTCToDayOfWeekAndDate } from '../../../core/utils/DateUtil'\n\nconst ROW_HEIGHT = 65\nconst DATE_ROW_HEIGHT = 32\n\nconst findScrollParent = (node: HTMLElement | null): HTMLElement | null => {\n for (let el = node?.parentElement; el; el = el.parentElement) {\n if (/(auto|scroll)/.test(getComputedStyle(el).overflowY)) return el\n }\n return null\n}\n\nexport interface TransactionListProps {\n bgcolor?: string\n filter?: (t: Transaction) => boolean\n height?: number | string\n /**\n * Marks rows that stay in the list but cannot be acted on. Disabled rows are rendered greyed\n * out and inert instead of being removed, so list membership and ordering are unaffected.\n */\n isRowDisabled?: (t: Transaction) => boolean\n loader?: React.JSX.Element\n onClick?: (guid: string) => void\n /** Virtualize against the nearest scrolling ancestor instead of an own fixed-height scroll box. */\n scrollsWithParent?: boolean\n /** Rendered above the rows; stays at the top of the scroll area when used with scrollsWithParent. */\n stickyHeader?: React.ReactNode\n showInsights?: boolean\n showLoader?: boolean\n transaction?: Transaction[]\n width?: number | string\n zeroState?: React.JSX.Element\n}\n\nconst TransactionList: React.FC<TransactionListProps> = ({\n bgcolor,\n filter,\n height = 'calc(100dvh - 36px)',\n isRowDisabled,\n loader = <Loader label=\"Loading\" size={40} />,\n onClick,\n scrollsWithParent = false,\n showInsights = false,\n showLoader = false,\n stickyHeader,\n transaction,\n width = '100%',\n zeroState = <ZeroState />,\n}) => {\n const { isLoading, sortedTransactions: allTransactions } = useTransactionStore()\n const transactions = React.useMemo(() => {\n const updatedTransactions = filter ? allTransactions.filter(filter) : allTransactions\n return transaction ?? updatedTransactions\n }, [allTransactions, filter, transaction])\n\n const { clearExpandedSplits, setShowInsights, toggleSplit } = useTransactionsUiStore()\n const { onEvent } = useEvent()\n const { common: commonCopy } = useGlobalCopyStore()\n const [pendingFocus, setPendingFocus] = React.useState<{ index: number; from: number } | null>(\n null,\n )\n\n const handleClick = (guid: string) => {\n const transaction = transactions.find((t) => t.guid === guid)\n\n if (transaction?.has_been_split) {\n toggleSplit(transaction.guid)\n return\n }\n\n onEvent(ANALYTICS_EVENTS.ACCOUNT_DETAILS_CLICK_TRANSACTION, {\n account_guid: transaction?.account_guid,\n transaction_guid: guid,\n })\n onClick?.(guid)\n }\n\n const parentRef = React.useRef<HTMLDivElement>(null)\n const hasStickyHeader = Boolean(stickyHeader)\n const [scrollParent, setScrollParent] = React.useState<HTMLElement | null>(null)\n const [scrollMargin, setScrollMargin] = React.useState(0)\n const headerRef = React.useRef<HTMLDivElement>(null)\n const [headerHeight, setHeaderHeight] = React.useState(0)\n\n React.useLayoutEffect(() => {\n if (!scrollsWithParent) return\n const list = parentRef.current\n if (!list) return\n // With no scrolling ancestor the list itself is the viewport, so every row renders.\n const scroller = findScrollParent(list) ?? list\n\n const measureOffset = () => {\n setScrollMargin(\n list.getBoundingClientRect().top -\n scroller.getBoundingClientRect().top +\n scroller.scrollTop,\n )\n setHeaderHeight(headerRef.current?.offsetHeight ?? 0)\n }\n\n setScrollParent(scroller)\n measureOffset()\n const observer = new ResizeObserver(measureOffset)\n observer.observe(scroller.firstElementChild ?? scroller)\n if (headerRef.current) observer.observe(headerRef.current)\n return () => observer.disconnect()\n }, [scrollsWithParent, hasStickyHeader])\n\n const rowVirtualizer = useVirtualizer({\n count: transactions.length,\n getScrollElement: () => (scrollsWithParent ? scrollParent : parentRef.current),\n estimateSize: (i) => ROW_HEIGHT + (shouldShowDate(i, transactions) ? DATE_ROW_HEIGHT : 0),\n overscan: 5,\n scrollMargin,\n scrollPaddingStart: headerHeight,\n })\n\n const virtualItems = rowVirtualizer.getVirtualItems()\n const lastRenderedIndex = virtualItems.at(-1)?.index ?? -1\n const unrenderedCount = transactions.length - (lastRenderedIndex + 1)\n const isSettled = !isLoading && !showLoader\n const showRows = isSettled && virtualItems.length > 0\n // The total size comes from the row count, so a content-sized list has height before any row\n // is drawn. It is 0 only with no transactions, where the zero state needs 'auto'.\n const rowBoxHeight = rowVirtualizer.getTotalSize() || 'auto'\n\n // Screen reader reading modes do not scroll the list, so rows past the rendered window\n // are unreachable without this control.\n const showNextRows = () => {\n const nextIndex = lastRenderedIndex + 1\n rowVirtualizer.scrollToIndex(nextIndex, { align: 'start' })\n setPendingFocus({ index: nextIndex, from: lastRenderedIndex })\n }\n\n React.useEffect(() => {\n if (!pendingFocus) return\n const row = parentRef.current?.querySelector<HTMLElement>(\n `[data-index=\"${pendingFocus.index}\"]`,\n )\n row?.focus()\n // Give up once the window moves, so a missed row cannot take focus later.\n if (row || lastRenderedIndex !== pendingFocus.from) setPendingFocus(null)\n }, [pendingFocus, lastRenderedIndex])\n\n React.useEffect(() => rowVirtualizer.measure(), [transactions, scrollParent])\n React.useEffect(() => setShowInsights(showInsights), [showInsights])\n\n React.useEffect(() => {\n return () => clearExpandedSplits()\n }, [])\n\n return (\n <>\n {stickyHeader && (\n <Box\n ref={headerRef}\n sx={{\n bgcolor: 'background.paper',\n position: scrollsWithParent ? 'sticky' : undefined,\n top: 0,\n width,\n zIndex: 1,\n }}\n >\n {stickyHeader}\n </Box>\n )}\n <List component=\"div\" role=\"list\" sx={{ width: width }}>\n <Box\n height={scrollsWithParent ? undefined : height}\n overflow={scrollsWithParent ? undefined : 'auto'}\n ref={parentRef}\n role=\"presentation\"\n width={width}\n >\n <Box height={rowBoxHeight} position=\"relative\" role=\"presentation\" width=\"100%\">\n {!isSettled && loader}\n {isSettled && transactions.length === 0 && zeroState}\n {showRows &&\n virtualItems.map((row) => {\n const transaction = transactions[row.index]\n const showDate = shouldShowDate(row.index, transactions)\n const isInset = hasInsetBorder(row.index, transactions)\n const rowHeight = ROW_HEIGHT + (showDate ? DATE_ROW_HEIGHT : 0)\n\n return (\n <Box\n aria-posinset={row.index + 1}\n aria-setsize={transactions.length}\n data-index={row.index}\n key={transaction.guid}\n role=\"listitem\"\n tabIndex={-1}\n sx={{\n height: rowHeight,\n position: 'absolute',\n // Keeps a focused row from scrolling under the sticky header.\n scrollMarginTop: headerHeight,\n transform: `translateY(${row.start - scrollMargin}px)`,\n width: '100%',\n bgcolor: 'background.paper',\n }}\n >\n {showDate && (\n <SubheaderRow bgcolor={bgcolor}>\n {fromUnixUTCToDayOfWeekAndDate(transaction.date)}\n </SubheaderRow>\n )}\n <TransactionRow\n component=\"div\"\n disabled={isRowDisabled?.(transaction)}\n {...(onClick && { onClick: handleClick })}\n transaction={transaction}\n />\n <Divider sx={{ ml: isInset ? 68 : 0 }} />\n </Box>\n )\n })}\n </Box>\n </Box>\n </List>\n {showRows && unrenderedCount > 0 && (\n <Box\n component=\"button\"\n onClick={showNextRows}\n sx={VISUALLY_HIDDEN_SX}\n tabIndex={-1}\n type=\"button\"\n >\n {`${commonCopy.view_more} (${unrenderedCount})`}\n </Box>\n )}\n </>\n )\n}\n\nexport default observer(TransactionList)\n"],"mappings":";;;;;;;;;;;;;;;;;AA2BA,IAAM,IAAa,IACb,IAAkB,IAElB,KAAA,CAAoB,MAAiD;AACzE,WAAS,IAAK,GAAM,eAAe,GAAI,IAAK,EAAG,cAC7C,KAAI,gBAAgB,KAAK,iBAAiB,CAAE,EAAE,SAAS,EAAG,QAAO;AAEnE,SAAO;AACT,GAwBM,KAAA,CAAmD,EACvD,SAAA,GACA,QAAA,GACA,QAAA,IAAS,uBACT,eAAA,GACA,QAAA,IAAS,gBAAA,EAAC,IAAD;AAAA,EAAQ,OAAM;AAAA,EAAU,MAAM;AAAK,CAAA,GAC5C,SAAA,GACA,mBAAA,IAAoB,IACpB,cAAA,IAAe,IACf,YAAA,IAAa,IACb,cAAA,GACA,aAAA,GACA,OAAA,IAAQ,QACR,WAAA,IAAY,gBAAA,EAAC,IAAD,CAAY,CAAA,EAAA,MACpB;AACJ,QAAM,EAAE,WAAA,GAAW,oBAAoB,E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