@mx-cartographer/experiences 9.7.71-alpha-ram-usp-2 → 9.7.72
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 +2 -5
- package/dist/core/stores/GlobalCopyStore.d.ts +0 -6
- package/dist/core/stores/GlobalCopyStore.es.js +8 -14
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +0 -24
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/TransactionHistoryBlock.es.js +11 -11
- package/dist/insights-v2/actionBlocks/TransactionHistoryBlock/useTransactionHistoryPrepare.es.js +3 -3
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +59 -92
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +1 -9
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +5 -9
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js +5 -5
- package/dist/insights-v2/components/BaseLayout.es.js +146 -160
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +1 -14
- package/dist/insights-v2/components/CtaStatus.es.js +38 -76
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +1 -3
- package/dist/insights-v2/components/InsightTransactionRow.es.js +20 -36
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/TransactionListCard.d.ts +1 -5
- package/dist/insights-v2/components/TransactionListCard.es.js +49 -69
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/WithdrawalCard.es.js +8 -10
- package/dist/insights-v2/components/WithdrawalCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +1 -10
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +11 -27
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +9 -23
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +0 -7
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +62 -73
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +1 -10
- package/dist/insights-v2/ctaActions/types.d.ts +2 -5
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +0 -6
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +27 -32
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +0 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +0 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +68 -74
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +17 -21
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +86 -91
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/stores/CopyStore.d.ts +1 -4
- package/dist/microinsights/stores/CopyStore.es.js +10 -13
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +0 -6
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +0 -168
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +0 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +0 -4
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +0 -10
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +0 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +0 -16
- package/dist/insights-v2/components/shared/elevation.es.js +0 -15
- package/dist/insights-v2/components/shared/elevation.es.js.map +0 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +0 -115
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +0 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +0 -18
- package/dist/microinsights/cards/MicroCtaStatus.es.js +0 -44
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +0 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { sendClientConfiguredCta as
|
|
3
|
-
import { BeatActionsProvider as
|
|
4
|
-
import { isContactSupportCtaDisabled as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { ErrorCard as
|
|
12
|
-
import { blocks as
|
|
13
|
-
import { ActionBlockLayer as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { FeedbackBar as
|
|
17
|
-
import { DismissInsightDialog as
|
|
18
|
-
import { HiddenConfirmationCard as
|
|
19
|
-
import { LoadingCard as
|
|
20
|
-
import { ObsolesceBanner as
|
|
21
|
-
import { useBeatFeedbackFlow as
|
|
22
|
-
import { useMemo as
|
|
23
|
-
import { observer as
|
|
24
|
-
import
|
|
25
|
-
import { P as
|
|
26
|
-
import
|
|
27
|
-
import { ChevronRight as
|
|
28
|
-
import { Fragment as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
var
|
|
1
|
+
import { useAppConfig as Y, useGlobalCopyStore as $, useGlobalStore as q, useInsightsV2Store as J } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { sendClientConfiguredCta as Q } from "../../common/utils/PostMessage.es.js";
|
|
3
|
+
import { BeatActionsProvider as Z } from "../beatActions.es.js";
|
|
4
|
+
import { isContactSupportCtaDisabled as oo } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
5
|
+
import { reportCtaClick as io } from "../ctaActions/runCtaAction.es.js";
|
|
6
|
+
import { useBeatCtaActions as eo } from "../ctaActions/useCtaAction.es.js";
|
|
7
|
+
import { actionBlocksKey as to } from "../mappings/actionBlocksKey.es.js";
|
|
8
|
+
import { logoFromRef as ro } from "./shared/EntityLogo.es.js";
|
|
9
|
+
import { CtaStatus as no } from "./CtaStatus.es.js";
|
|
10
|
+
import so from "./FeedbackDialog.es.js";
|
|
11
|
+
import { ErrorCard as ao } from "./ErrorCard.es.js";
|
|
12
|
+
import { blocks as lo } from "../mappings/blocks.es.js";
|
|
13
|
+
import { ActionBlockLayer as co } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
14
|
+
import mo from "./Footer.es.js";
|
|
15
|
+
import po from "./Header.es.js";
|
|
16
|
+
import { FeedbackBar as uo } from "./FeedbackBar.es.js";
|
|
17
|
+
import { DismissInsightDialog as fo } from "./DismissInsightDialog.es.js";
|
|
18
|
+
import { HiddenConfirmationCard as Co } from "./HiddenConfirmationCard.es.js";
|
|
19
|
+
import { LoadingCard as bo } from "./LoadingCard.es.js";
|
|
20
|
+
import { ObsolesceBanner as go } from "./ObsolesceBanner.es.js";
|
|
21
|
+
import { useBeatFeedbackFlow as ho } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
22
|
+
import { useMemo as yo } from "react";
|
|
23
|
+
import { observer as _o } from "mobx-react-lite";
|
|
24
|
+
import x from "@mui/material/Stack";
|
|
25
|
+
import { P as ko } from "@mxenabled/mxui";
|
|
26
|
+
import p from "@mui/material/Button";
|
|
27
|
+
import { ChevronRight as O } from "@mxenabled/mx-icons";
|
|
28
|
+
import { Fragment as xo, jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
29
|
+
import vo from "@mui/material/Box";
|
|
30
|
+
import So from "@mui/material/Card";
|
|
31
|
+
var wo = {}, To = {
|
|
32
32
|
position: "absolute",
|
|
33
33
|
top: 0,
|
|
34
34
|
left: 0,
|
|
@@ -37,10 +37,8 @@ var Tt = {}, Bt = {
|
|
|
37
37
|
backgroundColor: "background.default",
|
|
38
38
|
opacity: 0.7,
|
|
39
39
|
zIndex: 3
|
|
40
|
-
},
|
|
41
|
-
alignItems: "center",
|
|
40
|
+
}, v = {
|
|
42
41
|
alignSelf: "flex-start",
|
|
43
|
-
display: "flex",
|
|
44
42
|
fontSize: 13,
|
|
45
43
|
fontWeight: 600,
|
|
46
44
|
height: "auto",
|
|
@@ -50,84 +48,85 @@ var Tt = {}, Bt = {
|
|
|
50
48
|
minWidth: 0,
|
|
51
49
|
px: 0,
|
|
52
50
|
py: 4,
|
|
53
|
-
textAlign: "left"
|
|
51
|
+
textAlign: "left"
|
|
52
|
+
}, Do = {
|
|
53
|
+
...v,
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
display: "flex",
|
|
54
56
|
textTransform: "none"
|
|
55
|
-
},
|
|
56
|
-
display: "-webkit-box",
|
|
57
|
-
overflow: "hidden",
|
|
58
|
-
WebkitBoxOrient: "vertical",
|
|
59
|
-
WebkitLineClamp: 3
|
|
60
|
-
}, Ot = {
|
|
57
|
+
}, Lo = {
|
|
61
58
|
color: "text.secondary",
|
|
62
|
-
height: 40,
|
|
63
|
-
minHeight: 40,
|
|
64
59
|
fontSize: 13,
|
|
65
60
|
fontWeight: 600,
|
|
61
|
+
height: "auto",
|
|
66
62
|
lineHeight: "16px",
|
|
63
|
+
minHeight: 40,
|
|
64
|
+
px: 16,
|
|
65
|
+
py: 12,
|
|
67
66
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
68
|
-
},
|
|
69
|
-
const
|
|
70
|
-
...
|
|
71
|
-
beat:
|
|
72
|
-
}), [
|
|
73
|
-
if (F) return /* @__PURE__ */
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
const { instance_slot:
|
|
77
|
-
logo:
|
|
78
|
-
text:
|
|
79
|
-
} : void 0),
|
|
80
|
-
if (!
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
beat:
|
|
67
|
+
}, ni = _o(({ beat: e, beatActions: l = wo, obsolete: b, isLoading: I = !1, isError: F = !1 }) => {
|
|
68
|
+
const E = $(), H = J(), { config: R } = Y(), o = ho(e, l), S = q(), { runCta: M, primary: g, secondary: w } = eo(e, l, e.insights_payload?.primary_cta, e.insights_payload?.secondary_cta), f = e.insights_payload?.widget_type === "mini", N = yo(() => ({
|
|
69
|
+
...o.wrappedActions,
|
|
70
|
+
beat: e
|
|
71
|
+
}), [o.wrappedActions, e]);
|
|
72
|
+
if (F) return /* @__PURE__ */ i(ao, {});
|
|
73
|
+
const t = e.insights_payload;
|
|
74
|
+
if (!t || o.cardState === "dismissed") return null;
|
|
75
|
+
const { instance_slot: W, primary_cta: n, secondary_cta: s, sub_title: P, title: X, guid: T, dismissed_at: z } = t, { block: G } = W, V = P ?? (t.subtitle ? {
|
|
76
|
+
logo: ro(t.logo),
|
|
77
|
+
text: t.subtitle
|
|
78
|
+
} : void 0), c = (a) => oo(a, R, l.onContactSupport), D = async (a, m) => {
|
|
79
|
+
if (!c(m.block)) {
|
|
80
|
+
if (m.block === to.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
81
|
+
io({
|
|
82
|
+
beat: e,
|
|
84
83
|
stores: S,
|
|
85
|
-
hostActions:
|
|
86
|
-
slot:
|
|
87
|
-
}),
|
|
84
|
+
hostActions: l,
|
|
85
|
+
slot: a
|
|
86
|
+
}), l.onContactSupport?.();
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
|
-
await M(
|
|
89
|
+
await M(a, m);
|
|
91
90
|
}
|
|
92
|
-
},
|
|
93
|
-
const { is_mobile_webview:
|
|
94
|
-
|
|
95
|
-
isMobileWebview:
|
|
96
|
-
webviewScheme:
|
|
97
|
-
userGuid:
|
|
91
|
+
}, L = lo[G], d = t.in_description_cta, h = !f && d?.label && d.block ? d : void 0, y = n?.label || (h ? void 0 : d?.label) || void 0, C = !f && !!n?.label, A = e.in_description_cta || e.html_in_description_cta, j = () => {
|
|
92
|
+
const { is_mobile_webview: a, clientConfig: m } = S.appDataStore.appConfig;
|
|
93
|
+
Q(e.template, {
|
|
94
|
+
isMobileWebview: a,
|
|
95
|
+
webviewScheme: m?.master?.ui_message_webview_url_scheme,
|
|
96
|
+
userGuid: t.user_guid ?? e.user_guid
|
|
98
97
|
});
|
|
99
|
-
},
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
value:
|
|
102
|
-
children: /* @__PURE__ */
|
|
98
|
+
}, r = C ? g.presentation : void 0, K = r?.kind === "hidden" && !!r.hideAll, B = !f && !!s?.label && !K, U = !!y && r?.kind !== "hidden" || B, _ = E.insights_feed?.general, k = b?.state === "not_refreshable" && !z && !!_;
|
|
99
|
+
return /* @__PURE__ */ i(Z, {
|
|
100
|
+
value: N,
|
|
101
|
+
children: /* @__PURE__ */ u(x, {
|
|
103
102
|
sx: { mb: 16 },
|
|
104
103
|
children: [
|
|
105
|
-
|
|
106
|
-
onClose:
|
|
107
|
-
onLeaveFeedback:
|
|
108
|
-
onUndo:
|
|
109
|
-
}) : /* @__PURE__ */
|
|
110
|
-
...
|
|
111
|
-
copy:
|
|
112
|
-
}), /* @__PURE__ */
|
|
113
|
-
inert:
|
|
114
|
-
sx: { ...
|
|
104
|
+
o.cardState === "confirming" ? /* @__PURE__ */ i(Co, {
|
|
105
|
+
onClose: o.collapseConfirmation,
|
|
106
|
+
onLeaveFeedback: o.openHideSurvey,
|
|
107
|
+
onUndo: o.undoDismiss
|
|
108
|
+
}) : /* @__PURE__ */ u(xo, { children: [b && _ && /* @__PURE__ */ i(go, {
|
|
109
|
+
...b,
|
|
110
|
+
copy: _
|
|
111
|
+
}), /* @__PURE__ */ u(So, {
|
|
112
|
+
inert: k,
|
|
113
|
+
sx: { ...k && {
|
|
115
114
|
position: "relative",
|
|
116
115
|
zIndex: 2,
|
|
117
116
|
pointerEvents: "none"
|
|
118
117
|
} },
|
|
119
118
|
children: [
|
|
120
|
-
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
isMini:
|
|
123
|
-
subtitle:
|
|
124
|
-
title:
|
|
119
|
+
k && /* @__PURE__ */ i(vo, { sx: To }),
|
|
120
|
+
/* @__PURE__ */ i(po, {
|
|
121
|
+
isMini: f,
|
|
122
|
+
subtitle: V,
|
|
123
|
+
title: X ?? ""
|
|
125
124
|
}),
|
|
126
|
-
|
|
127
|
-
beatGuid:
|
|
128
|
-
payload:
|
|
125
|
+
I ? /* @__PURE__ */ i(bo, {}) : L && /* @__PURE__ */ i(L, {
|
|
126
|
+
beatGuid: T,
|
|
127
|
+
payload: t
|
|
129
128
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ u(x, {
|
|
131
130
|
sx: {
|
|
132
131
|
gap: 6,
|
|
133
132
|
pb: 16,
|
|
@@ -135,112 +134,99 @@ var Tt = {}, Bt = {
|
|
|
135
134
|
px: 16
|
|
136
135
|
},
|
|
137
136
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
dangerouslySetInnerHTML: { __html:
|
|
140
|
-
sx: {
|
|
141
|
-
fontWeight: "fontWeightRegular",
|
|
142
|
-
...s && It
|
|
143
|
-
},
|
|
137
|
+
/* @__PURE__ */ i(ko, {
|
|
138
|
+
dangerouslySetInnerHTML: { __html: t.description.html_text },
|
|
139
|
+
sx: { fontWeight: "fontWeightRegular" },
|
|
144
140
|
variant: "subtitle2"
|
|
145
141
|
}),
|
|
146
|
-
|
|
147
|
-
endIcon: /* @__PURE__ */
|
|
148
|
-
onClick: () =>
|
|
149
|
-
guid:
|
|
142
|
+
h && /* @__PURE__ */ i(p, {
|
|
143
|
+
endIcon: /* @__PURE__ */ i(O, {}),
|
|
144
|
+
onClick: () => H.openActionDrawer({
|
|
145
|
+
guid: T,
|
|
150
146
|
trigger: "inDescriptionCta"
|
|
151
147
|
}),
|
|
152
|
-
sx:
|
|
153
|
-
|
|
154
|
-
p: 4,
|
|
155
|
-
width: "max-content"
|
|
156
|
-
},
|
|
157
|
-
children: y.label
|
|
148
|
+
sx: v,
|
|
149
|
+
children: h.label
|
|
158
150
|
}),
|
|
159
|
-
!
|
|
160
|
-
endIcon: /* @__PURE__ */
|
|
161
|
-
onClick:
|
|
162
|
-
sx:
|
|
163
|
-
|
|
164
|
-
p: 4,
|
|
165
|
-
width: "max-content"
|
|
166
|
-
},
|
|
167
|
-
children: B
|
|
151
|
+
!d?.label && A && /* @__PURE__ */ i(p, {
|
|
152
|
+
endIcon: /* @__PURE__ */ i(O, {}),
|
|
153
|
+
onClick: j,
|
|
154
|
+
sx: v,
|
|
155
|
+
children: A
|
|
168
156
|
})
|
|
169
157
|
]
|
|
170
158
|
}),
|
|
171
|
-
|
|
159
|
+
U && /* @__PURE__ */ u(x, {
|
|
172
160
|
sx: {
|
|
173
161
|
gap: 8,
|
|
174
162
|
pb: 16,
|
|
175
163
|
px: 16
|
|
176
164
|
},
|
|
177
165
|
children: [
|
|
178
|
-
|
|
179
|
-
sx:
|
|
166
|
+
y && !C && /* @__PURE__ */ i(p, {
|
|
167
|
+
sx: Do,
|
|
180
168
|
variant: "text",
|
|
181
|
-
children:
|
|
169
|
+
children: y
|
|
182
170
|
}),
|
|
183
|
-
|
|
184
|
-
action:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
label: n.label,
|
|
189
|
-
tone: n.tone
|
|
171
|
+
C && n && r?.kind === "status" && /* @__PURE__ */ i(no, {
|
|
172
|
+
action: r.action,
|
|
173
|
+
icon: r.icon,
|
|
174
|
+
label: r.label,
|
|
175
|
+
tone: r.tone
|
|
190
176
|
}),
|
|
191
|
-
|
|
192
|
-
"aria-disabled":
|
|
177
|
+
C && n && !r && /* @__PURE__ */ i(p, {
|
|
178
|
+
"aria-disabled": c(n.block) || g.disabled,
|
|
193
179
|
disabled: g.disabled,
|
|
194
|
-
onClick: () =>
|
|
195
|
-
sx: { ...
|
|
180
|
+
onClick: () => D("primary", n),
|
|
181
|
+
sx: { ...c(n.block) && { color: "text.disabled" } },
|
|
196
182
|
variant: "outlined",
|
|
197
|
-
children:
|
|
183
|
+
children: n.label
|
|
198
184
|
}),
|
|
199
|
-
|
|
200
|
-
"aria-disabled":
|
|
185
|
+
B && s && /* @__PURE__ */ i(p, {
|
|
186
|
+
"aria-disabled": c(s.block) || w.disabled,
|
|
201
187
|
color: "inherit",
|
|
202
188
|
disabled: w.disabled,
|
|
203
|
-
onClick: () =>
|
|
189
|
+
onClick: () => D("secondary", s),
|
|
204
190
|
sx: {
|
|
205
|
-
...
|
|
206
|
-
...
|
|
191
|
+
...Lo,
|
|
192
|
+
...c(s.block) && { color: "text.disabled" }
|
|
207
193
|
},
|
|
208
|
-
children:
|
|
194
|
+
children: s.label
|
|
209
195
|
})
|
|
210
196
|
]
|
|
211
197
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
onTellUsMore:
|
|
214
|
-
show:
|
|
198
|
+
/* @__PURE__ */ i(uo, {
|
|
199
|
+
onTellUsMore: o.openRatingSurvey,
|
|
200
|
+
show: o.isFeedbackBarShown
|
|
215
201
|
})
|
|
216
202
|
]
|
|
217
203
|
})] }),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
isOpen:
|
|
221
|
-
onClose:
|
|
222
|
-
onDismiss:
|
|
204
|
+
/* @__PURE__ */ i(co, { beat: e }),
|
|
205
|
+
/* @__PURE__ */ i(fo, {
|
|
206
|
+
isOpen: o.isDismissOpen,
|
|
207
|
+
onClose: o.closeDismissDialog,
|
|
208
|
+
onDismiss: o.confirmDismiss
|
|
223
209
|
}),
|
|
224
|
-
|
|
225
|
-
characterLimitLabel:
|
|
226
|
-
closeAriaLabel:
|
|
210
|
+
o.isSurveyOpen && /* @__PURE__ */ i(so, {
|
|
211
|
+
characterLimitLabel: o.survey.characterLimitLabel,
|
|
212
|
+
closeAriaLabel: o.survey.closeAriaLabel,
|
|
227
213
|
isOpen: !0,
|
|
228
|
-
onBackClick:
|
|
229
|
-
onClose:
|
|
230
|
-
onSubmit:
|
|
231
|
-
onTextInputFocus:
|
|
232
|
-
options:
|
|
233
|
-
primaryText:
|
|
234
|
-
secondaryText:
|
|
235
|
-
title:
|
|
214
|
+
onBackClick: o.feedbackDialogCallbacks.onBackClick,
|
|
215
|
+
onClose: o.closeSurvey,
|
|
216
|
+
onSubmit: o.submitSurvey,
|
|
217
|
+
onTextInputFocus: o.feedbackDialogCallbacks.onTextInputFocus,
|
|
218
|
+
options: o.survey.options,
|
|
219
|
+
primaryText: o.survey.submitText,
|
|
220
|
+
secondaryText: o.survey.backText,
|
|
221
|
+
title: o.survey.title
|
|
236
222
|
}),
|
|
237
|
-
|
|
223
|
+
o.cardState === "visible" && t.footer && /* @__PURE__ */ i(mo, { footer: t.footer })
|
|
238
224
|
]
|
|
239
225
|
})
|
|
240
226
|
});
|
|
241
227
|
});
|
|
242
228
|
export {
|
|
243
|
-
|
|
229
|
+
ni as default
|
|
244
230
|
};
|
|
245
231
|
|
|
246
232
|
//# sourceMappingURL=BaseLayout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Mini CTA label as Figma's 24px text link, which fits Pulse's 312px mini slide: 13/16 semibold, 16px\n// line plus 4px above and below, its text starting at the card's 16px inset. A minimum height, not the\n// theme's fixed 44px Button height, so a long or translated label wraps instead of overflowing; MUI's\n// 64px minimum width and centring are undone for the same inset.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n textTransform: 'none',\n} as const\n\n// Figma mini template: the description shows at most three lines, then an ellipsis.\nconst MINI_DESCRIPTION_SX = {\n display: '-webkit-box',\n overflow: 'hidden',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 3,\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary. `color=\"inherit\"` keeps hover, ripple and focus off the primary palette.\n// An unavailable CTA (contact_support_block with no host handler) is dimmed at the call site, as the\n// primary CTA is, because it is only aria-disabled and so never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n // Figma: 40px (13/16 + 12px padding).\n height: 40,\n minHeight: 40,\n fontSize: 13,\n fontWeight: 600,\n lineHeight: '16px',\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n action: actionCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n // Mini: the card's action (in_description_cta) mirrors the full card's state, as a label only.\n // Answered → the status's action word (Undo) and its answered title; hidden → no label. The tap\n // stays the host's (it opens the insight with its block), so nothing runs from mini itself.\n const miniPresentation = isMini ? actionCtaState.presentation : undefined\n const miniStatus = miniPresentation?.kind === 'status' ? miniPresentation : undefined\n const actionLabel = miniPresentation ? miniStatus?.action?.label : ctaLabel\n const cardTitle = miniPresentation?.title || title || ''\n const showCtaRow = (!!actionLabel && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={cardTitle} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular', ...(isMini && MINI_DESCRIPTION_SX) }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {actionLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {actionLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\n variant={primaryPresentation.variant}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,E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C,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
1
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Card from '@mui/material/Card'\nimport Stack from '@mui/material/Stack'\n\nimport { ChevronRight } from '@mxenabled/mx-icons'\nimport { P } from '@mxenabled/mxui'\n\nimport { blocks } from '../mappings/blocks'\nimport { actionBlocksKey } from '../mappings/actionBlocksKey'\nimport { isContactSupportCtaDisabled } from '../actionBlocks/ContactSupportActionBlock'\nimport { logoFromRef } from './shared/EntityLogo'\n\nimport Footer from './Footer'\nimport Header from './Header'\nimport FeedbackBar from './FeedbackBar'\nimport FeedbackDialog from './FeedbackDialog'\nimport DismissInsightDialog from './DismissInsightDialog'\nimport HiddenConfirmationCard from './HiddenConfirmationCard'\nimport ErrorCard from './ErrorCard'\nimport LoadingCard from './LoadingCard'\nimport { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useGlobalStore, useInsightsV2Store } from '../../common'\nimport { sendClientConfiguredCta } from '../../common/utils/PostMessage'\nimport type { Beat, PrimaryCTA, SecondaryCTA } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\nimport { reportCtaClick, useBeatCtaActions } from '../ctaActions'\nimport { CtaStatus } from './CtaStatus'\nimport { useBeatFeedbackFlow } from '../hooks/useBeatFeedbackFlow'\n\nexport interface ObsoleteState {\n state: ObsolesceBannerState\n onRefresh: () => void\n onDismiss: () => void\n}\n\ninterface BaseLayoutProps {\n beat: Beat\n beatActions?: BeatActions\n obsolete?: ObsoleteState\n /** Swap only the block slot for a LoadingCard (e.g. while a sampled beat loads). */\n isLoading?: boolean\n /** Replace the entire card with an ErrorCard (e.g. when the sample fails to load). */\n isError?: boolean\n}\n\nconst NO_BEAT_ACTIONS: BeatActions = {}\n\nconst OBSOLETE_OVERLAY_SX = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n backgroundColor: 'background.default',\n opacity: 0.7,\n // Above every block's own z-index (hero card 1, AccountBlock 2), or that section shows through.\n zIndex: 3,\n} as const\n\n// Figma's 24px text link: 13/16 semibold, 16px line plus 4px above and below, its text starting at the\n// card's 16px inset. A minimum height, not the theme's fixed 44px Button height, so a long or translated\n// label wraps instead of overflowing; MUI's 64px minimum width and centring are undone for the same inset.\n// The in-description links use it as is, with the Button's 20px chevron, so they are 28px tall, as in\n// Figma's Low Account Balance full card (node 438:27877); the 24px is the mini CTA's, which has no icon.\nconst TEXT_LINK_SX = {\n alignSelf: 'flex-start',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n justifyContent: 'flex-start',\n lineHeight: '16px',\n minHeight: 24,\n minWidth: 0,\n px: 0,\n py: 4,\n textAlign: 'left',\n} as const\n\n// Mini CTA label, which fits Pulse's 312px mini slide as a text link.\nconst MINI_CTA_SX = {\n ...TEXT_LINK_SX,\n alignItems: 'center',\n display: 'flex',\n textTransform: 'none',\n} as const\n\n// Full card's secondary CTA (e.g. Fee Detected's Contact Support): a quiet text button, 13/16\n// semibold in text.secondary, at least 40px tall with 12/16 padding, as in Figma. `color=\"inherit\"` keeps\n// hover, ripple and focus off the primary palette. An unavailable CTA (contact_support_block with no host\n// handler) is dimmed at the call site, as the primary CTA is, because it is only aria-disabled and so\n// never matches `.Mui-disabled`.\nconst SECONDARY_CTA_SX = {\n color: 'text.secondary',\n fontSize: 13,\n fontWeight: 600,\n height: 'auto',\n lineHeight: '16px',\n minHeight: 40,\n px: 16,\n py: 12,\n '&.Mui-disabled': { color: 'text.disabled' },\n} as const\n\nconst BaseLayout = observer(\n ({\n beat,\n beatActions = NO_BEAT_ACTIONS,\n obsolete,\n isLoading = false,\n isError = false,\n }: BaseLayoutProps) => {\n const copy = useGlobalCopyStore()\n const insightsV2Store = useInsightsV2Store()\n const { config } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\n\n const stores = useGlobalStore()\n const {\n runCta: handleCtaClick,\n primary: primaryCtaState,\n secondary: secondaryCtaState,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // Memoized: an inline object here would change identity every render, making every\n // useAnalyticsEvent() consumer's callback (and its effect deps) unstable too.\n const beatActionsValue = useMemo(\n () => ({ ...flow.wrappedActions, beat }),\n [flow.wrappedActions, beat],\n )\n\n // Error replaces the entire card; loading only swaps the block slot (below).\n if (isError) return <ErrorCard />\n\n const insights_payload = beat.insights_payload\n\n if (!insights_payload) return null\n if (flow.cardState === 'dismissed') return null\n\n const { instance_slot, primary_cta, secondary_cta, sub_title, title, guid, dismissed_at } =\n insights_payload\n const { block } = instance_slot\n\n // Rebuild V1 subtitle shape; sub_title wins if present.\n const subtitle =\n sub_title ??\n (insights_payload.subtitle\n ? {\n logo: logoFromRef(insights_payload.logo),\n text: insights_payload.subtitle,\n }\n : undefined)\n\n // CTAs run via ctaActions; contact_support_block bypasses it.\n const isCtaDisabled = (ctaBlock: string | null | undefined) =>\n isContactSupportCtaDisabled(ctaBlock, config, beatActions.onContactSupport)\n\n const onCtaClick = async (slot: 'primary' | 'secondary', cta: PrimaryCTA | SecondaryCTA) => {\n if (isCtaDisabled(cta.block)) return\n\n if (cta.block === actionBlocksKey.CONTACT_SUPPORT_ACTION_BLOCK) {\n // Bypasses the runner, but still reports the press like any other CTA: the generic\n // press event, and (on a first primary press) FIRST_TIME_PRIMARY_ACTION_SELECTED +\n // cta_clicked_at.\n reportCtaClick({ beat, stores, hostActions: beatActions, slot })\n beatActions.onContactSupport?.()\n return\n }\n\n await handleCtaClick(slot, cta)\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const inDescriptionCta = insights_payload.in_description_cta\n // Full card: the envelope's link opens the drawer its block names. A link with no block (mini's\n // \"Make a Transfer\") is the card's action, drawn as the mini label below, never a dead link.\n const envelopeLink =\n !isMini && inDescriptionCta?.label && inDescriptionCta.block ? inDescriptionCta : undefined\n // The card's action label: the primary CTA's, else a block-less envelope link's (ditto ≥ 1.4.3\n // sends mini's action as in_description_cta). `||`, not `??`: the copy may send the primary label\n // as \"\" rather than omit it, and an empty string must fall through. It is a button only on a full\n // card with a primary CTA; otherwise a label, so a tap reaches the host's card handler.\n const ctaLabel =\n primary_cta?.label || (envelopeLink ? undefined : inDescriptionCta?.label) || undefined\n const isCtaButton = !isMini && !!primary_cta?.label\n const clientConfiguredLabel = beat.in_description_cta || beat.html_in_description_cta\n const onClientConfiguredLinkClick = () => {\n const { is_mobile_webview, clientConfig } = stores.appDataStore.appConfig\n\n sendClientConfiguredCta(beat.template, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: insights_payload.user_guid ?? beat.user_guid,\n })\n }\n // The primary step's presenter may draw a status or nothing instead of the button (full card only).\n const primaryPresentation = isCtaButton ? primaryCtaState.presentation : undefined\n const hidesAllCtas = primaryPresentation?.kind === 'hidden' && !!primaryPresentation.hideAll\n const showSecondaryCta = !isMini && !!secondary_cta?.label && !hidesAllCtas\n const showCtaRow = (!!ctaLabel && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={beatActionsValue}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={subtitle} title={title ?? ''} />\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n\n <Stack sx={{ gap: 6, pb: 16, pt: 12, px: 16 }}>\n <P\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n sx={{ fontWeight: 'fontWeightRegular' }}\n variant=\"subtitle2\"\n />\n {/* V2: the envelope's link opens the action block it names. */}\n {envelopeLink && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() =>\n insightsV2Store.openActionDrawer({ guid, trigger: 'inDescriptionCta' })\n }\n sx={TEXT_LINK_SX}\n >\n {envelopeLink.label}\n </Button>\n )}\n {/* Custom-copy link when the envelope sends none; legacy mini shows it too, so no mini guard. */}\n {!inDescriptionCta?.label && clientConfiguredLabel && (\n <Button\n endIcon={<ChevronRight />}\n onClick={onClientConfiguredLinkClick}\n sx={TEXT_LINK_SX}\n >\n {clientConfiguredLabel}\n </Button>\n )}\n </Stack>\n\n {showCtaRow && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n {ctaLabel &&\n !isCtaButton && (\n // The card's action when it has no primary CTA button (mini always; a full card whose\n // only link names no block). What the tap does is the host's decision (Pulse posts\n // `carousel/cta`, the same redirect a V1 mini card sends), never the action drawer the\n // full card's CTA opens. It is a real (blue, focusable) button for that tap, but has no\n // handler of its own and does not stop the click, so it reaches the host's card handler\n // exactly as a tap on the card does.\n <Button sx={MINI_CTA_SX} variant=\"text\">\n {ctaLabel}\n </Button>\n )}\n {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n icon={primaryPresentation.icon}\n label={primaryPresentation.label}\n tone={primaryPresentation.tone}\n />\n )}\n {isCtaButton && primary_cta && !primaryPresentation && (\n <Button\n aria-disabled={isCtaDisabled(primary_cta.block) || primaryCtaState.disabled}\n disabled={primaryCtaState.disabled}\n onClick={() => onCtaClick('primary', primary_cta)}\n sx={{\n ...(isCtaDisabled(primary_cta.block) && { color: 'text.disabled' }),\n }}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n )}\n {/* Mini has room for one CTA. */}\n {showSecondaryCta && secondary_cta && (\n <Button\n aria-disabled={\n isCtaDisabled(secondary_cta.block) || secondaryCtaState.disabled\n }\n color=\"inherit\"\n disabled={secondaryCtaState.disabled}\n onClick={() => onCtaClick('secondary', secondary_cta)}\n sx={{\n ...SECONDARY_CTA_SX,\n ...(isCtaDisabled(secondary_cta.block) && { color: 'text.disabled' }),\n }}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,IAAM,KAA+B,CAAC,GAEhC,KAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAOM,IAAe;AAAA,EACnB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,WAAW;AACb,GAGM,KAAc;AAAA,EAClB,GAAG;AAAA,EACH,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,eAAe;AACjB,GAOM,KAAmB;AAAA,EACvB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,kBAAkB,EAAE,OAAO,gBAAgB;AAC7C,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,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IAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,IAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import { SxProps } from '@mui/material/styles';
|
|
2
1
|
export type CtaStatusTone = 'success' | 'neutral' | 'error';
|
|
3
|
-
/**
|
|
4
|
-
* How the status is drawn. `tinted` (default): a toned fill with toned text (Designate's "Account
|
|
5
|
-
* Saved!"). `alert`: Figma's `<Alert>`: the alert background, `text.primary` words and a small
|
|
6
|
-
* 13/16 action (Subscription Status's "Subscribed | Undo"). A new design adds a variant here; a CTA
|
|
7
|
-
* step picks one through its presenter.
|
|
8
|
-
*/
|
|
9
|
-
export type CtaStatusVariant = 'tinted' | 'alert';
|
|
10
2
|
export interface CtaStatusProps {
|
|
11
3
|
/** The words, from the backend (copy or a slot) so they stay localized and customizable. */
|
|
12
4
|
label: string;
|
|
13
5
|
/** Background, border, icon and text colours. */
|
|
14
6
|
tone: CtaStatusTone;
|
|
15
|
-
/** Which status design to draw; defaults to `tinted`. */
|
|
16
|
-
variant?: CtaStatusVariant;
|
|
17
7
|
/** mx-icons name, drawn filled and hidden from assistive technology. */
|
|
18
8
|
icon?: string;
|
|
19
|
-
/** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */
|
|
20
|
-
sx?: SxProps;
|
|
21
9
|
/** An inline button inside the status (e.g. Subscription Detected's "Undo"). */
|
|
22
10
|
action?: {
|
|
23
11
|
label: string;
|
|
@@ -28,5 +16,4 @@ export interface CtaStatusProps {
|
|
|
28
16
|
* A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a
|
|
29
17
|
* control itself (`role="status"`); only the optional inline `action` is pressable.
|
|
30
18
|
*/
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const CtaStatus: ({ label, tone, variant, icon, action, sx, }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const CtaStatus: ({ label, tone, icon, action }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;
|