@mx-cartographer/experiences 9.7.199 → 9.7.201
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 +10 -0
- package/dist/core/types/Insights.d.ts +1 -1
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.d.ts +12 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js +131 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeeChargedBlock/index.d.ts +3 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +39 -39
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/statusIcon.d.ts +5 -5
- package/dist/insights-v2/components/statusIcon.es.js +7 -6
- package/dist/insights-v2/components/statusIcon.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +39 -39
- package/dist/insights-v2/mappings/blocks.es.js +24 -24
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.d.ts +0 -8
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js +0 -88
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.es.js.map +0 -1
- package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/index.d.ts +0 -3
|
@@ -15,10 +15,10 @@ export type StatusIconPalette = 'error' | 'success' | 'warning';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const statusIconPalette: (color?: string | null) => StatusIconPalette;
|
|
17
17
|
/**
|
|
18
|
-
* The accent colour a status icon's `color` names when it is not a status palette: `primary.main
|
|
19
|
-
* chart colour (`chart.chart2`), for an icon that isn't
|
|
20
|
-
* Savings Account Balances Summary's bar chart).
|
|
21
|
-
* `statusIconPalette`'s status colours and its error
|
|
22
|
-
* accepted: the value is server data.
|
|
18
|
+
* The accent colour a status icon's `color` names when it is not a status palette: `primary.main`,
|
|
19
|
+
* `action.active` (a neutral info glyph) or a chart colour (`chart.chart2`), for an icon that isn't
|
|
20
|
+
* a status (Weekly New Merchants' money bag, Savings Account Balances Summary's bar chart).
|
|
21
|
+
* Undefined otherwise, so the tile keeps `statusIconPalette`'s status colours and its error
|
|
22
|
+
* fallback. Only these exact theme paths are accepted: the value is server data.
|
|
23
23
|
*/
|
|
24
24
|
export declare const statusIconAccentColor: (palette: Theme["palette"], color?: string | null) => string | undefined;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { IconList as
|
|
2
|
-
var
|
|
1
|
+
import { IconList as c } from "@mxenabled/mx-icons";
|
|
2
|
+
var i = (r) => {
|
|
3
3
|
const a = /^ICO-([a-z0-9_]+)$/.exec(r ?? "")?.[1];
|
|
4
|
-
return a && Object.hasOwn(
|
|
4
|
+
return a && Object.hasOwn(c, a) ? a : void 0;
|
|
5
5
|
}, t = {
|
|
6
6
|
"error.main": "error",
|
|
7
7
|
"success.main": "success",
|
|
8
8
|
"warning.main": "warning"
|
|
9
|
-
},
|
|
9
|
+
}, s = (r) => r && Object.hasOwn(t, r) && t[r] || "error", m = (r, a) => {
|
|
10
10
|
if (a === "primary.main") return r.primary.main;
|
|
11
|
+
if (a === "action.active") return r.action.active;
|
|
11
12
|
const n = /^chart\.(chart[1-7])$/.exec(a ?? "")?.[1];
|
|
12
13
|
return n ? r.chart?.[n] : void 0;
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
16
|
m as statusIconAccentColor,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
i as statusIconName,
|
|
18
|
+
s as statusIconPalette
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
//# sourceMappingURL=statusIcon.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusIcon.es.js","names":[],"sources":["../../../src/insights-v2/components/statusIcon.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport { IconList } from '@mxenabled/mx-icons'\n\n/**\n * The mx-icons name an `ICO-<name>` guid carries (`ICO-error` → `error`), or undefined for any other\n * guid, a malformed name, or a name mx-icons does not define — so a caller renders nothing rather\n * than an empty box. ditto names a status icon this way where a block has no entity logo (account_block\n * `minimal`).\n */\nexport const statusIconName = (guid?: string | null): string | undefined => {\n const name = /^ICO-([a-z0-9_]+)$/.exec(guid ?? '')?.[1]\n\n // Own keys only: `in` would also accept inherited names such as `constructor`.\n return name && Object.hasOwn(IconList, name) ? name : undefined\n}\n\nexport type StatusIconPalette = 'error' | 'success' | 'warning'\n\nconst STATUS_PALETTES: Record<string, StatusIconPalette> = {\n 'error.main': 'error',\n 'success.main': 'success',\n 'warning.main': 'warning',\n}\n\n/**\n * The theme palette a status icon's `color` names (`success.main` → `success`), for the tinted tile\n * the micro card draws it in. The value is server data that becomes a palette key, so only these\n * three status palettes are accepted; anything else — another palette, a raw colour, a CSS\n * break-out — is the error tint, the tile's original colour.\n */\nexport const statusIconPalette = (color?: string | null): StatusIconPalette =>\n (color && Object.hasOwn(STATUS_PALETTES, color) && STATUS_PALETTES[color]) || 'error'\n\n/**\n * The accent colour a status icon's `color` names when it is not a status palette: `primary.main` or a
|
|
1
|
+
{"version":3,"file":"statusIcon.es.js","names":[],"sources":["../../../src/insights-v2/components/statusIcon.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nimport { IconList } from '@mxenabled/mx-icons'\n\n/**\n * The mx-icons name an `ICO-<name>` guid carries (`ICO-error` → `error`), or undefined for any other\n * guid, a malformed name, or a name mx-icons does not define — so a caller renders nothing rather\n * than an empty box. ditto names a status icon this way where a block has no entity logo (account_block\n * `minimal`).\n */\nexport const statusIconName = (guid?: string | null): string | undefined => {\n const name = /^ICO-([a-z0-9_]+)$/.exec(guid ?? '')?.[1]\n\n // Own keys only: `in` would also accept inherited names such as `constructor`.\n return name && Object.hasOwn(IconList, name) ? name : undefined\n}\n\nexport type StatusIconPalette = 'error' | 'success' | 'warning'\n\nconst STATUS_PALETTES: Record<string, StatusIconPalette> = {\n 'error.main': 'error',\n 'success.main': 'success',\n 'warning.main': 'warning',\n}\n\n/**\n * The theme palette a status icon's `color` names (`success.main` → `success`), for the tinted tile\n * the micro card draws it in. The value is server data that becomes a palette key, so only these\n * three status palettes are accepted; anything else — another palette, a raw colour, a CSS\n * break-out — is the error tint, the tile's original colour.\n */\nexport const statusIconPalette = (color?: string | null): StatusIconPalette =>\n (color && Object.hasOwn(STATUS_PALETTES, color) && STATUS_PALETTES[color]) || 'error'\n\n/**\n * The accent colour a status icon's `color` names when it is not a status palette: `primary.main`,\n * `action.active` (a neutral info glyph) or a chart colour (`chart.chart2`), for an icon that isn't\n * a status (Weekly New Merchants' money bag, Savings Account Balances Summary's bar chart).\n * Undefined otherwise, so the tile keeps `statusIconPalette`'s status colours and its error\n * fallback. Only these exact theme paths are accepted: the value is server data.\n */\nexport const statusIconAccentColor = (\n palette: Theme['palette'],\n color?: string | null,\n): string | undefined => {\n if (color === 'primary.main') return palette.primary.main\n if (color === 'action.active') return palette.action.active\n const chartKey = /^chart\\.(chart[1-7])$/.exec(color ?? '')?.[1] as\n | keyof Theme['palette']['chart']\n | undefined\n return chartKey ? palette.chart?.[chartKey] : undefined\n}\n"],"mappings":";AAUA,IAAa,IAAA,CAAkB,MAA6C;AAC1E,QAAM,IAAO,qBAAqB,KAAK,KAAQ,EAAE,IAAI,CAAA;AAGrD,SAAO,KAAQ,OAAO,OAAO,GAAU,CAAI,IAAI,IAAO;AACxD,GAIM,IAAqD;AAAA,EACzD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAClB,GAQa,IAAA,CAAqB,MAC/B,KAAS,OAAO,OAAO,GAAiB,CAAK,KAAK,EAAgB,CAAA,KAAW,SASnE,IAAA,CACX,GACA,MACuB;AACvB,MAAI,MAAU,eAAgB,QAAO,EAAQ,QAAQ;AACrD,MAAI,MAAU,gBAAiB,QAAO,EAAQ,OAAO;AACrD,QAAM,IAAW,wBAAwB,KAAK,KAAS,EAAE,IAAI,CAAA;AAG7D,SAAO,IAAW,EAAQ,QAAQ,CAAA,IAAY;AAChD"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import r from "./components/StatusPill.es.js";
|
|
2
|
-
import { resolveInsightRender as
|
|
2
|
+
import { resolveInsightRender as t } from "./resolveInsightRender.es.js";
|
|
3
3
|
import { useBeatActions as a } from "./beatActions.es.js";
|
|
4
|
-
import { BAR_ARIA_LABEL as e, BAR_CHART_VARIANTS as f, barChartVariant as
|
|
4
|
+
import { BAR_ARIA_LABEL as e, BAR_CHART_VARIANTS as f, barChartVariant as c, buildChartData as n, buildDataSeries as l } from "./blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
5
5
|
import { HOST_ACTIONS as d } from "./ctaActions/hostActions.es.js";
|
|
6
6
|
import { runInDescriptionCta as u } from "./ctaActions/runCtaAction.es.js";
|
|
7
7
|
import { useBeatCtaActions as g, useCtaHandler as C } from "./ctaActions/useCtaAction.es.js";
|
|
8
|
-
import { BarchartBlock as
|
|
8
|
+
import { BarchartBlock as h } from "./blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js";
|
|
9
9
|
import { DoubleBarChartBlock as A } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
10
10
|
import I from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
11
11
|
import T from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
12
12
|
import v from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
13
13
|
import R, { isLogoGuid as w } from "./components/LogoFromGuid.es.js";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { detailedAccountVariant as
|
|
14
|
+
import M from "./components/AccountHeroCard.es.js";
|
|
15
|
+
import V from "./components/DirectDepositCard.es.js";
|
|
16
|
+
import { detailedAccountVariant as G, directDepositVariant as F, isDetailedAccountVariant as _ } from "./blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js";
|
|
17
17
|
import N from "./blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
18
18
|
import W from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
19
19
|
import z from "./components/TransferLogoCard.es.js";
|
|
@@ -22,23 +22,23 @@ import { BudgetBlock as K } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlo
|
|
|
22
22
|
import Y from "./components/InsightTransactionRow.es.js";
|
|
23
23
|
import $ from "./blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
24
24
|
import ro from "./blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.es.js";
|
|
25
|
-
import
|
|
25
|
+
import to from "./components/GoalProgressCard.es.js";
|
|
26
26
|
import ao from "./blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
|
|
27
27
|
import eo from "./components/LogoTile.es.js";
|
|
28
|
-
import
|
|
28
|
+
import co from "./components/LogoClusterCard.es.js";
|
|
29
29
|
import lo from "./components/AmountPill.es.js";
|
|
30
30
|
import Bo from "./components/MerchantHighlightCard.es.js";
|
|
31
31
|
import ko from "./components/P2PLogoStack.es.js";
|
|
32
32
|
import Co from "./blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js";
|
|
33
|
-
import
|
|
33
|
+
import ho from "./blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
34
34
|
import Ao from "./blocks/ComponentBlocks/QuarterlySummaryBlock/QuarterlySummaryBlock.es.js";
|
|
35
35
|
import Io from "./blocks/ComponentBlocks/QuizBlock/QuizBlock.es.js";
|
|
36
36
|
import To from "./components/UpcomingBillCard.es.js";
|
|
37
37
|
import vo from "./blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTransactionBlock.es.js";
|
|
38
38
|
import Ro from "./components/SaveAnExtraCard.es.js";
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
39
|
+
import Ho from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
40
|
+
import Oo from "./components/SavingsOpportunityCard.es.js";
|
|
41
|
+
import Eo from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
42
42
|
import Fo from "./blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js";
|
|
43
43
|
import xo from "./components/StatusMessageCard.es.js";
|
|
44
44
|
import Uo from "./components/TransactionListCard.es.js";
|
|
@@ -48,24 +48,24 @@ import Jo from "./components/SubscriptionHeroCard.es.js";
|
|
|
48
48
|
import Xo from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
49
49
|
import Zo from "./blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js";
|
|
50
50
|
import or from "./components/WithdrawalCard.es.js";
|
|
51
|
-
import
|
|
52
|
-
import ir from "./blocks/ComponentBlocks/
|
|
51
|
+
import mr from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
52
|
+
import ir from "./blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js";
|
|
53
53
|
import pr from "./components/DesignateEmergencySavingsCard.es.js";
|
|
54
54
|
import { SVGImageBlock as fr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
55
|
-
import
|
|
55
|
+
import nr from "./components/shared/StatusSnackbar.es.js";
|
|
56
56
|
import sr from "./components/FeedbackDialog.es.js";
|
|
57
57
|
import Br from "./components/FeedbackModal.es.js";
|
|
58
58
|
import kr from "./components/ConnectionDetailDrillDown.es.js";
|
|
59
59
|
import Cr from "./components/SurveyModal.es.js";
|
|
60
|
-
import
|
|
60
|
+
import hr from "./components/InsightErrorCard.es.js";
|
|
61
61
|
import { ErrorCard as Ar } from "./components/ErrorCard.es.js";
|
|
62
62
|
import Ir from "./components/AmountBreakdownCard.es.js";
|
|
63
63
|
import Tr from "./components/BadgedTile.es.js";
|
|
64
64
|
import { OverflowMenu as vr } from "./components/OverflowMenu.es.js";
|
|
65
65
|
import { InsightOptionsMenu as Rr } from "./components/InsightOptionsMenu.es.js";
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import { FeedbackBar as
|
|
66
|
+
import Hr from "./components/StatusBadge.es.js";
|
|
67
|
+
import Or from "./components/CompactInsightCard.es.js";
|
|
68
|
+
import { FeedbackBar as Er } from "./components/FeedbackBar.es.js";
|
|
69
69
|
import { DismissInsightDialog as Fr } from "./components/DismissInsightDialog.es.js";
|
|
70
70
|
import { HiddenConfirmationCard as xr } from "./components/HiddenConfirmationCard.es.js";
|
|
71
71
|
import { LoadingCard as Ur } from "./components/LoadingCard.es.js";
|
|
@@ -73,47 +73,47 @@ import { ObsolesceBanner as Qr } from "./components/ObsolesceBanner.es.js";
|
|
|
73
73
|
import jr from "./components/BaseLayout.es.js";
|
|
74
74
|
export {
|
|
75
75
|
W as AccountBlock,
|
|
76
|
-
|
|
76
|
+
M as AccountHeroCard,
|
|
77
77
|
q as AccountSwitchBlock,
|
|
78
78
|
Ir as AmountBreakdownCard,
|
|
79
79
|
lo as AmountPill,
|
|
80
80
|
e as BAR_ARIA_LABEL,
|
|
81
81
|
f as BAR_CHART_VARIANTS,
|
|
82
82
|
Tr as BadgedTile,
|
|
83
|
-
|
|
83
|
+
h as BarchartBlock,
|
|
84
84
|
jr as BaseLayout,
|
|
85
85
|
K as BudgetBlock,
|
|
86
|
-
|
|
86
|
+
Or as CompactInsightCard,
|
|
87
87
|
kr as ConnectionDetailDrillDown,
|
|
88
88
|
$ as DebtsBlock,
|
|
89
89
|
pr as DesignateEmergencySavingsCard,
|
|
90
90
|
N as DetailedAccountBlock,
|
|
91
91
|
N as DirectDepositBlock,
|
|
92
|
-
|
|
92
|
+
V as DirectDepositCard,
|
|
93
93
|
Fr as DismissInsightDialog,
|
|
94
94
|
T as DonutChartBlock,
|
|
95
95
|
A as DoubleBarChartBlock,
|
|
96
96
|
v as DoubleProgressBarBlock,
|
|
97
97
|
Ar as ErrorCard,
|
|
98
|
-
|
|
98
|
+
ir as FeeChargedBlock,
|
|
99
|
+
Er as FeedbackBar,
|
|
99
100
|
sr as FeedbackDialog,
|
|
100
101
|
Br as FeedbackModal,
|
|
101
102
|
ro as GasPurchaseBlock,
|
|
102
|
-
|
|
103
|
+
to as GoalProgressCard,
|
|
103
104
|
ao as GoalsBlock,
|
|
104
|
-
ir as GreenStatementFeeBlock,
|
|
105
105
|
d as HOST_ACTIONS,
|
|
106
106
|
xr as HiddenConfirmationCard,
|
|
107
|
-
|
|
107
|
+
hr as InsightErrorCard,
|
|
108
108
|
Rr as InsightOptionsMenu,
|
|
109
109
|
Y as InsightTransactionRow,
|
|
110
110
|
Ur as LoadingCard,
|
|
111
|
-
|
|
111
|
+
co as LogoClusterCard,
|
|
112
112
|
R as LogoFromGuid,
|
|
113
113
|
eo as LogoTile,
|
|
114
114
|
Co as MerchantBlock,
|
|
115
115
|
Bo as MerchantHighlightCard,
|
|
116
|
-
|
|
116
|
+
ho as NoSpendDaysBlock,
|
|
117
117
|
Qr as ObsolesceBanner,
|
|
118
118
|
vr as OverflowMenu,
|
|
119
119
|
ko as P2PLogoStack,
|
|
@@ -122,14 +122,14 @@ export {
|
|
|
122
122
|
vo as RepeatingTransactionBlock,
|
|
123
123
|
fr as SVGImageBlock,
|
|
124
124
|
Ro as SaveAnExtraCard,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
Ho as SaveExtraBlock,
|
|
126
|
+
Eo as SavingsOpportunityBlock,
|
|
127
|
+
Oo as SavingsOpportunityCard,
|
|
128
128
|
Fo as SavingsSummaryBlock,
|
|
129
|
-
|
|
129
|
+
Hr as StatusBadge,
|
|
130
130
|
xo as StatusMessageCard,
|
|
131
131
|
r as StatusPill,
|
|
132
|
-
|
|
132
|
+
nr as StatusSnackbar,
|
|
133
133
|
I as StepChartBlock,
|
|
134
134
|
Jo as SubscriptionHeroCard,
|
|
135
135
|
Cr as SurveyModal,
|
|
@@ -140,16 +140,16 @@ export {
|
|
|
140
140
|
To as UpcomingBillCard,
|
|
141
141
|
Xo as UpcomingSubscriptionBlock,
|
|
142
142
|
Zo as WeeklySmallPurchasesBlock,
|
|
143
|
-
|
|
143
|
+
mr as WithdrawalBlock,
|
|
144
144
|
or as WithdrawalCard,
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
c as barChartVariant,
|
|
146
|
+
n as buildChartData,
|
|
147
147
|
l as buildDataSeries,
|
|
148
|
-
|
|
148
|
+
G as detailedAccountVariant,
|
|
149
149
|
F as directDepositVariant,
|
|
150
150
|
_ as isDetailedAccountVariant,
|
|
151
151
|
w as isLogoGuid,
|
|
152
|
-
|
|
152
|
+
t as resolveInsightRender,
|
|
153
153
|
u as runInDescriptionCta,
|
|
154
154
|
Qo as transactionBlockVariant,
|
|
155
155
|
a as useBeatActions,
|
|
@@ -6,14 +6,14 @@ import { BarchartBlock as O } from "../blocks/ChartBlocks/BarchartBlock/Barchart
|
|
|
6
6
|
import { DoubleBarChartBlock as d } from "../blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
|
|
7
7
|
import L from "../blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
|
|
8
8
|
import P from "../blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import g from "../blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
|
|
10
|
+
import N from "../blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
11
11
|
import y from "../blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
12
12
|
import I from "../blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
|
|
13
13
|
import { BudgetBlock as S } from "../blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
|
|
14
14
|
import b from "../blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
15
|
+
import h from "../blocks/ComponentBlocks/GasPurchaseBlock/GasPurchaseBlock.es.js";
|
|
16
|
+
import D from "../blocks/ComponentBlocks/GoalsBlock/GoalsBlock.es.js";
|
|
17
17
|
import E from "../blocks/ComponentBlocks/MerchantBlock/MerchantBlock.es.js";
|
|
18
18
|
import K from "../blocks/ComponentBlocks/NoSpendDaysBlock/NoSpendDaysBlock.es.js";
|
|
19
19
|
import R from "../blocks/ComponentBlocks/QuarterlySummaryBlock/QuarterlySummaryBlock.es.js";
|
|
@@ -22,11 +22,11 @@ import c from "../blocks/ComponentBlocks/RepeatingTransactionBlock/RepeatingTran
|
|
|
22
22
|
import M from "../blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
23
23
|
import U from "../blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
24
24
|
import w from "../blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js";
|
|
25
|
-
import { TransactionBlock as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
25
|
+
import { TransactionBlock as H } from "../blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
|
|
26
|
+
import F from "../blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js";
|
|
27
|
+
import G from "../blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js";
|
|
28
28
|
import z from "../blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
29
|
-
import Y from "../blocks/ComponentBlocks/
|
|
29
|
+
import Y from "../blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js";
|
|
30
30
|
import q from "../blocks/ImageBlocks/ImageBlock.es.js";
|
|
31
31
|
import { SVGImageBlock as x } from "../blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
32
32
|
import { FeedbackModalActionBlock as Q } from "../actionBlocks/FeedbackModalActionBlock.es.js";
|
|
@@ -57,13 +57,13 @@ import { useAccountListPrepare as fo } from "../actionBlocks/AccountListBlock/us
|
|
|
57
57
|
import { EmergencySavingsBlock as ko, selectEmergencySavingsCopy as To } from "../actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js";
|
|
58
58
|
import { CreditUtilizationBlock as Ao, selectCreditUtilizationCopy as C } from "../actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js";
|
|
59
59
|
import { useCreditUtilizationPrepare as Oo } from "../actionBlocks/CreditUtilizationBlock/useCreditUtilizationPrepare.es.js";
|
|
60
|
-
import { PayoffCalculatorBlock as Lo, selectPayoffCalculatorCopy as u, usePayoffCalculatorLoadState as Po, usePayoffCalculatorPrepare as
|
|
61
|
-
import { BudgetDetailsBlock as
|
|
60
|
+
import { PayoffCalculatorBlock as Lo, selectPayoffCalculatorCopy as u, usePayoffCalculatorLoadState as Po, usePayoffCalculatorPrepare as go } from "../actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js";
|
|
61
|
+
import { BudgetDetailsBlock as No, selectBudgetDetailsCopy as yo } from "../actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js";
|
|
62
62
|
import { TopMerchantsBlock as Io, selectTopMerchantsCopy as B } from "../actionBlocks/TopMerchantsBlock/TopMerchantsBlock.es.js";
|
|
63
63
|
import { useBudgetDetailsPrepare as So } from "../actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare.es.js";
|
|
64
64
|
import { PayoffStrategiesBlock as bo, selectPayoffStrategiesCopy as f } from "../actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js";
|
|
65
|
-
import { usePayoffStrategiesPrepare as
|
|
66
|
-
import { QuizMerchantBlock as
|
|
65
|
+
import { usePayoffStrategiesPrepare as ho } from "../actionBlocks/PayoffStrategiesBlock/usePayoffStrategiesPrepare.es.js";
|
|
66
|
+
import { QuizMerchantBlock as Do } from "../actionBlocks/QuizMerchantBlock/QuizMerchantBlock.es.js";
|
|
67
67
|
import { useAccountsLoadState as k } from "../actionBlocks/useAccountsLoadState.es.js";
|
|
68
68
|
var a = (r) => {
|
|
69
69
|
}, t = (r) => ({
|
|
@@ -187,7 +187,7 @@ var a = (r) => {
|
|
|
187
187
|
[o.PAYOFF_CALCULATOR_ACTION_BLOCK]: t(() => ({
|
|
188
188
|
Component: Lo,
|
|
189
189
|
copy: u,
|
|
190
|
-
usePrepare:
|
|
190
|
+
usePrepare: go,
|
|
191
191
|
useLoadState: Po,
|
|
192
192
|
title: (r, e) => u(e)?.title ?? ""
|
|
193
193
|
})),
|
|
@@ -199,7 +199,7 @@ var a = (r) => {
|
|
|
199
199
|
title: (r, e) => B(e)?.title ?? ""
|
|
200
200
|
})),
|
|
201
201
|
[o.BUDGET_DETAILS_ACTION_BLOCK]: t(() => ({
|
|
202
|
-
Component:
|
|
202
|
+
Component: No,
|
|
203
203
|
copy: yo,
|
|
204
204
|
usePrepare: So,
|
|
205
205
|
title: A
|
|
@@ -223,27 +223,27 @@ var a = (r) => {
|
|
|
223
223
|
[o.PAYOFF_STRATEGIES_ACTION_BLOCK]: t(() => ({
|
|
224
224
|
Component: bo,
|
|
225
225
|
copy: f,
|
|
226
|
-
usePrepare:
|
|
226
|
+
usePrepare: ho,
|
|
227
227
|
useLoadState: k,
|
|
228
228
|
title: (r, e) => f(e)?.debt_payoff_strategies ?? ""
|
|
229
229
|
})),
|
|
230
230
|
[o.QUIZ_MERCHANT_ACTION_BLOCK]: t(() => ({
|
|
231
|
-
Component:
|
|
231
|
+
Component: Do,
|
|
232
232
|
usePrepare: n,
|
|
233
233
|
title: (r, e) => e.insights_feed?.quiz_block?.drawer_title ?? ""
|
|
234
234
|
}))
|
|
235
235
|
}, Vt = {
|
|
236
236
|
account_block: y,
|
|
237
237
|
account_switch_block: I,
|
|
238
|
-
direct_deposit_block:
|
|
238
|
+
direct_deposit_block: N,
|
|
239
239
|
bar_chart_block: O,
|
|
240
240
|
budget_block: S,
|
|
241
241
|
debts_block: b,
|
|
242
242
|
donut_chart_block: P,
|
|
243
243
|
double_bar_chart_block: d,
|
|
244
|
-
double_progress_bar_block:
|
|
245
|
-
gas_purchase_block:
|
|
246
|
-
goals_block:
|
|
244
|
+
double_progress_bar_block: g,
|
|
245
|
+
gas_purchase_block: h,
|
|
246
|
+
goals_block: D,
|
|
247
247
|
image_block: q,
|
|
248
248
|
merchant_block: E,
|
|
249
249
|
no_spend_days_block: K,
|
|
@@ -256,11 +256,11 @@ var a = (r) => {
|
|
|
256
256
|
step_chart_block: L,
|
|
257
257
|
svg_image_block: x,
|
|
258
258
|
upcoming_bill_block: c,
|
|
259
|
-
upcoming_subscription_block:
|
|
260
|
-
weekly_small_purchases_block:
|
|
259
|
+
upcoming_subscription_block: F,
|
|
260
|
+
weekly_small_purchases_block: G,
|
|
261
261
|
withdrawal_block: z,
|
|
262
|
-
transaction_block:
|
|
263
|
-
|
|
262
|
+
transaction_block: H,
|
|
263
|
+
fee_charged_block: Y
|
|
264
264
|
};
|
|
265
265
|
export {
|
|
266
266
|
Qt as actionBlocks,
|
|
@@ -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 GasPurchaseBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n QuarterlySummaryBlock,\n QuizBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SavingsSummaryBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WeeklySmallPurchasesBlock,\n WithdrawalBlock,\n TransactionBlock,\n GreenStatementFeeBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport {\n selectTransactionHistoryCopy,\n TransactionHistoryBlock,\n} from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport {\n RemainingCashBlock,\n selectRemainingCashCopy,\n useRemainingCashLoadState,\n} from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport {\n OverdraftBlock,\n selectOverdraftCopy,\n useOverdraftPrepare,\n} from '../actionBlocks/OverdraftBlock'\nimport {\n AccountListBlock,\n selectAccountListCopy,\n useAccountListPrepare,\n} from '../actionBlocks/AccountListBlock'\nimport {\n EmergencySavingsBlock,\n selectEmergencySavingsCopy,\n} from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n selectCreditUtilizationCopy,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n selectPayoffCalculatorCopy,\n usePayoffCalculatorLoadState,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock, selectBudgetDetailsCopy } from '../actionBlocks/BudgetDetailsBlock'\nimport { TopMerchantsBlock, selectTopMerchantsCopy } from '../actionBlocks/TopMerchantsBlock'\nimport { useBudgetDetailsPrepare } from '../actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare'\nimport { getBudgetDetailsDrawerTitle } from '../actionBlocks/BudgetDetailsBlock/layout'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\nimport { HelpBlock } from '../actionBlocks/HelpBlock'\nimport {\n PayoffStrategiesBlock,\n selectPayoffStrategiesCopy,\n usePayoffStrategiesPrepare,\n} from '../actionBlocks/PayoffStrategiesBlock'\nimport { QuizMerchantBlock } from '../actionBlocks/QuizMerchantBlock'\nimport { useAccountsLoadState } from '../actionBlocks/useAccountsLoadState'\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 BlockLoadState {\n ready: boolean\n failed?: boolean\n retry?: () => void\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // The data the block waits for: a loader until `ready`, the error card while `failed`.\n useLoadState?: (props: ActionBlockProps) => BlockLoadState\n // Drawer title from the CTA's variant and copy; falls back to the CTA label when empty.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // The copy section a drawer block needs; the layer shows BlockErrorMessage without it.\n copy?: (copy: GlobalCopy) => unknown\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n // The drawer header's close control: 'back' (default, arrow on the left) or 'close' (X on the right).\n headerAction?: 'back' | 'close'\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 * Reads its imports on access, not at load: some blocks import this registry back through\n * `ActionBlockLayer`, so a value copied at load would still be `undefined`.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get useLoadState() {\n return resolve().useLoadState\n },\n get title() {\n return resolve().title\n },\n get copy() {\n return resolve().copy\n },\n get presentation() {\n return resolve().presentation\n },\n get headerAction() {\n return resolve().headerAction\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 copy: selectTransactionHistoryCopy,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n copy: selectRemainingCashCopy,\n usePrepare: useRecurringTransactionPrepare,\n useLoadState: useRemainingCashLoadState,\n title: (_variant, copy) => selectRemainingCashCopy(copy)?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety net: `safety_net_block` opens the amount-input modal.\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n copy: selectOverdraftCopy,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": the explanation, the band legend and the per-card list.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n copy: selectCreditUtilizationCopy,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => selectCreditUtilizationCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n copy: selectEmergencySavingsCopy,\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 copy: selectPayoffCalculatorCopy,\n usePrepare: usePayoffCalculatorPrepare,\n useLoadState: usePayoffCalculatorLoadState,\n title: (_variant, copy) => selectPayoffCalculatorCopy(copy)?.title ?? '',\n })),\n // Monthly Top Merchant Spending's Top Merchants: the month's ten ranked merchants, each opening\n // its Merchant History (Transaction History, `top_merchant` variant) in a nested drawer.\n [actionBlocksKey.TOP_MERCHANTS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TopMerchantsBlock,\n copy: selectTopMerchantsCopy,\n // Figma's Top Merchants: a close X on the right, not the back arrow.\n headerAction: 'close',\n // The nested Merchant History lists the store's transactions, so load them as it would.\n usePrepare: useTransactionHistoryPrepare,\n title: (_variant, copy) => selectTopMerchantsCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n copy: selectBudgetDetailsCopy,\n // Loads the budget data and points the transaction store at the budget month, as pulse did.\n usePrepare: useBudgetDetailsPrepare,\n title: getBudgetDetailsDrawerTitle,\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 copy: selectAccountListCopy,\n usePrepare: useAccountListPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectAccountListCopy(copy)?.title ?? '',\n })),\n // A beat's \"Learn More\": its pre-localized help title and body from the payload's\n // `drilldown_data`. The drawer title is the CTA label.\n [actionBlocksKey.HELP_ACTION_BLOCK]: liveEntry(() => ({\n Component: HelpBlock,\n usePrepare: noop,\n })),\n // Debt Payoff Strategies' \"Learn more\": Avalanche / Snowball tabs over the beat's debt accounts.\n [actionBlocksKey.PAYOFF_STRATEGIES_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffStrategiesBlock,\n copy: selectPayoffStrategiesCopy,\n usePrepare: usePayoffStrategiesPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectPayoffStrategiesCopy(copy)?.debt_payoff_strategies ?? '',\n })),\n // A Monthly Top Transacted Merchant result row: that merchant's rank, totals and transactions.\n [actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK]: liveEntry(() => ({\n Component: QuizMerchantBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, copy) => copy.insights_feed?.quiz_block?.drawer_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 gas_purchase_block: GasPurchaseBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n quarterly_summary_block: QuarterlySummaryBlock,\n quiz_block: QuizBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n savings_summary_block: SavingsSummaryBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n weekly_small_purchases_block: WeeklySmallPurchasesBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n green_statement_fee_block: GreenStatementFeeBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAiCjC,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,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,OAAO;AACT,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,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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AAG,0BAA0B;AAAA,EACzF,EAAE;AAAA,EAED,CAAA,EAAgB,0BAAA,GAA6B,EAAA,OAAiB;AAAA,IAC7D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,CAAQ,GAAU,MAAS,EAAK,eAAe,YAAY,gBAAgB;AAAA,EAC7E,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,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,YAAY;AAAA,EACZ,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,2BAA2B;AAC7B"}
|
|
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 GasPurchaseBlock,\n GoalsBlock,\n MerchantBlock,\n DoubleBarChartBlock,\n DoubleProgressBarBlock,\n NoSpendDaysBlock,\n QuarterlySummaryBlock,\n QuizBlock,\n RepeatingTransactionBlock,\n SaveExtraBlock,\n SavingsOpportunityBlock,\n SavingsSummaryBlock,\n SVGImageBlock,\n UpcomingSubscriptionBlock,\n WeeklySmallPurchasesBlock,\n WithdrawalBlock,\n TransactionBlock,\n FeeChargedBlock,\n} from '../blocks'\nimport StepChartBlock from '../blocks/ChartBlocks/StepChartBlock'\nimport ImageBlock from '../blocks/ImageBlocks/ImageBlock'\n\nimport type { Beat, GlobalCopy, InsightsPayload } from '../../core'\nimport { ContactSupportActionBlock } from '../actionBlocks/ContactSupportActionBlock'\nimport { FeedbackModalActionBlock } from '../actionBlocks/FeedbackModalActionBlock'\nimport { ConnectionDetailActionBlock } from '../actionBlocks/ConnectionDetailActionBlock'\nimport { ConnectWidgetActionBlock } from '../actionBlocks/ConnectWidgetActionBlock'\nimport { SurveyModalActionBlock } from '../actionBlocks/SurveyModalActionBlock'\nimport { SubscriptionStatusModalBlock } from '../actionBlocks/SubscriptionStatusModalBlock'\nimport { PlaceholderActionBlock } from '../actionBlocks/PlaceholderActionBlock'\nimport { MakeTransferActionBlockLayer } from '../actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer'\nimport { getMakeTransferDrawerTitle } from '../actionBlocks/MakeTransferActionBlock/layout'\nimport {\n selectTransactionHistoryCopy,\n TransactionHistoryBlock,\n} from '../actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock'\nimport { getDrawerHeaderTitle } from '../actionBlocks/TransactionHistoryBlock/utils'\nimport { useTransactionHistoryPrepare } from '../actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare'\nimport {\n TransactionDetailsBlock,\n useTransactionDetailsPrepare,\n} from '../actionBlocks/TransactionDetailsBlock'\nimport {\n RecurringTransactionBlock,\n useRecurringTransactionPrepare,\n} from '../actionBlocks/RecurringTransactionBlock'\nimport { TransactionListBlock } from '../actionBlocks/TransactionListBlock'\nimport { getTransactionListDrawerTitle } from '../actionBlocks/TransactionListBlock/layout'\nimport {\n RemainingCashBlock,\n selectRemainingCashCopy,\n useRemainingCashLoadState,\n} from '../actionBlocks/RemainingCashBlock'\nimport { AmountInputModalBlock } from '../actionBlocks/AmountInputModalBlock'\nimport {\n OverdraftBlock,\n selectOverdraftCopy,\n useOverdraftPrepare,\n} from '../actionBlocks/OverdraftBlock'\nimport {\n AccountListBlock,\n selectAccountListCopy,\n useAccountListPrepare,\n} from '../actionBlocks/AccountListBlock'\nimport {\n EmergencySavingsBlock,\n selectEmergencySavingsCopy,\n} from '../actionBlocks/EmergencySavingsBlock'\nimport {\n CreditUtilizationBlock,\n selectCreditUtilizationCopy,\n useCreditUtilizationPrepare,\n} from '../actionBlocks/CreditUtilizationBlock'\nimport {\n PayoffCalculatorBlock,\n selectPayoffCalculatorCopy,\n usePayoffCalculatorLoadState,\n usePayoffCalculatorPrepare,\n} from '../actionBlocks/PayoffCalculatorBlock'\nimport { BudgetDetailsBlock, selectBudgetDetailsCopy } from '../actionBlocks/BudgetDetailsBlock'\nimport { TopMerchantsBlock, selectTopMerchantsCopy } from '../actionBlocks/TopMerchantsBlock'\nimport { useBudgetDetailsPrepare } from '../actionBlocks/BudgetDetailsBlock/useBudgetDetailsPrepare'\nimport { getBudgetDetailsDrawerTitle } from '../actionBlocks/BudgetDetailsBlock/layout'\nimport { AccountDetailsBlock, useAccountDetailsPrepare } from '../actionBlocks/AccountDetailsBlock'\nimport { HelpBlock } from '../actionBlocks/HelpBlock'\nimport {\n PayoffStrategiesBlock,\n selectPayoffStrategiesCopy,\n usePayoffStrategiesPrepare,\n} from '../actionBlocks/PayoffStrategiesBlock'\nimport { QuizMerchantBlock } from '../actionBlocks/QuizMerchantBlock'\nimport { useAccountsLoadState } from '../actionBlocks/useAccountsLoadState'\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 BlockLoadState {\n ready: boolean\n failed?: boolean\n retry?: () => void\n}\n\nexport interface ActionBlockEntry {\n Component: React.ComponentType<ActionBlockProps>\n usePrepare: (props: ActionBlockProps) => void // required; default to noop in each entry\n // The data the block waits for: a loader until `ready`, the error card while `failed`.\n useLoadState?: (props: ActionBlockProps) => BlockLoadState\n // Drawer title from the CTA's variant and copy; falls back to the CTA label when empty.\n title?: (variant: string | null | undefined, copy: GlobalCopy, beat?: Beat) => string\n // The copy section a drawer block needs; the layer shows BlockErrorMessage without it.\n copy?: (copy: GlobalCopy) => unknown\n // 'drawer' (default) or 'modal' (component renders its own dialog, no Drawer wrapper).\n presentation?: 'drawer' | 'modal'\n // The drawer header's close control: 'back' (default, arrow on the left) or 'close' (X on the right).\n headerAction?: 'back' | 'close'\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 * Reads its imports on access, not at load: some blocks import this registry back through\n * `ActionBlockLayer`, so a value copied at load would still be `undefined`.\n */\nconst liveEntry = (resolve: () => ActionBlockEntry): ActionBlockEntry => ({\n get Component() {\n return resolve().Component\n },\n get usePrepare() {\n return resolve().usePrepare\n },\n get useLoadState() {\n return resolve().useLoadState\n },\n get title() {\n return resolve().title\n },\n get copy() {\n return resolve().copy\n },\n get presentation() {\n return resolve().presentation\n },\n get headerAction() {\n return resolve().headerAction\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 copy: selectTransactionHistoryCopy,\n usePrepare: useTransactionHistoryPrepare,\n title: getDrawerHeaderTitle,\n })),\n [actionBlocksKey.TRANSACTION_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionDetailsBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: () => 'Transaction Details',\n })),\n // Expense Details for one recurring subscription. Which subscription a beat names is resolved in\n // `RecurringTransactionBlock/subscriptionBeats.ts`, not through this registry.\n [actionBlocksKey.RECURRING_TRANSACTION_ACTION_BLOCK]: liveEntry(() => ({\n Component: RecurringTransactionBlock,\n usePrepare: useRecurringTransactionPrepare,\n title: (_variant, copy) => copy.recurring?.expense_details ?? '',\n })),\n // Remaining Cash for the Payday Cash Left Over Status beat. Store-driven: reuses the recurring\n // loader, which also loads accounts and categories, so CashflowStore's computeds are ready.\n [actionBlocksKey.REMAINING_CASH_ACTION_BLOCK]: liveEntry(() => ({\n Component: RemainingCashBlock,\n copy: selectRemainingCashCopy,\n usePrepare: useRecurringTransactionPrepare,\n useLoadState: useRemainingCashLoadState,\n title: (_variant, copy) => selectRemainingCashCopy(copy)?.title ?? '',\n })),\n // The block renders its own drawer (the help module's RequestSupport) on top of the action\n // drawer, so the action drawer's title is the CTA label.\n [actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK]: liveEntry(() => ({\n Component: ContactSupportActionBlock,\n usePrepare: noop,\n title: (_variant, copy) => copy.help?.request_support ?? '',\n })),\n [actionBlocksKey.FEEDBACK_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: FeedbackModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.CONNECTION_DETAIL_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectionDetailActionBlock,\n usePrepare: noop,\n title: (_variant, copy) =>\n copy.insights_feed?.connection_details?.connection_details_drawer_title ?? '',\n })),\n // Boots MX's Connect widget (web-widget-sdk iframe) inside the action\n // drawer; the drawer title falls back to the CTA label.\n [actionBlocksKey.CONNECT_WIDGET_ACTION_BLOCK]: liveEntry(() => ({\n Component: ConnectWidgetActionBlock,\n usePrepare: noop,\n })),\n [actionBlocksKey.SURVEY_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SurveyModalActionBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n // Unexpected Subscription Payment's Subscription Status modal.\n [actionBlocksKey.SUBSCRIPTION_STATUS_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: SubscriptionStatusModalBlock,\n usePrepare: noop,\n presentation: 'modal',\n })),\n [actionBlocksKey.TRANSACTION_LIST_ACTION_BLOCK]: liveEntry(() => ({\n Component: TransactionListBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: getTransactionListDrawerTitle,\n })),\n // One whole-dollar setting in a dialog; the CTA variant picks which (low-balance threshold or\n // safety net). A modal: no drawer, so no drawer title.\n [actionBlocksKey.AMOUNT_INPUT_MODAL_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n // Loads inside the block: it mounts only while open, so mounting is the open-time load.\n usePrepare: noop,\n })),\n // Savings Opportunity's safety net: `safety_net_block` opens the amount-input modal.\n [actionBlocksKey.SAFETY_NET_ACTION_BLOCK]: liveEntry(() => ({\n Component: AmountInputModalBlock,\n presentation: 'modal',\n usePrepare: noop,\n })),\n // Transparent Overdraft's \"Learn more\": the projected overdraft, its account and the confidence\n // meter. Titled from the beat, as the pulse drawer was.\n [actionBlocksKey.OVERDRAFT_ACTION_BLOCK]: liveEntry(() => ({\n Component: OverdraftBlock,\n copy: selectOverdraftCopy,\n usePrepare: useOverdraftPrepare,\n title: (_variant, _copy, beat) => beat?.insights_payload?.title ?? '',\n })),\n // Credit Utilization's \"Learn more\": the explanation, the band legend and the per-card list.\n [actionBlocksKey.CREDIT_UTILIZATION_ACTION_BLOCK]: liveEntry(() => ({\n Component: CreditUtilizationBlock,\n copy: selectCreditUtilizationCopy,\n usePrepare: useCreditUtilizationPrepare,\n title: (_variant, copy) => selectCreditUtilizationCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.EMERGENCY_SAVINGS_ACTION_BLOCK]: liveEntry(() => ({\n Component: EmergencySavingsBlock,\n copy: selectEmergencySavingsCopy,\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 copy: selectPayoffCalculatorCopy,\n usePrepare: usePayoffCalculatorPrepare,\n useLoadState: usePayoffCalculatorLoadState,\n title: (_variant, copy) => selectPayoffCalculatorCopy(copy)?.title ?? '',\n })),\n // Monthly Top Merchant Spending's Top Merchants: the month's ten ranked merchants, each opening\n // its Merchant History (Transaction History, `top_merchant` variant) in a nested drawer.\n [actionBlocksKey.TOP_MERCHANTS_ACTION_BLOCK]: liveEntry(() => ({\n Component: TopMerchantsBlock,\n copy: selectTopMerchantsCopy,\n // Figma's Top Merchants: a close X on the right, not the back arrow.\n headerAction: 'close',\n // The nested Merchant History lists the store's transactions, so load them as it would.\n usePrepare: useTransactionHistoryPrepare,\n title: (_variant, copy) => selectTopMerchantsCopy(copy)?.title ?? '',\n })),\n [actionBlocksKey.BUDGET_DETAILS_ACTION_BLOCK]: liveEntry(() => ({\n Component: BudgetDetailsBlock,\n copy: selectBudgetDetailsCopy,\n // Loads the budget data and points the transaction store at the budget month, as pulse did.\n usePrepare: useBudgetDetailsPrepare,\n title: getBudgetDetailsDrawerTitle,\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 copy: selectAccountListCopy,\n usePrepare: useAccountListPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectAccountListCopy(copy)?.title ?? '',\n })),\n // A beat's \"Learn More\": its pre-localized help title and body from the payload's\n // `drilldown_data`. The drawer title is the CTA label.\n [actionBlocksKey.HELP_ACTION_BLOCK]: liveEntry(() => ({\n Component: HelpBlock,\n usePrepare: noop,\n })),\n // Debt Payoff Strategies' \"Learn more\": Avalanche / Snowball tabs over the beat's debt accounts.\n [actionBlocksKey.PAYOFF_STRATEGIES_ACTION_BLOCK]: liveEntry(() => ({\n Component: PayoffStrategiesBlock,\n copy: selectPayoffStrategiesCopy,\n usePrepare: usePayoffStrategiesPrepare,\n useLoadState: useAccountsLoadState,\n title: (_variant, copy) => selectPayoffStrategiesCopy(copy)?.debt_payoff_strategies ?? '',\n })),\n // A Monthly Top Transacted Merchant result row: that merchant's rank, totals and transactions.\n [actionBlocksKey.QUIZ_MERCHANT_ACTION_BLOCK]: liveEntry(() => ({\n Component: QuizMerchantBlock,\n usePrepare: useTransactionDetailsPrepare,\n title: (_variant, copy) => copy.insights_feed?.quiz_block?.drawer_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 gas_purchase_block: GasPurchaseBlock,\n goals_block: GoalsBlock,\n image_block: ImageBlock,\n merchant_block: MerchantBlock,\n no_spend_days_block: NoSpendDaysBlock,\n quarterly_summary_block: QuarterlySummaryBlock,\n quiz_block: QuizBlock,\n repeating_transaction_block: RepeatingTransactionBlock,\n save_extra_block: SaveExtraBlock,\n savings_amount_block: SavingsOpportunityBlock,\n savings_summary_block: SavingsSummaryBlock,\n step_chart_block: StepChartBlock,\n svg_image_block: SVGImageBlock,\n upcoming_bill_block: RepeatingTransactionBlock,\n upcoming_subscription_block: UpcomingSubscriptionBlock,\n weekly_small_purchases_block: WeeklySmallPurchasesBlock,\n withdrawal_block: WithdrawalBlock,\n transaction_block: TransactionBlock,\n fee_charged_block: FeeChargedBlock,\n} as Record<string, React.ComponentType<{ payload: InsightsPayload; beatGuid?: string }>>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,IAAM,IAAA,CAAQ,MAAwB;AAAC,GAiCjC,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,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,QAAQ;AACV,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,OAAO;AACT,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AAAA,EACA,IAAI,eAAe;AACjB,WAAO,EAAQ,EAAE;AAAA,EACnB;AACF,IAEa,KAAe;AAAA,EACzB,CAAA,EAAgB,wBAAA,GAA2B,EAAA,OAAiB;AAAA,IAC3D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAA,MAAa;AAAA,EACf,EAAE;AAAA,EACD,CAAA,EAAgB,0BAAA,GAA6B,EAAA,OAAiB;AAAA,IAC7D,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EACT,EAAE;AAAA,EACD,CAAA,EAAgB,gCAAA,GAAmC,EAAA,OAAiB;AAAA,IACnE,WAAW;AAAA,IACX,MAAM;AAAA,I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pB,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,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,YAAY;AAAA,EACZ,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,8BAA8B;AAAA,EAC9B,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,mBAAmB;AACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport { asLogoRef } from '../../insights-v2/blocks/slotReaders'\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid, { isLogoGuid } from '../../insights-v2/components/LogoFromGuid'\nimport {\n statusIconAccentColor,\n statusIconName,\n statusIconPalette,\n} from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\n/**\n * A `budget_block` slot's micro tile is the tinted category tile (Figma 156:35121, Micro | Category\n * Budget: the glyph on a 25% tint of the category colour, bordered in it) instead of mxui's solid tile.\n */\nconst TINTED_CATEGORY_TILE_BLOCK = 'budget_block'\nconst CATEGORY_TILE_TINT = 0.25\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no usable row logo may name a status icon instead (account_block `minimal`:\n // `ICO-error`), drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const { data } = v2Payload.instance_slot\n const rowLogo = asLogoRef(slot(data, 'logo'))\n // The reviewed icon once answered, else the icon: whichever names a status icon first.\n const statusIcon = [answered ? slot(data, 'reviewed_icon') : undefined, slot(data, 'icon')]\n .map(asLogoRef)\n .find((ref) => statusIconName(ref?.guid))\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (isLogoGuid(rowLogo?.guid) && !rowIconName ? (\n <LogoFromGuid\n categoryTint={\n v2Payload.instance_slot.block === TINTED_CATEGORY_TILE_BLOCK\n ? CATEGORY_TILE_TINT\n : undefined\n }\n logo={rowLogo}\n size={ICON_SIZE}\n />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : undefined}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,KAA6B,gBAC7B,KAAqB,MAOd,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,GACA,SAAA,GACA,gBAAA,GACA,SAAA,GACA,UAAA,GACA,iBAAA,EAAA,MACI;AACJ,QAAM,EAAE,KAAA,GAAK,QAAA,EAAA,IAAW,GAAU,EAChC,WAAA,EACF,CAAC,GAEK,IAAQ,GAAS,GAGjB,EAAE,WAAA,EAAA,IAAc,GAAa,GAC7B,EAAE,SAAA,EAAA,IAAY,GAAS,GACvB,EAAE,YAAA,GAAY,aAAA,EAAA,IAAgB,GAA4B,GAE1D,IAAO,oBAAoB,KAAQ,EAAK,gBACxC,IAAa,IAAO,EAAE,UAAU,EAAE,gBAAgB,GAAK,EAAE,IAAI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B,CAAA;AAGH,aAAK,IAGH,gBAAA,GAAA,IAAA,EAAA,UAAA,CACG,GAEA,IAAoB,KACnB,gBAAA,EAAC,IAAD;AAAA,QACQ,MAAA;AAAA,QACN,aAAa;AAAA,QACJ,SAAA;AAAA,MACV,CAAA,CAEH,EAAA,CAAA,IAbqB;AAAA,IAe3B;AAAA,EAKsB,CAAA,IAKtB,gBAAA,EAAC,GAAD;AAAA,IACE,wBAAqB;AAAA,IACV,WAAA;AAAA,IACX,aACE,GAAM,0BAA0B,GAAM,uBAAuB,SAAS,IAClE,EAAK,yBACL,EAAK,oBAAoB;AAAA,IAEpB,WAAA;AAAA,IACM,iBAAA;AAAA,IACjB,MAAM,KAAY,gBAAA,EAAC,IAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport Box from '@mui/material/Box'\nimport { alpha, useTheme } from '@mui/material/styles'\n\nimport { BeatIcon } from '../beaticons'\nimport BeatMaterialIcon from '../beaticons/BeatMaterialIcon'\n\nimport { useCopyStore, useEvent, useInsightsMicroWidgetStore } from '../context/hooks'\n\nimport { ON_CLICK_EVENT, ON_VIEW_EVENT, ON_VIEW_FIRST_TIME_EVENT } from '../constants/Analytics'\nimport { ICON_SIZE, VIEW_THRESHOLD } from '../constants/App'\nimport { microCardMinWidth } from '../utils/cardWidth'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\n// Leaf imports, not the `core` barrel: that pulls GlobalStore and every feature store into the\n// micro bundle, and through `core/stores` it reintroduces a circular path this module avoids.\nimport { slot } from '../../core/types/Insights'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf import, not the `common` barrel, which would pull the shared layer into the micro bundle.\nimport { GlobalDataContext } from '../../common/context/GlobalDataProvider'\n// TODO: load this with `React.lazy` to keep the block registry and charts out of the micro bundle,\n// once it is verified in every host that embeds the micro widget.\nimport InlineActionBlock from './InlineActionBlock'\nimport MicroCtaStatusGate, { type MicroCtaStatus } from './MicroCtaStatus'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport { asLogoRef } from '../../insights-v2/blocks/slotReaders'\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid, { isLogoGuid } from '../../insights-v2/components/LogoFromGuid'\nimport {\n statusIconAccentColor,\n statusIconName,\n statusIconPalette,\n} from '../../insights-v2/components/statusIcon'\nimport { hasDrawerBlock } from '../../insights-v2/mappings/hasDrawerBlock'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\n/**\n * A `budget_block` slot's micro tile is the tinted category tile (Figma 156:35121, Micro | Category\n * Budget: the glyph on a 25% tint of the category colour, bordered in it) instead of mxui's solid tile.\n */\nconst TINTED_CATEGORY_TILE_BLOCK = 'budget_block'\nconst CATEGORY_TILE_TINT = 0.25\n\nexport interface InsightCardProps extends MicroInsightCardProps {\n beat: Beat | BeatLikeOffer\n index?: number\n}\n\nexport const InsightCard: React.FC<InsightCardProps> = ({\n ariaLabel,\n beat,\n elevation,\n inDescriptionCtaBehavior = 'external',\n index,\n isActiveCard,\n onCardClick,\n posthog,\n widthOverrides,\n variant,\n showIcon,\n heightOverrides,\n}) => {\n const { ref, inView } = useInView({\n threshold: VIEW_THRESHOLD,\n })\n\n const theme = useTheme()\n\n // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\n\n const isV2 = 'is_insights_v2' in beat && beat.is_insights_v2\n const eventProps = isV2 ? { metadata: { is_insights_v2: true } } : undefined\n\n // ************** Use Effects Hooks **********************\n useEffect(() => {\n if (inView) {\n if (!beat.has_been_displayed) {\n if (beat.guid.startsWith('OFR')) {\n updateOffer({\n ...beat,\n has_been_displayed: true,\n })\n } else {\n updateBeat({\n ...beat,\n has_been_displayed: true,\n })\n }\n onEvent(ON_VIEW_FIRST_TIME_EVENT(beat.template), eventProps)\n } else {\n onEvent(ON_VIEW_EVENT(beat.template), eventProps)\n }\n }\n }, [inView])\n\n useEffect(() => {\n if (inView && beat) {\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('viewed_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('viewed_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n }, [beat, index, inView])\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\n // Only a V2 beat whose `in_description_cta` names a drawer block opens in place; everything else\n // keeps the host's behavior. Micro sends its one action as `in_description_cta`.\n // It also needs the host's `GlobalDataProvider`; without one the tap goes to the host instead.\n const hasGlobalData = React.useContext(GlobalDataContext) !== null\n const opensInline =\n inDescriptionCtaBehavior === 'internal' &&\n hasGlobalData &&\n hasDrawerBlock(v2Payload?.in_description_cta?.block)\n\n // *************** Click handlers ************************\n // Taps that opened the beat's own action block.\n const [inlineOpenRequest, setInlineOpenRequest] = useState(0)\n\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n // Internal opens the block here and skips the host's `onCardClick`; analytics are unchanged.\n if (opensInline) {\n setInlineOpenRequest((count) => count + 1)\n } else {\n onCardClick && onCardClick(beat)\n }\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n\n if (beat.template === 'MarketingOffer') {\n const offerBeat = beat as BeatLikeOffer\n posthog?.capture('clicked_messaging_insight', {\n template: beat.template,\n campaign_guid: offerBeat.campaign_guid,\n campaign_name: offerBeat.pulse_campaign_name,\n offer_guid: offerBeat.guid,\n user_guid: offerBeat.user_guid,\n })\n } else {\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n }\n\n if (insightRender === 'error') {\n // Keeps the carousel's slot sizing; the error card does not know about it.\n return (\n <Box\n aria-hidden={!isActiveCard}\n aria-label={ariaLabel}\n aria-roledescription=\"slide\"\n ref={ref}\n role=\"group\"\n sx={{\n height: heightOverrides ? '100%' : 120,\n minWidth: microCardMinWidth(widthOverrides),\n my: 1,\n }}\n >\n <InsightErrorCard beat={beat} />\n </Box>\n )\n }\n\n if (v2Payload) {\n // Figma (Micro Widget | Large Transaction) is the legacy micro card's layout fed from the envelope:\n // the slot's logo on the left (merchant, or the category without one), title, description, and the\n // primary CTA as a link. The logo falls back to the insight glyph when the slot carries none.\n // ditto ≥ 1.4.3 words micro's action as in_description_cta instead of primary_cta; either way\n // the label stays the card's tap (`micro-carousel/cta`), never a drawer.\n // A block with no usable row logo may name a status icon instead (account_block `minimal`:\n // `ICO-error`), drawn in the legacy card's tinted tile (Figma Micro | Low Account Balance).\n // The status tile takes the palette the slot names (Payday's on-track check is `success.main`),\n // falling back to error. `||` on the label: the copy may send the primary label as \"\".\n // Answered (mirrors the full card): reviewed title, icon and the Undo label. Display only: the card\n // and its label tap go to the host, which opens the insight with its block; nothing runs here.\n const renderCard = ({ presentation }: MicroCtaStatus) => {\n const answered = presentation?.kind === 'status' ? presentation : undefined\n const { data } = v2Payload.instance_slot\n const rowLogo = asLogoRef(slot(data, 'logo'))\n // The reviewed icon once answered, else the icon: whichever names a status icon first.\n const statusIcon = [answered ? slot(data, 'reviewed_icon') : undefined, slot(data, 'icon')]\n .map(asLogoRef)\n .find((ref) => statusIconName(ref?.guid))\n // An `ICO-` row logo is an icon, not an entity logo: it takes the same tinted tile (Figma Micro\n // Card) and wins over the status icon, as a row logo always has. The no-colour defaults differ\n // on purpose: a row icon with none is decorative (primary), a status icon with none is an error.\n const rowIconName = statusIconName(rowLogo?.guid)\n const tileColor = rowIconName ? rowLogo?.color || 'primary.main' : statusIcon?.color\n const tileName = rowIconName ?? statusIconName(statusIcon?.guid)\n const tilePalette = statusIconPalette(tileColor)\n // A non-status icon (`primary.main`, `action.active`, `chart.*`) tints the tile in its own colour.\n const tileAccent = statusIconAccentColor(theme.palette, tileColor)\n const actionLabel = presentation\n ? answered?.action?.label\n : v2Payload.primary_cta?.label || v2Payload.in_description_cta?.label || undefined\n const handleHostClick = () => {\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template), eventProps)\n posthog?.capture('clicked_insight', {\n beat_guid: beat.guid,\n template: beat.template,\n position: index,\n ...(isV2 && { is_insights_v2: true }),\n })\n }\n\n const card = (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={v2Payload.description.html_text}\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={\n showIcon &&\n (isLogoGuid(rowLogo?.guid) && !rowIconName ? (\n <LogoFromGuid\n categoryTint={\n v2Payload.instance_slot.block === TINTED_CATEGORY_TILE_BLOCK\n ? CATEGORY_TILE_TINT\n : undefined\n }\n logo={rowLogo}\n size={ICON_SIZE}\n />\n ) : tileName ? (\n <BeatMaterialIcon\n bgColor={alpha(tileAccent ?? theme.palette[tilePalette].main, 0.15)}\n iconColor={tileAccent ? 'inherit' : tilePalette}\n name={tileName}\n sx={tileAccent ? { color: tileAccent } : undefined}\n />\n ) : (\n <BeatMaterialIcon\n bgColor={alpha(theme.palette.primary.main, 0.15)}\n name=\"lightbulb\"\n />\n ))\n }\n isActiveCard={isActiveCard}\n isInsightsV2={true}\n onCardClick={presentation ? handleHostClick : handleClick}\n onPrimaryAction={presentation ? handleHostClick : handleClick}\n primaryActionText={actionLabel}\n ref={ref}\n title={presentation?.title || v2Payload.title || ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n\n if (!opensInline) return card\n\n return (\n <>\n {card}\n {/* Nothing renders until the first tap. */}\n {inlineOpenRequest > 0 && (\n <InlineActionBlock\n beat={beat as Beat}\n openRequest={inlineOpenRequest}\n posthog={posthog}\n />\n )}\n </>\n )\n }\n\n return (\n <MicroCtaStatusGate beat={beat as Beat} posthog={posthog}>\n {renderCard}\n </MicroCtaStatusGate>\n )\n }\n\n return (\n <MicroCardTemplate\n aria-roledescription=\"slide\"\n ariaLabel={ariaLabel}\n description={\n beat?.html_micro_description && beat?.html_micro_description.length > 0\n ? beat.html_micro_description\n : beat.html_description || ''\n }\n elevation={elevation}\n heightOverrides={heightOverrides}\n icon={showIcon && <BeatIcon beat={beat} />}\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={beat.micro_call_to_action || cardsCopy?.micro_card_cta}\n ref={ref}\n title={beat.micro_title && beat.micro_title.length > 0 ? beat.micro_title : beat.title}\n variant={variant}\n widthOverrides={widthOverrides}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,KAA6B,gBAC7B,KAAqB,MAOd,KAAA,CAA2C,EACtD,WAAA,GACA,MAAA,GACA,WAAA,GACA,0BAAA,IAA2B,YAC3B,OAAA,GACA,cAAA,GACA,aAAA,GACA,SAAA,GACA,gBAAA,GACA,SAAA,GACA,UAAA,GACA,iBAAA,EAAA,MACI;AACJ,QAAM,EAAE,KAAA,GAAK,QAAA,EAAA,IAAW,GAAU,EAChC,WAAA,EACF,CAAC,GAEK,IAAQ,GAAS,GAGjB,EAAE,WAAA,EAAA,IAAc,GAAa,GAC7B,EAAE,SAAA,EAAA,IAA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AA,QAC9C,iBAAiB,IAAe,IAAkB;AAAA,QAClD,mBAAmB;AAAA,QACd,KAAA;AAAA,QACL,OAAO,GAAc,SAAS,EAAU,SAAS;AAAA,QACxC,SAAA;AAAA,QACO,gBAAA;AAAA,MACjB,CAAA;AAGH,aAAK,IAGH,gBAAA,GAAA,IAAA,EAAA,UAAA,CACG,GAEA,IAAoB,KACnB,gBAAA,EAAC,IAAD;AAAA,QACQ,MAAA;AAAA,QACN,aAAa;AAAA,QACJ,SAAA;AAAA,MACV,CAAA,CAEH,EAAA,CAAA,IAbqB;AAAA,IAe3B;AAAA,EAKsB,CAAA,IAKtB,gBAAA,EAAC,GAAD;AAAA,IACE,wBAAqB;AAAA,IACV,WAAA;AAAA,IACX,aACE,GAAM,0BAA0B,GAAM,uBAAuB,SAAS,IAClE,EAAK,yBACL,EAAK,oBAAoB;AAAA,IAEpB,WAAA;AAAA,IACM,iBAAA;AAAA,IACjB,MAAM,KAAY,gBAAA,EAAC,IAAD,EAAgB,MAAA,EAAO,CAAA;AAAA,IAC3B,cAAA;AAAA,IACd,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB,EAAK,wBAAwB,GAAW;AAAA,IACtD,KAAA;AAAA,IACL,OAAO,EAAK,eAAe,EAAK,YAAY,SAAS,IAAI,EAAK,cAAc,EAAK;AAAA,IACxE,SAAA;AAAA,IACO,gBAAA;AAAA,EACjB,CAAA;AAEL"}
|
package/package.json
CHANGED
package/dist/insights-v2/blocks/ComponentBlocks/GreenStatementFeeBlock/GreenStatementFeeBlock.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BlockProps } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Formats an ISO `YYYY-MM-DD` date as local midnight into a long date string (e.g. "October 15, 2026").
|
|
4
|
-
* A date that already arrives worded or is not in ISO format is returned as-is.
|
|
5
|
-
*/
|
|
6
|
-
export declare const formatStatementDate: (value?: string) => string | undefined;
|
|
7
|
-
declare const GreenStatementFeeBlock: ({ payload }: BlockProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export default GreenStatementFeeBlock;
|