@mx-cartographer/experiences 9.5.3 → 9.6.0-alpha-ram1-connect-widget-testing
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 +13 -0
- package/dist/common/components/ConnectDrawer.es.js +17 -44
- package/dist/common/components/ConnectDrawer.es.js.map +1 -1
- package/dist/common/components/ConnectWidgetPanel.d.ts +8 -0
- package/dist/common/components/ConnectWidgetPanel.es.js +44 -0
- package/dist/common/components/ConnectWidgetPanel.es.js.map +1 -0
- package/dist/common/components/CurrencyDialog.d.ts +10 -2
- package/dist/common/components/CurrencyDialog.es.js +56 -50
- package/dist/common/components/CurrencyDialog.es.js.map +1 -1
- package/dist/common/components/dialog/Dialog.d.ts +2 -0
- package/dist/common/components/dialog/Dialog.es.js +30 -30
- package/dist/common/components/dialog/Dialog.es.js.map +1 -1
- package/dist/common/components/index.d.ts +1 -0
- package/dist/common/index.es.js +67 -65
- package/dist/core/index.es.js +111 -109
- package/dist/core/types/Insights.d.ts +33 -16
- package/dist/core/types/Insights.es.js +6 -0
- package/dist/core/types/Insights.es.js.map +1 -0
- package/dist/core/types/index.d.ts +2 -1
- package/dist/core/types/localization/InsightsFeedCopy.d.ts +108 -0
- package/dist/core/types/localization/index.d.ts +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +24 -18
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.d.ts +13 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js +128 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/AmountInputModalBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/index.d.ts +1 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.d.ts +14 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js +14 -0
- package/dist/insights-v2/actionBlocks/AmountInputModalBlock/layout.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.d.ts +21 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js +16 -0
- package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.d.ts +12 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js +25 -0
- package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.d.ts +17 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js +39 -0
- package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js.map +1 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.d.ts +16 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +47 -0
- package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -0
- package/dist/insights-v2/beatActions.d.ts +2 -2
- package/dist/insights-v2/beatActions.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.d.ts +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.d.ts +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.d.ts +5 -2
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js +36 -35
- package/dist/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.d.ts +2 -2
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js +6 -5
- package/dist/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.d.ts +1 -1
- package/dist/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +24 -24
- package/dist/insights-v2/components/CompactInsightCard.d.ts +4 -4
- package/dist/insights-v2/components/CompactInsightCard.es.js +50 -46
- package/dist/insights-v2/components/CompactInsightCard.es.js.map +1 -1
- package/dist/insights-v2/components/ConnectionDetailDrillDown.d.ts +32 -0
- package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js +148 -0
- package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js.map +1 -0
- package/dist/insights-v2/components/FeedbackDialog.d.ts +3 -1
- package/dist/insights-v2/components/FeedbackDialog.es.js +80 -72
- package/dist/insights-v2/components/FeedbackDialog.es.js.map +1 -1
- package/dist/insights-v2/components/FeedbackModal.d.ts +60 -0
- package/dist/insights-v2/components/FeedbackModal.es.js +61 -0
- package/dist/insights-v2/components/FeedbackModal.es.js.map +1 -0
- package/dist/insights-v2/components/SurveyModal.d.ts +65 -0
- package/dist/insights-v2/components/SurveyModal.es.js +138 -0
- package/dist/insights-v2/components/SurveyModal.es.js.map +1 -0
- package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +28 -0
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js +19 -0
- package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -0
- package/dist/insights-v2/ctaActions/runCtaAction.es.js +10 -10
- package/dist/insights-v2/ctaActions/runCtaAction.es.js.map +1 -1
- package/dist/insights-v2/index.d.ts +4 -0
- package/dist/insights-v2/index.es.js +70 -62
- package/dist/insights-v2/mappings/actionBlocksKey.d.ts +5 -0
- package/dist/insights-v2/mappings/actionBlocksKey.es.js +6 -1
- package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
- package/dist/insights-v2/mappings/blocks.d.ts +2 -1
- package/dist/insights-v2/mappings/blocks.es.js +91 -68
- package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
- package/dist/insights-v2/mappings/hasDrawerBlock.d.ts +1 -0
- package/dist/insights-v2/mappings/hasDrawerBlock.es.js +13 -0
- package/dist/insights-v2/mappings/hasDrawerBlock.es.js.map +1 -0
- package/dist/insights-v2/resolveInsightRender.d.ts +8 -5
- package/dist/insights-v2/resolveInsightRender.es.js.map +1 -1
- package/dist/microinsights/cards/InsightCard.es.js +32 -31
- package/dist/microinsights/cards/InsightCard.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useGlobalCopyStore as c, useInsightsV2Store as u } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { useBeatActions as m } from "../beatActions.es.js";
|
|
3
|
+
import b from "../components/SurveyModal.es.js";
|
|
4
|
+
import { observer as p } from "mobx-react-lite";
|
|
5
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
6
|
+
var A = p(function({ beat: t }) {
|
|
7
|
+
const { closeActionDrawer: s } = u(), { onSubmitFeedback: r } = m(), a = c(), o = t.insights_payload, e = a.insights_feed?.survey_modal;
|
|
8
|
+
if (!o || !e) return null;
|
|
9
|
+
const i = {
|
|
10
|
+
title: e.title,
|
|
11
|
+
options: [{
|
|
12
|
+
overline: e.yes_overline,
|
|
13
|
+
label: e.yes_label,
|
|
14
|
+
tone: "positive"
|
|
15
|
+
}, {
|
|
16
|
+
overline: e.no_overline,
|
|
17
|
+
label: e.no_label,
|
|
18
|
+
tone: "negative"
|
|
19
|
+
}],
|
|
20
|
+
submitText: e.submit,
|
|
21
|
+
closeAriaLabel: e.close_aria,
|
|
22
|
+
reasonsTitle: e.reasons_title,
|
|
23
|
+
reasonOptions: Object.values(e.reason_options ?? {}),
|
|
24
|
+
backText: e.back,
|
|
25
|
+
characterLimitLabel: e.character_limit,
|
|
26
|
+
successMessage: e.success_message,
|
|
27
|
+
errorMessage: e.error_message,
|
|
28
|
+
tryAgainText: e.try_again,
|
|
29
|
+
toastCloseAriaLabel: e.toast_close_aria
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ _(b, {
|
|
32
|
+
copy: i,
|
|
33
|
+
isOpen: !0,
|
|
34
|
+
onClose: () => s(),
|
|
35
|
+
onSubmit: (n, l) => r?.({
|
|
36
|
+
beatGuid: o.guid,
|
|
37
|
+
source: "cta",
|
|
38
|
+
option: n,
|
|
39
|
+
detail: l
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
A as SurveyModalActionBlock
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=SurveyModalActionBlock.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SurveyModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/SurveyModalActionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport SurveyModal, { type SurveyModalContent } from '../components/SurveyModal'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `survey_modal_block` — the \"Does this look right?\" confirmation survey\n * (Figma `1941:212640`). Registered like any other drawer block; its content\n * is a MODAL (the dialog portals over the drawer).\n *\n * The survey has no action buttons — its rows act: the positive row submits\n * to the host via `beatActions.onSubmitFeedback` (source `cta`) and shows the\n * status snackbar; the negative row opens the FeedbackModal reasons dialog.\n * The session ends when the flow does (snackbar dismissed or dialogs closed).\n *\n * Copy comes from `insights_feed.survey_modal` in GlobalCopy.\n */\nexport const SurveyModalActionBlock = observer(function SurveyModalActionBlock({\n beat,\n}: ActionBlockProps) {\n const { closeActionDrawer } = useInsightsV2Store()\n const { onSubmitFeedback } = useBeatActions()\n const copyStore = useGlobalCopyStore()\n\n const insights_payload = beat.insights_payload\n const surveyCopy = copyStore.insights_feed?.survey_modal\n\n if (!insights_payload || !surveyCopy) return null\n\n const copy: SurveyModalContent = {\n title: surveyCopy.title,\n options: [\n { overline: surveyCopy.yes_overline, label: surveyCopy.yes_label, tone: 'positive' },\n { overline: surveyCopy.no_overline, label: surveyCopy.no_label, tone: 'negative' },\n ],\n submitText: surveyCopy.submit,\n\n closeAriaLabel: surveyCopy.close_aria,\n reasonsTitle: surveyCopy.reasons_title,\n reasonOptions: Object.values(surveyCopy.reason_options ?? {}),\n backText: surveyCopy.back,\n characterLimitLabel: surveyCopy.character_limit,\n successMessage: surveyCopy.success_message,\n errorMessage: surveyCopy.error_message,\n tryAgainText: surveyCopy.try_again,\n toastCloseAriaLabel: surveyCopy.toast_close_aria,\n }\n\n // Returned (not just fired): a host promise rejection drives the modal's\n // error snackbar + Try Again retry. The session closes when the flow ends\n // (snackbar dismissed), not on submit.\n\n //TODO: Need to update the onSubmit functionality as per pulse. This function is mis-matching with the current approach of switchdirectdeposit and setupdirectdeposit\n const handleSubmit = (option: string, detail?: string) =>\n onSubmitFeedback?.({\n beatGuid: insights_payload.guid,\n source: 'cta',\n option,\n detail,\n })\n\n return (\n <SurveyModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n />\n )\n})\n"],"mappings":";;;;;AAmBA,IAAa,IAAyB,EAAS,SAAgC,EAC7E,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,kBAAA,EAAA,IAAqB,EAAe,GACtC,IAAY,EAAmB,GAE/B,IAAmB,EAAK,kBACxB,IAAa,EAAU,eAAe;AAE5C,MAAI,CAAC,KAAoB,CAAC,EAAY,QAAO;AAE7C,QAAM,IAA2B;AAAA,IAC/B,OAAO,EAAW;AAAA,IAClB,SAAS,CACP;AAAA,MAAE,UAAU,EAAW;AAAA,MAAc,OAAO,EAAW;AAAA,MAAW,MAAM;AAAA,IAAW,GACnF;AAAA,MAAE,UAAU,EAAW;AAAA,MAAa,OAAO,EAAW;AAAA,MAAU,MAAM;AAAA,IAAW,CACnF;AAAA,IACA,YAAY,EAAW;AAAA,IAEvB,gBAAgB,EAAW;AAAA,IAC3B,cAAc,EAAW;AAAA,IACzB,eAAe,OAAO,OAAO,EAAW,kBAAkB,CAAC,CAAC;AAAA,IAC5D,UAAU,EAAW;AAAA,IACrB,qBAAqB,EAAW;AAAA,IAChC,gBAAgB,EAAW;AAAA,IAC3B,cAAc,EAAW;AAAA,IACzB,cAAc,EAAW;AAAA,IACzB,qBAAqB,EAAW;AAAA,EAClC;AAeA,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACN,QAAQ;AAAA,IACR,SAAA,MAAe,EAAkB;AAAA,IACjC,UAbE,CAAgB,GAAgB,MACpC,IAAmB;AAAA,MACjB,UAAU,EAAiB;AAAA,MAC3B,QAAQ;AAAA,MACR,QAAA;AAAA,MACA,QAAA;AAAA,IACF,CAAC;AAAA,EAQA,CAAA;AAEL,CAAC"}
|
|
@@ -13,7 +13,7 @@ export interface UpdateParams {
|
|
|
13
13
|
}
|
|
14
14
|
export interface FeedbackParams {
|
|
15
15
|
beatGuid: string;
|
|
16
|
-
source: InsightRating | 'hide';
|
|
16
|
+
source: InsightRating | 'hide' | 'cta';
|
|
17
17
|
option: string;
|
|
18
18
|
detail?: string;
|
|
19
19
|
}
|
|
@@ -35,7 +35,7 @@ export interface CtaActionParams {
|
|
|
35
35
|
export interface BeatActions {
|
|
36
36
|
onMenuAction?: MenuActionHandlers;
|
|
37
37
|
onUpdate?: (params: UpdateParams) => void;
|
|
38
|
-
onSubmitFeedback?: (params: FeedbackParams) => void
|
|
38
|
+
onSubmitFeedback?: (params: FeedbackParams) => void | Promise<void>;
|
|
39
39
|
onDismissInsight?: (params: DismissParams) => void;
|
|
40
40
|
onUndoDismiss?: (params: {
|
|
41
41
|
beatGuid: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beatActions.es.js","names":[],"sources":["../../src/insights-v2/beatActions.tsx"],"sourcesContent":["import { createContext, useContext, type ReactNode } from 'react'\n\nimport type { DismissType } from './components/DismissInsightDialog'\nimport type { FeedbackDialogCloseReason } from './components/FeedbackDialog'\n\nexport type InsightMenuAction = 'helpful' | 'not_helpful' | 'hide'\nexport type InsightRating = 'helpful' | 'not_helpful'\n\nexport interface MenuActionHandlers {\n onAction: (action: InsightMenuAction) => void\n onOpen?: () => void\n disabled?: boolean\n}\n\nexport interface UpdateParams {\n beatGuid: string\n}\n\nexport interface FeedbackParams {\n beatGuid: string\n source: InsightRating | 'hide'\n option: string\n detail?: string\n}\n\nexport interface DismissParams {\n beatGuid: string\n type: DismissType\n}\n\n/**\n * A CTA side effect the host must perform because experiences cannot (beat-owned endpoints,\n * spending plan items, third-party SDKs). `name` is agreed between the ctaActions table and\n * the host; see insights-v2/ctaActions/README.md for the list.\n */\nexport interface CtaActionParams {\n beatGuid: string\n name: string\n params?: Record<string, unknown>\n}\n\n/** Host callbacks for a beat card. */\nexport interface BeatActions {\n onMenuAction?: MenuActionHandlers\n onUpdate?: (params: UpdateParams) => void\n onSubmitFeedback?: (params: FeedbackParams) => void
|
|
1
|
+
{"version":3,"file":"beatActions.es.js","names":[],"sources":["../../src/insights-v2/beatActions.tsx"],"sourcesContent":["import { createContext, useContext, type ReactNode } from 'react'\n\nimport type { DismissType } from './components/DismissInsightDialog'\nimport type { FeedbackDialogCloseReason } from './components/FeedbackDialog'\n\nexport type InsightMenuAction = 'helpful' | 'not_helpful' | 'hide'\nexport type InsightRating = 'helpful' | 'not_helpful'\n\nexport interface MenuActionHandlers {\n onAction: (action: InsightMenuAction) => void\n onOpen?: () => void\n disabled?: boolean\n}\n\nexport interface UpdateParams {\n beatGuid: string\n}\n\nexport interface FeedbackParams {\n beatGuid: string\n source: InsightRating | 'hide' | 'cta'\n option: string\n detail?: string\n}\n\nexport interface DismissParams {\n beatGuid: string\n type: DismissType\n}\n\n/**\n * A CTA side effect the host must perform because experiences cannot (beat-owned endpoints,\n * spending plan items, third-party SDKs). `name` is agreed between the ctaActions table and\n * the host; see insights-v2/ctaActions/README.md for the list.\n */\nexport interface CtaActionParams {\n beatGuid: string\n name: string\n params?: Record<string, unknown>\n}\n\n/** Host callbacks for a beat card. */\nexport interface BeatActions {\n onMenuAction?: MenuActionHandlers\n onUpdate?: (params: UpdateParams) => void\n onSubmitFeedback?: (params: FeedbackParams) => void | Promise<void>\n onDismissInsight?: (params: DismissParams) => void\n onUndoDismiss?: (params: { beatGuid: string }) => void\n onFeedbackDialogClose?: (reason: FeedbackDialogCloseReason) => void\n onFeedbackDialogBack?: () => void\n onFeedbackTextFocus?: () => void\n /**\n * Opens the host's contact-support flow for a `contact_support_block` CTA. insights-v2 cannot\n * import the help module (hosts that don't ship it stub the import), so the host supplies it:\n * the experiences Help widget wires `RequestSupport`; pulse wires its own. When absent, the CTA\n * renders disabled (see `isContactSupportCtaDisabled`).\n */\n onContactSupport?: () => void\n onCtaAction?: (params: CtaActionParams) => Promise<void> | void\n}\n\nconst BeatActionsContext = createContext<BeatActions>({})\n\nexport const BeatActionsProvider = ({\n value,\n children,\n}: {\n value: BeatActions\n children: ReactNode\n}) => <BeatActionsContext.Provider value={value}>{children}</BeatActionsContext.Provider>\n\nexport const useBeatActions = () => useContext(BeatActionsContext)\n"],"mappings":";;AA6DA,IAAM,IAAqB,EAA2B,CAAC,CAAC,GAE3C,IAAA,CAAuB,EAClC,OAAA,GACA,UAAA,EAAA,MAII,gBAAA,EAAC,EAAmB,UAApB;AAAA,EAAoC,OAAA;AAAA,EAAQ,UAAA;AAAsC,CAAA,GAE3E,IAAA,MAAuB,EAAW,CAAkB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Theme } from '@mui/material/styles';
|
|
2
2
|
import { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData';
|
|
3
|
-
export declare const getDonutChartColors: (variant: string | null, blockData: InsightsInstanceSlotData, theme: Theme) => [string, string];
|
|
3
|
+
export declare const getDonutChartColors: (variant: string | null | undefined, blockData: InsightsInstanceSlotData, theme: Theme) => [string, string];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\nimport { getCategoryColor } from '../../../../core/utils/CategoryUtil'\nimport { getLayoutConfig } from './layout'\nimport type { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData'\n\nexport const getDonutChartColors = (\n variant: string | null,\n blockData: InsightsInstanceSlotData,\n theme: Theme,\n): [string, string] => {\n const layouts = getLayoutConfig(theme)\n const variantConfig = layouts[variant as keyof ReturnType<typeof getLayoutConfig>] as\n | { dynamicPrimary: string; secondaryColor: string }\n | { secondaryColor: string }\n | { colors: [string, string] }\n\n if ('dynamicPrimary' in variantConfig && variantConfig.dynamicPrimary === 'creditUtilization') {\n const utilization = Number(blockData.main?.value ?? 0)\n const primaryColor = utilization > 30 ? theme.palette.error.main : theme.palette.warning.main\n return [primaryColor, variantConfig.secondaryColor]\n }\n\n if ('secondaryColor' in variantConfig) {\n const categoryColor = getCategoryColor(blockData.category_guid ?? '', theme)\n return [categoryColor, variantConfig.secondaryColor]\n }\n\n return variantConfig.colors\n}\n"],"mappings":";;AAKA,IAAa,IAAA,CACX,GACA,GACA,MACqB;AAErB,QAAM,IADU,EAAgB,CACV,EAAQ,CAAA;AAK9B,SAAI,oBAAoB,KAAiB,EAAc,mBAAmB,sBAGjE,CAFa,OAAO,EAAU,MAAM,SAAS,CAC/B,IAAc,KAAK,EAAM,QAAQ,MAAM,OAAO,EAAM,QAAQ,QAAQ,MACnE,EAAc,cAAc,IAGhD,oBAAoB,IAEf,CADe,EAAiB,EAAU,iBAAiB,IAAI,CAC9D,GAAe,EAAc,cAAc,IAG9C,EAAc;AACvB"}
|
|
1
|
+
{"version":3,"file":"utils.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DonutChartBlock/utils.ts"],"sourcesContent":["import { type Theme } from '@mui/material/styles'\nimport { getCategoryColor } from '../../../../core/utils/CategoryUtil'\nimport { getLayoutConfig } from './layout'\nimport type { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData'\n\nexport const getDonutChartColors = (\n variant: string | null | undefined,\n blockData: InsightsInstanceSlotData,\n theme: Theme,\n): [string, string] => {\n const layouts = getLayoutConfig(theme)\n const variantConfig = layouts[variant as keyof ReturnType<typeof getLayoutConfig>] as\n | { dynamicPrimary: string; secondaryColor: string }\n | { secondaryColor: string }\n | { colors: [string, string] }\n\n if ('dynamicPrimary' in variantConfig && variantConfig.dynamicPrimary === 'creditUtilization') {\n const utilization = Number(blockData.main?.value ?? 0)\n const primaryColor = utilization > 30 ? theme.palette.error.main : theme.palette.warning.main\n return [primaryColor, variantConfig.secondaryColor]\n }\n\n if ('secondaryColor' in variantConfig) {\n const categoryColor = getCategoryColor(blockData.category_guid ?? '', theme)\n return [categoryColor, variantConfig.secondaryColor]\n }\n\n return variantConfig.colors\n}\n"],"mappings":";;AAKA,IAAa,IAAA,CACX,GACA,GACA,MACqB;AAErB,QAAM,IADU,EAAgB,CACV,EAAQ,CAAA;AAK9B,SAAI,oBAAoB,KAAiB,EAAc,mBAAmB,sBAGjE,CAFa,OAAO,EAAU,MAAM,SAAS,CAC/B,IAAc,KAAK,EAAM,QAAQ,MAAM,OAAO,EAAM,QAAQ,QAAQ,MACnE,EAAc,cAAc,IAGhD,oBAAoB,IAEf,CADe,EAAiB,EAAU,iBAAiB,IAAI,CAC9D,GAAe,EAAc,cAAc,IAG9C,EAAc;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nexport const getLayoutConfig = (theme: Theme, variant
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/layout.ts"],"sourcesContent":["import type { Theme } from '@mui/material/styles'\n\nexport const getLayoutConfig = (theme: Theme, variant?: string | null) => {\n const config = {\n SpendToIncome: {\n color: [theme.palette.categories.billsUtilities, theme.palette.chart.chart1] as string[],\n },\n DebtToIncome: {\n color: [theme.palette.chart.chart5, theme.palette.chart.chart1] as string[],\n },\n SavingsToIncome: {\n color: [theme.palette.chartMono.chartMono5, theme.palette.chartMono.chartMono3] as string[],\n },\n }\n return config[variant as keyof typeof config]\n}\n"],"mappings":"AAEA,IAAa,IAAA,CAAmB,GAAc,OAYrC;AAAA,EAVL,eAAe,EACb,OAAO,CAAC,EAAM,QAAQ,WAAW,gBAAgB,EAAM,QAAQ,MAAM,MAAM,EAC7E;AAAA,EACA,cAAc,EACZ,OAAO,CAAC,EAAM,QAAQ,MAAM,QAAQ,EAAM,QAAQ,MAAM,MAAM,EAChE;AAAA,EACA,iBAAiB,EACf,OAAO,CAAC,EAAM,QAAQ,UAAU,YAAY,EAAM,QAAQ,UAAU,UAAU,EAChF;AAEK,GAAO,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData';
|
|
2
2
|
interface IconComponentProps {
|
|
3
3
|
blockData: InsightsInstanceSlotData;
|
|
4
|
-
variant
|
|
4
|
+
variant?: string | null;
|
|
5
5
|
}
|
|
6
6
|
export declare const IconComponent: ({ blockData, variant }: IconComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { getLayoutConfig } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData'\n\ninterface IconComponentProps {\n blockData: InsightsInstanceSlotData\n variant
|
|
1
|
+
{"version":3,"file":"IconComponent.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/AccountBlock/IconComponent.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\nimport { Icon } from '@mxenabled/mx-icons'\nimport { InstitutionLogo } from '@mxenabled/mxui'\nimport { IconBacking } from '../../../../common'\nimport { getLayoutConfig } from './layout'\nimport { useTheme } from '@mui/material/styles'\nimport type { InsightsInstanceSlotData } from '../../../../core/types/InsightsInstanceSlotData'\n\ninterface IconComponentProps {\n blockData: InsightsInstanceSlotData\n variant?: string | null\n}\n\nexport const IconComponent = ({ blockData, variant }: IconComponentProps) => {\n const theme = useTheme()\n const layoutConfig = getLayoutConfig(theme)[variant as keyof ReturnType<typeof getLayoutConfig>]\n\n if (blockData.institution_guid) {\n return (\n <Stack sx={{ alignItems: 'center', flexDirection: 'row', position: 'relative' }}>\n <InstitutionLogo\n alt={`${blockData.institution_name}`}\n institutionGuid={`${blockData.institution_guid}`}\n size={48}\n />\n <IconBacking size={20} sx={{ position: 'absolute', right: -8, top: -8 }}>\n <Icon\n color=\"error\"\n fill={true}\n name=\"error\"\n size={20}\n sx={{ gridColumn: 1, gridRow: 1, zIndex: 2 }}\n />\n </IconBacking>\n </Stack>\n )\n }\n\n if (blockData.icon_name) {\n return (\n <Stack\n sx={{\n alignItems: 'center',\n bgcolor: layoutConfig.logo_bGcolor,\n borderRadius: '6px',\n height: 48,\n justifyContent: 'center',\n width: 48,\n ...(layoutConfig.logo_border_color && {\n borderColor: layoutConfig.logo_border_color,\n borderStyle: 'solid',\n borderWidth: 1.5,\n }),\n }}\n >\n <Icon\n name={blockData.icon_name}\n size={24}\n sx={{\n color: layoutConfig.logo_color,\n }}\n />\n </Stack>\n )\n }\n\n return null\n}\n"],"mappings":";;;;;;;AAaA,IAAa,IAAA,CAAiB,EAAE,WAAA,GAAW,SAAA,EAAA,MAAkC;AAC3E,QAAM,IAAQ,EAAS,GACjB,IAAe,EAAgB,CAAK,EAAE,CAAA;AAE5C,SAAI,EAAU,mBAEV,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI;AAAA,MAAE,YAAY;AAAA,MAAU,eAAe;AAAA,MAAO,UAAU;AAAA,IAAW;AAAA,IAA9E,UAAA,CACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,GAAG,EAAU,gBAAA;AAAA,MAClB,iBAAiB,GAAG,EAAU,gBAAA;AAAA,MAC9B,MAAM;AAAA,IACP,CAAA,GACD,gBAAA,EAAC,GAAD;AAAA,MAAa,MAAM;AAAA,MAAI,IAAI;AAAA,QAAE,UAAU;AAAA,QAAY,OAAO;AAAA,QAAI,KAAK;AAAA,MAAG;AAAA,MACpE,UAAA,gBAAA,EAAC,GAAD;AAAA,QACE,OAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAK;AAAA,QACL,MAAM;AAAA,QACN,IAAI;AAAA,UAAE,YAAY;AAAA,UAAG,SAAS;AAAA,UAAG,QAAQ;AAAA,QAAE;AAAA,MAC5C,CAAA;AAAA,IACU,CAAA,CACR;AAAA,OAIP,EAAU,YAEV,gBAAA,EAAC,GAAD;AAAA,IACE,IAAI;AAAA,MACF,YAAY;AAAA,MACZ,SAAS,EAAa;AAAA,MACtB,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,MACP,GAAI,EAAa,qBAAqB;AAAA,QACpC,aAAa,EAAa;AAAA,QAC1B,aAAa;AAAA,QACb,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,MAAM,EAAU;AAAA,MAChB,MAAM;AAAA,MACN,IAAI,EACF,OAAO,EAAa,WACtB;AAAA,IACD,CAAA;AAAA,EACI,CAAA,IAIJ;AACT"}
|
|
@@ -15,11 +15,14 @@ export declare const TransactionBlockVariant: {
|
|
|
15
15
|
/**
|
|
16
16
|
* The `transaction_block` (ditto `blocks.name` for LargeTransactionV2).
|
|
17
17
|
*
|
|
18
|
-
* Renders rows the backend already localized and carried inline on `instance_slot.
|
|
18
|
+
* Renders rows the backend already localized and carried inline on `instance_slot.data.series`
|
|
19
19
|
* (`logo`, `primary_text`, `secondary_text`, `amount`). Only the amount is formatted here,
|
|
20
20
|
* because the contract sends it as a number.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo
|
|
23
|
+
* alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.
|
|
24
|
+
*
|
|
25
|
+
* Under `with_header` the card header comes from `instance_slot.data.header_text`, which tupac sends
|
|
23
26
|
* as the transaction date. It deliberately does *not* come from the first row: on a `with_merchant`
|
|
24
27
|
* card a row's `secondary_text` is the category, so reading it here rendered the category twice
|
|
25
28
|
* and dropped the date entirely.
|
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
import { useCategoryStore as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
import { useCategoryStore as g } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { slot as c } from "../../../../core/types/Insights.es.js";
|
|
3
|
+
import { formatCurrency as l } from "../../../../core/utils/NumberFormatting.es.js";
|
|
4
|
+
import { logoFromRef as _ } from "../../../components/shared/EntityLogo.es.js";
|
|
5
|
+
import f from "../../../components/TransactionListCard.es.js";
|
|
6
|
+
import { observer as h } from "mobx-react-lite";
|
|
7
|
+
import { CategoryIcon as y, InstitutionLogo as p, MerchantLogo as x } from "@mxenabled/mxui";
|
|
8
|
+
import { Icon as v } from "@mxenabled/mx-icons";
|
|
9
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
10
|
+
import d from "@mui/material/Box";
|
|
11
|
+
var I = {
|
|
11
12
|
WithHeader: "with_header",
|
|
12
13
|
NoHeader: "no_header"
|
|
13
|
-
},
|
|
14
|
-
const t =
|
|
14
|
+
}, o = 32, G = Math.round(o * 0.625), C = (i, n) => {
|
|
15
|
+
const t = _(i.logo, i.primary_text);
|
|
15
16
|
if (t) {
|
|
16
|
-
if (t.logo_name) return /* @__PURE__ */
|
|
17
|
+
if (t.logo_name) return /* @__PURE__ */ r(d, {
|
|
17
18
|
sx: {
|
|
18
19
|
alignItems: "center",
|
|
19
20
|
display: "flex",
|
|
20
|
-
height:
|
|
21
|
+
height: o,
|
|
21
22
|
justifyContent: "center",
|
|
22
|
-
width:
|
|
23
|
+
width: o
|
|
23
24
|
},
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
+
children: /* @__PURE__ */ r(v, {
|
|
25
26
|
name: t.logo_name,
|
|
26
|
-
size:
|
|
27
|
+
size: G,
|
|
27
28
|
sx: { color: t.logo_color }
|
|
28
29
|
})
|
|
29
30
|
});
|
|
30
|
-
if (t.merchant_guid) return /* @__PURE__ */
|
|
31
|
+
if (t.merchant_guid) return /* @__PURE__ */ r(x, {
|
|
31
32
|
alt: t.merchant_name ?? "",
|
|
32
33
|
categoryGuid: t.category_guid ? n(t.category_guid) : "",
|
|
33
34
|
merchantGuid: t.merchant_guid,
|
|
34
|
-
size:
|
|
35
|
+
size: o
|
|
35
36
|
});
|
|
36
|
-
if (t.institution_guid) return /* @__PURE__ */
|
|
37
|
+
if (t.institution_guid) return /* @__PURE__ */ r(p, {
|
|
37
38
|
alt: t.institution_name ?? "",
|
|
38
39
|
institutionGuid: t.institution_guid,
|
|
39
|
-
size:
|
|
40
|
+
size: o
|
|
40
41
|
});
|
|
41
42
|
if (t.category_guid) {
|
|
42
43
|
const a = n(t.category_guid);
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ r(d, {
|
|
44
45
|
"data-testid": `category-icon-${a}`,
|
|
45
46
|
sx: { display: "flex" },
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ r(y, {
|
|
47
48
|
categoryGuid: a,
|
|
48
|
-
size:
|
|
49
|
+
size: o
|
|
49
50
|
})
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
},
|
|
54
|
-
const { getTopLevelCategoryGuid: n } =
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
header:
|
|
59
|
-
rows:
|
|
60
|
-
amount: typeof e.amount == "number" ?
|
|
61
|
-
leading:
|
|
54
|
+
}, j = h(({ payload: i }) => {
|
|
55
|
+
const { getTopLevelCategoryGuid: n } = g(), { data: t, variant: a } = i.instance_slot, s = c(t, "series"), m = c(t, "header_text");
|
|
56
|
+
if (!Array.isArray(s) || !s.length) return null;
|
|
57
|
+
const u = a === I.WithHeader && typeof m == "string" ? m : void 0;
|
|
58
|
+
return /* @__PURE__ */ r(f, {
|
|
59
|
+
header: u,
|
|
60
|
+
rows: s.map((e) => ({
|
|
61
|
+
amount: typeof e.amount == "number" ? l(e.amount, "0,0.00") : "",
|
|
62
|
+
leading: C(e, n),
|
|
62
63
|
subtitle: e.secondary_text ?? "",
|
|
63
64
|
title: e.primary_text ?? ""
|
|
64
65
|
}))
|
|
65
66
|
});
|
|
66
67
|
});
|
|
67
68
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
j as TransactionBlock,
|
|
70
|
+
I as TransactionBlockVariant
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
//# sourceMappingURL=TransactionBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport type { InsightsPayload, InstanceSlotRow } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\n/**\n * Variants from ditto `lib/ditto/beats/large_transaction_v2.yml`:\n * - `with_header` — transaction row under a date header (the `with_merchant` card).\n * - `no_header` — the row alone (the `no_merchant` card).\n */\nexport const TransactionBlockVariant = {\n WithHeader: 'with_header',\n NoHeader: 'no_header',\n} as const\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block` (ditto `blocks.name` for LargeTransactionV2).\n *\n * Renders rows the backend already localized and carried inline on `instance_slot.
|
|
1
|
+
{"version":3,"file":"TransactionBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/TransactionBlock/TransactionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport Box from '@mui/material/Box'\n\nimport { CategoryIcon, InstitutionLogo, MerchantLogo } from '@mxenabled/mxui'\nimport { Icon } from '@mxenabled/mx-icons'\n\nimport { useCategoryStore } from '../../../../common'\nimport { slot } from '../../../../core'\nimport type { InsightsPayload, InstanceSlotRow } from '../../../../core'\nimport { formatCurrency } from '../../../../core/utils/NumberFormatting'\n\nimport TransactionListCard from '../../../components/TransactionListCard'\nimport { logoFromRef } from '../../../components/shared/EntityLogo'\n\ninterface TransactionBlockProps {\n payload: InsightsPayload\n beatGuid?: string\n}\n\n/**\n * Variants from ditto `lib/ditto/beats/large_transaction_v2.yml`:\n * - `with_header` — transaction row under a date header (the `with_merchant` card).\n * - `no_header` — the row alone (the `no_merchant` card).\n */\nexport const TransactionBlockVariant = {\n WithHeader: 'with_header',\n NoHeader: 'no_header',\n} as const\n\nconst ROW_LOGO_SIZE = 32\n// Same glyph-to-tile ratio mxui's `CategoryIcon` uses, so a status icon sits like the other logos.\nconst ROW_ICON_SIZE = Math.round(ROW_LOGO_SIZE * 0.625)\n\n/**\n * Renders the row's leading logo from its `LogoRef`: a status icon, or an entity guid whose prefix\n * names the entity. An unrecognized prefix renders no logo rather than guessing.\n *\n * `resolveTopLevelCategory`: mxui's `CategoryIcon` only knows the top-level category guids and\n * silently falls back to the Uncategorized icon for a sub-category. The details drawer avoids\n * this by passing `transaction.top_level_category_guid`; the row only has the raw guid, so it is\n * walked up to its parent here (identity until categories load). That applies both to a `CAT-`\n * row logo and to a merchant's `fallback_guid`, which `MerchantLogo` draws through the same\n * `CategoryIcon` when the merchant image fails to load.\n */\nconst renderRowLogo = (row: InstanceSlotRow, resolveTopLevelCategory: (guid: string) => string) => {\n const logo = logoFromRef(row.logo, row.primary_text)\n\n if (!logo) return undefined\n\n if (logo.logo_name) {\n // A fixed box the size of the other logos keeps the row's text column aligned.\n return (\n <Box\n sx={{\n alignItems: 'center',\n display: 'flex',\n height: ROW_LOGO_SIZE,\n justifyContent: 'center',\n width: ROW_LOGO_SIZE,\n }}\n >\n <Icon name={logo.logo_name} size={ROW_ICON_SIZE} sx={{ color: logo.logo_color }} />\n </Box>\n )\n }\n\n if (logo.merchant_guid) {\n return (\n <MerchantLogo\n alt={logo.merchant_name ?? ''}\n categoryGuid={logo.category_guid ? resolveTopLevelCategory(logo.category_guid) : ''}\n merchantGuid={logo.merchant_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.institution_guid) {\n return (\n <InstitutionLogo\n alt={logo.institution_name ?? ''}\n institutionGuid={logo.institution_guid}\n size={ROW_LOGO_SIZE}\n />\n )\n }\n\n if (logo.category_guid) {\n const topLevelGuid = resolveTopLevelCategory(logo.category_guid)\n return (\n <Box data-testid={`category-icon-${topLevelGuid}`} sx={{ display: 'flex' }}>\n <CategoryIcon categoryGuid={topLevelGuid} size={ROW_LOGO_SIZE} />\n </Box>\n )\n }\n\n return undefined\n}\n\n/**\n * The `transaction_block` (ditto `blocks.name` for LargeTransactionV2).\n *\n * Renders rows the backend already localized and carried inline on `instance_slot.data.series`\n * (`logo`, `primary_text`, `secondary_text`, `amount`). Only the amount is formatted here,\n * because the contract sends it as a number.\n *\n * This is the full/mini shape. The reduced widgets (micro, embedded) resolve to the row logo\n * alone, carried flat on `data.logo` with no `series`, and are drawn by `CompactInsightCard`.\n *\n * Under `with_header` the card header comes from `instance_slot.data.header_text`, which tupac sends\n * as the transaction date. It deliberately does *not* come from the first row: on a `with_merchant`\n * card a row's `secondary_text` is the category, so reading it here rendered the category twice\n * and dropped the date entirely.\n */\nexport const TransactionBlock = observer(({ payload }: TransactionBlockProps) => {\n const { getTopLevelCategoryGuid } = useCategoryStore()\n const { data, variant } = payload.instance_slot\n const series = slot<InstanceSlotRow[]>(data, 'series')\n const headerText = slot<string>(data, 'header_text')\n\n if (!Array.isArray(series) || !series.length) return null\n\n const header =\n variant === TransactionBlockVariant.WithHeader && typeof headerText === 'string'\n ? headerText\n : undefined\n\n return (\n <TransactionListCard\n header={header}\n rows={series.map((row) => ({\n amount: typeof row.amount === 'number' ? formatCurrency(row.amount, '0,0.00') : '',\n leading: renderRowLogo(row, getTopLevelCategoryGuid),\n subtitle: row.secondary_text ?? '',\n title: row.primary_text ?? '',\n }))}\n />\n )\n})\n"],"mappings":";;;;;;;;;;AAyBA,IAAa,IAA0B;AAAA,EACrC,YAAY;AAAA,EACZ,UAAU;AACZ,GAEM,IAAgB,IAEhB,IAAgB,KAAK,MAAM,IAAgB,KAAK,GAahD,IAAA,CAAiB,GAAsB,MAAsD;AACjG,QAAM,IAAO,EAAY,EAAI,MAAM,EAAI,YAAY;AAEnD,MAAK,GAEL;AAAA,QAAI,EAAK,UAEP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,IAAI;AAAA,QACF,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,gBAAgB;AAAA,QAChB,OAAO;AAAA,MACT;AAAA,MAEA,UAAA,gBAAA,EAAC,GAAD;AAAA,QAAM,MAAM,EAAK;AAAA,QAAW,MAAM;AAAA,QAAe,IAAI,EAAE,OAAO,EAAK,WAAW;AAAA,MAAI,CAAA;AAAA,IAC/E,CAAA;AAIT,QAAI,EAAK,cACP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,EAAK,iBAAiB;AAAA,MAC3B,cAAc,EAAK,gBAAgB,EAAwB,EAAK,aAAa,IAAI;AAAA,MACjF,cAAc,EAAK;AAAA,MACnB,MAAM;AAAA,IACP,CAAA;AAIL,QAAI,EAAK,iBACP,QACE,gBAAA,EAAC,GAAD;AAAA,MACE,KAAK,EAAK,oBAAoB;AAAA,MAC9B,iBAAiB,EAAK;AAAA,MACtB,MAAM;AAAA,IACP,CAAA;AAIL,QAAI,EAAK,eAAe;AACtB,YAAM,IAAe,EAAwB,EAAK,aAAa;AAC/D,aACE,gBAAA,EAAC,GAAD;AAAA,QAAK,eAAa,iBAAiB,CAAA;AAAA,QAAgB,IAAI,EAAE,SAAS,OAAO;AAAA,QACvE,UAAA,gBAAA,EAAC,GAAD;AAAA,UAAc,cAAc;AAAA,UAAc,MAAM;AAAA,QAAgB,CAAA;AAAA,MAC7D,CAAA;AAAA,IAET;AAAA;AAGF,GAiBa,IAAmB,EAAA,CAAU,EAAE,SAAA,EAAA,MAAqC;AAC/E,QAAM,EAAE,yBAAA,EAAA,IAA4B,EAAiB,GAC/C,EAAE,MAAA,GAAM,SAAA,EAAA,IAAY,EAAQ,eAC5B,IAAS,EAAwB,GAAM,QAAQ,GAC/C,IAAa,EAAa,GAAM,aAAa;AAEnD,MAAI,CAAC,MAAM,QAAQ,CAAM,KAAK,CAAC,EAAO,OAAQ,QAAO;AAErD,QAAM,IACJ,MAAY,EAAwB,cAAc,OAAO,KAAe,WACpE,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IACU,QAAA;AAAA,IACR,MAAM,EAAO,IAAA,CAAK,OAAS;AAAA,MACzB,QAAQ,OAAO,EAAI,UAAW,WAAW,EAAe,EAAI,QAAQ,QAAQ,IAAI;AAAA,MAChF,SAAS,EAAc,GAAK,CAAuB;AAAA,MACnD,UAAU,EAAI,kBAAkB;AAAA,MAChC,OAAO,EAAI,gBAAgB;AAAA,IAC7B,EAAE;AAAA,EACH,CAAA;AAEL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockProps } from '../../types';
|
|
2
|
-
/** The Withdrawal row on `instance_slot.
|
|
2
|
+
/** The Withdrawal row on `instance_slot.data.series`. */
|
|
3
3
|
export interface WithdrawalRow {
|
|
4
4
|
amount?: number;
|
|
5
5
|
amount_label?: string;
|
|
@@ -9,7 +9,7 @@ export interface WithdrawalRow {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* The `withdrawal_block` (Highlight Withdrawal), reading one row on
|
|
12
|
-
* `instance_slot.
|
|
12
|
+
* `instance_slot.data.series`. Text (`amount_label`, `withdrawal_date`,
|
|
13
13
|
* `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the
|
|
14
14
|
* card. Renders nothing unless the row carries both numbers.
|
|
15
15
|
*/
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import l from "
|
|
1
|
+
import { slot as l } from "../../../../core/types/Insights.es.js";
|
|
2
|
+
import o from "../../../components/WithdrawalCard.es.js";
|
|
2
3
|
import n from "@mui/material/Stack";
|
|
3
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
var
|
|
5
|
-
const r = e.instance_slot.
|
|
5
|
+
var c = ({ payload: e }) => {
|
|
6
|
+
const r = l(e.instance_slot.data, "series"), [a] = Array.isArray(r) ? r : [];
|
|
6
7
|
return !Number.isFinite(a?.amount) || !Number.isFinite(a?.balance) ? null : /* @__PURE__ */ t(n, {
|
|
7
8
|
sx: { px: 16 },
|
|
8
|
-
children: /* @__PURE__ */ t(
|
|
9
|
+
children: /* @__PURE__ */ t(o, {
|
|
9
10
|
amount: a.amount,
|
|
10
11
|
amountLabel: a.amount_label,
|
|
11
12
|
balance: a.balance,
|
|
@@ -15,7 +16,7 @@ var s = ({ payload: e }) => {
|
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
c as default
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
//# sourceMappingURL=WithdrawalBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithdrawalBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport WithdrawalCard from '../../../components/WithdrawalCard'\nimport type { BlockProps } from '../../types'\n\n/** The Withdrawal row on `instance_slot.
|
|
1
|
+
{"version":3,"file":"WithdrawalBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ComponentBlocks/WithdrawalBlock/WithdrawalBlock.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { slot } from '../../../../core'\nimport WithdrawalCard from '../../../components/WithdrawalCard'\nimport type { BlockProps } from '../../types'\n\n/** The Withdrawal row on `instance_slot.data.series`. */\nexport interface WithdrawalRow {\n amount?: number\n amount_label?: string\n balance?: number\n balance_label?: string\n withdrawal_date?: string\n}\n\n/**\n * The `withdrawal_block` (Highlight Withdrawal), reading one row on\n * `instance_slot.data.series`. Text (`amount_label`, `withdrawal_date`,\n * `balance_label`) renders as sent; `amount` and `balance` are numbers and are formatted by the\n * card. Renders nothing unless the row carries both numbers.\n */\nconst WithdrawalBlock = ({ payload }: BlockProps) => {\n const rows = slot<WithdrawalRow[]>(payload.instance_slot.data, 'series')\n const [row] = Array.isArray(rows) ? rows : []\n\n if (!Number.isFinite(row?.amount) || !Number.isFinite(row?.balance)) return null\n\n return (\n <Stack sx={{ px: 16 }}>\n <WithdrawalCard\n amount={row.amount as number}\n amountLabel={row.amount_label}\n balance={row.balance as number}\n balanceLabel={row.balance_label}\n withdrawalDate={row.withdrawal_date}\n />\n </Stack>\n )\n}\n\nexport default WithdrawalBlock\n"],"mappings":";;;;AAqBA,IAAM,IAAA,CAAmB,EAAE,SAAA,EAAA,MAA0B;AACnD,QAAM,IAAO,EAAsB,EAAQ,cAAc,MAAM,QAAQ,GACjE,CAAC,CAAA,IAAO,MAAM,QAAQ,CAAI,IAAI,IAAO,CAAC;AAE5C,SAAI,CAAC,OAAO,SAAS,GAAK,MAAM,KAAK,CAAC,OAAO,SAAS,GAAK,OAAO,IAAU,OAG1E,gBAAA,EAAC,GAAD;AAAA,IAAO,IAAI,EAAE,IAAI,GAAG;AAAA,IAClB,UAAA,gBAAA,EAAC,GAAD;AAAA,MACE,QAAQ,EAAI;AAAA,MACZ,aAAa,EAAI;AAAA,MACjB,SAAS,EAAI;AAAA,MACb,cAAc,EAAI;AAAA,MAClB,gBAAgB,EAAI;AAAA,IACrB,CAAA;AAAA,EACI,CAAA;AAEX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const getLayoutConfig: (variant
|
|
1
|
+
export declare const getLayoutConfig: (variant?: string | null, isCibc?: boolean) => {
|
|
2
2
|
image: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
|
3
3
|
} | {
|
|
4
4
|
image: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.ts"],"sourcesContent":["// SVGs to be moved to S3 and imported from there.\nimport { ReactComponent as UpcomingTaxDeadline } from './images/UpcomingTaxDeadlineAlert.svg'\nimport { ReactComponent as UpcomingTaxDeadlineCIBC } from './images/UpcomingTaxDeadlineAlertCIBC.svg'\n\nimport { ReactComponent as FederalBankHoliday } from './images/FederalBankHoliday.svg'\nimport { ReactComponent as FederalBankHolidayCIBC } from './images/FederalBankHolidayCibc.svg'\n\nimport { ReactComponent as DesignateEmergencySavingsAccount } from './images/DesignateEmergencySavingsAccount.svg'\n\nexport const getLayoutConfig = (variant
|
|
1
|
+
{"version":3,"file":"layout.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ImageBlocks/SVGImageBlock/layout.ts"],"sourcesContent":["// SVGs to be moved to S3 and imported from there.\nimport { ReactComponent as UpcomingTaxDeadline } from './images/UpcomingTaxDeadlineAlert.svg'\nimport { ReactComponent as UpcomingTaxDeadlineCIBC } from './images/UpcomingTaxDeadlineAlertCIBC.svg'\n\nimport { ReactComponent as FederalBankHoliday } from './images/FederalBankHoliday.svg'\nimport { ReactComponent as FederalBankHolidayCIBC } from './images/FederalBankHolidayCibc.svg'\n\nimport { ReactComponent as DesignateEmergencySavingsAccount } from './images/DesignateEmergencySavingsAccount.svg'\n\nexport const getLayoutConfig = (variant?: string | null, isCibc: boolean = false) => {\n const config = {\n Holiday: {\n image: isCibc ? FederalBankHolidayCIBC : FederalBankHoliday,\n },\n Reminder: {\n image: isCibc ? UpcomingTaxDeadlineCIBC : UpcomingTaxDeadline,\n },\n Savings: {\n image: DesignateEmergencySavingsAccount,\n },\n }\n return config[variant as keyof typeof config]\n}\n"],"mappings":";;;;;AASA,IAAa,IAAA,CAAmB,GAAyB,IAAkB,QAYlE;AAAA,EAVL,SAAS,EACP,OAAO,IAAS,IAAyB,EAC3C;AAAA,EACA,UAAU,EACR,OAAO,IAAS,IAA0B,EAC5C;AAAA,EACA,SAAS,EACP,OAAO,EACT;AAEK,GAAO,CAAA"}
|
|
@@ -3,18 +3,18 @@ import { BeatActionsProvider as R } from "../beatActions.es.js";
|
|
|
3
3
|
import { isContactSupportCtaDisabled as H } from "../actionBlocks/ContactSupportActionBlock.es.js";
|
|
4
4
|
import { logoFromRef as M } from "./shared/EntityLogo.es.js";
|
|
5
5
|
import { actionBlocksKey as P } from "../mappings/actionBlocksKey.es.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import z from "
|
|
9
|
-
import G from "
|
|
10
|
-
import
|
|
11
|
-
import X from "./
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import U from "./FeedbackDialog.es.js";
|
|
7
|
+
import { ErrorCard as j } from "./ErrorCard.es.js";
|
|
8
|
+
import { useBeatCtaActions as z } from "../ctaActions/useCtaAction.es.js";
|
|
9
|
+
import { blocks as G } from "../mappings/blocks.es.js";
|
|
10
|
+
import K from "./Footer.es.js";
|
|
11
|
+
import X from "./Header.es.js";
|
|
12
|
+
import { FeedbackBar as V } from "./FeedbackBar.es.js";
|
|
13
|
+
import { DismissInsightDialog as W } from "./DismissInsightDialog.es.js";
|
|
14
|
+
import { HiddenConfirmationCard as Y } from "./HiddenConfirmationCard.es.js";
|
|
15
|
+
import { LoadingCard as q } from "./LoadingCard.es.js";
|
|
16
|
+
import { ObsolesceBanner as J } from "./ObsolesceBanner.es.js";
|
|
17
|
+
import { ActionBlockLayer as Q } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
18
18
|
import { useBeatFeedbackFlow as Z } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
19
19
|
import { observer as $ } from "mobx-react-lite";
|
|
20
20
|
import b from "@mui/material/Stack";
|
|
@@ -42,8 +42,8 @@ var so = {}, no = {
|
|
|
42
42
|
px: 2,
|
|
43
43
|
textTransform: "none"
|
|
44
44
|
}, Ro = $(({ beat: t, beatActions: s = so, obsolete: c, isLoading: x = !1, isError: _ = !1 }) => {
|
|
45
|
-
const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } =
|
|
46
|
-
if (_) return /* @__PURE__ */ i(
|
|
45
|
+
const v = N(), { config: S } = E(), o = Z(t, s), { runCta: T, primary: C, secondary: g } = z(t, s, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta);
|
|
46
|
+
if (_) return /* @__PURE__ */ i(j, {});
|
|
47
47
|
const e = t.insights_payload;
|
|
48
48
|
if (!e || o.cardState === "dismissed") return null;
|
|
49
49
|
const { instance_slot: B, primary_cta: r, secondary_cta: n, sub_title: O, title: D, widget_type: L, guid: I, dismissed_at: F } = e, { block: A } = B, w = O ?? (e.subtitle ? {
|
|
@@ -57,17 +57,17 @@ var so = {}, no = {
|
|
|
57
57
|
}
|
|
58
58
|
await T(f, u);
|
|
59
59
|
}
|
|
60
|
-
}, k =
|
|
60
|
+
}, k = G[A], d = L === "mini", m = v.insights_feed?.general, p = c?.state === "not_refreshable" && !F && !!m;
|
|
61
61
|
return /* @__PURE__ */ i(R, {
|
|
62
62
|
value: o.wrappedActions,
|
|
63
63
|
children: /* @__PURE__ */ a(b, {
|
|
64
64
|
sx: { mb: 16 },
|
|
65
65
|
children: [
|
|
66
|
-
o.cardState === "confirming" ? /* @__PURE__ */ i(
|
|
66
|
+
o.cardState === "confirming" ? /* @__PURE__ */ i(Y, {
|
|
67
67
|
onClose: o.collapseConfirmation,
|
|
68
68
|
onLeaveFeedback: o.openHideSurvey,
|
|
69
69
|
onUndo: o.undoDismiss
|
|
70
|
-
}) : /* @__PURE__ */ a(to, { children: [c && m && /* @__PURE__ */ i(
|
|
70
|
+
}) : /* @__PURE__ */ a(to, { children: [c && m && /* @__PURE__ */ i(J, {
|
|
71
71
|
...c,
|
|
72
72
|
copy: m
|
|
73
73
|
}), /* @__PURE__ */ a(ao, {
|
|
@@ -79,12 +79,12 @@ var so = {}, no = {
|
|
|
79
79
|
} },
|
|
80
80
|
children: [
|
|
81
81
|
p && /* @__PURE__ */ i(ro, { sx: no }),
|
|
82
|
-
/* @__PURE__ */ i(
|
|
82
|
+
/* @__PURE__ */ i(X, {
|
|
83
83
|
isMini: d,
|
|
84
84
|
subtitle: w,
|
|
85
85
|
title: D ?? ""
|
|
86
86
|
}),
|
|
87
|
-
x ? /* @__PURE__ */ i(
|
|
87
|
+
x ? /* @__PURE__ */ i(q, {}) : k && /* @__PURE__ */ i(k, {
|
|
88
88
|
beatGuid: I,
|
|
89
89
|
payload: e
|
|
90
90
|
}),
|
|
@@ -136,19 +136,19 @@ var so = {}, no = {
|
|
|
136
136
|
children: n.label
|
|
137
137
|
})]
|
|
138
138
|
}),
|
|
139
|
-
/* @__PURE__ */ i(
|
|
139
|
+
/* @__PURE__ */ i(V, {
|
|
140
140
|
onTellUsMore: o.openRatingSurvey,
|
|
141
141
|
show: o.isFeedbackBarShown
|
|
142
142
|
})
|
|
143
143
|
]
|
|
144
144
|
})] }),
|
|
145
|
-
/* @__PURE__ */ i(
|
|
146
|
-
/* @__PURE__ */ i(
|
|
145
|
+
/* @__PURE__ */ i(Q, { beat: t }),
|
|
146
|
+
/* @__PURE__ */ i(W, {
|
|
147
147
|
isOpen: o.isDismissOpen,
|
|
148
148
|
onClose: o.closeDismissDialog,
|
|
149
149
|
onDismiss: o.confirmDismiss
|
|
150
150
|
}),
|
|
151
|
-
o.isSurveyOpen && /* @__PURE__ */ i(
|
|
151
|
+
o.isSurveyOpen && /* @__PURE__ */ i(U, {
|
|
152
152
|
characterLimitLabel: o.survey.characterLimitLabel,
|
|
153
153
|
closeAriaLabel: o.survey.closeAriaLabel,
|
|
154
154
|
isOpen: !0,
|
|
@@ -161,7 +161,7 @@ var so = {}, no = {
|
|
|
161
161
|
secondaryText: o.survey.backText,
|
|
162
162
|
title: o.survey.title
|
|
163
163
|
}),
|
|
164
|
-
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(
|
|
164
|
+
o.cardState === "visible" && e.footer && /* @__PURE__ */ i(K, { footer: e.footer })
|
|
165
165
|
]
|
|
166
166
|
})
|
|
167
167
|
});
|
|
@@ -19,13 +19,13 @@ export interface CompactInsightCardProps {
|
|
|
19
19
|
* The one compact renderer the micro and embedded envelopes share (`insights_v2.2.md` §8.3).
|
|
20
20
|
*
|
|
21
21
|
* Figma 1941:111897 (Embedded | Large Transaction): a title row with the overflow slot, the HTML
|
|
22
|
-
* description with the primary CTA under it, and on the right the
|
|
23
|
-
* `<BadgedTile>`. Under ditto's `
|
|
24
|
-
*
|
|
22
|
+
* description with the primary CTA under it, and on the right the slot's `logo` in a
|
|
23
|
+
* `<BadgedTile>`. Under ditto's `with_warning_badge` variant the tile takes a status badge; under
|
|
24
|
+
* `minimal` it draws the logo alone. The card lays out from the envelope alone and never reads
|
|
25
25
|
* `widget_type`.
|
|
26
26
|
*
|
|
27
27
|
* The icon falls back to the neutral insight glyph **here**, not in `LogoFromGuid`, when the slot
|
|
28
|
-
*
|
|
28
|
+
* carries no logo. The `pill` on the same envelope is the transaction row's, not the card's.
|
|
29
29
|
*/
|
|
30
30
|
declare const CompactInsightCard: ({ isCtaDisabled, onCtaClick, onTap, payload, }: CompactInsightCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
export default CompactInsightCard;
|