@mx-cartographer/experiences 9.6.0 → 9.6.1

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/common/components/ConnectDrawer.es.js +17 -44
  3. package/dist/common/components/ConnectDrawer.es.js.map +1 -1
  4. package/dist/common/components/ConnectWidgetPanel.d.ts +8 -0
  5. package/dist/common/components/ConnectWidgetPanel.es.js +44 -0
  6. package/dist/common/components/ConnectWidgetPanel.es.js.map +1 -0
  7. package/dist/common/components/dialog/Dialog.d.ts +2 -0
  8. package/dist/common/components/dialog/Dialog.es.js +30 -30
  9. package/dist/common/components/dialog/Dialog.es.js.map +1 -1
  10. package/dist/common/components/index.d.ts +1 -0
  11. package/dist/common/index.es.js +67 -65
  12. package/dist/core/types/localization/InsightsFeedCopy.d.ts +87 -0
  13. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js +19 -19
  14. package/dist/insights-v2/actionBlocks/ActionBlockLayer.es.js.map +1 -1
  15. package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.d.ts +21 -0
  16. package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js +16 -0
  17. package/dist/insights-v2/actionBlocks/ConnectWidgetActionBlock.es.js.map +1 -0
  18. package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.d.ts +12 -0
  19. package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js +25 -0
  20. package/dist/insights-v2/actionBlocks/ConnectionDetailActionBlock.es.js.map +1 -0
  21. package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.d.ts +17 -0
  22. package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js +39 -0
  23. package/dist/insights-v2/actionBlocks/FeedbackModalActionBlock.es.js.map +1 -0
  24. package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.d.ts +16 -0
  25. package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js +47 -0
  26. package/dist/insights-v2/actionBlocks/SurveyModalActionBlock.es.js.map +1 -0
  27. package/dist/insights-v2/beatActions.d.ts +2 -2
  28. package/dist/insights-v2/beatActions.es.js.map +1 -1
  29. package/dist/insights-v2/components/BaseLayout.es.js +14 -14
  30. package/dist/insights-v2/components/ConnectionDetailDrillDown.d.ts +32 -0
  31. package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js +148 -0
  32. package/dist/insights-v2/components/ConnectionDetailDrillDown.es.js.map +1 -0
  33. package/dist/insights-v2/components/FeedbackDialog.d.ts +3 -1
  34. package/dist/insights-v2/components/FeedbackDialog.es.js +80 -72
  35. package/dist/insights-v2/components/FeedbackDialog.es.js.map +1 -1
  36. package/dist/insights-v2/components/FeedbackModal.d.ts +60 -0
  37. package/dist/insights-v2/components/FeedbackModal.es.js +61 -0
  38. package/dist/insights-v2/components/FeedbackModal.es.js.map +1 -0
  39. package/dist/insights-v2/components/SurveyModal.d.ts +65 -0
  40. package/dist/insights-v2/components/SurveyModal.es.js +138 -0
  41. package/dist/insights-v2/components/SurveyModal.es.js.map +1 -0
  42. package/dist/insights-v2/components/shared/StatusSnackbar.d.ts +28 -0
  43. package/dist/insights-v2/components/shared/StatusSnackbar.es.js +19 -0
  44. package/dist/insights-v2/components/shared/StatusSnackbar.es.js.map +1 -0
  45. package/dist/insights-v2/index.d.ts +4 -0
  46. package/dist/insights-v2/index.es.js +72 -64
  47. package/dist/insights-v2/mappings/actionBlocksKey.d.ts +4 -0
  48. package/dist/insights-v2/mappings/actionBlocksKey.es.js +4 -0
  49. package/dist/insights-v2/mappings/actionBlocksKey.es.js.map +1 -1
  50. package/dist/insights-v2/mappings/blocks.es.js +79 -56
  51. package/dist/insights-v2/mappings/blocks.es.js.map +1 -1
  52. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
- import { useGlobalCopyStore as C, useGlobalUiStore as h, useInsightsV2Store as B } from "../../common/context/hooks.es.js";
2
- import _ from "../../common/components/drawer/Drawer.es.js";
3
- import b from "../../common/components/Loader.es.js";
1
+ import { useGlobalCopyStore as g, useGlobalUiStore as C, useInsightsV2Store as h } from "../../common/context/hooks.es.js";
2
+ import B from "../../common/components/drawer/Drawer.es.js";
3
+ import _ from "../../common/components/Loader.es.js";
4
4
  import { getDynamicCtaBasedOnTriggers as v } from "./util.es.js";
5
5
  import { hasDrawerBlock as w } from "../mappings/hasDrawerBlock.es.js";
6
6
  import { actionBlocks as D } from "../mappings/blocks.es.js";
7
- import { observer as L } from "mobx-react-lite";
8
- import x from "@mui/material/Stack";
9
- import { Text as A } from "@mxenabled/mxui";
7
+ import { observer as b } from "mobx-react-lite";
8
+ import L from "@mui/material/Stack";
9
+ import { Text as x } from "@mxenabled/mxui";
10
10
  import { jsx as e } from "react/jsx-runtime";
11
11
  var m = ({ actionBlock: s, ...o }) => {
12
12
  const { Component: i, usePrepare: n } = s;
13
13
  return n(o), /* @__PURE__ */ e(i, { ...o });
14
- }, q = L(function({ beat: o }) {
15
- const i = C(), n = i.common, { isCopyLoaded: p } = h(), { actionDrawer: c, closeActionDrawer: u } = B();
14
+ }, $ = b(function({ beat: o }) {
15
+ const i = g(), n = i.common, { isCopyLoaded: p } = C(), { actionDrawer: c, closeActionDrawer: u } = h();
16
16
  if (!o.insights_payload) return null;
17
- const { primary_cta: d, secondary_cta: f, guid: k } = o.insights_payload, a = c.isDrawerOpen && c.guid === k;
18
- if (!p) return a ? /* @__PURE__ */ e(b, {}) : null;
19
- const r = v(c, d, f), l = w(r?.block), t = l ? D[r?.block] : void 0;
20
- if (t?.presentation === "modal") return a ? /* @__PURE__ */ e(m, {
17
+ const { primary_cta: d, secondary_cta: f } = o.insights_payload, l = c.isDrawerOpen && c.guid === o.guid;
18
+ if (!p) return l ? /* @__PURE__ */ e(_, {}) : null;
19
+ const r = v(c, d, f), a = w(r?.block), t = a ? D[r?.block] : void 0;
20
+ if (t?.presentation === "modal") return l ? /* @__PURE__ */ e(m, {
21
21
  actionBlock: t,
22
22
  beat: o
23
23
  }, r?.block) : null;
24
- const y = t?.title?.(r?.variant, i, o), g = t ? y || r?.label || "" : l ? n.error_heading : r?.label ?? "";
25
- return /* @__PURE__ */ e(_, {
24
+ const k = t?.title?.(r?.variant, i, o), y = t ? k || r?.label || "" : a ? n.error_heading : r?.label ?? "";
25
+ return /* @__PURE__ */ e(B, {
26
26
  ariaLabelClose: n.close_aria,
27
- isOpen: a,
27
+ isOpen: l,
28
28
  onClose: u,
29
- title: g,
29
+ title: y,
30
30
  children: t ? /* @__PURE__ */ e(m, {
31
31
  actionBlock: t,
32
32
  beat: o
33
- }, r?.block) : l ? /* @__PURE__ */ e(x, {
33
+ }, r?.block) : a ? /* @__PURE__ */ e(L, {
34
34
  sx: { p: 24 },
35
- children: /* @__PURE__ */ e(A, { children: n.error_message })
35
+ children: /* @__PURE__ */ e(x, { children: n.error_message })
36
36
  }) : null
37
37
  });
38
38
  });
39
39
  export {
40
- q as ActionBlockLayer
40
+ $ as ActionBlockLayer
41
41
  };
42
42
 
43
43
  //# 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 // 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 // A modal block owns its dialog: no drawer behind it, and nothing mounted until it is opened.\n if (actionBlock?.presentation === 'modal') {\n return isCurrentBeatOpen ? (\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n ) : null\n }\n\n const resolvedTitle = actionBlock?.title?.(currentCta?.variant, copy, beat)\n const drawerTitle = actionBlock\n ? resolvedTitle || 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,GAAG,EAAA,MACuD;AAC1D,QAAM,EAAE,WAAA,GAAW,YAAA,EAAA,IAAe;AAElC,SAAA,EAAW,CAAU,GAEd,gBAAA,EAAC,GAAD,EAAW,GAAI,EAAa,CAAA;AACrC,GAKa,IAAmB,EAAS,SAA0B,EACjE,MAAA,EAAA,GACwB;AACxB,QAAM,IAAO,EAAmB,GAC1B,IAAa,EAAK,QAClB,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,cAAA,GAAc,mBAAA,EAAA,IAAsB,EAAmB;AAI/D,MAAI,CAAC,EAAK,iBAAkB,QAAO;AAEnC,QAAM,EAAE,aAAA,GAAa,eAAA,GAAe,MAAA,EAAA,IAAS,EAAK,kBAI5C,IAAoB,EAAa,gBAAgB,EAAa,SAAS;AAE7E,MAAI,CAAC,EAAc,QAAO,IAAoB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAAI;AAE3D,QAAM,IAAa,EAA6B,GAAc,GAAa,CAAa,GAIlF,IAAa,EAAe,GAAY,KAAK,GAC7C,IAAc,IAChB,EAAa,GAAY,KAAA,IACzB;AAGJ,MAAI,GAAa,iBAAiB,QAChC,QAAO,IACL,gBAAA,EAAC,GAAD;AAAA,IAAgC,aAAA;AAAA,IAAmB,MAAA;AAAA,EAA+B,GAApB,GAAY,KAAQ,IAChF;AAGN,QAAM,IAAgB,GAAa,QAAQ,GAAY,SAAS,GAAM,CAAI,GACpE,IAAc,IAChB,KAAiB,GAAY,SAAS,KACtC,IACE,EAAW,gBACV,GAAY,SAAS;AAE5B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IAEN,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,MAAgC,aAAA;AAAA,MAAmB,MAAA;AAAA,IAA+B,GAApB,GAAY,KAAQ,IAChF,IACF,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,GAAG,GAAG;AAAA,MACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,IACjC,CAAA,IACL;AAAA,EACE,CAAA;AAEZ,CAAC"}
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 } = 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 === beat.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 // A modal block owns its dialog: no drawer behind it, and nothing mounted until it is opened.\n if (actionBlock?.presentation === 'modal') {\n return isCurrentBeatOpen ? (\n <ActionBlockRunner actionBlock={actionBlock} beat={beat} key={currentCta?.block} />\n ) : null\n }\n\n const resolvedTitle = actionBlock?.title?.(currentCta?.variant, copy, beat)\n const drawerTitle = actionBlock\n ? resolvedTitle || 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,GAAG,EAAA,MACuD;AAC1D,QAAM,EAAE,WAAA,GAAW,YAAA,EAAA,IAAe;AAElC,SAAA,EAAW,CAAU,GAEd,gBAAA,EAAC,GAAD,EAAW,GAAI,EAAa,CAAA;AACrC,GAKa,IAAmB,EAAS,SAA0B,EACjE,MAAA,EAAA,GACwB;AACxB,QAAM,IAAO,EAAmB,GAC1B,IAAa,EAAK,QAClB,EAAE,cAAA,EAAA,IAAiB,EAAiB,GACpC,EAAE,cAAA,GAAc,mBAAA,EAAA,IAAsB,EAAmB;AAI/D,MAAI,CAAC,EAAK,iBAAkB,QAAO;AAEnC,QAAM,EAAE,aAAA,GAAa,eAAA,EAAA,IAAkB,EAAK,kBAItC,IAAoB,EAAa,gBAAgB,EAAa,SAAS,EAAK;AAElF,MAAI,CAAC,EAAc,QAAO,IAAoB,gBAAA,EAAC,GAAD,CAAS,CAAA,IAAI;AAE3D,QAAM,IAAa,EAA6B,GAAc,GAAa,CAAa,GAIlF,IAAa,EAAe,GAAY,KAAK,GAC7C,IAAc,IAChB,EAAa,GAAY,KAAA,IACzB;AAGJ,MAAI,GAAa,iBAAiB,QAChC,QAAO,IACL,gBAAA,EAAC,GAAD;AAAA,IAAgC,aAAA;AAAA,IAAmB,MAAA;AAAA,EAA+B,GAApB,GAAY,KAAQ,IAChF;AAGN,QAAM,IAAgB,GAAa,QAAQ,GAAY,SAAS,GAAM,CAAI,GACpE,IAAc,IAChB,KAAiB,GAAY,SAAS,KACtC,IACE,EAAW,gBACV,GAAY,SAAS;AAE5B,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,gBAAgB,EAAW;AAAA,IAC3B,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IAEN,UAAA,IACC,gBAAA,EAAC,GAAD;AAAA,MAAgC,aAAA;AAAA,MAAmB,MAAA;AAAA,IAA+B,GAApB,GAAY,KAAQ,IAChF,IACF,gBAAA,EAAC,GAAD;AAAA,MAAO,IAAI,EAAE,GAAG,GAAG;AAAA,MACjB,UAAA,gBAAA,EAAC,GAAD,EAAA,UAAO,EAAW,cAAoB,CAAA;AAAA,IACjC,CAAA,IACL;AAAA,EACE,CAAA;AAEZ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ActionBlockProps } from '../mappings/blocks';
2
+ /**
3
+ * `connect_widget_block` — opens MX's Connect widget itself via the shared
4
+ * `ConnectWidgetPanel` (src/common): SSO url via ConnectStore and the
5
+ * iframe-based `@mxenabled/web-widget-sdk` ConnectWidget, with loading/error
6
+ * statuses.
7
+ *
8
+ * Renders the panel directly (not `ConnectDrawer`, which wraps it in its own
9
+ * `Drawer`) — `ActionBlockLayer` already supplies the action drawer's chrome
10
+ * (title from the CTA label, close button), so a second nested `Drawer` here
11
+ * would produce two stacked drawers with two headers and two close buttons.
12
+ *
13
+ * `ActionBlockLayer` does not unmount a drawer-presentation block when the
14
+ * drawer closes — it only toggles the `Drawer`'s `isOpen` — so the account
15
+ * refresh (parity with `ConnectDrawer`'s own `onClose`) is driven by watching
16
+ * this beat's `actionDrawer.isDrawerOpen` transition from true to false,
17
+ * rather than an unmount effect, which would never fire.
18
+ */
19
+ export declare const ConnectWidgetActionBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element) & {
20
+ displayName: string;
21
+ };
@@ -0,0 +1,16 @@
1
+ import { useAccountStore as c, useInsightsV2Store as i } from "../../common/context/hooks.es.js";
2
+ import s from "../../common/components/ConnectWidgetPanel.es.js";
3
+ import { useEffect as u, useRef as f } from "react";
4
+ import { observer as m } from "mobx-react-lite";
5
+ import { jsx as p } from "react/jsx-runtime";
6
+ var v = m(function({ beat: o }) {
7
+ const { actionDrawer: e } = i(), { refreshAccounts: n } = c(), t = e.isDrawerOpen && e.guid === o.guid, r = f(t);
8
+ return u(() => {
9
+ r.current && !t && n(), r.current = t;
10
+ }, [t]), /* @__PURE__ */ p(s, { isActive: t });
11
+ });
12
+ export {
13
+ v as ConnectWidgetActionBlock
14
+ };
15
+
16
+ //# sourceMappingURL=ConnectWidgetActionBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectWidgetActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ConnectWidgetActionBlock.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react'\nimport { observer } from 'mobx-react-lite'\n\nimport { ConnectWidgetPanel, useAccountStore, useInsightsV2Store } from '../../common'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `connect_widget_block` — opens MX's Connect widget itself via the shared\n * `ConnectWidgetPanel` (src/common): SSO url via ConnectStore and the\n * iframe-based `@mxenabled/web-widget-sdk` ConnectWidget, with loading/error\n * statuses.\n *\n * Renders the panel directly (not `ConnectDrawer`, which wraps it in its own\n * `Drawer`) — `ActionBlockLayer` already supplies the action drawer's chrome\n * (title from the CTA label, close button), so a second nested `Drawer` here\n * would produce two stacked drawers with two headers and two close buttons.\n *\n * `ActionBlockLayer` does not unmount a drawer-presentation block when the\n * drawer closes — it only toggles the `Drawer`'s `isOpen` — so the account\n * refresh (parity with `ConnectDrawer`'s own `onClose`) is driven by watching\n * this beat's `actionDrawer.isDrawerOpen` transition from true to false,\n * rather than an unmount effect, which would never fire.\n */\nexport const ConnectWidgetActionBlock = observer(function ConnectWidgetActionBlock({\n beat,\n}: ActionBlockProps) {\n const { actionDrawer } = useInsightsV2Store()\n const { refreshAccounts } = useAccountStore()\n\n const isCurrentBeatOpen = actionDrawer.isDrawerOpen && actionDrawer.guid === beat.guid\n const wasOpen = useRef(isCurrentBeatOpen)\n\n useEffect(() => {\n if (wasOpen.current && !isCurrentBeatOpen) {\n void refreshAccounts()\n }\n wasOpen.current = isCurrentBeatOpen\n }, [isCurrentBeatOpen])\n\n return <ConnectWidgetPanel isActive={isCurrentBeatOpen} />\n})\n"],"mappings":";;;;;AAuBA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,cAAA,EAAA,IAAiB,EAAmB,GACtC,EAAE,iBAAA,EAAA,IAAoB,EAAgB,GAEtC,IAAoB,EAAa,gBAAgB,EAAa,SAAS,EAAK,MAC5E,IAAU,EAAO,CAAiB;AAExC,SAAA,EAAA,MAAgB;AACd,IAAI,EAAQ,WAAW,CAAC,KACtB,EAAqB,GAEvB,EAAQ,UAAU;AAAA,EACpB,GAAG,CAAC,CAAiB,CAAC,GAEf,gBAAA,EAAC,GAAD,EAAoB,UAAU,EAAoB,CAAA;AAC3D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ActionBlockProps } from '../mappings/blocks';
2
+ /**
3
+ * `connection_detail_block` — the connection-details education drilldown
4
+ * (ported from V1's `insights/components/shared/ConnectionDetailDrillDown`).
5
+ * Renders inside the standard action drawer; the drawer title comes from the
6
+ * registry entry's `title` (copy `connection_details_drawer_title`).
7
+ *
8
+ * Copy comes from `insights_feed.connection_details` in GlobalCopy.
9
+ */
10
+ export declare const ConnectionDetailActionBlock: ((_props: ActionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
11
+ displayName: string;
12
+ };
@@ -0,0 +1,25 @@
1
+ import { useGlobalCopyStore as o } from "../../common/context/hooks.es.js";
2
+ import i from "../components/ConnectionDetailDrillDown.es.js";
3
+ import { observer as r } from "mobx-react-lite";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ var f = r(function(a) {
6
+ const e = o().insights_feed?.connection_details;
7
+ if (!e) return null;
8
+ const t = {
9
+ aria_label_thumbs_down: e.aria_label_thumbs_down,
10
+ aria_label_thumbs_up: e.aria_label_thumbs_up,
11
+ benefits: Object.values(e.benefits_list ?? {}),
12
+ description: e.description,
13
+ footer_title: e.footer_title,
14
+ header_text: e.header_text,
15
+ shared_info_description: e.shared_info_description,
16
+ shared_info_header_text: e.shared_info_header_text,
17
+ shared_info_items: Object.values(e.shared_info_list ?? {})
18
+ };
19
+ return /* @__PURE__ */ n(i, { copy: t });
20
+ });
21
+ export {
22
+ f as ConnectionDetailActionBlock
23
+ };
24
+
25
+ //# sourceMappingURL=ConnectionDetailActionBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectionDetailActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/ConnectionDetailActionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore } from '../../common'\nimport ConnectionDetailDrillDown, {\n type ConnectionDetailContent,\n} from '../components/ConnectionDetailDrillDown'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `connection_detail_block` — the connection-details education drilldown\n * (ported from V1's `insights/components/shared/ConnectionDetailDrillDown`).\n * Renders inside the standard action drawer; the drawer title comes from the\n * registry entry's `title` (copy `connection_details_drawer_title`).\n *\n * Copy comes from `insights_feed.connection_details` in GlobalCopy.\n */\nexport const ConnectionDetailActionBlock = observer(function ConnectionDetailActionBlock(\n _props: ActionBlockProps,\n) {\n const copyStore = useGlobalCopyStore()\n const detailsCopy = copyStore.insights_feed?.connection_details\n\n if (!detailsCopy) return null\n\n const copy: ConnectionDetailContent = {\n aria_label_thumbs_down: detailsCopy.aria_label_thumbs_down,\n aria_label_thumbs_up: detailsCopy.aria_label_thumbs_up,\n benefits: Object.values(detailsCopy.benefits_list ?? {}),\n description: detailsCopy.description,\n footer_title: detailsCopy.footer_title,\n header_text: detailsCopy.header_text,\n shared_info_description: detailsCopy.shared_info_description,\n shared_info_header_text: detailsCopy.shared_info_header_text,\n shared_info_items: Object.values(detailsCopy.shared_info_list ?? {}),\n }\n\n // TODO(analytics): forward the thumbs response once the host contract for\n // connection-details feedback lands (V1 posted it via sendResponseAnalytics).\n return <ConnectionDetailDrillDown copy={copy} />\n})\n"],"mappings":";;;;AAgBA,IAAa,IAA8B,EAAS,SAClD,GACA;AAEA,QAAM,IADY,EACE,EAAU,eAAe;AAE7C,MAAI,CAAC,EAAa,QAAO;AAEzB,QAAM,IAAgC;AAAA,IACpC,wBAAwB,EAAY;AAAA,IACpC,sBAAsB,EAAY;AAAA,IAClC,UAAU,OAAO,OAAO,EAAY,iBAAiB,CAAC,CAAC;AAAA,IACvD,aAAa,EAAY;AAAA,IACzB,cAAc,EAAY;AAAA,IAC1B,aAAa,EAAY;AAAA,IACzB,yBAAyB,EAAY;AAAA,IACrC,yBAAyB,EAAY;AAAA,IACrC,mBAAmB,OAAO,OAAO,EAAY,oBAAoB,CAAC,CAAC;AAAA,EACrE;AAIA,SAAO,gBAAA,EAAC,GAAD,EAAiC,MAAA,EAAO,CAAA;AACjD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ActionBlockProps } from '../mappings/blocks';
2
+ /**
3
+ * `feedback_modal_block` — a CTA drilldown registered like any other drawer
4
+ * block; its content is a MODAL (the dialog portals over the drawer).
5
+ *
6
+ * Flow: the CTA (e.g. Set Up Direct Deposit's "Not Interested") opens the
7
+ * "Can you tell us why?" survey (Figma `1941:192803`). Submit forwards the
8
+ * selection to the host via `beatActions.onSubmitFeedback` (source `cta`) and
9
+ * swaps the dialog for the success snackbar (Figma `1941:167636`); closing the
10
+ * snackbar — or dismissing the dialog — ends the action-drawer session.
11
+ *
12
+ * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the
13
+ * description interpolates the beat's account name (`_1{account_name}`).
14
+ */
15
+ export declare const FeedbackModalActionBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
16
+ displayName: string;
17
+ };
@@ -0,0 +1,39 @@
1
+ import { buildDynamicCopy as l } from "../../core/utils/Localization.es.js";
2
+ import { useGlobalCopyStore as m, useInsightsV2Store as u } from "../../common/context/hooks.es.js";
3
+ import { useBeatActions as d } from "../beatActions.es.js";
4
+ import b from "../components/FeedbackModal.es.js";
5
+ import { observer as p } from "mobx-react-lite";
6
+ import { jsx as _ } from "react/jsx-runtime";
7
+ var C = p(function({ beat: t }) {
8
+ const { closeActionDrawer: s } = u(), { onSubmitFeedback: a } = d(), i = m(), e = t.insights_payload, o = i.insights_feed?.feedback_modal;
9
+ if (!e || !o) return null;
10
+ const r = {
11
+ title: o.title,
12
+ description: l(o.description, e.instance_slot?.account_name ?? ""),
13
+ options: Object.values(o.options ?? {}),
14
+ submitText: o.submit,
15
+ cancelText: o.no_thanks,
16
+ closeAriaLabel: o.close_aria,
17
+ characterLimitLabel: o.character_limit,
18
+ successMessage: o.success_message,
19
+ errorMessage: o.error_message,
20
+ tryAgainText: o.try_again,
21
+ toastCloseAriaLabel: o.toast_close_aria
22
+ };
23
+ return /* @__PURE__ */ _(b, {
24
+ copy: r,
25
+ isOpen: !0,
26
+ onClose: () => s(),
27
+ onSubmit: (c, n) => a?.({
28
+ beatGuid: e.guid,
29
+ source: "cta",
30
+ option: c,
31
+ detail: n
32
+ })
33
+ });
34
+ });
35
+ export {
36
+ C as FeedbackModalActionBlock
37
+ };
38
+
39
+ //# sourceMappingURL=FeedbackModalActionBlock.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FeedbackModalActionBlock.es.js","names":[],"sources":["../../../src/insights-v2/actionBlocks/FeedbackModalActionBlock.tsx"],"sourcesContent":["import { observer } from 'mobx-react-lite'\n\nimport { useGlobalCopyStore, useInsightsV2Store } from '../../common'\nimport { buildDynamicCopy } from '../../core/utils/Localization'\nimport FeedbackModal, { type FeedbackModalContent } from '../components/FeedbackModal'\nimport { useBeatActions } from '../beatActions'\nimport type { ActionBlockProps } from '../mappings/blocks'\n\n/**\n * `feedback_modal_block` — a CTA drilldown registered like any other drawer\n * block; its content is a MODAL (the dialog portals over the drawer).\n *\n * Flow: the CTA (e.g. Set Up Direct Deposit's \"Not Interested\") opens the\n * \"Can you tell us why?\" survey (Figma `1941:192803`). Submit forwards the\n * selection to the host via `beatActions.onSubmitFeedback` (source `cta`) and\n * swaps the dialog for the success snackbar (Figma `1941:167636`); closing the\n * snackbar — or dismissing the dialog — ends the action-drawer session.\n *\n * Copy comes from `insights_feed.feedback_modal` in GlobalCopy; the\n * description interpolates the beat's account name (`_1{account_name}`).\n */\nexport const FeedbackModalActionBlock = observer(function FeedbackModalActionBlock({\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 modalCopy = copyStore.insights_feed?.feedback_modal\n\n if (!insights_payload || !modalCopy) return null\n\n const copy: FeedbackModalContent = {\n title: modalCopy.title,\n description: buildDynamicCopy(\n modalCopy.description,\n // `account_name` lands on InstanceSlot with the Direct Deposit block (WEC-1875);\n // narrow-cast until that merges so the modal stays beat-agnostic.\n (insights_payload.instance_slot as { account_name?: string })?.account_name ?? '',\n ) as string,\n options: Object.values(modalCopy.options ?? {}),\n submitText: modalCopy.submit,\n cancelText: modalCopy.no_thanks,\n closeAriaLabel: modalCopy.close_aria,\n characterLimitLabel: modalCopy.character_limit,\n successMessage: modalCopy.success_message,\n errorMessage: modalCopy.error_message,\n tryAgainText: modalCopy.try_again,\n toastCloseAriaLabel: modalCopy.toast_close_aria,\n }\n\n // Returned (not just fired): a host promise rejection drives the modal's\n // error snackbar + Try Again retry.\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\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 <FeedbackModal\n copy={copy}\n isOpen={true}\n onClose={() => closeActionDrawer()}\n onSubmit={handleSubmit}\n />\n )\n})\n"],"mappings":";;;;;;AAqBA,IAAa,IAA2B,EAAS,SAAkC,EACjF,MAAA,EAAA,GACmB;AACnB,QAAM,EAAE,mBAAA,EAAA,IAAsB,EAAmB,GAC3C,EAAE,kBAAA,EAAA,IAAqB,EAAe,GACtC,IAAY,EAAmB,GAE/B,IAAmB,EAAK,kBACxB,IAAY,EAAU,eAAe;AAE3C,MAAI,CAAC,KAAoB,CAAC,EAAW,QAAO;AAE5C,QAAM,IAA6B;AAAA,IACjC,OAAO,EAAU;AAAA,IACjB,aAAa,EACX,EAAU,aAGT,EAAiB,eAA6C,gBAAgB,EACjF;AAAA,IACA,SAAS,OAAO,OAAO,EAAU,WAAW,CAAC,CAAC;AAAA,IAC9C,YAAY,EAAU;AAAA,IACtB,YAAY,EAAU;AAAA,IACtB,gBAAgB,EAAU;AAAA,IAC1B,qBAAqB,EAAU;AAAA,IAC/B,gBAAgB,EAAU;AAAA,IAC1B,cAAc,EAAU;AAAA,IACxB,cAAc,EAAU;AAAA,IACxB,qBAAqB,EAAU;AAAA,EACjC;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"}
@@ -0,0 +1,16 @@
1
+ import { ActionBlockProps } from '../mappings/blocks';
2
+ /**
3
+ * `survey_modal_block` — the "Does this look right?" confirmation survey
4
+ * (Figma `1941:212640`). Registered like any other drawer block; its content
5
+ * is a MODAL (the dialog portals over the drawer).
6
+ *
7
+ * The survey has no action buttons — its rows act: the positive row submits
8
+ * to the host via `beatActions.onSubmitFeedback` (source `cta`) and shows the
9
+ * status snackbar; the negative row opens the FeedbackModal reasons dialog.
10
+ * The session ends when the flow does (snackbar dismissed or dialogs closed).
11
+ *
12
+ * Copy comes from `insights_feed.survey_modal` in GlobalCopy.
13
+ */
14
+ export declare const SurveyModalActionBlock: (({ beat, }: ActionBlockProps) => import("react/jsx-runtime").JSX.Element | null) & {
15
+ displayName: string;
16
+ };
@@ -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\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
+ {"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"}
@@ -3,13 +3,13 @@ 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 { ErrorCard as U } from "./ErrorCard.es.js";
7
- import { useBeatCtaActions as j } from "../ctaActions/useCtaAction.es.js";
8
- import { blocks as z } from "../mappings/blocks.es.js";
9
- import G from "./Footer.es.js";
10
- import K from "./Header.es.js";
11
- import { FeedbackBar as X } from "./FeedbackBar.es.js";
12
- import V from "./FeedbackDialog.es.js";
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
13
  import { DismissInsightDialog as W } from "./DismissInsightDialog.es.js";
14
14
  import { HiddenConfirmationCard as Y } from "./HiddenConfirmationCard.es.js";
15
15
  import { LoadingCard as q } from "./LoadingCard.es.js";
@@ -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 } = j(t, s, t.insights_payload?.primary_cta, t.insights_payload?.secondary_cta);
46
- if (_) return /* @__PURE__ */ i(U, {});
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,7 +57,7 @@ var so = {}, no = {
57
57
  }
58
58
  await T(f, u);
59
59
  }
60
- }, k = z[A], d = L === "mini", m = v.insights_feed?.general, p = c?.state === "not_refreshable" && !F && !!m;
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, {
@@ -79,7 +79,7 @@ var so = {}, no = {
79
79
  } },
80
80
  children: [
81
81
  p && /* @__PURE__ */ i(ro, { sx: no }),
82
- /* @__PURE__ */ i(K, {
82
+ /* @__PURE__ */ i(X, {
83
83
  isMini: d,
84
84
  subtitle: w,
85
85
  title: D ?? ""
@@ -136,7 +136,7 @@ var so = {}, no = {
136
136
  children: n.label
137
137
  })]
138
138
  }),
139
- /* @__PURE__ */ i(X, {
139
+ /* @__PURE__ */ i(V, {
140
140
  onTellUsMore: o.openRatingSurvey,
141
141
  show: o.isFeedbackBarShown
142
142
  })
@@ -148,7 +148,7 @@ var so = {}, no = {
148
148
  onClose: o.closeDismissDialog,
149
149
  onDismiss: o.confirmDismiss
150
150
  }),
151
- o.isSurveyOpen && /* @__PURE__ */ i(V, {
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(G, { footer: e.footer })
164
+ o.cardState === "visible" && e.footer && /* @__PURE__ */ i(K, { footer: e.footer })
165
165
  ]
166
166
  })
167
167
  });
@@ -0,0 +1,32 @@
1
+ export interface ConnectionDetailItem {
2
+ content: string;
3
+ icon_name: string;
4
+ title: string;
5
+ }
6
+ /** Resolved strings the drilldown renders (see ConnectionDetailActionBlock). */
7
+ export interface ConnectionDetailContent {
8
+ aria_label_thumbs_down: string;
9
+ aria_label_thumbs_up: string;
10
+ benefits: string[];
11
+ description: string;
12
+ footer_title: string;
13
+ header_text: string;
14
+ shared_info_description: string;
15
+ shared_info_header_text: string;
16
+ shared_info_items: ConnectionDetailItem[];
17
+ }
18
+ interface ConnectionDetailDrillDownProps {
19
+ copy: ConnectionDetailContent;
20
+ /** Thumbs response — `'yes'` (up) / `'no'` (down). */
21
+ onRespond?: (response: 'yes' | 'no') => void;
22
+ }
23
+ /**
24
+ * Insights-v2 copy of the V1 `insights/components/shared/ConnectionDetailDrillDown`:
25
+ * the connection-details education panel (benefits, shared-info cards, and a
26
+ * thumbs was-this-helpful footer).
27
+ *
28
+ * Unlike V1, this is drawer CONTENT only — the `connection_detail_block`
29
+ * registry entry supplies the drawer and its title via ActionBlockLayer.
30
+ */
31
+ declare const ConnectionDetailDrillDown: ({ copy, onRespond }: ConnectionDetailDrillDownProps) => import("react/jsx-runtime").JSX.Element;
32
+ export default ConnectionDetailDrillDown;
@@ -0,0 +1,148 @@
1
+ import i from "@mui/material/Stack";
2
+ import { P as a, Text as s } from "@mxenabled/mxui";
3
+ import { Icon as l } from "@mxenabled/mx-icons";
4
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
5
+ import d from "@mui/material/IconButton";
6
+ import h from "@mui/material/Card";
7
+ import x from "@mui/material/CardContent";
8
+ var m = ({ icon: r, title: o, description: n }) => /* @__PURE__ */ e(h, {
9
+ variant: "outlined",
10
+ children: /* @__PURE__ */ t(x, {
11
+ sx: {
12
+ display: "flex",
13
+ gap: 12,
14
+ "&:last-child": { pb: 16 }
15
+ },
16
+ children: [r, /* @__PURE__ */ t(i, {
17
+ sx: { gap: 4 },
18
+ children: [/* @__PURE__ */ e(s, {
19
+ bold: !0,
20
+ variant: "body1",
21
+ children: o
22
+ }), /* @__PURE__ */ e(a, {
23
+ sx: {
24
+ color: "text.secondary",
25
+ fontWeight: 400
26
+ },
27
+ variant: "subtitle2",
28
+ children: n
29
+ })]
30
+ })]
31
+ })
32
+ }), I = ({ copy: r, onRespond: o }) => /* @__PURE__ */ t(i, {
33
+ sx: {
34
+ p: 24,
35
+ bgcolor: "background.paper"
36
+ },
37
+ children: [
38
+ /* @__PURE__ */ t(i, {
39
+ sx: {
40
+ gap: 16,
41
+ pb: 16
42
+ },
43
+ children: [/* @__PURE__ */ t(i, {
44
+ sx: { gap: 4 },
45
+ children: [/* @__PURE__ */ e(a, {
46
+ variant: "h3",
47
+ children: r.header_text
48
+ }), /* @__PURE__ */ e(a, {
49
+ sx: {
50
+ fontWeight: 400,
51
+ color: "text.secondary"
52
+ },
53
+ variant: "subtitle2",
54
+ children: r.description
55
+ })]
56
+ }), /* @__PURE__ */ e(i, {
57
+ sx: { gap: 12 },
58
+ children: r.benefits.map((n, c) => /* @__PURE__ */ t(i, {
59
+ sx: {
60
+ flexDirection: "row",
61
+ gap: 8
62
+ },
63
+ children: [/* @__PURE__ */ e(l, {
64
+ color: "success",
65
+ name: "check_circle",
66
+ size: 16
67
+ }), /* @__PURE__ */ e(a, {
68
+ sx: { fontWeight: 400 },
69
+ variant: "subtitle2",
70
+ children: n
71
+ })]
72
+ }, c))
73
+ })]
74
+ }),
75
+ /* @__PURE__ */ t(i, {
76
+ sx: {
77
+ gap: 4,
78
+ py: 12
79
+ },
80
+ children: [/* @__PURE__ */ e(s, {
81
+ sx: { fontWeight: 600 },
82
+ variant: "body1",
83
+ children: r.shared_info_header_text
84
+ }), /* @__PURE__ */ e(a, {
85
+ sx: {
86
+ color: "text.secondary",
87
+ lineHeight: "20px"
88
+ },
89
+ variant: "body2",
90
+ children: r.shared_info_description
91
+ })]
92
+ }),
93
+ /* @__PURE__ */ e(i, {
94
+ sx: {
95
+ py: 16,
96
+ gap: 24
97
+ },
98
+ children: r.shared_info_items.map((n, c) => /* @__PURE__ */ e(m, {
99
+ description: n.content,
100
+ icon: /* @__PURE__ */ e(l, {
101
+ name: n.icon_name,
102
+ size: 24,
103
+ sx: { color: "text.primary" }
104
+ }),
105
+ title: n.title
106
+ }, c))
107
+ }),
108
+ /* @__PURE__ */ t(i, {
109
+ sx: {
110
+ py: 16,
111
+ gap: 12,
112
+ alignItems: "center"
113
+ },
114
+ children: [/* @__PURE__ */ e(s, {
115
+ bold: !0,
116
+ children: r.footer_title
117
+ }), /* @__PURE__ */ t(i, {
118
+ sx: {
119
+ flexDirection: "row",
120
+ alignItems: "center",
121
+ gap: 24
122
+ },
123
+ children: [/* @__PURE__ */ e(d, {
124
+ "aria-label": r.aria_label_thumbs_down,
125
+ onClick: () => o?.("no"),
126
+ children: /* @__PURE__ */ e(l, {
127
+ color: "secondary",
128
+ name: "thumb_down",
129
+ size: 24
130
+ })
131
+ }), /* @__PURE__ */ e(d, {
132
+ "aria-label": r.aria_label_thumbs_up,
133
+ onClick: () => o?.("yes"),
134
+ children: /* @__PURE__ */ e(l, {
135
+ color: "secondary",
136
+ name: "thumb_up",
137
+ size: 24
138
+ })
139
+ })]
140
+ })]
141
+ })
142
+ ]
143
+ });
144
+ export {
145
+ I as default
146
+ };
147
+
148
+ //# sourceMappingURL=ConnectionDetailDrillDown.es.js.map