@mx-cartographer/experiences 9.7.1 → 9.7.3
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 +11 -0
- package/dist/common/constants/Analytics.d.ts +1 -0
- package/dist/common/constants/Analytics.es.js +2 -1
- package/dist/common/constants/Analytics.es.js.map +1 -1
- package/dist/common/context/hooks.d.ts +1 -0
- package/dist/common/context/hooks.es.js +30 -29
- package/dist/common/context/hooks.es.js.map +1 -1
- package/dist/common/context/index.d.ts +1 -1
- package/dist/common/index.es.js +140 -139
- package/dist/core/api/AgreementApi.d.ts +7 -0
- package/dist/core/api/AgreementApi.es.js +14 -0
- package/dist/core/api/AgreementApi.es.js.map +1 -0
- package/dist/core/api/index.d.ts +1 -0
- package/dist/core/constants/ApiEndpoints.d.ts +1 -0
- package/dist/core/constants/ApiEndpoints.es.js +1 -0
- package/dist/core/constants/ApiEndpoints.es.js.map +1 -1
- package/dist/core/index.es.js +92 -88
- package/dist/core/stores/AgreementStore.d.ts +12 -0
- package/dist/core/stores/AgreementStore.es.js +35 -0
- package/dist/core/stores/AgreementStore.es.js.map +1 -0
- package/dist/core/stores/GlobalStore.d.ts +2 -1
- package/dist/core/stores/GlobalStore.es.js +32 -30
- package/dist/core/stores/GlobalStore.es.js.map +1 -1
- package/dist/core/stores/GlobalUiStore.d.ts +1 -0
- package/dist/core/stores/GlobalUiStore.es.js +9 -4
- package/dist/core/stores/GlobalUiStore.es.js.map +1 -1
- package/dist/core/stores/UserStore.d.ts +2 -1
- package/dist/core/stores/UserStore.es.js +42 -29
- package/dist/core/stores/UserStore.es.js.map +1 -1
- package/dist/core/stores/index.d.ts +1 -0
- package/dist/core/types/Agreement.d.ts +6 -0
- package/dist/core/types/InsightsInstanceSlotData.d.ts +6 -2
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/User.d.ts +1 -0
- package/dist/core/types/index.d.ts +1 -0
- package/dist/core/types/localization/CommonCopy.d.ts +15 -0
- package/dist/dashboard/Dashboard.es.js +68 -36
- package/dist/dashboard/Dashboard.es.js.map +1 -1
- package/dist/dashboard/WelcomeDialog.d.ts +7 -0
- package/dist/dashboard/WelcomeDialog.es.js +281 -0
- package/dist/dashboard/WelcomeDialog.es.js.map +1 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.es.js +4 -2
- package/dist/finstrong/components/ManageDOB.es.js +16 -16
- package/dist/goals/components/GoalList.es.js +1 -1
- package/dist/goals/components/actions/BirthdayAction.es.js +11 -11
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandard.es.js +9 -9
- package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js +8 -8
- package/dist/insights/components/insights/MonthlySpendingComparisonV2/MonthlySpendingComparisonV2.es.js +9 -9
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/TransactionDetailsBlock.es.js +4 -4
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +58 -58
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.d.ts +1 -3
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js +14 -13
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistory.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.d.ts +8 -2
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js +56 -36
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.d.ts +7 -3
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +30 -32
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.d.ts +3 -2
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js +16 -15
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js +5 -5
- package/dist/insights-v2/blocks/ComponentBlocks/DebtsBlock/DebtsBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +4 -4
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingBillBlock/UpcomingBillBlock.es.js +6 -6
- package/dist/insights-v2/blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubscriptionBlock.es.js +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +24 -24
- package/dist/insights-v2/components/CompactInsightCard.d.ts +4 -2
- package/dist/insights-v2/components/CompactInsightCard.es.js +91 -59
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/chartblocks/EmptyBarChart.es.js +4 -4
- package/dist/insights-v2/index.es.js +122 -121
- package/dist/insights-v2/mappings/blocks.es.js +112 -99
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +10 -10
- package/dist/recurringtransactions/components/PaymentSchedule.es.js +11 -11
- package/dist/recurringtransactions/components/RecurringTransactionDetails.es.js +16 -16
- package/dist/settings/components/profile/ProfileTab.es.js +33 -33
- package/dist/transactions/components/shared/TransactionDetails.es.js +5 -4
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeDialog.es.js","names":[],"sources":["../../src/dashboard/WelcomeDialog.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\nimport DOMPurify from 'dompurify'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Dialog from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport Divider from '@mui/material/Divider'\nimport IconButton from '@mui/material/IconButton'\nimport Link from '@mui/material/Link'\nimport Stack from '@mui/material/Stack'\nimport { alpha } from '@mui/material/styles'\n\nimport { Icon, P, Text } from '@mxenabled/mxui'\n\nimport {\n ANALYTICS_EVENTS,\n buildDynamicCopy,\n Loader,\n useAgreementStore,\n useEvent,\n useGlobalCopyStore,\n useGlobalStore,\n useScreenSize,\n} from '../common'\n\n// Terms HTML is server-controlled, so render it fail-closed and against an explicit\n// allowlist — no script/style/form/event-handler content can reach the DOM.\nconst SANITIZE_CONFIG = {\n ALLOWED_TAGS: [\n 'a',\n 'b',\n 'br',\n 'div',\n 'em',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'i',\n 'li',\n 'ol',\n 'p',\n 'span',\n 'strong',\n 'u',\n 'ul',\n ],\n ALLOWED_ATTR: ['href', 'target', 'rel'],\n}\n\n// Any anchor that opens a new tab must not leak the opener (reverse tabnabbing).\nconst forceSafeRel = (node: Element) => {\n if (node.tagName === 'A' && node.getAttribute('target') === '_blank') {\n node.setAttribute('rel', 'noopener noreferrer')\n }\n}\n\n// Fail closed: when DOMPurify has no DOM to sanitize against, render nothing rather\n// than passing raw server HTML straight through to `dangerouslySetInnerHTML`.\nconst sanitizeTermsHtml = (html: string) => {\n if (!DOMPurify.isSupported) {\n return ''\n }\n\n // Scope the hook to this single call so it never alters the shared DOMPurify\n // singleton's behavior for other sanitize() callers (and never stacks).\n DOMPurify.addHook('afterSanitizeAttributes', forceSafeRel)\n try {\n return DOMPurify.sanitize(html, SANITIZE_CONFIG)\n } finally {\n DOMPurify.removeHook('afterSanitizeAttributes')\n }\n}\n\nexport interface WelcomeDialogProps {\n isOpen: boolean\n onContinue: () => void\n}\n\nconst WelcomeDialog: React.FC<WelcomeDialogProps> = ({ isOpen, onContinue }) => {\n const { copyStore } = useGlobalStore()\n const { common: commonCopy } = useGlobalCopyStore()\n const { isSmallMobile } = useScreenSize()\n const agreementStore = useAgreementStore()\n const { onEvent } = useEvent()\n\n const [showTerms, setShowTerms] = React.useState(false)\n\n if (!copyStore.isInitialized) {\n return null\n }\n\n const copy = commonCopy.welcome_dialog\n\n const openTerms = () => {\n setShowTerms(true)\n onEvent(ANALYTICS_EVENTS.WELCOME_DIALOG_VIEW_TERMS)\n if (!agreementStore.isLoaded) {\n agreementStore.loadAgreement()\n }\n }\n\n // MUI only fires onClose for backdrop clicks and Escape. This is a consent gate, so\n // neither dismisses it (Continue is the only way out); Escape just backs out of the\n // terms sub-view, mirroring the back button.\n const handleClose = (_event: object, reason: 'backdropClick' | 'escapeKeyDown') => {\n if (reason === 'escapeKeyDown' && showTerms) {\n setShowTerms(false)\n }\n }\n\n const renderTermsBody = () => {\n if (agreementStore.hasError) {\n return (\n <Stack sx={{ alignItems: 'center', gap: 16, py: 24 }}>\n <P color=\"error.main\" role=\"alert\" sx={{ textAlign: 'center' }} truncate={false}>\n {copy.terms_error}\n </P>\n <Button onClick={() => agreementStore.loadAgreement()} variant=\"outlined\">\n {commonCopy.refresh_button}\n </Button>\n </Stack>\n )\n }\n\n if (!agreementStore.isLoaded) {\n return <Loader height={400} />\n }\n\n return (\n <Box\n aria-labelledby=\"welcome-dialog-terms-title\"\n dangerouslySetInnerHTML={{\n __html: sanitizeTermsHtml(agreementStore.agreement?.text ?? ''),\n }}\n role=\"region\"\n tabIndex={0}\n sx={{\n overflowY: 'auto',\n '& *': { maxWidth: '100%' },\n ...(isSmallMobile ? { flex: 1, minHeight: 0 } : { maxHeight: 400 }),\n }}\n />\n )\n }\n\n const features = [\n {\n description: copy.financial_views_description,\n icon: 'account_balance',\n title: copy.financial_views_title,\n },\n {\n description: copy.smart_spending_description,\n icon: 'receipt_long',\n title: copy.smart_spending_title,\n },\n {\n description: copy.budgets_description,\n icon: 'bubble_chart',\n title: copy.budgets_title,\n },\n ]\n\n const titleId = showTerms ? 'welcome-dialog-terms-title' : 'welcome-dialog-title'\n\n return (\n <Dialog\n aria-labelledby={titleId}\n fullScreen={isSmallMobile}\n maxWidth=\"sm\"\n onClose={handleClose}\n open={isOpen}\n role=\"dialog\"\n scroll={isSmallMobile ? 'paper' : 'body'}\n sx={{\n '& .MuiDialog-paper': {\n borderRadius: isSmallMobile ? 0 : '8px',\n margin: isSmallMobile ? 0 : '32px auto',\n padding: showTerms || isSmallMobile ? '24px' : '64px',\n maxWidth: 500,\n width: '100%',\n },\n '& .MuiDialogContent-root': {\n padding: 0,\n ...(showTerms && {\n overflow: 'visible',\n ...(isSmallMobile && { display: 'flex', flexDirection: 'column' }),\n }),\n },\n }}\n >\n <DialogContent>\n {showTerms ? (\n <Stack sx={{ gap: 16, ...(isSmallMobile && { flex: 1, minHeight: 0 }) }}>\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', gap: 8 }}>\n <IconButton\n aria-label={commonCopy.back}\n onClick={() => setShowTerms(false)}\n sx={{ color: 'primary.main', ml: -8 }}\n >\n <Icon name=\"chevron_left\" size={24} />\n </IconButton>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-terms-title\" variant=\"h3\">\n {agreementStore.agreement?.title || copy.terms_link}\n </Text>\n </Stack>\n\n <Divider sx={{ mx: -24 }} />\n\n {renderTermsBody()}\n </Stack>\n ) : (\n <>\n <Stack sx={{ alignItems: 'center', mb: 32, textAlign: 'center' }}>\n <Text bold={true} component=\"h2\" id=\"welcome-dialog-title\" variant=\"h3\">\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_1}\n </Box>\n <Box component=\"span\" sx={{ display: 'block' }}>\n {copy.title_line_2}\n </Box>\n </Text>\n </Stack>\n\n <Stack sx={{ border: 1, borderColor: 'divider', borderRadius: '8px', p: 16, gap: 16 }}>\n {features.map((feature) => (\n <Stack\n key={feature.title}\n sx={{ alignItems: 'center', flexDirection: 'row', gap: 16 }}\n >\n <Box\n sx={{\n alignItems: 'center',\n bgcolor: (theme) => alpha(theme.palette.primary.main, 0.1),\n borderRadius: 1,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n p: 8,\n }}\n >\n <Icon name={feature.icon} size={24} sx={{ color: 'primary.main' }} />\n </Box>\n <Stack sx={{ gap: 2 }}>\n <Text bold={true} variant=\"body1\">\n {feature.title}\n </Text>\n <P color=\"text.secondary\" truncate={false} variant=\"caption\">\n {feature.description}\n </P>\n </Stack>\n </Stack>\n ))}\n </Stack>\n\n <Stack>\n <Button\n fullWidth={true}\n onClick={onContinue}\n sx={{ maxWidth: 324, mt: 64, mx: 'auto' }}\n variant=\"contained\"\n >\n {copy.continue_button}\n </Button>\n\n <P\n color=\"text.secondary\"\n sx={{ mt: 16, textAlign: 'center' }}\n truncate={false}\n variant=\"body2\"\n >\n {\n buildDynamicCopy(\n copy.terms_agreement,\n <Link\n component=\"button\"\n onClick={openTerms}\n rel=\"noopener\"\n sx={{ display: 'block', fontWeight: 600, lineHeight: 2, mx: 'auto' }}\n type=\"button\"\n >\n {copy.terms_link}\n </Link>,\n ) as string\n }\n </P>\n </Stack>\n </>\n )}\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default observer(WelcomeDialog)\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6BA,IAAM,IAAkB;AAAA,EACtB,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IAAC;AAAA,IAAQ;AAAA,IAAU;AAAA,EAAK;AACxC,GAGM,IAAA,CAAgB,MAAkB;AACtC,EAAI,EAAK,YAAY,OAAO,EAAK,aAAa,QAAQ,MAAM,YAC1D,EAAK,aAAa,OAAO,qBAAqB;AAElD,G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CAAA;AAAA,QAxBA,GAAA,EAAQ,KAwBR,CACR;AAAA,MACI,CAAA;AAAA,MAEP,gBAAA,EAAC,GAAD,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,QACE,WAAW;AAAA,QACX,SAAS;AAAA,QACT,IAAI;AAAA,UAAE,UAAU;AAAA,UAAK,IAAI;AAAA,UAAI,IAAI;AAAA,QAAO;AAAA,QACxC,SAAQ;AAAA,QAEP,UAAA,EAAK;AAAA,MACA,CAAA,GAER,gBAAA,EAAC,GAAD;AAAA,QACE,OAAM;AAAA,QACN,IAAI;AAAA,UAAE,IAAI;AAAA,UAAI,WAAW;AAAA,QAAS;AAAA,QAClC,UAAU;AAAA,QACV,SAAQ;AAAA,QAGN,UAAA,EACE,EAAK,iBACL,gBAAA,EAAC,GAAD;AAAA,UACE,WAAU;AAAA,UACV,SAAS;AAAA,UACT,KAAI;AAAA,UACJ,IAAI;AAAA,YAAE,SAAS;AAAA,YAAS,YAAY;AAAA,YAAK,YAAY;AAAA,YAAG,IAAI;AAAA,UAAO;AAAA,UACnE,MAAK;AAAA,UAEJ,UAAA,EAAK;AAAA,QACF,CAAA,CACR;AAAA,MAED,CAAA,CACE,EAAA,CAAA;AAAA,IACP,EAAA,CAAA,EAES,CAAA;AAAA,EACT,CAAA;AAEZ,GAEA,KAAe,EAAS,CAAa"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { default as Dashboard } from './Dashboard';
|
|
2
|
+
export { default as WelcomeDialog } from './WelcomeDialog';
|
|
3
|
+
export type { WelcomeDialogProps } from './WelcomeDialog';
|
|
2
4
|
export { DashboardLocation } from './constants/Dashboard';
|
|
3
5
|
export type { DashboardWidget } from './types/DashboardTypes';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./WelcomeDialog.es.js";
|
|
2
|
+
import { DashboardLocation as m } from "./constants/Dashboard.es.js";
|
|
2
3
|
import t from "./Dashboard.es.js";
|
|
3
4
|
export {
|
|
4
5
|
t as Dashboard,
|
|
5
|
-
|
|
6
|
+
m as DashboardLocation,
|
|
7
|
+
a as WelcomeDialog
|
|
6
8
|
};
|
|
@@ -3,16 +3,16 @@ import g from "../../common/components/drawer/Drawer.es.js";
|
|
|
3
3
|
import y from "react";
|
|
4
4
|
import { observer as b } from "mobx-react-lite";
|
|
5
5
|
import v from "@mui/material/Stack";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { alpha as
|
|
6
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
7
|
+
import { alpha as e, useTheme as D } from "@mui/material/styles";
|
|
8
8
|
import { AdapterDateFns as S } from "@mui/x-date-pickers/AdapterDateFns";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
var
|
|
12
|
-
const { finstrong: l } = u(),
|
|
9
|
+
import { StaticDatePicker as x } from "@mui/x-date-pickers";
|
|
10
|
+
import { LocalizationProvider as P } from "@mui/x-date-pickers/LocalizationProvider";
|
|
11
|
+
var w = ({ isOpen: n, onClose: a }) => {
|
|
12
|
+
const { finstrong: l } = u(), o = D(), { updateUser: c, user: i } = f(), { loadPeerScore: m } = h(), [r, s] = y.useState(i.birthday), p = (d) => {
|
|
13
13
|
s(Math.floor(new Date(d).getTime() / 1e3));
|
|
14
14
|
};
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ t(g, {
|
|
16
16
|
footerStyles: {
|
|
17
17
|
borderTop: 1,
|
|
18
18
|
borderColor: "divider",
|
|
@@ -31,28 +31,28 @@ var B = ({ isOpen: n, onClose: a }) => {
|
|
|
31
31
|
},
|
|
32
32
|
onSecondaryAction: a,
|
|
33
33
|
title: l.date_of_birth,
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ t(v, {
|
|
35
35
|
sx: {
|
|
36
36
|
bgcolor: "background.default",
|
|
37
37
|
height: "100%"
|
|
38
38
|
},
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ t(P, {
|
|
40
40
|
dateAdapter: S,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ t(x, {
|
|
42
42
|
disableFuture: !0,
|
|
43
43
|
onChange: p,
|
|
44
44
|
slotProps: {
|
|
45
45
|
nextIconButton: { sx: {
|
|
46
46
|
color: "primary.main",
|
|
47
|
-
"&:hover": { bgcolor: o
|
|
47
|
+
"&:hover": { bgcolor: e(o.palette.primary.light, 0.1) }
|
|
48
48
|
} },
|
|
49
49
|
previousIconButton: { sx: {
|
|
50
50
|
color: "primary.main",
|
|
51
|
-
"&:hover": { bgcolor: o
|
|
51
|
+
"&:hover": { bgcolor: e(o.palette.primary.light, 0.1) }
|
|
52
52
|
} },
|
|
53
53
|
switchViewButton: { sx: {
|
|
54
54
|
color: "primary.main",
|
|
55
|
-
"&:hover": { bgcolor: o
|
|
55
|
+
"&:hover": { bgcolor: e(o.palette.primary.light, 0.1) }
|
|
56
56
|
} }
|
|
57
57
|
},
|
|
58
58
|
slots: {
|
|
@@ -63,7 +63,7 @@ var B = ({ isOpen: n, onClose: a }) => {
|
|
|
63
63
|
width: "100%",
|
|
64
64
|
"& .MuiIconButton-edgeEnd": {
|
|
65
65
|
color: "primary.main",
|
|
66
|
-
"&:hover": { bgcolor: o
|
|
66
|
+
"&:hover": { bgcolor: e(o.palette.primary.light, 0.1) }
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
value: r ? /* @__PURE__ */ new Date(r * 1e3) : /* @__PURE__ */ new Date()
|
|
@@ -71,9 +71,9 @@ var B = ({ isOpen: n, onClose: a }) => {
|
|
|
71
71
|
})
|
|
72
72
|
})
|
|
73
73
|
});
|
|
74
|
-
},
|
|
74
|
+
}, O = b(w);
|
|
75
75
|
export {
|
|
76
|
-
|
|
76
|
+
O as default
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
//# sourceMappingURL=ManageDOB.es.js.map
|
|
@@ -12,8 +12,8 @@ import K from "@mui/material/Button";
|
|
|
12
12
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
13
13
|
import N from "@mui/material/Card";
|
|
14
14
|
import z from "@mui/material/CardContent";
|
|
15
|
-
import b from "@mui/material/Grid";
|
|
16
15
|
import j from "@mui/material/CardActionArea";
|
|
16
|
+
import b from "@mui/material/Grid";
|
|
17
17
|
var Y = w(({ trackType: c, onAddGoals: f }) => {
|
|
18
18
|
const { isMobile: s } = G(), { goals: n } = R(), { selectedAccountGuids: y } = x(), { orderedGoals: C, setSelectedGoal: a } = A(), d = C.filter((e) => e.track_type === c && (e.track_type !== r.RETIREMENT_TRACK && y.includes(e.account_guid) || e.track_type === r.RETIREMENT_TRACK)), l = d.filter((e) => e.track_type === r.SAVINGS_TRACK && !e.has_been_spent || e.track_type !== r.SAVINGS_TRACK && !e.is_complete), m = d.filter((e) => e.track_type === r.SAVINGS_TRACK && e.has_been_spent || e.track_type !== r.SAVINGS_TRACK && e.is_complete), S = c === r.DEBT_TRACK ? n.zero_state_complete_debt : n.zero_state_complete_savings;
|
|
19
19
|
return /* @__PURE__ */ i(o, {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { DATE_FORMATS_INTL as b, formatDate as f } from "../../../core/constants/DateFormats.es.js";
|
|
2
2
|
import { useGlobalCopyStore as u, useGoalStore as _, useUserStore as S } from "../../../common/context/hooks.es.js";
|
|
3
|
-
import { ListItemAction as
|
|
3
|
+
import { ListItemAction as v } from "../../../common/components/ListItemAction.es.js";
|
|
4
4
|
import i from "react";
|
|
5
|
-
import { observer as
|
|
5
|
+
import { observer as A } from "mobx-react-lite";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
7
|
import { fromUnixTime as s } from "date-fns/fromUnixTime";
|
|
8
|
-
import { getUnixTime as
|
|
8
|
+
import { getUnixTime as T } from "date-fns/getUnixTime";
|
|
9
9
|
import { AdapterDateFns as x } from "@mui/x-date-pickers/AdapterDateFns";
|
|
10
|
-
import {
|
|
10
|
+
import { isValid as D } from "date-fns/isValid";
|
|
11
11
|
import { DatePicker as g } from "@mui/x-date-pickers";
|
|
12
|
-
import {
|
|
13
|
-
var
|
|
12
|
+
import { LocalizationProvider as E } from "@mui/x-date-pickers/LocalizationProvider";
|
|
13
|
+
var N = A(({ goal: a }) => {
|
|
14
14
|
const { goals: r } = u(), { user: t, updateUser: d } = S(), { setAlert: m } = _(), [e, l] = i.useState(s(t.birthday ?? 0)), [n, p] = i.useState(null), c = a.is_complete, h = async () => {
|
|
15
|
-
e &&
|
|
15
|
+
e && D(e) && (await d({
|
|
16
16
|
...t,
|
|
17
|
-
birthday:
|
|
17
|
+
birthday: T(e)
|
|
18
18
|
}), m(r.alert_goal_updated_birthday));
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */ o(
|
|
20
|
+
return /* @__PURE__ */ o(v, {
|
|
21
21
|
isDisabled: c,
|
|
22
22
|
isSaveDisabled: !!n,
|
|
23
23
|
label: r.details_birthday,
|
|
@@ -25,7 +25,7 @@ var O = T(({ goal: a }) => {
|
|
|
25
25
|
primaryText: r.details_birthday,
|
|
26
26
|
secondaryText: `${f(s(t.birthday ?? 0), b.MONTH_DAY_YEAR)}`,
|
|
27
27
|
zeroStateText: !a.guid && !t.birthday ? r.add_birthday : void 0,
|
|
28
|
-
children: /* @__PURE__ */ o(
|
|
28
|
+
children: /* @__PURE__ */ o(E, {
|
|
29
29
|
dateAdapter: x,
|
|
30
30
|
children: /* @__PURE__ */ o(g, {
|
|
31
31
|
label: r.details_birthday,
|
|
@@ -38,7 +38,7 @@ var O = T(({ goal: a }) => {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
N as BirthdayAction
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
//# sourceMappingURL=BirthdayAction.es.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { ReactComponent as g } from "../../shared/images/EmptyBarChart.es.js";
|
|
2
|
+
import { BarChart as h } from "../../shared/Charts/BarChart/BarChart.es.js";
|
|
3
|
+
import { ThemedSVGImage as d } from "../../shared/ThemedSVGImage.es.js";
|
|
4
|
+
import { BeatCard as l } from "../../shared/InsightsCard/BeatCard.es.js";
|
|
5
|
+
import { InsightButton as u } from "../../shared/InsightsCard/InsightButton.es.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
var S = ({ amounts: i, beat: t, buttonProps: n, color: e, data: o, legendLabelAvg: a, legendLabelMain: f, onBarClick: p, ...m }) => /* @__PURE__ */ r(
|
|
8
|
+
var S = ({ amounts: i, beat: t, buttonProps: n, color: e, data: o, legendLabelAvg: a, legendLabelMain: f, onBarClick: p, ...m }) => /* @__PURE__ */ r(l, {
|
|
9
9
|
...m,
|
|
10
10
|
beat: t,
|
|
11
|
-
button: /* @__PURE__ */ r(
|
|
11
|
+
button: /* @__PURE__ */ r(u, {
|
|
12
12
|
...n,
|
|
13
13
|
beat: t
|
|
14
14
|
}),
|
|
15
|
-
children: o.length > 0 ? /* @__PURE__ */ r(
|
|
15
|
+
children: o.length > 0 ? /* @__PURE__ */ r(h, {
|
|
16
16
|
amounts: i,
|
|
17
17
|
color: e,
|
|
18
18
|
data: o,
|
|
@@ -26,7 +26,7 @@ var S = ({ amounts: i, beat: t, buttonProps: n, color: e, data: o, legendLabelAv
|
|
|
26
26
|
top: 24
|
|
27
27
|
},
|
|
28
28
|
onBarClick: p
|
|
29
|
-
}) : /* @__PURE__ */ r(
|
|
29
|
+
}) : /* @__PURE__ */ r(d, { image: g })
|
|
30
30
|
});
|
|
31
31
|
export {
|
|
32
32
|
S as BillAmountNotStandard
|
package/dist/insights/components/insights/BillAmountNotStandard/BillAmountNotStandardMUI.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ReactComponent as h } from "../../shared/images/EmptyBarChart.es.js";
|
|
2
|
+
import { BarChartV2 as l } from "../../shared/Charts/BarChart/BarChartV2.es.js";
|
|
3
|
+
import { ThemedSVGImage as d } from "../../shared/ThemedSVGImage.es.js";
|
|
4
|
+
import { InsightButton as s } from "../../shared/InsightsCard/InsightButton.es.js";
|
|
5
5
|
import { BeatCardMUI as u } from "../../shared/InsightsCard/BeatCardMUI.es.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
8
|
var S = ({ amounts: m, beat: o, buttonProps: i, color: e, data: t, trendAmountLabel: n, monthlyAmountLabel: a, onBarClick: p, selectedTabIndex: f, ...g }) => /* @__PURE__ */ r(u, {
|
|
9
9
|
...g,
|
|
10
10
|
beat: o,
|
|
11
|
-
button: t?.length > 0 && /* @__PURE__ */ r(
|
|
11
|
+
button: t?.length > 0 && /* @__PURE__ */ r(s, {
|
|
12
12
|
...i,
|
|
13
13
|
beat: o
|
|
14
14
|
}),
|
|
15
|
-
children: t.length > 0 ? /* @__PURE__ */ r(
|
|
15
|
+
children: t.length > 0 ? /* @__PURE__ */ r(l, {
|
|
16
16
|
amounts: m,
|
|
17
17
|
color: e,
|
|
18
18
|
data: t,
|
|
@@ -26,12 +26,12 @@ var S = ({ amounts: m, beat: o, buttonProps: i, color: e, data: t, trendAmountLa
|
|
|
26
26
|
onBarClick: p,
|
|
27
27
|
selectedTabIndex: f,
|
|
28
28
|
trendAmountLabel: n
|
|
29
|
-
}) : /* @__PURE__ */ r(
|
|
29
|
+
}) : /* @__PURE__ */ r(d, {
|
|
30
30
|
divProps: { style: {
|
|
31
31
|
marginLeft: 2,
|
|
32
32
|
marginRight: 2
|
|
33
33
|
} },
|
|
34
|
-
image:
|
|
34
|
+
image: h
|
|
35
35
|
})
|
|
36
36
|
});
|
|
37
37
|
export {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { ReactComponent as g } from "../../shared/images/EmptyBarChart.es.js";
|
|
2
|
+
import { BarChart as h } from "../../shared/Charts/BarChart/BarChart.es.js";
|
|
3
|
+
import { ThemedSVGImage as d } from "../../shared/ThemedSVGImage.es.js";
|
|
4
|
+
import { BeatCard as l } from "../../shared/InsightsCard/BeatCard.es.js";
|
|
5
|
+
import { InsightButton as s } from "../../shared/InsightsCard/InsightButton.es.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
var S = ({ amounts: i, beat: r, buttonProps: n, color: e, data: t, legendLabelAvg: p, legendLabelMain: a, onBarClick: f, ...m }) => /* @__PURE__ */ o(
|
|
8
|
+
var S = ({ amounts: i, beat: r, buttonProps: n, color: e, data: t, legendLabelAvg: p, legendLabelMain: a, onBarClick: f, ...m }) => /* @__PURE__ */ o(l, {
|
|
9
9
|
...m,
|
|
10
10
|
beat: r,
|
|
11
|
-
button: /* @__PURE__ */ o(
|
|
11
|
+
button: /* @__PURE__ */ o(s, {
|
|
12
12
|
...n,
|
|
13
13
|
beat: r
|
|
14
14
|
}),
|
|
15
|
-
children: t.length > 0 ? /* @__PURE__ */ o(
|
|
15
|
+
children: t.length > 0 ? /* @__PURE__ */ o(h, {
|
|
16
16
|
amounts: i,
|
|
17
17
|
color: e,
|
|
18
18
|
data: t,
|
|
@@ -26,7 +26,7 @@ var S = ({ amounts: i, beat: r, buttonProps: n, color: e, data: t, legendLabelAv
|
|
|
26
26
|
top: 24
|
|
27
27
|
},
|
|
28
28
|
onBarClick: f
|
|
29
|
-
}) : /* @__PURE__ */ o(
|
|
29
|
+
}) : /* @__PURE__ */ o(d, { image: g })
|
|
30
30
|
});
|
|
31
31
|
export {
|
|
32
32
|
S as MonthlySpendingComparisonV2
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useGlobalCopyStore as m } from "../../../common/context/hooks.es.js";
|
|
2
2
|
import s from "../../../common/components/Loader.es.js";
|
|
3
|
-
import c from "
|
|
4
|
-
import
|
|
3
|
+
import { useTransactionDetailsBlock as c } from "./useTransactionDetailsBlock.es.js";
|
|
4
|
+
import l from "../../../transactions/components/shared/TransactionDetails.es.js";
|
|
5
5
|
import { observer as f } from "mobx-react-lite";
|
|
6
6
|
import p from "@mui/material/Stack";
|
|
7
7
|
import { Text as d } from "@mxenabled/mxui";
|
|
8
8
|
import { jsx as o } from "react/jsx-runtime";
|
|
9
9
|
var S = f(function({ beat: t }) {
|
|
10
|
-
const { common: i } = m(), { bottomActions: e, isLoading: n, topActions: a, transaction: r } =
|
|
11
|
-
return n ? /* @__PURE__ */ o(s, {}) : r ? /* @__PURE__ */ o(
|
|
10
|
+
const { common: i } = m(), { bottomActions: e, isLoading: n, topActions: a, transaction: r } = c(t);
|
|
11
|
+
return n ? /* @__PURE__ */ o(s, {}) : r ? /* @__PURE__ */ o(l, {
|
|
12
12
|
bottomActions: e,
|
|
13
13
|
shouldShowEmbeddedCard: !1,
|
|
14
14
|
topActions: a,
|
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import { formatCurrency as
|
|
1
|
+
import { useGlobalCopyStore as Z, useGlobalUiStore as tt, useInsightsV2Store as et } from "../../../common/context/hooks.es.js";
|
|
2
|
+
import { formatCurrency as ot } from "../../../core/utils/NumberFormatting.es.js";
|
|
3
3
|
import at from "../../../common/components/drawer/Drawer.es.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { getDefaultSelection as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
import nt from "../../../common/components/Loader.es.js";
|
|
5
|
+
import { BAR_ARIA_LABEL as rt } from "../../blocks/ChartBlocks/BarchartBlock/utils.es.js";
|
|
6
|
+
import { BarChartV2 as it } from "../../components/chartblocks/BarchartV2.es.js";
|
|
7
|
+
import { EmptyBarChart as st } from "../../components/chartblocks/EmptyBarChart.es.js";
|
|
8
|
+
import { ANALYTICS_EVENTS_CONFIG as B } from "../../analytics/analyticsEventsConfig.es.js";
|
|
9
|
+
import { useAnalyticsEvent as lt } from "../../analytics/useAnalyticsEvent.es.js";
|
|
10
|
+
import { TransactionDrillDown as ct } from "./TransactionDrillDown.es.js";
|
|
11
|
+
import { getDefaultSelection as mt, getDrillDownConfig as dt, getFlattenedDataSeries as pt, resolveDrillDownSubHeader as gt, toStoreFilter as ut } from "./utils.es.js";
|
|
12
|
+
import { useTransactionHistory as ft } from "./useTransactionHistory.es.js";
|
|
13
|
+
import { getDynamicCtaBasedOnTriggers as ht } from "../util.es.js";
|
|
14
|
+
import { TransactionDetailsBlock as yt } from "../TransactionDetailsBlock/TransactionDetailsBlock.es.js";
|
|
15
|
+
import { useLayoutEffect as Ct, useState as u } from "react";
|
|
16
|
+
import { observer as bt } from "mobx-react-lite";
|
|
17
|
+
import { Fragment as Tt, jsx as a, jsxs as _t } from "react/jsx-runtime";
|
|
18
|
+
import { useTheme as St } from "@mui/material/styles";
|
|
19
|
+
var Vt = bt(({ beat: o }) => {
|
|
20
|
+
const f = St(), { instanceSlotData: e, beatTransactions: l, spendCategoryGuids: h, allAccountGuids: y, categoryName: x, displayedDateRange: p, transactionStore: E } = ft(o), { actionDrawer: C, setActionContext: b } = et(), { common: I, insights_feed: c } = Z(), { isCopyLoaded: F } = tt(), [G, T] = u(!1), [R, H] = u(!1), _ = lt(), { insights_payload: n } = o, w = ht(C, n?.primary_cta, n?.secondary_cta, n?.in_description_cta)?.variant, { top: r, filterMode: m, header: O, colors: j, filterStrategy: k, tipSection: S } = dt(w ?? ""), { dataSeries: d, chartData: i, comparisonBars: K } = pt({
|
|
20
21
|
data: e?.data_series,
|
|
21
|
-
ariaLabel:
|
|
22
|
+
ariaLabel: rt,
|
|
22
23
|
top: r,
|
|
23
24
|
beatTransactions: l,
|
|
24
25
|
payload: e
|
|
25
|
-
}), { chartBarIndex:
|
|
26
|
+
}), { chartBarIndex: N, subTabIndex: V } = mt({
|
|
26
27
|
chartTabCount: i.length,
|
|
27
|
-
comparisonTabCount:
|
|
28
|
-
actionDrawer:
|
|
29
|
-
beatGuid:
|
|
30
|
-
}), [s, D] = u(
|
|
31
|
-
beat:
|
|
28
|
+
comparisonTabCount: K.length,
|
|
29
|
+
actionDrawer: C,
|
|
30
|
+
beatGuid: o.guid
|
|
31
|
+
}), [s, D] = u(N), A = (t) => k({
|
|
32
|
+
beat: o,
|
|
32
33
|
beatTransactions: l,
|
|
33
34
|
dataSeries: d,
|
|
34
35
|
selectedIndex: t,
|
|
35
|
-
subIndex:
|
|
36
|
+
subIndex: V,
|
|
36
37
|
isLastTab: t === d.length - 1,
|
|
37
38
|
instanceSlotData: e,
|
|
38
39
|
spendCategoryGuids: h,
|
|
39
40
|
displayedDateRange: p
|
|
40
|
-
}),
|
|
41
|
-
m !== "store" || !
|
|
41
|
+
}), M = l.map((t) => t.guid).join(","), P = h.join(","), U = y.join(","), W = r === "list" || d.length > 0, v = () => {
|
|
42
|
+
m !== "store" || !W || E.setFilter(ut(A(s), {
|
|
42
43
|
allAccountGuids: y,
|
|
43
44
|
displayedDateRange: p
|
|
44
45
|
}));
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
+
Ct(() => {
|
|
47
48
|
v();
|
|
48
49
|
}, [
|
|
49
|
-
|
|
50
|
+
o.guid,
|
|
50
51
|
s,
|
|
51
52
|
m,
|
|
52
53
|
d.length,
|
|
53
54
|
e,
|
|
54
55
|
p,
|
|
55
|
-
M,
|
|
56
56
|
P,
|
|
57
|
-
|
|
57
|
+
U,
|
|
58
|
+
M,
|
|
58
59
|
r
|
|
59
60
|
]);
|
|
60
|
-
const g =
|
|
61
|
-
title:
|
|
62
|
-
subHeader:
|
|
61
|
+
const L = gt(n), g = O?.({
|
|
62
|
+
title: n?.title,
|
|
63
|
+
subHeader: L,
|
|
63
64
|
categoryName: x,
|
|
64
65
|
selectedDate: i[s]?.date ?? void 0
|
|
65
|
-
}),
|
|
66
|
-
if (!
|
|
67
|
-
const
|
|
66
|
+
}), Y = j(f, e?.category_guid);
|
|
67
|
+
if (!F) return /* @__PURE__ */ a(nt, {});
|
|
68
|
+
const $ = [c.general.monthly_amount, c.general.trend], [q, z] = e?.legends?.length ? e.legends.map((t) => t.label) : $, J = m === "local" ? (t) => A(t).custom ?? (() => !0) : void 0, Q = m === "local" ? l : void 0, X = r === "singleBar" || r === "upcomingBill" ? i.length ? /* @__PURE__ */ a(it, {
|
|
68
69
|
amounts: {
|
|
69
70
|
average: e?.average_amount,
|
|
70
|
-
formattedAverage:
|
|
71
|
+
formattedAverage: ot(e?.average_amount ?? 0, "0,0.00")
|
|
71
72
|
},
|
|
72
|
-
color:
|
|
73
|
+
color: Y[0] ?? f.palette.primary.main,
|
|
73
74
|
data: i,
|
|
74
75
|
legendPosition: "top",
|
|
75
76
|
heightOverride: 142,
|
|
@@ -79,20 +80,19 @@ var kt = ht(({ beat: a }) => {
|
|
|
79
80
|
left: 24,
|
|
80
81
|
right: 24
|
|
81
82
|
},
|
|
82
|
-
monthlyAmountLabel:
|
|
83
|
+
monthlyAmountLabel: q,
|
|
83
84
|
onBarClick: (t) => {
|
|
84
|
-
_(
|
|
85
|
+
_(B.DRAWER_CHART_BAR_CLICKED), D(t);
|
|
85
86
|
},
|
|
86
87
|
selectedTabIndex: s,
|
|
87
|
-
trendAmountLabel:
|
|
88
|
-
}) : /* @__PURE__ */
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
91
|
-
baseTransactions: J,
|
|
88
|
+
trendAmountLabel: z
|
|
89
|
+
}) : /* @__PURE__ */ a(st, {}) : null;
|
|
90
|
+
return /* @__PURE__ */ _t(Tt, { children: [/* @__PURE__ */ a(ct, {
|
|
91
|
+
baseTransactions: Q,
|
|
92
92
|
heading: g?.heading,
|
|
93
93
|
icon: g?.icon,
|
|
94
94
|
onSelectionChange: (t) => {
|
|
95
|
-
_(
|
|
95
|
+
_(B.TAB_SELECTED), D(t);
|
|
96
96
|
},
|
|
97
97
|
selectedIndex: s,
|
|
98
98
|
subHeadingText: g?.subHeadingText,
|
|
@@ -100,24 +100,24 @@ var kt = ht(({ beat: a }) => {
|
|
|
100
100
|
ariaLabel: t.ariaLabel,
|
|
101
101
|
label: t.label
|
|
102
102
|
})),
|
|
103
|
-
top:
|
|
104
|
-
...S && { tipSection: !
|
|
105
|
-
transactionFilter:
|
|
103
|
+
top: X,
|
|
104
|
+
...S && { tipSection: !R && S(H, c, L?.text) },
|
|
105
|
+
transactionFilter: J,
|
|
106
106
|
onEachRowClick: (t) => {
|
|
107
|
-
|
|
107
|
+
b({ transaction_guid: t }), T(!0);
|
|
108
108
|
}
|
|
109
|
-
}), /* @__PURE__ */
|
|
110
|
-
ariaLabelClose:
|
|
111
|
-
isOpen:
|
|
109
|
+
}), /* @__PURE__ */ a(at, {
|
|
110
|
+
ariaLabelClose: I.close_aria,
|
|
111
|
+
isOpen: G,
|
|
112
112
|
onClose: () => {
|
|
113
|
-
T(!1),
|
|
113
|
+
T(!1), b({ transaction_guid: void 0 }), v();
|
|
114
114
|
},
|
|
115
115
|
title: c.general.transaction_details_title,
|
|
116
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ a(yt, { beat: o })
|
|
117
117
|
})] });
|
|
118
118
|
});
|
|
119
119
|
export {
|
|
120
|
-
|
|
120
|
+
Vt as TransactionHistoryBlock
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
//# sourceMappingURL=TransactionHistoryBlock.es.js.map
|
package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, Transaction } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n toStoreFilter,\n} from './utils'\nimport {\n Drawer,\n useInsightsV2Store,\n useGlobalCopyStore,\n useGlobalUiStore,\n Loader,\n} from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(beat)\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { isCopyLoaded } = useGlobalUiStore()\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { insights_payload } = beat\n\n const dynamicCtaVariant = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n insights_payload?.primary_cta,\n insights_payload?.secondary_cta,\n insights_payload?.in_description_cta,\n )?.variant\n\n const { top, filterMode, header, colors, filterStrategy, tipSection } = getDrillDownConfig(\n dynamicCtaVariant ?? '',\n )\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel: instanceSlotData?.ariaLabel ?? '',\n top,\n beatTransactions,\n payload: instanceSlotData,\n })\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n selectedIndex: index,\n subIndex: subTabIndex,\n isLastTab: index === dataSeries.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Apply the current selection's filter. Store variants route through the store filter; local\n // (upcomingBill) variants filter beatTransactions directly and only backfill the cache when the\n // Stable primitive keys for the collections below: beatTransactions/spendCategoryGuids/\n // allAccountGuids are recomputed (new array identity) every render, so depending on them directly\n // re-fires the effect each render (REVIEW.md MEW-3732). Key on content instead.\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applies the current selection's filter to the shared transactionStore. Called both by the\n // effect below (on selection change) and when the nested TransactionDetailsBlock drawer closes:\n // AddMerchantBudgetAction (opened from within that drawer) overwrites transactionStore.filter\n // with a merchant_guid-only filter while its own drawer is open, and never restores it — leaving\n // the row list stuck showing only that one merchant's transactions after backing all the way out.\n // Re-running this on close re-derives the filter fresh instead of relying on whatever the nested\n // drawers left behind.\n // A `list` drawer has no bars: it filters once from the beat alone.\n const canApplyFilter = top === 'list' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store' || !canApplyFilter) return\n transactionStore.setFilter(\n toStoreFilter(resolveFilter(selectedIndex), { allAccountGuids, displayedDateRange }),\n )\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader: insights_payload?.sub_title,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n if (!isCopyLoaded) return <Loader />\n\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every beat/variant.\n // Remove this once the backend guarantees `legends` on the payload.\n const legendFallbackLabels = [insightsCopy.general.monthly_amount, insightsCopy.general.trend]\n\n const [monthlyAmountLabel, trendAmountLabel] = instanceSlotData?.legends?.length\n ? instanceSlotData.legends.map((legend) => legend.label)\n : legendFallbackLabels\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? beatTransactions : undefined\n\n const isBarTop = top === 'singleBar' || top === 'upcomingBill'\n const chartTop = !isBarTop ? null : chartData.length ? (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(instanceSlotData?.average_amount ?? 0, '0,0.00'),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n heightOverride={142}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n monthlyAmountLabel={monthlyAmountLabel}\n onBarClick={(index) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n }}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={trendAmountLabel}\n />\n ) : (\n <EmptyBarChart />\n )\n\n return (\n <>\n <TransactionDrillDown\n ariaLabel={instanceSlotData?.ariaLabel}\n baseTransactions={baseTransactions}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={(index) => {\n // MUI Tabs only fires onChange on real user selection, not on mount.\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={chartData.map((bar) => ({\n ariaLabel: bar.ariaLabel,\n label: bar.label,\n }))}\n top={chartTop}\n {...(tipSection && {\n tipSection:\n !closeTipSection &&\n tipSection(setCloseTipSection, insightsCopy, insights_payload?.sub_title?.text),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,IAAa,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IAAQ,GAAS,GACjB,EACJ,kBAAA,GACA,kBAAA,GACA,oBAAA,GACA,iBAAA,GACA,cAAA,GACA,oBAAA,GACA,kBAAA,EAAA,IACE,GAAsB,CA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AA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
1
|
+
{"version":3,"file":"TransactionHistoryBlock.es.js","names":[],"sources":["../../../../src/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.tsx"],"sourcesContent":["import { useLayoutEffect, useState } from 'react'\n\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport type { Beat, DataSeries, Transaction } from '../../../core'\nimport { formatCurrency } from '../../../core/utils/NumberFormatting'\nimport { ANALYTICS_EVENTS_CONFIG, useAnalyticsEvent } from '../../analytics'\nimport { BarChartV2 } from '../../components/chartblocks/BarchartV2'\nimport { EmptyBarChart } from '../../components/chartblocks/EmptyBarChart'\nimport { BAR_ARIA_LABEL } from '../../blocks/ChartBlocks/BarchartBlock/utils'\n\nimport { TransactionDrillDown } from './TransactionDrillDown'\nimport { useTransactionHistory } from './useTransactionHistory'\nimport {\n getDefaultSelection,\n getDrillDownConfig,\n getFlattenedDataSeries,\n resolveDrillDownSubHeader,\n toStoreFilter,\n} from './utils'\nimport {\n Drawer,\n useInsightsV2Store,\n useGlobalCopyStore,\n useGlobalUiStore,\n Loader,\n} from '../../../common'\nimport { TransactionDetailsBlock } from '../TransactionDetailsBlock'\nimport { getDynamicCtaBasedOnTriggers } from '../util'\n\ninterface TransactionHistoryProp {\n beat: Beat\n}\n\nexport const TransactionHistoryBlock = observer(({ beat }: TransactionHistoryProp) => {\n const theme = useTheme()\n const {\n instanceSlotData,\n beatTransactions,\n spendCategoryGuids,\n allAccountGuids,\n categoryName,\n displayedDateRange,\n transactionStore,\n } = useTransactionHistory(beat)\n\n const { actionDrawer, setActionContext } = useInsightsV2Store()\n\n const { common: commonCopy, insights_feed: insightsCopy } = useGlobalCopyStore()\n\n const { isCopyLoaded } = useGlobalUiStore()\n\n const [isTransactionDetailsOpen, setIsTransactionDetailsOpen] = useState(false)\n\n const [closeTipSection, setCloseTipSection] = useState(false)\n\n const fireAnalyticsEvent = useAnalyticsEvent()\n\n const { insights_payload } = beat\n\n const dynamicCtaVariant = getDynamicCtaBasedOnTriggers(\n actionDrawer,\n insights_payload?.primary_cta,\n insights_payload?.secondary_cta,\n insights_payload?.in_description_cta,\n )?.variant\n\n const { top, filterMode, header, colors, filterStrategy, tipSection } = getDrillDownConfig(\n dynamicCtaVariant ?? '',\n )\n\n const { dataSeries, chartData, comparisonBars } = getFlattenedDataSeries({\n data: instanceSlotData?.data_series as DataSeries,\n ariaLabel: BAR_ARIA_LABEL,\n top,\n beatTransactions,\n payload: instanceSlotData,\n })\n\n const { chartBarIndex, subTabIndex } = getDefaultSelection({\n chartTabCount: chartData.length,\n comparisonTabCount: comparisonBars.length,\n actionDrawer,\n beatGuid: beat.guid,\n })\n\n const [selectedIndex, setSelectedIndex] = useState(chartBarIndex)\n\n const resolveFilter = (index: number) =>\n filterStrategy({\n beat,\n beatTransactions,\n dataSeries,\n selectedIndex: index,\n subIndex: subTabIndex,\n isLastTab: index === dataSeries.length - 1,\n instanceSlotData,\n spendCategoryGuids,\n displayedDateRange,\n })\n\n // Apply the current selection's filter. Store variants route through the store filter; local\n // (upcomingBill) variants filter beatTransactions directly and only backfill the cache when the\n // Stable primitive keys for the collections below: beatTransactions/spendCategoryGuids/\n // allAccountGuids are recomputed (new array identity) every render, so depending on them directly\n // re-fires the effect each render (REVIEW.md MEW-3732). Key on content instead.\n const beatTransactionGuidsKey = beatTransactions.map((transaction) => transaction.guid).join(',')\n const spendCategoryGuidsKey = spendCategoryGuids.join(',')\n const allAccountGuidsKey = allAccountGuids.join(',')\n\n // Re-applies the current selection's filter to the shared transactionStore. Called both by the\n // effect below (on selection change) and when the nested TransactionDetailsBlock drawer closes:\n // AddMerchantBudgetAction (opened from within that drawer) overwrites transactionStore.filter\n // with a merchant_guid-only filter while its own drawer is open, and never restores it — leaving\n // the row list stuck showing only that one merchant's transactions after backing all the way out.\n // Re-running this on close re-derives the filter fresh instead of relying on whatever the nested\n // drawers left behind.\n // A `list` drawer has no bars: it filters once from the beat alone.\n const canApplyFilter = top === 'list' || dataSeries.length > 0\n const applyCurrentSelectionFilter = () => {\n if (filterMode !== 'store' || !canApplyFilter) return\n transactionStore.setFilter(\n toStoreFilter(resolveFilter(selectedIndex), { allAccountGuids, displayedDateRange }),\n )\n }\n\n // store variants route the selection through the shared store filter; local (upcomingBill) variants\n // filter beatTransactions directly, so there's nothing to push to the store for them.\n useLayoutEffect(() => {\n applyCurrentSelectionFilter()\n }, [\n beat.guid,\n selectedIndex,\n filterMode,\n dataSeries.length,\n instanceSlotData,\n displayedDateRange,\n spendCategoryGuidsKey,\n allAccountGuidsKey,\n beatTransactionGuidsKey,\n top,\n ])\n\n const subHeader = resolveDrillDownSubHeader(insights_payload)\n\n const headerContent = header?.({\n title: insights_payload?.title,\n subHeader,\n categoryName,\n selectedDate: chartData[selectedIndex]?.date ?? undefined,\n })\n\n const barColors = colors(theme, instanceSlotData?.category_guid)\n\n if (!isCopyLoaded) return <Loader />\n\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every beat/variant.\n // Remove this once the backend guarantees `legends` on the payload.\n const legendFallbackLabels = [insightsCopy.general.monthly_amount, insightsCopy.general.trend]\n\n const [monthlyAmountLabel, trendAmountLabel] = instanceSlotData?.legends?.length\n ? instanceSlotData.legends.map((legend) => legend.label)\n : legendFallbackLabels\n\n const transactionFilter =\n filterMode === 'local'\n ? (index: number) => resolveFilter(index).custom ?? (() => true)\n : undefined\n\n const baseTransactions: Transaction[] | undefined =\n filterMode === 'local' ? beatTransactions : undefined\n\n const isBarTop = top === 'singleBar' || top === 'upcomingBill'\n const chartTop = !isBarTop ? null : chartData.length ? (\n <BarChartV2\n amounts={{\n average: instanceSlotData?.average_amount,\n formattedAverage: formatCurrency(instanceSlotData?.average_amount ?? 0, '0,0.00'),\n }}\n color={barColors[0] ?? theme.palette.primary.main}\n data={chartData}\n legendPosition=\"top\"\n heightOverride={142}\n margin={{\n bottom: 8,\n top: 24,\n left: 24,\n right: 24,\n }}\n monthlyAmountLabel={monthlyAmountLabel}\n onBarClick={(index) => {\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.DRAWER_CHART_BAR_CLICKED)\n setSelectedIndex(index)\n }}\n selectedTabIndex={selectedIndex}\n trendAmountLabel={trendAmountLabel}\n />\n ) : (\n <EmptyBarChart />\n )\n\n return (\n <>\n <TransactionDrillDown\n baseTransactions={baseTransactions}\n heading={headerContent?.heading}\n icon={headerContent?.icon}\n onSelectionChange={(index) => {\n // MUI Tabs only fires onChange on real user selection, not on mount.\n fireAnalyticsEvent(ANALYTICS_EVENTS_CONFIG.TAB_SELECTED)\n setSelectedIndex(index)\n }}\n selectedIndex={selectedIndex}\n subHeadingText={headerContent?.subHeadingText}\n tabs={chartData.map((bar) => ({\n ariaLabel: bar.ariaLabel,\n label: bar.label,\n }))}\n top={chartTop}\n {...(tipSection && {\n tipSection:\n !closeTipSection && tipSection(setCloseTipSection, insightsCopy, subHeader?.text),\n })}\n transactionFilter={transactionFilter}\n onEachRowClick={(guid) => {\n setActionContext({ transaction_guid: guid })\n setIsTransactionDetailsOpen(true)\n }}\n />\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isTransactionDetailsOpen}\n onClose={() => {\n setIsTransactionDetailsOpen(false)\n // Clear only the key this nested drawer owns — setActionContext merges, so an\n // explicit `{}` would be a no-op and leave transaction_guid stuck in the shared\n // context, and the outer drawer's own context (e.g. chartBarIndex) must survive.\n setActionContext({ transaction_guid: undefined })\n // Re-apply this block's own filter: a further-nested AddMerchantBudgetAction drawer may\n // have overwritten transactionStore.filter (merchant_guid-only) without restoring it.\n applyCurrentSelectionFilter()\n }}\n title={insightsCopy.general.transaction_details_title}\n >\n <TransactionDetailsBlock beat={beat} />\n </Drawer>\n </>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,IAAa,KAA0B,GAAA,CAAU,EAAE,MAAA,EAAA,MAAmC;AACpF,QAAM,IA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AGhD,EAA4B;AAAA,IAC9B;AAAA,IACA,OAAO,EAAa,QAAQ;AAAA,IAE5B,UAAA,gBAAA,EAAC,IAAD,EAA+B,MAAA,EAAO,CAAA;AAAA,EAChC,CAAA,CACR,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Beat } from '../../../core';
|
|
2
|
-
import { InsightsInstanceSlotData } from '../../../core/types/InsightsInstanceSlotData';
|
|
3
2
|
export declare const useTransactionHistory: (beat: Beat) => {
|
|
4
|
-
instanceSlotData:
|
|
3
|
+
instanceSlotData: import('./utils').DrillDownSlotData;
|
|
5
4
|
beatTransactions: import('../../../core').Transaction[];
|
|
6
|
-
primaryTransaction: import('../../../core').Transaction | undefined;
|
|
7
5
|
spendCategoryGuids: string[];
|
|
8
6
|
allAccountGuids: string[];
|
|
9
7
|
categoryName: string;
|