@mx-cartographer/experiences 9.4.60 → 9.4.62
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/core/stores/GlobalStore.d.ts +8 -2
- package/dist/core/stores/GlobalStore.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.d.ts +17 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js +21 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/WithdrawalCard.d.ts +25 -0
- package/dist/insights-v2/components/WithdrawalCard.es.js +63 -0
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -0
- package/dist/insights-v2/index.d.ts +1 -0
- package/dist/insights-v2/index.es.js +62 -58
- package/dist/insights-v2/mappings/blocks.es.js +24 -22
- 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.4.62] - 10-07-2026
|
|
2
|
+
|
|
3
|
+
- **ADDED** - `withdrawal_block` (Highlight Withdrawal) component block and `WithdrawalCard`: the amount (shown with a leading minus unless it is zero), an `"{amount_label} {withdrawal_date}"` date line and a grey balance footer, read from one `instance_slot.data_series` row (`amount`, `amount_label`, `withdrawal_date`, `balance`, `balance_label`). Text arrives localized from the backend; only `amount` and `balance` are formatted. (WEC-1871)
|
|
4
|
+
|
|
5
|
+
## [9.4.61] - 10-07-2026
|
|
6
|
+
|
|
7
|
+
- **ADDED** - `ObservedUpdate` type exported from `GlobalStore` with an optional `staleBeatGuid`, so an in-app action that outdates a beat can tell the host to refetch it over the existing `onStoreUpdate` bridge; `transactions` is now optional on that payload (WEC-1852)
|
|
8
|
+
|
|
1
9
|
## [9.4.60] - 10-07-2026
|
|
2
10
|
|
|
3
11
|
- **ADDED** - Insights 2.0 render gate: `Beat.is_insights_v2` (written by firefly) and `resolveInsightRender(beat)` → `legacy` | `v2` | `error`. An absent flag renders the legacy path unchanged; a flagged beat with no envelope is an `error`, never a legacy card. (WEC-1823)
|
|
@@ -15,8 +15,14 @@ interface LoadDataProps {
|
|
|
15
15
|
userFeatures?: UserFeature[];
|
|
16
16
|
}
|
|
17
17
|
type OnStoreUpdate = (update: ObservedUpdate) => void;
|
|
18
|
-
type ObservedUpdate = {
|
|
19
|
-
transactions
|
|
18
|
+
export type ObservedUpdate = {
|
|
19
|
+
transactions?: Transaction[];
|
|
20
|
+
/**
|
|
21
|
+
* Guid of a beat whose data went stale because of an action taken inside experiences
|
|
22
|
+
* (e.g. an insight CTA that mutated data). Hosts refetch that beat's sampled data.
|
|
23
|
+
* Emitted only from explicit actions, never from the transactions autorun.
|
|
24
|
+
*/
|
|
25
|
+
staleBeatGuid?: string;
|
|
20
26
|
};
|
|
21
27
|
export declare class GlobalStore {
|
|
22
28
|
appConfig: AppConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalStore.ts"],"sourcesContent":["import { autorun, makeAutoObservable } from 'mobx'\n\nimport { DefaultAppConfig } from '../constants/DefaultConfig'\n\nimport {\n AccountStore,\n AnalyticsStore,\n AppDataStore,\n BeatStore,\n BudgetsStore,\n CashflowStore,\n CategoryStore,\n ConnectStore,\n DebtsStore,\n FinstrongStore,\n GlobalCopyStore,\n GlobalUiStore,\n GoalStore,\n HelpStore,\n HoldingStore,\n InsightsV2Store,\n MerchantStore,\n NetWorthStore,\n NotificationStore,\n RecurringTransactionsStore,\n SettingsStore,\n TransactionStore,\n TrendsStore,\n UserStore,\n} from '../stores'\n\nimport type {\n Account,\n Category,\n Institution,\n Member,\n AppConfig,\n AppData,\n Beat,\n GlobalCaptureException,\n GlobalErrorHandler,\n MerchantBudget,\n Tag,\n Tagging,\n Transaction,\n TransactionRule,\n UserFeature,\n} from '../types'\n\ninterface LoadDataProps {\n accounts?: Account[]\n appData?: AppData\n associatedBeats?: Beat[]\n categories?: Category[]\n institutions?: Institution[]\n members?: Member[]\n merchantBudgets?: MerchantBudget[]\n taggings?: Tagging[]\n tags?: Tag[]\n transactionRules?: TransactionRule[]\n transactions?: Transaction[]\n userFeatures?: UserFeature[]\n}\n\ntype OnStoreUpdate = (update: ObservedUpdate) => void\
|
|
1
|
+
{"version":3,"file":"GlobalStore.es.js","names":[],"sources":["../../../src/core/stores/GlobalStore.ts"],"sourcesContent":["import { autorun, makeAutoObservable } from 'mobx'\n\nimport { DefaultAppConfig } from '../constants/DefaultConfig'\n\nimport {\n AccountStore,\n AnalyticsStore,\n AppDataStore,\n BeatStore,\n BudgetsStore,\n CashflowStore,\n CategoryStore,\n ConnectStore,\n DebtsStore,\n FinstrongStore,\n GlobalCopyStore,\n GlobalUiStore,\n GoalStore,\n HelpStore,\n HoldingStore,\n InsightsV2Store,\n MerchantStore,\n NetWorthStore,\n NotificationStore,\n RecurringTransactionsStore,\n SettingsStore,\n TransactionStore,\n TrendsStore,\n UserStore,\n} from '../stores'\n\nimport type {\n Account,\n Category,\n Institution,\n Member,\n AppConfig,\n AppData,\n Beat,\n GlobalCaptureException,\n GlobalErrorHandler,\n MerchantBudget,\n Tag,\n Tagging,\n Transaction,\n TransactionRule,\n UserFeature,\n} from '../types'\n\ninterface LoadDataProps {\n accounts?: Account[]\n appData?: AppData\n associatedBeats?: Beat[]\n categories?: Category[]\n institutions?: Institution[]\n members?: Member[]\n merchantBudgets?: MerchantBudget[]\n taggings?: Tagging[]\n tags?: Tag[]\n transactionRules?: TransactionRule[]\n transactions?: Transaction[]\n userFeatures?: UserFeature[]\n}\n\ntype OnStoreUpdate = (update: ObservedUpdate) => void\nexport type ObservedUpdate = {\n transactions?: Transaction[]\n /**\n * Guid of a beat whose data went stale because of an action taken inside experiences\n * (e.g. an insight CTA that mutated data). Hosts refetch that beat's sampled data.\n * Emitted only from explicit actions, never from the transactions autorun.\n */\n staleBeatGuid?: string\n}\nexport class GlobalStore {\n // Global properties\n appConfig: AppConfig = DefaultAppConfig\n endpoint: string = '/'\n sessionToken: string = ''\n onCaptureException?: GlobalCaptureException\n onError?: GlobalErrorHandler\n onStoreUpdate?: OnStoreUpdate\n\n // Data Stores\n accountStore: AccountStore\n appDataStore: AppDataStore\n analyticsStore: AnalyticsStore\n beatStore: BeatStore\n budgetsStore: BudgetsStore\n cashflowStore: CashflowStore\n categoryStore: CategoryStore\n connectStore: ConnectStore\n copyStore: GlobalCopyStore\n debtsStore: DebtsStore\n finstrongStore: FinstrongStore\n goalStore: GoalStore\n helpStore: HelpStore\n holdingStore: HoldingStore\n merchantStore: MerchantStore\n netWorthStore: NetWorthStore\n notificationStore: NotificationStore\n recurringTransactionsStore: RecurringTransactionsStore\n settingsStore: SettingsStore\n transactionStore: TransactionStore\n trendsStore: TrendsStore\n userStore: UserStore\n\n // UI Stores\n globalUiStore: GlobalUiStore\n insightsV2Store: InsightsV2Store\n\n constructor(\n appConfig: AppConfig = DefaultAppConfig,\n endpoint: string = '/',\n onError?: GlobalErrorHandler,\n onStoreUpdate?: OnStoreUpdate,\n onCaptureException?: GlobalCaptureException,\n ) {\n this.appConfig = appConfig\n this.endpoint = endpoint\n this.sessionToken = appConfig.options.session_token ?? ''\n this.onCaptureException = onCaptureException\n this.onError = onError\n this.onStoreUpdate = onStoreUpdate\n\n this.accountStore = new AccountStore(this)\n this.appDataStore = new AppDataStore(this)\n this.analyticsStore = new AnalyticsStore(this)\n this.beatStore = new BeatStore(this)\n this.budgetsStore = new BudgetsStore(this)\n this.cashflowStore = new CashflowStore(this)\n this.categoryStore = new CategoryStore(this)\n this.connectStore = new ConnectStore(this)\n this.copyStore = new GlobalCopyStore(this)\n this.debtsStore = new DebtsStore(this)\n this.finstrongStore = new FinstrongStore(this)\n this.goalStore = new GoalStore(this)\n this.helpStore = new HelpStore(this)\n this.holdingStore = new HoldingStore(this)\n this.merchantStore = new MerchantStore(this)\n this.netWorthStore = new NetWorthStore(this)\n this.notificationStore = new NotificationStore(this)\n this.recurringTransactionsStore = new RecurringTransactionsStore(this)\n this.settingsStore = new SettingsStore(this)\n this.transactionStore = new TransactionStore(this)\n this.trendsStore = new TrendsStore(this)\n this.userStore = new UserStore(this)\n\n this.globalUiStore = new GlobalUiStore(this)\n this.insightsV2Store = new InsightsV2Store(this)\n\n makeAutoObservable(this)\n\n // detects a change based on an observed value\n autorun(() => {\n // destructure or assign new variables to observe changes to them\n // in this case we are observing changes to `transactions`\n const { transactions } = this.transactionStore\n this.emitUpdate({\n transactions,\n })\n })\n }\n\n get isInitialized() {\n return this.globalUiStore.isInitialized\n }\n\n captureException = (error: unknown, context?: Record<string, string>) => {\n if (this.onCaptureException) {\n this.onCaptureException(error, context)\n return\n }\n console.error('Unreported error:', error, context)\n }\n\n // emits change triggered in the autorun\n emitUpdate = (change: ObservedUpdate) => {\n this.onStoreUpdate?.(change)\n }\n\n loadConfigData = async () => {\n await Promise.all([\n // Load copy, config and user data\n this.copyStore.loadCopy(),\n this.appDataStore.loadAppData(),\n this.accountStore.refreshMembers(),\n this.userStore.loadUserFeatures(),\n ])\n }\n\n loadData = async ({\n accounts,\n appData,\n associatedBeats,\n categories,\n institutions,\n transactionRules,\n transactions,\n userFeatures,\n merchantBudgets,\n }: LoadDataProps = {}) => {\n if (!appData || !userFeatures) {\n await this.loadConfigData()\n }\n\n // Keep for backwards compatibility for Insights\n if (appData) {\n this.appDataStore.setAppData(appData)\n }\n\n if (userFeatures) {\n this.userStore.setUserFeatures(userFeatures)\n }\n\n if (accounts) {\n await this.accountStore.loadMembers()\n if (institutions) {\n this.accountStore.setInstitutions(institutions)\n }\n this.accountStore.setAccounts(accounts)\n }\n\n if (associatedBeats) {\n this.transactionStore.setAssociatedBeats(associatedBeats)\n }\n\n if (categories) {\n this.categoryStore.setCategories(categories)\n }\n\n if (transactions) {\n this.transactionStore.setTransactions(transactions)\n }\n\n if (transactionRules) {\n this.transactionStore.setTransactionRules(transactionRules)\n }\n\n if (merchantBudgets) {\n this.budgetsStore.setMerchantBudgets(merchantBudgets)\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -191,6 +191,7 @@ export declare const BlockType: {
|
|
|
191
191
|
readonly DoubleProgressBarBlock: "double_progress_bar_block";
|
|
192
192
|
readonly StepChartBlock: "step_chart_block";
|
|
193
193
|
readonly SVGImageBlock: "svg_image_block";
|
|
194
|
+
readonly WithdrawalBlock: "withdrawal_block";
|
|
194
195
|
};
|
|
195
196
|
export type BlockType = (typeof BlockType)[keyof typeof BlockType];
|
|
196
197
|
/**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BlockProps } from '../../types';
|
|
2
|
+
/** The Withdrawal row on `instance_slot.data_series`. */
|
|
3
|
+
export interface WithdrawalRow {
|
|
4
|
+
amount?: number;
|
|
5
|
+
amount_label?: string;
|
|
6
|
+
balance?: number;
|
|
7
|
+
balance_label?: string;
|
|
8
|
+
withdrawal_date?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The `withdrawal_block` (Highlight Withdrawal), reading one row on
|
|
12
|
+
* `instance_slot.data_series`. Text (`amount_label`, `withdrawal_date`,
|
|
13
|
+
* `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the
|
|
14
|
+
* card. Renders nothing unless the row carries both numbers.
|
|
15
|
+
*/
|
|
16
|
+
declare const WithdrawalBlock: ({ payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
export default WithdrawalBlock;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import l from "../../../components/WithdrawalCard.es.js";
|
|
2
|
+
import n from "@mui/material/Stack";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
var s = ({ payload: e }) => {
|
|
5
|
+
const r = e.instance_slot.data_series, [a] = Array.isArray(r) ? r : [];
|
|
6
|
+
return !Number.isFinite(a?.amount) || !Number.isFinite(a?.balance) ? null : /* @__PURE__ */ t(n, {
|
|
7
|
+
sx: { px: 16 },
|
|
8
|
+
children: /* @__PURE__ */ t(l, {
|
|
9
|
+
amount: a.amount,
|
|
10
|
+
amountLabel: a.amount_label,
|
|
11
|
+
balance: a.balance,
|
|
12
|
+
balanceLabel: a.balance_label,
|
|
13
|
+
withdrawalDate: a.withdrawal_date
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
s as default
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=WithdrawalBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport WithdrawalCard from '../../../components/WithdrawalCard'\nimport type { BlockProps } from '../../types'\n\n/** The Withdrawal row on `instance_slot.data_series`. */\nexport interface WithdrawalRow {\n amount?: number\n amount_label?: string\n balance?: number\n balance_label?: string\n withdrawal_date?: string\n}\n\n/**\n * The `withdrawal_block` (Highlight Withdrawal), reading one row on\n * `instance_slot.data_series`. Text (`amount_label`, `withdrawal_date`,\n * `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the\n * card. Renders nothing unless the row carries both numbers.\n */\nconst WithdrawalBlock = ({ payload }: BlockProps) => {\n const rows = payload.instance_slot.data_series\n const [row] = (Array.isArray(rows) ? rows : []) as WithdrawalRow[]\n\n if (!Number.isFinite(row?.amount) || !Number.isFinite(row?.balance)) return null\n\n return (\n <Stack sx={{ px: 16 }}>\n <WithdrawalCard\n amount={row.amount as number}\n amountLabel={row.amount_label}\n balance={row.balance as number}\n balanceLabel={row.balance_label}\n withdrawalDate={row.withdrawal_date}\n />\n </Stack>\n )\n}\n\nexport default WithdrawalBlock\n"],"mappings":";;;AAoBA,IAAM,IAAA,CAAmB,EAAE,SAAA,EAAA,MAA0B;AACnD,QAAM,IAAO,EAAQ,cAAc,aAC7B,CAAC,CAAA,IAAQ,MAAM,QAAQ,CAAI,IAAI,IAAO,CAAC;AAE7C,SAAI,CAAC,OAAO,SAAS,GAAK,MAAM,KAAK,CAAC,OAAO,SAAS,GAAK,OAAO,IAAU,OAG1E,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,EAAI;AAAA,MACZ,aAAa,EAAI;AAAA,MACjB,SAAS,EAAI;AAAA,MACb,cAAc,EAAI;AAAA,MAClB,gBAAgB,EAAI;AAAA,IACrB,CAAA;AAAA,EACI,CAAA;AAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as WithdrawalBlock } from './WithdrawalBlock';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material/styles';
|
|
2
|
+
interface WithdrawalCardProps {
|
|
3
|
+
/** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */
|
|
4
|
+
amount: number;
|
|
5
|
+
/** Pre-localized lead-in for the date line (e.g. "Withdrawn on"). */
|
|
6
|
+
amountLabel?: string;
|
|
7
|
+
/** Account balance after the withdrawal, shown in the grey footer row. */
|
|
8
|
+
balance: number;
|
|
9
|
+
/** Pre-localized footer label for the balance (e.g. "Balance"). */
|
|
10
|
+
balanceLabel?: string;
|
|
11
|
+
/** Pre-localized withdrawal date (e.g. "October 5, 2026"). */
|
|
12
|
+
withdrawalDate?: string;
|
|
13
|
+
sx?: SxProps;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A centered withdrawal highlight: the amount as a headline with a date line beneath it
|
|
17
|
+
* ("{amountLabel} {withdrawalDate}"), over a grey footer row showing the balance. All text arrives
|
|
18
|
+
* localized from the backend; only the two numbers are formatted here (the amount gets a leading
|
|
19
|
+
* minus unless it is zero). The date line is hidden when both `amountLabel` and `withdrawalDate`
|
|
20
|
+
* are empty.
|
|
21
|
+
*
|
|
22
|
+
* Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.
|
|
23
|
+
*/
|
|
24
|
+
declare const WithdrawalCard: ({ amount, amountLabel, balance, balanceLabel, withdrawalDate, sx, }: WithdrawalCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default WithdrawalCard;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { formatCurrency as n } from "../../core/utils/NumberFormatting.es.js";
|
|
2
|
+
import t from "@mui/material/Stack";
|
|
3
|
+
import { Text as e } from "@mxenabled/mxui";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import m from "@mui/material/Divider";
|
|
6
|
+
var x = (o) => o === 0 ? n(0, "0,0.00") : `-${n(Math.abs(o), "0,0.00")}`, y = ({ amount: o, amountLabel: l, balance: s, balanceLabel: d, withdrawalDate: a, sx: p }) => {
|
|
7
|
+
const c = a ? [l, a].filter(Boolean).join(" ") : "";
|
|
8
|
+
return /* @__PURE__ */ i(t, {
|
|
9
|
+
sx: {
|
|
10
|
+
border: "1px solid",
|
|
11
|
+
borderColor: "divider",
|
|
12
|
+
borderRadius: "4px",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
width: "100%",
|
|
15
|
+
...p
|
|
16
|
+
},
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ i(t, {
|
|
19
|
+
sx: {
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
gap: 4,
|
|
22
|
+
px: 16,
|
|
23
|
+
py: 20
|
|
24
|
+
},
|
|
25
|
+
children: [/* @__PURE__ */ r(e, {
|
|
26
|
+
bold: !0,
|
|
27
|
+
variant: "h1",
|
|
28
|
+
children: x(o)
|
|
29
|
+
}), c && /* @__PURE__ */ r(e, {
|
|
30
|
+
color: "text.secondary",
|
|
31
|
+
variant: "caption",
|
|
32
|
+
children: c
|
|
33
|
+
})]
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ r(m, {}),
|
|
36
|
+
/* @__PURE__ */ i(t, {
|
|
37
|
+
sx: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
bgcolor: "background.default",
|
|
40
|
+
flexDirection: "row",
|
|
41
|
+
justifyContent: "space-between",
|
|
42
|
+
minHeight: 40,
|
|
43
|
+
px: 16,
|
|
44
|
+
py: 2
|
|
45
|
+
},
|
|
46
|
+
children: [d && /* @__PURE__ */ r(e, {
|
|
47
|
+
color: "text.secondary",
|
|
48
|
+
variant: "caption",
|
|
49
|
+
children: d
|
|
50
|
+
}), /* @__PURE__ */ r(e, {
|
|
51
|
+
bold: !0,
|
|
52
|
+
variant: "body2",
|
|
53
|
+
children: n(s, "0,0.00")
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
export {
|
|
60
|
+
y as default
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=WithdrawalCard.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalCard.es.js","names":[],"sources":["../../../src/insights-v2/components/WithdrawalCard.tsx"],"sourcesContent":["import Divider from '@mui/material/Divider'\nimport Stack from '@mui/material/Stack'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { formatCurrency } from '../../core/utils/NumberFormatting'\n\n// A withdrawal is a debit, so a non-zero amount is shown with a leading minus (\"-$100.00\"); zero is\n// shown unsigned (\"$0.00\"). The sign comes from the magnitude, so an amount that already arrives\n// negative does not render a double minus.\nconst formatWithdrawalAmount = (amount: number) =>\n amount === 0 ? formatCurrency(0, '0,0.00') : `-${formatCurrency(Math.abs(amount), '0,0.00')}`\n\ninterface WithdrawalCardProps {\n /** Withdrawn amount as a plain number (e.g. `100`); the card adds the minus sign. */\n amount: number\n /** Pre-localized lead-in for the date line (e.g. \"Withdrawn on\"). */\n amountLabel?: string\n /** Account balance after the withdrawal, shown in the grey footer row. */\n balance: number\n /** Pre-localized footer label for the balance (e.g. \"Balance\"). */\n balanceLabel?: string\n /** Pre-localized withdrawal date (e.g. \"October 5, 2026\"). */\n withdrawalDate?: string\n sx?: SxProps\n}\n\n/**\n * A centered withdrawal highlight: the amount as a headline with a date line beneath it\n * (\"{amountLabel} {withdrawalDate}\"), over a grey footer row showing the balance. All text arrives\n * localized from the backend; only the two numbers are formatted here (the amount gets a leading\n * minus unless it is zero). The date line is hidden when both `amountLabel` and `withdrawalDate`\n * are empty.\n *\n * Figma: Withdrawal component block (Highlight Withdrawal). Scope is the Content section only.\n */\nconst WithdrawalCard = ({\n amount,\n amountLabel,\n balance,\n balanceLabel,\n withdrawalDate,\n sx,\n}: WithdrawalCardProps) => {\n const dateLine = withdrawalDate ? [amountLabel, withdrawalDate].filter(Boolean).join(' ') : ''\n\n return (\n <Stack\n sx={{\n border: '1px solid',\n borderColor: 'divider',\n borderRadius: '4px',\n overflow: 'hidden',\n width: '100%',\n ...sx,\n }}\n >\n <Stack sx={{ alignItems: 'center', gap: 4, px: 16, py: 20 }}>\n <Text bold={true} variant=\"h1\">\n {formatWithdrawalAmount(amount)}\n </Text>\n {dateLine && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateLine}\n </Text>\n )}\n </Stack>\n <Divider />\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: 'background.default',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 40,\n px: 16,\n py: 2,\n }}\n >\n {balanceLabel && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {balanceLabel}\n </Text>\n )}\n <Text bold={true} variant=\"body2\">\n {formatCurrency(balance, '0,0.00')}\n </Text>\n </Stack>\n </Stack>\n )\n}\n\nexport default WithdrawalCard\n"],"mappings":";;;;;AAWA,IAAM,IAAA,CAA0B,MAC9B,MAAW,IAAI,EAAe,GAAG,QAAQ,IAAI,IAAI,EAAe,KAAK,IAAI,CAAM,GAAG,QAAQ,CAAA,IAyBtF,IAAA,CAAkB,EACtB,QAAA,GACA,aAAA,GACA,SAAA,GACA,cAAA,GACA,gBAAA,GACA,IAAA,EAAA,MACyB;AACzB,QAAM,IAAW,IAAiB,CAAC,GAAa,CAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,IAAI;AAE5F,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,cAAc;AAAA,MACd,UAAU;AAAA,MACV,OAAO;AAAA,MACP,GAAG;AAAA,IACL;AAAA,IARF,UAAA;AAAA,MAUE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,YAAY;AAAA,UAAU,KAAK;AAAA,UAAG,IAAI;AAAA,UAAI,IAAI;AAAA,QAAG;AAAA,QAA1D,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,SAAQ;AAAA,UACvB,UAAA,EAAuB,CAAM;AAAA,QAC1B,CAAA,GACL,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA;AAAA,QACG,CAAA,CAEH;AAAA;MACP,gBAAA,EAAC,GAAD,CAAU,CAAA;AAAA,MACV,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,eAAe;AAAA,UACf,gBAAgB;AAAA,UAChB,WAAW;AAAA,UACX,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QATF,UAAA,CAWG,KACC,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAiB,SAAQ;AAAA,UAClC,UAAA;AAAA,QACG,CAAA,GAER,gBAAA,EAAC,GAAD;AAAA,UAAM,MAAM;AAAA,UAAM,SAAQ;AAAA,UACvB,UAAA,EAAe,GAAS,QAAQ;AAAA,QAC7B,CAAA,CACD;AAAA;IACF;AAAA;AAEX"}
|
|
@@ -31,4 +31,5 @@ export { default as SavingsOpportunityCard } from './components/SavingsOpportuni
|
|
|
31
31
|
export { default as StatusPill } from './components/StatusPill';
|
|
32
32
|
export { default as SubscriptionHeroCard } from './components/SubscriptionHeroCard';
|
|
33
33
|
export { default as TransferLogoCard } from './components/TransferLogoCard';
|
|
34
|
+
export { default as WithdrawalCard } from './components/WithdrawalCard';
|
|
34
35
|
export { default as UpcomingBillCard, type UpcomingBillCardProps, type UpcomingBillDay, } from './components/UpcomingBillCard';
|
|
@@ -10,84 +10,88 @@ import h from "./components/CompactInsightCard.es.js";
|
|
|
10
10
|
import S from "./components/InsightErrorCard.es.js";
|
|
11
11
|
import { BAR_CHART_VARIANTS as b, barChartVariant as D, buildChartData as L, buildDataSeries as T } from "./blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
12
12
|
import { BarchartBlock as v } from "./blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
13
|
-
import { DoubleBarChartBlock as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import { DoubleBarChartBlock as E } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
14
|
+
import P from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
15
|
+
import M from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
16
|
+
import V from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
17
17
|
import y from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
18
18
|
import G from "./components/TransferLogoCard.es.js";
|
|
19
|
-
import
|
|
20
|
-
import { BudgetBlock as
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
19
|
+
import _ from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
20
|
+
import { BudgetBlock as U } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
21
|
+
import q from "./components/SaveAnExtraCard.es.js";
|
|
22
|
+
import J from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
23
|
+
import Q from "./components/InsightTransactionRow.es.js";
|
|
24
24
|
import Y from "./components/TransactionListCard.es.js";
|
|
25
25
|
import { TransactionBlock as $, TransactionBlockVariant as rr } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
26
|
-
import
|
|
27
|
-
import ir from "./
|
|
28
|
-
import pr from "./
|
|
29
|
-
import er from "./components/
|
|
30
|
-
import
|
|
31
|
-
import lr from "./components/
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import Lr from "./components/
|
|
38
|
-
import Ir from "./components/
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import xr from "./components/
|
|
44
|
-
import Fr from "./components/
|
|
45
|
-
import
|
|
26
|
+
import mr from "./components/WithdrawalCard.es.js";
|
|
27
|
+
import ir from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
28
|
+
import { SVGImageBlock as pr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
29
|
+
import er from "./components/AccountHeroCard.es.js";
|
|
30
|
+
import sr from "./components/AmountPill.es.js";
|
|
31
|
+
import lr from "./components/DesignateEmergencySavingsCard.es.js";
|
|
32
|
+
import { FeedbackBar as gr } from "./components/FeedbackBar.es.js";
|
|
33
|
+
import Br from "./components/FeedbackDialog.es.js";
|
|
34
|
+
import { DismissInsightDialog as hr } from "./components/DismissInsightDialog.es.js";
|
|
35
|
+
import { HiddenConfirmationCard as Sr } from "./components/HiddenConfirmationCard.es.js";
|
|
36
|
+
import { ErrorCard as br } from "./components/ErrorCard.es.js";
|
|
37
|
+
import { LoadingCard as Lr } from "./components/LoadingCard.es.js";
|
|
38
|
+
import { ObsolesceBanner as Ir } from "./components/ObsolesceBanner.es.js";
|
|
39
|
+
import wr from "./components/BaseLayout.es.js";
|
|
40
|
+
import Hr from "./components/StatusMessageCard.es.js";
|
|
41
|
+
import Rr from "./components/LogoTile.es.js";
|
|
42
|
+
import Or from "./components/LogoClusterCard.es.js";
|
|
43
|
+
import xr from "./components/MerchantHighlightCard.es.js";
|
|
44
|
+
import Fr from "./components/P2PLogoStack.es.js";
|
|
45
|
+
import Wr from "./components/SavingsOpportunityCard.es.js";
|
|
46
|
+
import Nr from "./components/SubscriptionHeroCard.es.js";
|
|
47
|
+
import jr from "./components/UpcomingBillCard.es.js";
|
|
46
48
|
export {
|
|
47
49
|
y as AccountBlock,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
er as AccountHeroCard,
|
|
51
|
+
_ as AccountSwitchBlock,
|
|
52
|
+
sr as AmountPill,
|
|
51
53
|
b as BAR_CHART_VARIANTS,
|
|
52
54
|
f as BadgedTile,
|
|
53
55
|
v as BarchartBlock,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
wr as BaseLayout,
|
|
57
|
+
U as BudgetBlock,
|
|
56
58
|
h as CompactInsightCard,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
lr as DesignateEmergencySavingsCard,
|
|
60
|
+
hr as DismissInsightDialog,
|
|
61
|
+
M as DonutChartBlock,
|
|
62
|
+
E as DoubleBarChartBlock,
|
|
63
|
+
V as DoubleProgressBarBlock,
|
|
64
|
+
br as ErrorCard,
|
|
65
|
+
gr as FeedbackBar,
|
|
66
|
+
Br as FeedbackDialog,
|
|
67
|
+
Sr as HiddenConfirmationCard,
|
|
66
68
|
S as InsightErrorCard,
|
|
67
69
|
c as InsightOptionsMenu,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
Q as InsightTransactionRow,
|
|
71
|
+
Lr as LoadingCard,
|
|
72
|
+
Or as LogoClusterCard,
|
|
71
73
|
d as LogoFromGuid,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
Rr as LogoTile,
|
|
75
|
+
xr as MerchantHighlightCard,
|
|
76
|
+
Ir as ObsolesceBanner,
|
|
75
77
|
n as OverflowMenu,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
Fr as P2PLogoStack,
|
|
79
|
+
pr as SVGImageBlock,
|
|
80
|
+
q as SaveAnExtraCard,
|
|
81
|
+
J as SaveExtraBlock,
|
|
82
|
+
Wr as SavingsOpportunityCard,
|
|
81
83
|
B as StatusBadge,
|
|
82
|
-
|
|
84
|
+
Hr as StatusMessageCard,
|
|
83
85
|
o as StatusPill,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
P as StepChartBlock,
|
|
87
|
+
Nr as SubscriptionHeroCard,
|
|
86
88
|
$ as TransactionBlock,
|
|
87
89
|
rr as TransactionBlockVariant,
|
|
88
90
|
Y as TransactionListCard,
|
|
89
91
|
G as TransferLogoCard,
|
|
90
|
-
|
|
92
|
+
jr as UpcomingBillCard,
|
|
93
|
+
ir as WithdrawalBlock,
|
|
94
|
+
mr as WithdrawalCard,
|
|
91
95
|
D as barChartVariant,
|
|
92
96
|
L as buildChartData,
|
|
93
97
|
T as buildDataSeries,
|
|
@@ -10,42 +10,43 @@ import _ from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.e
|
|
|
10
10
|
import { BudgetBlock as k } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
11
11
|
import s from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
12
12
|
import { TransactionBlock as B } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
13
|
-
import C from "../blocks/
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
13
|
+
import C from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
14
|
+
import f from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
15
|
+
import { SVGImageBlock as u } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
16
|
+
import { PlaceholderActionBlock as T } from "../actionBlocks/PlaceholderActionBlock.es.js";
|
|
17
|
+
import { getMakeTransferDrawerTitle as b } from "../actionBlocks/MakeTransferActionBlock/layout.es.js";
|
|
18
|
+
import { MakeTransferActionBlockLayer as A } from "../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js";
|
|
19
|
+
import { getDrawerHeaderTitle as O } from "../actionBlocks/TransactionHistoryBlock/utils.es.js";
|
|
20
|
+
import { TransactionDetailsBlock as h } from "../actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
21
|
+
import { useTransactionDetailsPrepare as d } from "../actionBlocks/TransactionDetailsBlock/useTransactionDetailsPrepare.es.js";
|
|
21
22
|
import { TransactionHistoryBlock as L } from "../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js";
|
|
22
23
|
var t = (e) => {
|
|
23
24
|
}, N = /* @__PURE__ */ new Set([
|
|
24
25
|
"",
|
|
25
26
|
"null",
|
|
26
27
|
"undefined"
|
|
27
|
-
]),
|
|
28
|
+
]), j = (e) => {
|
|
28
29
|
const r = e?.trim().toLowerCase();
|
|
29
30
|
return !!r && !N.has(r);
|
|
30
|
-
},
|
|
31
|
+
}, J = {
|
|
31
32
|
[o.PLACEHOLDER_ACTION_BLOCK]: {
|
|
32
|
-
Component:
|
|
33
|
+
Component: T,
|
|
33
34
|
usePrepare: t,
|
|
34
35
|
title: () => "Action Block Layer Drilldown"
|
|
35
36
|
},
|
|
36
37
|
[o.MAKE_TRANSFER_ACTION_BLOCK]: {
|
|
37
|
-
Component:
|
|
38
|
+
Component: A,
|
|
38
39
|
usePrepare: t,
|
|
39
|
-
title:
|
|
40
|
+
title: b
|
|
40
41
|
},
|
|
41
42
|
[o.TRANSCATION_HISTORY_ACTION_BLOCK]: {
|
|
42
43
|
Component: L,
|
|
43
44
|
usePrepare: t,
|
|
44
|
-
title:
|
|
45
|
+
title: O
|
|
45
46
|
},
|
|
46
47
|
[o.TRANSACTION_DETAILS_ACTION_BLOCK]: {
|
|
47
|
-
Component:
|
|
48
|
-
usePrepare:
|
|
48
|
+
Component: h,
|
|
49
|
+
usePrepare: d,
|
|
49
50
|
title: () => "Transaction Details"
|
|
50
51
|
},
|
|
51
52
|
[o.CONTACT_SUPPORT_ACTION_BLOCK]: {
|
|
@@ -53,7 +54,7 @@ var t = (e) => {
|
|
|
53
54
|
usePrepare: t,
|
|
54
55
|
title: (e, r) => r.help?.request_support ?? ""
|
|
55
56
|
}
|
|
56
|
-
},
|
|
57
|
+
}, Q = {
|
|
57
58
|
account_block: p,
|
|
58
59
|
account_switch_block: _,
|
|
59
60
|
bar_chart_block: c,
|
|
@@ -61,16 +62,17 @@ var t = (e) => {
|
|
|
61
62
|
donut_chart_block: m,
|
|
62
63
|
double_bar_chart_block: l,
|
|
63
64
|
double_progress_bar_block: n,
|
|
64
|
-
image_block:
|
|
65
|
+
image_block: f,
|
|
65
66
|
save_extra_block: s,
|
|
66
67
|
step_chart_block: i,
|
|
67
|
-
svg_image_block:
|
|
68
|
+
svg_image_block: u,
|
|
69
|
+
withdrawal_block: C,
|
|
68
70
|
transaction_block: B
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
J as actionBlocks,
|
|
74
|
+
Q as blocks,
|
|
75
|
+
j as hasDrawerBlock
|
|
74
76
|
};
|
|
75
77
|
|
|
76
78
|
//# 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 DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\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 { 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'\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// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\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 (e.g.\n // MakeTransfer reads its variant title from layout.ts). Falls back to the CTA label.\n title?: (variant: string | null | undefined, copy: GlobalCopy) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\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]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":"
|
|
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 DonutChartBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n SaveExtraBlock,\n SVGImageBlock,\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 { 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'\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// A CTA opens a drawer only when it carries a real `block`. The backend may send\n// an empty/absent block (or the literal strings \"null\"/\"undefined\") for CTAs\n// that trigger something else (e.g. a postMessage) instead of a drilldown.\nconst NON_BLOCK_VALUES = new Set(['', 'null', 'undefined'])\nexport const hasDrawerBlock = (block?: string | null): boolean => {\n const normalized = block?.trim().toLowerCase()\n return !!normalized && !NON_BLOCK_VALUES.has(normalized)\n}\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 (e.g.\n // MakeTransfer reads its variant title from layout.ts). Falls back to the CTA label.\n title?: (variant: string | null | undefined, copy: GlobalCopy) => string\n}\n\n// Registry of drawer drilldowns, keyed by the `block` name the backend sends\n// on a beat's CTA. To add one: create a component taking ActionBlockProps,\n// read the clicked indexes from useInsightsV2Store().actionDrawer, and\n// register it here. Add\n// `usePrepare` when the block needs to load data before rendering.\n\nexport const actionBlocks = {\n [actionBlocksKey.PLACEHOLDER_ACTION_BLOCK]: {\n Component: PlaceholderActionBlock,\n usePrepare: noop,\n title: () => 'Action Block Layer Drilldown',\n },\n [actionBlocksKey.MAKE_TRANSFER_ACTION_BLOCK]: {\n Component: MakeTransferActionBlockLayer,\n usePrepare: noop,\n title: getMakeTransferDrawerTitle,\n },\n [actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK]: {\n Component: TransactionHistoryBlock,\n usePrepare: noop,\n title: getDrawerHeaderTitle,\n },\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: {\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\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]: {\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n },\n} as Record<string, ActionBlockEntry>\n\nexport const blocks = {\n account_block: AccountBlock,\n account_switch_block: AccountSwitchBlock,\n bar_chart_block: BarchartBlock,\n budget_block: BudgetBlock,\n donut_chart_block: DonutChartBlock,\n double_bar_chart_block: DoubleBarChartBlock,\n double_progress_bar_block: DoubleProgressBarBlock,\n image_block: ImageBlock,\n save_extra_block: SaveExtraBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAKjC,IAAmB,oBAAI,IAAI;AAAA,EAAC;AAAA,EAAI;AAAA,EAAQ;AAAW,CAAC,GAC7C,IAAA,CAAkB,MAAmC;AAChE,QAAM,IAAa,GAAO,KAAK,EAAE,YAAY;AAC7C,SAAO,CAAC,CAAC,KAAc,CAAC,EAAiB,IAAI,CAAU;AACzD,GAgBa,IAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B;AAAA,IAC1C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EACC,CAAA,EAAgB,0BAAA,GAA6B;AAAA,IAC5C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT;AAAA,EACC,CAAA,EAAgB,gCAAA,GAAmC;AAAA,IAClD,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf;AAAA,EAGC,CAAA,EAAgB,4BAAA,GAA+B;AAAA,IAC9C,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,MAAM,mBAAmB;AAAA,EAC3D;AACF,GAEa,IAAS;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,mBAAmB;AACrB"}
|