@mx-cartographer/experiences 9.7.69 → 9.7.71-alpha-ram-usp-2
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 +16 -0
- package/dist/core/stores/GlobalCopyStore.d.ts +6 -0
- package/dist/core/stores/GlobalCopyStore.es.js +14 -8
- package/dist/core/stores/GlobalCopyStore.es.js.map +1 -1
- package/dist/core/stores/GoalStore.d.ts +1 -1
- package/dist/core/stores/GoalStore.es.js +1 -1
- package/dist/core/stores/GoalStore.es.js.map +1 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +24 -0
- package/dist/goals/GoalsMiniWidget.d.ts +7 -0
- package/dist/goals/{GoalsMicroWidget.es.js → GoalsMiniWidget.es.js} +14 -14
- package/dist/goals/GoalsMiniWidget.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalMicroStatusCard.d.ts → mini/GoalMiniStatusCard.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalMicroStatusCard.es.js → mini/GoalMiniStatusCard.es.js} +2 -2
- package/dist/goals/components/mini/GoalMiniStatusCard.es.js.map +1 -0
- package/dist/goals/components/{micro/GoalsMicroEmptyState.d.ts → mini/GoalsMiniEmptyState.d.ts} +1 -1
- package/dist/goals/components/{micro/GoalsMicroEmptyState.es.js → mini/GoalsMiniEmptyState.es.js} +2 -2
- package/dist/goals/components/mini/GoalsMiniEmptyState.es.js.map +1 -0
- package/dist/goals/index.d.ts +1 -1
- package/dist/goals/index.es.js +4 -4
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.d.ts +6 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js +168 -0
- package/dist/insights-v2/actionBlocks/SubscriptionStatusModalBlock.es.js.map +1 -0
- 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 +92 -59
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.d.ts +9 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/layout.es.js +9 -5
- 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/AccountHeroCard.es.js +7 -5
- package/dist/insights-v2/components/AccountHeroCard.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +157 -138
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/CtaStatus.d.ts +14 -1
- package/dist/insights-v2/components/CtaStatus.es.js +76 -38
- package/dist/insights-v2/components/CtaStatus.es.js.map +1 -1
- package/dist/insights-v2/components/InsightTransactionRow.d.ts +3 -1
- package/dist/insights-v2/components/InsightTransactionRow.es.js +36 -20
- package/dist/insights-v2/components/InsightTransactionRow.es.js.map +1 -1
- package/dist/insights-v2/components/StatusPill.es.js +12 -11
- package/dist/insights-v2/components/StatusPill.es.js.map +1 -1
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.d.ts +4 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js +10 -0
- package/dist/insights-v2/components/SubscriptionStatus/subscriptionFrequency.es.js.map +1 -0
- package/dist/insights-v2/components/TransactionListCard.d.ts +5 -1
- package/dist/insights-v2/components/TransactionListCard.es.js +69 -49
- package/dist/insights-v2/components/TransactionListCard.es.js.map +1 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +10 -1
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +27 -11
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -1
- package/dist/insights-v2/components/shared/elevation.d.ts +16 -0
- package/dist/insights-v2/components/shared/elevation.es.js +15 -0
- package/dist/insights-v2/components/shared/elevation.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/ctaConfig.es.js +23 -9
- package/dist/insights-v2/ctaActions/ctaConfig.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/runCtaAction.d.ts +7 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +73 -62
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.d.ts +10 -1
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js +115 -0
- package/dist/insights-v2/ctaActions/subscriptionAnswer.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/types.d.ts +5 -2
- package/dist/insights-v2/ctaActions/useCtaAction.d.ts +6 -0
- package/dist/insights-v2/ctaActions/useCtaAction.es.js +32 -27
- package/dist/insights-v2/ctaActions/useCtaAction.es.js.map +1 -1
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +1 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.es.js +74 -68
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/microinsights/MicroCardTemplate.es.js +21 -17
- package/dist/microinsights/MicroCardTemplate.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +91 -86
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/dist/microinsights/cards/MicroCtaStatus.d.ts +18 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js +44 -0
- package/dist/microinsights/cards/MicroCtaStatus.es.js.map +1 -0
- package/dist/microinsights/stores/CopyStore.d.ts +4 -1
- package/dist/microinsights/stores/CopyStore.es.js +13 -10
- package/dist/microinsights/stores/CopyStore.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/goals/GoalsMicroWidget.d.ts +0 -7
- package/dist/goals/GoalsMicroWidget.es.js.map +0 -1
- package/dist/goals/components/micro/GoalMicroStatusCard.es.js.map +0 -1
- package/dist/goals/components/micro/GoalsMicroEmptyState.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 Q, useGlobalCopyStore as Z, useGlobalStore as tt, useInsightsV2Store as ot } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { sendClientConfiguredCta as it } from "../../common/utils/PostMessage.es.js";
|
|
3
|
+
import { BeatActionsProvider as et } from "../beatActions.es.js";
|
|
4
|
+
import { isContactSupportCtaDisabled as nt } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
5
|
+
import { CtaStatus as rt } from "./CtaStatus.es.js";
|
|
6
|
+
import { reportCtaClick as st } from "../ctaActions/runCtaAction.es.js";
|
|
7
|
+
import { useBeatCtaActions as at } from "../ctaActions/useCtaAction.es.js";
|
|
8
|
+
import { actionBlocksKey as lt } from "../mappings/actionBlocksKey.es.js";
|
|
9
|
+
import { logoFromRef as ct } from "./shared/EntityLogo.es.js";
|
|
10
|
+
import dt from "./FeedbackDialog.es.js";
|
|
11
|
+
import { ErrorCard as mt } from "./ErrorCard.es.js";
|
|
12
|
+
import { blocks as pt } from "../mappings/blocks.es.js";
|
|
13
|
+
import { ActionBlockLayer as ut } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
14
|
+
import ft from "./Footer.es.js";
|
|
15
|
+
import bt from "./Header.es.js";
|
|
16
|
+
import { FeedbackBar as Ct } from "./FeedbackBar.es.js";
|
|
17
|
+
import { DismissInsightDialog as ht } from "./DismissInsightDialog.es.js";
|
|
18
|
+
import { HiddenConfirmationCard as gt } from "./HiddenConfirmationCard.es.js";
|
|
19
|
+
import { LoadingCard as yt } from "./LoadingCard.es.js";
|
|
20
|
+
import { ObsolesceBanner as kt } from "./ObsolesceBanner.es.js";
|
|
21
|
+
import { useBeatFeedbackFlow as xt } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
22
|
+
import { useMemo as _t } from "react";
|
|
23
|
+
import { observer as vt } from "mobx-react-lite";
|
|
24
|
+
import v from "@mui/material/Stack";
|
|
25
|
+
import { P as St } from "@mxenabled/mxui";
|
|
26
|
+
import u from "@mui/material/Button";
|
|
27
|
+
import { ChevronRight as I } from "@mxenabled/mx-icons";
|
|
28
|
+
import { Fragment as wt, jsx as o, jsxs as f } from "react/jsx-runtime";
|
|
29
|
+
import Dt from "@mui/material/Box";
|
|
30
|
+
import Lt from "@mui/material/Card";
|
|
31
|
+
var Tt = {}, Bt = {
|
|
32
32
|
position: "absolute",
|
|
33
33
|
top: 0,
|
|
34
34
|
left: 0,
|
|
@@ -37,83 +37,97 @@ var So = {}, wo = {
|
|
|
37
37
|
backgroundColor: "background.default",
|
|
38
38
|
opacity: 0.7,
|
|
39
39
|
zIndex: 3
|
|
40
|
-
},
|
|
40
|
+
}, At = {
|
|
41
41
|
alignItems: "center",
|
|
42
42
|
alignSelf: "flex-start",
|
|
43
43
|
display: "flex",
|
|
44
|
+
fontSize: 13,
|
|
44
45
|
fontWeight: 600,
|
|
45
|
-
height:
|
|
46
|
-
|
|
46
|
+
height: "auto",
|
|
47
|
+
justifyContent: "flex-start",
|
|
48
|
+
lineHeight: "16px",
|
|
49
|
+
minHeight: 24,
|
|
50
|
+
minWidth: 0,
|
|
51
|
+
px: 0,
|
|
52
|
+
py: 4,
|
|
53
|
+
textAlign: "left",
|
|
47
54
|
textTransform: "none"
|
|
48
|
-
},
|
|
55
|
+
}, It = {
|
|
56
|
+
display: "-webkit-box",
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
WebkitBoxOrient: "vertical",
|
|
59
|
+
WebkitLineClamp: 3
|
|
60
|
+
}, Ot = {
|
|
49
61
|
color: "text.secondary",
|
|
62
|
+
height: 40,
|
|
63
|
+
minHeight: 40,
|
|
50
64
|
fontSize: 13,
|
|
51
65
|
fontWeight: 600,
|
|
52
66
|
lineHeight: "16px",
|
|
53
67
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
...
|
|
68
|
+
}, co = vt(({ beat: i, beatActions: c = Tt, obsolete: h, isLoading: O = !1, isError: F = !1 }) => {
|
|
69
|
+
const R = Z(), E = ot(), { config: H } = Q(), t = xt(i, c), S = tt(), { runCta: M, primary: g, secondary: w, action: N } = at(i, c, i.insights_payload?.primary_cta, i.insights_payload?.secondary_cta), s = i.insights_payload?.widget_type === "mini", W = _t(() => ({
|
|
70
|
+
...t.wrappedActions,
|
|
57
71
|
beat: i
|
|
58
|
-
}), [
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
62
|
-
const { instance_slot:
|
|
63
|
-
logo:
|
|
64
|
-
text:
|
|
65
|
-
} : void 0),
|
|
66
|
-
if (!
|
|
67
|
-
if (
|
|
68
|
-
|
|
72
|
+
}), [t.wrappedActions, i]);
|
|
73
|
+
if (F) return /* @__PURE__ */ o(mt, {});
|
|
74
|
+
const e = i.insights_payload;
|
|
75
|
+
if (!e || t.cardState === "dismissed") return null;
|
|
76
|
+
const { instance_slot: P, primary_cta: r, secondary_cta: a, sub_title: z, title: G, guid: D, dismissed_at: V } = e, { block: X } = P, j = z ?? (e.subtitle ? {
|
|
77
|
+
logo: ct(e.logo),
|
|
78
|
+
text: e.subtitle
|
|
79
|
+
} : void 0), d = (l) => nt(l, H, c.onContactSupport), L = async (l, p) => {
|
|
80
|
+
if (!d(p.block)) {
|
|
81
|
+
if (p.block === lt.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
82
|
+
st({
|
|
69
83
|
beat: i,
|
|
70
|
-
stores:
|
|
71
|
-
hostActions:
|
|
72
|
-
slot:
|
|
73
|
-
}),
|
|
84
|
+
stores: S,
|
|
85
|
+
hostActions: c,
|
|
86
|
+
slot: l
|
|
87
|
+
}), c.onContactSupport?.();
|
|
74
88
|
return;
|
|
75
89
|
}
|
|
76
|
-
await M(
|
|
90
|
+
await M(l, p);
|
|
77
91
|
}
|
|
78
|
-
},
|
|
79
|
-
const { is_mobile_webview:
|
|
80
|
-
|
|
81
|
-
isMobileWebview:
|
|
82
|
-
webviewScheme:
|
|
83
|
-
userGuid:
|
|
92
|
+
}, T = pt[X], m = e.in_description_cta, y = !s && m?.label && m.block ? m : void 0, U = r?.label || (y ? void 0 : m?.label) || void 0, b = !s && !!r?.label, B = i.in_description_cta || i.html_in_description_cta, K = () => {
|
|
93
|
+
const { is_mobile_webview: l, clientConfig: p } = S.appDataStore.appConfig;
|
|
94
|
+
it(i.template, {
|
|
95
|
+
isMobileWebview: l,
|
|
96
|
+
webviewScheme: p?.master?.ui_message_webview_url_scheme,
|
|
97
|
+
userGuid: e.user_guid ?? i.user_guid
|
|
84
98
|
});
|
|
85
|
-
},
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
value:
|
|
88
|
-
children: /* @__PURE__ */
|
|
99
|
+
}, n = b ? g.presentation : void 0, Y = n?.kind === "hidden" && !!n.hideAll, A = !s && !!a?.label && !Y, C = s ? N.presentation : void 0, $ = C?.kind === "status" ? C : void 0, k = C ? $?.action?.label : U, q = C?.title || G || "", J = !!k && n?.kind !== "hidden" || A, x = R.insights_feed?.general, _ = h?.state === "not_refreshable" && !V && !!x;
|
|
100
|
+
return /* @__PURE__ */ o(et, {
|
|
101
|
+
value: W,
|
|
102
|
+
children: /* @__PURE__ */ f(v, {
|
|
89
103
|
sx: { mb: 16 },
|
|
90
104
|
children: [
|
|
91
|
-
|
|
92
|
-
onClose:
|
|
93
|
-
onLeaveFeedback:
|
|
94
|
-
onUndo:
|
|
95
|
-
}) : /* @__PURE__ */
|
|
96
|
-
...
|
|
97
|
-
copy:
|
|
98
|
-
}), /* @__PURE__ */
|
|
99
|
-
inert:
|
|
100
|
-
sx: { ...
|
|
105
|
+
t.cardState === "confirming" ? /* @__PURE__ */ o(gt, {
|
|
106
|
+
onClose: t.collapseConfirmation,
|
|
107
|
+
onLeaveFeedback: t.openHideSurvey,
|
|
108
|
+
onUndo: t.undoDismiss
|
|
109
|
+
}) : /* @__PURE__ */ f(wt, { children: [h && x && /* @__PURE__ */ o(kt, {
|
|
110
|
+
...h,
|
|
111
|
+
copy: x
|
|
112
|
+
}), /* @__PURE__ */ f(Lt, {
|
|
113
|
+
inert: _,
|
|
114
|
+
sx: { ..._ && {
|
|
101
115
|
position: "relative",
|
|
102
116
|
zIndex: 2,
|
|
103
117
|
pointerEvents: "none"
|
|
104
118
|
} },
|
|
105
119
|
children: [
|
|
106
|
-
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
isMini:
|
|
109
|
-
subtitle:
|
|
110
|
-
title:
|
|
120
|
+
_ && /* @__PURE__ */ o(Dt, { sx: Bt }),
|
|
121
|
+
/* @__PURE__ */ o(bt, {
|
|
122
|
+
isMini: s,
|
|
123
|
+
subtitle: j,
|
|
124
|
+
title: q
|
|
111
125
|
}),
|
|
112
|
-
O ? /* @__PURE__ */
|
|
113
|
-
beatGuid:
|
|
114
|
-
payload:
|
|
126
|
+
O ? /* @__PURE__ */ o(yt, {}) : T && /* @__PURE__ */ o(T, {
|
|
127
|
+
beatGuid: D,
|
|
128
|
+
payload: e
|
|
115
129
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ f(v, {
|
|
117
131
|
sx: {
|
|
118
132
|
gap: 6,
|
|
119
133
|
pb: 16,
|
|
@@ -121,15 +135,18 @@ var So = {}, wo = {
|
|
|
121
135
|
px: 16
|
|
122
136
|
},
|
|
123
137
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
dangerouslySetInnerHTML: { __html:
|
|
126
|
-
sx: {
|
|
138
|
+
/* @__PURE__ */ o(St, {
|
|
139
|
+
dangerouslySetInnerHTML: { __html: e.description.html_text },
|
|
140
|
+
sx: {
|
|
141
|
+
fontWeight: "fontWeightRegular",
|
|
142
|
+
...s && It
|
|
143
|
+
},
|
|
127
144
|
variant: "subtitle2"
|
|
128
145
|
}),
|
|
129
|
-
|
|
130
|
-
endIcon: /* @__PURE__ */
|
|
131
|
-
onClick: () =>
|
|
132
|
-
guid:
|
|
146
|
+
y && /* @__PURE__ */ o(u, {
|
|
147
|
+
endIcon: /* @__PURE__ */ o(I, {}),
|
|
148
|
+
onClick: () => E.openActionDrawer({
|
|
149
|
+
guid: D,
|
|
133
150
|
trigger: "inDescriptionCta"
|
|
134
151
|
}),
|
|
135
152
|
sx: {
|
|
@@ -137,91 +154,93 @@ var So = {}, wo = {
|
|
|
137
154
|
p: 4,
|
|
138
155
|
width: "max-content"
|
|
139
156
|
},
|
|
140
|
-
children:
|
|
157
|
+
children: y.label
|
|
141
158
|
}),
|
|
142
|
-
!
|
|
143
|
-
endIcon: /* @__PURE__ */
|
|
144
|
-
onClick:
|
|
159
|
+
!m?.label && B && /* @__PURE__ */ o(u, {
|
|
160
|
+
endIcon: /* @__PURE__ */ o(I, {}),
|
|
161
|
+
onClick: K,
|
|
145
162
|
sx: {
|
|
146
163
|
height: 24,
|
|
147
164
|
p: 4,
|
|
148
165
|
width: "max-content"
|
|
149
166
|
},
|
|
150
|
-
children:
|
|
167
|
+
children: B
|
|
151
168
|
})
|
|
152
169
|
]
|
|
153
170
|
}),
|
|
154
|
-
|
|
171
|
+
J && /* @__PURE__ */ f(v, {
|
|
155
172
|
sx: {
|
|
156
173
|
gap: 8,
|
|
157
174
|
pb: 16,
|
|
158
175
|
px: 16
|
|
159
176
|
},
|
|
160
177
|
children: [
|
|
161
|
-
|
|
162
|
-
sx:
|
|
178
|
+
k && !b && /* @__PURE__ */ o(u, {
|
|
179
|
+
sx: At,
|
|
163
180
|
variant: "text",
|
|
164
|
-
children:
|
|
181
|
+
children: k
|
|
165
182
|
}),
|
|
166
|
-
b &&
|
|
167
|
-
action:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
b && r && n?.kind === "status" && /* @__PURE__ */ o(rt, {
|
|
184
|
+
action: n.action,
|
|
185
|
+
sx: n.sx,
|
|
186
|
+
variant: n.variant,
|
|
187
|
+
icon: n.icon,
|
|
188
|
+
label: n.label,
|
|
189
|
+
tone: n.tone
|
|
171
190
|
}),
|
|
172
|
-
b &&
|
|
173
|
-
"aria-disabled":
|
|
174
|
-
disabled:
|
|
175
|
-
onClick: () =>
|
|
176
|
-
sx: { ...
|
|
191
|
+
b && r && !n && /* @__PURE__ */ o(u, {
|
|
192
|
+
"aria-disabled": d(r.block) || g.disabled,
|
|
193
|
+
disabled: g.disabled,
|
|
194
|
+
onClick: () => L("primary", r),
|
|
195
|
+
sx: { ...d(r.block) && { color: "text.disabled" } },
|
|
177
196
|
variant: "outlined",
|
|
178
|
-
children:
|
|
197
|
+
children: r.label
|
|
179
198
|
}),
|
|
180
|
-
|
|
181
|
-
"aria-disabled":
|
|
199
|
+
A && a && /* @__PURE__ */ o(u, {
|
|
200
|
+
"aria-disabled": d(a.block) || w.disabled,
|
|
182
201
|
color: "inherit",
|
|
183
|
-
disabled:
|
|
184
|
-
onClick: () =>
|
|
202
|
+
disabled: w.disabled,
|
|
203
|
+
onClick: () => L("secondary", a),
|
|
185
204
|
sx: {
|
|
186
|
-
...
|
|
187
|
-
...
|
|
205
|
+
...Ot,
|
|
206
|
+
...d(a.block) && { color: "text.disabled" }
|
|
188
207
|
},
|
|
189
|
-
children:
|
|
208
|
+
children: a.label
|
|
190
209
|
})
|
|
191
210
|
]
|
|
192
211
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
onTellUsMore:
|
|
195
|
-
show:
|
|
212
|
+
/* @__PURE__ */ o(Ct, {
|
|
213
|
+
onTellUsMore: t.openRatingSurvey,
|
|
214
|
+
show: t.isFeedbackBarShown
|
|
196
215
|
})
|
|
197
216
|
]
|
|
198
217
|
})] }),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
isOpen:
|
|
202
|
-
onClose:
|
|
203
|
-
onDismiss:
|
|
218
|
+
/* @__PURE__ */ o(ut, { beat: i }),
|
|
219
|
+
/* @__PURE__ */ o(ht, {
|
|
220
|
+
isOpen: t.isDismissOpen,
|
|
221
|
+
onClose: t.closeDismissDialog,
|
|
222
|
+
onDismiss: t.confirmDismiss
|
|
204
223
|
}),
|
|
205
|
-
|
|
206
|
-
characterLimitLabel:
|
|
207
|
-
closeAriaLabel:
|
|
224
|
+
t.isSurveyOpen && /* @__PURE__ */ o(dt, {
|
|
225
|
+
characterLimitLabel: t.survey.characterLimitLabel,
|
|
226
|
+
closeAriaLabel: t.survey.closeAriaLabel,
|
|
208
227
|
isOpen: !0,
|
|
209
|
-
onBackClick:
|
|
210
|
-
onClose:
|
|
211
|
-
onSubmit:
|
|
212
|
-
onTextInputFocus:
|
|
213
|
-
options:
|
|
214
|
-
primaryText:
|
|
215
|
-
secondaryText:
|
|
216
|
-
title:
|
|
228
|
+
onBackClick: t.feedbackDialogCallbacks.onBackClick,
|
|
229
|
+
onClose: t.closeSurvey,
|
|
230
|
+
onSubmit: t.submitSurvey,
|
|
231
|
+
onTextInputFocus: t.feedbackDialogCallbacks.onTextInputFocus,
|
|
232
|
+
options: t.survey.options,
|
|
233
|
+
primaryText: t.survey.submitText,
|
|
234
|
+
secondaryText: t.survey.backText,
|
|
235
|
+
title: t.survey.title
|
|
217
236
|
}),
|
|
218
|
-
|
|
237
|
+
t.cardState === "visible" && e.footer && /* @__PURE__ */ o(ft, { footer: e.footer })
|
|
219
238
|
]
|
|
220
239
|
})
|
|
221
240
|
});
|
|
222
241
|
});
|
|
223
242
|
export {
|
|
224
|
-
|
|
243
|
+
co as default
|
|
225
244
|
};
|
|
226
245
|
|
|
227
246
|
//# 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 styled like a Button.\nconst MINI_CTA_SX = {\n alignItems: 'center',\n alignSelf: 'flex-start',\n display: 'flex',\n fontWeight: 600,\n height: 44,\n px: 2,\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. `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 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 } = 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={{ 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 {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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AQ,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// 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,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EAET,QAAQ;AACV,GAMM,KAAc;AAAA,EAClB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,SAAS;AAAA,EACT,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;AAAA,EACX,eAAe;AACjB,GAGM,KAAsB;AAAA,EAC1B,SAAS;AAAA,EACT,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,iBAAiB;AACnB,GAMM,KAAmB;AAAA,EACvB,OAAO;AAAA,EAEP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,kBAAkB,EAAE,OAAO,gBAAgB;AAC7C,GAEM,KAAa,GAAA,CAChB,EACC,MAAA,GACA,aAAA,IAAc,IACd,UAAA,GACA,WAAA,IAAY,IACZ,SAAA,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,EAAmB,GAC1B,IAAkB,GAAmB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AAK,KAAK,EAAE,OAAO,gBAAgB;AAAA,kBACrE;AAAA,kBAEC,UAAA,EAAc;AAAA,gBACT,CAAA;AAAA,cAEL;AAAA;YAGT,gBAAA,EAAC,IAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,IAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,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,11 +1,23 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material/styles';
|
|
1
2
|
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';
|
|
2
10
|
export interface CtaStatusProps {
|
|
3
11
|
/** The words, from the backend (copy or a slot) so they stay localized and customizable. */
|
|
4
12
|
label: string;
|
|
5
13
|
/** Background, border, icon and text colours. */
|
|
6
14
|
tone: CtaStatusTone;
|
|
15
|
+
/** Which status design to draw; defaults to `tinted`. */
|
|
16
|
+
variant?: CtaStatusVariant;
|
|
7
17
|
/** mx-icons name, drawn filled and hidden from assistive technology. */
|
|
8
18
|
icon?: string;
|
|
19
|
+
/** Overrides for this status (outer bar); target the inner row via `CTA_STATUS_CONTENT_CLASS`. */
|
|
20
|
+
sx?: SxProps;
|
|
9
21
|
/** An inline button inside the status (e.g. Subscription Detected's "Undo"). */
|
|
10
22
|
action?: {
|
|
11
23
|
label: string;
|
|
@@ -16,4 +28,5 @@ export interface CtaStatusProps {
|
|
|
16
28
|
* A CTA slot's status: what the slot shows once its action is done, instead of a button. Not a
|
|
17
29
|
* control itself (`role="status"`); only the optional inline `action` is pressable.
|
|
18
30
|
*/
|
|
19
|
-
export declare const
|
|
31
|
+
export declare const CTA_STATUS_CONTENT_CLASS = "CtaStatus-content";
|
|
32
|
+
export declare const CtaStatus: ({ label, tone, variant, icon, action, sx, }: CtaStatusProps) => import("react/jsx-runtime").JSX.Element;
|