@mx-cartographer/experiences 9.7.202 → 9.7.203
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 +5 -0
- package/dist/core/stores/AnalyticsStore.es.js +9 -8
- package/dist/core/stores/AnalyticsStore.es.js.map +1 -1
- package/dist/core/stores/InsightsV2Store.d.ts +4 -0
- package/dist/core/stores/InsightsV2Store.es.js +10 -8
- package/dist/core/stores/InsightsV2Store.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +1 -0
- package/dist/core/types/Insights.es.js.map +1 -1
- package/dist/core/utils/PostHog.d.ts +2 -0
- package/dist/core/utils/PostHog.es.js +6 -0
- package/dist/core/utils/PostHog.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.d.ts +14 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js +324 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/index.d.ts +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.d.ts +29 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js +25 -0
- package/dist/insights-v2/blocks/ComponentBlocks/FeedbackBlock/survey.es.js.map +1 -0
- package/dist/insights-v2/blocks/ComponentBlocks/index.d.ts +1 -0
- package/dist/insights-v2/components/BaseLayout.es.js +137 -135
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/Header.d.ts +5 -1
- package/dist/insights-v2/components/Header.es.js +15 -15
- package/dist/insights-v2/components/Header.es.js.map +1 -1
- package/dist/insights-v2/index.es.js +51 -49
- package/dist/insights-v2/mappings/blocks.es.js +96 -94
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { type MouseEvent, useEffect, 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 { BEAT_ACTIVE_AT_KEY } from '../../core/stores/InsightsV2Store'\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// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\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 ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\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 display: 'flex',\n flexDirection: 'column',\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 <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n {/* Figma Template/Insight Card: with an empty slot, the description follows the header's 12px. */}\n <Stack sx={{ gap: 6, pb: 16, pt: isLoading || Block ? 12 : 0, 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_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AAO;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, useEffect, 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 {\n BEAT_ACTIVE_AT_KEY,\n BEAT_CARD_TITLE_KEY,\n BEAT_KEEP_AFTER_DISMISS_KEY,\n} from '../../core/stores/InsightsV2Store'\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// The instance_slot grows into the height a fixed-height host leaves (Pulse's 312px mini slide; a full card leaves\n// none) and shrinks so a chart sized from its container fits. `clip` cuts a block that still cannot fit at the\n// slot's edge without making the slot a scroll container; the 4px margin keeps focus rings and edge shadows.\nconst INSTANCE_SLOT_SX = {\n flexGrow: 1,\n minHeight: 0,\n overflow: 'clip',\n overflowClipMargin: 4,\n // The block's root fills the slot, contents centred: `justifyContent` for a column, `alignContent` for a block or\n // a row. Zero specificity (`*:where(&)`), so any value the block sets wins; a row-root block must set its own\n // `justifyContent`, or this centres it sideways. `:first-of-type`, not `:first-child`: Emotion flags the latter\n // as SSR-unsafe, and a block renders one root.\n '*:where(&) > :where(:first-of-type)': {\n alignContent: 'center',\n height: '100%',\n justifyContent: 'center',\n },\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 ?? undefined,\n beat.insights_payload?.secondary_cta ?? undefined,\n beat.insights_payload?.in_description_cta ?? undefined,\n )\n\n // Guard: payload may not be loaded yet (isLoading/isError states).\n const isMini = beat.insights_payload?.widget_type === 'mini'\n\n // A sampled beat is re-read without active_at after a CTA; keep the card's for its drawers.\n const activeAt = beat.active_at ?? beat.insights_payload?.active_at\n useEffect(() => {\n if (activeAt == null || activeAt === '') return\n insightsV2Store.setBeatContext(beat.guid, { [BEAT_ACTIVE_AT_KEY]: activeAt })\n }, [activeAt, beat.guid, insightsV2Store])\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 // A block that dismissed its own beat sets keep_after_dismiss: the card stays (not the hidden\n // card) until the feed refreshes, without the overflow menu, since the beat is already gone.\n const blockContext = insightsV2Store.beatContext[beat.guid]\n const keepsAfterDismiss = !!blockContext?.[BEAT_KEEP_AFTER_DISMISS_KEY]\n const cardState = keepsAfterDismiss ? 'visible' : flow.cardState\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 (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 blockTitle = blockContext?.[BEAT_CARD_TITLE_KEY]\n const cardTitle =\n miniPresentation?.title || (typeof blockTitle === 'string' ? blockTitle : '') || title || ''\n const showActionLink = !!actionLabel && !isCtaButton\n // A block that writes card_title owns the card's header: its title wraps, and the description row\n // drops when it has nothing to show. Every other card keeps the row, so an empty description still\n // spaces the CTAs as before.\n const blockOwnsHeader = typeof blockTitle === 'string'\n const showDescriptionRow =\n !blockOwnsHeader ||\n !!insights_payload.description.html_text ||\n !!envelopeLink ||\n showActionLink ||\n (!inDescriptionCta?.label && !!clientConfiguredLabel)\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 {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 display: 'flex',\n flexDirection: 'column',\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header\n hidesMenu={keepsAfterDismiss}\n isMini={isMini}\n subtitle={subtitle}\n title={cardTitle}\n wrapsTitle={blockOwnsHeader}\n />\n <Box sx={INSTANCE_SLOT_SX}>\n {isLoading ? (\n <LoadingCard />\n ) : (\n Block && <Block beatGuid={guid} payload={insights_payload} />\n )}\n </Box>\n\n {/* Figma Template/Insight Card: with an empty slot, the description follows the header's 12px. */}\n {showDescriptionRow && (\n <Stack sx={{ gap: 6, pb: 16, pt: isLoading || Block ? 12 : 0, 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\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 {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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,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;AA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EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,MAAc,aAAa,EAAiB,UAC3C,gBAAA,EAAC,IAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Subtitle } from '../../core';
|
|
2
2
|
interface HeaderProps {
|
|
3
|
+
/** Drops the overflow menu, e.g. once the card's block has dismissed its own beat. */
|
|
4
|
+
hidesMenu?: boolean;
|
|
3
5
|
isMini: boolean;
|
|
4
6
|
subtitle?: Subtitle;
|
|
5
7
|
title: string;
|
|
8
|
+
/** Lets a long title wrap instead of truncating to one line (a block-owned title, like a survey question). */
|
|
9
|
+
wrapsTitle?: boolean;
|
|
6
10
|
}
|
|
7
|
-
declare const Header: ({ isMini, subtitle, title }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const Header: ({ hidesMenu, isMini, subtitle, title, wrapsTitle, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
12
|
export default Header;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useBeatActions as
|
|
2
|
-
import
|
|
3
|
-
import { InsightOptionsMenu as
|
|
4
|
-
import
|
|
5
|
-
import { H3 as
|
|
1
|
+
import { useBeatActions as m } from "../beatActions.es.js";
|
|
2
|
+
import f from "./SubHeader.es.js";
|
|
3
|
+
import { InsightOptionsMenu as c } from "./InsightOptionsMenu.es.js";
|
|
4
|
+
import t from "@mui/material/Stack";
|
|
5
|
+
import { H3 as l } from "@mxenabled/mxui";
|
|
6
6
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const { onMenuAction: p } =
|
|
9
|
-
return /* @__PURE__ */ o(
|
|
7
|
+
var H = ({ hidesMenu: n = !1, isMini: i, subtitle: e, title: s, wrapsTitle: a = !1 }) => {
|
|
8
|
+
const { onMenuAction: p } = m();
|
|
9
|
+
return /* @__PURE__ */ o(t, {
|
|
10
10
|
sx: {
|
|
11
11
|
gap: 4,
|
|
12
12
|
pb: 12,
|
|
@@ -14,21 +14,21 @@ var g = ({ isMini: n, subtitle: t, title: i }) => {
|
|
|
14
14
|
pr: 16,
|
|
15
15
|
pt: 16
|
|
16
16
|
},
|
|
17
|
-
children: [/* @__PURE__ */ o(
|
|
17
|
+
children: [/* @__PURE__ */ o(t, {
|
|
18
18
|
sx: {
|
|
19
19
|
alignItems: "flex-start",
|
|
20
20
|
flexDirection: "row",
|
|
21
21
|
justifyContent: "space-between"
|
|
22
22
|
},
|
|
23
|
-
children: [/* @__PURE__ */ r(
|
|
24
|
-
truncate: !
|
|
25
|
-
children:
|
|
26
|
-
}), !n && p && /* @__PURE__ */ r(
|
|
27
|
-
}),
|
|
23
|
+
children: [/* @__PURE__ */ r(l, {
|
|
24
|
+
truncate: !a,
|
|
25
|
+
children: s
|
|
26
|
+
}), !i && !n && p && /* @__PURE__ */ r(c, {})]
|
|
27
|
+
}), e && /* @__PURE__ */ r(f, { subtitle: e })]
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
H as default
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
//# sourceMappingURL=Header.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../src/insights-v2/components/Header.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { H3 } from '@mxenabled/mxui'\n\nimport SubHeader from './SubHeader'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport { useBeatActions } from '../beatActions'\nimport type { Subtitle } from '../../core'\n\ninterface HeaderProps {\n isMini: boolean\n subtitle?: Subtitle\n title: string\n}\n\nconst Header = ({ isMini
|
|
1
|
+
{"version":3,"file":"Header.es.js","names":[],"sources":["../../../src/insights-v2/components/Header.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { H3 } from '@mxenabled/mxui'\n\nimport SubHeader from './SubHeader'\nimport InsightOptionsMenu from './InsightOptionsMenu'\nimport { useBeatActions } from '../beatActions'\nimport type { Subtitle } from '../../core'\n\ninterface HeaderProps {\n /** Drops the overflow menu, e.g. once the card's block has dismissed its own beat. */\n hidesMenu?: boolean\n isMini: boolean\n subtitle?: Subtitle\n title: string\n /** Lets a long title wrap instead of truncating to one line (a block-owned title, like a survey question). */\n wrapsTitle?: boolean\n}\n\nconst Header = ({\n hidesMenu = false,\n isMini,\n subtitle,\n title,\n wrapsTitle = false,\n}: HeaderProps) => {\n // The overflow menu appears only when the host wired a menu handler and this\n // isn't the compact/mini layout. Handlers are delivered via context.\n const { onMenuAction } = useBeatActions()\n\n return (\n <Stack sx={{ gap: 4, pb: 12, pl: 16, pr: 16, pt: 16 }}>\n <Stack\n sx={{ alignItems: 'flex-start', flexDirection: 'row', justifyContent: 'space-between' }}\n >\n <H3 truncate={!wrapsTitle}>{title}</H3>\n {!isMini && !hidesMenu && onMenuAction && <InsightOptionsMenu />}\n </Stack>\n\n {/* Sub Header */}\n {subtitle && <SubHeader subtitle={subtitle} />}\n </Stack>\n )\n}\n\nexport default Header\n"],"mappings":";;;;;;AAmBA,IAAM,IAAA,CAAU,EACd,WAAA,IAAY,IACZ,QAAA,GACA,UAAA,GACA,OAAA,GACA,YAAA,IAAa,GAAA,MACI;AAGjB,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAe;AAExC,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,KAAK;AAAA,MAAG,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,MAAI,IAAI;AAAA,IAAG;AAAA,IAApD,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QAAE,YAAY;AAAA,QAAc,eAAe;AAAA,QAAO,gBAAgB;AAAA,MAAgB;AAAA,MADxF,UAAA,CAGE,gBAAA,EAAC,GAAD;AAAA,QAAI,UAAU,CAAC;AAAA,QAAa,UAAA;AAAA,MAAU,CAAA,GACrC,CAAC,KAAU,CAAC,KAAa,KAAgB,gBAAA,EAAC,GAAD,CAAqB,CAAA,CAC1D;AAAA,IAGN,CAAA,GAAA,KAAY,gBAAA,EAAC,GAAD,EAAqB,UAAA,EAAW,CAAA,CACxC;AAAA;AAEX"}
|
|
@@ -13,7 +13,7 @@ import v from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBloc
|
|
|
13
13
|
import R, { isLogoGuid as w } from "./components/LogoFromGuid.es.js";
|
|
14
14
|
import M from "./components/AccountHeroCard.es.js";
|
|
15
15
|
import V from "./components/DirectDepositCard.es.js";
|
|
16
|
-
import { detailedAccountVariant as
|
|
16
|
+
import { detailedAccountVariant as F, directDepositVariant as G, isDetailedAccountVariant as _ } from "./blocks/ComponentBlocks/DetailedAccountBlock/layout.es.js";
|
|
17
17
|
import N from "./blocks/ComponentBlocks/DetailedAccountBlock/DetailedAccountBlock.es.js";
|
|
18
18
|
import W from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
|
|
19
19
|
import z from "./components/TransferLogoCard.es.js";
|
|
@@ -39,7 +39,7 @@ import Ro from "./components/SaveAnExtraCard.es.js";
|
|
|
39
39
|
import Ho from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
|
|
40
40
|
import Oo from "./components/SavingsOpportunityCard.es.js";
|
|
41
41
|
import Eo from "./blocks/ComponentBlocks/SavingsOpportunityBlock/SavingsOpportunityBlock.es.js";
|
|
42
|
-
import
|
|
42
|
+
import Go from "./blocks/ComponentBlocks/SavingsSummaryBlock/SavingsSummaryBlock.es.js";
|
|
43
43
|
import xo from "./components/StatusMessageCard.es.js";
|
|
44
44
|
import Uo from "./components/TransactionListCard.es.js";
|
|
45
45
|
import { transactionBlockVariant as Qo } from "./blocks/ComponentBlocks/TransactionBlock/layout.es.js";
|
|
@@ -49,90 +49,92 @@ import Xo from "./blocks/ComponentBlocks/UpcomingSubscriptionBlock/UpcomingSubsc
|
|
|
49
49
|
import Zo from "./blocks/ComponentBlocks/WeeklySmallPurchasesBlock/WeeklySmallPurchasesBlock.es.js";
|
|
50
50
|
import or from "./components/WithdrawalCard.es.js";
|
|
51
51
|
import mr from "./blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js";
|
|
52
|
-
import ir from "./blocks/ComponentBlocks/
|
|
53
|
-
import pr from "./
|
|
54
|
-
import
|
|
55
|
-
import nr from "./
|
|
56
|
-
import sr from "./components/
|
|
57
|
-
import Br from "./components/
|
|
58
|
-
import kr from "./components/
|
|
59
|
-
import Cr from "./components/
|
|
60
|
-
import hr from "./components/
|
|
61
|
-
import
|
|
62
|
-
import Ir from "./components/
|
|
63
|
-
import Tr from "./components/
|
|
64
|
-
import
|
|
65
|
-
import {
|
|
66
|
-
import Hr from "./components/
|
|
67
|
-
import Or from "./components/
|
|
68
|
-
import
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import jr from "./components/
|
|
52
|
+
import ir from "./blocks/ComponentBlocks/FeedbackBlock/FeedbackBlock.es.js";
|
|
53
|
+
import pr from "./blocks/ComponentBlocks/FeeChargedBlock/FeeChargedBlock.es.js";
|
|
54
|
+
import fr from "./components/DesignateEmergencySavingsCard.es.js";
|
|
55
|
+
import { SVGImageBlock as nr } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
|
|
56
|
+
import sr from "./components/shared/StatusSnackbar.es.js";
|
|
57
|
+
import Br from "./components/FeedbackDialog.es.js";
|
|
58
|
+
import kr from "./components/FeedbackModal.es.js";
|
|
59
|
+
import Cr from "./components/ConnectionDetailDrillDown.es.js";
|
|
60
|
+
import hr from "./components/SurveyModal.es.js";
|
|
61
|
+
import Ar from "./components/InsightErrorCard.es.js";
|
|
62
|
+
import { ErrorCard as Ir } from "./components/ErrorCard.es.js";
|
|
63
|
+
import Tr from "./components/AmountBreakdownCard.es.js";
|
|
64
|
+
import vr from "./components/BadgedTile.es.js";
|
|
65
|
+
import { OverflowMenu as Rr } from "./components/OverflowMenu.es.js";
|
|
66
|
+
import { InsightOptionsMenu as Hr } from "./components/InsightOptionsMenu.es.js";
|
|
67
|
+
import Or from "./components/StatusBadge.es.js";
|
|
68
|
+
import Er from "./components/CompactInsightCard.es.js";
|
|
69
|
+
import { FeedbackBar as Gr } from "./components/FeedbackBar.es.js";
|
|
70
|
+
import { DismissInsightDialog as xr } from "./components/DismissInsightDialog.es.js";
|
|
71
|
+
import { HiddenConfirmationCard as Ur } from "./components/HiddenConfirmationCard.es.js";
|
|
72
|
+
import { LoadingCard as Qr } from "./components/LoadingCard.es.js";
|
|
73
|
+
import { ObsolesceBanner as jr } from "./components/ObsolesceBanner.es.js";
|
|
74
|
+
import Jr from "./components/BaseLayout.es.js";
|
|
74
75
|
export {
|
|
75
76
|
W as AccountBlock,
|
|
76
77
|
M as AccountHeroCard,
|
|
77
78
|
q as AccountSwitchBlock,
|
|
78
|
-
|
|
79
|
+
Tr as AmountBreakdownCard,
|
|
79
80
|
lo as AmountPill,
|
|
80
81
|
e as BAR_ARIA_LABEL,
|
|
81
82
|
f as BAR_CHART_VARIANTS,
|
|
82
|
-
|
|
83
|
+
vr as BadgedTile,
|
|
83
84
|
h as BarchartBlock,
|
|
84
|
-
|
|
85
|
+
Jr as BaseLayout,
|
|
85
86
|
K as BudgetBlock,
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
Er as CompactInsightCard,
|
|
88
|
+
Cr as ConnectionDetailDrillDown,
|
|
88
89
|
$ as DebtsBlock,
|
|
89
|
-
|
|
90
|
+
fr as DesignateEmergencySavingsCard,
|
|
90
91
|
N as DetailedAccountBlock,
|
|
91
92
|
N as DirectDepositBlock,
|
|
92
93
|
V as DirectDepositCard,
|
|
93
|
-
|
|
94
|
+
xr as DismissInsightDialog,
|
|
94
95
|
T as DonutChartBlock,
|
|
95
96
|
A as DoubleBarChartBlock,
|
|
96
97
|
v as DoubleProgressBarBlock,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Br as
|
|
98
|
+
Ir as ErrorCard,
|
|
99
|
+
pr as FeeChargedBlock,
|
|
100
|
+
Gr as FeedbackBar,
|
|
101
|
+
ir as FeedbackBlock,
|
|
102
|
+
Br as FeedbackDialog,
|
|
103
|
+
kr as FeedbackModal,
|
|
102
104
|
ro as GasPurchaseBlock,
|
|
103
105
|
to as GoalProgressCard,
|
|
104
106
|
ao as GoalsBlock,
|
|
105
107
|
d as HOST_ACTIONS,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
Ur as HiddenConfirmationCard,
|
|
109
|
+
Ar as InsightErrorCard,
|
|
110
|
+
Hr as InsightOptionsMenu,
|
|
109
111
|
Y as InsightTransactionRow,
|
|
110
|
-
|
|
112
|
+
Qr as LoadingCard,
|
|
111
113
|
co as LogoClusterCard,
|
|
112
114
|
R as LogoFromGuid,
|
|
113
115
|
eo as LogoTile,
|
|
114
116
|
Co as MerchantBlock,
|
|
115
117
|
Bo as MerchantHighlightCard,
|
|
116
118
|
ho as NoSpendDaysBlock,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
jr as ObsolesceBanner,
|
|
120
|
+
Rr as OverflowMenu,
|
|
119
121
|
ko as P2PLogoStack,
|
|
120
122
|
Ao as QuarterlySummaryBlock,
|
|
121
123
|
Io as QuizBlock,
|
|
122
124
|
vo as RepeatingTransactionBlock,
|
|
123
|
-
|
|
125
|
+
nr as SVGImageBlock,
|
|
124
126
|
Ro as SaveAnExtraCard,
|
|
125
127
|
Ho as SaveExtraBlock,
|
|
126
128
|
Eo as SavingsOpportunityBlock,
|
|
127
129
|
Oo as SavingsOpportunityCard,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
Go as SavingsSummaryBlock,
|
|
131
|
+
Or as StatusBadge,
|
|
130
132
|
xo as StatusMessageCard,
|
|
131
133
|
r as StatusPill,
|
|
132
|
-
|
|
134
|
+
sr as StatusSnackbar,
|
|
133
135
|
I as StepChartBlock,
|
|
134
136
|
Jo as SubscriptionHeroCard,
|
|
135
|
-
|
|
137
|
+
hr as SurveyModal,
|
|
136
138
|
jo as TransactionBlock,
|
|
137
139
|
Uo as TransactionListCard,
|
|
138
140
|
z as TransferLogoCard,
|
|
@@ -145,8 +147,8 @@ export {
|
|
|
145
147
|
c as barChartVariant,
|
|
146
148
|
n as buildChartData,
|
|
147
149
|
l as buildDataSeries,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
F as detailedAccountVariant,
|
|
151
|
+
G as directDepositVariant,
|
|
150
152
|
_ as isDetailedAccountVariant,
|
|
151
153
|
w as isLogoGuid,
|
|
152
154
|
t as resolveInsightRender,
|