@mx-cartographer/experiences 9.7.154 → 9.7.156
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 +13 -0
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js +19 -22
- package/dist/insights-v2/actionBlocks/AccountDetailsBlock/AccountDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js +43 -48
- package/dist/insights-v2/actionBlocks/AccountListBlock/AccountListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +30 -34
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +52 -52
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.d.ts +4 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js +17 -0
- package/dist/insights-v2/actionBlocks/BlockErrorMessage.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js +131 -135
- package/dist/insights-v2/actionBlocks/BudgetDetailsBlock/BudgetDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +14 -18
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js +19 -25
- package/dist/insights-v2/actionBlocks/CreditUtilizationBlock/CreditUtilizationBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js +26 -28
- package/dist/insights-v2/actionBlocks/EmergencySavingsBlock/EmergencySavingsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js +11 -14
- package/dist/insights-v2/actionBlocks/HelpBlock/HelpBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js +12 -12
- package/dist/insights-v2/actionBlocks/MakeTransferActionBlock/MakeTransferActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js +28 -30
- package/dist/insights-v2/actionBlocks/OverdraftBlock/OverdraftBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js +53 -55
- package/dist/insights-v2/actionBlocks/PayoffCalculatorBlock/PayoffCalculatorBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js +26 -31
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js +18 -18
- package/dist/insights-v2/actionBlocks/PayoffStrategiesBlock/PayoffStrategiesContent.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js +23 -22
- package/dist/insights-v2/actionBlocks/PlaceholderActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js +38 -41
- package/dist/insights-v2/actionBlocks/RemainingCashBlock/RemainingCashBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +44 -44
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +24 -24
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +11 -16
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +20 -20
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.d.ts +1 -2
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js +3 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/util.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js +39 -42
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionDrillDown.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +102 -104
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.d.ts +7 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js +28 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListHeaderIconTile.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js +14 -33
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSubscriptionHeader.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js +24 -41
- package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/useOpenedCta.d.ts +9 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js +11 -0
- package/dist/insights-v2/actionBlocks/useOpenedCta.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/util.d.ts +2 -1
- package/dist/insights-v2/actionBlocks/util.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,83 +1,66 @@
|
|
|
1
|
-
import { buildPluralCopy as
|
|
2
|
-
import { DATE_FORMATS_INTL as s, formatDate as
|
|
3
|
-
import { CURRENCY_FORMAT as
|
|
4
|
-
import { getLogoElevation as
|
|
1
|
+
import { buildPluralCopy as l } from "../../../core/utils/Localization.es.js";
|
|
2
|
+
import { DATE_FORMATS_INTL as s, formatDate as d } from "../../../core/constants/DateFormats.es.js";
|
|
3
|
+
import { CURRENCY_FORMAT as f, formatCurrency as x } from "../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { getLogoElevation as _ } from "../../components/logoShadow.es.js";
|
|
5
|
+
import { TransactionListHeaderIconTile as g } from "./TransactionListHeaderIconTile.es.js";
|
|
5
6
|
import n from "@mui/material/Stack";
|
|
6
|
-
import { Text as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { alpha as m } from "@mui/material/styles";
|
|
7
|
+
import { Text as i } from "@mxenabled/mxui";
|
|
8
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
9
|
+
import { alpha as T } from "@mui/material/styles";
|
|
10
10
|
import p from "@mui/material/Box";
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
var u = "_1{count} transactions", h = "_1{count} transaction", v = (t, a) => [t, a].filter((r) => r !== void 0).map((r) => d(r, s.MONTH_DAY)).join(" – "), S = ({ summary: t, count: a, copy: r }) => {
|
|
12
|
+
const c = v(t.startDate, t.endDate);
|
|
13
|
+
return /* @__PURE__ */ o(p, {
|
|
14
14
|
sx: {
|
|
15
15
|
px: 24,
|
|
16
16
|
pt: 24,
|
|
17
17
|
pb: 12
|
|
18
18
|
},
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ e(n, {
|
|
20
20
|
sx: {
|
|
21
21
|
bgcolor: "background.paper",
|
|
22
22
|
borderRadius: "8px",
|
|
23
|
-
boxShadow:
|
|
23
|
+
boxShadow: _,
|
|
24
24
|
gap: 11,
|
|
25
25
|
p: 16
|
|
26
26
|
},
|
|
27
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ e(n, {
|
|
28
28
|
sx: {
|
|
29
29
|
alignItems: "center",
|
|
30
30
|
flexDirection: "row",
|
|
31
31
|
gap: 12
|
|
32
32
|
},
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
sx: {
|
|
35
|
-
alignItems: "center",
|
|
36
|
-
bgcolor: (i) => m(i.palette.primary.main, 0.15),
|
|
37
|
-
borderRadius: "4px",
|
|
38
|
-
color: "primary.main",
|
|
39
|
-
display: "flex",
|
|
40
|
-
height: 56,
|
|
41
|
-
justifyContent: "center",
|
|
42
|
-
width: 56
|
|
43
|
-
},
|
|
44
|
-
children: /* @__PURE__ */ r(u, {
|
|
45
|
-
"aria-hidden": !0,
|
|
46
|
-
fill: !0,
|
|
47
|
-
name: "savings",
|
|
48
|
-
size: 32
|
|
49
|
-
})
|
|
50
|
-
}), /* @__PURE__ */ c(n, { children: [l && /* @__PURE__ */ r(e, {
|
|
33
|
+
children: [/* @__PURE__ */ o(g, { name: "savings" }), /* @__PURE__ */ e(n, { children: [c && /* @__PURE__ */ o(i, {
|
|
51
34
|
color: "text.secondary",
|
|
52
35
|
variant: "caption",
|
|
53
|
-
children:
|
|
54
|
-
}), /* @__PURE__ */
|
|
36
|
+
children: c
|
|
37
|
+
}), /* @__PURE__ */ o(i, {
|
|
55
38
|
bold: !0,
|
|
56
39
|
component: "p",
|
|
57
40
|
variant: "h1",
|
|
58
|
-
children:
|
|
41
|
+
children: x(t.amount, f.cents)
|
|
59
42
|
})] })]
|
|
60
|
-
}), /* @__PURE__ */
|
|
43
|
+
}), /* @__PURE__ */ o(p, {
|
|
61
44
|
sx: {
|
|
62
45
|
alignItems: "center",
|
|
63
|
-
bgcolor: (
|
|
46
|
+
bgcolor: (m) => T(m.palette.primary.main, 0.15),
|
|
64
47
|
borderRadius: "999px",
|
|
65
48
|
display: "flex",
|
|
66
49
|
px: 12,
|
|
67
50
|
py: 2
|
|
68
51
|
},
|
|
69
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ o(i, {
|
|
70
53
|
color: "primary.dark",
|
|
71
54
|
variant: "caption",
|
|
72
|
-
children:
|
|
55
|
+
children: l(r.transaction_count_one ?? h, r.transaction_count ?? u, a, String(a))
|
|
73
56
|
})
|
|
74
57
|
})]
|
|
75
58
|
})
|
|
76
59
|
});
|
|
77
60
|
};
|
|
78
61
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
62
|
+
S as TransactionListSummaryCard,
|
|
63
|
+
S as default
|
|
81
64
|
};
|
|
82
65
|
|
|
83
66
|
//# sourceMappingURL=TransactionListSummaryCard.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionListSummaryCard.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport {
|
|
1
|
+
{"version":3,"file":"TransactionListSummaryCard.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionListBlock/TransactionListSummaryCard.tsx"],"sourcesContent":["import Box from '@mui/material/Box'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Text } from '@mxenabled/mxui'\n\nimport { DATE_FORMATS_INTL, formatDate } from '../../../core/constants'\nimport type { InsightsFeedCopy } from '../../../core/types/localization'\nimport { buildPluralCopy } from '../../../core/utils/Localization'\nimport { CURRENCY_FORMAT, formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { getLogoElevation } from '../../components/logoShadow'\n\nimport { TransactionListHeaderIconTile } from './TransactionListHeaderIconTile'\nimport type { TransactionListSummary } from './layout'\n\nexport interface TransactionListSummaryCardProps {\n summary: TransactionListSummary\n /** Pill count: the CTA's `drilldown_data.count`, else the number of guids the beat names. */\n count: number\n /** Only the two pill-copy keys the card reads. */\n copy: Pick<InsightsFeedCopy['general'], 'transaction_count' | 'transaction_count_one'>\n}\n\n// English default until the localized-content service ships the pill copy in every locale.\nconst DEFAULT_COUNT_COPY = '_1{count} transactions'\nconst DEFAULT_COUNT_ONE_COPY = '_1{count} transaction'\n\n// Endpoints are already validated `Date`s from `readSummary` (invalid/junk omitted there).\nconst formatRange = (start?: Date, end?: Date): string =>\n [start, end]\n .filter((d): d is Date => d !== undefined)\n .map((d) => formatDate(d, DATE_FORMATS_INTL.MONTH_DAY))\n .join(' – ')\n\n/**\n * Summary header for the Transaction List drawer: a white card with a themed icon tile, the date\n * range, the headline amount, and a `{count} transactions` pill. Driven by the beat's summary\n * figures (see `readSummary` in layout.ts). Theme-aware tokens keep it correct in dark mode.\n *\n * Figma: Drilldown | Replenish Savings (\"Savings Withdrawal\"). Currently only Replenish Savings\n * declares the `summary_header` variant, so the tile carries its `savings` icon.\n */\nexport const TransactionListSummaryCard = ({\n summary,\n count,\n copy,\n}: TransactionListSummaryCardProps) => {\n const dateRange = formatRange(summary.startDate, summary.endDate)\n\n return (\n <Box sx={{ px: 24, pt: 24, pb: 12 }}>\n <Stack\n sx={{\n bgcolor: 'background.paper',\n borderRadius: '8px',\n boxShadow: getLogoElevation,\n gap: 11,\n p: 16,\n }}\n >\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 12 }}>\n <TransactionListHeaderIconTile name=\"savings\" />\n <Stack>\n {dateRange && (\n <Text color=\"text.secondary\" variant=\"caption\">\n {dateRange}\n </Text>\n )}\n <Text bold={true} component=\"p\" variant=\"h1\">\n {formatCurrency(summary.amount, CURRENCY_FORMAT.cents)}\n </Text>\n </Stack>\n </Stack>\n\n {/* Figma Tag: a 20px pill. As a flex container the inline caption becomes a flex item, so its own\n 16px line box (not the pill's inherited line height) sets 2 + 16 + 2, centered. */}\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.15),\n borderRadius: '999px',\n display: 'flex',\n px: 12,\n py: 2,\n }}\n >\n <Text color=\"primary.dark\" variant=\"caption\">\n {\n buildPluralCopy(\n copy.transaction_count_one ?? DEFAULT_COUNT_ONE_COPY,\n copy.transaction_count ?? DEFAULT_COUNT_COPY,\n count,\n String(count),\n ) as string\n }\n </Text>\n </Box>\n </Stack>\n </Box>\n )\n}\n\nexport default TransactionListSummaryCard\n"],"mappings":";;;;;;;;;;AAwBA,IAAM,IAAqB,0BACrB,IAAyB,yBAGzB,IAAA,CAAe,GAAc,MACjC,CAAC,GAAO,CAAG,EACR,OAAA,CAAQ,MAAiB,MAAM,MAAS,EACxC,IAAA,CAAK,MAAM,EAAW,GAAG,EAAkB,SAAS,CAAC,EACrD,KAAK,KAAK,GAUF,IAAA,CAA8B,EACzC,SAAA,GACA,OAAA,GACA,MAAA,EAAA,MACqC;AACrC,QAAM,IAAY,EAAY,EAAQ,WAAW,EAAQ,OAAO;AAEhE,SACE,gBAAA,EAAC,GAAD;AAAA,IAAK,IAAI;AAAA,MAAE,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAChC,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,SAAS;AAAA,QACT,cAAc;AAAA,QACd,WAAW;AAAA,QACX,KAAK;AAAA,QACL,GAAG;AAAA,MACL;AAAA,MAPF,UAAA,CASE,gBAAA,EAAC,GAAD;AAAA,QAAO,IAAI;AAAA,UAAE,YAAY;AAAA,UAAU,eAAe;AAAA,UAAO,KAAK;AAAA,QAAG;AAAA,QAAjE,UAAA,CACE,gBAAA,EAAC,GAAD,EAA+B,MAAK,UAAW,CAAA,GAC/C,gBAAA,EAAC,GAAD,EAAA,UAAA,CACG,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,WAAU;AAAA,UAAI,SAAQ;AAAA,UACrC,UAAA,EAAe,EAAQ,QAAQ,EAAgB,KAAK;AAAA,QACjD,CAAA,CACD,EAAA,CAAA,CACF;AAAA,MAIP,CAAA,GAAA,gBAAA,EAAC,GAAD;AAAA,QACE,IAAI;AAAA,UACF,YAAY;AAAA,UACZ,SAAA,CAAU,MAAU,EAAM,EAAM,QAAQ,QAAQ,MAAM,IAAI;AAAA,UAC1D,cAAc;AAAA,UACd,SAAS;AAAA,UACT,IAAI;AAAA,UACJ,IAAI;AAAA,QACN;AAAA,QAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAM,OAAM;AAAA,UAAe,SAAQ;AAAA,UAE/B,UAAA,EACE,EAAK,yBAAyB,GAC9B,EAAK,qBAAqB,GAC1B,GACA,OAAO,CAAK,CACd;AAAA,QAEE,CAAA;AAAA,MACH,CAAA,CACA;AAAA;EACJ,CAAA;AAET"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Beat } from '../../core';
|
|
2
|
+
import { OpenedCta } from './util';
|
|
3
|
+
/**
|
|
4
|
+
* The CTA that opened the beat's drawer, re-read from the store's trigger on every render, so a
|
|
5
|
+
* block follows a beat its own edit refreshes. ActionBlockLayer pins its own copy to pick the block
|
|
6
|
+
* and title. Call it from an observer component; the result can be a new object each render, so
|
|
7
|
+
* keep it out of effect and memo dependency lists.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useOpenedCta: (beat: Beat) => OpenedCta;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useInsightsV2Store as n } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { getDynamicCtaBasedOnTriggers as o } from "./util.es.js";
|
|
3
|
+
var p = (r) => {
|
|
4
|
+
const { actionDrawer: t } = n(), { primary_cta: a, secondary_cta: e, in_description_cta: i } = r.insights_payload ?? {};
|
|
5
|
+
return o(t, a, e, i);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
p as useOpenedCta
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=useOpenedCta.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOpenedCta.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/useOpenedCta.ts"],"sourcesContent":["import { useInsightsV2Store } from '../../common'\nimport type { Beat } from '../../core'\nimport { getDynamicCtaBasedOnTriggers, type OpenedCta } from './util'\n\n/**\n * The CTA that opened the beat's drawer, re-read from the store's trigger on every render, so a\n * block follows a beat its own edit refreshes. ActionBlockLayer pins its own copy to pick the block\n * and title. Call it from an observer component; the result can be a new object each render, so\n * keep it out of effect and memo dependency lists.\n */\nexport const useOpenedCta = (beat: Beat): OpenedCta => {\n const { actionDrawer } = useInsightsV2Store()\n const { primary_cta, secondary_cta, in_description_cta } = beat.insights_payload ?? {}\n\n return getDynamicCtaBasedOnTriggers(actionDrawer, primary_cta, secondary_cta, in_description_cta)\n}\n"],"mappings":";;AAUA,IAAa,IAAA,CAAgB,MAA0B;AACrD,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,aAAA,GAAa,eAAA,GAAe,oBAAA,EAAA,IAAuB,EAAK,oBAAoB,CAAC;AAErF,SAAO,EAA6B,GAAc,GAAa,GAAe,CAAkB;AAClG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActionDrawerState, InDescriptionCTA, PrimaryCTA, SecondaryCTA } from '../../core';
|
|
2
2
|
/** A CTA naming the bar's block wins; else that block with the card's CTA variant; else the secondary CTA. */
|
|
3
3
|
export declare const getCtaForChartBarClick: (actionDrawer: ActionDrawerState, primary_cta: PrimaryCTA | undefined, secondary_cta: SecondaryCTA | undefined) => PrimaryCTA | SecondaryCTA | undefined;
|
|
4
|
+
export type OpenedCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA | undefined;
|
|
4
5
|
/** The CTA driving the open drawer, by trigger; falls back to `primary_cta`. */
|
|
5
|
-
export declare const getDynamicCtaBasedOnTriggers: (actionDrawer: ActionDrawerState, primary_cta: PrimaryCTA | undefined, secondary_cta: SecondaryCTA | undefined, in_description_cta?: InDescriptionCTA) =>
|
|
6
|
+
export declare const getDynamicCtaBasedOnTriggers: (actionDrawer: ActionDrawerState, primary_cta: PrimaryCTA | undefined, secondary_cta: SecondaryCTA | undefined, in_description_cta?: InDescriptionCTA) => OpenedCta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/util.ts"],"sourcesContent":["import type {\n ActionDrawerState,\n DrilldownPayload,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../core'\nimport { layout as drillDownLayout } from './TransactionHistoryBlock/layout'\n\n/** A CTA naming the bar's block wins; else that block with the card's CTA variant; else the secondary CTA. */\nexport const getCtaForChartBarClick = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n): PrimaryCTA | SecondaryCTA | undefined => {\n const context = actionDrawer.context as DrilldownPayload | undefined\n const blockName = context?.block\n\n if (blockName === primary_cta?.block) {\n return primary_cta\n }\n // Category Spending with a budget: no CTA names Spending History, so the bar opens it with the\n // primary CTA's variant when that is a Spending History view (`category_spend`).\n const variant = primary_cta?.variant\n if (\n blockName &&\n blockName !== secondary_cta?.block &&\n variant &&\n Object.hasOwn(drillDownLayout, variant)\n ) {\n return { label: '', block: blockName, variant }\n }\n return secondary_cta\n}\n\n/** The CTA driving the open drawer, by trigger; falls back to `primary_cta`. */\nexport const getDynamicCtaBasedOnTriggers = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n in_description_cta?: InDescriptionCTA,\n):
|
|
1
|
+
{"version":3,"file":"util.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/util.ts"],"sourcesContent":["import type {\n ActionDrawerState,\n DrilldownPayload,\n InDescriptionCTA,\n PrimaryCTA,\n SecondaryCTA,\n} from '../../core'\nimport { layout as drillDownLayout } from './TransactionHistoryBlock/layout'\n\n/** A CTA naming the bar's block wins; else that block with the card's CTA variant; else the secondary CTA. */\nexport const getCtaForChartBarClick = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n): PrimaryCTA | SecondaryCTA | undefined => {\n const context = actionDrawer.context as DrilldownPayload | undefined\n const blockName = context?.block\n\n if (blockName === primary_cta?.block) {\n return primary_cta\n }\n // Category Spending with a budget: no CTA names Spending History, so the bar opens it with the\n // primary CTA's variant when that is a Spending History view (`category_spend`).\n const variant = primary_cta?.variant\n if (\n blockName &&\n blockName !== secondary_cta?.block &&\n variant &&\n Object.hasOwn(drillDownLayout, variant)\n ) {\n return { label: '', block: blockName, variant }\n }\n return secondary_cta\n}\n\nexport type OpenedCta = PrimaryCTA | SecondaryCTA | InDescriptionCTA | undefined\n\n/** The CTA driving the open drawer, by trigger; falls back to `primary_cta`. */\nexport const getDynamicCtaBasedOnTriggers = (\n actionDrawer: ActionDrawerState,\n primary_cta: PrimaryCTA | undefined,\n secondary_cta: SecondaryCTA | undefined,\n in_description_cta?: InDescriptionCTA,\n): OpenedCta => {\n // The opener's block and variant, else the beat's link.\n if (actionDrawer.trigger === 'inDescriptionCta') {\n if (!actionDrawer.cta) return in_description_cta\n const { drilldown_data } = in_description_cta ?? {}\n return { label: '', ...(drilldown_data && { drilldown_data }), ...actionDrawer.cta }\n }\n if (actionDrawer.trigger === 'secondaryCta') {\n return secondary_cta ?? primary_cta\n }\n if (actionDrawer.trigger === 'primaryCta') {\n return primary_cta\n }\n return getCtaForChartBarClick(actionDrawer, primary_cta, secondary_cta) ?? primary_cta\n}\n"],"mappings":";AAUA,IAAa,IAAA,CACX,GACA,GACA,MAC0C;AAE1C,QAAM,IADU,EAAa,SACF;AAE3B,MAAI,MAAc,GAAa,MAC7B,QAAO;AAIT,QAAM,IAAU,GAAa;AAC7B,SACE,KACA,MAAc,GAAe,SAC7B,KACA,OAAO,OAAO,GAAiB,CAAO,IAE/B;AAAA,IAAE,OAAO;AAAA,IAAI,OAAO;AAAA,IAAW,SAAA;AAAA,EAAQ,IAEzC;AACT,GAKa,IAAA,CACX,GACA,GACA,GACA,MACc;AAEd,MAAI,EAAa,YAAY,oBAAoB;AAC/C,QAAI,CAAC,EAAa,IAAK,QAAO;AAC9B,UAAM,EAAE,gBAAA,EAAA,IAAmB,KAAsB,CAAC;AAClD,WAAO;AAAA,MAAE,OAAO;AAAA,MAAI,GAAI,KAAkB,EAAE,gBAAA,EAAe;AAAA,MAAI,GAAG,EAAa;AAAA,IAAI;AAAA,EACrF;AACA,SAAI,EAAa,YAAY,iBACpB,KAAiB,IAEtB,EAAa,YAAY,eACpB,IAEF,EAAuB,GAAc,GAAa,CAAa,KAAK;AAC7E"}
|