@mx-cartographer/experiences 9.7.82 → 9.7.84
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 +10 -0
- package/dist/common/components/dialog/Dialog.es.js +13 -10
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +101 -89
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/ctaActions/hostActions.d.ts +2 -0
- package/dist/insights-v2/ctaActions/hostActions.es.js +2 -1
- package/dist/insights-v2/ctaActions/hostActions.es.js.map +1 -1
- package/dist/settings/components/profile/actions/VerifyTokenAction.es.js +6 -6
- package/dist/settings/components/profile/actions/VerifyTokenAction.es.js.map +1 -1
- package/dist/settings/components/transactionrules/actions/EditPayeeAction.es.js +9 -9
- package/dist/settings/components/transactionrules/actions/EditPayeeAction.es.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [9.7.84] - 11-03-2026
|
|
2
|
+
|
|
3
|
+
- **FIXED** - An Insights 2.0 mini card's action link hands its tap to the host as the card tap (`HOST_ACTIONS.cardClick` through `beatActions.onCtaAction`), as micro's link does, so the host sends its post message and analytics (WEC-2196)
|
|
4
|
+
- **CHANGED** - Host: pulse handles `cardClick` in pulse !3906; until then the link sends nothing, as before (pulse's `MiniCardV2` skips taps on buttons). A host without `onCtaAction` keeps today's behaviour (the click bubbles)
|
|
5
|
+
- **CHANGED** - The card's action link (mini, and a full card's block-less link) sits under the description, as in Figma
|
|
6
|
+
|
|
7
|
+
## [9.7.83] - 11-02-2026
|
|
8
|
+
|
|
9
|
+
- **FIXED** - dialogs fit on small mobile screens, mxui (WELL-51)
|
|
10
|
+
|
|
1
11
|
## [9.7.82] - 11-03-2026
|
|
2
12
|
|
|
3
13
|
- **FIXED** - Subscription Detected design QA (WEC-2195): the Confirmed status matches Figma (alert success fill, primary text, smaller Undo), and the `info_wash` row card gets a border and shadow (new opt-in `TransactionListCard` `raised`)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useScreenSize as H } from "../../hooks/useScreenSize.es.js";
|
|
2
|
-
import { useFocusReturn as
|
|
3
|
-
import
|
|
4
|
-
import { DialogFooter as
|
|
5
|
-
import { jsx as o, jsxs as
|
|
6
|
-
import
|
|
2
|
+
import { useFocusReturn as W } from "../../hooks/useFocusReturn.es.js";
|
|
3
|
+
import j from "react";
|
|
4
|
+
import { DialogFooter as k, DialogHeader as v } from "@mxenabled/mxui";
|
|
5
|
+
import { jsx as o, jsxs as C } from "react/jsx-runtime";
|
|
6
|
+
import I from "@mui/material/Dialog";
|
|
7
7
|
import _ from "@mui/material/DialogContent";
|
|
8
8
|
var G = ({ className: l, copy: i, disablePrimaryButton: n = !1, showActions: c = !0, isOpen: e = !1, onClose: r, onPrimaryAction: m, primaryColor: d = "primary", primaryText: u = "Confirm", returnFocusTo: p, onSecondaryAction: t, secondaryColor: f = "primary", secondaryText: g = "Cancel", children: x, ...h }) => {
|
|
9
|
-
const { sx: a, ...D } = h, b = i?.title ?? "", y = i?.close_aria ?? "Close", s =
|
|
9
|
+
const { sx: a, ...D } = h, b = i?.title ?? "", y = i?.close_aria ?? "Close", s = j.useId(), { isSmallMobile: P } = H(), { onExited: S, onFocus: A, rootRef: F } = W(e, p), M = () => {
|
|
10
10
|
m?.(), r();
|
|
11
11
|
}, R = () => {
|
|
12
12
|
t && t(), r();
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ o("div", {
|
|
15
15
|
className: `mx-cmn-dialog ${l}`,
|
|
16
|
-
children: /* @__PURE__ */ I
|
|
16
|
+
children: /* @__PURE__ */ C(I, {
|
|
17
17
|
"aria-labelledby": s,
|
|
18
18
|
maxWidth: "xs",
|
|
19
19
|
onClose: r,
|
|
@@ -29,7 +29,7 @@ var G = ({ className: l, copy: i, disablePrimaryButton: n = !1, showActions: c =
|
|
|
29
29
|
ref: F,
|
|
30
30
|
slotProps: { transition: { onExited: S } },
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */ o(
|
|
32
|
+
/* @__PURE__ */ o(v, {
|
|
33
33
|
ariaHidden: !0,
|
|
34
34
|
copy: {
|
|
35
35
|
title: b,
|
|
@@ -40,10 +40,13 @@ var G = ({ className: l, copy: i, disablePrimaryButton: n = !1, showActions: c =
|
|
|
40
40
|
truncate: !0
|
|
41
41
|
}),
|
|
42
42
|
/* @__PURE__ */ o(_, {
|
|
43
|
-
sx: {
|
|
43
|
+
sx: {
|
|
44
|
+
lineHeight: 1.5,
|
|
45
|
+
maxWidth: "100%"
|
|
46
|
+
},
|
|
44
47
|
children: x
|
|
45
48
|
}),
|
|
46
|
-
c && /* @__PURE__ */ o(
|
|
49
|
+
c && /* @__PURE__ */ o(k, {
|
|
47
50
|
isPrimaryDisabled: n,
|
|
48
51
|
onPrimaryAction: M,
|
|
49
52
|
onSecondaryAction: R,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n // Label the dialog *by* its visible heading (WAI-ARIA APG) instead of a duplicate\n // aria-label, so screen readers announce the title once rather than name + heading.\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen, returnFocusTo)\n\n const handlePrimaryAction = () => {\n onPrimaryAction?.()\n onClose()\n }\n\n const handleSecondaryAction = () => {\n if (onSecondaryAction) {\n onSecondaryAction()\n }\n onClose()\n }\n\n return (\n <div className={`mx-cmn-dialog ${className}`}>\n <MuiDialog\n aria-labelledby={titleId}\n maxWidth=\"xs\"\n onClose={onClose}\n open={isOpen}\n sx={\n [\n {\n '& .MuiDialog-paperScrollPaper': { backgroundColor: 'background.default' },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n height: '100%',\n },\n ...(restSx ? [restSx] : []),\n ] as SxProps\n }\n {...restProps}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{ transition: { onExited } }}\n >\n <DialogHeader\n ariaHidden={true}\n copy={{ title, close_aria: closeAria }}\n id={titleId}\n onClose={onClose}\n truncate={true}\n />\n\n <DialogContent sx={{ lineHeight: 1.5 }}>{children}</DialogContent>\n\n {showActions && (\n <DialogFooter\n isPrimaryDisabled={disablePrimaryButton}\n onPrimaryAction={handlePrimaryAction}\n onSecondaryAction={handleSecondaryAction}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </MuiDialog>\n </div>\n )\n}\n\nexport default Dialog\n"],"mappings":";;;;;;;AA2CA,IAAM,IAAA,CAA0D,EAC9D,WAAA,GACA,MAAA,GACA,sBAAA,IAAuB,IACvB,aAAA,IAAc,IACd,QAAA,IAAS,IACT,SAAA,GACA,iBAAA,GACA,cAAA,IAAe,WACf,aAAA,IAAc,WACd,eAAA,GACA,mBAAA,GACA,gBAAA,IAAiB,WACjB,eAAA,IAAgB,UAChB,UAAA,GACA,GAAG,EAAA,MACC;AAEJ,QAAM,EAAE,IAAI,GAAQ,GAAG,EAAA,IAAc,GAC/B,IAAQ,GAAM,SAAS,IACvB,IAAY,GAAM,cAAc,SAIhC,IAAU,EAAM,MAAM,GAEtB,EAAE,eAAA,EAAA,IAAkB,EAAc,GAElC,EAAE,UAAA,GAAU,SAAA,GAAS,SAAA,EAAA,IAAY,EAAe,GAAQ,CAAa,GAErE,IAAA,MAA4B;AAChC,IAAA,IAAkB,GAClB,EAAQ;AAAA,EACV,GAEM,IAAA,MAA8B;AAClC,IAAI,KACF,EAAkB,GAEpB,EAAQ;AAAA,EACV;AAEA,SACE,gBAAA,EAAC,OAAD;AAAA,IAAK,WAAW,iBAAiB,CAAA;AAAA,IAC/B,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,mBAAiB;AAAA,MACjB,UAAS;AAAA,MACA,SAAA;AAAA,MACT,MAAM;AAAA,MACN,IACE,CACE;AAAA,QACE,iCAAiC,EAAE,iBAAiB,qBAAqB;AAAA,QACzE,GAAI,KAAiB,EAAE,sBAAsB,EAAE,UAAU,OAAO,EAAE;AAAA,QAClE,QAAQ;AAAA,MACV,GACA,GAAI,IAAS,CAAC,CAAM,IAAI,CAAC,CAC3B;AAAA,MAEF,GAAI;AAAA,MACJ,qBAAqB;AAAA,MACZ,SAAA;AAAA,MACT,KAAK;AAAA,MACL,WAAW,EAAE,YAAY,EAAE,UAAA,EAAS,EAAE;AAAA,MAnBxC,UAAA;AAAA,QAqBE,gBAAA,EAAC,GAAD;AAAA,UACE,YAAY;AAAA,UACZ,MAAM;AAAA,YAAE,OAAA;AAAA,YAAO,YAAY;AAAA,UAAU;AAAA,UACrC,IAAI;AAAA,UACK,SAAA;AAAA,UACT,UAAU;AAAA,QACX,CAAA;AAAA,QAED,gBAAA,EAAC,GAAD;AAAA,UAAe,IAAI,
|
|
1
|
+
{"version":3,"file":"Dialog.es.js","names":[],"sources":["../../../../src/common/components/dialog/Dialog.tsx"],"sourcesContent":["import React from 'react'\n\nimport MuiDialog from '@mui/material/Dialog'\nimport { DialogProps as MuiDialogProps } from '@mui/material/Dialog'\nimport DialogContent from '@mui/material/DialogContent'\nimport type { SxProps } from '@mui/material/styles'\n\nimport { DialogFooter, DialogHeader } from '@mxenabled/mxui'\nimport { useScreenSize } from '../../hooks'\nimport { useFocusReturn } from '../../hooks/useFocusReturn'\n\nexport type CopyObject = {\n close_aria?: string\n title: string\n}\n\ntype OwnedMuiProps =\n | 'disableRestoreFocus'\n | 'onFocus'\n | 'open'\n | 'slotProps'\n | 'slots'\n | 'TransitionComponent'\n | 'TransitionProps'\n\nexport interface DialogProps extends Omit<MuiDialogProps, OwnedMuiProps> {\n className?: string\n copy: CopyObject\n disablePrimaryButton?: boolean\n /** Render the footer action buttons. Default true; content-only dialogs (e.g. the insights survey modal) pass false. */\n showActions?: boolean\n isOpen: boolean\n onClose: (event?: unknown, reason?: string) => void\n onPrimaryAction?: () => void\n onSecondaryAction?: () => void\n primaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n primaryText?: string\n /** Where focus goes on close. Takes precedence over the element that opened the dialog. */\n returnFocusTo?: React.RefObject<HTMLElement | null>\n secondaryColor?: 'primary' | 'inherit' | 'secondary' | 'success' | 'error' | 'info' | 'warning'\n secondaryText?: string\n}\n\nconst Dialog: React.FC<React.PropsWithChildren<DialogProps>> = ({\n className,\n copy,\n disablePrimaryButton = false,\n showActions = true,\n isOpen = false,\n onClose,\n onPrimaryAction,\n primaryColor = 'primary',\n primaryText = 'Confirm',\n returnFocusTo,\n onSecondaryAction,\n secondaryColor = 'primary',\n secondaryText = 'Cancel',\n children,\n ...rest\n}) => {\n // Extract sx from rest to merge with Dialog's own styles instead of overwriting\n const { sx: restSx, ...restProps } = rest\n const title = copy?.title ?? ''\n const closeAria = copy?.close_aria ?? 'Close'\n\n // Label the dialog *by* its visible heading (WAI-ARIA APG) instead of a duplicate\n // aria-label, so screen readers announce the title once rather than name + heading.\n const titleId = React.useId()\n\n const { isSmallMobile } = useScreenSize()\n\n const { onExited, onFocus, rootRef } = useFocusReturn(isOpen, returnFocusTo)\n\n const handlePrimaryAction = () => {\n onPrimaryAction?.()\n onClose()\n }\n\n const handleSecondaryAction = () => {\n if (onSecondaryAction) {\n onSecondaryAction()\n }\n onClose()\n }\n\n return (\n <div className={`mx-cmn-dialog ${className}`}>\n <MuiDialog\n aria-labelledby={titleId}\n maxWidth=\"xs\"\n onClose={onClose}\n open={isOpen}\n sx={\n [\n {\n '& .MuiDialog-paperScrollPaper': { backgroundColor: 'background.default' },\n ...(isSmallMobile && { '& .MuiDialog-paper': { minWidth: '100%' } }),\n height: '100%',\n },\n ...(restSx ? [restSx] : []),\n ] as SxProps\n }\n {...restProps}\n disableRestoreFocus={true}\n onFocus={onFocus}\n ref={rootRef}\n slotProps={{ transition: { onExited } }}\n >\n <DialogHeader\n ariaHidden={true}\n copy={{ title, close_aria: closeAria }}\n id={titleId}\n onClose={onClose}\n truncate={true}\n />\n\n <DialogContent sx={{ lineHeight: 1.5, maxWidth: '100%' }}>{children}</DialogContent>\n\n {showActions && (\n <DialogFooter\n isPrimaryDisabled={disablePrimaryButton}\n onPrimaryAction={handlePrimaryAction}\n onSecondaryAction={handleSecondaryAction}\n primaryColor={primaryColor}\n primaryText={primaryText}\n secondaryColor={secondaryColor}\n secondaryText={secondaryText}\n />\n )}\n </MuiDialog>\n </div>\n )\n}\n\nexport default Dialog\n"],"mappings":";;;;;;;AA2CA,IAAM,IAAA,CAA0D,EAC9D,WAAA,GACA,MAAA,GACA,sBAAA,IAAuB,IACvB,aAAA,IAAc,IACd,QAAA,IAAS,IACT,SAAA,GACA,iBAAA,GACA,cAAA,IAAe,WACf,aAAA,IAAc,WACd,eAAA,GACA,mBAAA,GACA,gBAAA,IAAiB,WACjB,eAAA,IAAgB,UAChB,UAAA,GACA,GAAG,EAAA,MACC;AAEJ,QAAM,EAAE,IAAI,GAAQ,GAAG,EAAA,IAAc,GAC/B,IAAQ,GAAM,SAAS,IACvB,IAAY,GAAM,cAAc,SAIhC,IAAU,EAAM,MAAM,GAEtB,EAAE,eAAA,EAAA,IAAkB,EAAc,GAElC,EAAE,UAAA,GAAU,SAAA,GAAS,SAAA,EAAA,IAAY,EAAe,GAAQ,CAAa,GAErE,IAAA,MAA4B;AAChC,IAAA,IAAkB,GAClB,EAAQ;AAAA,EACV,GAEM,IAAA,MAA8B;AAClC,IAAI,KACF,EAAkB,GAEpB,EAAQ;AAAA,EACV;AAEA,SACE,gBAAA,EAAC,OAAD;AAAA,IAAK,WAAW,iBAAiB,CAAA;AAAA,IAC/B,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,mBAAiB;AAAA,MACjB,UAAS;AAAA,MACA,SAAA;AAAA,MACT,MAAM;AAAA,MACN,IACE,CACE;AAAA,QACE,iCAAiC,EAAE,iBAAiB,qBAAqB;AAAA,QACzE,GAAI,KAAiB,EAAE,sBAAsB,EAAE,UAAU,OAAO,EAAE;AAAA,QAClE,QAAQ;AAAA,MACV,GACA,GAAI,IAAS,CAAC,CAAM,IAAI,CAAC,CAC3B;AAAA,MAEF,GAAI;AAAA,MACJ,qBAAqB;AAAA,MACZ,SAAA;AAAA,MACT,KAAK;AAAA,MACL,WAAW,EAAE,YAAY,EAAE,UAAA,EAAS,EAAE;AAAA,MAnBxC,UAAA;AAAA,QAqBE,gBAAA,EAAC,GAAD;AAAA,UACE,YAAY;AAAA,UACZ,MAAM;AAAA,YAAE,OAAA;AAAA,YAAO,YAAY;AAAA,UAAU;AAAA,UACrC,IAAI;AAAA,UACK,SAAA;AAAA,UACT,UAAU;AAAA,QACX,CAAA;AAAA,QAED,gBAAA,EAAC,GAAD;AAAA,UAAe,IAAI;AAAA,YAAE,YAAY;AAAA,YAAK,UAAU;AAAA,UAAO;AAAA,UAAI,UAAA;AAAA,QAAwB,CAAA;AAAA,QAElF,KACC,gBAAA,EAAC,GAAD;AAAA,UACE,mBAAmB;AAAA,UACnB,iBAAiB;AAAA,UACjB,mBAAmB;AAAA,UACL,cAAA;AAAA,UACD,aAAA;AAAA,UACG,gBAAA;AAAA,UACD,eAAA;AAAA,QAChB,CAAA;AAAA,MAEM;AAAA;EACR,CAAA;AAET"}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { sendClientConfiguredCta as
|
|
3
|
-
import { BeatActionsProvider as
|
|
4
|
-
import { isContactSupportCtaDisabled as
|
|
5
|
-
import { CtaStatus as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { useAppConfig as to, useGlobalCopyStore as eo, useGlobalStore as no, useInsightsV2Store as ro } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { sendClientConfiguredCta as so } from "../../common/utils/PostMessage.es.js";
|
|
3
|
+
import { BeatActionsProvider as ao } from "../beatActions.es.js";
|
|
4
|
+
import { isContactSupportCtaDisabled as lo } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
5
|
+
import { CtaStatus as co } from "./CtaStatus.es.js";
|
|
6
|
+
import { HOST_ACTIONS as po } from "../ctaActions/hostActions.es.js";
|
|
7
|
+
import { reportCtaClick as mo } from "../ctaActions/runCtaAction.es.js";
|
|
8
|
+
import { useBeatCtaActions as uo } from "../ctaActions/useCtaAction.es.js";
|
|
9
|
+
import { actionBlocksKey as fo } from "../mappings/actionBlocksKey.es.js";
|
|
10
|
+
import { logoFromRef as Co } from "./shared/EntityLogo.es.js";
|
|
11
|
+
import ho from "./FeedbackDialog.es.js";
|
|
12
|
+
import { ErrorCard as go } from "./ErrorCard.es.js";
|
|
13
|
+
import { blocks as bo } from "../mappings/blocks.es.js";
|
|
14
|
+
import { ActionBlockLayer as _o } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
15
|
+
import ko from "./Footer.es.js";
|
|
16
|
+
import yo from "./Header.es.js";
|
|
17
|
+
import { FeedbackBar as xo } from "./FeedbackBar.es.js";
|
|
18
|
+
import { DismissInsightDialog as vo } from "./DismissInsightDialog.es.js";
|
|
19
|
+
import { HiddenConfirmationCard as So } from "./HiddenConfirmationCard.es.js";
|
|
20
|
+
import { LoadingCard as To } from "./LoadingCard.es.js";
|
|
21
|
+
import { ObsolesceBanner as Lo } from "./ObsolesceBanner.es.js";
|
|
22
|
+
import { useBeatFeedbackFlow as wo } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
23
|
+
import { useMemo as Ao } from "react";
|
|
24
|
+
import { observer as Bo } from "mobx-react-lite";
|
|
24
25
|
import v from "@mui/material/Stack";
|
|
25
|
-
import { P as
|
|
26
|
-
import
|
|
26
|
+
import { P as Do } from "@mxenabled/mxui";
|
|
27
|
+
import f from "@mui/material/Button";
|
|
27
28
|
import { ChevronRight as I } from "@mxenabled/mx-icons";
|
|
28
|
-
import { Fragment as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
var
|
|
29
|
+
import { Fragment as Oo, jsx as i, jsxs as C } from "react/jsx-runtime";
|
|
30
|
+
import Io from "@mui/material/Box";
|
|
31
|
+
import Fo from "@mui/material/Card";
|
|
32
|
+
var Eo = {}, Ho = {
|
|
32
33
|
position: "absolute",
|
|
33
34
|
top: 0,
|
|
34
35
|
left: 0,
|
|
@@ -49,12 +50,12 @@ var Bo = {}, Oo = {
|
|
|
49
50
|
px: 0,
|
|
50
51
|
py: 4,
|
|
51
52
|
textAlign: "left"
|
|
52
|
-
},
|
|
53
|
+
}, Po = {
|
|
53
54
|
...S,
|
|
54
55
|
alignItems: "center",
|
|
55
56
|
display: "flex",
|
|
56
57
|
textTransform: "none"
|
|
57
|
-
},
|
|
58
|
+
}, Mo = {
|
|
58
59
|
color: "text.secondary",
|
|
59
60
|
fontSize: 13,
|
|
60
61
|
fontWeight: 600,
|
|
@@ -64,51 +65,61 @@ var Bo = {}, Oo = {
|
|
|
64
65
|
px: 16,
|
|
65
66
|
py: 12,
|
|
66
67
|
"&.Mui-disabled": { color: "text.disabled" }
|
|
67
|
-
},
|
|
68
|
-
const H =
|
|
68
|
+
}, Ci = Bo(({ beat: t, beatActions: l = Eo, obsolete: g, isLoading: F = !1, isError: E = !1 }) => {
|
|
69
|
+
const H = eo(), P = ro(), { config: M } = to(), o = wo(t, l), b = no(), { runCta: N, primary: _, secondary: T, linkPresentation: R } = uo(t, l, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta, t.insights_payload?.in_description_cta), c = t.insights_payload?.widget_type === "mini", W = Ao(() => ({
|
|
69
70
|
...o.wrappedActions,
|
|
70
71
|
beat: t
|
|
71
72
|
}), [o.wrappedActions, t]);
|
|
72
|
-
if (E) return /* @__PURE__ */ i(
|
|
73
|
+
if (E) return /* @__PURE__ */ i(go, {});
|
|
73
74
|
const e = t.insights_payload;
|
|
74
75
|
if (!e || o.cardState === "dismissed") return null;
|
|
75
|
-
const { instance_slot:
|
|
76
|
-
logo:
|
|
76
|
+
const { instance_slot: G, primary_cta: r, secondary_cta: d, sub_title: X, title: z, guid: L, dismissed_at: V } = e, { block: j } = G, K = X ?? (e.subtitle ? {
|
|
77
|
+
logo: Co(e.logo),
|
|
77
78
|
text: e.subtitle
|
|
78
|
-
} : void 0),
|
|
79
|
-
if (!
|
|
80
|
-
if (
|
|
81
|
-
|
|
79
|
+
} : void 0), p = (s) => lo(s, M, l.onContactSupport), w = async (s, a) => {
|
|
80
|
+
if (!p(a.block)) {
|
|
81
|
+
if (a.block === fo.CONTACT_SUPPORT_ACTION_BLOCK) {
|
|
82
|
+
mo({
|
|
82
83
|
beat: t,
|
|
83
|
-
stores:
|
|
84
|
+
stores: b,
|
|
84
85
|
hostActions: l,
|
|
85
|
-
slot:
|
|
86
|
+
slot: s
|
|
86
87
|
}), l.onContactSupport?.();
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
await N(
|
|
90
|
+
await N(s, a);
|
|
90
91
|
}
|
|
91
|
-
}, A =
|
|
92
|
-
const { is_mobile_webview:
|
|
93
|
-
|
|
94
|
-
isMobileWebview:
|
|
95
|
-
webviewScheme:
|
|
92
|
+
}, A = bo[j], m = e.in_description_cta, k = !c && m?.label && m.block ? m : void 0, U = r?.label || (k ? void 0 : m?.label) || void 0, u = !c && !!r?.label, B = t.in_description_cta || t.html_in_description_cta, Y = () => {
|
|
93
|
+
const { is_mobile_webview: s, clientConfig: a } = b.appDataStore.appConfig;
|
|
94
|
+
so(t.template, {
|
|
95
|
+
isMobileWebview: s,
|
|
96
|
+
webviewScheme: a?.master?.ui_message_webview_url_scheme,
|
|
96
97
|
userGuid: e.user_guid ?? t.user_guid
|
|
97
98
|
});
|
|
98
|
-
}, n =
|
|
99
|
-
|
|
99
|
+
}, n = u ? _.presentation : void 0, $ = n?.kind === "hidden" && !!n.hideAll, D = !c && !!d?.label && !$, h = c ? R : void 0, q = h?.kind === "status" ? h : void 0, O = h ? q?.action?.label : U, J = h?.title || z || "", Q = !!O && !u, Z = u && n?.kind !== "hidden" || D, oo = (s) => {
|
|
100
|
+
const { onCtaAction: a } = l;
|
|
101
|
+
a && (s.stopPropagation(), Promise.resolve().then(() => a({
|
|
102
|
+
beatGuid: t.guid,
|
|
103
|
+
name: po.cardClick
|
|
104
|
+
})).catch((io) => b.captureException(io, {
|
|
105
|
+
store: "BaseLayout",
|
|
106
|
+
template: t.template,
|
|
107
|
+
handler: "cardClick"
|
|
108
|
+
})));
|
|
109
|
+
}, y = H.insights_feed?.general, x = g?.state === "not_refreshable" && !V && !!y;
|
|
110
|
+
return /* @__PURE__ */ i(ao, {
|
|
100
111
|
value: W,
|
|
101
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ C(v, {
|
|
102
113
|
sx: { mb: 16 },
|
|
103
114
|
children: [
|
|
104
|
-
o.cardState === "confirming" ? /* @__PURE__ */ i(
|
|
115
|
+
o.cardState === "confirming" ? /* @__PURE__ */ i(So, {
|
|
105
116
|
onClose: o.collapseConfirmation,
|
|
106
117
|
onLeaveFeedback: o.openHideSurvey,
|
|
107
118
|
onUndo: o.undoDismiss
|
|
108
|
-
}) : /* @__PURE__ */
|
|
119
|
+
}) : /* @__PURE__ */ C(Oo, { children: [g && y && /* @__PURE__ */ i(Lo, {
|
|
109
120
|
...g,
|
|
110
|
-
copy:
|
|
111
|
-
}), /* @__PURE__ */
|
|
121
|
+
copy: y
|
|
122
|
+
}), /* @__PURE__ */ C(Fo, {
|
|
112
123
|
inert: x,
|
|
113
124
|
sx: { ...x && {
|
|
114
125
|
position: "relative",
|
|
@@ -116,17 +127,17 @@ var Bo = {}, Oo = {
|
|
|
116
127
|
pointerEvents: "none"
|
|
117
128
|
} },
|
|
118
129
|
children: [
|
|
119
|
-
x && /* @__PURE__ */ i(
|
|
120
|
-
/* @__PURE__ */ i(
|
|
130
|
+
x && /* @__PURE__ */ i(Io, { sx: Ho }),
|
|
131
|
+
/* @__PURE__ */ i(yo, {
|
|
121
132
|
isMini: c,
|
|
122
133
|
subtitle: K,
|
|
123
134
|
title: J
|
|
124
135
|
}),
|
|
125
|
-
F ? /* @__PURE__ */ i(
|
|
136
|
+
F ? /* @__PURE__ */ i(To, {}) : A && /* @__PURE__ */ i(A, {
|
|
126
137
|
beatGuid: L,
|
|
127
138
|
payload: e
|
|
128
139
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ C(v, {
|
|
130
141
|
sx: {
|
|
131
142
|
gap: 6,
|
|
132
143
|
pb: 16,
|
|
@@ -134,21 +145,27 @@ var Bo = {}, Oo = {
|
|
|
134
145
|
px: 16
|
|
135
146
|
},
|
|
136
147
|
children: [
|
|
137
|
-
/* @__PURE__ */ i(
|
|
148
|
+
/* @__PURE__ */ i(Do, {
|
|
138
149
|
dangerouslySetInnerHTML: { __html: e.description.html_text },
|
|
139
150
|
sx: { fontWeight: "fontWeightRegular" },
|
|
140
151
|
variant: "subtitle2"
|
|
141
152
|
}),
|
|
142
|
-
|
|
153
|
+
k && /* @__PURE__ */ i(f, {
|
|
143
154
|
endIcon: /* @__PURE__ */ i(I, {}),
|
|
144
|
-
onClick: () =>
|
|
155
|
+
onClick: () => P.openActionDrawer({
|
|
145
156
|
guid: L,
|
|
146
157
|
trigger: "inDescriptionCta"
|
|
147
158
|
}),
|
|
148
159
|
sx: S,
|
|
149
|
-
children:
|
|
160
|
+
children: k.label
|
|
150
161
|
}),
|
|
151
|
-
|
|
162
|
+
Q && /* @__PURE__ */ i(f, {
|
|
163
|
+
onClick: c ? oo : void 0,
|
|
164
|
+
sx: Po,
|
|
165
|
+
variant: "text",
|
|
166
|
+
children: O
|
|
167
|
+
}),
|
|
168
|
+
!m?.label && B && /* @__PURE__ */ i(f, {
|
|
152
169
|
endIcon: /* @__PURE__ */ i(I, {}),
|
|
153
170
|
onClick: Y,
|
|
154
171
|
sx: S,
|
|
@@ -156,59 +173,54 @@ var Bo = {}, Oo = {
|
|
|
156
173
|
})
|
|
157
174
|
]
|
|
158
175
|
}),
|
|
159
|
-
|
|
176
|
+
Z && /* @__PURE__ */ C(v, {
|
|
160
177
|
sx: {
|
|
161
178
|
gap: 8,
|
|
162
179
|
pb: 16,
|
|
163
180
|
px: 16
|
|
164
181
|
},
|
|
165
182
|
children: [
|
|
166
|
-
|
|
167
|
-
sx: Io,
|
|
168
|
-
variant: "text",
|
|
169
|
-
children: y
|
|
170
|
-
}),
|
|
171
|
-
b && r && n?.kind === "status" && /* @__PURE__ */ i(so, {
|
|
183
|
+
u && r && n?.kind === "status" && /* @__PURE__ */ i(co, {
|
|
172
184
|
action: n.action,
|
|
173
185
|
sx: n.sx,
|
|
174
186
|
icon: n.icon,
|
|
175
187
|
label: n.label,
|
|
176
188
|
tone: n.tone
|
|
177
189
|
}),
|
|
178
|
-
|
|
179
|
-
"aria-disabled":
|
|
180
|
-
disabled:
|
|
181
|
-
onClick: () =>
|
|
182
|
-
sx: { ...
|
|
190
|
+
u && r && !n && /* @__PURE__ */ i(f, {
|
|
191
|
+
"aria-disabled": p(r.block) || _.disabled,
|
|
192
|
+
disabled: _.disabled,
|
|
193
|
+
onClick: () => w("primary", r),
|
|
194
|
+
sx: { ...p(r.block) && { color: "text.disabled" } },
|
|
183
195
|
variant: "outlined",
|
|
184
196
|
children: r.label
|
|
185
197
|
}),
|
|
186
|
-
|
|
187
|
-
"aria-disabled": d
|
|
198
|
+
D && d && /* @__PURE__ */ i(f, {
|
|
199
|
+
"aria-disabled": p(d.block) || T.disabled,
|
|
188
200
|
color: "inherit",
|
|
189
|
-
disabled:
|
|
190
|
-
onClick: () =>
|
|
201
|
+
disabled: T.disabled,
|
|
202
|
+
onClick: () => w("secondary", d),
|
|
191
203
|
sx: {
|
|
192
|
-
...
|
|
193
|
-
...d
|
|
204
|
+
...Mo,
|
|
205
|
+
...p(d.block) && { color: "text.disabled" }
|
|
194
206
|
},
|
|
195
|
-
children:
|
|
207
|
+
children: d.label
|
|
196
208
|
})
|
|
197
209
|
]
|
|
198
210
|
}),
|
|
199
|
-
/* @__PURE__ */ i(
|
|
211
|
+
/* @__PURE__ */ i(xo, {
|
|
200
212
|
onTellUsMore: o.openRatingSurvey,
|
|
201
213
|
show: o.isFeedbackBarShown
|
|
202
214
|
})
|
|
203
215
|
]
|
|
204
216
|
})] }),
|
|
205
|
-
/* @__PURE__ */ i(
|
|
206
|
-
/* @__PURE__ */ i(
|
|
217
|
+
/* @__PURE__ */ i(_o, { beat: t }),
|
|
218
|
+
/* @__PURE__ */ i(vo, {
|
|
207
219
|
isOpen: o.isDismissOpen,
|
|
208
220
|
onClose: o.closeDismissDialog,
|
|
209
221
|
onDismiss: o.confirmDismiss
|
|
210
222
|
}),
|
|
211
|
-
o.isSurveyOpen && /* @__PURE__ */ i(
|
|
223
|
+
o.isSurveyOpen && /* @__PURE__ */ i(ho, {
|
|
212
224
|
characterLimitLabel: o.survey.characterLimitLabel,
|
|
213
225
|
closeAriaLabel: o.survey.closeAriaLabel,
|
|
214
226
|
isOpen: !0,
|
|
@@ -221,13 +233,13 @@ var Bo = {}, Oo = {
|
|
|
221
233
|
secondaryText: o.survey.backText,
|
|
222
234
|
title: o.survey.title
|
|
223
235
|
}),
|
|
224
|
-
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(
|
|
236
|
+
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(ko, { footer: e.footer })
|
|
225
237
|
]
|
|
226
238
|
})
|
|
227
239
|
});
|
|
228
240
|
});
|
|
229
241
|
export {
|
|
230
|
-
|
|
242
|
+
Ci as default
|
|
231
243
|
};
|
|
232
244
|
|
|
233
245
|
//# 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// 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 linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n beat.insights_payload?.in_description_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 ? linkPresentation : 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' }}\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 {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 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,IAAU,GAAA,MACW;AACrB,QAAM,IAAO,GAAmB,GAC1B,IAAkB,GAAmB,GACrC,EAAE,QAAA,EAAA,IAAW,EAAa,GAC1B,IAAO,GAAoB,GAAM,CAAW,GAE5C,IAAS,GAAe,GACxB,EACJ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,kBAAA,EAAA,IACE,GACF,GACA,GACA,EAAK,kBAAk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,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
|
+
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, 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 { HOST_ACTIONS, 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 linkPresentation,\n } = useBeatCtaActions(\n beat,\n beatActions,\n beat.insights_payload?.primary_cta,\n beat.insights_payload?.secondary_cta,\n beat.insights_payload?.in_description_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 ? linkPresentation : 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 showActionLink = !!actionLabel && !isCtaButton\n const showCtaRow = (isCtaButton && primaryPresentation?.kind !== 'hidden') || showSecondaryCta\n const handleMiniActionClick = (event: MouseEvent) => {\n const { onCtaAction } = beatActions\n if (!onCtaAction) return\n event.stopPropagation()\n Promise.resolve()\n .then(() => onCtaAction({ beatGuid: beat.guid, name: HOST_ACTIONS.cardClick }))\n .catch((error) =>\n stores.captureException(error, {\n store: 'BaseLayout',\n template: beat.template,\n handler: 'cardClick',\n }),\n )\n }\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' }}\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 {/* The card's action with no primary CTA button, never a drawer: mini hands its tap to\n the host (`cardClick`); a full card's block-less link bubbles to the host's card handler. */}\n {showActionLink && (\n <Button\n onClick={isMini ? handleMiniActionClick : undefined}\n sx={MINI_CTA_SX}\n variant=\"text\"\n >\n {actionLabel}\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 {isCtaButton && primary_cta && primaryPresentation?.kind === 'status' && (\n <CtaStatus\n action={primaryPresentation.action}\n sx={primaryPresentation.sx}\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;AAA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,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"}
|
|
@@ -15,5 +15,7 @@ export declare const HOST_ACTIONS: {
|
|
|
15
15
|
readonly spendingPlanItemDelete: "spendingPlanItem.delete";
|
|
16
16
|
/** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */
|
|
17
17
|
readonly atomicTransact: "atomicTransact";
|
|
18
|
+
/** A mini link's tap, handled by the host as a card tap. */
|
|
19
|
+
readonly cardClick: "cardClick";
|
|
18
20
|
};
|
|
19
21
|
export type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS];
|
|
@@ -8,7 +8,8 @@ var e = {
|
|
|
8
8
|
spendingPlanItemCreate: "spendingPlanItem.create",
|
|
9
9
|
spendingPlanItemEdit: "spendingPlanItem.edit",
|
|
10
10
|
spendingPlanItemDelete: "spendingPlanItem.delete",
|
|
11
|
-
atomicTransact: "atomicTransact"
|
|
11
|
+
atomicTransact: "atomicTransact",
|
|
12
|
+
cardClick: "cardClick"
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
15
|
e as HOST_ACTIONS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;
|
|
1
|
+
{"version":3,"file":"hostActions.es.js","names":[],"sources":["../../../src/insights-v2/ctaActions/hostActions.ts"],"sourcesContent":["/**\n * Host-owned effects requested via `beatActions.onCtaAction`. Contract with pulse\n * (`HOST_CTA_ACTIONS` in `src/hooks/useBeatActions.js`): add names on both sides together.\n */\nexport const HOST_ACTIONS = {\n /** First primary click (`cta_clicked_at`); fired by the runner, not by steps. */\n markCtaClicked: 'markCtaClicked',\n dismissBeat: 'dismissBeat',\n updateBeat: 'updateBeat',\n readBeatSummary: 'readBeatSummary',\n sendBeatFeedback: 'sendBeatFeedback',\n disableBeatTemplate: 'disableBeatTemplate',\n spendingPlanItemCreate: 'spendingPlanItem.create',\n spendingPlanItemEdit: 'spendingPlanItem.edit',\n spendingPlanItemDelete: 'spendingPlanItem.delete',\n /** Set Up Direct Deposit: the host fetches the Atomic SDK token and runs the flow. */\n atomicTransact: 'atomicTransact',\n /** A mini link's tap, handled by the host as a card tap. */\n cardClick: 'cardClick',\n} as const\n\nexport type HostActionName = (typeof HOST_ACTIONS)[keyof typeof HOST_ACTIONS]\n"],"mappings":"AAIA,IAAa,IAAe;AAAA,EAE1B,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,wBAAwB;AAAA,EACxB,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EAExB,gBAAgB;AAAA,EAEhB,WAAW;AACb"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
1
|
+
import { useGlobalCopyStore as l } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import p from "../../../../common/components/dialog/Dialog.es.js";
|
|
3
|
-
import
|
|
3
|
+
import s from "react";
|
|
4
4
|
import { observer as f } from "mobx-react-lite";
|
|
5
5
|
import d from "@mui/material/Stack";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
import
|
|
7
|
+
import u from "@mui/material/TextField";
|
|
8
8
|
var b = f(({ handleClose: t, handleVerify: i, isOpen: n }) => {
|
|
9
|
-
const { common: a, settings: e } =
|
|
9
|
+
const { common: a, settings: e } = l(), [r, m] = s.useState("");
|
|
10
10
|
return /* @__PURE__ */ o(p, {
|
|
11
11
|
copy: { title: e.enter_verification_code },
|
|
12
12
|
isOpen: n,
|
|
@@ -26,9 +26,9 @@ var b = f(({ handleClose: t, handleVerify: i, isOpen: n }) => {
|
|
|
26
26
|
justifyContent: "flex-end"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(
|
|
29
|
+
children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(u, {
|
|
30
|
+
fullWidth: !0,
|
|
30
31
|
onChange: (c) => m(c.target.value),
|
|
31
|
-
sx: { width: 352 },
|
|
32
32
|
value: r
|
|
33
33
|
}) })
|
|
34
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyTokenAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyTokenAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Dialog, useGlobalCopyStore } from '../../../../common'\n\ninterface ActionProps {\n handleClose: () => void\n handleVerify: (token: string) => void\n isOpen: boolean\n}\n\nconst VerifyTokenAction: React.FC<ActionProps> = observer(\n ({ handleClose, handleVerify, isOpen }) => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const [token, setToken] = React.useState('')\n\n return (\n <Dialog\n copy={{ title: settingsCopy.enter_verification_code }}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={() => handleVerify(token)}\n onSecondaryAction={handleClose}\n primaryText={settingsCopy.verify}\n secondaryText={commonCopy.cancel_button}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n '& .MuiToolbar-root:last-child': {\n gap: 8,\n padding: 24,\n justifyContent: 'flex-end',\n },\n }}\n >\n <Stack>\n <TextField onChange={(e) => setToken(e.target.value)}
|
|
1
|
+
{"version":3,"file":"VerifyTokenAction.es.js","names":[],"sources":["../../../../../src/settings/components/profile/actions/VerifyTokenAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\n\nimport { Dialog, useGlobalCopyStore } from '../../../../common'\n\ninterface ActionProps {\n handleClose: () => void\n handleVerify: (token: string) => void\n isOpen: boolean\n}\n\nconst VerifyTokenAction: React.FC<ActionProps> = observer(\n ({ handleClose, handleVerify, isOpen }) => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const [token, setToken] = React.useState('')\n\n return (\n <Dialog\n copy={{ title: settingsCopy.enter_verification_code }}\n isOpen={isOpen}\n onClose={handleClose}\n onPrimaryAction={() => handleVerify(token)}\n onSecondaryAction={handleClose}\n primaryText={settingsCopy.verify}\n secondaryText={commonCopy.cancel_button}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n '& .MuiToolbar-root:last-child': {\n gap: 8,\n padding: 24,\n justifyContent: 'flex-end',\n },\n }}\n >\n <Stack>\n <TextField fullWidth onChange={(e) => setToken(e.target.value)} value={token} />\n </Stack>\n </Dialog>\n )\n },\n)\n\nexport default VerifyTokenAction\n"],"mappings":";;;;;;;AAcA,IAAM,IAA2C,EAAA,CAC9C,EAAE,aAAA,GAAa,cAAA,GAAc,QAAA,EAAA,MAAa;AACzC,QAAM,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB,EAAmB,GACpE,CAAC,GAAO,CAAA,IAAY,EAAM,SAAS,EAAE;AAE3C,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAE,OAAO,EAAa,wBAAwB;AAAA,IAC5C,QAAA;AAAA,IACR,SAAS;AAAA,IACT,iBAAA,MAAuB,EAAa,CAAK;AAAA,IACzC,mBAAmB;AAAA,IACnB,aAAa,EAAa;AAAA,IAC1B,eAAe,EAAW;AAAA,IAC1B,IAAI;AAAA,MACF,4BAA4B;AAAA,QAAE,IAAI;AAAA,QAAG,OAAO;AAAA,MAAI;AAAA,MAChD,iCAAiC;AAAA,QAC/B,KAAK;AAAA,QACL,SAAS;AAAA,QACT,gBAAgB;AAAA,MAClB;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD,EAAA,UACE,gBAAA,EAAC,GAAD;AAAA,MAAW,WAAA;AAAA,MAAU,UAAA,CAAW,MAAM,EAAS,EAAE,OAAO,KAAK;AAAA,MAAG,OAAO;AAAA,IAAQ,CAAA,EAC1E,CAAA;AAAA,EACD,CAAA;AAEZ,CACF"}
|
|
@@ -6,10 +6,10 @@ import { observer as C } from "mobx-react-lite";
|
|
|
6
6
|
import { jsx as n, jsxs as S } from "react/jsx-runtime";
|
|
7
7
|
import { useTheme as v } from "@mui/material/styles";
|
|
8
8
|
import T from "@mui/material/TextField";
|
|
9
|
-
var
|
|
10
|
-
const { common: i, settings: s } = f(), { selectedRule: e, updateRulePayee: c } = h(),
|
|
9
|
+
var k = C(() => {
|
|
10
|
+
const { common: i, settings: s } = f(), { selectedRule: e, updateRulePayee: c } = h(), l = v(), [m, t] = r.useState(!1), o = e?.description ? e.description : e?.match_description, [a, p] = r.useState(o || ""), d = () => {
|
|
11
11
|
t(!0);
|
|
12
|
-
},
|
|
12
|
+
}, u = async () => {
|
|
13
13
|
a !== o && e && (e.description = a, await c(e), t(!1));
|
|
14
14
|
};
|
|
15
15
|
return /* @__PURE__ */ S(r.Fragment, { children: [/* @__PURE__ */ n(g, {
|
|
@@ -18,9 +18,9 @@ var j = C(() => {
|
|
|
18
18
|
secondaryText: s.payee
|
|
19
19
|
}), /* @__PURE__ */ n(x, {
|
|
20
20
|
copy: { title: s.edit_payee },
|
|
21
|
-
isOpen:
|
|
21
|
+
isOpen: m,
|
|
22
22
|
onClose: () => t(!1),
|
|
23
|
-
onPrimaryAction:
|
|
23
|
+
onPrimaryAction: u,
|
|
24
24
|
onSecondaryAction: () => t(!1),
|
|
25
25
|
primaryText: i.save_button,
|
|
26
26
|
secondaryText: i.cancel_button,
|
|
@@ -29,17 +29,17 @@ var j = C(() => {
|
|
|
29
29
|
pt: 0,
|
|
30
30
|
width: 400
|
|
31
31
|
},
|
|
32
|
-
path: { fill:
|
|
32
|
+
path: { fill: l.palette.secondary.darker }
|
|
33
33
|
},
|
|
34
34
|
children: /* @__PURE__ */ n(T, {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
fullWidth: !0,
|
|
36
|
+
onChange: (y) => p(y.target.value),
|
|
37
37
|
value: a
|
|
38
38
|
})
|
|
39
39
|
})] });
|
|
40
40
|
});
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
k as default
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
//# sourceMappingURL=EditPayeeAction.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditPayeeAction.es.js","names":[],"sources":["../../../../../src/settings/components/transactionrules/actions/EditPayeeAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport TextField from '@mui/material/TextField'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Dialog, useGlobalCopyStore, useSettingsStore } from '../../../../common'\nimport RuleListItem from '../components/RuleListItem'\n\nconst EditPayeeAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { selectedRule: rule, updateRulePayee } = useSettingsStore()\n\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n const initialPayeeName = rule?.description ? rule.description : rule?.match_description\n\n const [payeeName, setPayeeName] = React.useState(initialPayeeName ? initialPayeeName : '')\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n const handleSave = async () => {\n if (payeeName !== initialPayeeName && rule) {\n rule.description = payeeName\n await updateRulePayee(rule)\n setIsOpen(false)\n }\n }\n\n return (\n <React.Fragment>\n <RuleListItem\n onClick={handleOpen}\n primaryText={initialPayeeName}\n secondaryText={settingsCopy.payee}\n />\n <Dialog\n copy={{ title: settingsCopy.edit_payee }}\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n onPrimaryAction={handleSave}\n onSecondaryAction={() => setIsOpen(false)}\n primaryText={commonCopy.save_button}\n secondaryText={commonCopy.cancel_button}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n path: { fill: theme.palette.secondary.darker },\n }}\n >\n <TextField
|
|
1
|
+
{"version":3,"file":"EditPayeeAction.es.js","names":[],"sources":["../../../../../src/settings/components/transactionrules/actions/EditPayeeAction.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\nimport React from 'react'\n\nimport TextField from '@mui/material/TextField'\nimport { useTheme } from '@mui/material/styles'\n\nimport { Dialog, useGlobalCopyStore, useSettingsStore } from '../../../../common'\nimport RuleListItem from '../components/RuleListItem'\n\nconst EditPayeeAction = observer(() => {\n const { common: commonCopy, settings: settingsCopy } = useGlobalCopyStore()\n const { selectedRule: rule, updateRulePayee } = useSettingsStore()\n\n const theme = useTheme()\n\n const [isOpen, setIsOpen] = React.useState(false)\n const initialPayeeName = rule?.description ? rule.description : rule?.match_description\n\n const [payeeName, setPayeeName] = React.useState(initialPayeeName ? initialPayeeName : '')\n\n const handleOpen = (): void => {\n setIsOpen(true)\n }\n\n const handleSave = async () => {\n if (payeeName !== initialPayeeName && rule) {\n rule.description = payeeName\n await updateRulePayee(rule)\n setIsOpen(false)\n }\n }\n\n return (\n <React.Fragment>\n <RuleListItem\n onClick={handleOpen}\n primaryText={initialPayeeName}\n secondaryText={settingsCopy.payee}\n />\n <Dialog\n copy={{ title: settingsCopy.edit_payee }}\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n onPrimaryAction={handleSave}\n onSecondaryAction={() => setIsOpen(false)}\n primaryText={commonCopy.save_button}\n secondaryText={commonCopy.cancel_button}\n sx={{\n '& .MuiDialogContent-root': { pt: 0, width: 400 },\n path: { fill: theme.palette.secondary.darker },\n }}\n >\n <TextField fullWidth onChange={(e) => setPayeeName(e.target.value)} value={payeeName} />\n </Dialog>\n </React.Fragment>\n )\n})\n\nexport default EditPayeeAction\n"],"mappings":";;;;;;;;AASA,IAAM,IAAkB,EAAA,MAAe;AACrC,QAAM,EAAE,QAAQ,GAAY,UAAU,EAAA,IAAiB,EAAmB,GACpE,EAAE,cAAc,GAAM,iBAAA,EAAA,IAAoB,EAAiB,GAE3D,IAAQ,EAAS,GAEjB,CAAC,GAAQ,CAAA,IAAa,EAAM,SAAS,EAAK,GAC1C,IAAmB,GAAM,cAAc,EAAK,cAAc,GAAM,mBAEhE,CAAC,GAAW,CAAA,IAAgB,EAAM,SAAS,KAAsC,EAAE,GAEnF,IAAA,MAAyB;AAC7B,IAAA,EAAU,EAAI;AAAA,EAChB,GAEM,IAAa,YAAY;AAC7B,IAAI,MAAc,KAAoB,MACpC,EAAK,cAAc,GACnB,MAAM,EAAgB,CAAI,GAC1B,EAAU,EAAK;AAAA,EAEnB;AAEA,SACE,gBAAA,EAAC,EAAM,UAAP,EAAA,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,IACE,SAAS;AAAA,IACT,aAAa;AAAA,IACb,eAAe,EAAa;AAAA,EAC7B,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,EAAE,OAAO,EAAa,WAAW;AAAA,IAC/B,QAAA;AAAA,IACR,SAAA,MAAe,EAAU,EAAK;AAAA,IAC9B,iBAAiB;AAAA,IACjB,mBAAA,MAAyB,EAAU,EAAK;AAAA,IACxC,aAAa,EAAW;AAAA,IACxB,eAAe,EAAW;AAAA,IAC1B,IAAI;AAAA,MACF,4BAA4B;AAAA,QAAE,IAAI;AAAA,QAAG,OAAO;AAAA,MAAI;AAAA,MAChD,MAAM,EAAE,MAAM,EAAM,QAAQ,UAAU,OAAO;AAAA,IAC/C;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MAAW,WAAA;AAAA,MAAU,UAAA,CAAW,MAAM,EAAa,EAAE,OAAO,KAAK;AAAA,MAAG,OAAO;AAAA,IAAY,CAAA;AAAA,EACjF,CAAA,CACM,EAAA,CAAA;AAEpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.84",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
"@mui/x-charts": "^8.29.2",
|
|
218
218
|
"@mxenabled/cssinjs": "^0.6.0",
|
|
219
219
|
"@mxenabled/mx-icons": "^2.3.0",
|
|
220
|
-
"@mxenabled/mxui": "^2.
|
|
220
|
+
"@mxenabled/mxui": "^2.13.0",
|
|
221
221
|
"@mxenabled/web-widget-sdk": "^0.0.15",
|
|
222
222
|
"@tanstack/react-virtual": "^3.14.9",
|
|
223
223
|
"bowser": "^2.14.1",
|