@mx-cartographer/experiences 9.4.19-alpha.al3 → 9.4.19

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 (41) hide show
  1. package/CHANGELOG.md +16 -7
  2. package/dist/common/components/dialog/Dialog.d.ts +1 -1
  3. package/dist/common/components/dialog/Dialog.es.js.map +1 -1
  4. package/dist/core/types/AppData.d.ts +0 -2
  5. package/dist/core/types/localization/InsightsFeedCopy.d.ts +6 -0
  6. package/dist/insights-v2/beatActions.d.ts +5 -19
  7. package/dist/insights-v2/beatActions.es.js.map +1 -1
  8. package/dist/insights-v2/components/BaseLayout.d.ts +8 -3
  9. package/dist/insights-v2/components/BaseLayout.es.js +105 -80
  10. package/dist/insights-v2/components/BaseLayout.es.js.map +1 -1
  11. package/dist/insights-v2/components/DismissInsightDialog.d.ts +1 -8
  12. package/dist/insights-v2/components/DismissInsightDialog.es.js.map +1 -1
  13. package/dist/insights-v2/components/FeedbackBar.d.ts +1 -12
  14. package/dist/insights-v2/components/FeedbackBar.es.js.map +1 -1
  15. package/dist/insights-v2/components/FeedbackDialog.d.ts +7 -25
  16. package/dist/insights-v2/components/FeedbackDialog.es.js +54 -42
  17. package/dist/insights-v2/components/FeedbackDialog.es.js.map +1 -1
  18. package/dist/insights-v2/components/HiddenConfirmationCard.d.ts +1 -11
  19. package/dist/insights-v2/components/HiddenConfirmationCard.es.js.map +1 -1
  20. package/dist/insights-v2/components/InsightOptionsMenu.d.ts +1 -6
  21. package/dist/insights-v2/components/InsightOptionsMenu.es.js.map +1 -1
  22. package/dist/insights-v2/components/ObsolesceBanner.d.ts +26 -0
  23. package/dist/insights-v2/components/ObsolesceBanner.es.js +119 -0
  24. package/dist/insights-v2/components/ObsolesceBanner.es.js.map +1 -0
  25. package/dist/insights-v2/hooks/useBeatFeedbackFlow.d.ts +8 -15
  26. package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js +35 -25
  27. package/dist/insights-v2/hooks/useBeatFeedbackFlow.es.js.map +1 -1
  28. package/dist/insights-v2/index.d.ts +2 -1
  29. package/dist/insights-v2/index.es.js +32 -30
  30. package/package.json +1 -9
  31. package/dist/rum/RumRedaction.d.ts +0 -3
  32. package/dist/rum/RumRedaction.es.js +0 -8
  33. package/dist/rum/RumRedaction.es.js.map +0 -1
  34. package/dist/rum/beforeSend.d.ts +0 -40
  35. package/dist/rum/beforeSend.es.js +0 -16
  36. package/dist/rum/beforeSend.es.js.map +0 -1
  37. package/dist/rum/errorBuffer.d.ts +0 -9
  38. package/dist/rum/errorBuffer.es.js +0 -27
  39. package/dist/rum/errorBuffer.es.js.map +0 -1
  40. package/dist/rum/index.d.ts +0 -3
  41. package/dist/rum/index.es.js +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"useBeatFeedbackFlow.es.js","names":[],"sources":["../../../src/insights-v2/hooks/useBeatFeedbackFlow.ts"],"sourcesContent":["import { useMemo, useState } from 'react'\n\nimport { useGlobalCopyStore } from '../../common'\nimport type { Beat } from '../../core'\nimport type { BeatActions, InsightRating } from '../beatActions'\nimport type { DismissType } from '../components/DismissInsightDialog'\n\n/** Which flow opened the survey dialog (null = closed): a rating or the hide flow. */\nexport type FeedbackVariant = InsightRating | 'hide'\n\n/**\n * What the card slot shows:\n * - `visible` the original beat card\n * - `confirming` the hidden-confirmation card (grace period after a hide)\n * - `dismissed` nothing (beat stays hidden; the host removes it on refresh)\n */\nexport type CardState = 'visible' | 'confirming' | 'dismissed'\n\n/**\n * Owns the post-action UI state machine for a beat card: the feedback bar shown\n * after a rating, the \"hide this insight\" dismiss dialog, the hidden-confirmation\n * card, and the shared feedback survey dialog.\n *\n * Experiences owns this UI; the host only receives callbacks (rate / dismiss /\n * undo / submit-feedback) via `beatActions`. Keeping the machine here leaves\n * BaseLayout as pure layout.\n */\nexport const useBeatFeedbackFlow = (beat: Beat, beatActions: BeatActions) => {\n const copyStore = useGlobalCopyStore()\n\n // Rating that surfaced the feedback bar (null = hidden). The bar confirms the\n // vote and offers a follow-up survey.\n const [feedbackRating, setFeedbackRating] = useState<InsightRating | null>(null)\n // Which flow opened the survey dialog (null = closed).\n const [feedbackVariant, setFeedbackVariant] = useState<FeedbackVariant | null>(null)\n // The \"hide this insight\" confirmation dialog (pick once / always).\n const [isDismissOpen, setIsDismissOpen] = useState(false)\n // Drives the card slot through the hide flow (see CardState).\n const [cardState, setCardState] = useState<CardState>('visible')\n\n // Survey title + reasons for the active variant. FeedbackDialog is generic, so\n // the variant-to-copy mapping lives here: hide uses the dismiss reasons; a\n // rating uses its matching helpful / not-helpful reasons.\n //\n // Not memoized on purpose: it reads observable copy fields, and the consumer\n // (BaseLayout) is an observer, so deriving on each render keeps it in sync when\n // copy reloads (a useMemo keyed on the stable store ref would go stale). The\n // work is a few lookups + Object.values on small arrays — cheap.\n const resolveSurvey = () => {\n const feedbackCopy = copyStore.insights_feed?.feedback\n const hideCopy = copyStore.insights_feed?.hide_feedback\n\n // Buttons + labels come from the same block as the reasons, so the hide and\n // rating surveys stay independently localizable (no cross-variant leakage).\n const chrome = {\n characterLimitLabel: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.character_limit,\n closeAriaLabel: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.close_aria ?? 'Close',\n submitText: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.submit ?? 'Submit',\n backText: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.back ?? 'Back',\n }\n\n if (feedbackVariant === 'hide' && hideCopy) {\n return { title: hideCopy.title, options: Object.values(hideCopy.options), ...chrome }\n }\n\n const options =\n feedbackVariant === 'not_helpful'\n ? Object.values(feedbackCopy?.not_helpful_options ?? {})\n : Object.values(feedbackCopy?.helpful_options ?? {})\n\n return { title: feedbackCopy?.tell_us_more_title ?? 'Tell us more', options, ...chrome }\n }\n\n const survey = resolveSurvey()\n\n // Wrap the host's menu handler so experiences owns the post-action UI (feedback\n // bar for a vote, dismiss dialog for hide) while the host still sees the action.\n const wrappedActions = useMemo<BeatActions>(() => {\n const menu = beatActions.onMenuAction\n if (!menu) return beatActions\n return {\n ...beatActions,\n onMenuAction: {\n ...menu,\n onAction: (action) => {\n if (action === 'helpful' || action === 'not_helpful') {\n setFeedbackRating(action)\n } else if (action === 'hide') {\n setIsDismissOpen(true)\n }\n menu.onAction(action)\n },\n },\n }\n }, [beatActions])\n\n // --- Feedback survey ------------------------------------------------------\n\n /** Open the survey from the feedback bar's \"Tell us more\" (rating flow only). */\n const openRatingSurvey = () => {\n if (feedbackRating) setFeedbackVariant(feedbackRating)\n }\n\n /** Open the hide survey from the confirmation card's \"Leave Feedback\". */\n const openHideSurvey = () => setFeedbackVariant('hide')\n\n /** Close the survey (X / Back). A rating survey also clears the feedback bar. */\n const closeSurvey = () => {\n // Intentional asymmetry (matches the host): closing a rating survey also\n // clears the \"Feedback sent\" bar, while the hide flow keeps its confirmation\n // card up (Undo stays reachable). The card guards a destructive hide; the\n // rating bar is just a non-destructive vote confirmation.\n if (feedbackVariant !== 'hide') setFeedbackRating(null)\n setFeedbackVariant(null)\n }\n\n const submitSurvey = (option: string, detail?: string) => {\n if (!feedbackVariant) return\n beatActions.onSubmitFeedback?.({ beatGuid: beat.guid, source: feedbackVariant, option, detail })\n setFeedbackVariant(null)\n // Rating surveys clear the confirmation bar; the hide survey collapses the\n // confirmation card. The beat stays hidden either way — the host removes it.\n if (feedbackVariant === 'hide') {\n setCardState('dismissed')\n } else {\n setFeedbackRating(null)\n }\n }\n\n // --- Hide flow ------------------------------------------------------------\n\n /** Confirm a hide from the dismiss dialog; swaps in the confirmation card. */\n const confirmDismiss = (type: DismissType) => {\n beatActions.onDismissInsight?.({ beatGuid: beat.guid, type })\n setCardState('confirming')\n }\n\n /** Undo a hide from the confirmation card; restores the original card. */\n const undoDismiss = () => {\n beatActions.onUndoDismiss?.({ beatGuid: beat.guid })\n setFeedbackRating(null) // Clear any stale rating-bar state from before the hide\n setCardState('visible')\n }\n\n /** Close the confirmation card without undoing; the beat stays hidden. */\n const collapseConfirmation = () => setCardState('dismissed')\n\n const closeDismissDialog = () => setIsDismissOpen(false)\n\n return {\n cardState,\n isDismissOpen,\n isSurveyOpen: feedbackVariant !== null,\n isFeedbackBarShown: feedbackRating !== null,\n survey,\n wrappedActions,\n // survey actions\n openRatingSurvey,\n openHideSurvey,\n closeSurvey,\n submitSurvey,\n // hide-flow actions\n confirmDismiss,\n undoDismiss,\n collapseConfirmation,\n closeDismissDialog,\n }\n}\n"],"mappings":";;AA2BA,IAAa,IAAA,CAAuB,GAAY,MAA6B;AAC3E,QAAM,IAAY,EAAmB,GAI/B,CAAC,GAAgB,CAAA,IAAqB,EAA+B,IAAI,GAEzE,CAAC,GAAiB,CAAA,IAAsB,EAAiC,IAAI,GAE7E,CAAC,GAAe,CAAA,IAAoB,EAAS,EAAK,GAElD,CAAC,GAAW,CAAA,IAAgB,EAAoB,SAAS,GAmCzD,KAzBA,MAAsB;AAC1B,UAAM,IAAe,EAAU,eAAe,UACxC,IAAW,EAAU,eAAe,eAIpC,IAAS;AAAA,MACb,sBAAsB,MAAoB,SAAS,IAAW,IAAe;AAAA,MAC7E,iBAAiB,MAAoB,SAAS,IAAW,IAAe,cAAc;AAAA,MACtF,aAAa,MAAoB,SAAS,IAAW,IAAe,UAAU;AAAA,MAC9E,WAAW,MAAoB,SAAS,IAAW,IAAe,QAAQ;AAAA,IAC5E;AAEA,QAAI,MAAoB,UAAU,EAChC,QAAO;AAAA,MAAE,OAAO,EAAS;AAAA,MAAO,SAAS,OAAO,OAAO,EAAS,OAAO;AAAA,MAAG,GAAG;AAAA,IAAO;AAGtF,UAAM,IAEA,OAAO,OADX,MAAoB,gBACF,GAAc,uBAAuB,CAAC,IACtC,GAAc,mBAAmB,CAAC,CADK;AAG3D,WAAO;AAAA,MAAE,OAAO,GAAc,sBAAsB;AAAA,MAAgB,SAAA;AAAA,MAAS,GAAG;AAAA,IAAO;AAAA,EACzF,GAE6B,GAIvB,IAAiB,EAAA,MAA2B;AAChD,UAAM,IAAO,EAAY;AACzB,WAAK,IACE;AAAA,MACL,GAAG;AAAA,MACH,cAAc;AAAA,QACZ,GAAG;AAAA,QACH,UAAA,CAAW,MAAW;AACpB,UAAI,MAAW,aAAa,MAAW,gBACrC,EAAkB,CAAM,IACf,MAAW,UACpB,EAAiB,EAAI,GAEvB,EAAK,SAAS,CAAM;AAAA,QACtB;AAAA,MACF;AAAA,IACF,IAdkB;AAAA,EAepB,GAAG,CAAC,CAAW,CAAC;AAuDhB,SAAO;AAAA,IACL,WAAA;AAAA,IACA,eAAA;AAAA,IACA,cAAc,MAAoB;AAAA,IAClC,oBAAoB,MAAmB;AAAA,IACvC,QAAA;AAAA,IACA,gBAAA;AAAA,IAEA,kBA1DI,MAAyB;AAC7B,MAAI,KAAgB,EAAmB,CAAc;AAAA,IACvD;AAAA,IAyDE,gBAtDI,MAAuB,EAAmB,MAAM;AAAA,IAuDpD,aApDI,MAAoB;AAKxB,MAAI,MAAoB,UAAQ,EAAkB,IAAI,GACtD,EAAmB,IAAI;AAAA,IACzB;AAAA,IA8CE,cA5CI,CAAgB,GAAgB,MAAoB;AACxD,MAAK,MACL,EAAY,mBAAmB;AAAA,QAAE,UAAU,EAAK;AAAA,QAAM,QAAQ;AAAA,QAAiB,QAAA;AAAA,QAAQ,QAAA;AAAA,MAAO,CAAC,GAC/F,EAAmB,IAAI,GAGnB,MAAoB,SACtB,EAAa,WAAW,IAExB,EAAkB,IAAI;AAAA,IAE1B;AAAA,IAmCE,gBA9BI,CAAkB,MAAsB;AAC5C,MAAA,EAAY,mBAAmB;AAAA,QAAE,UAAU,EAAK;AAAA,QAAM,MAAA;AAAA,MAAK,CAAC,GAC5D,EAAa,YAAY;AAAA,IAC3B;AAAA,IA4BE,aAzBI,MAAoB;AACxB,MAAA,EAAY,gBAAgB,EAAE,UAAU,EAAK,KAAK,CAAC,GACnD,EAAkB,IAAI,GACtB,EAAa,SAAS;AAAA,IACxB;AAAA,IAsBE,sBAnBI,MAA6B,EAAa,WAAW;AAAA,IAoBzD,oBAlBI,MAA2B,EAAiB,EAAK;AAAA,EAmBvD;AACF"}
1
+ {"version":3,"file":"useBeatFeedbackFlow.es.js","names":[],"sources":["../../../src/insights-v2/hooks/useBeatFeedbackFlow.ts"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react'\n\nimport { useGlobalCopyStore } from '../../common'\nimport type { Beat } from '../../core'\nimport type { BeatActions, InsightRating } from '../beatActions'\nimport type { DismissType } from '../components/DismissInsightDialog'\nimport type { FeedbackDialogCloseReason } from '../components/FeedbackDialog'\n\nexport type FeedbackVariant = InsightRating | 'hide'\nexport type CardState = 'visible' | 'confirming' | 'dismissed'\n\n/**\n * Manages feedback and dismiss UI state for a beat card.\n * Handles feedback bar, dismiss dialog, confirmation card, and survey dialogs.\n */\nexport const useBeatFeedbackFlow = (beat: Beat, beatActions: BeatActions) => {\n const copyStore = useGlobalCopyStore()\n\n const [feedbackRating, setFeedbackRating] = useState<InsightRating | null>(null)\n const [feedbackVariant, setFeedbackVariant] = useState<FeedbackVariant | null>(null)\n const [isDismissOpen, setIsDismissOpen] = useState(false)\n const [hasClosedConfirmation, setHasClosedConfirmation] = useState(false)\n\n // Reset the confirmation-closed flag whenever the beat is no longer dismissed\n // (undo or a host reload flipping is_dismissed), so a fresh dismiss always\n // starts at the confirmation card instead of jumping to 'dismissed'.\n useEffect(() => {\n if (!beat.is_dismissed) setHasClosedConfirmation(false)\n }, [beat.is_dismissed])\n\n const cardState: CardState = useMemo(() => {\n if (beat.is_dismissed && hasClosedConfirmation) return 'dismissed'\n if (beat.is_dismissed) return 'confirming'\n return 'visible'\n }, [beat.is_dismissed, hasClosedConfirmation])\n\n const resolveSurvey = () => {\n const feedbackCopy = copyStore.insights_feed?.feedback\n const hideCopy = copyStore.insights_feed?.hide_feedback\n\n const chrome = {\n characterLimitLabel: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.character_limit,\n closeAriaLabel: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.close_aria ?? 'Close',\n submitText: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.submit ?? 'Submit',\n backText: (feedbackVariant === 'hide' ? hideCopy : feedbackCopy)?.back ?? 'Back',\n }\n\n if (feedbackVariant === 'hide' && hideCopy) {\n return { title: hideCopy.title, options: Object.values(hideCopy.options), ...chrome }\n }\n\n const options =\n feedbackVariant === 'not_helpful'\n ? Object.values(feedbackCopy?.not_helpful_options ?? {})\n : Object.values(feedbackCopy?.helpful_options ?? {})\n\n return { title: feedbackCopy?.tell_us_more_title ?? 'Tell us more', options, ...chrome }\n }\n\n const survey = resolveSurvey()\n\n const wrappedActions = useMemo<BeatActions>(() => {\n const menu = beatActions.onMenuAction\n if (!menu) return beatActions\n return {\n ...beatActions,\n onMenuAction: {\n ...menu,\n onAction: (action) => {\n if (action === 'helpful' || action === 'not_helpful') {\n setFeedbackRating(action)\n } else if (action === 'hide') {\n setIsDismissOpen(true)\n }\n menu.onAction(action)\n },\n },\n }\n }, [beatActions])\n\n const openRatingSurvey = () => {\n if (feedbackRating) setFeedbackVariant(feedbackRating)\n }\n\n const openHideSurvey = () => setFeedbackVariant('hide')\n\n const closeSurvey = (reason?: FeedbackDialogCloseReason) => {\n if (reason) beatActions.onFeedbackDialogClose?.(reason)\n if (feedbackVariant !== 'hide') setFeedbackRating(null)\n setFeedbackVariant(null)\n }\n\n const submitSurvey = (option: string, detail?: string) => {\n if (!feedbackVariant) return\n beatActions.onSubmitFeedback?.({ beatGuid: beat.guid, source: feedbackVariant, option, detail })\n setFeedbackVariant(null)\n if (feedbackVariant === 'hide') {\n setHasClosedConfirmation(true)\n } else {\n setFeedbackRating(null)\n }\n }\n\n const confirmDismiss = (type: DismissType) => {\n beatActions.onDismissInsight?.({ beatGuid: beat.guid, type })\n }\n\n const undoDismiss = () => {\n beatActions.onUndoDismiss?.({ beatGuid: beat.guid })\n setFeedbackRating(null)\n }\n\n const collapseConfirmation = () => {\n setHasClosedConfirmation(true)\n }\n\n const closeDismissDialog = () => setIsDismissOpen(false)\n\n return {\n cardState,\n isDismissOpen,\n isSurveyOpen: feedbackVariant !== null,\n isFeedbackBarShown: feedbackRating !== null,\n survey,\n wrappedActions,\n openRatingSurvey,\n openHideSurvey,\n closeSurvey,\n submitSurvey,\n confirmDismiss,\n undoDismiss,\n collapseConfirmation,\n closeDismissDialog,\n feedbackDialogCallbacks: {\n onBackClick: beatActions.onFeedbackDialogBack,\n onTextInputFocus: beatActions.onFeedbackTextFocus,\n },\n }\n}\n"],"mappings":"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"}
@@ -11,8 +11,9 @@ export { default as OverflowMenu, type OverflowMenuItem, type OverflowMenuProps,
11
11
  export { default as InsightOptionsMenu } from './components/InsightOptionsMenu';
12
12
  export { default as DismissInsightDialog, type DismissInsightDialogProps, type DismissType, } from './components/DismissInsightDialog';
13
13
  export { default as HiddenConfirmationCard, type HiddenConfirmationCardProps, } from './components/HiddenConfirmationCard';
14
- export { default as FeedbackDialog, type FeedbackDialogProps } from './components/FeedbackDialog';
14
+ export { default as FeedbackDialog, type FeedbackDialogCloseReason, type FeedbackDialogProps, } from './components/FeedbackDialog';
15
15
  export { default as FeedbackBar, type FeedbackBarProps } from './components/FeedbackBar';
16
+ export { ObsolesceBanner, type ObsolesceBannerProps, type ObsolesceBannerState, type ObsolesceBannerCopy, } from './components/ObsolesceBanner';
16
17
  export { useBeatActions, type BeatActions, type MenuActionHandlers, type UpdateParams, type FeedbackParams, type DismissParams, type InsightMenuAction, type InsightRating, } from './beatActions';
17
18
  export { default as LogoTile } from './components/LogoTile';
18
19
  export { default as MerchantHighlightCard } from './components/MerchantHighlightCard';
@@ -3,18 +3,18 @@ import { BarchartBlock as p } from "./blocks/ChartBlocks/BarchartBlock/BarchartB
3
3
  import { DoubleBarChartBlock as e } from "./blocks/ChartBlocks/DoubleBarChartBlock/DoubleBarChartBlock.es.js";
4
4
  import c from "./blocks/ChartBlocks/StepChartBlock/StepChartBlock.es.js";
5
5
  import l from "./blocks/ChartBlocks/DonutChartBlock/DonutChartBlock.es.js";
6
- import C from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
6
+ import B from "./blocks/ChartBlocks/DoubleProgressBarBlock/DoubleProgressBarBlock.es.js";
7
7
  import d from "./blocks/ComponentBlocks/AccountBlock/AccountBlock.es.js";
8
8
  import k from "./components/TransferLogoCard.es.js";
9
9
  import S from "./blocks/ComponentBlocks/AccountSwitchBlock/AccountSwitchBlock.es.js";
10
- import { BudgetBlock as D } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
10
+ import { BudgetBlock as b } from "./blocks/ComponentBlocks/BudgetBlock/BudgetBlock.es.js";
11
11
  import T from "./components/SaveAnExtraCard.es.js";
12
12
  import v from "./blocks/ComponentBlocks/SaveExtraBlock/SaveExtraBlock.es.js";
13
13
  import I from "./components/InsightTransactionRow.es.js";
14
14
  import y from "./components/TransactionListCard.es.js";
15
- import { CategoryTransactionsBlock as R } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
16
- import { SVGImageBlock as x } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
17
- import O from "./components/AccountHeroCard.es.js";
15
+ import { CategoryTransactionsBlock as O } from "./blocks/ComponentBlocks/TransactionBlock/TransactionBlock.es.js";
16
+ import { SVGImageBlock as w } from "./blocks/ImageBlocks/SVGImageBlock/SVGImageBlock.es.js";
17
+ import E from "./components/AccountHeroCard.es.js";
18
18
  import F from "./components/AmountPill.es.js";
19
19
  import G from "./components/DesignateEmergencySavingsCard.es.js";
20
20
  import { useBeatActions as U } from "./beatActions.es.js";
@@ -24,52 +24,54 @@ import { FeedbackBar as Q } from "./components/FeedbackBar.es.js";
24
24
  import X from "./components/FeedbackDialog.es.js";
25
25
  import { DismissInsightDialog as Z } from "./components/DismissInsightDialog.es.js";
26
26
  import { HiddenConfirmationCard as oo } from "./components/HiddenConfirmationCard.es.js";
27
- import to from "./components/BaseLayout.es.js";
28
- import io from "./components/StatusMessageCard.es.js";
29
- import po from "./components/LogoTile.es.js";
30
- import eo from "./components/LogoClusterCard.es.js";
31
- import co from "./components/MerchantHighlightCard.es.js";
32
- import lo from "./components/P2PLogoStack.es.js";
33
- import Co from "./components/SavingsOpportunityCard.es.js";
34
- import uo from "./components/StatusPill.es.js";
35
- import ho from "./components/SubscriptionHeroCard.es.js";
36
- import Ao from "./components/UpcomingBillCard.es.js";
27
+ import { ObsolesceBanner as to } from "./components/ObsolesceBanner.es.js";
28
+ import io from "./components/BaseLayout.es.js";
29
+ import po from "./components/StatusMessageCard.es.js";
30
+ import eo from "./components/LogoTile.es.js";
31
+ import co from "./components/LogoClusterCard.es.js";
32
+ import lo from "./components/MerchantHighlightCard.es.js";
33
+ import Bo from "./components/P2PLogoStack.es.js";
34
+ import uo from "./components/SavingsOpportunityCard.es.js";
35
+ import ho from "./components/StatusPill.es.js";
36
+ import Ao from "./components/SubscriptionHeroCard.es.js";
37
+ import Do from "./components/UpcomingBillCard.es.js";
37
38
  export {
38
39
  d as AccountBlock,
39
- O as AccountHeroCard,
40
+ E as AccountHeroCard,
40
41
  S as AccountSwitchBlock,
41
42
  F as AmountPill,
42
43
  r as BAR_CHART_VARIANTS,
43
44
  p as BarchartBlock,
44
- to as BaseLayout,
45
- D as BudgetBlock,
46
- R as CategoryTransactionsBlock,
45
+ io as BaseLayout,
46
+ b as BudgetBlock,
47
+ O as CategoryTransactionsBlock,
47
48
  G as DesignateEmergencySavingsCard,
48
49
  Z as DismissInsightDialog,
49
50
  l as DonutChartBlock,
50
51
  e as DoubleBarChartBlock,
51
- C as DoubleProgressBarBlock,
52
+ B as DoubleProgressBarBlock,
52
53
  Q as FeedbackBar,
53
54
  X as FeedbackDialog,
54
55
  oo as HiddenConfirmationCard,
55
56
  J as InsightOptionsMenu,
56
57
  I as InsightTransactionRow,
57
- eo as LogoClusterCard,
58
- po as LogoTile,
59
- co as MerchantHighlightCard,
58
+ co as LogoClusterCard,
59
+ eo as LogoTile,
60
+ lo as MerchantHighlightCard,
61
+ to as ObsolesceBanner,
60
62
  q as OverflowMenu,
61
- lo as P2PLogoStack,
62
- x as SVGImageBlock,
63
+ Bo as P2PLogoStack,
64
+ w as SVGImageBlock,
63
65
  T as SaveAnExtraCard,
64
66
  v as SaveExtraBlock,
65
- Co as SavingsOpportunityCard,
66
- io as StatusMessageCard,
67
- uo as StatusPill,
67
+ uo as SavingsOpportunityCard,
68
+ po as StatusMessageCard,
69
+ ho as StatusPill,
68
70
  c as StepChartBlock,
69
- ho as SubscriptionHeroCard,
71
+ Ao as SubscriptionHeroCard,
70
72
  y as TransactionListCard,
71
73
  k as TransferLogoCard,
72
- Ao as UpcomingBillCard,
74
+ Do as UpcomingBillCard,
73
75
  t as barChartVariant,
74
76
  m as buildChartData,
75
77
  i as buildDataSeries,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "9.4.19-alpha.al3",
3
+ "version": "9.4.19",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -104,10 +104,6 @@
104
104
  "./trends": {
105
105
  "import": "./dist/trends/index.es.js",
106
106
  "types": "./dist/trends/index.d.ts"
107
- },
108
- "./rum": {
109
- "import": "./dist/rum/index.es.js",
110
- "types": "./dist/rum/index.d.ts"
111
107
  }
112
108
  },
113
109
  "typesVersions": {
@@ -183,9 +179,6 @@
183
179
  ],
184
180
  "trends": [
185
181
  "./dist/trends/index.d.ts"
186
- ],
187
- "rum": [
188
- "./dist/rum/index.d.ts"
189
182
  ]
190
183
  }
191
184
  },
@@ -239,7 +232,6 @@
239
232
  },
240
233
  "devDependencies": {
241
234
  "@babel/core": "^7.29.7",
242
- "@datadog/browser-rum-core": "7.12.0",
243
235
  "@storybook/addon-a11y": "^10.5.5",
244
236
  "@storybook/addon-docs": "^10.5.5",
245
237
  "@storybook/addon-links": "^10.5.5",
@@ -1,3 +0,0 @@
1
- export declare const redactGuids: <T extends string | undefined>(value: T) => T;
2
- export declare const redactAmounts: <T extends string | undefined>(value: T) => T;
3
- export declare const redactSsoPath: <T extends string | undefined>(value: T) => T;
@@ -1,8 +0,0 @@
1
- var a = /\b([A-Za-z]{3}-)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/g, t = /[-−(]?\$\s*\d(?:[\d,]|[ \u00A0\u202F](?=\d))*(?:[.,]\d+)?(?:\s*[KMB])?\)?|[-−(]?\d(?:[\d,]|[ \u00A0\u202F](?=\d))*(?:[.,]\d+)?(?:\s*[KMB])?\s*\$\)?/gi, d = /(\/(?:md\/[^/?#]+|login)\/)[^?#]+/g, T = (r) => typeof r == "string" ? r.replace(a, (s, A) => `${A ?? ""}REDACTED`) : r, f = (r) => typeof r == "string" ? r.replace(t, "$[amount]") : r, o = (r) => typeof r == "string" ? r.replace(d, "$1REDACTED") : r;
2
- export {
3
- f as redactAmounts,
4
- T as redactGuids,
5
- o as redactSsoPath
6
- };
7
-
8
- //# sourceMappingURL=RumRedaction.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RumRedaction.es.js","names":[],"sources":["../../src/rum/RumRedaction.ts"],"sourcesContent":["// String scrubbers for Datadog RUM `beforeSend` hooks. RUM records URLs,\n// error messages and clicked-element text verbatim, and in MX apps those carry\n// member-linkable identifiers, balances and — on the firefly host — live SSO\n// tokens. Consumers compose these in their own `beforeSend`. All three are\n// total on `string | undefined` and return their input unchanged when it isn't\n// a string.\n\n// MX GUIDs are a 3-letter uppercase prefix plus a UUID (ACT-…, USR-…, TRN-…).\n// API paths embed them in both the path and the query string\n// (`/accounts/ACT-<uuid>/monthly_account_balances`, `?account_guids[]=ACT-<uuid>`).\n// The prefix is kept so URLs still group by resource kind; only the identifying\n// UUID is dropped. The prefix is optional in the pattern so bare UUIDs\n// (session / correlation ids) are caught too.\nconst GUID_PATTERN =\n /\\b([A-Za-z]{3}-)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\b/g\n\n// Interaction names come from rendered button/link text, which is frequently a\n// balance or transaction amount. Both sign positions are matched (\"$1,234.56\"\n// and fr-CA \"123,45 $\"), the K/M/B abbreviation (\"$1.2K\"), and a leading \"-\",\n// \"−\" (U+2212) or accounting \"(\" with trailing \")\", so a negative renders as\n// \"$[amount]\" rather than \"-$[amount]\". Digit groups may be joined by \",\" or by\n// a space / no-break space / narrow no-break space, which is how\n// Intl.NumberFormat('fr-CA') groups thousands (\"1 234,56 $\"); the lookahead only\n// swallows a space when another digit follows it.\nconst AMOUNT_PATTERN =\n /[-−(]?\\$\\s*\\d(?:[\\d,]|[ \\u00A0\\u202F](?=\\d))*(?:[.,]\\d+)?(?:\\s*[KMB])?\\)?|[-−(]?\\d(?:[\\d,]|[ \\u00A0\\u202F](?=\\d))*(?:[.,]\\d+)?(?:\\s*[KMB])?\\s*\\$\\)?/gi\n\n// Firefly's widget SSO deep-links put a live single-use auth token — and an\n// optional base64 params blob that can carry account/insight GUIDs — directly\n// in the path: /md/<widget>/:single_sign_on_token(/:encoded_params) renders the\n// widget in place, so RUM's first view.url and every later view.referrer would\n// otherwise ship the token verbatim. Neither segment is UUID-shaped, so the GUID\n// pattern cannot catch them; everything after the widget segment is replaced.\n// /login/:single_sign_on_token redirects, but still surfaces as a referrer.\nconst SSO_PATH_PATTERN = /(\\/(?:md\\/[^/?#]+|login)\\/)[^?#]+/g\n\nexport const redactGuids = <T extends string | undefined>(value: T): T =>\n typeof value === 'string'\n ? (value.replace(\n GUID_PATTERN,\n (_match: string, prefix?: string) => `${prefix ?? ''}REDACTED`,\n ) as T)\n : value\n\nexport const redactAmounts = <T extends string | undefined>(value: T): T =>\n typeof value === 'string' ? (value.replace(AMOUNT_PATTERN, '$[amount]') as T) : value\n\nexport const redactSsoPath = <T extends string | undefined>(value: T): T =>\n typeof value === 'string' ? (value.replace(SSO_PATH_PATTERN, '$1REDACTED') as T) : value\n"],"mappings":"AAaA,IAAM,IACJ,mGAUI,IACJ,yJASI,IAAmB,sCAEZ,IAAA,CAA6C,MACxD,OAAO,KAAU,WACZ,EAAM,QACL,GAAA,CACC,GAAgB,MAAoB,GAAG,KAAU,EAAA,UACpD,IACA,GAEO,IAAA,CAA+C,MAC1D,OAAO,KAAU,WAAY,EAAM,QAAQ,GAAgB,WAAW,IAAU,GAErE,IAAA,CAA+C,MAC1D,OAAO,KAAU,WAAY,EAAM,QAAQ,GAAkB,YAAY,IAAU"}
@@ -1,40 +0,0 @@
1
- export interface RumBeforeSendEvent {
2
- type: string;
3
- view?: {
4
- url: string;
5
- referrer?: string;
6
- [key: string]: unknown;
7
- };
8
- resource?: {
9
- type?: string;
10
- url: string;
11
- status_code?: number;
12
- [key: string]: unknown;
13
- };
14
- error?: {
15
- message: string;
16
- stack?: string;
17
- resource?: {
18
- url: string;
19
- [key: string]: unknown;
20
- };
21
- [key: string]: unknown;
22
- };
23
- action?: {
24
- target?: {
25
- name: string;
26
- [key: string]: unknown;
27
- };
28
- [key: string]: unknown;
29
- };
30
- [key: string]: unknown;
31
- }
32
- export interface RumBeforeSendOptions {
33
- /**
34
- * Also scrub firefly's /md/<widget>/:single_sign_on_token deep-link paths and
35
- * /login/:token referrers. Only the firefly host has those routes; a
36
- * core-data-served build should leave this off.
37
- */
38
- scrubSsoPaths?: boolean;
39
- }
40
- export declare function buildRumBeforeSend({ scrubSsoPaths }?: RumBeforeSendOptions): (event: RumBeforeSendEvent) => boolean;
@@ -1,16 +0,0 @@
1
- import { redactAmounts as e, redactGuids as c, redactSsoPath as a } from "./RumRedaction.es.js";
2
- function f({ scrubSsoPaths: i = !1 } = {}) {
3
- const o = (r) => i ? a(c(r)) : c(r);
4
- return (r) => {
5
- if (r.view && (r.view.url = o(r.view.url), r.view.referrer = o(r.view.referrer)), r.resource && (r.resource.url = o(r.resource.url)), r.error && (r.error.message = e(o(r.error.message)), r.error.stack = e(o(r.error.stack)), r.error.resource && (r.error.resource.url = o(r.error.resource.url))), r.action?.target && (r.action.target.name = e(c(r.action.target.name))), r.type !== "resource" || !r.resource) return !0;
6
- const { resource: u } = r;
7
- if (u.type === "xhr" || u.type === "fetch") return !0;
8
- const s = u.status_code;
9
- return !(s !== void 0 && s > 0 && s < 400);
10
- };
11
- }
12
- export {
13
- f as buildRumBeforeSend
14
- };
15
-
16
- //# sourceMappingURL=beforeSend.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beforeSend.es.js","names":[],"sources":["../../src/rum/beforeSend.ts"],"sourcesContent":["import { redactAmounts, redactGuids, redactSsoPath } from './RumRedaction'\n\n// The subset of a Datadog RUM event that beforeSend reads or writes. Structural\n// on purpose: any RumEvent from @datadog/browser-rum satisfies it, and this\n// package takes no dependency on the SDK. Every field written here is on the\n// SDK's beforeSend allowlist (MODIFIABLE_FIELD_PATHS_BY_EVENT in\n// browser-rum-core/domain/assembly) — writes to anything else are silently\n// discarded by the SDK.\n// The index signatures matter: SDK event members carry other fields, and\n// TypeScript's weak-type rule would otherwise reject e.g. RumErrorEvent.action\n// (which has an `id` but no `target`) as sharing no properties with `action`.\nexport interface RumBeforeSendEvent {\n type: string\n view?: { url: string; referrer?: string; [key: string]: unknown }\n resource?: { type?: string; url: string; status_code?: number; [key: string]: unknown }\n error?: {\n message: string\n stack?: string\n resource?: { url: string; [key: string]: unknown }\n [key: string]: unknown\n }\n action?: { target?: { name: string; [key: string]: unknown }; [key: string]: unknown }\n [key: string]: unknown\n}\n\nexport interface RumBeforeSendOptions {\n /**\n * Also scrub firefly's /md/<widget>/:single_sign_on_token deep-link paths and\n * /login/:token referrers. Only the firefly host has those routes; a\n * core-data-served build should leave this off.\n */\n scrubSsoPaths?: boolean\n}\n\n// Builds the beforeSend hook every MX RUM consumer installs: redact\n// member-linkable identifiers and amounts from everything RUM records verbatim,\n// then drop the successful static resources that make up the bulk of the volume\n// while keeping XHR/fetch so client-perceived API latency stays visible.\nexport function buildRumBeforeSend({ scrubSsoPaths = false }: RumBeforeSendOptions = {}) {\n const redactUrl = <T extends string | undefined>(value: T): T =>\n scrubSsoPaths ? redactSsoPath(redactGuids(value)) : redactGuids(value)\n\n return (event: RumBeforeSendEvent): boolean => {\n if (event.view) {\n event.view.url = redactUrl(event.view.url)\n event.view.referrer = redactUrl(event.view.referrer)\n }\n if (event.resource) {\n event.resource.url = redactUrl(event.resource.url)\n }\n if (event.error) {\n event.error.message = redactAmounts(redactUrl(event.error.message))\n event.error.stack = redactAmounts(redactUrl(event.error.stack))\n if (event.error.resource) event.error.resource.url = redactUrl(event.error.resource.url)\n }\n if (event.action?.target) {\n event.action.target.name = redactAmounts(redactGuids(event.action.target.name))\n }\n\n if (event.type !== 'resource' || !event.resource) return true\n const { resource } = event\n if (resource.type === 'xhr' || resource.type === 'fetch') return true\n const status = resource.status_code\n if (status !== undefined && status > 0 && status < 400) return false\n return true\n }\n}\n"],"mappings":";AAsCA,SAAgB,EAAmB,EAAE,eAAA,IAAgB,GAAA,IAAgC,CAAC,GAAG;AACvF,QAAM,IAAA,CAA2C,MAC/C,IAAgB,EAAc,EAAY,CAAK,CAAC,IAAI,EAAY,CAAK;AAEvE,SAAA,CAAQ,MAAuC;AAiB7C,QAhBI,EAAM,SACR,EAAM,KAAK,MAAM,EAAU,EAAM,KAAK,GAAG,GACzC,EAAM,KAAK,WAAW,EAAU,EAAM,KAAK,QAAQ,IAEjD,EAAM,aACR,EAAM,SAAS,MAAM,EAAU,EAAM,SAAS,GAAG,IAE/C,EAAM,UACR,EAAM,MAAM,UAAU,EAAc,EAAU,EAAM,MAAM,OAAO,CAAC,GAClE,EAAM,MAAM,QAAQ,EAAc,EAAU,EAAM,MAAM,KAAK,CAAC,GAC1D,EAAM,MAAM,aAAU,EAAM,MAAM,SAAS,MAAM,EAAU,EAAM,MAAM,SAAS,GAAG,KAErF,EAAM,QAAQ,WAChB,EAAM,OAAO,OAAO,OAAO,EAAc,EAAY,EAAM,OAAO,OAAO,IAAI,CAAC,IAG5E,EAAM,SAAS,cAAc,CAAC,EAAM,SAAU,QAAO;AACzD,UAAM,EAAE,UAAA,EAAA,IAAa;AACrB,QAAI,EAAS,SAAS,SAAS,EAAS,SAAS,QAAS,QAAO;AACjE,UAAM,IAAS,EAAS;AACxB,WAAI,EAAA,MAAW,UAAa,IAAS,KAAK,IAAS;AAAA,EAErD;AACF"}
@@ -1,9 +0,0 @@
1
- export interface RumErrorBuffer<Context = Record<string, unknown>> {
2
- /** Queue an error. Returns false (and drops it) once the buffer is full. */
3
- push(error: unknown, context?: Context): boolean;
4
- /** Drain in arrival order into `send`, typically `datadogRum.addError`. */
5
- flush(send: (error: unknown, context?: Context) => void): void;
6
- readonly size: number;
7
- }
8
- export declare const DEFAULT_RUM_ERROR_BUFFER_SIZE = 50;
9
- export declare function createRumErrorBuffer<Context = Record<string, unknown>>(maxSize?: number): RumErrorBuffer<Context>;
@@ -1,27 +0,0 @@
1
- var u = 50;
2
- function s(n = 50) {
3
- const e = [];
4
- return {
5
- push(t, r) {
6
- return e.length >= n ? !1 : (e.push({
7
- error: t,
8
- context: r
9
- }), !0);
10
- },
11
- flush(t) {
12
- for (; e.length > 0; ) {
13
- const r = e.shift();
14
- r && t(r.error, r.context);
15
- }
16
- },
17
- get size() {
18
- return e.length;
19
- }
20
- };
21
- }
22
- export {
23
- u as DEFAULT_RUM_ERROR_BUFFER_SIZE,
24
- s as createRumErrorBuffer
25
- };
26
-
27
- //# sourceMappingURL=errorBuffer.es.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorBuffer.es.js","names":[],"sources":["../../src/rum/errorBuffer.ts"],"sourcesContent":["// Errors reported before Datadog RUM has initialized have nowhere to go, so\n// consumers buffer them and flush once `datadogRum.init()` has run. Capped so a\n// configless environment — where RUM never initializes — cannot grow the buffer\n// without bound. The buffer knows nothing about the SDK: the consumer supplies\n// the sink at flush time, so this package takes no dependency on\n// @datadog/browser-rum.\n\nexport interface RumErrorBuffer<Context = Record<string, unknown>> {\n /** Queue an error. Returns false (and drops it) once the buffer is full. */\n push(error: unknown, context?: Context): boolean\n /** Drain in arrival order into `send`, typically `datadogRum.addError`. */\n flush(send: (error: unknown, context?: Context) => void): void\n readonly size: number\n}\n\nexport const DEFAULT_RUM_ERROR_BUFFER_SIZE = 50\n\nexport function createRumErrorBuffer<Context = Record<string, unknown>>(\n maxSize: number = DEFAULT_RUM_ERROR_BUFFER_SIZE,\n): RumErrorBuffer<Context> {\n const items: Array<{ error: unknown; context?: Context }> = []\n return {\n push(error, context) {\n if (items.length >= maxSize) return false\n items.push({ error, context })\n return true\n },\n flush(send) {\n while (items.length > 0) {\n const item = items.shift()\n if (item) send(item.error, item.context)\n }\n },\n get size() {\n return items.length\n },\n }\n}\n"],"mappings":"AAeA,IAAa,IAAgC;AAE7C,SAAgB,EACd,IAAA,IACyB;AACzB,QAAM,IAAsD,CAAC;AAC7D,SAAO;AAAA,IACL,KAAK,GAAO,GAAS;AACnB,aAAI,EAAM,UAAU,IAAgB,MACpC,EAAM,KAAK;AAAA,QAAE,OAAA;AAAA,QAAO,SAAA;AAAA,MAAQ,CAAC,GACtB;AAAA,IACT;AAAA,IACA,MAAM,GAAM;AACV,aAAO,EAAM,SAAS,KAAG;AACvB,cAAM,IAAO,EAAM,MAAM;AACzB,QAAI,KAAM,EAAK,EAAK,OAAO,EAAK,OAAO;AAAA,MACzC;AAAA,IACF;AAAA,IACA,IAAI,OAAO;AACT,aAAO,EAAM;AAAA,IACf;AAAA,EACF;AACF"}
@@ -1,3 +0,0 @@
1
- export { redactAmounts, redactGuids, redactSsoPath } from './RumRedaction';
2
- export { buildRumBeforeSend, type RumBeforeSendEvent, type RumBeforeSendOptions, } from './beforeSend';
3
- export { createRumErrorBuffer, DEFAULT_RUM_ERROR_BUFFER_SIZE, type RumErrorBuffer, } from './errorBuffer';
@@ -1,11 +0,0 @@
1
- import { redactAmounts as o, redactGuids as e, redactSsoPath as t } from "./RumRedaction.es.js";
2
- import { buildRumBeforeSend as R } from "./beforeSend.es.js";
3
- import { DEFAULT_RUM_ERROR_BUFFER_SIZE as f, createRumErrorBuffer as u } from "./errorBuffer.es.js";
4
- export {
5
- f as DEFAULT_RUM_ERROR_BUFFER_SIZE,
6
- R as buildRumBeforeSend,
7
- u as createRumErrorBuffer,
8
- o as redactAmounts,
9
- e as redactGuids,
10
- t as redactSsoPath
11
- };