@mx-cartographer/experiences 9.4.58 → 9.4.60
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 +42 -1
- package/dist/core/api/BeatApi.d.ts +6 -0
- package/dist/core/api/BeatApi.es.js +1 -1
- package/dist/core/api/BeatApi.es.js.map +1 -1
- package/dist/core/api/UserApi.d.ts +2 -1
- package/dist/core/api/UserApi.es.js +6 -5
- package/dist/core/api/UserApi.es.js.map +1 -1
- 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/stores/AccountStore.d.ts +2 -1
- package/dist/core/stores/AccountStore.es.js +16 -16
- package/dist/core/stores/AccountStore.es.js.map +1 -1
- package/dist/core/stores/BeatStore.d.ts +6 -0
- package/dist/core/stores/BeatStore.es.js +30 -17
- package/dist/core/stores/BeatStore.es.js.map +1 -1
- package/dist/core/stores/BudgetsStore.d.ts +2 -1
- package/dist/core/stores/BudgetsStore.es.js +8 -8
- package/dist/core/stores/BudgetsStore.es.js.map +1 -1
- package/dist/core/stores/CategoryStore.d.ts +7 -0
- package/dist/core/stores/CategoryStore.es.js +18 -7
- package/dist/core/stores/CategoryStore.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/stores/SettingsStore.d.ts +2 -1
- package/dist/core/stores/SettingsStore.es.js +11 -11
- package/dist/core/stores/SettingsStore.es.js.map +1 -1
- package/dist/core/stores/TransactionStore.d.ts +4 -2
- package/dist/core/stores/TransactionStore.es.js +6 -6
- package/dist/core/stores/TransactionStore.es.js.map +1 -1
- package/dist/core/stores/UserStore.d.ts +15 -1
- package/dist/core/stores/UserStore.es.js +21 -3
- package/dist/core/stores/UserStore.es.js.map +1 -1
- package/dist/core/types/Beat.d.ts +6 -0
- package/dist/core/types/Beat.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +127 -5
- package/dist/core/types/InsightsInstanceSlotData.d.ts +1 -13
- package/dist/core/types/InsightsInstanceSlotData.es.js.map +1 -1
- package/dist/core/types/RepeatingTransaction.d.ts +2 -0
- package/dist/core/types/RepeatingTransaction.es.js.map +1 -1
- package/dist/core/types/User.d.ts +11 -0
- package/dist/core/types/index.d.ts +2 -3
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.d.ts +31 -0
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js +22 -0
- package/dist/insights-v2/actionBlocks/ContactSupportActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.d.ts +10 -9
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js +7 -7
- package/dist/insights-v2/actionBlocks/TransactionDetailsBlock/useTransactionDetailsBlock.es.js.map +1 -1
- package/dist/insights-v2/beatActions.d.ts +7 -0
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +8 -8
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.d.ts +30 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +67 -24
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/index.d.ts +1 -1
- package/dist/insights-v2/components/BadgedTile.d.ts +22 -0
- package/dist/insights-v2/components/BadgedTile.es.js +46 -0
- package/dist/insights-v2/components/BadgedTile.es.js.map +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +113 -92
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CompactInsightCard.d.ts +31 -0
- package/dist/insights-v2/components/CompactInsightCard.es.js +129 -0
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -0
- package/dist/insights-v2/components/Footer.d.ts +1 -4
- package/dist/insights-v2/components/Footer.es.js +30 -21
- package/dist/insights-v2/components/Footer.es.js.map +1 -1
- package/dist/insights-v2/components/Header.es.js +10 -10
- package/dist/insights-v2/components/Header.es.js.map +1 -1
- package/dist/insights-v2/components/InsightErrorCard.d.ts +19 -0
- package/dist/insights-v2/components/InsightErrorCard.es.js +45 -0
- package/dist/insights-v2/components/InsightErrorCard.es.js.map +1 -0
- package/dist/insights-v2/components/InsightTransactionRow.es.js +19 -15
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/LogoFromGuid.d.ts +26 -0
- package/dist/insights-v2/components/LogoFromGuid.es.js +48 -0
- package/dist/insights-v2/components/LogoFromGuid.es.js.map +1 -0
- package/dist/insights-v2/components/StatusBadge.d.ts +16 -0
- package/dist/insights-v2/components/StatusBadge.es.js +29 -0
- package/dist/insights-v2/components/StatusBadge.es.js.map +1 -0
- package/dist/insights-v2/components/StatusPill.d.ts +11 -2
- package/dist/insights-v2/components/StatusPill.es.js +25 -13
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubHeader.es.js +7 -5
- package/dist/insights-v2/components/SubHeader.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +11 -11
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/EntityLogo.d.ts +26 -0
- package/dist/insights-v2/components/shared/EntityLogo.es.js +33 -0
- package/dist/insights-v2/components/shared/EntityLogo.es.js.map +1 -0
- package/dist/insights-v2/index.d.ts +6 -0
- package/dist/insights-v2/index.es.js +95 -81
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +2 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +50 -44
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/insights-v2/resolveInsightRender.d.ts +30 -0
- package/dist/insights-v2/resolveInsightRender.es.js +10 -0
- package/dist/insights-v2/resolveInsightRender.es.js.map +1 -0
- package/dist/microinsights/cards/InsightCard.es.js +83 -39
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/carousel/BeatList.es.js +24 -24
- package/dist/microinsights/carousel/BeatList.es.js.map +1 -1
- package/dist/notifications/components/NotificationBadge.es.js +12 -10
- package/dist/notifications/components/NotificationBadge.es.js.map +1 -1
- package/dist/notifications/components/NotificationCard.es.js +27 -18
- package/dist/notifications/components/NotificationCard.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionDetails.d.ts +7 -0
- package/dist/transactions/components/shared/TransactionDetails.es.js +159 -143
- package/dist/transactions/components/shared/TransactionDetails.es.js.map +1 -1
- package/dist/transactions/components/shared/TransactionInsightTag.d.ts +26 -0
- package/dist/transactions/components/shared/TransactionInsightTag.es.js +53 -0
- package/dist/transactions/components/shared/TransactionInsightTag.es.js.map +1 -0
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js +30 -39
- package/dist/transactions/components/shared/transactionlist/TransactionRow.es.js.map +1 -1
- package/dist/transactions/components/shared/transactiontable/cells/AmountCell.es.js +15 -15
- package/dist/transactions/components/shared/transactiontable/cells/AmountCell.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,75 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import M from "../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { resolveInsightRender as k } from "../../insights-v2/resolveInsightRender.es.js";
|
|
2
|
+
import x from "../../insights-v2/components/LogoFromGuid.es.js";
|
|
3
|
+
import B from "../../insights-v2/components/InsightErrorCard.es.js";
|
|
4
|
+
import { ON_CLICK_EVENT as M, ON_VIEW_EVENT as R, ON_VIEW_FIRST_TIME_EVENT as W } from "../constants/Analytics.es.js";
|
|
5
|
+
import S from "../beaticons/BeatMaterialIcon.es.js";
|
|
6
|
+
import { BeatIcon as F } from "../beaticons/BeatIcon.es.js";
|
|
7
|
+
import { useCopyStore as O, useEvent as P, useInsightsMicroWidgetStore as A } from "../context/hooks.es.js";
|
|
8
|
+
import E from "../MicroCardTemplate.es.js";
|
|
9
|
+
import { useEffect as I } from "react";
|
|
10
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
11
|
+
import { alpha as j, useTheme as v } from "@mui/material/styles";
|
|
12
|
+
import w from "@mui/material/Box";
|
|
13
|
+
import { useInView as z } from "react-intersection-observer";
|
|
14
|
+
var G = 32, ei = ({ ariaLabel: l, beat: i, elevation: g, index: s, isActiveCard: c, onCardClick: u, posthog: o, widthOverrides: m, variant: f, showIcon: h, heightOverrides: a }) => {
|
|
15
|
+
const { ref: _, inView: n } = z({ threshold: 1 }), C = v(), { cardsCopy: T } = O(), { onEvent: d } = P(), { updateBeat: N, updateOffer: V } = A();
|
|
16
|
+
I(() => {
|
|
17
|
+
n && (i.has_been_displayed ? d(R(i.template)) : (i.guid.startsWith("OFR") ? V({
|
|
12
18
|
...i,
|
|
13
19
|
has_been_displayed: !0
|
|
14
|
-
}) :
|
|
20
|
+
}) : N({
|
|
15
21
|
...i,
|
|
16
22
|
has_been_displayed: !0
|
|
17
|
-
}),
|
|
18
|
-
}, [
|
|
19
|
-
if (
|
|
23
|
+
}), d(W(i.template))));
|
|
24
|
+
}, [n]), I(() => {
|
|
25
|
+
if (n && i) if (i.template === "MarketingOffer") {
|
|
20
26
|
const e = i;
|
|
21
|
-
|
|
27
|
+
o?.capture("viewed_messaging_insight", {
|
|
22
28
|
template: i.template,
|
|
23
29
|
campaign_guid: e.campaign_guid,
|
|
24
30
|
campaign_name: e.pulse_campaign_name,
|
|
25
31
|
offer_guid: e.guid,
|
|
26
32
|
user_guid: e.user_guid
|
|
27
33
|
});
|
|
28
|
-
} else
|
|
34
|
+
} else o?.capture("viewed_insight", {
|
|
29
35
|
beat_guid: i.guid,
|
|
30
36
|
template: i.template,
|
|
31
|
-
position:
|
|
37
|
+
position: s
|
|
32
38
|
});
|
|
33
39
|
}, [
|
|
34
40
|
i,
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
s,
|
|
42
|
+
n
|
|
37
43
|
]);
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
44
|
+
const p = () => {
|
|
45
|
+
if (u && u(i), d(M(i.template)), i.template === "MarketingOffer") {
|
|
40
46
|
const e = i;
|
|
41
|
-
|
|
47
|
+
o?.capture("clicked_messaging_insight", {
|
|
42
48
|
template: i.template,
|
|
43
49
|
campaign_guid: e.campaign_guid,
|
|
44
50
|
campaign_name: e.pulse_campaign_name,
|
|
45
51
|
offer_guid: e.guid,
|
|
46
52
|
user_guid: e.user_guid
|
|
47
53
|
});
|
|
48
|
-
} else
|
|
54
|
+
} else o?.capture("clicked_insight", {
|
|
49
55
|
beat_guid: i.guid,
|
|
50
56
|
template: i.template,
|
|
51
|
-
position:
|
|
57
|
+
position: s
|
|
52
58
|
});
|
|
53
|
-
};
|
|
54
|
-
return /* @__PURE__ */
|
|
59
|
+
}, y = k(i), t = y === "v2" ? i.insights_payload : void 0;
|
|
60
|
+
if (y === "error") return /* @__PURE__ */ r(w, {
|
|
61
|
+
"aria-hidden": !c,
|
|
62
|
+
"aria-label": l,
|
|
55
63
|
"aria-roledescription": "slide",
|
|
56
|
-
|
|
64
|
+
ref: _,
|
|
65
|
+
role: "group",
|
|
66
|
+
sx: {
|
|
67
|
+
height: a ? "100%" : 120,
|
|
68
|
+
minWidth: m ? `${m}px` : "100%",
|
|
69
|
+
my: 1
|
|
70
|
+
},
|
|
71
|
+
children: /* @__PURE__ */ r(B, { beat: i })
|
|
72
|
+
});
|
|
73
|
+
if (t) {
|
|
74
|
+
const e = t.instance_slot.data_series?.[0]?.logo;
|
|
75
|
+
return /* @__PURE__ */ r(E, {
|
|
76
|
+
"aria-roledescription": "slide",
|
|
77
|
+
ariaLabel: l,
|
|
78
|
+
description: t.description.html_text,
|
|
79
|
+
elevation: g,
|
|
80
|
+
heightOverrides: a,
|
|
81
|
+
icon: h && (e ? /* @__PURE__ */ r(x, {
|
|
82
|
+
logo: e,
|
|
83
|
+
size: G
|
|
84
|
+
}) : /* @__PURE__ */ r(S, {
|
|
85
|
+
bgColor: j(C.palette.primary.main, 0.15),
|
|
86
|
+
name: "lightbulb"
|
|
87
|
+
})),
|
|
88
|
+
isActiveCard: c,
|
|
89
|
+
onCardClick: p,
|
|
90
|
+
onPrimaryAction: p,
|
|
91
|
+
primaryActionText: t.primary_cta?.label,
|
|
92
|
+
ref: _,
|
|
93
|
+
title: t.title ?? "",
|
|
94
|
+
variant: f,
|
|
95
|
+
widthOverrides: m
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ r(E, {
|
|
99
|
+
"aria-roledescription": "slide",
|
|
100
|
+
ariaLabel: l,
|
|
57
101
|
description: i?.html_micro_description && i?.html_micro_description.length > 0 ? i.html_micro_description : i.html_description || "",
|
|
58
|
-
elevation:
|
|
59
|
-
heightOverrides:
|
|
60
|
-
icon:
|
|
61
|
-
isActiveCard:
|
|
62
|
-
onCardClick:
|
|
63
|
-
onPrimaryAction:
|
|
64
|
-
primaryActionText: i.micro_call_to_action ||
|
|
65
|
-
ref:
|
|
102
|
+
elevation: g,
|
|
103
|
+
heightOverrides: a,
|
|
104
|
+
icon: h && /* @__PURE__ */ r(F, { beat: i }),
|
|
105
|
+
isActiveCard: c,
|
|
106
|
+
onCardClick: p,
|
|
107
|
+
onPrimaryAction: p,
|
|
108
|
+
primaryActionText: i.micro_call_to_action || T?.micro_card_cta,
|
|
109
|
+
ref: _,
|
|
66
110
|
title: i.micro_title && i.micro_title.length > 0 ? i.micro_title : i.title,
|
|
67
|
-
variant:
|
|
68
|
-
widthOverrides:
|
|
111
|
+
variant: f,
|
|
112
|
+
widthOverrides: m
|
|
69
113
|
});
|
|
70
114
|
};
|
|
71
115
|
export {
|
|
72
|
-
|
|
116
|
+
ei as InsightCard
|
|
73
117
|
};
|
|
74
118
|
|
|
75
119
|
//# sourceMappingURL=InsightCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect } from 'react'\nimport { useInView } from 'react-intersection-observer'\n\nimport { BeatIcon } from '../beaticons'\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 { VIEW_THRESHOLD } from '../constants/App'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\nimport MicroCardTemplate from '../MicroCardTemplate'\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 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 // *************** Context functions *********************\n const { cardsCopy } = useCopyStore()\n const { onEvent } = useEvent()\n const { updateBeat, updateOffer } = useInsightsMicroWidgetStore()\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))\n } else {\n onEvent(ON_VIEW_EVENT(beat.template))\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 })\n }\n }\n }, [beat, index, inView])\n\n // *************** Click handlers ************************\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template))\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 })\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":"
|
|
1
|
+
{"version":3,"file":"InsightCard.es.js","names":[],"sources":["../../../src/microinsights/cards/InsightCard.tsx"],"sourcesContent":["import React, { useEffect } 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 { VIEW_THRESHOLD } from '../constants/App'\n\nimport type { BeatLikeOffer, MicroInsightCardProps } from '../interfaces'\nimport type { Beat } from '../../core/types/Beat'\nimport MicroCardTemplate from '../MicroCardTemplate'\n// Leaf imports on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its charts.\nimport InsightErrorCard from '../../insights-v2/components/InsightErrorCard'\nimport LogoFromGuid from '../../insights-v2/components/LogoFromGuid'\nimport { resolveInsightRender } from '../../insights-v2/resolveInsightRender'\n\n/** The legacy micro card's icon tile size (BeatMaterialIcon). */\nconst ICON_SIZE = 32\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 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 // ************** 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))\n } else {\n onEvent(ON_VIEW_EVENT(beat.template))\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 })\n }\n }\n }, [beat, index, inView])\n\n // *************** Click handlers ************************\n const handleClick = () => {\n /* eslint-disable no-unused-expressions */\n onCardClick && onCardClick(beat)\n onEvent(ON_CLICK_EVENT(beat.template))\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 })\n }\n }\n\n const insightRender = resolveInsightRender(beat as Beat)\n const v2Payload = insightRender === 'v2' ? beat.insights_payload : undefined\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: widthOverrides ? `${widthOverrides}px` : '100%',\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 first slot row's logo on the left (merchant, or the category without one), title, description,\n // and the primary CTA as a link. The logo falls back to the insight glyph when the slot has no row.\n const rowLogo = v2Payload.instance_slot.data_series?.[0]?.logo\n\n return (\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 (rowLogo ? (\n <LogoFromGuid logo={rowLogo} size={ICON_SIZE} />\n ) : (\n <BeatMaterialIcon bgColor={alpha(theme.palette.primary.main, 0.15)} name=\"lightbulb\" />\n ))\n }\n isActiveCard={isActiveCard}\n onCardClick={handleClick}\n onPrimaryAction={handleClick}\n primaryActionText={v2Payload.primary_cta?.label}\n ref={ref}\n title={v2Payload.title ?? ''}\n variant={variant}\n widthOverrides={widthOverrides}\n />\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":"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"}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { buildDynamicCopy as
|
|
1
|
+
import { buildDynamicCopy as x } from "../../core/utils/Localization.es.js";
|
|
2
2
|
import { useCopyStore as M } from "../context/hooks.es.js";
|
|
3
|
-
import { InsightCard as
|
|
4
|
-
import
|
|
3
|
+
import { InsightCard as P } from "../cards/InsightCard.es.js";
|
|
4
|
+
import w from "../cards/ViewMoreMicroCard.es.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { Fragment as D, jsx as
|
|
7
|
-
var
|
|
8
|
-
const { carouselCopy: g } = M(),
|
|
9
|
-
elevation:
|
|
10
|
-
heightOverrides:
|
|
11
|
-
posthog:
|
|
12
|
-
showIcon:
|
|
13
|
-
variant:
|
|
6
|
+
import { Fragment as D, jsx as l, jsxs as L } from "react/jsx-runtime";
|
|
7
|
+
var I = ({ activeCardIndex: s, beats: r, cardWidth: n, elevation: a, heightOverrides: m, onCardClick: e, posthog: p, showIcon: d, variant: _ }) => {
|
|
8
|
+
const { carouselCopy: g } = M(), c = {
|
|
9
|
+
elevation: a,
|
|
10
|
+
heightOverrides: m,
|
|
11
|
+
posthog: p,
|
|
12
|
+
showIcon: d,
|
|
13
|
+
variant: _
|
|
14
14
|
};
|
|
15
15
|
return /* @__PURE__ */ L(D, { children: [r.map((i, o) => {
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
ariaLabel: `${
|
|
16
|
+
const h = o + 1, u = r.length + 1, v = x(g?.card_position_in_carousel_aria, h.toString(), u.toString()), f = i.micro_title && i.micro_title.length > 0, y = i.micro_description && i.micro_description.length > 0, t = i.is_insights_v2 ? i.insights_payload : void 0, $ = t ? t.title : f ? i.micro_title : i.title, C = t ? t.description?.text : y ? i.micro_description : i.description;
|
|
17
|
+
return /* @__PURE__ */ l(P, {
|
|
18
|
+
ariaLabel: `${v}: ${$}, ${C}`,
|
|
19
19
|
beat: i,
|
|
20
20
|
index: o,
|
|
21
|
-
isActiveCard: o ===
|
|
22
|
-
onCardClick:
|
|
23
|
-
widthOverrides:
|
|
24
|
-
...
|
|
21
|
+
isActiveCard: o === s,
|
|
22
|
+
onCardClick: e,
|
|
23
|
+
widthOverrides: n || void 0,
|
|
24
|
+
...c
|
|
25
25
|
}, `${i.guid} ${o}`);
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
isActiveCard:
|
|
28
|
-
onCardClick:
|
|
29
|
-
widthOverrides:
|
|
30
|
-
...
|
|
26
|
+
}), /* @__PURE__ */ l(w, {
|
|
27
|
+
isActiveCard: s === r.length,
|
|
28
|
+
onCardClick: e,
|
|
29
|
+
widthOverrides: n || void 0,
|
|
30
|
+
...c
|
|
31
31
|
})] });
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
I as default
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
//# sourceMappingURL=BeatList.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeatList.es.js","names":[],"sources":["../../../src/microinsights/carousel/BeatList.tsx"],"sourcesContent":["import React from 'react'\n\nimport { InsightCard, ViewMoreMicroCard } from '..'\nimport type { MicroInsightCardProps } from '../interfaces'\n\nimport { useCopyStore } from '../context/hooks'\n\nimport type { Beat } from '../../core/types/Beat'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\n\nexport interface BeatListProps extends MicroInsightCardProps {\n activeCardIndex: number\n beats: Beat[]\n cardWidth: number | null\n}\n\nconst BeatList: React.FC<BeatListProps> = ({\n activeCardIndex,\n beats,\n cardWidth,\n elevation,\n heightOverrides,\n onCardClick,\n posthog,\n showIcon,\n variant,\n}) => {\n const { carouselCopy: copy } = useCopyStore()\n\n const generalProps = {\n elevation,\n heightOverrides,\n posthog,\n showIcon,\n variant,\n }\n\n return (\n <>\n {beats.map((beat: Beat, i) => {\n const beatPosition = i + 1\n const totalBeats = beats.length + 1\n const ariaLabelPositionInCarousel = buildDynamicCopy(\n copy?.card_position_in_carousel_aria,\n beatPosition.toString(),\n totalBeats.toString(),\n )\n\n const hasMicroTitle = beat.micro_title && beat.micro_title.length > 0\n const hasMicroDescription = beat.micro_description && beat.micro_description.length > 0\n\n const beatTitle = hasMicroTitle
|
|
1
|
+
{"version":3,"file":"BeatList.es.js","names":[],"sources":["../../../src/microinsights/carousel/BeatList.tsx"],"sourcesContent":["import React from 'react'\n\nimport { InsightCard, ViewMoreMicroCard } from '..'\nimport type { MicroInsightCardProps } from '../interfaces'\n\nimport { useCopyStore } from '../context/hooks'\n\nimport type { Beat } from '../../core/types/Beat'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\n\nexport interface BeatListProps extends MicroInsightCardProps {\n activeCardIndex: number\n beats: Beat[]\n cardWidth: number | null\n}\n\nconst BeatList: React.FC<BeatListProps> = ({\n activeCardIndex,\n beats,\n cardWidth,\n elevation,\n heightOverrides,\n onCardClick,\n posthog,\n showIcon,\n variant,\n}) => {\n const { carouselCopy: copy } = useCopyStore()\n\n const generalProps = {\n elevation,\n heightOverrides,\n posthog,\n showIcon,\n variant,\n }\n\n return (\n <>\n {beats.map((beat: Beat, i) => {\n const beatPosition = i + 1\n const totalBeats = beats.length + 1\n const ariaLabelPositionInCarousel = buildDynamicCopy(\n copy?.card_position_in_carousel_aria,\n beatPosition.toString(),\n totalBeats.toString(),\n )\n\n const hasMicroTitle = beat.micro_title && beat.micro_title.length > 0\n const hasMicroDescription = beat.micro_description && beat.micro_description.length > 0\n\n // An Insights 2.0 beat's copy lives on its envelope; the legacy micro fields are blank.\n const v2Payload = beat.is_insights_v2 ? beat.insights_payload : undefined\n\n const beatTitle = v2Payload\n ? v2Payload.title\n : hasMicroTitle\n ? beat.micro_title\n : beat.title\n const beatDescription = v2Payload\n ? v2Payload.description?.text\n : hasMicroDescription\n ? beat.micro_description\n : beat.description\n\n return (\n <InsightCard\n ariaLabel={`${ariaLabelPositionInCarousel}: ${beatTitle}, ${beatDescription}`}\n beat={beat}\n index={i}\n isActiveCard={i === activeCardIndex}\n key={`${beat.guid} ${i}`}\n onCardClick={onCardClick}\n widthOverrides={cardWidth || undefined}\n {...generalProps}\n />\n )\n })}\n <ViewMoreMicroCard\n isActiveCard={activeCardIndex === beats.length}\n onCardClick={onCardClick}\n widthOverrides={cardWidth || undefined}\n {...generalProps}\n />\n </>\n )\n}\n\nexport default BeatList\n"],"mappings":";;;;;;AAgBA,IAAM,IAAA,CAAqC,EACzC,iBAAA,GACA,OAAA,GACA,WAAA,GACA,WAAA,GACA,iBAAA,GACA,aAAA,GACA,SAAA,GACA,UAAA,GACA,SAAA,EAAA,MACI;AACJ,QAAM,EAAE,cAAc,EAAA,IAAS,EAAa,GAEtC,IAAe;AAAA,IACnB,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,EACF;AAEA,SACE,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,EAAM,IAAA,CAAK,GAAY,MAAM;AAC5B,UAAM,IAAe,IAAI,GACnB,IAAa,EAAM,SAAS,GAC5B,IAA8B,EAClC,GAAM,gCACN,EAAa,SAAS,GACtB,EAAW,SAAS,CACtB,GAEM,IAAgB,EAAK,eAAe,EAAK,YAAY,SAAS,GAC9D,IAAsB,EAAK,qBAAqB,EAAK,kBAAkB,SAAS,GAGhF,IAAY,EAAK,iBAAiB,EAAK,mBAAmB,QAE1D,IAAY,IACd,EAAU,QACV,IACE,EAAK,cACL,EAAK,OACL,IAAkB,IACpB,EAAU,aAAa,OACvB,IACE,EAAK,oBACL,EAAK;AAEX,WACE,gBAAA,EAAC,GAAD;AAAA,MACE,WAAW,GAAG,CAAA,KAAgC,CAAA,KAAc,CAAA;AAAA,MACtD,MAAA;AAAA,MACN,OAAO;AAAA,MACP,cAAc,MAAM;AAAA,MAEP,aAAA;AAAA,MACb,gBAAgB,KAAa;AAAA,MAC7B,GAAI;AAAA,IACL,GAJM,GAAG,EAAK,IAAA,IAAQ,CAAA,EAItB;AAAA,EAEL,CAAC,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,cAAc,MAAoB,EAAM;AAAA,IAC3B,aAAA;AAAA,IACb,gBAAgB,KAAa;AAAA,IAC7B,GAAI;AAAA,EACL,CAAA,CACD,EAAA,CAAA;AAEN"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { useAccountStore as c, useBudgetsStore as g, useGlobalCopyStore as l } from "../../common/context/hooks.es.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { CategoryIcon as
|
|
3
|
+
import { observer as f } from "mobx-react-lite";
|
|
4
|
+
import { CategoryIcon as m, InstitutionLogo as y } from "@mxenabled/mxui";
|
|
5
5
|
import { jsx as t } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
const { accounts: s } = c(), { budgets:
|
|
6
|
+
var b = ({ notification: i }) => {
|
|
7
|
+
const { accounts: s } = c(), { budgets: a } = g(), { accounts: d } = l(), e = s.find((o) => o.guid === i.entity_guid), r = a.find((o) => o.guid === i.entity_guid), u = i.entity_guid.includes("GOL"), n = { badge: {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
|
10
10
|
justifyContent: "center",
|
|
11
11
|
borderRadius: 4,
|
|
12
12
|
marginRight: 12
|
|
13
13
|
} };
|
|
14
|
-
return e ||
|
|
14
|
+
return e || u ? /* @__PURE__ */ t("div", {
|
|
15
|
+
"data-testid": "notification-badge",
|
|
15
16
|
style: n.badge,
|
|
16
|
-
children: /* @__PURE__ */ t(
|
|
17
|
-
alt: e?.institutionName ||
|
|
17
|
+
children: /* @__PURE__ */ t(y, {
|
|
18
|
+
alt: e?.institutionName || d.institution_logo_alt,
|
|
18
19
|
institutionGuid: e?.institution_guid ?? "",
|
|
19
20
|
size: 33
|
|
20
21
|
})
|
|
21
22
|
}) : /* @__PURE__ */ t("div", {
|
|
23
|
+
"data-testid": "notification-badge",
|
|
22
24
|
style: n.badge,
|
|
23
|
-
children: /* @__PURE__ */ t(
|
|
24
|
-
categoryGuid:
|
|
25
|
+
children: /* @__PURE__ */ t(m, {
|
|
26
|
+
categoryGuid: r?.category_guid,
|
|
25
27
|
size: 36
|
|
26
28
|
})
|
|
27
29
|
});
|
|
28
|
-
}, x =
|
|
30
|
+
}, x = f(b);
|
|
29
31
|
export {
|
|
30
32
|
x as default
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBadge.es.js","names":[],"sources":["../../../src/notifications/components/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { InstitutionLogo, CategoryIcon } from '@mxenabled/mxui'\n\nimport { useAccountStore, useBudgetsStore, useGlobalCopyStore } from '../../common'\nimport { type Notification } from '../../core'\n\ninterface NotificationBadgeProps {\n notification: Notification\n}\n\nconst NotificationBadge: React.FC<NotificationBadgeProps> = ({ notification }) => {\n // Show notifications for all accounts (including hidden)\n const { accounts } = useAccountStore()\n const { budgets } = useBudgetsStore()\n const { accounts: accountsCopy } = useGlobalCopyStore()\n\n const account = accounts.find((account) => account.guid === notification.entity_guid)\n const budget = budgets.find((budget) => budget.guid === notification.entity_guid)\n const isGoal = notification.entity_guid.includes('GOL')\n\n const styles = {\n badge: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 4,\n marginRight: 12,\n },\n }\n\n if (account || isGoal) {\n return (\n <div style={styles.badge}>\n <InstitutionLogo\n alt={account?.institutionName || accountsCopy.institution_logo_alt}\n institutionGuid={account?.institution_guid ?? ''}\n size={33}\n />\n </div>\n )\n } else {\n return (\n <div style={styles.badge}>\n <CategoryIcon categoryGuid={budget?.category_guid} size={36} />\n </div>\n )\n }\n}\n\nexport default observer(NotificationBadge)\n"],"mappings":";;;;;AAYA,IAAM,IAAA,CAAuD,EAAE,cAAA,EAAA,MAAmB;AAEhF,QAAM,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,EAAE,SAAA,EAAA,IAAY,EAAgB,GAC9B,EAAE,UAAU,EAAA,IAAiB,EAAmB,GAEhD,IAAU,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAa,WAAW,GAC9E,IAAS,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAa,WAAW,GAC1E,IAAS,EAAa,YAAY,SAAS,KAAK,GAEhD,IAAS,EACb,OAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,aAAa;AAAA,EACf,EACF;AAEA,SAAI,KAAW,IAEX,gBAAA,EAAC,OAAD;AAAA,IAAK,OAAO,EAAO;AAAA,
|
|
1
|
+
{"version":3,"file":"NotificationBadge.es.js","names":[],"sources":["../../../src/notifications/components/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { InstitutionLogo, CategoryIcon } from '@mxenabled/mxui'\n\nimport { useAccountStore, useBudgetsStore, useGlobalCopyStore } from '../../common'\nimport { type Notification } from '../../core'\n\ninterface NotificationBadgeProps {\n notification: Notification\n}\n\nconst NotificationBadge: React.FC<NotificationBadgeProps> = ({ notification }) => {\n // Show notifications for all accounts (including hidden)\n const { accounts } = useAccountStore()\n const { budgets } = useBudgetsStore()\n const { accounts: accountsCopy } = useGlobalCopyStore()\n\n const account = accounts.find((account) => account.guid === notification.entity_guid)\n const budget = budgets.find((budget) => budget.guid === notification.entity_guid)\n const isGoal = notification.entity_guid.includes('GOL')\n\n const styles = {\n badge: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 4,\n marginRight: 12,\n },\n }\n\n if (account || isGoal) {\n return (\n <div data-testid=\"notification-badge\" style={styles.badge}>\n <InstitutionLogo\n alt={account?.institutionName || accountsCopy.institution_logo_alt}\n institutionGuid={account?.institution_guid ?? ''}\n size={33}\n />\n </div>\n )\n } else {\n return (\n <div data-testid=\"notification-badge\" style={styles.badge}>\n <CategoryIcon categoryGuid={budget?.category_guid} size={36} />\n </div>\n )\n }\n}\n\nexport default observer(NotificationBadge)\n"],"mappings":";;;;;AAYA,IAAM,IAAA,CAAuD,EAAE,cAAA,EAAA,MAAmB;AAEhF,QAAM,EAAE,UAAA,EAAA,IAAa,EAAgB,GAC/B,EAAE,SAAA,EAAA,IAAY,EAAgB,GAC9B,EAAE,UAAU,EAAA,IAAiB,EAAmB,GAEhD,IAAU,EAAS,KAAA,CAAM,MAAY,EAAQ,SAAS,EAAa,WAAW,GAC9E,IAAS,EAAQ,KAAA,CAAM,MAAW,EAAO,SAAS,EAAa,WAAW,GAC1E,IAAS,EAAa,YAAY,SAAS,KAAK,GAEhD,IAAS,EACb,OAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,aAAa;AAAA,EACf,EACF;AAEA,SAAI,KAAW,IAEX,gBAAA,EAAC,OAAD;AAAA,IAAK,eAAY;AAAA,IAAqB,OAAO,EAAO;AAAA,IAClD,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,GAAS,mBAAmB,EAAa;AAAA,MAC9C,iBAAiB,GAAS,oBAAoB;AAAA,MAC9C,MAAM;AAAA,IACP,CAAA;AAAA,EACE,CAAA,IAIL,gBAAA,EAAC,OAAD;AAAA,IAAK,eAAY;AAAA,IAAqB,OAAO,EAAO;AAAA,IAClD,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAc,cAAc,GAAQ;AAAA,MAAe,MAAM;AAAA,IAAK,CAAA;AAAA,EAC3D,CAAA;AAGX,GAEA,IAAe,EAAS,CAAiB"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useNotificationStore as
|
|
2
|
-
import
|
|
1
|
+
import { useNotificationStore as i } from "../../common/context/hooks.es.js";
|
|
2
|
+
import l, { isLogoGuid as n } from "../../insights-v2/components/LogoFromGuid.es.js";
|
|
3
|
+
import s from "./NotificationBadge.es.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import { Text as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { Card as
|
|
7
|
-
var
|
|
8
|
-
const { updateNotification: d } =
|
|
5
|
+
import { Text as m } from "@mxenabled/mxui";
|
|
6
|
+
import { jsx as t, jsxs as g } from "react/jsx-runtime";
|
|
7
|
+
import { Card as u, useTheme as c } from "@mui/material";
|
|
8
|
+
var p = 33, w = ({ notification: e, onClick: a }) => {
|
|
9
|
+
const { updateNotification: d } = i(), o = c(), r = {
|
|
9
10
|
card: {
|
|
10
11
|
alignItems: "center",
|
|
11
12
|
cursor: "pointer",
|
|
@@ -13,11 +14,12 @@ var v = ({ notification: e, onClick: o }) => {
|
|
|
13
14
|
marginBottom: 12,
|
|
14
15
|
paddingX: 24,
|
|
15
16
|
paddingY: 12,
|
|
16
|
-
"&:focus": { backgroundColor:
|
|
17
|
-
"&:hover": { backgroundColor:
|
|
17
|
+
"&:focus": { backgroundColor: o.palette.background.default },
|
|
18
|
+
"&:hover": { backgroundColor: o.palette.background.default },
|
|
19
|
+
"& .notification-logo": { marginRight: 12 }
|
|
18
20
|
},
|
|
19
21
|
dot: {
|
|
20
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: o.palette.primary.main,
|
|
21
23
|
borderRadius: "100%",
|
|
22
24
|
flex: "0 0 auto",
|
|
23
25
|
marginLeft: -8,
|
|
@@ -26,21 +28,28 @@ var v = ({ notification: e, onClick: o }) => {
|
|
|
26
28
|
width: 8
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ g(u, {
|
|
30
32
|
onClick: () => {
|
|
31
|
-
|
|
33
|
+
a(e), d({
|
|
32
34
|
...e,
|
|
33
35
|
has_been_viewed: !0
|
|
34
36
|
}).finally();
|
|
35
37
|
},
|
|
36
|
-
sx:
|
|
38
|
+
sx: r.card,
|
|
37
39
|
children: [
|
|
38
|
-
e.has_been_viewed ? null : /* @__PURE__ */
|
|
40
|
+
e.has_been_viewed ? null : /* @__PURE__ */ t("div", {
|
|
39
41
|
"data-testid": "new-message-dot",
|
|
40
|
-
style:
|
|
42
|
+
style: r.dot
|
|
41
43
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
+
n(e.entity_guid) ? /* @__PURE__ */ t(l, {
|
|
45
|
+
className: "notification-logo",
|
|
46
|
+
logo: {
|
|
47
|
+
alt: e.content,
|
|
48
|
+
guid: e.entity_guid
|
|
49
|
+
},
|
|
50
|
+
size: p
|
|
51
|
+
}) : /* @__PURE__ */ t(s, { notification: e }),
|
|
52
|
+
/* @__PURE__ */ t(m, {
|
|
44
53
|
bold: !e.has_been_viewed,
|
|
45
54
|
truncate: !1,
|
|
46
55
|
variant: "body2",
|
|
@@ -50,7 +59,7 @@ var v = ({ notification: e, onClick: o }) => {
|
|
|
50
59
|
});
|
|
51
60
|
};
|
|
52
61
|
export {
|
|
53
|
-
|
|
62
|
+
w as default
|
|
54
63
|
};
|
|
55
64
|
|
|
56
65
|
//# sourceMappingURL=NotificationCard.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCard.es.js","names":[],"sources":["../../../src/notifications/components/NotificationCard.tsx"],"sourcesContent":["import React from 'react'\nimport { Card, useTheme } from '@mui/material'\nimport { Text } from '@mxenabled/mxui'\n\nimport { type Notification } from '../../core'\nimport { useNotificationStore } from '../../common'\nimport NotificationBadge from './NotificationBadge'\n\ninterface NotificationCardProps {\n notification: Notification\n onClick: (notification: Notification) => void\n}\n\nconst NotificationCard: React.FC<NotificationCardProps> = ({ notification, onClick }) => {\n const { updateNotification } = useNotificationStore()\n const theme = useTheme()\n\n const styles = {\n card: {\n alignItems: 'center',\n cursor: 'pointer',\n display: 'flex',\n marginBottom: 12,\n paddingX: 24,\n paddingY: 12,\n '&:focus': {\n backgroundColor: theme.palette.background.default,\n },\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n },\n },\n dot: {\n backgroundColor: theme.palette.primary.main,\n borderRadius: '100%',\n flex: '0 0 auto',\n marginLeft: -8,\n marginRight: 8,\n height: 8,\n width: 8,\n },\n }\n\n const handleOnClick = () => {\n onClick(notification)\n updateNotification({ ...notification, has_been_viewed: true }).finally()\n }\n\n return (\n <Card onClick={handleOnClick} sx={styles.card}>\n {!notification.has_been_viewed ? (\n <div data-testid=\"new-message-dot\" style={styles.dot} />\n ) : null}\n <NotificationBadge notification={notification} />\n <Text bold={!notification.has_been_viewed} truncate={false} variant={'body2'}>\n {notification.content}\n </Text>\n </Card>\n )\n}\n\nexport default NotificationCard\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationCard.es.js","names":[],"sources":["../../../src/notifications/components/NotificationCard.tsx"],"sourcesContent":["import React from 'react'\nimport { Card, useTheme } from '@mui/material'\nimport { Text } from '@mxenabled/mxui'\n\nimport { type Notification } from '../../core'\nimport { useNotificationStore } from '../../common'\n// Leaf import on purpose: the `insights-v2` barrel pulls in `mappings/blocks` and its chart blocks\n// (see the circular-import note in `insights-v2/mappings/actionBlocksKey.ts`).\nimport LogoFromGuid, { isLogoGuid } from '../../insights-v2/components/LogoFromGuid'\nimport NotificationBadge from './NotificationBadge'\n\n/** Same footprint as the legacy badge's institution logo, so rows line up either way. */\nconst LOGO_SIZE = 33\n\ninterface NotificationCardProps {\n notification: Notification\n onClick: (notification: Notification) => void\n}\n\nconst NotificationCard: React.FC<NotificationCardProps> = ({ notification, onClick }) => {\n const { updateNotification } = useNotificationStore()\n const theme = useTheme()\n\n const styles = {\n card: {\n alignItems: 'center',\n cursor: 'pointer',\n display: 'flex',\n marginBottom: 12,\n paddingX: 24,\n paddingY: 12,\n '&:focus': {\n backgroundColor: theme.palette.background.default,\n },\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n },\n // Matches the legacy badge's trailing gap so the text column lines up either way.\n '& .notification-logo': { marginRight: 12 },\n },\n dot: {\n backgroundColor: theme.palette.primary.main,\n borderRadius: '100%',\n flex: '0 0 auto',\n marginLeft: -8,\n marginRight: 8,\n height: 8,\n width: 8,\n },\n }\n\n const handleOnClick = () => {\n onClick(notification)\n updateNotification({ ...notification, has_been_viewed: true }).finally()\n }\n\n return (\n <Card onClick={handleOnClick} sx={styles.card}>\n {!notification.has_been_viewed ? (\n <div data-testid=\"new-message-dot\" style={styles.dot} />\n ) : null}\n {/* Insights 2.0 (insights_v2.2.md §8.3): Newman writes the row logo guid (merchant, else\n category) into `entity_guid` at send time, so a `MCH-`/`CAT-`/`INS-` guid draws that logo.\n A prefix heuristic by design: non-insight rows carry account or budget guids and legacy\n insight rows the `\"PARENT-ENTITY\"` sentinel, which keep today's badge. The row fetches no\n beat; its text stays `content`. Nothing else branches on the shape of `entity_guid`. */}\n {isLogoGuid(notification.entity_guid) ? (\n <LogoFromGuid\n className=\"notification-logo\"\n logo={{ alt: notification.content, guid: notification.entity_guid }}\n size={LOGO_SIZE}\n />\n ) : (\n <NotificationBadge notification={notification} />\n )}\n <Text bold={!notification.has_been_viewed} truncate={false} variant={'body2'}>\n {notification.content}\n </Text>\n </Card>\n )\n}\n\nexport default NotificationCard\n"],"mappings":";;;;;;;AAYA,IAAM,IAAY,IAOZ,IAAA,CAAqD,EAAE,cAAA,GAAc,SAAA,EAAA,MAAc;AACvF,QAAM,EAAE,oBAAA,EAAA,IAAuB,EAAqB,GAC9C,IAAQ,EAAS,GAEjB,IAAS;AAAA,IACb,MAAM;AAAA,MACJ,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,cAAc;AAAA,MACd,UAAU;AAAA,MACV,UAAU;AAAA,MACV,WAAW,EACT,iBAAiB,EAAM,QAAQ,WAAW,QAC5C;AAAA,MACA,WAAW,EACT,iBAAiB,EAAM,QAAQ,WAAW,QAC5C;AAAA,MAEA,wBAAwB,EAAE,aAAa,GAAG;AAAA,IAC5C;AAAA,IACA,KAAK;AAAA,MACH,iBAAiB,EAAM,QAAQ,QAAQ;AAAA,MACvC,cAAc;AAAA,MACd,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAOA,SACE,gBAAA,EAAC,GAAD;AAAA,IAAM,SANF,MAAsB;AAC1B,MAAA,EAAQ,CAAY,GACpB,EAAmB;AAAA,QAAE,GAAG;AAAA,QAAc,iBAAiB;AAAA,MAAK,CAAC,EAAE,QAAQ;AAAA,IACzE;AAAA,IAGgC,IAAI,EAAO;AAAA,IAAzC,UAAA;AAAA,MACI,EAAa,kBAEX,OADF,gBAAA,EAAC,OAAD;AAAA,QAAK,eAAY;AAAA,QAAkB,OAAO,EAAO;AAAA,MAAM,CAAA;AAAA,MAOxD,EAAW,EAAa,WAAW,IAClC,gBAAA,EAAC,GAAD;AAAA,QACE,WAAU;AAAA,QACV,MAAM;AAAA,UAAE,KAAK,EAAa;AAAA,UAAS,MAAM,EAAa;AAAA,QAAY;AAAA,QAClE,MAAM;AAAA,MACP,CAAA,IAED,gBAAA,EAAC,GAAD,EAAiC,cAAA,EAAe,CAAA;AAAA,MAElD,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,CAAC,EAAa;AAAA,QAAiB,UAAU;AAAA,QAAO,SAAS;AAAA,QAClE,UAAA,EAAa;AAAA,MACV,CAAA;AAAA,IACF;AAAA;AAEV"}
|
|
@@ -7,6 +7,13 @@ export interface TransactionDetailsProps {
|
|
|
7
7
|
topActions?: TopActions[];
|
|
8
8
|
transaction: Transaction;
|
|
9
9
|
shouldShowEmbeddedCard?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Opens the host's contact-support flow when the embedded insight card's CTA is
|
|
12
|
+
* `contact_support_block`. This module cannot import the help module (hosts that don't ship the
|
|
13
|
+
* Help widget stub the import — pulse's webpack `IgnorePlugin`), so the host supplies it. Without
|
|
14
|
+
* it, or with the client's `enable_support_requests` off, the CTA renders disabled.
|
|
15
|
+
*/
|
|
16
|
+
onContactSupport?: () => void;
|
|
10
17
|
}
|
|
11
18
|
declare const _default: React.FunctionComponent<TransactionDetailsProps>;
|
|
12
19
|
export default _default;
|