@mx-cartographer/experiences 9.4.31 → 9.4.33
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 +11 -0
- package/dist/core/api/AccountApi.d.ts +3 -2
- package/dist/core/api/AccountApi.es.js +1 -0
- package/dist/core/api/AccountApi.es.js.map +1 -1
- package/dist/core/stores/NetWorthStore.d.ts +3 -0
- package/dist/core/stores/NetWorthStore.es.js +30 -18
- package/dist/core/stores/NetWorthStore.es.js.map +1 -1
- package/dist/core/types/Account.d.ts +10 -0
- package/dist/core/types/Account.es.js.map +1 -1
- package/dist/core/types/Insights.d.ts +4 -0
- package/dist/core/types/index.d.ts +1 -1
- package/dist/core/utils/NetWorthUtils.d.ts +2 -1
- package/dist/core/utils/NetWorthUtils.es.js +58 -46
- package/dist/core/utils/NetWorthUtils.es.js.map +1 -1
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +20 -19
- package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js +34 -31
- package/dist/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.es.js.map +1 -1
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js +21 -18
- package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map +1 -1
- package/dist/insights-v2/components/BaseLayout.es.js +53 -53
- package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
- package/dist/insights-v2/components/DismissInsightDialog.es.js +34 -32
- package/dist/insights-v2/components/DismissInsightDialog.es.js.map +1 -1
- package/dist/insights-v2/components/FeedbackDialog.es.js +10 -7
- package/dist/insights-v2/components/FeedbackDialog.es.js.map +1 -1
- package/dist/insights-v2/components/InsightOptionsMenu.es.js +23 -23
- package/dist/insights-v2/components/InsightOptionsMenu.es.js.map +1 -1
- package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js +33 -33
- package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { getDynamicCtaBasedOnTriggers as
|
|
5
|
-
import { actionBlocks as _, hasDrawerBlock as
|
|
6
|
-
import { observer as
|
|
7
|
-
import
|
|
8
|
-
import { Text as
|
|
1
|
+
import { useGlobalCopyStore as g, useGlobalUiStore as k, useInsightsV2Store as C } from "../../common/context/hooks.es.js";
|
|
2
|
+
import h from "../../common/components/drawer/Drawer.es.js";
|
|
3
|
+
import B from "../../common/components/Loader.es.js";
|
|
4
|
+
import { getDynamicCtaBasedOnTriggers as b } from "./util.es.js";
|
|
5
|
+
import { actionBlocks as _, hasDrawerBlock as w } from "../mappings/blocks.es.js";
|
|
6
|
+
import { observer as D } from "mobx-react-lite";
|
|
7
|
+
import v from "@mui/material/Stack";
|
|
8
|
+
import { Text as L } from "@mxenabled/mxui";
|
|
9
9
|
import { jsx as e } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
10
|
+
var x = ({ actionBlock: s, ...o }) => {
|
|
11
11
|
const { Component: n, usePrepare: t } = s;
|
|
12
12
|
return t(o), /* @__PURE__ */ e(n, { ...o });
|
|
13
|
-
},
|
|
14
|
-
const n =
|
|
15
|
-
if (!m) return l ? /* @__PURE__ */ e(h, {}) : null;
|
|
13
|
+
}, U = D(function({ beat: o }) {
|
|
14
|
+
const n = g(), t = n.common, { isCopyLoaded: m } = k(), { actionDrawer: a, closeActionDrawer: p } = C();
|
|
16
15
|
if (!o.insights_payload) return null;
|
|
17
|
-
const { primary_cta: u, secondary_cta: d } = o.insights_payload,
|
|
18
|
-
return /* @__PURE__ */ e(
|
|
16
|
+
const { primary_cta: u, secondary_cta: d, guid: f } = o.insights_payload, l = a.isDrawerOpen && a.guid === f;
|
|
17
|
+
if (!m) return l ? /* @__PURE__ */ e(B, {}) : null;
|
|
18
|
+
const r = b(a, u, d), c = w(r?.block), i = c ? _[r?.block] : void 0, y = i ? i.title?.(r?.variant, n) ?? r?.label ?? "" : c ? t.error_heading : r?.label ?? "";
|
|
19
|
+
return /* @__PURE__ */ e(h, {
|
|
19
20
|
ariaLabelClose: t.close_aria,
|
|
20
21
|
isOpen: l,
|
|
21
22
|
onClose: p,
|
|
22
|
-
title:
|
|
23
|
-
children: i ? /* @__PURE__ */ e(
|
|
23
|
+
title: y,
|
|
24
|
+
children: i ? /* @__PURE__ */ e(x, {
|
|
24
25
|
actionBlock: i,
|
|
25
26
|
beat: o
|
|
26
|
-
}, r?.block) : c ? /* @__PURE__ */ e(
|
|
27
|
+
}, r?.block) : c ? /* @__PURE__ */ e(v, {
|
|
27
28
|
sx: { p: 24 },
|
|
28
|
-
children: /* @__PURE__ */ e(
|
|
29
|
+
children: /* @__PURE__ */ e(L, { children: t.error_message })
|
|
29
30
|
}) : null
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
U as ActionBlockLayer
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
//# sourceMappingURL=ActionBlockLayer.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBlockLayer.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ActionBlockLayer.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../common'\nimport { type Beat } from '../../core'\nimport {\n actionBlocks,\n hasDrawerBlock,\n type ActionBlockEntry,\n type ActionBlockProps,\n} from '../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from './util'\n\ninterface ActionBlockLayerProps {\n beat: Beat\n}\n\n/**\n * Renders a registered action block. Callers MUST key this per block name — a\n * block with `usePrepare` and one without run a different number of hooks, so\n * reusing the same fiber across a block switch violates the rules of hooks.\n */\nconst ActionBlockRunner = ({\n actionBlock,\n ...blockProps\n}: ActionBlockProps & { actionBlock: ActionBlockEntry }) => {\n const { Component, usePrepare } = actionBlock\n\n usePrepare(blockProps)\n\n return <Component {...blockProps} />\n}\n\n// `observer` is required: this reads `isCopyLoaded` off GlobalUiStore and the\n// action drawer off InsightsV2Store. Without it the component never re-renders\n// and stays stuck on <Loader /> forever.\nexport const ActionBlockLayer = observer(function ActionBlockLayer({\n beat,\n}: ActionBlockLayerProps) {\n const copy = useGlobalCopyStore()\n const commonCopy = copy.common\n const { isCopyLoaded } = useGlobalUiStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n\n // Every card in the feed renders its own layer against the shared store, so\n // this card's drawer only opens when its beat is the one that triggered it.\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid ===
|
|
1
|
+
{"version":3,"file":"ActionBlockLayer.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ActionBlockLayer.tsx"],"sourcesContent":["import Stack from '@mui/material/Stack'\n\nimport { Text } from '@mxenabled/mxui'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n Drawer,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../common'\nimport { type Beat } from '../../core'\nimport {\n actionBlocks,\n hasDrawerBlock,\n type ActionBlockEntry,\n type ActionBlockProps,\n} from '../mappings/blocks'\nimport { getDynamicCtaBasedOnTriggers } from './util'\n\ninterface ActionBlockLayerProps {\n beat: Beat\n}\n\n/**\n * Renders a registered action block. Callers MUST key this per block name — a\n * block with `usePrepare` and one without run a different number of hooks, so\n * reusing the same fiber across a block switch violates the rules of hooks.\n */\nconst ActionBlockRunner = ({\n actionBlock,\n ...blockProps\n}: ActionBlockProps & { actionBlock: ActionBlockEntry }) => {\n const { Component, usePrepare } = actionBlock\n\n usePrepare(blockProps)\n\n return <Component {...blockProps} />\n}\n\n// `observer` is required: this reads `isCopyLoaded` off GlobalUiStore and the\n// action drawer off InsightsV2Store. Without it the component never re-renders\n// and stays stuck on <Loader /> forever.\nexport const ActionBlockLayer = observer(function ActionBlockLayer({\n beat,\n}: ActionBlockLayerProps) {\n const copy = useGlobalCopyStore()\n const commonCopy = copy.common\n const { isCopyLoaded } = useGlobalUiStore()\n const { actionDrawer, closeActionDrawer } = useInsightsV2Store()\n\n // Mirrors BaseLayout's guard — the layer is exported, so callers are not\n // guaranteed to have narrowed this already.\n if (!beat.insights_payload) return null\n\n const { primary_cta, secondary_cta, guid } = beat.insights_payload\n\n // Every card in the feed renders its own layer against the shared store, so\n // this card's drawer only opens when its beat is the one that triggered it.\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === guid\n\n if (!isCopyLoaded) return isCurrentBeatOpen ? <Loader /> : null\n\n const currentCta = getDynamicCtaBasedOnTriggers(actionDrawer, primary_cta, secondary_cta)\n\n // A CTA without a real block never opens a drawer (BaseLayout won't trigger it);\n // a real-but-unknown block shows the error (\"oops\") content.\n const blockValid = hasDrawerBlock(currentCta?.block)\n const actionBlock = blockValid\n ? actionBlocks[currentCta?.block as keyof typeof actionBlocks]\n : undefined\n\n const drawerTitle = actionBlock\n ? (actionBlock.title?.(currentCta?.variant, copy) ?? currentCta?.label ?? '')\n : blockValid\n ? commonCopy.error_heading\n : (currentCta?.label ?? '')\n\n return (\n <Drawer\n ariaLabelClose={commonCopy.close_aria}\n isOpen={isCurrentBeatOpen}\n onClose={closeActionDrawer}\n title={drawerTitle}\n >\n {actionBlock ? (\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n ) : blockValid ? (\n <Stack sx={{ p: 24 }}>\n <Text>{commonCopy.error_message}</Text>\n </Stack>\n ) : null}\n </Drawer>\n )\n})\n"],"mappings":";;;;;;;;;AA8BA,IAAM,IAAA,CAAqB,EACzB,aAAA,GACA,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useGlobalCopyStore as B, useGlobalUiStore as
|
|
2
|
-
import { formatCurrency as
|
|
3
|
-
import
|
|
4
|
-
import { BarChartV2 as
|
|
5
|
-
import { EmptyBarChart as
|
|
6
|
-
import { barChartVariant as
|
|
7
|
-
import { actionBlocksKey as
|
|
8
|
-
import
|
|
9
|
-
import { observer as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import { useTheme as
|
|
12
|
-
var
|
|
13
|
-
const l =
|
|
14
|
-
if (!d) return /* @__PURE__ */
|
|
15
|
-
const
|
|
16
|
-
return t.length ? /* @__PURE__ */
|
|
1
|
+
import { useGlobalCopyStore as B, useGlobalUiStore as A, useInsightsV2Store as L } from "../../../../common/context/hooks.es.js";
|
|
2
|
+
import { formatCurrency as S } from "../../../../core/utils/NumberFormatting.es.js";
|
|
3
|
+
import I from "../../../../common/components/Loader.es.js";
|
|
4
|
+
import { BarChartV2 as T } from "../../../components/chartblocks/BarchartV2.es.js";
|
|
5
|
+
import { EmptyBarChart as k } from "../../../components/chartblocks/EmptyBarChart.es.js";
|
|
6
|
+
import { barChartVariant as v, buildChartData as x, buildDataSeries as D } from "./utils.es.js";
|
|
7
|
+
import { actionBlocksKey as O } from "../../../mappings/actionBlocksKey.es.js";
|
|
8
|
+
import N from "react";
|
|
9
|
+
import { observer as R } from "mobx-react-lite";
|
|
10
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
11
|
+
import { useTheme as V } from "@mui/material/styles";
|
|
12
|
+
var J = R(({ payload: m, beatGuid: i = "" }) => {
|
|
13
|
+
const l = V(), { openActionDrawer: c } = L(), { insights_feed: o } = B(), { isCopyLoaded: d } = A(), { instance_slot: f, instance_slot_data: a, widget_type: p } = m, { data_series: h, ariaLabel: u = "", average_amount: n = 0, legends: s = [] } = a, t = x(D(h), u), [g] = N.useState(t.length - 1), { color: b } = v(f, a, l);
|
|
14
|
+
if (!d) return /* @__PURE__ */ e(I, {});
|
|
15
|
+
const C = [o.general.monthly_amount, o.general.trend], [_, y] = s.length ? s.map((r) => r.label) : C;
|
|
16
|
+
return t.length ? /* @__PURE__ */ e(T, {
|
|
17
17
|
amounts: {
|
|
18
18
|
average: n,
|
|
19
|
-
formattedAverage:
|
|
19
|
+
formattedAverage: S(n, "0,0")
|
|
20
20
|
},
|
|
21
|
-
color:
|
|
21
|
+
color: b,
|
|
22
22
|
data: t,
|
|
23
|
-
monthlyAmountLabel:
|
|
24
|
-
onBarClick: (r) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
monthlyAmountLabel: _,
|
|
24
|
+
onBarClick: (r) => {
|
|
25
|
+
if (p !== "full") return !1;
|
|
26
|
+
c({
|
|
27
|
+
guid: i,
|
|
28
|
+
trigger: "chartBar",
|
|
29
|
+
context: {
|
|
30
|
+
chartBarIndex: r,
|
|
31
|
+
block: O.TRANSCATION_HISTORY_ACTION_BLOCK
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
selectedTabIndex: g,
|
|
36
|
+
trendAmountLabel: y
|
|
37
|
+
}) : /* @__PURE__ */ e(k, {});
|
|
35
38
|
});
|
|
36
39
|
export {
|
|
37
|
-
|
|
40
|
+
J as BarchartBlock
|
|
38
41
|
};
|
|
39
42
|
|
|
40
43
|
//# sourceMappingURL=BarchartBlock.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarchartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.tsx"],"sourcesContent":["import React from 'react'\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n formatCurrency,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../../../common'\nimport type { DataSeries, DrilldownPayload } from '../../../../core'\nimport type { BarChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { BarChartV2 } from '../../../components/chartblocks/BarchartV2'\nimport { EmptyBarChart } from '../../../components/chartblocks/EmptyBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { barChartVariant, buildChartData, buildDataSeries } from './utils'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\nexport const BarchartBlock = observer(\n ({ payload, beatGuid = '' }: BlockProps<BarChartBlockData>) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { instance_slot, instance_slot_data } = payload\n const { data_series, ariaLabel = '', average_amount = 0, legends = [] } = instance_slot_data\n const chartData = buildChartData(buildDataSeries(data_series as DataSeries), ariaLabel)\n const [selectedTabIndex] = React.useState(chartData.length - 1)\n const { color } = barChartVariant(instance_slot, instance_slot_data, theme)\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every beat/variant.\n // Remove this once the backend guarantees `legends` on the payload.\n const fallbackLabels = [insightsFeedCopy.general.monthly_amount, insightsFeedCopy.general.trend]\n\n const [monthlyAmountLabel, trendAmountLabel] = legends.length\n ? legends.map((legend) => legend.label)\n : fallbackLabels\n\n return chartData.length ? (\n <BarChartV2\n amounts={{\n average: average_amount,\n formattedAverage: formatCurrency(average_amount, '0,0'),\n }}\n color={color}\n data={chartData}\n monthlyAmountLabel={monthlyAmountLabel}\n onBarClick={(index)
|
|
1
|
+
{"version":3,"file":"BarchartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/BarchartBlock/BarchartBlock.tsx"],"sourcesContent":["import React from 'react'\nimport { useTheme } from '@mui/material/styles'\nimport { observer } from 'mobx-react-lite'\n\nimport {\n formatCurrency,\n Loader,\n useGlobalCopyStore,\n useGlobalUiStore,\n useInsightsV2Store,\n} from '../../../../common'\nimport type { DataSeries, DrilldownPayload } from '../../../../core'\nimport type { BarChartBlockData } from '../../../../core/types/InsightsInstanceSlotData'\n\nimport { BarChartV2 } from '../../../components/chartblocks/BarchartV2'\nimport { EmptyBarChart } from '../../../components/chartblocks/EmptyBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { barChartVariant, buildChartData, buildDataSeries } from './utils'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\nexport const BarchartBlock = observer(\n ({ payload, beatGuid = '' }: BlockProps<BarChartBlockData>) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const { insights_feed: insightsFeedCopy } = useGlobalCopyStore()\n const { isCopyLoaded } = useGlobalUiStore()\n const { instance_slot, instance_slot_data, widget_type } = payload\n const { data_series, ariaLabel = '', average_amount = 0, legends = [] } = instance_slot_data\n const chartData = buildChartData(buildDataSeries(data_series as DataSeries), ariaLabel)\n const [selectedTabIndex] = React.useState(chartData.length - 1)\n const { color } = barChartVariant(instance_slot, instance_slot_data, theme)\n\n if (!isCopyLoaded) {\n return <Loader />\n }\n\n // TODO: Temporary fallback while the backend doesn't always send `legends` on every beat/variant.\n // Remove this once the backend guarantees `legends` on the payload.\n const fallbackLabels = [insightsFeedCopy.general.monthly_amount, insightsFeedCopy.general.trend]\n\n const [monthlyAmountLabel, trendAmountLabel] = legends.length\n ? legends.map((legend) => legend.label)\n : fallbackLabels\n\n return chartData.length ? (\n <BarChartV2\n amounts={{\n average: average_amount,\n formattedAverage: formatCurrency(average_amount, '0,0'),\n }}\n color={color}\n data={chartData}\n monthlyAmountLabel={monthlyAmountLabel}\n onBarClick={(index) => {\n if (widget_type !== 'full') return false\n\n openActionDrawer({\n guid: beatGuid,\n trigger: 'chartBar',\n context: {\n chartBarIndex: index,\n block: actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK,\n } satisfies DrilldownPayload,\n })\n }}\n selectedTabIndex={selectedTabIndex}\n trendAmountLabel={trendAmountLabel}\n />\n ) : (\n <EmptyBarChart />\n )\n },\n)\n"],"m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,GAAD,CAAgB,CAAA;AAEpB,CACF"}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { useInsightsV2Store as B } from "../../../../common/context/hooks.es.js";
|
|
2
2
|
import { actionBlocksKey as C } from "../../../mappings/actionBlocksKey.es.js";
|
|
3
3
|
import { DoubleBarChart as b } from "../../../components/chartblocks/DoubleBarChart.es.js";
|
|
4
|
-
import { buildComparisonSeries as
|
|
5
|
-
import { getLayoutConfig as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { buildComparisonSeries as h } from "./comparisonUtils.es.js";
|
|
5
|
+
import { getLayoutConfig as d } from "./layout.es.js";
|
|
6
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
7
7
|
import { useTheme as I } from "@mui/material/styles";
|
|
8
|
-
var
|
|
9
|
-
const
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
var L = ({ payload: { instance_slot: o, instance_slot_data: t, widget_type: r }, beatGuid: a = "" }) => {
|
|
9
|
+
const e = I(), { openActionDrawer: i } = B(), { variant: n } = o, { ariaLabel: s = "", data_series: m, legends: c } = t, l = h(m, s), f = d(e, n)?.color ?? [];
|
|
10
|
+
return /* @__PURE__ */ g(b, {
|
|
11
11
|
bars: l,
|
|
12
|
-
colors:
|
|
13
|
-
isMini:
|
|
12
|
+
colors: f,
|
|
13
|
+
isMini: r === "mini",
|
|
14
14
|
legends: c,
|
|
15
|
-
onBarClick: (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
onBarClick: (p, u) => {
|
|
16
|
+
if (r !== "full") return !1;
|
|
17
|
+
i({
|
|
18
|
+
guid: a,
|
|
19
|
+
trigger: "chartBar",
|
|
20
|
+
context: {
|
|
21
|
+
chartBarIndex: p,
|
|
22
|
+
tabIndex: u,
|
|
23
|
+
block: C.TRANSCATION_HISTORY_ACTION_BLOCK
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
L as DoubleBarChartBlock
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
//# sourceMappingURL=DoubleBarChartBlock.es.js.map
|
package/dist/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleBarChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport { useInsightsV2Store } from '../../../../common'\nimport type { DataSeries, DrilldownPayload } from '../../../../core'\nimport { DoubleBarChart } from '../../../components/chartblocks/DoubleBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { buildComparisonSeries } from './comparisonUtils'\nimport { getLayoutConfig } from './layout'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\n/**\n * Card block for the double-bar chart. Mirrors BarchartBlock: it builds the shaped series\n * (buildComparisonSeries) and resolves the card palette (getLayoutConfig), then renders the reusable\n * DoubleBarChart and injects the card click behavior \\u2014 open the shared drawer scoped to this beat\n * (chartBarIndex = clicked column, tabIndex = clicked sub-series).\n */\nexport const DoubleBarChartBlock = ({\n payload: { instance_slot, instance_slot_data, widget_type },\n beatGuid = '',\n}: BlockProps) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const { variant } = instance_slot\n const { ariaLabel = '', data_series, legends } = instance_slot_data\n const bars = buildComparisonSeries(data_series as DataSeries, ariaLabel)\n // getLayoutConfig returns undefined for an unknown/unsupported variant; fall back to an empty\n // palette so an unregistered beat can't throw on mount.\n const colors = getLayoutConfig(theme, variant)?.color ?? []\n\n return (\n <DoubleBarChart\n bars={bars}\n colors={colors}\n isMini={widget_type === 'mini'}\n legends={legends}\n onBarClick={(columnIndex, subIndex)
|
|
1
|
+
{"version":3,"file":"DoubleBarChartBlock.es.js","names":[],"sources":["../../../../../src/insights-v2/blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.tsx"],"sourcesContent":["import { useTheme } from '@mui/material/styles'\n\nimport { useInsightsV2Store } from '../../../../common'\nimport type { DataSeries, DrilldownPayload } from '../../../../core'\nimport { DoubleBarChart } from '../../../components/chartblocks/DoubleBarChart'\n\nimport type { BlockProps } from '../../types'\n\nimport { buildComparisonSeries } from './comparisonUtils'\nimport { getLayoutConfig } from './layout'\nimport { actionBlocksKey } from '../../../mappings/actionBlocksKey'\n\n/**\n * Card block for the double-bar chart. Mirrors BarchartBlock: it builds the shaped series\n * (buildComparisonSeries) and resolves the card palette (getLayoutConfig), then renders the reusable\n * DoubleBarChart and injects the card click behavior \\u2014 open the shared drawer scoped to this beat\n * (chartBarIndex = clicked column, tabIndex = clicked sub-series).\n */\nexport const DoubleBarChartBlock = ({\n payload: { instance_slot, instance_slot_data, widget_type },\n beatGuid = '',\n}: BlockProps) => {\n const theme = useTheme()\n const { openActionDrawer } = useInsightsV2Store()\n const { variant } = instance_slot\n const { ariaLabel = '', data_series, legends } = instance_slot_data\n const bars = buildComparisonSeries(data_series as DataSeries, ariaLabel)\n // getLayoutConfig returns undefined for an unknown/unsupported variant; fall back to an empty\n // palette so an unregistered beat can't throw on mount.\n const colors = getLayoutConfig(theme, variant)?.color ?? []\n\n return (\n <DoubleBarChart\n bars={bars}\n colors={colors}\n isMini={widget_type === 'mini'}\n legends={legends}\n onBarClick={(columnIndex, subIndex) => {\n if (widget_type !== 'full') return false\n\n openActionDrawer({\n guid: beatGuid,\n trigger: 'chartBar',\n context: {\n chartBarIndex: columnIndex,\n tabIndex: subIndex,\n block: actionBlocksKey.TRANSCATION_HISTORY_ACTION_BLOCK,\n } satisfies DrilldownPayload,\n })\n }}\n />\n )\n}\n"],"mappings":";;;;;;;AAkBA,IAAa,IAAA,CAAuB,EAClC,SAAS,EAAE,eAAA,GAAe,oBAAA,GAAoB,aAAA,EAAA,GAC9C,UAAA,IAAW,GAAA,MACK;AAChB,QAAM,IAAQ,EAAS,GACjB,EAAE,kBAAA,EAAA,IAAqB,EAAmB,GAC1C,EAAE,SAAA,EAAA,IAAY,GACd,EAAE,WAAA,IAAY,IAAI,aAAA,GAAa,SAAA,EAAA,IAAY,GAC3C,IAAO,EAAsB,GAA2B,CAAS,GAGjE,IAAS,EAAgB,GAAO,CAAO,GAAG,SAAS,CAAC;AAE1D,SACE,gBAAA,EAAC,GAAD;AAAA,IACQ,MAAA;AAAA,IACE,QAAA;AAAA,IACR,QAAQ,MAAgB;AAAA,IACf,SAAA;AAAA,IACT,YAAA,CAAa,GAAa,MAAa;AACrC,UAAI,MAAgB,OAAQ,QAAO;AAEnC,MAAA,EAAiB;AAAA,QACf,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,UACP,eAAe;AAAA,UACf,UAAU;AAAA,UACV,OAAO,EAAgB;AAAA,QACzB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACD,CAAA;AAEL"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { useAppConfig as
|
|
2
|
-
import { sendBeatCta as
|
|
3
|
-
import { blocks as
|
|
4
|
-
import
|
|
5
|
-
import { BeatActionsProvider as
|
|
6
|
-
import
|
|
7
|
-
import { FeedbackBar as
|
|
8
|
-
import
|
|
9
|
-
import { DismissInsightDialog as
|
|
10
|
-
import { HiddenConfirmationCard as
|
|
11
|
-
import { ObsolesceBanner as
|
|
12
|
-
import { ActionBlockLayer as
|
|
13
|
-
import { useBeatFeedbackFlow as
|
|
14
|
-
import { observer as
|
|
1
|
+
import { useAppConfig as T, useGlobalCopyStore as F, useInsightsV2Store as A } from "../../common/context/hooks.es.js";
|
|
2
|
+
import { sendBeatCta as I } from "../../common/utils/PostMessage.es.js";
|
|
3
|
+
import { blocks as E, hasDrawerBlock as H } from "../mappings/blocks.es.js";
|
|
4
|
+
import M from "./Footer.es.js";
|
|
5
|
+
import { BeatActionsProvider as G } from "../beatActions.es.js";
|
|
6
|
+
import R from "./Header.es.js";
|
|
7
|
+
import { FeedbackBar as j } from "./FeedbackBar.es.js";
|
|
8
|
+
import z from "./FeedbackDialog.es.js";
|
|
9
|
+
import { DismissInsightDialog as N } from "./DismissInsightDialog.es.js";
|
|
10
|
+
import { HiddenConfirmationCard as U } from "./HiddenConfirmationCard.es.js";
|
|
11
|
+
import { ObsolesceBanner as V } from "./ObsolesceBanner.es.js";
|
|
12
|
+
import { ActionBlockLayer as P } from "../actionBlocks/ActionBlockLayer.es.js";
|
|
13
|
+
import { useBeatFeedbackFlow as W } from "../hooks/useBeatFeedbackFlow.es.js";
|
|
14
|
+
import { observer as X } from "mobx-react-lite";
|
|
15
15
|
import m from "@mui/material/Stack";
|
|
16
16
|
import d from "@mui/material/Button";
|
|
17
|
-
import { ChevronRight as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
var
|
|
17
|
+
import { ChevronRight as Y } from "@mxenabled/mx-icons";
|
|
18
|
+
import { Fragment as q, jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
19
|
+
import J from "@mui/material/Box";
|
|
20
|
+
import K from "@mui/material/Card";
|
|
21
|
+
var Q = {}, Z = {
|
|
22
22
|
position: "absolute",
|
|
23
23
|
top: 0,
|
|
24
24
|
left: 0,
|
|
@@ -27,29 +27,29 @@ var q = {}, J = {
|
|
|
27
27
|
backgroundColor: "background.default",
|
|
28
28
|
opacity: 0.7,
|
|
29
29
|
zIndex: 1
|
|
30
|
-
},
|
|
31
|
-
const { openCtaDrawer:
|
|
32
|
-
if (!
|
|
33
|
-
const { instance_slot:
|
|
34
|
-
|
|
35
|
-
isMobileWebview:
|
|
36
|
-
webviewScheme:
|
|
37
|
-
userGuid:
|
|
30
|
+
}, ke = X(({ beat: i, beatActions: h = Q, obsolete: s }) => {
|
|
31
|
+
const { openCtaDrawer: y } = A(), g = F(), { is_mobile_webview: k, clientConfig: v } = T(), e = W(i, h), t = i.insights_payload;
|
|
32
|
+
if (!t || e.cardState === "dismissed") return null;
|
|
33
|
+
const { instance_slot: _, primary_cta: n, secondary_cta: a, sub_title: C, title: x, widget_type: S, guid: p, user_guid: w, dismissed_at: B } = t, { block: D } = _, u = (L, O) => {
|
|
34
|
+
H(L) ? y(p, O) : I(i, {
|
|
35
|
+
isMobileWebview: k,
|
|
36
|
+
webviewScheme: v?.master?.ui_message_webview_url_scheme,
|
|
37
|
+
userGuid: w
|
|
38
38
|
});
|
|
39
|
-
},
|
|
40
|
-
return /* @__PURE__ */ o(
|
|
39
|
+
}, f = E[D], b = S === "mini", l = g.insights_feed?.general, c = s?.state === "not_refreshable" && !B && !!l;
|
|
40
|
+
return /* @__PURE__ */ o(G, {
|
|
41
41
|
value: e.wrappedActions,
|
|
42
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ r(m, {
|
|
43
43
|
sx: { mb: 16 },
|
|
44
44
|
children: [
|
|
45
|
-
e.cardState === "confirming" ? /* @__PURE__ */ o(
|
|
45
|
+
e.cardState === "confirming" ? /* @__PURE__ */ o(U, {
|
|
46
46
|
onClose: e.collapseConfirmation,
|
|
47
47
|
onLeaveFeedback: e.openHideSurvey,
|
|
48
48
|
onUndo: e.undoDismiss
|
|
49
|
-
}) : /* @__PURE__ */
|
|
49
|
+
}) : /* @__PURE__ */ r(q, { children: [s && l && /* @__PURE__ */ o(V, {
|
|
50
50
|
...s,
|
|
51
51
|
copy: l
|
|
52
|
-
}), /* @__PURE__ */
|
|
52
|
+
}), /* @__PURE__ */ r(K, {
|
|
53
53
|
inert: c,
|
|
54
54
|
sx: { ...c && {
|
|
55
55
|
position: "relative",
|
|
@@ -57,17 +57,17 @@ var q = {}, J = {
|
|
|
57
57
|
pointerEvents: "none"
|
|
58
58
|
} },
|
|
59
59
|
children: [
|
|
60
|
-
c && /* @__PURE__ */ o(
|
|
61
|
-
/* @__PURE__ */ o(
|
|
62
|
-
isMini:
|
|
63
|
-
subtitle:
|
|
64
|
-
title:
|
|
60
|
+
c && /* @__PURE__ */ o(J, { sx: Z }),
|
|
61
|
+
/* @__PURE__ */ o(R, {
|
|
62
|
+
isMini: b,
|
|
63
|
+
subtitle: C,
|
|
64
|
+
title: x ?? ""
|
|
65
65
|
}),
|
|
66
|
-
|
|
67
|
-
beatGuid:
|
|
68
|
-
payload:
|
|
66
|
+
f && /* @__PURE__ */ o(f, {
|
|
67
|
+
beatGuid: p,
|
|
68
|
+
payload: t
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ r(m, {
|
|
71
71
|
sx: {
|
|
72
72
|
gap: 6,
|
|
73
73
|
pb: 16,
|
|
@@ -76,10 +76,10 @@ var q = {}, J = {
|
|
|
76
76
|
pt: 12
|
|
77
77
|
},
|
|
78
78
|
children: [/* @__PURE__ */ o("div", {
|
|
79
|
-
dangerouslySetInnerHTML: { __html:
|
|
79
|
+
dangerouslySetInnerHTML: { __html: t.description.html_text },
|
|
80
80
|
style: { paddingLeft: 4 }
|
|
81
81
|
}), i?.in_description_cta && /* @__PURE__ */ o(d, {
|
|
82
|
-
endIcon: /* @__PURE__ */ o(
|
|
82
|
+
endIcon: /* @__PURE__ */ o(Y, {}),
|
|
83
83
|
onClick: () => {
|
|
84
84
|
},
|
|
85
85
|
sx: {
|
|
@@ -90,35 +90,35 @@ var q = {}, J = {
|
|
|
90
90
|
children: i.in_description_cta
|
|
91
91
|
})]
|
|
92
92
|
}),
|
|
93
|
-
!
|
|
93
|
+
!b && n?.label && /* @__PURE__ */ r(m, {
|
|
94
94
|
sx: {
|
|
95
95
|
gap: 8,
|
|
96
96
|
pb: 16,
|
|
97
97
|
px: 16
|
|
98
98
|
},
|
|
99
99
|
children: [/* @__PURE__ */ o(d, {
|
|
100
|
-
onClick: () =>
|
|
100
|
+
onClick: () => u(n.block, "primaryCta"),
|
|
101
101
|
variant: "outlined",
|
|
102
102
|
children: n.label
|
|
103
103
|
}), a?.label && /* @__PURE__ */ o(d, {
|
|
104
104
|
color: "secondary",
|
|
105
|
-
onClick: () =>
|
|
105
|
+
onClick: () => u(a.block, "secondaryCta"),
|
|
106
106
|
children: a.label
|
|
107
107
|
})]
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */ o(
|
|
109
|
+
/* @__PURE__ */ o(j, {
|
|
110
110
|
onTellUsMore: e.openRatingSurvey,
|
|
111
111
|
show: e.isFeedbackBarShown
|
|
112
112
|
})
|
|
113
113
|
]
|
|
114
114
|
})] }),
|
|
115
|
-
/* @__PURE__ */ o(
|
|
116
|
-
/* @__PURE__ */ o(
|
|
115
|
+
/* @__PURE__ */ o(P, { beat: i }),
|
|
116
|
+
/* @__PURE__ */ o(N, {
|
|
117
117
|
isOpen: e.isDismissOpen,
|
|
118
118
|
onClose: e.closeDismissDialog,
|
|
119
119
|
onDismiss: e.confirmDismiss
|
|
120
120
|
}),
|
|
121
|
-
e.isSurveyOpen && /* @__PURE__ */ o(
|
|
121
|
+
e.isSurveyOpen && /* @__PURE__ */ o(z, {
|
|
122
122
|
characterLimitLabel: e.survey.characterLimitLabel,
|
|
123
123
|
closeAriaLabel: e.survey.closeAriaLabel,
|
|
124
124
|
isOpen: !0,
|
|
@@ -131,13 +131,13 @@ var q = {}, J = {
|
|
|
131
131
|
secondaryText: e.survey.backText,
|
|
132
132
|
title: e.survey.title
|
|
133
133
|
}),
|
|
134
|
-
e.cardState === "visible" &&
|
|
134
|
+
e.cardState === "visible" && t.footer && /* @__PURE__ */ o(M, { footer: t.footer })
|
|
135
135
|
]
|
|
136
136
|
})
|
|
137
137
|
});
|
|
138
138
|
});
|
|
139
139
|
export {
|
|
140
|
-
|
|
140
|
+
ke as default
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
//# sourceMappingURL=BaseLayout.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLayout.es.js","names":[],"sources":["../../../src/insights-v2/components/BaseLayout.tsx"],"sourcesContent":["import { 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'\n\nimport { blocks, hasDrawerBlock } from '../mappings/blocks'\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 { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { sendBeatCta } from '../../common/utils/PostMessage'\nimport type { Beat } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\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}\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 zIndex: 1,\n} as const\n\nconst BaseLayout = observer(\n ({ beat, beatActions = NO_BEAT_ACTIONS, obsolete }: BaseLayoutProps) => {\n const { openCtaDrawer } = useInsightsV2Store()\n const copy = useGlobalCopyStore()\n const { is_mobile_webview, clientConfig } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\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, widget_type } =\n insights_payload\n const { block } = instance_slot\n\n // A CTA with a real drilldown `block` opens a drawer; otherwise it notifies\n // the host app via a beat/cta post message (the \"Make a Transfer\" CTA on the\n // Save an extra $100 beat). Mirrors Pulse's SaveAnExtra100Dollars beat.\n const handleCtaClick = (\n ctaBlock: string | null | undefined,\n source: 'primaryCta' | 'secondaryCta',\n ) => {\n if (hasDrawerBlock(ctaBlock)) {\n openCtaDrawer(beat.guid, source)\n } else {\n sendBeatCta(beat, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: beat.user_guid,\n })\n }\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const isMini = widget_type === 'mini'\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !beat.dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={flow.wrappedActions}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={sub_title} title={title ?? ''} />\n {Block && <Block beatGuid={beat.guid} payload={insights_payload} />}\n\n <Stack sx={{ gap: 6, pb: 16, pl: 12, pr: 16, pt: 12 }}>\n <div\n dangerouslySetInnerHTML={{\n __html: beat.html_description as string,\n }}\n style={{ paddingLeft: 4 }}\n />\n {beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {!isMini && primary_cta?.label && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n <Button\n onClick={() => handleCtaClick(primary_cta.block, 'primaryCta')}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n {secondary_cta?.label && (\n <Button\n color=\"secondary\"\n onClick={() => handleCtaClick(secondary_cta.block, 'secondaryCta')}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,IAA+B,CAAC,GAEhC,IAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,QAAQ;AACV,GAEM,KAAa,EAAA,CAChB,EAAE,MAAA,GAAM,aAAA,IAAc,GAAiB,UAAA,EAAA,MAAgC;AACtE,QAAM,EAAE,eAAA,EAA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O,cAAc;AAAA,gBAEhE,UAAA,EAAc;AAAA,cACT,CAAA,CAEL;AAAA;YAGT,gBAAA,EAAC,GAAD;AAAA,cAAa,cAAc,EAAK;AAAA,cAAkB,MAAM,EAAK;AAAA,YAAqB,CAAA;AAAA,UAC9E;AAAA,QACN,CAAA,CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,GAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,GAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,GAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,GAAD,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 { 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'\n\nimport { blocks, hasDrawerBlock } from '../mappings/blocks'\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 { ObsolesceBanner, type ObsolesceBannerState } from './ObsolesceBanner'\nimport { useAppConfig, useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { sendBeatCta } from '../../common/utils/PostMessage'\nimport type { Beat } from '../../core'\nimport { BeatActionsProvider, type BeatActions } from '../beatActions'\nimport { ActionBlockLayer } from '../actionBlocks/ActionBlockLayer'\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}\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 zIndex: 1,\n} as const\n\nconst BaseLayout = observer(\n ({ beat, beatActions = NO_BEAT_ACTIONS, obsolete }: BaseLayoutProps) => {\n const { openCtaDrawer } = useInsightsV2Store()\n const copy = useGlobalCopyStore()\n const { is_mobile_webview, clientConfig } = useAppConfig()\n const flow = useBeatFeedbackFlow(beat, beatActions)\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 {\n instance_slot,\n primary_cta,\n secondary_cta,\n sub_title,\n title,\n widget_type,\n guid,\n user_guid,\n dismissed_at,\n } = insights_payload\n const { block } = instance_slot\n\n // A CTA with a real drilldown `block` opens a drawer; otherwise it notifies\n // the host app via a beat/cta post message (the \"Make a Transfer\" CTA on the\n // Save an extra $100 beat). Mirrors Pulse's SaveAnExtra100Dollars beat.\n const handleCtaClick = (\n ctaBlock: string | null | undefined,\n source: 'primaryCta' | 'secondaryCta',\n ) => {\n if (hasDrawerBlock(ctaBlock)) {\n openCtaDrawer(guid, source)\n } else {\n sendBeatCta(beat, {\n isMobileWebview: is_mobile_webview,\n webviewScheme: clientConfig?.master?.ui_message_webview_url_scheme,\n userGuid: user_guid,\n })\n }\n }\n\n const Block = blocks[block as keyof typeof blocks]\n\n const isMini = widget_type === 'mini'\n const obsoleteCopy = copy.insights_feed?.general\n const isObsoleteDimmed =\n obsolete?.state === 'not_refreshable' && !dismissed_at && !!obsoleteCopy\n\n return (\n <BeatActionsProvider value={flow.wrappedActions}>\n <Stack sx={{ mb: 16 }}>\n {flow.cardState === 'confirming' ? (\n <HiddenConfirmationCard\n onClose={flow.collapseConfirmation}\n onLeaveFeedback={flow.openHideSurvey}\n onUndo={flow.undoDismiss}\n />\n ) : (\n <>\n {obsolete && obsoleteCopy && <ObsolesceBanner {...obsolete} copy={obsoleteCopy} />}\n <Card\n inert={isObsoleteDimmed}\n sx={{\n ...(isObsoleteDimmed && {\n position: 'relative',\n zIndex: 2,\n pointerEvents: 'none',\n }),\n }}\n >\n {isObsoleteDimmed && <Box sx={OBSOLETE_OVERLAY_SX} />}\n <Header isMini={isMini} subtitle={sub_title} title={title ?? ''} />\n {Block && <Block beatGuid={guid} payload={insights_payload} />}\n\n <Stack sx={{ gap: 6, pb: 16, pl: 12, pr: 16, pt: 12 }}>\n <div\n dangerouslySetInnerHTML={{\n __html: insights_payload.description.html_text,\n }}\n style={{ paddingLeft: 4 }}\n />\n {/* TODO: Migrate to insights_payload.in_description_cta once backend provides it */}\n {beat?.in_description_cta && (\n <Button\n endIcon={<ChevronRight />}\n onClick={() => {}}\n sx={{ height: 24, p: 4, width: 'max-content' }}\n >\n {beat.in_description_cta}\n </Button>\n )}\n </Stack>\n\n {!isMini && primary_cta?.label && (\n <Stack sx={{ gap: 8, pb: 16, px: 16 }}>\n <Button\n onClick={() => handleCtaClick(primary_cta.block, 'primaryCta')}\n variant=\"outlined\"\n >\n {primary_cta.label}\n </Button>\n {secondary_cta?.label && (\n <Button\n color=\"secondary\"\n onClick={() => handleCtaClick(secondary_cta.block, 'secondaryCta')}\n >\n {secondary_cta.label}\n </Button>\n )}\n </Stack>\n )}\n\n <FeedbackBar onTellUsMore={flow.openRatingSurvey} show={flow.isFeedbackBarShown} />\n </Card>\n </>\n )}\n\n <ActionBlockLayer beat={beat} />\n\n <DismissInsightDialog\n isOpen={flow.isDismissOpen}\n onClose={flow.closeDismissDialog}\n onDismiss={flow.confirmDismiss}\n />\n\n {flow.isSurveyOpen && (\n <FeedbackDialog\n characterLimitLabel={flow.survey.characterLimitLabel}\n closeAriaLabel={flow.survey.closeAriaLabel}\n isOpen={true}\n onBackClick={flow.feedbackDialogCallbacks.onBackClick}\n onClose={flow.closeSurvey}\n onSubmit={flow.submitSurvey}\n onTextInputFocus={flow.feedbackDialogCallbacks.onTextInputFocus}\n options={flow.survey.options}\n primaryText={flow.survey.submitText}\n secondaryText={flow.survey.backText}\n title={flow.survey.title}\n />\n )}\n\n {flow.cardState === 'visible' && insights_payload.footer && (\n <Footer footer={insights_payload.footer} />\n )}\n </Stack>\n </BeatActionsProvider>\n )\n },\n)\n\nexport default BaseLayout\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,IAAM,IAA+B,CAAC,GAEhC,IAAsB;AAAA,EAC1B,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,QAAQ;AACV,GAEM,KAAa,EAAA,CAChB,EAAE,MAAA,GAAM,aAAA,IAAc,GAAiB,UAAA,EAAA,MAAgC;AACtE,QAAM,EAAE,eAAA,EAAA,IAAkB,EAAmB,GACvC,IAAO,EAAmB,GAC1B,EAAE,mBAAA,GAAmB,cAAA,EAAA,IAAiB,EAAa,GACnD,IAAO,EAAoB,GAAM,CAAW,GAE5C,IAAmB,EAAK;AAG9B,MADI,CAAC,KACD,EAAK,cAAc,YAAa,QAAO;AAE3C,QA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CAAA,EAAA,CAAA;AAAA,QAGJ,gBAAA,EAAC,GAAD,EAAwB,MAAA,EAAO,CAAA;AAAA,QAE/B,gBAAA,EAAC,GAAD;AAAA,UACE,QAAQ,EAAK;AAAA,UACb,SAAS,EAAK;AAAA,UACd,WAAW,EAAK;AAAA,QACjB,CAAA;AAAA,QAEA,EAAK,gBACJ,gBAAA,EAAC,GAAD;AAAA,UACE,qBAAqB,EAAK,OAAO;AAAA,UACjC,gBAAgB,EAAK,OAAO;AAAA,UAC5B,QAAQ;AAAA,UACR,aAAa,EAAK,wBAAwB;AAAA,UAC1C,SAAS,EAAK;AAAA,UACd,UAAU,EAAK;AAAA,UACf,kBAAkB,EAAK,wBAAwB;AAAA,UAC/C,SAAS,EAAK,OAAO;AAAA,UACrB,aAAa,EAAK,OAAO;AAAA,UACzB,eAAe,EAAK,OAAO;AAAA,UAC3B,OAAO,EAAK,OAAO;AAAA,QACpB,CAAA;AAAA,QAGF,EAAK,cAAc,aAAa,EAAiB,UAChD,gBAAA,EAAC,GAAD,EAAQ,QAAQ,EAAiB,OAAS,CAAA;AAAA,MAEvC;AAAA;EACY,CAAA;AAEzB,CACF"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { useGlobalCopyStore as
|
|
2
|
-
import
|
|
3
|
-
import { useEffect as b, useState as
|
|
4
|
-
import { observer as
|
|
1
|
+
import { useGlobalCopyStore as u } from "../../common/context/hooks.es.js";
|
|
2
|
+
import f from "../../common/components/dialog/Dialog.es.js";
|
|
3
|
+
import { useEffect as b, useState as x } from "react";
|
|
4
|
+
import { observer as g } from "mobx-react-lite";
|
|
5
5
|
import a from "@mui/material/Stack";
|
|
6
6
|
import { Text as l } from "@mxenabled/mxui";
|
|
7
|
-
import { jsx as
|
|
8
|
-
import
|
|
9
|
-
import h from "@mui/material/
|
|
7
|
+
import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { alpha as c } from "@mui/material/styles";
|
|
9
|
+
import h from "@mui/material/FormControlLabel";
|
|
10
|
+
import v from "@mui/material/Radio";
|
|
10
11
|
import y from "@mui/material/RadioGroup";
|
|
11
|
-
var
|
|
12
|
-
const o =
|
|
12
|
+
var _ = g(({ isOpen: t, onClose: d, onDismiss: m }) => {
|
|
13
|
+
const o = u().insights_feed?.dismiss, [e, n] = x("once");
|
|
13
14
|
return b(() => {
|
|
14
|
-
|
|
15
|
-
}, [
|
|
15
|
+
t && n("once");
|
|
16
|
+
}, [t]), o ? /* @__PURE__ */ i(f, {
|
|
16
17
|
copy: {
|
|
17
18
|
title: o.title,
|
|
18
19
|
close_aria: o.close_aria
|
|
19
20
|
},
|
|
20
|
-
isOpen:
|
|
21
|
+
isOpen: t,
|
|
21
22
|
onClose: d,
|
|
22
|
-
onPrimaryAction: () =>
|
|
23
|
+
onPrimaryAction: () => m(e),
|
|
23
24
|
primaryText: o.confirm,
|
|
24
25
|
secondaryText: o.cancel,
|
|
25
26
|
sx: {
|
|
@@ -31,9 +32,7 @@ var R = x(({ isOpen: i, onClose: d, onDismiss: c }) => {
|
|
|
31
32
|
"& .MuiDialog-paperScrollPaper > div:first-child .MuiIconButton-root": { my: -10 },
|
|
32
33
|
"& .MuiDialog-paperScrollPaper": {
|
|
33
34
|
bgcolor: "background.paper",
|
|
34
|
-
|
|
35
|
-
borderColor: "divider",
|
|
36
|
-
boxShadow: "none"
|
|
35
|
+
borderRadius: "4px"
|
|
37
36
|
},
|
|
38
37
|
"&:focus-visible": {
|
|
39
38
|
outline: "2px solid",
|
|
@@ -53,36 +52,39 @@ var R = x(({ isOpen: i, onClose: d, onDismiss: c }) => {
|
|
|
53
52
|
},
|
|
54
53
|
children: /* @__PURE__ */ s(a, {
|
|
55
54
|
sx: { gap: 24 },
|
|
56
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ i(l, {
|
|
57
56
|
variant: "subtitle1",
|
|
58
57
|
children: o.description
|
|
59
|
-
}), /* @__PURE__ */
|
|
58
|
+
}), /* @__PURE__ */ i(y, {
|
|
60
59
|
"aria-label": o.title,
|
|
61
60
|
name: "dismiss-type",
|
|
62
|
-
onChange: (
|
|
61
|
+
onChange: (r) => n(r.target.value),
|
|
63
62
|
sx: {
|
|
64
63
|
m: 0,
|
|
65
64
|
p: 0
|
|
66
65
|
},
|
|
67
|
-
value:
|
|
68
|
-
children: /* @__PURE__ */
|
|
66
|
+
value: e,
|
|
67
|
+
children: /* @__PURE__ */ i(a, {
|
|
69
68
|
sx: { gap: 16 },
|
|
70
|
-
children: ["once", "always"].map((
|
|
71
|
-
value:
|
|
72
|
-
control: /* @__PURE__ */
|
|
69
|
+
children: ["once", "always"].map((r) => /* @__PURE__ */ i(h, {
|
|
70
|
+
value: r,
|
|
71
|
+
control: /* @__PURE__ */ i(v, {
|
|
72
|
+
inputProps: { "aria-label": o[r].headline },
|
|
73
|
+
sx: { "& .MuiSvgIcon-root": { color: e === r ? "inherit" : "action.active" } }
|
|
74
|
+
}),
|
|
73
75
|
labelPlacement: "start",
|
|
74
76
|
label: /* @__PURE__ */ s(a, {
|
|
75
77
|
sx: {
|
|
76
78
|
gap: 4,
|
|
77
79
|
flexGrow: 1
|
|
78
80
|
},
|
|
79
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ i(l, {
|
|
80
82
|
bold: !0,
|
|
81
83
|
variant: "body1",
|
|
82
|
-
children: o[
|
|
83
|
-
}), /* @__PURE__ */
|
|
84
|
+
children: o[r].headline
|
|
85
|
+
}), /* @__PURE__ */ i(l, {
|
|
84
86
|
variant: "subtitle2",
|
|
85
|
-
children: o[
|
|
87
|
+
children: o[r].description
|
|
86
88
|
})]
|
|
87
89
|
}),
|
|
88
90
|
sx: {
|
|
@@ -93,17 +95,17 @@ var R = x(({ isOpen: i, onClose: d, onDismiss: c }) => {
|
|
|
93
95
|
minHeight: 72,
|
|
94
96
|
px: 16,
|
|
95
97
|
py: 0,
|
|
96
|
-
|
|
98
|
+
border: (p) => e === r ? `2px solid ${c(p.palette.primary.main, 0.5)}` : `1px solid ${c(p.palette.divider, 0.5)}`
|
|
97
99
|
}
|
|
98
|
-
},
|
|
100
|
+
}, r))
|
|
99
101
|
})
|
|
100
102
|
})]
|
|
101
103
|
})
|
|
102
104
|
}) : null;
|
|
103
105
|
});
|
|
104
106
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
_ as DismissInsightDialog,
|
|
108
|
+
_ as default
|
|
107
109
|
};
|
|
108
110
|
|
|
109
111
|
//# sourceMappingURL=DismissInsightDialog.es.js.map
|